diff --git a/build/org.eclipse.cdt.cmake.core/src/org/eclipse/cdt/cmake/core/internal/CMakeBuildConfiguration.java b/build/org.eclipse.cdt.cmake.core/src/org/eclipse/cdt/cmake/core/internal/CMakeBuildConfiguration.java index 9adc2484f59..1970463806c 100644 --- a/build/org.eclipse.cdt.cmake.core/src/org/eclipse/cdt/cmake/core/internal/CMakeBuildConfiguration.java +++ b/build/org.eclipse.cdt.cmake.core/src/org/eclipse/cdt/cmake/core/internal/CMakeBuildConfiguration.java @@ -193,14 +193,19 @@ public class CMakeBuildConfiguration extends CBuildConfiguration { org.eclipse.core.runtime.Path workingDir = new org.eclipse.core.runtime.Path( getBuildDirectory().toString()); // hook in cmake error parsing - IConsole errConsole = new CMakeConsoleWrapper(srcFolder, console); - Process p = startBuildProcess(command, new IEnvironmentVariable[0], workingDir, errConsole, monitor); - if (p == null) { - console.getErrorStream().write(String.format(Messages.CMakeBuildConfiguration_Failure, "")); //$NON-NLS-1$ - return null; - } + try (CMakeErrorParser errorParser = new CMakeErrorParser(new CMakeExecutionMarkerFactory(srcFolder))) { + ParsingConsoleOutputStream errStream = new ParsingConsoleOutputStream(console.getErrorStream(), + errorParser); + IConsole errConsole = new CMakeConsoleWrapper(console, errStream); + Process p = startBuildProcess(command, new IEnvironmentVariable[0], workingDir, errConsole, + monitor); + if (p == null) { + console.getErrorStream().write(String.format(Messages.CMakeBuildConfiguration_Failure, "")); //$NON-NLS-1$ + return null; + } - watchProcess(p, errConsole); + watchProcess(p, errConsole); + } cmakeListsModified = false; } @@ -471,7 +476,7 @@ public class CMakeBuildConfiguration extends CBuildConfiguration { * @throws CoreException */ private static void deleteCMakeErrorMarkers(IProject project) throws CoreException { - project.deleteMarkers(CMakeErrorParser.CMAKE_PROBLEM_MARKER_ID, false, IResource.DEPTH_INFINITE); + project.deleteMarkers(ICMakeExecutionMarkerFactory.CMAKE_PROBLEM_MARKER_ID, false, IResource.DEPTH_INFINITE); } private static class CMakeIndexerInfoConsumer implements IIndexerInfoConsumer { diff --git a/build/org.eclipse.cdt.cmake.core/src/org/eclipse/cdt/cmake/core/internal/CMakeConsoleWrapper.java b/build/org.eclipse.cdt.cmake.core/src/org/eclipse/cdt/cmake/core/internal/CMakeConsoleWrapper.java index 7da979ee209..05a9263ff1f 100644 --- a/build/org.eclipse.cdt.cmake.core/src/org/eclipse/cdt/cmake/core/internal/CMakeConsoleWrapper.java +++ b/build/org.eclipse.cdt.cmake.core/src/org/eclipse/cdt/cmake/core/internal/CMakeConsoleWrapper.java @@ -15,33 +15,31 @@ import java.util.Objects; import org.eclipse.cdt.core.ConsoleOutputStream; import org.eclipse.cdt.core.resources.IConsole; -import org.eclipse.core.resources.IContainer; import org.eclipse.core.resources.IProject; import org.eclipse.core.runtime.CoreException; -/** +/** Intercepts output to a console and forwards its error stream to a stream that does error parsing for processing. + * @author Martin Weber * */ class CMakeConsoleWrapper implements IConsole { private final IConsole delegate; - private final ConsoleOutputStream out; private final ConsoleOutputStream err; /** - * @param srcFolder - * the source root of the project being built * @param delegate * the console to wrap + * @param parsingConsoleOutputStream + * the replacement of the error output stream of the wrapped console that parses for errors */ - public CMakeConsoleWrapper(IContainer srcFolder, IConsole delegate) throws CoreException { - Objects.requireNonNull(srcFolder); + public CMakeConsoleWrapper(IConsole delegate, ConsoleOutputStream parsingConsoleErrOutputStream) + throws CoreException { this.delegate = Objects.requireNonNull(delegate); // NOTE: we need one parser for each stream, since the output streams are not synchronized // when the process is started via o.e.c.core.CommandLauncher, causing loss of // the internal parser state - out = new CMakeErrorParser(srcFolder, delegate.getOutputStream()); - err = new CMakeErrorParser(srcFolder, delegate.getErrorStream()); + err = Objects.requireNonNull(parsingConsoleErrOutputStream); } @Override @@ -56,7 +54,7 @@ class CMakeConsoleWrapper implements IConsole { @Override public ConsoleOutputStream getOutputStream() throws CoreException { - return out; + return delegate.getOutputStream(); } @Override diff --git a/build/org.eclipse.cdt.cmake.core/src/org/eclipse/cdt/cmake/core/internal/CMakeErrorParser.java b/build/org.eclipse.cdt.cmake.core/src/org/eclipse/cdt/cmake/core/internal/CMakeErrorParser.java index 2f144e0823e..b4f8e935220 100644 --- a/build/org.eclipse.cdt.cmake.core/src/org/eclipse/cdt/cmake/core/internal/CMakeErrorParser.java +++ b/build/org.eclipse.cdt.cmake.core/src/org/eclipse/cdt/cmake/core/internal/CMakeErrorParser.java @@ -8,32 +8,136 @@ *******************************************************************************/ package org.eclipse.cdt.cmake.core.internal; -import java.io.IOException; -import java.io.OutputStream; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Iterator; +import java.util.List; +import java.util.Map; import java.util.Objects; import java.util.regex.Matcher; import java.util.regex.Pattern; -import org.eclipse.cdt.core.ConsoleOutputStream; -import org.eclipse.core.resources.IContainer; import org.eclipse.core.resources.IMarker; import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IPath; import org.eclipse.core.runtime.IStatus; -import org.eclipse.core.runtime.Path; import org.eclipse.core.runtime.Status; -/** Parses the output of cmake and reports errors and warnings as problem markers. +/** Parses the error output stream of cmake and reports errors and warnings as problem markers.

+ * As long as cmake keeps printing the output we are interested in to the standard error stream, + * attaching an instance of this class to cmake's standard output + * stream will have no positive effect. + *

+ *

+ * NOTE: There is no way properly handle output emitted by the cmake + * {@code MESSAGE(NOTICE "text")} or {@code MESSAGE("text")} command + * since that output is arbitrary text w/o any indication of the message type + * nor filename/line-number information. + *

* * @author Martin Weber */ -/* package */ class CMakeErrorParser extends ConsoleOutputStream { +/* package */ class CMakeErrorParser implements AutoCloseable { - public static final String CMAKE_PROBLEM_MARKER_ID = Activator.getId() + ".cmakeproblem"; //$NON-NLS-1$ + /** matches the Start of a message, also ending the previous message */ + private static final Pattern PTN_MSG_START; + + private static Map handlersByMessageStart = new HashMap<>(); + + /** the handler for the message we are currently gathering output for */ + private MessageHandler currentHandler = new MhNull(); + private final ICMakeExecutionMarkerFactory markerFactory; + private final StringBuilder buffer; + + static { + // setup regex to match the start of a message... + StringBuilder ptnbuf = new StringBuilder("^"); //$NON-NLS-1$ + + List markerHandlers = Arrays.asList(new MhStartLog(), new MhStatus(), new MhDeprError(), + new MhDeprWarning(), new MhErrorDev(), new MhError(), new MhInternalError(), new MhWarningDev(), + new MhWarning()); + for (Iterator it = markerHandlers.iterator(); it.hasNext();) { + MessageHandler h = it.next(); + handlersByMessageStart.put(h.getMessageStart(), h); + ptnbuf.append(Pattern.quote(h.getMessageStart())); + if (it.hasNext()) { + ptnbuf.append('|'); + } + } + + PTN_MSG_START = Pattern.compile(ptnbuf.toString()); + } + + //////////////////////////////////////////////////////////////////// + /** + * @param markerFactory + * the object responsible for creating problem marker objects for the project being built + */ + public CMakeErrorParser(ICMakeExecutionMarkerFactory markerFactory) { + this.markerFactory = Objects.requireNonNull(markerFactory); + buffer = new StringBuilder(512); + } + + /** Adds text from the output stream to parse. + * + * @param input + * text from the output stream to parse + */ + public void addInput(CharSequence input) { + buffer.append(input); + processBuffer(); + } + + /** Closes this parser. Any remaining buffered input will be parsed. + */ + @Override + public void close() { + // process remaining bytes + processMessage(currentHandler, buffer.toString().trim()); + buffer.delete(0, buffer.length()); + } + + private void processBuffer() { + Matcher matcher = PTN_MSG_START.matcher(""); //$NON-NLS-1$ + while (true) { + matcher.reset(buffer.subSequence(currentHandler.getMessageStart().length(), buffer.length())); + if (matcher.find()) { + String handlerId = matcher.group(); + MessageHandler newHandler = handlersByMessageStart.get(handlerId); + int end = matcher.start() + currentHandler.getMessageStart().length(); + String message = buffer.substring(0, end); + processMessage(currentHandler, message.trim()); + currentHandler = newHandler; + buffer.delete(0, end); // delete processed message + continue; // proceed with follow-up messages + } else { + // NO message arrived in buffer + return; // wait for more input + } + } + } /** - * Taken from cmMessenger.cxx#printMessagePreamble: - * + * @param handler + * message handler + * @param fullMessage + * the complete message, including the string the message starts with + */ + private void processMessage(MessageHandler handler, String fullMessage) { + try { + handler.processMessage(markerFactory, fullMessage); + } catch (CoreException e) { + Activator.getPlugin().getLog() + .log(new Status(IStatus.WARNING, Activator.getId(), "CMake output error parsing failed", e)); //$NON-NLS-1$ + } + } + + //////////////////////////////////////////////////////////////////// + // inner classes + //////////////////////////////////////////////////////////////////// + /** + * Message handler base class. Extracts the source-file name and line-number of errors from the output stream.

+ * Message matching regexes are taken from cmake code in + * cmMessenger.cxx#printMessagePreamble: *

 	if (t == cmake::FATAL_ERROR) {
 	msg << "CMake Error";
@@ -54,202 +158,36 @@ import org.eclipse.core.runtime.Status;
 	 * 
* *
- * NOTE: We currently not handle output emitted by the cmake MESSAGE() command since the msg format - * is unknown (or needs more investigation). - * - */ - // message start markers... - private static final String START_DERROR = "CMake Deprecation Error"; //$NON-NLS-1$ - private static final String START_DWARNING = "CMake Deprecation Warning"; //$NON-NLS-1$ - private static final String START_ERROR = "CMake Error"; //$NON-NLS-1$ - private static final String START_ERROR_DEV = "CMake Error (dev)"; //$NON-NLS-1$ - private static final String START_IERROR = "CMake Internal Error (please report a bug)"; //$NON-NLS-1$ - private static final String START_LOG = "CMake Debug Log"; //$NON-NLS-1$ - private static final String START_WARNING = "CMake Warning"; //$NON-NLS-1$ - private static final String START_WARNING_DEV = "CMake Warning (dev)"; //$NON-NLS-1$ - private static final String START_STATUS = "--"; //$NON-NLS-1$ - /** to terminate on the output of 'message("message test")' */ - private static final String START_MSG_SIMPLE = "\\R\\R"; //$NON-NLS-1$ - /** Start of a new error message, also ending the previous message. */ - private static final Pattern PTN_MSG_START; - - /** Name of the named-capturing group that holds a file name. */ - private static final String GP_FILE = "File"; //$NON-NLS-1$ - /** Name of the named-capturing group that holds a line number. */ - private static final String GP_LINE = "Lineno"; //$NON-NLS-1$ - - static { - String ptn = "^" + String.join("|", START_DERROR, START_DWARNING, Pattern.quote(START_ERROR_DEV), START_ERROR, //$NON-NLS-1$ //$NON-NLS-2$ - Pattern.quote(START_IERROR), START_LOG, Pattern.quote(START_WARNING_DEV), START_WARNING, START_STATUS, - START_MSG_SIMPLE); - PTN_MSG_START = Pattern.compile(ptn); - } - - //////////////////////////////////////////////////////////////////// - // the source root of the project being built - private final IContainer srcPath; - private final OutputStream os; - - private final StringBuilder buffer; - - /** false as long as the buffer contains leading junk in front of a start-of-message */ - private boolean somSeen; - - /** - * @param srcFolder - * the source root of the project being built - * @param outputStream - * the OutputStream to write to or {@code null} - */ - public CMakeErrorParser(IContainer srcFolder, OutputStream outputStream) { - this.srcPath = Objects.requireNonNull(srcFolder); - this.os = outputStream; - buffer = new StringBuilder(512); - } - - private void processBuffer(boolean isEOF) { - Matcher matcher = PTN_MSG_START.matcher(""); //$NON-NLS-1$ - for (;;) { - matcher.reset(buffer); - if (matcher.find()) { - // a new Start Of Message is present in the buffer - if (!somSeen) { - // this is the first Start Of Message seen in the output, discard leading junk - buffer.delete(0, matcher.start()); - somSeen = true; - return; - } - String classification = matcher.group(); - int start = matcher.end(); - // get start of next message - if (matcher.find() || isEOF) { - int end = isEOF ? buffer.length() : matcher.start(); - String fullMessage = buffer.substring(0, end); - // System.err.println("-###" + fullMessage.trim() + "\n###-"); - String content = buffer.substring(start, end); - // buffer contains a complete message - processMessage(classification, content, fullMessage); - buffer.delete(0, end); - } else { - break; - } - } else { - // nothing found in buffer - return; - } - } - } - - /** - * @param classification - * message classification string - * @param content - * message content, which is parsed according to the classification - * @param fullMessage - * the complete message, including the classification - */ - private void processMessage(String classification, String content, String fullMessage) { - MarkerCreator creator; - switch (classification) { - case START_DERROR: - creator = new McDeprError(srcPath); - break; - case START_DWARNING: - creator = new McDeprWarning(srcPath); - break; - case START_ERROR: - creator = new McError(srcPath); - break; - case START_ERROR_DEV: - creator = new McErrorDev(srcPath); - break; - case START_IERROR: - creator = new McInternalError(srcPath); - break; - case START_WARNING: - creator = new McWarning(srcPath); - break; - case START_WARNING_DEV: - creator = new McWarningDev(srcPath); - break; - default: - return; // ignore message - } - - try { - creator.createMarker(fullMessage, content); - } catch (CoreException e) { - Activator.getPlugin().getLog() - .log(new Status(IStatus.WARNING, Activator.getId(), "CMake output error parsing failed", e)); //$NON-NLS-1$ - } - } - - @Override - public void write(int c) throws IOException { - if (os != null) - os.write(c); - buffer.append(new String(new byte[] { (byte) c })); - processBuffer(false); - } - - @Override - public void write(byte[] b, int off, int len) throws IOException { - if (os != null) - os.write(b, off, len); - buffer.append(new String(b, off, len)); - processBuffer(false); - } - - @Override - public void flush() throws IOException { - if (os != null) - os.flush(); - } - - @Override - public void close() throws IOException { - if (os != null) - os.close(); - // process remaining bytes - processBuffer(true); - } - - //////////////////////////////////////////////////////////////////// - // inner classes - //////////////////////////////////////////////////////////////////// - /** - * Marker creator base class. Extracts the source-file name and line-number of errors from the output stream. + * NOTE: We cannot properly handle output emitted by the cmake MESSAGE(NOTICE ...) command since + * the output is arbitrary text w/o any indication of the message type nor filename/line-number information. + *

* * @author Martin Weber */ - private static abstract class MarkerCreator { + private static abstract class MessageHandler { /** patterns used to extract file-name and line number information */ private static final Pattern[] PTN_LOCATION; + /** Name of the named-capturing group that holds a file name. */ + private static final String GRP_FILE = "File"; //$NON-NLS-1$ + /** Name of the named-capturing group that holds a line number. */ + private static final String GRP_LINE = "Lineno"; //$NON-NLS-1$ + static { PTN_LOCATION = new Pattern[] { - Pattern.compile("(?m)^ at (?<" + GP_FILE + ">.+):(?<" + GP_LINE + ">\\d+).*$"), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ - Pattern.compile("(?s)^: Error in cmake code at.(?<" + GP_FILE + ">.+):(?<" + GP_LINE + ">\\d+).*$"), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ - Pattern.compile("(?m)^ in (?<" + GP_FILE + ">.+):(?<" + GP_LINE + ">\\d+).*$"), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ + Pattern.compile("(?m)^ at (?<" + GRP_FILE + ">.+):(?<" + GRP_LINE + ">\\d+).*$"), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ + Pattern.compile( + "(?s)^: Error in cmake code at.(?<" + GRP_FILE + ">.+):(?<" + GRP_LINE + ">\\d+).*$"), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ + Pattern.compile("(?m)^ in (?<" + GRP_FILE + ">.+):(?<" + GRP_LINE + ">\\d+).*$"), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ + Pattern.compile("(?m)^ in (?<" + GRP_FILE + ">.+?):.*$"), //$NON-NLS-1$ //$NON-NLS-2$ Pattern.compile("(?m)^:\\s.+$"), }; //$NON-NLS-1$ } - // the source root of the project being built - protected final IContainer srcPath; - /** - * @param srcPath - * the source root of the project being built + * Gets the string the error message is supposed to start with. */ - public MarkerCreator(IContainer srcPath) { - this.srcPath = srcPath; - } - - /** - * Gets the message classification that this object handles. - */ - abstract String getClassification(); + abstract String getMessageStart(); /** * @return the severity of the problem, see {@link IMarker} for acceptable severity values @@ -259,95 +197,115 @@ import org.eclipse.core.runtime.Status; /** * Creates the {@link IMarker marker object} that reflects the message. * + * @param markerFactory + * the object responsible for creating problem marker objects for the project being built * @param fullMessage - * the complete message, including the classification - * @param content - * the message, without the classification + * the complete message, including the string the message starts with * @throws CoreException */ - public void createMarker(String fullMessage, String content) throws CoreException { + public void processMessage(ICMakeExecutionMarkerFactory markerFactory, String fullMessage) + throws CoreException { + String content = fullMessage.substring(getMessageStart().length()); + // mandatory attributes for the marker + Map attributes = new HashMap<>(3); + attributes.put(IMarker.LOCATION, getClass().getSimpleName()); + + // filename is normally project source root relative but may be absolute FS path + String filename = null; for (Pattern ptn : PTN_LOCATION) { final Matcher matcher = ptn.matcher(content); + // try to extract filename and/or line number from message if (matcher.find()) { - // normally project source root relative but may be absolute FS path - String filename = null; try { - filename = matcher.group(GP_FILE); + filename = matcher.group(GRP_FILE); } catch (IllegalArgumentException expected) { + // no file name in message } - IMarker marker = createBasicMarker(filename, getSeverity(), fullMessage.trim()); + // attach additional info to marker... try { - String lineno = matcher.group(GP_LINE); + String lineno = matcher.group(GRP_LINE); Integer lineNumber = Integer.parseInt(lineno); - marker.setAttribute(IMarker.LINE_NUMBER, lineNumber); + attributes.put(IMarker.LINE_NUMBER, lineNumber); } catch (IllegalArgumentException expected) { + // no line number in message } break; } } + markerFactory.createMarker(fullMessage, getSeverity(), filename, attributes); } - - /** - * Creates a basic problem marker which should be enhanced with more problem information (e.g. severity, file name, - * line number exact message). - * - * @param fileName - * the file where the problem occurred, relative to the source-root or null to denote just the - * current project being build - * @param severity - * the severity of the problem, see {@link IMarker} for acceptable severity values - * @param fullMessage - * the complete message, including the classification - * @throws CoreException - */ - protected final IMarker createBasicMarker(String fileName, int severity, String fullMessage) - throws CoreException { - IMarker marker; - if (fileName == null) { - marker = srcPath.createMarker(CMAKE_PROBLEM_MARKER_ID); - } else { - // NOTE normally, cmake reports the file name relative to source root. - // BUT some messages give an absolute file-system path which is problematic when the build - // runs in a docker container - // So we do some heuristics here... - IPath path = new Path(fileName); - try { - // normal case: file is rel. to source root - marker = srcPath.getFile(path).createMarker(CMAKE_PROBLEM_MARKER_ID); - } catch (CoreException ign) { - // try abs. path - IPath srcLocation = srcPath.getLocation(); - if (srcLocation.isPrefixOf(path)) { - // can resolve the cmake file - int segmentsToRemove = srcLocation.segmentCount(); - path = path.removeFirstSegments(segmentsToRemove); - marker = srcPath.getFile(path).createMarker(CMAKE_PROBLEM_MARKER_ID); - } else { - // possibly a build in docker container. we would reach this if the source-dir path inside - // the container is NOT the same as the one in the host/IDE. - // for now, just add the markers to the source dir and lets users file issues:-) - marker = srcPath.createMarker(CMAKE_PROBLEM_MARKER_ID); - Activator.getPlugin().getLog().log(new Status(IStatus.INFO, Activator.getId(), - String.format(Messages.CMakeErrorParser_NotAWorkspaceResource, fileName))); - // Extra case: IDE runs on Linux, build runs on Windows, or vice versa... - } - } - } - marker.setAttribute(IMarker.MESSAGE, fullMessage); - marker.setAttribute(IMarker.SEVERITY, severity); - marker.setAttribute(IMarker.LOCATION, CMakeErrorParser.class.getName()); - return marker; - } - } // MarkerCreator + } // MessageHandler //////////////////////////////////////////////////////////////////// - private static class McDeprError extends MarkerCreator { - public McDeprError(IContainer srcPath) { - super(srcPath); + private static class MhNull extends MessageHandler { + + @Override + public void processMessage(ICMakeExecutionMarkerFactory markerFactory, String fullMessage) + throws CoreException { } @Override - String getClassification() { + String getMessageStart() { + return ""; //$NON-NLS-1$ + } + + @Override + int getSeverity() { + throw new UnsupportedOperationException(); + } + + @Override + public String toString() { + return super.toString() + ": " + getMessageStart(); //$NON-NLS-1$ + } + } + + //////////////////////////////////////////////////////////////////// + private static class MhStartLog extends MhNull { + private static final String START_LOG = "CMake Debug Log"; //$NON-NLS-1$ + + @Override + String getMessageStart() { + return START_LOG; + } + + @Override + int getSeverity() { + throw new UnsupportedOperationException(); + } + + @Override + public String toString() { + return super.toString() + ": " + getMessageStart(); //$NON-NLS-1$ + } + } + + //////////////////////////////////////////////////////////////////// + private static class MhStatus extends MhNull { + private static final String START_STATUS = "-- "; //$NON-NLS-1$ + + @Override + String getMessageStart() { + return START_STATUS; + } + + @Override + int getSeverity() { + throw new UnsupportedOperationException(); + } + + @Override + public String toString() { + return super.toString() + ": " + getMessageStart(); //$NON-NLS-1$ + } + } + + //////////////////////////////////////////////////////////////////// + private static class MhDeprError extends MessageHandler { + private static final String START_DERROR = "CMake Deprecation Error"; //$NON-NLS-1$ + + @Override + String getMessageStart() { return START_DERROR; } @@ -355,15 +313,18 @@ import org.eclipse.core.runtime.Status; int getSeverity() { return IMarker.SEVERITY_ERROR; } - } - - private static class McDeprWarning extends MarkerCreator { - public McDeprWarning(IContainer srcPath) { - super(srcPath); - } @Override - String getClassification() { + public String toString() { + return super.toString() + ": " + getMessageStart(); //$NON-NLS-1$ + } + } + + private static class MhDeprWarning extends MessageHandler { + private static final String START_DWARNING = "CMake Deprecation Warning"; //$NON-NLS-1$ + + @Override + String getMessageStart() { return START_DWARNING; } @@ -371,15 +332,18 @@ import org.eclipse.core.runtime.Status; int getSeverity() { return IMarker.SEVERITY_WARNING; } - } - - private static class McError extends MarkerCreator { - public McError(IContainer srcPath) { - super(srcPath); - } @Override - String getClassification() { + public String toString() { + return super.toString() + ": " + getMessageStart(); //$NON-NLS-1$ + } + } + + private static class MhError extends MessageHandler { + private static final String START_ERROR = "CMake Error"; //$NON-NLS-1$ + + @Override + String getMessageStart() { return START_ERROR; } @@ -387,15 +351,18 @@ import org.eclipse.core.runtime.Status; int getSeverity() { return IMarker.SEVERITY_ERROR; } - } - - private static class McErrorDev extends MarkerCreator { - public McErrorDev(IContainer srcPath) { - super(srcPath); - } @Override - String getClassification() { + public String toString() { + return super.toString() + ": " + getMessageStart(); //$NON-NLS-1$ + } + } + + private static class MhErrorDev extends MessageHandler { + private static final String START_ERROR_DEV = "CMake Error (dev)"; //$NON-NLS-1$ + + @Override + String getMessageStart() { return START_ERROR_DEV; } @@ -403,15 +370,18 @@ import org.eclipse.core.runtime.Status; int getSeverity() { return IMarker.SEVERITY_ERROR; } - } - - private static class McInternalError extends MarkerCreator { - public McInternalError(IContainer srcPath) { - super(srcPath); - } @Override - String getClassification() { + public String toString() { + return super.toString() + ": " + getMessageStart(); //$NON-NLS-1$ + } + } + + private static class MhInternalError extends MessageHandler { + private static final String START_IERROR = "CMake Internal Error (please report a bug)"; //$NON-NLS-1$ + + @Override + String getMessageStart() { return START_IERROR; } @@ -419,15 +389,18 @@ import org.eclipse.core.runtime.Status; int getSeverity() { return IMarker.SEVERITY_ERROR; } - } - - private static class McWarning extends MarkerCreator { - public McWarning(IContainer srcPath) { - super(srcPath); - } @Override - String getClassification() { + public String toString() { + return super.toString() + ": " + getMessageStart(); //$NON-NLS-1$ + } + } + + private static class MhWarning extends MessageHandler { + private static final String START_WARNING = "CMake Warning"; //$NON-NLS-1$ + + @Override + String getMessageStart() { return START_WARNING; } @@ -435,15 +408,18 @@ import org.eclipse.core.runtime.Status; int getSeverity() { return IMarker.SEVERITY_WARNING; } - } - - private static class McWarningDev extends MarkerCreator { - public McWarningDev(IContainer srcPath) { - super(srcPath); - } @Override - String getClassification() { + public String toString() { + return super.toString() + ": " + getMessageStart(); //$NON-NLS-1$ + } + } + + private static class MhWarningDev extends MessageHandler { + private static final String START_WARNING_DEV = "CMake Warning (dev)"; //$NON-NLS-1$ + + @Override + String getMessageStart() { return START_WARNING_DEV; } @@ -451,5 +427,10 @@ import org.eclipse.core.runtime.Status; int getSeverity() { return IMarker.SEVERITY_WARNING; } + + @Override + public String toString() { + return super.toString() + ": " + getMessageStart(); //$NON-NLS-1$ + } } } diff --git a/build/org.eclipse.cdt.cmake.core/src/org/eclipse/cdt/cmake/core/internal/CMakeExecutionMarkerFactory.java b/build/org.eclipse.cdt.cmake.core/src/org/eclipse/cdt/cmake/core/internal/CMakeExecutionMarkerFactory.java new file mode 100644 index 00000000000..dd17e02ffc5 --- /dev/null +++ b/build/org.eclipse.cdt.cmake.core/src/org/eclipse/cdt/cmake/core/internal/CMakeExecutionMarkerFactory.java @@ -0,0 +1,85 @@ +/******************************************************************************* + * Copyright (c) 2020 Martin Weber. + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 + * which accompanies this distribution, and is available at + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 + *******************************************************************************/ + +package org.eclipse.cdt.cmake.core.internal; + +import java.util.Map; +import java.util.Map.Entry; +import java.util.Objects; + +import org.eclipse.core.resources.IContainer; +import org.eclipse.core.resources.IMarker; +import org.eclipse.core.runtime.CoreException; +import org.eclipse.core.runtime.IPath; +import org.eclipse.core.runtime.IStatus; +import org.eclipse.core.runtime.Path; +import org.eclipse.core.runtime.Status; + +/** + * Default implementation of {@code ICMakeExecutionMarkerFactory}. + * + * @author Martin Weber + */ +public class CMakeExecutionMarkerFactory implements ICMakeExecutionMarkerFactory { + + private final IContainer srcFolder; + + /** + * @param srcFolder + * source-folder ofthe project currently being build. + * + */ + public CMakeExecutionMarkerFactory(IContainer srcFolder) { + this.srcFolder = Objects.requireNonNull(srcFolder); + } + + @Override + public final void createMarker(String message, int severity, String filePath, + Map mandatoryAttributes) throws CoreException { + IMarker marker; + if (filePath == null) { + marker = srcFolder.createMarker(CMAKE_PROBLEM_MARKER_ID); + } else { + // NOTE normally, cmake reports the file name relative to source root. + // BUT some messages give an absolute file-system path which is problematic when the build + // runs in a docker container + // So we do some heuristics here... + IPath path = new Path(filePath); + try { + // normal case: file is rel. to source root + marker = srcFolder.getFile(path).createMarker(CMAKE_PROBLEM_MARKER_ID); + } catch (CoreException ign) { + // try abs. path + IPath srcLocation = srcFolder.getLocation(); + if (srcLocation.isPrefixOf(path)) { + // can resolve the cmake file + int segmentsToRemove = srcLocation.segmentCount(); + path = path.removeFirstSegments(segmentsToRemove); + marker = srcFolder.getFile(path).createMarker(CMAKE_PROBLEM_MARKER_ID); + } else { + // possibly a build in docker container. we would reach this if the source-dir path inside + // the container is NOT the same as the one in the host/IDE. + // for now, just add the markers to the source dir and lets users file issues:-) + marker = srcFolder.createMarker(CMAKE_PROBLEM_MARKER_ID); + Activator.getPlugin().getLog().log(new Status(IStatus.INFO, Activator.getId(), + String.format(Messages.CMakeErrorParser_NotAWorkspaceResource, filePath))); + // Extra case: IDE runs on Linux, build runs on Windows, or vice versa... + } + } + } + marker.setAttribute(IMarker.MESSAGE, message); + marker.setAttribute(IMarker.SEVERITY, severity); + for (Entry elem : mandatoryAttributes.entrySet()) { + marker.setAttribute(elem.getKey(), elem.getValue()); + } + } + +} diff --git a/build/org.eclipse.cdt.cmake.core/src/org/eclipse/cdt/cmake/core/internal/ICMakeExecutionMarkerFactory.java b/build/org.eclipse.cdt.cmake.core/src/org/eclipse/cdt/cmake/core/internal/ICMakeExecutionMarkerFactory.java new file mode 100644 index 00000000000..b6283f2c517 --- /dev/null +++ b/build/org.eclipse.cdt.cmake.core/src/org/eclipse/cdt/cmake/core/internal/ICMakeExecutionMarkerFactory.java @@ -0,0 +1,56 @@ +/******************************************************************************* + * Copyright (c) 2020 Martin Weber. + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 + * which accompanies this distribution, and is available at + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 + *******************************************************************************/ + +package org.eclipse.cdt.cmake.core.internal; + +import java.util.Map; + +import org.eclipse.core.resources.IMarker; +import org.eclipse.core.resources.IResource; +import org.eclipse.core.runtime.CoreException; + +/** Responsible for creating problem marker objects related to errors in cmake's output for the project currently being + * build. + * + * @author Martin Weber + */ +@FunctionalInterface +interface ICMakeExecutionMarkerFactory { + + /** ID for error markers related to execution of the cmake tool. + * @see IResource#createMarker(String) + */ + String CMAKE_PROBLEM_MARKER_ID = Activator.getId() + ".cmakeproblem"; //$NON-NLS-1$ + + /** + * Creates a problem marker and/or text marker object related to errors in cmake's output. + * + * @param message + * the complete error message, including the string the message starts with + * @param severity + * the severity of the problem, see {@link IMarker} for acceptable severity values + * @param filePath + * the name of the file where the problem occurred, extracted from the error message. + * This is a String denoting a location in the file system.
+ * If null, no file information is present in the error message; the marker should be created + * then for the project being build.
+ * If it is relative, it is relative to the source-root of the project being build (and thus can be + * converted to an {@code IResource}).
+ * If absolute, the file might not be a workspace resource (e.g. one of cmake's module files).
+ * @param mandatoryAttributes + * mandatory attributes to add to the marker. Attribute keys must be one of those defined in {@link IMarker} + * + * @throws CoreException + */ + // TODO pass in the extra attributes here then return void + void createMarker(String message, int severity, String filePath, Map mandatoryAttributes) + throws CoreException; +} \ No newline at end of file diff --git a/build/org.eclipse.cdt.cmake.core/src/org/eclipse/cdt/cmake/core/internal/ParsingConsoleOutputStream.java b/build/org.eclipse.cdt.cmake.core/src/org/eclipse/cdt/cmake/core/internal/ParsingConsoleOutputStream.java new file mode 100644 index 00000000000..8a1ef1ad25c --- /dev/null +++ b/build/org.eclipse.cdt.cmake.core/src/org/eclipse/cdt/cmake/core/internal/ParsingConsoleOutputStream.java @@ -0,0 +1,68 @@ +/******************************************************************************* + * Copyright (c) 2020 Martin Weber. + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 + * which accompanies this distribution, and is available at + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 + *******************************************************************************/ + +package org.eclipse.cdt.cmake.core.internal; + +import java.io.IOException; +import java.util.Objects; + +import org.eclipse.cdt.core.ConsoleOutputStream; + +/** + * Intercepts output to a console output stream and forwards it to a CMakeErrorParser for processing. + * + * @author Martin Weber + */ +class ParsingConsoleOutputStream extends ConsoleOutputStream { + + private final ConsoleOutputStream os; + private final CMakeErrorParser parser; + + /** + * @param outputStream + * the OutputStream to write to + * @param cmakeErrorParser + * the CMakeErrorParser for processing the output + */ + public ParsingConsoleOutputStream(ConsoleOutputStream outputStream, CMakeErrorParser cmakeErrorParser) { + this.os = Objects.requireNonNull(outputStream); + this.parser = Objects.requireNonNull(cmakeErrorParser); + } + + @Override + public void write(int c) throws IOException { + write(new byte[] { (byte) c }, 0, 1); + } + + @Override + public void write(byte[] b, int off, int len) throws IOException { + os.write(b, off, len); + parser.addInput(new String(b, off, len)); + } + + // interface ConsoleOutputStream + @Override + public synchronized void write(String msg) throws IOException { + os.write(msg); + parser.addInput(msg); + } + + @Override + public void flush() throws IOException { + os.flush(); + } + + @Override + public void close() throws IOException { + os.close(); + parser.close(); + } +} diff --git a/cmake/aggregator/pom.xml b/cmake/aggregator/pom.xml index e021064c4dc..816df907c48 100644 --- a/cmake/aggregator/pom.xml +++ b/cmake/aggregator/pom.xml @@ -6,61 +6,18 @@ org.eclipse.cdt - cdt-parent + cmake-parent 10.0.0-SNAPSHOT - ../.. cmake-aggregator - 1.0.0 pom ../../releng/org.eclipse.cdt.target - ../org.eclipse.cdt.cmake.is.core.doc - ../org.eclipse.cdt.cmake.is.core - ../org.eclipse.cdt.cmake.is.core.tests - ../org.eclipse.cdt.cmake.is.core.ui - ../org.eclipse.cdt.cmake.is.arm - ../org.eclipse.cdt.cmake.is.arm.tests - ../org.eclipse.cdt.cmake.is.hpenonstop - ../org.eclipse.cdt.cmake.is.hpenonstop.tests - ../org.eclipse.cdt.cmake.is.intel - ../org.eclipse.cdt.cmake.is.nvidia - ../org.eclipse.cdt.cmake.is.nvidia.tests - ../org.eclipse.cdt.cmake.is.microsoft - ../org.eclipse.cdt.cmake.is.microsoft.tests + .. + + ../../build/org.eclipse.cdt.cmake.core - - - - - - org.apache.maven.plugins - maven-install-plugin - 2.3.1 - - - - default-install - - - - - - org.apache.maven.plugins - maven-deploy-plugin - 2.5 - - - - default-deploy - - - - - - - diff --git a/cmake/org.eclipse.cdt.cmake.core.tests/.classpath b/cmake/org.eclipse.cdt.cmake.core.tests/.classpath new file mode 100644 index 00000000000..311fc18f606 --- /dev/null +++ b/cmake/org.eclipse.cdt.cmake.core.tests/.classpath @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + + + diff --git a/cmake/org.eclipse.cdt.cmake.core.tests/.project b/cmake/org.eclipse.cdt.cmake.core.tests/.project new file mode 100644 index 00000000000..cbd7d2859b7 --- /dev/null +++ b/cmake/org.eclipse.cdt.cmake.core.tests/.project @@ -0,0 +1,34 @@ + + + org.eclipse.cdt.cmake.core.tests + + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.eclipse.pde.ManifestBuilder + + + + + org.eclipse.pde.SchemaBuilder + + + + + org.eclipse.m2e.core.maven2Builder + + + + + + org.eclipse.m2e.core.maven2Nature + org.eclipse.pde.PluginNature + org.eclipse.jdt.core.javanature + + diff --git a/cmake/org.eclipse.cdt.cmake.core.tests/.settings/org.eclipse.core.resources.prefs b/cmake/org.eclipse.cdt.cmake.core.tests/.settings/org.eclipse.core.resources.prefs new file mode 100644 index 00000000000..99f26c0203a --- /dev/null +++ b/cmake/org.eclipse.cdt.cmake.core.tests/.settings/org.eclipse.core.resources.prefs @@ -0,0 +1,2 @@ +eclipse.preferences.version=1 +encoding/=UTF-8 diff --git a/cmake/org.eclipse.cdt.cmake.core.tests/.settings/org.eclipse.jdt.core.prefs b/cmake/org.eclipse.cdt.cmake.core.tests/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 00000000000..5b1c443114d --- /dev/null +++ b/cmake/org.eclipse.cdt.cmake.core.tests/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,486 @@ +eclipse.preferences.version=1 +org.eclipse.jdt.core.builder.cleanOutputFolder=clean +org.eclipse.jdt.core.builder.duplicateResourceTask=warning +org.eclipse.jdt.core.builder.invalidClasspath=abort +org.eclipse.jdt.core.builder.recreateModifiedClassFileInOutputFolder=ignore +org.eclipse.jdt.core.builder.resourceCopyExclusionFilter=*.launch, *.xtend +org.eclipse.jdt.core.circularClasspath=error +org.eclipse.jdt.core.classpath.exclusionPatterns=enabled +org.eclipse.jdt.core.classpath.mainOnlyProjectHasTestOnlyDependency=error +org.eclipse.jdt.core.classpath.multipleOutputLocations=enabled +org.eclipse.jdt.core.classpath.outputOverlappingAnotherSource=error +org.eclipse.jdt.core.codeComplete.argumentPrefixes= +org.eclipse.jdt.core.codeComplete.argumentSuffixes= +org.eclipse.jdt.core.codeComplete.fieldPrefixes= +org.eclipse.jdt.core.codeComplete.fieldSuffixes= +org.eclipse.jdt.core.codeComplete.localPrefixes= +org.eclipse.jdt.core.codeComplete.localSuffixes= +org.eclipse.jdt.core.codeComplete.staticFieldPrefixes= +org.eclipse.jdt.core.codeComplete.staticFieldSuffixes= +org.eclipse.jdt.core.codeComplete.staticFinalFieldPrefixes= +org.eclipse.jdt.core.codeComplete.staticFinalFieldSuffixes= +org.eclipse.jdt.core.compiler.annotation.inheritNullAnnotations=disabled +org.eclipse.jdt.core.compiler.annotation.missingNonNullByDefaultAnnotation=ignore +org.eclipse.jdt.core.compiler.annotation.nonnull=org.eclipse.jdt.annotation.NonNull +org.eclipse.jdt.core.compiler.annotation.nonnull.secondary= +org.eclipse.jdt.core.compiler.annotation.nonnullbydefault=org.eclipse.jdt.annotation.NonNullByDefault +org.eclipse.jdt.core.compiler.annotation.nonnullbydefault.secondary= +org.eclipse.jdt.core.compiler.annotation.nullable=org.eclipse.jdt.annotation.Nullable +org.eclipse.jdt.core.compiler.annotation.nullable.secondary= +org.eclipse.jdt.core.compiler.annotation.nullanalysis=disabled +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.methodParameters=generate +org.eclipse.jdt.core.compiler.codegen.targetPlatform=11 +org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve +org.eclipse.jdt.core.compiler.compliance=11 +org.eclipse.jdt.core.compiler.debug.lineNumber=generate +org.eclipse.jdt.core.compiler.debug.localVariable=generate +org.eclipse.jdt.core.compiler.debug.sourceFile=generate +org.eclipse.jdt.core.compiler.doc.comment.support=enabled +org.eclipse.jdt.core.compiler.maxProblemPerUnit=100 +org.eclipse.jdt.core.compiler.problem.APILeak=warning +org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.eclipse.jdt.core.compiler.problem.autoboxing=ignore +org.eclipse.jdt.core.compiler.problem.comparingIdentical=warning +org.eclipse.jdt.core.compiler.problem.deadCode=warning +org.eclipse.jdt.core.compiler.problem.deprecation=ignore +org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled +org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled +org.eclipse.jdt.core.compiler.problem.discouragedReference=ignore +org.eclipse.jdt.core.compiler.problem.emptyStatement=ignore +org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.problem.explicitlyClosedAutoCloseable=ignore +org.eclipse.jdt.core.compiler.problem.fallthroughCase=warning +org.eclipse.jdt.core.compiler.problem.fatalOptionalError=enabled +org.eclipse.jdt.core.compiler.problem.fieldHiding=ignore +org.eclipse.jdt.core.compiler.problem.finalParameterBound=ignore +org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning +org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning +org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning +org.eclipse.jdt.core.compiler.problem.includeNullInfoFromAsserts=disabled +org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning +org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=ignore +org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=ignore +org.eclipse.jdt.core.compiler.problem.invalidJavadoc=ignore +org.eclipse.jdt.core.compiler.problem.invalidJavadocTags=enabled +org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsDeprecatedRef=disabled +org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsNotVisibleRef=enabled +org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsVisibility=protected +org.eclipse.jdt.core.compiler.problem.localVariableHiding=ignore +org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=error +org.eclipse.jdt.core.compiler.problem.missingDefaultCase=ignore +org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=warning +org.eclipse.jdt.core.compiler.problem.missingEnumCaseDespiteDefault=disabled +org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=ignore +org.eclipse.jdt.core.compiler.problem.missingJavadocComments=ignore +org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsOverriding=disabled +org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsVisibility=public +org.eclipse.jdt.core.compiler.problem.missingJavadocTagDescription=return_tag +org.eclipse.jdt.core.compiler.problem.missingJavadocTags=ignore +org.eclipse.jdt.core.compiler.problem.missingJavadocTagsMethodTypeParameters=disabled +org.eclipse.jdt.core.compiler.problem.missingJavadocTagsOverriding=disabled +org.eclipse.jdt.core.compiler.problem.missingJavadocTagsVisibility=protected +org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=warning +org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotationForInterfaceMethodImplementation=enabled +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=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 +org.eclipse.jdt.core.compiler.problem.nullReference=error +org.eclipse.jdt.core.compiler.problem.nullSpecViolation=error +org.eclipse.jdt.core.compiler.problem.nullUncheckedConversion=warning +org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning +org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore +org.eclipse.jdt.core.compiler.problem.pessimisticNullAnalysisForFreeTypeVariables=warning +org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=warning +org.eclipse.jdt.core.compiler.problem.potentialNullReference=ignore +org.eclipse.jdt.core.compiler.problem.potentiallyUnclosedCloseable=ignore +org.eclipse.jdt.core.compiler.problem.rawTypeReference=ignore +org.eclipse.jdt.core.compiler.problem.redundantNullAnnotation=warning +org.eclipse.jdt.core.compiler.problem.redundantNullCheck=warning +org.eclipse.jdt.core.compiler.problem.redundantSpecificationOfTypeArguments=ignore +org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=warning +org.eclipse.jdt.core.compiler.problem.reportMethodCanBePotentiallyStatic=ignore +org.eclipse.jdt.core.compiler.problem.reportMethodCanBeStatic=ignore +org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning +org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled +org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning +org.eclipse.jdt.core.compiler.problem.suppressOptionalErrors=disabled +org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled +org.eclipse.jdt.core.compiler.problem.syntacticNullAnalysisForFields=disabled +org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore +org.eclipse.jdt.core.compiler.problem.terminalDeprecation=warning +org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning +org.eclipse.jdt.core.compiler.problem.unavoidableGenericTypeProblems=enabled +org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=ignore +org.eclipse.jdt.core.compiler.problem.unclosedCloseable=warning +org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore +org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning +org.eclipse.jdt.core.compiler.problem.unlikelyCollectionMethodArgumentType=warning +org.eclipse.jdt.core.compiler.problem.unlikelyCollectionMethodArgumentTypeStrict=disabled +org.eclipse.jdt.core.compiler.problem.unlikelyEqualsArgumentType=info +org.eclipse.jdt.core.compiler.problem.unnecessaryElse=ignore +org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=warning +org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore +org.eclipse.jdt.core.compiler.problem.unstableAutoModuleName=warning +org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=ignore +org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExceptionAndThrowable=enabled +org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=enabled +org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled +org.eclipse.jdt.core.compiler.problem.unusedExceptionParameter=ignore +org.eclipse.jdt.core.compiler.problem.unusedImport=warning +org.eclipse.jdt.core.compiler.problem.unusedLabel=warning +org.eclipse.jdt.core.compiler.problem.unusedLocal=ignore +org.eclipse.jdt.core.compiler.problem.unusedObjectAllocation=ignore +org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore +org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=enabled +org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled +org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled +org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=ignore +org.eclipse.jdt.core.compiler.problem.unusedTypeParameter=ignore +org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning +org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning +org.eclipse.jdt.core.compiler.release=enabled +org.eclipse.jdt.core.compiler.source=11 +org.eclipse.jdt.core.formatter.align_assignment_statements_on_columns=false +org.eclipse.jdt.core.formatter.align_fields_grouping_blank_lines=2147483647 +org.eclipse.jdt.core.formatter.align_type_members_on_columns=false +org.eclipse.jdt.core.formatter.align_variable_declarations_on_columns=false +org.eclipse.jdt.core.formatter.align_with_spaces=false +org.eclipse.jdt.core.formatter.alignment_for_additive_operator=16 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation=0 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant=16 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call=16 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation=16 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression=16 +org.eclipse.jdt.core.formatter.alignment_for_assignment=0 +org.eclipse.jdt.core.formatter.alignment_for_bitwise_operator=16 +org.eclipse.jdt.core.formatter.alignment_for_compact_if=16 +org.eclipse.jdt.core.formatter.alignment_for_compact_loops=16 +org.eclipse.jdt.core.formatter.alignment_for_conditional_expression=80 +org.eclipse.jdt.core.formatter.alignment_for_enum_constants=16 +org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer=16 +org.eclipse.jdt.core.formatter.alignment_for_expressions_in_for_loop_header=0 +org.eclipse.jdt.core.formatter.alignment_for_logical_operator=16 +org.eclipse.jdt.core.formatter.alignment_for_method_declaration=0 +org.eclipse.jdt.core.formatter.alignment_for_module_statements=16 +org.eclipse.jdt.core.formatter.alignment_for_multiple_fields=16 +org.eclipse.jdt.core.formatter.alignment_for_multiplicative_operator=16 +org.eclipse.jdt.core.formatter.alignment_for_parameterized_type_references=0 +org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_resources_in_try=80 +org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation=16 +org.eclipse.jdt.core.formatter.alignment_for_string_concatenation=16 +org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_type_arguments=0 +org.eclipse.jdt.core.formatter.alignment_for_type_parameters=0 +org.eclipse.jdt.core.formatter.alignment_for_union_type_in_multicatch=16 +org.eclipse.jdt.core.formatter.blank_lines_after_imports=1 +org.eclipse.jdt.core.formatter.blank_lines_after_package=1 +org.eclipse.jdt.core.formatter.blank_lines_before_field=0 +org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration=0 +org.eclipse.jdt.core.formatter.blank_lines_before_imports=1 +org.eclipse.jdt.core.formatter.blank_lines_before_member_type=1 +org.eclipse.jdt.core.formatter.blank_lines_before_method=1 +org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk=1 +org.eclipse.jdt.core.formatter.blank_lines_before_package=0 +org.eclipse.jdt.core.formatter.blank_lines_between_import_groups=1 +org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations=1 +org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_array_initializer=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_block=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_block_in_case=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_enum_constant=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_lambda_body=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_method_declaration=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_switch=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_type_declaration=end_of_line +org.eclipse.jdt.core.formatter.comment.align_tags_descriptions_grouped=true +org.eclipse.jdt.core.formatter.comment.align_tags_names_descriptions=false +org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment=false +org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment=false +org.eclipse.jdt.core.formatter.comment.count_line_length_from_starting_position=true +org.eclipse.jdt.core.formatter.comment.format_block_comments=false +org.eclipse.jdt.core.formatter.comment.format_header=false +org.eclipse.jdt.core.formatter.comment.format_html=true +org.eclipse.jdt.core.formatter.comment.format_javadoc_comments=false +org.eclipse.jdt.core.formatter.comment.format_line_comments=false +org.eclipse.jdt.core.formatter.comment.format_source_code=true +org.eclipse.jdt.core.formatter.comment.indent_parameter_description=false +org.eclipse.jdt.core.formatter.comment.indent_root_tags=false +org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags=insert +org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter=do not insert +org.eclipse.jdt.core.formatter.comment.line_length=80 +org.eclipse.jdt.core.formatter.comment.new_lines_at_block_boundaries=true +org.eclipse.jdt.core.formatter.comment.new_lines_at_javadoc_boundaries=true +org.eclipse.jdt.core.formatter.comment.preserve_white_space_between_code_and_line_comments=false +org.eclipse.jdt.core.formatter.compact_else_if=true +org.eclipse.jdt.core.formatter.continuation_indentation=2 +org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer=2 +org.eclipse.jdt.core.formatter.disabling_tag=@formatter\:off +org.eclipse.jdt.core.formatter.enabling_tag=@formatter\:on +org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line=false +org.eclipse.jdt.core.formatter.format_line_comment_starting_on_first_column=false +org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header=true +org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header=true +org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header=true +org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header=true +org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases=true +org.eclipse.jdt.core.formatter.indent_empty_lines=false +org.eclipse.jdt.core.formatter.indent_statements_compare_to_block=true +org.eclipse.jdt.core.formatter.indent_statements_compare_to_body=true +org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases=true +org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch=false +org.eclipse.jdt.core.formatter.indentation.size=4 +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_enum_constant=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_field=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_local_variable=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_method=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_package=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_parameter=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_type=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_label=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_after_type_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_annotation_declaration=insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_anonymous_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_block=insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_constant=insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_declaration=insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body=insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_after_additive_operator=insert +org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter=insert +org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator=insert +org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_bitwise_operator=insert +org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters=insert +org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block=insert +org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters=insert +org.eclipse.jdt.core.formatter.insert_space_after_ellipsis=insert +org.eclipse.jdt.core.formatter.insert_space_after_lambda_arrow=insert +org.eclipse.jdt.core.formatter.insert_space_after_logical_operator=insert +org.eclipse.jdt.core.formatter.insert_space_after_multiplicative_operator=insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer=insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_try=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional=insert +org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_relational_operator=insert +org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for=insert +org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_try_resources=insert +org.eclipse.jdt.core.formatter.insert_space_after_shift_operator=insert +org.eclipse.jdt.core.formatter.insert_space_after_string_concatenation=insert +org.eclipse.jdt.core.formatter.insert_space_after_unary_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_additive_operator=insert +org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter=insert +org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator=insert +org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_bitwise_operator=insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer=insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_try=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert=insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional=insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for=insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_ellipsis=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_lambda_arrow=insert +org.eclipse.jdt.core.formatter.insert_space_before_logical_operator=insert +org.eclipse.jdt.core.formatter.insert_space_before_multiplicative_operator=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_try=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while=insert +org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return=insert +org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw=insert +org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional=insert +org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_relational_operator=insert +org.eclipse.jdt.core.formatter.insert_space_before_semicolon=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_try_resources=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_shift_operator=insert +org.eclipse.jdt.core.formatter.insert_space_before_string_concatenation=insert +org.eclipse.jdt.core.formatter.insert_space_before_unary_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation=do not insert +org.eclipse.jdt.core.formatter.join_lines_in_comments=true +org.eclipse.jdt.core.formatter.join_wrapped_lines=true +org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line=false +org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line=false +org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line=false +org.eclipse.jdt.core.formatter.keep_simple_do_while_body_on_same_line=false +org.eclipse.jdt.core.formatter.keep_simple_for_body_on_same_line=false +org.eclipse.jdt.core.formatter.keep_simple_while_body_on_same_line=false +org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line=false +org.eclipse.jdt.core.formatter.lineSplit=120 +org.eclipse.jdt.core.formatter.never_indent_block_comments_on_first_column=false +org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column=false +org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body=0 +org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve=1 +org.eclipse.jdt.core.formatter.parentheses_positions_in_annotation=common_lines +org.eclipse.jdt.core.formatter.parentheses_positions_in_catch_clause=common_lines +org.eclipse.jdt.core.formatter.parentheses_positions_in_enum_constant_declaration=common_lines +org.eclipse.jdt.core.formatter.parentheses_positions_in_for_statment=common_lines +org.eclipse.jdt.core.formatter.parentheses_positions_in_if_while_statement=common_lines +org.eclipse.jdt.core.formatter.parentheses_positions_in_lambda_declaration=common_lines +org.eclipse.jdt.core.formatter.parentheses_positions_in_method_delcaration=common_lines +org.eclipse.jdt.core.formatter.parentheses_positions_in_method_invocation=common_lines +org.eclipse.jdt.core.formatter.parentheses_positions_in_switch_statement=common_lines +org.eclipse.jdt.core.formatter.parentheses_positions_in_try_clause=common_lines +org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line=true +org.eclipse.jdt.core.formatter.tabulation.char=tab +org.eclipse.jdt.core.formatter.tabulation.size=4 +org.eclipse.jdt.core.formatter.use_on_off_tags=true +org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations=false +org.eclipse.jdt.core.formatter.wrap_before_additive_operator=true +org.eclipse.jdt.core.formatter.wrap_before_assignment_operator=false +org.eclipse.jdt.core.formatter.wrap_before_bitwise_operator=true +org.eclipse.jdt.core.formatter.wrap_before_conditional_operator=true +org.eclipse.jdt.core.formatter.wrap_before_logical_operator=true +org.eclipse.jdt.core.formatter.wrap_before_multiplicative_operator=true +org.eclipse.jdt.core.formatter.wrap_before_or_operator_multicatch=true +org.eclipse.jdt.core.formatter.wrap_before_string_concatenation=true +org.eclipse.jdt.core.formatter.wrap_outer_expressions_when_nested=true +org.eclipse.jdt.core.incompatibleJDKLevel=ignore +org.eclipse.jdt.core.incompleteClasspath=error +org.eclipse.jdt.core.javaFormatter=org.eclipse.jdt.core.defaultJavaFormatter diff --git a/cmake/org.eclipse.cdt.cmake.core.tests/.settings/org.eclipse.jdt.launching.prefs b/cmake/org.eclipse.cdt.cmake.core.tests/.settings/org.eclipse.jdt.launching.prefs new file mode 100644 index 00000000000..f8a131b56e0 --- /dev/null +++ b/cmake/org.eclipse.cdt.cmake.core.tests/.settings/org.eclipse.jdt.launching.prefs @@ -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 diff --git a/cmake/org.eclipse.cdt.cmake.core.tests/.settings/org.eclipse.jdt.ui.prefs b/cmake/org.eclipse.cdt.cmake.core.tests/.settings/org.eclipse.jdt.ui.prefs new file mode 100644 index 00000000000..e44576346c4 --- /dev/null +++ b/cmake/org.eclipse.cdt.cmake.core.tests/.settings/org.eclipse.jdt.ui.prefs @@ -0,0 +1,133 @@ +cleanup.add_default_serial_version_id=true +cleanup.add_generated_serial_version_id=false +cleanup.add_missing_annotations=true +cleanup.add_missing_deprecated_annotations=true +cleanup.add_missing_methods=false +cleanup.add_missing_nls_tags=false +cleanup.add_missing_override_annotations=true +cleanup.add_missing_override_annotations_interface_methods=true +cleanup.add_serial_version_id=false +cleanup.always_use_blocks=true +cleanup.always_use_parentheses_in_expressions=false +cleanup.always_use_this_for_non_static_field_access=false +cleanup.always_use_this_for_non_static_method_access=false +cleanup.convert_functional_interfaces=false +cleanup.convert_to_enhanced_for_loop=false +cleanup.correct_indentation=false +cleanup.format_source_code=true +cleanup.format_source_code_changes_only=false +cleanup.insert_inferred_type_arguments=false +cleanup.make_local_variable_final=true +cleanup.make_parameters_final=false +cleanup.make_private_fields_final=true +cleanup.make_type_abstract_if_missing_method=false +cleanup.make_variable_declarations_final=false +cleanup.never_use_blocks=false +cleanup.never_use_parentheses_in_expressions=true +cleanup.organize_imports=true +cleanup.qualify_static_field_accesses_with_declaring_class=false +cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true +cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true +cleanup.qualify_static_member_accesses_with_declaring_class=false +cleanup.qualify_static_method_accesses_with_declaring_class=false +cleanup.remove_private_constructors=true +cleanup.remove_redundant_modifiers=false +cleanup.remove_redundant_semicolons=true +cleanup.remove_redundant_type_arguments=true +cleanup.remove_trailing_whitespaces=true +cleanup.remove_trailing_whitespaces_all=true +cleanup.remove_trailing_whitespaces_ignore_empty=false +cleanup.remove_unnecessary_casts=true +cleanup.remove_unnecessary_nls_tags=false +cleanup.remove_unused_imports=true +cleanup.remove_unused_local_variables=false +cleanup.remove_unused_private_fields=true +cleanup.remove_unused_private_members=false +cleanup.remove_unused_private_methods=true +cleanup.remove_unused_private_types=true +cleanup.sort_members=false +cleanup.sort_members_all=false +cleanup.use_anonymous_class_creation=false +cleanup.use_blocks=false +cleanup.use_blocks_only_for_return_and_throw=false +cleanup.use_lambda=true +cleanup.use_parentheses_in_expressions=false +cleanup.use_this_for_non_static_field_access=false +cleanup.use_this_for_non_static_field_access_only_if_necessary=true +cleanup.use_this_for_non_static_method_access=false +cleanup.use_this_for_non_static_method_access_only_if_necessary=true +cleanup_profile=_CDT +cleanup_settings_version=2 +eclipse.preferences.version=1 +editor_save_participant_org.eclipse.jdt.ui.postsavelistener.cleanup=true +formatter_profile=_CDT +formatter_settings_version=14 +internal.default.compliance=user +org.eclipse.jdt.ui.exception.name=e +org.eclipse.jdt.ui.gettersetter.use.is=true +org.eclipse.jdt.ui.ignorelowercasenames=true +org.eclipse.jdt.ui.importorder=java;javax;org;com; +org.eclipse.jdt.ui.keywordthis=false +org.eclipse.jdt.ui.ondemandthreshold=1000 +org.eclipse.jdt.ui.overrideannotation=true +org.eclipse.jdt.ui.staticondemandthreshold=1000 +org.eclipse.jdt.ui.text.custom_code_templates= +sp_cleanup.add_default_serial_version_id=true +sp_cleanup.add_generated_serial_version_id=false +sp_cleanup.add_missing_annotations=true +sp_cleanup.add_missing_deprecated_annotations=true +sp_cleanup.add_missing_methods=false +sp_cleanup.add_missing_nls_tags=false +sp_cleanup.add_missing_override_annotations=true +sp_cleanup.add_missing_override_annotations_interface_methods=true +sp_cleanup.add_serial_version_id=false +sp_cleanup.always_use_blocks=true +sp_cleanup.always_use_parentheses_in_expressions=false +sp_cleanup.always_use_this_for_non_static_field_access=false +sp_cleanup.always_use_this_for_non_static_method_access=false +sp_cleanup.convert_functional_interfaces=false +sp_cleanup.convert_to_enhanced_for_loop=false +sp_cleanup.correct_indentation=false +sp_cleanup.format_source_code=true +sp_cleanup.format_source_code_changes_only=false +sp_cleanup.insert_inferred_type_arguments=false +sp_cleanup.make_local_variable_final=true +sp_cleanup.make_parameters_final=false +sp_cleanup.make_private_fields_final=true +sp_cleanup.make_type_abstract_if_missing_method=false +sp_cleanup.make_variable_declarations_final=false +sp_cleanup.never_use_blocks=false +sp_cleanup.never_use_parentheses_in_expressions=true +sp_cleanup.on_save_use_additional_actions=true +sp_cleanup.organize_imports=true +sp_cleanup.qualify_static_field_accesses_with_declaring_class=false +sp_cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true +sp_cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true +sp_cleanup.qualify_static_member_accesses_with_declaring_class=false +sp_cleanup.qualify_static_method_accesses_with_declaring_class=false +sp_cleanup.remove_private_constructors=true +sp_cleanup.remove_redundant_modifiers=false +sp_cleanup.remove_redundant_semicolons=true +sp_cleanup.remove_redundant_type_arguments=true +sp_cleanup.remove_trailing_whitespaces=true +sp_cleanup.remove_trailing_whitespaces_all=true +sp_cleanup.remove_trailing_whitespaces_ignore_empty=false +sp_cleanup.remove_unnecessary_casts=true +sp_cleanup.remove_unnecessary_nls_tags=false +sp_cleanup.remove_unused_imports=true +sp_cleanup.remove_unused_local_variables=false +sp_cleanup.remove_unused_private_fields=true +sp_cleanup.remove_unused_private_members=false +sp_cleanup.remove_unused_private_methods=true +sp_cleanup.remove_unused_private_types=true +sp_cleanup.sort_members=false +sp_cleanup.sort_members_all=false +sp_cleanup.use_anonymous_class_creation=false +sp_cleanup.use_blocks=false +sp_cleanup.use_blocks_only_for_return_and_throw=false +sp_cleanup.use_lambda=true +sp_cleanup.use_parentheses_in_expressions=false +sp_cleanup.use_this_for_non_static_field_access=false +sp_cleanup.use_this_for_non_static_field_access_only_if_necessary=true +sp_cleanup.use_this_for_non_static_method_access=false +sp_cleanup.use_this_for_non_static_method_access_only_if_necessary=true diff --git a/cmake/org.eclipse.cdt.cmake.core.tests/.settings/org.eclipse.m2e.core.prefs b/cmake/org.eclipse.cdt.cmake.core.tests/.settings/org.eclipse.m2e.core.prefs new file mode 100644 index 00000000000..f897a7f1cb2 --- /dev/null +++ b/cmake/org.eclipse.cdt.cmake.core.tests/.settings/org.eclipse.m2e.core.prefs @@ -0,0 +1,4 @@ +activeProfiles= +eclipse.preferences.version=1 +resolveWorkspaceProjects=true +version=1 diff --git a/cmake/org.eclipse.cdt.cmake.core.tests/.settings/org.eclipse.pde.api.tools.prefs b/cmake/org.eclipse.cdt.cmake.core.tests/.settings/org.eclipse.pde.api.tools.prefs new file mode 100644 index 00000000000..ec9fbf321d0 --- /dev/null +++ b/cmake/org.eclipse.cdt.cmake.core.tests/.settings/org.eclipse.pde.api.tools.prefs @@ -0,0 +1,184 @@ +ANNOTATION_ELEMENT_TYPE_ADDED_CLASS_BOUND=Error +ANNOTATION_ELEMENT_TYPE_ADDED_FIELD=Error +ANNOTATION_ELEMENT_TYPE_ADDED_INTERFACE_BOUND=Error +ANNOTATION_ELEMENT_TYPE_ADDED_INTERFACE_BOUNDS=Error +ANNOTATION_ELEMENT_TYPE_ADDED_METHOD=Error +ANNOTATION_ELEMENT_TYPE_ADDED_METHOD_WITHOUT_DEFAULT_VALUE=Error +ANNOTATION_ELEMENT_TYPE_ADDED_TYPE_MEMBER=Error +ANNOTATION_ELEMENT_TYPE_ADDED_TYPE_PARAMETER=Error +ANNOTATION_ELEMENT_TYPE_CHANGED_CLASS_BOUND=Error +ANNOTATION_ELEMENT_TYPE_CHANGED_CONTRACTED_SUPERINTERFACES_SET=Error +ANNOTATION_ELEMENT_TYPE_CHANGED_INTERFACE_BOUND=Error +ANNOTATION_ELEMENT_TYPE_CHANGED_INTERFACE_BOUNDS=Error +ANNOTATION_ELEMENT_TYPE_CHANGED_RESTRICTIONS=Error +ANNOTATION_ELEMENT_TYPE_CHANGED_TO_CLASS=Error +ANNOTATION_ELEMENT_TYPE_CHANGED_TO_ENUM=Error +ANNOTATION_ELEMENT_TYPE_CHANGED_TO_INTERFACE=Error +ANNOTATION_ELEMENT_TYPE_CHANGED_TYPE_CONVERSION=Error +ANNOTATION_ELEMENT_TYPE_REMOVED_CLASS_BOUND=Error +ANNOTATION_ELEMENT_TYPE_REMOVED_FIELD=Error +ANNOTATION_ELEMENT_TYPE_REMOVED_INTERFACE_BOUND=Error +ANNOTATION_ELEMENT_TYPE_REMOVED_METHOD=Error +ANNOTATION_ELEMENT_TYPE_REMOVED_METHOD_WITHOUT_DEFAULT_VALUE=Error +ANNOTATION_ELEMENT_TYPE_REMOVED_METHOD_WITH_DEFAULT_VALUE=Error +ANNOTATION_ELEMENT_TYPE_REMOVED_TYPE_MEMBER=Error +ANNOTATION_ELEMENT_TYPE_REMOVED_TYPE_PARAMETER=Error +ANNOTATION_ELEMENT_TYPE_REMOVED_TYPE_PARAMETERS=Error +API_COMPONENT_ELEMENT_TYPE_REMOVED_API_TYPE=Error +API_COMPONENT_ELEMENT_TYPE_REMOVED_REEXPORTED_API_TYPE=Error +API_COMPONENT_ELEMENT_TYPE_REMOVED_REEXPORTED_TYPE=Error +API_COMPONENT_ELEMENT_TYPE_REMOVED_TYPE=Error +API_USE_SCAN_FIELD_SEVERITY=Error +API_USE_SCAN_METHOD_SEVERITY=Error +API_USE_SCAN_TYPE_SEVERITY=Error +CLASS_ELEMENT_TYPE_ADDED_CLASS_BOUND=Error +CLASS_ELEMENT_TYPE_ADDED_FIELD=Error +CLASS_ELEMENT_TYPE_ADDED_INTERFACE_BOUND=Error +CLASS_ELEMENT_TYPE_ADDED_INTERFACE_BOUNDS=Error +CLASS_ELEMENT_TYPE_ADDED_METHOD=Error +CLASS_ELEMENT_TYPE_ADDED_RESTRICTIONS=Error +CLASS_ELEMENT_TYPE_ADDED_TYPE_PARAMETER=Error +CLASS_ELEMENT_TYPE_CHANGED_CLASS_BOUND=Error +CLASS_ELEMENT_TYPE_CHANGED_CONTRACTED_SUPERCLASS_SET=Error +CLASS_ELEMENT_TYPE_CHANGED_CONTRACTED_SUPERINTERFACES_SET=Error +CLASS_ELEMENT_TYPE_CHANGED_DECREASE_ACCESS=Error +CLASS_ELEMENT_TYPE_CHANGED_INTERFACE_BOUND=Error +CLASS_ELEMENT_TYPE_CHANGED_NON_ABSTRACT_TO_ABSTRACT=Error +CLASS_ELEMENT_TYPE_CHANGED_NON_FINAL_TO_FINAL=Error +CLASS_ELEMENT_TYPE_CHANGED_RESTRICTIONS=Error +CLASS_ELEMENT_TYPE_CHANGED_SUPERCLASS=Error +CLASS_ELEMENT_TYPE_CHANGED_TO_ANNOTATION=Error +CLASS_ELEMENT_TYPE_CHANGED_TO_ENUM=Error +CLASS_ELEMENT_TYPE_CHANGED_TO_INTERFACE=Error +CLASS_ELEMENT_TYPE_CHANGED_TYPE_CONVERSION=Error +CLASS_ELEMENT_TYPE_REMOVED_CLASS_BOUND=Error +CLASS_ELEMENT_TYPE_REMOVED_CONSTRUCTOR=Error +CLASS_ELEMENT_TYPE_REMOVED_FIELD=Error +CLASS_ELEMENT_TYPE_REMOVED_INTERFACE_BOUND=Error +CLASS_ELEMENT_TYPE_REMOVED_INTERFACE_BOUNDS=Error +CLASS_ELEMENT_TYPE_REMOVED_METHOD=Error +CLASS_ELEMENT_TYPE_REMOVED_SUPERCLASS=Error +CLASS_ELEMENT_TYPE_REMOVED_TYPE_MEMBER=Error +CLASS_ELEMENT_TYPE_REMOVED_TYPE_PARAMETER=Error +CLASS_ELEMENT_TYPE_REMOVED_TYPE_PARAMETERS=Error +CONSTRUCTOR_ELEMENT_TYPE_ADDED_CLASS_BOUND=Error +CONSTRUCTOR_ELEMENT_TYPE_ADDED_INTERFACE_BOUND=Error +CONSTRUCTOR_ELEMENT_TYPE_ADDED_INTERFACE_BOUNDS=Error +CONSTRUCTOR_ELEMENT_TYPE_ADDED_TYPE_PARAMETER=Error +CONSTRUCTOR_ELEMENT_TYPE_CHANGED_CLASS_BOUND=Error +CONSTRUCTOR_ELEMENT_TYPE_CHANGED_DECREASE_ACCESS=Error +CONSTRUCTOR_ELEMENT_TYPE_CHANGED_INTERFACE_BOUND=Error +CONSTRUCTOR_ELEMENT_TYPE_CHANGED_NON_ABSTRACT_TO_ABSTRACT=Error +CONSTRUCTOR_ELEMENT_TYPE_CHANGED_NON_FINAL_TO_FINAL=Error +CONSTRUCTOR_ELEMENT_TYPE_CHANGED_NON_STATIC_TO_STATIC=Error +CONSTRUCTOR_ELEMENT_TYPE_CHANGED_STATIC_TO_NON_STATIC=Error +CONSTRUCTOR_ELEMENT_TYPE_CHANGED_TYPE_PARAMETER=Error +CONSTRUCTOR_ELEMENT_TYPE_CHANGED_VARARGS_TO_ARRAY=Error +CONSTRUCTOR_ELEMENT_TYPE_REMOVED_ANNOTATION_DEFAULT_VALUE=Error +CONSTRUCTOR_ELEMENT_TYPE_REMOVED_CLASS_BOUND=Error +CONSTRUCTOR_ELEMENT_TYPE_REMOVED_INTERFACE_BOUND=Error +CONSTRUCTOR_ELEMENT_TYPE_REMOVED_INTERFACE_BOUNDS=Error +CONSTRUCTOR_ELEMENT_TYPE_REMOVED_TYPE_PARAMETER=Error +CONSTRUCTOR_ELEMENT_TYPE_REMOVED_TYPE_PARAMETERS=Error +ENUM_ELEMENT_TYPE_CHANGED_CONTRACTED_SUPERINTERFACES_SET=Error +ENUM_ELEMENT_TYPE_CHANGED_RESTRICTIONS=Error +ENUM_ELEMENT_TYPE_CHANGED_TO_ANNOTATION=Error +ENUM_ELEMENT_TYPE_CHANGED_TO_CLASS=Error +ENUM_ELEMENT_TYPE_CHANGED_TO_INTERFACE=Error +ENUM_ELEMENT_TYPE_CHANGED_TYPE_CONVERSION=Error +ENUM_ELEMENT_TYPE_REMOVED_ENUM_CONSTANT=Error +ENUM_ELEMENT_TYPE_REMOVED_FIELD=Error +ENUM_ELEMENT_TYPE_REMOVED_METHOD=Error +ENUM_ELEMENT_TYPE_REMOVED_TYPE_MEMBER=Error +FIELD_ELEMENT_TYPE_ADDED_VALUE=Error +FIELD_ELEMENT_TYPE_CHANGED_DECREASE_ACCESS=Error +FIELD_ELEMENT_TYPE_CHANGED_FINAL_TO_NON_FINAL_STATIC_CONSTANT=Error +FIELD_ELEMENT_TYPE_CHANGED_NON_FINAL_TO_FINAL=Error +FIELD_ELEMENT_TYPE_CHANGED_NON_STATIC_TO_STATIC=Error +FIELD_ELEMENT_TYPE_CHANGED_STATIC_TO_NON_STATIC=Error +FIELD_ELEMENT_TYPE_CHANGED_TYPE=Error +FIELD_ELEMENT_TYPE_CHANGED_VALUE=Error +FIELD_ELEMENT_TYPE_REMOVED_TYPE_ARGUMENT=Error +FIELD_ELEMENT_TYPE_REMOVED_TYPE_ARGUMENTS=Error +FIELD_ELEMENT_TYPE_REMOVED_VALUE=Error +ILLEGAL_EXTEND=Warning +ILLEGAL_IMPLEMENT=Warning +ILLEGAL_INSTANTIATE=Warning +ILLEGAL_OVERRIDE=Warning +ILLEGAL_REFERENCE=Warning +INTERFACE_ELEMENT_TYPE_ADDED_CLASS_BOUND=Error +INTERFACE_ELEMENT_TYPE_ADDED_DEFAULT_METHOD=Error +INTERFACE_ELEMENT_TYPE_ADDED_FIELD=Error +INTERFACE_ELEMENT_TYPE_ADDED_INTERFACE_BOUND=Error +INTERFACE_ELEMENT_TYPE_ADDED_INTERFACE_BOUNDS=Error +INTERFACE_ELEMENT_TYPE_ADDED_METHOD=Error +INTERFACE_ELEMENT_TYPE_ADDED_RESTRICTIONS=Error +INTERFACE_ELEMENT_TYPE_ADDED_SUPER_INTERFACE_WITH_METHODS=Error +INTERFACE_ELEMENT_TYPE_ADDED_TYPE_MEMBER=Error +INTERFACE_ELEMENT_TYPE_ADDED_TYPE_PARAMETER=Error +INTERFACE_ELEMENT_TYPE_ADDED_TYPE_PARAMETERS=Error +INTERFACE_ELEMENT_TYPE_CHANGED_CLASS_BOUND=Error +INTERFACE_ELEMENT_TYPE_CHANGED_CONTRACTED_SUPERINTERFACES_SET=Error +INTERFACE_ELEMENT_TYPE_CHANGED_INTERFACE_BOUND=Error +INTERFACE_ELEMENT_TYPE_CHANGED_INTERFACE_BOUNDS=Error +INTERFACE_ELEMENT_TYPE_CHANGED_RESTRICTIONS=Error +INTERFACE_ELEMENT_TYPE_CHANGED_TO_ANNOTATION=Error +INTERFACE_ELEMENT_TYPE_CHANGED_TO_CLASS=Error +INTERFACE_ELEMENT_TYPE_CHANGED_TO_ENUM=Error +INTERFACE_ELEMENT_TYPE_CHANGED_TYPE_CONVERSION=Error +INTERFACE_ELEMENT_TYPE_REMOVED_CLASS_BOUND=Error +INTERFACE_ELEMENT_TYPE_REMOVED_FIELD=Error +INTERFACE_ELEMENT_TYPE_REMOVED_INTERFACE_BOUND=Error +INTERFACE_ELEMENT_TYPE_REMOVED_INTERFACE_BOUNDS=Error +INTERFACE_ELEMENT_TYPE_REMOVED_METHOD=Error +INTERFACE_ELEMENT_TYPE_REMOVED_TYPE_MEMBER=Error +INTERFACE_ELEMENT_TYPE_REMOVED_TYPE_PARAMETER=Error +INVALID_ANNOTATION=Ignore +INVALID_JAVADOC_TAG=Error +INVALID_REFERENCE_IN_SYSTEM_LIBRARIES=Warning +LEAK_EXTEND=Warning +LEAK_FIELD_DECL=Warning +LEAK_IMPLEMENT=Warning +LEAK_METHOD_PARAM=Warning +LEAK_METHOD_RETURN_TYPE=Warning +METHOD_ELEMENT_TYPE_ADDED_CLASS_BOUND=Error +METHOD_ELEMENT_TYPE_ADDED_INTERFACE_BOUND=Error +METHOD_ELEMENT_TYPE_ADDED_INTERFACE_BOUNDS=Error +METHOD_ELEMENT_TYPE_ADDED_RESTRICTIONS=Error +METHOD_ELEMENT_TYPE_ADDED_TYPE_PARAMETER=Error +METHOD_ELEMENT_TYPE_CHANGED_CLASS_BOUND=Error +METHOD_ELEMENT_TYPE_CHANGED_DECREASE_ACCESS=Error +METHOD_ELEMENT_TYPE_CHANGED_INTERFACE_BOUND=Error +METHOD_ELEMENT_TYPE_CHANGED_NON_ABSTRACT_TO_ABSTRACT=Error +METHOD_ELEMENT_TYPE_CHANGED_NON_FINAL_TO_FINAL=Error +METHOD_ELEMENT_TYPE_CHANGED_NON_STATIC_TO_STATIC=Error +METHOD_ELEMENT_TYPE_CHANGED_STATIC_TO_NON_STATIC=Error +METHOD_ELEMENT_TYPE_CHANGED_TYPE_PARAMETER=Error +METHOD_ELEMENT_TYPE_CHANGED_VARARGS_TO_ARRAY=Error +METHOD_ELEMENT_TYPE_REMOVED_ANNOTATION_DEFAULT_VALUE=Error +METHOD_ELEMENT_TYPE_REMOVED_CLASS_BOUND=Error +METHOD_ELEMENT_TYPE_REMOVED_INTERFACE_BOUND=Error +METHOD_ELEMENT_TYPE_REMOVED_INTERFACE_BOUNDS=Error +METHOD_ELEMENT_TYPE_REMOVED_TYPE_PARAMETER=Error +METHOD_ELEMENT_TYPE_REMOVED_TYPE_PARAMETERS=Error +MISSING_EE_DESCRIPTIONS=Warning +TYPE_PARAMETER_ELEMENT_TYPE_ADDED_CLASS_BOUND=Error +TYPE_PARAMETER_ELEMENT_TYPE_ADDED_INTERFACE_BOUND=Error +TYPE_PARAMETER_ELEMENT_TYPE_CHANGED_CLASS_BOUND=Error +TYPE_PARAMETER_ELEMENT_TYPE_CHANGED_INTERFACE_BOUND=Error +TYPE_PARAMETER_ELEMENT_TYPE_REMOVED_CLASS_BOUND=Error +TYPE_PARAMETER_ELEMENT_TYPE_REMOVED_INTERFACE_BOUND=Error +UNUSED_PROBLEM_FILTERS=Warning +automatically_removed_unused_problem_filters=false +changed_execution_env=Error +eclipse.preferences.version=1 +incompatible_api_component_version=Error +incompatible_api_component_version_include_major_without_breaking_change=Disabled +incompatible_api_component_version_include_minor_without_api_change=Disabled +incompatible_api_component_version_report_major_without_breaking_change=Warning +incompatible_api_component_version_report_minor_without_api_change=Warning +invalid_since_tag_version=Error +malformed_since_tag=Error +missing_since_tag=Error +report_api_breakage_when_major_version_incremented=Disabled +report_resolution_errors_api_component=Warning diff --git a/cmake/org.eclipse.cdt.cmake.core.tests/.settings/org.eclipse.pde.prefs b/cmake/org.eclipse.cdt.cmake.core.tests/.settings/org.eclipse.pde.prefs new file mode 100644 index 00000000000..51a63ec9988 --- /dev/null +++ b/cmake/org.eclipse.cdt.cmake.core.tests/.settings/org.eclipse.pde.prefs @@ -0,0 +1,35 @@ +compilers.f.unresolved-features=1 +compilers.f.unresolved-plugins=1 +compilers.incompatible-environment=1 +compilers.p.build=1 +compilers.p.build.bin.includes=1 +compilers.p.build.encodings=2 +compilers.p.build.java.compiler=2 +compilers.p.build.java.compliance=1 +compilers.p.build.missing.output=2 +compilers.p.build.output.library=1 +compilers.p.build.source.library=1 +compilers.p.build.src.includes=1 +compilers.p.deprecated=1 +compilers.p.discouraged-class=1 +compilers.p.internal=1 +compilers.p.missing-packages=2 +compilers.p.missing-version-export-package=2 +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=2 +compilers.p.service.component.without.lazyactivation=1 +compilers.p.unknown-attribute=1 +compilers.p.unknown-class=1 +compilers.p.unknown-element=1 +compilers.p.unknown-identifier=1 +compilers.p.unknown-resource=1 +compilers.p.unresolved-ex-points=0 +compilers.p.unresolved-import=0 +compilers.s.create-docs=false +compilers.s.doc-folder=doc +compilers.s.open-tags=1 +compilers.use-project=true +eclipse.preferences.version=1 diff --git a/cmake/org.eclipse.cdt.cmake.core.tests/META-INF/MANIFEST.MF b/cmake/org.eclipse.cdt.cmake.core.tests/META-INF/MANIFEST.MF new file mode 100644 index 00000000000..2d1777c237a --- /dev/null +++ b/cmake/org.eclipse.cdt.cmake.core.tests/META-INF/MANIFEST.MF @@ -0,0 +1,12 @@ +Manifest-Version: 1.0 +Bundle-ManifestVersion: 2 +Bundle-Name: %Bundle-Name +Bundle-SymbolicName: org.eclipse.cdt.cmake.core.tests +Bundle-Version: 1.0.0.qualifier +Fragment-Host: org.eclipse.cdt.cmake.core;bundle-version="1.3.0" +Automatic-Module-Name: org.eclipse.cdt.cmake.core.tests +Bundle-Vendor: %Bundle-Vendor +Bundle-Copyright: %Bundle-Copyright +Require-Bundle: org.junit, + org.junit.jupiter.api + diff --git a/cmake/org.eclipse.cdt.cmake.core.tests/OSGI-INF/l10n/bundle.properties b/cmake/org.eclipse.cdt.cmake.core.tests/OSGI-INF/l10n/bundle.properties new file mode 100644 index 00000000000..0fa6190fca1 --- /dev/null +++ b/cmake/org.eclipse.cdt.cmake.core.tests/OSGI-INF/l10n/bundle.properties @@ -0,0 +1,10 @@ +#Properties file for org.eclipse.cdt.cmake.is.core.tests +Bundle-Name = org.eclipse.cdt.cmake.is.core.tests +Bundle-Vendor = Eclipse CDT +Bundle-Copyright = 2020 Martin Weber\n\ +\n\ +This program and the accompanying materials are made\n\ +available under the terms of the Eclipse Public License 2.0\n\ +which is available at https://www.eclipse.org/legal/epl-2.0/\n\ +\n\ +SPDX-License-Identifier: EPL-2.0\n\ \ No newline at end of file diff --git a/cmake/org.eclipse.cdt.cmake.core.tests/about.html b/cmake/org.eclipse.cdt.cmake.core.tests/about.html new file mode 100644 index 00000000000..164f781a8fd --- /dev/null +++ b/cmake/org.eclipse.cdt.cmake.core.tests/about.html @@ -0,0 +1,36 @@ + + + + +About + + +

About This Content

+ +

November 30, 2017

+

License

+ +

+ The Eclipse Foundation makes available all content in this plug-in + ("Content"). Unless otherwise indicated below, the Content + is provided to you under the terms and conditions of the Eclipse + Public License Version 2.0 ("EPL"). A copy of the EPL is + available at http://www.eclipse.org/legal/epl-2.0. + For purposes of the EPL, "Program" will mean the Content. +

+ +

+ If you did not receive this Content directly from the Eclipse + Foundation, the Content is being redistributed by another party + ("Redistributor") and different terms and conditions may + apply to your use of any object code in the Content. Check the + Redistributor's license that was provided with the Content. If no such + license exists, contact the Redistributor. Unless otherwise indicated + below, the terms and conditions of the EPL still apply to any source + code in the Content and such source code may be obtained at http://www.eclipse.org. +

+ + + \ No newline at end of file diff --git a/cmake/org.eclipse.cdt.cmake.core.tests/build.properties b/cmake/org.eclipse.cdt.cmake.core.tests/build.properties new file mode 100644 index 00000000000..30c35d74ee2 --- /dev/null +++ b/cmake/org.eclipse.cdt.cmake.core.tests/build.properties @@ -0,0 +1,7 @@ +source.. = src/ +output.. = bin/ +bin.includes = META-INF/,\ + .,\ + OSGI-INF/,\ + about.html +src.includes = about.html diff --git a/cmake/org.eclipse.cdt.cmake.core.tests/pom.xml b/cmake/org.eclipse.cdt.cmake.core.tests/pom.xml new file mode 100644 index 00000000000..e6d339ad7ce --- /dev/null +++ b/cmake/org.eclipse.cdt.cmake.core.tests/pom.xml @@ -0,0 +1,13 @@ + + 4.0.0 + + org.eclipse.cdt + cdt-parent + 10.0.0-SNAPSHOT + ../.. + + + org.eclipse.cdt.cmake.core.tests + 1.0.0-SNAPSHOT + eclipse-test-plugin + \ No newline at end of file diff --git a/cmake/org.eclipse.cdt.cmake.core.tests/src/org/eclipse/cdt/cmake/core/internal/CMakeErrorParserTest.java b/cmake/org.eclipse.cdt.cmake.core.tests/src/org/eclipse/cdt/cmake/core/internal/CMakeErrorParserTest.java new file mode 100644 index 00000000000..268fef30c8c --- /dev/null +++ b/cmake/org.eclipse.cdt.cmake.core.tests/src/org/eclipse/cdt/cmake/core/internal/CMakeErrorParserTest.java @@ -0,0 +1,349 @@ +/******************************************************************************* + * Copyright (c) 2020 Martin Weber. + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 + * which accompanies this distribution, and is available at + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 + *******************************************************************************/ + +package org.eclipse.cdt.cmake.core.internal; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertTrue; + +import java.util.Map; +import java.util.Objects; + +import org.eclipse.core.resources.IMarker; +import org.eclipse.core.runtime.CoreException; +import org.junit.Assert; +import org.junit.Test; + +/** + * @author Martin Weber + * + */ +public class CMakeErrorParserTest { + + @SuppressWarnings("resource") + @Test + public void testCtorNPE() { + try { + new CMakeErrorParser(null); + Assert.fail("NullPointerException expected"); + } catch (NullPointerException expected) { + } + } + + /** + * Test method for {@link org.eclipse.cdt.cmake.core.internal.CMakeErrorParser#addInput(java.lang.CharSequence)}. + * Just tests whether the call survives. + */ + @Test + public void testAddInput() { + ICMakeExecutionMarkerFactory f = (m, s, fi, a) -> { + }; + try (CMakeErrorParser testee = new CMakeErrorParser(f)) { + testee.addInput("c f g b\n blah"); + } + } + + /** + * Test method for {@link org.eclipse.cdt.cmake.core.internal.CMakeErrorParser#close()}. + * Just tests whether the call survives. + */ + @Test + public void testClose() { + ICMakeExecutionMarkerFactory f = (m, s, fi, a) -> { + }; + CMakeErrorParser testee = new CMakeErrorParser(f); + testee.close(); + } + + /** + * test "CMake Error" + */ + @Test + public void testError() { + String msgStart = "CMake Error"; + String fmt = "%1$s%2$s\n" + "-- ignored lkjdfflgjd an" + "\n%1$s%2$s\n"; + String fmt2 = "\n%1$s%2$s\n" + "\n%1$s%2$s" + "\n%1$s%2$s"; + String msgContent = " at xyz:123\n some message"; + String input = String.format(fmt, msgStart, msgContent); + + CountingCMakeExecutionMarkerFactory f = new CountingCMakeExecutionMarkerFactory(); + try (CMakeErrorParser testee = new CMakeErrorParser(f)) { + testee.addInput("ignored leading\njunk adlasdj\n"); + testee.addInput(input); + testee.addInput(input); + testee.addInput(String.format(fmt2, msgStart, msgContent)); + testee.addInput("-- ignored lkjdfflgjd an"); + } + assertEquals(7, f.markerCnt); + } + + /** + * test "CMake Error (dev)" + */ + @Test + public void testErrorDev() { + String msgStart = "CMake Error (dev)"; + String fmt = "%1$s%2$s\n" + "-- ignored lkjdfflgjd an" + "\n%1$s%2$s\n"; + String fmt2 = "\n%1$s%2$s\n" + "\n%1$s%2$s" + "\n%1$s%2$s"; + String msgContent = " at xyz:123\n some message"; + String input = String.format(fmt, msgStart, msgContent); + + CountingCMakeExecutionMarkerFactory f = new CountingCMakeExecutionMarkerFactory(); + try (CMakeErrorParser testee = new CMakeErrorParser(f)) { + testee.addInput("ignored leading\njunk adlasdj\n"); + testee.addInput(input); + testee.addInput(input); + testee.addInput(String.format(fmt2, msgStart, msgContent)); + testee.addInput("-- ignored lkjdfflgjd an"); + } + assertEquals(7, f.markerCnt); + } + + /** + * test "CMake Internal Error (please report a bug)" + */ + @Test + public void testInternalError() { + String msgStart = "CMake Internal Error (please report a bug)"; + String fmt = "%1$s%2$s\n" + "-- ignored lkjdfflgjd an" + "\n%1$s%2$s\n"; + String fmt2 = "\n%1$s%2$s\n" + "\n%1$s%2$s" + "\n%1$s%2$s"; + String msgContent = " at xyz:123\n some message"; + String input = String.format(fmt, msgStart, msgContent); + + CountingCMakeExecutionMarkerFactory f = new CountingCMakeExecutionMarkerFactory(); + try (CMakeErrorParser testee = new CMakeErrorParser(f)) { + testee.addInput("ignored leading\njunk adlasdj\n"); + testee.addInput(input); + testee.addInput(input); + testee.addInput(String.format(fmt2, msgStart, msgContent)); + testee.addInput("-- ignored lkjdfflgjd an"); + } + assertEquals(7, f.markerCnt); + } + + /** + * test "CMake Deprecation Error" + */ + @Test + public void testDeprecationError() { + String msgStart = "CMake Deprecation Error"; + String fmt = "%1$s%2$s\n" + "-- ignored lkjdfflgjd an" + "\n%1$s%2$s\n"; + String fmt2 = "\n%1$s%2$s\n" + "\n%1$s%2$s" + "\n%1$s%2$s"; + String msgContent = " at xyz:123\n some message"; + String input = String.format(fmt, msgStart, msgContent); + + CountingCMakeExecutionMarkerFactory f = new CountingCMakeExecutionMarkerFactory(); + try (CMakeErrorParser testee = new CMakeErrorParser(f)) { + testee.addInput("ignored leading\njunk adlasdj\n"); + testee.addInput(input); + testee.addInput(input); + testee.addInput(String.format(fmt2, msgStart, msgContent)); + testee.addInput("-- ignored lkjdfflgjd an"); + } + assertEquals(7, f.markerCnt); + } + + /** + * test "CMake Deprecation Warning" + */ + @Test + public void testDeprecationWarning() { + String msgStart = "CMake Deprecation Warning"; + String fmt = "%1$s%2$s\n" + "-- ignored lkjdfflgjd an" + "\n%1$s%2$s\n"; + String fmt2 = "\n%1$s%2$s\n" + "\n%1$s%2$s" + "\n%1$s%2$s"; + String msgContent = " at xyz:123\n some message"; + String input = String.format(fmt, msgStart, msgContent); + + CountingCMakeExecutionMarkerFactory f = new CountingCMakeExecutionMarkerFactory(); + try (CMakeErrorParser testee = new CMakeErrorParser(f)) { + testee.addInput("ignored leading\njunk adlasdj\n"); + testee.addInput(input); + testee.addInput(input); + testee.addInput(String.format(fmt2, msgStart, msgContent)); + testee.addInput("-- ignored lkjdfflgjd an"); + } + assertEquals(7, f.markerCnt); + } + + /** + * test "CMake Warning" + */ + @Test + public void testCMakeWarning() { + String msgStart = "CMake Warning"; + String fmt = "%1$s%2$s\n" + "-- ignored lkjdfflgjd an" + "\n%1$s%2$s\n"; + String fmt2 = "\n%1$s%2$s\n" + "\n%1$s%2$s" + "\n%1$s%2$s"; + String msgContent = " at xyz:123\n some message"; + String input = String.format(fmt, msgStart, msgContent); + + CountingCMakeExecutionMarkerFactory f = new CountingCMakeExecutionMarkerFactory(); + try (CMakeErrorParser testee = new CMakeErrorParser(f)) { + testee.addInput("ignored leading\njunk adlasdj\n"); + testee.addInput(input); + testee.addInput(input); + testee.addInput(String.format(fmt2, msgStart, msgContent)); + testee.addInput("-- ignored lkjdfflgjd an"); + } + assertEquals(7, f.markerCnt); + } + + /** + * test "CMake Warning (dev)" + */ + @Test + public void testCMakeWarningDev() { + String msgStart = "CMake Warning (dev)"; + String fmt = "%1$s%2$s\n" + "-- ignored lkjdfflgjd an" + "\n%1$s%2$s\n"; + String fmt2 = "\n%1$s%2$s\n" + "\n%1$s%2$s" + "\n%1$s%2$s"; + String msgContent = " at xyz:123\n some message"; + String input = String.format(fmt, msgStart, msgContent); + + CountingCMakeExecutionMarkerFactory f = new CountingCMakeExecutionMarkerFactory(); + try (CMakeErrorParser testee = new CMakeErrorParser(f)) { + testee.addInput("ignored leading\njunk adlasdj\n"); + testee.addInput(input); + testee.addInput(input); + testee.addInput(String.format(fmt2, msgStart, msgContent)); + testee.addInput("-- ignored lkjdfflgjd an"); + } + assertEquals(7, f.markerCnt); + } + + /** + * Tests whether the file name and line number are extracted from the message. + */ + @Test + public void testFilenameLineNo() { + final String msgStart = "CMake Warning"; + final String filename = "FileWithError.ext"; + final Integer lineNumber = Integer.valueOf(505); + { + String fmt = "%1$s at %2$s:%3$d Have\n some message text\n until here"; + HasFilenameAndLineNumberCEMFactory f = new HasFilenameAndLineNumberCEMFactory(); + try (CMakeErrorParser testee = new CMakeErrorParser(f)) { + String input = String.format(fmt, msgStart, filename, lineNumber); + testee.addInput(input); + } + assertEquals(1, f.markerCnt); + assertEquals(filename, f.filePath); + assertEquals(lineNumber, f.lineNumber); + } + { + String fmt = "%1$s: Error in cmake code at %2$s:%3$d Have\n some message text\n until here"; + HasFilenameAndLineNumberCEMFactory f = new HasFilenameAndLineNumberCEMFactory(); + try (CMakeErrorParser testee = new CMakeErrorParser(f)) { + String input = String.format(fmt, msgStart, filename, lineNumber); + testee.addInput(input); + } + assertEquals(1, f.markerCnt); + assertEquals(filename, f.filePath); + assertEquals(lineNumber, f.lineNumber); + } + { + String fmt = "%1$s at %2$s:%3$d Have\n some message text\n until here"; + HasFilenameAndLineNumberCEMFactory f = new HasFilenameAndLineNumberCEMFactory(); + try (CMakeErrorParser testee = new CMakeErrorParser(f)) { + String input = String.format(fmt, msgStart, filename, lineNumber); + testee.addInput(input); + } + assertEquals(1, f.markerCnt); + assertEquals(filename, f.filePath); + assertEquals(lineNumber, f.lineNumber); + } + { + String fmt = "%1$s in %2$s:%3$d Have\n some message text\n until here"; + HasFilenameAndLineNumberCEMFactory f = new HasFilenameAndLineNumberCEMFactory(); + try (CMakeErrorParser testee = new CMakeErrorParser(f)) { + String input = String.format(fmt, msgStart, filename, lineNumber); + testee.addInput(input); + } + assertEquals(1, f.markerCnt); + assertEquals(filename, f.filePath); + assertEquals(lineNumber, f.lineNumber); + } + } + + /** + * Tests whether the file name is extracted from the message. + */ + @Test + public void testFilename() { + final String msgStart = "CMake Warning"; + final String filename = "FileWithError.ext"; + { + String fmt = "%1$s in %2$s: Have\n some message text\n until here"; + HasFilenameAndLineNumberCEMFactory f = new HasFilenameAndLineNumberCEMFactory(); + try (CMakeErrorParser testee = new CMakeErrorParser(f)) { + String input = String.format(fmt, msgStart, filename); + testee.addInput(input); + } + assertEquals(1, f.markerCnt); + assertEquals(filename, f.filePath); + } + } + + /** + * Tests without the file name. + */ + @Test + public void testNoFilename() { + final String msgStart = "CMake Warning"; + final String message = " Have\\n some message text\\n until here"; + { + String fmt = "%1$s:%2$s"; + HasMessageCEMFactory f = new HasMessageCEMFactory(); + try (CMakeErrorParser testee = new CMakeErrorParser(f)) { + String input = String.format(fmt, msgStart, message); + testee.addInput(input); + } + assertEquals(1, f.markerCnt); + assertTrue("mgsStart", f.message.startsWith(msgStart)); + assertTrue("message", f.message.endsWith(message)); + } + } + + ///////////////////////////////////////////////////////////////////////////// + private static class CountingCMakeExecutionMarkerFactory implements ICMakeExecutionMarkerFactory { + int markerCnt = 0; + + @Override + public void createMarker(String message, int severity, String filePath, Map mandatoryAttributes) + throws CoreException { + Objects.requireNonNull(message, "message"); + Objects.requireNonNull(mandatoryAttributes, "mandatoryAttributes"); + markerCnt++; + } + } + + private static class HasFilenameAndLineNumberCEMFactory extends CountingCMakeExecutionMarkerFactory { + private String filePath; + private Object lineNumber; + + @Override + public void createMarker(String message, int severity, String filePath, Map mandatoryAttributes) + throws CoreException { + super.createMarker(message, severity, filePath, mandatoryAttributes); + this.filePath = filePath; + this.lineNumber = mandatoryAttributes.get(IMarker.LINE_NUMBER); + } + } + + private static class HasMessageCEMFactory extends CountingCMakeExecutionMarkerFactory { + private String message; + + @Override + public void createMarker(String message, int severity, String filePath, Map mandatoryAttributes) + throws CoreException { + super.createMarker(message, severity, filePath, mandatoryAttributes); + this.message = message; + } + } +} diff --git a/cmake/pom.xml b/cmake/pom.xml index 92e7e80c9e7..582dcc1c7d9 100644 --- a/cmake/pom.xml +++ b/cmake/pom.xml @@ -16,6 +16,7 @@ pom + org.eclipse.cdt.cmake.core.tests org.eclipse.cdt.cmake.is.core.doc org.eclipse.cdt.cmake.is.core org.eclipse.cdt.cmake.is.core.tests