|
|
Oops! Integer.compare
I was doing some subtraction in sort Comparators, when I noticed a
method Integer.compare that would handle the nice cases properly.
I thought to myself, I wonder why I never noticed that before. (Turns
out it was introduced in 1.7).
The catch was though that Jet stopped working.
Why?
Jet only supports up to Java 1.6.
When I compile with switches to generate Java 1.6 code, it is happy to
use new 1.7 code from the library. It then generates class files and
jars marked as legit 1.6 code. Ouch!
The official way to do this is to find old rt.jars to generate old
code. Is that the best way to catch these errors?
--
Roedy Green Canadian Mind Products
http://mindprod.com
I would be quite surprised if the NSA (National Security Agency)
did not have a computer program to scan bits of shredded
documents and electronically put them back together like a giant
jigsaw puzzle. This suggests you cannot just shred, you must also burn.
..
|
|
0
|
|
|
|
Reply
|
see_website (4858)
|
5/25/2012 7:00:28 PM |
|
Roedy Green wrote:
> I was doing some subtraction in sort Comparators, when I noticed a
> method Integer.compare that would handle the nice cases properly.
>
> I thought to myself, I wonder why I never noticed that before. (Turns
> out it was introduced in 1.7).
>
> The catch was though that Jet stopped working.
>
> Why?
>
> Jet only supports up to Java 1.6.
>
> When I compile with switches to generate Java 1.6 code, it is happy to
> use new 1.7 code from the library. It then generates class files and
> jars marked as legit 1.6 code. Ouch!
>
> The official way to do this is to find old rt.jars to generate old
> code. Is that the best way to catch these errors?
Yes. You use Java 6 boot JARs in the "-bootclasspath" argument to "javac".
--
Lew
|
|
0
|
|
|
|
Reply
|
lewbloch (1312)
|
5/25/2012 8:23:41 PM
|
|
On 2012-05-25 19:00:28 +0000, Roedy Green said:
> I was doing some subtraction in sort Comparators, when I noticed a
> method Integer.compare that would handle the nice cases properly.
>
> I thought to myself, I wonder why I never noticed that before. (Turns
> out it was introduced in 1.7).
>
> The catch was though that Jet stopped working.
>
> Why?
>
> Jet only supports up to Java 1.6.
>
> When I compile with switches to generate Java 1.6 code, it is happy to
> use new 1.7 code from the library. It then generates class files and
> jars marked as legit 1.6 code. Ouch!
>
> The official way to do this is to find old rt.jars to generate old
> code. Is that the best way to catch these errors?
It's usually easier to keep a complete JDK installation around for the
oldest runtime version you want to support, and compile your code with
that JDK. That takes care of language and bytecode compatibility (the
default -source and -target versions for a given version of the JDK are
exactly the version of the JDK itself) as well as library compatibility
(the JDK uses its version's runtime library to find symbols by default).
Sun, and now Oracle, try fairly hard to ensure forward source and
binary compatibility, so you can still run your compiled code on newer
runtimes if you like.
-o
|
|
0
|
|
|
|
Reply
|
angrybaldguy (338)
|
5/30/2012 12:18:48 AM
|
|
|
2 Replies
35 Views
(page loaded in 0.507 seconds)
Similiar Articles: GetPrivateProfileInt help - comp.lang.asm.x86I can figure out why the comparison isn't working. ..data sec ... kain wrote: > > [Wie Viel] > Nummer=E9 > Oops, it will be stored as an integer, so Nummer=233 ... 128 bit integer - comp.lang.cHi all, How to program 128 bit integer in C language ? ... struct so you can do > assignment and equality comparison ... :) Oops, you're right. I dropped the context ... Decimal sort - comp.lang.perl.misc>> > Oops. Forgot about default sort function being string cmp. Although that tends to work in a surprising number of cases. ... sort defaults to string compare ... Allocatable versus automatic arrays - comp.lang.fortranOops. I missed that because I didn't look at the code closely ... lang.fortran... some claim that it doesn't make sense to compare fixed sized values, but that the number ... nth day of the year? - comp.lang.awke.g. 24-nov-2005 = 328 -- -Gernot int main(int argc ... GNU date... > > $ date +%j -d"24-nov-2005" > 328 Oops ... date command; gawk adds relatively little in comparison ... Opening a file with case-insensitive name - comp.lang.perl.misc ...Do a case insensitive comparison on the variable to see if ... Oops, very good point. -- John Bokma Read my ... file name that they want to open. ... Determine number ... segmentation fault (SIGSEGV) - comp.lang.fortranIn some contexts, such as mixed arithmetic, > integers ... And no, I don't buy the "this was just for comparison ... Oops, yeah, I forgot about that. C++ manages it ... Iterating over a String - comp.lang.java.helpfor( int i : categories.length() ) { char c ... we have a BMP character > } > } > Oops, silly ... awk A workaround is to iterate over the fields and compare ... number of CPUs - comp.unix.solarisIn order to detect the number of physical CPUs you can ... numonline=`psrinfo | grep -v off-line | wc -l` Oops ... finite-difference-method and want to benchmark and compare ... Poker hand evaluator - comp.lang.javascript... evaluate a hand, it suffices to keep track of the number ... this would not be hard to code, either in the compare-two ... of equivalence classes > of 7-card poker hands Oops ... Comparing Strings - Microsoft Corporation: Software, Smartphones ...Method name. Use. String. Compare. Compares the values of two strings. Returns an integer value. String. CompareOrdinal. Compares two strings without regard to local ... Miss Oops - Compare Prices, Reviews and Buy at Nextag - Price - ReviewMiss Oops - 87 results like Miss Oops Show Stoppers ... Number of Sellers ... Compare Prices 7/23/2012 6:21:28 PM
|
|
|
|
|
|
|
|
|