pgpool / pgpool2

This is the official mirror of git://git.postgresql.org/git/pgpool2.git. Note that this is just a *mirror* - we don't work with pull requests on github. Please subscribe to pgpool-hackers mailing list from our website and submit your patch to this mailing list.
https://www.pgpool.net
Other
305 stars 87 forks source link

Replace Runtime.exec(String) with Runtime.exec(String[]) to avoid Java 21 deprecation warnings #40

Closed vpa1977 closed 3 months ago

vpa1977 commented 4 months ago

When running pgpool2 tests with Java 21, jdbc tests output deprecation warning when compiling PgpoolTest.java and RunTest.java.

javac -Xlint:deprecation ./src/test/regression/tests/005.jdbc/*.java
./src/test/regression/tests/005.jdbc/PgpoolTest.java:59: warning: [deprecation] exec(String) in Runtime has been deprecated
        proc = Runtime.getRuntime().exec(command_line);
                                   ^
./src/test/regression/tests/005.jdbc/RunTest.java:29: warning: [deprecation] exec(String) in Runtime has been deprecated
        Process proc = Runtime.getRuntime().exec(command_line);
                                           ^
2 warnings

Replace Runtime.exec(String) with Runtime.exec(String[]) to avoid Java 21 deprecation warnings.

vpa1977 commented 3 months ago

@pengbo0328 I apologise for not reporting it via bug tracker because "report issue" button redirects back to the view issues pages in https://www.pgpool.net/mantisbt/.

Turned out that it happens only in chrome.

Firefox opens the issue page, but trying to attach the patch for this MR results in 403/Forbidden.

vpa1977 commented 3 months ago

Thank you! I have fixed the typo that was causing this issue.

I was wondering if it would be ok to push commit that checks return code from waitFor() and prints psql's process stdout/stderr?

pengbo0328 commented 3 months ago

@vpa1977 I've made a few minor changes to your patch and committed it bfee798e5045a309af2e297baed3d8544e68d4c2 Thank you for your patch!

vpa1977 commented 3 months ago

@vpa1977 I've made a few minor changes to your patch and committed it bfee798 Thank you for your patch!

Thank you!!!!!!