Revert - Bug 302296 - Please update to Ant 1.8.2 - Test build fails to run Ant test suite with perm gen exceptions
diff --git a/ant/org.eclipse.ant.tests.core/META-INF/MANIFEST.MF b/ant/org.eclipse.ant.tests.core/META-INF/MANIFEST.MF
index 0478fb3..438c056 100644
--- a/ant/org.eclipse.ant.tests.core/META-INF/MANIFEST.MF
+++ b/ant/org.eclipse.ant.tests.core/META-INF/MANIFEST.MF
@@ -11,7 +11,7 @@
org.eclipse.ant.tests.core.testplugin,
org.eclipse.ant.tests.core.tests
Require-Bundle: org.eclipse.ui.ide;resolution:=optional,
- org.apache.ant;bundle-version="1.8.2",
+ org.apache.ant,
org.junit,
org.eclipse.core.resources,
org.eclipse.ui,
diff --git a/ant/org.eclipse.ant.tests.core/tests/org/eclipse/ant/tests/core/tests/OptionTests.java b/ant/org.eclipse.ant.tests.core/tests/org/eclipse/ant/tests/core/tests/OptionTests.java
index 508c7de..201ca15 100644
--- a/ant/org.eclipse.ant.tests.core/tests/org/eclipse/ant/tests/core/tests/OptionTests.java
+++ b/ant/org.eclipse.ant.tests.core/tests/org/eclipse/ant/tests/core/tests/OptionTests.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2011 IBM Corporation and others.
+ * Copyright (c) 2000, 2009 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
@@ -25,10 +25,10 @@
public class OptionTests extends AbstractAntTest {
- protected static final String UNKNOWN_ARG = "Unknown argument: ";
- protected static final String START_OF_HELP = "ant [options] [target [target2 [target3] ...]]";
- protected static final String VERSION = "Apache Ant(TM) version 1.8.2 compiled on December 20 2010";
- protected static final String PLUGIN_VERSION = "org.apache.ant_1.8.2";
+ protected static final String UNKNOWN_ARG= "Unknown argument: ";
+ protected static final String START_OF_HELP= "ant [options] [target [target2 [target3] ...]]";
+ protected static final String VERSION= "Apache Ant version 1.7.1 compiled on June 27 2008";
+ protected static final String PLUGIN_VERSION= "org.apache.ant_1.7.1";
public OptionTests(String name) {
super(name);
@@ -58,7 +58,7 @@
public void testVersion() throws CoreException {
run("TestForEcho.xml", new String[]{"-version"});
assertTrue("One message should have been logged", AntTestChecker.getDefault().getMessagesLoggedCount() == 1);
- assertEquals("Version is incorrect: ", VERSION, getLastMessageLogged());
+ assertTrue("Version is incorrect", VERSION.equals(getLastMessageLogged()));
}
/**
@@ -578,9 +578,8 @@
} finally {
restorePreferenceDefaults();
}
- //we are looking for the ant.home entry
- List messages = AntTestChecker.getDefault().getMessages();
- String msg = (String)messages.get(17);
+
+ String msg= (String)AntTestChecker.getDefault().getMessages().get(15);
//msg depends on whether self hosting testing or build testing
assertTrue("Message incorrect: " + msg, checkAntHomeMessage(msg));
}
diff --git a/ant/org.eclipse.ant.tests.core/tests/org/eclipse/ant/tests/core/tests/TargetTests.java b/ant/org.eclipse.ant.tests.core/tests/org/eclipse/ant/tests/core/tests/TargetTests.java
index cb41221..d57910f 100644
--- a/ant/org.eclipse.ant.tests.core/tests/org/eclipse/ant/tests/core/tests/TargetTests.java
+++ b/ant/org.eclipse.ant.tests.core/tests/org/eclipse/ant/tests/core/tests/TargetTests.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2011 IBM Corporation and others.
+ * Copyright (c) 2000, 2007 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
@@ -53,8 +53,7 @@
getTargets("Bug42926.xml");
} catch (CoreException ce) {
//classpathref was successful but the task is not defined
- String message = ce.getMessage();
- assertTrue("Core exception message not as expected: " + message, message.endsWith("Bug42926.xml:7: taskdef class com.foo.SomeTask cannot be found\n using the classloader AntClassLoader[]"));
+ assertTrue("Core exception message not as expected: " + ce.getMessage(), ce.getMessage().endsWith("Bug42926.xml:7: taskdef class com.foo.SomeTask cannot be found"));
}
}
diff --git a/ant/org.eclipse.ant.tests.ui/Ant Debug Tests/org/eclipse/ant/tests/ui/debug/PropertyTests.java b/ant/org.eclipse.ant.tests.ui/Ant Debug Tests/org/eclipse/ant/tests/ui/debug/PropertyTests.java
index e341f08..ceb236e 100644
--- a/ant/org.eclipse.ant.tests.ui/Ant Debug Tests/org/eclipse/ant/tests/ui/debug/PropertyTests.java
+++ b/ant/org.eclipse.ant.tests.ui/Ant Debug Tests/org/eclipse/ant/tests/ui/debug/PropertyTests.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2005, 2011 IBM Corporation and others.
+ * Copyright (c) 2005, 2009 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
@@ -24,7 +24,7 @@
public class PropertyTests extends AbstractAntDebugTest {
- private static final String ANT_VERSION = "Apache Ant(TM) version 1.8.2 compiled on December 20 2010";
+ private static final String ANT_VERSION = "Apache Ant version 1.7.1 compiled on June 27 2008";
public PropertyTests(String name) {
super(name);
@@ -146,7 +146,7 @@
AntProperty property= frame.findProperty(propertyName);
assertNotNull("Did not find property: " + propertyName, property);
AntValue value= (AntValue) property.getValue();
- assertEquals("Value of property "+propertyName+ " incorrect", propertyValue, value.getValueString());
+ assertTrue("Value of property" + propertyName + " incorrect: " + value.getValueString(), propertyValue.equals(value.getValueString()));
return frame;
}
}
\ No newline at end of file
diff --git a/ant/org.eclipse.ant.tests.ui/Ant Editor Tests/org/eclipse/ant/tests/ui/editor/AntEditorTests.java b/ant/org.eclipse.ant.tests.ui/Ant Editor Tests/org/eclipse/ant/tests/ui/editor/AntEditorTests.java
index d492147..8c4288b 100644
--- a/ant/org.eclipse.ant.tests.ui/Ant Editor Tests/org/eclipse/ant/tests/ui/editor/AntEditorTests.java
+++ b/ant/org.eclipse.ant.tests.ui/Ant Editor Tests/org/eclipse/ant/tests/ui/editor/AntEditorTests.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2004, 2011 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
@@ -38,7 +38,6 @@
int offset= getOffsetWithinLine(editor, 9, 20);
IRegion region= hover.getHoverRegion(editor.getViewer(), offset);
String hoverText= hover.getHoverInfo(editor.getViewer(), region);
- assertNotNull("Expecting a hovertext object", hoverText);
String correctResultRegEx= "<html><body text=\"#.*\" bgcolor=\"#.*\"><h5>Path Elements:</h5><ul><li>.*</html>";
assertTrue("Expected the following hover text to match regex: " + correctResultRegEx, hoverText.matches(correctResultRegEx));
}
@@ -50,7 +49,6 @@
int offset= getOffsetWithinLine(editor, 42, 13);
IRegion region= hover.getHoverRegion(editor.getViewer(), offset);
String hoverText= hover.getHoverInfo(editor.getViewer(), region);
- assertNotNull("Expecting a hovertext object", hoverText);
String correctResult= "<p>value with spaces</body></html>";
assertTrue("Expected the following hover text to end with: " + correctResult, hoverText.endsWith(correctResult));
}
@@ -73,7 +71,6 @@
int offset= getOffsetWithinLine(editor, 45, 25);
IRegion region= hover.getHoverRegion(editor.getViewer(), offset);
String hoverText= hover.getHoverInfo(editor.getViewer(), region);
- assertNotNull("Expecting a hovertext object", hoverText);
String correctResult= "<h5>Includes:</h5><li>*.xml</li><p><p><h5>Excludes:</h5><li>**/*Test*</li></body></html>";
assertTrue("Expected the following hover text to end with: " + correctResult + "was: " + hoverText, hoverText.endsWith(correctResult));
}
@@ -85,7 +82,6 @@
int offset= getOffsetWithinLine(editor, 46, 25);
IRegion region= hover.getHoverRegion(editor.getViewer(), offset);
String hoverText= hover.getHoverInfo(editor.getViewer(), region);
- assertNotNull("Expecting a hovertext object", hoverText);
String correctResult= "Ant UI Tests" + File.separatorChar + "buildfiles" + File.separatorChar + "nothere not found.";
assertTrue("Expected the following hover text to ends with: " + correctResult, hoverText.endsWith(correctResult));
}
@@ -97,14 +93,28 @@
int offset= getOffsetWithinLine(editor, 44, 20);
IRegion region= hover.getHoverRegion(editor.getViewer(), offset);
String hoverText= hover.getHoverInfo(editor.getViewer(), region);
- assertNotNull("Expecting a hovertext object", hoverText);
- assertTrue("Expected to see '<h5>Includes:</h5><li>include</li>'", hoverText.indexOf("<h5>Includes:</h5><li>include</li>") > -1);
- assertTrue("Expected to see '<h5>Excludes:</h5><li>exclude</li>'", hoverText.indexOf("<h5>Excludes:</h5><li>exclude</li>") > -1);
- assertTrue("Expected to see '<li>**/SCCS/**</li>'", hoverText.indexOf("<li>**/SCCS/**</li>") > -1);
- assertTrue("Expected to see '<li>**/.DS_Store</li>'", hoverText.indexOf("<li>**/.DS_Store</li>") > -1);
- assertTrue("Expected to see '<li>**/.bzrignore</li>'", hoverText.indexOf("<li>**/.bzrignore</li>") > -1);
- assertTrue("Expected to see '<li>**/.gitattributes</li>'", hoverText.indexOf("<li>**/.gitattributes</li>") > -1);
- assertTrue("Expected to see '<li>**/.hgtags</li>'", hoverText.indexOf("<li>**/.hgtags</li>") > -1);
+
+ String correctResult= "<h5>Includes:</h5><li>include</li><p><p><h5>Excludes:</h5><li>exclude</li><li>**" +
+ File.separatorChar + "*~</li><li>**"
+ + File.separatorChar
+ + "#*#</li><li>**" +
+ File.separatorChar +
+ ".#*</li><li>**" +
+ File.separatorChar +
+ "%*%</li><li>**" +
+ File.separatorChar +
+ "._*</li><li>**" +
+ File.separatorChar +
+ "CVS</li><li>**" +
+ File.separatorChar +
+ "CVS" + File.separatorChar + "**</li><li>**" +
+ File.separatorChar + ".cvsignore</li><li>**" +
+ File.separatorChar + "SCCS</li><li>**" + File.separatorChar +
+ "SCCS" + File.separatorChar + "**</li><li>**" + File.separatorChar +
+ "vssver.scc</li><li>**" + File.separatorChar +
+ ".svn</li><li>**" + File.separatorChar + ".svn" + File.separatorChar +
+ "**</li><li>**" + File.separatorChar + ".DS_Store</li></body></html>";
+ assertTrue("Expected the following hover text to be: " + correctResult + " Was " + hoverText, hoverText.endsWith(correctResult));
}
diff --git a/ant/org.eclipse.ant.tests.ui/Ant Editor Tests/org/eclipse/ant/tests/ui/editor/CodeCompletionTest.java b/ant/org.eclipse.ant.tests.ui/Ant Editor Tests/org/eclipse/ant/tests/ui/editor/CodeCompletionTest.java
index f0d1cdf..3e06378 100644
--- a/ant/org.eclipse.ant.tests.ui/Ant Editor Tests/org/eclipse/ant/tests/ui/editor/CodeCompletionTest.java
+++ b/ant/org.eclipse.ant.tests.ui/Ant Editor Tests/org/eclipse/ant/tests/ui/editor/CodeCompletionTest.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2002, 2011 GEBIT Gesellschaft fuer EDV-Beratung
+ * Copyright (c) 2002, 2006 GEBIT Gesellschaft fuer EDV-Beratung
* und Informatik-Technologien mbH,
* Berlin, Duesseldorf, Frankfurt (Germany) and others.
* All rights reserved. This program and the accompanying materials
@@ -259,10 +259,10 @@
processor.setColumnNumber(columnNumber);
processor.setCursorPosition(lineOffset + columnNumber);
proposals = processor.getTargetAttributeValueProposals(getCurrentDocument(), getCurrentDocument().get(0, lineOffset + columnNumber), "", "depends");
- assertTrue(proposals.length == 7);
+ assertTrue(proposals.length == 6);
assertContains("main", proposals);
- //XXX why do we not want a valid proposal?
- /*assertDoesNotContain("pretest", proposals);*/
+ assertDoesNotContain("pretest", proposals);
+
}
/**
diff --git a/ant/org.eclipse.ant.tests.ui/Ant Editor Tests/org/eclipse/ant/tests/ui/editor/OccurrencesFinderTests.java b/ant/org.eclipse.ant.tests.ui/Ant Editor Tests/org/eclipse/ant/tests/ui/editor/OccurrencesFinderTests.java
index 7908bee..24dade5 100644
--- a/ant/org.eclipse.ant.tests.ui/Ant Editor Tests/org/eclipse/ant/tests/ui/editor/OccurrencesFinderTests.java
+++ b/ant/org.eclipse.ant.tests.ui/Ant Editor Tests/org/eclipse/ant/tests/ui/editor/OccurrencesFinderTests.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2004, 2011 IBM Corporation and others.
+ * Copyright (c) 2004, 2006 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
@@ -45,11 +45,10 @@
private void propertyOccurences(AntEditor editor, int offset) throws BadLocationException {
OccurrencesFinder finder= getOccurrencesFinder(editor, offset);
List positions= finder.perform();
- assertNotNull("Expecting a position listing", positions);
assertTrue("7 positions should have been found; found: " + positions.size(), positions.size() == 7);
assertContainsPosition(positions, offset, 8);
- int newoffset = getOffsetWithinLine(editor, 34, 21);
- assertContainsPosition(positions, newoffset, 8);
+ offset = getOffsetWithinLine(editor, 34, 21);
+ assertContainsPosition(positions, offset, 8);
}
public void testFromPropertyLocation() throws PartInitException, BadLocationException {
@@ -84,10 +83,9 @@
AntEditor editor= (AntEditor)EditorTestHelper.openInEditor(file, "org.eclipse.ant.ui.internal.editor.AntEditor", true);
//from property name
int offset = getOffsetWithinLine(editor, 39, 20);
- editor.selectAndReveal(offset, 50);
+ editor.selectAndReveal(offset, 0);
OccurrencesFinder finder= getOccurrencesFinder(editor, offset);
List positions= finder.perform();
- assertNotNull("Expecting a position listing", positions);
assertTrue("3 positions should have been found; found: " + positions.size(), positions.size() == 3);
assertContainsPosition(positions, offset, 15);
offset = getOffsetWithinLine(editor, 40, 20);
@@ -95,10 +93,9 @@
//from echo text
offset = getOffsetWithinLine(editor, 40, 20);
- editor.selectAndReveal(offset, 10);
+ editor.selectAndReveal(offset, 0);
finder= getOccurrencesFinder(editor, offset);
positions= finder.perform();
- assertNotNull("Expecting a position listing", positions);
assertTrue("3 positions should have been found; found: " + positions.size(), positions.size() == 3);
assertContainsPosition(positions, offset, 15);
offset = getOffsetWithinLine(editor, 39, 20);
@@ -127,8 +124,8 @@
List positions= finder.perform();
assertTrue("6 positions should have been found; found: " + positions.size(), positions.size() == 6);
assertContainsPosition(positions, offset, 7);
- int newoffset = getOffsetWithinLine(editor, 19, 32);
- assertContainsPosition(positions, newoffset, 7);
+ offset = getOffsetWithinLine(editor, 19, 32);
+ assertContainsPosition(positions, offset, 7);
}
public void testFromMacrodefAttributeRef() throws PartInitException, BadLocationException {
diff --git a/ant/org.eclipse.ant.tests.ui/Ant Tests/org/eclipse/ant/tests/ui/separateVM/SeparateVMTests.java b/ant/org.eclipse.ant.tests.ui/Ant Tests/org/eclipse/ant/tests/ui/separateVM/SeparateVMTests.java
index 1edbec7..fb2af43 100644
--- a/ant/org.eclipse.ant.tests.ui/Ant Tests/org/eclipse/ant/tests/ui/separateVM/SeparateVMTests.java
+++ b/ant/org.eclipse.ant.tests.ui/Ant Tests/org/eclipse/ant/tests/ui/separateVM/SeparateVMTests.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2004, 2011 IBM Corporation and others.
+ * Copyright (c) 2004, 2009 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
@@ -37,7 +37,7 @@
public class SeparateVMTests extends AbstractAntUIBuildTest {
- protected static final String PLUGIN_VERSION= "org.apache.ant_1.8.2";
+ protected static final String PLUGIN_VERSION= "org.apache.ant_1.7.1";
public SeparateVMTests(String name) {
super(name);
diff --git a/ant/org.eclipse.ant.tests.ui/META-INF/MANIFEST.MF b/ant/org.eclipse.ant.tests.ui/META-INF/MANIFEST.MF
index 717cf20..3d93b0d 100644
--- a/ant/org.eclipse.ant.tests.ui/META-INF/MANIFEST.MF
+++ b/ant/org.eclipse.ant.tests.ui/META-INF/MANIFEST.MF
@@ -22,7 +22,7 @@
org.eclipse.jface.text;resolution:=optional,
org.eclipse.ui.workbench.texteditor;resolution:=optional,
org.eclipse.ui.editors;resolution:=optional,
- org.apache.ant;bundle-version="1.8.2",
+ org.apache.ant,
org.junit,
org.eclipse.core.resources,
org.eclipse.jdt.core,
diff --git a/ant/org.eclipse.ant.ui/Ant Editor/org/eclipse/ant/internal/ui/editor/utils/ProjectHelper.java b/ant/org.eclipse.ant.ui/Ant Editor/org/eclipse/ant/internal/ui/editor/utils/ProjectHelper.java
index 471c560..1dc834e 100644
--- a/ant/org.eclipse.ant.ui/Ant Editor/org/eclipse/ant/internal/ui/editor/utils/ProjectHelper.java
+++ b/ant/org.eclipse.ant.ui/Ant Editor/org/eclipse/ant/internal/ui/editor/utils/ProjectHelper.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2011 IBM Corporation and others.
+ * Copyright (c) 2000, 2008 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
@@ -29,7 +29,6 @@
import org.apache.tools.ant.BuildException;
import org.apache.tools.ant.Location;
import org.apache.tools.ant.Project;
-import org.apache.tools.ant.ProjectHelperRepository;
import org.apache.tools.ant.RuntimeConfigurable;
import org.apache.tools.ant.Target;
import org.apache.tools.ant.Task;
@@ -515,31 +514,23 @@
}
/**
- * Constructor
- * <p>
- * This constructor is only to be used by the {@link ProjectHelperRepository} when loading
- * instances of registered helpers.
- * </p>
- * @since 3.7
- * @noreference This constructor is not intended to be referenced by clients.
- */
- public ProjectHelper() {}
-
- /**
* Parses the project file, configuring the project as it goes.
*
* @param project the current project
- * @param source the XML source or a {@link File}
+ * @param source the xml source or a java.io.File
* @param handler the root handler to use (contains the current context)
- * @exception BuildException if the configuration is invalid or cannot be read
+ * @exception BuildException if the configuration is invalid or cannot
+ * be read
*/
- public void parse(Project project, Object source, ProjectHelper2.RootHandler handler) throws BuildException {
+ public void parse(Project project, Object source, org.apache.tools.ant.helper.ProjectHelper2.RootHandler handler) throws BuildException {
+
if (!(source instanceof String) && !(source instanceof File)) {
//this should only occur with a source URL and that should not be possible currently
//as Antlib hard codes using ProjectHelper2 (bug 152793)
super.parse(project, source, handler);
return;
}
+
AntXMLContext context = (AntXMLContext)project.getReference("ant.parsing.context"); //$NON-NLS-1$
//switch to using "our" handler so parsing will continue on hitting errors.
handler = new RootHandler(context, mainHandler);
diff --git a/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/model/AntModel.java b/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/model/AntModel.java
index b47e9cb..ea91ab8 100644
--- a/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/model/AntModel.java
+++ b/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/model/AntModel.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2011 IBM Corporation and others.
+ * Copyright (c) 2000, 2009 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
@@ -36,7 +36,6 @@
import org.apache.tools.ant.Location;
import org.apache.tools.ant.Main;
import org.apache.tools.ant.Project;
-import org.apache.tools.ant.ProjectHelperRepository;
import org.apache.tools.ant.RuntimeConfigurable;
import org.apache.tools.ant.Target;
import org.apache.tools.ant.Task;
@@ -177,6 +176,7 @@
public AntModel(IDocument document, IProblemRequestor problemRequestor, LocationProvider locationProvider, boolean resolveLexicalInfo, boolean resolvePositionInfo, boolean resolveTaskInfo) {
init(document, problemRequestor, locationProvider);
+
fHasLexicalInfo= resolveLexicalInfo;
fHasPositionInfo= resolvePositionInfo;
fHasTaskInfo= resolveTaskInfo;
@@ -194,29 +194,6 @@
}
fgInstanceCount++;
DecayCodeCompletionDataStructuresThread.cancel();
- ProjectHelper helper = getProjectHelper();
- if(helper == null) {
- ProjectHelperRepository.getInstance().registerProjectHelper(ProjectHelper.class);
- }
- }
-
- /**
- * Searches the collection of registered {@link org.apache.tools.ant.ProjectHelper}s to see if we have one
- * registered already.
- *
- * @return the {@link ProjectHelper} from our implementation of <code>null</code> if we have not registered one yet
- * @since 3.7
- * @see ProjectHelperRepository
- */
- ProjectHelper getProjectHelper() {
- Iterator helpers = ProjectHelperRepository.getInstance().getHelpers();
- while(helpers.hasNext()) {
- org.apache.tools.ant.ProjectHelper helper = (org.apache.tools.ant.ProjectHelper) helpers.next();
- if(helper instanceof ProjectHelper) {
- return (ProjectHelper) helper;
- }
- }
- return null;
}
/* (non-Javadoc)
@@ -377,9 +354,8 @@
}
project.setUserProperty("ant.file", filePath); //$NON-NLS-1$
project.setUserProperty("ant.version", Main.getAntVersion()); //$NON-NLS-1$
-
- ProjectHelper projectHelper = getProjectHelper();
- ProjectHelper.setAntModel(this);
+
+ ProjectHelper projectHelper= new ProjectHelper(this);
projectHelper.setBuildFile(file);
project.addReference("ant.projectHelper", projectHelper); //$NON-NLS-1$
return projectHelper;
diff --git a/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/model/AntModelProject.java b/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/model/AntModelProject.java
index 504a021..ff4d049 100644
--- a/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/model/AntModelProject.java
+++ b/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/model/AntModelProject.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2011 IBM Corporation and others.
+ * Copyright (c) 2000, 2005 IBM Corporation and others.
* Portions Copyright 2000-2004 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
@@ -13,18 +13,13 @@
package org.eclipse.ant.internal.ui.model;
import java.io.File;
-import java.util.Collections;
import java.util.Enumeration;
-import java.util.HashMap;
import java.util.Hashtable;
-import java.util.Map;
import org.apache.tools.ant.AntClassLoader;
import org.apache.tools.ant.BuildException;
import org.apache.tools.ant.BuildListener;
import org.apache.tools.ant.Project;
-import org.apache.tools.ant.PropertyHelper;
-import org.apache.tools.ant.UnknownElement;
import org.apache.tools.ant.types.Path;
/**
@@ -37,48 +32,22 @@
*/
public class AntModelProject extends Project {
- /**
- * Delegate to maintain property chaining - to make sure our project is alerted
- * to new properties being set
- */
- class AntPropertyHelper implements PropertyHelper.PropertySetter {
- /* (non-Javadoc)
- * @see org.apache.tools.ant.PropertyHelper.PropertySetter#setNew(java.lang.String, java.lang.Object, org.apache.tools.ant.PropertyHelper)
- */
- public boolean setNew(String property, Object value, PropertyHelper propertyHelper) {
- setNewProperty(property, value.toString());
- return false;
- }
-
- /* (non-Javadoc)
- * @see org.apache.tools.ant.PropertyHelper.PropertySetter#set(java.lang.String, java.lang.Object, org.apache.tools.ant.PropertyHelper)
- */
- public boolean set(String property, Object value, PropertyHelper propertyHelper) {
- return false;
- }
- }
-
+ private Hashtable fBaseProperties;
+ private Hashtable fCurrentProperties= new Hashtable();
private AntPropertyNode fCurrentConfiguringPropertyNode;
- private Map idrefs = Collections.synchronizedMap(new HashMap());
-
- /**
- * Constructor
- * <p>
- * Allows us to register a {@link PropertyHelper.PropertySetter} delegate for this project
- * </p>
- * @noreference This constructor is not intended to be referenced by clients.
- */
- public AntModelProject() {
- PropertyHelper.getPropertyHelper(this).add(new AntPropertyHelper());
- }
/* (non-Javadoc)
* @see org.apache.tools.ant.Project#setNewProperty(java.lang.String, java.lang.String)
*/
public void setNewProperty(String name, String value) {
+
+ if (fCurrentProperties.get(name) != null) {
+ return;
+ }
//allows property values to be over-written for this parse session
//there is currently no way to remove properties from the Apache Ant project
//the project resets it properties for each parse...see reset()
+ fCurrentProperties.put(name, value);
if (fCurrentConfiguringPropertyNode != null) {
fCurrentConfiguringPropertyNode.addProperty(name, value);
}
@@ -102,6 +71,8 @@
setDefault(null);
setDescription(null);
setName(""); //$NON-NLS-1$
+ //reset the properties to the initial set
+ fCurrentProperties= new Hashtable(fBaseProperties);
}
/* (non-Javadoc)
@@ -109,55 +80,39 @@
*/
public String getProperty(String name) {
//override as we cannot remove properties from the Apache Ant project
- String result= super.getProperty(name);
+ String result= (String)fCurrentProperties.get(name);
if (result == null) {
- return getUserProperty(name);
+ result= getUserProperty(name);
}
return result;
}
/* (non-Javadoc)
- * @see org.apache.tools.ant.Project#addIdReference(java.lang.String, java.lang.Object)
- */
- public void addIdReference(String id, Object value) {
- //XXX hack because we cannot look up references by id in Ant 1.8.x
- //see https://issues.apache.org/bugzilla/show_bug.cgi?id=49659
- idrefs.put(id, value);
- }
-
- /* (non-Javadoc)
- * @see org.apache.tools.ant.Project#getReference(java.lang.String)
- */
- public Object getReference(String key) {
- Object ref = super.getReference(key);
- if(ref == null) {
- ref = idrefs.get(key);
- if(ref instanceof UnknownElement) {
- UnknownElement ue = (UnknownElement) ref;
- ue.maybeConfigure();
- return ue.getRealThing();
- }
- }
- return ref;
- }
-
- /* (non-Javadoc)
* @see org.apache.tools.ant.Project#getProperties()
*/
public Hashtable getProperties() {
//override as we cannot remove properties from the Apache Ant project
- Hashtable allProps = super.getProperties();
+ Hashtable allProps= new Hashtable(fCurrentProperties);
allProps.putAll(getUserProperties());
allProps.put("basedir", getBaseDir().getPath()); //$NON-NLS-1$
return allProps;
}
/* (non-Javadoc)
+ * @see org.apache.tools.ant.Project#init()
+ */
+ public void init() throws BuildException {
+ super.init();
+ fBaseProperties= super.getProperties();
+ fCurrentProperties= super.getProperties();
+ }
+
+ /* (non-Javadoc)
* @see org.apache.tools.ant.Project#setBaseDir(java.io.File)
*/
public void setBaseDir(File baseDir) throws BuildException {
super.setBaseDir(baseDir);
- setNewProperty("basedir", getBaseDir().getPath()); //$NON-NLS-1$
+ fCurrentProperties.put("basedir", getBaseDir().getPath()); //$NON-NLS-1$
}
/**
diff --git a/ant/org.eclipse.ant.ui/META-INF/MANIFEST.MF b/ant/org.eclipse.ant.ui/META-INF/MANIFEST.MF
index 1b7b144..9dde873 100644
--- a/ant/org.eclipse.ant.ui/META-INF/MANIFEST.MF
+++ b/ant/org.eclipse.ant.ui/META-INF/MANIFEST.MF
@@ -32,7 +32,7 @@
org.eclipse.jface.text;bundle-version="[3.5.0,4.0.0)";resolution:=optional,
org.eclipse.ui.workbench.texteditor;bundle-version="[3.5.0,4.0.0)";resolution:=optional,
org.eclipse.ui.editors;bundle-version="[3.2.0,4.0.0)";resolution:=optional,
- org.apache.ant;bundle-version="1.8.2",
+ org.apache.ant;bundle-version="1.7.0",
org.eclipse.ant.core;bundle-version="[3.2.0,4.0.0)",
org.eclipse.core.filesystem;bundle-version="[1.0.0,2.0.0)",
org.eclipse.core.resources;bundle-version="[3.2.0,4.0.0)",