Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_langtools
提交
de6f1495
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看板
提交
de6f1495
编写于
9月 16, 2008
作者:
J
jjg
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
6574134: Allow for alternative implementation of Name Table with garbage collection of name bytes
Reviewed-by: darcy, mcimadamore
上级
0c25a1a9
变更
44
展开全部
隐藏空白更改
内联
并排
Showing
44 changed file
with
963 addition
and
708 deletion
+963
-708
src/share/classes/com/sun/tools/apt/mirror/AptEnv.java
src/share/classes/com/sun/tools/apt/mirror/AptEnv.java
+3
-3
src/share/classes/com/sun/tools/javac/code/Attribute.java
src/share/classes/com/sun/tools/javac/code/Attribute.java
+1
-1
src/share/classes/com/sun/tools/javac/code/Scope.java
src/share/classes/com/sun/tools/javac/code/Scope.java
+7
-7
src/share/classes/com/sun/tools/javac/code/Symbol.java
src/share/classes/com/sun/tools/javac/code/Symbol.java
+10
-10
src/share/classes/com/sun/tools/javac/code/Symtab.java
src/share/classes/com/sun/tools/javac/code/Symtab.java
+2
-2
src/share/classes/com/sun/tools/javac/code/Type.java
src/share/classes/com/sun/tools/javac/code/Type.java
+2
-2
src/share/classes/com/sun/tools/javac/code/Types.java
src/share/classes/com/sun/tools/javac/code/Types.java
+3
-3
src/share/classes/com/sun/tools/javac/comp/Annotate.java
src/share/classes/com/sun/tools/javac/comp/Annotate.java
+2
-2
src/share/classes/com/sun/tools/javac/comp/Attr.java
src/share/classes/com/sun/tools/javac/comp/Attr.java
+2
-2
src/share/classes/com/sun/tools/javac/comp/Check.java
src/share/classes/com/sun/tools/javac/comp/Check.java
+3
-3
src/share/classes/com/sun/tools/javac/comp/Enter.java
src/share/classes/com/sun/tools/javac/comp/Enter.java
+2
-2
src/share/classes/com/sun/tools/javac/comp/Flow.java
src/share/classes/com/sun/tools/javac/comp/Flow.java
+2
-2
src/share/classes/com/sun/tools/javac/comp/Lower.java
src/share/classes/com/sun/tools/javac/comp/Lower.java
+5
-5
src/share/classes/com/sun/tools/javac/comp/MemberEnter.java
src/share/classes/com/sun/tools/javac/comp/MemberEnter.java
+4
-4
src/share/classes/com/sun/tools/javac/comp/Resolve.java
src/share/classes/com/sun/tools/javac/comp/Resolve.java
+10
-10
src/share/classes/com/sun/tools/javac/comp/TransTypes.java
src/share/classes/com/sun/tools/javac/comp/TransTypes.java
+2
-2
src/share/classes/com/sun/tools/javac/jvm/ClassFile.java
src/share/classes/com/sun/tools/javac/jvm/ClassFile.java
+2
-2
src/share/classes/com/sun/tools/javac/jvm/ClassReader.java
src/share/classes/com/sun/tools/javac/jvm/ClassReader.java
+4
-18
src/share/classes/com/sun/tools/javac/jvm/ClassWriter.java
src/share/classes/com/sun/tools/javac/jvm/ClassWriter.java
+6
-9
src/share/classes/com/sun/tools/javac/jvm/Code.java
src/share/classes/com/sun/tools/javac/jvm/Code.java
+3
-3
src/share/classes/com/sun/tools/javac/jvm/Gen.java
src/share/classes/com/sun/tools/javac/jvm/Gen.java
+3
-3
src/share/classes/com/sun/tools/javac/main/JavaCompiler.java
src/share/classes/com/sun/tools/javac/main/JavaCompiler.java
+3
-3
src/share/classes/com/sun/tools/javac/model/AnnotationProxyMaker.java
...asses/com/sun/tools/javac/model/AnnotationProxyMaker.java
+1
-1
src/share/classes/com/sun/tools/javac/model/JavacElements.java
...hare/classes/com/sun/tools/javac/model/JavacElements.java
+5
-8
src/share/classes/com/sun/tools/javac/parser/JavacParser.java
...share/classes/com/sun/tools/javac/parser/JavacParser.java
+2
-2
src/share/classes/com/sun/tools/javac/parser/Keywords.java
src/share/classes/com/sun/tools/javac/parser/Keywords.java
+6
-5
src/share/classes/com/sun/tools/javac/parser/ParserFactory.java
...are/classes/com/sun/tools/javac/parser/ParserFactory.java
+3
-3
src/share/classes/com/sun/tools/javac/parser/Scanner.java
src/share/classes/com/sun/tools/javac/parser/Scanner.java
+3
-3
src/share/classes/com/sun/tools/javac/processing/JavacProcessingEnvironment.java
...un/tools/javac/processing/JavacProcessingEnvironment.java
+9
-8
src/share/classes/com/sun/tools/javac/tree/Pretty.java
src/share/classes/com/sun/tools/javac/tree/Pretty.java
+5
-5
src/share/classes/com/sun/tools/javac/tree/TreeInfo.java
src/share/classes/com/sun/tools/javac/tree/TreeInfo.java
+7
-7
src/share/classes/com/sun/tools/javac/tree/TreeMaker.java
src/share/classes/com/sun/tools/javac/tree/TreeMaker.java
+3
-3
src/share/classes/com/sun/tools/javac/util/ByteBuffer.java
src/share/classes/com/sun/tools/javac/util/ByteBuffer.java
+2
-2
src/share/classes/com/sun/tools/javac/util/Convert.java
src/share/classes/com/sun/tools/javac/util/Convert.java
+1
-1
src/share/classes/com/sun/tools/javac/util/Name.java
src/share/classes/com/sun/tools/javac/util/Name.java
+126
-533
src/share/classes/com/sun/tools/javac/util/Names.java
src/share/classes/com/sun/tools/javac/util/Names.java
+281
-0
src/share/classes/com/sun/tools/javac/util/SharedNameTable.java
...are/classes/com/sun/tools/javac/util/SharedNameTable.java
+221
-0
src/share/classes/com/sun/tools/javac/util/UnsharedNameTable.java
...e/classes/com/sun/tools/javac/util/UnsharedNameTable.java
+185
-0
src/share/classes/com/sun/tools/javadoc/AnnotationTypeDocImpl.java
.../classes/com/sun/tools/javadoc/AnnotationTypeDocImpl.java
+2
-6
src/share/classes/com/sun/tools/javadoc/ClassDocImpl.java
src/share/classes/com/sun/tools/javadoc/ClassDocImpl.java
+9
-12
src/share/classes/com/sun/tools/javadoc/DocEnv.java
src/share/classes/com/sun/tools/javadoc/DocEnv.java
+3
-5
src/share/classes/com/sun/tools/javadoc/SerializedForm.java
src/share/classes/com/sun/tools/javadoc/SerializedForm.java
+4
-3
src/share/classes/com/sun/tools/javadoc/TypeVariableImpl.java
...share/classes/com/sun/tools/javadoc/TypeVariableImpl.java
+3
-2
test/tools/javac/unit/util/convert/EnclosingCandidates.java
test/tools/javac/unit/util/convert/EnclosingCandidates.java
+1
-1
未找到文件。
src/share/classes/com/sun/tools/apt/mirror/AptEnv.java
浏览文件 @
de6f1495
...
@@ -33,7 +33,7 @@ import com.sun.tools.javac.code.Symbol.CompletionFailure;
...
@@ -33,7 +33,7 @@ import com.sun.tools.javac.code.Symbol.CompletionFailure;
import
com.sun.tools.javac.comp.Attr
;
import
com.sun.tools.javac.comp.Attr
;
import
com.sun.tools.javac.comp.Enter
;
import
com.sun.tools.javac.comp.Enter
;
import
com.sun.tools.javac.util.Context
;
import
com.sun.tools.javac.util.Context
;
import
com.sun.tools.javac.util.Name
;
import
com.sun.tools.javac.util.Name
s
;
/**
/**
...
@@ -42,7 +42,7 @@ import com.sun.tools.javac.util.Name;
...
@@ -42,7 +42,7 @@ import com.sun.tools.javac.util.Name;
public
class
AptEnv
{
public
class
AptEnv
{
public
Name
.
Table
names
;
// javac's name table
public
Name
s
names
;
// javac's name table
public
Symtab
symtab
;
// javac's predefined symbols
public
Symtab
symtab
;
// javac's predefined symbols
public
Types
jctypes
;
// javac's type utilities
public
Types
jctypes
;
// javac's type utilities
public
Enter
enter
;
// javac's enter phase
public
Enter
enter
;
// javac's enter phase
...
@@ -66,7 +66,7 @@ public class AptEnv {
...
@@ -66,7 +66,7 @@ public class AptEnv {
private
AptEnv
(
Context
context
)
{
private
AptEnv
(
Context
context
)
{
context
.
put
(
aptEnvKey
,
this
);
context
.
put
(
aptEnvKey
,
this
);
names
=
Name
.
Table
.
instance
(
context
);
names
=
Name
s
.
instance
(
context
);
symtab
=
Symtab
.
instance
(
context
);
symtab
=
Symtab
.
instance
(
context
);
jctypes
=
Types
.
instance
(
context
);
jctypes
=
Types
.
instance
(
context
);
enter
=
Enter
.
instance
(
context
);
enter
=
Enter
.
instance
(
context
);
...
...
src/share/classes/com/sun/tools/javac/code/Attribute.java
浏览文件 @
de6f1495
...
@@ -166,7 +166,7 @@ public abstract class Attribute implements AnnotationValue {
...
@@ -166,7 +166,7 @@ public abstract class Attribute implements AnnotationValue {
first
=
false
;
first
=
false
;
Name
name
=
value
.
fst
.
name
;
Name
name
=
value
.
fst
.
name
;
if
(
len
>
1
||
name
!=
name
.
table
.
value
)
{
if
(
len
>
1
||
name
!=
name
.
table
.
names
.
value
)
{
buf
.
append
(
name
);
buf
.
append
(
name
);
buf
.
append
(
'='
);
buf
.
append
(
'='
);
}
}
...
...
src/share/classes/com/sun/tools/javac/code/Scope.java
浏览文件 @
de6f1495
...
@@ -145,7 +145,7 @@ public class Scope {
...
@@ -145,7 +145,7 @@ public class Scope {
assert
shared
==
0
;
assert
shared
==
0
;
if
(
table
!=
next
.
table
)
return
next
;
if
(
table
!=
next
.
table
)
return
next
;
while
(
elems
!=
null
)
{
while
(
elems
!=
null
)
{
int
hash
=
elems
.
sym
.
name
.
index
&
hashMask
;
int
hash
=
elems
.
sym
.
name
.
hashCode
()
&
hashMask
;
Entry
e
=
table
[
hash
];
Entry
e
=
table
[
hash
];
assert
e
==
elems
:
elems
.
sym
;
assert
e
==
elems
:
elems
.
sym
;
table
[
hash
]
=
elems
.
shadowed
;
table
[
hash
]
=
elems
.
shadowed
;
...
@@ -180,7 +180,7 @@ public class Scope {
...
@@ -180,7 +180,7 @@ public class Scope {
private
void
copy
(
Entry
e
)
{
private
void
copy
(
Entry
e
)
{
if
(
e
.
sym
!=
null
)
{
if
(
e
.
sym
!=
null
)
{
copy
(
e
.
shadowed
);
copy
(
e
.
shadowed
);
int
hash
=
e
.
sym
.
name
.
index
&
hashMask
;
int
hash
=
e
.
sym
.
name
.
hashCode
()
&
hashMask
;
e
.
shadowed
=
table
[
hash
];
e
.
shadowed
=
table
[
hash
];
table
[
hash
]
=
e
;
table
[
hash
]
=
e
;
}
}
...
@@ -206,7 +206,7 @@ public class Scope {
...
@@ -206,7 +206,7 @@ public class Scope {
assert
shared
==
0
;
assert
shared
==
0
;
// Temporarily disabled (bug 6460352):
// Temporarily disabled (bug 6460352):
// if (nelems * 3 >= hashMask * 2) dble();
// if (nelems * 3 >= hashMask * 2) dble();
int
hash
=
sym
.
name
.
index
&
hashMask
;
int
hash
=
sym
.
name
.
hashCode
()
&
hashMask
;
Entry
e
=
makeEntry
(
sym
,
table
[
hash
],
elems
,
s
,
origin
);
Entry
e
=
makeEntry
(
sym
,
table
[
hash
],
elems
,
s
,
origin
);
table
[
hash
]
=
e
;
table
[
hash
]
=
e
;
elems
=
e
;
elems
=
e
;
...
@@ -227,9 +227,9 @@ public class Scope {
...
@@ -227,9 +227,9 @@ public class Scope {
if
(
e
.
scope
==
null
)
return
;
if
(
e
.
scope
==
null
)
return
;
// remove e from table and shadowed list;
// remove e from table and shadowed list;
Entry
te
=
table
[
sym
.
name
.
index
&
hashMask
];
Entry
te
=
table
[
sym
.
name
.
hashCode
()
&
hashMask
];
if
(
te
==
e
)
if
(
te
==
e
)
table
[
sym
.
name
.
index
&
hashMask
]
=
e
.
shadowed
;
table
[
sym
.
name
.
hashCode
()
&
hashMask
]
=
e
.
shadowed
;
else
while
(
true
)
{
else
while
(
true
)
{
if
(
te
.
shadowed
==
e
)
{
if
(
te
.
shadowed
==
e
)
{
te
.
shadowed
=
e
.
shadowed
;
te
.
shadowed
=
e
.
shadowed
;
...
@@ -279,7 +279,7 @@ public class Scope {
...
@@ -279,7 +279,7 @@ public class Scope {
* for regular entries.
* for regular entries.
*/
*/
public
Entry
lookup
(
Name
name
)
{
public
Entry
lookup
(
Name
name
)
{
Entry
e
=
table
[
name
.
index
&
hashMask
];
Entry
e
=
table
[
name
.
hashCode
()
&
hashMask
];
while
(
e
.
scope
!=
null
&&
e
.
sym
.
name
!=
name
)
while
(
e
.
scope
!=
null
&&
e
.
sym
.
name
!=
name
)
e
=
e
.
shadowed
;
e
=
e
.
shadowed
;
return
e
;
return
e
;
...
@@ -400,7 +400,7 @@ public class Scope {
...
@@ -400,7 +400,7 @@ public class Scope {
}
}
public
Entry
lookup
(
Name
name
)
{
public
Entry
lookup
(
Name
name
)
{
Entry
e
=
table
[
name
.
index
&
hashMask
];
Entry
e
=
table
[
name
.
hashCode
()
&
hashMask
];
while
(
e
.
scope
!=
null
&&
while
(
e
.
scope
!=
null
&&
(
e
.
sym
.
name
!=
name
||
(
e
.
sym
.
name
!=
name
||
/* Since an inner class will show up in package and
/* Since an inner class will show up in package and
...
...
src/share/classes/com/sun/tools/javac/code/Symbol.java
浏览文件 @
de6f1495
...
@@ -146,14 +146,14 @@ public abstract class Symbol implements Element {
...
@@ -146,14 +146,14 @@ public abstract class Symbol implements Element {
* the default package; otherwise, the owner symbol is returned
* the default package; otherwise, the owner symbol is returned
*/
*/
public
Symbol
location
()
{
public
Symbol
location
()
{
if
(
owner
.
name
==
null
||
(
owner
.
name
.
len
==
0
&&
owner
.
kind
!=
PCK
))
{
if
(
owner
.
name
==
null
||
(
owner
.
name
.
isEmpty
()
&&
owner
.
kind
!=
PCK
))
{
return
null
;
return
null
;
}
}
return
owner
;
return
owner
;
}
}
public
Symbol
location
(
Type
site
,
Types
types
)
{
public
Symbol
location
(
Type
site
,
Types
types
)
{
if
(
owner
.
name
==
null
||
owner
.
name
.
len
==
0
)
{
if
(
owner
.
name
==
null
||
owner
.
name
.
isEmpty
()
)
{
return
location
();
return
location
();
}
}
if
(
owner
.
type
.
tag
==
CLASS
)
{
if
(
owner
.
type
.
tag
==
CLASS
)
{
...
@@ -177,7 +177,7 @@ public abstract class Symbol implements Element {
...
@@ -177,7 +177,7 @@ public abstract class Symbol implements Element {
*/
*/
public
Type
externalType
(
Types
types
)
{
public
Type
externalType
(
Types
types
)
{
Type
t
=
erasure
(
types
);
Type
t
=
erasure
(
types
);
if
(
name
==
name
.
table
.
init
&&
owner
.
hasOuterInstance
())
{
if
(
name
==
name
.
table
.
names
.
init
&&
owner
.
hasOuterInstance
())
{
Type
outerThisType
=
types
.
erasure
(
owner
.
type
.
getEnclosingType
());
Type
outerThisType
=
types
.
erasure
(
owner
.
type
.
getEnclosingType
());
return
new
MethodType
(
t
.
getParameterTypes
().
prepend
(
outerThisType
),
return
new
MethodType
(
t
.
getParameterTypes
().
prepend
(
outerThisType
),
t
.
getReturnType
(),
t
.
getReturnType
(),
...
@@ -212,7 +212,7 @@ public abstract class Symbol implements Element {
...
@@ -212,7 +212,7 @@ public abstract class Symbol implements Element {
/** Is this symbol a constructor?
/** Is this symbol a constructor?
*/
*/
public
boolean
isConstructor
()
{
public
boolean
isConstructor
()
{
return
name
==
name
.
table
.
init
;
return
name
==
name
.
table
.
names
.
init
;
}
}
/** The fully qualified name of this symbol.
/** The fully qualified name of this symbol.
...
@@ -501,7 +501,7 @@ public abstract class Symbol implements Element {
...
@@ -501,7 +501,7 @@ public abstract class Symbol implements Element {
||
(
owner
.
kind
==
TYP
&&
owner
.
type
.
tag
==
TYPEVAR
)
||
(
owner
.
kind
==
TYP
&&
owner
.
type
.
tag
==
TYPEVAR
)
))
return
name
;
))
return
name
;
Name
prefix
=
owner
.
getQualifiedName
();
Name
prefix
=
owner
.
getQualifiedName
();
if
(
prefix
==
null
||
prefix
==
prefix
.
table
.
empty
)
if
(
prefix
==
null
||
prefix
==
prefix
.
table
.
names
.
empty
)
return
name
;
return
name
;
else
return
prefix
.
append
(
'.'
,
name
);
else
return
prefix
.
append
(
'.'
,
name
);
}
}
...
@@ -516,7 +516,7 @@ public abstract class Symbol implements Element {
...
@@ -516,7 +516,7 @@ public abstract class Symbol implements Element {
)
return
name
;
)
return
name
;
char
sep
=
owner
.
kind
==
TYP
?
'$'
:
'.'
;
char
sep
=
owner
.
kind
==
TYP
?
'$'
:
'.'
;
Name
prefix
=
owner
.
flatName
();
Name
prefix
=
owner
.
flatName
();
if
(
prefix
==
null
||
prefix
==
prefix
.
table
.
empty
)
if
(
prefix
==
null
||
prefix
==
prefix
.
table
.
names
.
empty
)
return
name
;
return
name
;
else
return
prefix
.
append
(
sep
,
name
);
else
return
prefix
.
append
(
sep
,
name
);
}
}
...
@@ -737,7 +737,7 @@ public abstract class Symbol implements Element {
...
@@ -737,7 +737,7 @@ public abstract class Symbol implements Element {
}
}
public
String
className
()
{
public
String
className
()
{
if
(
name
.
len
==
0
)
if
(
name
.
isEmpty
()
)
return
return
Log
.
getLocalizedString
(
"anonymous.class"
,
flatname
);
Log
.
getLocalizedString
(
"anonymous.class"
,
flatname
);
else
else
...
@@ -1011,7 +1011,7 @@ public abstract class Symbol implements Element {
...
@@ -1011,7 +1011,7 @@ public abstract class Symbol implements Element {
if
((
flags
()
&
BLOCK
)
!=
0
)
{
if
((
flags
()
&
BLOCK
)
!=
0
)
{
return
owner
.
name
.
toString
();
return
owner
.
name
.
toString
();
}
else
{
}
else
{
String
s
=
(
name
==
name
.
table
.
init
)
String
s
=
(
name
==
name
.
table
.
names
.
init
)
?
owner
.
name
.
toString
()
?
owner
.
name
.
toString
()
:
name
.
toString
();
:
name
.
toString
();
if
(
type
!=
null
)
{
if
(
type
!=
null
)
{
...
@@ -1208,9 +1208,9 @@ public abstract class Symbol implements Element {
...
@@ -1208,9 +1208,9 @@ public abstract class Symbol implements Element {
}
}
public
ElementKind
getKind
()
{
public
ElementKind
getKind
()
{
if
(
name
==
name
.
table
.
init
)
if
(
name
==
name
.
table
.
names
.
init
)
return
ElementKind
.
CONSTRUCTOR
;
return
ElementKind
.
CONSTRUCTOR
;
else
if
(
name
==
name
.
table
.
clinit
)
else
if
(
name
==
name
.
table
.
names
.
clinit
)
return
ElementKind
.
STATIC_INIT
;
return
ElementKind
.
STATIC_INIT
;
else
else
return
ElementKind
.
METHOD
;
return
ElementKind
.
METHOD
;
...
...
src/share/classes/com/sun/tools/javac/code/Symtab.java
浏览文件 @
de6f1495
...
@@ -73,7 +73,7 @@ public class Symtab {
...
@@ -73,7 +73,7 @@ public class Symtab {
public
final
Type
botType
=
new
BottomType
();
public
final
Type
botType
=
new
BottomType
();
public
final
JCNoType
voidType
=
new
JCNoType
(
TypeTags
.
VOID
);
public
final
JCNoType
voidType
=
new
JCNoType
(
TypeTags
.
VOID
);
private
final
Name
.
Table
names
;
private
final
Name
s
names
;
private
final
ClassReader
reader
;
private
final
ClassReader
reader
;
private
final
Target
target
;
private
final
Target
target
;
...
@@ -328,7 +328,7 @@ public class Symtab {
...
@@ -328,7 +328,7 @@ public class Symtab {
protected
Symtab
(
Context
context
)
throws
CompletionFailure
{
protected
Symtab
(
Context
context
)
throws
CompletionFailure
{
context
.
put
(
symtabKey
,
this
);
context
.
put
(
symtabKey
,
this
);
names
=
Name
.
Table
.
instance
(
context
);
names
=
Name
s
.
instance
(
context
);
target
=
Target
.
instance
(
context
);
target
=
Target
.
instance
(
context
);
// Create the unknown type
// Create the unknown type
...
...
src/share/classes/com/sun/tools/javac/code/Type.java
浏览文件 @
de6f1495
...
@@ -599,14 +599,14 @@ public class Type implements PrimitiveType {
...
@@ -599,14 +599,14 @@ public class Type implements PrimitiveType {
}
}
//where
//where
private
String
className
(
Symbol
sym
,
boolean
longform
)
{
private
String
className
(
Symbol
sym
,
boolean
longform
)
{
if
(
sym
.
name
.
len
==
0
&&
(
sym
.
flags
()
&
COMPOUND
)
!=
0
)
{
if
(
sym
.
name
.
isEmpty
()
&&
(
sym
.
flags
()
&
COMPOUND
)
!=
0
)
{
StringBuffer
s
=
new
StringBuffer
(
supertype_field
.
toString
());
StringBuffer
s
=
new
StringBuffer
(
supertype_field
.
toString
());
for
(
List
<
Type
>
is
=
interfaces_field
;
is
.
nonEmpty
();
is
=
is
.
tail
)
{
for
(
List
<
Type
>
is
=
interfaces_field
;
is
.
nonEmpty
();
is
=
is
.
tail
)
{
s
.
append
(
"&"
);
s
.
append
(
"&"
);
s
.
append
(
is
.
head
.
toString
());
s
.
append
(
is
.
head
.
toString
());
}
}
return
s
.
toString
();
return
s
.
toString
();
}
else
if
(
sym
.
name
.
len
==
0
)
{
}
else
if
(
sym
.
name
.
isEmpty
()
)
{
String
s
;
String
s
;
ClassType
norm
=
(
ClassType
)
tsym
.
type
;
ClassType
norm
=
(
ClassType
)
tsym
.
type
;
if
(
norm
==
null
)
{
if
(
norm
==
null
)
{
...
...
src/share/classes/com/sun/tools/javac/code/Types.java
浏览文件 @
de6f1495
...
@@ -67,7 +67,7 @@ public class Types {
...
@@ -67,7 +67,7 @@ public class Types {
new
Context
.
Key
<
Types
>();
new
Context
.
Key
<
Types
>();
final
Symtab
syms
;
final
Symtab
syms
;
final
Name
.
Table
names
;
final
Name
s
names
;
final
boolean
allowBoxing
;
final
boolean
allowBoxing
;
final
ClassReader
reader
;
final
ClassReader
reader
;
final
Source
source
;
final
Source
source
;
...
@@ -86,7 +86,7 @@ public class Types {
...
@@ -86,7 +86,7 @@ public class Types {
protected
Types
(
Context
context
)
{
protected
Types
(
Context
context
)
{
context
.
put
(
typesKey
,
this
);
context
.
put
(
typesKey
,
this
);
syms
=
Symtab
.
instance
(
context
);
syms
=
Symtab
.
instance
(
context
);
names
=
Name
.
Table
.
instance
(
context
);
names
=
Name
s
.
instance
(
context
);
allowBoxing
=
Source
.
instance
(
context
).
allowBoxing
();
allowBoxing
=
Source
.
instance
(
context
).
allowBoxing
();
reader
=
ClassReader
.
instance
(
context
);
reader
=
ClassReader
.
instance
(
context
);
source
=
Source
.
instance
(
context
);
source
=
Source
.
instance
(
context
);
...
@@ -2213,7 +2213,7 @@ public class Types {
...
@@ -2213,7 +2213,7 @@ public class Types {
ClassType
cls
=
(
ClassType
)
t
;
ClassType
cls
=
(
ClassType
)
t
;
if
(
cls
.
rank_field
<
0
)
{
if
(
cls
.
rank_field
<
0
)
{
Name
fullname
=
cls
.
tsym
.
getQualifiedName
();
Name
fullname
=
cls
.
tsym
.
getQualifiedName
();
if
(
fullname
==
fullname
.
table
.
java_lang_Object
)
if
(
fullname
==
names
.
java_lang_Object
)
cls
.
rank_field
=
0
;
cls
.
rank_field
=
0
;
else
{
else
{
int
r
=
rank
(
supertype
(
cls
));
int
r
=
rank
(
supertype
(
cls
));
...
...
src/share/classes/com/sun/tools/javac/comp/Annotate.java
浏览文件 @
de6f1495
...
@@ -55,7 +55,7 @@ public class Annotate {
...
@@ -55,7 +55,7 @@ public class Annotate {
final
TreeMaker
make
;
final
TreeMaker
make
;
final
Log
log
;
final
Log
log
;
final
Symtab
syms
;
final
Symtab
syms
;
final
Name
.
Table
names
;
final
Name
s
names
;
final
Resolve
rs
;
final
Resolve
rs
;
final
Types
types
;
final
Types
types
;
final
ConstFold
cfolder
;
final
ConstFold
cfolder
;
...
@@ -67,7 +67,7 @@ public class Annotate {
...
@@ -67,7 +67,7 @@ public class Annotate {
make
=
TreeMaker
.
instance
(
context
);
make
=
TreeMaker
.
instance
(
context
);
log
=
Log
.
instance
(
context
);
log
=
Log
.
instance
(
context
);
syms
=
Symtab
.
instance
(
context
);
syms
=
Symtab
.
instance
(
context
);
names
=
Name
.
Table
.
instance
(
context
);
names
=
Name
s
.
instance
(
context
);
rs
=
Resolve
.
instance
(
context
);
rs
=
Resolve
.
instance
(
context
);
types
=
Types
.
instance
(
context
);
types
=
Types
.
instance
(
context
);
cfolder
=
ConstFold
.
instance
(
context
);
cfolder
=
ConstFold
.
instance
(
context
);
...
...
src/share/classes/com/sun/tools/javac/comp/Attr.java
浏览文件 @
de6f1495
...
@@ -68,7 +68,7 @@ public class Attr extends JCTree.Visitor {
...
@@ -68,7 +68,7 @@ public class Attr extends JCTree.Visitor {
protected
static
final
Context
.
Key
<
Attr
>
attrKey
=
protected
static
final
Context
.
Key
<
Attr
>
attrKey
=
new
Context
.
Key
<
Attr
>();
new
Context
.
Key
<
Attr
>();
final
Name
.
Table
names
;
final
Name
s
names
;
final
Log
log
;
final
Log
log
;
final
Symtab
syms
;
final
Symtab
syms
;
final
Resolve
rs
;
final
Resolve
rs
;
...
@@ -92,7 +92,7 @@ public class Attr extends JCTree.Visitor {
...
@@ -92,7 +92,7 @@ public class Attr extends JCTree.Visitor {
protected
Attr
(
Context
context
)
{
protected
Attr
(
Context
context
)
{
context
.
put
(
attrKey
,
this
);
context
.
put
(
attrKey
,
this
);
names
=
Name
.
Table
.
instance
(
context
);
names
=
Name
s
.
instance
(
context
);
log
=
Log
.
instance
(
context
);
log
=
Log
.
instance
(
context
);
syms
=
Symtab
.
instance
(
context
);
syms
=
Symtab
.
instance
(
context
);
rs
=
Resolve
.
instance
(
context
);
rs
=
Resolve
.
instance
(
context
);
...
...
src/share/classes/com/sun/tools/javac/comp/Check.java
浏览文件 @
de6f1495
...
@@ -56,7 +56,7 @@ public class Check {
...
@@ -56,7 +56,7 @@ public class Check {
protected
static
final
Context
.
Key
<
Check
>
checkKey
=
protected
static
final
Context
.
Key
<
Check
>
checkKey
=
new
Context
.
Key
<
Check
>();
new
Context
.
Key
<
Check
>();
private
final
Name
.
Table
names
;
private
final
Name
s
names
;
private
final
Log
log
;
private
final
Log
log
;
private
final
Symtab
syms
;
private
final
Symtab
syms
;
private
final
Infer
infer
;
private
final
Infer
infer
;
...
@@ -82,7 +82,7 @@ public class Check {
...
@@ -82,7 +82,7 @@ public class Check {
protected
Check
(
Context
context
)
{
protected
Check
(
Context
context
)
{
context
.
put
(
checkKey
,
this
);
context
.
put
(
checkKey
,
this
);
names
=
Name
.
Table
.
instance
(
context
);
names
=
Name
s
.
instance
(
context
);
log
=
Log
.
instance
(
context
);
log
=
Log
.
instance
(
context
);
syms
=
Symtab
.
instance
(
context
);
syms
=
Symtab
.
instance
(
context
);
infer
=
Infer
.
instance
(
context
);
infer
=
Infer
.
instance
(
context
);
...
@@ -628,7 +628,7 @@ public class Check {
...
@@ -628,7 +628,7 @@ public class Check {
case
TYP:
case
TYP:
if
(
sym
.
isLocal
())
{
if
(
sym
.
isLocal
())
{
mask
=
LocalClassFlags
;
mask
=
LocalClassFlags
;
if
(
sym
.
name
.
len
==
0
)
{
// Anonymous class
if
(
sym
.
name
.
isEmpty
()
)
{
// Anonymous class
// Anonymous classes in static methods are themselves static;
// Anonymous classes in static methods are themselves static;
// that's why we admit STATIC here.
// that's why we admit STATIC here.
mask
|=
STATIC
;
mask
|=
STATIC
;
...
...
src/share/classes/com/sun/tools/javac/comp/Enter.java
浏览文件 @
de6f1495
...
@@ -333,7 +333,7 @@ public class Enter extends JCTree.Visitor {
...
@@ -333,7 +333,7 @@ public class Enter extends JCTree.Visitor {
"class.public.should.be.in.file"
,
tree
.
name
);
"class.public.should.be.in.file"
,
tree
.
name
);
}
}
}
else
{
}
else
{
if
(
tree
.
name
.
len
!=
0
&&
if
(
!
tree
.
name
.
isEmpty
()
&&
!
chk
.
checkUniqueClassName
(
tree
.
pos
(),
tree
.
name
,
enclScope
))
{
!
chk
.
checkUniqueClassName
(
tree
.
pos
(),
tree
.
name
,
enclScope
))
{
result
=
null
;
result
=
null
;
return
;
return
;
...
@@ -348,7 +348,7 @@ public class Enter extends JCTree.Visitor {
...
@@ -348,7 +348,7 @@ public class Enter extends JCTree.Visitor {
// We are seeing a local class.
// We are seeing a local class.
c
=
reader
.
defineClass
(
tree
.
name
,
owner
);
c
=
reader
.
defineClass
(
tree
.
name
,
owner
);
c
.
flatname
=
chk
.
localClassName
(
c
);
c
.
flatname
=
chk
.
localClassName
(
c
);
if
(
c
.
name
.
len
!=
0
)
if
(
!
c
.
name
.
isEmpty
()
)
chk
.
checkTransparentClass
(
tree
.
pos
(),
c
,
env
.
info
.
scope
);
chk
.
checkTransparentClass
(
tree
.
pos
(),
c
,
env
.
info
.
scope
);
}
}
}
}
...
...
src/share/classes/com/sun/tools/javac/comp/Flow.java
浏览文件 @
de6f1495
...
@@ -177,7 +177,7 @@ public class Flow extends TreeScanner {
...
@@ -177,7 +177,7 @@ public class Flow extends TreeScanner {
protected
static
final
Context
.
Key
<
Flow
>
flowKey
=
protected
static
final
Context
.
Key
<
Flow
>
flowKey
=
new
Context
.
Key
<
Flow
>();
new
Context
.
Key
<
Flow
>();
private
final
Name
.
Table
names
;
private
final
Name
s
names
;
private
final
Log
log
;
private
final
Log
log
;
private
final
Symtab
syms
;
private
final
Symtab
syms
;
private
final
Types
types
;
private
final
Types
types
;
...
@@ -195,7 +195,7 @@ public class Flow extends TreeScanner {
...
@@ -195,7 +195,7 @@ public class Flow extends TreeScanner {
protected
Flow
(
Context
context
)
{
protected
Flow
(
Context
context
)
{
context
.
put
(
flowKey
,
this
);
context
.
put
(
flowKey
,
this
);
names
=
Name
.
Table
.
instance
(
context
);
names
=
Name
s
.
instance
(
context
);
log
=
Log
.
instance
(
context
);
log
=
Log
.
instance
(
context
);
syms
=
Symtab
.
instance
(
context
);
syms
=
Symtab
.
instance
(
context
);
types
=
Types
.
instance
(
context
);
types
=
Types
.
instance
(
context
);
...
...
src/share/classes/com/sun/tools/javac/comp/Lower.java
浏览文件 @
de6f1495
...
@@ -64,7 +64,7 @@ public class Lower extends TreeTranslator {
...
@@ -64,7 +64,7 @@ public class Lower extends TreeTranslator {
return
instance
;
return
instance
;
}
}
private
Name
.
Table
names
;
private
Name
s
names
;
private
Log
log
;
private
Log
log
;
private
Symtab
syms
;
private
Symtab
syms
;
private
Resolve
rs
;
private
Resolve
rs
;
...
@@ -85,7 +85,7 @@ public class Lower extends TreeTranslator {
...
@@ -85,7 +85,7 @@ public class Lower extends TreeTranslator {
protected
Lower
(
Context
context
)
{
protected
Lower
(
Context
context
)
{
context
.
put
(
lowerKey
,
this
);
context
.
put
(
lowerKey
,
this
);
names
=
Name
.
Table
.
instance
(
context
);
names
=
Name
s
.
instance
(
context
);
log
=
Log
.
instance
(
context
);
log
=
Log
.
instance
(
context
);
syms
=
Symtab
.
instance
(
context
);
syms
=
Symtab
.
instance
(
context
);
rs
=
Resolve
.
instance
(
context
);
rs
=
Resolve
.
instance
(
context
);
...
@@ -1830,7 +1830,7 @@ public class Lower extends TreeTranslator {
...
@@ -1830,7 +1830,7 @@ public class Lower extends TreeTranslator {
}
}
VarSymbol
var
=
VarSymbol
var
=
new
VarSymbol
(
FINAL
|
SYNTHETIC
,
new
VarSymbol
(
FINAL
|
SYNTHETIC
,
Name
.
fromString
(
names
,
names
.
fromString
(
target
.
syntheticNameChar
()
target
.
syntheticNameChar
()
+
""
+
rval
.
hashCode
()),
+
""
+
rval
.
hashCode
()),
type
,
type
,
...
@@ -3338,7 +3338,7 @@ public class Lower extends TreeTranslator {
...
@@ -3338,7 +3338,7 @@ public class Lower extends TreeTranslator {
ListBuffer
<
JCStatement
>
blockStatements
=
new
ListBuffer
<
JCStatement
>();
ListBuffer
<
JCStatement
>
blockStatements
=
new
ListBuffer
<
JCStatement
>();
JCModifiers
mod1
=
make
.
Modifiers
(
0L
);
JCModifiers
mod1
=
make
.
Modifiers
(
0L
);
Name
oName
=
Name
.
fromString
(
names
,
"o"
);
Name
oName
=
names
.
fromString
(
"o"
);
JCVariableDecl
par1
=
make
.
Param
(
oName
,
cdef
.
type
,
compareToSym
);
JCVariableDecl
par1
=
make
.
Param
(
oName
,
cdef
.
type
,
compareToSym
);
JCIdent
paramId1
=
make
.
Ident
(
names
.
java_lang_Object
);
JCIdent
paramId1
=
make
.
Ident
(
names
.
java_lang_Object
);
...
@@ -3352,7 +3352,7 @@ public class Lower extends TreeTranslator {
...
@@ -3352,7 +3352,7 @@ public class Lower extends TreeTranslator {
JCTypeCast
cast
=
make
.
TypeCast
(
castTargetIdent
,
par1UsageId
);
JCTypeCast
cast
=
make
.
TypeCast
(
castTargetIdent
,
par1UsageId
);
cast
.
setType
(
castTargetIdent
.
type
);
cast
.
setType
(
castTargetIdent
.
type
);
Name
otherName
=
Name
.
fromString
(
names
,
"other"
);
Name
otherName
=
names
.
fromString
(
"other"
);
VarSymbol
otherVarSym
=
new
VarSymbol
(
mod1
.
flags
,
VarSymbol
otherVarSym
=
new
VarSymbol
(
mod1
.
flags
,
otherName
,
otherName
,
...
...
src/share/classes/com/sun/tools/javac/comp/MemberEnter.java
浏览文件 @
de6f1495
...
@@ -61,7 +61,7 @@ public class MemberEnter extends JCTree.Visitor implements Completer {
...
@@ -61,7 +61,7 @@ public class MemberEnter extends JCTree.Visitor implements Completer {
*/
*/
final
static
boolean
checkClash
=
true
;
final
static
boolean
checkClash
=
true
;
private
final
Name
.
Table
names
;
private
final
Name
s
names
;
private
final
Enter
enter
;
private
final
Enter
enter
;
private
final
Log
log
;
private
final
Log
log
;
private
final
Check
chk
;
private
final
Check
chk
;
...
@@ -86,7 +86,7 @@ public class MemberEnter extends JCTree.Visitor implements Completer {
...
@@ -86,7 +86,7 @@ public class MemberEnter extends JCTree.Visitor implements Completer {
protected
MemberEnter
(
Context
context
)
{
protected
MemberEnter
(
Context
context
)
{
context
.
put
(
memberEnterKey
,
this
);
context
.
put
(
memberEnterKey
,
this
);
names
=
Name
.
Table
.
instance
(
context
);
names
=
Name
s
.
instance
(
context
);
enter
=
Enter
.
instance
(
context
);
enter
=
Enter
.
instance
(
context
);
log
=
Log
.
instance
(
context
);
log
=
Log
.
instance
(
context
);
chk
=
Check
.
instance
(
context
);
chk
=
Check
.
instance
(
context
);
...
@@ -919,7 +919,7 @@ public class MemberEnter extends JCTree.Visitor implements Completer {
...
@@ -919,7 +919,7 @@ public class MemberEnter extends JCTree.Visitor implements Completer {
List
<
Type
>
thrown
=
List
.
nil
();
List
<
Type
>
thrown
=
List
.
nil
();
long
ctorFlags
=
0
;
long
ctorFlags
=
0
;
boolean
based
=
false
;
boolean
based
=
false
;
if
(
c
.
name
.
len
==
0
)
{
if
(
c
.
name
.
isEmpty
()
)
{
JCNewClass
nc
=
(
JCNewClass
)
env
.
next
.
tree
;
JCNewClass
nc
=
(
JCNewClass
)
env
.
next
.
tree
;
if
(
nc
.
constructor
!=
null
)
{
if
(
nc
.
constructor
!=
null
)
{
Type
superConstrType
=
types
.
memberType
(
c
.
type
,
Type
superConstrType
=
types
.
memberType
(
c
.
type
,
...
@@ -1068,7 +1068,7 @@ public class MemberEnter extends JCTree.Visitor implements Completer {
...
@@ -1068,7 +1068,7 @@ public class MemberEnter extends JCTree.Visitor implements Completer {
flags
=
(
flags
&
~
AccessFlags
)
|
PRIVATE
|
GENERATEDCONSTR
;
flags
=
(
flags
&
~
AccessFlags
)
|
PRIVATE
|
GENERATEDCONSTR
;
}
else
}
else
flags
|=
(
c
.
flags
()
&
AccessFlags
)
|
GENERATEDCONSTR
;
flags
|=
(
c
.
flags
()
&
AccessFlags
)
|
GENERATEDCONSTR
;
if
(
c
.
name
.
len
==
0
)
flags
|=
ANONCONSTR
;
if
(
c
.
name
.
isEmpty
()
)
flags
|=
ANONCONSTR
;
JCTree
result
=
make
.
MethodDef
(
JCTree
result
=
make
.
MethodDef
(
make
.
Modifiers
(
flags
),
make
.
Modifiers
(
flags
),
names
.
init
,
names
.
init
,
...
...
src/share/classes/com/sun/tools/javac/comp/Resolve.java
浏览文件 @
de6f1495
...
@@ -51,7 +51,7 @@ public class Resolve {
...
@@ -51,7 +51,7 @@ public class Resolve {
protected
static
final
Context
.
Key
<
Resolve
>
resolveKey
=
protected
static
final
Context
.
Key
<
Resolve
>
resolveKey
=
new
Context
.
Key
<
Resolve
>();
new
Context
.
Key
<
Resolve
>();
Name
.
Table
names
;
Name
s
names
;
Log
log
;
Log
log
;
Symtab
syms
;
Symtab
syms
;
Check
chk
;
Check
chk
;
...
@@ -86,7 +86,7 @@ public class Resolve {
...
@@ -86,7 +86,7 @@ public class Resolve {
typeNotFound
=
new
typeNotFound
=
new
ResolveError
(
ABSENT_TYP
,
syms
.
errSymbol
,
"type not found"
);
ResolveError
(
ABSENT_TYP
,
syms
.
errSymbol
,
"type not found"
);
names
=
Name
.
Table
.
instance
(
context
);
names
=
Name
s
.
instance
(
context
);
log
=
Log
.
instance
(
context
);
log
=
Log
.
instance
(
context
);
chk
=
Check
.
instance
(
context
);
chk
=
Check
.
instance
(
context
);
infer
=
Infer
.
instance
(
context
);
infer
=
Infer
.
instance
(
context
);
...
@@ -1538,7 +1538,7 @@ public class Resolve {
...
@@ -1538,7 +1538,7 @@ public class Resolve {
argtypes
=
List
.
nil
();
argtypes
=
List
.
nil
();
if
(
typeargtypes
==
null
)
if
(
typeargtypes
==
null
)
typeargtypes
=
List
.
nil
();
typeargtypes
=
List
.
nil
();
if
(
name
!=
name
.
table
.
error
)
{
if
(
name
!=
name
s
.
error
)
{
KindName
kindname
=
absentKind
(
kind
);
KindName
kindname
=
absentKind
(
kind
);
Name
idname
=
name
;
Name
idname
=
name
;
if
(
kind
>=
WRONG_MTHS
&&
kind
<=
ABSENT_MTH
)
{
if
(
kind
>=
WRONG_MTHS
&&
kind
<=
ABSENT_MTH
)
{
...
@@ -1547,7 +1547,7 @@ public class Resolve {
...
@@ -1547,7 +1547,7 @@ public class Resolve {
name
,
argtypes
);
name
,
argtypes
);
return
;
return
;
}
}
if
(
name
==
name
.
table
.
init
)
{
if
(
name
==
name
s
.
init
)
{
kindname
=
KindName
.
CONSTRUCTOR
;
kindname
=
KindName
.
CONSTRUCTOR
;
idname
=
site
.
tsym
.
name
;
idname
=
site
.
tsym
.
name
;
}
}
...
@@ -1563,7 +1563,7 @@ public class Resolve {
...
@@ -1563,7 +1563,7 @@ public class Resolve {
kindName
(
ws
.
owner
),
kindName
(
ws
.
owner
),
ws
.
owner
.
type
,
ws
.
owner
.
type
,
explanation
);
explanation
);
}
else
if
(
site
.
tsym
.
name
.
len
!=
0
)
{
}
else
if
(
!
site
.
tsym
.
name
.
isEmpty
()
)
{
if
(
site
.
tsym
.
kind
==
PCK
&&
!
site
.
tsym
.
exists
())
if
(
site
.
tsym
.
kind
==
PCK
&&
!
site
.
tsym
.
exists
())
log
.
error
(
pos
,
"doesnt.exist"
,
site
.
tsym
);
log
.
error
(
pos
,
"doesnt.exist"
,
site
.
tsym
);
else
{
else
{
...
@@ -1601,9 +1601,9 @@ public class Resolve {
...
@@ -1601,9 +1601,9 @@ public class Resolve {
*/
*/
boolean
isOperator
(
Name
name
)
{
boolean
isOperator
(
Name
name
)
{
int
i
=
0
;
int
i
=
0
;
while
(
i
<
name
.
len
&&
while
(
i
<
name
.
getByteLength
()
&&
"+-~!*/%&|^<>="
.
indexOf
(
name
.
b
yteAt
(
i
))
>=
0
)
i
++;
"+-~!*/%&|^<>="
.
indexOf
(
name
.
getB
yteAt
(
i
))
>=
0
)
i
++;
return
i
>
0
&&
i
==
name
.
len
;
return
i
>
0
&&
i
==
name
.
getByteLength
()
;
}
}
}
}
...
@@ -1639,7 +1639,7 @@ public class Resolve {
...
@@ -1639,7 +1639,7 @@ public class Resolve {
void
report
(
Log
log
,
DiagnosticPosition
pos
,
Type
site
,
Name
name
,
void
report
(
Log
log
,
DiagnosticPosition
pos
,
Type
site
,
Name
name
,
List
<
Type
>
argtypes
,
List
<
Type
>
typeargtypes
)
{
List
<
Type
>
argtypes
,
List
<
Type
>
typeargtypes
)
{
if
(
sym
.
owner
.
type
.
tag
!=
ERROR
)
{
if
(
sym
.
owner
.
type
.
tag
!=
ERROR
)
{
if
(
sym
.
name
==
sym
.
name
.
table
.
init
&&
sym
.
owner
!=
site
.
tsym
)
if
(
sym
.
name
==
names
.
init
&&
sym
.
owner
!=
site
.
tsym
)
new
ResolveError
(
ABSENT_MTH
,
sym
.
owner
,
"absent method "
+
sym
).
report
(
new
ResolveError
(
ABSENT_MTH
,
sym
.
owner
,
"absent method "
+
sym
).
report
(
log
,
pos
,
site
,
name
,
argtypes
,
typeargtypes
);
log
,
pos
,
site
,
name
,
argtypes
,
typeargtypes
);
if
((
sym
.
flags
()
&
PUBLIC
)
!=
0
if
((
sym
.
flags
()
&
PUBLIC
)
!=
0
...
@@ -1723,7 +1723,7 @@ public class Resolve {
...
@@ -1723,7 +1723,7 @@ public class Resolve {
else
break
;
else
break
;
}
}
Name
sname
=
pair
.
sym1
.
name
;
Name
sname
=
pair
.
sym1
.
name
;
if
(
sname
==
sname
.
table
.
init
)
sname
=
pair
.
sym1
.
owner
.
name
;
if
(
sname
==
names
.
init
)
sname
=
pair
.
sym1
.
owner
.
name
;
log
.
error
(
pos
,
"ref.ambiguous"
,
sname
,
log
.
error
(
pos
,
"ref.ambiguous"
,
sname
,
kindName
(
pair
.
sym1
),
kindName
(
pair
.
sym1
),
pair
.
sym1
,
pair
.
sym1
,
...
...
src/share/classes/com/sun/tools/javac/comp/TransTypes.java
浏览文件 @
de6f1495
...
@@ -59,7 +59,7 @@ public class TransTypes extends TreeTranslator {
...
@@ -59,7 +59,7 @@ public class TransTypes extends TreeTranslator {
return
instance
;
return
instance
;
}
}
private
Name
.
Table
names
;
private
Name
s
names
;
private
Log
log
;
private
Log
log
;
private
Symtab
syms
;
private
Symtab
syms
;
private
TreeMaker
make
;
private
TreeMaker
make
;
...
@@ -77,7 +77,7 @@ public class TransTypes extends TreeTranslator {
...
@@ -77,7 +77,7 @@ public class TransTypes extends TreeTranslator {
protected
TransTypes
(
Context
context
)
{
protected
TransTypes
(
Context
context
)
{
context
.
put
(
transTypesKey
,
this
);
context
.
put
(
transTypesKey
,
this
);
names
=
Name
.
Table
.
instance
(
context
);
names
=
Name
s
.
instance
(
context
);
log
=
Log
.
instance
(
context
);
log
=
Log
.
instance
(
context
);
syms
=
Symtab
.
instance
(
context
);
syms
=
Symtab
.
instance
(
context
);
enter
=
Enter
.
instance
(
context
);
enter
=
Enter
.
instance
(
context
);
...
...
src/share/classes/com/sun/tools/javac/jvm/ClassFile.java
浏览文件 @
de6f1495
...
@@ -108,7 +108,7 @@ public class ClassFile {
...
@@ -108,7 +108,7 @@ public class ClassFile {
* converting '/' to '.'.
* converting '/' to '.'.
*/
*/
public
static
byte
[]
internalize
(
Name
name
)
{
public
static
byte
[]
internalize
(
Name
name
)
{
return
internalize
(
name
.
table
.
names
,
name
.
index
,
name
.
len
);
return
internalize
(
name
.
getByteArray
(),
name
.
getByteOffset
(),
name
.
getByteLength
()
);
}
}
/** Return external representation of buf[offset..offset+len-1],
/** Return external representation of buf[offset..offset+len-1],
...
@@ -128,7 +128,7 @@ public class ClassFile {
...
@@ -128,7 +128,7 @@ public class ClassFile {
* converting '/' to '.'.
* converting '/' to '.'.
*/
*/
public
static
byte
[]
externalize
(
Name
name
)
{
public
static
byte
[]
externalize
(
Name
name
)
{
return
externalize
(
name
.
table
.
names
,
name
.
index
,
name
.
len
);
return
externalize
(
name
.
getByteArray
(),
name
.
getByteOffset
(),
name
.
getByteLength
()
);
}
}
/************************************************************************
/************************************************************************
...
...
src/share/classes/com/sun/tools/javac/jvm/ClassReader.java
浏览文件 @
de6f1495
...
@@ -122,7 +122,7 @@ public class ClassReader extends ClassFile implements Completer {
...
@@ -122,7 +122,7 @@ public class ClassReader extends ClassFile implements Completer {
Types
types
;
Types
types
;
/** The name table. */
/** The name table. */
final
Name
.
Table
names
;
final
Name
s
names
;
/** Force a completion failure on this name
/** Force a completion failure on this name
*/
*/
...
@@ -220,7 +220,7 @@ public class ClassReader extends ClassFile implements Completer {
...
@@ -220,7 +220,7 @@ public class ClassReader extends ClassFile implements Completer {
protected
ClassReader
(
Context
context
,
boolean
definitive
)
{
protected
ClassReader
(
Context
context
,
boolean
definitive
)
{
if
(
definitive
)
context
.
put
(
classReaderKey
,
this
);
if
(
definitive
)
context
.
put
(
classReaderKey
,
this
);
names
=
Name
.
Table
.
instance
(
context
);
names
=
Name
s
.
instance
(
context
);
syms
=
Symtab
.
instance
(
context
);
syms
=
Symtab
.
instance
(
context
);
types
=
Types
.
instance
(
context
);
types
=
Types
.
instance
(
context
);
fileManager
=
context
.
get
(
JavaFileManager
.
class
);
fileManager
=
context
.
get
(
JavaFileManager
.
class
);
...
@@ -516,14 +516,6 @@ public class ClassReader extends ClassFile implements Completer {
...
@@ -516,14 +516,6 @@ public class ClassReader extends ClassFile implements Completer {
int
siglimit
;
int
siglimit
;
boolean
sigEnterPhase
=
false
;
boolean
sigEnterPhase
=
false
;
/** Convert signature to type, where signature is a name.
*/
Type
sigToType
(
Name
sig
)
{
return
sig
==
null
?
null
:
sigToType
(
sig
.
table
.
names
,
sig
.
index
,
sig
.
len
);
}
/** Convert signature to type, where signature is a byte array segment.
/** Convert signature to type, where signature is a byte array segment.
*/
*/
Type
sigToType
(
byte
[]
sig
,
int
offset
,
int
len
)
{
Type
sigToType
(
byte
[]
sig
,
int
offset
,
int
len
)
{
...
@@ -741,12 +733,6 @@ public class ClassReader extends ClassFile implements Completer {
...
@@ -741,12 +733,6 @@ public class ClassReader extends ClassFile implements Completer {
return
head
.
tail
;
return
head
.
tail
;
}
}
/** Convert signature to type parameters, where signature is a name.
*/
List
<
Type
>
sigToTypeParams
(
Name
name
)
{
return
sigToTypeParams
(
name
.
table
.
names
,
name
.
index
,
name
.
len
);
}
/** Convert signature to type parameters, where signature is a byte
/** Convert signature to type parameters, where signature is a byte
* array segment.
* array segment.
*/
*/
...
@@ -952,7 +938,7 @@ public class ClassReader extends ClassFile implements Completer {
...
@@ -952,7 +938,7 @@ public class ClassReader extends ClassFile implements Completer {
self
.
name
=
simpleBinaryName
(
self
.
flatname
,
c
.
flatname
)
;
self
.
name
=
simpleBinaryName
(
self
.
flatname
,
c
.
flatname
)
;
self
.
owner
=
m
!=
null
?
m
:
c
;
self
.
owner
=
m
!=
null
?
m
:
c
;
if
(
self
.
name
.
len
==
0
)
if
(
self
.
name
.
isEmpty
()
)
self
.
fullname
=
null
;
self
.
fullname
=
null
;
else
else
self
.
fullname
=
ClassSymbol
.
formFullName
(
self
.
name
,
self
.
owner
);
self
.
fullname
=
ClassSymbol
.
formFullName
(
self
.
name
,
self
.
owner
);
...
@@ -1500,7 +1486,7 @@ public class ClassReader extends ClassFile implements Completer {
...
@@ -1500,7 +1486,7 @@ public class ClassReader extends ClassFile implements Completer {
// Sometimes anonymous classes don't have an outer
// Sometimes anonymous classes don't have an outer
// instance, however, there is no reliable way to tell so
// instance, however, there is no reliable way to tell so
// we never strip this$n
// we never strip this$n
if
(
currentOwner
.
name
.
len
!=
0
)
if
(
!
currentOwner
.
name
.
isEmpty
()
)
type
=
new
MethodType
(
type
.
getParameterTypes
().
tail
,
type
=
new
MethodType
(
type
.
getParameterTypes
().
tail
,
type
.
getReturnType
(),
type
.
getReturnType
(),
type
.
getThrownTypes
(),
type
.
getThrownTypes
(),
...
...
src/share/classes/com/sun/tools/javac/jvm/ClassWriter.java
浏览文件 @
de6f1495
...
@@ -26,7 +26,6 @@
...
@@ -26,7 +26,6 @@
package
com.sun.tools.javac.jvm
;
package
com.sun.tools.javac.jvm
;
import
java.io.*
;
import
java.io.*
;
import
java.util.*
;
import
java.util.Set
;
import
java.util.Set
;
import
java.util.HashSet
;
import
java.util.HashSet
;
...
@@ -140,7 +139,7 @@ public class ClassWriter extends ClassFile {
...
@@ -140,7 +139,7 @@ public class ClassWriter extends ClassFile {
private
final
Log
log
;
private
final
Log
log
;
/** The name table. */
/** The name table. */
private
final
Name
.
Table
names
;
private
final
Name
s
names
;
/** Access to files. */
/** Access to files. */
private
final
JavaFileManager
fileManager
;
private
final
JavaFileManager
fileManager
;
...
@@ -166,7 +165,7 @@ public class ClassWriter extends ClassFile {
...
@@ -166,7 +165,7 @@ public class ClassWriter extends ClassFile {
context
.
put
(
classWriterKey
,
this
);
context
.
put
(
classWriterKey
,
this
);
log
=
Log
.
instance
(
context
);
log
=
Log
.
instance
(
context
);
names
=
Name
.
Table
.
instance
(
context
);
names
=
Name
s
.
instance
(
context
);
syms
=
Symtab
.
instance
(
context
);
syms
=
Symtab
.
instance
(
context
);
options
=
Options
.
instance
(
context
);
options
=
Options
.
instance
(
context
);
target
=
Target
.
instance
(
context
);
target
=
Target
.
instance
(
context
);
...
@@ -375,9 +374,7 @@ public class ClassWriter extends ClassFile {
...
@@ -375,9 +374,7 @@ public class ClassWriter extends ClassFile {
sigbuf
.
appendByte
(
'.'
);
sigbuf
.
appendByte
(
'.'
);
assert
c
.
flatname
.
startsWith
(
c
.
owner
.
enclClass
().
flatname
);
assert
c
.
flatname
.
startsWith
(
c
.
owner
.
enclClass
().
flatname
);
sigbuf
.
appendName
(
rawOuter
sigbuf
.
appendName
(
rawOuter
?
c
.
flatname
.
subName
(
c
.
owner
.
enclClass
()
?
c
.
flatname
.
subName
(
c
.
owner
.
enclClass
().
flatname
.
getByteLength
()+
1
,
c
.
flatname
.
getByteLength
())
.
flatname
.
len
+
1
,
c
.
flatname
.
len
)
:
c
.
name
);
:
c
.
name
);
}
else
{
}
else
{
sigbuf
.
appendBytes
(
externalize
(
c
.
flatname
));
sigbuf
.
appendBytes
(
externalize
(
c
.
flatname
));
...
@@ -542,7 +539,7 @@ public class ClassWriter extends ClassFile {
...
@@ -542,7 +539,7 @@ public class ClassWriter extends ClassFile {
Name
fieldName
(
Symbol
sym
)
{
Name
fieldName
(
Symbol
sym
)
{
if
(
scramble
&&
(
sym
.
flags
()
&
PRIVATE
)
!=
0
||
if
(
scramble
&&
(
sym
.
flags
()
&
PRIVATE
)
!=
0
||
scrambleAll
&&
(
sym
.
flags
()
&
(
PROTECTED
|
PUBLIC
))
==
0
)
scrambleAll
&&
(
sym
.
flags
()
&
(
PROTECTED
|
PUBLIC
))
==
0
)
return
names
.
fromString
(
"_$"
+
sym
.
name
.
index
);
return
names
.
fromString
(
"_$"
+
sym
.
name
.
getIndex
()
);
else
else
return
sym
.
name
;
return
sym
.
name
;
}
}
...
@@ -917,7 +914,7 @@ public class ClassWriter extends ClassFile {
...
@@ -917,7 +914,7 @@ public class ClassWriter extends ClassFile {
databuf
.
appendChar
(
databuf
.
appendChar
(
inner
.
owner
.
kind
==
TYP
?
pool
.
get
(
inner
.
owner
)
:
0
);
inner
.
owner
.
kind
==
TYP
?
pool
.
get
(
inner
.
owner
)
:
0
);
databuf
.
appendChar
(
databuf
.
appendChar
(
inner
.
name
.
len
!=
0
?
pool
.
get
(
inner
.
name
)
:
0
);
!
inner
.
name
.
isEmpty
()
?
pool
.
get
(
inner
.
name
)
:
0
);
databuf
.
appendChar
(
flags
);
databuf
.
appendChar
(
flags
);
}
}
endAttr
(
alenIdx
);
endAttr
(
alenIdx
);
...
@@ -1457,7 +1454,7 @@ public class ClassWriter extends ClassFile {
...
@@ -1457,7 +1454,7 @@ public class ClassWriter extends ClassFile {
try
{
try
{
writeClassFile
(
out
,
c
);
writeClassFile
(
out
,
c
);
if
(
verbose
)
if
(
verbose
)
log
.
errWriter
.
println
(
l
og
.
getLocalizedString
(
"verbose.wrote.file"
,
outFile
));
log
.
errWriter
.
println
(
L
og
.
getLocalizedString
(
"verbose.wrote.file"
,
outFile
));
out
.
close
();
out
.
close
();
out
=
null
;
out
=
null
;
}
finally
{
}
finally
{
...
...
src/share/classes/com/sun/tools/javac/jvm/Code.java
浏览文件 @
de6f1495
...
@@ -52,16 +52,16 @@ public class Code {
...
@@ -52,16 +52,16 @@ public class Code {
public
enum
StackMapFormat
{
public
enum
StackMapFormat
{
NONE
,
NONE
,
CLDC
{
CLDC
{
Name
getAttributeName
(
Name
.
Table
names
)
{
Name
getAttributeName
(
Name
s
names
)
{
return
names
.
StackMap
;
return
names
.
StackMap
;
}
}
},
},
JSR202
{
JSR202
{
Name
getAttributeName
(
Name
.
Table
names
)
{
Name
getAttributeName
(
Name
s
names
)
{
return
names
.
StackMapTable
;
return
names
.
StackMapTable
;
}
}
};
};
Name
getAttributeName
(
Name
.
Table
names
)
{
Name
getAttributeName
(
Name
s
names
)
{
return
names
.
empty
;
return
names
.
empty
;
}
}
}
}
...
...
src/share/classes/com/sun/tools/javac/jvm/Gen.java
浏览文件 @
de6f1495
...
@@ -61,7 +61,7 @@ public class Gen extends JCTree.Visitor {
...
@@ -61,7 +61,7 @@ public class Gen extends JCTree.Visitor {
private
final
Check
chk
;
private
final
Check
chk
;
private
final
Resolve
rs
;
private
final
Resolve
rs
;
private
final
TreeMaker
make
;
private
final
TreeMaker
make
;
private
final
Name
.
Table
names
;
private
final
Name
s
names
;
private
final
Target
target
;
private
final
Target
target
;
private
final
Type
stringBufferType
;
private
final
Type
stringBufferType
;
private
final
Map
<
Type
,
Symbol
>
stringBufferAppend
;
private
final
Map
<
Type
,
Symbol
>
stringBufferAppend
;
...
@@ -92,7 +92,7 @@ public class Gen extends JCTree.Visitor {
...
@@ -92,7 +92,7 @@ public class Gen extends JCTree.Visitor {
protected
Gen
(
Context
context
)
{
protected
Gen
(
Context
context
)
{
context
.
put
(
genKey
,
this
);
context
.
put
(
genKey
,
this
);
names
=
Name
.
Table
.
instance
(
context
);
names
=
Name
s
.
instance
(
context
);
log
=
Log
.
instance
(
context
);
log
=
Log
.
instance
(
context
);
syms
=
Symtab
.
instance
(
context
);
syms
=
Symtab
.
instance
(
context
);
chk
=
Check
.
instance
(
context
);
chk
=
Check
.
instance
(
context
);
...
@@ -365,7 +365,7 @@ public class Gen extends JCTree.Visitor {
...
@@ -365,7 +365,7 @@ public class Gen extends JCTree.Visitor {
private
boolean
isOddAccessName
(
Name
name
)
{
private
boolean
isOddAccessName
(
Name
name
)
{
return
return
name
.
startsWith
(
accessDollar
)
&&
name
.
startsWith
(
accessDollar
)
&&
(
name
.
byteAt
(
name
.
len
-
1
)
&
1
)
==
1
;
(
name
.
getByteAt
(
name
.
getByteLength
()
-
1
)
&
1
)
==
1
;
}
}
/* ************************************************************************
/* ************************************************************************
...
...
src/share/classes/com/sun/tools/javac/main/JavaCompiler.java
浏览文件 @
de6f1495
...
@@ -236,7 +236,7 @@ public class JavaCompiler implements ClassReader.SourceCompleter {
...
@@ -236,7 +236,7 @@ public class JavaCompiler implements ClassReader.SourceCompleter {
/** The name table.
/** The name table.
*/
*/
protected
Name
.
Table
names
;
protected
Name
s
names
;
/** The attributor.
/** The attributor.
*/
*/
...
@@ -310,7 +310,7 @@ public class JavaCompiler implements ClassReader.SourceCompleter {
...
@@ -310,7 +310,7 @@ public class JavaCompiler implements ClassReader.SourceCompleter {
if
(
context
.
get
(
JavaFileManager
.
class
)
==
null
)
if
(
context
.
get
(
JavaFileManager
.
class
)
==
null
)
JavacFileManager
.
preRegister
(
context
);
JavacFileManager
.
preRegister
(
context
);
names
=
Name
.
Table
.
instance
(
context
);
names
=
Name
s
.
instance
(
context
);
log
=
Log
.
instance
(
context
);
log
=
Log
.
instance
(
context
);
diagFactory
=
JCDiagnostic
.
Factory
.
instance
(
context
);
diagFactory
=
JCDiagnostic
.
Factory
.
instance
(
context
);
reader
=
ClassReader
.
instance
(
context
);
reader
=
ClassReader
.
instance
(
context
);
...
@@ -1411,7 +1411,7 @@ public class JavaCompiler implements ClassReader.SourceCompleter {
...
@@ -1411,7 +1411,7 @@ public class JavaCompiler implements ClassReader.SourceCompleter {
close
(
true
);
close
(
true
);
}
}
p
rivate
void
close
(
boolean
disposeNames
)
{
p
ublic
void
close
(
boolean
disposeNames
)
{
rootClasses
=
null
;
rootClasses
=
null
;
reader
=
null
;
reader
=
null
;
make
=
null
;
make
=
null
;
...
...
src/share/classes/com/sun/tools/javac/model/AnnotationProxyMaker.java
浏览文件 @
de6f1495
...
@@ -181,7 +181,7 @@ public class AnnotationProxyMaker {
...
@@ -181,7 +181,7 @@ public class AnnotationProxyMaker {
public
void
visitArray
(
Attribute
.
Array
a
)
{
public
void
visitArray
(
Attribute
.
Array
a
)
{
Name
elemName
=
((
ArrayType
)
a
.
type
).
elemtype
.
tsym
.
name
;
Name
elemName
=
((
ArrayType
)
a
.
type
).
elemtype
.
tsym
.
name
;
if
(
elemName
==
elemName
.
table
.
java_lang_Class
)
{
// Class[]
if
(
elemName
==
elemName
.
table
.
names
.
java_lang_Class
)
{
// Class[]
// Construct a proxy for a MirroredTypesException
// Construct a proxy for a MirroredTypesException
List
<
TypeMirror
>
elems
=
List
.
nil
();
List
<
TypeMirror
>
elems
=
List
.
nil
();
for
(
Attribute
value
:
a
.
values
)
{
for
(
Attribute
value
:
a
.
values
)
{
...
...
src/share/classes/com/sun/tools/javac/model/JavacElements.java
浏览文件 @
de6f1495
...
@@ -39,15 +39,14 @@ import com.sun.tools.javac.code.TypeTags;
...
@@ -39,15 +39,14 @@ import com.sun.tools.javac.code.TypeTags;
import
com.sun.tools.javac.comp.AttrContext
;
import
com.sun.tools.javac.comp.AttrContext
;
import
com.sun.tools.javac.comp.Enter
;
import
com.sun.tools.javac.comp.Enter
;
import
com.sun.tools.javac.comp.Env
;
import
com.sun.tools.javac.comp.Env
;
import
com.sun.tools.javac.jvm.ClassReader
;
import
com.sun.tools.javac.main.JavaCompiler
;
import
com.sun.tools.javac.main.JavaCompiler
;
import
com.sun.tools.javac.processing.PrintingProcessor
;
import
com.sun.tools.javac.processing.PrintingProcessor
;
import
com.sun.tools.javac.tree.JCTree
;
import
com.sun.tools.javac.tree.JCTree
;
import
com.sun.tools.javac.tree.JCTree.*
;
import
com.sun.tools.javac.tree.JCTree.*
;
import
com.sun.tools.javac.tree.TreeInfo
;
import
com.sun.tools.javac.tree.TreeInfo
;
import
com.sun.tools.javac.tree.TreeScanner
;
import
com.sun.tools.javac.tree.TreeScanner
;
import
com.sun.tools.javac.util.Name
;
import
com.sun.tools.javac.util.*
;
import
com.sun.tools.javac.util.*
;
import
com.sun.tools.javac.util.Name
;
import
static
javax
.
lang
.
model
.
util
.
ElementFilter
.
methodsIn
;
import
static
javax
.
lang
.
model
.
util
.
ElementFilter
.
methodsIn
;
...
@@ -63,10 +62,9 @@ public class JavacElements implements Elements {
...
@@ -63,10 +62,9 @@ public class JavacElements implements Elements {
private
JavaCompiler
javaCompiler
;
private
JavaCompiler
javaCompiler
;
private
Symtab
syms
;
private
Symtab
syms
;
private
Name
.
Table
names
;
private
Name
s
names
;
private
Types
types
;
private
Types
types
;
private
Enter
enter
;
private
Enter
enter
;
private
ClassReader
reader
;
private
static
final
Context
.
Key
<
JavacElements
>
KEY
=
private
static
final
Context
.
Key
<
JavacElements
>
KEY
=
new
Context
.
Key
<
JavacElements
>();
new
Context
.
Key
<
JavacElements
>();
...
@@ -96,10 +94,9 @@ public class JavacElements implements Elements {
...
@@ -96,10 +94,9 @@ public class JavacElements implements Elements {
public
void
setContext
(
Context
context
)
{
public
void
setContext
(
Context
context
)
{
javaCompiler
=
JavaCompiler
.
instance
(
context
);
javaCompiler
=
JavaCompiler
.
instance
(
context
);
syms
=
Symtab
.
instance
(
context
);
syms
=
Symtab
.
instance
(
context
);
names
=
Name
.
Table
.
instance
(
context
);
names
=
Name
s
.
instance
(
context
);
types
=
Types
.
instance
(
context
);
types
=
Types
.
instance
(
context
);
enter
=
Enter
.
instance
(
context
);
enter
=
Enter
.
instance
(
context
);
reader
=
ClassReader
.
instance
(
context
);
}
}
...
@@ -126,7 +123,7 @@ public class JavacElements implements Elements {
...
@@ -126,7 +123,7 @@ public class JavacElements implements Elements {
Class
<
A
>
annoType
)
{
Class
<
A
>
annoType
)
{
boolean
inherited
=
annoType
.
isAnnotationPresent
(
Inherited
.
class
);
boolean
inherited
=
annoType
.
isAnnotationPresent
(
Inherited
.
class
);
A
result
=
null
;
A
result
=
null
;
while
(
annotated
.
name
!=
annotated
.
name
.
table
.
java_lang_Object
)
{
while
(
annotated
.
name
!=
annotated
.
name
.
table
.
names
.
java_lang_Object
)
{
result
=
getAnnotation
((
Symbol
)
annotated
,
annoType
);
result
=
getAnnotation
((
Symbol
)
annotated
,
annoType
);
if
(
result
!=
null
||
!
inherited
)
if
(
result
!=
null
||
!
inherited
)
break
;
break
;
...
@@ -568,7 +565,7 @@ public class JavacElements implements Elements {
...
@@ -568,7 +565,7 @@ public class JavacElements implements Elements {
}
}
public
Name
getName
(
CharSequence
cs
)
{
public
Name
getName
(
CharSequence
cs
)
{
return
Name
.
fromString
(
names
,
cs
.
toString
());
return
names
.
fromString
(
cs
.
toString
());
}
}
/**
/**
...
...
src/share/classes/com/sun/tools/javac/parser/JavacParser.java
浏览文件 @
de6f1495
...
@@ -73,7 +73,7 @@ public class JavacParser implements Parser {
...
@@ -73,7 +73,7 @@ public class JavacParser implements Parser {
private
Source
source
;
private
Source
source
;
/** The name table. */
/** The name table. */
private
Name
.
Table
names
;
private
Name
s
names
;
/** Construct a parser from a given scanner, tree factory and log.
/** Construct a parser from a given scanner, tree factory and log.
*/
*/
...
@@ -549,7 +549,7 @@ public class JavacParser implements Parser {
...
@@ -549,7 +549,7 @@ public class JavacParser implements Parser {
String
strval
(
Name
prefix
)
{
String
strval
(
Name
prefix
)
{
String
s
=
S
.
stringVal
();
String
s
=
S
.
stringVal
();
return
(
prefix
.
len
==
0
)
?
s
:
prefix
+
s
;
return
prefix
.
isEmpty
(
)
?
s
:
prefix
+
s
;
}
}
/** terms can be either expressions or types.
/** terms can be either expressions or types.
...
...
src/share/classes/com/sun/tools/javac/parser/Keywords.java
浏览文件 @
de6f1495
...
@@ -28,6 +28,7 @@ package com.sun.tools.javac.parser;
...
@@ -28,6 +28,7 @@ package com.sun.tools.javac.parser;
import
com.sun.tools.javac.util.Context
;
import
com.sun.tools.javac.util.Context
;
import
com.sun.tools.javac.util.Log
;
import
com.sun.tools.javac.util.Log
;
import
com.sun.tools.javac.util.Name
;
import
com.sun.tools.javac.util.Name
;
import
com.sun.tools.javac.util.Names
;
import
static
com
.
sun
.
tools
.
javac
.
parser
.
Token
.*;
import
static
com
.
sun
.
tools
.
javac
.
parser
.
Token
.*;
...
@@ -51,12 +52,12 @@ public class Keywords {
...
@@ -51,12 +52,12 @@ public class Keywords {
}
}
private
final
Log
log
;
private
final
Log
log
;
private
final
Name
.
Table
names
;
private
final
Name
s
names
;
protected
Keywords
(
Context
context
)
{
protected
Keywords
(
Context
context
)
{
context
.
put
(
keywordsKey
,
this
);
context
.
put
(
keywordsKey
,
this
);
log
=
Log
.
instance
(
context
);
log
=
Log
.
instance
(
context
);
names
=
Name
.
Table
.
instance
(
context
);
names
=
Name
s
.
instance
(
context
);
for
(
Token
t
:
Token
.
values
())
{
for
(
Token
t
:
Token
.
values
())
{
if
(
t
.
name
!=
null
)
if
(
t
.
name
!=
null
)
...
@@ -69,13 +70,13 @@ public class Keywords {
...
@@ -69,13 +70,13 @@ public class Keywords {
for
(
int
i
=
0
;
i
<=
maxKey
;
i
++)
key
[
i
]
=
IDENTIFIER
;
for
(
int
i
=
0
;
i
<=
maxKey
;
i
++)
key
[
i
]
=
IDENTIFIER
;
for
(
Token
t
:
Token
.
values
())
{
for
(
Token
t
:
Token
.
values
())
{
if
(
t
.
name
!=
null
)
if
(
t
.
name
!=
null
)
key
[
tokenName
[
t
.
ordinal
()].
index
]
=
t
;
key
[
tokenName
[
t
.
ordinal
()].
getIndex
()
]
=
t
;
}
}
}
}
public
Token
key
(
Name
name
)
{
public
Token
key
(
Name
name
)
{
return
(
name
.
index
>
maxKey
)
?
IDENTIFIER
:
key
[
name
.
index
];
return
(
name
.
getIndex
()
>
maxKey
)
?
IDENTIFIER
:
key
[
name
.
getIndex
()
];
}
}
/**
/**
...
@@ -94,6 +95,6 @@ public class Keywords {
...
@@ -94,6 +95,6 @@ public class Keywords {
private
void
enterKeyword
(
String
s
,
Token
token
)
{
private
void
enterKeyword
(
String
s
,
Token
token
)
{
Name
n
=
names
.
fromString
(
s
);
Name
n
=
names
.
fromString
(
s
);
tokenName
[
token
.
ordinal
()]
=
n
;
tokenName
[
token
.
ordinal
()]
=
n
;
if
(
n
.
index
>
maxKey
)
maxKey
=
n
.
index
;
if
(
n
.
getIndex
()
>
maxKey
)
maxKey
=
n
.
getIndex
()
;
}
}
}
}
src/share/classes/com/sun/tools/javac/parser/ParserFactory.java
浏览文件 @
de6f1495
...
@@ -29,7 +29,7 @@ import com.sun.tools.javac.code.Source;
...
@@ -29,7 +29,7 @@ import com.sun.tools.javac.code.Source;
import
com.sun.tools.javac.tree.TreeMaker
;
import
com.sun.tools.javac.tree.TreeMaker
;
import
com.sun.tools.javac.util.Context
;
import
com.sun.tools.javac.util.Context
;
import
com.sun.tools.javac.util.Log
;
import
com.sun.tools.javac.util.Log
;
import
com.sun.tools.javac.util.Name
;
import
com.sun.tools.javac.util.Name
s
;
import
com.sun.tools.javac.util.Options
;
import
com.sun.tools.javac.util.Options
;
/**
/**
...
@@ -52,7 +52,7 @@ public class ParserFactory {
...
@@ -52,7 +52,7 @@ public class ParserFactory {
final
Log
log
;
final
Log
log
;
final
Keywords
keywords
;
final
Keywords
keywords
;
final
Source
source
;
final
Source
source
;
final
Name
.
Table
names
;
final
Name
s
names
;
final
Options
options
;
final
Options
options
;
final
Scanner
.
Factory
scannerFactory
;
final
Scanner
.
Factory
scannerFactory
;
...
@@ -61,7 +61,7 @@ public class ParserFactory {
...
@@ -61,7 +61,7 @@ public class ParserFactory {
context
.
put
(
parserFactoryKey
,
this
);
context
.
put
(
parserFactoryKey
,
this
);
this
.
F
=
TreeMaker
.
instance
(
context
);
this
.
F
=
TreeMaker
.
instance
(
context
);
this
.
log
=
Log
.
instance
(
context
);
this
.
log
=
Log
.
instance
(
context
);
this
.
names
=
Name
.
Table
.
instance
(
context
);
this
.
names
=
Name
s
.
instance
(
context
);
this
.
keywords
=
Keywords
.
instance
(
context
);
this
.
keywords
=
Keywords
.
instance
(
context
);
this
.
source
=
Source
.
instance
(
context
);
this
.
source
=
Source
.
instance
(
context
);
this
.
options
=
Options
.
instance
(
context
);
this
.
options
=
Options
.
instance
(
context
);
...
...
src/share/classes/com/sun/tools/javac/parser/Scanner.java
浏览文件 @
de6f1495
...
@@ -62,7 +62,7 @@ public class Scanner implements Lexer {
...
@@ -62,7 +62,7 @@ public class Scanner implements Lexer {
}
}
final
Log
log
;
final
Log
log
;
final
Name
.
Table
names
;
final
Name
s
names
;
final
Source
source
;
final
Source
source
;
final
Keywords
keywords
;
final
Keywords
keywords
;
...
@@ -70,7 +70,7 @@ public class Scanner implements Lexer {
...
@@ -70,7 +70,7 @@ public class Scanner implements Lexer {
protected
Factory
(
Context
context
)
{
protected
Factory
(
Context
context
)
{
context
.
put
(
scannerFactoryKey
,
this
);
context
.
put
(
scannerFactoryKey
,
this
);
this
.
log
=
Log
.
instance
(
context
);
this
.
log
=
Log
.
instance
(
context
);
this
.
names
=
Name
.
Table
.
instance
(
context
);
this
.
names
=
Name
s
.
instance
(
context
);
this
.
source
=
Source
.
instance
(
context
);
this
.
source
=
Source
.
instance
(
context
);
this
.
keywords
=
Keywords
.
instance
(
context
);
this
.
keywords
=
Keywords
.
instance
(
context
);
}
}
...
@@ -155,7 +155,7 @@ public class Scanner implements Lexer {
...
@@ -155,7 +155,7 @@ public class Scanner implements Lexer {
private
final
Log
log
;
private
final
Log
log
;
/** The name table. */
/** The name table. */
private
final
Name
.
Table
names
;
private
final
Name
s
names
;
/** The keyword table. */
/** The keyword table. */
private
final
Keywords
keywords
;
private
final
Keywords
keywords
;
...
...
src/share/classes/com/sun/tools/javac/processing/JavacProcessingEnvironment.java
浏览文件 @
de6f1495
...
@@ -70,6 +70,7 @@ import com.sun.tools.javac.util.List;
...
@@ -70,6 +70,7 @@ import com.sun.tools.javac.util.List;
import
com.sun.tools.javac.util.ListBuffer
;
import
com.sun.tools.javac.util.ListBuffer
;
import
com.sun.tools.javac.util.Log
;
import
com.sun.tools.javac.util.Log
;
import
com.sun.tools.javac.util.Name
;
import
com.sun.tools.javac.util.Name
;
import
com.sun.tools.javac.util.Names
;
import
com.sun.tools.javac.util.Options
;
import
com.sun.tools.javac.util.Options
;
import
static
javax
.
tools
.
StandardLocation
.*;
import
static
javax
.
tools
.
StandardLocation
.*;
...
@@ -831,7 +832,7 @@ public class JavacProcessingEnvironment implements ProcessingEnvironment, Closea
...
@@ -831,7 +832,7 @@ public class JavacProcessingEnvironment implements ProcessingEnvironment, Closea
topLevelClasses
=
List
.
nil
();
topLevelClasses
=
List
.
nil
();
packageInfoFiles
=
List
.
nil
();
packageInfoFiles
=
List
.
nil
();
compiler
.
close
();
compiler
.
close
(
false
);
currentContext
=
contextForNextRound
(
currentContext
,
true
);
currentContext
=
contextForNextRound
(
currentContext
,
true
);
JavaFileManager
fileManager
=
currentContext
.
get
(
JavaFileManager
.
class
);
JavaFileManager
fileManager
=
currentContext
.
get
(
JavaFileManager
.
class
);
...
@@ -879,7 +880,7 @@ public class JavacProcessingEnvironment implements ProcessingEnvironment, Closea
...
@@ -879,7 +880,7 @@ public class JavacProcessingEnvironment implements ProcessingEnvironment, Closea
}
}
runLastRound
(
xout
,
roundNumber
,
errorStatus
,
taskListener
);
runLastRound
(
xout
,
roundNumber
,
errorStatus
,
taskListener
);
compiler
.
close
();
compiler
.
close
(
false
);
currentContext
=
contextForNextRound
(
currentContext
,
true
);
currentContext
=
contextForNextRound
(
currentContext
,
true
);
compiler
=
JavaCompiler
.
instance
(
currentContext
);
compiler
=
JavaCompiler
.
instance
(
currentContext
);
filer
.
newRound
(
currentContext
,
true
);
filer
.
newRound
(
currentContext
,
true
);
...
@@ -913,7 +914,7 @@ public class JavacProcessingEnvironment implements ProcessingEnvironment, Closea
...
@@ -913,7 +914,7 @@ public class JavacProcessingEnvironment implements ProcessingEnvironment, Closea
}
else
if
(
procOnly
)
{
}
else
if
(
procOnly
)
{
compiler
.
todo
.
clear
();
compiler
.
todo
.
clear
();
}
else
{
// Final compilation
}
else
{
// Final compilation
compiler
.
close
();
compiler
.
close
(
false
);
currentContext
=
contextForNextRound
(
currentContext
,
true
);
currentContext
=
contextForNextRound
(
currentContext
,
true
);
compiler
=
JavaCompiler
.
instance
(
currentContext
);
compiler
=
JavaCompiler
.
instance
(
currentContext
);
...
@@ -987,7 +988,7 @@ public class JavacProcessingEnvironment implements ProcessingEnvironment, Closea
...
@@ -987,7 +988,7 @@ public class JavacProcessingEnvironment implements ProcessingEnvironment, Closea
private
ListBuffer
<
ClassSymbol
>
enterNewClassFiles
(
Context
currentContext
)
{
private
ListBuffer
<
ClassSymbol
>
enterNewClassFiles
(
Context
currentContext
)
{
ClassReader
reader
=
ClassReader
.
instance
(
currentContext
);
ClassReader
reader
=
ClassReader
.
instance
(
currentContext
);
Name
.
Table
names
=
Name
.
Table
.
instance
(
currentContext
);
Name
s
names
=
Names
.
instance
(
currentContext
);
ListBuffer
<
ClassSymbol
>
list
=
new
ListBuffer
<
ClassSymbol
>();
ListBuffer
<
ClassSymbol
>
list
=
new
ListBuffer
<
ClassSymbol
>();
for
(
Map
.
Entry
<
String
,
JavaFileObject
>
entry
:
filer
.
getGeneratedClasses
().
entrySet
())
{
for
(
Map
.
Entry
<
String
,
JavaFileObject
>
entry
:
filer
.
getGeneratedClasses
().
entrySet
())
{
...
@@ -1047,9 +1048,9 @@ public class JavacProcessingEnvironment implements ProcessingEnvironment, Closea
...
@@ -1047,9 +1048,9 @@ public class JavacProcessingEnvironment implements ProcessingEnvironment, Closea
next
.
put
(
Log
.
outKey
,
out
);
next
.
put
(
Log
.
outKey
,
out
);
if
(
shareNames
)
{
if
(
shareNames
)
{
Name
.
Table
names
=
Name
.
Table
.
instance
(
context
);
Name
s
names
=
Names
.
instance
(
context
);
assert
names
!=
null
;
assert
names
!=
null
;
next
.
put
(
Name
.
Table
.
namesKey
,
names
);
next
.
put
(
Name
s
.
namesKey
,
names
);
}
}
DiagnosticListener
dl
=
context
.
get
(
DiagnosticListener
.
class
);
DiagnosticListener
dl
=
context
.
get
(
DiagnosticListener
.
class
);
...
@@ -1067,9 +1068,9 @@ public class JavacProcessingEnvironment implements ProcessingEnvironment, Closea
...
@@ -1067,9 +1068,9 @@ public class JavacProcessingEnvironment implements ProcessingEnvironment, Closea
((
JavacFileManager
)
jfm
).
setContext
(
next
);
((
JavacFileManager
)
jfm
).
setContext
(
next
);
}
}
Name
.
Table
names
=
Name
.
Table
.
instance
(
context
);
Name
s
names
=
Names
.
instance
(
context
);
assert
names
!=
null
;
assert
names
!=
null
;
next
.
put
(
Name
.
Table
.
namesKey
,
names
);
next
.
put
(
Name
s
.
namesKey
,
names
);
Keywords
keywords
=
Keywords
.
instance
(
context
);
Keywords
keywords
=
Keywords
.
instance
(
context
);
assert
(
keywords
!=
null
);
assert
(
keywords
!=
null
);
...
...
src/share/classes/com/sun/tools/javac/tree/Pretty.java
浏览文件 @
de6f1495
...
@@ -336,7 +336,7 @@ public class Pretty extends JCTree.Visitor {
...
@@ -336,7 +336,7 @@ public class Pretty extends JCTree.Visitor {
if
(
l
.
head
.
getTag
()
==
JCTree
.
IMPORT
)
{
if
(
l
.
head
.
getTag
()
==
JCTree
.
IMPORT
)
{
JCImport
imp
=
(
JCImport
)
l
.
head
;
JCImport
imp
=
(
JCImport
)
l
.
head
;
Name
name
=
TreeInfo
.
name
(
imp
.
qualid
);
Name
name
=
TreeInfo
.
name
(
imp
.
qualid
);
if
(
name
==
name
.
table
.
asterisk
||
if
(
name
==
name
.
table
.
names
.
asterisk
||
cdef
==
null
||
cdef
==
null
||
isUsed
(
TreeInfo
.
symbol
(
imp
.
qualid
),
cdef
))
{
isUsed
(
TreeInfo
.
symbol
(
imp
.
qualid
),
cdef
))
{
if
(
firstImport
)
{
if
(
firstImport
)
{
...
@@ -439,14 +439,14 @@ public class Pretty extends JCTree.Visitor {
...
@@ -439,14 +439,14 @@ public class Pretty extends JCTree.Visitor {
public
void
visitMethodDef
(
JCMethodDecl
tree
)
{
public
void
visitMethodDef
(
JCMethodDecl
tree
)
{
try
{
try
{
// when producing source output, omit anonymous constructors
// when producing source output, omit anonymous constructors
if
(
tree
.
name
==
tree
.
name
.
table
.
init
&&
if
(
tree
.
name
==
tree
.
name
.
table
.
names
.
init
&&
enclClassName
==
null
&&
enclClassName
==
null
&&
sourceOutput
)
return
;
sourceOutput
)
return
;
println
();
align
();
println
();
align
();
printDocComment
(
tree
);
printDocComment
(
tree
);
printExpr
(
tree
.
mods
);
printExpr
(
tree
.
mods
);
printTypeParameters
(
tree
.
typarams
);
printTypeParameters
(
tree
.
typarams
);
if
(
tree
.
name
==
tree
.
name
.
table
.
init
)
{
if
(
tree
.
name
==
tree
.
name
.
table
.
names
.
init
)
{
print
(
enclClassName
!=
null
?
enclClassName
:
tree
.
name
);
print
(
enclClassName
!=
null
?
enclClassName
:
tree
.
name
);
}
else
{
}
else
{
printExpr
(
tree
.
restype
);
printExpr
(
tree
.
restype
);
...
@@ -835,8 +835,8 @@ public class Pretty extends JCTree.Visitor {
...
@@ -835,8 +835,8 @@ public class Pretty extends JCTree.Visitor {
Name
enclClassNamePrev
=
enclClassName
;
Name
enclClassNamePrev
=
enclClassName
;
enclClassName
=
enclClassName
=
tree
.
def
.
name
!=
null
?
tree
.
def
.
name
:
tree
.
def
.
name
!=
null
?
tree
.
def
.
name
:
tree
.
type
!=
null
&&
tree
.
type
.
tsym
.
name
!=
tree
.
type
.
tsym
.
name
.
table
.
empty
?
tree
.
type
.
tsym
.
name
:
tree
.
type
!=
null
&&
tree
.
type
.
tsym
.
name
!=
tree
.
type
.
tsym
.
name
.
table
.
names
.
empty
null
;
?
tree
.
type
.
tsym
.
name
:
null
;
if
((
tree
.
def
.
mods
.
flags
&
Flags
.
ENUM
)
!=
0
)
print
(
"/*enum*/"
);
if
((
tree
.
def
.
mods
.
flags
&
Flags
.
ENUM
)
!=
0
)
print
(
"/*enum*/"
);
printBlock
(
tree
.
def
.
defs
);
printBlock
(
tree
.
def
.
defs
);
enclClassName
=
enclClassNamePrev
;
enclClassName
=
enclClassNamePrev
;
...
...
src/share/classes/com/sun/tools/javac/tree/TreeInfo.java
浏览文件 @
de6f1495
...
@@ -61,7 +61,7 @@ public class TreeInfo {
...
@@ -61,7 +61,7 @@ public class TreeInfo {
private
TreeInfo
(
Context
context
)
{
private
TreeInfo
(
Context
context
)
{
context
.
put
(
treeInfoKey
,
this
);
context
.
put
(
treeInfoKey
,
this
);
Name
.
Table
names
=
Name
.
Table
.
instance
(
context
);
Name
s
names
=
Names
.
instance
(
context
);
opname
[
JCTree
.
POS
-
JCTree
.
POS
]
=
names
.
fromString
(
"+"
);
opname
[
JCTree
.
POS
-
JCTree
.
POS
]
=
names
.
fromString
(
"+"
);
opname
[
JCTree
.
NEG
-
JCTree
.
POS
]
=
names
.
hyphen
;
opname
[
JCTree
.
NEG
-
JCTree
.
POS
]
=
names
.
hyphen
;
opname
[
JCTree
.
NOT
-
JCTree
.
POS
]
=
names
.
fromString
(
"!"
);
opname
[
JCTree
.
NOT
-
JCTree
.
POS
]
=
names
.
fromString
(
"!"
);
...
@@ -104,7 +104,7 @@ public class TreeInfo {
...
@@ -104,7 +104,7 @@ public class TreeInfo {
public
static
boolean
isConstructor
(
JCTree
tree
)
{
public
static
boolean
isConstructor
(
JCTree
tree
)
{
if
(
tree
.
getTag
()
==
JCTree
.
METHODDEF
)
{
if
(
tree
.
getTag
()
==
JCTree
.
METHODDEF
)
{
Name
name
=
((
JCMethodDecl
)
tree
).
name
;
Name
name
=
((
JCMethodDecl
)
tree
).
name
;
return
name
==
name
.
table
.
init
;
return
name
==
name
.
table
.
names
.
init
;
}
else
{
}
else
{
return
false
;
return
false
;
}
}
...
@@ -130,7 +130,7 @@ public class TreeInfo {
...
@@ -130,7 +130,7 @@ public class TreeInfo {
if
(
select
.
sym
!=
null
&&
if
(
select
.
sym
!=
null
&&
(
select
.
sym
.
flags
()
&
SYNTHETIC
)
!=
0
)
{
(
select
.
sym
.
flags
()
&
SYNTHETIC
)
!=
0
)
{
Name
selected
=
name
(
select
.
selected
);
Name
selected
=
name
(
select
.
selected
);
if
(
selected
!=
null
&&
selected
==
selected
.
table
.
_this
)
if
(
selected
!=
null
&&
selected
==
selected
.
table
.
names
.
_this
)
return
true
;
return
true
;
}
}
}
}
...
@@ -157,7 +157,7 @@ public class TreeInfo {
...
@@ -157,7 +157,7 @@ public class TreeInfo {
public
static
boolean
isSelfCall
(
JCTree
tree
)
{
public
static
boolean
isSelfCall
(
JCTree
tree
)
{
Name
name
=
calledMethodName
(
tree
);
Name
name
=
calledMethodName
(
tree
);
if
(
name
!=
null
)
{
if
(
name
!=
null
)
{
Name
.
Table
names
=
name
.
table
;
Name
s
names
=
name
.
table
.
names
;
return
name
==
names
.
_this
||
name
==
names
.
_super
;
return
name
==
names
.
_this
||
name
==
names
.
_super
;
}
else
{
}
else
{
return
false
;
return
false
;
...
@@ -169,7 +169,7 @@ public class TreeInfo {
...
@@ -169,7 +169,7 @@ public class TreeInfo {
public
static
boolean
isSuperCall
(
JCTree
tree
)
{
public
static
boolean
isSuperCall
(
JCTree
tree
)
{
Name
name
=
calledMethodName
(
tree
);
Name
name
=
calledMethodName
(
tree
);
if
(
name
!=
null
)
{
if
(
name
!=
null
)
{
Name
.
Table
names
=
name
.
table
;
Name
s
names
=
name
.
table
.
names
;
return
name
==
names
.
_super
;
return
name
==
names
.
_super
;
}
else
{
}
else
{
return
false
;
return
false
;
...
@@ -183,14 +183,14 @@ public class TreeInfo {
...
@@ -183,14 +183,14 @@ public class TreeInfo {
JCMethodInvocation
app
=
firstConstructorCall
(
tree
);
JCMethodInvocation
app
=
firstConstructorCall
(
tree
);
if
(
app
==
null
)
return
false
;
if
(
app
==
null
)
return
false
;
Name
meth
=
name
(
app
.
meth
);
Name
meth
=
name
(
app
.
meth
);
return
meth
==
null
||
meth
!=
meth
.
table
.
_this
;
return
meth
==
null
||
meth
!=
meth
.
table
.
names
.
_this
;
}
}
/** Return the first call in a constructor definition. */
/** Return the first call in a constructor definition. */
public
static
JCMethodInvocation
firstConstructorCall
(
JCTree
tree
)
{
public
static
JCMethodInvocation
firstConstructorCall
(
JCTree
tree
)
{
if
(
tree
.
getTag
()
!=
JCTree
.
METHODDEF
)
return
null
;
if
(
tree
.
getTag
()
!=
JCTree
.
METHODDEF
)
return
null
;
JCMethodDecl
md
=
(
JCMethodDecl
)
tree
;
JCMethodDecl
md
=
(
JCMethodDecl
)
tree
;
Name
.
Table
names
=
md
.
name
.
table
;
Name
s
names
=
md
.
name
.
table
.
names
;
if
(
md
.
name
!=
names
.
init
)
return
null
;
if
(
md
.
name
!=
names
.
init
)
return
null
;
if
(
md
.
body
==
null
)
return
null
;
if
(
md
.
body
==
null
)
return
null
;
List
<
JCStatement
>
stats
=
md
.
body
.
stats
;
List
<
JCStatement
>
stats
=
md
.
body
.
stats
;
...
...
src/share/classes/com/sun/tools/javac/tree/TreeMaker.java
浏览文件 @
de6f1495
...
@@ -67,7 +67,7 @@ public class TreeMaker implements JCTree.Factory {
...
@@ -67,7 +67,7 @@ public class TreeMaker implements JCTree.Factory {
public
JCCompilationUnit
toplevel
;
public
JCCompilationUnit
toplevel
;
/** The current name table. */
/** The current name table. */
Name
.
Table
names
;
Name
s
names
;
Types
types
;
Types
types
;
...
@@ -80,14 +80,14 @@ public class TreeMaker implements JCTree.Factory {
...
@@ -80,14 +80,14 @@ public class TreeMaker implements JCTree.Factory {
context
.
put
(
treeMakerKey
,
this
);
context
.
put
(
treeMakerKey
,
this
);
this
.
pos
=
Position
.
NOPOS
;
this
.
pos
=
Position
.
NOPOS
;
this
.
toplevel
=
null
;
this
.
toplevel
=
null
;
this
.
names
=
Name
.
Table
.
instance
(
context
);
this
.
names
=
Name
s
.
instance
(
context
);
this
.
syms
=
Symtab
.
instance
(
context
);
this
.
syms
=
Symtab
.
instance
(
context
);
this
.
types
=
Types
.
instance
(
context
);
this
.
types
=
Types
.
instance
(
context
);
}
}
/** Create a tree maker with a given toplevel and FIRSTPOS as initial position.
/** Create a tree maker with a given toplevel and FIRSTPOS as initial position.
*/
*/
TreeMaker
(
JCCompilationUnit
toplevel
,
Name
.
Table
names
,
Types
types
,
Symtab
syms
)
{
TreeMaker
(
JCCompilationUnit
toplevel
,
Name
s
names
,
Types
types
,
Symtab
syms
)
{
this
.
pos
=
Position
.
FIRSTPOS
;
this
.
pos
=
Position
.
FIRSTPOS
;
this
.
toplevel
=
toplevel
;
this
.
toplevel
=
toplevel
;
this
.
names
=
names
;
this
.
names
=
names
;
...
...
src/share/classes/com/sun/tools/javac/util/ByteBuffer.java
浏览文件 @
de6f1495
...
@@ -150,7 +150,7 @@ public class ByteBuffer {
...
@@ -150,7 +150,7 @@ public class ByteBuffer {
/** Append a name.
/** Append a name.
*/
*/
public
void
appendName
(
Name
name
)
{
public
void
appendName
(
Name
name
)
{
appendBytes
(
name
.
table
.
names
,
name
.
index
,
name
.
len
);
appendBytes
(
name
.
getByteArray
(),
name
.
getByteOffset
(),
name
.
getByteLength
()
);
}
}
/** Reset to zero length.
/** Reset to zero length.
...
@@ -161,7 +161,7 @@ public class ByteBuffer {
...
@@ -161,7 +161,7 @@ public class ByteBuffer {
/** Convert contents to name.
/** Convert contents to name.
*/
*/
public
Name
toName
(
Name
.
Table
names
)
{
public
Name
toName
(
Name
s
names
)
{
return
names
.
fromUtf
(
elems
,
0
,
length
);
return
names
.
fromUtf
(
elems
,
0
,
length
);
}
}
}
}
src/share/classes/com/sun/tools/javac/util/Convert.java
浏览文件 @
de6f1495
...
@@ -289,7 +289,7 @@ public class Convert {
...
@@ -289,7 +289,7 @@ public class Convert {
*/
*/
public
static
Name
shortName
(
Name
classname
)
{
public
static
Name
shortName
(
Name
classname
)
{
return
classname
.
subName
(
return
classname
.
subName
(
classname
.
lastIndexOf
((
byte
)
'.'
)
+
1
,
classname
.
len
);
classname
.
lastIndexOf
((
byte
)
'.'
)
+
1
,
classname
.
getByteLength
()
);
}
}
public
static
String
shortName
(
String
classname
)
{
public
static
String
shortName
(
String
classname
)
{
...
...
src/share/classes/com/sun/tools/javac/util/Name.java
浏览文件 @
de6f1495
此差异已折叠。
点击以展开。
src/share/classes/com/sun/tools/javac/util/Names.java
0 → 100644
浏览文件 @
de6f1495
/*
* Copyright 1999-2006 Sun Microsystems, Inc. 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. Sun designates this
* particular file as subject to the "Classpath" exception as provided
* by Sun 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
* CA 95054 USA or visit www.sun.com if you need additional information or
* have any questions.
*/
package
com.sun.tools.javac.util
;
/**
* Access to the compiler's name table. STandard names are defined,
* as well as methods to create new names.
*
* <p><b>This is NOT part of any API supported by Sun Microsystems. If
* you write code that depends on this, you do so at your own risk.
* This code and its internal interfaces are subject to change or
* deletion without notice.</b>
*/
public
class
Names
{
public
static
final
Context
.
Key
<
Names
>
namesKey
=
new
Context
.
Key
<
Names
>();
public
static
Names
instance
(
Context
context
)
{
Names
instance
=
context
.
get
(
namesKey
);
if
(
instance
==
null
)
{
instance
=
new
Names
(
context
);
context
.
put
(
namesKey
,
instance
);
}
return
instance
;
}
public
final
Name
slash
;
public
final
Name
hyphen
;
public
final
Name
T
;
public
final
Name
slashequals
;
public
final
Name
deprecated
;
public
final
Name
init
;
public
final
Name
clinit
;
public
final
Name
error
;
public
final
Name
any
;
public
final
Name
empty
;
public
final
Name
one
;
public
final
Name
period
;
public
final
Name
comma
;
public
final
Name
semicolon
;
public
final
Name
asterisk
;
public
final
Name
_this
;
public
final
Name
_super
;
public
final
Name
_default
;
public
final
Name
_class
;
public
final
Name
java_lang
;
public
final
Name
java_lang_Object
;
public
final
Name
java_lang_Class
;
public
final
Name
java_lang_Cloneable
;
public
final
Name
java_io_Serializable
;
public
final
Name
serialVersionUID
;
public
final
Name
java_lang_Enum
;
public
final
Name
package_info
;
public
final
Name
ConstantValue
;
public
final
Name
LineNumberTable
;
public
final
Name
LocalVariableTable
;
public
final
Name
LocalVariableTypeTable
;
public
final
Name
CharacterRangeTable
;
public
final
Name
StackMap
;
public
final
Name
StackMapTable
;
public
final
Name
SourceID
;
public
final
Name
CompilationID
;
public
final
Name
Code
;
public
final
Name
Exceptions
;
public
final
Name
SourceFile
;
public
final
Name
InnerClasses
;
public
final
Name
Synthetic
;
public
final
Name
Bridge
;
public
final
Name
Deprecated
;
public
final
Name
Enum
;
public
final
Name
_name
;
public
final
Name
Signature
;
public
final
Name
Varargs
;
public
final
Name
Annotation
;
public
final
Name
RuntimeVisibleAnnotations
;
public
final
Name
RuntimeInvisibleAnnotations
;
public
final
Name
RuntimeVisibleParameterAnnotations
;
public
final
Name
RuntimeInvisibleParameterAnnotations
;
public
final
Name
Value
;
public
final
Name
EnclosingMethod
;
public
final
Name
desiredAssertionStatus
;
public
final
Name
append
;
public
final
Name
family
;
public
final
Name
forName
;
public
final
Name
toString
;
public
final
Name
length
;
public
final
Name
valueOf
;
public
final
Name
value
;
public
final
Name
getMessage
;
public
final
Name
getClass
;
public
final
Name
TYPE
;
public
final
Name
FIELD
;
public
final
Name
METHOD
;
public
final
Name
PARAMETER
;
public
final
Name
CONSTRUCTOR
;
public
final
Name
LOCAL_VARIABLE
;
public
final
Name
ANNOTATION_TYPE
;
public
final
Name
PACKAGE
;
public
final
Name
SOURCE
;
public
final
Name
CLASS
;
public
final
Name
RUNTIME
;
public
final
Name
Array
;
public
final
Name
Method
;
public
final
Name
Bound
;
public
final
Name
clone
;
public
final
Name
getComponentType
;
public
final
Name
getClassLoader
;
public
final
Name
initCause
;
public
final
Name
values
;
public
final
Name
iterator
;
public
final
Name
hasNext
;
public
final
Name
next
;
public
final
Name
AnnotationDefault
;
public
final
Name
ordinal
;
public
final
Name
equals
;
public
final
Name
hashCode
;
public
final
Name
compareTo
;
public
final
Name
getDeclaringClass
;
public
final
Name
ex
;
public
final
Name
finalize
;
public
final
Name
.
Table
table
;
public
Names
(
Context
context
)
{
Options
options
=
Options
.
instance
(
context
);
table
=
createTable
(
options
);
slash
=
fromString
(
"/"
);
hyphen
=
fromString
(
"-"
);
T
=
fromString
(
"T"
);
slashequals
=
fromString
(
"/="
);
deprecated
=
fromString
(
"deprecated"
);
init
=
fromString
(
"<init>"
);
clinit
=
fromString
(
"<clinit>"
);
error
=
fromString
(
"<error>"
);
any
=
fromString
(
"<any>"
);
empty
=
fromString
(
""
);
one
=
fromString
(
"1"
);
period
=
fromString
(
"."
);
comma
=
fromString
(
","
);
semicolon
=
fromString
(
";"
);
asterisk
=
fromString
(
"*"
);
_this
=
fromString
(
"this"
);
_super
=
fromString
(
"super"
);
_default
=
fromString
(
"default"
);
_class
=
fromString
(
"class"
);
java_lang
=
fromString
(
"java.lang"
);
java_lang_Object
=
fromString
(
"java.lang.Object"
);
java_lang_Class
=
fromString
(
"java.lang.Class"
);
java_lang_Cloneable
=
fromString
(
"java.lang.Cloneable"
);
java_io_Serializable
=
fromString
(
"java.io.Serializable"
);
java_lang_Enum
=
fromString
(
"java.lang.Enum"
);
package_info
=
fromString
(
"package-info"
);
serialVersionUID
=
fromString
(
"serialVersionUID"
);
ConstantValue
=
fromString
(
"ConstantValue"
);
LineNumberTable
=
fromString
(
"LineNumberTable"
);
LocalVariableTable
=
fromString
(
"LocalVariableTable"
);
LocalVariableTypeTable
=
fromString
(
"LocalVariableTypeTable"
);
CharacterRangeTable
=
fromString
(
"CharacterRangeTable"
);
StackMap
=
fromString
(
"StackMap"
);
StackMapTable
=
fromString
(
"StackMapTable"
);
SourceID
=
fromString
(
"SourceID"
);
CompilationID
=
fromString
(
"CompilationID"
);
Code
=
fromString
(
"Code"
);
Exceptions
=
fromString
(
"Exceptions"
);
SourceFile
=
fromString
(
"SourceFile"
);
InnerClasses
=
fromString
(
"InnerClasses"
);
Synthetic
=
fromString
(
"Synthetic"
);
Bridge
=
fromString
(
"Bridge"
);
Deprecated
=
fromString
(
"Deprecated"
);
Enum
=
fromString
(
"Enum"
);
_name
=
fromString
(
"name"
);
Signature
=
fromString
(
"Signature"
);
Varargs
=
fromString
(
"Varargs"
);
Annotation
=
fromString
(
"Annotation"
);
RuntimeVisibleAnnotations
=
fromString
(
"RuntimeVisibleAnnotations"
);
RuntimeInvisibleAnnotations
=
fromString
(
"RuntimeInvisibleAnnotations"
);
RuntimeVisibleParameterAnnotations
=
fromString
(
"RuntimeVisibleParameterAnnotations"
);
RuntimeInvisibleParameterAnnotations
=
fromString
(
"RuntimeInvisibleParameterAnnotations"
);
Value
=
fromString
(
"Value"
);
EnclosingMethod
=
fromString
(
"EnclosingMethod"
);
desiredAssertionStatus
=
fromString
(
"desiredAssertionStatus"
);
append
=
fromString
(
"append"
);
family
=
fromString
(
"family"
);
forName
=
fromString
(
"forName"
);
toString
=
fromString
(
"toString"
);
length
=
fromString
(
"length"
);
valueOf
=
fromString
(
"valueOf"
);
value
=
fromString
(
"value"
);
getMessage
=
fromString
(
"getMessage"
);
getClass
=
fromString
(
"getClass"
);
TYPE
=
fromString
(
"TYPE"
);
FIELD
=
fromString
(
"FIELD"
);
METHOD
=
fromString
(
"METHOD"
);
PARAMETER
=
fromString
(
"PARAMETER"
);
CONSTRUCTOR
=
fromString
(
"CONSTRUCTOR"
);
LOCAL_VARIABLE
=
fromString
(
"LOCAL_VARIABLE"
);
ANNOTATION_TYPE
=
fromString
(
"ANNOTATION_TYPE"
);
PACKAGE
=
fromString
(
"PACKAGE"
);
SOURCE
=
fromString
(
"SOURCE"
);
CLASS
=
fromString
(
"CLASS"
);
RUNTIME
=
fromString
(
"RUNTIME"
);
Array
=
fromString
(
"Array"
);
Method
=
fromString
(
"Method"
);
Bound
=
fromString
(
"Bound"
);
clone
=
fromString
(
"clone"
);
getComponentType
=
fromString
(
"getComponentType"
);
getClassLoader
=
fromString
(
"getClassLoader"
);
initCause
=
fromString
(
"initCause"
);
values
=
fromString
(
"values"
);
iterator
=
fromString
(
"iterator"
);
hasNext
=
fromString
(
"hasNext"
);
next
=
fromString
(
"next"
);
AnnotationDefault
=
fromString
(
"AnnotationDefault"
);
ordinal
=
fromString
(
"ordinal"
);
equals
=
fromString
(
"equals"
);
hashCode
=
fromString
(
"hashCode"
);
compareTo
=
fromString
(
"compareTo"
);
getDeclaringClass
=
fromString
(
"getDeclaringClass"
);
ex
=
fromString
(
"ex"
);
finalize
=
fromString
(
"finalize"
);
}
protected
Name
.
Table
createTable
(
Options
options
)
{
boolean
useUnsharedTable
=
options
.
get
(
"useUnsharedTable"
)
!=
null
;
if
(
useUnsharedTable
)
return
new
UnsharedNameTable
(
this
);
else
return
new
SharedNameTable
(
this
);
}
public
void
dispose
()
{
table
.
dispose
();
}
public
Name
fromChars
(
char
[]
cs
,
int
start
,
int
len
)
{
return
table
.
fromChars
(
cs
,
start
,
len
);
}
public
Name
fromString
(
String
s
)
{
return
table
.
fromString
(
s
);
}
public
Name
fromUtf
(
byte
[]
cs
)
{
return
table
.
fromUtf
(
cs
);
}
public
Name
fromUtf
(
byte
[]
cs
,
int
start
,
int
len
)
{
return
table
.
fromUtf
(
cs
,
start
,
len
);
}
}
src/share/classes/com/sun/tools/javac/util/SharedNameTable.java
0 → 100644
浏览文件 @
de6f1495
/*
* Copyright 1999-2006 Sun Microsystems, Inc. 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. Sun designates this
* particular file as subject to the "Classpath" exception as provided
* by Sun 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
* CA 95054 USA or visit www.sun.com if you need additional information or
* have any questions.
*/
package
com.sun.tools.javac.util
;
import
java.lang.ref.SoftReference
;
/**
* Implementation of Name.Table that stores all names in a single shared
* byte array, expanding it as needed. This avoids the overhead incurred
* by using an array of bytes for each name.
*
* <p><b>This is NOT part of any API supported by Sun Microsystems. If
* you write code that depends on this, you do so at your own risk.
* This code and its internal interfaces are subject to change or
* deletion without notice.</b>
*/
public
class
SharedNameTable
extends
Name
.
Table
{
// maintain a freelist of recently used name tables for reuse.
private
static
List
<
SoftReference
<
SharedNameTable
>>
freelist
=
List
.
nil
();
static
public
synchronized
SharedNameTable
create
(
Names
names
)
{
while
(
freelist
.
nonEmpty
())
{
SharedNameTable
t
=
freelist
.
head
.
get
();
freelist
=
freelist
.
tail
;
if
(
t
!=
null
)
{
return
t
;
}
}
return
new
SharedNameTable
(
names
);
}
static
private
synchronized
void
dispose
(
SharedNameTable
t
)
{
freelist
=
freelist
.
prepend
(
new
SoftReference
<
SharedNameTable
>(
t
));
}
/** The hash table for names.
*/
private
NameImpl
[]
hashes
;
/** The shared byte array holding all encountered names.
*/
public
byte
[]
bytes
;
/** The mask to be used for hashing
*/
private
int
hashMask
;
/** The number of filled bytes in `names'.
*/
private
int
nc
=
0
;
/** Allocator
* @param names The main name table
* @param hashSize the (constant) size to be used for the hash table
* needs to be a power of two.
* @param nameSize the initial size of the name table.
*/
public
SharedNameTable
(
Names
names
,
int
hashSize
,
int
nameSize
)
{
super
(
names
);
hashMask
=
hashSize
-
1
;
hashes
=
new
NameImpl
[
hashSize
];
bytes
=
new
byte
[
nameSize
];
}
public
SharedNameTable
(
Names
names
)
{
this
(
names
,
0x8000
,
0x20000
);
}
@Override
public
Name
fromChars
(
char
[]
cs
,
int
start
,
int
len
)
{
int
nc
=
this
.
nc
;
byte
[]
bytes
=
this
.
bytes
;
while
(
nc
+
len
*
3
>=
bytes
.
length
)
{
// System.err.println("doubling name buffer of length " + names.length + " to fit " + len + " chars");//DEBUG
byte
[]
newnames
=
new
byte
[
bytes
.
length
*
2
];
System
.
arraycopy
(
bytes
,
0
,
newnames
,
0
,
bytes
.
length
);
bytes
=
this
.
bytes
=
newnames
;
}
int
nbytes
=
Convert
.
chars2utf
(
cs
,
start
,
bytes
,
nc
,
len
)
-
nc
;
int
h
=
hashValue
(
bytes
,
nc
,
nbytes
)
&
hashMask
;
NameImpl
n
=
hashes
[
h
];
while
(
n
!=
null
&&
(
n
.
getByteLength
()
!=
nbytes
||
!
equals
(
bytes
,
n
.
index
,
bytes
,
nc
,
nbytes
)))
{
n
=
n
.
next
;
}
if
(
n
==
null
)
{
n
=
new
NameImpl
(
this
);
n
.
index
=
nc
;
n
.
length
=
nbytes
;
n
.
next
=
hashes
[
h
];
hashes
[
h
]
=
n
;
this
.
nc
=
nc
+
nbytes
;
if
(
nbytes
==
0
)
{
this
.
nc
++;
}
}
return
n
;
}
@Override
public
Name
fromUtf
(
byte
[]
cs
,
int
start
,
int
len
)
{
int
h
=
hashValue
(
cs
,
start
,
len
)
&
hashMask
;
NameImpl
n
=
hashes
[
h
];
byte
[]
names
=
this
.
bytes
;
while
(
n
!=
null
&&
(
n
.
getByteLength
()
!=
len
||
!
equals
(
names
,
n
.
index
,
cs
,
start
,
len
)))
{
n
=
n
.
next
;
}
if
(
n
==
null
)
{
int
nc
=
this
.
nc
;
while
(
nc
+
len
>
names
.
length
)
{
// System.err.println("doubling name buffer of length + " + names.length + " to fit " + len + " bytes");//DEBUG
byte
[]
newnames
=
new
byte
[
names
.
length
*
2
];
System
.
arraycopy
(
names
,
0
,
newnames
,
0
,
names
.
length
);
names
=
this
.
bytes
=
newnames
;
}
System
.
arraycopy
(
cs
,
start
,
names
,
nc
,
len
);
n
=
new
NameImpl
(
this
);
n
.
index
=
nc
;
n
.
length
=
len
;
n
.
next
=
hashes
[
h
];
hashes
[
h
]
=
n
;
this
.
nc
=
nc
+
len
;
if
(
len
==
0
)
{
this
.
nc
++;
}
}
return
n
;
}
@Override
public
void
dispose
()
{
dispose
(
this
);
}
static
class
NameImpl
extends
Name
{
/** The next name occupying the same hash bucket.
*/
NameImpl
next
;
/** The index where the bytes of this name are stored in the global name
* buffer `byte'.
*/
int
index
;
/** The number of bytes in this name.
*/
int
length
;
NameImpl
(
SharedNameTable
table
)
{
super
(
table
);
}
@Override
public
int
getIndex
()
{
return
index
;
}
@Override
public
int
getByteLength
()
{
return
length
;
}
@Override
public
byte
getByteAt
(
int
i
)
{
return
getByteArray
()[
index
+
i
];
}
@Override
public
byte
[]
getByteArray
()
{
return
((
SharedNameTable
)
table
).
bytes
;
}
@Override
public
int
getByteOffset
()
{
return
index
;
}
/** Return the hash value of this name.
*/
public
int
hashCode
()
{
return
index
;
}
/** Is this name equal to other?
*/
public
boolean
equals
(
Object
other
)
{
if
(
other
instanceof
Name
)
return
table
==
((
Name
)
other
).
table
&&
index
==
((
Name
)
other
).
getIndex
();
else
return
false
;
}
}
}
src/share/classes/com/sun/tools/javac/util/UnsharedNameTable.java
0 → 100644
浏览文件 @
de6f1495
/*
* Copyright 1999-2006 Sun Microsystems, Inc. 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. Sun designates this
* particular file as subject to the "Classpath" exception as provided
* by Sun 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
* CA 95054 USA or visit www.sun.com if you need additional information or
* have any questions.
*/
package
com.sun.tools.javac.util
;
import
java.lang.ref.WeakReference
;
/**
* Implementation of Name.Table that stores names in individual arrays
* using weak references. It is recommended for use when a single shared
* byte array is unsuitable.
*
* <p><b>This is NOT part of any API supported by Sun Microsystems. If
* you write code that depends on this, you do so at your own risk.
* This code and its internal interfaces are subject to change or
* deletion without notice.</b>
*/
public
class
UnsharedNameTable
extends
Name
.
Table
{
static
public
Name
.
Table
create
(
Names
names
)
{
return
new
UnsharedNameTable
(
names
);
}
static
class
HashEntry
extends
WeakReference
<
NameImpl
>
{
HashEntry
next
;
HashEntry
(
NameImpl
referent
)
{
super
(
referent
);
}
}
/** The hash table for names.
*/
private
HashEntry
[]
hashes
=
null
;
/** The mask to be used for hashing
*/
private
int
hashMask
;
/** Index counter for names in this table.
*/
public
int
index
;
/** Allocator
* @param names The main name table
* @param hashSize the (constant) size to be used for the hash table
* needs to be a power of two.
*/
public
UnsharedNameTable
(
Names
names
,
int
hashSize
)
{
super
(
names
);
hashMask
=
hashSize
-
1
;
hashes
=
new
HashEntry
[
hashSize
];
}
public
UnsharedNameTable
(
Names
names
)
{
this
(
names
,
0x8000
);
}
@Override
public
Name
fromChars
(
char
[]
cs
,
int
start
,
int
len
)
{
byte
[]
name
=
new
byte
[
len
*
3
];
int
nbytes
=
Convert
.
chars2utf
(
cs
,
start
,
name
,
0
,
len
);
return
fromUtf
(
name
,
0
,
nbytes
);
}
@Override
public
Name
fromUtf
(
byte
[]
cs
,
int
start
,
int
len
)
{
int
h
=
hashValue
(
cs
,
start
,
len
)
&
hashMask
;
HashEntry
element
=
hashes
[
h
];
NameImpl
n
=
null
;
HashEntry
previousNonNullTableEntry
=
null
;
HashEntry
firstTableEntry
=
element
;
while
(
element
!=
null
)
{
if
(
element
==
null
)
{
break
;
}
n
=
element
.
get
();
if
(
n
==
null
)
{
if
(
firstTableEntry
==
element
)
{
hashes
[
h
]
=
firstTableEntry
=
element
.
next
;
}
else
{
assert
previousNonNullTableEntry
!=
null
:
"previousNonNullTableEntry cannot be null here."
;
previousNonNullTableEntry
.
next
=
element
.
next
;
}
}
else
{
if
(
n
.
getByteLength
()
==
len
&&
equals
(
n
.
bytes
,
0
,
cs
,
start
,
len
))
{
return
n
;
}
previousNonNullTableEntry
=
element
;
}
element
=
element
.
next
;
}
byte
[]
bytes
=
new
byte
[
len
];
System
.
arraycopy
(
cs
,
start
,
bytes
,
0
,
len
);
n
=
new
NameImpl
(
this
,
bytes
,
index
++);
System
.
arraycopy
(
cs
,
start
,
n
.
bytes
,
0
,
len
);
HashEntry
newEntry
=
new
HashEntry
(
n
);
if
(
previousNonNullTableEntry
==
null
)
{
// We are not the first name with that hashCode.
hashes
[
h
]
=
newEntry
;
}
else
{
assert
previousNonNullTableEntry
.
next
==
null
:
"previousNonNullTableEntry.next must be null."
;
previousNonNullTableEntry
.
next
=
newEntry
;
}
return
n
;
}
@Override
public
void
dispose
()
{
hashes
=
null
;
}
static
class
NameImpl
extends
Name
{
NameImpl
(
UnsharedNameTable
table
,
byte
[]
bytes
,
int
index
)
{
super
(
table
);
this
.
bytes
=
bytes
;
this
.
index
=
index
;
}
final
byte
[]
bytes
;
final
int
index
;
@Override
public
int
getIndex
()
{
return
index
;
}
@Override
public
int
getByteLength
()
{
return
bytes
.
length
;
}
@Override
public
byte
getByteAt
(
int
i
)
{
return
bytes
[
i
];
}
@Override
public
byte
[]
getByteArray
()
{
return
bytes
;
}
@Override
public
int
getByteOffset
()
{
return
0
;
}
}
}
src/share/classes/com/sun/tools/javadoc/AnnotationTypeDocImpl.java
浏览文件 @
de6f1495
...
@@ -27,17 +27,13 @@ package com.sun.tools.javadoc;
...
@@ -27,17 +27,13 @@ package com.sun.tools.javadoc;
import
com.sun.javadoc.*
;
import
com.sun.javadoc.*
;
import
static
com
.
sun
.
javadoc
.
LanguageVersion
.*;
import
com.sun.tools.javac.code.Flags
;
import
com.sun.tools.javac.code.Kinds
;
import
com.sun.tools.javac.code.Kinds
;
import
com.sun.tools.javac.code.Scope
;
import
com.sun.tools.javac.code.Scope
;
import
com.sun.tools.javac.code.Symbol
;
import
com.sun.tools.javac.code.Symbol.*
;
import
com.sun.tools.javac.code.Symbol.*
;
import
com.sun.tools.javac.tree.JCTree.*
;
import
com.sun.tools.javac.tree.JCTree.*
;
import
com.sun.tools.javac.util.List
;
import
com.sun.tools.javac.util.List
;
import
com.sun.tools.javac.util.ListBuffer
;
import
com.sun.tools.javac.util.Names
;
import
com.sun.tools.javac.util.Name
;
import
com.sun.tools.javac.util.Position
;
import
com.sun.tools.javac.util.Position
;
/**
/**
...
@@ -93,7 +89,7 @@ public class AnnotationTypeDocImpl
...
@@ -93,7 +89,7 @@ public class AnnotationTypeDocImpl
* Elements are always public, so no need to filter them.
* Elements are always public, so no need to filter them.
*/
*/
public
AnnotationTypeElementDoc
[]
elements
()
{
public
AnnotationTypeElementDoc
[]
elements
()
{
Name
.
Table
names
=
tsym
.
name
.
table
;
Name
s
names
=
tsym
.
name
.
table
.
names
;
List
<
AnnotationTypeElementDoc
>
elements
=
List
.
nil
();
List
<
AnnotationTypeElementDoc
>
elements
=
List
.
nil
();
for
(
Scope
.
Entry
e
=
tsym
.
members
().
elems
;
e
!=
null
;
e
=
e
.
sibling
)
{
for
(
Scope
.
Entry
e
=
tsym
.
members
().
elems
;
e
!=
null
;
e
=
e
.
sibling
)
{
if
(
e
.
sym
!=
null
&&
e
.
sym
.
kind
==
Kinds
.
MTH
)
{
if
(
e
.
sym
!=
null
&&
e
.
sym
.
kind
==
Kinds
.
MTH
)
{
...
...
src/share/classes/com/sun/tools/javadoc/ClassDocImpl.java
浏览文件 @
de6f1495
...
@@ -25,8 +25,6 @@
...
@@ -25,8 +25,6 @@
package
com.sun.tools.javadoc
;
package
com.sun.tools.javadoc
;
import
java.util.*
;
import
com.sun.javadoc.*
;
import
com.sun.javadoc.*
;
import
static
com
.
sun
.
javadoc
.
LanguageVersion
.*;
import
static
com
.
sun
.
javadoc
.
LanguageVersion
.*;
...
@@ -40,7 +38,6 @@ import com.sun.tools.javac.code.Flags;
...
@@ -40,7 +38,6 @@ import com.sun.tools.javac.code.Flags;
import
com.sun.tools.javac.code.Kinds
;
import
com.sun.tools.javac.code.Kinds
;
import
com.sun.tools.javac.code.TypeTags
;
import
com.sun.tools.javac.code.TypeTags
;
import
com.sun.tools.javac.code.Type
;
import
com.sun.tools.javac.code.Type
;
import
com.sun.tools.javac.code.Types
;
import
com.sun.tools.javac.code.Type.ClassType
;
import
com.sun.tools.javac.code.Type.ClassType
;
import
com.sun.tools.javac.code.Scope
;
import
com.sun.tools.javac.code.Scope
;
import
com.sun.tools.javac.code.Symbol
;
import
com.sun.tools.javac.code.Symbol
;
...
@@ -55,9 +52,9 @@ import com.sun.tools.javac.tree.JCTree.JCImport;
...
@@ -55,9 +52,9 @@ import com.sun.tools.javac.tree.JCTree.JCImport;
import
com.sun.tools.javac.tree.JCTree.JCClassDecl
;
import
com.sun.tools.javac.tree.JCTree.JCClassDecl
;
import
com.sun.tools.javac.tree.TreeInfo
;
import
com.sun.tools.javac.tree.TreeInfo
;
import
com.sun.tools.javac.util.Names
;
import
static
com
.
sun
.
tools
.
javac
.
code
.
Flags
.*;
import
static
com
.
sun
.
tools
.
javac
.
code
.
Flags
.*;
import
static
com
.
sun
.
tools
.
javac
.
code
.
Kinds
.*;
import
static
com
.
sun
.
tools
.
javac
.
code
.
Kinds
.*;
import
static
com
.
sun
.
tools
.
javac
.
code
.
TypeTags
.*;
import
java.io.File
;
import
java.io.File
;
import
java.util.Set
;
import
java.util.Set
;
...
@@ -549,7 +546,7 @@ public class ClassDocImpl extends ProgramElementDocImpl implements ClassDoc {
...
@@ -549,7 +546,7 @@ public class ClassDocImpl extends ProgramElementDocImpl implements ClassDoc {
* methods in this class. Does not include constructors.
* methods in this class. Does not include constructors.
*/
*/
public
MethodDoc
[]
methods
(
boolean
filter
)
{
public
MethodDoc
[]
methods
(
boolean
filter
)
{
Name
.
Table
names
=
tsym
.
name
.
table
;
Name
s
names
=
tsym
.
name
.
table
.
names
;
List
<
MethodDocImpl
>
methods
=
List
.
nil
();
List
<
MethodDocImpl
>
methods
=
List
.
nil
();
for
(
Scope
.
Entry
e
=
tsym
.
members
().
elems
;
e
!=
null
;
e
=
e
.
sibling
)
{
for
(
Scope
.
Entry
e
=
tsym
.
members
().
elems
;
e
!=
null
;
e
=
e
.
sibling
)
{
if
(
e
.
sym
!=
null
&&
if
(
e
.
sym
!=
null
&&
...
@@ -582,7 +579,7 @@ public class ClassDocImpl extends ProgramElementDocImpl implements ClassDoc {
...
@@ -582,7 +579,7 @@ public class ClassDocImpl extends ProgramElementDocImpl implements ClassDoc {
* constructors in this class.
* constructors in this class.
*/
*/
public
ConstructorDoc
[]
constructors
(
boolean
filter
)
{
public
ConstructorDoc
[]
constructors
(
boolean
filter
)
{
Name
.
Table
names
=
tsym
.
name
.
table
;
Name
s
names
=
tsym
.
name
.
table
.
names
;
List
<
ConstructorDocImpl
>
constructors
=
List
.
nil
();
List
<
ConstructorDocImpl
>
constructors
=
List
.
nil
();
for
(
Scope
.
Entry
e
=
tsym
.
members
().
elems
;
e
!=
null
;
e
=
e
.
sibling
)
{
for
(
Scope
.
Entry
e
=
tsym
.
members
().
elems
;
e
!=
null
;
e
=
e
.
sibling
)
{
if
(
e
.
sym
!=
null
&&
if
(
e
.
sym
!=
null
&&
...
@@ -696,7 +693,7 @@ public class ClassDocImpl extends ProgramElementDocImpl implements ClassDoc {
...
@@ -696,7 +693,7 @@ public class ClassDocImpl extends ProgramElementDocImpl implements ClassDoc {
}
}
private
ClassDoc
searchClass
(
String
className
)
{
private
ClassDoc
searchClass
(
String
className
)
{
Name
.
Table
names
=
tsym
.
name
.
table
;
Name
s
names
=
tsym
.
name
.
table
.
names
;
// search by qualified name first
// search by qualified name first
ClassDoc
cd
=
env
.
lookupClass
(
className
);
ClassDoc
cd
=
env
.
lookupClass
(
className
);
...
@@ -848,7 +845,7 @@ public class ClassDocImpl extends ProgramElementDocImpl implements ClassDoc {
...
@@ -848,7 +845,7 @@ public class ClassDocImpl extends ProgramElementDocImpl implements ClassDoc {
*---------------------------------*/
*---------------------------------*/
// search current class
// search current class
Name
.
Table
names
=
tsym
.
name
.
table
;
Name
s
names
=
tsym
.
name
.
table
.
names
;
Scope
.
Entry
e
=
tsym
.
members
().
lookup
(
names
.
fromString
(
methodName
));
Scope
.
Entry
e
=
tsym
.
members
().
lookup
(
names
.
fromString
(
methodName
));
//### Using modifier filter here isn't really correct,
//### Using modifier filter here isn't really correct,
...
@@ -936,7 +933,7 @@ public class ClassDocImpl extends ProgramElementDocImpl implements ClassDoc {
...
@@ -936,7 +933,7 @@ public class ClassDocImpl extends ProgramElementDocImpl implements ClassDoc {
*/
*/
public
ConstructorDoc
findConstructor
(
String
constrName
,
public
ConstructorDoc
findConstructor
(
String
constrName
,
String
[]
paramTypes
)
{
String
[]
paramTypes
)
{
Name
.
Table
names
=
tsym
.
name
.
table
;
Name
s
names
=
tsym
.
name
.
table
.
names
;
for
(
Scope
.
Entry
e
=
tsym
.
members
().
lookup
(
names
.
fromString
(
"<init>"
));
e
.
scope
!=
null
;
e
=
e
.
next
())
{
for
(
Scope
.
Entry
e
=
tsym
.
members
().
lookup
(
names
.
fromString
(
"<init>"
));
e
.
scope
!=
null
;
e
=
e
.
next
())
{
if
(
e
.
sym
.
kind
==
Kinds
.
MTH
)
{
if
(
e
.
sym
.
kind
==
Kinds
.
MTH
)
{
if
(
hasParameterTypes
((
MethodSymbol
)
e
.
sym
,
paramTypes
))
{
if
(
hasParameterTypes
((
MethodSymbol
)
e
.
sym
,
paramTypes
))
{
...
@@ -973,7 +970,7 @@ public class ClassDocImpl extends ProgramElementDocImpl implements ClassDoc {
...
@@ -973,7 +970,7 @@ public class ClassDocImpl extends ProgramElementDocImpl implements ClassDoc {
}
}
private
FieldDocImpl
searchField
(
String
fieldName
,
Set
<
ClassDocImpl
>
searched
)
{
private
FieldDocImpl
searchField
(
String
fieldName
,
Set
<
ClassDocImpl
>
searched
)
{
Name
.
Table
names
=
tsym
.
name
.
table
;
Name
s
names
=
tsym
.
name
.
table
.
names
;
if
(
searched
.
contains
(
this
))
{
if
(
searched
.
contains
(
this
))
{
return
null
;
return
null
;
}
}
...
@@ -1040,7 +1037,7 @@ public class ClassDocImpl extends ProgramElementDocImpl implements ClassDoc {
...
@@ -1040,7 +1037,7 @@ public class ClassDocImpl extends ProgramElementDocImpl implements ClassDoc {
Env
<
AttrContext
>
compenv
=
env
.
enter
.
getEnv
(
tsym
);
Env
<
AttrContext
>
compenv
=
env
.
enter
.
getEnv
(
tsym
);
if
(
compenv
==
null
)
return
new
ClassDocImpl
[
0
];
if
(
compenv
==
null
)
return
new
ClassDocImpl
[
0
];
Name
asterisk
=
tsym
.
name
.
table
.
asterisk
;
Name
asterisk
=
tsym
.
name
.
table
.
names
.
asterisk
;
for
(
JCTree
t
:
compenv
.
toplevel
.
defs
)
{
for
(
JCTree
t
:
compenv
.
toplevel
.
defs
)
{
if
(
t
.
getTag
()
==
JCTree
.
IMPORT
)
{
if
(
t
.
getTag
()
==
JCTree
.
IMPORT
)
{
JCTree
imp
=
((
JCImport
)
t
).
qualid
;
JCTree
imp
=
((
JCImport
)
t
).
qualid
;
...
@@ -1076,7 +1073,7 @@ public class ClassDocImpl extends ProgramElementDocImpl implements ClassDoc {
...
@@ -1076,7 +1073,7 @@ public class ClassDocImpl extends ProgramElementDocImpl implements ClassDoc {
ListBuffer
<
PackageDocImpl
>
importedPackages
=
new
ListBuffer
<
PackageDocImpl
>();
ListBuffer
<
PackageDocImpl
>
importedPackages
=
new
ListBuffer
<
PackageDocImpl
>();
//### Add the implicit "import java.lang.*" to the result
//### Add the implicit "import java.lang.*" to the result
Name
.
Table
names
=
tsym
.
name
.
table
;
Name
s
names
=
tsym
.
name
.
table
.
names
;
importedPackages
.
append
(
env
.
getPackageDoc
(
env
.
reader
.
enterPackage
(
names
.
java_lang
)));
importedPackages
.
append
(
env
.
getPackageDoc
(
env
.
reader
.
enterPackage
(
names
.
java_lang
)));
Env
<
AttrContext
>
compenv
=
env
.
enter
.
getEnv
(
tsym
);
Env
<
AttrContext
>
compenv
=
env
.
enter
.
getEnv
(
tsym
);
...
...
src/share/classes/com/sun/tools/javadoc/DocEnv.java
浏览文件 @
de6f1495
...
@@ -33,13 +33,11 @@ import com.sun.javadoc.*;
...
@@ -33,13 +33,11 @@ import com.sun.javadoc.*;
import
com.sun.tools.javac.code.*
;
import
com.sun.tools.javac.code.*
;
import
com.sun.tools.javac.code.Symbol.*
;
import
com.sun.tools.javac.code.Symbol.*
;
import
com.sun.tools.javac.code.Type.ClassType
;
import
com.sun.tools.javac.code.Type.ClassType
;
import
com.sun.tools.javac.code.Type.TypeVar
;
import
com.sun.tools.javac.comp.Attr
;
import
com.sun.tools.javac.comp.Attr
;
import
com.sun.tools.javac.comp.Check
;
import
com.sun.tools.javac.comp.Check
;
import
com.sun.tools.javac.tree.JCTree.*
;
import
com.sun.tools.javac.tree.JCTree.*
;
import
com.sun.tools.javac.util.Context
;
import
com.sun.tools.javac.util.Context
;
import
com.sun.tools.javac.util.List
;
import
com.sun.tools.javac.util.Names
;
import
com.sun.tools.javac.util.Name
;
import
com.sun.tools.javac.util.Position
;
import
com.sun.tools.javac.util.Position
;
...
@@ -83,7 +81,7 @@ public class DocEnv {
...
@@ -83,7 +81,7 @@ public class DocEnv {
JavadocEnter
enter
;
JavadocEnter
enter
;
/** The name table. */
/** The name table. */
Name
.
Table
names
;
Name
s
names
;
/** The encoding name. */
/** The encoding name. */
private
String
encoding
;
private
String
encoding
;
...
@@ -131,7 +129,7 @@ public class DocEnv {
...
@@ -131,7 +129,7 @@ public class DocEnv {
reader
=
JavadocClassReader
.
instance0
(
context
);
reader
=
JavadocClassReader
.
instance0
(
context
);
enter
=
JavadocEnter
.
instance0
(
context
);
enter
=
JavadocEnter
.
instance0
(
context
);
attr
=
Attr
.
instance
(
context
);
attr
=
Attr
.
instance
(
context
);
names
=
Name
.
Table
.
instance
(
context
);
names
=
Name
s
.
instance
(
context
);
externalizableSym
=
reader
.
enterClass
(
names
.
fromString
(
"java.io.Externalizable"
));
externalizableSym
=
reader
.
enterClass
(
names
.
fromString
(
"java.io.Externalizable"
));
chk
=
Check
.
instance
(
context
);
chk
=
Check
.
instance
(
context
);
types
=
Types
.
instance
(
context
);
types
=
Types
.
instance
(
context
);
...
...
src/share/classes/com/sun/tools/javadoc/SerializedForm.java
浏览文件 @
de6f1495
...
@@ -35,6 +35,7 @@ import com.sun.tools.javac.code.Symbol.ClassSymbol;
...
@@ -35,6 +35,7 @@ import com.sun.tools.javac.code.Symbol.ClassSymbol;
import
com.sun.tools.javac.code.Symbol.MethodSymbol
;
import
com.sun.tools.javac.code.Symbol.MethodSymbol
;
import
com.sun.tools.javac.util.Name
;
import
com.sun.tools.javac.util.Name
;
import
com.sun.tools.javac.util.ListBuffer
;
import
com.sun.tools.javac.util.ListBuffer
;
import
com.sun.tools.javac.util.Names
;
/**
/**
* The serialized form is the specification of a class' serialization
* The serialized form is the specification of a class' serialization
...
@@ -149,7 +150,7 @@ class SerializedForm {
...
@@ -149,7 +150,7 @@ class SerializedForm {
* name SERIALIZABLE_FIELDS.
* name SERIALIZABLE_FIELDS.
*/
*/
private
VarSymbol
getDefinedSerializableFields
(
ClassSymbol
def
)
{
private
VarSymbol
getDefinedSerializableFields
(
ClassSymbol
def
)
{
Name
.
Table
names
=
def
.
name
.
table
;
Name
s
names
=
def
.
name
.
table
.
names
;
/* SERIALIZABLE_FIELDS can be private,
/* SERIALIZABLE_FIELDS can be private,
* so must lookup by ClassSymbol, not by ClassDocImpl.
* so must lookup by ClassSymbol, not by ClassDocImpl.
...
@@ -202,7 +203,7 @@ class SerializedForm {
...
@@ -202,7 +203,7 @@ class SerializedForm {
* @param visibility the visibility flag for the given method.
* @param visibility the visibility flag for the given method.
*/
*/
private
void
addMethodIfExist
(
DocEnv
env
,
ClassSymbol
def
,
String
methodName
)
{
private
void
addMethodIfExist
(
DocEnv
env
,
ClassSymbol
def
,
String
methodName
)
{
Name
.
Table
names
=
def
.
name
.
table
;
Name
s
names
=
def
.
name
.
table
.
names
;
for
(
Scope
.
Entry
e
=
def
.
members
().
lookup
(
names
.
fromString
(
methodName
));
e
.
scope
!=
null
;
e
=
e
.
next
())
{
for
(
Scope
.
Entry
e
=
def
.
members
().
lookup
(
names
.
fromString
(
methodName
));
e
.
scope
!=
null
;
e
=
e
.
next
())
{
if
(
e
.
sym
.
kind
==
Kinds
.
MTH
)
{
if
(
e
.
sym
.
kind
==
Kinds
.
MTH
)
{
...
@@ -228,7 +229,7 @@ class SerializedForm {
...
@@ -228,7 +229,7 @@ class SerializedForm {
private
void
mapSerialFieldTagImplsToFieldDocImpls
(
FieldDocImpl
spfDoc
,
private
void
mapSerialFieldTagImplsToFieldDocImpls
(
FieldDocImpl
spfDoc
,
DocEnv
env
,
DocEnv
env
,
ClassSymbol
def
)
{
ClassSymbol
def
)
{
Name
.
Table
names
=
def
.
name
.
table
;
Name
s
names
=
def
.
name
.
table
.
names
;
SerialFieldTag
[]
sfTag
=
spfDoc
.
serialFieldTags
();
SerialFieldTag
[]
sfTag
=
spfDoc
.
serialFieldTags
();
for
(
int
i
=
0
;
i
<
sfTag
.
length
;
i
++)
{
for
(
int
i
=
0
;
i
<
sfTag
.
length
;
i
++)
{
...
...
src/share/classes/com/sun/tools/javadoc/TypeVariableImpl.java
浏览文件 @
de6f1495
...
@@ -36,6 +36,7 @@ import com.sun.tools.javac.code.Type;
...
@@ -36,6 +36,7 @@ import com.sun.tools.javac.code.Type;
import
com.sun.tools.javac.code.Type.TypeVar
;
import
com.sun.tools.javac.code.Type.TypeVar
;
import
com.sun.tools.javac.util.List
;
import
com.sun.tools.javac.util.List
;
import
com.sun.tools.javac.util.Name
;
import
com.sun.tools.javac.util.Name
;
import
com.sun.tools.javac.util.Names
;
/**
/**
* Implementation of <code>TypeVariable</code>, which
* Implementation of <code>TypeVariable</code>, which
...
@@ -66,7 +67,7 @@ public class TypeVariableImpl extends AbstractTypeImpl implements TypeVariable {
...
@@ -66,7 +67,7 @@ public class TypeVariableImpl extends AbstractTypeImpl implements TypeVariable {
if
((
osym
.
kind
&
Kinds
.
TYP
)
!=
0
)
{
if
((
osym
.
kind
&
Kinds
.
TYP
)
!=
0
)
{
return
env
.
getClassDoc
((
ClassSymbol
)
osym
);
return
env
.
getClassDoc
((
ClassSymbol
)
osym
);
}
}
Name
.
Table
names
=
osym
.
name
.
table
;
Name
s
names
=
osym
.
name
.
table
.
names
;
if
(
osym
.
name
==
names
.
init
)
{
if
(
osym
.
name
==
names
.
init
)
{
return
env
.
getConstructorDoc
((
MethodSymbol
)
osym
);
return
env
.
getConstructorDoc
((
MethodSymbol
)
osym
);
}
else
{
}
else
{
...
@@ -113,7 +114,7 @@ public class TypeVariableImpl extends AbstractTypeImpl implements TypeVariable {
...
@@ -113,7 +114,7 @@ public class TypeVariableImpl extends AbstractTypeImpl implements TypeVariable {
*/
*/
private
static
List
<
Type
>
getBounds
(
TypeVar
v
,
DocEnv
env
)
{
private
static
List
<
Type
>
getBounds
(
TypeVar
v
,
DocEnv
env
)
{
Name
boundname
=
v
.
getUpperBound
().
tsym
.
getQualifiedName
();
Name
boundname
=
v
.
getUpperBound
().
tsym
.
getQualifiedName
();
if
(
boundname
==
boundname
.
table
.
java_lang_Object
)
{
if
(
boundname
==
boundname
.
table
.
names
.
java_lang_Object
)
{
return
List
.
nil
();
return
List
.
nil
();
}
else
{
}
else
{
return
env
.
types
.
getBounds
(
v
);
return
env
.
types
.
getBounds
(
v
);
...
...
test/tools/javac/unit/util/convert/EnclosingCandidates.java
浏览文件 @
de6f1495
...
@@ -36,7 +36,7 @@ import java.util.Locale;
...
@@ -36,7 +36,7 @@ import java.util.Locale;
public
class
EnclosingCandidates
{
public
class
EnclosingCandidates
{
Name
.
Table
names
=
Name
.
Table
.
instance
(
new
Context
());
Name
s
names
=
Names
.
instance
(
new
Context
());
void
test
(
String
name
,
String
...
expected
)
{
void
test
(
String
name
,
String
...
expected
)
{
List
<
Name
>
result
=
enclosingCandidates
(
names
.
fromString
(
name
));
List
<
Name
>
result
=
enclosingCandidates
(
names
.
fromString
(
name
));
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录