photonvision icon indicating copy to clipboard operation
photonvision copied to clipboard

Java 17

Open Alextopher opened this issue 1 year ago • 9 comments

image

JDK 11 References https://github.com/search?q=org%3APhotonVision+jdk-11&type=code

JDK 17 References https://github.com/search?q=org%3APhotonVision+jdk-17&type=code

TODO List (things we might need to update in other repos):

  • [] https://github.com/PhotonVision/photon-pi-os/blob/ab5fa98d72c0381e7f73adf62b3aeeeea4d4fed6/photonvision/src/modules/photonvision/start_chroot_script#L29
  • [] https://github.com/PhotonVision/photon-pi-gen/blob/7f8d2254450b7533871d71eb36a415639d8c5ac9/stage2/01-sys-tweaks/00-packages#L34
  • [] https://github.com/PhotonVision/photon-pi-os/blob/ab5fa98d72c0381e7f73adf62b3aeeeea4d4fed6/photonvision/src/modules/photonvision/install.sh#L11
  • [] https://github.com/PhotonVision/photon-picam-driver/blob/a4e7ecb6e379e4b1ca8ac65de9ebbdfa795dee34/Makefile#L14

Alextopher avatar Sep 29 '24 11:09 Alextopher

This should update code to use new Java 17 features

spacey-sooty avatar Sep 29 '24 11:09 spacey-sooty

This should update code to use new Java 17 features

I can do that. I'm familiar with instanceof pattern matching and new switch syntax. Are there other things I should look out for?

Alextopher avatar Sep 29 '24 11:09 Alextopher

Potentially enhanced instanceof to simplify equals methods. https://github.com/wpilibsuite/allwpilib/pull/6691/ could be of help

spacey-sooty avatar Sep 29 '24 11:09 spacey-sooty

Superesedes https://github.com/PhotonVision/photonvision/pull/1069

spacey-sooty avatar Sep 29 '24 13:09 spacey-sooty

https://github.com/PhotonVision/photonvision/blob/abe95dfaa055bbe3609f72cfcaaba0f96ee7978c/shared/common.gradle#L6

Maybe this hack can be removed from build scripts?

This isn't a hack? it should be set to 17 tho

spacey-sooty avatar Sep 29 '24 14:09 spacey-sooty

@spacey-sooty You're just too fast! I copy pasted the wrong permalink.

https://github.com/Alextopher/photonvision/blob/f4e2d4b3bef7a707fd156c8b7cd68f7ce251cd75/photon-docs/build.gradle#L250

This looks like a hack - does JDK 17 just fix this? RE @mcm001 #1094

Alextopher avatar Sep 29 '24 14:09 Alextopher

@spacey-sooty You're just too fast! I copy pasted the wrong permalink.

Alextopher/photonvision@f4e2d4b/photon-docs/build.gradle#L250

This looks like a hack - does JDK 17 just fix this? RE @mcm001 #1094

Based off when it was resolved I don't think so?

spacey-sooty avatar Sep 29 '24 14:09 spacey-sooty

You can also steal stuff from #1069. I can rerun Intellij inspection after and do more stuff. It does it all automatically so no need for you to manually implement all the basic stuff yourself (switch cases, instance typing, etc).

srimanachanta avatar Oct 02 '24 13:10 srimanachanta

Supersedes #1069

srimanachanta avatar Oct 02 '24 13:10 srimanachanta