Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_langtools
提交
4dd2a905
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看板
提交
4dd2a905
编写于
5月 28, 2008
作者:
T
tbell
浏览文件
操作
浏览文件
下载
差异文件
Merge
上级
a13b3ab8
22904a6d
变更
13
隐藏空白更改
内联
并排
Showing
13 changed file
with
187 addition
and
74 deletion
+187
-74
src/share/classes/com/sun/tools/javac/util/JavacFileManager.java
...re/classes/com/sun/tools/javac/util/JavacFileManager.java
+1
-1
src/share/classes/com/sun/tools/javac/zip/ZipFileIndex.java
src/share/classes/com/sun/tools/javac/zip/ZipFileIndex.java
+25
-0
src/share/classes/com/sun/tools/javac/zip/ZipFileIndexEntry.java
...re/classes/com/sun/tools/javac/zip/ZipFileIndexEntry.java
+25
-0
src/share/classes/sun/tools/javap/ClassData.java
src/share/classes/sun/tools/javap/ClassData.java
+7
-7
src/share/classes/sun/tools/javap/FieldData.java
src/share/classes/sun/tools/javap/FieldData.java
+3
-3
src/share/classes/sun/tools/javap/InnerClassData.java
src/share/classes/sun/tools/javap/InnerClassData.java
+1
-1
src/share/classes/sun/tools/javap/JavapPrinter.java
src/share/classes/sun/tools/javap/JavapPrinter.java
+2
-2
src/share/classes/sun/tools/javap/Main.java
src/share/classes/sun/tools/javap/Main.java
+3
-3
src/share/classes/sun/tools/javap/MethodData.java
src/share/classes/sun/tools/javap/MethodData.java
+9
-9
src/share/classes/sun/tools/javap/Tables.java
src/share/classes/sun/tools/javap/Tables.java
+43
-45
src/share/classes/sun/tools/javap/TypeSignature.java
src/share/classes/sun/tools/javap/TypeSignature.java
+2
-2
test/tools/javac/6589361/T6589361.java
test/tools/javac/6589361/T6589361.java
+1
-1
test/tools/javac/T6705935.java
test/tools/javac/T6705935.java
+65
-0
未找到文件。
src/share/classes/com/sun/tools/javac/util/JavacFileManager.java
浏览文件 @
4dd2a905
...
@@ -1606,7 +1606,7 @@ public class JavacFileManager implements StandardJavaFileManager {
...
@@ -1606,7 +1606,7 @@ public class JavacFileManager implements StandardJavaFileManager {
/** @deprecated see bug 6410637 */
/** @deprecated see bug 6410637 */
@Deprecated
@Deprecated
public
String
getPath
()
{
public
String
getPath
()
{
return
entry
.
getName
()
+
"("
+
entry
+
")"
;
return
zipName
+
"("
+
entry
.
getName
()
+
")"
;
}
}
public
long
getLastModified
()
{
public
long
getLastModified
()
{
...
...
src/share/classes/com/sun/tools/javac/zip/ZipFileIndex.java
浏览文件 @
4dd2a905
/*
* Copyright 2007-2008 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.zip
;
package
com.sun.tools.javac.zip
;
import
java.io.*
;
import
java.io.*
;
...
...
src/share/classes/com/sun/tools/javac/zip/ZipFileIndexEntry.java
浏览文件 @
4dd2a905
/*
* Copyright 2007-2008 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.zip
;
package
com.sun.tools.javac.zip
;
import
java.io.File
;
import
java.io.File
;
...
...
src/share/classes/sun/tools/javap/ClassData.java
浏览文件 @
4dd2a905
...
@@ -58,7 +58,7 @@ public class ClassData implements RuntimeConstants {
...
@@ -58,7 +58,7 @@ public class ClassData implements RuntimeConstants {
private
String
superclassname
;
private
String
superclassname
;
private
int
source_cpx
=
0
;
private
int
source_cpx
=
0
;
private
byte
tags
[];
private
byte
tags
[];
private
Hashtable
indexHashAscii
=
new
Hashtable
();
private
Hashtable
<
Object
,
Integer
>
indexHashAscii
=
new
Hashtable
<
Object
,
Integer
>
();
private
String
pkgPrefix
=
""
;
private
String
pkgPrefix
=
""
;
private
int
pkgPrefixLen
=
0
;
private
int
pkgPrefixLen
=
0
;
...
@@ -167,19 +167,19 @@ public class ClassData implements RuntimeConstants {
...
@@ -167,19 +167,19 @@ public class ClassData implements RuntimeConstants {
switch
(
tags
[
i
]
=
tag
)
{
switch
(
tags
[
i
]
=
tag
)
{
case
CONSTANT_UTF8:
case
CONSTANT_UTF8:
String
str
=
in
.
readUTF
();
String
str
=
in
.
readUTF
();
indexHashAscii
.
put
(
cpool
[
i
]
=
str
,
new
Integer
(
i
)
);
indexHashAscii
.
put
(
cpool
[
i
]
=
str
,
i
);
break
;
break
;
case
CONSTANT_INTEGER:
case
CONSTANT_INTEGER:
cpool
[
i
]
=
new
Integer
(
in
.
readInt
());
cpool
[
i
]
=
Integer
.
valueOf
(
in
.
readInt
());
break
;
break
;
case
CONSTANT_FLOAT:
case
CONSTANT_FLOAT:
cpool
[
i
]
=
new
Float
(
in
.
readFloat
());
cpool
[
i
]
=
Float
.
valueOf
(
in
.
readFloat
());
break
;
break
;
case
CONSTANT_LONG:
case
CONSTANT_LONG:
cpool
[
i
++]
=
new
Long
(
in
.
readLong
());
cpool
[
i
++]
=
Long
.
valueOf
(
in
.
readLong
());
break
;
break
;
case
CONSTANT_DOUBLE:
case
CONSTANT_DOUBLE:
cpool
[
i
++]
=
new
Double
(
in
.
readDouble
());
cpool
[
i
++]
=
Double
.
valueOf
(
in
.
readDouble
());
break
;
break
;
case
CONSTANT_CLASS:
case
CONSTANT_CLASS:
case
CONSTANT_STRING:
case
CONSTANT_STRING:
...
@@ -365,7 +365,7 @@ public class ClassData implements RuntimeConstants {
...
@@ -365,7 +365,7 @@ public class ClassData implements RuntimeConstants {
* Returns the access of this class or interface.
* Returns the access of this class or interface.
*/
*/
public
String
[]
getAccess
(){
public
String
[]
getAccess
(){
Vector
v
=
new
Vector
();
Vector
<
String
>
v
=
new
Vector
<
String
>
();
if
((
access
&
ACC_PUBLIC
)
!=
0
)
v
.
addElement
(
"public"
);
if
((
access
&
ACC_PUBLIC
)
!=
0
)
v
.
addElement
(
"public"
);
if
((
access
&
ACC_FINAL
)
!=
0
)
v
.
addElement
(
"final"
);
if
((
access
&
ACC_FINAL
)
!=
0
)
v
.
addElement
(
"final"
);
if
((
access
&
ACC_ABSTRACT
)
!=
0
)
v
.
addElement
(
"abstract"
);
if
((
access
&
ACC_ABSTRACT
)
!=
0
)
v
.
addElement
(
"abstract"
);
...
...
src/share/classes/sun/tools/javap/FieldData.java
浏览文件 @
4dd2a905
...
@@ -45,7 +45,7 @@ public class FieldData implements RuntimeConstants {
...
@@ -45,7 +45,7 @@ public class FieldData implements RuntimeConstants {
int
value_cpx
=
0
;
int
value_cpx
=
0
;
boolean
isSynthetic
=
false
;
boolean
isSynthetic
=
false
;
boolean
isDeprecated
=
false
;
boolean
isDeprecated
=
false
;
Vector
attrs
;
Vector
<
AttrData
>
attrs
;
public
FieldData
(
ClassData
cls
){
public
FieldData
(
ClassData
cls
){
this
.
cls
=
cls
;
this
.
cls
=
cls
;
...
@@ -60,7 +60,7 @@ public class FieldData implements RuntimeConstants {
...
@@ -60,7 +60,7 @@ public class FieldData implements RuntimeConstants {
descriptor_index
=
in
.
readUnsignedShort
();
descriptor_index
=
in
.
readUnsignedShort
();
// Read the attributes
// Read the attributes
int
attributes_count
=
in
.
readUnsignedShort
();
int
attributes_count
=
in
.
readUnsignedShort
();
attrs
=
new
Vector
(
attributes_count
);
attrs
=
new
Vector
<
AttrData
>
(
attributes_count
);
for
(
int
i
=
0
;
i
<
attributes_count
;
i
++)
{
for
(
int
i
=
0
;
i
<
attributes_count
;
i
++)
{
int
attr_name_index
=
in
.
readUnsignedShort
();
int
attr_name_index
=
in
.
readUnsignedShort
();
if
(
cls
.
getTag
(
attr_name_index
)!=
CONSTANT_UTF8
)
continue
;
if
(
cls
.
getTag
(
attr_name_index
)!=
CONSTANT_UTF8
)
continue
;
...
@@ -99,7 +99,7 @@ public class FieldData implements RuntimeConstants {
...
@@ -99,7 +99,7 @@ public class FieldData implements RuntimeConstants {
* Returns access of a field.
* Returns access of a field.
*/
*/
public
String
[]
getAccess
(){
public
String
[]
getAccess
(){
Vector
v
=
new
Vector
();
Vector
<
String
>
v
=
new
Vector
<
String
>
();
if
((
access
&
ACC_PUBLIC
)
!=
0
)
v
.
addElement
(
"public"
);
if
((
access
&
ACC_PUBLIC
)
!=
0
)
v
.
addElement
(
"public"
);
if
((
access
&
ACC_PRIVATE
)
!=
0
)
v
.
addElement
(
"private"
);
if
((
access
&
ACC_PRIVATE
)
!=
0
)
v
.
addElement
(
"private"
);
if
((
access
&
ACC_PROTECTED
)
!=
0
)
v
.
addElement
(
"protected"
);
if
((
access
&
ACC_PROTECTED
)
!=
0
)
v
.
addElement
(
"protected"
);
...
...
src/share/classes/sun/tools/javap/InnerClassData.java
浏览文件 @
4dd2a905
...
@@ -63,7 +63,7 @@ class InnerClassData implements RuntimeConstants {
...
@@ -63,7 +63,7 @@ class InnerClassData implements RuntimeConstants {
* Returns the access of this class or interface.
* Returns the access of this class or interface.
*/
*/
public
String
[]
getAccess
(){
public
String
[]
getAccess
(){
Vector
v
=
new
Vector
();
Vector
<
String
>
v
=
new
Vector
<
String
>
();
if
((
access
&
ACC_PUBLIC
)
!=
0
)
v
.
addElement
(
"public"
);
if
((
access
&
ACC_PUBLIC
)
!=
0
)
v
.
addElement
(
"public"
);
if
((
access
&
ACC_FINAL
)
!=
0
)
v
.
addElement
(
"final"
);
if
((
access
&
ACC_FINAL
)
!=
0
)
v
.
addElement
(
"final"
);
if
((
access
&
ACC_ABSTRACT
)
!=
0
)
v
.
addElement
(
"abstract"
);
if
((
access
&
ACC_ABSTRACT
)
!=
0
)
v
.
addElement
(
"abstract"
);
...
...
src/share/classes/sun/tools/javap/JavapPrinter.java
浏览文件 @
4dd2a905
...
@@ -653,7 +653,7 @@ public class JavapPrinter {
...
@@ -653,7 +653,7 @@ public class JavapPrinter {
case
CONSTANT_METHOD:
case
CONSTANT_METHOD:
case
CONSTANT_INTERFACEMETHOD:
case
CONSTANT_INTERFACEMETHOD:
case
CONSTANT_FIELD:
{
case
CONSTANT_FIELD:
{
CPX2
x
=
(
CPX2
)(
cls
.
getCpoolEntry
(
cpx
)
);
CPX2
x
=
cls
.
getCpoolEntry
(
cpx
);
if
(
x
.
cpx1
==
cls
.
getthis_cpx
())
{
if
(
x
.
cpx1
==
cls
.
getthis_cpx
())
{
// don't print class part for local references
// don't print class part for local references
cpx
=
x
.
cpx2
;
cpx
=
x
.
cpx2
;
...
@@ -851,7 +851,7 @@ public class JavapPrinter {
...
@@ -851,7 +851,7 @@ public class JavapPrinter {
case
CONSTANT_INTERFACEMETHOD:
case
CONSTANT_INTERFACEMETHOD:
case
CONSTANT_FIELD:
{
case
CONSTANT_FIELD:
{
// CPX2 x=(CPX2)(cpool[cpx]);
// CPX2 x=(CPX2)(cpool[cpx]);
CPX2
x
=
(
CPX2
)(
cls
.
getCpoolEntry
(
cpx
)
);
CPX2
x
=
cls
.
getCpoolEntry
(
cpx
);
if
(
x
.
cpx1
==
cls
.
getthis_cpx
())
{
if
(
x
.
cpx1
==
cls
.
getthis_cpx
())
{
// don't print class part for local references
// don't print class part for local references
cpx
=
x
.
cpx2
;
cpx
=
x
.
cpx2
;
...
...
src/share/classes/sun/tools/javap/Main.java
浏览文件 @
4dd2a905
...
@@ -35,9 +35,9 @@ import java.io.*;
...
@@ -35,9 +35,9 @@ import java.io.*;
*
*
* @author Sucheta Dambalkar (Adopted code from old javap)
* @author Sucheta Dambalkar (Adopted code from old javap)
*/
*/
public
class
Main
{
public
class
Main
{
private
Vector
classList
=
new
Vector
();
private
Vector
<
String
>
classList
=
new
Vector
<
String
>
();
private
PrintWriter
out
;
private
PrintWriter
out
;
JavapEnvironment
env
=
new
JavapEnvironment
();
JavapEnvironment
env
=
new
JavapEnvironment
();
private
static
boolean
errorOccurred
=
false
;
private
static
boolean
errorOccurred
=
false
;
...
@@ -201,7 +201,7 @@ public class Main{
...
@@ -201,7 +201,7 @@ public class Main{
*/
*/
private
void
displayResults
()
{
private
void
displayResults
()
{
for
(
int
i
=
0
;
i
<
classList
.
size
()
;
i
++
)
{
for
(
int
i
=
0
;
i
<
classList
.
size
()
;
i
++
)
{
String
Name
=
(
String
)
classList
.
elementAt
(
i
);
String
Name
=
classList
.
elementAt
(
i
);
InputStream
classin
=
env
.
getFileInputStream
(
Name
);
InputStream
classin
=
env
.
getFileInputStream
(
Name
);
try
{
try
{
...
...
src/share/classes/sun/tools/javap/MethodData.java
浏览文件 @
4dd2a905
...
@@ -43,14 +43,14 @@ public class MethodData {
...
@@ -43,14 +43,14 @@ public class MethodData {
int
descriptor_index
;
int
descriptor_index
;
int
attributes_count
;
int
attributes_count
;
byte
[]
code
;
byte
[]
code
;
Vector
exception_table
=
new
Vector
(
0
);
Vector
<
TrapData
>
exception_table
=
new
Vector
<
TrapData
>
(
0
);
Vector
lin_num_tb
=
new
Vector
(
0
);
Vector
<
LineNumData
>
lin_num_tb
=
new
Vector
<
LineNumData
>
(
0
);
Vector
loc_var_tb
=
new
Vector
(
0
);
Vector
<
LocVarData
>
loc_var_tb
=
new
Vector
<
LocVarData
>
(
0
);
StackMapTableData
[]
stackMapTable
;
StackMapTableData
[]
stackMapTable
;
StackMapData
[]
stackMap
;
StackMapData
[]
stackMap
;
int
[]
exc_index_table
=
null
;
int
[]
exc_index_table
=
null
;
Vector
attrs
=
new
Vector
(
0
);
Vector
<
AttrData
>
attrs
=
new
Vector
<
AttrData
>
(
0
);
Vector
code_attrs
=
new
Vector
(
0
);
Vector
<
AttrData
>
code_attrs
=
new
Vector
<
AttrData
>
(
0
);
int
max_stack
,
max_locals
;
int
max_stack
,
max_locals
;
boolean
isSynthetic
=
false
;
boolean
isSynthetic
=
false
;
boolean
isDeprecated
=
false
;
boolean
isDeprecated
=
false
;
...
@@ -165,7 +165,7 @@ public class MethodData {
...
@@ -165,7 +165,7 @@ public class MethodData {
*/
*/
void
readExceptionTable
(
DataInputStream
in
)
throws
IOException
{
void
readExceptionTable
(
DataInputStream
in
)
throws
IOException
{
int
exception_table_len
=
in
.
readUnsignedShort
();
int
exception_table_len
=
in
.
readUnsignedShort
();
exception_table
=
new
Vector
(
exception_table_len
);
exception_table
=
new
Vector
<
TrapData
>
(
exception_table_len
);
for
(
int
l
=
0
;
l
<
exception_table_len
;
l
++)
{
for
(
int
l
=
0
;
l
<
exception_table_len
;
l
++)
{
exception_table
.
addElement
(
new
TrapData
(
in
,
l
));
exception_table
.
addElement
(
new
TrapData
(
in
,
l
));
}
}
...
@@ -177,7 +177,7 @@ public class MethodData {
...
@@ -177,7 +177,7 @@ public class MethodData {
void
readLineNumTable
(
DataInputStream
in
)
throws
IOException
{
void
readLineNumTable
(
DataInputStream
in
)
throws
IOException
{
int
attr_len
=
in
.
readInt
();
// attr_length
int
attr_len
=
in
.
readInt
();
// attr_length
int
lin_num_tb_len
=
in
.
readUnsignedShort
();
int
lin_num_tb_len
=
in
.
readUnsignedShort
();
lin_num_tb
=
new
Vector
(
lin_num_tb_len
);
lin_num_tb
=
new
Vector
<
LineNumData
>
(
lin_num_tb_len
);
for
(
int
l
=
0
;
l
<
lin_num_tb_len
;
l
++)
{
for
(
int
l
=
0
;
l
<
lin_num_tb_len
;
l
++)
{
lin_num_tb
.
addElement
(
new
LineNumData
(
in
));
lin_num_tb
.
addElement
(
new
LineNumData
(
in
));
}
}
...
@@ -189,7 +189,7 @@ public class MethodData {
...
@@ -189,7 +189,7 @@ public class MethodData {
void
readLocVarTable
(
DataInputStream
in
)
throws
IOException
{
void
readLocVarTable
(
DataInputStream
in
)
throws
IOException
{
int
attr_len
=
in
.
readInt
();
// attr_length
int
attr_len
=
in
.
readInt
();
// attr_length
int
loc_var_tb_len
=
in
.
readUnsignedShort
();
int
loc_var_tb_len
=
in
.
readUnsignedShort
();
loc_var_tb
=
new
Vector
(
loc_var_tb_len
);
loc_var_tb
=
new
Vector
<
LocVarData
>
(
loc_var_tb_len
);
for
(
int
l
=
0
;
l
<
loc_var_tb_len
;
l
++)
{
for
(
int
l
=
0
;
l
<
loc_var_tb_len
;
l
++)
{
loc_var_tb
.
addElement
(
new
LocVarData
(
in
));
loc_var_tb
.
addElement
(
new
LocVarData
(
in
));
}
}
...
@@ -237,7 +237,7 @@ public class MethodData {
...
@@ -237,7 +237,7 @@ public class MethodData {
*/
*/
public
String
[]
getAccess
(){
public
String
[]
getAccess
(){
Vector
v
=
new
Vector
();
Vector
<
String
>
v
=
new
Vector
<
String
>
();
if
((
access
&
ACC_PUBLIC
)
!=
0
)
v
.
addElement
(
"public"
);
if
((
access
&
ACC_PUBLIC
)
!=
0
)
v
.
addElement
(
"public"
);
if
((
access
&
ACC_PRIVATE
)
!=
0
)
v
.
addElement
(
"private"
);
if
((
access
&
ACC_PRIVATE
)
!=
0
)
v
.
addElement
(
"private"
);
if
((
access
&
ACC_PROTECTED
)
!=
0
)
v
.
addElement
(
"protected"
);
if
((
access
&
ACC_PROTECTED
)
!=
0
)
v
.
addElement
(
"protected"
);
...
...
src/share/classes/sun/tools/javap/Tables.java
浏览文件 @
4dd2a905
...
@@ -26,8 +26,6 @@
...
@@ -26,8 +26,6 @@
package
sun.tools.javap
;
package
sun.tools.javap
;
import
java.io.IOException
;
import
java.io.InputStream
;
import
java.util.Hashtable
;
import
java.util.Hashtable
;
import
java.util.Vector
;
import
java.util.Vector
;
...
@@ -36,14 +34,14 @@ public class Tables implements Constants {
...
@@ -36,14 +34,14 @@ public class Tables implements Constants {
/**
/**
* Define mnemocodes table.
* Define mnemocodes table.
*/
*/
static
Hashtable
mnemocodes
=
new
Hashtable
(
301
,
0.5f
);
static
Hashtable
<
String
,
Integer
>
mnemocodes
=
new
Hashtable
<
String
,
Integer
>
(
301
,
0.5f
);
static
String
opcExtNamesTab
[]=
new
String
[
128
];
static
String
opcExtNamesTab
[]=
new
String
[
128
];
static
String
opcPrivExtNamesTab
[]=
new
String
[
128
];
static
String
opcPrivExtNamesTab
[]=
new
String
[
128
];
static
void
defineNonPriv
(
int
opc
,
String
mnem
)
{
static
void
defineNonPriv
(
int
opc
,
String
mnem
)
{
mnemocodes
.
put
(
opcExtNamesTab
[
opc
]=
mnem
,
new
Integer
(
opc_nonpriv
*
256
+
opc
)
);
mnemocodes
.
put
(
opcExtNamesTab
[
opc
]=
mnem
,
opc_nonpriv
*
256
+
opc
);
}
}
static
void
definePriv
(
int
opc
,
String
mnem
)
{
static
void
definePriv
(
int
opc
,
String
mnem
)
{
mnemocodes
.
put
(
opcPrivExtNamesTab
[
opc
]=
"priv_"
+
mnem
,
new
Integer
(
opc_priv
*
256
+
opc
)
);
mnemocodes
.
put
(
opcPrivExtNamesTab
[
opc
]=
"priv_"
+
mnem
,
opc_priv
*
256
+
opc
);
}
}
static
void
defineExt
(
int
opc
,
String
mnem
)
{
static
void
defineExt
(
int
opc
,
String
mnem
)
{
defineNonPriv
(
opc
,
mnem
);
defineNonPriv
(
opc
,
mnem
);
...
@@ -51,28 +49,28 @@ public class Tables implements Constants {
...
@@ -51,28 +49,28 @@ public class Tables implements Constants {
}
}
static
{
int
k
;
static
{
int
k
;
for
(
k
=
0
;
k
<
opc_wide
;
k
++)
{
for
(
k
=
0
;
k
<
opc_wide
;
k
++)
{
mnemocodes
.
put
(
opcNamesTab
[
k
],
new
Integer
(
k
)
);
mnemocodes
.
put
(
opcNamesTab
[
k
],
k
);
}
}
for
(
k
=
opc_wide
+
1
;
k
<
opcNamesTab
.
length
;
k
++)
{
for
(
k
=
opc_wide
+
1
;
k
<
opcNamesTab
.
length
;
k
++)
{
mnemocodes
.
put
(
opcNamesTab
[
k
],
new
Integer
(
k
)
);
mnemocodes
.
put
(
opcNamesTab
[
k
],
k
);
}
}
mnemocodes
.
put
(
"invokenonvirtual"
,
new
Integer
(
opc_invokespecial
)
);
mnemocodes
.
put
(
"invokenonvirtual"
,
opc_invokespecial
);
mnemocodes
.
put
(
"iload_w"
,
new
Integer
(
opc_iload_w
)
);
mnemocodes
.
put
(
"iload_w"
,
opc_iload_w
);
mnemocodes
.
put
(
"lload_w"
,
new
Integer
(
opc_lload_w
)
);
mnemocodes
.
put
(
"lload_w"
,
opc_lload_w
);
mnemocodes
.
put
(
"fload_w"
,
new
Integer
(
opc_fload_w
)
);
mnemocodes
.
put
(
"fload_w"
,
opc_fload_w
);
mnemocodes
.
put
(
"dload_w"
,
new
Integer
(
opc_dload_w
)
);
mnemocodes
.
put
(
"dload_w"
,
opc_dload_w
);
mnemocodes
.
put
(
"aload_w"
,
new
Integer
(
opc_aload_w
)
);
mnemocodes
.
put
(
"aload_w"
,
opc_aload_w
);
mnemocodes
.
put
(
"istore_w"
,
new
Integer
(
opc_istore_w
)
);
mnemocodes
.
put
(
"istore_w"
,
opc_istore_w
);
mnemocodes
.
put
(
"lstore_w"
,
new
Integer
(
opc_lstore_w
)
);
mnemocodes
.
put
(
"lstore_w"
,
opc_lstore_w
);
mnemocodes
.
put
(
"fstore_w"
,
new
Integer
(
opc_fstore_w
)
);
mnemocodes
.
put
(
"fstore_w"
,
opc_fstore_w
);
mnemocodes
.
put
(
"dstore_w"
,
new
Integer
(
opc_dstore_w
)
);
mnemocodes
.
put
(
"dstore_w"
,
opc_dstore_w
);
mnemocodes
.
put
(
"astore_w"
,
new
Integer
(
opc_astore_w
)
);
mnemocodes
.
put
(
"astore_w"
,
opc_astore_w
);
mnemocodes
.
put
(
"ret_w"
,
new
Integer
(
opc_ret_w
)
);
mnemocodes
.
put
(
"ret_w"
,
opc_ret_w
);
mnemocodes
.
put
(
"iinc_w"
,
new
Integer
(
opc_iinc_w
)
);
mnemocodes
.
put
(
"iinc_w"
,
opc_iinc_w
);
mnemocodes
.
put
(
"nonpriv"
,
new
Integer
(
opc_nonpriv
)
);
mnemocodes
.
put
(
"nonpriv"
,
opc_nonpriv
);
mnemocodes
.
put
(
"priv"
,
new
Integer
(
opc_priv
)
);
mnemocodes
.
put
(
"priv"
,
opc_priv
);
defineExt
(
0
,
"load_ubyte"
);
defineExt
(
0
,
"load_ubyte"
);
defineExt
(
1
,
"load_byte"
);
defineExt
(
1
,
"load_byte"
);
...
@@ -183,7 +181,7 @@ public class Tables implements Constants {
...
@@ -183,7 +181,7 @@ public class Tables implements Constants {
}
}
public
static
int
opcode
(
String
mnem
)
{
public
static
int
opcode
(
String
mnem
)
{
Integer
Val
=
(
Integer
)(
mnemocodes
.
get
(
mnem
)
);
Integer
Val
=
mnemocodes
.
get
(
mnem
);
if
(
Val
==
null
)
return
-
1
;
if
(
Val
==
null
)
return
-
1
;
return
Val
.
intValue
();
return
Val
.
intValue
();
}
}
...
@@ -191,7 +189,7 @@ public class Tables implements Constants {
...
@@ -191,7 +189,7 @@ public class Tables implements Constants {
/**
/**
* Initialized keyword and token Hashtables
* Initialized keyword and token Hashtables
*/
*/
static
Vector
keywordNames
=
new
Vector
(
40
);
static
Vector
<
String
>
keywordNames
=
new
Vector
<
String
>
(
40
);
private
static
void
defineKeywordName
(
String
id
,
int
token
)
{
private
static
void
defineKeywordName
(
String
id
,
int
token
)
{
if
(
token
>=
keywordNames
.
size
())
{
if
(
token
>=
keywordNames
.
size
())
{
...
@@ -202,7 +200,7 @@ public class Tables implements Constants {
...
@@ -202,7 +200,7 @@ public class Tables implements Constants {
public
static
String
keywordName
(
int
token
)
{
public
static
String
keywordName
(
int
token
)
{
if
(
token
==-
1
)
return
"EOF"
;
if
(
token
==-
1
)
return
"EOF"
;
if
(
token
>=
keywordNames
.
size
())
return
null
;
if
(
token
>=
keywordNames
.
size
())
return
null
;
return
(
String
)
keywordNames
.
elementAt
(
token
);
return
keywordNames
.
elementAt
(
token
);
}
}
static
{
static
{
defineKeywordName
(
"ident"
,
IDENT
);
defineKeywordName
(
"ident"
,
IDENT
);
...
@@ -217,15 +215,15 @@ public class Tables implements Constants {
...
@@ -217,15 +215,15 @@ public class Tables implements Constants {
defineKeywordName
(
"RBRACE"
,
RBRACE
);
defineKeywordName
(
"RBRACE"
,
RBRACE
);
}
}
static
Hashtable
keywords
=
new
Hashtable
(
40
);
static
Hashtable
<
String
,
Integer
>
keywords
=
new
Hashtable
<
String
,
Integer
>
(
40
);
public
static
int
keyword
(
String
idValue
)
{
public
static
int
keyword
(
String
idValue
)
{
Integer
Val
=(
Integer
)(
keywords
.
get
(
idValue
)
);
Integer
val
=
keywords
.
get
(
idValue
);
if
(
V
al
==
null
)
return
IDENT
;
if
(
v
al
==
null
)
return
IDENT
;
return
V
al
.
intValue
();
return
v
al
.
intValue
();
}
}
private
static
void
defineKeyword
(
String
id
,
int
token
)
{
private
static
void
defineKeyword
(
String
id
,
int
token
)
{
keywords
.
put
(
id
,
new
Integer
(
token
)
);
keywords
.
put
(
id
,
token
);
defineKeywordName
(
id
,
token
);
defineKeywordName
(
id
,
token
);
}
}
static
{
static
{
...
@@ -275,8 +273,8 @@ public class Tables implements Constants {
...
@@ -275,8 +273,8 @@ public class Tables implements Constants {
/**
/**
* Define tag table.
* Define tag table.
*/
*/
private
static
Vector
tagNames
=
new
Vector
(
10
);
private
static
Vector
<
String
>
tagNames
=
new
Vector
<
String
>
(
10
);
private
static
Hashtable
Tags
=
new
Hashtable
(
10
);
private
static
Hashtable
<
String
,
Integer
>
Tags
=
new
Hashtable
<
String
,
Integer
>
(
10
);
static
{
static
{
defineTag
(
"Asciz"
,
CONSTANT_UTF8
);
defineTag
(
"Asciz"
,
CONSTANT_UTF8
);
defineTag
(
"int"
,
CONSTANT_INTEGER
);
defineTag
(
"int"
,
CONSTANT_INTEGER
);
...
@@ -291,7 +289,7 @@ public class Tables implements Constants {
...
@@ -291,7 +289,7 @@ public class Tables implements Constants {
defineTag
(
"NameAndType"
,
CONSTANT_NAMEANDTYPE
);
defineTag
(
"NameAndType"
,
CONSTANT_NAMEANDTYPE
);
}
}
private
static
void
defineTag
(
String
id
,
int
val
)
{
private
static
void
defineTag
(
String
id
,
int
val
)
{
Tags
.
put
(
id
,
new
Integer
(
val
)
);
Tags
.
put
(
id
,
val
);
if
(
val
>=
tagNames
.
size
())
{
if
(
val
>=
tagNames
.
size
())
{
tagNames
.
setSize
(
val
+
1
);
tagNames
.
setSize
(
val
+
1
);
}
}
...
@@ -299,10 +297,10 @@ public class Tables implements Constants {
...
@@ -299,10 +297,10 @@ public class Tables implements Constants {
}
}
public
static
String
tagName
(
int
tag
)
{
public
static
String
tagName
(
int
tag
)
{
if
(
tag
>=
tagNames
.
size
())
return
null
;
if
(
tag
>=
tagNames
.
size
())
return
null
;
return
(
String
)
tagNames
.
elementAt
(
tag
);
return
tagNames
.
elementAt
(
tag
);
}
}
public
static
int
tagValue
(
String
idValue
)
{
public
static
int
tagValue
(
String
idValue
)
{
Integer
Val
=
(
Integer
)(
Tags
.
get
(
idValue
)
);
Integer
Val
=
Tags
.
get
(
idValue
);
if
(
Val
==
null
)
return
0
;
if
(
Val
==
null
)
return
0
;
return
Val
.
intValue
();
return
Val
.
intValue
();
}
}
...
@@ -310,8 +308,8 @@ public class Tables implements Constants {
...
@@ -310,8 +308,8 @@ public class Tables implements Constants {
/**
/**
* Define type table. These types used in "newarray" instruction only.
* Define type table. These types used in "newarray" instruction only.
*/
*/
private
static
Vector
typeNames
=
new
Vector
(
10
);
private
static
Vector
<
String
>
typeNames
=
new
Vector
<
String
>
(
10
);
private
static
Hashtable
Types
=
new
Hashtable
(
10
);
private
static
Hashtable
<
String
,
Integer
>
Types
=
new
Hashtable
<
String
,
Integer
>
(
10
);
static
{
static
{
defineType
(
"int"
,
T_INT
);
defineType
(
"int"
,
T_INT
);
defineType
(
"long"
,
T_LONG
);
defineType
(
"long"
,
T_LONG
);
...
@@ -324,28 +322,28 @@ public class Tables implements Constants {
...
@@ -324,28 +322,28 @@ public class Tables implements Constants {
defineType
(
"short"
,
T_SHORT
);
defineType
(
"short"
,
T_SHORT
);
}
}
private
static
void
defineType
(
String
id
,
int
val
)
{
private
static
void
defineType
(
String
id
,
int
val
)
{
Types
.
put
(
id
,
new
Integer
(
val
)
);
Types
.
put
(
id
,
val
);
if
(
val
>=
typeNames
.
size
())
{
if
(
val
>=
typeNames
.
size
())
{
typeNames
.
setSize
(
val
+
1
);
typeNames
.
setSize
(
val
+
1
);
}
}
typeNames
.
setElementAt
(
id
,
val
);
typeNames
.
setElementAt
(
id
,
val
);
}
}
public
static
int
typeValue
(
String
idValue
)
{
public
static
int
typeValue
(
String
idValue
)
{
Integer
Val
=
(
Integer
)(
Types
.
get
(
idValue
)
);
Integer
Val
=
Types
.
get
(
idValue
);
if
(
Val
==
null
)
return
-
1
;
if
(
Val
==
null
)
return
-
1
;
return
Val
.
intValue
();
return
Val
.
intValue
();
}
}
public
static
String
typeName
(
int
type
)
{
public
static
String
typeName
(
int
type
)
{
if
(
type
>=
typeNames
.
size
())
return
null
;
if
(
type
>=
typeNames
.
size
())
return
null
;
return
(
String
)
typeNames
.
elementAt
(
type
);
return
typeNames
.
elementAt
(
type
);
}
}
/**
/**
* Define MapTypes table.
* Define MapTypes table.
* These constants used in stackmap tables only.
* These constants used in stackmap tables only.
*/
*/
private
static
Vector
mapTypeNames
=
new
Vector
(
10
);
private
static
Vector
<
String
>
mapTypeNames
=
new
Vector
<
String
>
(
10
);
private
static
Hashtable
MapTypes
=
new
Hashtable
(
10
);
private
static
Hashtable
<
String
,
Integer
>
MapTypes
=
new
Hashtable
<
String
,
Integer
>
(
10
);
static
{
static
{
defineMapType
(
"bogus"
,
ITEM_Bogus
);
defineMapType
(
"bogus"
,
ITEM_Bogus
);
defineMapType
(
"int"
,
ITEM_Integer
);
defineMapType
(
"int"
,
ITEM_Integer
);
...
@@ -358,20 +356,20 @@ public class Tables implements Constants {
...
@@ -358,20 +356,20 @@ public class Tables implements Constants {
defineMapType
(
"uninitialized"
,
ITEM_NewObject
);
defineMapType
(
"uninitialized"
,
ITEM_NewObject
);
}
}
private
static
void
defineMapType
(
String
id
,
int
val
)
{
private
static
void
defineMapType
(
String
id
,
int
val
)
{
MapTypes
.
put
(
id
,
new
Integer
(
val
)
);
MapTypes
.
put
(
id
,
val
);
if
(
val
>=
mapTypeNames
.
size
())
{
if
(
val
>=
mapTypeNames
.
size
())
{
mapTypeNames
.
setSize
(
val
+
1
);
mapTypeNames
.
setSize
(
val
+
1
);
}
}
mapTypeNames
.
setElementAt
(
id
,
val
);
mapTypeNames
.
setElementAt
(
id
,
val
);
}
}
public
static
int
mapTypeValue
(
String
idValue
)
{
public
static
int
mapTypeValue
(
String
idValue
)
{
Integer
Val
=
(
Integer
)(
MapTypes
.
get
(
idValue
)
);
Integer
Val
=
MapTypes
.
get
(
idValue
);
if
(
Val
==
null
)
return
-
1
;
if
(
Val
==
null
)
return
-
1
;
return
Val
.
intValue
();
return
Val
.
intValue
();
}
}
public
static
String
mapTypeName
(
int
type
)
{
public
static
String
mapTypeName
(
int
type
)
{
if
(
type
>=
mapTypeNames
.
size
())
return
null
;
if
(
type
>=
mapTypeNames
.
size
())
return
null
;
return
(
String
)
mapTypeNames
.
elementAt
(
type
);
return
mapTypeNames
.
elementAt
(
type
);
}
}
}
}
src/share/classes/sun/tools/javap/TypeSignature.java
浏览文件 @
4dd2a905
...
@@ -79,7 +79,7 @@ public class TypeSignature {
...
@@ -79,7 +79,7 @@ public class TypeSignature {
* Returns java type signature of a parameter.
* Returns java type signature of a parameter.
*/
*/
public
String
getParametersHelper
(
String
parameterdes
){
public
String
getParametersHelper
(
String
parameterdes
){
Vector
parameters
=
new
Vector
();
Vector
<
String
>
parameters
=
new
Vector
<
String
>
();
int
startindex
=
-
1
;
int
startindex
=
-
1
;
int
endindex
=
-
1
;
int
endindex
=
-
1
;
String
param
=
""
;
String
param
=
""
;
...
@@ -187,7 +187,7 @@ public class TypeSignature {
...
@@ -187,7 +187,7 @@ public class TypeSignature {
int
i
;
int
i
;
for
(
i
=
0
;
i
<
parameters
.
size
();
i
++){
for
(
i
=
0
;
i
<
parameters
.
size
();
i
++){
parametersignature
+=
(
String
)
parameters
.
elementAt
(
i
);
parametersignature
+=
parameters
.
elementAt
(
i
);
if
(
i
!=
parameters
.
size
()-
1
){
if
(
i
!=
parameters
.
size
()-
1
){
parametersignature
+=
", "
;
parametersignature
+=
", "
;
}
}
...
...
test/tools/javac/6589361/T6589361.java
浏览文件 @
4dd2a905
...
@@ -24,7 +24,7 @@ public class T6589361 {
...
@@ -24,7 +24,7 @@ public class T6589361 {
Iterable
<
JavaFileObject
>
files
=
fm
.
list
(
StandardLocation
.
PLATFORM_CLASS_PATH
,
"java.lang"
,
set
,
false
);
Iterable
<
JavaFileObject
>
files
=
fm
.
list
(
StandardLocation
.
PLATFORM_CLASS_PATH
,
"java.lang"
,
set
,
false
);
for
(
JavaFileObject
file
:
files
)
{
for
(
JavaFileObject
file
:
files
)
{
if
(
file
.
toString
().
startsWith
(
"java"
+
File
.
separator
+
"lang"
+
File
.
separator
+
"Object.class"
))
{
if
(
file
.
toString
().
contains
(
"java"
+
File
.
separator
+
"lang"
+
File
.
separator
+
"Object.class"
))
{
String
str
=
fm
.
inferBinaryName
(
StandardLocation
.
CLASS_PATH
,
file
);
String
str
=
fm
.
inferBinaryName
(
StandardLocation
.
CLASS_PATH
,
file
);
if
(!
str
.
equals
(
"java.lang.Object"
))
{
if
(!
str
.
equals
(
"java.lang.Object"
))
{
throw
new
AssertionError
(
"Error in JavacFileManager.inferBinaryName method!"
);
throw
new
AssertionError
(
"Error in JavacFileManager.inferBinaryName method!"
);
...
...
test/tools/javac/T6705935.java
0 → 100644
浏览文件 @
4dd2a905
/*
* Copyright 2008 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.
*
* 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.
*/
/*
* @test
* @bug 6705935
* @summary javac reports path name of entry in ZipFileIndex incorectly
*/
import
java.io.*
;
import
java.util.*
;
import
javax.tools.*
;
import
com.sun.tools.javac.util.*
;
public
class
T6705935
{
public
static
void
main
(
String
...
args
)
throws
Exception
{
new
T6705935
().
run
();
}
public
void
run
()
throws
Exception
{
File
java_home
=
new
File
(
System
.
getProperty
(
"java.home"
));
if
(
java_home
.
getName
().
equals
(
"jre"
))
java_home
=
java_home
.
getParentFile
();
JavaCompiler
c
=
ToolProvider
.
getSystemJavaCompiler
();
JavaFileManager
fm
=
c
.
getStandardFileManager
(
null
,
null
,
null
);
for
(
JavaFileObject
fo:
fm
.
list
(
StandardLocation
.
PLATFORM_CLASS_PATH
,
"java.lang"
,
Collections
.
singleton
(
JavaFileObject
.
Kind
.
CLASS
),
false
))
{
String
p
=
((
BaseFileObject
)
fo
).
getPath
();
int
bra
=
p
.
indexOf
(
"("
);
int
ket
=
p
.
indexOf
(
")"
);
//System.err.println(bra + "," + ket + "," + p.length());
if
(
bra
==
-
1
||
ket
!=
p
.
length
()
-
1
)
throw
new
Exception
(
"unexpected path: "
+
p
+
"["
+
bra
+
","
+
ket
+
","
+
p
.
length
());
String
part1
=
p
.
substring
(
0
,
bra
);
String
part2
=
p
.
substring
(
bra
+
1
,
ket
);
//System.err.println("[" + part1 + "|" + part2 + "]" + " " + java_home);
if
(
part1
.
equals
(
part2
)
||
!
part1
.
startsWith
(
java_home
.
getPath
()))
throw
new
Exception
(
"bad path: "
+
p
);
}
}
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录