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/29 09:58:57 UTC

[GitHub] [netbeans] junichi11 opened a new pull request #2335: [NETBEANS-4443] PHP 8.0 Support: Static return type

junichi11 opened a new pull request #2335:
URL: https://github.com/apache/netbeans/pull/2335


   https://issues.apache.org/jira/browse/NETBEANS-4443
   
   #### Part 1
   
   - https://wiki.php.net/rfc/static_return_type
   - Fix the `ASTPHP5Parser.cup`
   - Fix the code completion feature
   - Add unit tests for the parser and the code completion
   
   ##### PHP 8.0 (Project Properties)
   
   ![nb-php80-static-return-type](https://user-images.githubusercontent.com/738383/91634097-b9803500-ea28-11ea-9198-41c4daae4110.png)
   
   ##### PHP 7.4 (Project Properties)
   
   ![nb-php80-static-return-type-php74](https://user-images.githubusercontent.com/738383/91634101-bd13bc00-ea28-11ea-9b49-ba95c4a402f9.png)
   
   #### Part 2
   
   - Fix `IntroduceSuggestion` and `PHP80UnhandledError`
   - Fix `UnusableTypesUnhandledError` (Error for redundant combination with the object type)
   - Add unit tests for override/implement method, formatting, and the comment generator features
   
   ###### Error for redundant combination with the object type
   
   ![nb-php80-static-return-type-redundant-with-object-type](https://user-images.githubusercontent.com/738383/91634167-3e6b4e80-ea29-11ea-968d-3ab8e54fde3e.png)
   


----------------------------------------------------------------
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] tmysik merged pull request #2335: [NETBEANS-4443] PHP 8.0 Support: Static return type

Posted by GitBox <gi...@apache.org>.
tmysik merged pull request #2335:
URL: https://github.com/apache/netbeans/pull/2335


   


----------------------------------------------------------------
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 pull request #2335: [NETBEANS-4443] PHP 8.0 Support: Static return type

Posted by GitBox <gi...@apache.org>.
junichi11 commented on pull request #2335:
URL: https://github.com/apache/netbeans/pull/2335#issuecomment-683347708


   @matthiasblaesing 
   
   > Is this problem still reproducible for you?
   
   Yes. (I can load the file via a browser.) I tried testing them in my PC because Travis CI failed (reran the job twice)... They also seem to fail in other PRs. I was not sure whether this is a problem temporarily. So, I just asked... I think also it's better if we can keep it. Thanks.


----------------------------------------------------------------
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 edited a comment on pull request #2335: [NETBEANS-4443] PHP 8.0 Support: Static return type

Posted by GitBox <gi...@apache.org>.
junichi11 edited a comment on pull request #2335:
URL: https://github.com/apache/netbeans/pull/2335#issuecomment-683351020


   @matthiasblaesing As a workaround: Add "User-Agent" to `URLConnection`? 
   
   e.g. no failures with the following
   ```java
               URLConnection connection = source.openConnection();
               connection.addRequestProperty("User-Agent", "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.103 Safari/537.36");
               try(InputStream is = connection.getInputStream();
   ```


----------------------------------------------------------------
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] tmysik commented on pull request #2335: [NETBEANS-4443] PHP 8.0 Support: Static return type

Posted by GitBox <gi...@apache.org>.
tmysik commented on pull request #2335:
URL: https://github.com/apache/netbeans/pull/2335#issuecomment-684857421


   Looks good to me (again, huge patch so impossible to review properly but - we have tests, they pass so OK for me).
   


----------------------------------------------------------------
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 pull request #2335: [NETBEANS-4443] PHP 8.0 Support: Static return type

Posted by GitBox <gi...@apache.org>.
junichi11 commented on pull request #2335:
URL: https://github.com/apache/netbeans/pull/2335#issuecomment-683407612


   @matthiasblaesing I'll leave it to you :) If you would not like to do it, I'll do it. Thanks!


----------------------------------------------------------------
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] tmysik commented on a change in pull request #2335: [NETBEANS-4443] PHP 8.0 Support: Static return type

Posted by GitBox <gi...@apache.org>.
tmysik commented on a change in pull request #2335:
URL: https://github.com/apache/netbeans/pull/2335#discussion_r481139262



##########
File path: php/php.editor/src/org/netbeans/modules/php/editor/verification/UnusableTypesUnhandledError.java
##########
@@ -229,6 +258,16 @@ private void checkReturnType(@NullAllowed Expression returnType, boolean isInUni
             } else if (type instanceof UnionType) {
                 ((UnionType) type).getTypes().forEach(unionType -> checkReturnType(unionType, true));
                 checkUnionType((UnionType) type);
+            } else if (type instanceof Identifier) {
+                // method, labmda funciton, and arrow function can use static return type

Review comment:
       Nitpick: Typos, "la[b]mda func[i]ton".
   




----------------------------------------------------------------
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 pull request #2335: [NETBEANS-4443] PHP 8.0 Support: Static return type

Posted by GitBox <gi...@apache.org>.
junichi11 commented on pull request #2335:
URL: https://github.com/apache/netbeans/pull/2335#issuecomment-685189681


   Yes, it's impossible. Thank you!


----------------------------------------------------------------
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 pull request #2335: [NETBEANS-4443] PHP 8.0 Support: Static return type

Posted by GitBox <gi...@apache.org>.
junichi11 commented on pull request #2335:
URL: https://github.com/apache/netbeans/pull/2335#issuecomment-683351020


   @matthiasblaesing As a workaround: Add "User-Agent" to `URLConnection`? 


----------------------------------------------------------------
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 #2335: [NETBEANS-4443] PHP 8.0 Support: Static return type

Posted by GitBox <gi...@apache.org>.
junichi11 commented on a change in pull request #2335:
URL: https://github.com/apache/netbeans/pull/2335#discussion_r481490612



##########
File path: php/php.editor/src/org/netbeans/modules/php/editor/verification/UnusableTypesUnhandledError.java
##########
@@ -229,6 +258,16 @@ private void checkReturnType(@NullAllowed Expression returnType, boolean isInUni
             } else if (type instanceof UnionType) {
                 ((UnionType) type).getTypes().forEach(unionType -> checkReturnType(unionType, true));
                 checkUnionType((UnionType) type);
+            } else if (type instanceof Identifier) {
+                // method, labmda funciton, and arrow function can use static return type

Review comment:
       Thanks for caching them :) Will fix them later. (Just add the `TODO` label)




----------------------------------------------------------------
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 pull request #2335: [NETBEANS-4443] PHP 8.0 Support: Static return type

Posted by GitBox <gi...@apache.org>.
junichi11 commented on pull request #2335:
URL: https://github.com/apache/netbeans/pull/2335#issuecomment-683304087


   Regarding the failure of Travis CI:
   I've tested `webcommon/javascript2.extjs/test/unit/src/org/netbeans/modules/javascript2/extjs/model/JsStructureTest.java` and `ExtModelTest.java` in my local PC.
   
   ```
   Testcase: testIssue230177(org.netbeans.modules.javascript2.extjs.model.JsStructureTest):	Caused an ERROR
   Server returned HTTP response code: 403 for URL: https://cdnjs.cloudflare.com/ajax/libs/extjs/4.2.1/src/class/ClassManager.js
   java.io.IOException: Server returned HTTP response code: 403 for URL: https://cdnjs.cloudflare.com/ajax/libs/extjs/4.2.1/src/class/ClassManager.js
   	at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1894)
   	at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1492)
   	at sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(HttpsURLConnectionImpl.java:263)
   ```
   ```
   Testcase: testIssue231923(org.netbeans.modules.javascript2.extjs.model.ExtModelTest):	Caused an ERROR
   Server returned HTTP response code: 403 for URL: https://cdnjs.cloudflare.com/ajax/libs/extjs/4.2.1/src/class/ClassManager.js
   java.io.IOException: Server returned HTTP response code: 403 for URL: https://cdnjs.cloudflare.com/ajax/libs/extjs/4.2.1/src/class/ClassManager.js
   	at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1894)
   	at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1492)
   	at sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(HttpsURLConnectionImpl.java:263)
   	at java.net.URL.openStream(URL.java:1045)
   	at org.netbeans.modules.javascript2.extjs.model.ExtModelTest.setUp(ExtModelTest.java:44)
   ```
   
   @matthiasblaesing should we upload the test data(ClassManager.js) to `https://netbeans.osuosl.org/binaries/` ?
   Maybe, related to this change: https://github.com/apache/netbeans/pull/1451/commits/433ba3a8bb22d8d3d608ca31807422047ff18963


----------------------------------------------------------------
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] matthiasblaesing commented on pull request #2335: [NETBEANS-4443] PHP 8.0 Support: Static return type

Posted by GitBox <gi...@apache.org>.
matthiasblaesing commented on pull request #2335:
URL: https://github.com/apache/netbeans/pull/2335#issuecomment-683328472


   @junichi11 I run the unittests from javascript2.extjs and for me they run clean (no test failures). I was also able to load the file manually. Is this problem still reproducible for you? 
   
   To be frank: In an ideal world netbeans would be hosted by an entity, that has more flexible policy than the ASF, but we live in the real world. From my POV our use of the osuosl servers already stretches policy. If we don't need to host ourselves, I'd like to keep it like that. I think it is a reasonable expectation, that maven central and cdnjs both keep up with request, as it is their only reason for living.


----------------------------------------------------------------
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] matthiasblaesing commented on pull request #2335: [NETBEANS-4443] PHP 8.0 Support: Static return type

Posted by GitBox <gi...@apache.org>.
matthiasblaesing commented on pull request #2335:
URL: https://github.com/apache/netbeans/pull/2335#issuecomment-683405510


   @junichi11 maybe we see a local test/change, that requires the setting of a users agent. Your idee sounds good and I think I saw similar problems in the past regarding missing user agent information. So if it works I think this is a good addition. One thing worth exploring is, whether a Browser User Agent string is required or if a more hones user agent:
   
   ```java
               connection.addRequestProperty("User-Agent", "NetBeans Unittesting");
   ```
   
   would also work.


----------------------------------------------------------------
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