Konstruktor nicht gefunden #334

Closed
opened 2024-05-15 12:32:16 +00:00 by pl · 1 comment
Owner

commit: c3343959c5

In testComplete habe ich den Test Box reaktiviert.

Folgende Probleme:

  1. Problem:
    javap Box.class

class Box {
A a;

Box();
Code:
0: aload_0
1: invokespecial #12 // Method java/lang/Object."":()V
4: return
5: athrow

Box(A);
Code:
0: aload_0
1: invokespecial #12 // Method java/lang/Object."":()V
4: return
5: athrow

public static {};
Code:
0: return
}

Was machen athrow am Ende der Konstruktoren?
Was ist die letzte Methode "public static {}; Code:0: return"?

  1. Problem:
    Konstruktoren werden nicht gefunden:
    java.lang.IllegalAccessException: class TestComplete cannot access a member of class Box with package access
    at java.base/jdk.internal.reflect.Reflection.newIllegalAccessException(Reflection.java:394)
    at java.base/java.lang.reflect.AccessibleObject.checkAccess(AccessibleObject.java:714)
    at java.base/java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:495)
    at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:486)
    at TestComplete.boxTest(TestComplete.java:612)
    at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
    at java.base/java.lang.reflect.Method.invoke(Method.java:580)
    at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47)
    at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
    at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44)
    at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
    at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:271)
    at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:70)
    at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
    at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)
    at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)
    at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)
    at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)
    at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)
    at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
    at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:93)
    at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:40)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:529)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:757)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:452)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:210)

Ich habe schon mal ein wenig analysiert: ClassOrInterface enthält keine Konstruktoren.

commit: c3343959c5fa8466a0d2257cb2686ebfa2aafded In testComplete habe ich den Test Box reaktiviert. Folgende Probleme: 1. Problem: javap Box.class class Box<A> { A a; Box(); Code: 0: aload_0 1: invokespecial #12 // Method java/lang/Object."<init>":()V 4: return 5: athrow Box(A); Code: 0: aload_0 1: invokespecial #12 // Method java/lang/Object."<init>":()V 4: return 5: athrow public static {}; Code: 0: return } Was machen athrow am Ende der Konstruktoren? Was ist die letzte Methode "public static {}; Code:0: return"? 2. Problem: Konstruktoren werden nicht gefunden: java.lang.IllegalAccessException: class TestComplete cannot access a member of class Box with package access at java.base/jdk.internal.reflect.Reflection.newIllegalAccessException(Reflection.java:394) at java.base/java.lang.reflect.AccessibleObject.checkAccess(AccessibleObject.java:714) at java.base/java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:495) at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:486) at TestComplete.boxTest(TestComplete.java:612) at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103) at java.base/java.lang.reflect.Method.invoke(Method.java:580) at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47) at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12) at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44) at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17) at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:271) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:70) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50) at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238) at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63) at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236) at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53) at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229) at org.junit.runners.ParentRunner.run(ParentRunner.java:309) at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:93) at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:40) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:529) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:757) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:452) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:210) Ich habe schon mal ein wenig analysiert: ClassOrInterface enthält keine Konstruktoren.
pl added the
Codegen
label 2024-05-15 12:32:16 +00:00
dholle was assigned by pl 2024-05-15 12:32:16 +00:00
Owner
2ded0c9044
Sign in to join this conversation.
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: JavaTX/JavaCompilerCore#334
No description provided.