/
githubmirror
/
panama-vector
Обзор
Документация
Войти
/
githubmirror
/
panama-vector
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
test/langtools/tools/javac/lambda/8071432/T8071432.java
50 строк
1 KB
Archie L. Cobbs
8163229: several regression tests have a main method that is never executed
17 янв 2023, 07:43
17 янв 2023, 07:43
382fe51
Код
Авторство
О чём код?
/* * @test /nodynamiccopyright/ * @bug 8071432 8069545 * @summary structural most specific and stuckness * @compile/fail/ref=T8071432.out -XDrawDiagnostics T8071432.java */ import java.util.Arrays; import java.util.Collection; class T8071432 { static class Point { private double x, y; public Point(double x, double y) { this.x = x; this.y = y; } public double getX() { return x; } public double getY() { return y; } public double distance(Point p) { return Math.sqrt((this.x - p.x) * (this.x - p.x) + (this.y - p.y) * (this.y - p.y)); } public double distance() { return Math.sqrt(this.x * this.x + this.y * this.y); } public String toString() { return "(" + x + ":" + y + ")"; } } public static void meth() { Collection<Point> c = Arrays.asList(new Point(1.0, 0.1)); System.out.println("------- 1 ---------------"); System.out.println(c.stream().reduce(0.0, (s, p) -> s += p.distance(), (d1, d2) -> 0)); } }