Issue Details (XML | Word | Printable)

Key: JANINO-78
Type: Improvement Improvement
Status: Resolved Resolved
Resolution: Fixed
Priority: Major Major
Assignee: Arno Unkrig
Reporter: Marko Vucetic
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Janino

Implement Superclass field access

Created: 02/Apr/07 03:34 AM   Updated: 18/May/07 03:32 PM
Component/s: None
Affects Version/s: None
Fix Version/s: None

Time Tracking:
Not Specified

Environment: java 1.4, janino 2.5.6


 Description  « Hide
Classes with construct:

super.member = ...

fail to load. For example:

java --classpath janino.jar org.codehaus.janino.samples.ClassBodyDemo @/udd/share/ws/sample/src/Two.java
Exception in thread "main" org.codehaus.janino.Parser$ParseException: Line 5, Column 20: Superclass field access NYI
at org.codehaus.janino.Parser.throwParseException(Parser.java)
at org.codehaus.janino.Parser.parsePrimary(Parser.java)
at org.codehaus.janino.Parser.parseUnaryExpression(Parser.java)
at org.codehaus.janino.Parser.parseMultiplicativeExpression(Parser.java)
at org.codehaus.janino.Parser.parseAdditiveExpression(Parser.java)
at org.codehaus.janino.Parser.parseShiftExpression(Parser.java)
at org.codehaus.janino.Parser.parseRelationalExpression(Parser.java)
at org.codehaus.janino.Parser.parseEqualityExpression(Parser.java)
at org.codehaus.janino.Parser.parseAndExpression(Parser.java)
at org.codehaus.janino.Parser.parseExclusiveOrExpression(Parser.java)
at org.codehaus.janino.Parser.parseInclusiveOrExpression(Parser.java)
at org.codehaus.janino.Parser.parseConditionalAndExpression(Parser.java)
at org.codehaus.janino.Parser.parseConditionalOrExpression(Parser.java)
at org.codehaus.janino.Parser.parseConditionalExpression(Parser.java)
at org.codehaus.janino.Parser.parseAssignmentExpression(Parser.java)
at org.codehaus.janino.Parser.parseExpression(Parser.java)
at org.codehaus.janino.Parser.parseConstructorDeclarator(Parser.java)
at org.codehaus.janino.Parser.parseClassBodyDeclaration(Parser.java)
at org.codehaus.janino.Parser.parseClassBody(Parser.java)
at org.codehaus.janino.Parser.parseClassDeclarationRest(Parser.java)
at org.codehaus.janino.Parser.parseClassBodyDeclaration(Parser.java)
at org.codehaus.janino.ClassBodyEvaluator.cook(ClassBodyEvaluator.java)
at org.codehaus.janino.Cookable.cook(Cookable.java)
at org.codehaus.janino.Cookable.cook(Cookable.java)
at org.codehaus.janino.Cookable.cook(Cookable.java)
at org.codehaus.janino.ClassBodyEvaluator.<init>(ClassBodyEvaluator.java)
at org.codehaus.janino.samples.ClassBodyDemo.main(ClassBodyDemo.java)

with class Two:

public class Two extends One {

Two() { super.name = "Two"; }
public void doit() { System.out.println("Two.doit"); }
}

and class One:
public class One {

protected String name = new String();

public One() { this.name = "One"; }

public void doit() { System.out.println("One.doit"); }
}

class One, of course loads nicely. Class Two fails, all though super class member access is listed as suported.



 All   Comments   Work Log   Change History      Sort Order: Ascending order - Click to sort in descending order
Arno Unkrig added a comment - 04/Apr/07 09:12 AM
It's not a bug, it's a feature!

"Superclass field access NYI" means "not yet implemented", so it's a documented non-feature

Joking aside, I will try to implement the missing feature soon. How urgent is it?

CU

Arno


Marko Vucetic added a comment - 04/Apr/07 09:49 AM

Aha, I thought so. Hence the NYI.

I was fooled by Janino homepage where it says:

The following elements of the Java programming language are implemented:
– cut –

  • Superclass member access (super.meth();, super.field = x;
    • cut –

(Fortunately) This particular thing isn't urgent or necessary anymore. I was compiling output of wsdl2java (Axis1) when I hit this. We moved to Axis2 in the mean time ... and Axis2 generated code is compiled nicely by Janino.

Thanks,

-Marko.


Arno Unkrig added a comment - 18/May/07 03:32 PM
Will be released with 2.5.7.