nitlanguage
/
nit.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
e6cff84
)
contrib/jwrapper: implement == and hash in JavaClass and JavaMethod
author
Alexis Laferrière
<alexis.laf@xymus.net>
Sat, 1 Aug 2015 13:05:04 +0000
(09:05 -0400)
committer
Alexis Laferrière
<alexis.laf@xymus.net>
Wed, 5 Aug 2015 01:37:53 +0000
(21:37 -0400)
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
contrib/jwrapper/src/model.nit
patch
|
blob
|
history
diff --git
a/contrib/jwrapper/src/model.nit
b/contrib/jwrapper/src/model.nit
index
50d54f1
..
021c319
100644
(file)
--- a/
contrib/jwrapper/src/model.nit
+++ b/
contrib/jwrapper/src/model.nit
@@
-230,6
+230,9
@@
class JavaClass
end
end
end
+
+ redef fun hash do return class_type.hash
+ redef fun ==(o) do return o isa JavaClass and o.class_type == class_type
end
# Model of all the Java class analyzed in one run
@@
-334,6
+337,9
@@
class JavaMethod
# Generic parameters of this method
var generic_params: Array[JavaType]
+
+ redef fun ==(o) do return o isa JavaMethod and o.is_static == is_static and o.params == params
+ redef fun hash do return params.hash
end
# An attribute in a Java class