1
votes

Javassist gives me this error:

Caused by: javassist.compiler.SyntaxError: syntax error near "oolean do() {
  Obje"
        at javassist.compiler.Parser.parseMember1(Parser.java:55) ~[?:?]
        at javassist.compiler.Javac.compile(Javac.java:90) ~[?:?]
        at javassist.CtNewMethod.make(CtNewMethod.java:74) ~[?:?]
        at javassist.CtNewMethod.make(CtNewMethod.java:45) ~[?:?]
        at javassist.CtMethod.make(CtMethod.java:132) ~[?:?]

when it tries to compile this part of a generated class:

public boolean do() {
  ObjectContainer[] $cArgs = ObjectContainer.fromObjects(ArrayMaker.fromParameters());
  SuperSwitch $switch = SuperSwitch.newInstance();
  boolean $returned = (boolean) this.methodCalled_boolean("boolean do()", $switch, $cArgs);
  Object[] $mArgs = ObjectContainer.toObjects($cArgs);
  if($switch.callSuper()) {
    if($switch.isReplace()) {
      return (boolean) $returned;    } else {
      return (boolean) super.do();
    }
  } else {
    return (boolean) false;
  }
}

From what I can see, there isn't anything wrong with the method syntax, and other similar boolean methods in the same class compile just fine.

1

1 Answers

2
votes

do is a keyword and is not a valid method identifier, so there is a syntax error.

See https://docs.oracle.com/javase/tutorial/java/nutsandbolts/while.html