Skip to content
Snippets Groups Projects
Commit be591189 authored by Karsch Lukas's avatar Karsch Lukas
Browse files

removing redundant assignments etc

parent 31eb2696
Branches main
No related tags found
No related merge requests found
......@@ -19,8 +19,6 @@ public class MusicPlayer implements Runnable {
private final String absoluteFilePath;
private boolean isPlaying;
private AudioInputStream audioInputStream = null;
private SourceDataLine line = null;
private final byte[] buffer = new byte[BUFFER_SIZE];
private boolean running = true;
......@@ -32,6 +30,7 @@ public class MusicPlayer implements Runnable {
@Override
public void run() {
isPlaying = true;
AudioInputStream audioInputStream;
try {
audioInputStream = getAudioInputStream(absoluteFilePath);
} catch (Exception e) {
......@@ -40,6 +39,7 @@ public class MusicPlayer implements Runnable {
}
final AudioFormat audioFormat = audioInputStream.getFormat();
final DataLine.Info info = new DataLine.Info(SourceDataLine.class, audioFormat);
SourceDataLine line;
try {
//get ready to write audio data
line = (SourceDataLine) AudioSystem.getLine(info);
......
......@@ -5,11 +5,9 @@ import javafx.scene.text.Text;
import mi.hdm.recipes.RecipeComponent;
public class IngredientLabel extends HBox {
private final RecipeComponent component;
public IngredientLabel(int amount, RecipeComponent component) {
super();
this.component = component;
Text labelAmount = new Text(amount + " " + component.getMeasurement().getAbbreviation());
Text labelName = new Text(component.getName());
......@@ -19,8 +17,4 @@ public class IngredientLabel extends HBox {
setSpacing(16.0);
setStyle("-fx-padding: 5px;");
}
public RecipeComponent getComponent() {
return component;
}
}
......@@ -6,12 +6,10 @@ import java.lang.reflect.Type;
* This exception is thrown when no object is found for a code.
*/
public class MissingContentException extends Exception {
private final Type type;
private final String code;
public MissingContentException(String code, Type type) {
super("Missing content exception: no instance of '" + type.getTypeName() + "' was found with code '" + code + "'");
this.type = type;
this.code = code;
}
......
......@@ -15,6 +15,7 @@ public class NutritionCalculator {
*
* @return the nutrition table for this recipe based on its ingredients. All nutrition values are added up.
*/
@SuppressWarnings("BigDecimalMethodWithoutRoundingCalled")
public static NutritionTable calculateNutritionTable(Map<RecipeComponent, Integer> ingredients) {
if (ingredients == null || ingredients.isEmpty()) {
log.info("Map ingredients is null or empty. Therefore new nutritionTable() was generated.");
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment