* Does not return any request specific results. */ diff --git a/src/main/java/org/hyperledger/fabric/sdk/LifecycleApproveChaincodeDefinitionForMyOrgRequest.java b/src/main/java/org/hyperledger/fabric/sdk/LifecycleApproveChaincodeDefinitionForMyOrgRequest.java index 04ecfac4..d3531de3 100644 --- a/src/main/java/org/hyperledger/fabric/sdk/LifecycleApproveChaincodeDefinitionForMyOrgRequest.java +++ b/src/main/java/org/hyperledger/fabric/sdk/LifecycleApproveChaincodeDefinitionForMyOrgRequest.java @@ -8,8 +8,6 @@ package org.hyperledger.fabric.sdk; -import java.util.Collection; - import com.google.protobuf.ByteString; import org.hyperledger.fabric.sdk.exception.InvalidArgumentException; import org.hyperledger.fabric.sdk.helper.Config; @@ -17,7 +15,7 @@ /** * LifecycleApproveChaincodeDefinitionForMyOrgRequest parameters for approving chaincode with lifecycle. - * Send to peers with {@link Channel#sendLifecycleApproveChaincodeDefinitionForMyOrgProposal(LifecycleApproveChaincodeDefinitionForMyOrgRequest, Collection)} + * Send to peers with {@link Channel#sendLifecycleApproveChaincodeDefinitionForMyOrgProposal(LifecycleApproveChaincodeDefinitionForMyOrgRequest, java.util.Collection)} */ public class LifecycleApproveChaincodeDefinitionForMyOrgRequest extends LifecycleRequest { private static final Config config = Config.getConfig(); diff --git a/src/main/java/org/hyperledger/fabric/sdk/LifecycleChaincodeEndorsementPolicy.java b/src/main/java/org/hyperledger/fabric/sdk/LifecycleChaincodeEndorsementPolicy.java index ddf13785..bc3ac3c1 100644 --- a/src/main/java/org/hyperledger/fabric/sdk/LifecycleChaincodeEndorsementPolicy.java +++ b/src/main/java/org/hyperledger/fabric/sdk/LifecycleChaincodeEndorsementPolicy.java @@ -8,18 +8,6 @@ package org.hyperledger.fabric.sdk; -import java.io.FileInputStream; -import java.io.IOException; -import java.io.InputStream; -import java.nio.file.Files; -import java.nio.file.Path; -import java.util.HashMap; -import java.util.LinkedHashMap; -import java.util.List; -import java.util.Map; -import java.util.regex.Matcher; -import java.util.regex.Pattern; - import com.google.protobuf.ByteString; import io.grpc.netty.shaded.io.netty.util.internal.StringUtil; import org.apache.commons.io.IOUtils; @@ -33,6 +21,17 @@ import org.yaml.snakeyaml.Yaml; import org.yaml.snakeyaml.constructor.SafeConstructor; +import java.io.IOException; +import java.io.InputStream; +import java.nio.file.Files; +import java.nio.file.Path; +import java.util.HashMap; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + import static java.lang.String.format; /** diff --git a/src/main/java/org/hyperledger/fabric/sdk/LifecycleCommitChaincodeDefinitionProposalResponse.java b/src/main/java/org/hyperledger/fabric/sdk/LifecycleCommitChaincodeDefinitionProposalResponse.java index f0f9adce..547a96c9 100644 --- a/src/main/java/org/hyperledger/fabric/sdk/LifecycleCommitChaincodeDefinitionProposalResponse.java +++ b/src/main/java/org/hyperledger/fabric/sdk/LifecycleCommitChaincodeDefinitionProposalResponse.java @@ -8,13 +8,11 @@ package org.hyperledger.fabric.sdk; -import java.util.Collection; - import org.hyperledger.fabric.sdk.transaction.TransactionContext; /** * Response to a {@link LifecycleCommitChaincodeDefinitionRequest} - * Also see {@link Channel#sendLifecycleCommitChaincodeDefinitionProposal(LifecycleCommitChaincodeDefinitionRequest, Collection)}} + * Also see {@link Channel#sendLifecycleCommitChaincodeDefinitionProposal(LifecycleCommitChaincodeDefinitionRequest, java.util.Collection)}} *
* Response does not return any request specific parameters.
*/
diff --git a/src/main/java/org/hyperledger/fabric/sdk/LifecycleInstallChaincodeRequest.java b/src/main/java/org/hyperledger/fabric/sdk/LifecycleInstallChaincodeRequest.java
index 718d9ce5..17fa0cc6 100644
--- a/src/main/java/org/hyperledger/fabric/sdk/LifecycleInstallChaincodeRequest.java
+++ b/src/main/java/org/hyperledger/fabric/sdk/LifecycleInstallChaincodeRequest.java
@@ -8,13 +8,11 @@
package org.hyperledger.fabric.sdk;
-import java.util.Collection;
-
import org.hyperledger.fabric.sdk.exception.InvalidArgumentException;
/**
* LifecycleInstallChaincodeRequest parameters for installing chaincode with lifecycle
- * see also {@link HFClient#sendLifecycleInstallChaincodeRequest(LifecycleInstallChaincodeRequest, Collection)}
+ * see also {@link HFClient#sendLifecycleInstallChaincodeRequest(LifecycleInstallChaincodeRequest, java.util.Collection)}
*/
public class LifecycleInstallChaincodeRequest extends LifecycleRequest {
diff --git a/src/main/java/org/hyperledger/fabric/sdk/LifecycleQueryChaincodeDefinitionsRequest.java b/src/main/java/org/hyperledger/fabric/sdk/LifecycleQueryChaincodeDefinitionsRequest.java
index 2a6d7db7..a90e1514 100644
--- a/src/main/java/org/hyperledger/fabric/sdk/LifecycleQueryChaincodeDefinitionsRequest.java
+++ b/src/main/java/org/hyperledger/fabric/sdk/LifecycleQueryChaincodeDefinitionsRequest.java
@@ -8,11 +8,9 @@
package org.hyperledger.fabric.sdk;
-import java.util.Collection;
-
/**
* Request for definitions of commited chaincode.
- * See also {@link Channel#lifecycleQueryChaincodeDefinitions(LifecycleQueryChaincodeDefinitionsRequest, Collection)}
+ * See also {@link Channel#lifecycleQueryChaincodeDefinitions(LifecycleQueryChaincodeDefinitionsRequest, java.util.Collection)}
*/
public final class LifecycleQueryChaincodeDefinitionsRequest extends LifecycleRequest {
LifecycleQueryChaincodeDefinitionsRequest(User userContext) {
diff --git a/src/main/java/org/hyperledger/fabric/sdk/LifecycleQueryInstalledChaincodeProposalResponse.java b/src/main/java/org/hyperledger/fabric/sdk/LifecycleQueryInstalledChaincodeProposalResponse.java
index cbf7498c..49f5303a 100644
--- a/src/main/java/org/hyperledger/fabric/sdk/LifecycleQueryInstalledChaincodeProposalResponse.java
+++ b/src/main/java/org/hyperledger/fabric/sdk/LifecycleQueryInstalledChaincodeProposalResponse.java
@@ -8,8 +8,6 @@
package org.hyperledger.fabric.sdk;
-import java.nio.file.Path;
-
import com.google.protobuf.ByteString;
import org.hyperledger.fabric.protos.peer.ProposalResponsePackage;
import org.hyperledger.fabric.protos.peer.lifecycle.Lifecycle;
@@ -72,7 +70,7 @@ public String getPackageId() throws ProposalException {
}
/**
- * The lable used by this chaincode. This is defined by the installed chaincode. See label parameter in {@link LifecycleChaincodePackage#fromSource(String, Path, TransactionRequest.Type, String, Path)}
+ * The lable used by this chaincode. This is defined by the installed chaincode. See label parameter in {@link LifecycleChaincodePackage#fromSource(String, java.nio.file.Path, TransactionRequest.Type, String, java.nio.file.Path)}
* @return the label
* @throws ProposalException
*/
diff --git a/src/main/java/org/hyperledger/fabric/sdk/LifecycleQueryInstalledChaincodesProposalResponse.java b/src/main/java/org/hyperledger/fabric/sdk/LifecycleQueryInstalledChaincodesProposalResponse.java
index 9143ceec..0921f7c4 100644
--- a/src/main/java/org/hyperledger/fabric/sdk/LifecycleQueryInstalledChaincodesProposalResponse.java
+++ b/src/main/java/org/hyperledger/fabric/sdk/LifecycleQueryInstalledChaincodesProposalResponse.java
@@ -8,7 +8,6 @@
package org.hyperledger.fabric.sdk;
-import java.nio.file.Path;
import java.util.ArrayList;
import java.util.Collection;
@@ -75,7 +74,7 @@ public class LifecycleQueryInstalledChaincodesResult {
}
/**
- * The label used by this chaincode. This is defined by the installed chaincode. See label parameter in {@link LifecycleChaincodePackage#fromSource(String, Path, TransactionRequest.Type, String, Path)}
+ * The label used by this chaincode. This is defined by the installed chaincode. See label parameter in {@link LifecycleChaincodePackage#fromSource(String, java.nio.file.Path, TransactionRequest.Type, String, java.nio.file.Path)}
*
* @return Label
*/
diff --git a/src/main/java/org/hyperledger/fabric/sdk/helper/Config.java b/src/main/java/org/hyperledger/fabric/sdk/helper/Config.java
index c8a5599d..fdc886e7 100644
--- a/src/main/java/org/hyperledger/fabric/sdk/helper/Config.java
+++ b/src/main/java/org/hyperledger/fabric/sdk/helper/Config.java
@@ -213,7 +213,6 @@ private Config() {
org.apache.log4j.Level setTo;
switch (inLogLevel.toUpperCase()) {
-
case "TRACE":
setTo = org.apache.log4j.Level.TRACE;
break;
@@ -237,22 +236,18 @@ private Config() {
default:
setTo = Level.INFO;
break;
-
}
if (null != setTo) {
org.apache.log4j.Logger.getLogger("org.hyperledger.fabric").setLevel(setTo);
}
-
}
openTelemetry = AutoConfiguredOpenTelemetrySdk
- .builder()
- .setResultAsGlobal(false)
- .build()
- .getOpenTelemetrySdk();
+ .builder()
+ .build()
+ .getOpenTelemetrySdk();
}
-
}
/**
@@ -265,7 +260,6 @@ public static Config getConfig() {
config = new Config();
}
return config;
-
}
/**
diff --git a/src/main/java/org/hyperledger/fabric/sdk/security/CryptoSuiteFactory.java b/src/main/java/org/hyperledger/fabric/sdk/security/CryptoSuiteFactory.java
index b56c4c37..b3fed1e2 100644
--- a/src/main/java/org/hyperledger/fabric/sdk/security/CryptoSuiteFactory.java
+++ b/src/main/java/org/hyperledger/fabric/sdk/security/CryptoSuiteFactory.java
@@ -21,7 +21,6 @@
import org.hyperledger.fabric.sdk.exception.CryptoException;
import org.hyperledger.fabric.sdk.exception.InvalidArgumentException;
-import org.hyperledger.fabric.sdk.helper.Config;
/**
* Factory to produce a set of crypto suite implementations offering differing cryptographic algorithms and strengths.
@@ -60,7 +59,7 @@ public interface CryptoSuiteFactory {
/**
* This will return the default Crypto Suite Factory implementation.
* Can be overwritten by org.hyperledger.fabric.sdk.crypto.default_crypto_suite_factory property.
- * see {@link Config#getDefaultCryptoSuiteFactory()}
+ * see {@link org.hyperledger.fabric.sdk.helper.Config#getDefaultCryptoSuiteFactory()}
* Classes specified by this property must implement a public static method instance that
* returns back a single instance of this factory.
*
diff --git a/src/main/java/org/hyperledger/fabric_ca/sdk/HFCAAffiliation.java b/src/main/java/org/hyperledger/fabric_ca/sdk/HFCAAffiliation.java
index 61d41d6c..8a4987cd 100644
--- a/src/main/java/org/hyperledger/fabric_ca/sdk/HFCAAffiliation.java
+++ b/src/main/java/org/hyperledger/fabric_ca/sdk/HFCAAffiliation.java
@@ -387,7 +387,7 @@ public HFCAAffiliationResp delete(User registrar, boolean force) throws Affiliat
AffiliationException affiliationException = new AffiliationException(msg, e);
logger.error(msg);
throw affiliationException;
- } catch (Exception e) {
+ } catch (Exception e) {
String msg = format("Error while deleting affiliation %s url: %s %s ", this.name, deleteURL, e.getMessage());
AffiliationException affiliationException = new AffiliationException(msg, e);
logger.error(msg);
diff --git a/src/main/java/org/hyperledger/fabric_ca/sdk/HFCAClient.java b/src/main/java/org/hyperledger/fabric_ca/sdk/HFCAClient.java
index f5c495a0..34637c27 100644
--- a/src/main/java/org/hyperledger/fabric_ca/sdk/HFCAClient.java
+++ b/src/main/java/org/hyperledger/fabric_ca/sdk/HFCAClient.java
@@ -14,55 +14,6 @@
package org.hyperledger.fabric_ca.sdk;
-import java.io.BufferedInputStream;
-import java.io.ByteArrayInputStream;
-import java.io.File;
-import java.io.IOException;
-import java.io.PrintWriter;
-import java.io.StringReader;
-import java.io.StringWriter;
-import java.net.MalformedURLException;
-import java.net.Socket;
-import java.net.URISyntaxException;
-import java.net.URL;
-import java.nio.charset.StandardCharsets;
-import java.nio.file.Files;
-import java.nio.file.Paths;
-import java.security.KeyFactory;
-import java.security.KeyManagementException;
-import java.security.KeyPair;
-import java.security.KeyStore;
-import java.security.KeyStoreException;
-import java.security.NoSuchAlgorithmException;
-import java.security.PublicKey;
-import java.security.UnrecoverableKeyException;
-import java.security.cert.CertificateException;
-import java.security.cert.CertificateFactory;
-import java.security.cert.X509Certificate;
-import java.security.spec.InvalidKeySpecException;
-import java.security.spec.X509EncodedKeySpec;
-import java.util.ArrayList;
-import java.util.Base64;
-import java.util.Collection;
-import java.util.Date;
-import java.util.Map;
-import java.util.Map.Entry;
-import java.util.Properties;
-
-import javax.json.Json;
-import javax.json.JsonArray;
-import javax.json.JsonObject;
-import javax.json.JsonObjectBuilder;
-import javax.json.JsonReader;
-import javax.json.JsonValue;
-import javax.json.JsonWriter;
-import javax.net.ssl.HostnameVerifier;
-import javax.net.ssl.SSLContext;
-import javax.net.ssl.SSLSession;
-import javax.net.ssl.TrustManager;
-import javax.net.ssl.X509TrustManager;
-import javax.xml.bind.DatatypeConverter;
-
import com.google.protobuf.InvalidProtocolBufferException;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
@@ -129,6 +80,52 @@
import org.hyperledger.fabric_ca.sdk.helper.Config;
import org.hyperledger.fabric_ca.sdk.helper.Util;
+import javax.json.Json;
+import javax.json.JsonArray;
+import javax.json.JsonObject;
+import javax.json.JsonObjectBuilder;
+import javax.json.JsonReader;
+import javax.json.JsonValue;
+import javax.json.JsonWriter;
+import javax.net.ssl.SSLContext;
+import javax.net.ssl.TrustManager;
+import javax.net.ssl.X509TrustManager;
+import javax.xml.bind.DatatypeConverter;
+import java.io.BufferedInputStream;
+import java.io.ByteArrayInputStream;
+import java.io.File;
+import java.io.IOException;
+import java.io.PrintWriter;
+import java.io.StringReader;
+import java.io.StringWriter;
+import java.net.MalformedURLException;
+import java.net.Socket;
+import java.net.URISyntaxException;
+import java.net.URL;
+import java.nio.charset.StandardCharsets;
+import java.nio.file.Files;
+import java.nio.file.Paths;
+import java.security.KeyFactory;
+import java.security.KeyManagementException;
+import java.security.KeyPair;
+import java.security.KeyStore;
+import java.security.KeyStoreException;
+import java.security.NoSuchAlgorithmException;
+import java.security.PublicKey;
+import java.security.UnrecoverableKeyException;
+import java.security.cert.CertificateException;
+import java.security.cert.CertificateFactory;
+import java.security.cert.X509Certificate;
+import java.security.spec.InvalidKeySpecException;
+import java.security.spec.X509EncodedKeySpec;
+import java.util.ArrayList;
+import java.util.Base64;
+import java.util.Collection;
+import java.util.Date;
+import java.util.Map;
+import java.util.Map.Entry;
+import java.util.Properties;
+
import static java.lang.String.format;
import static java.nio.charset.StandardCharsets.UTF_8;
diff --git a/src/test/java/org/hyperledger/fabric/sdk/ChannelTest.java b/src/test/java/org/hyperledger/fabric/sdk/ChannelTest.java
index ad99f461..faf1d598 100644
--- a/src/test/java/org/hyperledger/fabric/sdk/ChannelTest.java
+++ b/src/test/java/org/hyperledger/fabric/sdk/ChannelTest.java
@@ -14,27 +14,6 @@
package org.hyperledger.fabric.sdk;
-//Allow throwing undeclared checked execeptions in mock code.
-//CHECKSTYLE.OFF: IllegalImport
-
-import java.io.File;
-import java.lang.reflect.Constructor;
-import java.lang.reflect.Field;
-import java.nio.file.Files;
-import java.nio.file.Paths;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.EnumSet;
-import java.util.HashMap;
-import java.util.LinkedList;
-import java.util.Map;
-import java.util.Properties;
-import java.util.concurrent.BlockingQueue;
-import java.util.concurrent.CompletableFuture;
-import java.util.concurrent.LinkedBlockingQueue;
-import java.util.concurrent.TimeUnit;
-
import com.google.protobuf.ByteString;
import io.grpc.Status;
import io.grpc.StatusRuntimeException;
@@ -57,7 +36,24 @@
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.ExpectedException;
-import sun.misc.Unsafe;
+
+import java.io.File;
+import java.lang.reflect.Constructor;
+import java.nio.file.Files;
+import java.nio.file.Paths;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.EnumSet;
+import java.util.HashMap;
+import java.util.LinkedList;
+import java.util.Map;
+import java.util.Objects;
+import java.util.Properties;
+import java.util.concurrent.BlockingQueue;
+import java.util.concurrent.CompletableFuture;
+import java.util.concurrent.LinkedBlockingQueue;
+import java.util.concurrent.TimeUnit;
import static org.hyperledger.fabric.sdk.Channel.PeerOptions.createPeerOptions;
import static org.hyperledger.fabric.sdk.testutils.TestUtils.assertArrayListEquals;
@@ -71,8 +67,6 @@
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
-//CHECKSTYLE.ON: IllegalImport
-
public class ChannelTest {
@Rule
public ExpectedException thrown = ExpectedException.none();
@@ -882,10 +876,7 @@ public void testQueryInstalledChaincodesERROR() throws Exception {
final Channel channel = createRunningChannel(null);
Peer peer = channel.getPeers().iterator().next();
- final CompletableFuture