Skip to content

Commit 82fc9d6

Browse files
acoburntimea-solid
andauthored
Clean up sonar warnings (#593)
Co-authored-by: Timea <4144203+timea-solid@users.noreply.github.com>
1 parent 686c414 commit 82fc9d6

File tree

5 files changed

+9
-11
lines changed

5 files changed

+9
-11
lines changed

access-grant/src/main/java/com/inrupt/client/accessgrant/AccessCredentialQuery.java

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,6 @@
3232
*/
3333
public class AccessCredentialQuery<T extends AccessCredential> {
3434

35-
private static final URI SOLID_ACCESS_GRANT = URI.create("SolidAccessGrant");
36-
private static final URI SOLID_ACCESS_REQUEST = URI.create("SolidAccessRequest");
37-
private static final URI SOLID_ACCESS_DENIAL = URI.create("SolidAccessDenial");
38-
3935
private final Set<URI> purposes;
4036
private final Set<String> modes;
4137
private final URI resource;
@@ -199,7 +195,7 @@ public Builder recipient(final URI recipient) {
199195
* @param clazz the credential type
200196
* @return the query object
201197
*/
202-
public <T extends AccessCredential> AccessCredentialQuery build(final Class<T> clazz) {
198+
public <T extends AccessCredential> AccessCredentialQuery<T> build(final Class<T> clazz) {
203199
return new AccessCredentialQuery<T>(builderResource, builderCreator, builderRecipient, purposes, modes,
204200
clazz);
205201
}

access-grant/src/main/java/com/inrupt/client/accessgrant/AccessGrantClient.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,7 @@ private AccessGrantClient(final Client client, final ClientCache<URI, Metadata>
168168
this.config = Objects.requireNonNull(config, "config may not be null!");
169169
this.metadataCache = Objects.requireNonNull(metadataCache, "metadataCache may not be null!");
170170
this.jsonService = ServiceProvider.getJsonService();
171+
LOGGER.debug("Initializing Access Grant client with issuer: {}", config.getIssuer());
171172
}
172173

173174
/**

jena/src/test/java/com/inrupt/client/jena/JenaBodyPublishersTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@
3232
import java.util.HashMap;
3333
import java.util.Map;
3434

35-
import org.apache.jena.graph.Factory;
3635
import org.apache.jena.graph.Graph;
36+
import org.apache.jena.graph.GraphMemFactory;
3737
import org.apache.jena.query.Dataset;
3838
import org.apache.jena.query.DatasetFactory;
3939
import org.apache.jena.rdf.model.Model;
@@ -121,7 +121,7 @@ void testOfUpdateRequestPublisher() throws IOException, InterruptedException {
121121

122122
@Test
123123
void testOfGraphPublisher() throws IOException, InterruptedException {
124-
graph = Factory.createDefaultGraph();
124+
graph = GraphMemFactory.createDefaultGraph();
125125

126126
graph.add(JenaTestModel.S_NODE, JenaTestModel.P_NODE, JenaTestModel.O_NODE);
127127
graph.add(JenaTestModel.S1_NODE, JenaTestModel.P1_NODE, JenaTestModel.O1_NODE);

openid/src/main/java/com/inrupt/client/openid/OpenIdSession.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -242,12 +242,12 @@ public void reset() {
242242
public CompletionStage<Optional<Credential>> authenticate(final Authenticator auth,
243243
final Request request, final Set<String> algorithms) {
244244
return auth.authenticate(this, request, algorithms)
245-
.thenApply(credential -> {
246-
if (credential != null) {
245+
.thenApply(cred -> {
246+
if (cred != null) {
247247
LOGGER.debug("Setting cache entry for request: {}", request.uri());
248-
requestCache.put(cacheKey(request.uri()), credential);
248+
requestCache.put(cacheKey(request.uri()), cred);
249249
}
250-
return Optional.ofNullable(credential);
250+
return Optional.ofNullable(cred);
251251
});
252252
}
253253

solid/src/main/java/com/inrupt/client/solid/SolidNonRDFSource.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ public SolidNonRDFSource(final URI identifier, final String contentType, final I
6666
*
6767
* @return the metadata
6868
*/
69+
@Override
6970
public Metadata getMetadata() {
7071
return metadata;
7172
}

0 commit comments

Comments
 (0)