1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-06-07 17:56:01 +02:00

Compiler warnings.

This commit is contained in:
Sergey Prigogin 2009-05-24 18:33:10 +00:00
parent af90f84dd0
commit fcf03e2a53

View file

@ -128,7 +128,7 @@ public class TestSourceReader {
int c= 0; int c= 0;
int offset= 0; int offset= 0;
StringBuffer buf= new StringBuffer(); StringBuffer buf= new StringBuffer();
while ( (c=reader.read()) >= 0) { while ((c = reader.read()) >= 0) {
buf.append((char) c); buf.append((char) c);
if (c == '\n') { if (c == '\n') {
int idx= buf.indexOf(lookfor); int idx= buf.indexOf(lookfor);
@ -144,8 +144,7 @@ public class TestSourceReader {
return idx+offset; return idx+offset;
} }
return -1; return -1;
} } finally {
finally {
reader.close(); reader.close();
} }
} }
@ -162,8 +161,7 @@ public class TestSourceReader {
line++; line++;
} }
return line; return line;
} } finally {
finally {
reader.close(); reader.close();
} }
} }
@ -189,8 +187,7 @@ public class TestSourceReader {
if (found) { if (found) {
content.append(line); content.append(line);
content.append('\n'); content.append('\n');
} } else {
else {
line= line.trim(); line= line.trim();
if (line.startsWith("{" + tag)) { if (line.startsWith("{" + tag)) {
if (line.length() == tag.length()+1 || if (line.length() == tag.length()+1 ||
@ -199,8 +196,7 @@ public class TestSourceReader {
} }
} }
} }
} } else if (found) {
else if (found) {
break; break;
} }
line= reader.readLine(); line= reader.readLine();
@ -240,8 +236,7 @@ public class TestSourceReader {
if (file.getLocalTimeStamp() == timestamp) { if (file.getLocalTimeStamp() == timestamp) {
file.setLocalTimeStamp(timestamp+1000); file.setLocalTimeStamp(timestamp+1000);
} }
} } else {
else {
createFolders(file); createFolders(file);
file.create(stream, true, new NullProgressMonitor()); file.create(stream, true, new NullProgressMonitor());
} }
@ -297,13 +292,12 @@ public class TestSourceReader {
if (pfile != null && pfile.getTimestamp() >= file.getLocalTimeStamp()) { if (pfile != null && pfile.getTimestamp() >= file.getLocalTimeStamp()) {
return; return;
} }
} } finally {
finally {
index.releaseReadLock(); index.releaseReadLock();
} }
Thread.sleep(50); Thread.sleep(50);
timeLeft= (int) (endTime-System.currentTimeMillis()); timeLeft= (int) (endTime - System.currentTimeMillis());
} }
Assert.fail("Indexing " + file.getFullPath() + " did not complete in time!"); Assert.fail("Indexing " + file.getFullPath() + " did not complete in time!");
} }
@ -312,9 +306,7 @@ public class TestSourceReader {
ICElement elem= project.findElement(file.getFullPath()); ICElement elem= project.findElement(file.getFullPath());
if (elem instanceof ITranslationUnit) { if (elem instanceof ITranslationUnit) {
ITranslationUnit tu= (ITranslationUnit) elem; ITranslationUnit tu= (ITranslationUnit) elem;
if (tu != null) { return tu.getAST(index, ITranslationUnit.AST_SKIP_INDEXED_HEADERS);
return tu.getAST(index, ITranslationUnit.AST_SKIP_INDEXED_HEADERS);
}
} }
Assert.fail("Could not create ast for " + file.getFullPath()); Assert.fail("Could not create ast for " + file.getFullPath());
return null; return null;