Community
Participate
Working Groups
Now we can have binary, octal, decimal and hexadecimal literals in Java code. It might be useful to have quick assists which convert integer literals from one base to another.
The relevance of these quick assists should be lower than the relevance of the Extract ... quick assists. Negative numbers will need some special love, otherwise converting e.g. public static final int CONST= 0xFFFFFFFF; to decimal will result in -1, and when you convert only the NumberLiteral back to hex, you'd get -0x1. Also make sure it behaves well with floating-point literals.
Created attachment 197682 [details] v0.5 I had written this code a while back. The patch uses apis from Integer class to do the parsing and conversion, but these APIs have not been completely updated (e.g. they do not handle underscores). Hence the patch is far from perfect. Will come back to it at some point in the future.
This seems like a nice feature. Any chance you could complete your patch Deepak? :)