Issue Details (XML | Word | Printable)

Type: New Feature New Feature
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Andy Jefferson
Reporter: Andy Jefferson
Votes: 3
Watchers: 5

If you were logged in you would be able to see more operations.
DataNucleus Enhancer (ARCHIVED)

Support JDK1.7+ (requires ASM v4)

Created: 11/Dec/11 08:32 AM   Updated: 18/Jun/12 10:08 AM   Resolved: 14/Jun/12 10:11 AM
Component/s: ASM Enhancer
Affects Version/s: None
Fix Version/s: 3.1.0.m1

 Sub-Task Progress: 
  • Sub-Tasks:
  • All
  • Open

 Description  « Hide
At some point we need to support JDK1.7+ usage. This requires ASM v4 which was recently released

Sort Order: Ascending order - Click to sort in descending order
Mike added a comment - 14/Mar/12 02:07 PM
The log says the enhancement succeeds:
2012-03-14 14:01:33,531 INFO [DataNucleus.Enhancer] - <DataNucleus Enhancer : Using ClassEnhancer "ASM" for API "JDO">
2012-03-14 14:01:33,753 INFO [DataNucleus.Enhancer] - <DataNucleus Enhancer (version 3.0.1) : Enhancement of classes>
DataNucleus Enhancer (version 3.0.1) : Enhancement of classes
2012-03-14 14:01:34,999 INFO [DataNucleus.Enhancer] - <Writing class file "/home/www/../entity/...class" with enhanced definition>

But the class files seem corrupted when running a test:
Tests in error:
  testAddLogon(sw.FindLoginTest): Expecting a stackmap frame at branch target 20 in method sw.entity.Login.jdoIsTransactional()Z at offset 4

Any timeline on this?


Andy Jefferson added a comment - 14/Mar/12 03:12 PM
No estimates, and indeed no estimates are ever given for unfunded work. You could look at
and include some obscure VM argument. Alternatively contribute time/donations for this to be done.

Andy Jefferson added a comment - 07/Jun/12 10:09 AM
For anyone who wants to do this, these are the changes needed (from ASM 4.0 guide)

* ClassVisitor, FieldVisitor, MethodVisitor, etc are now abstract classes and not interfaces, so replace "implements" with "extends" in
your code analyzers and adapters.

* Specify an ASM version in the constructors for these.

* ClassAdapter and MethodAdapter have been merged into ClassVisitor and MethodVisitor. To convert your code, you simply need to replace ClassAdapter with ClassVisitor, and MethodAdapter with MethodVisitor. Also, if you defined custom FieldAdapter or AnnotationAdapter classes, you can now replace them with FieldVisitor and AnnotationVisitor.

The other (less important) change would be that Eclipse has ASM (v3.x) as a plugin, and this is often found instead of the v4.0 dependency. We could manage with Maven-only builds until someone finds a solution to this.

Awaiting your patch ...

Andy Jefferson added a comment - 14/Jun/12 10:11 AM
SVN trunk passes DN tests using latest enhancer and maven plugin when using JDK1.7 without the aforementioned compiler flag (i.e using ASM v4, and with support for frames added to enhancement). Likely may be further work around persistent interfaces, but left for people to provide testcases that demonstrate something, rather than what has happened thus far