Skip to content

Commit 0969d84

Browse files
committed
Removed unused @Inject
1 parent 47a13b7 commit 0969d84

File tree

1 file changed

+14
-11
lines changed

1 file changed

+14
-11
lines changed

src/main/java/org/jboss/forge/addon/angularjs/InspectionResultProcessor.java

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,11 @@
88

99
import static org.jboss.forge.addon.angularjs.AngularJSInspectionResultConstants.JS_IDENTIFIER;
1010
import static org.jboss.forge.addon.scaffold.metawidget.inspector.ForgeInspectionResultConstants.PRIMARY_KEY;
11-
import static org.metawidget.inspector.InspectionResultConstants.*;
11+
import static org.metawidget.inspector.InspectionResultConstants.DATETIME_TYPE;
12+
import static org.metawidget.inspector.InspectionResultConstants.LABEL;
13+
import static org.metawidget.inspector.InspectionResultConstants.LOOKUP;
14+
import static org.metawidget.inspector.InspectionResultConstants.NAME;
15+
import static org.metawidget.inspector.InspectionResultConstants.TYPE;
1216

1317
import java.io.FileNotFoundException;
1418
import java.util.ArrayList;
@@ -17,7 +21,6 @@
1721
import java.util.List;
1822
import java.util.Map;
1923

20-
import javax.inject.Inject;
2124
import javax.persistence.EmbeddedId;
2225
import javax.persistence.Id;
2326
import javax.persistence.IdClass;
@@ -50,7 +53,6 @@ public class InspectionResultProcessor
5053
private MetawidgetInspectorFacade metawidgetInspectorFacade;
5154
private Project project;
5255

53-
@Inject
5456
public InspectionResultProcessor(Project project, MetawidgetInspectorFacade metawidgetInspectorFacade)
5557
{
5658
this.project = project;
@@ -60,12 +62,12 @@ public InspectionResultProcessor(Project project, MetawidgetInspectorFacade meta
6062
public List<Map<String, String>> enhanceResults(JavaClassSource entity, List<Map<String, String>> inspectionResults)
6163
{
6264
Iterator<Map<String, String>> iterInspectionResults = inspectionResults.iterator();
63-
List<Map<String, String>> additionalPropertyAttributes = new ArrayList<Map<String, String>>();
64-
while(iterInspectionResults.hasNext())
65+
List<Map<String, String>> additionalPropertyAttributes = new ArrayList<>();
66+
while (iterInspectionResults.hasNext())
6567
{
6668
Map<String, String> propertyAttributes = iterInspectionResults.next();
6769
// FORGEPLUGINS-120 Omit references to classes having composite keys
68-
if(shouldOmitPropertyWithCompositeKey(propertyAttributes))
70+
if (shouldOmitPropertyWithCompositeKey(propertyAttributes))
6971
{
7072
iterInspectionResults.remove();
7173
continue;
@@ -122,7 +124,7 @@ private List<Map<String, String>> expandEmbeddableTypes(Map<String, String> prop
122124
String embeddedType = propertyAttributes.get(TYPE);
123125
JavaClassSource javaClass = getJavaClass(embeddedType);
124126
List<Map<String, String>> embeddedTypeInspectionResults = metawidgetInspectorFacade.inspect(javaClass);
125-
List<Map<String, String>> expandedInspectionResults = new ArrayList<Map<String, String>>();
127+
List<Map<String, String>> expandedInspectionResults = new ArrayList<>();
126128
for (Map<String, String> embeddedPropertyAttribute : embeddedTypeInspectionResults)
127129
{
128130
embeddedPropertyAttribute.put(LABEL, StringUtils.uncamelCase(embeddedPropertyAttribute.get(NAME)));
@@ -214,7 +216,8 @@ private void chooseRelationshipOptionLabels(JavaClassSource entity, Map<String,
214216
propertyAttributes.put("simpleType", rightHandSideSimpleName);
215217
JavaClassSource javaClass = getJavaClass(rightHandSideType);
216218
List<Map<String, String>> rhsInspectionResults = metawidgetInspectorFacade.inspect(javaClass);
217-
List<InspectedProperty> fieldsToDisplay = getPropertiesToDisplay(getDisplayableProperties(rhsInspectionResults));
219+
List<InspectedProperty> fieldsToDisplay = getPropertiesToDisplay(
220+
getDisplayableProperties(rhsInspectionResults));
218221
InspectedProperty defaultField = fieldsToDisplay.size() > 0 ? fieldsToDisplay.get(0) : null;
219222
InspectedProperty fieldToDisplay = defaultField;
220223
/*
@@ -229,15 +232,15 @@ private void chooseRelationshipOptionLabels(JavaClassSource entity, Map<String,
229232

230233
private List<InspectedProperty> getPropertiesToDisplay(List<Map<String, String>> displayableProperties)
231234
{
232-
List<InspectedProperty> fieldsToDisplay = new ArrayList<InspectedProperty>();
235+
List<InspectedProperty> fieldsToDisplay = new ArrayList<>();
233236
for (Map<String, String> displayableProperty : displayableProperties)
234237
{
235238
fieldsToDisplay.add(new InspectedProperty(displayableProperty));
236239
}
237240
return fieldsToDisplay;
238241
}
239242

240-
private boolean shouldOmitPropertyWithCompositeKey(Map<String,String> propertyAttributes)
243+
private boolean shouldOmitPropertyWithCompositeKey(Map<String, String> propertyAttributes)
241244
{
242245
// Extract simple type name of the relationship types
243246
boolean isManyToOneRel = Boolean.parseBoolean(propertyAttributes.get("many-to-one"));
@@ -302,7 +305,7 @@ public String toString()
302305
// TODO; Extract this method into it's own class, for unit testing.
303306
private List<Map<String, String>> getDisplayableProperties(List<Map<String, String>> inspectionResults)
304307
{
305-
List<Map<String, String>> displayableProperties = new ArrayList<Map<String, String>>();
308+
List<Map<String, String>> displayableProperties = new ArrayList<>();
306309
for (Map<String, String> propertyAttributes : inspectionResults)
307310
{
308311
canonicalizeTypes(propertyAttributes);

0 commit comments

Comments
 (0)