cayenne-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aadamc...@apache.org
Subject [1/4] cayenne git commit: java 7 style, diamond operator
Date Sun, 18 Dec 2016 19:07:29 GMT
Repository: cayenne
Updated Branches:
  refs/heads/master 9319337c6 -> cee0b77d8


http://git-wip-us.apache.org/repos/asf/cayenne/blob/cee0b77d/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/action/LinkDataMapAction.java
----------------------------------------------------------------------
diff --git a/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/action/LinkDataMapAction.java
b/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/action/LinkDataMapAction.java
index e9d3ddf..bd5e0ce 100644
--- a/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/action/LinkDataMapAction.java
+++ b/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/action/LinkDataMapAction.java
@@ -58,7 +58,7 @@ public class LinkDataMapAction extends CayenneAction {
 
         ProjectController mediator = getProjectController();
         DataChannelDescriptor dataChannelDescriptor = (DataChannelDescriptor) mediator.getProject().getRootNode();
-        Collection<DataNodeDescriptor> unlinkedNodes = new ArrayList<DataNodeDescriptor>();
+        Collection<DataNodeDescriptor> unlinkedNodes = new ArrayList<>();
 
         // unlink map from any nodes
         // Theoretically only one node may contain a datamap at each given time.

http://git-wip-us.apache.org/repos/asf/cayenne/blob/cee0b77d/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/action/LinkDataMapsAction.java
----------------------------------------------------------------------
diff --git a/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/action/LinkDataMapsAction.java
b/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/action/LinkDataMapsAction.java
index 79296a9..fef2f8e 100644
--- a/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/action/LinkDataMapsAction.java
+++ b/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/action/LinkDataMapsAction.java
@@ -56,7 +56,7 @@ public class LinkDataMapsAction extends CayenneAction {
         ProjectController mediator = getProjectController();
         DataChannelDescriptor dataChannelDescriptor = (DataChannelDescriptor) mediator.getProject().getRootNode();
 
-        Collection<String> linkedDataMaps = new ArrayList<String>();
+        Collection<String> linkedDataMaps = new ArrayList<>();
         DataNodeDescriptor dataNodeDescriptor = mediator.getCurrentDataNode();
         for (DataNodeDescriptor dataNodeDesc : dataChannelDescriptor.getNodeDescriptors())
{
             linkedDataMaps.addAll(dataNodeDesc.getDataMapNames());

http://git-wip-us.apache.org/repos/asf/cayenne/blob/cee0b77d/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/autorelationship/InferRelationshipsControllerBase.java
----------------------------------------------------------------------
diff --git a/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/autorelationship/InferRelationshipsControllerBase.java
b/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/autorelationship/InferRelationshipsControllerBase.java
index fe92faf..fd7f59b 100644
--- a/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/autorelationship/InferRelationshipsControllerBase.java
+++ b/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/autorelationship/InferRelationshipsControllerBase.java
@@ -222,8 +222,7 @@ public class InferRelationshipsControllerBase extends CayenneController
{
     }
 
     public List<InferredRelationship> getSelectedEntities() {
-        List<InferredRelationship> selected = new ArrayList<InferredRelationship>(
-                selectedEntities.size());
+        List<InferredRelationship> selected = new ArrayList<>(selectedEntities.size());
 
         for (InferredRelationship entity : inferredRelationships) {
             if (selectedEntities.contains(entity)) {

http://git-wip-us.apache.org/repos/asf/cayenne/blob/cee0b77d/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/codegen/CodeGeneratorControllerBase.java
----------------------------------------------------------------------
diff --git a/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/codegen/CodeGeneratorControllerBase.java
b/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/codegen/CodeGeneratorControllerBase.java
index 7f57a36..ad8c306 100644
--- a/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/codegen/CodeGeneratorControllerBase.java
+++ b/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/codegen/CodeGeneratorControllerBase.java
@@ -143,7 +143,7 @@ public abstract class CodeGeneratorControllerBase extends CayenneController
{
 
     public List<Embeddable> getSelectedEmbeddables() {
 
-        List<Embeddable> selected = new ArrayList<Embeddable>(selectedEmbeddables.size());
+        List<Embeddable> selected = new ArrayList<>(selectedEmbeddables.size());
 
         for (Object classObj : classes) {
             if (classObj instanceof Embeddable
@@ -157,7 +157,7 @@ public abstract class CodeGeneratorControllerBase extends CayenneController
{
     }
 
     public List<ObjEntity> getSelectedEntities() {
-        List<ObjEntity> selected = new ArrayList<ObjEntity>(selectedEntities.size());
+        List<ObjEntity> selected = new ArrayList<>(selectedEntities.size());
         for (Object classObj : classes) {
             if (classObj instanceof ObjEntity
                     && selectedEntities.contains(((ObjEntity) classObj).getName()))
{

http://git-wip-us.apache.org/repos/asf/cayenne/blob/cee0b77d/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/codegen/CustomModeController.java
----------------------------------------------------------------------
diff --git a/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/codegen/CustomModeController.java
b/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/codegen/CustomModeController.java
index 88781f6..0250f9c 100644
--- a/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/codegen/CustomModeController.java
+++ b/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/codegen/CustomModeController.java
@@ -19,7 +19,17 @@
 
 package org.apache.cayenne.modeler.dialog.codegen;
 
-import java.awt.Component;
+import org.apache.cayenne.gen.ClassGenerationAction;
+import org.apache.cayenne.map.DataMap;
+import org.apache.cayenne.modeler.CodeTemplateManager;
+import org.apache.cayenne.modeler.dialog.pref.PreferenceDialog;
+import org.apache.cayenne.modeler.pref.DataMapDefaults;
+import org.apache.cayenne.swing.BindingBuilder;
+import org.apache.cayenne.swing.ObjectBinding;
+import org.apache.cayenne.util.Util;
+
+import javax.swing.*;
+import java.awt.*;
 import java.util.ArrayList;
 import java.util.Collection;
 import java.util.Collections;
@@ -30,17 +40,6 @@ import java.util.Map.Entry;
 import java.util.Set;
 import java.util.TreeMap;
 
-import javax.swing.DefaultComboBoxModel;
-
-import org.apache.cayenne.gen.ClassGenerationAction;
-import org.apache.cayenne.map.DataMap;
-import org.apache.cayenne.modeler.CodeTemplateManager;
-import org.apache.cayenne.modeler.dialog.pref.PreferenceDialog;
-import org.apache.cayenne.modeler.pref.DataMapDefaults;
-import org.apache.cayenne.swing.BindingBuilder;
-import org.apache.cayenne.swing.ObjectBinding;
-import org.apache.cayenne.util.Util;
-
 /**
  * A controller for the custom generation mode.
  */
@@ -188,14 +187,14 @@ public class CustomModeController extends GeneratorController {
 	protected void updateTemplates() {
 		this.templateManager = getApplication().getCodeTemplateManager();
 
-		List<String> customTemplates = new ArrayList<String>(templateManager.getCustomTemplates().keySet());
+		List<String> customTemplates = new ArrayList<>(templateManager.getCustomTemplates().keySet());
 		Collections.sort(customTemplates);
 
-		List<String> superTemplates = new ArrayList<String>(templateManager.getStandardSuperclassTemplates());
+		List<String> superTemplates = new ArrayList<>(templateManager.getStandardSuperclassTemplates());
 		Collections.sort(superTemplates);
 		superTemplates.addAll(customTemplates);
 
-		List<String> subTemplates = new ArrayList<String>(templateManager.getStandardSubclassTemplates());
+		List<String> subTemplates = new ArrayList<>(templateManager.getStandardSubclassTemplates());
 		Collections.sort(subTemplates);
 		subTemplates.addAll(customTemplates);
 

http://git-wip-us.apache.org/repos/asf/cayenne/blob/cee0b77d/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/codegen/GeneratorController.java
----------------------------------------------------------------------
diff --git a/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/codegen/GeneratorController.java
b/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/codegen/GeneratorController.java
index 0df2a1d..6cf1b31 100644
--- a/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/codegen/GeneratorController.java
+++ b/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/codegen/GeneratorController.java
@@ -158,7 +158,7 @@ public abstract class GeneratorController extends CayenneController {
         }
 
         // remove generic entities...
-        Collection<ObjEntity> selectedEntities = new ArrayList<ObjEntity>(getParentController().getSelectedEntities());
+        Collection<ObjEntity> selectedEntities = new ArrayList<>(getParentController().getSelectedEntities());
         Iterator<ObjEntity> it = selectedEntities.iterator();
         while (it.hasNext()) {
             if (it.next().isGeneric()) {
@@ -166,18 +166,18 @@ public abstract class GeneratorController extends CayenneController
{
             }
         }
 
-        Collection<ClassGenerationAction> generators = new ArrayList<ClassGenerationAction>();
+        Collection<ClassGenerationAction> generators = new ArrayList<>();
         Collection<StandardPanelComponent> dataMapLines = ((GeneratorControllerPanel)
getView()).getDataMapLines();
         for (DataMap map : getParentController().getDataMaps()) {
             ClassGenerationAction generator = newGenerator();
             generator.setArtifactsGenerationMode(mode);
             generator.setDataMap(map);
 
-            LinkedList<ObjEntity> objEntities = new LinkedList<ObjEntity>(map.getObjEntities());
+            LinkedList<ObjEntity> objEntities = new LinkedList<>(map.getObjEntities());
             objEntities.retainAll(selectedEntities);
             generator.addEntities(objEntities);
 
-            LinkedList<Embeddable> embeddables = new LinkedList<Embeddable>(map.getEmbeddables());
+            LinkedList<Embeddable> embeddables = new LinkedList<>(map.getEmbeddables());
             embeddables.retainAll(getParentController().getSelectedEmbeddables());
             generator.addEmbeddables(embeddables);
 

http://git-wip-us.apache.org/repos/asf/cayenne/blob/cee0b77d/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/codegen/GeneratorControllerPanel.java
----------------------------------------------------------------------
diff --git a/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/codegen/GeneratorControllerPanel.java
b/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/codegen/GeneratorControllerPanel.java
index 5e5340b..bb02345 100644
--- a/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/codegen/GeneratorControllerPanel.java
+++ b/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/codegen/GeneratorControllerPanel.java
@@ -36,7 +36,7 @@ public class GeneratorControllerPanel extends JPanel {
     protected JButton selectOutputFolder;
 
     public GeneratorControllerPanel() {
-        this.dataMapLines = new ArrayList<StandardPanelComponent>();
+        this.dataMapLines = new ArrayList<>();
         this.outputFolder = new JTextField();
         this.selectOutputFolder = new JButton("Select");
     }

http://git-wip-us.apache.org/repos/asf/cayenne/blob/cee0b77d/modeler/cayenne-wocompat/src/main/java/org/apache/cayenne/wocompat/EOModelProcessor.java
----------------------------------------------------------------------
diff --git a/modeler/cayenne-wocompat/src/main/java/org/apache/cayenne/wocompat/EOModelProcessor.java
b/modeler/cayenne-wocompat/src/main/java/org/apache/cayenne/wocompat/EOModelProcessor.java
index f3d858d..64eabd9 100644
--- a/modeler/cayenne-wocompat/src/main/java/org/apache/cayenne/wocompat/EOModelProcessor.java
+++ b/modeler/cayenne-wocompat/src/main/java/org/apache/cayenne/wocompat/EOModelProcessor.java
@@ -721,7 +721,7 @@ public class EOModelProcessor {
 		// iterate over a copy of the collection, since in case of
 		// reflexive relationships, we may modify source entity relationship map
 
-		for (DbRelationship relationship : new ArrayList<DbRelationship>(dbEntity.getRelationships()))
{
+		for (DbRelationship relationship : new ArrayList<>(dbEntity.getRelationships()))
{
 
 			if (relationship.getReverseRelationship() == null) {
 				DbRelationship reverse = relationship.createReverseRelationship();

http://git-wip-us.apache.org/repos/asf/cayenne/blob/cee0b77d/modeler/cayenne-wocompat/src/main/java/org/apache/cayenne/wocompat/EOQuery.java
----------------------------------------------------------------------
diff --git a/modeler/cayenne-wocompat/src/main/java/org/apache/cayenne/wocompat/EOQuery.java
b/modeler/cayenne-wocompat/src/main/java/org/apache/cayenne/wocompat/EOQuery.java
index 8400686..b37d10c 100644
--- a/modeler/cayenne-wocompat/src/main/java/org/apache/cayenne/wocompat/EOQuery.java
+++ b/modeler/cayenne-wocompat/src/main/java/org/apache/cayenne/wocompat/EOQuery.java
@@ -402,7 +402,7 @@ public class EOQuery<T> extends SelectQuery<T> {
 					// get the list of children
 					List children = (List) qualifierMap.get("qualifiers");
 					if (children != null) {
-						ArrayList<Expression> childExpressions = new ArrayList<Expression>();
+						ArrayList<Expression> childExpressions = new ArrayList<>();
 						// build an Expression for each child
 						Iterator<Map> it = children.iterator();
 						while (it.hasNext()) {

http://git-wip-us.apache.org/repos/asf/cayenne/blob/cee0b77d/modeler/cayenne-wocompat/src/main/java/org/apache/cayenne/wocompat/parser/DefaultPlistDataStructureFactory.java
----------------------------------------------------------------------
diff --git a/modeler/cayenne-wocompat/src/main/java/org/apache/cayenne/wocompat/parser/DefaultPlistDataStructureFactory.java
b/modeler/cayenne-wocompat/src/main/java/org/apache/cayenne/wocompat/parser/DefaultPlistDataStructureFactory.java
index a035fad..40ba352 100644
--- a/modeler/cayenne-wocompat/src/main/java/org/apache/cayenne/wocompat/parser/DefaultPlistDataStructureFactory.java
+++ b/modeler/cayenne-wocompat/src/main/java/org/apache/cayenne/wocompat/parser/DefaultPlistDataStructureFactory.java
@@ -19,18 +19,18 @@
 
 package org.apache.cayenne.wocompat.parser;
 
+import org.apache.cayenne.wocompat.PlistDataStructureFactory;
+
 import java.util.ArrayList;
 import java.util.Collection;
 import java.util.HashMap;
 import java.util.Map;
 
-import org.apache.cayenne.wocompat.PlistDataStructureFactory;
-
 class DefaultPlistDataStructureFactory implements PlistDataStructureFactory {
 
 	@Override
 	public Collection<Object> createCollection(String keyPath) {
-		return new ArrayList<Object>();
+		return new ArrayList<>();
 	}
 
 	@Override


Mime
View raw message