< prev index next >

src/hotspot/share/interpreter/linkResolver.cpp

Print this page
rev 59277 : [mq]: v3

@@ -604,20 +604,14 @@
       InstanceKlass* ref_ik = InstanceKlass::cast(ref_klass);
       InstanceKlass* sel_ik = InstanceKlass::cast(sel_klass);
       const char* nest_host_error_1 = ref_ik->nest_host_resolution_error();
       const char* nest_host_error_2 = sel_ik->nest_host_resolution_error();
       if (nest_host_error_1 != NULL || nest_host_error_2 != NULL) {
-        ss.print(", (");
-        if (nest_host_error_1 != NULL) {
-          ss.print("%s", nest_host_error_1);
-          if (nest_host_error_2 != NULL) {
-            ss.print(", %s", nest_host_error_2);
-          }
-        } else if (nest_host_error_2 != NULL) {
-          ss.print("%s", nest_host_error_2);
-        }
-        ss.print(")");
+        ss.print(", (%s%s%s)",
+                 (nest_host_error_1 != NULL) ? nest_host_error_1 : "",
+                 (nest_host_error_1 != NULL && nest_host_error_2 != NULL) ? ", " : "",
+                 (nest_host_error_2 != NULL) ? nest_host_error_2 : "");
       }
     }
 
     Exceptions::fthrow(THREAD_AND_LOCATION,
                        vmSymbols::java_lang_IllegalAccessError(),

@@ -961,20 +955,14 @@
       InstanceKlass* ref_ik = InstanceKlass::cast(ref_klass);
       InstanceKlass* sel_ik = InstanceKlass::cast(sel_klass);
       const char* nest_host_error_1 = ref_ik->nest_host_resolution_error();
       const char* nest_host_error_2 = sel_ik->nest_host_resolution_error();
       if (nest_host_error_1 != NULL || nest_host_error_2 != NULL) {
-        ss.print(", (");
-        if (nest_host_error_1 != NULL) {
-          ss.print("%s", nest_host_error_1);
-          if (nest_host_error_2 != NULL) {
-            ss.print(", %s", nest_host_error_2);
-          }
-        } else if (nest_host_error_2 != NULL) {
-          ss.print("%s", nest_host_error_2);
-        }
-        ss.print(")");
+        ss.print(", (%s%s%s)",
+                 (nest_host_error_1 != NULL) ? nest_host_error_1 : "",
+                 (nest_host_error_1 != NULL && nest_host_error_2 != NULL) ? ", " : "",
+                 (nest_host_error_2 != NULL) ? nest_host_error_2 : "");
       }
     }
     Exceptions::fthrow(THREAD_AND_LOCATION,
                        vmSymbols::java_lang_IllegalAccessError(),
                        "%s",
< prev index next >