Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
126 commits
Select commit Hold shift + click to select a range
a35eb28
Cleanup java config files
lm-sousa Oct 17, 2024
5113c48
Remove references to Nashorn
lm-sousa Oct 15, 2024
16b4764
Bug fix (maybe revert in the future)
lm-sousa Oct 17, 2024
6c2ca6b
Update GraalJS to 23.0.6
lm-sousa Oct 19, 2024
5db30be
Implement method to make test pass
lm-sousa Mar 1, 2025
c8abf07
Merge branch 'master' into lara-dsl-deprecation
lm-sousa Mar 10, 2025
24944fc
Make projects compatible with Gradle 9
lm-sousa Mar 11, 2025
931ff32
Update all Clava and Lara dependencies
lm-sousa Mar 16, 2025
6a5dbb6
Add nightly workflow for building and testing Gradle projects
lm-sousa Jun 11, 2025
767210c
Refactor nightly workflow to build and test Gradle projects sequentially
lm-sousa Jun 11, 2025
b2acc58
Improve error handling in nightly Gradle build workflow
lm-sousa Jun 11, 2025
aefd582
Mark repeat method as deprecated and suggest using String#repeat(int)…
lm-sousa Jun 15, 2025
32b6266
Refactor Pair usage to utilize record syntax and update method calls …
lm-sousa Jun 15, 2025
313b0ce
Remove unused imports and suppress warnings in various classes for cl…
lm-sousa Jun 15, 2025
29e15b0
Small repo cleanup
lm-sousa Jul 2, 2025
8a1ce90
Add Copilot instructions for repository overview, setup, and guidelines
lm-sousa Jul 2, 2025
ea81a02
Update nightly workflow to include additional Gradle projects for bui…
lm-sousa Jul 2, 2025
51bada2
Add missing repositories block to build.gradle for dependency resolution
lm-sousa Jul 2, 2025
5f16458
Partially revert 5f8f401
lm-sousa Jul 2, 2025
5045d12
Remove EclipseUtils from nightly build and add commons-lang3 dependen…
lm-sousa Jul 2, 2025
5cf5cf2
Fix path to Z3 library in build.gradle
lm-sousa Jul 2, 2025
d8c1cd9
Update copilot instructions: clarify Java version requirement and add…
lm-sousa Jul 2, 2025
625a3ca
Refactor SpecsUtils tests to use JUnit 5. Added new tests. Fixed some…
lm-sousa Jul 11, 2025
5ff4304
Cleanup deprecated code usages.
lm-sousa Jul 21, 2025
a208db6
[CommonLangPlus] Add unit tests
lm-sousa Jul 21, 2025
033c671
[GitPlus] Add unit tests (partial testing)
lm-sousa Jul 21, 2025
72fa78a
[JacksonPlus] Add unit tests
lm-sousa Jul 21, 2025
776d0e4
[JadxPlus] Add unit tests
lm-sousa Jul 21, 2025
16d95d1
[SymjaPlus] Add unit tests and fix discovered bugs
lm-sousa Jul 21, 2025
8cfa61b
[tdrcLibrary] Add unit tests and fix discovered bugs
lm-sousa Jul 21, 2025
d63f554
[JavaGenerator] Add unit tests and fix discovered bugs
lm-sousa Jul 22, 2025
9e246af
Enhance documentation across multiple packages
lm-sousa Jun 11, 2025
5acb829
Remove branch specification from push trigger in GitHub Actions workflow
lm-sousa Jun 11, 2025
58f8dc8
Enhance documentation across multiple classes
lm-sousa Jun 12, 2025
366e8a0
Update resource URL to use HTTPS in JsEngineWebResources
lm-sousa Jun 12, 2025
8c191f3
Enhance documentation across multiple classes in SymjaPlus
lm-sousa Jun 12, 2025
bda36cc
Enhance code documentation
lm-sousa Jun 12, 2025
f060136
Refactor and update documentation for provider interfaces and reporti…
lm-sousa Jun 12, 2025
9394cda
Refactor project structure and migrate to Gradle build system
lm-sousa Jun 15, 2025
55bf31b
[jOptions] Modernized and enabled the execution of existing tests
lm-sousa Jul 23, 2025
45c265d
[jOptions] Small changes to legacy tests to avoid conflicts with new …
lm-sousa Jul 25, 2025
0fd8161
Merge branch 'master' into lara-dsl-deprecation
lm-sousa Aug 16, 2025
e124a1b
[SpecsUtils] Fix typos and improve documentation for PowerShell methods
lm-sousa Aug 16, 2025
468ebd4
Remove obsolete ant-based workflow
lm-sousa Aug 17, 2025
9d2bd2f
Refactor: Replace SpecsFactory methods with standard Java collections
lm-sousa Aug 17, 2025
85064ca
Update Copilot instructions: Enhance repository overview, build instr…
lm-sousa Aug 17, 2025
b64f4e7
Refactor: Improve code formatting and remove unused constants in vari…
lm-sousa Aug 21, 2025
2255cdc
[XStreamPlus] Add unit tests and fix discovered bugs
lm-sousa Aug 21, 2025
88803be
[jOptions] Add unit tests and fix discovered bugs
lm-sousa Aug 25, 2025
42f3956
Fix cache behavior in PropertyWithNodeManager to ensure consistent re…
lm-sousa Aug 26, 2025
6d28f02
Refactor: Replace SpecsFactory.getUnmodifiableList with List.copyOf f…
lm-sousa Aug 26, 2025
f4d9639
[SpecsUtils] Add unit tests and fix *some* discovered bugs
lm-sousa Aug 27, 2025
e3132fe
Add JUnit Pioneer for test retries and apply to performance tests
lm-sousa Aug 27, 2025
82aa246
Add Testing plans and discovered bugs (for documentation purposes)
lm-sousa Aug 29, 2025
51293d9
[jOptions] Remove documentation for solved bugs
lm-sousa Aug 29, 2025
27c502c
[SpecsUtils] Fixed the bugs reported in BUGS_5.1.md
lm-sousa Aug 29, 2025
c5541fd
[SpecsUtils] Fixed the bugs reported in BUGS_5.3.md
lm-sousa Aug 29, 2025
40eb5ee
[SpecsUtils] Fixed the bugs reported in BUGS_5.4.md
lm-sousa Aug 29, 2025
a1575c4
[SpecsUtils] Fixed the bugs reported in BUGS_5.5.md
lm-sousa Aug 29, 2025
4c0c940
Refactor code for improved readability and maintainability
lm-sousa Aug 30, 2025
0c2f6e0
[SpecsUtils] Fixed the bugs reported in BUGS_5.6.md
lm-sousa Aug 30, 2025
d34af60
[SpecsUtils] Fixed the bugs reported in BUGS_5.7.md
lm-sousa Aug 30, 2025
2fc67dd
[SpecsUtils] Fixed the bugs reported in BUGS_5.8.md
lm-sousa Aug 30, 2025
300d590
[SpecsUtils] Fixed the bugs reported in BUGS_5.9.md
lm-sousa Aug 30, 2025
b061a48
[SpecsUtils] Fixed the bugs reported in BUGS_6.1.md
lm-sousa Aug 31, 2025
62f29cd
Deprecate checkNotNull method and recommend using Objects.requireNonN…
lm-sousa Aug 31, 2025
709bea5
[SpecsUtils] Fixed the bugs reported in BUGS_6.2.md
lm-sousa Aug 31, 2025
b504851
[SpecsUtils] Fixed the bugs reported in BUGS_6.3.md
lm-sousa Aug 31, 2025
a61a5fb
[SpecsUtils] Fixed the bugs reported in BUGS_6.4.md
lm-sousa Aug 31, 2025
e0106c5
[SpecsUtils] Fixed the bugs reported in BUGS_6.6.md
lm-sousa Sep 1, 2025
476f4ed
Clarify expected behavior in BUGS_7.1.md and update severity descript…
lm-sousa Sep 1, 2025
e879f9d
[SpecsUtils] Fixed the bugs reported in BUGS_7.1.md
lm-sousa Sep 1, 2025
edeafc3
[SpecsUtils] Fixed the bugs reported in BUGS_7.2.md
lm-sousa Sep 1, 2025
3f33ace
[SpecsUtils] Discarded the bugs reported in BUGS_7.3.md and BUGS_7.4.md
lm-sousa Sep 1, 2025
9553154
[SpecsUtils] Fixed the bugs reported in BUGS_7.5.md
lm-sousa Sep 2, 2025
f9c79f5
[SpecsUtils] Fixed the bugs reported in BUGS_csv.md
lm-sousa Sep 2, 2025
47e269e
Refactor PrintOnce to use ConcurrentHashMap for thread-safe message t…
lm-sousa Sep 3, 2025
3ece387
[XStreamPlus] Fixes bugs.
lm-sousa Sep 4, 2025
40396d8
Applied most suggestions made by IntelliJ to the code. Fixed a ton of…
lm-sousa Sep 4, 2025
0eef3ad
Fix getChildren method to return mutable list to prevent breaking fun…
lm-sousa Sep 9, 2025
dee9858
Refactor null checks to use Objects.requireNonNull
lm-sousa Sep 9, 2025
bbb85b9
Bug fix
lm-sousa Sep 9, 2025
2b0b0b8
Enforced a single style for all code. Enforced the use of spaces, as …
lm-sousa Sep 9, 2025
393e47b
Fix brittle tests
lm-sousa Sep 9, 2025
5ad7ad6
Refactor toString methods in PushingQueue implementations to handle n…
lm-sousa Sep 9, 2025
2c4fa21
Bug Fix: Enhance event notification safety by iterating over a snapsh…
lm-sousa Sep 10, 2025
ed2696c
Fix incorrect test assumption
lm-sousa Sep 10, 2025
fcd040c
Bug fixes: Refactor resource paths in tests and WebResourceProvider i…
lm-sousa Sep 10, 2025
9f445ab
Bug Fix: Enhance DebugBufferedReader: Add consistent debug output for…
lm-sousa Sep 10, 2025
b73fc0d
Bug Fix: Update exception handling in ReporterUtilsTest to throw Null…
lm-sousa Sep 10, 2025
f7e79da
Bug Fix: Improve CachedValue concurrency handling by ensuring atomic …
lm-sousa Sep 10, 2025
899b8d2
Bug Fix: Tests still expected old buggy behaviour
lm-sousa Sep 10, 2025
1831dec
Bug Fix: Refactor MemProgressBarUpdater to use Objects.requireNonNull…
lm-sousa Sep 11, 2025
e986835
Bug Fix: Add capacity check in LastUsedItems to prevent usage when ca…
lm-sousa Sep 11, 2025
dac87a5
Refactor LastUsedItems to return Optional.empty() for empty head inst…
lm-sousa Sep 11, 2025
953e873
Refactor comments to remove bug references and clarify handling of nu…
lm-sousa Sep 11, 2025
9154ab7
Refactor RangeMapTest to improve readability and maintain consistency…
lm-sousa Sep 11, 2025
50b73cb
Enhance MemoryProfiler to handle output file creation and ensure data…
lm-sousa Sep 11, 2025
50d5531
Enhance Reporter interface methods for thread safety; add stress test…
lm-sousa Sep 11, 2025
8fa8da2
Add persisted content caching and enhance toString() method in Buffer…
lm-sousa Sep 11, 2025
0ea719f
Refactor MemoryProfiler to improve thread management; replace execute…
lm-sousa Sep 11, 2025
f9c030d
Enhance null safety in PatternDetector by using Objects.equals() for …
lm-sousa Sep 12, 2025
3357908
Refactor LineStreamFileService to use ConcurrentHashMap for cache; im…
lm-sousa Sep 12, 2025
9a517d7
Enhance ProgressCounter to enforce non-negative max count; update tes…
lm-sousa Sep 12, 2025
1e49a09
Refactor ProgressCounter to use camelCase for maxCount; update behavi…
lm-sousa Sep 12, 2025
927aba5
Fix isBranchTakenInstruction logic to correctly classify jump instruc…
lm-sousa Sep 12, 2025
8a9e0d7
Enhance cancellable task test to use CountDownLatch for deterministic…
lm-sousa Sep 12, 2025
d7b9713
Enhance DelaySlotBranchCorrector documentation and tests; clarify beh…
lm-sousa Sep 12, 2025
e53f1ad
Refactor LogSourceInfoTest to reset LOGGER_SOURCE_INFO to factory def…
lm-sousa Sep 12, 2025
1cd4f30
Update jacocoTestCoverageVerification minimum coverage to 0.79; clari…
lm-sousa Sep 12, 2025
5a1ef35
Enhance MemoryProfilerTest to ensure proper thread execution; add cle…
lm-sousa Sep 12, 2025
85d5983
Increase performance threshold in GluerTest from 100ms to 500ms for b…
lm-sousa Sep 12, 2025
d3c8776
Refactor SpecsSwing to streamline file browsing logic; improve handli…
lm-sousa Sep 12, 2025
2395605
Remove documentation file for now-fixed bugs.
lm-sousa Sep 12, 2025
426c11f
Enhance SpecsSwing utility: add null handling in runOnSwing method; i…
lm-sousa Sep 12, 2025
28f1af6
Enhance HeapWindow: add headless environment support; prevent UI init…
lm-sousa Sep 12, 2025
1202d0a
Remove RetryingTest annotation from PerformanceTests in SymjaNodeTest
lm-sousa Sep 12, 2025
7d5b84f
Relaxed minimum coverage requirement due to CI headless environment.
lm-sousa Sep 12, 2025
2e1aa65
Removed now completed testing plan. Hurray! Over 10.000 tests!
lm-sousa Sep 12, 2025
9f869f8
Prevent exception leakeage and annotation creation on CI runs for pas…
lm-sousa Sep 12, 2025
e61d685
Remove redundant task from workflow
lm-sousa Sep 12, 2025
b5029df
Snuff out the last Annotation leak
lm-sousa Sep 12, 2025
d9c2ee8
Refactor tests to use @TempDir for temporary file management
lm-sousa Sep 15, 2025
f887801
Refactor build configuration: use environment variables for library p…
lm-sousa Sep 19, 2025
79431f7
Improve file download handling by using a temporary file for download…
lm-sousa Oct 4, 2025
efde272
GearmanPlus' dependency is gone. The project is no longer used. I wil…
lm-sousa Oct 4, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
172 changes: 172 additions & 0 deletions .github/copilot-instructions.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,172 @@
# SPeCS Java Libraries - Copilot Instructions

## Repository Overview

This repository contains 24 Java libraries developed by the SPeCS research group, organized as independent Gradle projects. Each library extends or enhances existing Java libraries (indicated by the "-Plus" suffix) or provides custom utilities. The repository uses Java 17, Gradle for builds, and follows a multi-project structure without a root Gradle configuration.

**Repository Statistics:**
- 24 main Java libraries + 3 legacy projects (RuntimeMutators, SpecsHWUtils, SupportJavaLibs)
- ~200K+ lines of Java code across all projects
- Mixed testing frameworks: JUnit 5 (modern projects) and JUnit 4 (legacy projects)
- Inter-project dependencies centered around SpecsUtils as the core utility library

## Build Instructions

### Prerequisites
- **Java 17 or higher** (REQUIRED - all projects target Java 17)
- **Gradle 8.13+** (system Gradle installation - NO gradlew wrapper in repo)

### Building Individual Projects

**ALWAYS navigate to the specific project directory before running Gradle commands.** Each project is self-contained with its own `build.gradle` and `settings.gradle`.

```bash
cd <project-name>
gradle build # Compile, test, package, and validate coverage (includes tests)
gradle test # Run tests only (without packaging)
gradle jar # Create JAR file
gradle clean # Clean build artifacts
```

### Build Dependencies Order

Due to inter-project dependencies, build in this order when building multiple projects:

1. **Core Libraries (no dependencies):**
- CommonsLangPlus, CommonsCompressPlus, GsonPlus, XStreamPlus

2. **SpecsUtils** (most projects depend on this)

3. **All other projects** (depend on SpecsUtils and/or other core libraries)

### Key Build Considerations

- **SpecsUtils tests are slow** - can take several minutes to complete
- **`gradle build` includes tests** - build will fail if tests fail or coverage is insufficient
- Projects use **different testing frameworks**:
- Modern projects: JUnit 5 with Mockito, AssertJ + Jacoco coverage validation
- Legacy projects: JUnit 4
- **Coverage requirements**: Modern projects with Jacoco enforce 80% minimum test coverage
- **No parallel builds** - run projects sequentially to avoid dependency conflicts
- **Inter-project dependencies** use syntax like `implementation ':SpecsUtils'`

### Common Build Issues & Solutions

1. **Dependency not found errors**: Ensure dependent projects are built first (e.g., build SpecsUtils before projects that depend on it)
2. **Java version errors**: Verify Java 17+ is active (`java -version`)
3. **Test timeouts**: SpecsUtils tests can take 5+ minutes - be patient
4. **Coverage failures**: Modern projects require 80% test coverage - add tests if build fails due to insufficient coverage
5. **Memory issues**: For large projects, use `gradle build -Xmx2g` if needed

## Project Layout

### Root Structure
```
├── .github/workflows/nightly.yml # CI pipeline
├── README.md # Project documentation
├── LICENSE # Apache 2.0 license
├── .gitignore # Ignores build/, .gradle/, etc.
└── [24 Java library directories]/
```

### Individual Project Structure
```
ProjectName/
├── build.gradle # Gradle build configuration
├── settings.gradle # Project settings
├── src/ # Main source code
├── test/ # Unit tests (JUnit 4 or 5)
├── resources/ # Resources (optional)
├── bin/ # Eclipse-generated (ignore)
└── build/ # Generated build artifacts
```

### Key Libraries and Their Purpose

**Core Infrastructure:**
- **SpecsUtils** - Core utilities, most other projects depend on this
- **CommonsLangPlus** - Extended Apache Commons Lang utilities
- **jOptions** - Command-line options and configuration management

**External Integrations:**
- **GitPlus** - Git operations and utilities
- **GitlabPlus** - GitLab API integration
- **SlackPlus** - Slack API integration
- **JsEngine** - JavaScript execution via GraalVM

**Data Processing:**
- **GsonPlus** - Extended JSON processing with Google Gson
- **JacksonPlus** - Extended JSON processing with Jackson
- **XStreamPlus** - Extended XML processing

**Development Tools:**
- **JavaGenerator** - Java code generation utilities
- **EclipseUtils** - Eclipse IDE integration tools
- **AntTasks** - Custom Ant build tasks

### Legacy Projects (No Gradle builds)
- **RuntimeMutators** - Runtime code mutation (Eclipse project only)
- **SpecsHWUtils** - Hardware utilities (Eclipse project only)
- **SupportJavaLibs** - Supporting libraries and tools

## Continuous Integration

### GitHub Actions Workflow
File: `.github/workflows/nightly.yml`

**Triggers:** Push to any branch, manual workflow dispatch
**Environment:** Ubuntu latest, Java 17 (Temurin), Gradle current

**Build Process:**
1. Sequentially builds and tests all 24 Gradle projects
2. Uses `gradle build test` for each project
3. Fails if any project fails to build or test
4. Publishes JUnit test reports
5. Generates dependency graphs

### Tested Projects (in CI order):
AntTasks, AsmParser, CommonsCompressPlus, CommonsLangPlus, GearmanPlus, GitlabPlus, GitPlus, Gprofer, GsonPlus, GuiHelper, JacksonPlus, JadxPlus, JavaGenerator, jOptions, JsEngine, LogbackPlus, MvelPlus, SlackPlus, SpecsUtils, SymjaPlus, tdrcLibrary, XStreamPlus, Z3Helper

### Local Validation Steps
1. **Build specific project**: `cd ProjectName && gradle build`
2. **Run tests**: `cd ProjectName && gradle test`
3. **Check code coverage** (for projects with Jacoco): `gradle jacocoTestReport`
4. **Validate dependencies**: Ensure dependent projects build successfully

## Development Guidelines

### Code Style & Conventions
- Java 17 language features are preferred
- Follow existing patterns within each project
- Add tests for new functionality (JUnit 5 for new code)
- Use appropriate testing framework for the project (check existing tests)

### Testing Approach
- **Modern projects**: JUnit 5 + Mockito + AssertJ with Jacoco coverage enforcement (80% minimum)
- **Legacy projects**: JUnit 4
- **Coverage validation**: Jacoco runs automatically with tests and enforces minimum coverage thresholds
- **Test locations**: Tests in `test/` directory, following package structure

### Making Changes
1. Identify the correct project for your changes
2. Check project's testing framework and conventions
3. Build the project first: `cd ProjectName && gradle build`
4. Make changes following existing patterns
5. Add/update tests appropriately
6. Re-run `gradle build` to ensure everything works
7. For projects with dependencies, test dependent projects as well

### Key Files to Check
- `build.gradle` - Dependencies, Java version, testing framework
- `src/` - Main source code structure and patterns
- `test/` - Testing approach and existing test structure
- `README.md` (if present) - Project-specific documentation

## Trust These Instructions

These instructions are comprehensive and validated. Only search for additional information if:
1. A specific command fails with an unexpected error
2. You encounter a build configuration not covered here
3. Project-specific documentation contradicts these general guidelines

Always check the project's individual `build.gradle` for dependencies and testing setup before making changes.
62 changes: 0 additions & 62 deletions .github/workflows/ant-main.yml

This file was deleted.

85 changes: 85 additions & 0 deletions .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
# This workflow will build and test all Gradle-migrated projects in specs-java-libs every day at midnight
# It will also run on every push and pull request

name: nightly

on:
push:
workflow_dispatch:

permissions:
checks: write
contents: write

env:
JAVA_VERSION: 17

jobs:
build-gradle-projects:
name: Build & Test Gradle Projects Sequentially
runs-on: ubuntu-latest
steps:
- name: Checkout specs-java-libs
uses: actions/checkout@v4

- name: Setup Java
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: ${{ env.JAVA_VERSION }}

- name: Setup Gradle
uses: gradle/actions/setup-gradle@v4
with:
gradle-version: current
dependency-graph: generate-and-submit

- name: Build and test all Gradle projects sequentially
run: |
projects=(
AntTasks
AsmParser
CommonsCompressPlus
CommonsLangPlus
GitlabPlus
GitPlus
Gprofer
GsonPlus
GuiHelper
JacksonPlus
JadxPlus
JavaGenerator
jOptions
JsEngine
LogbackPlus
MvelPlus
SlackPlus
SpecsUtils
SymjaPlus
tdrcLibrary
XStreamPlus
Z3Helper
)
failed=()
for project in "${projects[@]}"; do
echo "\n===== Building and testing $project ====="
cd "$project"
if ! gradle build; then
echo "[ERROR] $project failed to build or test"
failed+=("$project")
fi
cd -
done
if [ ${#failed[@]} -ne 0 ]; then
echo "\nThe following projects failed: ${failed[*]}"
exit 1
fi
env:
GITHUB_DEPENDENCY_GRAPH_ENABLED: false

- name: Publish Test Reports
uses: mikepenz/action-junit-report@v4
if: always()
with:
report_paths: '**/build/test-results/test/TEST-*.xml'
summary: true
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ RemoteSystemsTempFiles/
# Custom ignores #
##################

**/.settings/

output/
.idea/
.gradle/
Expand Down
7 changes: 7 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"jest.runMode": {
"type": "on-demand"
},
"java.compile.nullAnalysis.mode": "automatic",
"java.configuration.updateBuildConfiguration": "automatic"
}
11 changes: 0 additions & 11 deletions AntTasks/.classpath

This file was deleted.

29 changes: 0 additions & 29 deletions AntTasks/.project

This file was deleted.

2 changes: 0 additions & 2 deletions AntTasks/.settings/org.eclipse.core.resources.prefs

This file was deleted.

Loading