Skip to content
Open
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
4 changes: 2 additions & 2 deletions core/src/main/java/org/verapdf/report/HTMLReport.java
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public final class HTMLReport {
private static final String xslExt = ".xsl"; //$NON-NLS-1$
private static final String detailedReport = resourceRoot + "DetailedHtmlReport" + xslExt; //$NON-NLS-1$
private static final String summaryReport = resourceRoot + "SummaryHtmlReport" + xslExt; //$NON-NLS-1$
private static final String GUI = "gui"; //$NON-NLS-1$
private static final String APPS = "apps"; //$NON-NLS-1$
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

Verify the impact of renaming "gui" to "apps" in HTML templates and consuming code.

The constant declaration is correct. However, ensure that HTML report templates (XSL files) and any consuming code are updated to handle "apps" instead of "gui".

Run the following script to verify references to the old "gui" value and new "apps" value:


🏁 Script executed:

#!/bin/bash
# Description: Search for references to "gui" and "apps" in XSL templates and Java files

# Search for hardcoded "gui" strings that might expect the old constant value
rg -n -C3 '"gui"' --type=xml --type=xsl

# Search for references to the new "apps" value
rg -n -C3 '"apps"' --type=xml --type=xsl

# Search for usages of getAppName() to understand how the value is used
rg -n -C3 'getAppName\(\)' --type=java

Length of output: 1292


🏁 Script executed:

#!/bin/bash
# Find XSL template files
echo "=== Finding XSL/XSLT files ==="
fd -e xsl -e xslt

# Search for appName in all files
echo "=== Searching for appName references ==="
rg -n "appName" -C3

# Search for hardcoded gui values
echo "=== Searching for 'gui' string literals ==="
rg -n '"gui"' -C3

# Get complete getAppName method using ast-grep
echo "=== Complete getAppName() method ==="
ast-grep --pattern 'private static String getAppName() { $$$ }'

Length of output: 10593


🏁 Script executed:

#!/bin/bash
# Find ReleaseDetails class definition
echo "=== ReleaseDetails class ==="
rg -n "class ReleaseDetails" -A10 --type=java

# Search for where releaseDetails elements are created in XML
echo "=== releaseDetails XML creation ==="
rg -n "releaseDetails" -B2 -A2 --type=java

# Check buildInformation/releaseDetails generation
echo "=== BuildInformation class ==="
rg -n "class BuildInformation" -A10 --type=java

# Search for any enum or constant that defines app names
echo "=== App name constants/values ==="
rg -n '"gui"|"apps"|"rest"' -B1 -A1 --type=java

Length of output: 4196


🏁 Script executed:

#!/bin/bash
# Find release properties files
echo "=== Release properties files ==="
fd -e properties | grep -i release

# Check properties file content
echo "=== Properties file content (id values) ==="
rg -n '\bid=' --type=properties

# Find where XML is generated with releaseDetails
echo "=== XML generation with releaseDetails ==="
rg -n 'releaseDetails' -B3 -A3 --type=xml --type=java | head -60

# Check test resources for releaseDetails
echo "=== Test resource files with releaseDetails ==="
fd releaseDetails

# Search ReleaseDetails for getId() and id field
echo "=== ReleaseDetails ID field and getter ==="
ast-grep --pattern 'private $$$String id;' 

Length of output: 8455


🏁 Script executed:

#!/bin/bash
# View properties files
echo "=== library.properties ==="
cat core/src/main/resources/org/verapdf/release/library.properties

echo ""
echo "=== test.properties ==="
cat core/src/test/resources/org/verapdf/release/test.properties

# Find ReleaseDetails fields
echo ""
echo "=== ReleaseDetails fields ==="
ast-grep --pattern 'private $$$id;'

# Get complete ReleaseDetails class structure
echo ""
echo "=== ReleaseDetails members ==="
ast-grep --pattern 'public final class ReleaseDetails { $$$ }'

Length of output: 420


🏁 Script executed:

#!/bin/bash
# View full ReleaseDetails.java
echo "=== ReleaseDetails.java ==="
cat core/src/main/java/org/verapdf/ReleaseDetails.java

# Find all XML test files with id="gui"
echo ""
echo "=== Test files with id=gui ==="
rg -l 'id="gui"' --type=xml

# Count occurrences
echo ""
echo "=== Occurrences of id=gui in test files ==="
rg 'id="gui"' --type=xml

Length of output: 8059


🏁 Script executed:

#!/bin/bash
# Search for other references to "gui" in Java code (not just test XML)
echo "=== Java code references to 'gui' ==="
rg -n '"gui"' --type=java -B2 -A2

# Search for where DETAILS map gets populated (runtime behavior)
echo ""
echo "=== addDetailsFromResource calls ==="
rg -n 'addDetailsFromResource' -B1 -A1 --type=java

# Check pom.xml for project artifactId
echo ""
echo "=== Project artifactId in pom.xml ==="
rg -n 'artifactId' core/pom.xml | head -5

# Search for any constants or enums defining app names
echo ""
echo "=== App name definitions ==="
rg -n 'APPS|VERAPDF_REST|gui|apps' --type=java core/src/main/java/org/verapdf/report/HTMLReport.java

Length of output: 1252


Update test data to match new app name fallback value.

The code change replaces the fallback app name from "gui" to "apps" in HTMLReport.java (line 105). However, the test XML file still references id="gui", which will cause the XSL template lookup (releaseDetails[@id=$appName]) to fail at runtime.

Required change:
Update core/src/test/resources/org/verapdf/policy/font-checks-mrr.xml — change id="gui" to id="apps" in the releaseDetails element.

🤖 Prompt for AI Agents
In core/src/test/resources/org/verapdf/policy/font-checks-mrr.xml around the
releaseDetails element, the test XML still uses id="gui" which no longer matches
the new fallback appName ("apps") introduced in
core/src/main/java/org/verapdf/report/HTMLReport.java; update the releaseDetails
element to use id="apps" (i.e., change id="gui" to id="apps") so the XSL lookup
releaseDetails[@id=$appName] will find the correct node at runtime.

private static final String VERAPDF_REST = "verapdf-rest"; //$NON-NLS-1$

private HTMLReport() {
Expand Down Expand Up @@ -102,7 +102,7 @@ private static String getAppName() {
return VERAPDF_REST;
}
}
return GUI;
return APPS;
}

}
Loading