Skip to content
Merged
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
2 changes: 1 addition & 1 deletion .github/workflows/javadoc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,4 @@ jobs:
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./app/build/docs/javadoc
force_orphan: 'true'
force_orphan: 'true'
3 changes: 2 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"github.copilot.enable": false,
"java.configuration.updateBuildConfiguration": "automatic"
"java.configuration.updateBuildConfiguration": "automatic",
"java.compile.nullAnalysis.mode": "automatic"
}
24 changes: 24 additions & 0 deletions app/src/main/java/dev/project516/JavaAppTemplate/Greet.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
// SPDX-FileCopyrightText: 2026 project516 <project516@project516.dev>
//
// SPDX-License-Identifier: MIT

package dev.project516.JavaAppTemplate;

import java.util.ArrayList;
import java.util.Random;

public class Greet {

ArrayList<String> greetingList = new ArrayList<String>();

Random rand = new Random();

public Greet() {
greetingList.add("Hi");
greetingList.add("Hello");
}

public String greetUser() {
return greetingList.get(rand.nextInt(2));
}
}
6 changes: 1 addition & 5 deletions app/src/main/java/dev/project516/JavaAppTemplate/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,8 @@

public class Main {

public String greetUser() {
return "Hello!";
}

public static void main(String[] args) {

System.out.println(new Main().greetUser());
System.out.println(new Greet().greetUser());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@

import org.junit.Test;

public class MainTest {
public class GreetTest {
@Test
public void testGreetsUser() {
Main classUnderTest = new Main();
Greet classUnderTest = new Greet();
assertNotNull("Should greet the user", classUnderTest.greetUser());
}
}
Loading