You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by ai...@apache.org on 2007/08/22 13:32:53 UTC
svn commit: r568567 -
/harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/undo/UndoManager.java
Author: aivanov
Date: Wed Aug 22 04:32:52 2007
New Revision: 568567
URL: http://svn.apache.org/viewvc?rev=568567&view=rev
Log:
Fixing compiler warnings: added @Override and declared serialVersionUID.
Modified:
harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/undo/UndoManager.java
Modified: harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/undo/UndoManager.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/undo/UndoManager.java?rev=568567&r1=568566&r2=568567&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/undo/UndoManager.java (original)
+++ harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/undo/UndoManager.java Wed Aug 22 04:32:52 2007
@@ -24,6 +24,12 @@
import javax.swing.event.UndoableEditListener;
public class UndoManager extends CompoundEdit implements UndoableEditListener {
+ /**
+ * <b>Note:</b> The <code>serialVersionUID</code> fields are explicitly
+ * declared as a performance optimization, not as a guarantee of
+ * serialization compatibility.
+ */
+ private static final long serialVersionUID = -8731438423915672404L;
/**
* Index points to edit from the array of edits.
@@ -46,6 +52,7 @@
edits.ensureCapacity(100);
}
+ @Override
public synchronized boolean addEdit(final UndoableEdit anEdit) {
if (inProgress) {
// we need to remove edits only when indexOfNextAdd < size - 1
@@ -124,12 +131,14 @@
* Object obj = new UndoManager();
* System.out.println(obj.toString());
*/
+ @Override
public String toString() {
return super.toString()
+ " limit: " + limit
+ " indexOfNextAdd: " + indexOfNextAdd;
}
+ @Override
public synchronized String getUndoPresentationName() {
if (inProgress) {
UndoableEdit undoEdit = editToBeUndone();
@@ -150,6 +159,7 @@
}
}
+ @Override
public synchronized String getRedoPresentationName() {
if (inProgress) {
UndoableEdit redoEdit = editToBeRedone();
@@ -189,6 +199,7 @@
}
}
+ @Override
public synchronized boolean canUndo() {
if (inProgress) {
// find significant edit and call canUndo
@@ -199,7 +210,8 @@
return super.canUndo();
}
- public synchronized boolean canRedo() {
+ @Override
+ public synchronized boolean canRedo() {
if (inProgress) {
// find significant edit and call canRedo
UndoableEdit edit = editToBeRedone();
@@ -226,6 +238,7 @@
}
}
+ @Override
public synchronized void undo() {
if (inProgress) {
// undo first significant edit before indexOfNextAdd
@@ -257,6 +270,7 @@
}
}
+ @Override
public synchronized void redo() {
if (inProgress) {
// redoes last significant edit at index or later
@@ -272,6 +286,7 @@
}
}
+ @Override
public synchronized void end() {
// calls super's end
super.end();