diff --git a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/Command.java b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/Command.java index b3924ff9d6a..ecd20dca745 100644 --- a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/Command.java +++ b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/Command.java @@ -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 @@ -75,6 +75,7 @@ public class Command extends Directive implements ICommand { return false; } + @Override public String toString() { StringBuffer cmd = new StringBuffer(); cmd.append( '\t'); diff --git a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/Comment.java b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/Comment.java index 2f9fcc22fb1..c6c5ca9ef3c 100644 --- a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/Comment.java +++ b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/Comment.java @@ -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 @@ -25,6 +25,7 @@ public class Comment extends Directive implements IComment { } } + @Override public String toString() { StringBuffer buffer = new StringBuffer(); buffer.append(POUND_STRING).append(comment).append('\n'); diff --git a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/Directive.java b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/Directive.java index 33e098997a4..f5f7ea0b0b0 100644 --- a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/Directive.java +++ b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/Directive.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2008 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 @@ -27,6 +27,7 @@ public abstract class Directive implements IDirective { setLines(start, end); } + @Override public abstract String toString(); /* (non-Javadoc) diff --git a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/EmptyLine.java b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/EmptyLine.java index c9af2cfe061..1b5439f435b 100644 --- a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/EmptyLine.java +++ b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/EmptyLine.java @@ -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 EmptyLine extends Directive implements IEmptyLine { super(parent); } + @Override public String toString() { return NL_STRING; } diff --git a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/NullMakefile.java b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/NullMakefile.java index 813f4fb5345..dbe0a139aca 100644 --- a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/NullMakefile.java +++ b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/NullMakefile.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2008 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 @@ -41,10 +41,12 @@ public class NullMakefile extends AbstractMakefile { super(null); } + @Override public IDirective[] getDirectives() { return EMPTY_DIRECTIVES; } + @Override public IDirective[] getBuiltins() { return EMPTY_DIRECTIVES; } @@ -52,6 +54,7 @@ public class NullMakefile extends AbstractMakefile { public void addDirective(IDirective directive) { } + @Override public String toString() { return new String(); } diff --git a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/Parent.java b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/Parent.java index 9df6bc07efe..f4ba6cebcf4 100644 --- a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/Parent.java +++ b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/makefile/Parent.java @@ -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,7 +22,7 @@ import org.eclipse.cdt.make.core.makefile.IDirective; public abstract class Parent extends Directive implements IParent { - ArrayList children = new ArrayList(); + ArrayList children = new ArrayList(); public Parent(Directive parent) { super(parent); @@ -34,7 +34,7 @@ public abstract class Parent extends Directive implements IParent { public IDirective[] getDirectives() { children.trimToSize(); - return (IDirective[]) children.toArray(new IDirective[0]); + return children.toArray(new IDirective[0]); } public void addDirective(Directive directive) { @@ -57,12 +57,13 @@ public abstract class Parent extends Directive implements IParent { public Directive[] getStatements() { children.trimToSize(); - return (Directive[]) children.toArray(new Directive[0]); + return children.toArray(new Directive[0]); } /* (non-Javadoc) * @see java.lang.Object#toString() */ + @Override public String toString() { StringBuffer sb = new StringBuffer(); IDirective[] directives = getDirectives(); diff --git a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig/CDataDiscoveredInfoProcessor.java b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig/CDataDiscoveredInfoProcessor.java index bea81a68149..60a1179ca04 100644 --- a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig/CDataDiscoveredInfoProcessor.java +++ b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig/CDataDiscoveredInfoProcessor.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2007 Intel Corporation and others. + * Copyright (c) 2007, 2010 Intel Corporation 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 @@ -11,8 +11,9 @@ package org.eclipse.cdt.make.internal.core.scannerconfig; import java.util.Arrays; -import java.util.Iterator; import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; import org.eclipse.cdt.core.settings.model.ICSettingBase; import org.eclipse.cdt.core.settings.model.extension.CConfigurationData; @@ -32,7 +33,7 @@ import org.eclipse.core.runtime.Path; public abstract class CDataDiscoveredInfoProcessor { public void applyDiscoveredInfo(CConfigurationData cfgData, DiscoveredSettingInfo dsIinfo){ - Map map = CDataUtil.createPathRcDataMap(cfgData); + Map map = CDataUtil.createPathRcDataMap(cfgData); IRcSettingInfo info; PathSettingsContainer cr = PathSettingsContainer.createRootContainer(); @@ -46,7 +47,7 @@ public abstract class CDataDiscoveredInfoProcessor { } if(map.size() != 0){ - CResourceData rcData = (CResourceData)map.get(Path.EMPTY); + CResourceData rcData = map.get(Path.EMPTY); if(rcData != null){ info = CDataDiscoveredInfoCalculator.createEmptyRcSettingInfo((CFolderData)rcData); applyInfo(cfgData, info, cr); @@ -54,11 +55,11 @@ public abstract class CDataDiscoveredInfoProcessor { } if(map.size() != 0){ - for(Iterator iter = map.entrySet().iterator(); iter.hasNext();){ - Map.Entry entry = (Map.Entry)iter.next(); - IPath path = (IPath)entry.getKey(); + Set> entries = map.entrySet(); + for (Entry entry : entries) { + IPath path = entry.getKey(); PathSettingsContainer curCr = cr.getChildContainer(path, false, false); - rcData = (CResourceData)entry.getValue(); + rcData = entry.getValue(); info = (IRcSettingInfo)curCr.getValue(); applyInfo(cfgData, rcData, info); } diff --git a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig/DiscoveredPathManager.java b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig/DiscoveredPathManager.java index d965bfacfcb..df1a9d2a37d 100644 --- a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig/DiscoveredPathManager.java +++ b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig/DiscoveredPathManager.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2004, 2007 QNX Software Systems and others. + * Copyright (c) 2004, 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 @@ -59,7 +59,7 @@ public class DiscoveredPathManager implements IDiscoveredPathManager, IResourceC // PathSettingsContainer fContainer = PathSettingsContainer.createRootContainer(); public IDiscoveredPathInfo getInfo(InfoContext context){ - return (IDiscoveredPathInfo)fInfoMap.get(context); + return fInfoMap.get(context); } // private Map getMap(IPath path, boolean create, boolean exactPath){ @@ -90,8 +90,8 @@ public class DiscoveredPathManager implements IDiscoveredPathManager, IResourceC public IDiscoveredPathInfo setInfo(InfoContext context, IDiscoveredPathInfo info){ if(info != null) - return (IDiscoveredPathInfo)fInfoMap.put(context, info); - return (IDiscoveredPathInfo)fInfoMap.remove(context); + return fInfoMap.put(context, info); + return fInfoMap.remove(context); } } @@ -154,7 +154,7 @@ public class DiscoveredPathManager implements IDiscoveredPathManager, IResourceC } private DiscoveredInfoHolder getHolder(IProject project, boolean create){ - DiscoveredInfoHolder holder = (DiscoveredInfoHolder)fDiscoveredInfoHolderMap.get(project); + DiscoveredInfoHolder holder = fDiscoveredInfoHolderMap.get(project); if(holder == null && create){ holder = new DiscoveredInfoHolder(); fDiscoveredInfoHolderMap.put(project, holder); @@ -274,7 +274,7 @@ public class DiscoveredPathManager implements IDiscoveredPathManager, IResourceC // 1. clear DiscoveredPathManager's path info cache DiscoveredInfoHolder holder = getHolder(project, false); InfoContext context = new InfoContext(project); - IDiscoveredPathInfo oldInfo = (IDiscoveredPathInfo) holder.getInfo(context); + IDiscoveredPathInfo oldInfo = holder.getInfo(context); // 2. switch the containers try { diff --git a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig2/DefaultRunSIProvider.java b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig2/DefaultRunSIProvider.java index 588a61638ee..c2bd410e05a 100644 --- a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig2/DefaultRunSIProvider.java +++ b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig2/DefaultRunSIProvider.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2004, 2009 IBM Corporation and others. + * Copyright (c) 2004, 2010 IBM Corporation 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 @@ -148,7 +148,7 @@ public class DefaultRunSIProvider implements IExternalScannerInfoProvider { cos.close(); } catch (Exception e) { - CCorePlugin.log(e); + MakeCorePlugin.log(e); } finally { monitor.done(); diff --git a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig2/DefaultSIFileReader.java b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig2/DefaultSIFileReader.java index 372c2b84da9..ac4803ebd37 100644 --- a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig2/DefaultSIFileReader.java +++ b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig2/DefaultSIFileReader.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2004, 2008 IBM Corporation and others. + * Copyright (c) 2004, 2010 IBM Corporation 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 @@ -88,7 +88,7 @@ public class DefaultSIFileReader implements IExternalScannerInfoProvider { ConsoleOutputSniffer sniffer = ScannerInfoConsoleParserFactory. getMakeBuilderOutputSniffer(ostream, null, project, context, buildDirectory, buildInfo, markerGenerator, collector); if (sniffer != null) { - ostream = (sniffer == null ? null : sniffer.getOutputStream()); + ostream = sniffer.getOutputStream(); } if (ostream != null) {