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) {
344344 }
345345 if (baseClassName != null ) {
346346 if (!cn .getSuperClass ().getName ().equals (baseClassName )) {
347+ /* GRECLIPSE edit -- GROOVY-8096
347348 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
348357 AnnotationNode annotationNode = new AnnotationNode (BaseScriptASTTransformation .MY_TYPE );
349358 cn .addAnnotation (annotationNode );
350359 }
Original file line number Diff line number Diff line change @@ -350,7 +350,16 @@ private void setScriptBaseClassFromConfig(final ClassNode cn) {
350350 }
351351 if (baseClassName != null ) {
352352 if (!cn .getSuperClass ().getName ().equals (baseClassName )) {
353+ /* GRECLIPSE edit -- GROOVY-8096
353354 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
354363 AnnotationNode annotationNode = new AnnotationNode (BaseScriptASTTransformation .MY_TYPE );
355364 cn .addAnnotation (annotationNode );
356365 }
Original file line number Diff line number Diff line change @@ -349,7 +349,16 @@ private void setScriptBaseClassFromConfig(final ClassNode cn) {
349349 }
350350 if (baseClassName != null ) {
351351 if (!cn .getSuperClass ().getName ().equals (baseClassName )) {
352+ /* GRECLIPSE edit -- GROOVY-8096
352353 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
353362 AnnotationNode annotationNode = new AnnotationNode (BaseScriptASTTransformation .MY_TYPE );
354363 cn .addAnnotation (annotationNode );
355364 }
Original file line number Diff line number Diff line change @@ -250,7 +250,7 @@ public static CompilerConfiguration newCompilerConfiguration(final CompilerOptio
250250 ic .addStarImports ("org.codehaus.groovy.ast.expr" );
251251 if (GroovyUtils .getGroovyVersion ().compareTo (new Version (4 , 0 , 6 )) >= 0 ) ic .addStarImports ("org.codehaus.groovy.ast" );
252252 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" );
254254
255255 return config ;
256256 }
You can’t perform that action at this time.
0 commit comments