Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_langtools
提交
93d8737c
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看板
提交
93d8737c
编写于
3月 26, 2013
作者:
D
darcy
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
7041251: Use j.u.Objects utility methods in langtools
Reviewed-by: jjg
上级
a6775058
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
8 addition
and
10 deletion
+8
-10
src/share/classes/com/sun/tools/javac/util/Pair.java
src/share/classes/com/sun/tools/javac/util/Pair.java
+5
-7
src/share/classes/javax/annotation/processing/AbstractProcessor.java
...lasses/javax/annotation/processing/AbstractProcessor.java
+3
-3
未找到文件。
src/share/classes/com/sun/tools/javac/util/Pair.java
浏览文件 @
93d8737c
/*
/*
* Copyright (c) 1999, 20
05
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1999, 20
13
, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
*
* This code is free software; you can redistribute it and/or modify it
* This code is free software; you can redistribute it and/or modify it
...
@@ -25,6 +25,8 @@
...
@@ -25,6 +25,8 @@
package
com.sun.tools.javac.util
;
package
com.sun.tools.javac.util
;
import
java.util.Objects
;
/** A generic class for pairs.
/** A generic class for pairs.
*
*
* <p><b>This is NOT part of any supported API.
* <p><b>This is NOT part of any supported API.
...
@@ -46,15 +48,11 @@ public class Pair<A, B> {
...
@@ -46,15 +48,11 @@ public class Pair<A, B> {
return
"Pair["
+
fst
+
","
+
snd
+
"]"
;
return
"Pair["
+
fst
+
","
+
snd
+
"]"
;
}
}
private
static
boolean
equals
(
Object
x
,
Object
y
)
{
return
(
x
==
null
&&
y
==
null
)
||
(
x
!=
null
&&
x
.
equals
(
y
));
}
public
boolean
equals
(
Object
other
)
{
public
boolean
equals
(
Object
other
)
{
return
return
other
instanceof
Pair
<?,?>
&&
other
instanceof
Pair
<?,?>
&&
equals
(
fst
,
((
Pair
<?,?>)
other
).
fst
)
&&
Objects
.
equals
(
fst
,
((
Pair
<?,?>)
other
).
fst
)
&&
equals
(
snd
,
((
Pair
<?,?>)
other
).
snd
);
Objects
.
equals
(
snd
,
((
Pair
<?,?>)
other
).
snd
);
}
}
public
int
hashCode
()
{
public
int
hashCode
()
{
...
...
src/share/classes/javax/annotation/processing/AbstractProcessor.java
浏览文件 @
93d8737c
/*
/*
* Copyright (c) 2005, 20
06
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2005, 20
13
, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
*
* This code is free software; you can redistribute it and/or modify it
* This code is free software; you can redistribute it and/or modify it
...
@@ -28,6 +28,7 @@ package javax.annotation.processing;
...
@@ -28,6 +28,7 @@ package javax.annotation.processing;
import
java.util.Set
;
import
java.util.Set
;
import
java.util.HashSet
;
import
java.util.HashSet
;
import
java.util.Collections
;
import
java.util.Collections
;
import
java.util.Objects
;
import
javax.lang.model.element.*
;
import
javax.lang.model.element.*
;
import
javax.lang.model.SourceVersion
;
import
javax.lang.model.SourceVersion
;
import
javax.tools.Diagnostic
;
import
javax.tools.Diagnostic
;
...
@@ -146,8 +147,7 @@ public abstract class AbstractProcessor implements Processor {
...
@@ -146,8 +147,7 @@ public abstract class AbstractProcessor implements Processor {
public
synchronized
void
init
(
ProcessingEnvironment
processingEnv
)
{
public
synchronized
void
init
(
ProcessingEnvironment
processingEnv
)
{
if
(
initialized
)
if
(
initialized
)
throw
new
IllegalStateException
(
"Cannot call init more than once."
);
throw
new
IllegalStateException
(
"Cannot call init more than once."
);
if
(
processingEnv
==
null
)
Objects
.
requireNonNull
(
processingEnv
,
"Tool provided null ProcessingEnvironment"
);
throw
new
NullPointerException
(
"Tool provided null ProcessingEnvironment"
);
this
.
processingEnv
=
processingEnv
;
this
.
processingEnv
=
processingEnv
;
initialized
=
true
;
initialized
=
true
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录