Repository navigation
Appmod/java upgrade 20260602174913 - #1
Merged
Merged
Conversation
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.
There was a problem hiding this comment.
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
AlunoServicewith validation, sorting, search, and safer UI messaging viaMensagemFactory. - 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") | ||
| ); |
…0260602174913 # Conflicts: # README.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.