Skip to content
This repository was archived by the owner on Feb 14, 2023. It is now read-only.

Commit 56f4b47

Browse files
committed
Checkstyle warnings
1 parent fec58df commit 56f4b47

File tree

8 files changed

+46
-39
lines changed

8 files changed

+46
-39
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,3 +53,5 @@ launchers/demo-e2e/edc-config.properties
5353
.env
5454
runtime_settings.properties
5555
generated_backend.tf
56+
57+
bin/

core/control-plane/transfer/src/main/java/org/eclipse/dataspaceconnector/transfer/core/transfer/TransferProcessManagerImpl.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,7 @@ public void handleDeprovisionResult(String processId, List<StatusResult<Deprovis
254254

255255
private StatusResult<String> initiateRequest(TransferProcess.Type type, DataRequest dataRequest) {
256256
// make the request idempotent: if the process exists, return
257-
var processId = transferProcessStore.processIdForDataRequestId(dataRequest.getId(),type);
257+
var processId = transferProcessStore.processIdForDataRequestId(dataRequest.getId(), type);
258258
if (processId != null) {
259259
return StatusResult.success(processId);
260260
}

extensions/control-plane/data-plane-transfer/data-plane-transfer-sync/src/main/java/org/eclipse/dataspaceconnector/transfer/dataplane/sync/proxy/DataPlaneTransferConsumerProxyTransformer.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ public Result<EndpointDataReference> transform(@NotNull EndpointDataReference ed
7777
}
7878

7979
private static DataAddress toHttpDataAddress(EndpointDataReference edr) {
80-
DataAddress.Builder addressBuilder= HttpDataAddress.Builder.newInstance()
80+
DataAddress.Builder addressBuilder = HttpDataAddress.Builder.newInstance()
8181
.baseUrl(edr.getEndpoint())
8282
.authKey(edr.getAuthKey())
8383
.authCode(edr.getAuthCode())
@@ -90,7 +90,7 @@ private static DataAddress toHttpDataAddress(EndpointDataReference edr) {
9090
var protocol = edr.getProperties().get(PROTOCOL_ID);
9191
if (protocol != null) {
9292
// set sub-protocol
93-
addressBuilder=addressBuilder.type(protocol);
93+
addressBuilder = addressBuilder.type(protocol);
9494
}
9595
return addressBuilder.build();
9696
}

extensions/control-plane/http-receiver/src/main/java/org/eclipse/dataspaceconnector/receiver/http/HttpEndpointDataReferenceReceiverExtension.java

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ public class HttpEndpointDataReferenceReceiverExtension implements ServiceExtens
3636
@EdcSetting
3737
private static final String HTTP_RECEIVER_AUTH_CODE = "edc.receiver.http.auth-code";
3838

39-
public static final String SPEC_SEPARATOR=",";
39+
public static final String SPEC_SEPARATOR = ",";
4040

4141
@Inject
4242
private EndpointDataReferenceReceiverRegistry receiverRegistry;
@@ -62,36 +62,36 @@ public void initialize(ServiceExtensionContext context) {
6262
var authKey = context.getSetting(HTTP_RECEIVER_AUTH_KEY, null);
6363
var authCode = context.getSetting(HTTP_RECEIVER_AUTH_CODE, null);
6464

65-
Monitor monitor= context.getMonitor();
65+
Monitor monitor = context.getMonitor();
6666

67-
monitor.debug(String.format("Elaborating http endpoint receiver spec %s",endpoint));
67+
monitor.debug(String.format("Elaborating http endpoint receiver spec %s", endpoint));
6868

69-
var endpoints=endpoint.split(",");
70-
var authKeys= new String[0];
71-
if(authKey!=null) {
72-
authKeys=authKey.split(",");
69+
var endpoints = endpoint.split(",");
70+
var authKeys = new String[0];
71+
if (authKey != null) {
72+
authKeys = authKey.split(",");
7373
}
74-
var authCodes= new String[0];
75-
if(authCode!=null) {
76-
authCodes=authCode.split(",");
74+
var authCodes = new String[0];
75+
if (authCode != null) {
76+
authCodes = authCode.split(",");
7777
}
7878

79-
if(authKeys.length!=authCodes.length) {
80-
throw new EdcException(String.format("Length of endpoints %d auth keys %d and auth codes %d do not match", endpoints.length,authKeys.length,authCodes.length));
79+
if (authKeys.length != authCodes.length) {
80+
throw new EdcException(String.format("Length of endpoints %d auth keys %d and auth codes %d do not match", endpoints.length, authKeys.length, authCodes.length));
8181
}
82-
if(authKeys.length<endpoints.length) {
83-
monitor.warning(String.format("There are %d endpoints but only %d authorization infos. Omitting authorization for endpoints %d to %d.",endpoints.length,authKeys.length,authKeys.length+1,endpoints.length));
82+
if (authKeys.length < endpoints.length) {
83+
monitor.warning(String.format("There are %d endpoints but only %d authorization infos. Omitting authorization for endpoints %d to %d.", endpoints.length, authKeys.length, authKeys.length + 1, endpoints.length));
8484
}
85-
for(int count=0;count<endpoints.length;count++) {
86-
monitor.debug(String.format("About to build and register new http endpoint receiver number %d for address %s",count,endpoints[count]));
87-
String theEndpoint=endpoints[count];
88-
String theKey="";
89-
String theCode="";
90-
if(authKeys.length>count) {
91-
theKey=authKeys[count];
92-
theCode=authCodes[count];
85+
for (int count = 0; count < endpoints.length; count++) {
86+
monitor.debug(String.format("About to build and register new http endpoint receiver number %d for address %s", count, endpoints[count]));
87+
String theEndpoint = endpoints[count];
88+
String theKey = "";
89+
String theCode = "";
90+
if (authKeys.length > count) {
91+
theKey = authKeys[count];
92+
theCode = authCodes[count];
9393
}
94-
var receiver = HttpEndpointDataReferenceReceiver.Builder.newInstance()
94+
var receiver = HttpEndpointDataReferenceReceiver.Builder.newInstance()
9595
.endpoint(theEndpoint)
9696
.authHeader(theKey, theCode)
9797
.httpClient(httpClient)

extensions/control-plane/store/cosmos/transfer-process-store-cosmos/src/main/java/org/eclipse/dataspaceconnector/transfer/store/cosmos/CosmosTransferProcessStore.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ public TransferProcess find(String id) {
107107
@Override
108108
public @Nullable
109109
String processIdForDataRequestId(String transferId, TransferProcess.Type type) {
110-
var query = "SELECT * FROM t WHERE t.wrappedInstance.dataRequest.id = '" + transferId + "' AND t.wrappedInstance.type = '" +type.toString()+"'";
110+
var query = "SELECT * FROM t WHERE t.wrappedInstance.dataRequest.id = '" + transferId + "' AND t.wrappedInstance.type = '" + type.toString() + "'";
111111
var response = failsafeExecutor.get(() -> cosmosDbApi.queryItems(query));
112112
return response
113113
.map(this::convertToDocument)

spi/common/core-spi/src/main/java/org/eclipse/dataspaceconnector/spi/query/BaseCriterionToPredicateConverter.java

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@ private Predicate<T> inPredicate(Criterion criterion) {
9292
* implements a regex criterion
9393
* by matching the string representation of
9494
* a left hand operand against a regex pattern
95+
*
9596
* @param criterion representation
9697
* @return regex predicate
9798
*/
@@ -106,16 +107,16 @@ private Predicate<T> regexPredicate(Criterion criterion) {
106107
Pattern pattern = null;
107108

108109
try {
109-
if(rightOp instanceof java.util.regex.Pattern) {
110-
pattern=(Pattern) rightOp;
110+
if (rightOp instanceof java.util.regex.Pattern) {
111+
pattern = (Pattern) rightOp;
111112
} else if (rightOp instanceof String) {
112113
pattern = Pattern.compile((String) rightOp);
113114
}
114-
if(pattern!=null) {
115+
if (pattern != null) {
115116
return pattern.matcher(String.valueOf(property)).matches();
116117
}
117-
} catch(PatternSyntaxException e) {
118-
throw new IllegalArgumentException("Operator ~ the right-hand operand %s is not a valid regular expression." + rightOp.getClass().getName(),e);
118+
} catch (PatternSyntaxException e) {
119+
throw new IllegalArgumentException("Operator ~ the right-hand operand %s is not a valid regular expression." + rightOp.getClass().getName(), e);
119120
}
120121
throw new IllegalArgumentException("Operator ~ requires the right-hand operand to be a regular expression but was " + rightOp.getClass().getName());
121122
};

spi/common/policy-model/src/main/java/org/eclipse/dataspaceconnector/policy/model/Policy.java

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@
2424
import java.util.List;
2525
import java.util.Map;
2626
import java.util.Objects;
27-
import java.util.stream.Collectors;
2827
import java.util.regex.Pattern;
28+
import java.util.stream.Collectors;
2929
import java.util.stream.Stream;
3030

3131
/**
@@ -119,22 +119,25 @@ public boolean equals(Object o) {
119119
public Policy withTarget(String target) {
120120
return Builder.newInstance()
121121
.prohibitions(prohibitions.stream().flatMap(p -> {
122-
if (p.getTarget() == null || Pattern.compile(p.getTarget()).matcher(target).matches())
122+
if (p.getTarget() == null || Pattern.compile(p.getTarget()).matcher(target).matches()) {
123123
return Stream.of(p.withTarget(target));
124-
else
124+
} else {
125125
return Stream.empty();
126+
}
126127
}).collect(Collectors.toList()))
127128
.permissions(permissions.stream().flatMap(p -> {
128-
if (p.getTarget() == null || Pattern.compile(p.getTarget()).matcher(target).matches())
129+
if (p.getTarget() == null || Pattern.compile(p.getTarget()).matcher(target).matches()) {
129130
return Stream.of(p.withTarget(target));
130-
else
131+
} else {
131132
return Stream.empty();
133+
}
132134
}).collect(Collectors.toList()))
133135
.duties(obligations.stream().flatMap(o -> {
134-
if (o.getTarget() == null || Pattern.compile(o.getTarget()).matcher(target).matches())
136+
if (o.getTarget() == null || Pattern.compile(o.getTarget()).matcher(target).matches()) {
135137
return Stream.of(o.withTarget(target));
136-
else
138+
} else {
137139
return Stream.empty();
140+
}
138141
}).collect(Collectors.toList()))
139142
.assigner(assigner)
140143
.assignee(assignee)

spi/control-plane/contract-spi/src/main/java/org/eclipse/dataspaceconnector/spi/contract/ContractId.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ public final class ContractId {
3030
/**
3131
* Returns a UUID that references the definition id and
3232
* is based on an asset id
33+
*
3334
* @param definitionPart id of the contract definition
3435
* @param assetPart id of the offered asset
3536
* @return unique string

0 commit comments

Comments
 (0)