Lines 43-49
Link Here
|
43 |
private SpecfileErrorHandler errorHandler; |
43 |
private SpecfileErrorHandler errorHandler; |
44 |
|
44 |
|
45 |
public Specfile parse(IDocument specfileDocument) { |
45 |
public Specfile parse(IDocument specfileDocument) { |
46 |
|
46 |
// remove all existing markers. |
|
|
47 |
errorHandler.removeExistingMarkers(); |
47 |
LineNumberReader reader = new LineNumberReader(new StringReader( |
48 |
LineNumberReader reader = new LineNumberReader(new StringReader( |
48 |
specfileDocument.get())); |
49 |
specfileDocument.get())); |
49 |
String line = ""; |
50 |
String line = ""; |
Lines 370-379
Link Here
|
370 |
if (token.endsWith(":")) { |
371 |
if (token.endsWith(":")) { |
371 |
token = token.substring(0, token.length() - 1); |
372 |
token = token.substring(0, token.length() - 1); |
372 |
} else { |
373 |
} else { |
373 |
// FIXME: (al) Have not found why, but in some case errorHandler is null. |
|
|
374 |
// When this exception occurs, folding is not shown. |
375 |
// This fix work at less with the eclipse.spec and eclipse-mylar.spec file. |
376 |
if (errorHandler != null) |
377 |
// FIXME: come up with a better error message here |
374 |
// FIXME: come up with a better error message here |
378 |
// FIXME: what about descriptions that begin a line with the word "Source" or "Patch"? |
375 |
// FIXME: what about descriptions that begin a line with the word "Source" or "Patch"? |
379 |
errorHandler |
376 |
errorHandler |
Lines 418-427
Link Here
|
418 |
if (toReturn != null) |
415 |
if (toReturn != null) |
419 |
toReturn.setFileName(token); |
416 |
toReturn.setFileName(token); |
420 |
if (iter.hasNext()) { |
417 |
if (iter.hasNext()) { |
421 |
// FIXME: (al) Have not found why, but in some case errorHandler is null. |
|
|
422 |
// When this NullPointerException occurs, folding is not shown. |
423 |
// This fix works at least with the eclipse.spec and eclipse-mylar.spec. |
424 |
if (errorHandler != null) |
425 |
errorHandler.handleError(new SpecfileParseException( |
418 |
errorHandler.handleError(new SpecfileParseException( |
426 |
"Filename cannot be multiple words.", |
419 |
"Filename cannot be multiple words.", |
427 |
lineNumber, 0, lineText.length(), |
420 |
lineNumber, 0, lineText.length(), |
Lines 456-465
Link Here
|
456 |
IMarker.SEVERITY_ERROR)); |
449 |
IMarker.SEVERITY_ERROR)); |
457 |
return null; |
450 |
return null; |
458 |
} else { |
451 |
} else { |
459 |
// FIXME: (al) Have not found why, but in some case errorHandler is null. |
|
|
460 |
// When this NPE occurs, folding is not shown. |
461 |
// This fix works at least with the eclipse.spec and eclipse-mylar.spec |
462 |
if (errorHandler != null) |
463 |
errorHandler.handleError(new SpecfileParseException( |
452 |
errorHandler.handleError(new SpecfileParseException( |
464 |
token.substring(0, token.length() - 1) + " should be an acronym.", |
453 |
token.substring(0, token.length() - 1) + " should be an acronym.", |
465 |
lineNumber, 0, lineText.length(), |
454 |
lineNumber, 0, lineText.length(), |