Skip to content

Commit

Permalink
NIFI-10752: Comply with new Checkstyle rules
Browse files Browse the repository at this point in the history
  • Loading branch information
mattyb149 committed May 15, 2024
1 parent 0524756 commit 517949e
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -162,8 +162,8 @@ protected Collection<ValidationResult> customValidate(ValidationContext context)
public void onConfigured(final ConfigurationContext context) throws InitializationException {

bucketPasswords = new HashMap<>();
for(PropertyDescriptor p : context.getProperties().keySet()){
if(p.isDynamic() && p.getName().startsWith(DYNAMIC_PROP_BUCKET_PASSWORD)){
for (PropertyDescriptor p : context.getProperties().keySet()) {
if (p.isDynamic() && p.getName().startsWith(DYNAMIC_PROP_BUCKET_PASSWORD)) {
String bucketName = p.getName().substring(DYNAMIC_PROP_BUCKET_PASSWORD.length());
String password = context.getProperty(p).evaluateAttributeExpressions().getValue();
bucketPasswords.put(bucketName, password);
Expand All @@ -184,7 +184,7 @@ public void onConfigured(final ConfigurationContext context) throws Initializati
@Override
public Bucket openBucket(String bucketName) {
if (bucketPasswords.containsKey(bucketName)) {
return cluster.bucket(bucketName);//, bucketPasswords.get(bucketName));
return cluster.bucket(bucketName);
}

return cluster.bucket(bucketName);
Expand All @@ -195,7 +195,7 @@ public Bucket openBucket(String bucketName) {
*/
@OnDisabled
public void shutdown() {
if(cluster != null){
if (cluster != null) {
cluster.disconnect();
cluster = null;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ public Optional<Record> lookup(Map<String, Object> coordinates) throws LookupFai
break;

case Json:
inputStream= docId
inputStream = docId
.map(key -> collection.get(docId.get(), GetOptions.getOptions()
.transcoder(JsonTranscoder.create(DefaultJsonSerializer.create()))))
.map(doc -> new ByteArrayInputStream(doc.contentAsBytes()));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,7 @@ public enum CouchbaseAttributes implements FlowFileAttributeKey {
/**
* The thrown CouchbaseException class.
*/
Exception("couchbase.exception"),
;
Exception("couchbase.exception");

private final String key;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ public class CouchbaseExceptionMappings {
* @param e the CouchbaseException
* @return a registered strategy, if it's not registered, then return Fatal
*/
public static ErrorHandlingStrategy getStrategy(CouchbaseException e){
public static ErrorHandlingStrategy getStrategy(CouchbaseException e) {
ErrorHandlingStrategy strategy = mapping.get(e.getClass());
if (strategy == null) {
// Treat unknown Exception as Fatal.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public enum ErrorHandlingStrategy {

private final Result result;
private final Penalty penalty;
ErrorHandlingStrategy(Result result, Penalty penalty){
ErrorHandlingStrategy(Result result, Penalty penalty) {
this.result = result;
this.penalty = penalty;
}
Expand All @@ -71,11 +71,11 @@ public enum Penalty {
Yield, Penalize, None
}

public Result result(){
public Result result() {
return this.result;
}

public Penalty penalty(){
public Penalty penalty() {
return this.penalty;
}
}

0 comments on commit 517949e

Please sign in to comment.