You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@netbeans.apache.org by "mambastudio (via GitHub)" <gi...@apache.org> on 2025/11/08 19:24:44 UTC
[I] value keyword for Value Objects [netbeans]
mambastudio opened a new issue, #8994:
URL: https://github.com/apache/netbeans/issues/8994
### Description
Introduce recognition of the value keyword in Java source files to support[ Valhalla Early Access builds](https://jdk.java.net/valhalla/) (OpenJDK 26 and beyond). This enhancement would ensure correct syntax highlighting, parsing, and code completion for the new Value Objects feature introduced under Project Valhalla.
### Use case/motivation
The OpenJDK team is standardizing Value Objects as part of Project Valhalla. With the introduction of the value keyword in early-access builds of OpenJDK 26, IDE support is essential for developers testing and adopting this feature. NetBeans should recognize the value keyword similarly to existing Java keywords (e.g., record, sealed, permits) to maintain feature parity and developer experience with other IDEs.
### Related issues
_No response_
### Are you willing to submit a pull request?
No
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
Re: [I] value keyword for Value Classes [netbeans]
Posted by "mbien (via GitHub)" <gi...@apache.org>.
mbien commented on issue #8994:
URL: https://github.com/apache/netbeans/issues/8994#issuecomment-3663367910
https://github.com/apache/netbeans/pull/9079 implements the `value` keyword in the semantic layer
We can leave this issue open for informational purposes, but as previously mentioned for it to work the language feature (JEP 401 in this case) would have to make it into the main JDK repo first which the embedded javac is based on.
But to experiment with value objects you can prepare your own NetBeans dev build:
- [download a nightly build](https://github.com/apache/netbeans?tab=readme-ov-file#download) of NetBeans
- use a [Valhalla JDK 26 build](https://jdk.java.net/valhalla/) to run NetBeans (`--jdkhome <path>`)
- uninstall nb-javac (tools -> plugins -> installed) and restart
(don't forget to enable preview in your project)
NB will now use the valhalla javac of it's runtime JDK. This should work as long the javac version remains compatible with the NB version. (this assumes that the valhalla javac doesn't diverge too far from the mainline javac)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
Re: [I] value keyword for Value Classes [netbeans]
Posted by "mambastudio (via GitHub)" <gi...@apache.org>.
mambastudio commented on issue #8994:
URL: https://github.com/apache/netbeans/issues/8994#issuecomment-3506834821
@mbien that's well understood and it makes sense. It's just that the IDE doesn't allow me to compile the code at all when I try to test it. I had to compromise to a text editor with syntax highlights and use the command prompt. The argument is that it would be nice to have the ability to test certain experimental language features through the IDE.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
Re: [I] value keyword for Value Classes [netbeans]
Posted by "mbien (via GitHub)" <gi...@apache.org>.
mbien commented on issue #8994:
URL: https://github.com/apache/netbeans/issues/8994#issuecomment-3508497015
> It's just that the IDE doesn't allow me to compile the code at all
this is a common misconception but NB is not building your project and typically can't prevent your code from being compiled. You may see error badges in the editor and other failures, but only the build system of your project compiles your project (e.g maven).
that being set, I opened https://github.com/apache/netbeans/pull/8995 which produces dev builds which can be used to experiment with valhalla features.
e.g https://github.com/apache/netbeans/actions/runs/19204284796/artifacts/4510676681
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
Re: [I] value keyword for Value Classes [netbeans]
Posted by "mbien (via GitHub)" <gi...@apache.org>.
mbien commented on issue #8994:
URL: https://github.com/apache/netbeans/issues/8994#issuecomment-3506825272
this will likely take a while until it is supported. `value` is no traditional keyword, it is context sensitive and would get recognized as such using javac after the parsing phase.
Since value objects are no preview feature yet: Even if we would recognize `value`, the embedded javac would still fail to process the file and show an error at its location. Unless we build a frankenstein nb-javac which is a mix of upstream JDK 16 and the valhalla repo - which might be doable as experimental build but probably not in the release.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
Re: [I] value keyword for Value Classes [netbeans]
Posted by "mbien (via GitHub)" <gi...@apache.org>.
mbien commented on issue #8994:
URL: https://github.com/apache/netbeans/issues/8994#issuecomment-3559124742
@ExE-Boss yes. But but all context sensitive keywords you listed compile fine using nb-javac 25 (the javac build embedded in NB).
nb-javac is intentionally kept unchanged (outside of the fact that it can run on JDK 17) and will be based on javac of JDK 26 next. We don't want to merge valhalla patches into it. Once its a preview feature this won't be a problem but until then `value` inside a class declaration is a syntax error for nb-javac and it will annotate it as such in the editor.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
Re: [I] value keyword for Value Classes [netbeans]
Posted by "ExE-Boss (via GitHub)" <gi...@apache.org>.
ExE-Boss commented on issue #8994:
URL: https://github.com/apache/netbeans/issues/8994#issuecomment-3558814377
> this will likely take a while until it is supported. `value` is no traditional keyword, it is context sensitive and would get recognized as such using javac after the parsing phase.
So are `record`, `sealed`, `permits`, `var` and a few others, namely those that were added added since **Java 9**.
(`assert` was the last traditional keyword to be added with the release of **Java 5**, causing backwards compatibility issues for testing frameworks)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
Re: [I] value keyword for Value Classes [netbeans]
Posted by "mbien (via GitHub)" <gi...@apache.org>.
mbien commented on issue #8994:
URL: https://github.com/apache/netbeans/issues/8994#issuecomment-5228239861
The valhalla project is now in mainline [JDK 28 builds](https://jdk.java.net/28/) as preview feature.
For those wanting to test it: the regular [NetBeans 31 release](https://netbeans.apache.org/download/nb31/) (once available, [RC builds](https://github.com/apache/netbeans/discussions/9512) work too) + JDK 28 b10 is a combination known to work for testing purposes.
The instructions above still apply but make sure to use an extra copy of NetBeans and also a fresh config folder `--userdir <test_config_path>` to avoid breaking your main copy. (dev-builds and RCs use their own config folders, so it isn't a concern there if you stick to them)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists