SlideShare uma empresa Scribd logo
1 de 41
Baixar para ler offline
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 131
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 132
Что нового в JDK 8
Александр Ильин
Архитектор тестирования JDK
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 133
The following is intended to outline our general product
direction. It is intended
for information purposes only, and may not be incorporated
into any contract.
It is not a commitment to deliver any material, code, or
functionality, and should not be relied upon in making
purchasing decisions. The development, release, and timing
of any features or functionality described for Oracle’s products
remains at the sole discretion of Oracle.
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 134Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 16
Program
Agenda
 50+ изменений
 DateTime API
 Type annotations
 Profiles
 Lambda
http://openjdk.java.net/projects/jdk8/features
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 135
JDK 8
Java for Everyone
• Профайлы
• JSR 310 - Date & Time APIs
• Non-Gregorian calendars
• Unicode 6.1
• ResourceBundle
• BCP47 locale matching
●
Globalization & Accessibility
Innovation
• Lambda (замыкания)
• Language Interop
• Nashorn
Core Libraries
• “Параллельные” коллекции
Improvements in functionality
• Improved type inference
Security
• Ограничение doPrivilege
• NSA Suite B algorithm support
• Поддержка SNI Server Side
• DSA обновление FIPS186-3
• AEAD JSSE CipherSuites
Tools
• Управление компилятором
• JSR 308 – аннотации Java-
типов
• Нативные пакеты
• Инструменты для App Store
Client
●
Новые методы
развертывания
●
JavaFX 8
●
Public UI Control API
●
ПоддержкаEmbedded
●
Поддержка HTML5
●
3D формы и атрибуты
●
Система печати
General Goodness
• Улучшения в JVM
• No PermGen
• Производительность
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 136
Date & Time API: JSR 310
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 137
Instant start = Instant.ofEpochMilli(123450L);
Instant end = Instant.now();
Duration duration = Duration.ofSeconds(12);
Duration bigger = duration.multipliedBy(4);
Duration biggest = bigger.plus(duration);
Instant later = start.plus(duration);
Instant earlier = start.minus(duration);
Date & Time
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 138
LocalDate ld = LocalDate.of(2010, Month.DECEMBER, 3);
LocalDateTime ldt =
LocalDateTime.of(date, LocalTime.of(12, 33));
ZonedDateTime zdt = ZonedDateTime.of(dateTime, zoneId);
zdt = zdt.minus(12, HOURS);
long days = DAYS.between(date1, date2);
Period period = Period.between(date1, date2);
Date & Time
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 139
Type annotations: JSR 308
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 1310
Аннотации в Java до Java 8
 @Target
– ANNOTATION_TYPE, CONSTRUCTOR, FIELD,
LOCAL_VARIABLE, METHOD, PACKAGE, PARAMETER, TYPE
 @Retention
– SOURCE, CLASS, RUNTIME
 Поля, значения по умолчанию
– @Test(timeout=100)
– Primitive, String, Class, enum, array of the above
 Нет наследования
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 1311
Аннотации в Java 8
 Могут быть использованы на любом использовании типа
– Информация на следующих слайдах ...
 @Target
– TYPE_PARAMETER, TYPE_USE
 Повторяющиеся аннотации
@
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 1312
JSR 308: Annotations on Java Types (1)
 method receivers
public int size() @Readonly { ... }
 generic type arguments
Map<@NonNull String, @NonEmpty List<@Readonly Document>>
files;
 arrays
Document[][@Readonly] docs2 =
new Document[2] [@Readonly 12];
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 1313
JSR 308: Annotations on Java Types (2)
 typecasts
myString = (@NonNull String)myObject;
 type tests
boolean isNonNull = myString instanceof @NonNull String;
 object creation
new @NonEmpty @Readonly List(myNonEmptyStringSet)
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 1314
JSR 308: Annotations on Java Types (3)
 type parameter bounds
<T extends @A Object, U extends @C Cloneable>
 class inheritance
class UnmodifiableList implements @Readonly List<@Readonly T> { ... }
 throws clauses
void monitorTemperature() throws @Critical TemperatureException { ... }
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 1315
Nullness checker
Если Nullness checker не рапортует ошибок для какой-либо
программы, тогда во время выполнения этой программы
никогда не будет брошено null pointer exception.
@Nullable Object obj; @NonNull Object nnobj;
...
nnobj.toString(); obj.toString();
nnobj = obj; obj = nnobj;
if (nnobj == null) ...
if (obj != null) {
nnobj = obj; //type refinement
}
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 1316
Lock checker
Если Lock checker не рапортует ошибок для какой-либо
программы, тогда программа держит определенный монитор
каждый раз когда доступается до переменной.
 @GuardedBy – доступ разрешен только если держится
определенный монитор
 @Holding – вызов разрешен только если держится определенный
монитор
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 1317
Lock checker
@GuardedBy("MyClass.myLock") Object myMethod() { ... }
@GuardedBy("MyClass.myLock") Object x = myMethod();
@GuardedBy("MyClass.myLock") Object y = x;
Object z = x;
x.toString();
synchronized(MyClass.myLock) {
y.toString();
}
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 1318
Lock checker
void helper1(@GuardedBy("MyClass.myLock") Object a) {
a.toString();
synchronized(MyClass.myLock) {
a.toString();
}
}
@Holding("MyClass.myLock")
void helper2(@GuardedBy("MyClass.myLock") Object b) {
b.toString();
}
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 1319
JDK profiles
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 1320
base
tls logging
authjdbc
jtarmi
jaxp
naming
rowset
kerberos management
compiler
xmldsig
prefs
sctp
instrument
scripting
crypto
compat
management.iiop cosnaming
corba
desktop
tools.jre
jaxws
jx.annotations
httpserver
tools
tools.jaxws tools.base
devtools
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 1321
base
tls logging
authjdbc
jtarmi
jaxp
naming
rowset
kerberos management
compiler
xmldsig
prefs
sctp
instrument
scripting
crypto
compat
management.iiop cosnaming
corba
desktop
tools.jre
jaxws
jx.annotations
httpserver
tools
tools.jaxws tools.base
devtools
52MB
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 1322
base
tls logging
authjdbc
jtarmi
jaxp
naming
rowset
kerberos management
compiler
xmldsig
prefs
sctp
instrument
scripting
crypto
compat
management.iiop cosnaming
corba
desktop
tools.jre
jaxws
jx.annotations
httpserver
tools
tools.jaxws tools.base
devtools
52MB 24
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 1323
base
tls logging
authjdbc
jtarmi
jaxp
naming
rowset
kerberos management
compiler
xmldsig
prefs
sctp
instrument
scripting
crypto
compat
management.iiop cosnaming
corba
desktop
tools.jre
jaxws
jx.annotations
httpserver
tools
tools.jaxws tools.base
devtools
52MB 1724
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 1324
base
tls logging
authjdbc
jtarmi
jaxp
naming
rowset
kerberos management
compiler
xmldsig
prefs
sctp
instrument
scripting
crypto
compat
management.iiop cosnaming
corba
desktop
tools.jre
jaxws
jx.annotations
httpserver
tools
tools.jaxws tools.base
devtools
1052MB 1724
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 1325
Lambda: JSR 335
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 1326
Lambda
 Лямбда
(Object o) -> (o.toString());
 Ссылка на метод
Object::toString()
 Метод по умолчанию
Collection.forEach(java.util.function.Block)
 Collections
shapes.stream().filter(s s.getColor() == BLUE).
map(s s.getWeight()).sum();
Copyright © 2012, Oracle and/or its affiliates. All rights reserved.27
Функциональные интерфейсы
Интерфейс с одним методом
●
Runnable, Comparator, ActionListener
●
Predicate<T>, Block<T>
Лямбда - экземпляр функционального интерфейса
Predicate<String> isEmpty = s s.isEmpty();
Predicate<String> isEmpty = String::isEmpty;
Runnable r = () {System.out.println(“Boo!”) };
Copyright © 2012, Oracle and/or its affiliates. All rights reserved.28
Эволюция интерфейсов
 Палка о двух концах
– Гибкость
• Специфицирован только API
– Невозможно изменить
• Требуется менять все имплементации
Copyright © 2012, Oracle and/or its affiliates. All rights reserved.29
Методы по умолчанию
interface Collection<E> {
default void forEach(Block<E> action) {
for (E e: this) action.apply(e);
}
default boolean removeIf(Predicate<? super E> filter) {
boolean removed = false; Iterator<E> each = iterator();
while ( each.hasNext() ) {
if ( filter.test( each.next() ) ) {
each.remove(); removed = true;
}
}
return removed;
}
}
Copyright © 2012, Oracle and/or its affiliates. All rights reserved.30
Методы по умолчанию
Множественное наследование?
 Интерфейса
 Поведения
 Состояния
Copyright © 2012, Oracle and/or its affiliates. All rights reserved.31
Методы по умолчанию
Множественное наследование?
 Интерфейса
 Поведения
 Состояния
было всегда
Copyright © 2012, Oracle and/or its affiliates. All rights reserved.32
Методы по умолчанию
Множественное наследование?
 Интерфейса
 Поведения
 Состояния
было всегдабыло всегда
методы по умолчанию
Copyright © 2012, Oracle and/or its affiliates. All rights reserved.33
Методы по умолчанию
Множественное наследование?
 Интерфейса
 Поведения
 Состояния
методы по умолчанию
было всегда
Copyright © 2012, Oracle and/or its affiliates. All rights reserved.34
Методы по умолчанию
Множественное наследование?
1.Класс побеждает
2.Более специфичный интерфейс предпочтительней
3.Во всех остальных случаях пользователь должен предоставить
реализацию
 Интерфейса
 Поведения
 Состояния
было всегда
методы по умолчанию
Copyright © 2012, Oracle and/or its affiliates. All rights reserved.35
Diamonds? Нет проблем!
interface A {
default void m() {…}
}
interface B extends A {…}
interface C extends A {…}
class D implements B, C {...}
A
B C
D
m
Copyright © 2012, Oracle and/or its affiliates. All rights reserved.36
Diamonds? Нет проблем!
interface A {
default void m() {…}
}
interface B extends A {
default void m() {…}
}
interface C extends A {...}
сlass D implements B, C {...}
A
B C
D
m
m
Copyright © 2012, Oracle and/or its affiliates. All rights reserved.37
Явное разрешение неоднозначности
interface A {
default void m() {…}
}
interface B {
default void m() {…}
}
class C implements A, B {
//Must implement/reabstract m()
void m() { A.super.m(); }
}
A B
D
m m
Copyright © 2012, Oracle and/or its affiliates. All rights reserved.38
Cортировка
Collections.sort(people, new Comparator<Person>() {
public int compare(Person x, Person y) {
return x.getLastName().compareTo(y.getLastName());
}
});
Copyright © 2012, Oracle and/or its affiliates. All rights reserved.39
Сортировка с лямбдой
Comparator<Person> byLastName
= comparing(p p.getLastName());
Collections.sort(people, byLastName);
Collections.sort(people, comparing(p
p.getLastName()));
people.sort(comparing(p p.getLastName()))
Copyright © 2012, Oracle and/or its affiliates. All rights reserved.40
Сортировка с лямбдой
people.sort(comparing(Person::getLastName))
people.sort(comparing(Person::getLastName).reverse());
people.sort(comparing(Person::getLastName)
.compose(comparing(Person::getFirstName)));
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 1341
Что нового в JDK 8
Александр Ильин
Архитектор тестирования JDK

Mais conteúdo relacionado

Semelhante a Александр Ильин, Oracle

As novidades do Java EE 7: do HTML5 ao JMS 2.0
As novidades do Java EE 7: do HTML5 ao JMS 2.0As novidades do Java EE 7: do HTML5 ao JMS 2.0
As novidades do Java EE 7: do HTML5 ao JMS 2.0Bruno Borges
 
Introduction to JavaFX on Raspberry Pi
Introduction to JavaFX on Raspberry PiIntroduction to JavaFX on Raspberry Pi
Introduction to JavaFX on Raspberry PiBruno Borges
 
JavaFX and JEE 7
JavaFX and JEE 7JavaFX and JEE 7
JavaFX and JEE 7Vijay Nair
 
Aplicações HTML5 com Java EE 7 e NetBeans
Aplicações HTML5 com Java EE 7 e NetBeansAplicações HTML5 com Java EE 7 e NetBeans
Aplicações HTML5 com Java EE 7 e NetBeansBruno Borges
 
Innovations in Oracle Database 12c - 2015
Innovations in Oracle Database 12c - 2015Innovations in Oracle Database 12c - 2015
Innovations in Oracle Database 12c - 2015Connor McDonald
 
A Importância do JavaFX no Mercado Embedded
A Importância do JavaFX no Mercado EmbeddedA Importância do JavaFX no Mercado Embedded
A Importância do JavaFX no Mercado EmbeddedBruno Borges
 
12 things about Oracle 12c
12 things about Oracle 12c12 things about Oracle 12c
12 things about Oracle 12cConnor McDonald
 
whats-new-netbeans-ide-80.pptx
whats-new-netbeans-ide-80.pptxwhats-new-netbeans-ide-80.pptx
whats-new-netbeans-ide-80.pptxGabrielSoche
 
Java API for WebSocket 1.0: Java EE 7 and GlassFish
Java API for WebSocket 1.0: Java EE 7 and GlassFishJava API for WebSocket 1.0: Java EE 7 and GlassFish
Java API for WebSocket 1.0: Java EE 7 and GlassFishArun Gupta
 
First Steps with Java Card
First Steps with Java CardFirst Steps with Java Card
First Steps with Java CardEric Vétillard
 
Prisoner Management System
Prisoner Management SystemPrisoner Management System
Prisoner Management SystemPrince Kumar
 
Coding for Desktop & Mobile with HTML5 & Java EE
Coding for Desktop & Mobile with HTML5 & Java EECoding for Desktop & Mobile with HTML5 & Java EE
Coding for Desktop & Mobile with HTML5 & Java EEGeertjan Wielenga
 
Batch Applications for the Java Platform
Batch Applications for the Java PlatformBatch Applications for the Java Platform
Batch Applications for the Java PlatformSivakumar Thyagarajan
 
IOUG Collaborate 2014 ASH/AWR Deep Dive
IOUG Collaborate 2014 ASH/AWR Deep DiveIOUG Collaborate 2014 ASH/AWR Deep Dive
IOUG Collaborate 2014 ASH/AWR Deep DiveKellyn Pot'Vin-Gorman
 
JavaOne San Francisco 2013 - Servlet 3.1 (JSR 340)
JavaOne San Francisco 2013 - Servlet 3.1 (JSR 340)JavaOne San Francisco 2013 - Servlet 3.1 (JSR 340)
JavaOne San Francisco 2013 - Servlet 3.1 (JSR 340)Shing Wai Chan
 
B2 whats new with oracle exalogic worlds best foundation for applications
B2   whats new with oracle exalogic worlds best foundation for applicationsB2   whats new with oracle exalogic worlds best foundation for applications
B2 whats new with oracle exalogic worlds best foundation for applicationsDr. Wilfred Lin (Ph.D.)
 
Java EE 7 - Novidades e Mudanças
Java EE 7 - Novidades e MudançasJava EE 7 - Novidades e Mudanças
Java EE 7 - Novidades e MudançasBruno Borges
 
New PLSQL in Oracle Database 12c
New PLSQL in Oracle Database 12cNew PLSQL in Oracle Database 12c
New PLSQL in Oracle Database 12cConnor McDonald
 
Working with databases in Android
Working with databases in AndroidWorking with databases in Android
Working with databases in AndroidStephen Gilmore
 

Semelhante a Александр Ильин, Oracle (20)

As novidades do Java EE 7: do HTML5 ao JMS 2.0
As novidades do Java EE 7: do HTML5 ao JMS 2.0As novidades do Java EE 7: do HTML5 ao JMS 2.0
As novidades do Java EE 7: do HTML5 ao JMS 2.0
 
Introduction to JavaFX on Raspberry Pi
Introduction to JavaFX on Raspberry PiIntroduction to JavaFX on Raspberry Pi
Introduction to JavaFX on Raspberry Pi
 
JavaFX and JEE 7
JavaFX and JEE 7JavaFX and JEE 7
JavaFX and JEE 7
 
Aplicações HTML5 com Java EE 7 e NetBeans
Aplicações HTML5 com Java EE 7 e NetBeansAplicações HTML5 com Java EE 7 e NetBeans
Aplicações HTML5 com Java EE 7 e NetBeans
 
Innovations in Oracle Database 12c - 2015
Innovations in Oracle Database 12c - 2015Innovations in Oracle Database 12c - 2015
Innovations in Oracle Database 12c - 2015
 
A Importância do JavaFX no Mercado Embedded
A Importância do JavaFX no Mercado EmbeddedA Importância do JavaFX no Mercado Embedded
A Importância do JavaFX no Mercado Embedded
 
12 things about Oracle 12c
12 things about Oracle 12c12 things about Oracle 12c
12 things about Oracle 12c
 
whats-new-netbeans-ide-80.pptx
whats-new-netbeans-ide-80.pptxwhats-new-netbeans-ide-80.pptx
whats-new-netbeans-ide-80.pptx
 
Java API for WebSocket 1.0: Java EE 7 and GlassFish
Java API for WebSocket 1.0: Java EE 7 and GlassFishJava API for WebSocket 1.0: Java EE 7 and GlassFish
Java API for WebSocket 1.0: Java EE 7 and GlassFish
 
First Steps with Java Card
First Steps with Java CardFirst Steps with Java Card
First Steps with Java Card
 
Prisoner Management System
Prisoner Management SystemPrisoner Management System
Prisoner Management System
 
Coding for Desktop & Mobile with HTML5 & Java EE
Coding for Desktop & Mobile with HTML5 & Java EECoding for Desktop & Mobile with HTML5 & Java EE
Coding for Desktop & Mobile with HTML5 & Java EE
 
Batch Applications for the Java Platform
Batch Applications for the Java PlatformBatch Applications for the Java Platform
Batch Applications for the Java Platform
 
IOUG Collaborate 2014 ASH/AWR Deep Dive
IOUG Collaborate 2014 ASH/AWR Deep DiveIOUG Collaborate 2014 ASH/AWR Deep Dive
IOUG Collaborate 2014 ASH/AWR Deep Dive
 
JavaOne San Francisco 2013 - Servlet 3.1 (JSR 340)
JavaOne San Francisco 2013 - Servlet 3.1 (JSR 340)JavaOne San Francisco 2013 - Servlet 3.1 (JSR 340)
JavaOne San Francisco 2013 - Servlet 3.1 (JSR 340)
 
B2 whats new with oracle exalogic worlds best foundation for applications
B2   whats new with oracle exalogic worlds best foundation for applicationsB2   whats new with oracle exalogic worlds best foundation for applications
B2 whats new with oracle exalogic worlds best foundation for applications
 
Java EE 7 - Novidades e Mudanças
Java EE 7 - Novidades e MudançasJava EE 7 - Novidades e Mudanças
Java EE 7 - Novidades e Mudanças
 
New PLSQL in Oracle Database 12c
New PLSQL in Oracle Database 12cNew PLSQL in Oracle Database 12c
New PLSQL in Oracle Database 12c
 
Working with databases in Android
Working with databases in AndroidWorking with databases in Android
Working with databases in Android
 
Odi12c step
Odi12c stepOdi12c step
Odi12c step
 

Mais de Nata_Churda

Александра Алябьева "Поиск IT-специалистов. Шагнем за рамки привычного?"
Александра Алябьева "Поиск IT-специалистов. Шагнем за рамки привычного?"Александра Алябьева "Поиск IT-специалистов. Шагнем за рамки привычного?"
Александра Алябьева "Поиск IT-специалистов. Шагнем за рамки привычного?"Nata_Churda
 
Алексей Аболмасов "Критерии сильного HR-решения"
Алексей Аболмасов "Критерии сильного HR-решения"Алексей Аболмасов "Критерии сильного HR-решения"
Алексей Аболмасов "Критерии сильного HR-решения"Nata_Churda
 
«Хайлоад в рассылке почты: как спать спокойно»
«Хайлоад в рассылке почты: как спать спокойно»«Хайлоад в рассылке почты: как спать спокойно»
«Хайлоад в рассылке почты: как спать спокойно»Nata_Churda
 
«Лучшие предложения aviasales.ru, или как не упустить важное среди 150 миллио...
«Лучшие предложения aviasales.ru, или как не упустить важное среди 150 миллио...«Лучшие предложения aviasales.ru, или как не упустить важное среди 150 миллио...
«Лучшие предложения aviasales.ru, или как не упустить важное среди 150 миллио...Nata_Churda
 
«Механизмы обновления платформы и окружений пользователей в Jelastic»
«Механизмы обновления платформы и окружений пользователей в Jelastic»«Механизмы обновления платформы и окружений пользователей в Jelastic»
«Механизмы обновления платформы и окружений пользователей в Jelastic»Nata_Churda
 
«PRFLR - OpenSource инструмент для анализа производительности кода»
«PRFLR - OpenSource инструмент для анализа производительности кода»«PRFLR - OpenSource инструмент для анализа производительности кода»
«PRFLR - OpenSource инструмент для анализа производительности кода»Nata_Churda
 
«Делимся опытом разработки высоконагруженных мобильных приложений на примере ...
«Делимся опытом разработки высоконагруженных мобильных приложений на примере ...«Делимся опытом разработки высоконагруженных мобильных приложений на примере ...
«Делимся опытом разработки высоконагруженных мобильных приложений на примере ...Nata_Churda
 
«Как ради производительности высоконагруженного приложения мы разработали соб...
«Как ради производительности высоконагруженного приложения мы разработали соб...«Как ради производительности высоконагруженного приложения мы разработали соб...
«Как ради производительности высоконагруженного приложения мы разработали соб...Nata_Churda
 
«Облачная платформа Windows Azure для высоконагруженных проектов»
«Облачная платформа Windows Azure для высоконагруженных проектов»«Облачная платформа Windows Azure для высоконагруженных проектов»
«Облачная платформа Windows Azure для высоконагруженных проектов»Nata_Churda
 
Алена Новоселова, Яндекс.Деньги
Алена Новоселова, Яндекс.ДеньгиАлена Новоселова, Яндекс.Деньги
Алена Новоселова, Яндекс.ДеньгиNata_Churda
 
Артем Кумпель, ITmozg
Артем Кумпель, ITmozgАртем Кумпель, ITmozg
Артем Кумпель, ITmozgNata_Churda
 
Белогрудов Владислав, EMC
Белогрудов Владислав, EMCБелогрудов Владислав, EMC
Белогрудов Владислав, EMCNata_Churda
 
Анатолий Кондратьев, Exigen Services
Анатолий Кондратьев, Exigen ServicesАнатолий Кондратьев, Exigen Services
Анатолий Кондратьев, Exigen ServicesNata_Churda
 
Алексей Николаенков, Devexperts
Алексей Николаенков, DevexpertsАлексей Николаенков, Devexperts
Алексей Николаенков, DevexpertsNata_Churda
 
Анна Ященко, Google
Анна Ященко, GoogleАнна Ященко, Google
Анна Ященко, GoogleNata_Churda
 
Акулов Егор, Mail.ru Group
Акулов Егор, Mail.ru GroupАкулов Егор, Mail.ru Group
Акулов Егор, Mail.ru GroupNata_Churda
 
Елизавета Штофф, iChar
Елизавета Штофф, iCharЕлизавета Штофф, iChar
Елизавета Штофф, iCharNata_Churda
 
Шпунтенко Ольга, Mail.ru Group
Шпунтенко Ольга, Mail.ru GroupШпунтенко Ольга, Mail.ru Group
Шпунтенко Ольга, Mail.ru GroupNata_Churda
 
Екатерина Евсеева, ITmozg
Екатерина Евсеева, ITmozgЕкатерина Евсеева, ITmozg
Екатерина Евсеева, ITmozgNata_Churda
 
Александр Ильин, Oracle
Александр Ильин, OracleАлександр Ильин, Oracle
Александр Ильин, OracleNata_Churda
 

Mais de Nata_Churda (20)

Александра Алябьева "Поиск IT-специалистов. Шагнем за рамки привычного?"
Александра Алябьева "Поиск IT-специалистов. Шагнем за рамки привычного?"Александра Алябьева "Поиск IT-специалистов. Шагнем за рамки привычного?"
Александра Алябьева "Поиск IT-специалистов. Шагнем за рамки привычного?"
 
Алексей Аболмасов "Критерии сильного HR-решения"
Алексей Аболмасов "Критерии сильного HR-решения"Алексей Аболмасов "Критерии сильного HR-решения"
Алексей Аболмасов "Критерии сильного HR-решения"
 
«Хайлоад в рассылке почты: как спать спокойно»
«Хайлоад в рассылке почты: как спать спокойно»«Хайлоад в рассылке почты: как спать спокойно»
«Хайлоад в рассылке почты: как спать спокойно»
 
«Лучшие предложения aviasales.ru, или как не упустить важное среди 150 миллио...
«Лучшие предложения aviasales.ru, или как не упустить важное среди 150 миллио...«Лучшие предложения aviasales.ru, или как не упустить важное среди 150 миллио...
«Лучшие предложения aviasales.ru, или как не упустить важное среди 150 миллио...
 
«Механизмы обновления платформы и окружений пользователей в Jelastic»
«Механизмы обновления платформы и окружений пользователей в Jelastic»«Механизмы обновления платформы и окружений пользователей в Jelastic»
«Механизмы обновления платформы и окружений пользователей в Jelastic»
 
«PRFLR - OpenSource инструмент для анализа производительности кода»
«PRFLR - OpenSource инструмент для анализа производительности кода»«PRFLR - OpenSource инструмент для анализа производительности кода»
«PRFLR - OpenSource инструмент для анализа производительности кода»
 
«Делимся опытом разработки высоконагруженных мобильных приложений на примере ...
«Делимся опытом разработки высоконагруженных мобильных приложений на примере ...«Делимся опытом разработки высоконагруженных мобильных приложений на примере ...
«Делимся опытом разработки высоконагруженных мобильных приложений на примере ...
 
«Как ради производительности высоконагруженного приложения мы разработали соб...
«Как ради производительности высоконагруженного приложения мы разработали соб...«Как ради производительности высоконагруженного приложения мы разработали соб...
«Как ради производительности высоконагруженного приложения мы разработали соб...
 
«Облачная платформа Windows Azure для высоконагруженных проектов»
«Облачная платформа Windows Azure для высоконагруженных проектов»«Облачная платформа Windows Azure для высоконагруженных проектов»
«Облачная платформа Windows Azure для высоконагруженных проектов»
 
Алена Новоселова, Яндекс.Деньги
Алена Новоселова, Яндекс.ДеньгиАлена Новоселова, Яндекс.Деньги
Алена Новоселова, Яндекс.Деньги
 
Артем Кумпель, ITmozg
Артем Кумпель, ITmozgАртем Кумпель, ITmozg
Артем Кумпель, ITmozg
 
Белогрудов Владислав, EMC
Белогрудов Владислав, EMCБелогрудов Владислав, EMC
Белогрудов Владислав, EMC
 
Анатолий Кондратьев, Exigen Services
Анатолий Кондратьев, Exigen ServicesАнатолий Кондратьев, Exigen Services
Анатолий Кондратьев, Exigen Services
 
Алексей Николаенков, Devexperts
Алексей Николаенков, DevexpertsАлексей Николаенков, Devexperts
Алексей Николаенков, Devexperts
 
Анна Ященко, Google
Анна Ященко, GoogleАнна Ященко, Google
Анна Ященко, Google
 
Акулов Егор, Mail.ru Group
Акулов Егор, Mail.ru GroupАкулов Егор, Mail.ru Group
Акулов Егор, Mail.ru Group
 
Елизавета Штофф, iChar
Елизавета Штофф, iCharЕлизавета Штофф, iChar
Елизавета Штофф, iChar
 
Шпунтенко Ольга, Mail.ru Group
Шпунтенко Ольга, Mail.ru GroupШпунтенко Ольга, Mail.ru Group
Шпунтенко Ольга, Mail.ru Group
 
Екатерина Евсеева, ITmozg
Екатерина Евсеева, ITmozgЕкатерина Евсеева, ITmozg
Екатерина Евсеева, ITmozg
 
Александр Ильин, Oracle
Александр Ильин, OracleАлександр Ильин, Oracle
Александр Ильин, Oracle
 

Último

Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024The Digital Insurer
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native ApplicationsWSO2
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdflior mazor
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoffsammart93
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CVKhem
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...DianaGray10
 
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu SubbuApidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbuapidays
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodJuan lago vázquez
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century educationjfdjdjcjdnsjd
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherRemote DBA Services
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDropbox
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyKhushali Kathiriya
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxRustici Software
 
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024The Digital Insurer
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 

Último (20)

Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu SubbuApidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 

Александр Ильин, Oracle

  • 1. Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 131
  • 2. Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 132 Что нового в JDK 8 Александр Ильин Архитектор тестирования JDK
  • 3. Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 133 The following is intended to outline our general product direction. It is intended for information purposes only, and may not be incorporated into any contract. It is not a commitment to deliver any material, code, or functionality, and should not be relied upon in making purchasing decisions. The development, release, and timing of any features or functionality described for Oracle’s products remains at the sole discretion of Oracle.
  • 4. Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 134Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 16 Program Agenda  50+ изменений  DateTime API  Type annotations  Profiles  Lambda http://openjdk.java.net/projects/jdk8/features
  • 5. Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 135 JDK 8 Java for Everyone • Профайлы • JSR 310 - Date & Time APIs • Non-Gregorian calendars • Unicode 6.1 • ResourceBundle • BCP47 locale matching ● Globalization & Accessibility Innovation • Lambda (замыкания) • Language Interop • Nashorn Core Libraries • “Параллельные” коллекции Improvements in functionality • Improved type inference Security • Ограничение doPrivilege • NSA Suite B algorithm support • Поддержка SNI Server Side • DSA обновление FIPS186-3 • AEAD JSSE CipherSuites Tools • Управление компилятором • JSR 308 – аннотации Java- типов • Нативные пакеты • Инструменты для App Store Client ● Новые методы развертывания ● JavaFX 8 ● Public UI Control API ● ПоддержкаEmbedded ● Поддержка HTML5 ● 3D формы и атрибуты ● Система печати General Goodness • Улучшения в JVM • No PermGen • Производительность
  • 6. Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 136 Date & Time API: JSR 310
  • 7. Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 137 Instant start = Instant.ofEpochMilli(123450L); Instant end = Instant.now(); Duration duration = Duration.ofSeconds(12); Duration bigger = duration.multipliedBy(4); Duration biggest = bigger.plus(duration); Instant later = start.plus(duration); Instant earlier = start.minus(duration); Date & Time
  • 8. Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 138 LocalDate ld = LocalDate.of(2010, Month.DECEMBER, 3); LocalDateTime ldt = LocalDateTime.of(date, LocalTime.of(12, 33)); ZonedDateTime zdt = ZonedDateTime.of(dateTime, zoneId); zdt = zdt.minus(12, HOURS); long days = DAYS.between(date1, date2); Period period = Period.between(date1, date2); Date & Time
  • 9. Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 139 Type annotations: JSR 308
  • 10. Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 1310 Аннотации в Java до Java 8  @Target – ANNOTATION_TYPE, CONSTRUCTOR, FIELD, LOCAL_VARIABLE, METHOD, PACKAGE, PARAMETER, TYPE  @Retention – SOURCE, CLASS, RUNTIME  Поля, значения по умолчанию – @Test(timeout=100) – Primitive, String, Class, enum, array of the above  Нет наследования
  • 11. Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 1311 Аннотации в Java 8  Могут быть использованы на любом использовании типа – Информация на следующих слайдах ...  @Target – TYPE_PARAMETER, TYPE_USE  Повторяющиеся аннотации @
  • 12. Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 1312 JSR 308: Annotations on Java Types (1)  method receivers public int size() @Readonly { ... }  generic type arguments Map<@NonNull String, @NonEmpty List<@Readonly Document>> files;  arrays Document[][@Readonly] docs2 = new Document[2] [@Readonly 12];
  • 13. Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 1313 JSR 308: Annotations on Java Types (2)  typecasts myString = (@NonNull String)myObject;  type tests boolean isNonNull = myString instanceof @NonNull String;  object creation new @NonEmpty @Readonly List(myNonEmptyStringSet)
  • 14. Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 1314 JSR 308: Annotations on Java Types (3)  type parameter bounds <T extends @A Object, U extends @C Cloneable>  class inheritance class UnmodifiableList implements @Readonly List<@Readonly T> { ... }  throws clauses void monitorTemperature() throws @Critical TemperatureException { ... }
  • 15. Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 1315 Nullness checker Если Nullness checker не рапортует ошибок для какой-либо программы, тогда во время выполнения этой программы никогда не будет брошено null pointer exception. @Nullable Object obj; @NonNull Object nnobj; ... nnobj.toString(); obj.toString(); nnobj = obj; obj = nnobj; if (nnobj == null) ... if (obj != null) { nnobj = obj; //type refinement }
  • 16. Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 1316 Lock checker Если Lock checker не рапортует ошибок для какой-либо программы, тогда программа держит определенный монитор каждый раз когда доступается до переменной.  @GuardedBy – доступ разрешен только если держится определенный монитор  @Holding – вызов разрешен только если держится определенный монитор
  • 17. Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 1317 Lock checker @GuardedBy("MyClass.myLock") Object myMethod() { ... } @GuardedBy("MyClass.myLock") Object x = myMethod(); @GuardedBy("MyClass.myLock") Object y = x; Object z = x; x.toString(); synchronized(MyClass.myLock) { y.toString(); }
  • 18. Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 1318 Lock checker void helper1(@GuardedBy("MyClass.myLock") Object a) { a.toString(); synchronized(MyClass.myLock) { a.toString(); } } @Holding("MyClass.myLock") void helper2(@GuardedBy("MyClass.myLock") Object b) { b.toString(); }
  • 19. Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 1319 JDK profiles
  • 20. Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 1320 base tls logging authjdbc jtarmi jaxp naming rowset kerberos management compiler xmldsig prefs sctp instrument scripting crypto compat management.iiop cosnaming corba desktop tools.jre jaxws jx.annotations httpserver tools tools.jaxws tools.base devtools
  • 21. Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 1321 base tls logging authjdbc jtarmi jaxp naming rowset kerberos management compiler xmldsig prefs sctp instrument scripting crypto compat management.iiop cosnaming corba desktop tools.jre jaxws jx.annotations httpserver tools tools.jaxws tools.base devtools 52MB
  • 22. Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 1322 base tls logging authjdbc jtarmi jaxp naming rowset kerberos management compiler xmldsig prefs sctp instrument scripting crypto compat management.iiop cosnaming corba desktop tools.jre jaxws jx.annotations httpserver tools tools.jaxws tools.base devtools 52MB 24
  • 23. Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 1323 base tls logging authjdbc jtarmi jaxp naming rowset kerberos management compiler xmldsig prefs sctp instrument scripting crypto compat management.iiop cosnaming corba desktop tools.jre jaxws jx.annotations httpserver tools tools.jaxws tools.base devtools 52MB 1724
  • 24. Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 1324 base tls logging authjdbc jtarmi jaxp naming rowset kerberos management compiler xmldsig prefs sctp instrument scripting crypto compat management.iiop cosnaming corba desktop tools.jre jaxws jx.annotations httpserver tools tools.jaxws tools.base devtools 1052MB 1724
  • 25. Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 1325 Lambda: JSR 335
  • 26. Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 1326 Lambda  Лямбда (Object o) -> (o.toString());  Ссылка на метод Object::toString()  Метод по умолчанию Collection.forEach(java.util.function.Block)  Collections shapes.stream().filter(s s.getColor() == BLUE). map(s s.getWeight()).sum();
  • 27. Copyright © 2012, Oracle and/or its affiliates. All rights reserved.27 Функциональные интерфейсы Интерфейс с одним методом ● Runnable, Comparator, ActionListener ● Predicate<T>, Block<T> Лямбда - экземпляр функционального интерфейса Predicate<String> isEmpty = s s.isEmpty(); Predicate<String> isEmpty = String::isEmpty; Runnable r = () {System.out.println(“Boo!”) };
  • 28. Copyright © 2012, Oracle and/or its affiliates. All rights reserved.28 Эволюция интерфейсов  Палка о двух концах – Гибкость • Специфицирован только API – Невозможно изменить • Требуется менять все имплементации
  • 29. Copyright © 2012, Oracle and/or its affiliates. All rights reserved.29 Методы по умолчанию interface Collection<E> { default void forEach(Block<E> action) { for (E e: this) action.apply(e); } default boolean removeIf(Predicate<? super E> filter) { boolean removed = false; Iterator<E> each = iterator(); while ( each.hasNext() ) { if ( filter.test( each.next() ) ) { each.remove(); removed = true; } } return removed; } }
  • 30. Copyright © 2012, Oracle and/or its affiliates. All rights reserved.30 Методы по умолчанию Множественное наследование?  Интерфейса  Поведения  Состояния
  • 31. Copyright © 2012, Oracle and/or its affiliates. All rights reserved.31 Методы по умолчанию Множественное наследование?  Интерфейса  Поведения  Состояния было всегда
  • 32. Copyright © 2012, Oracle and/or its affiliates. All rights reserved.32 Методы по умолчанию Множественное наследование?  Интерфейса  Поведения  Состояния было всегдабыло всегда методы по умолчанию
  • 33. Copyright © 2012, Oracle and/or its affiliates. All rights reserved.33 Методы по умолчанию Множественное наследование?  Интерфейса  Поведения  Состояния методы по умолчанию было всегда
  • 34. Copyright © 2012, Oracle and/or its affiliates. All rights reserved.34 Методы по умолчанию Множественное наследование? 1.Класс побеждает 2.Более специфичный интерфейс предпочтительней 3.Во всех остальных случаях пользователь должен предоставить реализацию  Интерфейса  Поведения  Состояния было всегда методы по умолчанию
  • 35. Copyright © 2012, Oracle and/or its affiliates. All rights reserved.35 Diamonds? Нет проблем! interface A { default void m() {…} } interface B extends A {…} interface C extends A {…} class D implements B, C {...} A B C D m
  • 36. Copyright © 2012, Oracle and/or its affiliates. All rights reserved.36 Diamonds? Нет проблем! interface A { default void m() {…} } interface B extends A { default void m() {…} } interface C extends A {...} сlass D implements B, C {...} A B C D m m
  • 37. Copyright © 2012, Oracle and/or its affiliates. All rights reserved.37 Явное разрешение неоднозначности interface A { default void m() {…} } interface B { default void m() {…} } class C implements A, B { //Must implement/reabstract m() void m() { A.super.m(); } } A B D m m
  • 38. Copyright © 2012, Oracle and/or its affiliates. All rights reserved.38 Cортировка Collections.sort(people, new Comparator<Person>() { public int compare(Person x, Person y) { return x.getLastName().compareTo(y.getLastName()); } });
  • 39. Copyright © 2012, Oracle and/or its affiliates. All rights reserved.39 Сортировка с лямбдой Comparator<Person> byLastName = comparing(p p.getLastName()); Collections.sort(people, byLastName); Collections.sort(people, comparing(p p.getLastName())); people.sort(comparing(p p.getLastName()))
  • 40. Copyright © 2012, Oracle and/or its affiliates. All rights reserved.40 Сортировка с лямбдой people.sort(comparing(Person::getLastName)) people.sort(comparing(Person::getLastName).reverse()); people.sort(comparing(Person::getLastName) .compose(comparing(Person::getFirstName)));
  • 41. Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 1341 Что нового в JDK 8 Александр Ильин Архитектор тестирования JDK