Browse Source

Fix clobbering of Jackson ctor/setter for Photo path and UI's setter for
interactive usage.

Sam Jaffe 4 years ago
parent
commit
3fd499de46

+ 1 - 1
src/main/lombok/org/leumasjaffe/recipe/controller/SetImageAction.java

@@ -49,7 +49,7 @@ public class SetImageAction extends MouseAdapter {
 		}
 		
 		final String path = chooser.getSelectedFile().getAbsolutePath();
-		model.setPhoto(path);
+		model.setPhotoPath(path);
 		setPhoto.accept(path);
 	}
 }

+ 3 - 1
src/main/lombok/org/leumasjaffe/recipe/model/RecipeCard.java

@@ -9,6 +9,8 @@ import java.util.stream.Stream;
 
 import org.leumasjaffe.observer.Observable;
 
+import com.fasterxml.jackson.annotation.JsonIgnore;
+
 import lombok.Data;
 import lombok.EqualsAndHashCode;
 
@@ -22,7 +24,7 @@ public class RecipeCard extends Observable.Instance implements CompoundRecipeCom
 	Optional<String> photo = Optional.empty(); // TODO JSONIZATION	
 	List<Element> elements = new ArrayList<>();
 	
-	public void setPhoto(final String photo) {
+	@JsonIgnore public void setPhotoPath(final String photo) {
 		this.photo = Optional.of(photo);
 	}