Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_langtools
提交
4bd5c83b
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看板
提交
4bd5c83b
编写于
2月 26, 2010
作者:
J
jjg
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
6930076: "null" can incorrectly appear in error message compiler.err.error.reading.file
Reviewed-by: darcy
上级
db1bb9e6
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
24 addition
and
5 deletion
+24
-5
src/share/classes/com/sun/tools/javac/file/JavacFileManager.java
...re/classes/com/sun/tools/javac/file/JavacFileManager.java
+21
-2
src/share/classes/com/sun/tools/javac/file/Paths.java
src/share/classes/com/sun/tools/javac/file/Paths.java
+1
-1
src/share/classes/com/sun/tools/javac/main/JavaCompiler.java
src/share/classes/com/sun/tools/javac/main/JavaCompiler.java
+2
-2
未找到文件。
src/share/classes/com/sun/tools/javac/file/JavacFileManager.java
浏览文件 @
4bd5c83b
...
...
@@ -260,7 +260,7 @@ public class JavacFileManager extends BaseFileManager implements StandardJavaFil
archive
=
openArchive
(
directory
);
}
catch
(
IOException
ex
)
{
log
.
error
(
"error.reading.file"
,
directory
,
ex
.
getLocalizedMessage
(
));
directory
,
getMessage
(
ex
));
return
;
}
}
...
...
@@ -489,7 +489,7 @@ public class JavacFileManager extends BaseFileManager implements StandardJavaFil
archive
=
new
MissingArchive
(
zipFileName
);
}
catch
(
IOException
ex
)
{
if
(
zipFileName
.
exists
())
log
.
error
(
"error.reading.file"
,
zipFileName
,
ex
.
getLocalizedMessage
(
));
log
.
error
(
"error.reading.file"
,
zipFileName
,
getMessage
(
ex
));
archive
=
new
MissingArchive
(
zipFileName
);
}
...
...
@@ -838,4 +838,23 @@ public class JavacFileManager extends BaseFileManager implements StandardJavaFil
}
throw
new
IllegalArgumentException
(
"Invalid relative path: "
+
file
);
}
/**
* Get a detail message from an IOException.
* Most, but not all, instances of IOException provide a non-null result
* for getLocalizedMessage(). But some instances return null: in these
* cases, fallover to getMessage(), and if even that is null, return the
* name of the exception itself.
* @param e an IOException
* @return a string to include in a compiler diagnostic
*/
public
static
String
getMessage
(
IOException
e
)
{
String
s
=
e
.
getLocalizedMessage
();
if
(
s
!=
null
)
return
s
;
s
=
e
.
getMessage
();
if
(
s
!=
null
)
return
s
;
return
e
.
toString
();
}
}
src/share/classes/com/sun/tools/javac/file/Paths.java
浏览文件 @
4bd5c83b
...
...
@@ -320,7 +320,7 @@ public class Paths {
addFile
(
f
,
warn
);
}
}
catch
(
IOException
e
)
{
log
.
error
(
"error.reading.file"
,
jarFile
,
e
.
getLocalizedMessage
(
));
log
.
error
(
"error.reading.file"
,
jarFile
,
JavacFileManager
.
getMessage
(
e
));
}
}
}
...
...
src/share/classes/com/sun/tools/javac/main/JavaCompiler.java
浏览文件 @
4bd5c83b
...
...
@@ -558,7 +558,7 @@ public class JavaCompiler implements ClassReader.SourceCompleter {
inputFiles
.
add
(
filename
);
return
filename
.
getCharContent
(
false
);
}
catch
(
IOException
e
)
{
log
.
error
(
"error.reading.file"
,
filename
,
e
.
getLocalizedMessage
(
));
log
.
error
(
"error.reading.file"
,
filename
,
JavacFileManager
.
getMessage
(
e
));
return
null
;
}
}
...
...
@@ -717,7 +717,7 @@ public class JavaCompiler implements ClassReader.SourceCompleter {
try
{
tree
=
parse
(
filename
,
filename
.
getCharContent
(
false
));
}
catch
(
IOException
e
)
{
log
.
error
(
"error.reading.file"
,
filename
,
e
);
log
.
error
(
"error.reading.file"
,
filename
,
JavacFileManager
.
getMessage
(
e
)
);
tree
=
make
.
TopLevel
(
List
.<
JCTree
.
JCAnnotation
>
nil
(),
null
,
List
.<
JCTree
>
nil
());
}
finally
{
log
.
useSource
(
prev
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录