1
0
mirror of https://github.com/twiglet/cs2j.git synced 2025-01-18 13:15:17 +01:00

Restore support for Java 1.5: In Java 1.5 @Override doesn't accept methods that are only implementing interfaces

This commit is contained in:
Kevin Glynn 2012-01-18 14:32:52 +01:00
parent 24cd7e967d
commit e7471051d8
9 changed files with 22 additions and 98 deletions

View File

@ -54,111 +54,93 @@ public class CollectionSupport<T> implements ICollection<T> {
}
@Override
public boolean add(T arg0) {
return myCollection.add(arg0);
}
@Override
public boolean addAll(Collection<? extends T> arg0) {
return myCollection.addAll(arg0);
}
@Override
public void clear() {
myCollection.clear();
}
@Override
public boolean contains(Object arg0) {
return myCollection.contains(arg0);
}
@Override
public boolean containsAll(Collection<?> arg0) {
return myCollection.containsAll(arg0);
}
@Override
public boolean isEmpty() {
return myCollection.isEmpty();
}
@Override
public boolean remove(Object arg0) {
return myCollection.remove(arg0);
}
@Override
public boolean removeAll(Collection<?> arg0) {
return myCollection.removeAll(arg0);
}
@Override
public boolean retainAll(Collection<?> arg0) {
return myCollection.retainAll(arg0);
}
@Override
public int size() {
return myCollection.size();
}
@Override
public Object[] toArray() {
return myCollection.toArray();
}
@Override
public <S> S[] toArray(S[] arg0) {
return myCollection.toArray(arg0);
}
@Override
public boolean Contains(T x) throws Exception {
return myCollection.contains(x);
}
@Override
public void Add(T x) throws Exception {
myCollection.add(x);
}
@Override
public boolean Remove(T x) throws Exception {
return myCollection.remove(x);
}
@Override
public void Clear() throws Exception {
myCollection.clear();
}
@Override
public IEnumerator<T> GetEnumerator() throws Exception {
return new EnumeratorSupport<T>(myCollection.iterator());
}
@Override
public void CopyTo(T[] arr, int i) throws Exception {
if (arr == null) {
throw new NullArgumentException("arr");

View File

@ -59,7 +59,6 @@ public class IteratorSupport<T> implements Iterator<T>{
}
}
@Override
/***
* hasNext() can be called multiple times and should keep returning the same answer
* until next() has been called.
@ -68,7 +67,6 @@ public class IteratorSupport<T> implements Iterator<T>{
return hasNext;
}
@Override
public T next() {
if (!hasNext) {
throw new NoSuchElementException();
@ -84,7 +82,6 @@ public class IteratorSupport<T> implements Iterator<T>{
return ret;
}
@Override
public void remove() {
throw new UnsupportedOperationException("CS2J: IteratorSupport.remove()");

View File

@ -52,112 +52,92 @@ public class CollectionSupport<T> implements ICollection<T> {
return myCollection.iterator();
}
@Override
public boolean add(T arg0) {
return myCollection.add(arg0);
}
@Override
public boolean addAll(Collection<? extends T> arg0) {
return myCollection.addAll(arg0);
}
@Override
public void clear() {
myCollection.clear();
}
@Override
public boolean contains(Object arg0) {
return myCollection.contains(arg0);
}
@Override
public boolean containsAll(Collection<?> arg0) {
return myCollection.containsAll(arg0);
}
@Override
public boolean isEmpty() {
return myCollection.isEmpty();
}
@Override
public boolean remove(Object arg0) {
return myCollection.remove(arg0);
}
@Override
public boolean removeAll(Collection<?> arg0) {
return myCollection.removeAll(arg0);
}
@Override
public boolean retainAll(Collection<?> arg0) {
return myCollection.retainAll(arg0);
}
@Override
public int size() {
return myCollection.size();
}
@Override
public Object[] toArray() {
return myCollection.toArray();
}
@Override
public <S> S[] toArray(S[] arg0) {
return myCollection.toArray(arg0);
}
@Override
public boolean Contains(T x) throws Exception {
return myCollection.contains(x);
}
@Override
public void Add(T x) throws Exception {
myCollection.add(x);
}
@Override
public boolean Remove(T x) throws Exception {
return myCollection.remove(x);
}
@Override
public void Clear() throws Exception {
myCollection.clear();
}
@Override
public IEnumerator<T> getEnumerator() throws Exception {
return new EnumeratorSupport<T>(myCollection.iterator());
}
@Override
public void copyTo(T[] arr, int i) throws Exception {
if (arr == null) {
throw new NullArgumentException("arr");

View File

@ -31,7 +31,6 @@ public class EventCollection<T> implements IEventCollection<T> {
/* (non-Javadoc)
* @see CS2JNet.JavaSupport.language.IEventCollection#Invoke(java.lang.Object, CS2JNet.JavaSupport.language.EventArgs)
*/
@Override
public void Invoke(Object cause, EventArgs e) throws CS2JRunTimeException {
if (listeners != null) {
// do something here

View File

@ -60,99 +60,80 @@ public class CSList<T> implements ICollection<T>, IEnumerable<T>, Collection<T>
}
}
@Override
public Iterator<T> iterator() {
return myList.iterator();
}
@Override
public boolean add(T arg0) {
return myList.add(arg0);
}
@Override
public boolean addAll(Collection<? extends T> arg0) {
return myList.addAll(arg0);
}
@Override
public void clear() {
myList.clear();
}
@Override
public boolean contains(Object arg0) {
return myList.contains(arg0);
}
@Override
public boolean containsAll(Collection<?> arg0) {
return myList.containsAll(arg0);
}
@Override
public boolean isEmpty() {
return myList.isEmpty();
}
@Override
public boolean remove(Object arg0) {
return myList.remove(arg0);
}
@Override
public boolean removeAll(Collection<?> arg0) {
return myList.removeAll(arg0);
}
@Override
public boolean retainAll(Collection<?> arg0) {
return myList.retainAll(arg0);
}
@Override
public int size() {
return myList.size();
}
@Override
public Object[] toArray() {
return myList.toArray();
}
@Override
public <S> S[] toArray(S[] arg0) {
return myList.toArray(arg0);
}
@Override
public boolean Contains(T x) throws Exception {
return myList.contains(x);
}
@Override
public void Add(T x) throws Exception {
myList.add(x);
}
@Override
public boolean Remove(T x) throws Exception {
return myList.remove(x);
}
@Override
public void Clear() throws Exception {
myList.clear();
}
@Override
public IEnumerator<T> GetEnumerator() throws Exception {
return EnumeratorSupport.mk(myList.iterator());
}
@Override
public void CopyTo(T[] arr, int i) throws Exception {
if (arr == null)
throw new ArgumentNullException();

View File

@ -60,88 +60,88 @@ public class CSList<T> implements ICollection<T>, IEnumerable<T>, Collection<T>
}
}
@Override
public Iterator<T> iterator() {
return myList.iterator();
}
@Override
public boolean add(T arg0) {
return myList.add(arg0);
}
@Override
public boolean addAll(Collection<? extends T> arg0) {
return myList.addAll(arg0);
}
@Override
public void clear() {
myList.clear();
}
@Override
public boolean contains(Object arg0) {
return myList.contains(arg0);
}
@Override
public boolean containsAll(Collection<?> arg0) {
return myList.containsAll(arg0);
}
@Override
public boolean isEmpty() {
return myList.isEmpty();
}
@Override
public boolean remove(Object arg0) {
return myList.remove(arg0);
}
@Override
public boolean removeAll(Collection<?> arg0) {
return myList.removeAll(arg0);
}
@Override
public boolean retainAll(Collection<?> arg0) {
return myList.retainAll(arg0);
}
@Override
public int size() {
return myList.size();
}
@Override
public Object[] toArray() {
return myList.toArray();
}
@Override
public <S> S[] toArray(S[] arg0) {
return myList.toArray(arg0);
}
@Override
public boolean Contains(T x) throws Exception {
return myList.contains(x);
}
@Override
public void Add(T x) throws Exception {
myList.add(x);
}
@Override
public boolean Remove(T x) throws Exception {
return myList.remove(x);
}
@Override
public void Clear() throws Exception {
myList.clear();
}
@ -162,12 +162,12 @@ public class CSList<T> implements ICollection<T>, IEnumerable<T>, Collection<T>
}
}
@Override
public IEnumerator<T> getEnumerator() throws Exception {
return GetEnumerator();
}
@Override
public void copyTo(T[] arr, int i) throws Exception {
CopyTo(arr, i);
}

View File

@ -44,7 +44,6 @@ public class Disposable implements IDisposable {
/* (non-Javadoc)
* @see CS2JNet.System.IDisposable#Dispose()
*/
@Override
public void Dispose() throws Exception {
if (dispVal != null)
dispVal.Dispose();

View File

@ -44,7 +44,6 @@ public class Disposable implements IDisposable {
/* (non-Javadoc)
* @see CS2JNet.System.IDisposable#Dispose()
*/
@Override
public void dispose() throws Exception {
if (dispVal != null)
dispVal.dispose();

View File

@ -34,8 +34,7 @@ import javax.mail.internet.AddressException;
public class MailAddressCollection implements Collection<MailAddress> {
List<MailAddress> addresses = new ArrayList<MailAddress>();
@Override
public boolean add(MailAddress arg0) {
return addresses.add(arg0);
}
@ -44,63 +43,51 @@ public class MailAddressCollection implements Collection<MailAddress> {
return addresses.add(new MailAddress(arg0));
}
@Override
public boolean addAll(Collection<? extends MailAddress> arg0) {
return addresses.addAll(arg0);
}
@Override
public void clear() {
addresses.clear();
}
@Override
public boolean contains(Object arg0) {
return addresses.contains(arg0);
}
@Override
public boolean containsAll(Collection<?> arg0) {
return addresses.containsAll(arg0);
}
@Override
public boolean isEmpty() {
return addresses.isEmpty();
}
@Override
public Iterator<MailAddress> iterator() {
return addresses.iterator();
}
@Override
public boolean remove(Object arg0) {
return addresses.remove(arg0);
}
@Override
public boolean removeAll(Collection<?> arg0) {
return addresses.removeAll(arg0);
}
@Override
public boolean retainAll(Collection<?> arg0) {
return addresses.retainAll(arg0);
}
@Override
public int size() {
return addresses.size();
}
@Override
public Object[] toArray() {
return addresses.toArray();
}
@Override
public <T> T[] toArray(T[] arg0) {
return (T[]) addresses.toArray();
}