Add CodeWriter.getClassConstant() to abstract the difference between A.class in Java and classOf[A] in Scala.
…A.class in Java and classOf[A] in Scala. To be used in querydsl-codegen shortly.
Fix Scala constructor to output "def this(...)" instead of "public <CLASSNAME>(...)"
Fix regression: wrong method chosen as evaluator
Some Java instrumentation tools (e.g. JaCoCo) insert code into classes at runtime. This means that the static eval() method *could* not be the first method of our runtime generated classes anymore. Fix this by explicitly looking for the eval() method.
Fix codegen when using SureFire Booter combined with JaCoCo
When using codegen with SureFire Booter + JaCoCo, codegen was unable to determine the correct classpath, as its check for SureFire Booter was too strict (both the surefirebooter and jacoco jars were on the cp, while the code was only expecting surefirebooter). Fix this in a more generic way by checking all classloader URLs for surefirebooter.
Fix AbstractEvaluatorFactory.toId() not taking into account constants' types
…' types AbstractEvaluatorFactory ignored the types of constants when generating a classname. As these generated classes get cached, this could result in stack traces like these: java.lang.IllegalArgumentException: Can not set com.mysema.codegen.ComplexEvaluationTest$SuperCat field Q_0606084786_65821278_65821278.a1 to com.mysema.codegen.support.Cat at sun.reflect.UnsafeFieldAccessorImpl.throwSetIllegalArgumentException(UnsafeFieldAccessorImpl.java:164) at sun.reflect.UnsafeFieldAccessorImpl.throwSetIllegalArgumentException(UnsafeFieldAccessorImpl.java:168) at sun.reflect.UnsafeObjectFieldAccessorImpl.set(UnsafeObjectFieldAccessorImpl.java:81) at java.lang.reflect.Field.set(Field.java:680) at com.mysema.codegen.AbstractEvaluatorFactory.createEvaluator(AbstractEvaluatorFactory.java:86)
Normalize dynamically created classes by CGLIB to their canonical form
This fixes following issue (occuring in QueryDSL): Q_2045977532_1275614662_1275614662.java:3: error: cannot find symbol public example.ExampleClass$$EnhancerByMockitoWithCGLIB$$45c738ca a1; ^ symbol: class ExampleClass$$EnhancerByMockitoWithCGLIB$$45c738ca location: package example As this class is dynamically generated, it can't be found at compile-time. Because it basically is a proxy for the underlying object, use its super class as normalized form, which solves the compile error.