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:
nboyd%atg.com 2001-02-21 02:08:05 +00:00
Родитель 2f51414a3f
Коммит 25a2852250
2 изменённых файлов: 6 добавлений и 2 удалений

Просмотреть файл

@ -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 = "";