Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 317381 - [otre] ClassCircularityError in flight bonus example
Summary: [otre] ClassCircularityError in flight bonus example
Status: VERIFIED FIXED
Alias: None
Product: Objectteams
Classification: Tools
Component: OTJ (show other bugs)
Version: 0.7   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: 0.7   Edit
Assignee: Stephan Herrmann CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-06-20 12:55 EDT by Stephan Herrmann CLA
Modified: 2010-07-02 13:17 EDT (History)
0 users

See Also:


Attachments
proposed fix (1.43 KB, patch)
2010-06-20 12:58 EDT, Stephan Herrmann CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Stephan Herrmann CLA 2010-06-20 12:55:19 EDT
When running the flight bonus example in a Java 6 VM, the following
ClassCircularityError is thrown:

Error transforming class: java.util.LinkedHashMap$KeyIterator
java.lang.ClassCircularityError: java/util/LinkedHashMap$KeyIterator
	at java.util.LinkedHashMap.newKeyIterator(LinkedHashMap.java:396)
	at java.util.HashMap$KeySet.iterator(HashMap.java:874)
	at java.io.ExpiringCache.cleanup(ExpiringCache.java:99)
	at java.io.ExpiringCache.get(ExpiringCache.java:56)
	at java.io.UnixFileSystem.canonicalize(UnixFileSystem.java:137)
	at java.io.File.getCanonicalPath(File.java:559)
	at sun.security.provider.PolicyFile.canonPath(PolicyFile.java:1844)
	at java.io.FilePermission$1.run(FilePermission.java:186)
	at java.io.FilePermission$1.run(FilePermission.java:183)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.io.FilePermission.init(FilePermission.java:183)
	at java.io.FilePermission.<init>(FilePermission.java:249)
	at sun.net.www.protocol.file.FileURLConnection.getPermission(FileURLConnection.java:198)
	at sun.net.www.protocol.jar.JarFileFactory.getPermission(JarFileFactory.java:124)
	at sun.net.www.protocol.jar.JarFileFactory.getCachedJarFile(JarFileFactory.java:94)
	at sun.net.www.protocol.jar.JarFileFactory.get(JarFileFactory.java:50)
	at sun.net.www.protocol.jar.JarURLConnection.connect(JarURLConnection.java:104)
	at sun.net.www.protocol.jar.JarURLConnection.getInputStream(JarURLConnection.java:132)
	at java.net.URL.openStream(URL.java:1010)
	at java.lang.ClassLoader.getResourceAsStream(ClassLoader.java:1170)
	at org.apache.bcel.util.ClassPath.getInputStream(ClassPath.java:179)
	at org.apache.bcel.util.ClassPath.getInputStream(ClassPath.java:165)
	at org.apache.bcel.util.SyntheticRepository.loadClass(SyntheticRepository.java:126)
	at org.apache.bcel.Repository.lookupClass(Repository.java:62)
	at org.eclipse.objectteams.otre.RepositoryAccess.instanceOf(RepositoryAccess.java:117)
	at org.eclipse.objectteams.otre.RepositoryAccess.safeSubclassOf(RepositoryAccess.java:101)
	at org.eclipse.objectteams.otre.util.CallinBindingManager.getInheritedCallinBindings(CallinBindingManager.java:413)
 ...

Additionally, running in a Java 5 is currently not possible because the
OTRE jars seem to be compiled with a 1.6 target.
Comment 1 Stephan Herrmann CLA 2010-06-20 12:58:29 EDT
Created attachment 172293 [details]
proposed fix

This patch catches ClassCircularityError in RepositoryAccess.safeSubclassOf()
assuming that circularity was introduced by accessing additional classes
from framework code.

Additionally avoid transforming the specific class that caused the exception.
Comment 2 Stephan Herrmann CLA 2010-06-20 14:04:38 EDT
The patch has been committed as r522, which resolves the exception.

As of build 201006201327 the classfile version issue has been solved, too.
Comment 3 Stephan Herrmann CLA 2010-07-02 13:17:57 EDT
Verified using build 201007011455.