Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 151593 Details for
Bug 294502
Handling of unknown arguments/targets
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
[patch]
patch
ant-targets.patch (text/plain), 2.91 KB, created by
Darin Wright
on 2009-11-06 13:33:08 EST
(
hide
)
Description:
patch
Filename:
MIME Type:
Creator:
Darin Wright
Created:
2009-11-06 13:33:08 EST
Size:
2.91 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.ant.core >Index: src_ant/org/eclipse/ant/internal/core/ant/InternalAntRunner.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.ant.core/src_ant/org/eclipse/ant/internal/core/ant/InternalAntRunner.java,v >retrieving revision 1.173 >diff -u -r1.173 InternalAntRunner.java >--- src_ant/org/eclipse/ant/internal/core/ant/InternalAntRunner.java 29 May 2008 16:13:24 -0000 1.173 >+++ src_ant/org/eclipse/ant/internal/core/ant/InternalAntRunner.java 6 Nov 2009 18:31:41 -0000 >@@ -1,5 +1,5 @@ > /******************************************************************************* >- * Copyright (c) 2000, 2008 IBM Corporation and others. >+ * Copyright (c) 2000, 2009 IBM Corporation and others. > * Portions Copyright 2000-2007 The Apache Software Foundation > * All rights reserved. This program and the accompanying materials are made > * available under the terms of the Apache Software License v2.0 which >@@ -25,10 +25,13 @@ > import java.util.Arrays; > import java.util.Enumeration; > import java.util.HashMap; >+import java.util.HashSet; > import java.util.Iterator; > import java.util.List; >+import java.util.ListIterator; > import java.util.Map; > import java.util.Properties; >+import java.util.Set; > import java.util.Vector; > > import org.apache.tools.ant.AntTypeDefinition; >@@ -1068,7 +1071,11 @@ > if (!commands.isEmpty()) { > processUnrecognizedCommands(commands); > } >- >+ >+ if (!commands.isEmpty()) { >+ processUnrecognizedTargets(commands); >+ } >+ > if (!commands.isEmpty()) { > processTargets(commands); > } >@@ -1076,6 +1083,35 @@ > return true; > } > >+ /** >+ * Checks for unrecognized targets on the command line and >+ * removes them. >+ */ >+ private void processUnrecognizedTargets(List commands) { >+ List list = getTargets(); >+ Set names = new HashSet(); >+ Iterator it = list.iterator(); >+ while (it.hasNext()) { >+ Object element = it.next(); >+ if (element instanceof List) { >+ List target = (List)element; >+ if (!target.isEmpty()) { >+ names.add(target.get(0)); >+ } >+ } >+ } >+ ListIterator iterator = commands.listIterator(); >+ >+ while (iterator.hasNext()) { >+ String target = (String) iterator.next(); >+ if (!names.contains(target)) { >+ iterator.remove(); >+ String message = MessageFormat.format("Unknown target: {0}", new Object[]{target}); >+ logMessage(currentProject, message, Project.MSG_WARN); >+ } >+ } >+ } >+ > /* > * Checks for unrecognized arguments on the command line. > * Since there is no syntactic way to distingush between >@@ -1091,7 +1127,7 @@ > > // find the last arg that begins with '-' > for (int i = commands.size() - 1; i >= 0; i--) { >- if (((String) commands.get(0)).startsWith("-")) { //$NON-NLS-1$ >+ if (((String) commands.get(i)).startsWith("-")) { //$NON-NLS-1$ > p = i; > break; > }
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 294502
:
151593
|
151696
|
151837