squid:S1161 - '@Override' annotation should be used on any method overriding (since Java 5) or implementing (since Java 6) another one

This commit is contained in:
George Kankava
2016-07-02 10:16:50 +04:00
parent c7959ce63e
commit eb58734fea
2 changed files with 45 additions and 0 deletions
@@ -279,16 +279,19 @@ public class SlideModel extends Model implements List<MediaModel>, EventListener
* @throws ContentRestrictionException when can not add this object. * @throws ContentRestrictionException when can not add this object.
* *
*/ */
@Override
public boolean add(MediaModel object) { public boolean add(MediaModel object) {
internalAdd(object); internalAdd(object);
notifyModelChanged(true); notifyModelChanged(true);
return true; return true;
} }
@Override
public boolean addAll(Collection<? extends MediaModel> collection) { public boolean addAll(Collection<? extends MediaModel> collection) {
throw new UnsupportedOperationException("Operation not supported."); throw new UnsupportedOperationException("Operation not supported.");
} }
@Override
public void clear() { public void clear() {
if (mMedia.size() > 0) { if (mMedia.size() > 0) {
for (MediaModel media : mMedia) { for (MediaModel media : mMedia) {
@@ -312,22 +315,27 @@ public class SlideModel extends Model implements List<MediaModel>, EventListener
} }
} }
@Override
public boolean contains(Object object) { public boolean contains(Object object) {
return mMedia.contains(object); return mMedia.contains(object);
} }
@Override
public boolean containsAll(Collection<?> collection) { public boolean containsAll(Collection<?> collection) {
return mMedia.containsAll(collection); return mMedia.containsAll(collection);
} }
@Override
public boolean isEmpty() { public boolean isEmpty() {
return mMedia.isEmpty(); return mMedia.isEmpty();
} }
@Override
public Iterator<MediaModel> iterator() { public Iterator<MediaModel> iterator() {
return mMedia.iterator(); return mMedia.iterator();
} }
@Override
public boolean remove(Object object) { public boolean remove(Object object) {
if ((object != null) && (object instanceof MediaModel) if ((object != null) && (object instanceof MediaModel)
&& internalRemove(object)) { && internalRemove(object)) {
@@ -337,35 +345,43 @@ public class SlideModel extends Model implements List<MediaModel>, EventListener
return false; return false;
} }
@Override
public boolean removeAll(Collection<?> collection) { public boolean removeAll(Collection<?> collection) {
throw new UnsupportedOperationException("Operation not supported."); throw new UnsupportedOperationException("Operation not supported.");
} }
@Override
public boolean retainAll(Collection<?> collection) { public boolean retainAll(Collection<?> collection) {
throw new UnsupportedOperationException("Operation not supported."); throw new UnsupportedOperationException("Operation not supported.");
} }
@Override
public int size() { public int size() {
return mMedia.size(); return mMedia.size();
} }
@Override
public Object[] toArray() { public Object[] toArray() {
return mMedia.toArray(); return mMedia.toArray();
} }
@Override
public <T> T[] toArray(T[] array) { public <T> T[] toArray(T[] array) {
return mMedia.toArray(array); return mMedia.toArray(array);
} }
@Override
public void add(int location, MediaModel object) { public void add(int location, MediaModel object) {
throw new UnsupportedOperationException("Operation not supported."); throw new UnsupportedOperationException("Operation not supported.");
} }
@Override
public boolean addAll(int location, public boolean addAll(int location,
Collection<? extends MediaModel> collection) { Collection<? extends MediaModel> collection) {
throw new UnsupportedOperationException("Operation not supported."); throw new UnsupportedOperationException("Operation not supported.");
} }
@Override
public MediaModel get(int location) { public MediaModel get(int location) {
if (mMedia.size() == 0) { if (mMedia.size() == 0) {
return null; return null;
@@ -374,22 +390,27 @@ public class SlideModel extends Model implements List<MediaModel>, EventListener
return mMedia.get(location); return mMedia.get(location);
} }
@Override
public int indexOf(Object object) { public int indexOf(Object object) {
return mMedia.indexOf(object); return mMedia.indexOf(object);
} }
@Override
public int lastIndexOf(Object object) { public int lastIndexOf(Object object) {
return mMedia.lastIndexOf(object); return mMedia.lastIndexOf(object);
} }
@Override
public ListIterator<MediaModel> listIterator() { public ListIterator<MediaModel> listIterator() {
return mMedia.listIterator(); return mMedia.listIterator();
} }
@Override
public ListIterator<MediaModel> listIterator(int location) { public ListIterator<MediaModel> listIterator(int location) {
return mMedia.listIterator(location); return mMedia.listIterator(location);
} }
@Override
public MediaModel remove(int location) { public MediaModel remove(int location) {
MediaModel media = mMedia.get(location); MediaModel media = mMedia.get(location);
if ((media != null) && internalRemove(media)) { if ((media != null) && internalRemove(media)) {
@@ -398,10 +419,12 @@ public class SlideModel extends Model implements List<MediaModel>, EventListener
return media; return media;
} }
@Override
public MediaModel set(int location, MediaModel object) { public MediaModel set(int location, MediaModel object) {
throw new UnsupportedOperationException("Operation not supported."); throw new UnsupportedOperationException("Operation not supported.");
} }
@Override
public List<MediaModel> subList(int start, int end) { public List<MediaModel> subList(int start, int end) {
return mMedia.subList(start, end); return mMedia.subList(start, end);
} }
@@ -406,6 +406,7 @@ public class SlideshowModel extends Model
// //
// Implement List<E> interface. // Implement List<E> interface.
// //
@Override
public boolean add(SlideModel object) { public boolean add(SlideModel object) {
int increaseSize = object.getSlideSize(); int increaseSize = object.getSlideSize();
checkMessageSize(increaseSize); checkMessageSize(increaseSize);
@@ -422,10 +423,12 @@ public class SlideshowModel extends Model
return false; return false;
} }
@Override
public boolean addAll(Collection<? extends SlideModel> collection) { public boolean addAll(Collection<? extends SlideModel> collection) {
throw new UnsupportedOperationException("Operation not supported."); throw new UnsupportedOperationException("Operation not supported.");
} }
@Override
public void clear() { public void clear() {
if (mSlides.size() > 0) { if (mSlides.size() > 0) {
for (SlideModel slide : mSlides) { for (SlideModel slide : mSlides) {
@@ -440,22 +443,27 @@ public class SlideshowModel extends Model
} }
} }
@Override
public boolean contains(Object object) { public boolean contains(Object object) {
return mSlides.contains(object); return mSlides.contains(object);
} }
@Override
public boolean containsAll(Collection<?> collection) { public boolean containsAll(Collection<?> collection) {
return mSlides.containsAll(collection); return mSlides.containsAll(collection);
} }
@Override
public boolean isEmpty() { public boolean isEmpty() {
return mSlides.isEmpty(); return mSlides.isEmpty();
} }
@Override
public Iterator<SlideModel> iterator() { public Iterator<SlideModel> iterator() {
return mSlides.iterator(); return mSlides.iterator();
} }
@Override
public boolean remove(Object object) { public boolean remove(Object object) {
if ((object != null) && mSlides.remove(object)) { if ((object != null) && mSlides.remove(object)) {
SlideModel slide = (SlideModel) object; SlideModel slide = (SlideModel) object;
@@ -467,26 +475,32 @@ public class SlideshowModel extends Model
return false; return false;
} }
@Override
public boolean removeAll(Collection<?> collection) { public boolean removeAll(Collection<?> collection) {
throw new UnsupportedOperationException("Operation not supported."); throw new UnsupportedOperationException("Operation not supported.");
} }
@Override
public boolean retainAll(Collection<?> collection) { public boolean retainAll(Collection<?> collection) {
throw new UnsupportedOperationException("Operation not supported."); throw new UnsupportedOperationException("Operation not supported.");
} }
@Override
public int size() { public int size() {
return mSlides.size(); return mSlides.size();
} }
@Override
public Object[] toArray() { public Object[] toArray() {
return mSlides.toArray(); return mSlides.toArray();
} }
@Override
public <T> T[] toArray(T[] array) { public <T> T[] toArray(T[] array) {
return mSlides.toArray(array); return mSlides.toArray(array);
} }
@Override
public void add(int location, SlideModel object) { public void add(int location, SlideModel object) {
if (object != null) { if (object != null) {
int increaseSize = object.getSlideSize(); int increaseSize = object.getSlideSize();
@@ -502,31 +516,38 @@ public class SlideshowModel extends Model
} }
} }
@Override
public boolean addAll(int location, public boolean addAll(int location,
Collection<? extends SlideModel> collection) { Collection<? extends SlideModel> collection) {
throw new UnsupportedOperationException("Operation not supported."); throw new UnsupportedOperationException("Operation not supported.");
} }
@Override
public SlideModel get(int location) { public SlideModel get(int location) {
return (location >= 0 && location < mSlides.size()) ? mSlides.get(location) : null; return (location >= 0 && location < mSlides.size()) ? mSlides.get(location) : null;
} }
@Override
public int indexOf(Object object) { public int indexOf(Object object) {
return mSlides.indexOf(object); return mSlides.indexOf(object);
} }
@Override
public int lastIndexOf(Object object) { public int lastIndexOf(Object object) {
return mSlides.lastIndexOf(object); return mSlides.lastIndexOf(object);
} }
@Override
public ListIterator<SlideModel> listIterator() { public ListIterator<SlideModel> listIterator() {
return mSlides.listIterator(); return mSlides.listIterator();
} }
@Override
public ListIterator<SlideModel> listIterator(int location) { public ListIterator<SlideModel> listIterator(int location) {
return mSlides.listIterator(location); return mSlides.listIterator(location);
} }
@Override
public SlideModel remove(int location) { public SlideModel remove(int location) {
SlideModel slide = mSlides.remove(location); SlideModel slide = mSlides.remove(location);
if (slide != null) { if (slide != null) {
@@ -537,6 +558,7 @@ public class SlideshowModel extends Model
return slide; return slide;
} }
@Override
public SlideModel set(int location, SlideModel object) { public SlideModel set(int location, SlideModel object) {
SlideModel slide = mSlides.get(location); SlideModel slide = mSlides.get(location);
if (null != object) { if (null != object) {