зеркало из https://github.com/mozilla/gecko-dev.git
Subject:
Rhino Context.setTargetClassFileName() null pointer exception Date: Tue, 20 Feb 2001 15:28:20 -0800 From: "Ryan Manwiller" <rdm@europa.com> Organization: Another Netscape Collabra Server User Newsgroups: netscape.public.mozilla.jseng I'm setting the file name to compile to a file. However, on subsequent compiles, I don't want to compile to a file, so I tried setTargetClassFileName(null). This causes a NullPpinterException in OptClassNameHelper.setTargetClassFileName(OptClassNameHelper.java:76) It seems that Context.setTargetClassFileName() should check for null. Thanks
This commit is contained in:
Родитель
2f51414a3f
Коммит
25a2852250
|
@ -92,7 +92,9 @@ public class OptClassNameHelper implements ClassNameHelper {
|
|||
}
|
||||
|
||||
public void setTargetClassFileName(String classFileName) {
|
||||
int lastSeparator = classFileName.lastIndexOf(File.separatorChar);
|
||||
int lastSeparator = classFileName == null
|
||||
? -1
|
||||
: classFileName.lastIndexOf(File.separatorChar);
|
||||
String initialName;
|
||||
if (lastSeparator == -1) {
|
||||
generatingDirectory = "";
|
||||
|
|
|
@ -92,7 +92,9 @@ public class OptClassNameHelper implements ClassNameHelper {
|
|||
}
|
||||
|
||||
public void setTargetClassFileName(String classFileName) {
|
||||
int lastSeparator = classFileName.lastIndexOf(File.separatorChar);
|
||||
int lastSeparator = classFileName == null
|
||||
? -1
|
||||
: classFileName.lastIndexOf(File.separatorChar);
|
||||
String initialName;
|
||||
if (lastSeparator == -1) {
|
||||
generatingDirectory = "";
|
||||
|
|
Загрузка…
Ссылка в новой задаче