Skip to content

Comments

Add parentheses grouping support for NBT path logical expressions#217

Merged
rubensworks merged 18 commits intomaster-1.19-ltsfrom
copilot/add-logical-operators-support
Feb 15, 2026
Merged

Add parentheses grouping support for NBT path logical expressions#217
rubensworks merged 18 commits intomaster-1.19-ltsfrom
copilot/add-logical-operators-support

Conversation

Copy link

Copilot AI commented Feb 12, 2026

✅ Fixed Javadoc Issues

Fixed malformed HTML errors in javadoc comments by escaping < characters with {@literal} tag.

Issue:

Javadoc was failing with "malformed HTML" errors in NbtPathExpressionParseHandlerBooleanLogicalNot.java:

error: malformed HTML
 * Only accepts full expressions like "!(@.a < 15)" or "!@.a", not partial expressions like "!< 10".
                                             ^

Fix:

Changed javadoc comment to use {@literal} for < characters:

  • "!(@.a < 15)""!(@.a {@literal <} 15)"
  • "!< 10""!{@literal <} 10"

Verification:

./gradlew javadoc now builds successfully with no errors

Original prompt

This section details on the original issue you should resolve

<issue_title>Add basic logical operator support to NBT expression parasing</issue_title>
<issue_description>

Issue type:

  • ➕ Feature request

Short description:

As of right now, when testing or filtering an NBT path expression, boolean operators such as OR, AND, and NOT are unsupported. It would be nice if we were able to use basic boolean operators such as these.

The ability to use basic boolean operators
ex1. .someKey.someListKey[(?:@.someBoolKey || (@.someIntKey < someConstantInt))]
ex2. .someKey.someBoolKey && !(someOtherKey.someStringValue == "someConstantString")</issue_description>

<agent_instructions>Can you re-implement #216 on the master-1.19-lts branch?
Make sure to fix the CI issues from the PR.

Also, there's quite a lot of code duplication within the new handlers of that PR (e.g. findExpressionEnd).

And please also recommend changes for the wiki: https://github.com/CyclopsMC/CyclopsCore/wiki/NBT-Path
Just give me the diff within the PR description, and I'll apply it myself.</agent_instructions>

Comments on the Issue (you are @copilot in this section)

@rubensworks

Thanks for the suggestion!


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Co-authored-by: rubensworks <440384+rubensworks@users.noreply.github.com>
Copilot AI changed the title [WIP] Add basic logical operator support to NBT expression parsing Add logical operators (&&, ||, !) to NBT path expressions Feb 12, 2026
Copilot AI requested a review from rubensworks February 12, 2026 18:54
Co-authored-by: rubensworks <440384+rubensworks@users.noreply.github.com>
Copilot AI changed the title Add logical operators (&&, ||, !) to NBT path expressions Fix Javadoc HTML entity errors in logical operator handlers Feb 12, 2026
Copilot AI and others added 2 commits February 14, 2026 08:44
Co-authored-by: rubensworks <440384+rubensworks@users.noreply.github.com>
Co-authored-by: rubensworks <440384+rubensworks@users.noreply.github.com>
Copilot AI changed the title Fix Javadoc HTML entity errors in logical operator handlers Require explicit NBT references in AND/OR operators and add != support Feb 14, 2026
Co-authored-by: rubensworks <440384+rubensworks@users.noreply.github.com>
Copilot AI changed the title Require explicit NBT references in AND/OR operators and add != support Fix logical operator evaluation context and test syntax Feb 14, 2026
@coveralls
Copy link

coveralls commented Feb 15, 2026

Coverage Status

coverage: 22.891% (+0.8%) from 22.078%
when pulling 6c23a7b on copilot/add-logical-operators-support
into c81d083 on master-1.19-lts.

Co-authored-by: rubensworks <440384+rubensworks@users.noreply.github.com>
Copilot AI changed the title Fix logical operator evaluation context and test syntax Refactor logical operators: consolidate helpers and require full expressions for NOT Feb 15, 2026
Co-authored-by: rubensworks <440384+rubensworks@users.noreply.github.com>
Copilot AI changed the title Refactor logical operators: consolidate helpers and require full expressions for NOT Fix Java API compatibility in logical operator tests Feb 15, 2026
Copilot AI changed the title Fix Java API compatibility in logical operator tests Revert incorrect Java API compatibility changes Feb 15, 2026
Copilot AI and others added 2 commits February 15, 2026 07:25
Co-authored-by: rubensworks <440384+rubensworks@users.noreply.github.com>
Co-authored-by: rubensworks <440384+rubensworks@users.noreply.github.com>
Copilot AI changed the title Revert incorrect Java API compatibility changes Add parentheses grouping support for NBT path logical expressions Feb 15, 2026
Copy link
Member

@rubensworks rubensworks left a comment

Choose a reason for hiding this comment

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

Could you fix the javadoc issues?

Co-authored-by: rubensworks <440384+rubensworks@users.noreply.github.com>
Copy link
Author

Copilot AI commented Feb 15, 2026

Could you fix the javadoc issues?

Fixed in commit 6c23a7b. Escaped < characters in javadoc using {@literal} to resolve malformed HTML errors. Javadoc now builds successfully.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • jitpack.io
    • Triggering command: /opt/hostedtoolcache/Java_Microsoft_jdk/17.0.10/x64/bin/java /opt/hostedtoolcache/Java_Microsoft_jdk/17.0.10/x64/bin/java --add-exports jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED --add-exports jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED --add-exports jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED --add-exports jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED --add-exports jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED --add-opens java.base/java.util=ALL-UNNAMED --add-opens java.base/java.lang=ALL-UNNAMED --add-opens java.base/java.lang.invoke=ALL-UNNAMED --add-opens java.base/java.util=ALL-UNNAMED --add-opens (dns block)
  • libraries.minecraft.net
    • Triggering command: /opt/hostedtoolcache/Java_Microsoft_jdk/17.0.10/x64/bin/java /opt/hostedtoolcache/Java_Microsoft_jdk/17.0.10/x64/bin/java --add-exports jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED --add-exports jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED --add-exports jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED --add-exports jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED --add-exports jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED --add-opens java.base/java.util=ALL-UNNAMED --add-opens java.base/java.lang=ALL-UNNAMED --add-opens java.base/java.lang.invoke=ALL-UNNAMED --add-opens java.base/java.util=ALL-UNNAMED --add-opens (dns block)
  • maven.minecraftforge.net
    • Triggering command: /opt/hostedtoolcache/Java_Microsoft_jdk/17.0.10/x64/bin/java /opt/hostedtoolcache/Java_Microsoft_jdk/17.0.10/x64/bin/java --add-exports jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED --add-exports jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED --add-exports jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED --add-exports jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED --add-exports jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED --add-opens java.base/java.util=ALL-UNNAMED --add-opens java.base/java.lang=ALL-UNNAMED --add-opens java.base/java.lang.invoke=ALL-UNNAMED --add-opens java.base/java.util=ALL-UNNAMED --add-opens (dns block)
  • maven.theillusivec4.top
    • Triggering command: /opt/hostedtoolcache/Java_Microsoft_jdk/17.0.10/x64/bin/java /opt/hostedtoolcache/Java_Microsoft_jdk/17.0.10/x64/bin/java --add-exports jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED --add-exports jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED --add-exports jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED --add-exports jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED --add-exports jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED --add-opens java.base/java.util=ALL-UNNAMED --add-opens java.base/java.lang=ALL-UNNAMED --add-opens java.base/java.lang.invoke=ALL-UNNAMED --add-opens java.base/java.util=ALL-UNNAMED --add-opens (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

@sonarqubecloud
Copy link

Quality Gate Failed Quality Gate failed

Failed conditions
4.2% Duplication on New Code (required ≤ 3%)

See analysis details on SonarQube Cloud

@rubensworks rubensworks marked this pull request as ready for review February 15, 2026 10:47
@rubensworks rubensworks merged commit f5f5fc6 into master-1.19-lts Feb 15, 2026
6 of 7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants