Brooklyn fails to compile with GroovyEclipseBug, for private static method SshjTool.getMandatoryVal #50

Closed
aledsage opened this Issue May 2, 2012 · 5 comments

Comments

Projects
None yet
2 participants
Owner

aledsage commented May 2, 2012

Brooklyn fails to compile in Eclipse with the GroovyEclipseBug shown below.

This is with org.codehause.groovy.eclipse version 2.6.0, in Eclipse Indigo Service Release 2.

The method:
private static T getMandatoryVal(Map<String,?> map, String key, Class clazz)
is delcared in SshjTool.

The class reporting the compile error is EffectorSayHiTest.groovy, at line 0.

General error during class generation: Cannot find type variable on method declaring element private static T getMandatoryVal(Map<java.lang.String,?>, java.lang.String, Class)

org.codehaus.jdt.groovy.internal.compiler.ast.GroovyEclipseBug: Cannot find type variable on method declaring element private static T getMandatoryVal(Map<java.lang.String,?>, java.lang.String, Class)
   at org.codehaus.jdt.groovy.internal.compiler.ast.JDTResolver.createClassNode(JDTResolver.java:531)
   at org.codehaus.jdt.groovy.internal.compiler.ast.JDTResolver.createJDTClassNode(JDTResolver.java:448)
   at org.codehaus.jdt.groovy.internal.compiler.ast.JDTResolver.convertToClassNode(JDTResolver.java:436)
   at org.codehaus.jdt.groovy.internal.compiler.ast.JDTClassNode.methodBindingToMethodNode(JDTClassNode.java:336)
   at org.codehaus.jdt.groovy.internal.compiler.ast.JDTClassNode.initializeMembers(JDTClassNode.java:298)
   at org.codehaus.jdt.groovy.internal.compiler.ast.JDTClassNode.initialize(JDTClassNode.java:231)
   at org.codehaus.jdt.groovy.internal.compiler.ast.JDTClassNode.lazyClassInit(JDTClassNode.java:155)
   at org.codehaus.groovy.ast.ClassNode.getInterfaces(ClassNode.java:444)
   at org.codehaus.groovy.ast.ClassNode.declaresInterface(ClassNode.java:1051)
   at org.codehaus.groovy.ast.ClassNode.implementsInterface(ClassNode.java:1031)
   at org.codehaus.groovy.ast.ClassNode.isDerivedFromGroovyObject(ClassNode.java:1021)
   at org.codehaus.groovy.classgen.AsmClassGenerator.loadWrapper(AsmClassGenerator.java:1509)
   at org.codehaus.groovy.classgen.asm.CallSiteWriter.makeCallSite(CallSiteWriter.java:303)
   at org.codehaus.groovy.classgen.asm.InvocationWriter.makeCall(InvocationWriter.java:187)
   at org.codehaus.groovy.classgen.asm.InvocationWriter.makeCall(InvocationWriter.java:89)
   at org.codehaus.groovy.classgen.asm.InvocationWriter.makeInvokeMethodCall(InvocationWriter.java:73)
   at org.codehaus.groovy.classgen.asm.InvocationWriter.writeInvokeMethod(InvocationWriter.java:292)
   at org.codehaus.groovy.classgen.AsmClassGenerator.visitMethodCallExpression(AsmClassGenerator.java:657)
   at org.codehaus.groovy.ast.expr.MethodCallExpression.visit(MethodCallExpression.java:75)
   at org.codehaus.groovy.classgen.asm.StatementWriter.writeReturn(StatementWriter.java:579)
   at org.codehaus.groovy.classgen.asm.OptimizingStatementWriter.writeReturn(OptimizingStatementWriter.java:316)
   at org.codehaus.groovy.classgen.AsmClassGenerator.visitReturnStatement(AsmClassGenerator.java:499)
   at org.codehaus.groovy.ast.stmt.ReturnStatement.visit(ReturnStatement.java:47)
   at org.codehaus.groovy.ast.ClassCodeVisitorSupport.visitClassCodeContainer(ClassCodeVisitorSupport.java:102)
   at org.codehaus.groovy.ast.ClassCodeVisitorSupport.visitConstructorOrMethod(ClassCodeVisitorSupport.java:113)
   at org.codehaus.groovy.classgen.AsmClassGenerator.visitStdMethod(AsmClassGenerator.java:313)
   at org.codehaus.groovy.classgen.AsmClassGenerator.visitConstructorOrMethod(AsmClassGenerator.java:270)
   at org.codehaus.groovy.ast.ClassCodeVisitorSupport.visitMethod(ClassCodeVisitorSupport.java:124)
   at org.codehaus.groovy.classgen.AsmClassGenerator.visitMethod(AsmClassGenerator.java:390)
   at org.codehaus.groovy.ast.ClassNode.visitContents(ClassNode.java:1170)
   at org.codehaus.groovy.ast.ClassCodeVisitorSupport.visitClass(ClassCodeVisitorSupport.java:51)
   at org.codehaus.groovy.classgen.AsmClassGenerator.visitClass(AsmClassGenerator.java:174)
   at org.codehaus.groovy.control.CompilationUnit$6.call(CompilationUnit.java:829)
   at org.codehaus.groovy.control.CompilationUnit.applyToPrimaryClassNodes(CompilationUnit.java:1122)
   at org.codehaus.groovy.control.CompilationUnit.doPhaseOperation(CompilationUnit.java:594)
   at org.codehaus.groovy.control.CompilationUnit.processPhaseOperations(CompilationUnit.java:572)
   at org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:549)
   at org.codehaus.jdt.groovy.internal.compiler.ast.GroovyCompilationUnitDeclaration.processToPhase(GroovyCompilationUnitDeclaration.java:171)
   at org.codehaus.jdt.groovy.internal.compiler.ast.GroovyCompilationUnitDeclaration.generateCode(GroovyCompilationUnitDeclaration.java:1526)
   at org.eclipse.jdt.internal.compiler.Compiler.process(Compiler.java:831)
   at org.eclipse.jdt.internal.compiler.ProcessTaskManager.run(ProcessTaskManager.java:137)
   at java.lang.Thread.run(Thread.java:680)

Owner

aledsage commented May 2, 2012

This problems goes away when I declare the static methods in SshjTool as package-private instead of private.

Owner

aledsage commented May 2, 2012

Work-around is in #51

Contributor

cosmin-dumitrache commented May 2, 2012

Also works for me.

Owner

aledsage commented May 2, 2012

I've opened an issue with greclipse: see http://jira.codehaus.org/browse/GRECLIPSE-1435

Owner

aledsage commented May 3, 2012

Work-around has been merged into master.

An interesting dialog has begun with greclipse folk at the above URL...

aledsage closed this May 3, 2012

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment