Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_langtools
提交
9fd3a915
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看板
提交
9fd3a915
编写于
9月 28, 2012
作者:
M
mcimadamore
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
8000233: Fix issues in recent push
Summary: Forgot to incorporate review comments in pushed changesets Reviewed-by: jjg
上级
292d264a
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
34 addition
and
44 deletion
+34
-44
src/share/classes/com/sun/tools/javac/code/Type.java
src/share/classes/com/sun/tools/javac/code/Type.java
+3
-2
src/share/classes/com/sun/tools/javac/comp/Resolve.java
src/share/classes/com/sun/tools/javac/comp/Resolve.java
+23
-26
src/share/classes/com/sun/tools/javac/jvm/Pool.java
src/share/classes/com/sun/tools/javac/jvm/Pool.java
+6
-10
src/share/classes/com/sun/tools/javac/util/Names.java
src/share/classes/com/sun/tools/javac/util/Names.java
+2
-6
未找到文件。
src/share/classes/com/sun/tools/javac/code/Type.java
浏览文件 @
9fd3a915
...
...
@@ -27,18 +27,19 @@ package com.sun.tools.javac.code;
import
java.util.Collections
;
import
com.sun.tools.javac.util.*
;
import
com.sun.tools.javac.code.Symbol.*
;
import
com.sun.tools.javac.util.*
;
import
java.util.EnumMap
;
import
java.util.EnumSet
;
import
java.util.Map
;
import
java.util.Set
;
import
javax.lang.model.type.*
;
import
static
com
.
sun
.
tools
.
javac
.
code
.
BoundKind
.*;
import
static
com
.
sun
.
tools
.
javac
.
code
.
Flags
.*;
import
static
com
.
sun
.
tools
.
javac
.
code
.
Kinds
.*;
import
static
com
.
sun
.
tools
.
javac
.
code
.
BoundKind
.*;
import
static
com
.
sun
.
tools
.
javac
.
code
.
TypeTags
.*;
/** This class represents Java types. The class itself defines the behavior of
...
...
src/share/classes/com/sun/tools/javac/comp/Resolve.java
浏览文件 @
9fd3a915
...
...
@@ -27,8 +27,8 @@ package com.sun.tools.javac.comp;
import
com.sun.tools.javac.api.Formattable.LocalizedString
;
import
com.sun.tools.javac.code.*
;
import
com.sun.tools.javac.code.Type.*
;
import
com.sun.tools.javac.code.Symbol.*
;
import
com.sun.tools.javac.code.Type.*
;
import
com.sun.tools.javac.comp.Attr.ResultInfo
;
import
com.sun.tools.javac.comp.Check.CheckContext
;
import
com.sun.tools.javac.comp.Infer.InferenceContext
;
...
...
@@ -48,6 +48,7 @@ import java.util.Collection;
import
java.util.EnumMap
;
import
java.util.EnumSet
;
import
java.util.HashSet
;
import
java.util.Iterator
;
import
java.util.Map
;
import
java.util.Set
;
...
...
@@ -60,7 +61,6 @@ import static com.sun.tools.javac.code.Kinds.ERRONEOUS;
import
static
com
.
sun
.
tools
.
javac
.
code
.
TypeTags
.*;
import
static
com
.
sun
.
tools
.
javac
.
comp
.
Resolve
.
MethodResolutionPhase
.*;
import
static
com
.
sun
.
tools
.
javac
.
tree
.
JCTree
.
Tag
.*;
import
java.util.Iterator
;
/** Helper class for name resolution, used mostly by the attribution phase.
*
...
...
@@ -1200,7 +1200,10 @@ public class Resolve {
for
(
TypeSymbol
s
:
superclasses
(
intype
))
{
bestSoFar
=
lookupMethod
(
env
,
site
,
name
,
argtypes
,
typeargtypes
,
s
.
members
(),
bestSoFar
,
allowBoxing
,
useVarargs
,
operator
,
true
);
abstractOk
&=
excludeAbstractsFilter
.
accepts
(
s
);
//We should not look for abstract methods if receiver is a concrete class
//(as concrete classes are expected to implement all abstracts coming
//from superinterfaces)
abstractOk
&=
(
s
.
flags
()
&
(
ABSTRACT
|
INTERFACE
|
ENUM
))
!=
0
;
if
(
abstractOk
)
{
for
(
Type
itype
:
types
.
interfaces
(
s
.
type
))
{
itypes
=
types
.
union
(
types
.
closure
(
itype
),
itypes
);
...
...
@@ -1247,53 +1250,47 @@ public class Resolve {
return
new
Iterator
<
TypeSymbol
>()
{
List
<
TypeSymbol
>
seen
=
List
.
nil
();
TypeSymbol
currentSym
=
getSymbol
(
intype
);
TypeSymbol
currentSym
=
symbolFor
(
intype
);
TypeSymbol
prevSym
=
null
;
public
boolean
hasNext
()
{
if
(
currentSym
==
syms
.
noSymbol
)
{
currentSym
=
symbolFor
(
types
.
supertype
(
prevSym
.
type
));
}
return
currentSym
!=
null
;
}
public
TypeSymbol
next
()
{
TypeSymbol
prevSym
=
currentSym
;
currentSym
=
getSymbol
(
types
.
supertype
(
currentSym
.
type
));
prevSym
=
currentSym
;
currentSym
=
syms
.
noSymbol
;
Assert
.
check
(
prevSym
!=
null
||
prevSym
!=
syms
.
noSymbol
);
return
prevSym
;
}
public
void
remove
()
{
throw
new
UnsupportedOperationException
(
"Not supported yet."
);
throw
new
UnsupportedOperationException
();
}
TypeSymbol
getSymbol
(
Type
intype
)
{
if
(
intype
.
tag
!=
CLASS
&&
intype
.
tag
!=
TYPEVAR
)
{
TypeSymbol
symbolFor
(
Type
t
)
{
if
(
t
.
tag
!=
CLASS
&&
t
.
tag
!=
TYPEVAR
)
{
return
null
;
}
while
(
intype
.
tag
==
TYPEVAR
)
intype
=
intype
.
getUpperBound
();
if
(
seen
.
contains
(
intype
.
tsym
))
{
while
(
t
.
tag
==
TYPEVAR
)
t
=
t
.
getUpperBound
();
if
(
seen
.
contains
(
t
.
tsym
))
{
//degenerate case in which we have a circular
//class hierarchy - because of ill-formed classfiles
return
null
;
}
seen
=
seen
.
prepend
(
intype
.
tsym
);
return
intype
.
tsym
;
seen
=
seen
.
prepend
(
t
.
tsym
);
return
t
.
tsym
;
}
};
}
};
}
/**
* We should not look for abstract methods if receiver is a concrete class
* (as concrete classes are expected to implement all abstracts coming
* from superinterfaces)
*/
Filter
<
Symbol
>
excludeAbstractsFilter
=
new
Filter
<
Symbol
>()
{
public
boolean
accepts
(
Symbol
s
)
{
return
(
s
.
flags
()
&
(
ABSTRACT
|
INTERFACE
|
ENUM
))
!=
0
;
}
};
/**
* Lookup a method with given name and argument types in a given scope
*/
...
...
src/share/classes/com/sun/tools/javac/jvm/Pool.java
浏览文件 @
9fd3a915
...
...
@@ -27,17 +27,17 @@ package com.sun.tools.javac.jvm;
import
com.sun.tools.javac.code.Flags
;
import
com.sun.tools.javac.code.Kinds
;
import
java.util.*
;
import
com.sun.tools.javac.code.Symbol
;
import
com.sun.tools.javac.code.Symbol.*
;
import
com.sun.tools.javac.code.Type
;
import
com.sun.tools.javac.util.ArrayUtils
;
import
com.sun.tools.javac.util.Assert
;
import
com.sun.tools.javac.util.Filter
;
import
com.sun.tools.javac.util.Name
;
import
com.sun.tools.javac.util.Names
;
import
java.util.*
;
/** An internal structure that corresponds to the constant pool of a classfile.
*
* <p><b>This is NOT part of any supported API.
...
...
@@ -177,13 +177,9 @@ public class Pool {
/** Reference symbol */
Symbol
refSym
;
/** Reference to the name table */
Names
names
;
public
MethodHandle
(
int
refKind
,
Symbol
refSym
,
Names
names
)
{
public
MethodHandle
(
int
refKind
,
Symbol
refSym
)
{
this
.
refKind
=
refKind
;
this
.
refSym
=
refSym
;
this
.
names
=
names
;
checkConsistent
();
}
public
boolean
equals
(
Object
other
)
{
...
...
@@ -244,13 +240,13 @@ public class Pool {
//where
Filter
<
Name
>
nonInitFilter
=
new
Filter
<
Name
>()
{
public
boolean
accepts
(
Name
n
)
{
return
n
!=
n
ames
.
init
&&
n
!=
names
.
clinit
;
return
n
!=
n
.
table
.
names
.
init
&&
n
!=
n
.
table
.
names
.
clinit
;
}
};
Filter
<
Name
>
initFilter
=
new
Filter
<
Name
>()
{
public
boolean
accepts
(
Name
n
)
{
return
n
==
names
.
init
;
return
n
==
n
.
table
.
n
ames
.
init
;
}
};
}
...
...
src/share/classes/com/sun/tools/javac/util/Names.java
浏览文件 @
9fd3a915
...
...
@@ -118,6 +118,7 @@ public class Names {
// attribute names
public
final
Name
Annotation
;
public
final
Name
AnnotationDefault
;
public
final
Name
BootstrapMethods
;
public
final
Name
Bridge
;
public
final
Name
CharacterRangeTable
;
public
final
Name
Code
;
...
...
@@ -169,9 +170,6 @@ public class Names {
public
final
Name
ex
;
public
final
Name
package_info
;
// lambda-related
public
final
Name
BootstrapMethods
;
public
final
Name
.
Table
table
;
public
Names
(
Context
context
)
{
...
...
@@ -249,6 +247,7 @@ public class Names {
// attribute names
Annotation
=
fromString
(
"Annotation"
);
AnnotationDefault
=
fromString
(
"AnnotationDefault"
);
BootstrapMethods
=
fromString
(
"BootstrapMethods"
);
Bridge
=
fromString
(
"Bridge"
);
CharacterRangeTable
=
fromString
(
"CharacterRangeTable"
);
Code
=
fromString
(
"Code"
);
...
...
@@ -299,9 +298,6 @@ public class Names {
deprecated
=
fromString
(
"deprecated"
);
ex
=
fromString
(
"ex"
);
package_info
=
fromString
(
"package-info"
);
//lambda-related
BootstrapMethods
=
fromString
(
"BootstrapMethods"
);
}
protected
Name
.
Table
createTable
(
Options
options
)
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录