Commit 26e2d89c authored by Lukáš Marek's avatar Lukáš Marek

Small renaming

parent fd70b486
......@@ -25,7 +25,7 @@ import ch.usi.dag.disl.classparser.ClassParser;
import ch.usi.dag.disl.exception.DiSLException;
import ch.usi.dag.disl.exception.DiSLIOException;
import ch.usi.dag.disl.exception.DiSLInMethodException;
import ch.usi.dag.disl.exception.DynamicInfoException;
import ch.usi.dag.disl.exception.DynamicContextException;
import ch.usi.dag.disl.exception.InitException;
import ch.usi.dag.disl.exception.ManifestInfoException;
import ch.usi.dag.disl.exception.MarkerException;
......@@ -207,7 +207,7 @@ public class DiSL {
*/
private boolean instrumentMethod(ClassNode classNode, MethodNode methodNode)
throws ReflectionException, StaticContextGenException,
ProcessorException, DynamicInfoException, MarkerException {
ProcessorException, DynamicContextException, MarkerException {
// skip abstract methods
if ((methodNode.access & Opcodes.ACC_ABSTRACT) != 0) {
......
package ch.usi.dag.disl.exception;
public class DynamicInfoException extends DiSLException {
public class DynamicContextException extends DiSLException {
private static final long serialVersionUID = -4897273691513425444L;
public DynamicInfoException() {
public DynamicContextException() {
super();
}
public DynamicInfoException(String message, Throwable cause) {
public DynamicContextException(String message, Throwable cause) {
super(message, cause);
}
public DynamicInfoException(String message) {
public DynamicContextException(String message) {
super(message);
}
public DynamicInfoException(Throwable cause) {
public DynamicContextException(Throwable cause) {
super(cause);
}
......
......@@ -15,7 +15,7 @@ import ch.usi.dag.disl.guardcontext.GuardContext;
import ch.usi.dag.disl.processorcontext.ArgumentContext;
import ch.usi.dag.disl.resolver.GuardMethod;
import ch.usi.dag.disl.resolver.GuardResolver;
import ch.usi.dag.disl.resolver.StConResolver;
import ch.usi.dag.disl.resolver.SCResolver;
import ch.usi.dag.disl.snippet.Shadow;
import ch.usi.dag.disl.staticcontext.StaticContext;
import ch.usi.dag.disl.util.ReflectionHelper;
......@@ -237,7 +237,7 @@ public abstract class GuardHelper {
try {
// get static context
StaticContext scInst = StConResolver.getInstance()
StaticContext scInst = SCResolver.getInstance()
.getStaticContextInstance(argType);
// populate with data
......
......@@ -8,12 +8,12 @@ import ch.usi.dag.disl.staticcontext.StaticContext;
import ch.usi.dag.disl.util.ReflectionHelper;
public class StConResolver {
public class SCResolver {
// NOTE: This is internal DiSL cache. For user static context cache see
// ch.usi.dag.disl.staticcontext.cache.StaticContextCache
private static StConResolver instance = null;
private static SCResolver instance = null;
// list of static context instances
// validity of an instance is for whole instrumentation run
......@@ -40,10 +40,10 @@ public class StConResolver {
return (StaticContext) scInst;
}
public static synchronized StConResolver getInstance() {
public static synchronized SCResolver getInstance() {
if (instance == null) {
instance = new StConResolver();
instance = new SCResolver();
}
return instance;
}
......
......@@ -10,7 +10,7 @@ import ch.usi.dag.disl.coderep.StaticContextMethod;
import ch.usi.dag.disl.exception.ReflectionException;
import ch.usi.dag.disl.exception.StaticContextGenException;
import ch.usi.dag.disl.processor.ProcMethod;
import ch.usi.dag.disl.resolver.StConResolver;
import ch.usi.dag.disl.resolver.SCResolver;
import ch.usi.dag.disl.snippet.ProcInvocation;
import ch.usi.dag.disl.snippet.Shadow;
import ch.usi.dag.disl.snippet.Snippet;
......@@ -153,7 +153,7 @@ public class SCGenerator {
for (StaticContextMethod stConMth : stConMethods) {
// get static context instance
StaticContext scInst = StConResolver.getInstance()
StaticContext scInst = SCResolver.getInstance()
.getStaticContextInstance(
stConMth.getReferencedClass());
......
......@@ -22,7 +22,7 @@ import ch.usi.dag.disl.annotation.AfterReturning;
import ch.usi.dag.disl.annotation.AfterThrowing;
import ch.usi.dag.disl.annotation.Before;
import ch.usi.dag.disl.annotation.SyntheticLocal.Initialize;
import ch.usi.dag.disl.exception.DynamicInfoException;
import ch.usi.dag.disl.exception.DynamicContextException;
import ch.usi.dag.disl.localvar.SyntheticLocalVar;
import ch.usi.dag.disl.processor.generator.PIResolver;
import ch.usi.dag.disl.snippet.Shadow;
......@@ -214,7 +214,7 @@ public class Weaver {
private static void insert(MethodNode methodNode,
SCGenerator staticInfoHolder, PIResolver piResolver,
WeavingInfo info, Snippet snippet, SnippetCode code, Shadow shadow,
AbstractInsnNode loc) throws DynamicInfoException {
AbstractInsnNode loc) throws DynamicContextException {
// exception handler will discard the stack and push the
// exception object. Thus, before entering this snippet,
......@@ -244,7 +244,7 @@ public class Weaver {
Map<Snippet, List<Shadow>> snippetMarkings,
List<SyntheticLocalVar> syntheticLocalVars,
SCGenerator staticInfoHolder, PIResolver piResolver)
throws DynamicInfoException {
throws DynamicContextException {
WeavingInfo info = new WeavingInfo(classNode, methodNode,
snippetMarkings);
......
......@@ -24,7 +24,7 @@ import ch.usi.dag.disl.classcontext.ClassContext;
import ch.usi.dag.disl.coderep.Code;
import ch.usi.dag.disl.dynamiccontext.DynamicContext;
import ch.usi.dag.disl.exception.DiSLFatalException;
import ch.usi.dag.disl.exception.DynamicInfoException;
import ch.usi.dag.disl.exception.DynamicContextException;
import ch.usi.dag.disl.processor.generator.PIResolver;
import ch.usi.dag.disl.processor.generator.ProcInstance;
import ch.usi.dag.disl.processor.generator.ProcMethodInstance;
......@@ -142,7 +142,7 @@ public class WeavingCode {
}
}
private void preFixDynamicInfoCheck() throws DynamicInfoException {
private void preFixDynamicInfoCheck() throws DynamicContextException {
for (AbstractInsnNode instr : iList.toArray()) {
......@@ -180,7 +180,7 @@ public class WeavingCode {
break;
default:
throw new DynamicInfoException("In snippet "
throw new DynamicContextException("In snippet "
+ snippet.getOriginClassName() + "."
+ snippet.getOriginMethodName()
+ " - pass the first (pos)"
......@@ -190,7 +190,7 @@ public class WeavingCode {
// second operand test
if (AsmHelper.getClassType(secondOperand) == null) {
throw new DynamicInfoException("In snippet "
throw new DynamicContextException("In snippet "
+ snippet.getOriginClassName() + "."
+ snippet.getOriginMethodName()
+ " - pass the second (type)"
......@@ -219,7 +219,7 @@ public class WeavingCode {
// NOTE that if the user requests for the stack value, some store
// instructions will be inserted to the target method, and new local slot
// will be used for storing this.
public void fixDynamicInfo(boolean throwing) throws DynamicInfoException {
public void fixDynamicInfo(boolean throwing) throws DynamicContextException {
preFixDynamicInfoCheck();
......@@ -300,7 +300,7 @@ public class WeavingCode {
// index should be less than the stack height
if (operand >= basicframe.getStackSize() || operand < 0) {
throw new DynamicInfoException(
throw new DynamicContextException(
"Dynamic context wrong access." +
" Access out of bounds. Accessed " + operand +
", but the size of stack is "
......@@ -312,7 +312,7 @@ public class WeavingCode {
operand).getType();
if (t.getSort() != targetType.getSort()) {
throw new DynamicInfoException(
throw new DynamicContextException(
"Dynamic context wrong access. Requested \"" +
t + "\" but found \"" + targetType
+ "\" on the stack.");
......@@ -346,7 +346,7 @@ public class WeavingCode {
// index should be less than the size of local variables
if (slot >= basicframe.getLocals() || slot < 0) {
throw new DynamicInfoException(
throw new DynamicContextException(
"Dynamic context wrong access." +
" Access out of bounds. Accessed " + slot +
", but the size of stack is "
......@@ -357,7 +357,7 @@ public class WeavingCode {
Type targetType = basicframe.getLocal(slot).getType();
if (t.getSort() != targetType.getSort()) {
throw new DynamicInfoException(
throw new DynamicContextException(
"Dynamic context wrong access. Requested \"" +
t + "\" but found \"" + targetType
+ "\" on the stack.");
......@@ -379,7 +379,7 @@ public class WeavingCode {
// index should be less than the size of local variables
if (operand >= basicframe.getLocals() || operand < 0) {
throw new DynamicInfoException(
throw new DynamicContextException(
"Dynamic context wrong access." +
" Access out of bounds. Accessed " + operand +
", but the size of stack is "
......@@ -390,7 +390,7 @@ public class WeavingCode {
Type targetType = basicframe.getLocal(operand).getType();
if (t.getSort() != targetType.getSort()) {
throw new DynamicInfoException(
throw new DynamicContextException(
"Dynamic context wrong access. Requested \"" +
t + "\" but found \"" + targetType
+ "\" on the stack.");
......@@ -824,7 +824,7 @@ public class WeavingCode {
}
public void transform(SCGenerator staticInfoHolder, PIResolver piResolver, boolean throwing)
throws DynamicInfoException {
throws DynamicContextException {
fixProcessor(piResolver);
fixProcessorInfo();
fixStaticInfo(staticInfoHolder);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment