comp.lang.java.programmer Google Group
Programming in the Java language.
- Re: A question related to type casting
Whatever type T is.
using System;
using System.Collections.Generic;
namespace E
{
public class BigG<T> where T : new()
{
public static T GiveMe()
{
return new T();
}
}
public class Program
{
private static void Analyze(string prefix, Type t) - Re: Standalone gnu-diff like tool in Java
It only supports some Windows versions (2000, XP and 2003 - not 9x and
Vista - and most likely not 2008 when it does not support Vista).
Infrequent updates (latest version is form 2006).
Most likely less utilities (my cygwin install has 1805 exe's
in bin dir).
Arne - Re: A question related to type casting
If developers ignore compiler warnings, then I don't think they
should complain over runtime error.
I do.
Well - a nice yellow warning sign with a warning text similar
to what -Xlint gives.
It obviously does.
But in most cases developers would agree about what is weird.
It looks very weird to me. The code say "give me something type - Re: A question related to type casting
Well - It is a fact that the feature is used in C#.
I find it difficult to believe that Java programmers would
not use it if it was available in Java.
Constructors can be different, but a lot of classes have noarg
constructors.
Arne - Re: A question related to type casting
I don't agree. Creating a new instance is not something it really
makes sense to be able to do "generically". Different classes have
different constructors, with various arguments and different
requirements. And there's no way to specify a constructor for all
subclasses with inheritance. Nor would you really want to. A subclass - Re: A question related to type casting
Lew wrote:
WTF?
I *did* post the warnings that javac gives. Those *are* the warnings
about the use of unparameterized types.
Those would be the warnings about the use of unparameterized types.
Come on, man.
I wonder why Eclipse chose to go with different warnings from what
other Java compilers issue. I don't know what Eclipse says; I - Re: Java6: When are BROWSE and MAIL actions supported on Linux?
Bernd Eggink schrieb:
OK, I found it, by trial and error. The 'avahi' library from gnome was
missing.
I also found this "technical article":
[link]
which says: "On the Solaris Operating System and the Linux platform,
this API is dependent on Gnome libraries". That's it. Not an overly - Re: visibility on array elements
Thanks a lot to you and Arne (and the others that will jump in)
for answering my question,
Driss - Re: A question related to type casting
I guess that depends on your definition of "just fine". The fact is, the
compiler passes the code, and the run-time executes it. I prefer no
warnings when I compile, but they aren't a restriction on the code itself,
and I'm not seeing the warning you describe anyway.
I don't get that warning from Eclipse. - Re: A question related to type casting
Precisely!
You're quite right. I hadn't thought this through properly - a F<? extends
T> is *actually* a F<U extends T>, for some U. You don't know it at
compile-time, but it's there, and in a reified system, you'd know it at
runtime.
tom - Re: A question related to type casting
Lew wrote:
This absolutely does *not* compile "just fine". You get an "unchecked
cast" warning for the cast to a raw List.
You're really not supposed to mix raw and generic types in Java. This
is what Arne was referring to when he spoke of "weird looking code"
that lets you "shoot yourself in the foot". - Re: (macosX,netbeans) jndi : can't find serialContextProvider
there are news: I created a new domain via the console, and I started
the domain.
now I have the message : moi.un.plus_2bBean not found.
NB: the lookup method contains the argument "moi.un.plus_2bBean" which
is the argument ,in the bean code, of the annotation
"mappedName("moi.un.plus_2bBea n")".
olivier. - Re: A question related to type casting
On Wed, 31 Dec 2008 05:42:57 -0700, Tom Anderson <t...@urchin.earth.li>
wrote:
Impossible to say until you tell me the type parameter. But, for example:
Cache<String> cache = new Cache<String>();
Object obj = cache.makeNewElement();
The type of the instance referred to by "obj" would be "String". - Re: visibility on array elements
Yes, you'll get 3L (assuming nothing else has disturbed
ref[0] in the meantime).
You can synchronize all accesses on the array itself, as
above, in which case no accesses will overlap and modifications
made by any thread will be visible to all others. Note that
this may create more contention than if you could somehow - Re: HTML Correctness and Validators
True.
For CSS to be a good solution then the HTML need to be designed
for usage with CSS.
Arne