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) { public boolean add(T arg0) {
return myCollection.add(arg0); return myCollection.add(arg0);
} }
@Override
public boolean addAll(Collection<? extends T> arg0) { public boolean addAll(Collection<? extends T> arg0) {
return myCollection.addAll(arg0); return myCollection.addAll(arg0);
} }
@Override
public void clear() { public void clear() {
myCollection.clear(); myCollection.clear();
} }
@Override
public boolean contains(Object arg0) { public boolean contains(Object arg0) {
return myCollection.contains(arg0); return myCollection.contains(arg0);
} }
@Override
public boolean containsAll(Collection<?> arg0) { public boolean containsAll(Collection<?> arg0) {
return myCollection.containsAll(arg0); return myCollection.containsAll(arg0);
} }
@Override
public boolean isEmpty() { public boolean isEmpty() {
return myCollection.isEmpty(); return myCollection.isEmpty();
} }
@Override
public boolean remove(Object arg0) { public boolean remove(Object arg0) {
return myCollection.remove(arg0); return myCollection.remove(arg0);
} }
@Override
public boolean removeAll(Collection<?> arg0) { public boolean removeAll(Collection<?> arg0) {
return myCollection.removeAll(arg0); return myCollection.removeAll(arg0);
} }
@Override
public boolean retainAll(Collection<?> arg0) { public boolean retainAll(Collection<?> arg0) {
return myCollection.retainAll(arg0); return myCollection.retainAll(arg0);
} }
@Override
public int size() { public int size() {
return myCollection.size(); return myCollection.size();
} }
@Override
public Object[] toArray() { public Object[] toArray() {
return myCollection.toArray(); return myCollection.toArray();
} }
@Override
public <S> S[] toArray(S[] arg0) { public <S> S[] toArray(S[] arg0) {
return myCollection.toArray(arg0); return myCollection.toArray(arg0);
} }
@Override
public boolean Contains(T x) throws Exception { public boolean Contains(T x) throws Exception {
return myCollection.contains(x); return myCollection.contains(x);
} }
@Override
public void Add(T x) throws Exception { public void Add(T x) throws Exception {
myCollection.add(x); myCollection.add(x);
} }
@Override
public boolean Remove(T x) throws Exception { public boolean Remove(T x) throws Exception {
return myCollection.remove(x); return myCollection.remove(x);
} }
@Override
public void Clear() throws Exception { public void Clear() throws Exception {
myCollection.clear(); myCollection.clear();
} }
@Override
public IEnumerator<T> GetEnumerator() throws Exception { public IEnumerator<T> GetEnumerator() throws Exception {
return new EnumeratorSupport<T>(myCollection.iterator()); return new EnumeratorSupport<T>(myCollection.iterator());
} }
@Override
public void CopyTo(T[] arr, int i) throws Exception { public void CopyTo(T[] arr, int i) throws Exception {
if (arr == null) { if (arr == null) {
throw new NullArgumentException("arr"); 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 * hasNext() can be called multiple times and should keep returning the same answer
* until next() has been called. * until next() has been called.
@ -68,7 +67,6 @@ public class IteratorSupport<T> implements Iterator<T>{
return hasNext; return hasNext;
} }
@Override
public T next() { public T next() {
if (!hasNext) { if (!hasNext) {
throw new NoSuchElementException(); throw new NoSuchElementException();
@ -84,7 +82,6 @@ public class IteratorSupport<T> implements Iterator<T>{
return ret; return ret;
} }
@Override
public void remove() { public void remove() {
throw new UnsupportedOperationException("CS2J: IteratorSupport.remove()"); throw new UnsupportedOperationException("CS2J: IteratorSupport.remove()");

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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