Skip to content

Commit

Permalink
Added spotless plugin with Palantir java format
Browse files Browse the repository at this point in the history
  • Loading branch information
zubri committed Jul 25, 2023
1 parent 1c4c0c6 commit 7128536
Show file tree
Hide file tree
Showing 424 changed files with 10,272 additions and 11,170 deletions.
6 changes: 6 additions & 0 deletions .idea/palantir-java-format.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Prowide Core - CHANGELOG

#### 9.3.17 - SNAPSHOT
#### 9.3.17 - July 2023
* (PW-1405) Trim original String payload when creating an AbstractSwiftMessage

#### 9.3.16 - June 2023
Expand Down
12 changes: 12 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ buildscript {
classpath 'ru.vyarus:gradle-quality-plugin:4.7.0'
classpath 'pl.allegro.tech.build:axion-release-plugin:1.14.2'
classpath 'io.github.gradle-nexus:publish-plugin:1.1.0'
classpath 'com.diffplug.spotless:spotless-plugin-gradle:6.13.0' // above this version requires Java 11
}
}
apply plugin: 'pl.allegro.tech.build.axion-release'
Expand Down Expand Up @@ -317,3 +318,14 @@ quality {
spotbugsEffort = 'min'
spotbugsMaxRank = 8
}

apply plugin: 'com.diffplug.spotless'

spotless {
java {
target '**/src/main/java/**/*.java', '**/src/test/java/**/*.java'
palantirJavaFormat()
}
}

test.finalizedBy(spotlessCheck)
7 changes: 3 additions & 4 deletions overview.html
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,12 @@ <h3>Backbone - Structure Layer</h3>

<h2>Additional resources</h2>
<ol>
<li>Documentation: <a href="http://www.prowidesoftware.com/resources">http://www.prowidesoftware.com/resources</a></li>
<li>Documentation: <a href="https://dev.prowidesoftware.com/">https://dev.prowidesoftware.com/resources</a></li>
<li>Code examples: <a href="https://github.com/prowide/prowide-core-examples">https://github.com/prowide/prowide-core-examples</a></li>
<li>Source code: <a href="https://github.com/prowide/prowide-core">https://github.com/prowide/prowide-core</a></li>
<li>Binary download: <a href="http://www.prowidesoftware.com/download-prowide-core">http://www.prowidesoftware.com/download-prowide-core</a></li>
</ol>

<p>The project (previously known as WIFE) is active since 2006, production ready and commercially supported by <a href="www.prowidesoftware.com">Prowide Software</a>.</p>
<p>For SWIFT messages validation, extended MX support, GUI application and more, please check the Integrator version at <a href="http://www.prowidesoftware.com/products/integrator">http://www.prowidesoftware.com/products/integrator</a></p>
<p>The project is active since 2006, production ready and commercially supported by <a href="https://www.prowidesoftware.com">Prowide Software</a>.</p>
<p>For SWIFT messages validation, extended MX support, GUI application and more, please check the Integrator version at <a href="https://www.prowidesoftware.com/products/integrator">https://www.prowidesoftware.com/products/integrator</a></p>
<p>SWIFT is a trademark of <a href="www.swift.com">S.W.I.F.T. SCRL.</a></p>
</body>
2 changes: 1 addition & 1 deletion src/main/java/com/prowidesoftware/CopyableTo.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2006-2021 Prowide
* Copyright 2006-2023 Prowide
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
9 changes: 3 additions & 6 deletions src/main/java/com/prowidesoftware/Generated.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2006-2021 Prowide
* Copyright 2006-2023 Prowide
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -31,8 +31,5 @@
*/
@Documented
@Retention(SOURCE)
@Target({PACKAGE, TYPE, ANNOTATION_TYPE, METHOD, CONSTRUCTOR, FIELD,
LOCAL_VARIABLE, PARAMETER})
public @interface Generated {

}
@Target({PACKAGE, TYPE, ANNOTATION_TYPE, METHOD, CONSTRUCTOR, FIELD, LOCAL_VARIABLE, PARAMETER})
public @interface Generated {}
3 changes: 1 addition & 2 deletions src/main/java/com/prowidesoftware/JsonSerializable.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2006-2021 Prowide
* Copyright 2006-2023 Prowide
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -28,5 +28,4 @@ public interface JsonSerializable {
* @return the message content as JSON
*/
String toJson();

}
10 changes: 4 additions & 6 deletions src/main/java/com/prowidesoftware/ProwideException.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2006-2021 Prowide
* Copyright 2006-2023 Prowide
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -18,20 +18,19 @@
import java.util.*;
import java.util.Map.Entry;


/**
* Base class for Prowide exceptions hierarchy.
*
* @since 7.7
*/
public class ProwideException extends RuntimeException {
private static final long serialVersionUID = 4645197208853563727L;
private static transient final java.util.logging.Logger log = java.util.logging.Logger.getLogger(ProwideException.class.getName());
private static final transient java.util.logging.Logger log =
java.util.logging.Logger.getLogger(ProwideException.class.getName());

private final Map<String, String> variables = new HashMap<>();

public ProwideException() {
}
public ProwideException() {}

public ProwideException(final String message, final Throwable cause) {
super(message, cause);
Expand Down Expand Up @@ -98,7 +97,6 @@ protected String getMessage(final Locale locale, final Map<String, String> varia
log.fine("No localized message found for exception key '" + key + "'");
return super.getMessage();
}

}

static String substitute(String message, Map<String, String> variables) {
Expand Down
3 changes: 1 addition & 2 deletions src/main/java/com/prowidesoftware/ProwideLocale.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2006-2021 Prowide
* Copyright 2006-2023 Prowide
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -85,5 +85,4 @@ public static ResourceBundle getBundle(final String resource, Locale locale) {
public static ResourceBundle getBundle(final String resource) {
return getBundle(resource, Locale.getDefault());
}

}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2006-2021 Prowide
* Copyright 2006-2023 Prowide
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -15,12 +15,11 @@
*/
package com.prowidesoftware.deprecation;

import org.apache.commons.lang3.StringUtils;

import java.lang.reflect.Field;
import java.util.Collections;
import java.util.Map;
import java.util.logging.Level;
import org.apache.commons.lang3.StringUtils;

/**
* Helper API to implement the http://www.prowidesoftware.com/resources/deprecation-policy
Expand All @@ -33,7 +32,9 @@ public class DeprecationUtils {
* Environment variable used to switch off deprecation phase implementation
*/
public static final String PW_DEPRECATED = "PW_DEPRECATED";
private static final transient java.util.logging.Logger log = java.util.logging.Logger.getLogger(DeprecationUtils.class.getName());

private static final transient java.util.logging.Logger log =
java.util.logging.Logger.getLogger(DeprecationUtils.class.getName());

// Suppress default constructor for noninstantiability
private DeprecationUtils() {
Expand Down Expand Up @@ -142,7 +143,8 @@ private static void setEnv(final String key, final String value) {
theEnvironmentField.setAccessible(true);
Map<String, String> env = (Map<String, String>) theEnvironmentField.get(null);
env.put(key, value);
Field theCaseInsensitiveEnvironmentField = processEnvironmentClass.getDeclaredField("theCaseInsensitiveEnvironment");
Field theCaseInsensitiveEnvironmentField =
processEnvironmentClass.getDeclaredField("theCaseInsensitiveEnvironment");
theCaseInsensitiveEnvironmentField.setAccessible(true);
Map<String, String> cienv = (Map<String, String>) theCaseInsensitiveEnvironmentField.get(null);
cienv.put(key, value);
Expand Down Expand Up @@ -176,5 +178,4 @@ public enum EnvironmentVariableKey {
NODELAY,
NOEXCEPTION
}

}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2006-2021 Prowide
* Copyright 2006-2023 Prowide
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -55,5 +55,4 @@
* @return year
*/
TargetYear phase4() default TargetYear.SRU2025;

}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2006-2021 Prowide
* Copyright 2006-2023 Prowide
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2006-2021 Prowide
* Copyright 2006-2023 Prowide
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -16,4 +16,4 @@
/**
* Classes to support Prowide deprecation policy: <a href="http://www.prowidesoftware.com/resources/deprecation-policy">Deprecation Policy</a>
*/
package com.prowidesoftware.deprecation;
package com.prowidesoftware.deprecation;
4 changes: 2 additions & 2 deletions src/main/java/com/prowidesoftware/package-info.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2006-2021 Prowide
* Copyright 2006-2023 Prowide
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -16,4 +16,4 @@
/**
* Generic helper classes
*/
package com.prowidesoftware;
package com.prowidesoftware;
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2006-2021 Prowide
* Copyright 2006-2023 Prowide
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -21,7 +21,6 @@
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

import javax.validation.Constraint;
import javax.validation.Payload;

Expand All @@ -45,4 +44,4 @@
Class<?>[] groups() default {};

Class<? extends Payload>[] payload() default {};
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2006-2021 Prowide
* Copyright 2006-2023 Prowide
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -17,10 +17,9 @@

import com.prowidesoftware.swift.model.BIC;
import com.prowidesoftware.swift.model.BicValidationResult;
import org.apache.commons.lang3.StringUtils;

import javax.validation.ConstraintValidator;
import javax.validation.ConstraintValidatorContext;
import org.apache.commons.lang3.StringUtils;

/**
* Implementation of the BIC validation constraint
Expand All @@ -31,8 +30,7 @@
public class BicValidator implements ConstraintValidator<BicConstraint, String> {

@Override
public void initialize(BicConstraint bic) {
}
public void initialize(BicConstraint bic) {}

@Override
public boolean isValid(String bic, ConstraintValidatorContext context) {
Expand All @@ -48,5 +46,4 @@ public boolean isValid(String bic, ConstraintValidatorContext context) {
return false;
}
}

}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2006-2021 Prowide
* Copyright 2006-2023 Prowide
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -21,7 +21,6 @@
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

import javax.validation.Constraint;
import javax.validation.Payload;

Expand All @@ -45,4 +44,4 @@
Class<?>[] groups() default {};

Class<? extends Payload>[] payload() default {};
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2006-2021 Prowide
* Copyright 2006-2023 Prowide
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -16,10 +16,9 @@
package com.prowidesoftware.swift.constraints;

import com.prowidesoftware.swift.utils.IsoUtils;
import org.apache.commons.lang3.StringUtils;

import javax.validation.ConstraintValidator;
import javax.validation.ConstraintValidatorContext;
import org.apache.commons.lang3.StringUtils;

/**
* Implementation of the ISO Alpha-2 country validation constraint
Expand All @@ -30,8 +29,7 @@
public class CountryValidator implements ConstraintValidator<CountryConstraint, String> {

@Override
public void initialize(CountryConstraint country) {
}
public void initialize(CountryConstraint country) {}

@Override
public boolean isValid(String country, ConstraintValidatorContext context) {
Expand All @@ -40,5 +38,4 @@ public boolean isValid(String country, ConstraintValidatorContext context) {
}
return IsoUtils.getInstance().isValidISOCountry(country);
}

}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2006-2021 Prowide
* Copyright 2006-2023 Prowide
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -21,7 +21,6 @@
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

import javax.validation.Constraint;
import javax.validation.Payload;

Expand Down
Loading

0 comments on commit 7128536

Please sign in to comment.