Log of the #nice channel on irc.freenode.net

* arjanb leaves01:31
* rubber_duck joins08:42
hello?08:43
No one in here?
I get the following error if I try to compile some nice generated class natively with the gcj-3.3:08:46
gcj -c -g -O nice/lang/NiceThread.class
nice/lang/NiceThread.java: In class `nice.lang.NiceThread':
nice/lang/NiceThread.java: In constructor `(java.lang.ThreadGroup,java.lang.Runnable,java.lang.String,long,gnu.mapping.Procedure)':
nice/lang/NiceThread.java:0: error: class 'java.lang.Thread' has no method named '<init>' matching signature '(Ljava/lang/ThreadGroup;Ljava/lang/Runnable;Ljava/lang/String;J)V'
Maybe someone could help me here?
I've seen, that java.lang.Thread does have a Constructor with parameters ThreadGroup, Runnable and String...08:47
If I try to use nicec with the -o flag it simply gives me the following error message: Native compilation with gcj failed08:50
?hm, java.lang.Thread contains private void init(ThreadGroup g, Runnable target, String name,09:19
long stackSize) {
This seems to be the method we are looking for.09:20
But in java.lang.Thread of the gcj library such a method does not exist.09:21
* arjanb joins11:09
<rubber_duck>hello
<arjanb>hello11:10
<rubber_duck>Would you please have a look at the log: http://pauillac.inria.fr/~bonniot/nice@freenode/2003-07-16.html (if you've got some spare time)
<arjanb>ok
<rubber_duck>Do you have an idea how I am able to compile with gcj?11:12
<arjanb>does it work when you don't use gcj?11:14
<rubber_duck>The compile of the package? Sure.11:15
<arjanb>can you run what you have compiled in a jvm11:16
<rubber_duck>Yes.11:17
<arjanb>i have no idea why it goes wrong with gjc11:21
<rubber_duck>Did you ever compiled a package with gcj successfully?11:22
<arjanb>i never have used gcj and i know nobody who have used gcj to compile Nice package11:24
<rubber_duck>Hmmm, that's a pity.11:26
... I've also envountered another problem with GPL-LGPL.
<arjanb>and that is?11:27
<rubber_duck>The compiled packages don't only include generated class files, but also some classes direct from the compiler package (nice.lang) and from the gnu.bytecode library. At least the gnu.bytecode is explicit GPL.
Without these classes nothing will work.11:28
...run...
<arjanb>these classes are from kawa and that has muliple licences you should ask daniel about that11:31
<rubber_duck>Ok, I'll do so.11:32
<arjanb>if i look at the bytecode of NiceThread.class i see one constructor that has incorrect bytecode i think11:39
<rubber_duck>Due to my knowledge of the bytecode I coudl not follow...11:50
:-(
<arjanb>Method public <init> (java/lang/ThreadGroup ,java/lang/Runnable ,java/lang/String ,long,gnu/mappin/Procedure ) -> void11:53
0 aload_0
1 aload_1
2 aload_2
3 aload_3
4 lload 4
6 invokenonvirtual #38 <Method java/lang/Thread.<init> (Ljava/lang/ThreadGroup;Ljava/lang/Runable;Ljava/lang/String;J)V>
9 aload_0
10 aload 6
12 putfield #21 <Field nice/lang/NiceThread.action Lgnu/mapping/Procedure;>
15 return
position 4 iload 4 == load 4th local variable of type long
<rubber_duck>yes, so far I can follow. What does aload_[number]?11:54
<arjanb>i don't see 4 local variables and i don't see where that long should come from
<rubber_duck>hmmm11:55
what are local variables (which can be loaded with lload)? are there also included the variables fo the super class? Or am I on the wrong ship?11:56
<arjanb>in this case all local variables come from the arguments of the init function11:59
<rubber_duck>Ok. There seems not be a ThreadGroup, a Runnable, a String and a gnu Procedure but what about the long? An why does that run with aSunJVM?12:01
<arjanb>it probably runs on some jvms because that version of the constructor is never used12:02
<rubber_duck>Oh, sure.12:04
Well, I've read a bi of the JVM specification. Are their really only that less instructions?! So the Java code could really be readable...12:14
<arjanb>yes12:15
<rubber_duck>Ok, now you might give me also a hint, where such a constructor will be generated in nice...12:16
<arjanb>i don't know12:18
* bonniot joins12:19
<rubber_duck>Hello Daniel.
<bonniot>hi
i just saw the irc log
the bytecode looks correct to me
the 4th parameter of the constructor is a long12:20
<rubber_duck>Correct? I do not understand it than...
<bonniot>and the 0th is the reference to the object being constructed
in the jvm, method parameters are at the begining of the local variables list12:21
<rubber_duck>ok, so the bytecode is correct.12:22
<arjanb>but why does gcj chokes on that?
<rubber_duck>well, the java.lang.Thread implementations seem to differ?12:23
<bonniot>yes, i think it is a problem with java.lang.Thread in gcj
<arjanb>maybe tries gcj to compile it to native threads12:24
<rubber_duck>The method that should be invoked private void init(ThreadGroup g, Runnable target, String name, long stackSize) {12:25
right?
<bonniot>no, wait, since the constructor is private it cannot be called
<rubber_duck>ok, than it is something beyond my knowledge...12:26
<bonniot>it's just a question of visibility
<rubber_duck>Yes, what I meant was, that I don't know what function this init is and where it comes from.. And why the gcj implemantation does not have it...12:27
<bonniot><init> is the special name for constructors
it might have it or not, but since it is private that does not matter12:28
i think it is a bug in the Nice compiler, when it generates the constructors
<rubber_duck>I've not even found the place where the generation takes place.12:29
<arjanb>so private constructors should be ignored
<bonniot>yes
<rubber_duck>Why 'public <init> (java/lang/ThreadGroup ,java/lang/Runnable ,java/lang/String ,long,gnu/mapping/Procedure ) -> void' has got 5 arguments? (still not understanding a bit)12:30
<bonniot>there is the implicit 'this' argument
<rubber_duck>Ok, I've mixed the things together.12:31
<bonniot>what jdk did you use to compile this example?12:33
i don't get a constructor with long, using 1.3
<arjanb>i used sun's 1.4.1
<rubber_duck>I'm also using 1.4.112:34
...from sun
maybe I should try it with 1.3?12:35
<bonniot>it will work with 1.3
but this looks like a bug
<arjanb>according to to 1.4 docs there is a public constructor 12:36
public Thread(ThreadGroup group,
Runnable target,
String name,
long stackSize)
<bonniot>i will fix it, so it works in all cases
ah, that's different
so Nice is correct
so where is this constructor private?
in gcj only?
<rubber_duck>No, the private method was also in sun1.412:37
The constructors all call then this private method
<bonniot>it cannot be both public and private...
<arjanb>so gcj can't handle 1.4 yet12:38
<rubber_duck>no... the constructors in java.lang.Thread (sun1.4) are public but call a private method 'private void init(...)'
<bonniot>ok, i see
(how do you know that, by the way?)12:39
anyway, it does not matter what the constructor does
<rubber_duck>I've take a lokk into the sources.
I've mixed that togehter with the name of the mehtod 'init' and what I saw in the bytecode '<init>'...12:40
<bonniot>be careful, reading the sources prevents you to contribute to java related open source projects...
iirc, you would need to check the exact conditions12:41
<arjanb>if you want to look at some java api source look at the gnu classpath libraries
<bonniot>yes, init and <init> can easily be confused
so where can we see the api used by gcj?12:42
<rubber_duck>Is that true?
I`m not allowed to read the source.zip?
<arjanb>i think gcj uses classpath and that doesn't a Thread class written in java12:43
<bonniot>you are allowed, but under restrictive conditions
<rubber_duck>I will have to take a look at it.
<bonniot>gcj uses libgcj, which is getting merged with classpath
there must be the api of the class...12:44
<arjanb>but not in java
i think they compile threads from some c code 12:45
<bonniot>it must be a java class, since it is in the public API
the methods can be implemented in C
http://savannah.gnu.org/cgi-bin/viewcvs/gcc/gcc/libjava/java/lang/Thread.java?rev=1.26&content-type=text/vnd.viewcvs-markup
that version has
<rubber_duck>It is a java class...
<bonniot>public Thread (ThreadGroup g, Runnable r, String n, long size)
<rubber_duck>Well, the version that is included in gcc-3.3 does not have. :-(12:47
It only has got 'public Thread (ThreadGroup g, Runnable r, String n)'12:48
<bonniot>yes
<rubber_duck>...and some others which have almost fewer arguements.
<bonniot>so either you upgrade to a more recent build of gcj
<rubber_duck>So, that causes the error with the NiceThread.12:49
<bonniot>or you use the jdk 1.3 to compile your nice program
the second option is probably easier
<rubber_duck>I'm just trying to compile with 1.3...But it still says me: 'Native compilation with gcj failed'12:50
<arjanb>:-(
<bonniot>can you do it manually, to see the error message?
<rubber_duck>JI#ve comipiled with nice and 1.3 and the acutall version is runnable with a "normal" JVM
What will I have to do, better how? 12:51
<arjanb>compile with nice with -R option
<bonniot>compile the jar to native with gcj12:52
<rubber_duck>I can compile a complete jar with gcj?!
<bonniot>yes12:53
gcj-3.3 -o native --main=test.fun test.jar12:55
<rubber_duck>Yes, just fine!
It is working.12:56
Thnx a lot.
<bonniot>:-)
but the direct native compilation does not work?
i know why12:57
<rubber_duck>no, t doesn't.
<bonniot>i need to update the call to gcj, since the name of the main generated class has changed
this will be fixed in Nice 0.9.0
<rubber_duck>That's so NICE.
<arjanb>daniel: " So in this case there is a failure for 1 as an int, for 1 as a short, and 1 as a byte?12:58
Wouldn't it be possible to generate only the case 1 as a byte? For the value 300, consider it as a short, etc... "
* alexgreif joins12:59
hi
<bonniot>hi alex
<rubber_duck>Hi.
<arjanb>not exactly first are all tc's tested and then all values in combination with the tc's
<rubber_duck>Isn't it nice to be able to produce a 22MB big executable out of only a few hundert lines code. ;-)
<alexgreif>I have a problem: with reflection in the nice plugin:13:00
<bonniot>rubber_duck: really? mine is 235 kb
<rubber_duck>Yes, but it surely is not statically linked.13:01
<alexgreif>the class NewProjectCreationWizard has one member that is initialized to cast(null) so two constructors are created, but when eclipse wants to initialize it I get the following error:
net.sf.nice.ui.wizards.NewProjectCreationWizard.init(Lorg/eclipse/ui/IWorkbench;Lorg/eclipse/jface/viewers/IStructuredSelection;)V
<bonniot>rubber_duck: true
<arjanb>daniel: i can't really fix that without rewriting the dispatch test code and hardcode all sort things of primitive type tc's in it13:02
<rubber_duck>daniel: have you read in the log about the issue with gpl and lgpl?
<alexgreif>... I cannot interpret this meaasge, htere is no constructor like that , not even in a running version
<bonniot>arjanb: this is not a severe issue, so if you think it's too complex, we can rethink about it later13:03
<arjanb>daniel: ok shall i limit the number of value errors to one for now?13:04
<bonniot>arjanb: ok
alexgreif: isn't there an error message? this is just the name of a method
<alexgreif>yes thats all that is printed on the console13:05
<bonniot>it is not a constructor (whose name would be <init>)
does it mean that an exception was thrown during execution of that method?
<alexgreif>it seems to be , yes
<bonniot>or that that method should exist, but doesn't13:06
<alexgreif>I dont know, the message does not tell me more
<bonniot>does that method exist?
<alexgreif>It occure when I want to open a wizard page in eclipse
no
but not even in the running plugin13:07
<rubber_duck>@daniel: do you know where to find the restrictions to the reading of the java api sourcecode?
<bonniot>isn't this the problem?
maybe eclipse want to call that method by reflexion
<alexgreif>in the functional plugin there is no such method too
yes its sure reflection because the class path is specified in the xml13:08
<bonniot>rubber_duck: it should be together with the source, or the jdk
i don't know exactly
<alexgreif>not even a subcalss has such a constructor with these args
<bonniot>it should be on the web too
alex, this is not a constructor
a constructor has name <init>13:09
<alexgreif>ah, a normal method?
<rubber_duck>@daniel: 6. Source Code. Software may contain source code that is provided solely for
<bonniot>this is a method, name init
<rubber_duck>reference purposes pursuant to the terms of this Agreement.
<alexgreif>ok, I check it ...
I think its an abstract method that is not implemented ...13:10
<bonniot>alexgreif: yes, that could be13:11
but then it must be implemented in the working plugin too
<alexgreif>or a not implemented method declared in an interface
<rubber_duck>Maybe you mean: In the event that you create an additional class and associated API(s)
which (i) extends the functionality of a Java environment, and (ii) is exposed
to third party software developers for the purpose of developing additional
software, which invokes such additional API, you must promptly publish broadly
<bonniot>rubber_duck: about the GPL
<rubber_duck>an accurate specification for such API for free use by all developers.
<bonniot>is this the license for the source code?13:12
where did you find it?
<rubber_duck>This is jdk-1.3/LICENSE
Up to now I did not find an explicit license for the source... The source is included in the jdk...13:13
<bonniot>see http://www.debian.org/doc/manuals/debian-java-faq/ch5.html#s-license-concerns
<rubber_duck>Thnx.13:14
<arjanb>daniel do you now the details of the kawa license13:15
because some kawa classes are included in the runtime13:16
<bonniot>so, about the GPL
I will change Nice's standard library into LGPL
for the few kawa classes:
the license says that there is no restriction, provided that no modification is made to the distributed classes13:17
<alexgreif>bonniot: yes, it was a not implemented method declared in an interface :)
thanls
<bonniot>alexgreif: ok
a few of the distributed classes have been slightly modified13:18
<alexgreif>bonniot: can the compiler check for not implemented methods declared in abstarct classes or interfaces?
<bonniot>i have contacted the author of kawa about this. we will hopefully be able to integrate the changes into kawa itself, so that there is not legal problem
<rubber_duck>So, that are good news.13:19
<bonniot>alexgreif: it should. it does so, except in some cases, when the interface was declared in Java
<alexgreif>yes I mean abstarcrt classes and interface in java
in this case no chance?
<bonniot>alexgreif: it will be implemented in that case too13:20
<alexgreif>:) when?
0.9.1 ?
<bonniot>yeah, i could look at that after 0.9.0 is released13:21
<rubber_duck>@daniel: Am I correct that the issue is only valid for the comlete source of the jdk --> sdk?!
<alexgreif>ok, its not so urgent, because now I know how to handel such starnge outputs :)
<bonniot>:-)
<rubber_duck>http://wwws.sun.com/software/java2/download.html <-- Here I have never downloaded anything13:22
<bonniot>rubber_duck: i would think the license also covers the source of the core classes
<rubber_duck>I'll send dagobert onto this. He's has a better view of the licenses..13:23
<bonniot>but that would need checking
ok, tell me when you found the precise answer13:24
in the mean time, I stay safe and never look at Sun source :-)
<rubber_duck>Yes, I will inform you about that.13:25
So good, that I never looked at it before also.
<bonniot>looking at the license for the jdk, it does seem that there is no dangerous restriction, including for the source. 13:29
it the the Sun Community Source License that looks problematic
but i might be wrong
<rubber_duck>Yes, but where ends the SunCommunitySourceLicense scope?
<bonniot>i think it is used for prototypes13:31
<arjanb>yes for example the generics beta comes with sourcecode13:32
what's left to do before 0.9.0?13:38
<bonniot>i'm checking on the gcj compilation13:40
one thing i'm not sure i like is the non-ambiguity test for integer intervals
if there is both13:41
foo(n>0)
and
foo(n>1)
i think there should be an ambiguity
then maybe intervals would be useful, like13:42
foo(0<n<5)
foo(n>=5)
foo(n<=0)
that would be correct
<arjanb>well foo(n>1) is more precise than foo(n>0)13:44
for intervals i have to think about how to compare and coverage test them13:46
<bonniot>it's true that n>1 is more precise than n>013:48
it just seems strange, because that case is mostly unused, so it might be a bug
a..b is more precise than c..d if a>=c and b<=d13:49
<arjanb>yes but i have the generate a minimum of numbers to do the coverage test13:52
http://groups.google.com/groups?dq=&hl=en&lr=&ie=UTF-8&threadm=bf27b5%24a6ftf%241%40ID-9852.news.uni-berlin.de&prev=/groups%3Fhl%3Den%26lr%3D%26ie%3DUTF-8%26group%3Dcomp.lang.functional13:56
this url isn't parser correctly by the logger13:59
parsed
btw daniel you should read the posts where this link point to 14:07
<bonniot>i read the two posts14:09
are you reading that forum daily?
<arjanb>no but read some newsgroup occasionally14:10
* alexx joins15:06
could somebody kick alexgreif please, I had a timeout
<bonniot>i just posted a comment on comp.lang.functional15:18
<arjanb>are "throws" modifiers of java methods stored in bytecode?
<bonniot>i would think they are in attributes15:19
<arjanb>i'm trying to make enums serializable and in the java docs:15:20
Serializable classes that need to designate an alternative object to be used when writing an object to the stream should implement this special method with the exact signature: 15:21
ANY-ACCESS-MODIFIER Object writeReplace() throws ObjectStreamException;
<alexx>how can I simulate the following: reflection calls a noarg constructor that calls other methods. The nice compiler can create the noarg constructor too, but the methods are not called that are in the java noarg constructor
is there a possibility to redirect the constructor call on an other method? maybe something like retyping?15:22
<bonniot>arjanb: you have to investigate how throws are put in the bytecode, and if that matters
<alexx>... or if a class has a init{classname} method, then the automatically created constructor calls that init method after super;15:23
<bonniot>alexx: creating a non-default constructor will be possible later15:24
<arjanb>daniel: i don't know how "exact" is in "exact signature"
<alexx>when ? 0.9.2 :)
<bonniot>arjanb: yes, that's why you have to investigate :-)15:25
alexx: i cannot say yet
<alexx>how can I tell the reflection mechanism to call methods that are not in the constructor? but shuld be called to init some stuff
<bonniot>are you sure there is no work-around?
<arjanb>alex: can't you extend the nice class in java and call the right construct in the java no-arg constructor?15:26
<alexx>I will have to look for one
<bonniot>is it your code making the reflexion call?
in that case there is no problem15:27
<alexx>yes I could write a java warapper, but we wanted to avoid this
no eclipse calls reflection
<bonniot>if it is eclipse, then they decide which method/constructor to call
what initialization is needed?
<alexx>eclipse calls the noarg constructor, that should make super and call some other methods
- setDefaultPageImageDescriptor15:28
<bonniot>is it a class that will have several instances?
<alexx>- setDialogSettings
- setWindowTitle
I think no, its a wizard page, its sufficient to create it once15:29
<bonniot>so you could have a "static" method executed when the plugin loads, that triggers the creation of the class, gets the instance, and calls the methods15:30
<alexx>will eclipse call this static method? or you mean a static initializer?15:31
ah, you mean, to preset some static infos, 15:32
before they are neede
<bonniot>package my.plugin;15:33
let boolean initialized = initialize();
boolean initialize()
{
MyClass c = Platform.getPlugin("my.plugin.MyClass");15:34
c.setWindowTitle("...");
return true;
}
class MyClass { ... }15:35
voila
<alexx>is it called once? or on each instantiation?
<arjanb>daniel: the readresolve has to be in inside the class so i have to create an abstract java class with the readresolve method and then make the enum extend that class and implement readsolve so that the readsolve method comes in the class itself
<bonniot>once
what class will implement readresolve? Enum, or each subclass?15:37
<arjanb>i fear every subclass has to implement readresolve
<alexx>but setWindowTitle is not static, so after reflection new ...() the internal window title is invalid because a new instance was created
<arjanb>but that doesn't make the problem different15:38
because enum is also a niceclass
<bonniot>arjanb: if it is every subclass, then the compiler can directly generate readsolve inside them15:40
<alexx>does the auto created constructor only call super ?
<bonniot>alexx: isn't the platform going to instantiate MyClass only once?15:41
then the idea is to trigger that creation, and the call the methods on the instance15:42
the default constructor calls super, and sets the fields declared in the class
<alexx>there is a noarg constructor that is called by reflection, this constr. call a nonstatic setWindowTitle. MyClass is not the plugin itself! its a wizard page15:44
so I cannot get it from the platform
<bonniot>ok. can you get a reference to the instance of MyClass?
<alexx>good question :) I dont know... lets see ...15:45
unfortunately I dont know when <nd where eclipse triggures the reflection mechanism to instantialte the wizard page. Its deep in the eclipse internals15:46
could not the compiler recognize that a special method exists and in case yes it is called in the auto constructor?15:48
<bonniot>it's possible, it just sounds a bit hackish
but adding an initialization part to a class is planned15:49
<alexx>ok
<bonniot>are these calls non-essential?
so that you can just comment them for now, and go on with the plugin?15:50
<alexx>I have to chech nheit necessity15:52
I hope they are not essentioan :)
in eclipse is almost everything instantiated by reflection, so I will have to check all the classes declared in the manifest xml file15:53
<bonniot>for the design of the initializer, one possibility is to allow15:55
class Foo
{
int field;
{ /* initializer */ }
}
in that case there can be several of them15:56
a drawback is that they are not clearly marked
we could also have a special method name for initialization, but that disallows apriori to have several in the same class (unless they are not real methods)15:57
<arjanb>how about init { ... }16:02
<bonniot>that's also possible. but then would init be a keyword?16:06
<arjanb>in java you can add a static initializer using static { ... } inside a class16:07
init a keyword not a good idea16:08
maybe make constructor a keyword so constructor { ... }16:16
or use some token that cannot be part of an ident16:17
why am i trying to make enums serializable when it's not possible to serialize any niceclass16:22
:-(16:23
<bonniot>that's unrealted16:28
related
<alexx> /away
<bonniot>serializing enum values is useful in itself
anyway, it is possible to serialize nice classes
<arjanb>how?16:29
<bonniot>you just need to implement a (java) interface that declares the right methods
we could provide it in nice.lang, as a starter
<alexx> init { ... } maybe used by subclasses. I would call the method init{ClassName}(arg: the instance itself)
<arjanb>initializer of superclasses is always executed before the initializer of the class self16:30
<alexx>is the static initializer only executed once - I think so otherwise it would not be named "static" ??16:31
<arjanb>static initializer is a java only thing
daniel: so nice.lang some like interface Serializable extends java.lang.Serializable { ... }16:33
<bonniot>does it need to extend Serializable?16:35
I thought Serializable is only for classes for which the default serialization is OK
<arjanb>api docs: Serializability of a class is enabled by the class implementing the java.io.Serializable interface. Classes that do not implement this interface will not have any of their state serialized or deserialized. All subtypes of a serializable class are themselves serializable. The serialization interface has no methods or fields and serves only to identify the semantics of being serializable. 16:36
java uses reflection for serialization
<alexx>yozu can use externalisation where you implement methods that know what and how to serialize16:37
Interface java.io.Externalizable16:38
<arjanb>alex: but if you use externalizable then you have to implement the complete serialization process yourself16:39
but using externalizable might work for enums16:40
<alexx>I think there you can use algorithms from the serialization prozess too
but externalizing enums should not be so compicated, or can an enum contain complex classes? other than String Integer... ?16:42
<arjanb>enums in nice can't contain complex classes (not yet???)16:43
<alexx>simple classes all implement Serializable :)
<arjanb>i see16:45
daniel look at the logs of the failed automatic tests16:53
<bonniot>it looks only like a ssh problem17:06
<arjanb>ok just to be sure17:07
it looks like i can get enum serialization working but how do we solve serialization of nice classes in general17:19
the java Serializable interface has 3 implicit methods that can be independantly implemented17:22
but splitting it up to 3 interface in Nice is a bit awkward17:26
* rubber_duck leaves18:23
<arjanb>this weather is hot for doing anything at all18:25
* alexx leaves20:06
<arjanb>daniel?20:18
<bonniot>hi, i'm back20:20
what are the three methods for serialization?20:21
<arjanb>Object writeReplace() throws ObjectStreamException;20:22
Object readResolve() throws ObjectStreamException;
and the pair of 20:23
private void writeObject(java.io.ObjectOutputStream out)
throws IOException
private void readObject(java.io.ObjectInputStream in)
throws IOException, ClassNotFoundException;
i have a little problem with enums in case of multiple packages20:24
i generate method implementations in enumdefinition but when an enum is read of package.nicei i get an duplicat20:25
so how do i know when the enum is in a .nicei file20:26
<bonniot>cannot you only generate it when the package is compiled from source?
<arjanb>ues but how do i know when that is20:27
<bonniot>in what pass do you generate the implementations
<arjanb>parsing
<bonniot>!
you generate the bytecode during the parsing?
<arjanb>no just the ast things20:28
<bonniot>?
you should probably do that in the 'compile' method, which is only called when the package is compiled from source
<arjanb>i'm not sure how to do that, i need to register that implementation for dispatch, and ..20:32
<bonniot>no, you don't need to register it
if we are speaking about serialization methods20:33
<arjanb>no that's not the problem i trying to make a family method that returns a list of all enum element of the same type20:34
family(@Color) = [Red, Blue ,Green];20:36
serialization can i implement in the abstract enum class20:38
<bonniot>ok
i don't think family should be a method taking an enum value20:39
why would family(Red) be useful?
I would expect something like Color.family
<arjanb>the family method is also in the java proposal20:41
<bonniot>yes, but isn't is a static method?
<arjanb>no and there is no example of usage
<bonniot>public static List<this enum class> VALUES;20:43
about the method:
This instance method simply
* returns VALUES. Few programmers should have any need to use this
* method. It is provided for use by sophisticated enum-based data
* structures to prevent the need for reflective access to
* VALUES.
so family seems unessential, until we find a good use20:44
<arjanb>readResolve(readEnum@Enum) 20:47
{
for (Enum x : readEnum.family())
if (x.name.equals(readEnum.name)
return x;
throw new ObjectStreamException();
}
<bonniot>i see20:49
* arjanb leaves
* arjanb joins20:52
a little connection prob
but do you know an alternative way to implement readresolve?20:53
<bonniot>that way seems fine to me. now i see a motivation for family :-)20:56
<arjanb>if a i need the register that method at compile time how do i get the declaration?20:58
<bonniot>the declaration could be found like for any other implementation21:00
<arjanb>so i should make the method implementation a field of enumdefinition and find out which things to do21:08
<bonniot>yep!21:09
do you know about http://jakarta.apache.org/commons/lang/api/21:40
there are many utilities there. some of them might be useful (there is an enum implementation for instance) or give good ideas...
<arjanb>i will look at that21:41
<bonniot>i wonder if it is a good choice to use -> for implication, and => for anonymous functions21:44
maybe the opposite would be more logical, given that -> is used for the types of functions
<arjanb>it's matter of what you're used to21:47
http://merd.net/pixel/language-study/syntax-across-languages/Fnctn.html#FnctnnnmsFnct21:49
-> is more often used for anonymous functions
btw that jakarta library has some good ideas for things to add to the nice stdlib21:51
* alexgreif joins21:54
<bonniot>i'll be going soon21:57
good night21:58
* bonniot leaves21:59

Generated by Sualtam