Skip to content

Commit 1d45669

Browse files
committed
CM-2344: Fixed warnings related to unused imports, final modifiers, etc.
1 parent 8dd7346 commit 1d45669

File tree

15 files changed

+37
-43
lines changed

15 files changed

+37
-43
lines changed

comet-examples/src/main/java/ml/comet/examples/mnist/MnistExperimentExample.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ public final class MnistExperimentExample {
4848
* The number of epochs to perform.
4949
*/
5050
@Parameter(names = {"--epochs", "-e"}, description = "number of epochs to perform")
51+
final
5152
int numEpochs = 2;
5253

5354
/**

comet-java-client/src/main/java/ml/comet/experiment/builder/OnlineExperimentBuilder.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ public interface OnlineExperimentBuilder extends BaseCometBuilder<OnlineExperime
3434
/**
3535
* Set the URL of your comet installation.
3636
*
37-
* @param urlOverride full url of comet installation. Default is https://www.comet.ml
37+
* @param urlOverride full url of comet installation. Default is https://www.comet.com
3838
* @return the builder configured with specified URL of the Comet installation.
3939
*/
4040
OnlineExperimentBuilder withUrlOverride(String urlOverride);

comet-java-client/src/main/java/ml/comet/experiment/impl/BaseExperimentAsync.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@
7575
* using asynchronous networking.
7676
*/
7777
abstract class BaseExperimentAsync extends BaseExperiment {
78-
ExperimentContext baseContext;
78+
final ExperimentContext baseContext;
7979

8080
BaseExperimentAsync(@NonNull final String apiKey,
8181
@NonNull final String baseUrl,

comet-java-client/src/main/java/ml/comet/experiment/impl/OnlineExperimentImpl.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -755,7 +755,7 @@ Optional<Action> getLogAssetOnCompleteAction() {
755755
* The runnable to be invoked to send periodic heartbeat ping to mark this experiment as still running.
756756
*/
757757
static class HeartbeatPing implements Runnable {
758-
OnlineExperimentImpl onlineExperiment;
758+
final OnlineExperimentImpl onlineExperiment;
759759

760760
HeartbeatPing(OnlineExperimentImpl onlineExperiment) {
761761
this.onlineExperiment = onlineExperiment;

comet-java-client/src/main/java/ml/comet/experiment/impl/asset/DownloadArtifactAssetOptions.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
package ml.comet.experiment.impl.asset;
22

3-
import lombok.AllArgsConstructor;
43
import lombok.Data;
54
import lombok.EqualsAndHashCode;
65
import lombok.NoArgsConstructor;

comet-java-client/src/main/java/ml/comet/experiment/impl/asset/RemoteAssetImpl.java

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

33
import lombok.EqualsAndHashCode;
44
import lombok.Getter;
5-
import lombok.NoArgsConstructor;
65
import lombok.Setter;
76
import ml.comet.experiment.asset.RemoteAsset;
87

comet-java-client/src/main/java/ml/comet/experiment/impl/log/StdOutLogger.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,11 @@
2020
public class StdOutLogger implements Runnable, Closeable {
2121
final AtomicLong offset = new AtomicLong();
2222

23-
OutputStream outputStream;
24-
InputStream inputStream;
25-
PrintStream original;
26-
OnlineExperiment experiment;
27-
boolean stdOut;
23+
final OutputStream outputStream;
24+
final InputStream inputStream;
25+
final PrintStream original;
26+
final OnlineExperiment experiment;
27+
final boolean stdOut;
2828

2929
/**
3030
* Creates logger instance that captures StdOut stream for a given OnlineExperiment.

comet-java-client/src/main/java/ml/comet/experiment/impl/utils/ExceptionUtils.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
package ml.comet.experiment.impl.utils;
22

3-
import ml.comet.experiment.exception.CometApiException;
4-
53
import java.util.Objects;
64

75
/**

comet-java-client/src/test/java/ml/comet/experiment/impl/ApiExperimentTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,11 @@
3636
@DisplayName("ApiExperimentTest INTEGRATION")
3737
@Tag("integration")
3838
public class ApiExperimentTest {
39-
static Map<String, Object> SOME_METADATA = new HashMap<String, Object>() {{
39+
static final Map<String, Object> SOME_METADATA = new HashMap<String, Object>() {{
4040
put("someString", "string");
4141
put("someInt", 10);
4242
}};
43-
static String SOME_TEXT = "this is some text to be used";
43+
static final String SOME_TEXT = "this is some text to be used";
4444

4545
@Test
4646
public void testApiExperimentInitializedWithInvalidValues() {

comet-java-client/src/test/java/ml/comet/experiment/impl/ArtifactImplTest.java

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -35,20 +35,20 @@
3535
@DisplayName("Artifact")
3636
public class ArtifactImplTest extends AssetsBaseTest {
3737

38-
static String SOME_ARTIFACT_NAME = "artifactName";
39-
static String SOME_ARTIFACT_TYPE = "artifactType";
40-
static List<String> SOME_ALIASES = Arrays.asList("one", "two", "three", "three");
41-
static Set<String> UNIQUE_ALIASES = new HashSet<>(SOME_ALIASES);
42-
static List<String> SOME_TAGS = Arrays.asList("tag_1", "tag_2", "tag_3", "tag_3");
43-
static Set<String> UNIQUE_TAGS = new HashSet<>(SOME_TAGS);
44-
static String SOME_VERSION = "1.2.3-beta.4+sha899d8g79f87";
45-
static String INVALID_VERSION = "1.2";
46-
static Map<String, Object> SOME_METADATA = new HashMap<String, Object>() {{
38+
static final String SOME_ARTIFACT_NAME = "artifactName";
39+
static final String SOME_ARTIFACT_TYPE = "artifactType";
40+
static final List<String> SOME_ALIASES = Arrays.asList("one", "two", "three", "three");
41+
static final Set<String> UNIQUE_ALIASES = new HashSet<>(SOME_ALIASES);
42+
static final List<String> SOME_TAGS = Arrays.asList("tag_1", "tag_2", "tag_3", "tag_3");
43+
static final Set<String> UNIQUE_TAGS = new HashSet<>(SOME_TAGS);
44+
static final String SOME_VERSION = "1.2.3-beta.4+sha899d8g79f87";
45+
static final String INVALID_VERSION = "1.2";
46+
static final Map<String, Object> SOME_METADATA = new HashMap<String, Object>() {{
4747
put("someString", "string");
4848
put("someInt", 10);
4949
}};
50-
static String SOME_REMOTE_ASSET_LINK = "s3://bucket/folder/someFile";
51-
static String SOME_REMOTE_ASSET_NAME = "someRemoteAsset";
50+
static final String SOME_REMOTE_ASSET_LINK = "s3://bucket/folder/someFile";
51+
static final String SOME_REMOTE_ASSET_NAME = "someRemoteAsset";
5252

5353
@Test
5454
@DisplayName("is created with newArtifact()")
@@ -143,7 +143,7 @@ void hasNoAssets() {
143143
class AfterAddingFileAssetTest {
144144
File assetFile;
145145
String assetFileName;
146-
boolean overwrite = true;
146+
final boolean overwrite = true;
147147

148148
@BeforeEach
149149
void addFileAsset() {
@@ -175,7 +175,7 @@ void throwsExceptionWhenAddingSameName() {
175175
class AfterAddingFileLikeAssetTest {
176176
byte[] data;
177177
String assetFileName;
178-
boolean overwrite = true;
178+
final boolean overwrite = true;
179179

180180
@BeforeEach
181181
void addFileLikeAsset() {
@@ -207,7 +207,7 @@ void throwsExceptionWhenAddingSameName() {
207207
class AfterAddingRemoteAssetTest {
208208
URI uri;
209209
String assetFileName;
210-
boolean overwrite = true;
210+
final boolean overwrite = true;
211211

212212
@BeforeEach
213213
void addRemoteAsset() throws URISyntaxException {
@@ -238,8 +238,8 @@ void throwsExceptionWhenAddingSameName() {
238238
@Nested
239239
@DisplayName("after adding assets folder")
240240
class AfterAddingAssetsFolderTest {
241-
boolean logFilePath = true;
242-
boolean recursive = true;
241+
final boolean logFilePath = true;
242+
final boolean recursive = true;
243243

244244
@BeforeEach
245245
void addAssetsFolder() throws IOException {

0 commit comments

Comments
 (0)