File tree Expand file tree Collapse file tree 4 files changed +28
-1
lines changed
org.codehaus.groovy30/src/org/codehaus/groovy/ast
org.codehaus.groovy40/src/org/codehaus/groovy/ast
org.codehaus.groovy50/src/org/codehaus/groovy/ast
org.eclipse.jdt.groovy.core/src/org/codehaus/jdt/groovy/integration/internal Expand file tree Collapse file tree 4 files changed +28
-1
lines changed Original file line number Diff line number Diff line change @@ -344,7 +344,16 @@ private void setScriptBaseClassFromConfig(final ClassNode cn) {
344
344
}
345
345
if (baseClassName != null ) {
346
346
if (!cn .getSuperClass ().getName ().equals (baseClassName )) {
347
+ /* GRECLIPSE edit -- GROOVY-8096
347
348
cn.setSuperClass(ClassHelper.make(baseClassName));
349
+ */
350
+ ClassLoader cl = unit != null ? unit .getClassLoader () : context .getClassLoader ();
351
+ try {
352
+ cn .setSuperClass (ClassHelper .make (cl .loadClass (baseClassName )));
353
+ } catch (ReflectiveOperationException | RuntimeException e ) {
354
+ cn .setSuperClass (ClassHelper .make (baseClassName ));
355
+ }
356
+ // GRECLIPSE end
348
357
AnnotationNode annotationNode = new AnnotationNode (BaseScriptASTTransformation .MY_TYPE );
349
358
cn .addAnnotation (annotationNode );
350
359
}
Original file line number Diff line number Diff line change @@ -350,7 +350,16 @@ private void setScriptBaseClassFromConfig(final ClassNode cn) {
350
350
}
351
351
if (baseClassName != null ) {
352
352
if (!cn .getSuperClass ().getName ().equals (baseClassName )) {
353
+ /* GRECLIPSE edit -- GROOVY-8096
353
354
cn.setSuperClass(ClassHelper.make(baseClassName));
355
+ */
356
+ ClassLoader cl = unit != null ? unit .getClassLoader () : context .getClassLoader ();
357
+ try {
358
+ cn .setSuperClass (ClassHelper .make (cl .loadClass (baseClassName )));
359
+ } catch (ReflectiveOperationException | RuntimeException e ) {
360
+ cn .setSuperClass (ClassHelper .make (baseClassName ));
361
+ }
362
+ // GRECLIPSE end
354
363
AnnotationNode annotationNode = new AnnotationNode (BaseScriptASTTransformation .MY_TYPE );
355
364
cn .addAnnotation (annotationNode );
356
365
}
Original file line number Diff line number Diff line change @@ -349,7 +349,16 @@ private void setScriptBaseClassFromConfig(final ClassNode cn) {
349
349
}
350
350
if (baseClassName != null ) {
351
351
if (!cn .getSuperClass ().getName ().equals (baseClassName )) {
352
+ /* GRECLIPSE edit -- GROOVY-8096
352
353
cn.setSuperClass(ClassHelper.make(baseClassName));
354
+ */
355
+ ClassLoader cl = unit != null ? unit .getClassLoader () : context .getClassLoader ();
356
+ try {
357
+ cn .setSuperClass (ClassHelper .make (cl .loadClass (baseClassName )));
358
+ } catch (ReflectiveOperationException | RuntimeException e ) {
359
+ cn .setSuperClass (ClassHelper .make (baseClassName ));
360
+ }
361
+ // GRECLIPSE end
353
362
AnnotationNode annotationNode = new AnnotationNode (BaseScriptASTTransformation .MY_TYPE );
354
363
cn .addAnnotation (annotationNode );
355
364
}
Original file line number Diff line number Diff line change @@ -250,7 +250,7 @@ public static CompilerConfiguration newCompilerConfiguration(final CompilerOptio
250
250
ic .addStarImports ("org.codehaus.groovy.ast.expr" );
251
251
if (GroovyUtils .getGroovyVersion ().compareTo (new Version (4 , 0 , 6 )) >= 0 ) ic .addStarImports ("org.codehaus.groovy.ast" );
252
252
ic .addStaticStars ("org.codehaus.groovy.ast.ClassHelper" ,"org.codehaus.groovy.transform.stc.StaticTypeCheckingSupport" );
253
- config .addCompilationCustomizers (ic ).setScriptBaseClass ("org.codehaus.groovy.transform.stc.GroovyTypeCheckingExtensionSupport. TypeCheckingDSL" );
253
+ config .addCompilationCustomizers (ic ).setScriptBaseClass ("org.codehaus.groovy.transform.stc.GroovyTypeCheckingExtensionSupport$ TypeCheckingDSL" );
254
254
255
255
return config ;
256
256
}
You can’t perform that action at this time.
0 commit comments