Skip to content
Permalink
Browse files
minor refactor: remove style warnings
  • Loading branch information
paulk-asert committed Apr 18, 2022
1 parent c38a78c commit 56a4ee15558311ce7be6c7d37732c151eb6906db
Showing 3 changed files with 9 additions and 5 deletions.
@@ -312,8 +312,8 @@ public void visitIntInsn(int opcode, int operand) {
}

@Override
public void visitVarInsn(int opcode, int var) {
super.visitVarInsn(opcode, var);
public void visitVarInsn(int opcode, int varIndex) {
super.visitVarInsn(opcode, varIndex);
log();
}

@@ -330,6 +330,7 @@ public void visitFieldInsn(int opcode, String owner, String name, String desc) {
}

@Override
@Deprecated
public void visitMethodInsn(int opcode, String owner, String name, String desc) {
super.visitMethodInsn(opcode, owner, name, desc);
log();
@@ -366,8 +367,8 @@ public void visitLdcInsn(Object cst) {
}

@Override
public void visitIincInsn(int var, int increment) {
super.visitIincInsn(var, increment);
public void visitIincInsn(int varIndex, int increment) {
super.visitIincInsn(varIndex, increment);
log();
}

@@ -512,7 +512,7 @@ private void handleOptimizationOption(String key, String val) {
public CompilerConfiguration(final CompilerConfiguration configuration) {
setWarningLevel(configuration.getWarningLevel());
setTargetDirectory(configuration.getTargetDirectory());
setClasspathList(new LinkedList<String>(configuration.getClasspath()));
setClasspathList(new LinkedList<>(configuration.getClasspath()));
setVerbose(configuration.getVerbose());
setDebug(configuration.getDebug());
setParameters(configuration.getParameters());
@@ -40,6 +40,8 @@
import static org.codehaus.groovy.ast.tools.GeneralUtils.listX;

public class MacroLibGroovyMethods {
private MacroLibGroovyMethods() {}

private static final ClassNode NAMED_VALUE = ClassHelper.make(NamedValue.class);

@Macro
@@ -98,6 +100,7 @@ public static Expression NVL(MacroContext ctx, final Expression... exps) {
return listX(Arrays.stream(exps).map(exp -> namedValueExpr(exp)).collect(Collectors.toList()));
}

@SuppressWarnings("unchecked")
public static <T> List<NamedValue<T>> NVL(Object self, T... args) {
throw new IllegalStateException("MacroLibGroovyMethods.NVL(Object...) should never be called at runtime. Are you sure you are using it correctly?");
}

0 comments on commit 56a4ee1

Please sign in to comment.