jMonkeyEngine / jMonkeyEngine/jmonkeyengine
The normal parameter is not fully checked.
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 4.3k
- Forks
- 1.2k
- Avg merge
- 4d 7h
- Merged PRs (30d)
- 14
Description
When I call setNormal method of com.jme3.math.Plane, I notice that the method throws exceptions for null inputs:
public void setNormal(Vector3f normal) {
if (normal == null) {
throw new IllegalArgumentException("normal cannot be null");
}
this.normal.set(normal);
}
However, other methods do not check similar parameters. For example, I found that setOriginNormal does not throw exceptions when normal is set to null:
public void setOriginNormal(Vector3f origin, Vector3f normal){
this.normal.set(normal);
this.constant = normal.x * origin.x + normal.y * origin.y + normal.z * origin.z;
}
Please also add checks to avoid ill usages.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at com.jme3.math.Plane and compare setNormal with setOriginNormal, then inspect the other methods that accept Vector3f parameters. Identify which null inputs need consistent validation and confirm that the affected methods reject them without changing normal or constant.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- game-dev
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100