Janino

Implement Superclass field access

Details

  • Type: Improvement Improvement
  • Status: Resolved Resolved
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: None
  • Fix Version/s: None
  • Component/s: None
  • Labels:
    None
  • Environment:
    java 1.4, janino 2.5.6
  • Number of attachments :
    0

Description

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.

Activity

Hide
Arno Unkrig added a comment -

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

Show
Arno Unkrig added a comment - 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
Hide
Marko Vucetic added a comment -

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.

Show
Marko Vucetic added a comment - 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.
Hide
Arno Unkrig added a comment -

Will be released with 2.5.7.

Show
Arno Unkrig added a comment - Will be released with 2.5.7.

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: