harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ndbe...@apache.org
Subject svn commit: r470643 - in /incubator/harmony/enhanced/classlib/trunk/modules/print/src: main/java/common/javax/print/attribute/standard/ main/java/common/javax/print/event/ test/api/java/common/javax/print/attribute/standard/
Date Fri, 03 Nov 2006 03:46:05 GMT
Author: ndbeyer
Date: Thu Nov  2 19:46:04 2006
New Revision: 470643

URL: http://svn.apache.org/viewvc?view=rev&rev=470643
Log:
Code cleanup
* Add serialVersionUIDs
* Resolve a TODO

Modified:
    incubator/harmony/enhanced/classlib/trunk/modules/print/src/main/java/common/javax/print/attribute/standard/MediaSize.java
    incubator/harmony/enhanced/classlib/trunk/modules/print/src/main/java/common/javax/print/event/PrintEvent.java
    incubator/harmony/enhanced/classlib/trunk/modules/print/src/main/java/common/javax/print/event/PrintJobAdapter.java
    incubator/harmony/enhanced/classlib/trunk/modules/print/src/main/java/common/javax/print/event/PrintJobAttributeEvent.java
    incubator/harmony/enhanced/classlib/trunk/modules/print/src/main/java/common/javax/print/event/PrintJobAttributeListener.java
    incubator/harmony/enhanced/classlib/trunk/modules/print/src/main/java/common/javax/print/event/PrintJobEvent.java
    incubator/harmony/enhanced/classlib/trunk/modules/print/src/main/java/common/javax/print/event/PrintJobListener.java
    incubator/harmony/enhanced/classlib/trunk/modules/print/src/main/java/common/javax/print/event/PrintServiceAttributeEvent.java
    incubator/harmony/enhanced/classlib/trunk/modules/print/src/main/java/common/javax/print/event/PrintServiceAttributeListener.java
    incubator/harmony/enhanced/classlib/trunk/modules/print/src/test/api/java/common/javax/print/attribute/standard/MediaSizeTest.java

Modified: incubator/harmony/enhanced/classlib/trunk/modules/print/src/main/java/common/javax/print/attribute/standard/MediaSize.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/print/src/main/java/common/javax/print/attribute/standard/MediaSize.java?view=diff&rev=470643&r1=470642&r2=470643
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/print/src/main/java/common/javax/print/attribute/standard/MediaSize.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/print/src/main/java/common/javax/print/attribute/standard/MediaSize.java
Thu Nov  2 19:46:04 2006
@@ -25,6 +25,7 @@
 import javax.print.attribute.Attribute;
 import javax.print.attribute.Size2DSyntax;
 
+@SuppressWarnings("unused")
 public class MediaSize extends Size2DSyntax implements Attribute {
     private static final long serialVersionUID = -1967958664615414771L;
 
@@ -322,12 +323,10 @@
     }
 
     /*
-     * Loading nested classes and initializing it's static fields.
-     * It is necessary to put MediaSize instances into ArrayList
-     * and HashMap used in static MediaSize methods.
+     * Force the load and initialization of inner classes.
      */
-    //TODO This comment and code need to be validated; this seems unnecessary
     static {
+        
         MediaSize initClass = MediaSize.Engineering.A;
         initClass = MediaSize.ISO.A0;
         initClass = MediaSize.JIS.B0;

Modified: incubator/harmony/enhanced/classlib/trunk/modules/print/src/main/java/common/javax/print/event/PrintEvent.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/print/src/main/java/common/javax/print/event/PrintEvent.java?view=diff&rev=470643&r1=470642&r2=470643
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/print/src/main/java/common/javax/print/event/PrintEvent.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/print/src/main/java/common/javax/print/event/PrintEvent.java
Thu Nov  2 19:46:04 2006
@@ -14,19 +14,19 @@
  *  See the License for the specific language governing permissions and
  *  limitations under the License.
  */
-/** 
- * @author Aleksei V. Ivaschenko 
- * @version $Revision: 1.3 $ 
- */ 
 
 package javax.print.event;
 
-public class PrintEvent extends java.util.EventObject {
+import java.util.EventObject;
+
+public class PrintEvent extends EventObject {
+    private static final long serialVersionUID = 2286914924430763847L;
 
     public PrintEvent(Object source) {
         super(source);
     }
 
+    @Override
     public String toString() {
         return getSource().toString();
     }

Modified: incubator/harmony/enhanced/classlib/trunk/modules/print/src/main/java/common/javax/print/event/PrintJobAdapter.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/print/src/main/java/common/javax/print/event/PrintJobAdapter.java?view=diff&rev=470643&r1=470642&r2=470643
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/print/src/main/java/common/javax/print/event/PrintJobAdapter.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/print/src/main/java/common/javax/print/event/PrintJobAdapter.java
Thu Nov  2 19:46:04 2006
@@ -14,16 +14,12 @@
  *  See the License for the specific language governing permissions and
  *  limitations under the License.
  */
-/** 
- * @author Aleksei V. Ivaschenko 
- * @version $Revision: 1.3 $ 
- */ 
 
 package javax.print.event;
 
 public abstract class PrintJobAdapter implements PrintJobListener {
-
     public PrintJobAdapter() {
+        super();
     }
 
     public void printDataTransferCompleted(PrintJobEvent event) {

Modified: incubator/harmony/enhanced/classlib/trunk/modules/print/src/main/java/common/javax/print/event/PrintJobAttributeEvent.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/print/src/main/java/common/javax/print/event/PrintJobAttributeEvent.java?view=diff&rev=470643&r1=470642&r2=470643
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/print/src/main/java/common/javax/print/event/PrintJobAttributeEvent.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/print/src/main/java/common/javax/print/event/PrintJobAttributeEvent.java
Thu Nov  2 19:46:04 2006
@@ -14,10 +14,6 @@
  *  See the License for the specific language governing permissions and
  *  limitations under the License.
  */
-/** 
- * @author Aleksei V. Ivaschenko 
- * @version $Revision: 1.3 $ 
- */ 
 
 package javax.print.event;
 
@@ -25,11 +21,11 @@
 import javax.print.attribute.PrintJobAttributeSet;
 
 public class PrintJobAttributeEvent extends PrintEvent {
+    private static final long serialVersionUID = -6534469883874742101L;
 
-    private PrintJobAttributeSet attributes;
+    private final PrintJobAttributeSet attributes;
 
-    public PrintJobAttributeEvent(DocPrintJob source,
-            PrintJobAttributeSet attributes) {
+    public PrintJobAttributeEvent(DocPrintJob source, PrintJobAttributeSet attributes) {
         super(source);
         this.attributes = attributes;
     }
@@ -39,6 +35,6 @@
     }
 
     public DocPrintJob getPrintJob() {
-        return (DocPrintJob)getSource();
+        return (DocPrintJob) getSource();
     }
 }

Modified: incubator/harmony/enhanced/classlib/trunk/modules/print/src/main/java/common/javax/print/event/PrintJobAttributeListener.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/print/src/main/java/common/javax/print/event/PrintJobAttributeListener.java?view=diff&rev=470643&r1=470642&r2=470643
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/print/src/main/java/common/javax/print/event/PrintJobAttributeListener.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/print/src/main/java/common/javax/print/event/PrintJobAttributeListener.java
Thu Nov  2 19:46:04 2006
@@ -14,14 +14,9 @@
  *  See the License for the specific language governing permissions and
  *  limitations under the License.
  */
-/** 
- * @author Aleksei V. Ivaschenko 
- * @version $Revision: 1.3 $ 
- */ 
 
 package javax.print.event;
 
 public interface PrintJobAttributeListener {
-
-    public void attributeUpdate(PrintJobAttributeEvent event);
+    void attributeUpdate(PrintJobAttributeEvent event);
 }

Modified: incubator/harmony/enhanced/classlib/trunk/modules/print/src/main/java/common/javax/print/event/PrintJobEvent.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/print/src/main/java/common/javax/print/event/PrintJobEvent.java?view=diff&rev=470643&r1=470642&r2=470643
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/print/src/main/java/common/javax/print/event/PrintJobEvent.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/print/src/main/java/common/javax/print/event/PrintJobEvent.java
Thu Nov  2 19:46:04 2006
@@ -14,16 +14,13 @@
  *  See the License for the specific language governing permissions and
  *  limitations under the License.
  */
-/** 
- * @author Aleksei V. Ivaschenko 
- * @version $Revision: 1.3 $ 
- */ 
 
 package javax.print.event;
 
 import javax.print.DocPrintJob;
 
 public class PrintJobEvent extends PrintEvent {
+    private static final long serialVersionUID = -1711656903622072997L;
 
     public static final int DATA_TRANSFER_COMPLETE = 106;
 
@@ -37,7 +34,7 @@
 
     public static final int REQUIRES_ATTENTION = 104;
 
-    private int reason;
+    private final int reason;
 
     public PrintJobEvent(DocPrintJob source, int reason) {
         super(source);
@@ -49,6 +46,6 @@
     }
 
     public DocPrintJob getPrintJob() {
-        return (DocPrintJob)getSource();
+        return (DocPrintJob) getSource();
     }
 }

Modified: incubator/harmony/enhanced/classlib/trunk/modules/print/src/main/java/common/javax/print/event/PrintJobListener.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/print/src/main/java/common/javax/print/event/PrintJobListener.java?view=diff&rev=470643&r1=470642&r2=470643
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/print/src/main/java/common/javax/print/event/PrintJobListener.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/print/src/main/java/common/javax/print/event/PrintJobListener.java
Thu Nov  2 19:46:04 2006
@@ -14,24 +14,19 @@
  *  See the License for the specific language governing permissions and
  *  limitations under the License.
  */
-/** 
- * @author Aleksei V. Ivaschenko 
- * @version $Revision: 1.3 $ 
- */ 
 
 package javax.print.event;
 
 public interface PrintJobListener {
+    void printDataTransferCompleted(PrintJobEvent event);
 
-    public void printDataTransferCompleted(PrintJobEvent event);
+    void printJobCanceled(PrintJobEvent event);
 
-    public void printJobCanceled(PrintJobEvent event);
+    void printJobCompleted(PrintJobEvent event);
 
-    public void printJobCompleted(PrintJobEvent event);
+    void printJobFailed(PrintJobEvent event);
 
-    public void printJobFailed(PrintJobEvent event);
+    void printJobNoMoreEvents(PrintJobEvent event);
 
-    public void printJobNoMoreEvents(PrintJobEvent event);
-
-    public void printJobRequiresAttention(PrintJobEvent event);
+    void printJobRequiresAttention(PrintJobEvent event);
 }

Modified: incubator/harmony/enhanced/classlib/trunk/modules/print/src/main/java/common/javax/print/event/PrintServiceAttributeEvent.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/print/src/main/java/common/javax/print/event/PrintServiceAttributeEvent.java?view=diff&rev=470643&r1=470642&r2=470643
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/print/src/main/java/common/javax/print/event/PrintServiceAttributeEvent.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/print/src/main/java/common/javax/print/event/PrintServiceAttributeEvent.java
Thu Nov  2 19:46:04 2006
@@ -14,10 +14,6 @@
  *  See the License for the specific language governing permissions and
  *  limitations under the License.
  */
-/** 
- * @author Aleksei V. Ivaschenko 
- * @version $Revision: 1.3 $ 
- */ 
 
 package javax.print.event;
 
@@ -25,11 +21,11 @@
 import javax.print.attribute.PrintServiceAttributeSet;
 
 public class PrintServiceAttributeEvent extends PrintEvent {
+    private static final long serialVersionUID = -7565987018140326600L;
 
-    private PrintServiceAttributeSet attributes;
+    private final PrintServiceAttributeSet attributes;
 
-    public PrintServiceAttributeEvent(PrintService source,
-            PrintServiceAttributeSet attributes) {
+    public PrintServiceAttributeEvent(PrintService source, PrintServiceAttributeSet attributes)
{
         super(source);
         this.attributes = attributes;
     }
@@ -39,6 +35,6 @@
     }
 
     public PrintService getPrintService() {
-        return (PrintService)getSource();
+        return (PrintService) getSource();
     }
 }

Modified: incubator/harmony/enhanced/classlib/trunk/modules/print/src/main/java/common/javax/print/event/PrintServiceAttributeListener.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/print/src/main/java/common/javax/print/event/PrintServiceAttributeListener.java?view=diff&rev=470643&r1=470642&r2=470643
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/print/src/main/java/common/javax/print/event/PrintServiceAttributeListener.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/print/src/main/java/common/javax/print/event/PrintServiceAttributeListener.java
Thu Nov  2 19:46:04 2006
@@ -14,14 +14,9 @@
  *  See the License for the specific language governing permissions and
  *  limitations under the License.
  */
-/** 
- * @author Aleksei V. Ivaschenko 
- * @version $Revision: 1.3 $ 
- */ 
 
 package javax.print.event;
 
 public interface PrintServiceAttributeListener {
-
-    public void attributeUpdate(PrintServiceAttributeEvent event);
+    void attributeUpdate(PrintServiceAttributeEvent event);
 }

Modified: incubator/harmony/enhanced/classlib/trunk/modules/print/src/test/api/java/common/javax/print/attribute/standard/MediaSizeTest.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/print/src/test/api/java/common/javax/print/attribute/standard/MediaSizeTest.java?view=diff&rev=470643&r1=470642&r2=470643
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/print/src/test/api/java/common/javax/print/attribute/standard/MediaSizeTest.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/print/src/test/api/java/common/javax/print/attribute/standard/MediaSizeTest.java
Thu Nov  2 19:46:04 2006
@@ -25,18 +25,9 @@
 
 import junit.framework.TestCase;
 
-
+@SuppressWarnings("static-access")
 public class MediaSizeTest extends TestCase {
 
-    public static void main(String[] args) {
-        junit.textui.TestRunner.run(MediaSizeTest.class);
-    }
-
-    static {
-        System.out.println("MediaSize testing...");
-    }
-
-
     /*
      * MediaSize constructor testing.
      */
@@ -75,6 +66,7 @@
         MediaSizeName msn3 = new mediaSizeName(113);
         MediaSize ms1 = new MediaSize(Integer.MAX_VALUE / 15,
                 Integer.MAX_VALUE / 15, 1, msn1);
+        
         MediaSize ms2 = new MediaSize(Integer.MAX_VALUE / 5,
                 Integer.MAX_VALUE / 5, 1, msn2);
         MediaSize ms3 = new MediaSize(Integer.MAX_VALUE, Integer.MAX_VALUE, 1,
@@ -95,12 +87,12 @@
 
         assertTrue((MediaSizeName.JIS_B0 ==
                 MediaSize.findMedia(5000, 5000, MediaSize.MM)) ||
-                ((MediaSizeName) PPDMediaSizeName.B0 ==
+                (PPDMediaSizeName.B0 ==
                 MediaSize.findMedia(5000, 5000, MediaSize.MM)));
 
         assertTrue((MediaSizeName.ISO_A10 ==
             MediaSize.findMedia(20, 20, MediaSize.MM)) ||
-            ((MediaSizeName) PPDMediaSizeName.A10 ==
+            (PPDMediaSizeName.A10 ==
             MediaSize.findMedia(20, 20, MediaSize.MM)));
     }
 
@@ -221,6 +213,7 @@
     /*
      * Auxiliary class
      */
+    @SuppressWarnings("serial")
     public class mediaSizeName extends MediaSizeName {
 
         public mediaSizeName(int value) {



Mime
View raw message