Skip to content

Releases: Codegass/Javalang-analyzing-cli

v1.3.3

02 Jun 19:15

Choose a tag to compare

[1.3.3] - 2025-06-02

πŸ› Critical Bug Fix - JUnit Framework Support Enhancement

  • Fixed junit.framework.TestCase Assert Recognition: Major fix for assertion detection in legacy JUnit projects
    • Problem: junit.framework.TestCase assert methods were showing as UNRESOLVED_INVOCATION instead of ASSERT
    • Root Cause: isAssert() method only checked for org.junit but not junit.framework package
    • Solution: Added explicit support for junit.framework package in assertion detection
    • Impact: Eliminates false unresolved invocations in projects using JUnit 3.x style assertions

✨ New Feature - JUnit 3.x Test Method Detection

  • Legacy Test Method Support: Added support for JUnit 3.x style test method detection
    • Pattern Recognition: Detects public void testXxx() methods without requiring @Test annotations
    • Validation: Ensures methods are public, void, parameterless, and follow testXxx naming convention
    • Backward Compatibility: Maintains full support for modern @Test annotated methods

πŸ”§ Technical Improvements

  • Enhanced isAssert() Method: Added junit.framework package detection for comprehensive assertion recognition
  • Extended isTestMethod() Method: Added JUnit 3.x test method pattern detection alongside annotation-based detection
  • Smart Test Detection: Combines modern annotation-based and legacy naming convention-based test detection

πŸ§ͺ Verification - commons-vfs Project

Before (v1.3.2):

"unresolvedInvocations": [
  "UNRESOLVED_INVOCATION: assertSame(opts,newOpts)#[61-61]",
  "UNRESOLVED_INVOCATION: assertTrue(builder.isVersioning(newOpts))#[62-62]",
  "UNRESOLVED_INVOCATION: assertFalse(file.exists())#[63-63]"
]

After (v1.3.3):

"parsedStatementsSequence": [
  "ASSERT junit.framework.Assert.assertSame(Object, Object)#[61-61]",
  "ASSERT junit.framework.Assert.assertTrue(boolean)#[62-62]", 
  "ASSERT junit.framework.Assert.assertFalse(boolean)#[63-63]"
]

πŸ“Š Impact Analysis

  • Legacy Projects: Significantly reduces false unresolved invocations in JUnit 3.x projects
  • commons-vfs: From 1279 unresolved invocations to much fewer (mainly legitimate resolution issues)
  • Test Coverage: Now supports full spectrum of JUnit versions (3.x, 4.x, 5.x)
  • Analysis Accuracy: Dramatically improved assertion recognition across different JUnit frameworks

This fix is particularly important for analyzing older Java projects that still use JUnit 3.x conventions.

v1.3.2

02 Jun 06:58

Choose a tag to compare

[1.3.2] - 2025-06-02

πŸ› Critical Bug Fix - Inner Class Source Resolution

  • Fixed SOURCE_FILE_NOT_FOUND for Inner Classes: Major fix for source file detection of inner classes
    • Problem: Classes like org.apache.commons.cli.HelpFormatter.Builder were causing SOURCE_FILE_NOT_FOUND errors
    • Root Cause: Method was searching for org/apache/commons/cli/HelpFormatter/Builder.java instead of org/apache/commons/cli/HelpFormatter.java
    • Solution: Enhanced getSourceFilePathForClass() to detect inner classes and map them to their outer class source files
    • Impact: Dramatically reduces SOURCE_FILE_NOT_FOUND errors in projects with inner classes

πŸ”§ Technical Improvements

  • Smart Inner Class Detection: Added logic to identify inner classes by uppercase naming patterns
  • Outer Class Mapping: Automatically strips inner class portions to find the correct source file
  • Enhanced Debug Logging: Added detailed logging for source file resolution process

πŸ§ͺ Verification

  • commons-cli Project: Tested on Apache Commons CLI project - eliminated most SOURCE_FILE_NOT_FOUND errors
  • Before: Multiple SOURCE_FILE_NOT_FOUND errors for HelpFormatter.Builder methods
  • After: All inner class methods now correctly resolve to their source files

This fix significantly improves analysis accuracy for projects using inner classes, which are common in Java projects.

v1.3.1

02 Jun 05:58

Choose a tag to compare

[1.3.1] - 2025-06-02

πŸ› Bug Fixes - Windows Path Compatibility

  • Log File Path Handling: Fixed Windows path compatibility issues in logging system
    • Relative Path Recording: Changed from absolute to relative paths in unresolved case logs
    • Cross-platform File Names: Enhanced filename sanitization to handle Windows path separators
    • Log File Creation: Added project name sanitization for safe log file creation

πŸ”§ Technical Improvements

  • Enhanced Filename Sanitization: Updated regex pattern from [^a-zA-Z0-9.-] to [^a-zA-Z0-9._-]
  • Relative Path Storage: Log entries now store src/test/java/com/example/Test.java instead of full paths
  • Project Name Cleaning: Automatic removal of invalid characters from project names in log filenames

🌍 Cross-Platform Benefits

  • βœ… Windows: Log files now correctly handle C:\Users\... style paths
  • βœ… Unix/Linux/macOS: Maintains full backward compatibility
  • βœ… JSON Compatibility: Eliminates escaping issues with backslashes in JSON output

πŸ“‹ Log File Improvements

{
  "unresolvedCases": [
    {
      "fileName": "src/test/java/com/example/Test.java",  // βœ… Relative path
      "className": "com.example.Test",
      "methodName": "testMethod"
    }
  ]
}

Before (v1.3.0): "fileName": "C:\\Users\\user\\project\\src\\test\\java\\Test.java" ❌
After (v1.3.1): "fileName": "src/test/java/Test.java" βœ…

[1.3.0] - 2025-06-02

πŸš€ Major Features

  • Runtime Logging System: Added comprehensive analysis session logging
    • Execution Time Tracking: Automatic recording of start time, end time, and duration
    • Test Case Statistics: Total and processed test case counts
    • Unresolved Invocation Detection: Automatic detection and detailed tracking of unresolved method calls
    • Structured Log Output: JSON format log files saved to <output_dir>/<project_name>-log.json

✨ New Features

  • LogData Class: Dedicated data structure for logging analysis session information
  • Smart Status Tracking: RUNNING β†’ COMPLETED/FAILED/INTERRUPTED status progression
  • Unresolved Code Analysis: Identifies and catalogues:
    • UNRESOLVED_INVOCATION - Method calls that couldn't be resolved
    • UNRESOLVED_CONSTRUCTOR - Constructor calls that couldn't be resolved
    • UNRESOLVED_METHOD_REF - Method references that couldn't be resolved
    • METHOD_NOT_FOUND_IN_SOURCE - Methods not found in source code
    • SOURCE_FILE_NOT_FOUND - Source files that couldn't be located
  • Graceful Interruption Handling: Shutdown hooks to save logs even when interrupted
  • Project Context Integration: LogData integrated into ProjectCtx for task access

πŸ”§ Technical Improvements

  • Exception Handling: Robust error handling with detailed error message logging
  • Cross-platform Compatibility: All logging functionality works on Windows/Linux/macOS
  • Memory Efficient: Streaming JSON output without memory overhead
  • Thread Safe: Volatile flags for proper multi-threading support

πŸ“Š Log File Structure

{
  "projectName": "example-project",
  "taskName": "ParseTestCaseToLlmContext",
  "startTime": "2025-06-02T01:42:33",
  "endTime": "2025-06-02T01:42:34", 
  "durationMs": 1243,
  "totalTestCases": 3,
  "processedTestCases": 3,
  "unresolvedInvocationCount": 2,
  "unresolvedCases": [
    {
      "className": "com.example.SampleTest",
      "methodName": "testWithUnresolvedCode",
      "fileName": "/path/to/SampleTest.java",
      "startLine": 14,
      "endLine": 22,
      "unresolvedCount": 2,
      "unresolvedInvocations": [
        "UNRESOLVED_CONSTRUCTOR: new SomeUnknownClass()#[17-17]",
        "UNRESOLVED_INVOCATION: unknown.someMethod()#[18-18]"
      ]
    }
  ],
  "status": "COMPLETED"
}

🎯 Use Cases

  • Performance Monitoring: Track analysis execution time across different projects
  • Quality Assessment: Identify test cases with resolution issues
  • Problem Debugging: Pinpoint exact locations of unresolved method calls
  • Project Analytics: Generate reports on test coverage and code quality

V1.1.2

30 May 16:56

Choose a tag to compare

[1.1.2] - 2024-05-30

πŸ› Bug Fixes

  • Windows Path Compatibility: Fixed cross-platform path handling issues
    • Test Directory Detection: Enhanced isTestDirectory() to normalize Windows backslashes to forward slashes
    • Production/Test Code Classification: Fixed isProductionCode() and isTestCode() methods to handle Windows paths
    • Source File Path Resolution: Updated getSourceFilePathForClass() to use Path.resolve() instead of hardcoded path strings
    • Root Cause: Previous implementation only handled Unix-style paths (/), causing "No test source roots found" on Windows
    • Solution: Added path normalization (pathString.replace('\\', '/')) throughout path comparison logic

πŸ”§ Technical Details

  • Modified ParseTestCaseToLlmContextTask.isTestDirectory() method
  • Enhanced TestCaseAnalyzer.isProductionCode() and isTestCode() methods
  • Updated TestCaseAnalyzer.getSourceFilePathForClass() to use proper Path.resolve() chains
  • All path comparisons now use normalized forward slash format internally
  • Maintains full backward compatibility on Unix/Linux/macOS systems

🌍 Cross-Platform Support

  • βœ… Windows: Now correctly identifies test directories like D:\project\src\test\java
  • βœ… Unix/Linux: Continues to work with /project/src/test/java
  • βœ… macOS: Continues to work with /project/src/test/java

v1.1.1

30 May 13:02

Choose a tag to compare

[1.1.1] - 2024-05-30

πŸ› Bug Fixes

  • Duplicate JSON File Extension: Fixed issue where output files had double .json.json extension
    • Problem: getJsonFileName() was returning filename with .json extension, then .json was added again during file creation
    • Solution: Modified getJsonFileName() to return base filename without extension
    • Files now correctly named as project_class_method.json instead of project_class_method.json.json

πŸ”§ Technical Details

  • Modified TestCaseAnalyzer.AnalysisResult.getJsonFileName() method
  • Maintains backward compatibility - no changes to JSON content format
  • File sanitization (replacing invalid characters with _) still works correctly

V1.1.0

30 May 08:43

Choose a tag to compare

Javalang-analyzing-cli v1.1.0

πŸ“¦ Release Files

  • Javalang-analyzing-cli-1.1.0-all.jar (19M) - Main executable Fat JAR
  • README.md - Complete usage documentation
  • CHANGELOG.md - Version change log
  • LICENSE - Open source license
  • analyzer.yml - Example configuration file
  • run.sh / run.bat - Quick start scripts

πŸš€ Quick Start

System Requirements

  • Java 21 or higher

Basic Usage

# Check version
java -jar Javalang-analyzing-cli-1.1.0-all.jar --version

# Analyze project
java -jar Javalang-analyzing-cli-1.1.0-all.jar ParseTestCaseToLlmContext \
    --project /path/to/your/java/project

# Use configuration file
java -jar Javalang-analyzing-cli-1.1.0-all.jar ParseTestCaseToLlmContext \
    --config analyzer.yml

Using Scripts

# Linux/macOS
./run.sh ParseTestCaseToLlmContext --project /path/to/project

# Windows
run.bat ParseTestCaseToLlmContext --project C:\path\to\project

πŸ“‹ New Features

See CHANGELOG.md for complete feature list and updates.

πŸ› Issue Reporting

For issues, please report them in GitHub Issues.

v1.0.0

30 May 07:03

Choose a tag to compare

Changelog

All notable changes to this project will be documented in this file.

[1.0.0] - 2024-05-30

πŸŽ‰ Initial Release

✨ New Features

  • ParseTestCaseToLlmContext Task: Parses Java test cases and generates LLM-friendly JSON output
  • Intelligent Build System Detection: Automatically identifies and configures Maven/Gradle projects
  • Enhanced Dependency Resolution:
    • Maven: Parses dependencies from pom.xml, automatically handles property variables
    • Gradle: Uses Tooling API to get project configuration
    • Automatic search of local caches (~/.m2, ~/.gradle/caches) for missing dependencies
  • Automatic Test Framework Support: JUnit 4/5, Mockito, Hamcrest, AssertJ
  • Intelligent Statement Classification: ASSERT, MOCK, NEW, THIRD, GET/SET, PRODUCTION
  • DFS Method Call Analysis: Recursively expands method calls within test cases
  • Multi-threaded Parallel Processing: Supports concurrent analysis of multiple test files
  • Extensible Plugin Architecture: Task and visitor extension mechanism based on Java SPI

πŸ”§ Technical Features

  • Fat JAR Distribution: Includes all dependencies, ready to use out of the box
  • Detailed Debug Logging: Complete dependency resolution and configuration detection logs
  • Cross-platform Support: Windows, macOS, Linux
  • Java 21 Support: Uses latest JDK features

πŸ“‹ Output Format

{
  "project": "project name",
  "testClassName": "fully qualified test class name",
  "testCaseName": "test method name",
  "parsedStatementsSequence": ["method call sequence"],
  "productionFunctionImplementations": ["production code implementations"],
  "testCaseSourceCode": "test case source code",
  "importedPackages": ["imported packages list"]
}

πŸ—οΈ Dependencies

  • parser-core: Core AST parsing engine
  • picocli: Command line interface framework
  • Eclipse JDT: Java development tools core
  • Gson: JSON serialization library

πŸ“ Command Line Interface

java -jar Javalang-analyzing-cli-1.0.0-all.jar ParseTestCaseToLlmContext \
    --project /path/to/project \
    --format json

πŸ› Known Issues

  • Output directory is currently hardcoded to results/ folder under project root
  • Some complex Maven dependency management scenarios may require manual intervention

πŸ”„ Future Plans

  • Support for Go and Python project analysis
  • Configurable output directory
  • More built-in analysis tasks
  • Web UI interface

Version Format Description

  • [Major.Minor.Patch] - Release date
  • Major: Incompatible API changes
  • Minor: Backward-compatible functionality additions
  • Patch: Backward-compatible bug fixes