diff --git a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/classfmt/ClassFileReader.java b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/classfmt/ClassFileReader.java index 8f0bc208aa4..0c25e17ef5f 100644 --- a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/classfmt/ClassFileReader.java +++ b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/classfmt/ClassFileReader.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2023 IBM Corporation and others. + * Copyright (c) 2000, 2026 IBM Corporation and others. * * This program and the accompanying materials * are made available under the terms of the Eclipse Public License 2.0 @@ -810,10 +810,11 @@ public IBinaryNestedType[] getMemberTypes() { * So I added this extra check to filter out this anonymous class from the * member types. */ + char[] innerSourceName = currentInnerInfo.getSourceName(); if (outerClassNameIdx != 0 && innerNameIndex != 0 && outerClassNameIdx == this.classNameIndex - && currentInnerInfo.getSourceName().length != 0) { + && innerSourceName != null && innerSourceName.length != 0) { memberTypes[memberTypeIndex++] = currentInnerInfo; } }