]> granicus.if.org Git - icu/commitdiff
ICU-11928 Fix NPEs in test framework (affects CLDR build)
authorJohn Emmons <emmo@us.ibm.com>
Wed, 23 Sep 2015 19:50:53 +0000 (19:50 +0000)
committerJohn Emmons <emmo@us.ibm.com>
Wed, 23 Sep 2015 19:50:53 +0000 (19:50 +0000)
X-SVN-Rev: 38011

icu4j/main/tests/framework/src/com/ibm/icu/dev/test/TestFmwk.java

index bf9021eff2b7871eeb79db9a738574550ea2a0e3..ff7d3629f0f618a10ee5fe20e1b8279d089783e9 100644 (file)
@@ -1974,9 +1974,10 @@ public class TestFmwk extends AbstractTestLog {
         // Walk up the stack to the first call site outside this file
         for (StackTraceElement st : new Throwable().getStackTrace()) {
             String source = st.getFileName();
-            if (!source.equals("TestFmwk.java") && !source.equals("AbstractTestLog.java")) {
+            if (source != null && !source.equals("TestFmwk.java") && !source.equals("AbstractTestLog.java")) {
                 String methodName = st.getMethodName();
-                if (methodName.startsWith("Test") || methodName.startsWith("test") || methodName.equals("main")) {
+                if (methodName != null && 
+                       (methodName.startsWith("Test") || methodName.startsWith("test") || methodName.equals("main"))) {
                     return "(" + source + ":" + st.getLineNumber() + ") ";
                 }
             }