Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.programmer > #14796

Oops! Integer.compare

From Roedy Green <see_website@mindprod.com.invalid>
Newsgroups comp.lang.java.programmer
Subject Oops! Integer.compare
Date 2012-05-25 12:00 -0700
Organization Canadian Mind Products
Message-ID <ksjvr7t25pu5p56v9cfbdci5biqqadb2uc@4ax.com> (permalink)

Show all headers | View raw


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.
.

Back to comp.lang.java.programmer | Previous | NextNext in thread | Find similar | Unroll thread


Thread

Oops! Integer.compare Roedy Green <see_website@mindprod.com.invalid> - 2012-05-25 12:00 -0700
  Re: Oops! Integer.compare Lew <lewbloch@gmail.com> - 2012-05-25 13:23 -0700
  Re: Oops! Integer.compare Owen Jacobson <angrybaldguy@gmail.com> - 2012-05-29 20:18 -0400

csiph-web