Skip to main content
path: root/codan
AgeCommit message (Collapse)AuthorFilesLines
2018-03-14Bug 525250: "Create local variable" offered outside of local scopesFelix Morgner8-8/+90
When invoked from within 'isApplicable(IMarker)', 'isCodanProblem()' did not work as expected, since it used a cached value that was only updated in 'run(IMarker)'. The old API 'isCodanProblem()' has been marked as deprecated and is replaced by 'isCodanProblem(IMarker)', which works directly on the marker, instead of using a cached result. Additionally, two new APIs in 'QuickFixTestCase', called 'calculateQuickFixApplicability()' and 'assertIsApplicableForAllMarkers(boolean)', are introduced. The former can be used to record the applicability of the QuickFix under test for every marker in the test code, while the latter provides a way to assert on the applicability. For finer grained assertions, 'calculateQuickFixApplicability()' returns the calculated map. Change-Id: I7c53fd26afefa37ff086559acea75a7a33ecd5d7 Signed-off-by: Felix Morgner <>
2018-02-13[releng] Bump version to 9.5.0Jonah Graham1-1/+1
Change-Id: Ie342f02f7aae633f41a7ab7d39c21e056793a04a
2018-02-10Bug 529383 - NPE in CheckersRegistry.getResourceProfile()Nathan Ridge2-0/+8
Change-Id: I376cbf44c1fd237bd75a98ffc9e1daf60f5924ec
2018-02-08Remove useless code.Alexander Kurtakov1-3/+2
* Else clause. * Unused constructor in private class. Change-Id: I51d9ac08000e9ef6364dac96e96297733335a367 Signed-off-by: Alexander Kurtakov <>
2018-02-06Bug 530481 - NPE in QuickFixSuppressProblem.prepareFor()Nathan Ridge1-1/+4
Change-Id: Id83ce8e4cabf644b89d18a6e1c3f1199ec23396e
2018-01-10Bug 529338 - NPE in QuickFixUseDotOperator.apply()Nathan Ridge1-0/+5
Change-Id: I195f804e64abb77b5540d5abf0249d4de7816024
2017-12-26Bug 350144 - suppressing the "No break" problem with regexpAlena Laskavaia3-3/+58
added regex support for suppression comment Change-Id: I590d171fcce23d547a489e42a791aa484963d4a6 Signed-off-by: Alena Laskavaia <>
2017-11-30Bug 527553: Detect invalid decltype(auto) with a type specifierHansruedi Patzen5-0/+237
The evaluated type of 'decltype(auto)' in combination with const and/or volatile will be a ProblemType since this is not valid code. The patch also contains a checker to give the user a visual feedback. Note: A proposed quick-fix has been removed after a short discussion. Change-Id: I8760ed0ac28e28529ab30516accac9c0413c87d9 Signed-off-by: Hansruedi Patzen <>
2017-11-24Bug 527709 - [Checker] Test suite fails on WindowsHansruedi Patzen2-2/+2
Change-Id: I70cf18245dc8dba14493f212c932ea08ae85a6cf Signed-off-by: Hansruedi Patzen <>
2017-11-21Bug 526669 - Use the Matcher API correctly in ↵Nathan Ridge1-0/+2
CodanProblemMarkerResolutionGenerator Change-Id: Ia47cabea736fe2965f60117ae2074b6e2212d917
2017-11-21Releng fixes, ensuring legal files are there. Removing projects.Doug Schaefer2-1/+27
Removed the empty debug.core.tests project. Also removed the utils-feature and remote-feature projects since these shouldn't be features. Change-Id: Ib5d297c626de5328e3421a1fc9346330d9907750
2017-10-26Bug 525953 - Simplify the implementation of ↵Nathan Ridge1-5/+3
AbstractCodanCMarkerResolution.getProblem() In the process, the (problematic) assumption the function previously made that a marker's resource will be a file, has been removed. Change-Id: I657e1e99d9b06921558ca13960b4fd3ad554911d
2017-10-22Bug 513589 - Add support to build CDT projects in a Docker ContainerJeff Johnston1-2/+2
- add IOptionalBuildObjectPropertiesContainer interface to use for objects that supply optional build properties - add new IOptionalBuildProperties interface that defines optional build properties donated by external plug-ins - add new - change IConfiguration to an IOptionalBuildObjectPropertiesContainer - change IManagedProject to be an IOptionalBuildObjectPropertiesContainer - fix ProcessClosure to ensure that readers are not null before accessing them - fix Container launch delegate to look at project optional build properties for active configuration to fetch connection and image info and use said info to find a matching launch or create a new one - have Container launch delegate use the image name as part of the launch config name - have Container launch short-cut also use the project's optional build properties for the active config to get connection and image information before any defaulting - change AutotoolsNewMarkerGenerator to store the command launcher as an ICommandLauncher - add new CommandLauncherFactory extension to cdt.core that allows plug-ins to specify a CommandLauncherFactory that will return an ICommandLauncher based on the project - add macros for new extension to CCorePlugin - add new CommandLauncherManager class that loads CommandLauncherFactory extensions and is used to give an ICommandLauncher wrapper that will go through the list of CommandLauncherFactory extensions until one returns non-null ICommandLauncher - add code to RemoteCommandLauncher so it will use the CommandLauncherManager to get the local launcher - also change RemoteCommandLauncher to check at execution time whether the command is local and in that case use the local command launcher - add new ICommandLauncherFactory interface - add new ContainerCommandLauncher to launch - add new ContainerCommandLauncherFactory class for returning a ContainerCommandLauncher instance to launch commands in a Docker Container - change MakeBuilder to use CommandLauncherManager to get its ICommandLauncher - change CommandBuilder to use CommandLauncherManager too - ditto for Builder and AbstractBuiltinSpecsDetector and ExternalToolInvoker - change Configuration to load/store optional build properties as well as return the properties to get/set - ditto for MultiConfiguration - change ManagedProject to implement IOptionalBuildOptionProperties interface - ditto for ProjectType - create new OptionalBuildProperties class to store optional build properties for a configuration - bump cdt.docker.launcher to 1.1.0 - use CommandLauncherFactory extension to define ContainerCommandLauncherFactory - add optional ContainerPropertyTab which allows the end-user to optionally choose to build a C/C++ project in a Container and specify the connection/image to use - in LanguageSettingsSerializableSettings class, call the CommandLauncherManager getLanguageSettingEntries method to get the massaged language setting entries based on the current list - in LanguageSettingsProviderSerializer, try and get the pooled entries using the cfg description so that it will have the project and can use the CommandLauncherManager to get entries from image - in ContainerCommandLauncherFactory move cached headers under a HEADERS directory in the plug-in area - create a sub-directory for the connection and a sub-directory for the image based on cleansed names - store the real names of the connection and image to use later in the DockerHeaderPreferencePage - modify LanguageSettingsEntriesTab to force the horizontal scroll bar to appear (this is a bug in SWT SashForm support and the fix here isn't quite correct, but is better) - add new DockerHeaderPreferencePage that allows user to remove cached headers from images - change C/C++ Docker preferences to be titled: Docker Container - fix LanguageSettingsWorkspaceProvider.getSettingEntries method to use the CommandLauncherManager so entries will be transformed to use cached headers - add BaseDatabindingModel class - add DataVolumeModel class to model a volume mount - add ContainerPropertyVolumes model to model volume specification and selected volumes - add properties to ContainerCommandLauncher to represent volumes and selected volumes for a configuration - add ContainerDataVolumeDialog for specifying a volume mount by the end-user - add a null detector for cfgDescription in LanguageSettingsSerializableProvider - fix AutotoolsNewMakeGenerator.getWinOSType to not specify "." for working dir - fix GCCBuiltinSpecsDetectorCygwin to not map paths to Cygwin if the current configuration is enabled for container build - add logic to ContainerCommandLauncher to look for Windows file formats and change them to unix format and map any "." working dir to be /tmp - fix ContainerLauncherConfigurationDelegate similarly - fix AbstractBuiltinSpecsDetector to pass in the current configuration description when getting the CommandLauncher since the current configuration may not be the active configuration - change ContainerPropertyTab to add Elf and GNU Elf binary parsers when build in Container is chosen so that output executables are treated as Binaries by the CDT project - add documentationl for the ContainerPropertyTab in Build Settings and the Data Volume dialog pop-up it brings up - change CommandBuilder to accept a project as an argument to its constructor and to pass this as an argument to the CommandLauncherManager - have StepBuilder pass project when creating a CommandBuilder Change-Id: Ia78488b93056e6ec7ca83a6c87b3a9d2b9424943
2017-10-13Bug 525438 - Fix file path comparison in ↵Nathan Ridge1-2/+1
AbstractIndexAstChecker.getLineCommentsForLocation() Using IPath.toPortableString() was causing a forward slash vs. backward slash mismtach in the path comparison on Windows. Change-Id: Ib3eb392065fb473f6b6e70cb1dcddceb34ae7240
2017-10-06Add UI tests plugin for CMake. Fix a couple of bugs it found.Doug Schaefer1-10/+0
Also restructures the pom.xmls to put the modules in the top level so we can order them to have the test plugins build after them. Change-Id: I2f0e4ebd252791fb8844cdf0f635d574946207aa
2017-10-04Bug 495842: Add a quick fix for codan problems that ignores them by adding a ↵Felix Morgner10-80/+304
@suppress comment Change-Id: I760d2d435010f219bdb94273a6450e4163fe472e Signed-off-by: Felix Morgner <>
2017-10-04Bug 525350 - Ensure a lookup point is always set during indexing, code ↵Nathan Ridge2-1/+10
analysis, and code completion Also push a more accurate lookup point in a few places. Change-Id: I635569178d8d9afd23f7782aeebdaed714f1a10d
2017-09-25Bug 513105 - Store the current lookup point in a thread-local static stack ↵Nathan Ridge3-49/+65
rather than passing it around everywhere Change-Id: I3da7326d1ce6bede8d4787d98f38fb2064288338
2017-06-19Bug 486082 - Have ProblemBindingChecker report errors of type ↵Nathan Ridge2-0/+11
IProblemBinding.SEMANTIC_INVALID_TYPE Change-Id: I58f27a8783ea0dca53da5b45c2da11c6623892fd
2017-05-30Bug 517405 - Marker refresh causes editor to openThomas Corbat1-4/+5
Changed isApplicable to not retrieve the TU from the editor if it is not open. Applying the quick fix will still open the editor. Change-Id: Ib328ffa2054145eda8b2e72fe646fca2e7fc7905 Signed-off-by: Thomas Corbat <>
2017-05-29Bug 514423 - Ensure CodanCReconciler is installed on editors from all windowsNathan Ridge3-11/+58
Change-Id: I323a78fc1bd3a43270e27be7eb21c13f5a85de9f
2017-05-26Fix Codan quick-fixesJeff Johnston3-7/+6
- remove - move fix-it regexes to Change-Id: I6d389a12348e35d98c25ae18ca4026e03ea3e41d
2017-05-09Bug 512932 - Improve type checking of GCC builtinsNathan Ridge2-3/+10
Specifically, this patch: - Adds support for a new builtin, __builtin_assume_aligned. - Models __builtin_constant_p as a function instead of a macro. This inhibits constexpr evaluation, but allows for correct type-checking. - Diagnoses misuses of known builtins, instead of ingoring them like unknown builtins. Change-Id: Ie5a26f2010dc5b19e6f32a8c6a1237fe88da393e
2017-05-08Bug 514685 - codan: handle fallthrough attributeRolf Bislin13-88/+510
and provide quickfix for adding fallthrough attribute and add JUnit Tests and add StandardAttributes class Change-Id: I8cf0238771dc92bd1784b9dfb35a680d078b1db6 Depends-On: Ic09aa96f896b0a5dd998156e05930704775f695b Signed-off-by: Rolf Bislin <> Signed-off-by: Thomas Corbat <>
2017-05-02Fixed copyrightAlena Laskavaia1-15/+14
Change-Id: I801f28d73afeba8432283eb9b5e8de3fa9b47a32 Signed-off-by: Alena Laskavaia <>
2017-05-01Bug 515814 Copyright header for CaseBreakQuickFixCommentTestThomas Corbat1-0/+8
Associated with Bug 515814 Change-Id: Id32b0e8a77a774ff8922aa289a457e4f63434ecd Signed-off-by: Thomas Corbat <>
2017-04-26Bug 515814 - codan: add missing JUnit Testromibi2-0/+46
Change-Id: I626811b33ed09bb07c947c1c491b2c04e282232b Signed-off-by: romibi <>
2017-04-18Bug 497670 - Support compiler provided "fix-it" hintsJeff Johnston3-4/+61
- add new FixitErrorParser that extends RegexErrorParser and is used to replace the error parser for GNUCErrorParser - add new FixManager class to bind a fixit message with its problem marker - modify ProblemMarkerFilterManager to register the last accepted ProblemMarkerInfo for a particular resource so the FixitErrorParser can find the last error marker for the file that precedes the fixit message - FixitErrorParser looks for fix-it messages and binds them via FixitManager to the last error marker for the file - add new Fixit class to contain the details of a gcc fix-it - add new QuickFixForFixit which applies the gcc fix-it for the file - add new (.*) regex in codan.ui.checkers patterns that will trigger before any other error and will look for the fix-it message format - change cdt.core to expose cdt.internal.errorparsers to codan.checkers.ui - change codan.core to expose codan.internal.core.model to codan.checkers.ui - fix CDocumentProvider.setOverlay method to not overlay a CMarkerAnnotation that has a quick fix - when deleting all C problem markers, also make a call to FixManager.deleteAllMarkers() so markers aren't left referenced Change-Id: Ibf8ff7d8addb1bf092dc4ef35de0d92de0309589
2017-02-14releng: Make use of Tycho POM-less functionalityMarc-Andre Laperle66-219/+82
This removes a lot of pom.xml from the source tree. This is using the "POM-less" Tycho functionality. See One advantage of this is that you do not need to update the version in the pom.xml when you change it in the MANIFEST.MF because the pom.xml is automatically generated. This also reduces a lot of the duplicated information and pom.xml repetition. - Maven 3.3 and up is required. - Only eclipse-plugins and eclipse-features can be pom-less. Repositories, target and others still have pom.xml. - New parent poms are added because a parent is necessary directly one level above the plug-in/feature that will have its pom generated - Some test plug-ins had to be renamed .test -> .tests because it's required so that it detects that it's a test plug-in - Some suites were renamed so that they all use the same consistent name "AutomatedIntegrationSuite" - Profiles were added for the more common test configurations. They are activated by the presence of simple .properties files that only serve to activate the correct profile. The profiles: - One for UI tests (UI present and start in UI thread) - One for SWTBot tests (UI present and do not start in UI thread) Other test plug-ins that are too different are kept intact and still have a pom.xml - Fragments are kept intact since they all have different target platform configurations Change-Id: I9d73380eb766f547830c552daf08053a30b1845c Signed-off-by: Marc-Andre Laperle <>
2017-02-06Bug 511229 - RFE: Add quick fixes for some basic gcc errorsJeff Johnston14-6/+431
- change codanMarkerResolution schema to support translatable regex statements for matching - bump cdt.codan.ui version - add additional codanMarkerResolution extensions to codan.checkers.ui to handle some basic gcc error messages with quick fixes - add QuickFixAddSemicolon, QuickFixRenameMember, QuickFixUseDotOperator, and QuickFixUsePointer classes - add new QuickFixMessages - add to cdt.codan.checkers.ui to allow the quick fix regex matchers to be translated in the future - change the generic error message for gcc error parser so that the column is reported as the problem variable (useful for certain quick fix resolutions) - bump up cdt.core Change-Id: Ibb24c1a79c4d91ead3fc629ea3d4e7425b4e7f23
2017-01-21Bug 510722 - Handle a null AST in ExpandSelectionJob and ControlFlowGraphViewNathan Ridge1-0/+3
Change-Id: Iafd1b9a32833fb67554902d13955023c149a132e
2016-11-16Update version to 9.3.0Marc Khouzam8-8/+8
Change-Id: Ic953ccc5d38ff3661ca44de21ed8c4b7dad5b246
2016-11-15Update version to 9.2.0Marc Khouzam8-8/+8
Change-Id: I36ad4218b20b8ea70584c89f5be45c757bf4c714
2016-11-11Bug 507148. Fixed opening/switching to editor.Dominic Scharfe11-9/+335
- Reuse the TU from the open editor if present, otherwise load it from workspace - Added test plugin org.eclipse.cdt.codan.checkers.ui.test Change-Id: I725b7b8e462ffba39dd6c9a828ab72dd58f86b1f Signed-off-by: Dominic Scharfe <>
2016-10-26Bug 496720 - Respect scope filters for AST-based checkersNathan Ridge1-2/+2
Change-Id: Ib96879ec50bdc5a14215abbe6d109bcf3767d4f4
2016-10-06More robust implementation of ControlFlowGraphBuilder.isConstant methodSergey Prigogin1-6/+3
Change-Id: I43fd84e8c374a638834be3c2aeb216b96fc6b461
2016-10-05Bug 504004 - ReturnChecker should treat constructors and destructors asSergey Prigogin1-12/+16
void functions Change-Id: I8d957abcade86224af1e7ae1b1456f6a8e5b3813
2016-09-16Bug 490475. Support the evaluation of C++14 constexpr functionsToni Suter2-5/+5
Change-Id: I05029f26b6d33cbeeab8138a270b38c4018b64b5 Signed-off-by: Toni Suter <> Signed-off-by: Silvano Brugnoni <>
2016-09-05Bug 500884. Fixed ExternalToolInvoker so it starts the Build Console.Dan Crosscup1-0/+4
Build Console needs to be started before OutputStream and ErrorStream are retrieved for the Sniffer. Change-Id: I1aea84ca9fa2e6806cb07513bb2c9cad47c11617 Signed-off-by: Dan Crosscup <>
2016-08-17Update version to 9.1.0Marc Khouzam7-7/+7
This commit used the script releng/scripts/ Change-Id: I8274a6e8dd5c0f1e450f07952e138b265a441a62
2016-07-07Bug 496628 - Avoid codan markers that cover an entire class declarationNathan Ridge2-1/+22
This fixes a regression from bug 486610 which introduced these in some cases. Change-Id: I791528ce7f0bc061386aaa97dd9cecb7abeecd72
2016-06-22Move the rest of the CDT plugins to java 8Marc Khouzam27-45/+45
This change was generated using the script: releng/scripts/ Change-Id: I2ad96dc682a5acb8529c3edec40de279c331b5a4
2016-04-25Bug 492230 - Replace buffer.append(a+b) callsAlex Blewitt1-1/+1
When using a `StringBuilder` or `StringBuffer` to create a string message, using implicit string concatenation inside an `.append()` call will create a nested StringBuilder for the purposes of creating the arguments, which will subsequently be converted to a String and then passed to the outer StringBuilder. Skip the creation of the intermediate object and String by simply replacing such calls with `buffer.append(a).append(b)`. Where values are compile time String constants, leave as is so that the javac compiler can perform compile-time String concatenation. Ensure that NEWLINE isn't appended in such a way since it is not a compile time constant `System.getProperty("line.separator")` Change-Id: I4126aefb2272f06b08332e004d7ea76b6f02cdba Signed-off-by: Alex Blewitt <>
2016-04-22Bug 492200 - Replace StringBuffer with StringBuilderAlex Blewitt2-3/+3
There are many opportunities for replacing `StringBuffer` with `StringBuilder` provided that the type isn't visible from the public API and is used only in internal methods. Replace these where appropriate. Change-Id: Ic2f50c5b6f3c3a4eae301bb3b40fb6faed235f79 Signed-off-by: Alex Blewitt <>
2016-04-21Cosmetics.Sergey Prigogin1-15/+14
2016-04-21Bug 492200 - Replace StringBuffer with StringBuilder where appropriateSergey Prigogin1-1/+1
Change-Id: Ib52b839a211e2068e56da4b62a5b9640fef55d40
2016-04-19Bug 491984 - Replace .equals("") with .isEmpty()Alex Blewitt1-2/+2
In many cases a String's empty status is tested with `.equals("")`. However, Java 1.6 added `.isEmpty()` which can be more efficient since it compares the internal length parameter only for testing. Replace code using the `.isEmpty()` variant instead. Some tests for `"".equals(expr)` can be replaced with `expr.isEmpty()` where it is already known that the `expr` is not null; however, these have to be reviewed on a case-by-case basis. Change-Id: I3c6af4d8b7638e757435914ac76cb3a67899a5fd Signed-off-by: Alex Blewitt <>
2016-04-16Bug 491825 - Remove primitive wrapper creationAlex Blewitt1-2/+2
Using `new Integer` and other wrapper types such as `new Character` results in potential extra heap utilisation as the values are not cached. The built-in `Integer.valueOf` will perform caching on numbers in the range -128..127 (at least) using a flyweight pattern. In addition, parsing `int` values can be done with `Integer.parseInt` which avoids object construction. Adjust tests such as `"true".equals(expr)` to `Boolean.parseBoolean(expr)`. Change-Id: I0408a5c69afc4ca6ede71acaf6cc4abd67538006 Signed-off-by: Alex Blewitt <>
2016-03-17removing API for custom preference listeners in codanAlena Laskavaia5-131/+8
- this is replaced by eclipse preference listeners framework Change-Id: Ia39041c79c643912c883d7fdf507aeb252f13ddc
2016-03-15Bug 489553 - ConcurrentModificationException belowAlena Laskavaia2-37/+47
MapProblemPreference.clone Change-Id: If80417f386890495961745d13b3ad16040677e2e

Back to the top