mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-21 21:52:10 +02:00
Bug 540373: Post code-cleanup for DSF examples
The DSF Examples contains some commented out source that is enabled via a script so this commit cleans that up for new formatting rules. Change-Id: I82c5e195cc3746415c659b2c0fc72b8118cdc56c
This commit is contained in:
parent
37ed2c406d
commit
f869a3f247
10 changed files with 65 additions and 65 deletions
|
@ -87,7 +87,7 @@ org.eclipse.jdt.core.compiler.problem.missingSerialVersion=ignore
|
|||
org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=ignore
|
||||
org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning
|
||||
org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning
|
||||
org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=warning
|
||||
org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=ignore
|
||||
org.eclipse.jdt.core.compiler.problem.nonnullParameterAnnotationDropped=warning
|
||||
org.eclipse.jdt.core.compiler.problem.nonnullTypeVariableFromLegacyInvocation=warning
|
||||
org.eclipse.jdt.core.compiler.problem.nullAnnotationInferenceConflict=error
|
||||
|
|
|
@ -87,7 +87,7 @@ org.eclipse.jdt.core.compiler.problem.missingSerialVersion=ignore
|
|||
org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=ignore
|
||||
org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning
|
||||
org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning
|
||||
org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=warning
|
||||
org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=ignore
|
||||
org.eclipse.jdt.core.compiler.problem.nonnullParameterAnnotationDropped=warning
|
||||
org.eclipse.jdt.core.compiler.problem.nonnullTypeVariableFromLegacyInvocation=warning
|
||||
org.eclipse.jdt.core.compiler.problem.nullAnnotationInferenceConflict=error
|
||||
|
|
|
@ -87,7 +87,7 @@ org.eclipse.jdt.core.compiler.problem.missingSerialVersion=ignore
|
|||
org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=ignore
|
||||
org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning
|
||||
org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning
|
||||
org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=warning
|
||||
org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=ignore
|
||||
org.eclipse.jdt.core.compiler.problem.nonnullParameterAnnotationDropped=warning
|
||||
org.eclipse.jdt.core.compiler.problem.nonnullTypeVariableFromLegacyInvocation=warning
|
||||
org.eclipse.jdt.core.compiler.problem.nullAnnotationInferenceConflict=error
|
||||
|
|
|
@ -87,7 +87,7 @@ org.eclipse.jdt.core.compiler.problem.missingSerialVersion=ignore
|
|||
org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=ignore
|
||||
org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning
|
||||
org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning
|
||||
org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=warning
|
||||
org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=ignore
|
||||
org.eclipse.jdt.core.compiler.problem.nonnullParameterAnnotationDropped=warning
|
||||
org.eclipse.jdt.core.compiler.problem.nonnullTypeVariableFromLegacyInvocation=warning
|
||||
org.eclipse.jdt.core.compiler.problem.nullAnnotationInferenceConflict=error
|
||||
|
|
|
@ -157,9 +157,9 @@ public class PreProcessor extends Task {
|
|||
}
|
||||
String contents = null;
|
||||
if (fileName.endsWith(".java")) {
|
||||
contents = preProcessFile(srcFile, "//#");
|
||||
contents = preProcessFile(srcFile);
|
||||
} else if (fileName.equals("plugin.xml")) {
|
||||
contents = preProcessFile(srcFile, null);
|
||||
contents = preProcessFile(srcFile);
|
||||
}
|
||||
if (contents == null) {
|
||||
// no change, just copy file
|
||||
|
@ -186,10 +186,9 @@ public class PreProcessor extends Task {
|
|||
* Preprocesses a file
|
||||
*
|
||||
* @param srcFile the file to process
|
||||
* @param strip chars to stip off lines in a true condition, or <code>null</code>
|
||||
* @return
|
||||
*/
|
||||
public String preProcessFile(File srcFile, String strip) {
|
||||
public String preProcessFile(File srcFile) {
|
||||
try (BufferedReader reader = new BufferedReader(new FileReader(srcFile))) {
|
||||
StringBuilder buffer = new StringBuilder();
|
||||
String line = reader.readLine();
|
||||
|
@ -262,10 +261,8 @@ public class PreProcessor extends Task {
|
|||
}
|
||||
if (!commandLine) {
|
||||
if (state == STATE_OUTSIDE_CONDITION || state == STATE_TRUE_CONDITION) {
|
||||
if (state == STATE_TRUE_CONDITION && strip != null) {
|
||||
if (line.startsWith(strip)) {
|
||||
line = line.substring(strip.length());
|
||||
}
|
||||
if (state == STATE_TRUE_CONDITION) {
|
||||
line = line.replaceFirst("^(\t*)//#", "$1");
|
||||
}
|
||||
buffer.append(line);
|
||||
buffer.append("\n");
|
||||
|
@ -288,8 +285,7 @@ public class PreProcessor extends Task {
|
|||
PreProcessor processor = new PreProcessor();
|
||||
processor.setSymbols("ex2");
|
||||
String string = processor.preProcessFile(new File(
|
||||
"c:\\eclipse3.1\\dev\\example.debug.core\\src\\example\\debug\\core\\launcher\\PDALaunchDelegate.java"),
|
||||
"//#");
|
||||
"c:\\eclipse3.1\\dev\\example.debug.core\\src\\example\\debug\\core\\launcher\\PDALaunchDelegate.java"));
|
||||
//String string = processor.preProcessFile(new File("c:\\eclipse3.1\\dev\\example.debug.core\\plugin.xml"), null);
|
||||
System.out.println(string);
|
||||
}
|
||||
|
|
|
@ -74,7 +74,11 @@ git ls-files -- \*\*/.project ':!core/org.eclipse.cdt.core/.project' | while re
|
|||
sed -i \
|
||||
'-es@compilers.p.not-externalized-att=1@compilers.p.not-externalized-att=2@' \
|
||||
$d/.settings/org.eclipse.pde.prefs
|
||||
|
||||
fi
|
||||
if echo $i | grep 'org.eclipse.cdt.examples.dsf' > /dev/null; then
|
||||
sed -i \
|
||||
'-es@org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=warning@org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=ignore@' \
|
||||
$d/.settings/org.eclipse.jdt.core.prefs
|
||||
fi
|
||||
fi
|
||||
done
|
||||
|
|
Loading…
Add table
Reference in a new issue