You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pdfbox.apache.org by ti...@apache.org on 2023/03/18 10:42:44 UTC

svn commit: r1908480 - in /pdfbox/branches/2.0: debugger/src/main/java/org/apache/pdfbox/debugger/ui/OSXAdapter.java xmpbox/src/test/java/org/apache/xmpbox/schema/XMPSchemaTest.java

Author: tilman
Date: Sat Mar 18 10:42:44 2023
New Revision: 1908480

URL: http://svn.apache.org/viewvc?rev=1908480&view=rev
Log:
PDFBOX-5573: fix unnecessary boxing/unboxing, by Axel Howind

Modified:
    pdfbox/branches/2.0/debugger/src/main/java/org/apache/pdfbox/debugger/ui/OSXAdapter.java
    pdfbox/branches/2.0/xmpbox/src/test/java/org/apache/xmpbox/schema/XMPSchemaTest.java

Modified: pdfbox/branches/2.0/debugger/src/main/java/org/apache/pdfbox/debugger/ui/OSXAdapter.java
URL: http://svn.apache.org/viewvc/pdfbox/branches/2.0/debugger/src/main/java/org/apache/pdfbox/debugger/ui/OSXAdapter.java?rev=1908480&r1=1908479&r2=1908480&view=diff
==============================================================================
--- pdfbox/branches/2.0/debugger/src/main/java/org/apache/pdfbox/debugger/ui/OSXAdapter.java (original)
+++ pdfbox/branches/2.0/debugger/src/main/java/org/apache/pdfbox/debugger/ui/OSXAdapter.java Sat Mar 18 10:42:44 2023
@@ -162,7 +162,7 @@ public class OSXAdapter implements Invoc
         // com.apple.eawt.Application reflectively
         try {
             Method enableAboutMethod = macOSXApplication.getClass().getDeclaredMethod("setEnabledAboutMenu", boolean.class);
-            enableAboutMethod.invoke(macOSXApplication, Boolean.valueOf(enableAboutMenu));
+            enableAboutMethod.invoke(macOSXApplication, enableAboutMenu);
         } catch (Exception ex) {
             System.err.println("OSXAdapter could not access the About Menu");
             throw new RuntimeException(ex);
@@ -321,7 +321,7 @@ public class OSXAdapter implements Invoc
             try {
                 Method setHandledMethod = event.getClass().getDeclaredMethod("setHandled", boolean.class);
                 // If the target method returns a boolean, use that as a hint
-                setHandledMethod.invoke(event, Boolean.valueOf(handled));
+                setHandledMethod.invoke(event, handled);
             } catch (Exception ex) {
                 System.err.println("OSXAdapter was unable to handle an ApplicationEvent: " + event);
                 throw new RuntimeException(ex);

Modified: pdfbox/branches/2.0/xmpbox/src/test/java/org/apache/xmpbox/schema/XMPSchemaTest.java
URL: http://svn.apache.org/viewvc/pdfbox/branches/2.0/xmpbox/src/test/java/org/apache/xmpbox/schema/XMPSchemaTest.java?rev=1908480&r1=1908479&r2=1908480&view=diff
==============================================================================
--- pdfbox/branches/2.0/xmpbox/src/test/java/org/apache/xmpbox/schema/XMPSchemaTest.java (original)
+++ pdfbox/branches/2.0/xmpbox/src/test/java/org/apache/xmpbox/schema/XMPSchemaTest.java Sat Mar 18 10:42:44 2023
@@ -213,7 +213,7 @@ public class XMPSchemaTest
         schem.addUnqualifiedSequenceValue(seqprop, seqPropVal);
         schem.addSequenceDateValueAsSimple(seqdate, dateVal);
 
-        Assert.assertEquals(Boolean.valueOf(boolVal), schem.getBooleanProperty(prefSchem + bool).getValue());
+        Assert.assertEquals(boolVal, schem.getBooleanProperty(prefSchem + bool).getValue());
         Assert.assertEquals(dateVal, schem.getDateProperty(prefSchem + date).getValue());
         Assert.assertEquals("" + i, schem.getIntegerProperty(prefSchem + integ).getStringValue());
         Assert.assertEquals(langVal, schem.getUnqualifiedLanguagePropertyValue(langprop, lang));
@@ -222,7 +222,7 @@ public class XMPSchemaTest
         Assert.assertTrue(schem.getUnqualifiedSequenceDateValueList(seqdate).contains(dateVal));
         Assert.assertTrue(schem.getUnqualifiedLanguagePropertyLanguagesValue(langprop).contains(lang));
 
-        Assert.assertEquals(boolVal, schem.getBooleanPropertyValueAsSimple(bool).booleanValue());
+        Assert.assertEquals(boolVal, schem.getBooleanPropertyValueAsSimple(bool));
         Assert.assertEquals(dateVal, schem.getDatePropertyValueAsSimple(date));
         Assert.assertEquals(i, schem.getIntegerPropertyValueAsSimple(integ));
         Assert.assertEquals(langVal, schem.getUnqualifiedLanguagePropertyValue(langprop, lang));