Skip to content

Commit 959264f

Browse files
committed
Merge pull request #651 from jewzaam/reformat-v2-head
Reformat per http://dev.docs.lightblue.io/formatting/index.html [v2-head]
2 parents be21794 + ea6f0fe commit 959264f

File tree

272 files changed

+7690
-7497
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

272 files changed

+7690
-7497
lines changed

config/src/main/java/com/redhat/lightblue/config/AbstractMetadataConfiguration.java

Lines changed: 17 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -44,18 +44,18 @@
4444
public abstract class AbstractMetadataConfiguration implements MetadataConfiguration {
4545

4646
private final List<HookConfigurationParser> hookConfigurationParsers = new ArrayList<>();
47-
private final List<Map.Entry<String,DataStoreParser>> backendParsers = new ArrayList<>();
48-
private final List<Map.Entry<String,PropertyParser>> propertyParsers = new ArrayList<>();
49-
private final Map<MetadataRole,List<String>> roleMap = new HashMap<>();
50-
private boolean validateRequests=false;
47+
private final List<Map.Entry<String, DataStoreParser>> backendParsers = new ArrayList<>();
48+
private final List<Map.Entry<String, PropertyParser>> propertyParsers = new ArrayList<>();
49+
private final Map<MetadataRole, List<String>> roleMap = new HashMap<>();
50+
private boolean validateRequests = false;
5151

5252
@Override
5353
public boolean isValidateRequests() {
5454
return validateRequests;
5555
}
5656

5757
public void setValidateRequests(boolean b) {
58-
validateRequests=b;
58+
validateRequests = b;
5959
}
6060

6161
/**
@@ -73,8 +73,8 @@ protected void registerWithExtensions(Extensions ext) {
7373
}
7474
}
7575

76-
protected Map<MetadataRole,List<String>> getMappedRoles() {
77-
return roleMap;
76+
protected Map<MetadataRole, List<String>> getMappedRoles() {
77+
return roleMap;
7878
}
7979

8080
@Override
@@ -106,9 +106,8 @@ public void initializeFromJson(JsonNode node) {
106106
}
107107
}
108108

109-
110109
ArrayNode backendParsersJs = (ArrayNode) node.get("backendParsers");
111-
if(backendParsersJs != null) {
110+
if (backendParsersJs != null) {
112111
Iterator<JsonNode> bpjsItr = backendParsersJs.iterator();
113112
while (bpjsItr.hasNext()) {
114113
JsonNode jsonNode = bpjsItr.next();
@@ -130,8 +129,8 @@ public void initializeFromJson(JsonNode node) {
130129
}
131130

132131
ArrayNode propertyParserJs = (ArrayNode) node.get("propertyParsers");
133-
if(propertyParserJs != null) {
134-
for (JsonNode jsonNode:propertyParserJs) {
132+
if (propertyParserJs != null) {
133+
for (JsonNode jsonNode : propertyParserJs) {
135134
String name = jsonNode.get("name").asText();
136135
String clazz = jsonNode.get("clazz").asText();
137136

@@ -151,33 +150,33 @@ public void initializeFromJson(JsonNode node) {
151150
}
152151

153152
JsonNode roleMapJs = node.get("roleMap");
154-
if(roleMapJs != null) {
153+
if (roleMapJs != null) {
155154
// If the roleMap element is defined, it is expected to have all the roles mapped
156155
MetadataRole[] values = MetadataRole.values();
157156
for (MetadataRole value : values) {
158157
String name = value.toString();
159-
ArrayNode rolesJs = (ArrayNode) roleMapJs.get(name);
158+
ArrayNode rolesJs = (ArrayNode) roleMapJs.get(name);
160159

161160
if (rolesJs == null || rolesJs.size() == 0) {
162161
throw Error.get(MetadataConstants.ERR_CONFIG_NOT_VALID, "roleMap missing the role \"" + name + "\"");
163162
}
164163

165164
roleMap.put(value, new ArrayList<String>());
166-
for (JsonNode jsonNode: rolesJs) {
165+
for (JsonNode jsonNode : rolesJs) {
167166
roleMap.get(value).add(jsonNode.textValue());
168167
}
169168
}
170169
}
171170

172-
x=node.get("validateRequests");
173-
if(x!=null) {
174-
validateRequests=x.booleanValue();
171+
x = node.get("validateRequests");
172+
if (x != null) {
173+
validateRequests = x.booleanValue();
175174
}
176175
}
177176
}
178177

179178
@Override
180-
public List<HookConfigurationParser> getHookConfigurationParsers(){
179+
public List<HookConfigurationParser> getHookConfigurationParsers() {
181180
return hookConfigurationParsers;
182181
}
183182
}

config/src/main/java/com/redhat/lightblue/config/ControllerConfiguration.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ public class ControllerConfiguration implements JsonInitializable, Serializable
3636

3737
private static final long serialVersionUID = 1l;
3838

39-
private static final Logger LOGGER=LoggerFactory.getLogger(ControllerConfiguration.class);
39+
private static final Logger LOGGER = LoggerFactory.getLogger(ControllerConfiguration.class);
4040

4141
private String backend;
4242
private Class<? extends ControllerFactory> controllerFactory;
@@ -90,7 +90,7 @@ public ObjectNode getExtensions() {
9090
* The configuration for extensions
9191
*/
9292
public void setExtensions(ObjectNode node) {
93-
extensions=node;
93+
extensions = node;
9494
}
9595

9696
@SuppressWarnings("unchecked")
@@ -107,8 +107,8 @@ public void initializeFromJson(JsonNode node) {
107107
controllerFactory = (Class<ControllerFactory>) Thread.currentThread().getContextClassLoader().loadClass(
108108
x.asText());
109109
}
110-
extensions=(ObjectNode)node.get("extensions");
111-
LOGGER.debug("Initialized: source={} backend={} controllerFactory={} extensions={}",node,backend,controllerFactory,extensions);
110+
extensions = (ObjectNode) node.get("extensions");
111+
LOGGER.debug("Initialized: source={} backend={} controllerFactory={} extensions={}", node, backend, controllerFactory, extensions);
112112
}
113113
} catch (Exception e) {
114114
throw new RuntimeException(e);

config/src/main/java/com/redhat/lightblue/config/CrudConfiguration.java

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -44,23 +44,23 @@ public class CrudConfiguration implements JsonInitializable, Serializable {
4444
public static final transient String FILENAME = "lightblue-crud.json";
4545

4646
private ControllerConfiguration controllers[];
47-
private boolean validateRequests=false;
48-
private int bulkParallelExecutions=3;
47+
private boolean validateRequests = false;
48+
private int bulkParallelExecutions = 3;
4949

5050
public boolean isValidateRequests() {
5151
return validateRequests;
5252
}
5353

5454
public void setValidateRequests(boolean b) {
55-
validateRequests=b;
55+
validateRequests = b;
5656
}
5757

5858
public int getBulkParallelExecutions() {
5959
return bulkParallelExecutions;
6060
}
6161

6262
public void setBulkParallelExecutions(int i) {
63-
bulkParallelExecutions=i;
63+
bulkParallelExecutions = i;
6464
}
6565

6666
/**
@@ -109,12 +109,14 @@ public void initializeFromJson(JsonNode node) {
109109
throw new IllegalArgumentException("'controllers' must be instanceof ArrayNode: " + node.toString());
110110
}
111111

112-
x=node.get("validateRequests");
113-
if(x!=null)
114-
validateRequests=x.booleanValue();
115-
x=node.get("bulkParallelExecutions");
116-
if(x!=null)
117-
bulkParallelExecutions=x.intValue();
112+
x = node.get("validateRequests");
113+
if (x != null) {
114+
validateRequests = x.booleanValue();
115+
}
116+
x = node.get("bulkParallelExecutions");
117+
if (x != null) {
118+
bulkParallelExecutions = x.intValue();
119+
}
118120
}
119121
}
120122
}

config/src/main/java/com/redhat/lightblue/config/DataSourcesConfiguration.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ public <D extends DataSourceConfiguration> Map<String, D> getDataSourcesByType(C
9494
Map<String, D> map = new HashMap<>();
9595
for (Map.Entry<String, DataSourceConfiguration> entry : datasources.entrySet()) {
9696
if (clazz.isAssignableFrom(entry.getValue().getClass())) {
97-
map.put(entry.getKey(), (D)entry.getValue());
97+
map.put(entry.getKey(), (D) entry.getValue());
9898
}
9999
}
100100
return map;

0 commit comments

Comments
 (0)