GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Merge branch 'main' into unnecessaryboxing-overload-fn · pmd/pmd@1b84182

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • .ci/files
    • Gemfile.lock
  • docs
    • Gemfile.lock
    • pages
      • pmd/projectdocs/committers
        • infrastructure.md
      • release_notes.md
  • pmd-java/src
    • main/java/net/sourceforge/pmd/lang/java/ast
      • ConstantFolder.java
    • test
      • java/net/sourceforge/pmd/lang/java/ast
        • ConstantExpressionsTests.java
      • kotlin/net/sourceforge/pmd/lang/java
        • ast
          • ConstValuesKotlinTest.kt
        • types/internal/infer
          • LambdaInferenceTest.kt
  • pom.xml
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎.ci/files/Gemfile.lock‎

Copy file name to clipboardExpand all lines: .ci/files/Gemfile.lock
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ GEM
1515
logger (1.7.0)
1616
logger-colors (1.1.0)
1717
logger
18-
nokogiri (1.19.4-x86_64-linux-gnu)
18+
nokogiri (1.19.5-x86_64-linux-gnu)
1919
racc (~> 1.4)
2020
ostruct (0.6.3)
2121
pmdtester (1.7.0)
Collapse file

‎docs/Gemfile.lock‎

Copy file name to clipboardExpand all lines: docs/Gemfile.lock
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
GEM
22
remote: https://rubygems.org/
33
specs:
4-
addressable (2.9.0)
4+
addressable (2.9.1)
55
public_suffix (>= 2.0.2, < 8.0)
66
base64 (0.3.0)
77
bigdecimal (4.1.3)
Collapse file

‎docs/pages/pmd/projectdocs/committers/infrastructure.md‎

Copy file name to clipboardExpand all lines: docs/pages/pmd/projectdocs/committers/infrastructure.md
+7-9Lines changed: 7 additions & 9 deletions
  • Display the source diff
  • Display the rich diff
Original file line numberDiff line numberDiff line change
@@ -2,23 +2,24 @@
22
title: Infrastructure
33
permalink: pmd_projectdocs_committers_infrastructure.html
44
author: Andreas Dangel <[email protected]>
5-
last_updated: February 2025 (7.11.0)
5+
last_updated: November 2026 (7.30.0)
66
---
77

8-
This page describes, which infrastructure and services is used by the pmd project.
8+
This page describes which infrastructure and services are used by the pmd project.
99

1010
## GitHub
1111

1212
The main repository is hosted on <https://github.com/pmd>. We own the organization "pmd".
1313

1414
* source code in git repositories
15-
* releases
15+
* releases (<https://github.com/pmd/pmd/releases>, or via feed: <https://github.com/pmd/pmd/releases.atom>)
1616
* issue tracker
1717
* discussions
1818
* pull requests
19+
* commit notification via feeds, e.g. <https://github.com/pmd/pmd/commits/main.atom>
1920
* [GitHub Actions for CI](pmd_devdocs_github_actions_workflows.html)
2021

21-
Also the [main landing page](pmd_projectdocs_committers_main_landing_page.html) (<https://pmd.github.io>)
22+
The [main landing page](pmd_projectdocs_committers_main_landing_page.html) (<https://pmd.github.io>)
2223
is hosted using GitHub pages.
2324

2425
## SourceForge
@@ -29,12 +30,9 @@ Nowadays, it is used for:
2930

3031
* hosting an archive of binaries: <https://sourceforge.net/projects/pmd/files/>
3132
* hosting an archive of documentation: <https://pmd.sourceforge.io/archive.html>
32-
* mailing lists:
33-
* <[email protected]>
34-
* <[email protected]>
35-
* discussion forum
33+
* mailing list: <[email protected]>
3634

37-
It also contains the old issue tracker.
35+
It also contains the old issue tracker and the old discussion forum.
3836

3937
## Domain, mail and homepage
4038

Collapse file

‎docs/pages/release_notes.md‎

Copy file name to clipboardExpand all lines: docs/pages/release_notes.md
+1Lines changed: 1 addition & 0 deletions
  • Display the source diff
  • Display the rich diff
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ This is a {{ site.pmd.release_type }} release.
5252
* java
5353
* [#7144](https://github.com/pmd/pmd/issues/7144): \[java] Lambda block body that cannot complete normally is not treated as value-compatible
5454
* [#7240](https://github.com/pmd/pmd/issues/7240): \[java] "Not a Java binary name" when importing a class with non-ASCII (e.g. Japanese) letters in its name; the whole file is skipped
55+
* [#7313](https://github.com/pmd/pmd/issues/7313): \[java] Casts to boolean and boolean equality are not folded as constant expressions
5556
* java-bestpractices
5657
* [#7116](https://github.com/pmd/pmd/issues/7116): \[java] New rule: ControlFlowInTest
5758
* [#7216](https://github.com/pmd/pmd/issues/7216): \[java] GuardLogStatement: False positive on SLF4J parameterised calls whose arguments are wrapped with logstash value(...)
Collapse file

‎pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ConstantFolder.java‎

Copy file name to clipboardExpand all lines: pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ConstantFolder.java
+12Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
import net.sourceforge.pmd.lang.java.symbols.JFieldSymbol;
1616
import net.sourceforge.pmd.lang.java.symbols.JVariableSymbol;
1717
import net.sourceforge.pmd.lang.java.types.JPrimitiveType;
18+
import net.sourceforge.pmd.lang.java.types.JPrimitiveType.PrimitiveTypeKind;
1819
import net.sourceforge.pmd.lang.java.types.JTypeMirror;
1920
import net.sourceforge.pmd.lang.java.types.Substitution;
2021
import net.sourceforge.pmd.lang.java.types.TypeTestUtil;
@@ -188,6 +189,8 @@ private ConstResult coerceVariableValue(JVariableSymbol symbol, ConstResult resu
188189
Object res;
189190
if (t.isNumeric()) {
190191
res = numericCoercion(castValue.getValue(), t);
192+
} else if (t.isPrimitive(PrimitiveTypeKind.BOOLEAN)) {
193+
res = booleanCoercion(castValue.getValue());
191194
} else if (TypeTestUtil.isExactlyA(String.class, node.getCastType())) {
192195
res = stringCoercion(castValue.getValue());
193196
} else {
@@ -541,6 +544,8 @@ public strictfp ConstResult visit(ASTInfixExpression node, Void data) {
541544
if (isConvertibleToNumber(left) && isConvertibleToNumber(right)) {
542545
Pair<Object, Object> promoted = binaryNumericPromotion(left, right);
543546
return promoted.getLeft().equals(promoted.getRight()); // fixme Double.NaN
547+
} else if (left instanceof Boolean && right instanceof Boolean) {
548+
return left.equals(right);
544549
} else {
545550
return null; // not a constant expr on reference types
546551
}
@@ -630,6 +635,13 @@ private static Object numericCoercion(Object v, JTypeMirror target) {
630635
return null;
631636
}
632637

638+
private static Object booleanCoercion(Object v) {
639+
if (v instanceof Boolean) {
640+
return v;
641+
}
642+
return null;
643+
}
644+
633645
private static Object stringCoercion(Object v) {
634646
if (v instanceof String) {
635647
return v;
Collapse file

‎pmd-java/src/test/java/net/sourceforge/pmd/lang/java/ast/ConstantExpressionsTests.java‎

Copy file name to clipboardExpand all lines: pmd-java/src/test/java/net/sourceforge/pmd/lang/java/ast/ConstantExpressionsTests.java
+7-1Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,10 @@ void testCasts() {
6565
isConst("(int) 2f", 2),
6666
isConst("(short) 2f", (short) 2f),
6767
isConst("(long) 2f", 2L),
68+
isConst("(boolean) true", true),
6869

6970
// those are type errors
71+
notConst("(boolean) 1"),
7072
notConst("(Object) 1"),
7173
notConst("(String) null"),
7274
notConst("(char) null"),
@@ -290,11 +292,15 @@ strictfp void testEquality() {
290292
isConst("2 != 2d", false),
291293
isConst("'x' != (int) 'x'", false),
292294
isConst("'x' == (int) 'x'", true),
295+
isConst("true == true", true),
296+
isConst("false == false", true),
297+
isConst("true != false", true),
293298

294299

295300
notConst("\"\" == \"\""),
296301
notConst("\"\" != \"\""),
297-
notConst("2 != \"\"")
302+
notConst("2 != \"\""),
303+
notConst("true == 1")
298304
);
299305
}
300306

Collapse file

‎pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ConstValuesKotlinTest.kt‎

Copy file name to clipboardExpand all lines: pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/ast/ConstValuesKotlinTest.kt
+28Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,34 @@ class ConstValuesKotlinTest : ProcessorTestSpec({
118118
acu.initializerOf("result").constValue shouldBe null
119119
}
120120

121+
parserTest("Comparing or casting boxed Boolean locals is foldable but is not a constant expression") {
122+
val acu = parser.parse(
123+
"""
124+
class Foo {
125+
void test() {
126+
final Boolean boxedTrue = true;
127+
final Boolean boxedFalse = false;
128+
final boolean primTrue = true;
129+
final boolean primFalse = false;
130+
boolean same = boxedTrue == boxedFalse;
131+
boolean unboxed = boxedTrue == true;
132+
boolean cast = (boolean) boxedTrue;
133+
boolean primSame = primTrue == primFalse;
134+
}
135+
}
136+
""".trimIndent()
137+
)
138+
139+
acu.initializerOf("same").constFoldingResult.value shouldBe false
140+
acu.initializerOf("same").isCompileTimeConstant shouldBe false
141+
acu.initializerOf("unboxed").constFoldingResult.value shouldBe true
142+
acu.initializerOf("unboxed").isCompileTimeConstant shouldBe false
143+
acu.initializerOf("cast").constFoldingResult.value shouldBe true
144+
acu.initializerOf("cast").isCompileTimeConstant shouldBe false
145+
acu.initializerOf("primSame").constFoldingResult.value shouldBe false
146+
acu.initializerOf("primSame").isCompileTimeConstant shouldBe true
147+
}
148+
121149
parserTest("Local numeric constants use their declared types") {
122150
val acu = parser.parse(
123151
"""
Collapse file

‎pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/LambdaInferenceTest.kt‎

Copy file name to clipboardExpand all lines: pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/internal/infer/LambdaInferenceTest.kt
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -562,6 +562,7 @@ class Scratch {
562562
testBody("{ for (; 1 < 2;) { } }", void = true, value = true)
563563
testBody("{ while (forever) { } }", void = true, value = true)
564564
testBody("{ while (FOREVER) { } }", void = true, value = true)
565+
testBody("{ while (FOREVER == true) { } }", void = true, value = true)
565566
testBody("{ while (b) { } }", void = true)
566567
testBody("{ while (true || b) { } }", void = true)
567568

Collapse file

‎pom.xml‎

Copy file name to clipboardExpand all lines: pom.xml
+1-3Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,7 @@
4545
</mailingList>
4646
<mailingList>
4747
<name>PMD commits</name>
48-
<subscribe>https://lists.sourceforge.net/lists/listinfo/pmd-commits</subscribe>
49-
<unsubscribe>https://lists.sourceforge.net/lists/listinfo/pmd-commits</unsubscribe>
50-
<archive>https://sourceforge.net/p/pmd/mailman/pmd-commits</archive>
48+
<archive>https://github.com/pmd/pmd/commits/main</archive>
5149
</mailingList>
5250
</mailingLists>
5351
<developers>

0 commit comments

Comments
0 (0)
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.