diff libinterp/octave-value/ov-java.cc @ 19861:19755f4fc851

maint: Cleanup C++ code to follow Octave coding conventions. Try to wrap long lines to < 80 characters. Use GNU style and don't indent first brace of function definition. "case" statement is aligned flush left with brace of switch stmt. Remove trailing '\' line continuation from the end of #define macros. Use 2 spaces for indent. * files-dock-widget.cc, history-dock-widget.cc, main-window.cc, octave-cmd.cc, octave-dock-widget.cc, octave-gui.cc, resource-manager.cc, settings-dialog.cc, shortcut-manager.cc, welcome-wizard.cc, workspace-view.cc, cellfun.cc, data.cc, debug.cc, debug.h, dirfns.cc, error.h, file-io.cc, gl-render.cc, gl-render.h, gl2ps-renderer.h, graphics.cc, graphics.in.h, help.cc, input.cc, load-path.cc, load-path.h, lookup.cc, lu.cc, oct-stream.cc, octave-default-image.h, ordschur.cc, pr-output.cc, qz.cc, strfns.cc, symtab.cc, symtab.h, sysdep.cc, variables.cc, zfstream.h, __fltk_uigetfile__.cc, __init_fltk__.cc, __magick_read__.cc, __osmesa_print__.cc, audiodevinfo.cc, ov-classdef.cc, ov-classdef.h, ov-fcn.h, ov-float.cc, ov-flt-complex.cc, ov-java.cc, ov-range.cc, ov-re-mat.cc, ov-usr-fcn.h, ov.cc, op-int.h, options-usage.h, pt-eval.cc, Array-C.cc, Array-fC.cc, Array.cc, Array.h, PermMatrix.cc, Sparse.cc, chMatrix.h, dSparse.cc, dim-vector.h, bsxfun-decl.h, bsxfun-defs.cc, oct-norm.cc, Sparse-op-defs.h, oct-inttypes.cc, oct-inttypes.h, main.in.cc, mkoctfile.in.cc: Cleanup C++ code to follow Octave coding conventions.
author Rik <rik@octave.org>
date Wed, 25 Feb 2015 11:55:49 -0800
parents 76478d2da117
children 107130a0490c
line wrap: on
line diff
--- a/libinterp/octave-value/ov-java.cc	Wed Feb 25 16:23:45 2015 +0100
+++ b/libinterp/octave-value/ov-java.cc	Wed Feb 25 11:55:49 2015 -0800
@@ -57,8 +57,10 @@
 #include "parse.h"
 #include "variables.h"
 
-typedef jint (JNICALL *JNI_CreateJavaVM_t) (JavaVM **pvm, JNIEnv **penv, void *args);
-typedef jint (JNICALL *JNI_GetCreatedJavaVMs_t) (JavaVM **pvm, jsize bufLen, jsize *nVMs);
+typedef jint (JNICALL *JNI_CreateJavaVM_t) (JavaVM **pvm, JNIEnv **penv,
+                                            void *args);
+typedef jint (JNICALL *JNI_GetCreatedJavaVMs_t) (JavaVM **pvm, jsize bufLen,
+                                                 jsize *nVMs);
 
 extern "C"
 {
@@ -457,7 +459,8 @@
           std::string regval = read_registry_string (key,value);
 
           if (regval.empty ())
-            throw std::string ("unable to find Java Runtime Environment: ") + key + "::" + value;
+            throw std::string ("unable to find Java Runtime Environment: ")
+                  + key + "::" + value;
           value = regval;
         }
 
@@ -465,7 +468,8 @@
       value = "RuntimeLib";
       jvm_lib_path = read_registry_string (key, value);
       if (jvm_lib_path.empty ())
-        throw std::string ("unable to find Java Runtime Environment: ") + key + "::" + value;
+        throw std::string ("unable to find Java Runtime Environment: ")
+              + key + "::" + value;
 
       std::string jvm_bin_path;
 
@@ -500,7 +504,8 @@
   octave_shlib lib (jvm_lib_path);
 
   if (!lib)
-    throw std::string ("unable to load Java Runtime Environment from ") + jvm_lib_path;
+    throw std::string ("unable to load Java Runtime Environment from ")
+          + jvm_lib_path;
 
 #if defined (__WIN32__)
 
@@ -520,7 +525,8 @@
     throw std::string ("unable to find JNI_CreateJavaVM in ") + jvm_lib_path;
 
   if (!get_vm)
-    throw std::string ("unable to find JNI_GetCreatedJavaVMs in ") + jvm_lib_path;
+    throw std::string ("unable to find JNI_GetCreatedJavaVMs in ")
+          + jvm_lib_path;
 
   if (get_vm (&jvm, 1, &nVMs) == 0 && nVMs > 0)
 
@@ -537,7 +543,8 @@
     {
       // At least one JVM exists, try to attach to it
 
-      switch (jvm->GetEnv (reinterpret_cast<void **> (&current_env), JNI_VERSION_1_2))
+      switch (jvm->GetEnv (reinterpret_cast<void **> (&current_env),
+                           JNI_VERSION_1_2))
         {
         case JNI_EDETACHED:
           // Attach the current thread
@@ -571,7 +578,8 @@
       vm_args.add ("-Djava.class.path=" + initial_class_path ());
       vm_args.add ("-Xrs");
       vm_args.add ("-Djava.system.class.loader=org.octave.OctClassLoader");
-      vm_args.read_java_opts (initial_java_dir () + file_ops::dir_sep_str () + "java.opts");
+      vm_args.read_java_opts (initial_java_dir () + file_ops::dir_sep_str () +
+                              "java.opts");
 
 # if !defined (__APPLE__) && !defined (__MACH__)
 
@@ -714,7 +722,8 @@
               jstring_ref js (jni_env, jni_env->NewStringUTF ("octave.class.loader"));
               js = reinterpret_cast<jstring> (jni_env->CallStaticObjectMethod (syscls, mID, jstring (js)));
               class_loader = jstring_to_string (jni_env, jstring (js));
-              std::replace (class_loader.begin (), class_loader.end (), '.', '/');
+              std::replace (class_loader.begin (), class_loader.end (),
+                            '.', '/');
             }
 
           jclass_ref uicls (jni_env, jni_env->FindClass (class_loader.c_str ()));
@@ -724,11 +733,13 @@
               jni_env->ExceptionClear ();
 
               /* Try the netbeans way */
-              std::replace (class_loader.begin (), class_loader.end (), '/', '.');
+              std::replace (class_loader.begin (), class_loader.end (),
+                            '/', '.');
               jclass_ref jcls2 (jni_env, jni_env->FindClass ("org/openide/util/Lookup"));
               jmethodID mID = jni_env->GetStaticMethodID (jcls2, "getDefault", "()Lorg/openide/util/Lookup;");
               jobject_ref lObj (jni_env, jni_env->CallStaticObjectMethod (jcls2, mID));
-              mID = jni_env->GetMethodID (jcls2, "lookup", "(Ljava/lang/Class;)Ljava/lang/Object;");
+              mID = jni_env->GetMethodID (jcls2, "lookup",
+                                          "(Ljava/lang/Class;)Ljava/lang/Object;");
               jclass_ref cLoaderCls (jni_env, jni_env->FindClass ("java/lang/ClassLoader"));
               jobject_ref cLoader (jni_env, jni_env->CallObjectMethod (lObj, mID, jclass (cLoaderCls)));
               mID = jni_env->GetMethodID (cLoaderCls, "loadClass", "(Ljava/lang/String;)Ljava/lang/Class;");