All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.adoptopenjdk.jitwatch.model.bytecode.LineTableEntry Maven / Gradle / Ivy

Go to download

A Maven plugin that scans the project artifact and its dependencies for methods that cannot be inlined by the JIT compiler. It uses the JarScan utility from the JITWatch project to do that. See https://github.com/AdoptOpenJDK/jitwatch .

There is a newer version: 1.1
Show newest version
/*
 * Copyright (c) 2013, 2014 Chris Newland.
 * Licensed under https://github.com/AdoptOpenJDK/jitwatch/blob/master/LICENSE-BSD
 * Instructions: https://github.com/AdoptOpenJDK/jitwatch/wiki
 */
package org.adoptopenjdk.jitwatch.model.bytecode;

import static org.adoptopenjdk.jitwatch.core.JITWatchConstants.C_COLON;
import static org.adoptopenjdk.jitwatch.core.JITWatchConstants.C_SPACE;

public class LineTableEntry
{
	private int sourceOffset;
	private int bytecodeOffset;

	public LineTableEntry(int sourceOffset, int bytecodeOffset)
	{
		this.sourceOffset = sourceOffset;
		this.bytecodeOffset = bytecodeOffset;
	}

	public int getSourceOffset()
	{
		return sourceOffset;
	}

	public int getBytecodeOffset()
	{
		return bytecodeOffset;
	}

	@Override
	public String toString()
	{
		StringBuilder builder = new StringBuilder();

		builder.append(sourceOffset).append(C_SPACE).append(C_COLON).append(C_SPACE);
		builder.append(bytecodeOffset);

		return builder.toString();
	}

	@Override
	public int hashCode()
	{
		final int prime = 31;
		int result = 1;
		result = prime * result + bytecodeOffset;
		result = prime * result + sourceOffset;
		return result;
	}

	@Override
	public boolean equals(Object obj)
	{
		if (this == obj)
		{
			return true;
		}

		if (obj == null)
		{
			return false;
		}

		if (getClass() != obj.getClass())
		{
			return false;
		}

		LineTableEntry other = (LineTableEntry) obj;

		if (bytecodeOffset != other.bytecodeOffset)
		{
			return false;
		}

		if (sourceOffset != other.sourceOffset)
		{
			return false;
		}

		return true;
	}

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy