Skip to content

Appmod/java upgrade 20260602174913 - #1

Merged
siconeli1 merged 5 commits into
mainfrom
appmod/java-upgrade-20260602174913
Jun 2, 2026
Merged

siconeli1 merged 5 commits into
mainfrom
appmod/java-upgrade-20260602174913

Conversation

@siconeli1

Copy link
Copy Markdown
Owner

No description provided.

siconeli1 added 3 commits June 2, 2026 15:01
Updated Maven compiler source/target to Java 21.
Verified the project compiles on JDK 21.
No functional source changes were needed.
Security: no security-sensitive code paths were changed.
Ran a clean Maven build and the full test suite on JDK 21.
All 6 tests passed with no failures.
No project source or dependency changes were needed.
Security: no security-sensitive code paths were changed.
Copilot AI review requested due to automatic review settings June 2, 2026 19:44

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR modernizes the StudentHub JavaFX application by upgrading the build/runtime to Java 21 + JavaFX 21, refactoring the domain/service/repository layers (including JSON persistence), and adding a JUnit 5 test suite plus GitHub Actions CI.

Changes:

  • Upgrades the project to Java 21 / JavaFX 21.0.7, adds modular mainClass configuration, and introduces CI workflow for mvn test.
  • Refactors student management into a repository-backed AlunoService with validation, sorting, search, and safer UI messaging via MensagemFactory.
  • Adds/organizes automated tests for model, service, repository persistence, and authentication.

Reviewed changes

Copilot reviewed 33 out of 34 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
src/test/java/com/empresa/leonardoteixeiralucassiconeli_projetofinal/service/InMemoryAlunoRepository.java Adds an in-memory repository implementation to support service unit tests.
src/test/java/com/empresa/leonardoteixeiralucassiconeli_projetofinal/service/AutenticacaoServiceTest.java Adds unit tests for the authentication service.
src/test/java/com/empresa/leonardoteixeiralucassiconeli_projetofinal/service/AlunoServiceTest.java Adds coverage for AlunoService validation/search/update/remove behaviors.
src/test/java/com/empresa/leonardoteixeiralucassiconeli_projetofinal/repository/AlunoRepositoryJSONTest.java Adds persistence tests for JSON repository using a temp directory.
src/test/java/com/empresa/leonardoteixeiralucassiconeli_projetofinal/model/AlunoTest.java Adds model-level tests for getters/setters, copy constructor, equals/hashCode, and toString.
src/test/java/AlunoTest.java Removes old un-packaged test (replaced by structured tests under the app package).
src/test/java/AlunoServiceTest.java Removes old singleton/JavaFX-coupled service test (replaced by injected repository tests).
src/main/resources/com/empresa/leonardoteixeiralucassiconeli_projetofinal/view/styles.css Redesigns styling and introduces new style classes for modern UI.
src/main/resources/com/empresa/leonardoteixeiralucassiconeli_projetofinal/view/principal.fxml Updates main screen layout, adds header/search actions, and applies new style classes.
src/main/resources/com/empresa/leonardoteixeiralucassiconeli_projetofinal/view/login.fxml Updates login screen layout/styling to match new design system.
src/main/resources/com/empresa/leonardoteixeiralucassiconeli_projetofinal/view/cadastroAluno.fxml Updates student form screen layout/styling and adds clear/back actions.
src/main/java/module-info.java Exports additional packages to support modular usage and tests.
src/main/java/com/empresa/leonardoteixeiralucassiconeli_projetofinal/service/AutenticacaoService.java Introduces a dedicated authentication service.
src/main/java/com/empresa/leonardoteixeiralucassiconeli_projetofinal/service/AlunoService.java Refactors service to use repository injection, validation, ordering, search, and read-only list exposure.
src/main/java/com/empresa/leonardoteixeiralucassiconeli_projetofinal/repository/AlunoRepositoryJSON.java Reworks JSON persistence into an instance repository with default + legacy paths and UTF-8 I/O.
src/main/java/com/empresa/leonardoteixeiralucassiconeli_projetofinal/repository/AlunoRepository.java Adds repository interface abstraction for persistence.
src/main/java/com/empresa/leonardoteixeiralucassiconeli_projetofinal/model/Usuario.java Adds Usuario record for authentication.
src/main/java/com/empresa/leonardoteixeiralucassiconeli_projetofinal/model/Aluno.java Adds constructors, copy constructor, and implements equals/hashCode + improved toString.
src/main/java/com/empresa/leonardoteixeiralucassiconeli_projetofinal/factory/MensagemFactory.java Centralizes alert creation + convenience helpers for error/success/warning/confirm dialogs.
src/main/java/com/empresa/leonardoteixeiralucassiconeli_projetofinal/exception/RegraNegocioException.java Cleans up exception implementation and parameter naming.
src/main/java/com/empresa/leonardoteixeiralucassiconeli_projetofinal/controller/PrincipalController.java Updates UI behavior to use new search/removal flows and standardized messaging.
src/main/java/com/empresa/leonardoteixeiralucassiconeli_projetofinal/controller/LoginController.java Switches login logic to use AutenticacaoService + standardized messaging.
src/main/java/com/empresa/leonardoteixeiralucassiconeli_projetofinal/controller/CadastroAlunoController.java Refactors save/edit flow to use new AlunoService API and adds form parsing/validation messaging.
src/main/java/com/empresa/leonardoteixeiralucassiconeli_projetofinal/App.java Updates application title and keeps screen switching logic.
README.md Adds full project documentation (usage, architecture, commands, future improvements).
pom.xml Updates artifact metadata, sets Java 21 release, pins JavaFX version, and adjusts plugin configuration.
LICENSE Adds MIT license file.
docs/images/.gitkeep Keeps screenshots folder tracked for docs assets.
data/.gitkeep Keeps data directory tracked (runtime JSON will be created locally).
alunos.json Clears tracked legacy JSON content (now empty array).
.vscode/settings.json Adds VS Code Java build configuration setting.
.gitignore Ignores data/*.json and tooling folder.
.github/workflows/maven.yml Adds GitHub Actions workflow to run Maven tests on push/PR.
.gitattributes Normalizes line endings and text handling across common file types.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +48 to 52
List<Aluno> alunos = gson.fromJson(json, LISTA_ALUNOS);
return alunos == null ? new ArrayList<>() : new ArrayList<>(alunos);
} catch (IOException e) {
e.printStackTrace();
throw new IllegalStateException("Nao foi possivel carregar os alunos.", e);
}
Comment on lines +26 to 30
public AlunoService(AlunoRepository repository) {
this.repository = repository;
alunos.addAll(repository.carregar());
ordenarPorNome();
}
Comment on lines +80 to +85
public Optional<Aluno> buscarPorMatricula(String matricula) {
String matriculaNormalizada = normalizarMatricula(matricula);
return alunos.stream()
.filter(aluno -> aluno.getMatricula().equalsIgnoreCase(matriculaNormalizada))
.findFirst();
}
Comment on lines +119 to +125
private boolean matriculaJaExiste(String matricula, String matriculaOriginal) {
String original = normalizarMatricula(matriculaOriginal);
return alunos.stream()
.anyMatch(aluno
-> aluno.getMatricula().equalsIgnoreCase(matricula)
&& !aluno.getMatricula().equalsIgnoreCase(original));
}
Comment on lines +9 to +11
private static final List<Usuario> USUARIOS = List.of(
new Usuario("admin", "1234")
);
@siconeli1
siconeli1 merged commit a7fa17c into main Jun 2, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants