more synchronization

This commit is contained in:
Manindra Moharana
2013-08-24 16:57:47 +05:30
parent e9c09225b8
commit 904bfcd005
4 changed files with 74 additions and 59 deletions

View File

@@ -174,21 +174,22 @@ public class ErrorBar extends JPanel {
// Each problem.getSourceLine() will have an extra line added
// because of
// class declaration in the beginning as well as default imports
for (Problem problem : problems) {
if (problem.getTabIndex() == currentTab) {
// Ratio of error line to total lines
float y = (problem.getLineNumber() - errorCheckerService.defaultImportsOffset)
/ ((float) totalLines);
// Ratio multiplied by height of the error bar
y *= fheight - 15; // -15 is just a vertical offset
errorPoints
.add(new ErrorMarker(problem, (int) y,
problem.isError() ? ErrorMarker.Error
: ErrorMarker.Warning));
// System.out.println("Y: " + y);
synchronized (problems) {
for (Problem problem : problems) {
if (problem.getTabIndex() == currentTab) {
// Ratio of error line to total lines
float y = (problem.getLineNumber() - errorCheckerService.defaultImportsOffset)
/ ((float) totalLines);
// Ratio multiplied by height of the error bar
y *= fheight - 15; // -15 is just a vertical offset
errorPoints
.add(new ErrorMarker(problem, (int) y,
problem.isError() ? ErrorMarker.Error
: ErrorMarker.Warning));
// System.out.println("Y: " + y);
}
}
}
return null;
}