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;
import javafx.scene.paint.Color;
import javafx.stage.FileChooser;
import javafx.stage.FileChooser.ExtensionFilter;
import org.jspecify.annotations.NonNull;
public class CityDoctorController {
......@@ -1604,12 +1605,11 @@ public class CityDoctorController {
return model;
}
public CityObject retrieveCityObject(GmlId gmlId) {
public @NonNull CityObject retrieveCityObject(GmlId gmlId) {
try{
return model.getCityObject(gmlId);
}catch(IllegalArgumentException e){
logger.warn(e.getMessage());
return null;
throw new NullPointerException(e.getMessage());
}
}
......
......@@ -37,6 +37,7 @@ import javafx.scene.transform.Rotate;
import javafx.stage.Stage;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.jspecify.annotations.NonNull;
import javax.imageio.ImageIO;
import java.awt.image.BufferedImage;
......@@ -831,7 +832,7 @@ public class MainWindow extends Application {
node.getFeatureExportAction(this);
}
public CityObject retrieveCityObject(GmlId id){
public @NonNull CityObject retrieveCityObject(GmlId 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