Skip to content

Commit

Permalink
Upgrade Gradle 7.6 and dependencies (#1393)
Browse files Browse the repository at this point in the history
Signed-off-by: Bala.FA <[email protected]>
  • Loading branch information
balamurugana committed Dec 12, 2022
1 parent d0f789d commit 8c7a5be
Show file tree
Hide file tree
Showing 12 changed files with 66 additions and 57 deletions.
12 changes: 6 additions & 6 deletions .github/workflows/gradle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,12 @@ jobs:
name: Test on java-version ${{ matrix.java-version }} and ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
max-parallel: 4
matrix:
java-version: ['8.0.x', '11.0.x']
java-version: ['8', '11', '17']
os: [ubuntu-latest, windows-latest]

steps:
- uses: actions/checkout@master
- uses: actions/checkout@v3
- name: Check limited Guava usage
if: matrix.os == 'ubuntu-latest'
run: |
Expand All @@ -28,14 +27,15 @@ jobs:
exit 1
fi
- name: Setup java
uses: actions/setup-java@v1
uses: actions/setup-java@v3
with:
distribution: temurin
java-version: ${{ matrix.java-version }}
- name: Set environment variables
run: |
echo "DEV_VERSION=$(./gradlew properties | awk '/^version:/ { print $2 }')" >> $GITHUB_ENV
echo "RELEASE_VERSION=$(./gradlew properties -Prelease | awk '/^version:/ { print $2 }')" >> $GITHUB_ENV
- name: Gradle build on ${{ matrix.java-version }}
- name: Gradle build on java ${{ matrix.java-version }}
if: matrix.os == 'ubuntu-latest'
run: |
./gradlew build
Expand All @@ -46,7 +46,7 @@ jobs:
./gradlew build -Prelease
javac -cp api/build/libs/minio-${RELEASE_VERSION}-all.jar functional/TestUserAgent.java
java -Dversion=${RELEASE_VERSION} -cp api/build/libs/minio-${RELEASE_VERSION}-all.jar:functional TestUserAgent
- name: Gradle build on ${{ matrix.java-version }}
- name: Gradle build on java ${{ matrix.java-version }}
if: matrix.os == 'windows-latest'
run: |
$Env:Path += ';.'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ public Map<String, BucketUsageInfo> bucketsUsageInfo() {
}

public Map<String, Long> bucketsSizes() {
return bucketsSizes;
return Collections.unmodifiableMap(bucketsSizes);
}

public AllTierStats tierStats() {
Expand Down
1 change: 1 addition & 0 deletions api/src/main/java/io/minio/MinioProperties.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
import java.util.logging.Logger;

/** Identifies and stores version information of minio-java package at run time. */
@edu.umd.cs.findbugs.annotations.SuppressFBWarnings(value = "MS_EXPOSE_REP")
public enum MinioProperties {
INSTANCE;

Expand Down
12 changes: 2 additions & 10 deletions api/src/main/java/io/minio/errors/XmlParserException.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,7 @@
public class XmlParserException extends MinioException {
private static final long serialVersionUID = -3877568719271880309L;

Exception exception;

public XmlParserException(Exception exception) {
super();
this.exception = exception;
}

@Override
public String toString() {
return exception.toString();
public XmlParserException(Exception e) {
super(e.toString());
}
}
8 changes: 6 additions & 2 deletions api/src/main/java/io/minio/messages/Event.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@

import com.fasterxml.jackson.annotation.JsonProperty;
import java.time.ZonedDateTime;
import java.util.Collections;
import java.util.HashMap;
import java.util.Map;

/** Helper class to denote single event record for {@link NotificationRecords}. */
Expand Down Expand Up @@ -58,11 +60,13 @@ public String userId() {
}

public Map<String, String> requestParameters() {
return requestParameters;
return Collections.unmodifiableMap(
requestParameters == null ? new HashMap<>() : requestParameters);
}

public Map<String, String> responseElements() {
return responseElements;
return Collections.unmodifiableMap(
responseElements == null ? new HashMap<>() : responseElements);
}

public String bucketName() {
Expand Down
4 changes: 3 additions & 1 deletion api/src/main/java/io/minio/messages/NotificationRecords.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
package io.minio.messages;

import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.Collections;
import java.util.LinkedList;
import java.util.List;

/**
Expand All @@ -33,6 +35,6 @@ public class NotificationRecords {
private List<Event> events;

public List<Event> events() {
return events;
return Collections.unmodifiableList(events == null ? new LinkedList<>() : events);
}
}
4 changes: 3 additions & 1 deletion api/src/main/java/io/minio/messages/ObjectMetadata.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
package io.minio.messages;

import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.Collections;
import java.util.HashMap;
import java.util.Map;

/** Helper class to denote object information for {@link EventMetadata}. */
Expand Down Expand Up @@ -50,6 +52,6 @@ public String sequencer() {
}

public Map<String, String> userMetadata() {
return userMetadata;
return Collections.unmodifiableMap(userMetadata == null ? new HashMap<>() : userMetadata);
}
}
52 changes: 26 additions & 26 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,15 @@
*/

/***************************/
/* gradleVersion = '6.6.1' */
/* gradleVersion = '7.6' */
/***************************/

plugins {
id "com.github.johnrengelman.shadow" version "6.1.0"
id "com.github.spotbugs" version "4.5.0"
id "io.codearte.nexus-staging" version "0.22.0"
id "com.github.johnrengelman.shadow" version "7.1.2"
id "com.github.spotbugs" version "5.0.13"
id "io.codearte.nexus-staging" version "0.30.0"
id "de.marcphilipp.nexus-publish" version "0.4.0"
id "com.diffplug.spotless" version "5.3.0"
id "com.diffplug.spotless" version "6.12.0"
}

/*
Expand All @@ -34,7 +34,7 @@ apply plugin: "de.marcphilipp.nexus-publish"

allprojects {
group = 'io.minio'
version = '8.4.7'
version = '8.5.0'
if (!project.hasProperty('release')) {
version += '-DEV'
}
Expand All @@ -51,15 +51,15 @@ subprojects {
}

dependencies {
compile "com.carrotsearch.thirdparty:simple-xml-safe:2.7.1"
compile "com.google.guava:guava:30.1.1-jre"
compile "com.squareup.okhttp3:okhttp:4.10.0"
compile "com.fasterxml.jackson.core:jackson-annotations:2.13.4"
compile "com.fasterxml.jackson.core:jackson-core:2.13.4"
compile "com.fasterxml.jackson.core:jackson-databind:2.13.4.2"
compile "org.bouncycastle:bcprov-jdk15on:1.69"
compile 'org.apache.commons:commons-compress:1.21'
compile "org.xerial.snappy:snappy-java:1.1.8.4"
implementation "com.carrotsearch.thirdparty:simple-xml-safe:2.7.1"
implementation "com.google.guava:guava:30.1.1-jre"
implementation "com.squareup.okhttp3:okhttp:4.10.0"
implementation "com.fasterxml.jackson.core:jackson-annotations:2.13.4"
implementation "com.fasterxml.jackson.core:jackson-core:2.13.4"
implementation "com.fasterxml.jackson.core:jackson-databind:2.13.4.2"
implementation "org.bouncycastle:bcprov-jdk15on:1.69"
implementation 'org.apache.commons:commons-compress:1.21'
implementation "org.xerial.snappy:snappy-java:1.1.8.4"
compileOnly "com.github.spotbugs:spotbugs-annotations:4.1.2"

testImplementation "com.squareup.okhttp3:mockwebserver:4.8.1"
Expand All @@ -81,8 +81,8 @@ subprojects {
spotbugsMain {
reports {
html {
enabled = true
destination = file("$buildDir/reports/spotbugs/main/spotbugs.html")
required = true
outputLocation = file("$buildDir/reports/spotbugs/main/spotbugs.html")
stylesheet = 'fancy-hist.xsl'
}
}
Expand Down Expand Up @@ -116,7 +116,7 @@ subprojects {
target '**/*.java'
importOrder 'edu', 'com', 'io', 'java', 'javax', 'org', ''
removeUnusedImports()
googleJavaFormat()
googleJavaFormat('1.7')
}
groovyGradle {
target '*.gradle'
Expand Down Expand Up @@ -241,8 +241,8 @@ project(':adminapi') {
archivesBaseName = 'minio-admin'

dependencies {
compile project(':api')
compile "com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.13.4"
implementation project(':api')
implementation "com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.13.4"
testImplementation project(':api')
}

Expand Down Expand Up @@ -346,8 +346,8 @@ project(':adminapi') {

project(':examples') {
dependencies {
compile "me.tongfei:progressbar:0.5.3"
compile project(':api')
compileOnly "me.tongfei:progressbar:0.5.3"
compileOnly project(':api')
}

sourceSets {
Expand All @@ -363,9 +363,9 @@ import org.gradle.internal.os.OperatingSystem;

project(':functional') {
dependencies {
compile "junit:junit:4.13.2"
compile project(':api')
compile project(':adminapi')
implementation "junit:junit:4.13.2"
implementation project(':api')
implementation project(':adminapi')
}

sourceSets {
Expand All @@ -377,7 +377,7 @@ project(':functional') {
}

task runFunctionalTest(type:JavaExec) {
main = 'FunctionalTest'
mainClass = 'FunctionalTest'
classpath = sourceSets.main.runtimeClasspath

ext.endpoint = 'https://play.min.io:9000'
Expand Down
14 changes: 5 additions & 9 deletions examples/PutObjectUiProgressBar.java
Original file line number Diff line number Diff line change
Expand Up @@ -35,18 +35,15 @@ public class PutObjectUiProgressBar extends JFrame {

private static final long serialVersionUID = 1L;
private static final String defaultFileName = "/etc/issue";
private JButton button;
private JButton button = null;

PutObjectUiProgressBar() {
button = new JButton("Click here to upload !");
ButtonActionListener bal = new ButtonActionListener();
button.addActionListener(bal);

this.getContentPane().add(button);
}
PutObjectUiProgressBar() {}

/** go() implements a blocking UI frame. */
public void go() {
button = new JButton("Click here to upload!");
button.addActionListener(new ButtonActionListener());
this.getContentPane().add(button);

this.setLocationRelativeTo(null);
this.setVisible(true);
Expand Down Expand Up @@ -97,7 +94,6 @@ private void uploadFile(String fileName)

/** Internal class extends button listener, adds methods to initiate upload operation. */
private class ButtonActionListener implements ActionListener {

@Override
public void actionPerformed(ActionEvent e) {

Expand Down
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.6.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
12 changes: 12 additions & 0 deletions spotbugs-filter.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,16 @@
<Match>
<Bug code="RCN" />
</Match>
<!-- False positive: Random object created and used only once. -->
<Match>
<Bug pattern="DMI_RANDOM_USED_ONLY_ONCE"/>
</Match>
<!-- False positive in many cases: May expose internal representation by returning reference to mutable object. -->
<Match>
<Bug pattern="EI_EXPOSE_REP"/>
</Match>
<!-- False positive in many cases: May expose internal representation by incorporating reference to mutable object. -->
<Match>
<Bug pattern="EI_EXPOSE_REP2"/>
</Match>
</FindBugsFilter>

0 comments on commit 8c7a5be

Please sign in to comment.