Skip to content

Commit d2a2a65

Browse files
author
Eugen Paraschiv
committed
cleanup work
1 parent 14bf9a2 commit d2a2a65

193 files changed

Lines changed: 1550 additions & 2434 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎libraries/helloWorld.docx‎

6 Bytes
Binary file not shown.

‎libraries/src/main/java/com/baeldung/bouncycastle/BouncyCastleCrypto.java‎

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -42,26 +42,22 @@
4242

4343
public class BouncyCastleCrypto {
4444

45-
public static byte[] signData(byte[] data, final X509Certificate signingCertificate, final PrivateKey signingKey)
46-
throws CertificateEncodingException, OperatorCreationException, CMSException, IOException {
45+
public static byte[] signData(byte[] data, final X509Certificate signingCertificate, final PrivateKey signingKey) throws CertificateEncodingException, OperatorCreationException, CMSException, IOException {
4746
byte[] signedMessage = null;
4847
List<X509Certificate> certList = new ArrayList<X509Certificate>();
4948
CMSTypedData cmsData = new CMSProcessableByteArray(data);
5049
certList.add(signingCertificate);
5150
Store certs = new JcaCertStore(certList);
5251
CMSSignedDataGenerator cmsGenerator = new CMSSignedDataGenerator();
5352
ContentSigner contentSigner = new JcaContentSignerBuilder("SHA256withRSA").build(signingKey);
54-
cmsGenerator.addSignerInfoGenerator(
55-
new JcaSignerInfoGeneratorBuilder(new JcaDigestCalculatorProviderBuilder().setProvider("BC").build())
56-
.build(contentSigner, signingCertificate));
53+
cmsGenerator.addSignerInfoGenerator(new JcaSignerInfoGeneratorBuilder(new JcaDigestCalculatorProviderBuilder().setProvider("BC").build()).build(contentSigner, signingCertificate));
5754
cmsGenerator.addCertificates(certs);
5855
CMSSignedData cms = cmsGenerator.generate(cmsData, true);
5956
signedMessage = cms.getEncoded();
6057
return signedMessage;
6158
}
6259

63-
public static boolean verifSignData(final byte[] signedData)
64-
throws CMSException, IOException, OperatorCreationException, CertificateException {
60+
public static boolean verifSignData(final byte[] signedData) throws CMSException, IOException, OperatorCreationException, CertificateException {
6561
ByteArrayInputStream bIn = new ByteArrayInputStream(signedData);
6662
ASN1InputStream aIn = new ASN1InputStream(bIn);
6763
CMSSignedData s = new CMSSignedData(ContentInfo.getInstance(aIn.readObject()));
@@ -81,16 +77,14 @@ public static boolean verifSignData(final byte[] signedData)
8177
return true;
8278
}
8379

84-
public static byte[] encryptData(final byte[] data, X509Certificate encryptionCertificate)
85-
throws CertificateEncodingException, CMSException, IOException {
80+
public static byte[] encryptData(final byte[] data, X509Certificate encryptionCertificate) throws CertificateEncodingException, CMSException, IOException {
8681
byte[] encryptedData = null;
8782
if (null != data && null != encryptionCertificate) {
8883
CMSEnvelopedDataGenerator cmsEnvelopedDataGenerator = new CMSEnvelopedDataGenerator();
8984
JceKeyTransRecipientInfoGenerator jceKey = new JceKeyTransRecipientInfoGenerator(encryptionCertificate);
9085
cmsEnvelopedDataGenerator.addRecipientInfoGenerator(jceKey);
9186
CMSTypedData msg = new CMSProcessableByteArray(data);
92-
OutputEncryptor encryptor = new JceCMSContentEncryptorBuilder(CMSAlgorithm.AES128_CBC).setProvider("BC")
93-
.build();
87+
OutputEncryptor encryptor = new JceCMSContentEncryptorBuilder(CMSAlgorithm.AES128_CBC).setProvider("BC").build();
9488
CMSEnvelopedData cmsEnvelopedData = cmsEnvelopedDataGenerator.generate(msg, encryptor);
9589
encryptedData = cmsEnvelopedData.getEncoded();
9690
}

‎libraries/src/main/java/com/baeldung/bytebuddy/Bar.java‎

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,17 @@
55
public class Bar {
66

77
@BindingPriority(3)
8-
public static String sayHelloBar() { return "Holla in Bar!"; }
8+
public static String sayHelloBar() {
9+
return "Holla in Bar!";
10+
}
911

1012
@BindingPriority(2)
11-
public static String sayBar() { return "bar"; }
12-
13-
public String bar() { return Bar.class.getSimpleName() + " - Bar"; }
13+
public static String sayBar() {
14+
return "bar";
15+
}
1416

17+
public String bar() {
18+
return Bar.class.getSimpleName() + " - Bar";
19+
}
1520

1621
}

‎libraries/src/main/java/com/baeldung/bytebuddy/Foo.java‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
public class Foo {
44

5-
public String sayHelloFoo() { return "Hello in Foo!"; }
5+
public String sayHelloFoo() {
6+
return "Hello in Foo!";
7+
}
68

79
}

‎libraries/src/main/java/com/baeldung/caffeine/DataObject.java‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,7 @@ public String getData() {
1919

2020
@Override
2121
public String toString() {
22-
return "DataObject{" +
23-
"data='" + data + '\'' +
24-
'}';
22+
return "DataObject{" + "data='" + data + '\'' + '}';
2523
}
2624

2725
public static DataObject get(String data) {

‎libraries/src/main/java/com/baeldung/chronicle/queue/ChronicleQueue.java‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,7 @@
77

88
public class ChronicleQueue {
99

10-
static void writeToQueue(
11-
Chronicle chronicle, String stringValue, int intValue, long longValue, double doubleValue)
12-
throws IOException {
10+
static void writeToQueue(Chronicle chronicle, String stringValue, int intValue, long longValue, double doubleValue) throws IOException {
1311
ExcerptAppender appender = chronicle.createAppender();
1412
appender.startExcerpt();
1513
appender.writeUTF(stringValue);

‎libraries/src/main/java/com/baeldung/commons/beanutils/CourseEntity.java‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ public List<String> getCodes() {
2424
public void setCodes(List<String> codes) {
2525
this.codes = codes;
2626
}
27-
27+
2828
public void setStudent(String id, Student student) {
2929
students.put(id, student);
3030
}

‎libraries/src/main/java/com/baeldung/commons/beanutils/CourseService.java‎

Lines changed: 9 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -8,33 +8,27 @@
88

99
public class CourseService {
1010

11-
public static void setValues(Course course, String name, List<String> codes)
12-
throws IllegalAccessException, InvocationTargetException, NoSuchMethodException {
11+
public static void setValues(Course course, String name, List<String> codes) throws IllegalAccessException, InvocationTargetException, NoSuchMethodException {
1312
// Setting the simple properties
1413
PropertyUtils.setSimpleProperty(course, "name", name);
1514
PropertyUtils.setSimpleProperty(course, "codes", codes);
1615
}
17-
18-
public static void setIndexedValue(Course course, int codeIndex, String code)
19-
throws IllegalAccessException, InvocationTargetException, NoSuchMethodException {
16+
17+
public static void setIndexedValue(Course course, int codeIndex, String code) throws IllegalAccessException, InvocationTargetException, NoSuchMethodException {
2018
// Setting the indexed properties
2119
PropertyUtils.setIndexedProperty(course, "codes[" + codeIndex + "]", code);
2220
}
2321

24-
public static void setMappedValue(Course course, String enrollId, Student student)
25-
throws IllegalAccessException, InvocationTargetException, NoSuchMethodException {
22+
public static void setMappedValue(Course course, String enrollId, Student student) throws IllegalAccessException, InvocationTargetException, NoSuchMethodException {
2623
// Setting the mapped properties
2724
PropertyUtils.setMappedProperty(course, "enrolledStudent(" + enrollId + ")", student);
2825
}
29-
30-
public static String getNestedValue(Course course, String enrollId, String nestedPropertyName)
31-
throws IllegalAccessException, InvocationTargetException, NoSuchMethodException {
32-
return (String) PropertyUtils.getNestedProperty(
33-
course, "enrolledStudent(" + enrollId + ")." + nestedPropertyName);
26+
27+
public static String getNestedValue(Course course, String enrollId, String nestedPropertyName) throws IllegalAccessException, InvocationTargetException, NoSuchMethodException {
28+
return (String) PropertyUtils.getNestedProperty(course, "enrolledStudent(" + enrollId + ")." + nestedPropertyName);
3429
}
35-
36-
public static void copyProperties(Course course, CourseEntity courseEntity)
37-
throws IllegalAccessException, InvocationTargetException {
30+
31+
public static void copyProperties(Course course, CourseEntity courseEntity) throws IllegalAccessException, InvocationTargetException {
3832
BeanUtils.copyProperties(course, courseEntity);
3933
}
4034
}

‎libraries/src/main/java/com/baeldung/commons/chain/AuditFilter.java‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ public class AuditFilter implements Filter {
77

88
@Override
99
public boolean postprocess(Context context, Exception exception) {
10-
// Send notification to customer & bank.
10+
// Send notification to customer & bank.
1111
return false;
1212
}
1313

‎libraries/src/main/java/com/baeldung/commons/collectionutil/Customer.java‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ public Customer(Integer id, String name, Long phone) {
7373
this.name = name;
7474
this.phone = phone;
7575
}
76-
76+
7777
public Customer(String name) {
7878
super();
7979
this.name = name;

0 commit comments

Comments
 (0)