mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-23 14:42:11 +02:00
[263133] refactoring for java 1.5 (patch applied)
This commit is contained in:
parent
91c9f2840c
commit
d5b8322626
6 changed files with 109 additions and 101 deletions
|
@ -31,6 +31,7 @@ public interface IMakeCommonBuildInfo {
|
|||
/**
|
||||
* @deprecated - use setBuildString(BUILD_LOCATION...)
|
||||
*/
|
||||
@Deprecated
|
||||
void setBuildLocation(IPath location) throws CoreException;
|
||||
|
||||
boolean isStopOnError();
|
||||
|
@ -44,6 +45,7 @@ public interface IMakeCommonBuildInfo {
|
|||
/**
|
||||
* @deprecated - use setBuildString(BUILD_COMMAND...)
|
||||
*/
|
||||
@Deprecated
|
||||
void setBuildCommand(IPath command) throws CoreException;
|
||||
|
||||
String getBuildArguments();
|
||||
|
@ -51,15 +53,16 @@ public interface IMakeCommonBuildInfo {
|
|||
/**
|
||||
* @deprecated - use setBuildString(BUILD_ARGUMENTS...)
|
||||
*/
|
||||
@Deprecated
|
||||
void setBuildArguments(String args) throws CoreException;
|
||||
|
||||
String[] getErrorParsers();
|
||||
void setErrorParsers(String[] parsers) throws CoreException;
|
||||
|
||||
Map getExpandedEnvironment() throws CoreException;
|
||||
Map<String, String> getExpandedEnvironment() throws CoreException;
|
||||
|
||||
Map getEnvironment();
|
||||
void setEnvironment(Map env) throws CoreException;
|
||||
Map<String, String> getEnvironment();
|
||||
void setEnvironment(Map<String, String> env) throws CoreException;
|
||||
|
||||
boolean appendEnvironment();
|
||||
void setAppendEnvironment(boolean append) throws CoreException;
|
||||
|
|
|
@ -15,6 +15,8 @@ import java.util.EventObject;
|
|||
import org.eclipse.core.resources.IProject;
|
||||
|
||||
public class MakeTargetEvent extends EventObject {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public static final int TARGET_ADD = 1;
|
||||
public static final int TARGET_CHANGED = 2;
|
||||
public static final int TARGET_REMOVED = 3;
|
||||
|
|
|
@ -42,11 +42,10 @@ public class MakeProject implements ICOwner {
|
|||
private void updateBinaryParsers(ICDescriptor cDescriptor) throws CoreException {
|
||||
cDescriptor.remove(CCorePlugin.BINARY_PARSER_UNIQ_ID);
|
||||
Preferences makePrefs = MakeCorePlugin.getDefault().getPluginPreferences();
|
||||
String id = makePrefs.getString(CCorePlugin.PREF_BINARY_PARSER);
|
||||
if (id != null && id.length() != 0) {
|
||||
String[] ids = parseStringToArray(id);
|
||||
for (int i = 0; i < ids.length; i++) {
|
||||
cDescriptor.create(CCorePlugin.BINARY_PARSER_UNIQ_ID, ids[i]);
|
||||
String ids = makePrefs.getString(CCorePlugin.PREF_BINARY_PARSER);
|
||||
if (ids != null && ids.length() != 0) {
|
||||
for (String id : parseStringToArray(ids)) {
|
||||
cDescriptor.create(CCorePlugin.BINARY_PARSER_UNIQ_ID, id);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -54,11 +53,10 @@ public class MakeProject implements ICOwner {
|
|||
private void updateIndexers(ICDescriptor cDescriptor) throws CoreException {
|
||||
cDescriptor.remove(CCorePlugin.INDEXER_UNIQ_ID);
|
||||
Preferences corePrefs = CCorePlugin.getDefault().getPluginPreferences();
|
||||
String id = corePrefs.getString(CCorePlugin.PREF_INDEXER);
|
||||
if (id != null && id.length() != 0) {
|
||||
String[] ids = parseStringToArray(id);
|
||||
for (int i = 0; i < ids.length; i++) {
|
||||
cDescriptor.create(CCorePlugin.INDEXER_UNIQ_ID, ids[i]);
|
||||
String ids = corePrefs.getString(CCorePlugin.PREF_INDEXER);
|
||||
if (ids != null && ids.length() != 0) {
|
||||
for (String id : parseStringToArray(ids)) {
|
||||
cDescriptor.create(CCorePlugin.INDEXER_UNIQ_ID, id);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -66,11 +64,11 @@ public class MakeProject implements ICOwner {
|
|||
private String[] parseStringToArray(String syms) {
|
||||
if (syms != null && syms.length() > 0) {
|
||||
StringTokenizer tok = new StringTokenizer(syms, ";"); //$NON-NLS-1$
|
||||
ArrayList list = new ArrayList(tok.countTokens());
|
||||
ArrayList<String> list = new ArrayList<String>(tok.countTokens());
|
||||
while (tok.hasMoreElements()) {
|
||||
list.add(tok.nextToken());
|
||||
}
|
||||
return (String[]) list.toArray(new String[list.size()]);
|
||||
return list.toArray(new String[list.size()]);
|
||||
}
|
||||
return new String[0];
|
||||
}
|
||||
|
|
|
@ -32,7 +32,9 @@ public class MakeRecon extends OutputStream {
|
|||
MyList log;
|
||||
StringBuffer currentLine;
|
||||
|
||||
class MyList extends ArrayList {
|
||||
class MyList extends ArrayList<String> {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public void removeInterval (int start, int len) {
|
||||
removeRange(start, len);
|
||||
}
|
||||
|
@ -108,6 +110,7 @@ public class MakeRecon extends OutputStream {
|
|||
/**
|
||||
* @see java.io.OutputStream#close()
|
||||
*/
|
||||
@Override
|
||||
public void close() throws IOException {
|
||||
if (console != null) {
|
||||
console.close();
|
||||
|
@ -118,6 +121,7 @@ public class MakeRecon extends OutputStream {
|
|||
/**
|
||||
* @see java.io.OutputStream#flush()
|
||||
*/
|
||||
@Override
|
||||
public void flush() throws IOException {
|
||||
if (console != null) {
|
||||
console.flush();
|
||||
|
@ -127,6 +131,7 @@ public class MakeRecon extends OutputStream {
|
|||
/**
|
||||
* @see java.io.OutputStream#write(int)
|
||||
*/
|
||||
@Override
|
||||
public synchronized void write(int b) throws IOException {
|
||||
currentLine.append((char) b);
|
||||
checkProgress(false);
|
||||
|
@ -138,6 +143,7 @@ public class MakeRecon 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();
|
||||
|
@ -174,7 +180,7 @@ public class MakeRecon extends OutputStream {
|
|||
private void processLine(String line) {
|
||||
int found = -1;
|
||||
for (int i = 0; i < log.size(); i++) {
|
||||
String s = (String)log.get(i);
|
||||
String s = log.get(i);
|
||||
if (s.startsWith(line)) {
|
||||
found = i;
|
||||
break;
|
||||
|
@ -182,7 +188,7 @@ public class MakeRecon extends OutputStream {
|
|||
}
|
||||
|
||||
if (found != -1) {
|
||||
String show = (String)log.get(found);
|
||||
String show = log.get(found);
|
||||
if (show.length() > 50) {
|
||||
show = show.substring(0, 50);
|
||||
}
|
||||
|
|
|
@ -12,8 +12,8 @@
|
|||
package org.eclipse.cdt.make.internal.core;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Iterator;
|
||||
import java.util.Map;
|
||||
import java.util.Map.Entry;
|
||||
|
||||
import org.eclipse.cdt.make.core.IMakeBuilderInfo;
|
||||
import org.eclipse.cdt.make.core.IMakeCommonBuildInfo;
|
||||
|
@ -44,12 +44,12 @@ public class MakeTarget extends PlatformObject implements IMakeTarget {
|
|||
private boolean isDefaultBuildCmd;
|
||||
private boolean isStopOnError;
|
||||
boolean runAllBuidlers = true;
|
||||
private String targetBuilderID;
|
||||
private final String targetBuilderID;
|
||||
private IContainer container;
|
||||
private int appendEnvironment = USE_PROJECT_ENV_SETTING;
|
||||
private boolean appendProjectEnvironment = true;
|
||||
private Map buildEnvironment = new HashMap();
|
||||
private Map targetAttributes = new HashMap();
|
||||
private Map<String, String> buildEnvironment = new HashMap<String, String>();
|
||||
private final Map<String, String> targetAttributes = new HashMap<String, String>();
|
||||
|
||||
MakeTarget(MakeTargetManager manager, IProject project, String targetBuilderID, String name) throws CoreException {
|
||||
this.manager = manager;
|
||||
|
@ -75,7 +75,7 @@ public class MakeTarget extends PlatformObject implements IMakeTarget {
|
|||
this.name = name;
|
||||
}
|
||||
|
||||
Map getAttributeMap() {
|
||||
Map<String, String> getAttributeMap() {
|
||||
return targetAttributes;
|
||||
}
|
||||
|
||||
|
@ -167,7 +167,7 @@ public class MakeTarget extends PlatformObject implements IMakeTarget {
|
|||
}
|
||||
|
||||
public String getBuildAttribute(String name, String defaultValue) {
|
||||
String value = (String)targetAttributes.get(name);
|
||||
String value = targetAttributes.get(name);
|
||||
return value != null ? value : defaultValue;
|
||||
}
|
||||
|
||||
|
@ -193,8 +193,8 @@ public class MakeTarget extends PlatformObject implements IMakeTarget {
|
|||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
public Map getExpandedEnvironment() throws CoreException {
|
||||
Map env = null;
|
||||
public Map<String, String> getExpandedEnvironment() throws CoreException {
|
||||
Map<String, String> env = null;
|
||||
if (appendProjectEnvironment()) {
|
||||
IMakeBuilderInfo projectInfo;
|
||||
projectInfo = MakeCorePlugin.createBuildInfo(getProject(), manager.getBuilderID(targetBuilderID));
|
||||
|
@ -205,18 +205,17 @@ public class MakeTarget extends PlatformObject implements IMakeTarget {
|
|||
} else {
|
||||
env.putAll(getEnvironment());
|
||||
}
|
||||
HashMap envMap = new HashMap(env.entrySet().size());
|
||||
Iterator iter = env.entrySet().iterator();
|
||||
|
||||
HashMap<String, String> envMap = new HashMap<String, String>(env.entrySet().size());
|
||||
boolean win32 = Platform.getOS().equals(Constants.OS_WIN32);
|
||||
while (iter.hasNext()) {
|
||||
Map.Entry entry = (Map.Entry)iter.next();
|
||||
String key = (String)entry.getKey();
|
||||
for (Entry<String, String> entry : env.entrySet()) {
|
||||
String key = entry.getKey();
|
||||
if (win32) {
|
||||
// Win32 vars are case insensitive. Uppercase everything so
|
||||
// that (for example) "pAtH" will correctly replace "PATH"
|
||||
key = key.toUpperCase();
|
||||
}
|
||||
String value = (String)entry.getValue();
|
||||
String value = entry.getValue();
|
||||
// translate any string substitution variables
|
||||
String translated = value;
|
||||
translated = VariablesPlugin.getDefault().getStringVariableManager().performStringSubstitution(value, false);
|
||||
|
@ -233,12 +232,12 @@ public class MakeTarget extends PlatformObject implements IMakeTarget {
|
|||
appendProjectEnvironment = append;
|
||||
}
|
||||
|
||||
public Map getEnvironment() {
|
||||
public Map<String, String> getEnvironment() {
|
||||
return buildEnvironment;
|
||||
}
|
||||
|
||||
public void setEnvironment(Map env) throws CoreException {
|
||||
buildEnvironment = new HashMap(env);
|
||||
public void setEnvironment(Map<String, String> env) throws CoreException {
|
||||
buildEnvironment = new HashMap<String, String>(env);
|
||||
manager.updateTarget(this);
|
||||
}
|
||||
|
||||
|
@ -265,6 +264,7 @@ public class MakeTarget extends PlatformObject implements IMakeTarget {
|
|||
return container;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object obj) {
|
||||
if (obj == this)
|
||||
return true;
|
||||
|
@ -275,13 +275,14 @@ public class MakeTarget extends PlatformObject implements IMakeTarget {
|
|||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return container.hashCode() * 17 + name != null ? name.hashCode(): 0;
|
||||
}
|
||||
|
||||
public void build(IProgressMonitor monitor) throws CoreException {
|
||||
final String builderID = manager.getBuilderID(targetBuilderID);
|
||||
final HashMap infoMap = new HashMap();
|
||||
final HashMap<String, String> infoMap = new HashMap<String, String>();
|
||||
|
||||
IMakeBuilderInfo info = MakeCorePlugin.createBuildInfo(infoMap, builderID);
|
||||
info.setBuildAttribute(IMakeCommonBuildInfo.BUILD_COMMAND, getBuildAttribute(IMakeCommonBuildInfo.BUILD_COMMAND, "make")); //$NON-NLS-1$
|
||||
|
@ -309,12 +310,12 @@ public class MakeTarget extends PlatformObject implements IMakeTarget {
|
|||
if (runAllBuidlers) {
|
||||
ICommand[] commands = project.getDescription().getBuildSpec();
|
||||
monitor.beginTask("", commands.length); //$NON-NLS-1$
|
||||
for (int i = 0; i < commands.length; i++) {
|
||||
if (commands[i].getBuilderName().equals(builderID)) {
|
||||
for (ICommand command : commands) {
|
||||
if (command.getBuilderName().equals(builderID)) {
|
||||
project.build(IncrementalProjectBuilder.FULL_BUILD, builderID, infoMap, new SubProgressMonitor(monitor, 1));
|
||||
} else {
|
||||
project.build(IncrementalProjectBuilder.FULL_BUILD, commands[i].getBuilderName(),
|
||||
commands[i].getArguments(), new SubProgressMonitor(monitor, 1));
|
||||
project.build(IncrementalProjectBuilder.FULL_BUILD, command.getBuilderName(),
|
||||
command.getArguments(), new SubProgressMonitor(monitor, 1));
|
||||
}
|
||||
}
|
||||
monitor.done();
|
||||
|
@ -330,6 +331,8 @@ public class MakeTarget extends PlatformObject implements IMakeTarget {
|
|||
}
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
public Object getAdapter(Class adapter) {
|
||||
if (adapter.equals(IProject.class)) {
|
||||
return getProject();
|
||||
|
|
|
@ -12,7 +12,6 @@ package org.eclipse.cdt.make.internal.core;
|
|||
|
||||
import java.io.File;
|
||||
import java.util.HashMap;
|
||||
import java.util.Iterator;
|
||||
import java.util.Map;
|
||||
import java.util.Vector;
|
||||
import java.util.Map.Entry;
|
||||
|
@ -47,10 +46,10 @@ public class MakeTargetManager implements IMakeTargetManager, IResourceChangeLis
|
|||
|
||||
private static String TARGETS_EXT = "targets"; //$NON-NLS-1$
|
||||
|
||||
private ListenerList listeners = new ListenerList();
|
||||
Map projectMap = new HashMap();
|
||||
private HashMap builderMap;
|
||||
protected Vector fProjects = new Vector();
|
||||
private final ListenerList listeners = new ListenerList();
|
||||
private final Map<IProject, ProjectTargets> projectMap = new HashMap<IProject, ProjectTargets>();
|
||||
private HashMap<String, String> builderMap;
|
||||
protected Vector<IProject> fProjects = new Vector<IProject>();
|
||||
|
||||
public MakeTargetManager() {
|
||||
}
|
||||
|
@ -67,7 +66,7 @@ public class MakeTargetManager implements IMakeTargetManager, IResourceChangeLis
|
|||
if (container instanceof IWorkspaceRoot) {
|
||||
throw new CoreException(new Status(IStatus.ERROR, MakeCorePlugin.getUniqueIdentifier(), -1, MakeMessages.getString("MakeTargetManager.add_to_workspace_root"), null)); //$NON-NLS-1$
|
||||
}
|
||||
ProjectTargets projectTargets = (ProjectTargets)projectMap.get(target.getProject());
|
||||
ProjectTargets projectTargets = projectMap.get(target.getProject());
|
||||
if (projectTargets == null) {
|
||||
projectTargets = readTargets(target.getProject());
|
||||
}
|
||||
|
@ -83,7 +82,7 @@ public class MakeTargetManager implements IMakeTargetManager, IResourceChangeLis
|
|||
}
|
||||
|
||||
public boolean targetExists(IMakeTarget target) {
|
||||
ProjectTargets projectTargets = (ProjectTargets)projectMap.get(target.getProject());
|
||||
ProjectTargets projectTargets = projectMap.get(target.getProject());
|
||||
if (projectTargets == null) {
|
||||
projectTargets = readTargets(target.getProject());
|
||||
}
|
||||
|
@ -91,7 +90,7 @@ public class MakeTargetManager implements IMakeTargetManager, IResourceChangeLis
|
|||
}
|
||||
|
||||
public void removeTarget(IMakeTarget target) throws CoreException {
|
||||
ProjectTargets projectTargets = (ProjectTargets)projectMap.get(target.getProject());
|
||||
ProjectTargets projectTargets = projectMap.get(target.getProject());
|
||||
if (projectTargets == null) {
|
||||
projectTargets = readTargets(target.getProject());
|
||||
}
|
||||
|
@ -107,7 +106,7 @@ public class MakeTargetManager implements IMakeTargetManager, IResourceChangeLis
|
|||
}
|
||||
|
||||
public void renameTarget(IMakeTarget target, String name) throws CoreException {
|
||||
ProjectTargets projectTargets = (ProjectTargets)projectMap.get(target.getProject());
|
||||
ProjectTargets projectTargets = projectMap.get(target.getProject());
|
||||
if (projectTargets == null) {
|
||||
projectTargets = readTargets(target.getProject());
|
||||
}
|
||||
|
@ -119,7 +118,7 @@ public class MakeTargetManager implements IMakeTargetManager, IResourceChangeLis
|
|||
}
|
||||
|
||||
public IMakeTarget[] getTargets(IContainer container) throws CoreException {
|
||||
ProjectTargets projectTargets = (ProjectTargets)projectMap.get(container.getProject());
|
||||
ProjectTargets projectTargets = projectMap.get(container.getProject());
|
||||
if (projectTargets == null) {
|
||||
projectTargets = readTargets(container.getProject());
|
||||
}
|
||||
|
@ -127,7 +126,7 @@ public class MakeTargetManager implements IMakeTargetManager, IResourceChangeLis
|
|||
}
|
||||
|
||||
public IMakeTarget findTarget(IContainer container, String name) throws CoreException {
|
||||
ProjectTargets projectTargets = (ProjectTargets)projectMap.get(container.getProject());
|
||||
ProjectTargets projectTargets = projectMap.get(container.getProject());
|
||||
if (projectTargets == null) {
|
||||
projectTargets = readTargets(container.getProject());
|
||||
}
|
||||
|
@ -135,25 +134,23 @@ public class MakeTargetManager implements IMakeTargetManager, IResourceChangeLis
|
|||
}
|
||||
|
||||
public IProject[] getTargetBuilderProjects() {
|
||||
return (IProject[])fProjects.toArray(new IProject[fProjects.size()]);
|
||||
return fProjects.toArray(new IProject[fProjects.size()]);
|
||||
}
|
||||
|
||||
public String[] getTargetBuilders(IProject project) {
|
||||
if (fProjects.contains(project) || hasTargetBuilder(project)) {
|
||||
try {
|
||||
Vector ids = new Vector();
|
||||
Vector<String> ids = new Vector<String>();
|
||||
IProjectDescription description = project.getDescription();
|
||||
ICommand builder[] = description.getBuildSpec();
|
||||
for (int i = 0; i < builder.length; i++) {
|
||||
Iterator entries = builderMap.entrySet().iterator();
|
||||
while (entries.hasNext()) {
|
||||
Map.Entry entry = (Entry)entries.next();
|
||||
if (entry.getValue().equals(builder[i].getBuilderName())) {
|
||||
ICommand commands[] = description.getBuildSpec();
|
||||
for (ICommand command : commands) {
|
||||
for (Entry<String, String> entry : builderMap.entrySet()) {
|
||||
if (entry.getValue().equals(command.getBuilderName())) {
|
||||
ids.add(entry.getKey());
|
||||
}
|
||||
}
|
||||
}
|
||||
return (String[])ids.toArray(new String[ids.size()]);
|
||||
return ids.toArray(new String[ids.size()]);
|
||||
} catch (CoreException e) {
|
||||
}
|
||||
}
|
||||
|
@ -164,9 +161,9 @@ public class MakeTargetManager implements IMakeTargetManager, IResourceChangeLis
|
|||
try {
|
||||
if (project.isAccessible()) {
|
||||
IProjectDescription description = project.getDescription();
|
||||
ICommand builder[] = description.getBuildSpec();
|
||||
for (int j = 0; j < builder.length; j++) {
|
||||
if (builderMap.containsValue(builder[j].getBuilderName())) {
|
||||
ICommand commands[] = description.getBuildSpec();
|
||||
for (ICommand command : commands) {
|
||||
if (builderMap.containsValue(command.getBuilderName())) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
@ -178,10 +175,10 @@ public class MakeTargetManager implements IMakeTargetManager, IResourceChangeLis
|
|||
|
||||
public void startup() {
|
||||
initializeBuilders();
|
||||
IProject project[] = ResourcesPlugin.getWorkspace().getRoot().getProjects();
|
||||
for (int i = 0; i < project.length; i++) {
|
||||
if (hasTargetBuilder(project[i])) {
|
||||
fProjects.add(project[i]);
|
||||
IProject projects[] = ResourcesPlugin.getWorkspace().getRoot().getProjects();
|
||||
for (IProject project : projects) {
|
||||
if (hasTargetBuilder(project)) {
|
||||
fProjects.add(project);
|
||||
}
|
||||
}
|
||||
ResourcesPlugin.getWorkspace().addResourceChangeListener(this);
|
||||
|
@ -256,7 +253,7 @@ public class MakeTargetManager implements IMakeTargetManager, IResourceChangeLis
|
|||
|
||||
protected void updateTarget(MakeTarget target) throws CoreException {
|
||||
if (target.getContainer() != null ) { // target has not been added to manager.
|
||||
ProjectTargets projectTargets = (ProjectTargets)projectMap.get(target.getProject());
|
||||
ProjectTargets projectTargets = projectMap.get(target.getProject());
|
||||
if (projectTargets == null || !projectTargets.contains(target)) {
|
||||
return; // target has not been added to manager.
|
||||
}
|
||||
|
@ -287,15 +284,15 @@ public class MakeTargetManager implements IMakeTargetManager, IResourceChangeLis
|
|||
}
|
||||
|
||||
protected void initializeBuilders() {
|
||||
builderMap = new HashMap();
|
||||
builderMap = new HashMap<String, String>();
|
||||
IExtensionPoint point = Platform.getExtensionRegistry().getExtensionPoint(MakeCorePlugin.PLUGIN_ID, MakeTargetManager.TARGET_BUILD_EXT);
|
||||
IExtension[] ext = point.getExtensions();
|
||||
for (int i = 0; i < ext.length; i++) {
|
||||
IConfigurationElement[] element = ext[i].getConfigurationElements();
|
||||
for (int j = 0; j < element.length; j++) {
|
||||
if (element[j].getName().equals("builder")) { //$NON-NLS-1$
|
||||
String builderID = element[j].getAttribute("builderID"); //$NON-NLS-1$
|
||||
String targetID = element[j].getAttribute("id"); //$NON-NLS-1$
|
||||
IExtension[] extensions = point.getExtensions();
|
||||
for (IExtension extension : extensions) {
|
||||
IConfigurationElement[] cfgElements = extension.getConfigurationElements();
|
||||
for (IConfigurationElement cfgElement : cfgElements) {
|
||||
if (cfgElement.getName().equals("builder")) { //$NON-NLS-1$
|
||||
String builderID = cfgElement.getAttribute("builderID"); //$NON-NLS-1$
|
||||
String targetID = cfgElement.getAttribute("id"); //$NON-NLS-1$
|
||||
builderMap.put(targetID, builderID);
|
||||
}
|
||||
}
|
||||
|
@ -303,9 +300,8 @@ public class MakeTargetManager implements IMakeTargetManager, IResourceChangeLis
|
|||
}
|
||||
|
||||
protected void notifyListeners(MakeTargetEvent event) {
|
||||
Object[] list = listeners.getListeners();
|
||||
for (int i = 0; i < list.length; i++) {
|
||||
((IMakeTargetListener)list[i]).targetChanged(event);
|
||||
for (Object listener : listeners.getListeners()) {
|
||||
((IMakeTargetListener)listener).targetChanged(event);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -318,6 +314,6 @@ public class MakeTargetManager implements IMakeTargetManager, IResourceChangeLis
|
|||
}
|
||||
|
||||
public String getBuilderID(String targetBuilderID) {
|
||||
return (String)builderMap.get(targetBuilderID);
|
||||
return builderMap.get(targetBuilderID);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue