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

(-)compiler/org/eclipse/jdt/internal/compiler/parser/diagnose/DiagnoseParser.java (-20 lines)
Lines 884-894 Link Here
884
				repair.distance = j;
884
				repair.distance = j;
885
				repair.symbol = symbol;
885
				repair.symbol = symbol;
886
				repair.code = INSERTION_CODE;
886
				repair.code = INSERTION_CODE;
887
			} else if (j == repair.distance && k == repair.misspellIndex && isBetterSymbol(symbol, repair.symbol)) {
888
				repair.misspellIndex = k;
889
				repair.distance = j;
890
				repair.symbol = symbol;
891
				repair.code = INSERTION_CODE;
892
			}
887
			}
893
888
894
			symbol = this.list[symbol];
889
			symbol = this.list[symbol];
Lines 917-926 Link Here
917
					repair.misspellIndex = k;
912
					repair.misspellIndex = k;
918
					repair.symbol = symbol;
913
					repair.symbol = symbol;
919
					repair.code = SUBSTITUTION_CODE;
914
					repair.code = SUBSTITUTION_CODE;
920
				} else if (j == repair.distance && k > repair.misspellIndex && isBetterSymbol(symbol, repair.symbol)) {
921
					repair.misspellIndex = k;
922
					repair.symbol = symbol;
923
					repair.code = SUBSTITUTION_CODE;
924
				}
915
				}
925
				i = symbol;
916
				i = symbol;
926
				symbol = this.list[symbol];
917
				symbol = this.list[symbol];
Lines 1243-1259 Link Here
1243
		return Parser.non_terminal_index[highest_symbol];
1234
		return Parser.non_terminal_index[highest_symbol];
1244
	}
1235
	}
1245
1236
1246
	private boolean isBetterSymbol(int symbol, int actualSymbol) {
1247
//		switch (actualSymbol) {
1248
//			case TokenNameinterface :
1249
//				if(symbol == TokenNameclass) {
1250
//					return true;
1251
//				}
1252
//				break;
1253
//		}
1254
		return false;
1255
	}
1256
1257
//
1237
//
1258
//		   Check whether or not there is a high probability that a
1238
//		   Check whether or not there is a high probability that a
1259
//	   given string is a misspelling of another.
1239
//	   given string is a misspelling of another.

Return to bug 236193