Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/language/settings/providers/CompilationDatabaseParser.java6
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/language/settings/providers/Messages.java2
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/language/settings/providers/messages.properties3
-rw-r--r--build/org.eclipse.cdt.meson.core/META-INF/MANIFEST.MF2
-rw-r--r--build/org.eclipse.cdt.meson.core/src/org/eclipse/cdt/internal/meson/core/MesonBuildConfiguration.java5
-rw-r--r--build/org.eclipse.cdt.meson.core/src/org/eclipse/cdt/internal/meson/core/Messages.java2
-rw-r--r--build/org.eclipse.cdt.meson.core/src/org/eclipse/cdt/internal/meson/core/messages.properties3
-rw-r--r--cmake/org.eclipse.cdt.cmake.is.core/META-INF/MANIFEST.MF2
-rw-r--r--cmake/org.eclipse.cdt.cmake.is.core/pom.xml2
-rw-r--r--cmake/org.eclipse.cdt.cmake.is.core/src/org/eclipse/cdt/cmake/is/core/CompileCommandsJsonParser.java6
-rw-r--r--cmake/org.eclipse.cdt.cmake.is.core/src/org/eclipse/cdt/cmake/is/core/Messages.java1
-rw-r--r--cmake/org.eclipse.cdt.cmake.is.core/src/org/eclipse/cdt/cmake/is/core/messages.properties1
-rw-r--r--core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/build/CBuildConfiguration.java5
13 files changed, 32 insertions, 8 deletions
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/language/settings/providers/CompilationDatabaseParser.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/language/settings/providers/CompilationDatabaseParser.java
index 23a6c3fed8e..ac98bfb18d4 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/language/settings/providers/CompilationDatabaseParser.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/language/settings/providers/CompilationDatabaseParser.java
@@ -326,6 +326,12 @@ public class CompilationDatabaseParser extends LanguageSettingsSerializableProvi
Messages.CompilationDatabaseParser_ErrorProcessingCompilationDatabase, e));
}
+ if (compileCommands == null) {
+ throw new CoreException(new Status(Status.ERROR, ManagedBuilderCorePlugin.PLUGIN_ID,
+ Messages.CompilationDatabaseParser_ErrorProcessingCompilationDatabase,
+ new NullPointerException(Messages.CompilationDatabaseParser_StillNull)));
+ }
+
AbstractBuildCommandParser outputParser;
try {
outputParser = getBuildCommandParser(cfgDescription, getBuildParserId());
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/language/settings/providers/Messages.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/language/settings/providers/Messages.java
index 1a15eaff8f6..9eb07ef9370 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/language/settings/providers/Messages.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/language/settings/providers/Messages.java
@@ -27,6 +27,8 @@ public class Messages extends NLS {
public static String CompilationDatabaseParser_ProgressParsingBuildCommands;
public static String CompilationDatabaseParser_ProgressParsingJSONFile;
+ public static String CompilationDatabaseParser_StillNull;
+
static {
// initialize resource bundle
NLS.initializeMessages(BUNDLE_NAME, Messages.class);
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/language/settings/providers/messages.properties b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/language/settings/providers/messages.properties
index f5b2a80d63b..bf4d06bd974 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/language/settings/providers/messages.properties
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/language/settings/providers/messages.properties
@@ -18,4 +18,5 @@ CompilationDatabaseParser_Job=Discover Compilation Database language settings
CompilationDatabaseParser_ProgressApplyingEntries=Applying language setting entries
CompilationDatabaseParser_ProgressExcludingFiles=Excluding files not in compilation database. Checking %d/%d (Estimate)
CompilationDatabaseParser_ProgressParsingBuildCommands=Parsing build commands (%d/%d)
-CompilationDatabaseParser_ProgressParsingJSONFile=Parsing JSON file \ No newline at end of file
+CompilationDatabaseParser_ProgressParsingJSONFile=Parsing JSON file
+CompilationDatabaseParser_StillNull=Compilation database (usually compile_commands.json) appears to be empty
diff --git a/build/org.eclipse.cdt.meson.core/META-INF/MANIFEST.MF b/build/org.eclipse.cdt.meson.core/META-INF/MANIFEST.MF
index 6ad3f668a1e..136c12f7843 100644
--- a/build/org.eclipse.cdt.meson.core/META-INF/MANIFEST.MF
+++ b/build/org.eclipse.cdt.meson.core/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %Bundle-Name.0
Bundle-SymbolicName: org.eclipse.cdt.meson.core;singleton:=true
-Bundle-Version: 1.1.0.qualifier
+Bundle-Version: 1.1.100.qualifier
Bundle-Activator: org.eclipse.cdt.meson.core.Activator
Bundle-Vendor: %provider
Require-Bundle: org.eclipse.core.runtime,
diff --git a/build/org.eclipse.cdt.meson.core/src/org/eclipse/cdt/internal/meson/core/MesonBuildConfiguration.java b/build/org.eclipse.cdt.meson.core/src/org/eclipse/cdt/internal/meson/core/MesonBuildConfiguration.java
index 25d064b9659..dc33eb56228 100644
--- a/build/org.eclipse.cdt.meson.core/src/org/eclipse/cdt/internal/meson/core/MesonBuildConfiguration.java
+++ b/build/org.eclipse.cdt.meson.core/src/org/eclipse/cdt/internal/meson/core/MesonBuildConfiguration.java
@@ -336,6 +336,11 @@ public class MesonBuildConfiguration extends CBuildConfiguration {
try (FileReader reader = new FileReader(commandsFile.toFile())) {
Gson gson = new Gson();
CompileCommand[] commands = gson.fromJson(reader, CompileCommand[].class);
+ if (commands == null) {
+ throw new CoreException(Activator.errorStatus(
+ String.format(Messages.MesonBuildConfiguration_ProcCompCmds, project.getName()),
+ new NullPointerException(Messages.MesonBuildConfiguration_StillNull)));
+ }
Map<String, CompileCommand> dedupedCmds = new HashMap<>();
for (CompileCommand command : commands) {
dedupedCmds.put(command.getFile(), command);
diff --git a/build/org.eclipse.cdt.meson.core/src/org/eclipse/cdt/internal/meson/core/Messages.java b/build/org.eclipse.cdt.meson.core/src/org/eclipse/cdt/internal/meson/core/Messages.java
index 33ba2f73fd1..7103bfcc2dc 100644
--- a/build/org.eclipse.cdt.meson.core/src/org/eclipse/cdt/internal/meson/core/Messages.java
+++ b/build/org.eclipse.cdt.meson.core/src/org/eclipse/cdt/internal/meson/core/Messages.java
@@ -32,6 +32,8 @@ public class Messages extends NLS {
public static String MesonBuildConfiguration_ProcCompCmds;
public static String MesonBuildConfiguration_ProcCompJson;
+ public static String MesonBuildConfiguration_StillNull;
+
static {
// initialize resource bundle
NLS.initializeMessages(BUNDLE_NAME, Messages.class);
diff --git a/build/org.eclipse.cdt.meson.core/src/org/eclipse/cdt/internal/meson/core/messages.properties b/build/org.eclipse.cdt.meson.core/src/org/eclipse/cdt/internal/meson/core/messages.properties
index 2ed915078df..8aaef0b02bb 100644
--- a/build/org.eclipse.cdt.meson.core/src/org/eclipse/cdt/internal/meson/core/messages.properties
+++ b/build/org.eclipse.cdt.meson.core/src/org/eclipse/cdt/internal/meson/core/messages.properties
@@ -24,5 +24,4 @@ MesonBuildConfiguration_RunningMesonFailure=Failure running meson: %s
MesonBuildConfiguration_RunningNinjaFailure=Failure running ninja: %s
MesonBuildConfiguration_NoNinjaFileToClean=No ninja.build file so clean has nothing to do
MesonBuildConfiguration_NoNinjaFile=Meson did not create a ninja.build file so build cannot complete
-
-
+MesonBuildConfiguration_StillNull=Compilation database (usually compile_commands.json) appears to be empty
diff --git a/cmake/org.eclipse.cdt.cmake.is.core/META-INF/MANIFEST.MF b/cmake/org.eclipse.cdt.cmake.is.core/META-INF/MANIFEST.MF
index 5bdf5e3cbe3..600113344f5 100644
--- a/cmake/org.eclipse.cdt.cmake.is.core/META-INF/MANIFEST.MF
+++ b/cmake/org.eclipse.cdt.cmake.is.core/META-INF/MANIFEST.MF
@@ -4,7 +4,7 @@ Bundle-Name: %bundleName
Bundle-Description: %bundleDescription
Bundle-Copyright: %Bundle-Copyright
Bundle-SymbolicName: org.eclipse.cdt.cmake.is.core;singleton:=true
-Bundle-Version: 1.0.100.qualifier
+Bundle-Version: 1.0.200.qualifier
Bundle-Vendor: %Bundle-Vendor
Bundle-Localization: plugin
Bundle-RequiredExecutionEnvironment: JavaSE-11
diff --git a/cmake/org.eclipse.cdt.cmake.is.core/pom.xml b/cmake/org.eclipse.cdt.cmake.is.core/pom.xml
index 0051565c9e0..0d259fede0b 100644
--- a/cmake/org.eclipse.cdt.cmake.is.core/pom.xml
+++ b/cmake/org.eclipse.cdt.cmake.is.core/pom.xml
@@ -22,6 +22,6 @@
<artifactId>org.eclipse.cdt.cmake.is.core</artifactId>
<!-- always use .qualifier in manifest, we do not plan to publish this plugin
to a maven repo. (The repository version is a different thing) -->
- <version>1.0.100-SNAPSHOT</version>
+ <version>1.0.200-SNAPSHOT</version>
<packaging>eclipse-plugin</packaging>
</project>
diff --git a/cmake/org.eclipse.cdt.cmake.is.core/src/org/eclipse/cdt/cmake/is/core/CompileCommandsJsonParser.java b/cmake/org.eclipse.cdt.cmake.is.core/src/org/eclipse/cdt/cmake/is/core/CompileCommandsJsonParser.java
index 1445ff14853..471ad734fd4 100644
--- a/cmake/org.eclipse.cdt.cmake.is.core/src/org/eclipse/cdt/cmake/is/core/CompileCommandsJsonParser.java
+++ b/cmake/org.eclipse.cdt.cmake.is.core/src/org/eclipse/cdt/cmake/is/core/CompileCommandsJsonParser.java
@@ -171,6 +171,12 @@ public class CompileCommandsJsonParser {
// parse file...
Gson gson = new Gson();
CommandEntry[] sourceFileInfos = gson.fromJson(in, CommandEntry[].class);
+ if (sourceFileInfos == null) {
+ final String msg = String.format(Messages.CompileCommandsJsonParser_errmsg_empty_json, jsonDiskFile,
+ WORKBENCH_WILL_NOT_KNOW_ALL_MSG);
+ createMarker(jsonFile, msg);
+ return false;
+ }
for (CommandEntry sourceFileInfo : sourceFileInfos) {
processCommandEntry(sourceFileInfo, jsonFile);
}
diff --git a/cmake/org.eclipse.cdt.cmake.is.core/src/org/eclipse/cdt/cmake/is/core/Messages.java b/cmake/org.eclipse.cdt.cmake.is.core/src/org/eclipse/cdt/cmake/is/core/Messages.java
index 4ed2a8174c5..f443500337d 100644
--- a/cmake/org.eclipse.cdt.cmake.is.core/src/org/eclipse/cdt/cmake/is/core/Messages.java
+++ b/cmake/org.eclipse.cdt.cmake.is.core/src/org/eclipse/cdt/cmake/is/core/Messages.java
@@ -19,6 +19,7 @@ import org.eclipse.osgi.util.NLS;
*/
/* package */ public class Messages extends NLS {
private static final String BUNDLE_NAME = "org.eclipse.cdt.cmake.is.core.messages"; //$NON-NLS-1$
+ public static String CompileCommandsJsonParser_errmsg_empty_json;
public static String CompileCommandsJsonParser_errmsg_file_not_found;
public static String CompileCommandsJsonParser_errmsg_no_parser_for_commandline;
public static String CompileCommandsJsonParser_errmsg_not_json;
diff --git a/cmake/org.eclipse.cdt.cmake.is.core/src/org/eclipse/cdt/cmake/is/core/messages.properties b/cmake/org.eclipse.cdt.cmake.is.core/src/org/eclipse/cdt/cmake/is/core/messages.properties
index 77e951652f7..4b2b5c4481c 100644
--- a/cmake/org.eclipse.cdt.cmake.is.core/src/org/eclipse/cdt/cmake/is/core/messages.properties
+++ b/cmake/org.eclipse.cdt.cmake.is.core/src/org/eclipse/cdt/cmake/is/core/messages.properties
@@ -11,6 +11,7 @@
# Contributors:
# Martin Weber - initial API and implementation
###############################################################################
+CompileCommandsJsonParser_errmsg_empty_json=File '%1$s' appears to be an empty file. %2$s
CompileCommandsJsonParser_errmsg_file_not_found=File '%1$s' was not created in the build. %2$s
CompileCommandsJsonParser_errmsg_no_parser_for_commandline=No parser for command '%1$s'. %2$s
CompileCommandsJsonParser_errmsg_not_json=File '%1$s' does not seem to be in JSON format. %2$s
diff --git a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/build/CBuildConfiguration.java b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/build/CBuildConfiguration.java
index 0c1b5b0f9d6..2e4f21c174a 100644
--- a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/build/CBuildConfiguration.java
+++ b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/build/CBuildConfiguration.java
@@ -644,9 +644,10 @@ public abstract class CBuildConfiguration extends PlatformObject implements ICBu
scannerInfoCache = gson.fromJson(reader, ScannerInfoCache.class);
} catch (IOException e) {
CCorePlugin.log(e);
- scannerInfoCache = new ScannerInfoCache();
}
- } else {
+ }
+
+ if (scannerInfoCache == null) {
scannerInfoCache = new ScannerInfoCache();
}
scannerInfoCache.initCache();

Back to the top