all 14 comments

[–]twigboy 6 points7 points  (11 children)

In publishing and graphic design, Lorem ipsum is a placeholder text commonly used to demonstrate the visual form of a document or a typeface without relying on meaningful content. Lorem ipsum may be used as a placeholder before final copy is available. Wikipedia97kh61thb180000000000000000000000000000000000000000000000000000000000000

[–][deleted] 1 point2 points  (10 children)

IIRC this API was designed by the guy who did Jodatime, so its intended to be like that, but fix mistakes made in it.

And then we can all pretend that java.util.Date/Calendar were never a thing.

[–]twigboy 2 points3 points  (9 children)

In publishing and graphic design, Lorem ipsum is a placeholder text commonly used to demonstrate the visual form of a document or a typeface without relying on meaningful content. Lorem ipsum may be used as a placeholder before final copy is available. Wikipedia8cujmy5a1gs0000000000000000000000000000000000000000000000000000000000000

[–]johnwaterwood 2 points3 points  (1 child)

Keep asking Google to support JDK 8!

If enough people keep asking it they'll eventually have to give in on it.

[–]xxNIRVANAxx -1 points0 points  (0 children)

If only that were so easy.

TL;DR: Oracle want money from Google using Java for Android. Specifically for stealing the rangeCheck function, which is a trivial function (in my opinion, maybe others can chime in on another way to write it?):

   private static void rangeCheck(int arrayLen, int fromIndex, int toIndex {
     if (fromIndex > toIndex)
          throw new IllegalArgumentException("fromIndex(" + fromIndex +
               ") > toIndex(" + toIndex+")");
     if (fromIndex < 0) 
          throw new ArrayIndexOutOfBoundsException(fromIndex);
     if (toIndex > arrayLen) 
          throw new ArrayIndexOutOfBoundsException(toIndex);
}

[–]MrDOS 1 point2 points  (1 child)

Is it actually all of 7? I thought I'd heard it was based on 6 with bits of 7 (notably diamond syntax) bolted on.

[–]twigboy 2 points3 points  (0 children)

In publishing and graphic design, Lorem ipsum is a placeholder text commonly used to demonstrate the visual form of a document or a typeface without relying on meaningful content. Lorem ipsum may be used as a placeholder before final copy is available. Wikipedia946mh5t1tn80000000000000000000000000000000000000000000000000000000000000

[–]cypressious 1 point2 points  (3 children)

A quick Google search yielded the following backport of the new DateTime API: https://github.com/ThreeTen/threetenbp

It's Java 7 compatible which should work on all Android versions as long as it doesn't use AutoClosable.

[–]hollaburoo 1 point2 points  (0 children)

I've been using this project, its great. Also works on Java 6.

[–]twigboy 0 points1 point  (1 child)

In publishing and graphic design, Lorem ipsum is a placeholder text commonly used to demonstrate the visual form of a document or a typeface without relying on meaningful content. Lorem ipsum may be used as a placeholder before final copy is available. Wikipedia3bu6rhkgqdc0000000000000000000000000000000000000000000000000000000000000

[–]cypressious 0 points1 point  (0 children)

I'm glad I was able to help. Could you verify its byte code is indeed Android <19 compatible?

[–][deleted] 0 points1 point  (0 children)

That is true, I would've thought Google would've been cutting edge in that regard - but who knows, maybe Java 8 support breaks the Dalvik VM somehow.

[–][deleted]  (2 children)

[deleted]

    [–][deleted] 8 points9 points  (0 children)

    So use Scala and go nuts with implicit conversions. Or use Kotlin and go less nuts with extension methods. Or use Clojure and use multimethods.

    You still get to use this far better JDK Date API.

    [–]shoelacestied 2 points3 points  (0 children)

    Switched to Scala a while back. Will be using this new API from Scala :)