Просмотр исходного кода

* Fixed some "throw new NullPointerException" statements and replaced with IllegalArgumentException

git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@9987 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
Sha..rd 13 лет назад
Родитель
Сommit
0229a54b5e

+ 1 - 1
engine/src/core/com/jme3/animation/AnimChannel.java

@@ -235,7 +235,7 @@ public final class AnimChannel {
      */
     public void setAnim(String name, float blendTime){
         if (name == null)
-            throw new NullPointerException();
+            throw new IllegalArgumentException("name cannot be null");
 
         if (blendTime < 0f)
             throw new IllegalArgumentException("blendTime cannot be less than zero");

+ 1 - 1
engine/src/core/com/jme3/effect/shapes/EmitterBoxShape.java

@@ -48,7 +48,7 @@ public class EmitterBoxShape implements EmitterShape {
 
     public EmitterBoxShape(Vector3f min, Vector3f max) {
         if (min == null || max == null) {
-            throw new NullPointerException();
+            throw new IllegalArgumentException("min or max cannot be null");
         }
 
         this.min = min;

+ 1 - 1
engine/src/core/com/jme3/effect/shapes/EmitterSphereShape.java

@@ -49,7 +49,7 @@ public class EmitterSphereShape implements EmitterShape {
 
     public EmitterSphereShape(Vector3f center, float radius) {
         if (center == null) {
-            throw new NullPointerException();
+            throw new IllegalArgumentException("center cannot be null");
         }
 
         if (radius <= 0) {

+ 1 - 1
engine/src/core/com/jme3/font/BitmapTextPage.java

@@ -61,7 +61,7 @@ class BitmapTextPage extends Geometry {
         super("BitmapFont", new Mesh());
 
         if (font == null) {
-            throw new NullPointerException("'font' cannot be null.");
+            throw new IllegalArgumentException("font cannot be null.");
         }
 
         this.page = page;

+ 1 - 1
engine/src/core/com/jme3/input/InputManager.java

@@ -131,7 +131,7 @@ public class InputManager implements RawInputListener {
      */
     public InputManager(MouseInput mouse, KeyInput keys, JoyInput joystick, TouchInput touch) {
         if (keys == null || mouse == null) {
-            throw new NullPointerException("Mouse or keyboard cannot be null");
+            throw new IllegalArgumentException("Mouse or keyboard cannot be null");
         }
 
         this.keys = keys;

+ 1 - 1
engine/src/core/com/jme3/scene/Node.java

@@ -233,7 +233,7 @@ public class Node extends Spatial implements Savable {
      */
     public int attachChild(Spatial child) {
         if (child == null)
-            throw new NullPointerException();
+            throw new IllegalArgumentException("child cannot be null");
 
         if (child.getParent() != this && child != this) {
             if (child.getParent() != null) {