View | Details | Raw Unified | Return to bug 137456
Collapse All | Expand All

(-)model/org/eclipse/jdt/internal/core/BinaryMember.java (-2 / +5 lines)
Lines 56-63 Link Here
56
		// ensure the class file's buffer is open so that categories are computed
56
		// ensure the class file's buffer is open so that categories are computed
57
		((ClassFile)getClassFile()).getBuffer();
57
		((ClassFile)getClassFile()).getBuffer();
58
		
58
		
59
		if (mapper.categories != null) 
59
		if (mapper.categories != null) {
60
			return (String[]) mapper.categories.get(this);
60
			String[] categories = (String[]) mapper.categories.get(this);
61
			if (categories != null)
62
				return categories;
63
		}
61
	}
64
	}
62
	return CharOperation.NO_STRINGS;	
65
	return CharOperation.NO_STRINGS;	
63
}
66
}
(-)src/org/eclipse/jdt/core/tests/model/ClassFileTests.java (+21 lines)
Lines 321-326 Link Here
321
}
321
}
322
322
323
/*
323
/*
324
 * Ensure that the categories for a member that has no categories when another member defines some are correct.
325
 */
326
public void testGetCategories10() throws CoreException, IOException {
327
	createClassFile(
328
		"package p;\n" +
329
		"public class X {\n" +
330
		"  int field1;\n" +
331
		"  /**\n" +
332
		"   * @category test\n" +
333
		"   */\n" +
334
		"  int field2;\n" +
335
		"}"
336
	);
337
	String[] categories = this.classFile.getType().getField("field1").getCategories();
338
	assertStringsEqual(
339
		"Unexpected categories",
340
		"",
341
		categories);
342
}
343
344
/*
324
 * Ensures that the children of a type for a given category are correct.
345
 * Ensures that the children of a type for a given category are correct.
325
 */
346
 */
326
public void testGetChildrenForCategory01() throws CoreException, IOException {
347
public void testGetChildrenForCategory01() throws CoreException, IOException {

Return to bug 137456