Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
[![Review Assignment Due Date](https://classroom.github.com/assets/deadline-readme-button-22041afd0340ce965d47ae6ef1cefeee28c7c493a6346c4f15d667ab976d596c.svg)](https://classroom.github.com/a/_uV8Mn8f)
# 📘 Projektarbete: JPA + Hibernate med GitHub-flöde

Projektet genomförs som antingen en Java CLI-applikation eller med hjälp av JavaFX om ni vill ha ett grafiskt gränssnitt.
Expand Down
15 changes: 15 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -50,5 +50,20 @@
<artifactId>classgraph</artifactId>
<version>4.8.184</version>
</dependency>
<dependency>
<groupId>jakarta.persistence</groupId>
<artifactId>jakarta.persistence-api</artifactId>
<version>3.2.0</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>2.0.13</version>
</dependency>
Comment on lines +58 to +62
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

SLF4J implementation dependency missing.

You've added slf4j-api but no SLF4J implementation (e.g., logback-classic, slf4j-simple). Without an implementation, logging will fail with "Failed to load class org.slf4j.impl.StaticLoggerBinder" warnings, and log statements won't produce output.

Add an SLF4J implementation. For production, use Logback:

        <dependency>
            <groupId>ch.qos.logback</groupId>
            <artifactId>logback-classic</artifactId>
            <version>1.5.12</version>
        </dependency>

Or for simple console logging during development:

        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-simple</artifactId>
            <version>2.0.13</version>
        </dependency>
🤖 Prompt for AI Agents
In pom.xml around lines 58 to 62, you've declared slf4j-api but omitted an SLF4J
implementation, causing "Failed to load class org.slf4j.impl.StaticLoggerBinder"
and no logging output; add a single implementation dependency (e.g.,
ch.qos.logback:logback-classic:1.5.12 for production or
org.slf4j:slf4j-simple:2.0.13 for simple console logging in development), ensure
the chosen version is compatible with slf4j-api and remove any other SLF4J
implementation dependencies to avoid multiple bindings.

<dependency>
<groupId>org.openjfx</groupId>
<artifactId>javafx-media</artifactId>
<version>25.0.1</version>
</dependency>
Comment on lines +63 to +67
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Search for JavaFX imports and usage in the codebase
echo "=== Searching for JavaFX imports ==="
rg -n --type=java "import\s+javafx\." 
echo ""
echo "=== Searching for JavaFX class extensions ==="
rg -n --type=java "extends\s+(Application|Stage|Scene)"
echo ""
echo "=== Additional search: JavaFX references ==="
rg -n --type=java "javafx"

Repository: ithsjava25/ithsjava25-java-project-jpa-maven-java-template

Length of output: 231


Remove unused javafx-media dependency.

No JavaFX usage found in the codebase (no imports, class extensions, or references). If JavaFX is not intended for this project, remove the javafx-media dependency entirely. If it is planned for future use, reconsider adding it until actively needed.

🤖 Prompt for AI Agents
In pom.xml around lines 63 to 67, the javafx-media dependency is unused; remove
the entire <dependency> block for org.openjfx:javafx-media:25.0.1 from the
pom.xml to eliminate an unnecessary transitive artifact and rebuild; if you
intend to use JavaFX later, instead document the planned addition or add the
dependency only when code requiring JavaFX is introduced.

</dependencies>
</project>
4 changes: 1 addition & 3 deletions src/main/java/org/example/App.java
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
package org.example;

public class App {
public static void main(String[] args) {
System.out.println("Hello There!");
}

}
Comment on lines 3 to 5
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

🏁 Script executed:

# Check the current state of App.java
cat -n src/main/java/org/example/App.java

Repository: ithsjava25/ithsjava25-java-project-jpa-maven-java-template

Length of output: 180


🏁 Script executed:

# Search for main methods in the codebase
rg -n --type=java "public\s+static\s+void\s+main\s*\("

# Search for JavaFX Application classes
rg -n --type=java "extends\s+Application"

# Check for pom.xml to verify dependencies
cat -n pom.xml | head -50

Repository: ithsjava25/ithsjava25-java-project-jpa-maven-java-template

Length of output: 2366


🏁 Script executed:

# Check full pom.xml for javafx references
rg -n "javafx" pom.xml

Repository: ithsjava25/ithsjava25-java-project-jpa-maven-java-template

Length of output: 154


Add an entry point to make the application executable.

The App class is empty with no main method or JavaFX Application class. The javafx-media dependency in pom.xml suggests JavaFX is intended; create either a JavaFX Application entry point or restore a main method:

 package org.example;
 
 public class App {
-
+    public static void main(String[] args) {
+        // TODO: Initialize application
+        System.out.println("Hello World!");
+    }
 }
🤖 Prompt for AI Agents
In src/main/java/org/example/App.java around lines 3 to 5, the App class is
empty and lacks an entry point; add either a standard public static void
main(String[] args) as the JVM entry point or make App extend
javafx.application.Application and implement start(Stage) and call
Application.launch(args) from main (or rely on JavaFX launcher behavior). Ensure
the chosen approach matches the javafx-media dependency: for a JavaFX GUI create
the Application subclass with a main that calls launch, for a non-GUI CLI add
the main method that initializes necessary components; place the methods in this
App class and keep the file’s package and imports consistent.