Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_langtools
提交
e57a47d2
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看板
提交
e57a47d2
编写于
10月 10, 2012
作者:
J
jjg
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
8000310: Clean up use of StringBuffer in langtools
Reviewed-by: bpatel
上级
a23eee2f
变更
24
隐藏空白更改
内联
并排
Showing
24 changed file
with
63 addition
and
63 deletion
+63
-63
src/share/classes/com/sun/tools/classfile/Descriptor.java
src/share/classes/com/sun/tools/classfile/Descriptor.java
+2
-2
src/share/classes/com/sun/tools/doclets/formats/html/AbstractExecutableMemberWriter.java
.../doclets/formats/html/AbstractExecutableMemberWriter.java
+1
-1
src/share/classes/com/sun/tools/doclets/formats/html/AbstractMemberWriter.java
.../sun/tools/doclets/formats/html/AbstractMemberWriter.java
+1
-1
src/share/classes/com/sun/tools/doclets/formats/html/HtmlDocletWriter.java
.../com/sun/tools/doclets/formats/html/HtmlDocletWriter.java
+9
-9
src/share/classes/com/sun/tools/doclets/formats/html/LinkFactoryImpl.java
...s/com/sun/tools/doclets/formats/html/LinkFactoryImpl.java
+2
-2
src/share/classes/com/sun/tools/doclets/formats/html/LinkOutputImpl.java
...es/com/sun/tools/doclets/formats/html/LinkOutputImpl.java
+2
-2
src/share/classes/com/sun/tools/doclets/formats/html/TagletOutputImpl.java
.../com/sun/tools/doclets/formats/html/TagletOutputImpl.java
+2
-2
src/share/classes/com/sun/tools/doclets/formats/html/TagletWriterImpl.java
.../com/sun/tools/doclets/formats/html/TagletWriterImpl.java
+3
-3
src/share/classes/com/sun/tools/doclets/formats/html/markup/HtmlDocWriter.java
.../sun/tools/doclets/formats/html/markup/HtmlDocWriter.java
+3
-3
src/share/classes/com/sun/tools/doclets/internal/toolkit/Configuration.java
...com/sun/tools/doclets/internal/toolkit/Configuration.java
+1
-1
src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/AnnotationTypeBuilder.java
...lets/internal/toolkit/builders/AnnotationTypeBuilder.java
+1
-1
src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/ClassBuilder.java
...tools/doclets/internal/toolkit/builders/ClassBuilder.java
+5
-5
src/share/classes/com/sun/tools/doclets/internal/toolkit/taglets/LiteralTaglet.java
...tools/doclets/internal/toolkit/taglets/LiteralTaglet.java
+1
-1
src/share/classes/com/sun/tools/doclets/internal/toolkit/taglets/TagletManager.java
...tools/doclets/internal/toolkit/taglets/TagletManager.java
+1
-1
src/share/classes/com/sun/tools/doclets/internal/toolkit/util/DirectoryManager.java
...tools/doclets/internal/toolkit/util/DirectoryManager.java
+6
-6
src/share/classes/com/sun/tools/doclets/internal/toolkit/util/Extern.java
...s/com/sun/tools/doclets/internal/toolkit/util/Extern.java
+1
-1
src/share/classes/com/sun/tools/javac/code/Printer.java
src/share/classes/com/sun/tools/javac/code/Printer.java
+4
-4
src/share/classes/com/sun/tools/javac/comp/Lower.java
src/share/classes/com/sun/tools/javac/comp/Lower.java
+1
-1
src/share/classes/com/sun/tools/javac/parser/JavacParser.java
...share/classes/com/sun/tools/javac/parser/JavacParser.java
+4
-4
src/share/classes/com/sun/tools/javac/util/Convert.java
src/share/classes/com/sun/tools/javac/util/Convert.java
+2
-2
src/share/classes/com/sun/tools/javac/util/List.java
src/share/classes/com/sun/tools/javac/util/List.java
+2
-2
src/share/classes/com/sun/tools/javah/Gen.java
src/share/classes/com/sun/tools/javah/Gen.java
+3
-3
src/share/classes/com/sun/tools/javah/LLNI.java
src/share/classes/com/sun/tools/javah/LLNI.java
+2
-2
src/share/classes/com/sun/tools/javah/Mangle.java
src/share/classes/com/sun/tools/javah/Mangle.java
+4
-4
未找到文件。
src/share/classes/com/sun/tools/classfile/Descriptor.java
浏览文件 @
e57a47d2
/*
* Copyright (c) 2007, 20
09
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2007, 20
12
, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
...
...
@@ -114,7 +114,7 @@ public class Descriptor {
private
String
parse
(
String
desc
,
int
start
,
int
end
)
throws
InvalidDescriptor
{
int
p
=
start
;
StringBu
ffer
sb
=
new
StringBuff
er
();
StringBu
ilder
sb
=
new
StringBuild
er
();
int
dims
=
0
;
count
=
0
;
...
...
src/share/classes/com/sun/tools/doclets/formats/html/AbstractExecutableMemberWriter.java
浏览文件 @
e57a47d2
...
...
@@ -281,7 +281,7 @@ public abstract class AbstractExecutableMemberWriter extends AbstractMemberWrite
* @return the 1.4.x style anchor for the ExecutableMemberDoc.
*/
protected
String
getErasureAnchor
(
ExecutableMemberDoc
emd
)
{
StringBu
ffer
buf
=
new
StringBuff
er
(
emd
.
name
()
+
"("
);
StringBu
ilder
buf
=
new
StringBuild
er
(
emd
.
name
()
+
"("
);
Parameter
[]
params
=
emd
.
parameters
();
boolean
foundTypeVariable
=
false
;
for
(
int
i
=
0
;
i
<
params
.
length
;
i
++)
{
...
...
src/share/classes/com/sun/tools/doclets/formats/html/AbstractMemberWriter.java
浏览文件 @
e57a47d2
...
...
@@ -263,7 +263,7 @@ public abstract class AbstractMemberWriter {
if
(
len
<=
0
)
{
return
""
;
}
StringBu
ffer
sb
=
new
StringBuff
er
(
len
);
StringBu
ilder
sb
=
new
StringBuild
er
(
len
);
for
(
int
i
=
0
;
i
<
len
;
i
++)
{
sb
.
append
(
' '
);
}
...
...
src/share/classes/com/sun/tools/doclets/formats/html/HtmlDocletWriter.java
浏览文件 @
e57a47d2
...
...
@@ -1567,7 +1567,7 @@ public class HtmlDocletWriter extends HtmlDocWriter {
* @param name File name, to which path string is.
*/
protected
String
pathString
(
PackageDoc
pd
,
String
name
)
{
StringBu
ffer
buf
=
new
StringBuff
er
(
relativePath
);
StringBu
ilder
buf
=
new
StringBuild
er
(
relativePath
);
buf
.
append
(
DirectoryManager
.
getPathToPackage
(
pd
,
name
));
return
buf
.
toString
();
}
...
...
@@ -2030,7 +2030,7 @@ public class HtmlDocletWriter extends HtmlDocWriter {
if
(!
(
tagName
.
startsWith
(
"@link"
)
||
tagName
.
equals
(
"@see"
)))
{
return
""
;
}
StringBu
ffer
result
=
new
StringBuff
er
();
StringBu
ilder
result
=
new
StringBuild
er
();
boolean
isplaintext
=
tagName
.
toLowerCase
().
equals
(
"@linkplain"
);
String
label
=
see
.
label
();
label
=
(
label
.
length
()
>
0
)?
...
...
@@ -2329,7 +2329,7 @@ public class HtmlDocletWriter extends HtmlDocWriter {
text
=
removeNonInlineHtmlTags
(
text
);
}
StringTokenizer
lines
=
new
StringTokenizer
(
text
,
"\r\n"
,
true
);
StringBu
ffer
textBuff
=
new
StringBuff
er
();
StringBu
ilder
textBuff
=
new
StringBuild
er
();
while
(
lines
.
hasMoreTokens
())
{
StringBuilder
line
=
new
StringBuilder
(
lines
.
nextToken
());
Util
.
replaceTabs
(
configuration
.
sourcetab
,
line
);
...
...
@@ -2398,7 +2398,7 @@ public class HtmlDocletWriter extends HtmlDocWriter {
//Redirect all relative links.
int
end
,
begin
=
text
.
toLowerCase
().
indexOf
(
"<a"
);
if
(
begin
>=
0
){
StringBu
ffer
textBuff
=
new
StringBuff
er
(
text
);
StringBu
ilder
textBuff
=
new
StringBuild
er
(
text
);
while
(
begin
>=
0
){
if
(
textBuff
.
length
()
>
begin
+
2
&&
!
Character
.
isWhitespace
(
textBuff
.
charAt
(
begin
+
2
)))
{
...
...
@@ -2688,13 +2688,13 @@ public class HtmlDocletWriter extends HtmlDocWriter {
*/
private
List
<
String
>
getAnnotations
(
int
indent
,
AnnotationDesc
[]
descList
,
boolean
linkBreak
)
{
List
<
String
>
results
=
new
ArrayList
<
String
>();
StringBu
ff
er
annotation
;
StringBu
ild
er
annotation
;
for
(
int
i
=
0
;
i
<
descList
.
length
;
i
++)
{
AnnotationTypeDoc
annotationDoc
=
descList
[
i
].
annotationType
();
if
(!
Util
.
isDocumentedAnnotation
(
annotationDoc
)){
continue
;
}
annotation
=
new
StringBu
ff
er
();
annotation
=
new
StringBu
ild
er
();
LinkInfoImpl
linkInfo
=
new
LinkInfoImpl
(
LinkInfoImpl
.
CONTEXT_ANNOTATION
,
annotationDoc
);
linkInfo
.
label
=
"@"
+
annotationDoc
.
name
();
...
...
@@ -2759,9 +2759,9 @@ public class HtmlDocletWriter extends HtmlDocWriter {
List
<
String
>
list
=
getAnnotations
(
0
,
new
AnnotationDesc
[]{(
AnnotationDesc
)
annotationValue
.
value
()},
false
);
StringBu
ffer
buf
=
new
StringBuff
er
();
for
(
Iterator
<
String
>
iter
=
list
.
iterator
();
iter
.
hasNext
();
)
{
buf
.
append
(
iter
.
next
()
);
StringBu
ilder
buf
=
new
StringBuild
er
();
for
(
String
s:
list
)
{
buf
.
append
(
s
);
}
return
buf
.
toString
();
}
else
if
(
annotationValue
.
value
()
instanceof
MemberDoc
)
{
...
...
src/share/classes/com/sun/tools/doclets/formats/html/LinkFactoryImpl.java
浏览文件 @
e57a47d2
...
...
@@ -71,7 +71,7 @@ public class LinkFactoryImpl extends LinkFactory {
classLinkInfo
.
type
!=
null
&&
!
classDoc
.
qualifiedTypeName
().
equals
(
classLinkInfo
.
type
.
qualifiedTypeName
()))
:
""
;
StringBu
ffer
label
=
new
StringBuff
er
(
StringBu
ilder
label
=
new
StringBuild
er
(
classLinkInfo
.
getClassLinkLabel
(
m_writer
.
configuration
));
classLinkInfo
.
displayLength
+=
label
.
length
();
Configuration
configuration
=
ConfigurationImpl
.
getInstance
();
...
...
@@ -167,7 +167,7 @@ public class LinkFactoryImpl extends LinkFactory {
//with 1.4.2 output.
return
linkInfo
.
classDoc
.
name
()
+
".html"
;
}
StringBu
ffer
buf
=
new
StringBuff
er
(
m_writer
.
relativePath
);
StringBu
ilder
buf
=
new
StringBuild
er
(
m_writer
.
relativePath
);
buf
.
append
(
DirectoryManager
.
getPathToPackage
(
linkInfo
.
classDoc
.
containingPackage
(),
linkInfo
.
classDoc
.
name
()
+
".html"
));
...
...
src/share/classes/com/sun/tools/doclets/formats/html/LinkOutputImpl.java
浏览文件 @
e57a47d2
...
...
@@ -43,13 +43,13 @@ public class LinkOutputImpl implements LinkOutput {
/**
* The output of the link.
*/
public
StringBu
ff
er
output
;
public
StringBu
ild
er
output
;
/**
* Construct a new LinkOutputImpl.
*/
public
LinkOutputImpl
()
{
output
=
new
StringBu
ff
er
();
output
=
new
StringBu
ild
er
();
}
/**
...
...
src/share/classes/com/sun/tools/doclets/formats/html/TagletOutputImpl.java
浏览文件 @
e57a47d2
...
...
@@ -41,7 +41,7 @@ import com.sun.tools.doclets.internal.toolkit.taglets.*;
public
class
TagletOutputImpl
implements
TagletOutput
{
private
StringBu
ff
er
output
;
private
StringBu
ild
er
output
;
public
TagletOutputImpl
(
String
o
)
{
setOutput
(
o
);
...
...
@@ -51,7 +51,7 @@ public class TagletOutputImpl implements TagletOutput {
* {@inheritDoc}
*/
public
void
setOutput
(
Object
o
)
{
output
=
new
StringBu
ff
er
(
o
==
null
?
""
:
(
String
)
o
);
output
=
new
StringBu
ild
er
(
o
==
null
?
""
:
(
String
)
o
);
}
/**
...
...
src/share/classes/com/sun/tools/doclets/formats/html/TagletWriterImpl.java
浏览文件 @
e57a47d2
...
...
@@ -74,7 +74,7 @@ public class TagletWriterImpl extends TagletWriter {
* {@inheritDoc}
*/
public
TagletOutput
deprecatedTagOutput
(
Doc
doc
)
{
StringBu
ffer
output
=
new
StringBuff
er
();
StringBu
ilder
output
=
new
StringBuild
er
();
Tag
[]
deprs
=
doc
.
tags
(
"deprecated"
);
if
(
doc
instanceof
ClassDoc
)
{
if
(
Util
.
isDeprecated
((
ProgramElementDoc
)
doc
))
{
...
...
@@ -125,9 +125,9 @@ public class TagletWriterImpl extends TagletWriter {
* {@inheritDoc}
*/
public
TagletOutput
getParamHeader
(
String
header
)
{
StringBu
ffer
result
=
new
StringBuff
er
();
StringBu
ilder
result
=
new
StringBuild
er
();
result
.
append
(
"<dt>"
);
result
.
append
(
"<span class=\"strong\">"
+
header
+
"</span></dt>"
);
result
.
append
(
"<span class=\"strong\">"
).
append
(
header
).
append
(
"</span></dt>"
);
return
new
TagletOutputImpl
(
result
.
toString
());
}
...
...
src/share/classes/com/sun/tools/doclets/formats/html/markup/HtmlDocWriter.java
浏览文件 @
e57a47d2
...
...
@@ -186,7 +186,7 @@ public abstract class HtmlDocWriter extends HtmlWriter {
public
String
getHyperLinkString
(
String
link
,
String
where
,
String
label
,
boolean
strong
,
String
stylename
,
String
title
,
String
target
)
{
StringBu
ffer
retlink
=
new
StringBuff
er
();
StringBu
ilder
retlink
=
new
StringBuild
er
();
retlink
.
append
(
"<a href=\""
);
retlink
.
append
(
link
);
if
(
where
!=
null
&&
where
.
length
()
!=
0
)
{
...
...
@@ -195,10 +195,10 @@ public abstract class HtmlDocWriter extends HtmlWriter {
}
retlink
.
append
(
"\""
);
if
(
title
!=
null
&&
title
.
length
()
!=
0
)
{
retlink
.
append
(
" title=\""
+
title
+
"\""
);
retlink
.
append
(
" title=\""
).
append
(
title
).
append
(
"\""
);
}
if
(
target
!=
null
&&
target
.
length
()
!=
0
)
{
retlink
.
append
(
" target=\""
+
target
+
"\""
);
retlink
.
append
(
" target=\""
).
append
(
target
).
append
(
"\""
);
}
retlink
.
append
(
">"
);
if
(
stylename
!=
null
&&
stylename
.
length
()
!=
0
)
{
...
...
src/share/classes/com/sun/tools/doclets/internal/toolkit/Configuration.java
浏览文件 @
e57a47d2
...
...
@@ -465,7 +465,7 @@ public abstract class Configuration {
tagletManager
.
addNewSimpleCustomTag
(
tagName
,
null
,
""
);
}
else
{
//Create a simple tag with the heading that has the same name as the tag.
StringBu
ffer
heading
=
new
StringBuff
er
(
tagName
+
":"
);
StringBu
ilder
heading
=
new
StringBuild
er
(
tagName
+
":"
);
heading
.
setCharAt
(
0
,
Character
.
toUpperCase
(
tagName
.
charAt
(
0
)));
tagletManager
.
addNewSimpleCustomTag
(
tagName
,
heading
.
toString
(),
"a"
);
}
...
...
src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/AnnotationTypeBuilder.java
浏览文件 @
e57a47d2
...
...
@@ -179,7 +179,7 @@ public class AnnotationTypeBuilder extends AbstractBuilder {
* @param annotationInfoTree the content tree to which the documentation will be added
*/
public
void
buildAnnotationTypeSignature
(
XMLNode
node
,
Content
annotationInfoTree
)
{
StringBu
ffer
modifiers
=
new
StringBuff
er
(
StringBu
ilder
modifiers
=
new
StringBuild
er
(
annotationTypeDoc
.
modifiers
()
+
" "
);
writer
.
addAnnotationTypeSignature
(
Util
.
replaceText
(
modifiers
.
toString
(),
"interface"
,
"@interface"
),
annotationInfoTree
);
...
...
src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/ClassBuilder.java
浏览文件 @
e57a47d2
...
...
@@ -282,18 +282,18 @@ public class ClassBuilder extends AbstractBuilder {
* @param classInfoTree the content tree to which the documentation will be added
*/
public
void
buildClassSignature
(
XMLNode
node
,
Content
classInfoTree
)
{
StringBu
ffer
modifiers
=
new
StringBuff
er
(
classDoc
.
modifiers
()
+
" "
);
StringBu
ilder
modifiers
=
new
StringBuild
er
(
classDoc
.
modifiers
()
+
" "
);
if
(
isEnum
)
{
modifiers
.
append
(
"enum "
);
int
index
;
if
((
index
=
modifiers
.
indexOf
(
"abstract"
))
>=
0
)
{
modifiers
.
delete
(
index
,
index
+
(
new
String
(
"abstract"
))
.
length
());
modifiers
=
new
StringBu
ff
er
(
modifiers
.
delete
(
index
,
index
+
"abstract"
.
length
());
modifiers
=
new
StringBu
ild
er
(
Util
.
replaceText
(
modifiers
.
toString
(),
" "
,
" "
));
}
if
((
index
=
modifiers
.
indexOf
(
"final"
))
>=
0
)
{
modifiers
.
delete
(
index
,
index
+
(
new
String
(
"final"
))
.
length
());
modifiers
=
new
StringBu
ff
er
(
modifiers
.
delete
(
index
,
index
+
"final"
.
length
());
modifiers
=
new
StringBu
ild
er
(
Util
.
replaceText
(
modifiers
.
toString
(),
" "
,
" "
));
}
//} else if (classDoc.isAnnotationType()) {
...
...
src/share/classes/com/sun/tools/doclets/internal/toolkit/taglets/LiteralTaglet.java
浏览文件 @
e57a47d2
...
...
@@ -84,7 +84,7 @@ public class LiteralTaglet implements Taglet {
* Replace occurrences of the following characters: < > &
*/
protected
static
String
textToString
(
String
text
)
{
StringBu
ffer
buf
=
new
StringBuff
er
();
StringBu
ilder
buf
=
new
StringBuild
er
();
for
(
int
i
=
0
;
i
<
text
.
length
();
i
++)
{
char
c
=
text
.
charAt
(
i
);
switch
(
c
)
{
...
...
src/share/classes/com/sun/tools/doclets/internal/toolkit/taglets/TagletManager.java
浏览文件 @
e57a47d2
...
...
@@ -449,7 +449,7 @@ public class TagletManager {
//This known tag is excluded.
return
;
}
StringBu
ffer
combined_locations
=
new
StringBuff
er
();
StringBu
ilder
combined_locations
=
new
StringBuild
er
();
for
(
int
i
=
0
;
i
<
locations
.
length
;
i
++)
{
if
(
i
>
0
)
{
combined_locations
.
append
(
", "
);
...
...
src/share/classes/com/sun/tools/doclets/internal/toolkit/util/DirectoryManager.java
浏览文件 @
e57a47d2
/*
* Copyright (c) 1998, 201
0
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1998, 201
2
, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
...
...
@@ -119,7 +119,7 @@ public class DirectoryManager {
if
(
packageName
==
null
||
packageName
.
length
()
==
0
)
{
return
""
;
}
StringBu
ffer
pathstr
=
new
StringBuff
er
();
StringBu
ilder
pathstr
=
new
StringBuild
er
();
for
(
int
i
=
0
;
i
<
packageName
.
length
();
i
++)
{
char
ch
=
packageName
.
charAt
(
i
);
if
(
ch
==
'.'
)
{
...
...
@@ -151,7 +151,7 @@ public class DirectoryManager {
if
(
name
==
null
||
name
.
length
()
==
0
)
{
return
""
;
}
StringBu
ffer
pathstr
=
new
StringBuff
er
();
StringBu
ilder
pathstr
=
new
StringBuild
er
();
for
(
int
i
=
0
;
i
<
name
.
length
();
i
++)
{
char
ch
=
name
.
charAt
(
i
);
if
(
ch
==
'.'
)
{
...
...
@@ -181,7 +181,7 @@ public class DirectoryManager {
* @see #getPath(String)
*/
public
static
String
getRelativePath
(
String
from
,
String
to
)
{
StringBu
ffer
pathstr
=
new
StringBuff
er
();
StringBu
ilder
pathstr
=
new
StringBuild
er
();
pathstr
.
append
(
getRelativePath
(
from
));
pathstr
.
append
(
getPath
(
to
));
pathstr
.
append
(
URL_FILE_SEPARATOR
);
...
...
@@ -222,7 +222,7 @@ public class DirectoryManager {
if
(
from
==
null
||
from
.
length
()
==
0
)
{
return
""
;
}
StringBu
ffer
pathstr
=
new
StringBuff
er
();
StringBu
ilder
pathstr
=
new
StringBuild
er
();
for
(
int
i
=
0
;
i
<
from
.
length
();
i
++)
{
char
ch
=
from
.
charAt
(
i
);
if
(
ch
==
'.'
)
{
...
...
@@ -293,7 +293,7 @@ public class DirectoryManager {
* @param filename File name to be appended to the path of the package.
*/
public
static
String
getPathToPackage
(
PackageDoc
pd
,
String
filename
)
{
StringBu
ffer
buf
=
new
StringBuff
er
();
StringBu
ilder
buf
=
new
StringBuild
er
();
String
pathstr
=
createPathString
(
pd
);
if
(
pathstr
.
length
()
>
0
)
{
buf
.
append
(
pathstr
);
...
...
src/share/classes/com/sun/tools/doclets/internal/toolkit/util/Extern.java
浏览文件 @
e57a47d2
...
...
@@ -277,7 +277,7 @@ public class Extern {
boolean
relative
)
throws
IOException
{
BufferedReader
in
=
new
BufferedReader
(
new
InputStreamReader
(
input
));
StringBu
ffer
strbuf
=
new
StringBuff
er
();
StringBu
ilder
strbuf
=
new
StringBuild
er
();
try
{
int
c
;
while
((
c
=
in
.
read
())
>=
0
)
{
...
...
src/share/classes/com/sun/tools/javac/code/Printer.java
浏览文件 @
e57a47d2
...
...
@@ -182,7 +182,7 @@ public abstract class Printer implements Type.Visitor<String, Locale>, Symbol.Vi
@Override
public
String
visitClassType
(
ClassType
t
,
Locale
locale
)
{
StringBu
ffer
buf
=
new
StringBuff
er
();
StringBu
ilder
buf
=
new
StringBuild
er
();
if
(
t
.
getEnclosingType
().
tag
==
CLASS
&&
t
.
tsym
.
owner
.
kind
==
Kinds
.
TYP
)
{
buf
.
append
(
visit
(
t
.
getEnclosingType
(),
locale
));
buf
.
append
(
"."
);
...
...
@@ -210,7 +210,7 @@ public abstract class Printer implements Type.Visitor<String, Locale>, Symbol.Vi
@Override
public
String
visitWildcardType
(
WildcardType
t
,
Locale
locale
)
{
StringBu
ffer
s
=
new
StringBuff
er
();
StringBu
ilder
s
=
new
StringBuild
er
();
s
.
append
(
t
.
kind
);
if
(
t
.
kind
!=
UNBOUND
)
{
s
.
append
(
visit
(
t
.
type
,
locale
));
...
...
@@ -248,7 +248,7 @@ public abstract class Printer implements Type.Visitor<String, Locale>, Symbol.Vi
protected
String
className
(
ClassType
t
,
boolean
longform
,
Locale
locale
)
{
Symbol
sym
=
t
.
tsym
;
if
(
sym
.
name
.
length
()
==
0
&&
(
sym
.
flags
()
&
COMPOUND
)
!=
0
)
{
StringBu
ffer
s
=
new
StringBuff
er
(
visit
(
t
.
supertype_field
,
locale
));
StringBu
ilder
s
=
new
StringBuild
er
(
visit
(
t
.
supertype_field
,
locale
));
for
(
List
<
Type
>
is
=
t
.
interfaces_field
;
is
.
nonEmpty
();
is
=
is
.
tail
)
{
s
.
append
(
"&"
);
s
.
append
(
visit
(
is
.
head
,
locale
));
...
...
@@ -287,7 +287,7 @@ public abstract class Printer implements Type.Visitor<String, Locale>, Symbol.Vi
if
(!
varArgs
)
{
return
visitTypes
(
args
,
locale
);
}
else
{
StringBu
ffer
buf
=
new
StringBuff
er
();
StringBu
ilder
buf
=
new
StringBuild
er
();
while
(
args
.
tail
.
nonEmpty
())
{
buf
.
append
(
visit
(
args
.
head
,
locale
));
args
=
args
.
tail
;
...
...
src/share/classes/com/sun/tools/javac/comp/Lower.java
浏览文件 @
e57a47d2
...
...
@@ -1945,7 +1945,7 @@ public class Lower extends TreeTranslator {
* @param sig The signature of type T.
*/
private
Name
cacheName
(
String
sig
)
{
StringBu
ffer
buf
=
new
StringBuff
er
();
StringBu
ilder
buf
=
new
StringBuild
er
();
if
(
sig
.
startsWith
(
"["
))
{
buf
=
buf
.
append
(
"array"
);
while
(
sig
.
startsWith
(
"["
))
{
...
...
src/share/classes/com/sun/tools/javac/parser/JavacParser.java
浏览文件 @
e57a47d2
...
...
@@ -806,7 +806,7 @@ public class JavacParser implements Parser {
t
=
odStack
[
0
];
if
(
t
.
hasTag
(
JCTree
.
Tag
.
PLUS
))
{
StringBu
ff
er
buf
=
foldStrings
(
t
);
StringBu
ild
er
buf
=
foldStrings
(
t
);
if
(
buf
!=
null
)
{
t
=
toP
(
F
.
at
(
startPos
).
Literal
(
TypeTags
.
CLASS
,
buf
.
toString
()));
}
...
...
@@ -833,7 +833,7 @@ public class JavacParser implements Parser {
/** If tree is a concatenation of string literals, replace it
* by a single literal representing the concatenated string.
*/
protected
StringBu
ff
er
foldStrings
(
JCTree
tree
)
{
protected
StringBu
ild
er
foldStrings
(
JCTree
tree
)
{
if
(!
allowStringFolding
)
return
null
;
List
<
String
>
buf
=
List
.
nil
();
...
...
@@ -841,8 +841,8 @@ public class JavacParser implements Parser {
if
(
tree
.
hasTag
(
LITERAL
))
{
JCLiteral
lit
=
(
JCLiteral
)
tree
;
if
(
lit
.
typetag
==
TypeTags
.
CLASS
)
{
StringBu
ff
er
sbuf
=
new
StringBu
ff
er
((
String
)
lit
.
value
);
StringBu
ild
er
sbuf
=
new
StringBu
ild
er
((
String
)
lit
.
value
);
while
(
buf
.
nonEmpty
())
{
sbuf
.
append
(
buf
.
head
);
buf
=
buf
.
tail
;
...
...
src/share/classes/com/sun/tools/javac/util/Convert.java
浏览文件 @
e57a47d2
/*
* Copyright (c) 1999, 20
08
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1999, 20
12
, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
...
...
@@ -260,7 +260,7 @@ public class Convert {
while
(
i
<
len
)
{
char
ch
=
s
.
charAt
(
i
);
if
(
ch
>
255
)
{
StringBu
ffer
buf
=
new
StringBuff
er
();
StringBu
ilder
buf
=
new
StringBuild
er
();
buf
.
append
(
s
.
substring
(
0
,
i
));
while
(
i
<
len
)
{
ch
=
s
.
charAt
(
i
);
...
...
src/share/classes/com/sun/tools/javac/util/List.java
浏览文件 @
e57a47d2
/*
* Copyright (c) 1999, 201
1
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1999, 201
2
, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
...
...
@@ -287,7 +287,7 @@ public class List<A> extends AbstractCollection<A> implements java.util.List<A>
if
(
isEmpty
())
{
return
""
;
}
else
{
StringBu
ffer
buf
=
new
StringBuff
er
();
StringBu
ilder
buf
=
new
StringBuild
er
();
buf
.
append
(
head
);
for
(
List
<
A
>
l
=
tail
;
l
.
nonEmpty
();
l
=
l
.
tail
)
{
buf
.
append
(
sep
);
...
...
src/share/classes/com/sun/tools/javah/Gen.java
浏览文件 @
e57a47d2
/*
* Copyright (c) 2002, 20
09
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2002, 20
12
, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
...
...
@@ -287,7 +287,7 @@ public abstract class Gen {
constString
=
value
.
toString
();
}
if
(
constString
!=
null
)
{
StringBu
ffer
s
=
new
StringBuff
er
(
"#undef "
);
StringBu
ilder
s
=
new
StringBuild
er
(
"#undef "
);
s
.
append
(
cname
);
s
.
append
(
"_"
);
s
.
append
(
fname
);
s
.
append
(
lineSep
);
s
.
append
(
"#define "
);
s
.
append
(
cname
);
s
.
append
(
"_"
);
s
.
append
(
fname
);
s
.
append
(
" "
);
s
.
append
(
constString
);
...
...
@@ -370,7 +370,7 @@ public abstract class Gen {
// c.f. MethodDoc.signature
String
signature
(
ExecutableElement
e
)
{
StringBu
ffer
sb
=
new
StringBuff
er
(
"("
);
StringBu
ilder
sb
=
new
StringBuild
er
(
"("
);
String
sep
=
""
;
for
(
VariableElement
p:
e
.
getParameters
())
{
sb
.
append
(
sep
);
...
...
src/share/classes/com/sun/tools/javah/LLNI.java
浏览文件 @
e57a47d2
/*
* Copyright (c) 2002, 201
1
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2002, 201
2
, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
...
...
@@ -647,7 +647,7 @@ public class LLNI extends Gen {
%%% This may not be right, but should be called more often. */
protected
final
String
nameToIdentifier
(
String
name
)
{
int
len
=
name
.
length
();
StringBu
ffer
buf
=
new
StringBuff
er
(
len
);
StringBu
ilder
buf
=
new
StringBuild
er
(
len
);
for
(
int
i
=
0
;
i
<
len
;
i
++)
{
char
c
=
name
.
charAt
(
i
);
if
(
isASCIILetterOrDigit
(
c
))
...
...
src/share/classes/com/sun/tools/javah/Mangle.java
浏览文件 @
e57a47d2
/*
* Copyright (c) 2002, 201
0
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2002, 201
2
, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
...
...
@@ -66,7 +66,7 @@ public class Mangle {
}
public
final
String
mangle
(
CharSequence
name
,
int
mtype
)
{
StringBu
ffer
result
=
new
StringBuff
er
(
100
);
StringBu
ilder
result
=
new
StringBuild
er
(
100
);
int
length
=
name
.
length
();
for
(
int
i
=
0
;
i
<
length
;
i
++)
{
...
...
@@ -115,7 +115,7 @@ public class Mangle {
public
String
mangleMethod
(
ExecutableElement
method
,
TypeElement
clazz
,
int
mtype
)
throws
TypeSignature
.
SignatureException
{
StringBu
ffer
result
=
new
StringBuff
er
(
100
);
StringBu
ilder
result
=
new
StringBuild
er
(
100
);
result
.
append
(
"Java_"
);
if
(
mtype
==
Mangle
.
Type
.
METHOD_JDK_1
)
{
...
...
@@ -164,7 +164,7 @@ public class Mangle {
// Warning: duplicated in Gen
private
String
signature
(
ExecutableElement
e
)
{
StringBu
ffer
sb
=
new
StringBuff
er
();
StringBu
ilder
sb
=
new
StringBuild
er
();
String
sep
=
"("
;
for
(
VariableElement
p:
e
.
getParameters
())
{
sb
.
append
(
sep
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录