Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNitin Dahyabhai2015-10-29 20:14:39 -0400
committerNitin Dahyabhai2015-10-29 20:35:22 -0400
commitec3fea6a8d5f4dbd0b19c11b440ae23abfc4e6a7 (patch)
treeb6582bb1442417b2ca16bb0aa6e7c0b6d96a20c6
parent61e033a94118dac31306bb51c6da591436860e69 (diff)
downloadwebtools.sourceediting-ec3fea6a8d5f4dbd0b19c11b440ae23abfc4e6a7.tar.gz
webtools.sourceediting-ec3fea6a8d5f4dbd0b19c11b440ae23abfc4e6a7.tar.xz
webtools.sourceediting-ec3fea6a8d5f4dbd0b19c11b440ae23abfc4e6a7.zip
[481069] Compile error "The return type is incompatible with Hashtable.remove(Object, Object)" in ArrayMap.java
-rw-r--r--bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/java/ArrayMap.java11
-rw-r--r--bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/taglib/ProjectDescription.java12
2 files changed, 12 insertions, 11 deletions
diff --git a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/java/ArrayMap.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/java/ArrayMap.java
index 507ec7752..dd6ded39a 100644
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/java/ArrayMap.java
+++ b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/java/ArrayMap.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2008 IBM Corporation and others.
+ * Copyright (c) 2008, 2015 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
@@ -27,15 +27,16 @@ import java.util.Iterator;
*/
public class ArrayMap extends Hashtable {
- /**
- *
- */
private static final long serialVersionUID = 1L;
public ArrayMap(int size) {
super(size);
}
+ /*
+ * Adds the given value to a collection of values stored for the given
+ * key.
+ */
public synchronized Object put(Object key, Object value) {
Object[] values = (Object[]) super.get(key);
Object[] newValues = null;
@@ -59,7 +60,7 @@ public class ArrayMap extends Hashtable {
* @param value the specific value to remove from the key
* @return The item removed from the list of values
*/
- public synchronized Object remove(Object key, Object value) {
+ public synchronized Object removeFirstPair(Object key, Object value) {
Object[] values = (Object[]) super.get(key);
Object removed = null;
Object[] result = null;
diff --git a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/taglib/ProjectDescription.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/taglib/ProjectDescription.java
index 18b6495a8..25bee43bd 100644
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/taglib/ProjectDescription.java
+++ b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/taglib/ProjectDescription.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2005, 2013 IBM Corporation and others.
+ * Copyright (c) 2005, 2015 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
@@ -1306,9 +1306,9 @@ class ProjectDescription {
/**
* @return Returns the implicitReferences for the given path
*/
- Hashtable getImplicitReferences(String path) {
+ ArrayMap getImplicitReferences(String path) {
String localRoot = getLocalRoot(path);
- Hashtable implicitReferences = (Hashtable) fImplicitReferences.get(localRoot);
+ ArrayMap implicitReferences = (ArrayMap) fImplicitReferences.get(localRoot);
if (implicitReferences == null) {
implicitReferences = new ArrayMap(1);
fImplicitReferences.put(localRoot, implicitReferences);
@@ -1742,7 +1742,7 @@ class ProjectDescription {
URLRecord[] records = (URLRecord[]) record.getURLRecords().toArray(new URLRecord[0]);
for (int i = 0; i < records.length; i++) {
TaglibIndex.getInstance().addDelta(new TaglibIndexDelta(fProject, records[i], ITaglibIndexDelta.REMOVED));
- ((ArrayMap) getImplicitReferences(jar.getFullPath().toString())).remove(records[i].getURI(), records[i]);
+ getImplicitReferences(jar.getFullPath().toString()).removeFirstPair(records[i].getURI(), records[i]);
}
if (record.has11TLD) {
TaglibIndex.getInstance().addDelta(new TaglibIndexDelta(fProject, record, ITaglibIndexDelta.REMOVED));
@@ -1774,7 +1774,7 @@ class ProjectDescription {
TLDRecord record = (TLDRecord) fTLDReferences.remove(tld.getFullPath().toString());
if (record != null) {
if (record.getURI() != null) {
- ((ArrayMap) getImplicitReferences(tld.getFullPath().toString())).remove(record.getURI(), record);
+ getImplicitReferences(tld.getFullPath().toString()).removeFirstPair(record.getURI(), record);
}
TaglibIndex.getInstance().addDelta(new TaglibIndexDelta(fProject, record, ITaglibIndexDelta.REMOVED));
}
@@ -1789,7 +1789,7 @@ class ProjectDescription {
for (int i = 0; i < records.length; i++) {
if (_debugIndexCreation)
Logger.log(Logger.INFO, "removed record for " + records[i].getURI() + "@" + records[i].path); //$NON-NLS-1$ //$NON-NLS-2$
- ((ArrayMap) getImplicitReferences(webxml.getFullPath().toString())).remove(records[i].getURI(), records[i]);
+ getImplicitReferences(webxml.getFullPath().toString()).removeFirstPair(records[i].getURI(), records[i]);
TaglibIndex.getInstance().addDelta(new TaglibIndexDelta(fProject, records[i], ITaglibIndexDelta.REMOVED));
}
}

Back to the top