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 2019/08/14 05:19:51 UTC
[GitHub] [netbeans] tmysik commented on a change in pull request #1423:
[NETBEANS-53] Improve constructor getter setter code generation
tmysik commented on a change in pull request #1423: [NETBEANS-53] Improve constructor getter setter code generation
URL: https://github.com/apache/netbeans/pull/1423#discussion_r313706961
##########
File path: php/php.editor/src/org/netbeans/modules/php/editor/codegen/CGSInfo.java
##########
@@ -346,6 +354,24 @@ public void visit(FieldsDeclaration node) {
}
}
+ private String getPropertyType(FieldsDeclaration fieldsDeclaration, SingleFieldDeclaration singleFieldDeclaration) {
+ String type = ""; // NOI18N
+ if (fieldsDeclaration.getFieldType() == null || phpVersion.compareTo(PhpVersion.PHP_74) < 0) {
+ type = getPropertyType(singleFieldDeclaration);
+ } else {
+ // PHP 7.4 or newer
+ QualifiedName qualifiedName = QualifiedName.create(fieldsDeclaration.getFieldType());
+ if (qualifiedName != null) {
+ type = qualifiedName.toString();
+ if (fieldsDeclaration.getFieldType() instanceof NullableType) {
+ type = CodeUtils.NULLABLE_TYPE_PREFIX + type;
+ }
+ }
+ assert !type.isEmpty();
Review comment:
If this fails, some more information could be useful in order to fix the error (e.g. `qualifiedName` or `fieldsDeclaration` could be added?).
----------------------------------------------------------------
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
With regards,
Apache Git Services
---------------------------------------------------------------------
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