comp.lang.java.programmer
http://groups-beta.google.com/group/comp.lang.java.programmer
[EMAIL PROTECTED]

Today's topics:

* Regex problem. - 4 messages, 4 authors
  
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/3c8b6844d18aa371
* Why would file reading stop at 1124 bytes with this code? - 4 messages, 3 authors
  
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/f79ea47a0b0aea21
* reading large jpeg / jpg files error on java imageio read: 
javax.imageio.IIOException: Unsupported Image Type - 1 messages, 1 author
  
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/a637d95649897430
* Tomcat responce time 10-200 seconds once in a while - 1 messages, 1 author
  
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/eff0206fed26be06
* Looking for a jar manager in java. - 1 messages, 1 author
  
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/21cca5a7232d050f
* Thread-question - 2 messages, 2 authors
  
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/5766e179910e25fa
* Reading Stacktrace in J2ME? - 3 messages, 2 authors
  
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/7c1df4fa6425d1c5
* JMF usage question - 1 messages, 1 author
  
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/aad921bc1cea5088
* How do you report a JIT crash bug? - 2 messages, 2 authors
  
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/6e12e8e3c39c7cc4
* simplifying use of properties - 5 messages, 4 authors
  
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/c8ec2d768fef49b3
* J2SE SDK & Tomcat coexist w/Visual Studio.NET & IIS? - 1 messages, 1 author
  
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/995f13feb0b7d194
* Apache Axis and JDK1.5 - 2 messages, 2 authors
  
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/274cfa6bf37ead9b
* Is it possible to set a block of code as non-JIT area? - 2 messages, 2 authors
  
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/efa6df384a75654c
  
==========================================================================
TOPIC: Regex problem.
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/3c8b6844d18aa371
==========================================================================

== 1 of 4 ==
Date:   Fri,   Nov 5 2004 1:14 pm
From: [EMAIL PROTECTED] (X. Lee) 

Hello,  I am in need of some regex assistance..

In my project, I need to parse a String and replace everything within
brackets with the String "xx".

I thought this would be pretty simple, using the Pattern "(\[.+\])".

this pattern works fine if there is only one set of brackets in my
String, however it fails if I have multiple bracket sets because it
only seems to consider the very first and very last brackets found.

e.g.:  

"This is my [test] String" becomes "This is my [xx] String"   <-- fine

but "This is [my] other [test] String" also becomes "This is my [xx]
String" instead of "This is [xx] other [xx] String"   <-- not fine

So the matcher finds "[my] other [test]" instead of finding [my] and
[test] separately.

How can I make it find each set of brackets separately?



== 2 of 4 ==
Date:   Fri,   Nov 5 2004 2:44 pm
From: [EMAIL PROTECTED] 

It does work if you reduce the narrow down the intermediate
characters...

System.out.println("This is [my] other [test]
String".replaceAll("[\\[][a-zA-Z0-9]+[\\]]", "xx"));

does print "This is xx other xx String". The ']'  seems to be included
in ".+". 

Just a thought.
-Siplin




== 3 of 4 ==
Date:   Fri,   Nov 5 2004 2:58 pm
From: "Ferenc Hechler" <[EMAIL PROTECTED]> 

try "(\[[^\]+])"
means:  first "[", then sequence of chars except "]" and last "]"

the problem is that "+" and "*" are greedy, they take as much as they can.
There is a possipility to use the shortest match with an "?", but I am not 
sure about the correct syntax.

bye,
   feri 





== 4 of 4 ==
Date:   Fri,   Nov 5 2004 3:05 pm
From: Alan Moore <[EMAIL PROTECTED]> 

On Fri, 5 Nov 2004 23:58:32 +0100, "Ferenc Hechler"
<[EMAIL PROTECTED]> wrote:

> the problem is that "+" and "*" are greedy, they take as much as they can.
> There is a possipility to use the shortest match with an "?", but I am not 
> sure about the correct syntax.

You just add the '?' after the '*' or '+':

  str = str.replaceAll("\\[.*?\\]", "[xx]");





==========================================================================
TOPIC: Why would file reading stop at 1124 bytes with this code?
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/f79ea47a0b0aea21
==========================================================================

== 1 of 4 ==
Date:   Fri,   Nov 5 2004 1:33 pm
From: "Mickey Segal" <[EMAIL PROTECTED]> 

"Mickey Segal" <[EMAIL PROTECTED]> wrote in message 
news:[EMAIL PROTECTED]
> I've now made a test version of this applet so I can fiddle more than I 
> could with the version that in use by our software.  One of the things I 
> can now test is whether the problem is reading the file or sending out the 
> response string.

Using my new test version I can verify that the full string is read properly 
by the servlet.  The problem seems to be later, sending a large string back 
as a response doesn't work.  The reportString output of my read_delete 
method is handed off to what I thought was pretty generic code in the 
servlet's doPost method:

res.setContentType("text/plain");
PrintWriter out = res.getWriter();
out.print(reportString);
out.flush();

Is there some problem using such code for a String of longer than 1124 
bytes?  Sometimes a longer String is sent without truncation to 1124 bytes, 
but usually it gets truncated to 1124 bytes.
 





== 2 of 4 ==
Date:   Fri,   Nov 5 2004 3:42 pm
From: "Mickey Segal" <[EMAIL PROTECTED]> 

"Mickey Segal" <[EMAIL PROTECTED]> wrote in message 
news:[EMAIL PROTECTED]
> "Mickey Segal" <[EMAIL PROTECTED]> wrote in message 
> news:[EMAIL PROTECTED]
> Using my new test version I can verify that the full string is read 
> properly by the servlet.  The problem seems to be later, sending a large 
> string back as a response doesn't work.

The problem may be even later, in the receiving code in the applet.  I will 
re-do that; hopefully it will solve the problem. 





== 3 of 4 ==
Date:   Fri,   Nov 5 2004 4:27 pm
From: Steve Horsley <[EMAIL PROTECTED]> 

Mickey Segal wrote:
> "Mickey Segal" <[EMAIL PROTECTED]> wrote in message 
> news:[EMAIL PROTECTED]
> 
>>"Mickey Segal" <[EMAIL PROTECTED]> wrote in message 
>>news:[EMAIL PROTECTED]
>>Using my new test version I can verify that the full string is read 
>>properly by the servlet.  The problem seems to be later, sending a large 
>>string back as a response doesn't work.
> 
> 
> The problem may be even later, in the receiving code in the applet.  I will 
> re-do that; hopefully it will solve the problem. 
> 
> 
Ah! You're not using that nasty available() thing at the receiver are you?
Available() may welll return 0 if not all the reply has arrived yet. This
is more likely to happen with larger strings. 1120 could be the size of the
payload after the HTTP header that hapens to fit in one packet.

Steve



== 4 of 4 ==
Date:   Fri,   Nov 5 2004 6:50 pm
From: Sudsy <[EMAIL PROTECTED]> 

Mickey Segal wrote:
<snip>
> res.setContentType("text/plain");
> PrintWriter out = res.getWriter();
> out.print(reportString);
> out.flush();
> 
> Is there some problem using such code for a String of longer than 1124 
> bytes?  Sometimes a longer String is sent without truncation to 1124 bytes, 
> but usually it gets truncated to 1124 bytes.

I hate to mention the obvious, but I don't see an invocation of
setContentLength here. I know from experience that not specifying
the length can give receivers conniptions.

-- 
Java/J2EE/JSP/Struts/Tiles/C/UNIX consulting and remote development.





==========================================================================
TOPIC: reading large jpeg / jpg files error on java imageio read: 
javax.imageio.IIOException: Unsupported Image Type
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/a637d95649897430
==========================================================================

== 1 of 1 ==
Date:   Fri,   Nov 5 2004 1:44 pm
From: "Davidski" <[EMAIL PROTECTED]> 

When using javax.imageio.ImageIO.read() to read files ~>2MB in size, 
javax.imageio.IIOException: Unsupported Image Type occurs. Everything works 
ok with files <~2MB (don't know the exact figure). Tried both jdk1.4.2 and 
1.5 with the same results. HELP! 






==========================================================================
TOPIC: Tomcat responce time 10-200 seconds once in a while
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/eff0206fed26be06
==========================================================================

== 1 of 1 ==
Date:   Fri,   Nov 5 2004 2:33 pm
From: "Maz Rashid" <[EMAIL PROTECTED]> 

Have you considered, that this might be the garbage collector, that takes
that long?
regards
Maz

-- 
Maz Rashid * http://www.mazcity.de * ICQ 159547510
--
"Roman Zhovtulya" <[EMAIL PROTECTED]> schrieb im Newsbeitrag
news:[EMAIL PROTECTED]
> Dear all,
> I wonder if anyone had anything similar before.
> I'm running some JSP/Java Bean websites under Tomcat (on one PC as a
> stand-alone server, on another in connection with Apache).
>
> The website is a dynamic (3-tier architechture) connects to MySQL
> database to get the content to display any page (around 3-4 connections
> per page).
>
> Normally the performance is really good, but about once a day it gets
> really slow (around 1-5 minutes to display the page). It also recovers
> autocatically to normal response time when you simply wait 5-10 minutes.
>
> Any ideas?
>
> I'm running Tomcat 4.05 with Apache on RedHat 8.0 (one PC) as well as
> Tomcat 4.127 on SuSE 9.0 with MySQL 4.015.
>
> I'm closing all db-connections in JSP/JavaBeans, so I don't think it's a
> db-issue.
>
> I'd highly appreciate any help on the topic.
>
> Thank you very much,
> Roman Zhovtulya






==========================================================================
TOPIC: Looking for a jar manager in java.
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/21cca5a7232d050f
==========================================================================

== 1 of 1 ==
Date:   Fri,   Nov 5 2004 3:02 pm
From: "Ferenc Hechler" <[EMAIL PROTECTED]> 

There is an Eclipse plugin "Jar-Plug" which allows manipulating jars
http://jar-plug.sourceforge.net/






==========================================================================
TOPIC: Thread-question
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/5766e179910e25fa
==========================================================================

== 1 of 2 ==
Date:   Fri,   Nov 5 2004 4:15 pm
From: [EMAIL PROTECTED] (hiwa) 

Ao <[EMAIL PROTECTED]> wrote in message news:<[EMAIL PROTECTED]>...
> but freezes my UI...

See Q3.1, 3.2 and 4 .2 of the FAQ:
http://groups.google.com/groups?hl=en&lr=&selm=cjr8er%24oo0%241%40newstree.wise.edt.ericsson.se

Also, Runtime#addShutdownHook() may be of your service.



== 2 of 2 ==
Date:   Fri,   Nov 5 2004 11:00 pm
From: Babu Kalakrishnan <[EMAIL PROTECTED]> 

Ao wrote:
> 
> when closing my program I would like to start a Thread which does some 
> cleaning up in the background, but opf course before exiting I need to 
> be sure, that this Thread has finished running...
> 

Runtime.getRuntime().addShutdownHook()

BK




==========================================================================
TOPIC: Reading Stacktrace in J2ME?
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/7c1df4fa6425d1c5
==========================================================================

== 1 of 3 ==
Date:   Fri,   Nov 5 2004 4:31 pm
From: "Rhino" <[EMAIL PROTECTED]> 

Can anyone tell me how to decipher a J2ME stacktrace?

I am working on my first couple of J2ME applications. I'm using the Sun
Wireless Toolkit 2.2. When I crash my MIDlet, I get something like this:

startApp threw an Exception
java.lang.NullPointerException
java.lang.NullPointerException
 at javax.microedition.lcdui.ChoiceGroup.<init>(+92)
 at javax.microedition.lcdui.List.<init>(+61)
 at MemberManager.constructMemberList(+18)
 at MemberManager.startApp(+16)
 at javax.microedition.midlet.MIDletProxy.startApp(+7)
 at com.sun.midp.midlet.Scheduler.schedule(+270)
 at com.sun.midp.main.Main.runLocalClass(+28)
 at com.sun.midp.main.Main.main(+116)

Can someone tell me what the signed numbers in brackets mean and how I can
relate them to line numbers in my source code?

For instance, in this example, the NullPointerException happened in
MemberManager.constructMemberList and MemberManager.startApp but I can't
figure out what the +18 and +16 mean. I'm used to those being unsigned
integers that coincide with the line number in the source code where the
error took place. But lines 16 and 18 of MemberManager are NOT in the
constructMemberList and startApp methods, they are javadoc comments early in
the program.

How do I find which line of source code threw the exception?

I'd be very grateful for some help with this basic question; it would
certainly save me some time ;-)

-- 
Rhino
---
rhino1 AT sympatico DOT ca
"There are two ways of constructing a software design. One way is to make it
so simple that there are obviously no deficiencies. And the other way is to
make it so complicated that there are no obvious deficiencies." - C.A.R.
Hoare





== 2 of 3 ==
Date:   Fri,   Nov 5 2004 6:08 pm
From: "Darryl L. Pierce" <[EMAIL PROTECTED]> 

Rhino wrote:

> Can someone tell me what the signed numbers in brackets mean and how I can
> relate them to line numbers in my source code?

The opcode. Don't ask me why the MIDP emulators do that. I think it's dumb
that they don't give you a line number...

<snip>
 
> How do I find which line of source code threw the exception?

The old fashioned way: you have to put System.out.println() statements into
the code in question and track it down from there...

-- 
/**
 * @author Darryl L. Pierce <[EMAIL PROTECTED]>
 * @see    The Infobahn Offramp <http://mcpierce.multiply.com>
 * @quote  "Lobby, lobby, lobby, lobby, lobby, lobby..." - Adrian Monk
 */



== 3 of 3 ==
Date:   Fri,   Nov 5 2004 9:05 pm
From: "Rhino" <[EMAIL PROTECTED]> 


"Darryl L. Pierce" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Rhino wrote:
>
> > Can someone tell me what the signed numbers in brackets mean and how I
can
> > relate them to line numbers in my source code?
>
> The opcode. Don't ask me why the MIDP emulators do that. I think it's dumb
> that they don't give you a line number...
>
I'll go along with that! I suppose the developers sat down and weighed their
options: "Gee, what should we put in the stacktrace? The line number just
like every other version of Java and something which people can use, or the
opcode, which is useless to just about everyone? Okay, let's go with the
opcode....".

> <snip>
>
> > How do I find which line of source code threw the exception?
>
> The old fashioned way: you have to put System.out.println() statements
into
> the code in question and track it down from there...
>
That's what I *have* been doing. I was hoping there was some way to convert
the info in the stacktrace to line numbers or reconfigure the toolkit so
that it produced line numbers but it looks like I'm out of luck. Oh well,
back to 1982 techniques....

Thanks for filling me in on this question Darryl!

Rhino






==========================================================================
TOPIC: JMF usage question
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/aad921bc1cea5088
==========================================================================

== 1 of 1 ==
Date:   Fri,   Nov 5 2004 5:49 pm
From: [EMAIL PROTECTED] (Ted Holden) 


>
>Cross platform, or..
>
>> Basically, all I need is somethinng which works and is reasonably
>> portable 
>
>'portable' across platforms.  It depends on the media types 
>(which you have thus far not specified).

Basically just mpeg movie files, mpeg2 and possibly mpeg4 and for a
general purpose product if it oculd work on Windows and Apple machines
that would probably suffice, with Linux nice to have also.

Any reason not to think JMF would do that, or is there any other
possible way to go at the problem if it doesn't?












==========================================================================
TOPIC: How do you report a JIT crash bug?
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/6e12e8e3c39c7cc4
==========================================================================

== 1 of 2 ==
Date:   Fri,   Nov 5 2004 6:41 pm
From: Sudsy <[EMAIL PROTECTED]> 

Mickey Segal wrote:
> I looked through the crash logs and they don't seem to reveal anything that 
> can't be released so I posted two at www.segal.org/java/sun_jit/.  If anyone 
> has any clues about how to read such tea leaves in a way that would help Sun 
> fix the bug or help me work around it I'd be interested.  A lot of Java 
> methods are mentioned but it doesn't seem as easy to interpret as a typical 
> Exception trace in a Java Console. 

Mickey,
    It looks like a call to Component.removeAll is invoking the underlying
Component.removeNotify, which is supposed to disconnect from the native
peer. The code is dying in a native method in NTDLL.DLL.
    Now this is just a wild shot in the dark but I wouldn't be surprised
to see something like this if you were trying to remove the container
twice; once in the MouseReleased method and again in the calling method.
Without seeing the code it's impossible to guess further.
    Perhaps you've invoked addMouseListener on a Dialog?

-- 
Java/J2EE/JSP/Struts/Tiles/C/UNIX consulting and remote development.




== 2 of 2 ==
Date:   Fri,   Nov 5 2004 8:01 pm
From: steve <[EMAIL PROTECTED]> 

On Fri, 5 Nov 2004 18:53:58 +0800, Chris Uppal wrote
(in article <[EMAIL PROTECTED]>):

> Thomas Weidenfeller wrote:
> 
>> Pay them. No joke. Sun offers professional services, where experts even
>> come down to your site and look at the stuff.
>> 
>> I never did this for Java, but I went through this a few times, e.g.
>> when hunting nasty bugs in their C/C++ compiler.
> 
> /You/ pay /them/ to look for bugs in /their/ software ?  Wow !
> 
> Now that's the business to be in...
> 
>     -- chris
> 
> 
get used to it.
Oracle  do the same.
so does novell.

steve





==========================================================================
TOPIC: simplifying use of properties
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/c8ec2d768fef49b3
==========================================================================

== 1 of 5 ==
Date:   Fri,   Nov 5 2004 8:47 pm
From: Sudsy <[EMAIL PROTECTED]> 

kartik wrote:
<snip>
> Because
> window.visible = true
> is clearer than
> window.setVisible(true)
<snip>

Not to me. The first implies a public instance variable. The second hides
the actual implementation. And isn't encapsulation a big part of OOD/A?
So you'd mar the beauty of the language just because YOU think that the
first "is clearer"?
Egads! And using abortions like VB and C# to justify your position?
('tis to weep)

-- 
Java/J2EE/JSP/Struts/Tiles/C/UNIX consulting and remote development.




== 2 of 5 ==
Date:   Sat,   Nov 6 2004 12:02 am
From: "Stefan Schulz" <[EMAIL PROTECTED]> 

On 5 Nov 2004 20:35:36 -0800, kartik <[EMAIL PROTECTED]> wrote:
e its value.
>>
>> Maybe it is just me, but i think this is a horribly confusing idea with
>> just no merit. Why should anyone want this?
> Because
> window.visible = true
> is clearer than
> window.setVisible(true)
>
> Besides, properties allow you to avoid defining accessor methods till
> you need them, while retaining flexibility to change the
> implementation at any time.

Well, you have made an argzment (quality nonwithstanding, i disagree even
on source level) for changing source code semantics. This could
either be implemented on the compiler level, in which case it would  
generate
an invokevirtual instruction for _some_ field accesses (and all attendent
unclear code path problems). So even if your argument held, there would be
no reason to tinker with the VM instructions.

> No merit? Properties are supported in many languages like Python,
> Ruby, C# and (I think) VB.

So what? They are in java too (see the public modifier for fields) ;)

>> An invokevirtual is a clear
>> instruction. A setfield is also a clear instruction. Your proposal is
>> much less clear
>
> My proposal may make the getfield & setfield instructions a little
> more complex, but it increases clarity at the source level - & that's
> what matters for most programmers.

I really do not see any increase in source clarity, sorry. Where is the
benefit? If anything, it is "syntactic sugar" for accessing setter/getter
methods, and can be included in the compiler. It will however make it
even more of a living hell to explain to novices that a setter/getter pair
need not be backed by one and only one field of the arguemnt type.


-- 

Whom the gods wish to destroy they first call promising.



== 3 of 5 ==
Date:   Fri,   Nov 5 2004 8:49 pm
From: [EMAIL PROTECTED] (kartik) 

"John C. Bollinger" <[EMAIL PROTECTED]> wrote in message news:<[EMAIL PROTECTED]>...
> kartik wrote:
> 
> >                           Wouldn't it be better to extend the language
> > so that an expression "object.foo" (without a '()'), in the absence of
> > a field named foo, is treated as equivalent to a call to a
> > getter/setter method (depending on whether the property is being read
> > or written).
> 
> Why would it be better?  What do you expect to gain by this?  I don't 
> even see the problem you hope to solve.
It will make code clearer, and more intuitive; instead of:
window.setVisible(true)
you will be able to write:
window.visible = true

Besides, you can avoid defining accessor methods till you need them,
while retaining flexibility to change the implementation at any time.

> > I feel it would be better to do this *not* by a compile-time
> > transformation but by changing the spec of the getfield & putfield
> > instructions to invoke a getter/setter method when there is no
> > matching field. Then, classes can replace fields with properties (or
> > vice-versa) without hurting binary compatibility (for clients who
> > access the fields/properties using the "object.foo" syntax).
> 
> If your basic idea were adopted then the compatibility features of your 
> suggested implementation would be attractive, but their implementation 
> would be a bit messy.
It doesn't seem that way to me. In the code for getfield/setfield,
when you notice that the field doesn't exist, instead of throwing a
NoSuchFieldException, call a method.

> More importantly, however, implementing this in 
> the JVM would introduce a (Java convention) <-> (bytecode semantics) 
> relationship that would be wholly inappropriate.
Why is it inappropriate? I feel source code clarity is more important
than source -> bytecode mapping.

> Furthermore, although 
> there would be compatibility advantages going forward, the suggested JVM 
> change is _not_ fully binary compatible with existing classes because it 
> does not reproduce the error behavior currently specified by the 
> language and VM specs (and implemented by the current compiler / VM 
> combination).
Agreed, but how much code depends on such behaviour? If the decision
is taken not to break such code, perhaps the VM behavior can difer
based on the version of the class file (that defines the current
class), or by a flag in the class file. Such a change to the VM
semantics has been done before - method invocation can sometimes
behave differently based on whether the ACC_SUPER flag is set.
 
> The JVM, although designed to support Java, can and does support other 
> languages.  It's native language, bytecode, is a high-level OO language 
> entirely of its own.  In consideration of those facts I'd argue that it 
> is entirely inappropriate to implement a change to Java language 
> semantics by means of a change to bytecode semantics.
We are propsing to change the semantics only for what is presently an
error. This doesn't seem inappropriate, given the benefits.



== 4 of 5 ==
Date:   Sat,   Nov 6 2004 12:47 am
From: "Chris Uppal" <[EMAIL PROTECTED]> 

kartik wrote:

> Because
> window.visible = true
> is clearer than
> window.setVisible(true)

I think that the biggest thing /I/ dislike about this is that it confuses the
distinct concepts of the /behaviour/ of an object and its /state/.

The /state/ is inherently a private thing in OO (whether or not it's
implemented in private variables -- there's a fairly good consensus that
variables should always be private for OO).

The /behaviour/ is how it behaves in the "ecology of communicating objects"
that forms an OO program.

Now there are two ways to go from their. One is to say that your proposal fails
to distinguish the two, and hence is unacceptably flawed.  I think that as you
have stated it, this is the case -- you really are thinking of the first form
above as accessing a variable and want to (be able to) implement it that way.
That leads to the modifications to the JVM behaviour (which is in itself
unacceptable anyway, IMO).   It would also lead to confusion about how
"variables" are inherited.  Remember that behaviour can be overriden, state
cannot (Java does allow you to 'hide' superclass fields, but they are still
there and are still in use by code that is not overriden).

Alternatively, you can see both the above forms as purely syntactic variations
on a message send.  In that case it is purely a matter for the compiler.
There is nothing whatever to stop you defining your own language that
interoperates with Java-compiled classes, but which makes the syntax you prefer
available.  It then becomes a question of will anyone else like your variant
enough for it to become popular.  Maybe it would, I don't know, but /I/
wouldn't want to bother with it.  The reason for that is that I have no great
interest in "setting objects' properties", what I want to do is /send messages
to them/.  For instance:
    window.beVisible()
is clearer than either of the forms you give above.  Even if you look for pairs
of 0-arg, 1-arg methods and label them "properties", then they'll be rare in my
code.  So, even if I did think that your first form provided a significant
advantage over the second, I still wouldn't often use it.

To put it another way, what you are doing is providing an optimised syntax for
accessors, but the problem with that is that the very /concept/ of accessors
has no place in OO programming.

I would certainly agree that the function-call-like syntax for message sends
that Java has inherited from C (via C++) is less than optimal.  In fact I think
it sucks.  But I don't think that patching "properties" onto the language is
going to help.  I view the concept as a mistake, or at least as a red-herring,
and am not particularly impressed by any of the languages you mention that
include it.  (Though Ruby has some fine qualities too).

    -- chris






== 5 of 5 ==
Date:   Sat,   Nov 6 2004 12:58 am
From: "Stefan Schulz" <[EMAIL PROTECTED]> 

On Sat, 6 Nov 2004 08:47:47 -0000, Chris Uppal  
<[EMAIL PROTECTED]> wrote:

> The /state/ is inherently a private thing in OO (whether or not it's
> implemented in private variables -- there's a fairly good consensus that
> variables should always be private for OO).

Well, i can accept package and protected fields, but i usually would prefer
an accessor with that modifier. Fields should  never be public, unless
they are final and refer to an immutable object.


-- 

Whom the gods wish to destroy they first call promising.




==========================================================================
TOPIC: J2SE SDK & Tomcat coexist w/Visual Studio.NET & IIS?
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/995f13feb0b7d194
==========================================================================

== 1 of 1 ==
Date:   Fri,   Nov 5 2004 10:40 pm
From: Kerry Sanders <[EMAIL PROTECTED]> 

Franklin Barths wrote:
> OK, and I assume you mean for Tomcat and IIS.  Does
> it matter if they are not running at the same time?  Any
> other possible interferences with MS Access?


I have both setup on my laptop with no problems.  As another person 
mentioned in the thread, definitely check the ports.  I changed the port 
value in ./server/all/conf/jboss-service.xml to something like 8081 or 
whatever you decide.  Just make it something other than port 80, which 
is what IIS uses by default.




==========================================================================
TOPIC: Apache Axis and JDK1.5
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/274cfa6bf37ead9b
==========================================================================

== 1 of 2 ==
Date:   Fri,   Nov 5 2004 11:10 pm
From: Jacob <[EMAIL PROTECTED]> 

Mike Schilling wrote:

> Except in the files that need to reference the "enum" packages directly, you 
> could use all the 1.5 features you like.  Of course, when it comes time to 
> deploy your web services, you'd need to put them in a container that 
> supports 1.5.  AFAIK, that wouldn't be any of the large commercial ones 
> (WebLogic, WebSphere, etc.) yet.  Not sure about Tomcat, JBoss, etc. 

WDSL2Java auto-generates code that use the enum package
so there is no simple way out of this misery.

My code is not under container control so there is no
issues there; It is ready to ship as soon as I get a
decent SOAP library to work with.



== 2 of 2 ==
Date:   Fri,   Nov 5 2004 11:18 pm
From: "Mike Schilling" <[EMAIL PROTECTED]> 


"Jacob" <[EMAIL PROTECTED]> wrote in message 
news:[EMAIL PROTECTED]
> Mike Schilling wrote:
>
>> Except in the files that need to reference the "enum" packages directly, 
>> you could use all the 1.5 features you like.  Of course, when it comes 
>> time to deploy your web services, you'd need to put them in a container 
>> that supports 1.5.  AFAIK, that wouldn't be any of the large commercial 
>> ones (WebLogic, WebSphere, etc.) yet.  Not sure about Tomcat, JBoss, etc.
>
> WDSL2Java auto-generates code that use the enum package
> so there is no simple way out of this misery.

And this generated code won't use any 1.5 features, so compiling it "-source 
1.4" doesn't lose you anything. 






==========================================================================
TOPIC: Is it possible to set a block of code as non-JIT area?
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/efa6df384a75654c
==========================================================================

== 1 of 2 ==
Date:   Sat,   Nov 6 2004 12:35 am
From: Tor Iver Wilhelmsen <[EMAIL PROTECTED]> 

[EMAIL PROTECTED] (jacksu) writes:

> For the rest of the code, I would like the JIT to do the magic, but
> for certain portion of the java code, I would make it untouched by the
> JIT.

Translation: I know (better than the makers of Hotspot) what portions
of my code should be machine-translated and which should be
interpreted.

The only way to do this is to write your own JVM implementation.
Presumably you need a compiler extension as well, e.g.

 public void foo() {

    { /** @pragma interpreted */
        int i = 42;
        System.out.println(i);
    }
}



== 2 of 2 ==
Date:   Sat,   Nov 6 2004 1:02 am
From: "Chris Uppal" <[EMAIL PROTECTED]> 

jacksu wrote:

> For the rest of the code, I would like the JIT to do the magic, but
> for certain portion of the java code, I would make it untouched by the
> JIT.

Since there's no mention of the JITer in either the Java standard or the JVM
standard (i.e. the use of a JIT, or any alternative technology is purely an
implementation detail) there can be no standard way of doing that.  Any such
feature would be provided by the /specific/ implementation of the JVM that you
are using.  Perhaps as a runtime -XX option that specified a file containing a
list of methods that should/should not be optimised.

It's not an inherently silly thing to want, but I don't know of any JVM
implementation that provides it -- probably because there's little need for it
in general.

If you really /need/ to avoid the space/time costs of compiling some chunks of
bytecode (and don't want to implement your own JVM) then you could always write
a small interpreter (in Java) and embed that, plus the stuff you want it to
interpret, into your program.  If you go that route then I'd advise against
using the JVM bytecode set as the target for your interpreter -- it is
complicated and not particularly compact.

    -- chris






=======================================================================

You received this message because you are subscribed to the
Google Groups "comp.lang.java.programmer".  

comp.lang.java.programmer
[EMAIL PROTECTED]

Change your subscription type & other preferences:
* click http://groups-beta.google.com/group/comp.lang.java.programmer/subscribe

Report abuse:
* send email explaining the problem to [EMAIL PROTECTED]

Unsubscribe:
* click http://groups-beta.google.com/group/comp.lang.java.programmer/subscribe


=======================================================================
Google Groups: http://groups-beta.google.com 

Reply via email to