Commit ad0c25f1 authored by Luna Riegel's avatar Luna Riegel
Browse files

Refactor: Cleanup code

parent a9b6756d
...@@ -81,6 +81,7 @@ import javafx.scene.control.TreeView; ...@@ -81,6 +81,7 @@ import javafx.scene.control.TreeView;
import javafx.scene.paint.Color; import javafx.scene.paint.Color;
import javafx.stage.FileChooser; import javafx.stage.FileChooser;
import javafx.stage.FileChooser.ExtensionFilter; import javafx.stage.FileChooser.ExtensionFilter;
import org.jspecify.annotations.NonNull;
public class CityDoctorController { public class CityDoctorController {
...@@ -1604,12 +1605,11 @@ public class CityDoctorController { ...@@ -1604,12 +1605,11 @@ public class CityDoctorController {
return model; return model;
} }
public CityObject retrieveCityObject(GmlId gmlId) { public @NonNull CityObject retrieveCityObject(GmlId gmlId) {
try{ try{
return model.getCityObject(gmlId); return model.getCityObject(gmlId);
}catch(IllegalArgumentException e){ }catch(IllegalArgumentException e){
logger.warn(e.getMessage()); throw new NullPointerException(e.getMessage());
return null;
} }
} }
......
...@@ -37,6 +37,7 @@ import javafx.scene.transform.Rotate; ...@@ -37,6 +37,7 @@ import javafx.scene.transform.Rotate;
import javafx.stage.Stage; import javafx.stage.Stage;
import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger; import org.apache.logging.log4j.Logger;
import org.jspecify.annotations.NonNull;
import javax.imageio.ImageIO; import javax.imageio.ImageIO;
import java.awt.image.BufferedImage; import java.awt.image.BufferedImage;
...@@ -831,7 +832,7 @@ public class MainWindow extends Application { ...@@ -831,7 +832,7 @@ public class MainWindow extends Application {
node.getFeatureExportAction(this); node.getFeatureExportAction(this);
} }
public CityObject retrieveCityObject(GmlId id){ public @NonNull CityObject retrieveCityObject(GmlId id){
return controller.retrieveCityObject(id); return controller.retrieveCityObject(id);
} }
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment