mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-03-28 14:56:28 +01: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:
parent
e391b182cb
commit
35338f28a3
16 changed files with 43 additions and 38 deletions
2
.gitattributes
vendored
2
.gitattributes
vendored
|
@ -64,6 +64,8 @@ package-list text
|
|||
*.xml text
|
||||
*.xsd text
|
||||
*.xsl text
|
||||
yarn.lock text
|
||||
*.lock text
|
||||
|
||||
# Images
|
||||
*.gif binary
|
||||
|
|
|
@ -2,7 +2,7 @@ Manifest-Version: 1.0
|
|||
Bundle-ManifestVersion: 2
|
||||
Bundle-Name: %Bundle-Name.0
|
||||
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-Localization: plugin
|
||||
Bundle-Vendor: %provider
|
||||
|
|
|
@ -409,7 +409,7 @@ public class AutoconfParser {
|
|||
}
|
||||
throw new BlockEndCondition(token);
|
||||
|
||||
// 1. Check for end of statement
|
||||
// 1. Check for end of statement
|
||||
case ITokenConstants.EOL:
|
||||
case ITokenConstants.SEMI:
|
||||
return;
|
||||
|
@ -462,7 +462,7 @@ public class AutoconfParser {
|
|||
INVALID_FI);
|
||||
throw new BlockEndCondition(token);
|
||||
|
||||
// 4. Look for for/while loops
|
||||
// 4. Look for for/while loops
|
||||
case ITokenConstants.SH_FOR:
|
||||
checkLineStart(token, atStart);
|
||||
parseBlock(parent, token, new AutoconfForElement());
|
||||
|
@ -489,7 +489,7 @@ public class AutoconfParser {
|
|||
AutoconfUntilElement.class, AutoconfSelectElement.class }, INVALID_DONE);
|
||||
throw new BlockEndCondition(token);
|
||||
|
||||
// 5. Look for case statements
|
||||
// 5. Look for case statements
|
||||
case ITokenConstants.SH_CASE:
|
||||
checkLineStart(token, atStart);
|
||||
parseCaseBlock(parent, token, new AutoconfCaseElement());
|
||||
|
@ -507,7 +507,7 @@ public class AutoconfParser {
|
|||
new Class[] { AutoconfCaseElement.class, AutoconfCaseConditionElement.class }, INVALID_ESAC);
|
||||
throw new BlockEndCondition(token);
|
||||
|
||||
// 6. Check for HERE documents
|
||||
// 6. Check for HERE documents
|
||||
case ITokenConstants.SH_HERE:
|
||||
case ITokenConstants.SH_HERE_DASH:
|
||||
|
||||
|
@ -584,7 +584,7 @@ public class AutoconfParser {
|
|||
case ITokenConstants.EOF:
|
||||
throw new BlockEndCondition(token);
|
||||
|
||||
// 2. Check macro expansions
|
||||
// 2. Check macro expansions
|
||||
case ITokenConstants.WORD:
|
||||
token = checkMacro(parent, token);
|
||||
break;
|
||||
|
|
|
@ -422,7 +422,7 @@ public class MakeContentProvider implements ITreeContentProvider, IMakeTargetLis
|
|||
|
||||
/**
|
||||
* Check if the resource is in the list of source entries.
|
||||
|
||||
|
||||
* @param rc - resource to check.
|
||||
* @return {@code true} if the resource is a source folder, {@code false} otherwise.
|
||||
*
|
||||
|
|
|
@ -858,7 +858,7 @@ public class ManagedBuildManager extends AbstractCExtension {
|
|||
return;
|
||||
}
|
||||
} catch (BuildException e) {return;}
|
||||
|
||||
|
||||
// Figure out if there is a listener for this change
|
||||
IResource resource = config.getOwner();
|
||||
List listeners = (List) getBuildModelListeners().get(resource);
|
||||
|
@ -1363,10 +1363,10 @@ public class ManagedBuildManager extends AbstractCExtension {
|
|||
try {
|
||||
DocumentBuilder builder = DocumentBuilderFactory.newInstance().newDocumentBuilder();
|
||||
Document doc = builder.newDocument();
|
||||
|
||||
|
||||
// Get the build information for the project
|
||||
ManagedBuildInfo buildInfo = (ManagedBuildInfo) getBuildInfo(project);
|
||||
|
||||
|
||||
// Save the build info
|
||||
if (buildInfo != null &&
|
||||
!buildInfo.isReadOnly() &&
|
||||
|
@ -1381,7 +1381,7 @@ public class ManagedBuildManager extends AbstractCExtension {
|
|||
Element rootElement = doc.createElement(ROOT_NODE_NAME);
|
||||
doc.appendChild(rootElement);
|
||||
buildInfo.serialize(doc, rootElement);
|
||||
|
||||
|
||||
// Transform the document to something we can save in a file
|
||||
ByteArrayOutputStream stream = new ByteArrayOutputStream();
|
||||
Transformer transformer = TransformerFactory.newInstance().newTransformer();
|
||||
|
@ -1391,11 +1391,11 @@ public class ManagedBuildManager extends AbstractCExtension {
|
|||
DOMSource source = new DOMSource(doc);
|
||||
StreamResult result = new StreamResult(stream);
|
||||
transformer.transform(source, result);
|
||||
|
||||
|
||||
// Save the document
|
||||
IFile projectFile = project.getFile(SETTINGS_FILE_NAME);
|
||||
String utfString = stream.toString("UTF-8"); //$NON-NLS-1$
|
||||
|
||||
|
||||
if (projectFile.exists()) {
|
||||
if (projectFile.isReadOnly()) {
|
||||
// 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 {
|
||||
projectFile.create(new ByteArrayInputStream(utfString.getBytes("UTF-8")), IResource.FORCE, new NullProgressMonitor()); //$NON-NLS-1$
|
||||
}
|
||||
|
||||
|
||||
// Close the streams
|
||||
stream.close();
|
||||
}
|
||||
|
@ -1450,7 +1450,7 @@ public class ManagedBuildManager extends AbstractCExtension {
|
|||
// Save to IFile failed
|
||||
err = e;
|
||||
}
|
||||
|
||||
|
||||
if (err != null) {
|
||||
// Put out an error message indicating that the attempted write to the .cdtbuild project file failed
|
||||
IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
|
||||
|
@ -1458,7 +1458,7 @@ public class ManagedBuildManager extends AbstractCExtension {
|
|||
IWorkbenchWindow windows[] = PlatformUI.getWorkbench().getWorkbenchWindows();
|
||||
window = windows[0];
|
||||
}
|
||||
|
||||
|
||||
final Shell shell = window.getShell();
|
||||
if (shell != null) {
|
||||
final String exceptionMsg = err.getMessage();
|
||||
|
@ -1536,9 +1536,9 @@ public class ManagedBuildManager extends AbstractCExtension {
|
|||
for (int i=0; i < configs.length; i++) {
|
||||
ManagedBuildManager.performValueHandlerEvent(configs[i], IManagedOptionValueHandler.EVENT_CLOSE);
|
||||
}
|
||||
|
||||
|
||||
info.setValid(false);
|
||||
|
||||
|
||||
try {
|
||||
resource.setSessionProperty(buildInfoProperty, null);
|
||||
} catch (CoreException e) {
|
||||
|
@ -1819,7 +1819,7 @@ public class ManagedBuildManager extends AbstractCExtension {
|
|||
return Status.OK_STATUS;
|
||||
/*
|
||||
ManagedBuildInfo buildInfo = null;
|
||||
|
||||
|
||||
// Get the build info associated with this project for this session
|
||||
try {
|
||||
buildInfo = findBuildInfo(resource.getProject(), true);
|
||||
|
@ -2729,7 +2729,7 @@ public class ManagedBuildManager extends AbstractCExtension {
|
|||
} catch (Exception e) {
|
||||
// TODO: Issue error reagarding not being able to load the project file (.cdtbuild)
|
||||
}
|
||||
|
||||
|
||||
try {
|
||||
// Check if the project needs its container initialized
|
||||
initBuildInfoContainer(buildInfo);
|
||||
|
@ -2811,7 +2811,7 @@ public class ManagedBuildManager extends AbstractCExtension {
|
|||
*/
|
||||
/* synchronized private static ManagedBuildInfo findBuildInfoSynchronized(IProject project, boolean forceLoad) {
|
||||
ManagedBuildInfo buildInfo = null;
|
||||
|
||||
|
||||
// Check if there is any build info associated with this project for this session
|
||||
try {
|
||||
buildInfo = (ManagedBuildInfo)project.getSessionProperty(buildInfoProperty);
|
||||
|
@ -2822,7 +2822,7 @@ public class ManagedBuildManager extends AbstractCExtension {
|
|||
} catch (CoreException e) {
|
||||
// return null;
|
||||
}
|
||||
|
||||
|
||||
if(buildInfo == null && forceLoad){
|
||||
// Make sure the extension information is loaded first
|
||||
try {
|
||||
|
@ -2831,11 +2831,11 @@ public class ManagedBuildManager extends AbstractCExtension {
|
|||
e.printStackTrace();
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
// Check weather getBuildInfo is called from converter
|
||||
buildInfo = UpdateManagedProjectManager.getConvertedManagedBuildInfo(project);
|
||||
|
||||
|
||||
// Nothing in session store, so see if we can load it from cdtbuild
|
||||
if (buildInfo == null) {
|
||||
try {
|
||||
|
@ -2852,7 +2852,7 @@ public class ManagedBuildManager extends AbstractCExtension {
|
|||
IWorkbenchWindow windows[] = PlatformUI.getWorkbench().getWorkbenchWindows();
|
||||
window = windows[0];
|
||||
}
|
||||
|
||||
|
||||
final Shell shell = window.getShell();
|
||||
final String exceptionMsg = e.getMessage();
|
||||
//using syncExec could cause a dead-lock
|
||||
|
@ -2866,7 +2866,7 @@ public class ManagedBuildManager extends AbstractCExtension {
|
|||
}
|
||||
} );
|
||||
}
|
||||
|
||||
|
||||
if (buildInfo != null && !buildInfo.isContainerInited()) {
|
||||
// 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.
|
||||
|
@ -2880,7 +2880,7 @@ public class ManagedBuildManager extends AbstractCExtension {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return buildInfo;
|
||||
}
|
||||
*/
|
||||
|
|
|
@ -2,7 +2,7 @@ Manifest-Version: 1.0
|
|||
Bundle-ManifestVersion: 2
|
||||
Bundle-Name: %Bundle-Name
|
||||
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-Vendor: %Bundle-Vendor
|
||||
Require-Bundle: org.eclipse.core.runtime,
|
||||
|
|
|
@ -65,6 +65,7 @@ public interface IProblemPreferenceDescriptor extends Cloneable {
|
|||
* Custom type, represented by string input field by default
|
||||
*/
|
||||
TYPE_CUSTOM("custom"); //$NON-NLS-1$
|
||||
|
||||
private String literal;
|
||||
|
||||
private PreferenceType(String literal) {
|
||||
|
|
|
@ -120,7 +120,7 @@ public class RewriteTester extends TestSuite {
|
|||
|
||||
private static RewriteBaseTest createTestClass(String className, String testName, List<TestSourceFile> files)
|
||||
throws Exception {
|
||||
try {
|
||||
try {
|
||||
Class<?> refClass = Class.forName(className);
|
||||
Constructor<?> ct = refClass.getConstructor(new Class[] { String.class, List.class });
|
||||
RewriteBaseTest test = (RewriteBaseTest) ct.newInstance(new Object[] { testName, files });
|
||||
|
|
|
@ -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);
|
||||
|
||||
// Line comment group
|
||||
final Group commentGroup = createGroup(numColumns, composite,
|
||||
FormatterMessages.CommentsTabPage_group1_title);
|
||||
final Group commentGroup = createGroup(numColumns, composite, 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);
|
||||
// ((GridData) singleLineCommentsOnFirstColumn.getControl().getLayoutData()).horizontalIndent= indent;
|
||||
createPrefFalseTrue(commentGroup, numColumns, FormatterMessages.CommentsTabPage_block_comment,
|
||||
|
|
|
@ -567,7 +567,7 @@ public abstract class AbstractPage extends PropertyPage implements IPreferencePa
|
|||
* which do not share ICProjectDescription instance.
|
||||
* But some changes may be saved wrong if they are affected
|
||||
* by data from another property pages (Discovery options etc).
|
||||
|
||||
|
||||
* To enable 2nd mode, just create the following file:
|
||||
* <workspace>/.metadata/.plugins/org.eclipse.cdt.ui/apply_mode
|
||||
*/
|
||||
|
|
|
@ -3,7 +3,7 @@ Bundle-ManifestVersion: 2
|
|||
Bundle-Name: %Bundle-Name
|
||||
Bundle-Vendor: %Bundle-Vendor
|
||||
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
|
||||
Require-Bundle: org.apache.commons.io,
|
||||
org.eclipse.core.runtime,
|
||||
|
|
|
@ -13,7 +13,7 @@ public class Activator extends AbstractUIPlugin {
|
|||
|
||||
// The shared instance
|
||||
private static Activator plugin;
|
||||
|
||||
|
||||
/**
|
||||
* The constructor
|
||||
*/
|
||||
|
|
|
@ -216,7 +216,7 @@ public abstract class BaseExtensibleLanguage extends AbstractLanguage {
|
|||
if(e instanceof TemplateIDErrorException){
|
||||
//IScanner completePreprocessor = new CPreprocessor(reader, scanInfo, pl, log, config, fileCreator);
|
||||
//IParser<IASTTranslationUnit> completeParser = getCompleteParser(preprocessor, index, parserProperties);
|
||||
|
||||
|
||||
ISecondaryParser<IASTTranslationUnit> completeParser = getCompleteParser((ITokenStream)parser, preprocessor, index, parserProperties);
|
||||
//completeParser.setAction(parser.getAction());
|
||||
//((ISecondaryParser)completeParser).setTokenMap((ITokenStream)parser);
|
||||
|
|
|
@ -15,7 +15,7 @@ set -e
|
|||
##
|
||||
# Format code
|
||||
##
|
||||
: ${ECLIPSE:=~/buildtools/eclipse-SDK-4.9/eclipse}
|
||||
: ${ECLIPSE:=~/buildtools/eclipse-SDK-4.13/eclipse}
|
||||
test ! -e check_code_cleanliness_workspace
|
||||
${ECLIPSE} \
|
||||
-consolelog -nosplash -application org.eclipse.jdt.core.JavaCodeFormatter \
|
||||
|
|
|
@ -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
|
|
@ -19,7 +19,7 @@ compilers.p.missing-version-import-package=2
|
|||
compilers.p.missing-version-require-bundle=2
|
||||
compilers.p.no-required-att=0
|
||||
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.unknown-attribute=1
|
||||
compilers.p.unknown-class=1
|
||||
|
|
Loading…
Add table
Reference in a new issue