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

(-)compiler/org/eclipse/jdt/internal/compiler/ast/Javadoc.java (-3 / +6 lines)
Lines 776-788 Link Here
776
								mainLoop: for (int i=0; i<length; i++) {
776
								mainLoop: for (int i=0; i<length; i++) {
777
									char[][] compoundName = imports[i].compoundName;
777
									char[][] compoundName = imports[i].compoundName;
778
									int compoundNameLength = compoundName.length;
778
									int compoundNameLength = compoundName.length;
779
									if ((imports[i].onDemand && compoundNameLength == computedCompoundName.length-1) ||
779
									if ((imports[i].onDemand && compoundNameLength == computedCompoundName.length-1) 
780
										(compoundNameLength == computedCompoundName.length))
780
											|| (compoundNameLength == computedCompoundName.length)) {
781
									{
782
										for (int j = compoundNameLength; --j >= 0;) {
781
										for (int j = compoundNameLength; --j >= 0;) {
783
											if (CharOperation.equals(imports[i].compoundName[j], computedCompoundName[j])) {
782
											if (CharOperation.equals(imports[i].compoundName[j], computedCompoundName[j])) {
784
												if (j == 0) {
783
												if (j == 0) {
785
													hasValidImport = true;
784
													hasValidImport = true;
785
													ImportReference importReference = imports[i].reference;
786
													if (importReference != null) {
787
														importReference.bits |= ASTNode.Used;
788
													}
786
													break mainLoop;
789
													break mainLoop;
787
												}
790
												}
788
											} else {
791
											} else {
(-)src/org/eclipse/jdt/core/tests/compiler/regression/JavadocTestForClass.java (+122 lines)
Lines 14-19 Link Here
14
14
15
import junit.framework.Test;
15
import junit.framework.Test;
16
16
17
import org.eclipse.jdt.internal.compiler.classfmt.ClassFileConstants;
17
import org.eclipse.jdt.internal.compiler.impl.CompilerOptions;
18
import org.eclipse.jdt.internal.compiler.impl.CompilerOptions;
18
19
19
public class JavadocTestForClass extends JavadocTest {
20
public class JavadocTestForClass extends JavadocTest {
Lines 997-1000 Link Here
997
					+ "	}\n"
998
					+ "	}\n"
998
					+ "}\n" });
999
					+ "}\n" });
999
	}
1000
	}
1001
	
1002
	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=253750
1003
	public void testONLY_054() {
1004
		if (this.complianceLevel < ClassFileConstants.JDK1_5) {
1005
			runNegativeTest(
1006
					new String[] {
1007
						"X.java",
1008
						"import java.util.Map;\n" + 
1009
						"import java.util.Map.Entry;\n" + 
1010
						"\n" + 
1011
						"/**\n" + 
1012
						" * <ul>\n" + 
1013
						" * <li> {@link Entry} </li>\n" + 
1014
						" * </ul>\n" + 
1015
						" */\n" + 
1016
						"public interface X extends Map {\n" + 
1017
						"	int i;\n" +
1018
						"}\n",
1019
						},
1020
						"----------\n" + 
1021
						"1. ERROR in X.java (at line 6)\n" + 
1022
						"	* <li> {@link Entry} </li>\n" + 
1023
						"	              ^^^^^\n" + 
1024
						"Javadoc: Invalid member type qualification\n" + 
1025
						"----------\n");
1026
			return;
1027
		}
1028
		runNegativeTest(
1029
			new String[] {
1030
				"X.java",
1031
				"import java.util.Map;\n" + 
1032
				"import java.util.Map.Entry;\n" + 
1033
				"\n" + 
1034
				"/**\n" + 
1035
				" * <ul>\n" + 
1036
				" * <li> {@link Entry} </li>\n" + 
1037
				" * </ul>\n" + 
1038
				" */\n" + 
1039
				"public interface X extends Map {\n" + 
1040
				"	int i;\n" +
1041
				"}\n",
1042
				},
1043
				"----------\n" + 
1044
				"1. ERROR in X.java (at line 10)\n" + 
1045
				"	int i;\n" + 
1046
				"	    ^\n" + 
1047
				"The blank final field i may not have been initialized\n" + 
1048
				"----------\n");
1049
	}	
1050
	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=253750 - variation
1051
	public void testONLY_055() {
1052
		runNegativeTest(
1053
			new String[] {
1054
				"X.java",
1055
				"import java.util.Map;\n" + 
1056
				"\n" + 
1057
				"/**\n" + 
1058
				" * <ul>\n" + 
1059
				" * <li> {@link Entry} </li>\n" + 
1060
				" * </ul>\n" + 
1061
				" */\n" + 
1062
				"public interface X extends Map {\n" + 
1063
				"	Entry e = null;\n" + 
1064
				"}\n",
1065
				},
1066
				"----------\n" + 
1067
				"1. ERROR in X.java (at line 5)\n" + 
1068
				"	* <li> {@link Entry} </li>\n" + 
1069
				"	              ^^^^^\n" + 
1070
				"Javadoc: Invalid member type qualification\n" + 
1071
				"----------\n");
1072
	}	
1073
1074
	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=253750
1075
	public void testONLY_056() {
1076
		if (this.complianceLevel < ClassFileConstants.JDK1_5) {
1077
			runNegativeTest(
1078
					new String[] {
1079
						"X.java",
1080
						"import java.util.Map;\n" + 
1081
						"import java.util.Map.Entry;\n" + 
1082
						"\n" + 
1083
						"/**\n" + 
1084
						" * <ul>\n" + 
1085
						" * <li> {@link Entry} </li>\n" + 
1086
						" * </ul>\n" + 
1087
						" */\n" + 
1088
						"public interface X extends Map {\n" + 
1089
						"	Entry e;\n" + 
1090
						"}\n",
1091
						},
1092
						"----------\n" + 
1093
						"1. ERROR in X.java (at line 6)\n" + 
1094
						"	* <li> {@link Entry} </li>\n" + 
1095
						"	              ^^^^^\n" + 
1096
						"Javadoc: Invalid member type qualification\n" + 
1097
						"----------\n");
1098
			return;
1099
		}
1100
		runNegativeTest(
1101
			new String[] {
1102
				"X.java",
1103
				"import java.util.Map;\n" + 
1104
				"import java.util.Map.Entry;\n" + 
1105
				"\n" + 
1106
				"/**\n" + 
1107
				" * <ul>\n" + 
1108
				" * <li> {@link Entry} </li>\n" + 
1109
				" * </ul>\n" + 
1110
				" */\n" + 
1111
				"public interface X extends Map {\n" + 
1112
				"	Entry e;\n" + 
1113
				"}\n",
1114
				},
1115
				"----------\n" + 
1116
				"1. ERROR in X.java (at line 10)\n" + 
1117
				"	Entry e;\n" + 
1118
				"	      ^\n" + 
1119
				"The blank final field e may not have been initialized\n" + 
1120
				"----------\n");
1121
	}		
1000
}
1122
}

Return to bug 253750