diff options
Diffstat (limited to 'graphs/java/triad')
5 files changed, 305 insertions, 0 deletions
diff --git a/graphs/java/triad/flake.nix b/graphs/java/triad/flake.nix new file mode 100644 index 0000000..6bf8d07 --- /dev/null +++ b/graphs/java/triad/flake.nix @@ -0,0 +1,29 @@ +{ + description = "Java 2027"; + + inputs = { + nixpkgs.url = "github:NixOS/nixpkgs/nixos-24.05"; + flake-utils.url = "github:numtide/flake-utils"; + }; + + outputs = { self, nixpkgs, flake-utils, ... }: + flake-utils.lib.eachDefaultSystem (system: + let + pkgs = import nixpkgs { + inherit system; + }; + in + with pkgs; + { + devShell = mkShell { + buildInputs = [ + jdk21_headless + postgresql + quarkus + maven + nodejs_22 + ]; + }; + } + ); +} diff --git a/graphs/java/triad/pom.xml b/graphs/java/triad/pom.xml new file mode 100644 index 0000000..66ce68d --- /dev/null +++ b/graphs/java/triad/pom.xml @@ -0,0 +1,133 @@ +<?xml version="1.0" encoding="UTF-8"?> +<project xmlns="http://maven.apache.org/POM/4.0.0" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + <modelVersion>4.0.0</modelVersion> + <groupId>fr.epita.assistants</groupId> + <artifactId>triad</artifactId> + <version>1.0</version> + + <properties> + <versions.java>21</versions.java> + <versions.junit>5.9.1</versions.junit> + <versions.maven-compiler-plugin>3.13.0</versions.maven-compiler-plugin> + <versions.maven-surefire-plugin>3.5.0</versions.maven-surefire-plugin> + <versions.maven-jar-plugin>3.1.1</versions.maven-jar-plugin> + <versions.maven-install-plugin>3.1.0</versions.maven-install-plugin> + + <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> + + <surefire.reportsDirectory>${project.build.directory}/surefire-reports</surefire.reportsDirectory> + </properties> + + <dependencies> + <dependency> + <groupId>org.junit.jupiter</groupId> + <artifactId>junit-jupiter</artifactId> + <version>${versions.junit}</version> + </dependency> + <dependency> + <groupId>org.apache.maven.surefire</groupId> + <artifactId>surefire-junit-platform</artifactId> + <version>${versions.maven-surefire-plugin}</version> + </dependency> + <dependency> + <groupId>org.apache.maven</groupId> + <artifactId>maven-compat</artifactId> + <version>3.9.8</version> + </dependency> + <dependency> + <groupId>org.apache.maven</groupId> + <artifactId>maven-plugin-api</artifactId> + <version>3.9.8</version> + </dependency> + <dependency> + <groupId>org.apache.maven</groupId> + <artifactId>maven-project</artifactId> + <version>2.2.1</version> + </dependency> + <dependency> + <groupId>org.apache.maven</groupId> + <artifactId>maven-core</artifactId> + <version>3.8.1</version> + </dependency> + <dependency> + <groupId>org.apache.maven</groupId> + <artifactId>maven-monitor</artifactId> + <version>2.2.1</version> + </dependency> + <dependency> + <groupId>org.codehaus.plexus</groupId> + <artifactId>plexus-utils</artifactId> + <version>3.0.24</version> + </dependency> + <dependency> + <groupId>org.apache.maven.shared</groupId> + <artifactId>maven-filtering</artifactId> + <version>3.3.2</version> + </dependency> + <dependency> + <groupId>org.codehaus.plexus</groupId> + <artifactId>plexus-interpolation</artifactId> + <version>1.13</version> + </dependency> + <dependency> + <groupId>org.apache.maven</groupId> + <artifactId>maven-profile</artifactId> + <version>2.2.1</version> + </dependency> + <dependency> + <groupId>org.apache.maven</groupId> + <artifactId>maven-artifact-manager</artifactId> + <version>2.2.1</version> + </dependency> + <dependency> + <groupId>org.apache.maven</groupId> + <artifactId>maven-plugin-registry</artifactId> + <version>2.2.1</version> + </dependency> + <dependency> + <groupId>org.apache.maven</groupId> + <artifactId>maven-repository-metadata</artifactId> + <version>2.2.1</version> + </dependency> + <dependency> + <groupId>classworlds</groupId> + <artifactId>classworlds</artifactId> + <version>1.1</version> + </dependency> + <dependency> + <groupId>org.junit.platform</groupId> + <artifactId>junit-platform-commons</artifactId> + <version>1.9.3</version> + </dependency> + </dependencies> + + <build> + <plugins> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-compiler-plugin</artifactId> + <version>${versions.maven-compiler-plugin}</version> + <configuration> + <source>${versions.java}</source> + <target>${versions.java}</target> + </configuration> + </plugin> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-install-plugin</artifactId> + <version>${versions.maven-install-plugin}</version> + </plugin> + + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-surefire-plugin</artifactId> + <version>${versions.maven-surefire-plugin}</version> + <configuration> + <reportsDirectory>${surefire.reportsDirectory}</reportsDirectory> + </configuration> + </plugin> + </plugins> + </build> +</project> diff --git a/graphs/java/triad/src/main/java/fr/epita/assistants/triad/FixMyMistake.java b/graphs/java/triad/src/main/java/fr/epita/assistants/triad/FixMyMistake.java new file mode 100644 index 0000000..b5fa908 --- /dev/null +++ b/graphs/java/triad/src/main/java/fr/epita/assistants/triad/FixMyMistake.java @@ -0,0 +1,9 @@ +package fr.epita.assistants.triad; + +public class FixMyMistake { + public static String myEasyFunction() { + // Place your cursor below on aMagicNumber and press Alt+Enter to fix the issue so that the method returns 43 + final String aMagicNumber = "43"; + return aMagicNumber; + } +} diff --git a/graphs/java/triad/src/main/java/fr/epita/assistants/triad/UglyClass.java b/graphs/java/triad/src/main/java/fr/epita/assistants/triad/UglyClass.java new file mode 100644 index 0000000..75b714d --- /dev/null +++ b/graphs/java/triad/src/main/java/fr/epita/assistants/triad/UglyClass.java @@ -0,0 +1,36 @@ +package fr.epita.assistants.triad; + +import java.util.List; +import java.util.function.Function; + +public class UglyClass { + public static List<WriteGettersAndConstructorForMe> getMyMessWithParameters() { + return myNotSoUsefulMethod(); + } + + private static List<WriteGettersAndConstructorForMe> myNotSoUsefulMethod() { + if (false) { + return List.of(); + } else + return List.of(new WriteGettersAndConstructorForMe("name", "firstName", "lastName", "random", "anotherOne" + , "anotherOne2", "anotherOne3", "xyz", 1, 2.0, 3.0f, true, false), + new WriteGettersAndConstructorForMe("name", "firstName", "lastName", "random", "anotherOne", + "anotherOne2", "anotherOne3", "xyz", 1, 2.0, 3.0f, true, false), + new WriteGettersAndConstructorForMe("name", "firstName", "lastName", "random", "anotherOne", + "anotherOne2", "anotherOne3", "xyz", 1, 2.0, 3.0f, true, false), + new WriteGettersAndConstructorForMe("name", "firstName", "lastName", "random", "anotherOne", + "anotherOne2", "anotherOne3", "xyz", 1, 2.0, 3.0f, true, false), + new WriteGettersAndConstructorForMe("name", "firstName", "lastName", "random", "anotherOne", + "anotherOne2", "anotherOne3", "xyz", 1, 2.0, 3.0f, true, false), + new WriteGettersAndConstructorForMe("name", "firstName", "lastName", "random", "anotherOne", + "anotherOne2", "anotherOne3", "xyz", 1, 2.0, 3.0f, true, false), + new WriteGettersAndConstructorForMe("name", "firstName", "lastName", "random", "anotherOne", + "anotherOne2", "anotherOne3", "xyz", 1, 2.0, 3.0f, true, false), + new WriteGettersAndConstructorForMe("name", "firstName", "lastName", "random", "anotherOne", + "anotherOne2", "anotherOne3", "xyz", 1, 2.0, 3.0f, true, false), + new WriteGettersAndConstructorForMe("name", "firstName", "lastName", "random", "anotherOne", + "anotherOne2", "anotherOne3", "xyz", 1, 2.0, 3.0f, true, false), + new WriteGettersAndConstructorForMe("name", "firstName", "lastName", "random", "anotherOne", + "anotherOne2", "anotherOne3", "xyz", 1, 2.0, 3.0f, true, false)).stream().filter(parameter -> parameter.getName().equals("name")).map(Function.identity()).toList(); + } +} diff --git a/graphs/java/triad/src/main/java/fr/epita/assistants/triad/WriteGettersAndConstructorForMe.java b/graphs/java/triad/src/main/java/fr/epita/assistants/triad/WriteGettersAndConstructorForMe.java new file mode 100644 index 0000000..794a8f6 --- /dev/null +++ b/graphs/java/triad/src/main/java/fr/epita/assistants/triad/WriteGettersAndConstructorForMe.java @@ -0,0 +1,98 @@ +package fr.epita.assistants.triad; + +public class WriteGettersAndConstructorForMe { + private final String name; + + public String getName() { + return name; + } + + public String getFirstName() { + return firstName; + } + + public String getLastName() { + return lastName; + } + + public String getRandom() { + return random; + } + + public String getAnotherOne() { + return anotherOne; + } + + public boolean isC() { + return c; + } + + public Boolean getB() { + return b; + } + + public float getZ() { + return z; + } + + public double getY() { + return y; + } + + public int getX() { + return x; + } + + public String getXyz() { + return xyz; + } + + public String getAnotherOne3() { + return anotherOne3; + } + + public String getAnotherOne2() { + return anotherOne2; + } + + public WriteGettersAndConstructorForMe(String name, String firstName, String lastName, String random, String anotherOne, String anotherOne2, String anotherOne3, String xyz, int x, double y, float z, Boolean b, boolean c) { + this.name = name; + this.firstName = firstName; + this.lastName = lastName; + this.random = random; + this.anotherOne = anotherOne; + this.anotherOne2 = anotherOne2; + this.anotherOne3 = anotherOne3; + this.xyz = xyz; + this.x = x; + this.y = y; + this.z = z; + this.b = b; + this.c = c; + } + + private final String firstName; + private final String lastName; + + private final String random; + + private final String anotherOne; + + private final String anotherOne2; + + private final String anotherOne3; + + private final String xyz; + + private final int x; + + private final double y; + + private final float z; + + private final Boolean b; + + private final boolean c; + + // FIXME: Add a constructor with all the parameters and all the getters +} |
