pepness commented on code in PR #5444:
URL: https://github.com/apache/netbeans/pull/5444#discussion_r1099537493


##########
java/j2ee.persistence/src/org/netbeans/modules/j2ee/persistence/wizard/EntityClosure.java:
##########
@@ -425,19 +399,9 @@ public boolean isModelReady() {
     
     void waitModelIsReady(){
         try {
-            Future result = model.runReadActionWhenReady(new 
MetadataModelAction<EntityMappingsMetadata, Boolean>() {
-
-                @Override
-                public Boolean run(EntityMappingsMetadata metadata) throws 
Exception {
-                    return true;
-                }
-            });
+            Future result = model.runReadActionWhenReady( 
(EntityMappingsMetadata metadata) -> true );
             result.get();
-        } catch (InterruptedException ex) {
-            Exceptions.printStackTrace(ex);
-        } catch (ExecutionException ex) {
-            Exceptions.printStackTrace(ex);
-        } catch (MetadataModelException ex) {
+        } catch (InterruptedException | ExecutionException | 
MetadataModelException ex) {
             Exceptions.printStackTrace(ex);
         } catch (IOException ex) {

Review Comment:
   Done.



##########
java/j2ee.persistence/src/org/netbeans/modules/j2ee/persistence/unit/PUDataObject.java:
##########
@@ -174,21 +174,15 @@ public boolean parseDocument() {
         } else if (isModified()){//if it's isn't modified and persistenc 
eexits (parsed) no need to reparse
             try{
                 String oldVersion = persistence.getVersion();
-                java.io.InputStream is = getEditorSupport().getInputStream();
                 String version=Persistence.VERSION_1_0;
-                try {
+                try (java.io.InputStream is = 
getEditorSupport().getInputStream()) {

Review Comment:
   Done.



##########
java/j2ee.persistence/src/org/netbeans/modules/j2ee/persistence/spi/jpql/support/JPAAttribute.java:
##########
@@ -143,55 +143,69 @@ public Class<?> getClass1() {
     }
     
     private void buildType(){
-            TypeMirror tm = null;
-            VariableElement var = Utils.getField(parent.getTypeElement(), 
name);
-            if(var == null){
-                ExecutableElement acc = 
Utils.getAccesor(parent.getTypeElement(), name);
-                if(acc != null){
-                    tm = acc.getReturnType();
-                }
-            } else {
-                tm = var.asType();
+        TypeMirror tm = null;
+        VariableElement var = Utils.getField(parent.getTypeElement(), name);
+        if(var == null){
+            ExecutableElement acc = Utils.getAccesor(parent.getTypeElement(), 
name);
+            if(acc != null){
+                tm = acc.getReturnType();
             }
-            if( tm!=null ){
-                if(tm.getKind() == TypeKind.DECLARED){
-                    DeclaredType declaredType = (DeclaredType) tm;
-                    if(declaredType.getTypeArguments()!=null && 
declaredType.getTypeArguments().size()>0) {//it's some generic type
-                        if(mType == IMappingType.ONE_TO_MANY || mType == 
IMappingType.MANY_TO_MANY) {//we suppose it should be for relationship mapping 
only
-                            tm = declaredType.getTypeArguments().get(0);
-                            if(tm.getKind() == TypeKind.DECLARED){
-                                declaredType = (DeclaredType) tm;
+        } else {
+            tm = var.asType();
+        }
+        if( tm != null ){
+            if(null != tm.getKind()) {

Review Comment:
   Done.



##########
java/j2ee.persistence/src/org/netbeans/modules/j2ee/persistence/provider/ProviderUtil.java:
##########
@@ -206,14 +207,14 @@ public static DatabaseConnection 
getConnection(PersistenceUnit pu) {
         return null;
     }
     /**
-     * Gets the database connection properties (irl,name,password) specified 
in the given persistence
+     * Gets the database connection properties (url,name,password) specified 
in the given persistence
      * unit.
      * 
      * @param pu the persistence unit whose database connection is to 
      * be retrieved; must not be null.
      * 
-     * @return the connection properties specified in the given persistence 
unit or
-     * <code>null</code> if it didn't specify a connectioh.
+     * @rerturn the connection properties specified in the given persistence 
unit or

Review Comment:
   Done.



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

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists

Reply via email to