On 4/24/12 11:24 AM, Bill Burke wrote:
Well, I used the JDK as-is. This looks like a bug in the code
class WriteFinishedEvent extends Event {
WriteFinishedEvent (ExchangeImpl t) {
super (t);
assert !t.writefinished;
t.writefinished = true;
}
}
Why do a false assertion then set the same variable to true? Also,
writefinished is not referenced/set anywhere in that package except for
this code. So how can it ever work?
Yeah if you grep for assert in the code you can see they are all mostly
broken, and when they fail you get corruption all over the place
(leaking connections, bad states etc).
What I meant is that JDK code (everything on the bootclasspath) never
enables assertions (even if you run with -ea, since it's the classloader
that ultimately decides whether or not to allow them). We were going to
add an enhancement to jboss modules to allow us to disable assertions on
a per module basis for this very reason, but really we should just fix
the broken code.
BTW, apologies, I didn't even know you could have mulitple non-public
class definitions in the same .java file.
On 4/24/12 12:07 PM, Jason T. Greene wrote:
> Oh btw. Assertions are broken in the sun http server code. That's
> probably your problem. If you enable assertions they are not enabled for
> the JDK code. We need to comment them out and do a new release.
>
> On 4/24/12 11:06 AM, Jason T. Greene wrote:
>> That's a private class:
>>
>>
https://github.com/jbossas/httpserver/blob/master/src/main/java/org/jboss...
>>
>>
>>
>>
>> On 4/24/12 11:00 AM, Bill Burke wrote:
>>> Code is missing, Specifically
>>> org.jboss.sun.net.httpserver.WriteFinishedEvent
>>>
>>>
>>>
>>>
>>> Exception in thread "Thread-3" java.lang.AssertionError
>>> at
>>> org.jboss.sun.net.httpserver.WriteFinishedEvent.<init>(Event.java:40)
>>> at
>>>
org.jboss.sun.net.httpserver.FixedLengthOutputStream.close(FixedLengthOutputStream.java:98)
>>>
>>>
>>>
>>>
>>> at
>>>
org.jboss.sun.net.httpserver.PlaceholderOutputStream.close(ExchangeImpl.java:517)
>>>
>>>
>>>
>>>
>>> at
>>>
org.jboss.resteasy.plugins.server.sun.http.ResteasyHttpHandler.handle(ResteasyHttpHandler.java:86)
>>>
>>>
>>>
>>>
>>> at
>>> org.jboss.com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:78)
>>> at org.jboss.sun.net.httpserver.AuthFilter.doFilter(AuthFilter.java:80)
>>> at
>>> org.jboss.com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:81)
>>> at
>>>
org.jboss.sun.net.httpserver.ServerImpl$Exchange$LinkHandler.handle(ServerImpl.java:710)
>>>
>>>
>>>
>>>
>>> at
>>> org.jboss.com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:78)
>>> at
>>> org.jboss.sun.net.httpserver.ServerImpl$Exchange.run(ServerImpl.java:682)
>>>
>>>
>>> at
>>>
org.jboss.sun.net.httpserver.ServerImpl$DefaultExecutor.execute(ServerImpl.java:202)
>>>
>>>
>>>
>>>
>>> at
>>>
org.jboss.sun.net.httpserver.ServerImpl$Dispatcher.handle(ServerImpl.java:468)
>>>
>>>
>>>
>>>
>>> at
>>> org.jboss.sun.net.httpserver.ServerImpl$Dispatcher.run(ServerImpl.java:433)
>>>
>>>
>>>
>>> at java.lang.Thread.run(Thread.java:680)
>>>
>>>
>>>
>>
>>
>
>
--
Jason T. Greene
JBoss AS Lead / EAP Platform Architect
JBoss, a division of Red Hat