[armedbear-cvs] r12778 - branches/generic-class-file/abcl/src/org/armedbear/lisp

Erik Huelsmann ehuelsmann at common-lisp.net
Sat Jul 3 22:05:14 UTC 2010


Author: ehuelsmann
Date: Sat Jul  3 18:05:13 2010
New Revision: 12778

Log:
Managing field/method/attribute attributes.

Modified:
   branches/generic-class-file/abcl/src/org/armedbear/lisp/jvm-class-file.lisp

Modified: branches/generic-class-file/abcl/src/org/armedbear/lisp/jvm-class-file.lisp
==============================================================================
--- branches/generic-class-file/abcl/src/org/armedbear/lisp/jvm-class-file.lisp	(original)
+++ branches/generic-class-file/abcl/src/org/armedbear/lisp/jvm-class-file.lisp	Sat Jul  3 18:05:13 2010
@@ -390,12 +390,22 @@
   (push method (class-file-methods class)))
 
 (defun class-methods-by-name (class name)
-  (remove (map-method-name name) (class-file-methods class)
+  (remove name (class-file-methods class)
           :test-not #'string= :key #'method-name))
 
-(defun class-method (class descriptor)
-  (find descriptor (class-file-methods class)
-        :test #'string= :key #'method-name))
+(defun class-method (class name return &rest args)
+  (let ((return-and-args (cons return args)))
+    (find-if #'(lambda (c)
+                 (and (string= (method-name c) name)
+                      (equal (method-descriptor c) return-and-args)))
+             (class-file-methods class))))
+
+(defun class-add-attribute (class attribute)
+  (push atttribute (class-file-attributes class)))
+
+(defun class-attribute (class name)
+  (find name (class-file-attributes class)
+        :test #'string= :key #'attribute-name))
 
 
 (defun finalize-class-file (class)
@@ -521,9 +531,12 @@
                :name name
                :descriptor type))
 
-(defun add-field-attribute (field attribute)
+(defun field-add-attribute (field attribute)
   (push attribute (field-attributes field)))
 
+(defun field-attribute (field name)
+  (find name (field-attributes field)
+        :test #'string= :key #'attribute-name))
 
 (defun finalize-field (field class)
   (let ((pool (class-file-constants class)))




More information about the armedbear-cvs mailing list