Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 362693

Summary: ClassCastException when running tests which use javassist generated proxies
Product: [Eclipse Project] JDT Reporter: Jaroslaw Palka <jpalka>
Component: CoreAssignee: JDT-Core-Inbox <jdt-core-inbox>
Status: CLOSED WONTFIX QA Contact:
Severity: normal    
Priority: P3    
Version: 3.7.1   
Target Milestone: ---   
Hardware: PC   
OS: Windows 7   
Whiteboard: stalebug

Description Jaroslaw Palka CLA 2011-11-02 11:52:15 EDT
Build Identifier: M20110909-1335

I am working on opensource projects which uses javassist to generate proxies. When I clean project and run tests under Eclipse I get following exception:
java.lang.ClassCastException: org.javassist.tmp.java.lang.Object_$$_javassist_4 cannot be cast to java.lang.String
	at net.primitive.beemap.BeanToMapTest$1.configure(BeanToMapTest.java:38)
	at net.primitive.beemap.MappingDef.configure(MappingDef.java:59)
	at net.primitive.beemap.BeanMappingBuilder.with(BeanMappingBuilder.java:53)
	at net.primitive.beemap.BeanToMapTest.should_map_entry_to_bean_property(BeanToMapTest.java:32)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:45)
	at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
	at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:42)
	at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
	at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:263)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:68)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:47)
	at org.junit.runners.ParentRunner$3.run(ParentRunner.java:231)
	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:60)
	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:229)
	at org.junit.runners.ParentRunner.access$000(ParentRunner.java:50)
	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:222)
	at org.junit.runners.ParentRunner.run(ParentRunner.java:300)
	at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)
	at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)

When I run mvn clean test, all tests pass.

It looks like an issue with Eclipse compiler.


Reproducible: Always

Steps to Reproduce:
1. Checkout project from https://bitbucket.org/kcrimson/beemap
2. From code run mvn clean test, all tests pass
3. Go to Eclipse->Clean and clean the project
4. Select src/test/java and Run tests (Alt+Shift+X T), some of the tests fail
5. When you go to command line and run mvn clean test and later on run same tests from Eclipse without cleaning your project) all test pass.
Comment 1 Eclipse Genie CLA 2020-01-27 01:44:16 EST
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet. As such, we're closing this bug.

If you have further information on the current state of the bug, please add it and reopen this bug. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.