dubbo-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] diecui1202 closed pull request #2529: Optimization unnecessary unboxing 'b.booleanValue()' and Remove invalid throws java.lang.Exception
Date Fri, 21 Sep 2018 02:13:38 GMT
diecui1202 closed pull request #2529: Optimization unnecessary unboxing 'b.booleanValue()'
and Remove invalid  throws java.lang.Exception
URL: https://github.com/apache/incubator-dubbo/pull/2529
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/dubbo-config/dubbo-config-spring/src/main/java/org/apache/dubbo/config/spring/ReferenceBean.java
b/dubbo-config/dubbo-config-spring/src/main/java/org/apache/dubbo/config/spring/ReferenceBean.java
index e6a2a1fddb..bd6195ccb2 100644
--- a/dubbo-config/dubbo-config-spring/src/main/java/org/apache/dubbo/config/spring/ReferenceBean.java
+++ b/dubbo-config/dubbo-config-spring/src/main/java/org/apache/dubbo/config/spring/ReferenceBean.java
@@ -38,8 +38,6 @@
 
 /**
  * ReferenceFactoryBean
- *
- * @export
  */
 public class ReferenceBean<T> extends ReferenceConfig<T> implements FactoryBean,
ApplicationContextAware, InitializingBean, DisposableBean {
 
@@ -62,7 +60,7 @@ public void setApplicationContext(ApplicationContext applicationContext)
{
     }
 
     @Override
-    public Object getObject() throws Exception {
+    public Object getObject() {
         return get();
     }
 
@@ -85,7 +83,7 @@ public void afterPropertiesSet() throws Exception {
             if (consumerConfigMap != null && consumerConfigMap.size() > 0) {
                 ConsumerConfig consumerConfig = null;
                 for (ConsumerConfig config : consumerConfigMap.values()) {
-                    if (config.isDefault() == null || config.isDefault().booleanValue())
{
+                    if (config.isDefault() == null || config.isDefault()) {
                         if (consumerConfig != null) {
                             throw new IllegalStateException("Duplicate consumer configs:
" + consumerConfig + " and " + config);
                         }
@@ -103,7 +101,7 @@ public void afterPropertiesSet() throws Exception {
             if (applicationConfigMap != null && applicationConfigMap.size() >
0) {
                 ApplicationConfig applicationConfig = null;
                 for (ApplicationConfig config : applicationConfigMap.values()) {
-                    if (config.isDefault() == null || config.isDefault().booleanValue())
{
+                    if (config.isDefault() == null || config.isDefault()) {
                         if (applicationConfig != null) {
                             throw new IllegalStateException("Duplicate application configs:
" + applicationConfig + " and " + config);
                         }
@@ -121,7 +119,7 @@ public void afterPropertiesSet() throws Exception {
             if (moduleConfigMap != null && moduleConfigMap.size() > 0) {
                 ModuleConfig moduleConfig = null;
                 for (ModuleConfig config : moduleConfigMap.values()) {
-                    if (config.isDefault() == null || config.isDefault().booleanValue())
{
+                    if (config.isDefault() == null || config.isDefault()) {
                         if (moduleConfig != null) {
                             throw new IllegalStateException("Duplicate module configs: "
+ moduleConfig + " and " + config);
                         }
@@ -138,13 +136,13 @@ public void afterPropertiesSet() throws Exception {
                 && (getApplication() == null || getApplication().getRegistries()
== null || getApplication().getRegistries().isEmpty())) {
             Map<String, RegistryConfig> registryConfigMap = applicationContext == null
? null : BeanFactoryUtils.beansOfTypeIncludingAncestors(applicationContext, RegistryConfig.class,
false, false);
             if (registryConfigMap != null && registryConfigMap.size() > 0) {
-                List<RegistryConfig> registryConfigs = new ArrayList<RegistryConfig>();
+                List<RegistryConfig> registryConfigs = new ArrayList<>();
                 for (RegistryConfig config : registryConfigMap.values()) {
-                    if (config.isDefault() == null || config.isDefault().booleanValue())
{
+                    if (config.isDefault() == null || config.isDefault()) {
                         registryConfigs.add(config);
                     }
                 }
-                if (registryConfigs != null && !registryConfigs.isEmpty()) {
+                if (!registryConfigs.isEmpty()) {
                     super.setRegistries(registryConfigs);
                 }
             }
@@ -156,7 +154,7 @@ public void afterPropertiesSet() throws Exception {
             if (monitorConfigMap != null && monitorConfigMap.size() > 0) {
                 MonitorConfig monitorConfig = null;
                 for (MonitorConfig config : monitorConfigMap.values()) {
-                    if (config.isDefault() == null || config.isDefault().booleanValue())
{
+                    if (config.isDefault() == null || config.isDefault()) {
                         if (monitorConfig != null) {
                             throw new IllegalStateException("Duplicate monitor configs: "
+ monitorConfig + " and " + config);
                         }
@@ -172,7 +170,7 @@ public void afterPropertiesSet() throws Exception {
         if (b == null && getConsumer() != null) {
             b = getConsumer().isInit();
         }
-        if (b != null && b.booleanValue()) {
+        if (b != null && b) {
             getObject();
         }
     }


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


Mime
View raw message