diff --git a/cmake/org.eclipse.cdt.cmake.core/META-INF/MANIFEST.MF b/cmake/org.eclipse.cdt.cmake.core/META-INF/MANIFEST.MF index 88f217a2e85..140f7e7095d 100644 --- a/cmake/org.eclipse.cdt.cmake.core/META-INF/MANIFEST.MF +++ b/cmake/org.eclipse.cdt.cmake.core/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: %pluginName Bundle-SymbolicName: org.eclipse.cdt.cmake.core;singleton:=true -Bundle-Version: 1.4.0.qualifier +Bundle-Version: 1.4.100.qualifier Bundle-Activator: org.eclipse.cdt.cmake.core.internal.Activator Bundle-Vendor: %providerName Require-Bundle: org.eclipse.core.runtime, diff --git a/cmake/org.eclipse.cdt.cmake.is.core/src/org/eclipse/cdt/cmake/is/core/CompileCommandsJsonParser.java b/cmake/org.eclipse.cdt.cmake.is.core/src/org/eclipse/cdt/cmake/is/core/CompileCommandsJsonParser.java index 471ad734fd4..922edf9fb44 100644 --- a/cmake/org.eclipse.cdt.cmake.is.core/src/org/eclipse/cdt/cmake/is/core/CompileCommandsJsonParser.java +++ b/cmake/org.eclipse.cdt.cmake.is.core/src/org/eclipse/cdt/cmake/is/core/CompileCommandsJsonParser.java @@ -30,7 +30,6 @@ import org.eclipse.cdt.cmake.is.core.internal.ParserDetection; import org.eclipse.cdt.cmake.is.core.internal.ParserDetection.DetectorWithMethod; import org.eclipse.cdt.cmake.is.core.internal.ParserDetection.ParserDetectionResult; import org.eclipse.cdt.cmake.is.core.internal.Plugin; -import org.eclipse.cdt.cmake.is.core.internal.StringUtil; import org.eclipse.cdt.cmake.is.core.internal.builtins.CompilerBuiltinsDetector; import org.eclipse.cdt.cmake.is.core.participant.DefaultToolDetectionParticipant; import org.eclipse.cdt.cmake.is.core.participant.IRawIndexerInfo; @@ -225,7 +224,7 @@ public class CompileCommandsJsonParser { // CMake-notation (fileSep are forward slashes) final String cwdStr = sourceFileInfo.getDirectory(); IPath cwd = cwdStr != null ? Path.fromOSString(cwdStr) : new Path(""); //$NON-NLS-1$ - IResult result = parser.processArgs(cwd, StringUtil.trimLeadingWS(pdr.getReducedCommandLine())); + IResult result = parser.processArgs(cwd, pdr.getReducedCommandLine().stripLeading()); // remember result together with file name rememberFileResult(file, result); diff --git a/cmake/org.eclipse.cdt.cmake.is.core/src/org/eclipse/cdt/cmake/is/core/internal/StringUtil.java b/cmake/org.eclipse.cdt.cmake.is.core/src/org/eclipse/cdt/cmake/is/core/internal/StringUtil.java deleted file mode 100644 index b879c7484f8..00000000000 --- a/cmake/org.eclipse.cdt.cmake.is.core/src/org/eclipse/cdt/cmake/is/core/internal/StringUtil.java +++ /dev/null @@ -1,43 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2019 Martin Weber. - * - * 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. - * - * SPDX-License-Identifier: EPL-2.0 - *******************************************************************************/ - -package org.eclipse.cdt.cmake.is.core.internal; - -/** - * String manipulation functions. - * - * @author Martin Weber - */ -public class StringUtil { - - /** - * Just static methods. - * - */ - private StringUtil() { - } - - /** - * Returns a copy of the string, with leading whitespace omitted. - * - * @param string the string to remove whitespace from - * @return A copy of the string with leading white space removed, or the string - * if it has no leading white space. - */ - public static String trimLeadingWS(String string) { - int len = string.length(); - int st = 0; - - while ((st < len) && (string.charAt(st) <= ' ')) { - st++; - } - return st > 0 ? string.substring(st, len) : string; - } - -} diff --git a/cmake/org.eclipse.cdt.cmake.is.core/src/org/eclipse/cdt/cmake/is/core/participant/DefaultToolCommandlineParser.java b/cmake/org.eclipse.cdt.cmake.is.core/src/org/eclipse/cdt/cmake/is/core/participant/DefaultToolCommandlineParser.java index d94da445a77..ee65babe229 100644 --- a/cmake/org.eclipse.cdt.cmake.is.core/src/org/eclipse/cdt/cmake/is/core/participant/DefaultToolCommandlineParser.java +++ b/cmake/org.eclipse.cdt.cmake.is.core/src/org/eclipse/cdt/cmake/is/core/participant/DefaultToolCommandlineParser.java @@ -14,7 +14,6 @@ import java.util.Optional; import org.eclipse.cdt.cmake.is.core.internal.ParseContext; import org.eclipse.cdt.cmake.is.core.internal.Plugin; -import org.eclipse.cdt.cmake.is.core.internal.StringUtil; import org.eclipse.cdt.cmake.is.core.participant.builtins.IBuiltinsDetectionBehavior; import org.eclipse.core.runtime.IPath; import org.eclipse.core.runtime.Platform; @@ -124,7 +123,7 @@ public class DefaultToolCommandlineParser implements IToolCommandlineParser { @SuppressWarnings("nls") private IResult parseArguments(IResponseFileArglet responseFileArglet, String args) { // eat buildOutput string argument by argument.. - while (!(args = StringUtil.trimLeadingWS(args)).isEmpty()) { + while (!(args = args.stripLeading()).isEmpty()) { boolean argParsed = false; int consumed; // parse with first parser that can handle the first argument on the