smallrye-common icon indicating copy to clipboard operation
smallrye-common copied to clipboard

different name than ProcessBuilder

Open maxandersen opened this issue 6 months ago • 7 comments

discussed in #418 reusing ProcessBuilder name is not great.

In particular when you write code like this:

void main() {
    var pb = new ProcessBuilder("ls", "-l");
}

You get no error because ProcessBuilder is in java.lang and it is now quite tedious because the IDE will not help you import it.

How about ProcBuilder or ExecBuilder ?

maxandersen avatar Jun 30 '25 16:06 maxandersen

There have already been releases with the ProcessBuilder name now, so I think the bar for renaming would have to be pretty high at this point. How badly do you want this change?

FWIW IntelliJ finds the correct process builder for me with completion without too much trouble.

dmlloyd avatar Jun 30 '25 16:06 dmlloyd

Well you said beta to get feedback :)

I think it's bad for usability that Google searches , api lookup and IDE will have to be prefixed with smallrye all the time.

Using processBuilder as name will either:

A) make it hard to Discover the right docs/help for processBuilder

B) overlap/confuse with java.lang.processBuilder

Also - and that's subjective - ProcessBuilder is a mile long to write/read :)

maxandersen avatar Jul 01 '25 06:07 maxandersen

There was a beta, that was a while ago though, and nobody gave feedback. In retrospect I could have done more betas (for other reasons) but at the time I had convinced myself I could not. Oh well.

Anyway, I did evaluate A & B and decided that it wasn't too bad since I didn't have any trouble with completion when I did quarkusio/quarkus#48354. But again if you have more reasons do share them; I'm ready to be convinced if there's a good proposal (ExecBuilder is kind of interesting) and a really solid reason to change it so soon.

dmlloyd avatar Jul 01 '25 13:07 dmlloyd

I think there are probably three choices here:

  1. Keep everything the same (always a choice)
  2. Add a utility class called Exec which contains the exec* and newBuilder methods which are presently on ProcessBuilder, and deprecate the old methods (which then means ProcessBuilder never needs to be imported, thus solving (?) the problem; this retains 100% source and binary compatibility with the existing code)
  3. Introduce a new interface e.g. ExecBuilder and have ProcessBuilder extend it, with a lot of delegation & deprecation

I think 2 is the most practical solution, but I'm not sure if this would be acceptable to you.

dmlloyd avatar Jul 07 '25 18:07 dmlloyd

#2 sounds good :)

maxandersen avatar Jul 10 '25 10:07 maxandersen

btw. imo I struggle to see why its not okey to remove it as it is still just in a beta?

maxandersen avatar Jul 10 '25 10:07 maxandersen

It isn't in beta anymore. There have been multiple releases.

dmlloyd avatar Jul 10 '25 11:07 dmlloyd