You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@netbeans.apache.org by GitBox <gi...@apache.org> on 2020/08/07 14:34:59 UTC
[GitHub] [netbeans] singh-akhilesh opened a new pull request #2301: [NETBEANS-4681] Fixed issue : refactor record rename & move record file to other package
singh-akhilesh opened a new pull request #2301:
URL: https://github.com/apache/netbeans/pull/2301
https://issues.apache.org/jira/browse/NETBEANS-4681
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
[GitHub] [netbeans] junichi11 commented on a change in pull request #2301: [NETBEANS-4681] Fixed issue : refactor record rename & move record file to other package
Posted by GitBox <gi...@apache.org>.
junichi11 commented on a change in pull request #2301:
URL: https://github.com/apache/netbeans/pull/2301#discussion_r469736959
##########
File path: java/refactoring.java/src/org/netbeans/modules/refactoring/java/ui/UIUtilities.java
##########
@@ -57,14 +57,22 @@
// XXX: Remove "test_" when #211651 is fixed
private static final String TEST_JAVA_MIME_TYPE = "test_text/x-java"; // NOI18N
+ private static final String RECORD = "RECORD";
/**
* Element.Kind values allowed to be used when calling ElementHandle.create
*
* @see javax.lang.model.element.ElementKind
* @see org.netbeans.api.java.source.ElementHandle
*/
public static EnumSet allowedElementKinds = EnumSet.of(ElementKind.PACKAGE, ElementKind.CLASS, ElementKind.INTERFACE, ElementKind.ENUM, ElementKind.ANNOTATION_TYPE, ElementKind.METHOD, ElementKind.CONSTRUCTOR, ElementKind.INSTANCE_INIT, ElementKind.STATIC_INIT, ElementKind.FIELD, ElementKind.ENUM_CONSTANT, ElementKind.TYPE_PARAMETER);
-
+ static {
+ ElementKind recKind = null;
+ try {
+ recKind = ElementKind.valueOf(RECORD);
Review comment:
I see. I'm not an expert this area, so just asked. Thanks! Please add `// NOI18N` to `private static final String RECORD = "RECORD";`
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
[GitHub] [netbeans] singh-akhilesh commented on a change in pull request #2301: [NETBEANS-4681] Fixed issue : refactor record rename & move record file to other package
Posted by GitBox <gi...@apache.org>.
singh-akhilesh commented on a change in pull request #2301:
URL: https://github.com/apache/netbeans/pull/2301#discussion_r469737731
##########
File path: java/refactoring.java/src/org/netbeans/modules/refactoring/java/ui/UIUtilities.java
##########
@@ -57,14 +57,22 @@
// XXX: Remove "test_" when #211651 is fixed
private static final String TEST_JAVA_MIME_TYPE = "test_text/x-java"; // NOI18N
+ private static final String RECORD = "RECORD";
/**
* Element.Kind values allowed to be used when calling ElementHandle.create
*
* @see javax.lang.model.element.ElementKind
* @see org.netbeans.api.java.source.ElementHandle
*/
public static EnumSet allowedElementKinds = EnumSet.of(ElementKind.PACKAGE, ElementKind.CLASS, ElementKind.INTERFACE, ElementKind.ENUM, ElementKind.ANNOTATION_TYPE, ElementKind.METHOD, ElementKind.CONSTRUCTOR, ElementKind.INSTANCE_INIT, ElementKind.STATIC_INIT, ElementKind.FIELD, ElementKind.ENUM_CONSTANT, ElementKind.TYPE_PARAMETER);
-
+ static {
+ ElementKind recKind = null;
+ try {
+ recKind = ElementKind.valueOf(RECORD);
Review comment:
Ok, will add.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
[GitHub] [netbeans] singh-akhilesh commented on a change in pull request #2301: [NETBEANS-4681] Fixed issue : refactor record rename & move record file to other package
Posted by GitBox <gi...@apache.org>.
singh-akhilesh commented on a change in pull request #2301:
URL: https://github.com/apache/netbeans/pull/2301#discussion_r469718068
##########
File path: java/java.source.base/src/org/netbeans/api/java/source/TreeUtilities.java
##########
@@ -124,7 +125,14 @@
* @since 0.67
*/
public static final Set<Kind> CLASS_TREE_KINDS = EnumSet.of(Kind.ANNOTATION_TYPE, Kind.CLASS, Kind.ENUM, Kind.INTERFACE);
-
+ static {
+ Kind recKind = null;
+ try {
+ recKind = Kind.valueOf(TreeShims.RECORD); //NOI18N
Review comment:
comments addressed
##########
File path: java/refactoring.java/src/org/netbeans/modules/refactoring/java/ui/UIUtilities.java
##########
@@ -64,7 +64,14 @@
* @see org.netbeans.api.java.source.ElementHandle
*/
public static EnumSet allowedElementKinds = EnumSet.of(ElementKind.PACKAGE, ElementKind.CLASS, ElementKind.INTERFACE, ElementKind.ENUM, ElementKind.ANNOTATION_TYPE, ElementKind.METHOD, ElementKind.CONSTRUCTOR, ElementKind.INSTANCE_INIT, ElementKind.STATIC_INIT, ElementKind.FIELD, ElementKind.ENUM_CONSTANT, ElementKind.TYPE_PARAMETER);
-
+ static {
+ ElementKind recKind = null;
+ try {
+ recKind = ElementKind.valueOf("RECORD"); //NOI18N
Review comment:
comments addressed
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
[GitHub] [netbeans] junichi11 commented on a change in pull request #2301: [NETBEANS-4681] Fixed issue : refactor record rename & move record file to other package
Posted by GitBox <gi...@apache.org>.
junichi11 commented on a change in pull request #2301:
URL: https://github.com/apache/netbeans/pull/2301#discussion_r469727791
##########
File path: java/refactoring.java/src/org/netbeans/modules/refactoring/java/ui/MoveClassUI.java
##########
@@ -305,7 +305,10 @@ public RefactoringUI create(CompilationInfo info, TreePathHandle[] handles, File
Collection<TreePathHandle> tphs = new ArrayList<TreePathHandle>();
SourcePositions sourcePositions = info.getTrees().getSourcePositions();
for (Element ele : e.getEnclosedElements()) {
- Tree leaf = info.getTrees().getPath(ele).getLeaf();
+ TreePath path = info.getTrees().getPath(ele);
+ if(path == null)
Review comment:
Please use curly braces (`{}`) and reformat your changes (select lines > format) (missing white space after `if`)
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
[GitHub] [netbeans] singh-akhilesh commented on a change in pull request #2301: [NETBEANS-4681] Fixed issue : refactor record rename & move record file to other package
Posted by GitBox <gi...@apache.org>.
singh-akhilesh commented on a change in pull request #2301:
URL: https://github.com/apache/netbeans/pull/2301#discussion_r469782582
##########
File path: java/refactoring.java/src/org/netbeans/modules/refactoring/java/ui/UIUtilities.java
##########
@@ -57,14 +57,22 @@
// XXX: Remove "test_" when #211651 is fixed
private static final String TEST_JAVA_MIME_TYPE = "test_text/x-java"; // NOI18N
+ private static final String RECORD = "RECORD";
/**
* Element.Kind values allowed to be used when calling ElementHandle.create
*
* @see javax.lang.model.element.ElementKind
* @see org.netbeans.api.java.source.ElementHandle
*/
public static EnumSet allowedElementKinds = EnumSet.of(ElementKind.PACKAGE, ElementKind.CLASS, ElementKind.INTERFACE, ElementKind.ENUM, ElementKind.ANNOTATION_TYPE, ElementKind.METHOD, ElementKind.CONSTRUCTOR, ElementKind.INSTANCE_INIT, ElementKind.STATIC_INIT, ElementKind.FIELD, ElementKind.ENUM_CONSTANT, ElementKind.TYPE_PARAMETER);
-
+ static {
+ ElementKind recKind = null;
+ try {
+ recKind = ElementKind.valueOf(RECORD);
Review comment:
There is some issue in this PR. Created another PR https://github.com/apache/netbeans/pull/2310 and addressed all the review comments. Please verify.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
[GitHub] [netbeans] singh-akhilesh closed pull request #2301: [NETBEANS-4681] Fixed issue : refactor record rename & move record file to other package
Posted by GitBox <gi...@apache.org>.
singh-akhilesh closed pull request #2301:
URL: https://github.com/apache/netbeans/pull/2301
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
[GitHub] [netbeans] singh-akhilesh commented on a change in pull request #2301: [NETBEANS-4681] Fixed issue : refactor record rename & move record file to other package
Posted by GitBox <gi...@apache.org>.
singh-akhilesh commented on a change in pull request #2301:
URL: https://github.com/apache/netbeans/pull/2301#discussion_r469810845
##########
File path: java/refactoring.java/src/org/netbeans/modules/refactoring/java/ui/MoveClassUI.java
##########
@@ -305,7 +305,10 @@ public RefactoringUI create(CompilationInfo info, TreePathHandle[] handles, File
Collection<TreePathHandle> tphs = new ArrayList<TreePathHandle>();
SourcePositions sourcePositions = info.getTrees().getSourcePositions();
for (Element ele : e.getEnclosedElements()) {
- Tree leaf = info.getTrees().getPath(ele).getLeaf();
+ TreePath path = info.getTrees().getPath(ele);
+ if(path == null)
Review comment:
comment addressed
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
[GitHub] [netbeans] arusinha commented on a change in pull request #2301: [NETBEANS-4681] Fixed issue : refactor record rename & move record file to other package
Posted by GitBox <gi...@apache.org>.
arusinha commented on a change in pull request #2301:
URL: https://github.com/apache/netbeans/pull/2301#discussion_r469701596
##########
File path: java/refactoring.java/src/org/netbeans/modules/refactoring/java/ui/UIUtilities.java
##########
@@ -64,7 +64,14 @@
* @see org.netbeans.api.java.source.ElementHandle
*/
public static EnumSet allowedElementKinds = EnumSet.of(ElementKind.PACKAGE, ElementKind.CLASS, ElementKind.INTERFACE, ElementKind.ENUM, ElementKind.ANNOTATION_TYPE, ElementKind.METHOD, ElementKind.CONSTRUCTOR, ElementKind.INSTANCE_INIT, ElementKind.STATIC_INIT, ElementKind.FIELD, ElementKind.ENUM_CONSTANT, ElementKind.TYPE_PARAMETER);
-
+ static {
+ ElementKind recKind = null;
+ try {
+ recKind = ElementKind.valueOf("RECORD"); //NOI18N
Review comment:
Plz use Constant
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
[GitHub] [netbeans] junichi11 commented on a change in pull request #2301: [NETBEANS-4681] Fixed issue : refactor record rename & move record file to other package
Posted by GitBox <gi...@apache.org>.
junichi11 commented on a change in pull request #2301:
URL: https://github.com/apache/netbeans/pull/2301#discussion_r469731137
##########
File path: java/refactoring.java/src/org/netbeans/modules/refactoring/java/ui/UIUtilities.java
##########
@@ -57,14 +57,22 @@
// XXX: Remove "test_" when #211651 is fixed
private static final String TEST_JAVA_MIME_TYPE = "test_text/x-java"; // NOI18N
+ private static final String RECORD = "RECORD";
/**
* Element.Kind values allowed to be used when calling ElementHandle.create
*
* @see javax.lang.model.element.ElementKind
* @see org.netbeans.api.java.source.ElementHandle
*/
public static EnumSet allowedElementKinds = EnumSet.of(ElementKind.PACKAGE, ElementKind.CLASS, ElementKind.INTERFACE, ElementKind.ENUM, ElementKind.ANNOTATION_TYPE, ElementKind.METHOD, ElementKind.CONSTRUCTOR, ElementKind.INSTANCE_INIT, ElementKind.STATIC_INIT, ElementKind.FIELD, ElementKind.ENUM_CONSTANT, ElementKind.TYPE_PARAMETER);
-
+ static {
+ ElementKind recKind = null;
+ try {
+ recKind = ElementKind.valueOf(RECORD);
Review comment:
You are using `TreeShims.RECORD` in the `java/java.source.base/src/org/netbeans/api/java/source/TreeUtilities.java`. Can't be it used?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
[GitHub] [netbeans] singh-akhilesh commented on a change in pull request #2301: [NETBEANS-4681] Fixed issue : refactor record rename & move record file to other package
Posted by GitBox <gi...@apache.org>.
singh-akhilesh commented on a change in pull request #2301:
URL: https://github.com/apache/netbeans/pull/2301#discussion_r469735729
##########
File path: java/refactoring.java/src/org/netbeans/modules/refactoring/java/ui/UIUtilities.java
##########
@@ -57,14 +57,22 @@
// XXX: Remove "test_" when #211651 is fixed
private static final String TEST_JAVA_MIME_TYPE = "test_text/x-java"; // NOI18N
+ private static final String RECORD = "RECORD";
/**
* Element.Kind values allowed to be used when calling ElementHandle.create
*
* @see javax.lang.model.element.ElementKind
* @see org.netbeans.api.java.source.ElementHandle
*/
public static EnumSet allowedElementKinds = EnumSet.of(ElementKind.PACKAGE, ElementKind.CLASS, ElementKind.INTERFACE, ElementKind.ENUM, ElementKind.ANNOTATION_TYPE, ElementKind.METHOD, ElementKind.CONSTRUCTOR, ElementKind.INSTANCE_INIT, ElementKind.STATIC_INIT, ElementKind.FIELD, ElementKind.ENUM_CONSTANT, ElementKind.TYPE_PARAMETER);
-
+ static {
+ ElementKind recKind = null;
+ try {
+ recKind = ElementKind.valueOf(RECORD);
Review comment:
Treshims is not currently supported in java.refactoring module and to support this TreeShimCopiler class need to be modified. So instead of adding dependency on that class for the TreeShims.ROCORD had created the constant locally.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
[GitHub] [netbeans] singh-akhilesh commented on pull request #2301: [NETBEANS-4681] Fixed issue : refactor record rename & move record file to other package
Posted by GitBox <gi...@apache.org>.
singh-akhilesh commented on pull request #2301:
URL: https://github.com/apache/netbeans/pull/2301#issuecomment-673362272
Closing this PR due to issues during squashing. New Linked PR https://github.com/apache/netbeans/pull/2310
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
[GitHub] [netbeans] junichi11 commented on a change in pull request #2301: [NETBEANS-4681] Fixed issue : refactor record rename & move record file to other package
Posted by GitBox <gi...@apache.org>.
junichi11 commented on a change in pull request #2301:
URL: https://github.com/apache/netbeans/pull/2301#discussion_r469736959
##########
File path: java/refactoring.java/src/org/netbeans/modules/refactoring/java/ui/UIUtilities.java
##########
@@ -57,14 +57,22 @@
// XXX: Remove "test_" when #211651 is fixed
private static final String TEST_JAVA_MIME_TYPE = "test_text/x-java"; // NOI18N
+ private static final String RECORD = "RECORD";
/**
* Element.Kind values allowed to be used when calling ElementHandle.create
*
* @see javax.lang.model.element.ElementKind
* @see org.netbeans.api.java.source.ElementHandle
*/
public static EnumSet allowedElementKinds = EnumSet.of(ElementKind.PACKAGE, ElementKind.CLASS, ElementKind.INTERFACE, ElementKind.ENUM, ElementKind.ANNOTATION_TYPE, ElementKind.METHOD, ElementKind.CONSTRUCTOR, ElementKind.INSTANCE_INIT, ElementKind.STATIC_INIT, ElementKind.FIELD, ElementKind.ENUM_CONSTANT, ElementKind.TYPE_PARAMETER);
-
+ static {
+ ElementKind recKind = null;
+ try {
+ recKind = ElementKind.valueOf(RECORD);
Review comment:
I see. I'm not an expert of this area, so just asked. Thanks! Please add `// NOI18N` to `private static final String RECORD = "RECORD";`
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
[GitHub] [netbeans] arusinha commented on a change in pull request #2301: [NETBEANS-4681] Fixed issue : refactor record rename & move record file to other package
Posted by GitBox <gi...@apache.org>.
arusinha commented on a change in pull request #2301:
URL: https://github.com/apache/netbeans/pull/2301#discussion_r469701596
##########
File path: java/refactoring.java/src/org/netbeans/modules/refactoring/java/ui/UIUtilities.java
##########
@@ -64,7 +64,14 @@
* @see org.netbeans.api.java.source.ElementHandle
*/
public static EnumSet allowedElementKinds = EnumSet.of(ElementKind.PACKAGE, ElementKind.CLASS, ElementKind.INTERFACE, ElementKind.ENUM, ElementKind.ANNOTATION_TYPE, ElementKind.METHOD, ElementKind.CONSTRUCTOR, ElementKind.INSTANCE_INIT, ElementKind.STATIC_INIT, ElementKind.FIELD, ElementKind.ENUM_CONSTANT, ElementKind.TYPE_PARAMETER);
-
+ static {
+ ElementKind recKind = null;
+ try {
+ recKind = ElementKind.valueOf("RECORD"); //NOI18N
Review comment:
Plz use TreeShims.RECORD
##########
File path: java/java.source.base/src/org/netbeans/api/java/source/TreeUtilities.java
##########
@@ -124,7 +125,14 @@
* @since 0.67
*/
public static final Set<Kind> CLASS_TREE_KINDS = EnumSet.of(Kind.ANNOTATION_TYPE, Kind.CLASS, Kind.ENUM, Kind.INTERFACE);
-
+ static {
+ Kind recKind = null;
+ try {
+ recKind = Kind.valueOf(TreeShims.RECORD); //NOI18N
Review comment:
plz remove //NOI18N
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists