Archiv für die Kategorie „Java 8“

Java 8 Developer Preview mit Modulsystem Jigsaw

Download unter http://jdk8.java.net/jigsaw/, Kurzeinführung unter http://openjdk.java.net/projects/jigsaw/doc/quickstart.html.

Wie Lambda-Ausdrücke in Java 8 intern umgesetzt werden

Siehe http://cr.openjdk.java.net/~briangoetz/lambda/lambda-translation.html.

Voraussichtliche Java 8 Release Zeiten stehen fest, GA für September 2013 geplant

Siehe http://openjdk.java.net/projects/jdk8/:

2012/04/24. M1

2012/06/14. M2

2012/07/30. M3

2012/09/11. M4

2012/11/26. M5

2013/01/30. M6 – Feature Complete

2013/09/??. GA – General Availability

Mit anderen Worten: Es dauert noch lange.

Erster Entwurf, wie Lambda sich auf die Java SE-API auswirken könnte

http://cr.openjdk.java.net/~briangoetz/lambda/collections-overview.html

In Java 8 doch wohl kein Index-Zugriff für Listen und Assoziativspeicher

Wenn man Joe Darcy in http://mail.openjdk.java.net/pipermail/coin-dev/2012-February/003454.html so interpretiert, lese ich in der Aussage “so I wouldn’texpect many additions to this list.” ein NEIN zu diesem hübschen Sprachfeature. Schade.

Close of Early Draft Review 2 von JSR-000308 Annotations on Java Types

http://jcp.org/aboutJava/communityprocess/edr/jsr308/index2.html

Erster Draft für “Annotations on Java Types” (JSR-308)

http://jcp.org/aboutJava/communityprocess/edr/jsr308/index2.html. Aus der Spezi:

JSR 308 extends Java to allow annotations on any use of a type, and on type parameter declarations.

Beispiele:

for generic type arguments to parameterized classes:
Map<@NonNull String, @NonEmpty List<@Readonly Document>> files;
for generic type arguments in a generic method or constructor invocation:
o.<@NonNull String>m("…");
for type parameter bounds, including wildcard bounds:
class Folder<F extends @Existing File> { … }
Collection<? super @Existing File>
for class inheritance:
class UnmodifiableList<T> implements @Readonly List<@Readonly T> { … }
for throws clauses:
void monitorTemperature() throws @Critical TemperatureException { … }
for typecasts:
myString = (@NonNull String) myObject;
It is not permitted to omit the Java type, as in myString = (@NonNull) myObject;.
for constructor invocation results (that is, for object creation):
new @Interned MyObject()
new @NonEmpty @Readonly List<String>(myNonEmptyStringSet)
myVar . new @Tainted NestedClass
For generic constructors (JLS §8.8.4), the annotation follows the explicit type arguments (JLS §15.9):
new <String> @Interned MyObject()
for type tests:
boolean isNonNull = myString instanceof @NonNull String;
It is not permitted to omit the Java type, as in myString instanceof @NonNull.

Damit einher geht eine krasse Änderung, das bei Objektmethoden einfach so ein this Übergeben werden kann.

It is permitted to explicitly declare the method receiver as the first formal parameter

As an example, here are the standard definitions for toString and equals:
class MyClass {

public String toString() { … }
public boolean equals(Object other) { … }
}
It is equivalent to write instead
class MyClass {

public String toString(MyClass this) { … }
public boolean equals(MyClass this, Object other) { … }
}
and then it would be possible to annotate the receiver’s type:
class MyClass {

public String toString(@Readonly MyClass this) { … }
public boolean equals(@Readonly MyClass this, @Readonly Object other) { … }
}

Interessant finde ich noch:

To ease the transition from standard Java SE 7 code to code with type annotations, the reference implementation
recognizes the type annotations when surrounded by comment markers:
List</*@Readonly*/ Object> myList;
This permits use of both standard Java SE 7 tools and the new annotations even before Java SE 8 is released

unsigned integer arithmetic in Java 8

Siehe http://mail.openjdk.java.net/pipermail/core-libs-dev/2012-January/008926.html und die Quellen hier http://hg.openjdk.java.net/jdk8/tl/jdk/rev/71200c517524.

Neue Methoden in Byte:

  • static int toUnsignedInt(byte x)
  • static long toUnsignedLong(byte x)

In Integer:

  • static String toUnsignedString(int i, int radix)
  • static String toUnsignedString(int i)
  • static int parseUnsignedInt(String s, int radix)
  • static int compareUnsigned(int x, int y)
  • static long toUnsignedLong(int x)
  • static int divideUnsigned(int dividend, int divisor)
  • static int remainderUnsigned(int dividend, int divisor)

In Long:

  • String toUnsignedString(long i, int radix)
  • static String toUnsignedString(long i)
  • static long parseUnsignedLong(String s, int radix)
  • static int compareUnsigned(long x, long y)
  • static long divideUnsigned(long dividend, long divisor)
  • static long remainderUnsigned(long dividend, long divisor)

In Short:

  • static int toUnsignedInt(short x)
  • static long toUnsignedLong(short x)

Diagnose Kommandos kommen in Java 8 und Java 7u4

Das werden wir im nächsten Build bekommen, Quellen schon mal hier: http://hg.openjdk.java.net/jdk8/jdk8/jdk/rev/0194fe5ca404.

A diagnostic command is an action that can be invoked dynamically mainly for troubleshooting and diagnosis.

Die Idee ist also, das man ein Kommandozeilentool jcmd hat, mit dem man Kommandos an die JVM schicken kann. Dabei sind unterschiedliche Kommandos vordefiniert. Mit dem Argument PerfCounter.perf werden Performance-Kenngrößen ausgegeben.

Java 8, Build 18

http://jdk8.java.net/download.html, Änderungen: http://download.java.net/jdk8/changes/jdk8-b18.html. Einige Bugfixes an Hotspot, sonst nicht viel dabei.

Willkommen

Name: Christian Ullenboom
Standort: Sonsbeck, NRW, Germany

Ich bin Christian Ullenboom und Autor des Buches ›Java ist auch eine Insel‹. In diesem Blog schreibe ich über aktuelle Java-Entwicklungen, Neuerungen in der Insel, Updates bei Java Open-Source-Bibliotheken, Best-Practices, Fortschritte bei den IDEs und neue Eclipse-Plugins. Seit 1997 schule ich als Java-Tutor Java-Themen und Sun ernannte mich 2005 zum ›Java-Champion‹.

Kategorien
Archiv
Vintage Computer Museum
Unser Museum (http://tutego.de/computeroldies/) freut sich auf neue alte HEIMCOMPUTER und SPIELKONSOLEN. Gerne nehmen wir historische Heimcomputer, Software, Literatur, Werbung und weitere Artefakte aus der Vergangenheit entgegen (als Spende oder gegen Bezahlung). Bei uns sind die Sammlerstücke in guten Händen.
Mir auf Google+ folgen

In 0 people's circles

Add to circlesi
Rss Feed Tweeter button Facebook button Technorati button Reddit button Myspace button Linkedin button Delicious button Digg button