harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a...@apache.org
Subject svn commit: r506428 - in /harmony/enhanced/classlib/trunk/modules/swing/src: main/java/common/javax/swing/plaf/basic/BasicPopupMenuUI.java test/api/java/common/javax/swing/plaf/basic/BasicPopupMenuUITest.java
Date Mon, 12 Feb 2007 11:56:42 GMT
Author: ayza
Date: Mon Feb 12 03:56:41 2007
New Revision: 506428

URL: http://svn.apache.org/viewvc?view=rev&rev=506428
Log:
Applying patch from HARMONY-2512 ([classlib][swing] javax.swing.plaf.basic.BasicPopupMenuUI.isPopupTrigger(null)
does not throw unspecified NPE)

Modified:
    harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/plaf/basic/BasicPopupMenuUI.java
    harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/plaf/basic/BasicPopupMenuUITest.java

Modified: harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/plaf/basic/BasicPopupMenuUI.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/plaf/basic/BasicPopupMenuUI.java?view=diff&rev=506428&r1=506427&r2=506428
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/plaf/basic/BasicPopupMenuUI.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/plaf/basic/BasicPopupMenuUI.java
Mon Feb 12 03:56:41 2007
@@ -14,10 +14,6 @@
  *  See the License for the specific language governing permissions and
  *  limitations under the License.
  */
-/**
- * @author Alexander T. Simbirtsev
- * @version $Revision$
- */
 package javax.swing.plaf.basic;
 
 import java.awt.event.MouseEvent;
@@ -95,6 +91,10 @@
     }
 
     public boolean isPopupTrigger(final MouseEvent event) {
+        if (event == null) {
+            throw new NullPointerException();
+        }
+ 
         return false;
     }
 }

Modified: harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/plaf/basic/BasicPopupMenuUITest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/plaf/basic/BasicPopupMenuUITest.java?view=diff&rev=506428&r1=506427&r2=506428
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/plaf/basic/BasicPopupMenuUITest.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/plaf/basic/BasicPopupMenuUITest.java
Mon Feb 12 03:56:41 2007
@@ -14,10 +14,6 @@
  *  See the License for the specific language governing permissions and
  *  limitations under the License.
  */
-/**
- * @author Alexander T. Simbirtsev
- * @version $Revision$
- */
 package javax.swing.plaf.basic;
 
 import java.awt.Color;
@@ -87,6 +83,16 @@
         assertFalse(popupUI.isPopupTrigger(event2));
         assertFalse(popupUI.isPopupTrigger(event3));
         assertFalse(popupUI.isPopupTrigger(event4));
+
+        // regression for HARMONY-2512
+        try {    
+            BasicPopupMenuUI m = new BasicPopupMenuUI();
+
+            m.isPopupTrigger(null);
+            fail("NPE should be thrown"); 
+        } catch (NullPointerException npe) {                
+            // PASSED            
+        }
     }
 
     /*



Mime
View raw message