RFR 8081638: JShell tool: Improve completion for static import

ShinyaYoshida bitterfoxc at gmail.com
Wed Jun 3 09:21:27 UTC 2015


Hi Jan,
Thank you for your review.

2015-06-03 17:51 GMT+09:00 Jan Lahoda <jan.lahoda at oracle.com>:

> Hi Shinya,
>
> Overall looks good, thanks! Two comments:
> -it seems that it might make sense to create a single method that would
> for a TreePath look up the enclosing ImportTree, if any, and that would be
> used in the other methods. Something like:
>     public ImportTree findImport(TreePath tp) {
>         switch (tp.getParentPath().getLeaf().getKind()) {
>         case MEMBER_SELECT:
>             return findImport(tp.getParentPath());
>         case IMPORT:
>             return (ImporTree) tp.getLeaf();
>         default:
>             return null;
>         }
>     }
>
> And this would then be used to detect if TreePath is inside the import
> (isImport) and to detect static imports. Note there is another usecase for
> such detection in computeSuggestions in the IDENTIFIER identifier section.
>
Ok, I'll fix!


> -membersOf has parameter isStaticContext, which in fact mean
> "shouldGenerateDotClassItem" - would it make sense to rename the parameter?
>
Certainly, I'll rename.

Regards,
shinyafox(Shinya Yoshida)


>
> Thanks,
>    Jan
>
>
> On 2.6.2015 06:12, ShinyaYoshida wrote:
>
>> Hi Jan,
>> Please review this patch:
>>
>> webrev:
>> http://cr.openjdk.java.net/~shinyafox/kulla/8081638/webrev.00/
>>
>> bugs:
>> https://bugs.openjdk.java.net/browse/JDK-8081638
>>
>> Regards,
>> shinyafox(Shinya Yoshida)
>>
>>


More information about the kulla-dev mailing list