Skip to content

Commit 84e6f9b

Browse files
authored
Merge branch 'master' into b-registry
2 parents efbc772 + b03947d commit 84e6f9b

23 files changed

Lines changed: 549 additions & 399 deletions

File tree

client/oslc-client/src/main/java/org/eclipse/lyo/client/OslcOAuthClient.java

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,6 @@ public class OslcOAuthClient implements IOslcClient {
4747

4848
/**
4949
* Initialize an OAuthClient with the required OAuth URLs
50-
* @param requestTokenURL
51-
* @param authorizationTokenURL
52-
* @param accessTokenURL
53-
* @param consumerKey
54-
* @param consumerSecret
5550
*/
5651
public OslcOAuthClient(
5752
OAuthAccessor accessor,

client/oslc-client/src/main/java/org/eclipse/lyo/client/query/OslcQueryResult.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,6 @@ public boolean hasNext() {
159159

160160
/**
161161
* @return the next page of results
162-
* @throws NoSuchElementException if there is no next page
163162
*/
164163
public OslcQueryResult next() {
165164
return new OslcQueryResult(this);

core/oslc-query/src/main/java/org/eclipse/lyo/core/query/QueryUtils.java

Lines changed: 45 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1+
package org.eclipse.lyo.core.query;
12
/*
2-
* Copyright (c) 2020 Contributors to the Eclipse Foundation
3+
* Copyright (c) 2022 Contributors to the Eclipse Foundation
34
*
45
* See the NOTICE file(s) distributed with this work for additional
56
* information regarding copyright ownership.
@@ -11,7 +12,6 @@
1112
*
1213
* SPDX-License-Identifier: EPL-2.0 OR BSD-3-Clause
1314
*/
14-
package org.eclipse.lyo.core.query;
1515

1616
import java.lang.reflect.Proxy;
1717
import java.util.ArrayList;
@@ -34,7 +34,7 @@
3434

3535
/**
3636
* Utility methods for parsing various OSLC HTTP query
37-
* parameter clauses; e.g. oslc.where
37+
* parameter clauses; e.g. {@code oslc.where}
3838
*/
3939
public class QueryUtils
4040
{
@@ -74,9 +74,9 @@ public class QueryUtils
7474

7575
CommonTree rawTree = parser.oslc_prefixes().getTree();
7676

77-
checkErrors(parser.getErrors());;
77+
checkErrors(parser.getErrors());
7878

79-
PrefixMap prefixMap =
79+
PrefixMap prefixMap =
8080
new PrefixMap(rawTree.getChildCount());
8181

8282
for (int index = 0; index < rawTree.getChildCount(); index++) {
@@ -127,9 +127,9 @@ public class QueryUtils
127127
OslcWhereParser.oslc_where_return resultTree =
128128
parser.oslc_where();
129129

130-
checkErrors(parser.getErrors());;
130+
checkErrors(parser.getErrors());
131131

132-
CommonTree rawTree = (CommonTree)resultTree.getTree();
132+
CommonTree rawTree = resultTree.getTree();
133133
Tree child = rawTree.getChild(0);
134134

135135
if (child.getType() == Token.INVALID_TOKEN_TYPE) {
@@ -172,9 +172,9 @@ public class QueryUtils
172172
OslcSelectParser.oslc_select_return resultTree =
173173
parser.oslc_select();
174174

175-
checkErrors(parser.getErrors());;
175+
checkErrors(parser.getErrors());
176176

177-
CommonTree rawTree = (CommonTree)resultTree.getTree();
177+
CommonTree rawTree = resultTree.getTree();
178178

179179
if (rawTree.getType() == Token.INVALID_TOKEN_TYPE) {
180180
throw ((CommonErrorNode)rawTree).trappedException;
@@ -184,7 +184,7 @@ public class QueryUtils
184184
Proxy.newProxyInstance(SelectClause.class.getClassLoader(),
185185
new Class<?>[] { SelectClause.class, Properties.class },
186186
new PropertiesInvocationHandler(
187-
(CommonTree)resultTree.getTree(),
187+
resultTree.getTree(),
188188
prefixMap));
189189

190190
} catch (RecognitionException e) {
@@ -217,9 +217,9 @@ public class QueryUtils
217217
OslcSelectParser.oslc_select_return resultTree =
218218
parser.oslc_select();
219219

220-
checkErrors(parser.getErrors());;
220+
checkErrors(parser.getErrors());
221221

222-
CommonTree rawTree = (CommonTree)resultTree.getTree();
222+
CommonTree rawTree = resultTree.getTree();
223223

224224
if (rawTree.getType() == Token.INVALID_TOKEN_TYPE) {
225225
throw ((CommonErrorNode)rawTree).trappedException;
@@ -229,7 +229,7 @@ public class QueryUtils
229229
Proxy.newProxyInstance(PropertiesClause.class.getClassLoader(),
230230
new Class<?>[] { PropertiesClause.class, Properties.class },
231231
new PropertiesInvocationHandler(
232-
(CommonTree)resultTree.getTree(),
232+
resultTree.getTree(),
233233
prefixMap));
234234

235235
} catch (RecognitionException e) {
@@ -262,9 +262,9 @@ public class QueryUtils
262262
OslcOrderByParser.oslc_order_by_return resultTree =
263263
parser.oslc_order_by();
264264

265-
checkErrors(parser.getErrors());;
265+
checkErrors(parser.getErrors());
266266

267-
CommonTree rawTree = (CommonTree)resultTree.getTree();
267+
CommonTree rawTree = resultTree.getTree();
268268
Tree child = rawTree.getChild(0);
269269

270270
if (child.getType() == Token.INVALID_TOKEN_TYPE) {
@@ -283,7 +283,7 @@ public class QueryUtils
283283

284284
/**
285285
* Create a map representation of the {@link Properties} returned
286-
* from parsing oslc.properties or olsc.select URL query
286+
* from parsing {@code oslc.properties} or {@code oslc.select} URL query
287287
* parameters suitable for generating a property result from an
288288
* HTTP GET request.<p>
289289
*
@@ -312,7 +312,7 @@ public class QueryUtils
312312

313313
for (Property property : children) {
314314

315-
PName pname = null;
315+
PName pname;
316316
String propertyName = null;
317317

318318
if (! property.isWildcard()) {
@@ -403,12 +403,12 @@ public class QueryUtils
403403
}
404404

405405
/**
406-
* Parse a oslc.searchTerms expression
406+
* Parse an {@code oslc.searchTerms} expression
407407
*
408408
* <p><b>Note</b>: {@link Object#toString()} of result has been overridden to
409409
* return input expression.
410410
*
411-
* @param searchTermsExpression contents of an oslc.searchTerms HTTP query
411+
* @param searchTermsExpression contents of an {@code oslc.searchTerms} HTTP query
412412
* parameter
413413
*
414414
* @return the parsed search terms clause
@@ -427,9 +427,9 @@ public class QueryUtils
427427
OslcSearchTermsParser.oslc_search_terms_return resultTree =
428428
parser.oslc_search_terms();
429429

430-
checkErrors(parser.getErrors());;
430+
checkErrors(parser.getErrors());
431431

432-
CommonTree rawTree = (CommonTree)resultTree.getTree();
432+
CommonTree rawTree = resultTree.getTree();
433433
Tree child = rawTree.getChild(0);
434434

435435
if (child.getType() == Token.INVALID_TOKEN_TYPE) {
@@ -469,7 +469,7 @@ private static class StringList extends ArrayList<String>
469469
public String
470470
toString()
471471
{
472-
StringBuffer buffer = new StringBuffer();
472+
StringBuilder buffer = new StringBuilder();
473473
boolean first = true;
474474

475475
for (String string : this) {
@@ -492,7 +492,7 @@ private static class StringList extends ArrayList<String>
492492
}
493493

494494
/**
495-
* Implementation of a Map<String, String> prefixMap
495+
* Implementation of a {@code Map<String, String> prefixMap}
496496
*/
497497
private static class PrefixMap extends HashMap<String, String>
498498
{
@@ -505,7 +505,7 @@ private static class PrefixMap extends HashMap<String, String>
505505
public String
506506
toString()
507507
{
508-
StringBuffer buffer = new StringBuffer();
508+
StringBuilder buffer = new StringBuilder();
509509
Iterator<String> keys = this.keySet().iterator();
510510
boolean first = true;
511511

@@ -602,8 +602,8 @@ private static class BothWildcardPropertiesImpl
602602
}
603603

604604
/**
605-
* Merge into {@link #lhs} properties those of {@link #rhs} property
606-
* map, merging any common, nested property maps
605+
* Merge into {@code lhs} properties those of {@code rhs} property
606+
* map, merging any common, nested property maps.
607607
*
608608
* @param lhs target of property map merge
609609
* @param rhs source of property map merge
@@ -614,37 +614,35 @@ private static class BothWildcardPropertiesImpl
614614
Map<String, Object> rhs
615615
)
616616
{
617-
Iterator<String> propertyNames = rhs.keySet().iterator();
618617

619-
while (propertyNames.hasNext()) {
618+
for (String propertyName : rhs.keySet()) {
620619

621-
String propertyName = propertyNames.next();
622-
@SuppressWarnings("unchecked")
623-
Map<String, Object> lhsNestedProperties =
624-
(Map<String, Object>)lhs.get(propertyName);
625-
@SuppressWarnings("unchecked")
626-
Map<String, Object> rhsNestedProperties =
627-
(Map<String, Object>)rhs.get(propertyName);
620+
@SuppressWarnings("unchecked")
621+
Map<String, Object> lhsNestedProperties =
622+
(Map<String, Object>) lhs.get(propertyName);
623+
@SuppressWarnings("unchecked")
624+
Map<String, Object> rhsNestedProperties =
625+
(Map<String, Object>) rhs.get(propertyName);
628626

629-
if (lhsNestedProperties == rhsNestedProperties) {
630-
continue;
631-
}
627+
if (lhsNestedProperties == rhsNestedProperties) {
628+
continue;
629+
}
632630

633-
if (lhsNestedProperties == null ||
634-
lhsNestedProperties == OSLC4JConstants.OSL4J_PROPERTY_SINGLETON) {
631+
if (lhsNestedProperties == null ||
632+
lhsNestedProperties == OSLC4JConstants.OSL4J_PROPERTY_SINGLETON) {
635633

636-
lhs.put(propertyName, rhsNestedProperties);
634+
lhs.put(propertyName, rhsNestedProperties);
637635

638-
continue;
639-
}
636+
continue;
637+
}
640638

641-
mergePropertyMaps(lhsNestedProperties, rhsNestedProperties);
642-
}
639+
mergePropertyMaps(lhsNestedProperties, rhsNestedProperties);
640+
}
643641
}
644642

645643
/**
646644
* Check list of errors from parsing some expression, generating
647-
* @{link {@link ParseException} if there are any.
645+
* {@link ParseException} if there are any.
648646
*
649647
* @param errors list of errors, hopefully empty
650648
*
@@ -657,7 +655,7 @@ private static class BothWildcardPropertiesImpl
657655
return;
658656
}
659657

660-
StringBuffer buffer = new StringBuffer();
658+
StringBuilder buffer = new StringBuilder();
661659
boolean first = true;
662660

663661
for (String error : errors) {

0 commit comments

Comments
 (0)