Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [jdt-dev] 20 year old bug ? :)

Thanks, Aaron, I will follow up. (This is just the starting point, there are a few other places that need to be touched too.)

 

As far as encoding names the way you have done it, I think the level of indirection exists for a reason. In general some symbols may be present only in some versions of class libraries for example. (Though perhaps not in this case)

Yeah, I'm also skeptical that there is a Java VM which doesn't define java.lang.NoClassDefFoundError :-)

For other cases, I suggest to add a unit test that uses the class name and compares it against the constant. In the unit test, you can check that you have a full-blown runtime (for example by skipping it when it throws NoClassDefFoundError):

char[] expected;

try {

   expected = ...

} catch(NoClassDefFoundError e) {

    // ignore: Not all Java runtimes define this class.

    return;

}

If you can use lambdas, you may be able to create a helper function that calls Assumptions.assumeTrue(false, "Missing class " + klass) in the catch. That would also skip the test.

Regards,

 

 

From: jdt-dev <jdt-dev-bounces@xxxxxxxxxxx> On Behalf Of Aaron Digulla via jdt-dev
Sent: Friday, April 19, 2024 2:40 PM
To: jdt-dev@xxxxxxxxxxx
Cc: Aaron Digulla <digulla@xxxxxxxx>
Subject: Re: [jdt-dev] 20 year old bug ? :)

 

CAUTION: This email was sent from outside of Advantest.

 

Am 19.04.24 um 08:14 schrieb Sankaran, Srikanth via jdt-dev:

org.eclipse.jdt.internal.compiler.lookup.TypeConstants.JAVA_LANG_NOCLASSDEFERROR reads:

 

char[][] JAVA_LANG_NOCLASSDEFERROR = {JAVA, LANG, "NoClassDefError".toCharArray()}; //$NON-NLS-1$

 

I think it should be: “NoClassDefFoundError” A 20 years old bug!

How about this fix (would also get rid of the comment)?

char[][] JAVA_LANG_NOCLASSDEFERROR = {JAVA, LANG, NoClassDefFoundError.class.getSimpleName().toCharArray()};

Regards,

-- 
Aaron "Optimizer" Digulla a.k.a. Philmann Dark
"It's not the universe that's limited, it's our imagination.
Follow me and I'll show you something beyond the limits." 
http://blog.pdark.de/
-- 
Aaron "Optimizer" Digulla a.k.a. Philmann Dark
"It's not the universe that's limited, it's our imagination.
Follow me and I'll show you something beyond the limits." 
http://blog.pdark.de/

Back to the top