On Thu, Apr 24, 2014 at 12:06 AM, Zhong Yu wrote:
> If a thread is created inside AccessController.doPrivileged(), it
> seems to inherit AccessControlContext from the calling thread,
sorry, I was mistaken; there is no such inheritance, the new thread is
indeed privileged.
> is t
aders through
Thread.inheritedAccessControlContext. I try to avoid that and make
sure that only the immediate caller class loader is referenced; my
concern is rather garbage collection than permissions. Is there anyway
to achieve that?
Thanks,
Zhong Yu
new HashMap<>().{ put(n1,v1); put(n2,v2); }
new Button().{ color(red); text("hello"); onClick(event->color(blue)); }
Zhong Yu
lambda parameter types. This
restricted case happens to be the most common case where overload is
needed, e.g. Stream.map(), Comparator.comparing(). It is heartbreaking
to hear the decision of banning all overloads because of some bad
corner cases that won't likely happen in real code.
Zhong Yu
Some of these don't feel like "functions", e.g. Formattable, it's
unlikely that anyone would use lambda expression to instantiate them.
What is the general guideline to apply @FunctionalInterface? For
example, why should AutoCloseable be marked as @FI?
Zhong Yu
On Thu, Au
rgon. There are exactly
10 such elements in html 4
area base br col hr img input link meta param
I agree with Nick that a mere warning is appropriate for these elements.
Zhong Yu
On Fri, Jul 26, 2013 at 10:46 AM, Nick Williams
wrote:
>
> On Jul 26, 2013, at 10:27 AM, Stephen Cole
parameter that
>> fails…
>>
>>
>> On 15 July 2013 12:52, Zhong Yu wrote:
>>>
>>> Another example of possible missing a wildcard
>>>
>>>
>>> http://gee.cs.oswego.edu/dl/jsr166/dist/docs/java/util/concurrent/CompletionStage.html#thenCo
and we need a tool to find these mistakes.
Zhong Yu
On Sun, Jul 14, 2013 at 8:04 AM, Jed Wesley-Smith wrote:
> (accidentally didn't post to the list)
>
>> You probably know that the example provided is not completed ported to
> work with our Optional implementation,
>
>
X> is not a subtype of X>. We have to go
wildcard all the way - X>.
The subtyping rules don't care about final-ness of types. For example,
X is a distinct type from X, even though
String has only one subtype (itself).
Zhong Yu
On Sun, Jul 14, 2013 at 8:04 AM, Jed Wesle
th
If the only information we have is that the object is a MHCR, we must close it.
If we have other information, e.g. it's a Stream is from an ArrayList,
then we may omit the close() call.
The annotation @HoldsResource is meant to add extra information;
particularly, *lack* of the annotation is meant
On Fri, Jul 12, 2013 at 4:30 AM, Peter Levart wrote:
> On 07/12/2013 01:14 AM, Zhong Yu wrote:
>
> On Thu, Jul 11, 2013 at 4:08 PM, Peter Levart
> wrote:
>
> Hi Paul,
>
> I think the MayHoldCloseableResource extends AutoClosable is correct and
> AutoClosable exten
contract and which uses the lookup of @HoldsResource at runtime to decide
How do you lookup an annotation on an _instance_ at runtime? And why
do we even care? Just call close() regardless.
And we can revert the parent/child relation, because the "otherwise
specified" clause is a panacea.
@HoldsResource
interface D extends B
What does it mean?
If it mean that D definitely holds resource, is @HoldResource still
necessary on methods that return D?
Zhong Yu
On Wed, Jul 10, 2013 at 4:30 PM, Henry Jen wrote:
> Hi,
>
> Please review webrev at
> http://cr.openjdk.java.n
of the method, the type system couldn't help to catch the
mistake today, but it's a bug regardless.
Zhong Yu
> CompletableFuture. Which is pretty bad for a feature that is designed
> specifically to provide compile time safety. It would be nice to at least
> have an acknowledg
signature
Stream
Optional reduce(BinaryOperator accumulator)
So I don't think there's a lack of use cases for lower bound. (But I
have no idea how difficult it is to support it)
Zhong Yu
On Mon, Apr 15, 2013 at 2:37 PM, Martin Buchholz wrote:
> CompletableFuture currently
On Tue, Apr 9, 2013 at 11:54 AM, Steven Schlansker
wrote:
>
> On Apr 9, 2013, at 9:30 AM, Zhong Yu wrote:
>
>>
>>
>>
>> On Mon, Apr 8, 2013 at 6:54 PM, Steven Schlansker
>> wrote:
>> Today I encountered "java.lang.IllegalArgumentE
It doesn't feel very right to say the exception is the "cause" of the IAE.
If the user code reuses an exception instance "x", as reported by OP,
there is a possibility that the IAE is later added as a suppressed
exception to "x", forming a loop x->IAE->x.
ssion=writableStackTrace=true.
Interestingly, even for an immutable exception, `e.addSuppressed(e)` isn't
allowed. I think that it should be allowed.
Zhong Yu
);
stream.ifEmpty(-1).min();
Zhong Yu
On Wed, Mar 6, 2013 at 3:47 AM, Remi Forax wrote:
> Ok, let be nuclear on this,
> There is no good reason to introduce Optional in java.util.
>
> It doen't work like Google's Guava Optional despite having the same
> name, it doesn't work like S
der and StringBuffer, the method will copy the chars in
range. Therefore you may as well do the copy yourself to make Strings.
Currently String does not have a constructor like
public String(CharSequence source, int offset, int count)
maybe it should be added?
Zhong Yu
> This provides a st
e got a problem with the change of
String impl, we can refer him to wrap the string in a Strand, and
operate on the strand instead.
Zhong Yu
On Mon, Feb 18, 2013 at 11:27 PM, Mike Duigou wrote:
> Hello all;
>
> JDK 7u6 included a significant change to java.lang.String. The change was
ilter with walk, which return a Stream.
I see.
It's a pity that we don't have an abstraction for Path+Attributes,
since often applications need both.
> Hope that helps.
>
> Cheers,
> Henry
>
> On Feb 7, 2013, at 6:53 PM, Zhong Yu wrote:
>
>> The find() method
Path-based APIs - path alone often isn't enough and
app has to look up attributes in a separate step.
Zhong Yu
On Thu, Feb 7, 2013 at 6:15 PM, Henry Jen wrote:
> Hi,
>
> While lambda still finalizing the final API for Stream, there are a
> couple of streamifaction APIs in nio
>From user's point of view, there is nothing thread local about it - it
is more like one global random generator, which is unseedable and
unrepeatable. So why not call it a different name, like concurrent
random?
On Mon, Jan 14, 2013 at 4:17 PM, Alan Bateman wrote:
> On 14/01/2013 18:20, Chris He
lastValueWasNull = attrib == null;
xxx return attrib;
xxx }
if the wrong attribute type is requested, line 001 does not throw, so
line 002 is also executed, which is probably a bug. If line 001
throws, we won't have this bug.
Zhong Yu
On Sun, Jan 13, 2013 at 9:11 AM, Remi Forax
on commodity hardware,
but OP got 64 cores.
Zhong Yu
> Mike
>
> On Dec 27 2012, at 11:38 , Aleksey Shipilev wrote:
>
>> Looks very like dumb inlined java.util.Random?
>> Is there a security threat to use ThreadLocalRandom instead there?
>>
>> -Aleksey.
>>
&g
Question: why not delay the evaluation of the message even further,
until LogRecord.getMessage() is invoked? Since a logger might be
enabled for the level, but the handler is not, so the message is not
really logged. Or is that considered uncommon?
On Fri, Dec 21, 2012 at 12:28 AM, Henry Jen wrot
en wondering : why do JDK methods return
arrays, instead of something like List? To avoid dependencies among
JDK packages? Then how about an interface java.lang.Sequence? It
would be very useful for user applications as well.
Zhong Yu
Users are unlikely to expect multi-byte atomicity on a ByteBuffer.
However they are more likely to expect int-width atomicity on an
IntBuffer view of a ByteBuffer; such atomicity is unfortunately not
guaranteed either.
Zhong Yu
On Wed, Dec 19, 2012 at 11:48 AM, Aleksey Shipilev
wrote:
>
On Sat, Dec 15, 2012 at 3:24 AM, David Holmes wrote:
> On 15/12/2012 12:58 AM, Zhong Yu wrote:
>>
>> On Wed, Dec 12, 2012 at 5:48 PM, David Holmes
>> wrote:
>>>
>>> On 13/12/2012 1:51 AM, Zhong Yu wrote:
>>>>
>>>>
>>>> I
On Wed, Dec 12, 2012 at 5:48 PM, David Holmes wrote:
> On 13/12/2012 1:51 AM, Zhong Yu wrote:
>>
>> If a class loader is declared fully concurrent, yet
>> getClassLoadingLock() is invoked, what's the harm of returning a
>> dedicated lock anyway, exactly like wha
On Fri, Dec 14, 2012 at 4:54 AM, Remi Forax wrote:
> Hi Akhil,
>
> On 12/14/2012 02:24 AM, Akhil Arora wrote:
>>
>> As part of the library lambdafication, this patch adds a forEach default
>> method to Iterator, and converts remove() into a default method so that
>> implementations of Iterator no
On Wed, Dec 12, 2012 at 10:05 AM, Peter Levart wrote:
> On 12/12/2012 04:51 PM, Zhong Yu wrote:
>>
>> If a class loader is declared fully concurrent, yet
>> getClassLoadingLock() is invoked, what's the harm of returning a
>> dedicated lock anyway, exactly like what
If a class loader is declared fully concurrent, yet
getClassLoadingLock() is invoked, what's the harm of returning a
dedicated lock anyway, exactly like what's done before?
On Tue, Dec 11, 2012 at 7:40 PM, David Holmes wrote:
> On 11/12/2012 9:58 PM, Peter Levart wrote:
>>
>> On 12/11/2012 12:27
I just realized that I also use String.trim() a lot, and have always
assumed it's very cheap; that's no longer the case.
JDK itself contains many usages of trim(); even a lot of
str.substring().trim()
Just saying.
On Wed, Nov 14, 2012 at 9:14 AM, Zhong Yu wrote:
that's the worst blow in my book. There's no problem if
substring() does copying from day one, but 17 years have passed.
Zhong Yu
On Wed, Nov 14, 2012 at 6:58 PM, Vitaly Davidovich wrote:
> Personally, I feel like the concern is a bit overstated:
>
> 1) the n in O(n) is likely actu
f strings are no longer certain,
what else can we believe in?
Is there any chance in hell to roll it back? Maybe add a new method
for the new behavior?
Zhong Yu
at 9:14 AM, Zhong Yu wrote:
> Changing String.substring() from O(1) to O(n) is a big deal; we may
> say it breaks compatibility.
>
> Any code that intends to work across JDK versions before and after 7u6
> cannot use the method, since its behavior is so different in different
>
another type if it's part of a method
signature.
With all these problems, please reconsider this change and see if you
should roll it back. Thanks.
Zhong Yu
c boolean needsInput() {
synchronized (zsRef) {
return !finish && len <= 0;
}
}
(I don't understand the `synchronized (zsRef)` part; this class should
only be used serially anyway. But if other methods require
synchronization, this method requires it too)
Regards,
Zhong Yu
n for erasure here? Thanks.
Zhong Yu
41 matches
Mail list logo