Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell11
提交
8299e92a
D
dragonwell11
项目概览
openanolis
/
dragonwell11
通知
7
Star
2
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
D
dragonwell11
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
8299e92a
编写于
11月 02, 2017
作者:
R
rfield
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
8188072: JShell: NPE in SourceCodeAnalysis.completionSuggestions()
Reviewed-by: jlahoda
上级
1259be97
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
16 addition
and
8 deletion
+16
-8
src/jdk.jshell/share/classes/jdk/internal/jshell/debug/InternalDebugControl.java
...asses/jdk/internal/jshell/debug/InternalDebugControl.java
+3
-4
src/jdk.jshell/share/classes/jdk/jshell/JShell.java
src/jdk.jshell/share/classes/jdk/jshell/JShell.java
+1
-1
src/jdk.jshell/share/classes/jdk/jshell/SourceCodeAnalysisImpl.java
...hell/share/classes/jdk/jshell/SourceCodeAnalysisImpl.java
+7
-2
test/langtools/jdk/jshell/ToolTabSnippetTest.java
test/langtools/jdk/jshell/ToolTabSnippetTest.java
+5
-1
未找到文件。
src/jdk.jshell/share/classes/jdk/internal/jshell/debug/InternalDebugControl.java
浏览文件 @
8299e92a
/*
* Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2015,
2017,
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
...
...
@@ -28,12 +28,11 @@ import java.util.HashMap;
import
java.util.Map
;
import
jdk.jshell.JShell
;
/**
/**
* This class is used to externally control output messages for debugging the
* implementation of the JShell API.
* <p>
* This is not part of the SPI
, not
API.
* This is not part of the SPI
nor
API.
*/
public
class
InternalDebugControl
{
...
...
@@ -141,7 +140,7 @@ public class InternalDebugControl {
* @param ex the fatal Exception
* @param where additional context
*/
public
static
void
debug
(
JShell
state
,
PrintStream
err
,
Exception
ex
,
String
where
)
{
public
static
void
debug
(
JShell
state
,
PrintStream
err
,
Throwable
ex
,
String
where
)
{
if
(
isDebugEnabled
(
state
,
0xFFFFFFFF
))
{
err
.
printf
(
"Fatal error: %s: %s\n"
,
where
,
ex
.
getMessage
());
ex
.
printStackTrace
(
err
);
...
...
src/jdk.jshell/share/classes/jdk/jshell/JShell.java
浏览文件 @
8299e92a
...
...
@@ -807,7 +807,7 @@ public class JShell implements AutoCloseable {
InternalDebugControl
.
debug
(
this
,
err
,
flags
,
format
,
args
);
}
void
debug
(
Exception
ex
,
String
where
)
{
void
debug
(
Throwable
ex
,
String
where
)
{
InternalDebugControl
.
debug
(
this
,
err
,
ex
,
where
);
}
...
...
src/jdk.jshell/share/classes/jdk/jshell/SourceCodeAnalysisImpl.java
浏览文件 @
8299e92a
/*
* Copyright (c) 2014, 201
6
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2014, 201
7
, 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
...
...
@@ -58,7 +58,6 @@ import com.sun.tools.javac.util.Names;
import
com.sun.tools.javac.util.Pair
;
import
jdk.jshell.CompletenessAnalyzer.CaInfo
;
import
jdk.jshell.TaskFactory.AnalyzeTask
;
import
jdk.jshell.TaskFactory.ParseTask
;
import
java.util.ArrayList
;
import
java.util.Collections
;
...
...
@@ -255,6 +254,9 @@ class SourceCodeAnalysisImpl extends SourceCodeAnalysis {
suspendIndexing
();
try
{
return
completionSuggestionsImpl
(
code
,
cursor
,
anchor
);
}
catch
(
Throwable
exc
)
{
proc
.
debug
(
exc
,
"Exception thrown in SourceCodeAnalysisImpl.completionSuggestions"
);
return
Collections
.
emptyList
();
}
finally
{
resumeIndexing
();
}
...
...
@@ -1148,6 +1150,9 @@ class SourceCodeAnalysisImpl extends SourceCodeAnalysis {
suspendIndexing
();
try
{
return
documentationImpl
(
code
,
cursor
,
computeJavadoc
);
}
catch
(
Throwable
exc
)
{
proc
.
debug
(
exc
,
"Exception thrown in SourceCodeAnalysisImpl.documentation"
);
return
Collections
.
emptyList
();
}
finally
{
resumeIndexing
();
}
...
...
test/langtools/jdk/jshell/ToolTabSnippetTest.java
浏览文件 @
8299e92a
...
...
@@ -23,7 +23,7 @@
/**
* @test
* @bug 8177076 8185426
* @bug 8177076 8185426
8188072
* @modules
* jdk.compiler/com.sun.tools.javac.api
* jdk.compiler/com.sun.tools.javac.main
...
...
@@ -191,6 +191,10 @@ public class ToolTabSnippetTest extends UITesting {
//no crash:
inputSink
.
write
(
"\u0003new Stringbuil\011"
);
waitOutput
(
out
,
"\u0005new Stringbuil\u0007"
);
//no crash: 8188072
inputSink
.
write
(
"\u0003for (int:\011"
);
waitOutput
(
out
,
"\u0005for \\(int:\u0007"
);
});
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录