Skip to content

Fix/null program#537

Merged
dabeshouse merged 3 commits intodevelopfrom
fix/null_program
Feb 24, 2026
Merged

Fix/null program#537
dabeshouse merged 3 commits intodevelopfrom
fix/null_program

Conversation

@dabeshouse
Copy link
Contributor

Belt and suspenders fixes for null program in sceneImp. Plus some code cleanup

Copy link
Contributor

@dportnoy15 dportnoy15 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! Just some minor suggestions about doing early returns.

if (composite.getParent() instanceof ManipulationHandle3D) {
return (ManipulationHandle3D) composite.getParent();
ProgramImp program = scene.getImplementation().getProgram();
if (program != null) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps instead do this instead, if you're ok with early returns, so the main part of the code doesn't need to be indented:

if (program == null) {
   return;
}

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

this.dragAdapter.makeCameraActive(camera);
this.dragAdapter.setAnimator(this.scene.getProgram().getAnimator());
ProgramImp program = scene.getProgram();
if (program != null) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ditto about early returns

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

*/
public class SceneImp extends EntityImp {
private static final Transformable createDirectionalLightTransformable(DirectionalLight sgDirectionalLight, Angle yaw, Angle pitch, float brightness) {
private static Transformable createDirectionalLightTransformable(DirectionalLight sgDirectionalLight, Angle yaw, Angle pitch, float brightness) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Was the removal of final here intentional? Just wondering since I don't see the method being overridden anywhere in the PR.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. It is static, so final adds nothing.

}

//todo
// private static class Capsule {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, no! My favorite class is going away!

@dabeshouse dabeshouse merged commit 15c1ebc into develop Feb 24, 2026
1 check passed
@dabeshouse dabeshouse deleted the fix/null_program branch February 24, 2026 21:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants