org.adoptopenjdk.jitwatch.model.AnnotationException Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of jitwatch-jarscan-maven-plugin Show documentation
Show all versions of jitwatch-jarscan-maven-plugin Show documentation
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 .
The newest version!
/*
* Copyright (c) 2013-2015 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;
import org.adoptopenjdk.jitwatch.model.bytecode.BytecodeInstruction;
import static org.adoptopenjdk.jitwatch.core.JITWatchConstants.C_SPACE;
public class AnnotationException extends Exception
{
private static final long serialVersionUID = 1L;
private int bytecodeOffset;
private BytecodeInstruction instruction;
public AnnotationException(String msg, int offset, BytecodeInstruction instruction)
{
super(msg);
this.bytecodeOffset = offset;
this.instruction = instruction;
}
public int getBytecodeOffset()
{
return bytecodeOffset;
}
public BytecodeInstruction getInstruction()
{
return instruction;
}
@Override
public String getMessage()
{
StringBuilder builder = new StringBuilder();
builder.append(super.getMessage());
builder.append(" at offset: ").append(bytecodeOffset).append(C_SPACE);
builder.append("but was mnemonic: ");
if (instruction != null && instruction.getOpcode() != null)
{
builder.append(instruction.getOpcode().getMnemonic());
}
else
{
builder.append("Unknown");
}
return builder.toString();
}
}