* 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
3.0
Sha..rd 13 years ago
parent 7dae4d5238
commit 0229a54b5e
  1. 2
      engine/src/core/com/jme3/animation/AnimChannel.java
  2. 2
      engine/src/core/com/jme3/effect/shapes/EmitterBoxShape.java
  3. 2
      engine/src/core/com/jme3/effect/shapes/EmitterSphereShape.java
  4. 2
      engine/src/core/com/jme3/font/BitmapTextPage.java
  5. 2
      engine/src/core/com/jme3/input/InputManager.java
  6. 2
      engine/src/core/com/jme3/scene/Node.java

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

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

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

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

@ -131,7 +131,7 @@ public class InputManager implements RawInputListener {
*/ */
public InputManager(MouseInput mouse, KeyInput keys, JoyInput joystick, TouchInput touch) { public InputManager(MouseInput mouse, KeyInput keys, JoyInput joystick, TouchInput touch) {
if (keys == null || mouse == null) { 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; this.keys = keys;

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

Loading…
Cancel
Save