Skip to content

Commit

Permalink
Use generics in camel-kamelet-utils (#1559)
Browse files Browse the repository at this point in the history
Signed-off-by: Aurélien Pupier <apupier@redhat.com>
  • Loading branch information
apupier authored Aug 14, 2023
1 parent e0ed1f8 commit 9a0682b
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,8 @@ public void process(Exchange ex) throws InvalidPayloadException {
} else {
if (selectedHeaders != null && mode.equalsIgnoreCase("filtering")) {
List<String> headerList = Arrays.asList(selectedHeaders.split(","));
for (Iterator iteratorHeader = headerList.iterator(); iteratorHeader.hasNext();) {
String header = (String) iteratorHeader.next();
for (Iterator<String> iteratorHeader = headerList.iterator(); iteratorHeader.hasNext();) {
String header = iteratorHeader.next();
if (key.equalsIgnoreCase(header)) {
String newKey = key.replaceFirst(prefix, renamingPrefix);
String subKey = newKey.substring(renamingPrefix.length());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,8 @@ public void process(Exchange ex) throws InvalidPayloadException {
} else {
if (selectedHeaders != null && mode.equalsIgnoreCase("filtering")) {
List<String> headerList = Arrays.asList(selectedHeaders.split(","));
for (Iterator iterator = headerList.iterator(); iterator.hasNext();) {
String header = (String) iterator.next();
for (Iterator<String> iterator = headerList.iterator(); iterator.hasNext();) {
String header = iterator.next();
if (key.equalsIgnoreCase(header)) {
String newKey = key.replaceFirst(prefix, renamingPrefix);
String subKey = newKey.substring(renamingPrefix.length());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ public JsonNode process(@ExchangeProperty("fields") String fields, @ExchangeProp
}

Map<Object, Object> updatedBody = new HashMap<>();
for (Map.Entry entry:
for (Map.Entry<Object, Object> entry:
body.entrySet()) {
final String fieldName = (String) entry.getKey();
final Object origFieldValue = entry.getValue();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public JsonNode process(@ExchangeProperty("enabled") String enabled, @ExchangePr
if (ObjectHelper.isNotEmpty(renameFields)) {
Map<String, String> renamingMap = parseNames(renameFields);

for (Map.Entry entry :
for (Map.Entry<Object, Object> entry :
body.entrySet()) {
final String fieldName = (String) entry.getKey();
if (filterNames(fieldName, enabledFields, disabledFields)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public void process(@ExchangeProperty("fields") String fields, Exchange ex) thro
splittedFields = Arrays.stream(fields.split(",")).collect(Collectors.toList());
}
Map<Object, Object> key = new HashMap<>();
for (Map.Entry entry:
for (Map.Entry<Object, Object> entry:
body.entrySet()) {
final String fieldName = (String) entry.getKey();
if (filterNames(fieldName, splittedFields)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ void shouldMaskFieldWithNull() throws Exception {

@Test
void shouldMaskFieldList() throws Exception {
Map<String, List> names = new HashMap<>();
Map<String, List<String>> names = new HashMap<>();
Exchange exchange = new DefaultExchange(camelContext);
List<String> els = new ArrayList<>();
els.add("Sheldon");
Expand Down

0 comments on commit 9a0682b

Please sign in to comment.