1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-08-05 15:25:49 +02:00

[releng] Cleanup code that has been misformatted and update to SDK 4.13

The check-code-cleanliness CI jobs have not been running recently,
so this commit is to the code up to those minor changes

Change-Id: I9fb4b0213dec558f58c5ca718b3d2685564ef456
This commit is contained in:
Jonah Graham 2019-10-28 12:17:20 -04:00
parent e391b182cb
commit 35338f28a3
16 changed files with 43 additions and 38 deletions

2
.gitattributes vendored
View file

@ -64,6 +64,8 @@ package-list text
*.xml text *.xml text
*.xsd text *.xsd text
*.xsl text *.xsl text
yarn.lock text
*.lock text
# Images # Images
*.gif binary *.gif binary

View file

@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2 Bundle-ManifestVersion: 2
Bundle-Name: %Bundle-Name.0 Bundle-Name: %Bundle-Name.0
Bundle-SymbolicName: org.eclipse.cdt.autotools.ui;singleton:=true Bundle-SymbolicName: org.eclipse.cdt.autotools.ui;singleton:=true
Bundle-Version: 2.0.200.qualifier Bundle-Version: 2.0.300.qualifier
Bundle-Activator: org.eclipse.cdt.autotools.ui.AutotoolsUIPlugin Bundle-Activator: org.eclipse.cdt.autotools.ui.AutotoolsUIPlugin
Bundle-Localization: plugin Bundle-Localization: plugin
Bundle-Vendor: %provider Bundle-Vendor: %provider

View file

@ -409,7 +409,7 @@ public class AutoconfParser {
} }
throw new BlockEndCondition(token); throw new BlockEndCondition(token);
// 1. Check for end of statement // 1. Check for end of statement
case ITokenConstants.EOL: case ITokenConstants.EOL:
case ITokenConstants.SEMI: case ITokenConstants.SEMI:
return; return;
@ -462,7 +462,7 @@ public class AutoconfParser {
INVALID_FI); INVALID_FI);
throw new BlockEndCondition(token); throw new BlockEndCondition(token);
// 4. Look for for/while loops // 4. Look for for/while loops
case ITokenConstants.SH_FOR: case ITokenConstants.SH_FOR:
checkLineStart(token, atStart); checkLineStart(token, atStart);
parseBlock(parent, token, new AutoconfForElement()); parseBlock(parent, token, new AutoconfForElement());
@ -489,7 +489,7 @@ public class AutoconfParser {
AutoconfUntilElement.class, AutoconfSelectElement.class }, INVALID_DONE); AutoconfUntilElement.class, AutoconfSelectElement.class }, INVALID_DONE);
throw new BlockEndCondition(token); throw new BlockEndCondition(token);
// 5. Look for case statements // 5. Look for case statements
case ITokenConstants.SH_CASE: case ITokenConstants.SH_CASE:
checkLineStart(token, atStart); checkLineStart(token, atStart);
parseCaseBlock(parent, token, new AutoconfCaseElement()); parseCaseBlock(parent, token, new AutoconfCaseElement());
@ -507,7 +507,7 @@ public class AutoconfParser {
new Class[] { AutoconfCaseElement.class, AutoconfCaseConditionElement.class }, INVALID_ESAC); new Class[] { AutoconfCaseElement.class, AutoconfCaseConditionElement.class }, INVALID_ESAC);
throw new BlockEndCondition(token); throw new BlockEndCondition(token);
// 6. Check for HERE documents // 6. Check for HERE documents
case ITokenConstants.SH_HERE: case ITokenConstants.SH_HERE:
case ITokenConstants.SH_HERE_DASH: case ITokenConstants.SH_HERE_DASH:
@ -584,7 +584,7 @@ public class AutoconfParser {
case ITokenConstants.EOF: case ITokenConstants.EOF:
throw new BlockEndCondition(token); throw new BlockEndCondition(token);
// 2. Check macro expansions // 2. Check macro expansions
case ITokenConstants.WORD: case ITokenConstants.WORD:
token = checkMacro(parent, token); token = checkMacro(parent, token);
break; break;

View file

@ -422,7 +422,7 @@ public class MakeContentProvider implements ITreeContentProvider, IMakeTargetLis
/** /**
* Check if the resource is in the list of source entries. * Check if the resource is in the list of source entries.
* @param rc - resource to check. * @param rc - resource to check.
* @return {@code true} if the resource is a source folder, {@code false} otherwise. * @return {@code true} if the resource is a source folder, {@code false} otherwise.
* *

View file

@ -858,7 +858,7 @@ public class ManagedBuildManager extends AbstractCExtension {
return; return;
} }
} catch (BuildException e) {return;} } catch (BuildException e) {return;}
// Figure out if there is a listener for this change // Figure out if there is a listener for this change
IResource resource = config.getOwner(); IResource resource = config.getOwner();
List listeners = (List) getBuildModelListeners().get(resource); List listeners = (List) getBuildModelListeners().get(resource);
@ -1363,10 +1363,10 @@ public class ManagedBuildManager extends AbstractCExtension {
try { try {
DocumentBuilder builder = DocumentBuilderFactory.newInstance().newDocumentBuilder(); DocumentBuilder builder = DocumentBuilderFactory.newInstance().newDocumentBuilder();
Document doc = builder.newDocument(); Document doc = builder.newDocument();
// Get the build information for the project // Get the build information for the project
ManagedBuildInfo buildInfo = (ManagedBuildInfo) getBuildInfo(project); ManagedBuildInfo buildInfo = (ManagedBuildInfo) getBuildInfo(project);
// Save the build info // Save the build info
if (buildInfo != null && if (buildInfo != null &&
!buildInfo.isReadOnly() && !buildInfo.isReadOnly() &&
@ -1381,7 +1381,7 @@ public class ManagedBuildManager extends AbstractCExtension {
Element rootElement = doc.createElement(ROOT_NODE_NAME); Element rootElement = doc.createElement(ROOT_NODE_NAME);
doc.appendChild(rootElement); doc.appendChild(rootElement);
buildInfo.serialize(doc, rootElement); buildInfo.serialize(doc, rootElement);
// Transform the document to something we can save in a file // Transform the document to something we can save in a file
ByteArrayOutputStream stream = new ByteArrayOutputStream(); ByteArrayOutputStream stream = new ByteArrayOutputStream();
Transformer transformer = TransformerFactory.newInstance().newTransformer(); Transformer transformer = TransformerFactory.newInstance().newTransformer();
@ -1391,11 +1391,11 @@ public class ManagedBuildManager extends AbstractCExtension {
DOMSource source = new DOMSource(doc); DOMSource source = new DOMSource(doc);
StreamResult result = new StreamResult(stream); StreamResult result = new StreamResult(stream);
transformer.transform(source, result); transformer.transform(source, result);
// Save the document // Save the document
IFile projectFile = project.getFile(SETTINGS_FILE_NAME); IFile projectFile = project.getFile(SETTINGS_FILE_NAME);
String utfString = stream.toString("UTF-8"); //$NON-NLS-1$ String utfString = stream.toString("UTF-8"); //$NON-NLS-1$
if (projectFile.exists()) { if (projectFile.exists()) {
if (projectFile.isReadOnly()) { if (projectFile.isReadOnly()) {
// If we are not running headless, and there is a UI Window around, grab it // If we are not running headless, and there is a UI Window around, grab it
@ -1429,7 +1429,7 @@ public class ManagedBuildManager extends AbstractCExtension {
} else { } else {
projectFile.create(new ByteArrayInputStream(utfString.getBytes("UTF-8")), IResource.FORCE, new NullProgressMonitor()); //$NON-NLS-1$ projectFile.create(new ByteArrayInputStream(utfString.getBytes("UTF-8")), IResource.FORCE, new NullProgressMonitor()); //$NON-NLS-1$
} }
// Close the streams // Close the streams
stream.close(); stream.close();
} }
@ -1450,7 +1450,7 @@ public class ManagedBuildManager extends AbstractCExtension {
// Save to IFile failed // Save to IFile failed
err = e; err = e;
} }
if (err != null) { if (err != null) {
// Put out an error message indicating that the attempted write to the .cdtbuild project file failed // Put out an error message indicating that the attempted write to the .cdtbuild project file failed
IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow(); IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
@ -1458,7 +1458,7 @@ public class ManagedBuildManager extends AbstractCExtension {
IWorkbenchWindow windows[] = PlatformUI.getWorkbench().getWorkbenchWindows(); IWorkbenchWindow windows[] = PlatformUI.getWorkbench().getWorkbenchWindows();
window = windows[0]; window = windows[0];
} }
final Shell shell = window.getShell(); final Shell shell = window.getShell();
if (shell != null) { if (shell != null) {
final String exceptionMsg = err.getMessage(); final String exceptionMsg = err.getMessage();
@ -1536,9 +1536,9 @@ public class ManagedBuildManager extends AbstractCExtension {
for (int i=0; i < configs.length; i++) { for (int i=0; i < configs.length; i++) {
ManagedBuildManager.performValueHandlerEvent(configs[i], IManagedOptionValueHandler.EVENT_CLOSE); ManagedBuildManager.performValueHandlerEvent(configs[i], IManagedOptionValueHandler.EVENT_CLOSE);
} }
info.setValid(false); info.setValid(false);
try { try {
resource.setSessionProperty(buildInfoProperty, null); resource.setSessionProperty(buildInfoProperty, null);
} catch (CoreException e) { } catch (CoreException e) {
@ -1819,7 +1819,7 @@ public class ManagedBuildManager extends AbstractCExtension {
return Status.OK_STATUS; return Status.OK_STATUS;
/* /*
ManagedBuildInfo buildInfo = null; ManagedBuildInfo buildInfo = null;
// Get the build info associated with this project for this session // Get the build info associated with this project for this session
try { try {
buildInfo = findBuildInfo(resource.getProject(), true); buildInfo = findBuildInfo(resource.getProject(), true);
@ -2729,7 +2729,7 @@ public class ManagedBuildManager extends AbstractCExtension {
} catch (Exception e) { } catch (Exception e) {
// TODO: Issue error reagarding not being able to load the project file (.cdtbuild) // TODO: Issue error reagarding not being able to load the project file (.cdtbuild)
} }
try { try {
// Check if the project needs its container initialized // Check if the project needs its container initialized
initBuildInfoContainer(buildInfo); initBuildInfoContainer(buildInfo);
@ -2811,7 +2811,7 @@ public class ManagedBuildManager extends AbstractCExtension {
*/ */
/* synchronized private static ManagedBuildInfo findBuildInfoSynchronized(IProject project, boolean forceLoad) { /* synchronized private static ManagedBuildInfo findBuildInfoSynchronized(IProject project, boolean forceLoad) {
ManagedBuildInfo buildInfo = null; ManagedBuildInfo buildInfo = null;
// Check if there is any build info associated with this project for this session // Check if there is any build info associated with this project for this session
try { try {
buildInfo = (ManagedBuildInfo)project.getSessionProperty(buildInfoProperty); buildInfo = (ManagedBuildInfo)project.getSessionProperty(buildInfoProperty);
@ -2822,7 +2822,7 @@ public class ManagedBuildManager extends AbstractCExtension {
} catch (CoreException e) { } catch (CoreException e) {
// return null; // return null;
} }
if(buildInfo == null && forceLoad){ if(buildInfo == null && forceLoad){
// Make sure the extension information is loaded first // Make sure the extension information is loaded first
try { try {
@ -2831,11 +2831,11 @@ public class ManagedBuildManager extends AbstractCExtension {
e.printStackTrace(); e.printStackTrace();
return null; return null;
} }
// Check weather getBuildInfo is called from converter // Check weather getBuildInfo is called from converter
buildInfo = UpdateManagedProjectManager.getConvertedManagedBuildInfo(project); buildInfo = UpdateManagedProjectManager.getConvertedManagedBuildInfo(project);
// Nothing in session store, so see if we can load it from cdtbuild // Nothing in session store, so see if we can load it from cdtbuild
if (buildInfo == null) { if (buildInfo == null) {
try { try {
@ -2852,7 +2852,7 @@ public class ManagedBuildManager extends AbstractCExtension {
IWorkbenchWindow windows[] = PlatformUI.getWorkbench().getWorkbenchWindows(); IWorkbenchWindow windows[] = PlatformUI.getWorkbench().getWorkbenchWindows();
window = windows[0]; window = windows[0];
} }
final Shell shell = window.getShell(); final Shell shell = window.getShell();
final String exceptionMsg = e.getMessage(); final String exceptionMsg = e.getMessage();
//using syncExec could cause a dead-lock //using syncExec could cause a dead-lock
@ -2866,7 +2866,7 @@ public class ManagedBuildManager extends AbstractCExtension {
} }
} ); } );
} }
if (buildInfo != null && !buildInfo.isContainerInited()) { if (buildInfo != null && !buildInfo.isContainerInited()) {
// NOTE: If this is called inside the above rule, then an IllegalArgumentException can // NOTE: If this is called inside the above rule, then an IllegalArgumentException can
// occur when the CDT project file is saved - it uses the Workspace Root as the scheduling rule. // occur when the CDT project file is saved - it uses the Workspace Root as the scheduling rule.
@ -2880,7 +2880,7 @@ public class ManagedBuildManager extends AbstractCExtension {
} }
} }
} }
return buildInfo; return buildInfo;
} }
*/ */

View file

@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2 Bundle-ManifestVersion: 2
Bundle-Name: %Bundle-Name Bundle-Name: %Bundle-Name
Bundle-SymbolicName: org.eclipse.cdt.codan.core;singleton:=true Bundle-SymbolicName: org.eclipse.cdt.codan.core;singleton:=true
Bundle-Version: 4.0.100.qualifier Bundle-Version: 4.0.200.qualifier
Bundle-Activator: org.eclipse.cdt.codan.core.CodanCorePlugin Bundle-Activator: org.eclipse.cdt.codan.core.CodanCorePlugin
Bundle-Vendor: %Bundle-Vendor Bundle-Vendor: %Bundle-Vendor
Require-Bundle: org.eclipse.core.runtime, Require-Bundle: org.eclipse.core.runtime,

View file

@ -65,6 +65,7 @@ public interface IProblemPreferenceDescriptor extends Cloneable {
* Custom type, represented by string input field by default * Custom type, represented by string input field by default
*/ */
TYPE_CUSTOM("custom"); //$NON-NLS-1$ TYPE_CUSTOM("custom"); //$NON-NLS-1$
private String literal; private String literal;
private PreferenceType(String literal) { private PreferenceType(String literal) {

View file

@ -120,7 +120,7 @@ public class RewriteTester extends TestSuite {
private static RewriteBaseTest createTestClass(String className, String testName, List<TestSourceFile> files) private static RewriteBaseTest createTestClass(String className, String testName, List<TestSourceFile> files)
throws Exception { throws Exception {
try { try {
Class<?> refClass = Class.forName(className); Class<?> refClass = Class.forName(className);
Constructor<?> ct = refClass.getConstructor(new Class[] { String.class, List.class }); Constructor<?> ct = refClass.getConstructor(new Class[] { String.class, List.class });
RewriteBaseTest test = (RewriteBaseTest) ct.newInstance(new Object[] { testName, files }); RewriteBaseTest test = (RewriteBaseTest) ct.newInstance(new Object[] { testName, files });

View file

@ -99,8 +99,7 @@ public class CommentsTabPage extends FormatterTabPage {
// createPrefFalseTrue(globalGroup, numColumns, FormatterMessages.CommentsTabPage_do_not_join_lines, DefaultCodeFormatterConstants.FORMATTER_JOIN_LINES_IN_COMMENTS, true); // createPrefFalseTrue(globalGroup, numColumns, FormatterMessages.CommentsTabPage_do_not_join_lines, DefaultCodeFormatterConstants.FORMATTER_JOIN_LINES_IN_COMMENTS, true);
// Line comment group // Line comment group
final Group commentGroup = createGroup(numColumns, composite, final Group commentGroup = createGroup(numColumns, composite, FormatterMessages.CommentsTabPage_group1_title);
FormatterMessages.CommentsTabPage_group1_title);
// final CheckboxPreference singleLineCommentsOnFirstColumn= createPrefFalseTrue(lineCommentGroup, numColumns, FormatterMessages.CommentsTabPage_format_line_comments_on_first_column, DefaultCodeFormatterConstants.FORMATTER_COMMENT_FORMAT_LINE_COMMENT_STARTING_ON_FIRST_COLUMN, false); // final CheckboxPreference singleLineCommentsOnFirstColumn= createPrefFalseTrue(lineCommentGroup, numColumns, FormatterMessages.CommentsTabPage_format_line_comments_on_first_column, DefaultCodeFormatterConstants.FORMATTER_COMMENT_FORMAT_LINE_COMMENT_STARTING_ON_FIRST_COLUMN, false);
// ((GridData) singleLineCommentsOnFirstColumn.getControl().getLayoutData()).horizontalIndent= indent; // ((GridData) singleLineCommentsOnFirstColumn.getControl().getLayoutData()).horizontalIndent= indent;
createPrefFalseTrue(commentGroup, numColumns, FormatterMessages.CommentsTabPage_block_comment, createPrefFalseTrue(commentGroup, numColumns, FormatterMessages.CommentsTabPage_block_comment,

View file

@ -567,7 +567,7 @@ public abstract class AbstractPage extends PropertyPage implements IPreferencePa
* which do not share ICProjectDescription instance. * which do not share ICProjectDescription instance.
* But some changes may be saved wrong if they are affected * But some changes may be saved wrong if they are affected
* by data from another property pages (Discovery options etc). * by data from another property pages (Discovery options etc).
* To enable 2nd mode, just create the following file: * To enable 2nd mode, just create the following file:
* <workspace>/.metadata/.plugins/org.eclipse.cdt.ui/apply_mode * <workspace>/.metadata/.plugins/org.eclipse.cdt.ui/apply_mode
*/ */

View file

@ -3,7 +3,7 @@ Bundle-ManifestVersion: 2
Bundle-Name: %Bundle-Name Bundle-Name: %Bundle-Name
Bundle-Vendor: %Bundle-Vendor Bundle-Vendor: %Bundle-Vendor
Bundle-SymbolicName: org.eclipse.cdt.debug.dap.gdbjtag;singleton:=true Bundle-SymbolicName: org.eclipse.cdt.debug.dap.gdbjtag;singleton:=true
Bundle-Version: 1.0.0.qualifier Bundle-Version: 1.100.0.qualifier
Bundle-Activator: org.eclipse.cdt.debug.dap.gdbjtag.Activator Bundle-Activator: org.eclipse.cdt.debug.dap.gdbjtag.Activator
Require-Bundle: org.apache.commons.io, Require-Bundle: org.apache.commons.io,
org.eclipse.core.runtime, org.eclipse.core.runtime,

View file

@ -13,7 +13,7 @@ public class Activator extends AbstractUIPlugin {
// The shared instance // The shared instance
private static Activator plugin; private static Activator plugin;
/** /**
* The constructor * The constructor
*/ */

View file

@ -216,7 +216,7 @@ public abstract class BaseExtensibleLanguage extends AbstractLanguage {
if(e instanceof TemplateIDErrorException){ if(e instanceof TemplateIDErrorException){
//IScanner completePreprocessor = new CPreprocessor(reader, scanInfo, pl, log, config, fileCreator); //IScanner completePreprocessor = new CPreprocessor(reader, scanInfo, pl, log, config, fileCreator);
//IParser<IASTTranslationUnit> completeParser = getCompleteParser(preprocessor, index, parserProperties); //IParser<IASTTranslationUnit> completeParser = getCompleteParser(preprocessor, index, parserProperties);
ISecondaryParser<IASTTranslationUnit> completeParser = getCompleteParser((ITokenStream)parser, preprocessor, index, parserProperties); ISecondaryParser<IASTTranslationUnit> completeParser = getCompleteParser((ITokenStream)parser, preprocessor, index, parserProperties);
//completeParser.setAction(parser.getAction()); //completeParser.setAction(parser.getAction());
//((ISecondaryParser)completeParser).setTokenMap((ITokenStream)parser); //((ISecondaryParser)completeParser).setTokenMap((ITokenStream)parser);

View file

@ -15,7 +15,7 @@ set -e
## ##
# Format code # Format code
## ##
: ${ECLIPSE:=~/buildtools/eclipse-SDK-4.9/eclipse} : ${ECLIPSE:=~/buildtools/eclipse-SDK-4.13/eclipse}
test ! -e check_code_cleanliness_workspace test ! -e check_code_cleanliness_workspace
${ECLIPSE} \ ${ECLIPSE} \
-consolelog -nosplash -application org.eclipse.jdt.core.JavaCodeFormatter \ -consolelog -nosplash -application org.eclipse.jdt.core.JavaCodeFormatter \

View file

@ -0,0 +1,3 @@
eclipse.preferences.version=1
org.eclipse.jdt.launching.PREF_COMPILER_COMPLIANCE_DOES_NOT_MATCH_JRE=warning
org.eclipse.jdt.launching.PREF_STRICTLY_COMPATIBLE_JRE_NOT_AVAILABLE=warning

View file

@ -19,7 +19,7 @@ compilers.p.missing-version-import-package=2
compilers.p.missing-version-require-bundle=2 compilers.p.missing-version-require-bundle=2
compilers.p.no-required-att=0 compilers.p.no-required-att=0
compilers.p.no.automatic.module=1 compilers.p.no.automatic.module=1
compilers.p.not-externalized-att=1 compilers.p.not-externalized-att=2
compilers.p.service.component.without.lazyactivation=1 compilers.p.service.component.without.lazyactivation=1
compilers.p.unknown-attribute=1 compilers.p.unknown-attribute=1
compilers.p.unknown-class=1 compilers.p.unknown-class=1