[libinline-java-perl] 79/398: *** empty log message ***

Jonas Smedegaard dr at jones.dk
Thu Feb 26 11:42:50 UTC 2015


This is an automated email from the git hooks/post-receive script.

js pushed a commit to tag 0.55
in repository libinline-java-perl.

commit bbd9eb8e90e350333649a298fe3dd672c988f0d8
Author: patrick <>
Date:   Tue May 8 19:38:36 2001 +0000

    *** empty log message ***
---
 CHANGES          |   8 ++++
 Java/Protocol.pm | 114 +++++++++++++++++++------------------------------------
 MANIFEST         |   2 +
 README           |   6 ++-
 TODO             |   1 +
 5 files changed, 55 insertions(+), 76 deletions(-)

diff --git a/CHANGES b/CHANGES
index e827574..ca0ac53 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,6 +1,14 @@
 Revision history for Perl extension Inline::Java
 ------------------------------------------------
 
+0.21  Tue May  8 11:32:28 EDT 2001
+    - Added 'studying' of external Java classes
+    - Removed CLASSPATH config option because it didn't behave as
+      expected
+    - Added error message stating that Inline::Java doesn't currently 
+      support multiple sections.
+    - Caching for class information
+
 0.20  Sat Apr 14 23:00:00 EDT 2001
     - Added optional JNI extension.
     - Added support for arrays.
diff --git a/Java/Protocol.pm b/Java/Protocol.pm
index 48d8e2f..383030c 100644
--- a/Java/Protocol.pm
+++ b/Java/Protocol.pm
@@ -24,21 +24,6 @@ sub new {
 }
 
 
-sub SetClassPath {
-	my $this = shift ;
-	my $classpath = shift ;
-
-	Inline::Java::debug("setting classpath") ;
-
-	my $data = join(" ", 
-		"set_classpath", 
-		$this->ValidateArgs([$classpath]),
-	) ;
-
-	return $this->Send($data, 1) ;
-}
-
-
 sub Report {
 	my $this = shift ;
 	my $classes = shift ;
@@ -288,17 +273,18 @@ sub Send {
 			return undef ;
 		}
 		else{
-			my $obj = undef ;
 			my $inline = Inline::Java::get_INLINE($this->{module}) ;
-
 			my $perl_class = Inline::Java::known_to_perl($inline->{pkg}, $class) ;
-			if ($perl_class){
-				$obj = $perl_class->__new($class, $inline, $id) ;
-			}
-			else{
-				$obj = Inline::Java::Object->__new($class, $inline, $id) ;
+			if (! $perl_class){
+				$perl_class = "Inline::Java::Object" ;
+				if ($inline->{Java}->{AUTOSTUDY}){
+					$inline->_study([$class]) ;
+					$perl_class = Inline::Java::known_to_perl($inline->{pkg}, $class) ;
+				}
 			}
 
+			my $obj = $perl_class->__new($class, $inline, $id) ;
+
 			Inline::Java::debug("checking if stub is array...") ;
 			if (Inline::Java::Class::ClassIsArray($class)){
 				Inline::Java::debug("creating array object...") ;
@@ -371,9 +357,6 @@ class InlineJavaProtocol {
 		else if (c.equals("isa")){
 			ISA(st) ;
 		}
-		else if (c.equals("set_classpath")){
-			SetClassPath(st) ;
-		}
 		else if (c.equals("create_object")){
 			CreateJavaObject(st) ;
 		}
@@ -393,7 +376,7 @@ class InlineJavaProtocol {
 		Returns a report on the Java classes, listing all public methods
 		and members
 	*/
-	void Report(StringTokenizer st){
+	void Report(StringTokenizer st) throws InlineJavaException {
 		StringBuffer pw = new StringBuffer() ;
 
 		StringTokenizer st2 = new StringTokenizer(st.nextToken(), ":") ;
@@ -404,65 +387,46 @@ class InlineJavaProtocol {
 		ArrayList class_list = new ArrayList() ;
 		while (st3.hasMoreTokens()){
 			String c = st3.nextToken() ;
-			ijs.debug("reporting for " + c) ;
 			class_list.add(class_list.size(), c) ;
 		}
 
-		try {
-			for (int i = 0 ; i < class_list.size() ; i++){
-				String name = (String)class_list.get(i) ;
-				if (! name.startsWith("InlineJavaServer")){
-					Class c = Class.forName(name) ;
-															
-					pw.append("class " + c.getName() + "\n") ;
-					Constructor constructors[] = c.getConstructors() ;
-					Method methods[] = c.getMethods() ;
-					Field fields[] = c.getFields() ;
-
-					for (int j = 0 ; j < constructors.length ; j++){
-						Constructor x = constructors[j] ;
-						String sign = CreateSignature(x.getParameterTypes()) ;
-						Class decl = x.getDeclaringClass() ;
-						pw.append("constructor" + " " + sign + "\n") ;
-					}
-					for (int j = 0 ; j < methods.length ; j++){
-						Method x = methods[j] ;
-						String stat = (Modifier.isStatic(x.getModifiers()) ? " static " : " instance ") ;
-						String sign = CreateSignature(x.getParameterTypes()) ;
-						Class decl = x.getDeclaringClass() ;
-						pw.append("method" + stat + decl.getName() + " " + x.getName() + sign + "\n") ;
-					}
-					for (int j = 0 ; j < fields.length ; j++){
-						Field x = fields[j] ;
-						String stat = (Modifier.isStatic(x.getModifiers()) ? " static " : " instance ") ;
-						Class decl = x.getDeclaringClass() ;
-						Class type = x.getType() ;
-						pw.append("field" + stat + decl.getName() + " " + x.getName() + " " + type.getName() + "\n") ;
-					}
-				}
+		for (int i = 0 ; i < class_list.size() ; i++){
+			String name = (String)class_list.get(i) ;
+			Class c = ijc.ValidateClass(name) ;
+
+			ijs.debug("reporting for " + c) ;
+													
+			pw.append("class " + c.getName() + "\n") ;
+			Constructor constructors[] = c.getConstructors() ;
+			Method methods[] = c.getMethods() ;
+			Field fields[] = c.getFields() ;
+
+			for (int j = 0 ; j < constructors.length ; j++){
+				Constructor x = constructors[j] ;
+				String sign = CreateSignature(x.getParameterTypes()) ;
+				Class decl = x.getDeclaringClass() ;
+				pw.append("constructor" + " " + sign + "\n") ;
+			}
+			for (int j = 0 ; j < methods.length ; j++){
+				Method x = methods[j] ;
+				String stat = (Modifier.isStatic(x.getModifiers()) ? " static " : " instance ") ;
+				String sign = CreateSignature(x.getParameterTypes()) ;
+				Class decl = x.getDeclaringClass() ;
+				pw.append("method" + stat + decl.getName() + " " + x.getName() + sign + "\n") ;
+			}
+			for (int j = 0 ; j < fields.length ; j++){
+				Field x = fields[j] ;
+				String stat = (Modifier.isStatic(x.getModifiers()) ? " static " : " instance ") ;
+				Class decl = x.getDeclaringClass() ;
+				Class type = x.getType() ;
+				pw.append("field" + stat + decl.getName() + " " + x.getName() + " " + type.getName() + "\n") ;
 			}
 		}
-		catch (ClassNotFoundException e){
-			System.err.println("Can't find class: " + e.getMessage()) ;
-			System.exit(1) ;
-		}
 
 		SetResponse(pw.toString()) ;
 	}
 
 
-	void SetClassPath(StringTokenizer st) throws InlineJavaException {
-		String classpath = st.nextToken() ;
-		StringTokenizer st2 = new StringTokenizer(classpath, ":") ;
-		st2.nextToken() ;
-
-		String prop = pack(st2.nextToken()) ;
-		System.setProperty("java.class.path", prop) ;
-
-		SetResponse(null) ;
-	}
-
-
 	void ISA(StringTokenizer st) throws InlineJavaException {
 		int id = Integer.parseInt(st.nextToken()) ;
 
diff --git a/MANIFEST b/MANIFEST
index 707e3b8..94fc5da 100644
--- a/MANIFEST
+++ b/MANIFEST
@@ -23,5 +23,7 @@ t/4_members.t
 t/5_arrays.t
 t/6_static.t
 t/7_polymorph.t
+t/8_study.t
+t/types.class
 
 
diff --git a/README b/README
index 1ff250d..82a2d77 100644
--- a/README
+++ b/README
@@ -79,7 +79,11 @@ WARNING: THIS IS ALPHA SOFTWARE. It is incomplete and possibly unreliable.
          It is also possible that some elements of the interface (API) will 
          change in future releases.
 
-Inline::Java version 0.20 includes:
+Inline::Java version 0.21 is a minor upgrade that includes:
++ 'Studying' of external classes
++ Caching of class information increases performance
+
+Inline::Java version 0.20 is a major upgrade that includes:
 + All public member variables are now exported to Perl.
 + Arrays can now be passed as method parameters and assigned to 
   member variables.
diff --git a/TODO b/TODO
index 7fc35b9..dcd88fa 100644
--- a/TODO
+++ b/TODO
@@ -1,4 +1,5 @@
 CODE:
+- Add support for multiple sections (waiting for Inline 0.40)
 
 TEST:
 - Add test script for configuration options (other than BIN)

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-perl/packages/libinline-java-perl.git



More information about the Pkg-perl-cvs-commits mailing list