Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_langtools
提交
6cfa552a
D
dragonwell8_langtools
项目概览
openanolis
/
dragonwell8_langtools
通知
0
Star
2
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
D
dragonwell8_langtools
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
6cfa552a
编写于
4月 01, 2015
作者:
L
lana
浏览文件
操作
浏览文件
下载
差异文件
Merge
上级
602c8279
20245551
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
225 addition
and
5 deletion
+225
-5
src/share/classes/com/sun/tools/javac/comp/DeferredAttr.java
src/share/classes/com/sun/tools/javac/comp/DeferredAttr.java
+3
-2
test/tools/javac/lambda/8016177/T8016177g.java
test/tools/javac/lambda/8016177/T8016177g.java
+1
-1
test/tools/javac/lambda/8016177/T8016177g.out
test/tools/javac/lambda/8016177/T8016177g.out
+3
-2
test/tools/javac/lambda/8068399/T8068399.java
test/tools/javac/lambda/8068399/T8068399.java
+119
-0
test/tools/javac/lambda/8068430/T8068430.java
test/tools/javac/lambda/8068430/T8068430.java
+46
-0
test/tools/javac/lambda/8071432/T8071432.java
test/tools/javac/lambda/8071432/T8071432.java
+50
-0
test/tools/javac/lambda/8071432/T8071432.out
test/tools/javac/lambda/8071432/T8071432.out
+3
-0
未找到文件。
src/share/classes/com/sun/tools/javac/comp/DeferredAttr.java
浏览文件 @
6cfa552a
/*
* Copyright (c) 2012, 201
4
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2012, 201
5
, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
...
...
@@ -224,7 +224,8 @@ public class DeferredAttr extends JCTree.Visitor {
DeferredStuckPolicy
deferredStuckPolicy
;
if
(
resultInfo
.
pt
.
hasTag
(
NONE
)
||
resultInfo
.
pt
.
isErroneous
())
{
deferredStuckPolicy
=
dummyStuckPolicy
;
}
else
if
(
resultInfo
.
checkContext
.
deferredAttrContext
().
mode
==
AttrMode
.
SPECULATIVE
)
{
}
else
if
(
resultInfo
.
checkContext
.
deferredAttrContext
().
mode
==
AttrMode
.
SPECULATIVE
||
resultInfo
.
checkContext
.
deferredAttrContext
().
insideOverloadPhase
())
{
deferredStuckPolicy
=
new
OverloadStuckPolicy
(
resultInfo
,
this
);
}
else
{
deferredStuckPolicy
=
new
CheckStuckPolicy
(
resultInfo
,
this
);
...
...
test/tools/javac/lambda/8016177/T8016177g.java
浏览文件 @
6cfa552a
/*
* @test /nodynamiccopyright/
* @bug 8016081 8016178
* @bug 8016081 8016178
8069545
* @summary structural most specific and stuckness
* @compile/fail/ref=T8016177g.out -XDrawDiagnostics T8016177g.java
*/
...
...
test/tools/javac/lambda/8016177/T8016177g.out
浏览文件 @
6cfa552a
T8016177g.java:35:20: compiler.err.prob.found.req: (compiler.misc.possible.loss.of.precision: double, int)
1 error
T8016177g.java:34:14: compiler.err.cant.apply.symbol: kindname.method, print, java.lang.String, Test.Person, kindname.class, Test, (compiler.misc.no.conforming.assignment.exists: (compiler.misc.inferred.do.not.conform.to.upper.bounds: Test.Person, java.lang.String,java.lang.Object))
T8016177g.java:35:20: compiler.err.cant.apply.symbol: kindname.method, abs, int, java.lang.Double, kindname.class, Test, (compiler.misc.no.conforming.assignment.exists: (compiler.misc.infer.no.conforming.instance.exists: , R, int))
2 errors
test/tools/javac/lambda/8068399/T8068399.java
0 → 100644
浏览文件 @
6cfa552a
/*
* Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/*
* @test
* @bug 8068399
* @summary structural most specific and stuckness
*/
import
java.util.function.Function
;
import
java.util.stream.IntStream
;
import
java.util.stream.Stream
;
public
class
T8068399
{
public
static
class
Spectrum
{
public
double
[]
getEnergy
()
{
return
new
double
[
0
];
}
}
protected
Spectrum
spectrum
;
public
static
class
Ref
<
T
>
{
T
value
;
public
Ref
()
{
}
public
Ref
(
T
value
)
{
this
.
value
=
value
;
}
public
boolean
isNull
()
{
return
value
==
null
;
}
public
T
get
()
{
return
value
;
}
public
void
set
(
T
value
)
{
this
.
value
=
value
;
}
}
public
static
<
T
>
T
maxKey
(
Stream
<
T
>
stream
,
Function
<
T
,
Double
>
function
)
{
Ref
<
Double
>
max
=
new
Ref
<>();
Ref
<
T
>
index
=
new
Ref
<>();
stream
.
forEach
(
v
->
{
Double
value
=
function
.
apply
(
v
);
if
(
max
.
isNull
()
||
value
>
max
.
get
())
{
max
.
set
(
value
);
index
.
set
(
v
);
}
});
return
index
.
get
();
}
public
static
int
interpolate
(
int
x
,
int
x0
,
int
x1
,
int
y0
,
int
y1
)
{
return
y0
+
(
x
-
x0
)
*
(
y1
-
y0
)
/
(
x1
-
x0
);
}
public
static
double
interpolate
(
double
x
,
double
x0
,
double
x1
,
double
y0
,
double
y1
)
{
return
y0
+
(
x
-
x0
)
*
(
y1
-
y0
)
/
(
x1
-
x0
);
}
protected
int
getXByFrequency
(
double
frequency
)
{
return
(
int
)
Math
.
round
(
interpolate
(
frequency
,
getMinSpectrumCoord
(),
getMaxSpectrumCoord
(),
0
,
getWidth
()));
}
private
int
getWidth
()
{
return
0
;
}
private
double
getMaxSpectrumCoord
()
{
return
0
;
}
private
double
getMinSpectrumCoord
()
{
return
0
;
}
void
foo
()
{
int
maxBpmIndex
=
0
;
int
xcur
=
getXByFrequency
(
maxKey
(
IntStream
.
range
(
0
,
maxBpmIndex
).
boxed
(),
i
->
Math
.
abs
(
spectrum
.
getEnergy
()[
i
])));
}
public
static
void
main
(
String
[]
args
)
{
}
}
test/tools/javac/lambda/8068430/T8068430.java
0 → 100644
浏览文件 @
6cfa552a
/*
* Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/*
* @test
* @bug 8068430
* @summary structural most specific and stuckness
*/
import
java.util.HashMap
;
import
java.util.Map
;
public
class
T8068430
{
public
static
void
main
(
String
[]
args
)
{
Map
<
Integer
,
String
>
mp
=
new
HashMap
<>();
mp
.
put
(
1
,
"a"
);
mp
.
put
(
2
,
"b"
);
mp
.
put
(
3
,
"c"
);
mp
.
put
(
4
,
"d"
);
System
.
out
.
println
(
mp
.
entrySet
().
stream
().
reduce
(
0
,
(
i
,
e
)
->
i
+
e
.
getKey
(),
(
i1
,
i2
)
->
i1
+
i2
));
}
}
\ No newline at end of file
test/tools/javac/lambda/8071432/T8071432.java
0 → 100644
浏览文件 @
6cfa552a
/*
* @test /nodynamiccopyright/
* @bug 8071432
* @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
main
(
String
[]
args
)
{
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
));
}
}
test/tools/javac/lambda/8071432/T8071432.out
0 → 100644
浏览文件 @
6cfa552a
T8071432.java:47:45: compiler.err.prob.found.req: (compiler.misc.infer.no.conforming.assignment.exists: U, (compiler.misc.incompatible.ret.type.in.lambda: (compiler.misc.inconvertible.types: int, java.lang.Double)))
T8071432.java:47:27: compiler.err.cant.apply.symbol: kindname.method, println, java.lang.Object, <any>, kindname.class, java.io.PrintStream, (compiler.misc.no.conforming.assignment.exists: (compiler.misc.infer.no.conforming.assignment.exists: U, (compiler.misc.incompatible.ret.type.in.lambda: (compiler.misc.inconvertible.types: int, java.lang.Double))))
2 errors
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录