mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-29 19:45:01 +02:00
compilation warnings
This commit is contained in:
parent
906c0d3869
commit
ae1955efc0
8 changed files with 51 additions and 49 deletions
|
@ -129,7 +129,7 @@ public class MakeCorePlugin extends Plugin {
|
|||
return BuildInfoFactory.create(project, builderID);
|
||||
}
|
||||
|
||||
public static IMakeBuilderInfo createBuildInfo(Map args, String builderID) {
|
||||
public static IMakeBuilderInfo createBuildInfo(Map<String, String> args, String builderID) {
|
||||
return BuildInfoFactory.create(args, builderID);
|
||||
}
|
||||
|
||||
|
@ -149,11 +149,11 @@ public class MakeCorePlugin extends Plugin {
|
|||
public String[] getMakefileDirs() {
|
||||
String stringList = getPluginPreferences().getString(MAKEFILE_DIRS);
|
||||
StringTokenizer st = new StringTokenizer(stringList, File.pathSeparator + "\n\r");//$NON-NLS-1$
|
||||
ArrayList v = new ArrayList();
|
||||
ArrayList<String> v = new ArrayList<String>();
|
||||
while (st.hasMoreElements()) {
|
||||
v.add(st.nextElement());
|
||||
v.add(st.nextToken());
|
||||
}
|
||||
return (String[])v.toArray(new String[v.size()]);
|
||||
return v.toArray(new String[v.size()]);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -163,15 +163,16 @@ public class MakeCorePlugin extends Plugin {
|
|||
* @param makefileDirs
|
||||
* @return
|
||||
*/
|
||||
@Deprecated
|
||||
static public IMakefile createMakefile(File file, boolean isGnuStyle, String[] makefileDirs) {
|
||||
IMakefile makefile;
|
||||
if (isGnuStyle) {
|
||||
GNUMakefile gnu = new GNUMakefile();
|
||||
ArrayList includeList = new ArrayList();
|
||||
ArrayList<String> includeList = new ArrayList<String>();
|
||||
includeList.add(new Path(file.getAbsolutePath()).removeLastSegments(1).toOSString());
|
||||
includeList.addAll(Arrays.asList(gnu.getIncludeDirectories()));
|
||||
includeList.addAll(Arrays.asList(makefileDirs));
|
||||
String[] includes = (String[]) includeList.toArray(new String[includeList.size()]);
|
||||
String[] includes = includeList.toArray(new String[includeList.size()]);
|
||||
gnu.setIncludeDirectories(includes);
|
||||
try {
|
||||
gnu.parse(file.getAbsolutePath(), new FileReader(file));
|
||||
|
@ -208,11 +209,11 @@ public class MakeCorePlugin extends Plugin {
|
|||
IMakefile makefile;
|
||||
if (isGnuStyle) {
|
||||
GNUMakefile gnu = new GNUMakefile();
|
||||
ArrayList includeList = new ArrayList();
|
||||
ArrayList<String> includeList = new ArrayList<String>();
|
||||
includeList.add(new Path(fileURI.getPath()).removeLastSegments(1).toString());
|
||||
includeList.addAll(Arrays.asList(gnu.getIncludeDirectories()));
|
||||
includeList.addAll(Arrays.asList(makefileDirs));
|
||||
String[] includes = (String[]) includeList.toArray(new String[includeList.size()]);
|
||||
String[] includes = includeList.toArray(new String[includeList.size()]);
|
||||
gnu.setIncludeDirectories(includes);
|
||||
try {
|
||||
gnu.parse(fileURI, makefileReaderProvider);
|
||||
|
@ -247,6 +248,7 @@ public class MakeCorePlugin extends Plugin {
|
|||
return createMakefile(EFS.getStore(file.getLocationURI()), isMakefileGNUStyle(), getMakefileDirs());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void stop(BundleContext context) throws Exception {
|
||||
try {
|
||||
if ( fTargetManager != null) {
|
||||
|
@ -278,7 +280,7 @@ public class MakeCorePlugin extends Plugin {
|
|||
}
|
||||
|
||||
public static IScannerConfigBuilderInfo createScannerConfigBuildInfo(
|
||||
Map args, String builderID) {
|
||||
Map<String, String> args, String builderID) {
|
||||
return ScannerConfigInfoFactory.create(args, builderID);
|
||||
}
|
||||
|
||||
|
@ -336,7 +338,7 @@ public class MakeCorePlugin extends Plugin {
|
|||
IExtensionPoint extension = Platform.getExtensionRegistry().getExtensionPoint(PLUGIN_ID, SI_CONSOLE_PARSER_SIMPLE_ID);
|
||||
if (extension != null) {
|
||||
IExtension[] extensions = extension.getExtensions();
|
||||
List parserIds = new ArrayList(extensions.length);
|
||||
List<String> parserIds = new ArrayList<String>(extensions.length);
|
||||
for (int i = 0; i < extensions.length; i++) {
|
||||
String parserId = extensions[i].getUniqueIdentifier();
|
||||
if (parserId != null) {
|
||||
|
@ -347,7 +349,7 @@ public class MakeCorePlugin extends Plugin {
|
|||
}
|
||||
}
|
||||
}
|
||||
return (String[])parserIds.toArray(empty);
|
||||
return parserIds.toArray(empty);
|
||||
}
|
||||
return empty;
|
||||
}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*******************************************************************************
|
||||
* Copyright (c) 2000, 2006 QNX Software Systems and others.
|
||||
* Copyright (c) 2000, 2010 QNX Software Systems and others.
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Eclipse Public License v1.0
|
||||
* which accompanies this distribution, and is available at
|
||||
|
@ -53,6 +53,7 @@ public class StreamMonitor extends OutputStream {
|
|||
/**
|
||||
* @see java.io.OutputStream#close()
|
||||
*/
|
||||
@Override
|
||||
public void close() throws IOException {
|
||||
if (console != null) {
|
||||
console.close();
|
||||
|
@ -63,6 +64,7 @@ public class StreamMonitor extends OutputStream {
|
|||
/**
|
||||
* @see java.io.OutputStream#flush()
|
||||
*/
|
||||
@Override
|
||||
public void flush() throws IOException {
|
||||
if (console != null) {
|
||||
console.flush();
|
||||
|
@ -72,6 +74,7 @@ public class StreamMonitor extends OutputStream {
|
|||
/**
|
||||
* @see java.io.OutputStream#write(int)
|
||||
*/
|
||||
@Override
|
||||
public synchronized void write(int b) throws IOException {
|
||||
if (console != null) {
|
||||
console.write(b);
|
||||
|
@ -82,6 +85,7 @@ public class StreamMonitor extends OutputStream {
|
|||
/**
|
||||
* @see java.io.OutputStream#write(...)
|
||||
*/
|
||||
@Override
|
||||
public synchronized void write(byte[] b, int off, int len) throws IOException {
|
||||
if (b == null) {
|
||||
throw new NullPointerException();
|
||||
|
|
|
@ -21,6 +21,7 @@ public class BadDirective extends Directive implements IBadDirective {
|
|||
line = s;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return line;
|
||||
}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*******************************************************************************
|
||||
* Copyright (c) 2000, 2006 QNX Software Systems and others.
|
||||
* Copyright (c) 2000, 2010 QNX Software Systems and others.
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Eclipse Public License v1.0
|
||||
* which accompanies this distribution, and is available at
|
||||
|
@ -33,13 +33,13 @@ public abstract class Rule extends Parent implements IRule {
|
|||
|
||||
public ICommand[] getCommands() {
|
||||
IDirective[] directives = getDirectives();
|
||||
ArrayList cmds = new ArrayList(directives.length);
|
||||
ArrayList<IDirective> cmds = new ArrayList<IDirective>(directives.length);
|
||||
for (int i = 0; i < directives.length; i++) {
|
||||
if (directives[i] instanceof ICommand) {
|
||||
cmds.add(directives[i]);
|
||||
}
|
||||
}
|
||||
return (ICommand[])cmds.toArray(new ICommand[0]);
|
||||
return cmds.toArray(new ICommand[0]);
|
||||
}
|
||||
|
||||
public ITarget getTarget() {
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*******************************************************************************
|
||||
* Copyright (c) 2000, 2006 QNX Software Systems and others.
|
||||
* Copyright (c) 2000, 2010 QNX Software Systems and others.
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Eclipse Public License v1.0
|
||||
* which accompanies this distribution, and is available at
|
||||
|
@ -22,6 +22,7 @@ public class UnExport extends Directive implements IUnExport {
|
|||
variable = var;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuffer sb = new StringBuffer(GNUMakefileConstants.DIRECTIVE_UNEXPORT);
|
||||
sb.append(' ').append(variable);
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*******************************************************************************
|
||||
* Copyright (c) 2000, 2006 QNX Software Systems and others.
|
||||
* Copyright (c) 2000, 2010 QNX Software Systems and others.
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Eclipse Public License v1.0
|
||||
* which accompanies this distribution, and is available at
|
||||
|
@ -48,6 +48,7 @@ public class VariableDefinition extends MacroDefinition implements IVariableDefi
|
|||
/**
|
||||
* @see java.lang.Object#toString()
|
||||
*/
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuffer sb = new StringBuffer();
|
||||
if (isTargetSpecific()) {
|
||||
|
|
|
@ -13,6 +13,11 @@ package org.eclipse.cdt.make.internal.core.scannerconfig;
|
|||
|
||||
import java.util.Map;
|
||||
|
||||
import org.eclipse.cdt.make.core.MakeCorePlugin;
|
||||
import org.eclipse.cdt.make.core.MakeProjectNature;
|
||||
import org.eclipse.cdt.make.core.scannerconfig.IScannerConfigBuilderInfo;
|
||||
import org.eclipse.cdt.make.core.scannerconfig.ScannerConfigNature;
|
||||
import org.eclipse.cdt.make.internal.core.MakeMessages;
|
||||
import org.eclipse.core.resources.ICommand;
|
||||
import org.eclipse.core.resources.IProject;
|
||||
import org.eclipse.core.resources.IProjectDescription;
|
||||
|
@ -25,12 +30,6 @@ import org.eclipse.core.runtime.Path;
|
|||
import org.eclipse.core.runtime.Platform;
|
||||
import org.eclipse.core.runtime.Preferences;
|
||||
import org.eclipse.core.runtime.Status;
|
||||
import org.eclipse.cdt.make.core.MakeCorePlugin;
|
||||
import org.eclipse.cdt.make.core.MakeProjectNature;
|
||||
import org.eclipse.cdt.make.core.scannerconfig.IScannerConfigBuilderInfo;
|
||||
import org.eclipse.cdt.make.core.scannerconfig.ScannerConfigNature;
|
||||
import org.eclipse.cdt.make.internal.core.MakeMessages;
|
||||
import org.eclipse.cdt.make.internal.core.scannerconfig2.ScannerConfigProfileManager;
|
||||
|
||||
/**
|
||||
* Creates a ScannerConfigBuilderInfo variant
|
||||
|
@ -227,24 +226,6 @@ public class ScannerConfigInfoFactory {
|
|||
putString(SI_PROBLEM_GENERATION_ENABLED, Boolean.toString(enabled));
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.make.core.scannerconfig.IScannerConfigBuilderInfo#getProfileId()
|
||||
*/
|
||||
public String getProfileId() {
|
||||
String profileId = getString(SI_PROFILE_ID);
|
||||
if (profileId == null || profileId.length() == 0) {
|
||||
profileId = ScannerConfigProfileManager.getDefaultSIProfileId();
|
||||
// the default is the first one in the registry
|
||||
}
|
||||
return profileId;
|
||||
}
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.make.core.scannerconfig.IScannerConfigBuilderInfo#setProfileId(java.lang.String)
|
||||
*/
|
||||
public void setProfileId(String profileId) throws CoreException {
|
||||
putString(SI_PROFILE_ID, profileId);
|
||||
}
|
||||
|
||||
protected boolean getBoolean(String property) {
|
||||
return Boolean.valueOf(getString(property)).booleanValue();
|
||||
}
|
||||
|
@ -287,6 +268,7 @@ public class ScannerConfigInfoFactory {
|
|||
this.useDefaults = useDefaults;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void putString(String name, String value) {
|
||||
if (useDefaults) {
|
||||
prefs.setDefault(name, value);
|
||||
|
@ -295,6 +277,7 @@ public class ScannerConfigInfoFactory {
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String getString(String property) {
|
||||
if (useDefaults) {
|
||||
return prefs.getDefaultString(property);
|
||||
|
@ -302,6 +285,7 @@ public class ScannerConfigInfoFactory {
|
|||
return prefs.getString(property);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String getBuilderID() {
|
||||
return builderID;
|
||||
}
|
||||
|
@ -310,7 +294,7 @@ public class ScannerConfigInfoFactory {
|
|||
private static class BuildProperty extends Store {
|
||||
private IProject project;
|
||||
private String builderID;
|
||||
private Map args;
|
||||
private Map<String, String> args;
|
||||
|
||||
BuildProperty(IProject project, String builderID) throws CoreException {
|
||||
this.project = project;
|
||||
|
@ -322,11 +306,14 @@ public class ScannerConfigInfoFactory {
|
|||
MakeMessages.getString("ScannerConfigInfoFactory.Missing_Builder")//$NON-NLS-1$
|
||||
+ builderID, null));
|
||||
}
|
||||
args = builder.getArguments();
|
||||
@SuppressWarnings("unchecked")
|
||||
Map<String,String> bArgs = builder.getArguments();
|
||||
args = bArgs;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void putString(String name, String value) throws CoreException {
|
||||
String curValue = (String) args.get(name);
|
||||
String curValue = args.get(name);
|
||||
if (curValue != null && curValue.equals(value)) {
|
||||
return;
|
||||
}
|
||||
|
@ -338,33 +325,38 @@ public class ScannerConfigInfoFactory {
|
|||
project.setDescription(description, null);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String getString(String name) {
|
||||
String value = (String) args.get(name);
|
||||
String value = args.get(name);
|
||||
return value == null ? "" : value; //$NON-NLS-1$
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String getBuilderID() {
|
||||
return builderID;
|
||||
}
|
||||
}
|
||||
|
||||
private static class BuildArguments extends Store {
|
||||
private Map args;
|
||||
private Map<String, String> args;
|
||||
private String builderID;
|
||||
|
||||
BuildArguments(Map args, String builderID) {
|
||||
BuildArguments(Map<String, String> args, String builderID) {
|
||||
this.args = args;
|
||||
this.builderID = builderID;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void putString(String name, String value) {
|
||||
args.put(name, value);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String getString(String name) {
|
||||
return (String) args.get(name);
|
||||
return args.get(name);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String getBuilderID() {
|
||||
return builderID;
|
||||
}
|
||||
|
@ -378,7 +370,7 @@ public class ScannerConfigInfoFactory {
|
|||
return new ScannerConfigInfoFactory.BuildProperty(project, builderID);
|
||||
}
|
||||
|
||||
public static IScannerConfigBuilderInfo create(Map args, String builderID) {
|
||||
public static IScannerConfigBuilderInfo create(Map<String, String> args, String builderID) {
|
||||
return new ScannerConfigInfoFactory.BuildArguments(args, builderID);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -52,6 +52,7 @@ public class BuildOutputReaderJob extends Job {
|
|||
/* (non-Javadoc)
|
||||
* @see org.eclipse.core.internal.jobs.InternalJob#run(org.eclipse.core.runtime.IProgressMonitor)
|
||||
*/
|
||||
@Override
|
||||
protected IStatus run(IProgressMonitor monitor) {
|
||||
IProject project = resource.getProject();
|
||||
monitor.beginTask(MakeMessages.getString("ScannerConfigBuilder.Invoking_Builder"), 100); //$NON-NLS-1$
|
||||
|
|
Loading…
Add table
Reference in a new issue