[jira] [Commented] (ACCUMULO-2490) Pair.fromEntry should accept bounded wild card parameters

2014-03-22 Thread ASF subversion and git services (JIRA)

[ 
https://issues.apache.org/jira/browse/ACCUMULO-2490?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13944128#comment-13944128
 ] 

ASF subversion and git services commented on ACCUMULO-2490:
---

Commit 8a363c3e3695d8f1675b48d8308a7c512eef1b12 in accumulo's branch 
refs/heads/master from [~busbey]
[ https://git-wip-us.apache.org/repos/asf?p=accumulo.git;h=8a363c3 ]

ACCUMULO-2490 Correct test invocation Pair.fromEntry. Add test for 
non-parameterized fromEntry call


 Pair.fromEntry should accept bounded wild card parameters
 -

 Key: ACCUMULO-2490
 URL: https://issues.apache.org/jira/browse/ACCUMULO-2490
 Project: Accumulo
  Issue Type: Improvement
  Components: client
Reporter: Mike Drob
Assignee: Christopher Tubbs
Priority: Minor
  Labels: API, newbie
 Fix For: 1.7.0


 The following \[psuedo-]code should be legal:
 {code}
 EntryInteger, String entry = new Entry(10, IO)
 PairObject,Object pair = Pair.fromEntry(entry)
 {code}
 This is possible if we replace the generic parameters with bounded wild cards.
 (Effective Java SE; Item 28)



--
This message was sent by Atlassian JIRA
(v6.2#6252)


[jira] [Commented] (ACCUMULO-2490) Pair.fromEntry should accept bounded wild card parameters

2014-03-22 Thread Christopher Tubbs (JIRA)

[ 
https://issues.apache.org/jira/browse/ACCUMULO-2490?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13944222#comment-13944222
 ] 

Christopher Tubbs commented on ACCUMULO-2490:
-

Hmm, works fine for me without this last change, building with OpenJDK 1.7 
(with a 1.6 target).

 Pair.fromEntry should accept bounded wild card parameters
 -

 Key: ACCUMULO-2490
 URL: https://issues.apache.org/jira/browse/ACCUMULO-2490
 Project: Accumulo
  Issue Type: Improvement
  Components: client
Reporter: Mike Drob
Assignee: Christopher Tubbs
Priority: Minor
  Labels: API, newbie
 Fix For: 1.7.0


 The following \[psuedo-]code should be legal:
 {code}
 EntryInteger, String entry = new Entry(10, IO)
 PairObject,Object pair = Pair.fromEntry(entry)
 {code}
 This is possible if we replace the generic parameters with bounded wild cards.
 (Effective Java SE; Item 28)



--
This message was sent by Atlassian JIRA
(v6.2#6252)


[jira] [Commented] (ACCUMULO-2490) Pair.fromEntry should accept bounded wild card parameters

2014-03-22 Thread Sean Busbey (JIRA)

[ 
https://issues.apache.org/jira/browse/ACCUMULO-2490?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13944264#comment-13944264
 ] 

Sean Busbey commented on ACCUMULO-2490:
---

Yeah, [Java 7 added type inference based on target 
types|http://docs.oracle.com/javase/tutorial/java/generics/genTypeInference.html#target_types].
 Sine the generics stuff gets thrown away are runtime, it can safely use that 
feature while outputting class files for 1.6.

 Pair.fromEntry should accept bounded wild card parameters
 -

 Key: ACCUMULO-2490
 URL: https://issues.apache.org/jira/browse/ACCUMULO-2490
 Project: Accumulo
  Issue Type: Improvement
  Components: client
Reporter: Mike Drob
Assignee: Christopher Tubbs
Priority: Minor
  Labels: API, newbie
 Fix For: 1.7.0


 The following \[psuedo-]code should be legal:
 {code}
 EntryInteger, String entry = new Entry(10, IO)
 PairObject,Object pair = Pair.fromEntry(entry)
 {code}
 This is possible if we replace the generic parameters with bounded wild cards.
 (Effective Java SE; Item 28)



--
This message was sent by Atlassian JIRA
(v6.2#6252)


[jira] [Commented] (ACCUMULO-2490) Pair.fromEntry should accept bounded wild card parameters

2014-03-18 Thread Mike Drob (JIRA)

[ 
https://issues.apache.org/jira/browse/ACCUMULO-2490?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13939230#comment-13939230
 ] 

Mike Drob commented on ACCUMULO-2490:
-

-1.

Returning wildcarded types makes the API cumbersome, instead of simpler to use.

 Pair.fromEntry should accept bounded wild card parameters
 -

 Key: ACCUMULO-2490
 URL: https://issues.apache.org/jira/browse/ACCUMULO-2490
 Project: Accumulo
  Issue Type: Improvement
  Components: client
Reporter: Mike Drob
Assignee: Christopher Tubbs
Priority: Minor
  Labels: API, newbie
 Fix For: 1.7.0


 The following \[psuedo-]code should be legal:
 {code}
 EntryInteger, String entry = new Entry(10, IO)
 PairObject,Object pair = Pair.fromEntry(entry)
 {code}
 This is possible if we replace the generic parameters with bounded wild cards.
 (Effective Java SE; Item 28)



--
This message was sent by Atlassian JIRA
(v6.2#6252)


[jira] [Commented] (ACCUMULO-2490) Pair.fromEntry should accept bounded wild card parameters

2014-03-18 Thread Eric Newton (JIRA)

[ 
https://issues.apache.org/jira/browse/ACCUMULO-2490?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13939236#comment-13939236
 ] 

Eric Newton commented on ACCUMULO-2490:
---

Mike, could you give an example of how this makes the API more cumbersome?

 Pair.fromEntry should accept bounded wild card parameters
 -

 Key: ACCUMULO-2490
 URL: https://issues.apache.org/jira/browse/ACCUMULO-2490
 Project: Accumulo
  Issue Type: Improvement
  Components: client
Reporter: Mike Drob
Assignee: Christopher Tubbs
Priority: Minor
  Labels: API, newbie
 Fix For: 1.7.0


 The following \[psuedo-]code should be legal:
 {code}
 EntryInteger, String entry = new Entry(10, IO)
 PairObject,Object pair = Pair.fromEntry(entry)
 {code}
 This is possible if we replace the generic parameters with bounded wild cards.
 (Effective Java SE; Item 28)



--
This message was sent by Atlassian JIRA
(v6.2#6252)


[jira] [Commented] (ACCUMULO-2490) Pair.fromEntry should accept bounded wild card parameters

2014-03-18 Thread Mike Drob (JIRA)

[ 
https://issues.apache.org/jira/browse/ACCUMULO-2490?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13939254#comment-13939254
 ] 

Mike Drob commented on ACCUMULO-2490:
-

Sure.

{code}
PairInteger,String pair = new PairInteger,String(10, XX);

// Doesn't compile:
// Type mismatch: cannot convert from Map.Entrycapture#1-of ? super 
Integer,capture#2-of ? super String to Map.EntryInteger,String
EntryInteger,String entry = pair.toMapEntry();

// does compile but forces the client to use wildcards.
Entry? super Integer,? super String entry2 = pair.toMapEntry();

// Doesn't compile either:
EntryNumber,CharSequence entry3 = pair.toMapEntry();
{code}

 Pair.fromEntry should accept bounded wild card parameters
 -

 Key: ACCUMULO-2490
 URL: https://issues.apache.org/jira/browse/ACCUMULO-2490
 Project: Accumulo
  Issue Type: Improvement
  Components: client
Reporter: Mike Drob
Assignee: Christopher Tubbs
Priority: Minor
  Labels: API, newbie
 Fix For: 1.7.0


 The following \[psuedo-]code should be legal:
 {code}
 EntryInteger, String entry = new Entry(10, IO)
 PairObject,Object pair = Pair.fromEntry(entry)
 {code}
 This is possible if we replace the generic parameters with bounded wild cards.
 (Effective Java SE; Item 28)



--
This message was sent by Atlassian JIRA
(v6.2#6252)


[jira] [Commented] (ACCUMULO-2490) Pair.fromEntry should accept bounded wild card parameters

2014-03-18 Thread Eric Newton (JIRA)

[ 
https://issues.apache.org/jira/browse/ACCUMULO-2490?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13939392#comment-13939392
 ] 

Eric Newton commented on ACCUMULO-2490:
---

I'm convinced.  I would favor reverting it.  I'm sure [~ctubbsii] will argue 
valiantly if he really wants it to work this way.  I know he's mostly out this 
week, though.  

 Pair.fromEntry should accept bounded wild card parameters
 -

 Key: ACCUMULO-2490
 URL: https://issues.apache.org/jira/browse/ACCUMULO-2490
 Project: Accumulo
  Issue Type: Improvement
  Components: client
Reporter: Mike Drob
Assignee: Christopher Tubbs
Priority: Minor
  Labels: API, newbie
 Fix For: 1.7.0


 The following \[psuedo-]code should be legal:
 {code}
 EntryInteger, String entry = new Entry(10, IO)
 PairObject,Object pair = Pair.fromEntry(entry)
 {code}
 This is possible if we replace the generic parameters with bounded wild cards.
 (Effective Java SE; Item 28)



--
This message was sent by Atlassian JIRA
(v6.2#6252)


[jira] [Commented] (ACCUMULO-2490) Pair.fromEntry should accept bounded wild card parameters

2014-03-18 Thread ASF subversion and git services (JIRA)

[ 
https://issues.apache.org/jira/browse/ACCUMULO-2490?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13939395#comment-13939395
 ] 

ASF subversion and git services commented on ACCUMULO-2490:
---

Commit d1543a4e590531eb71f4e16481b29f435c019654 in accumulo's branch 
refs/heads/master from [~md...@cloudera.com]
[ https://git-wip-us.apache.org/repos/asf?p=accumulo.git;h=d1543a4 ]

Revert ACCUMULO-2490 Make Pair API more generics-friendly

This reverts commit 053e83fc4225969efda31ee4957651640cc7ac9e.


 Pair.fromEntry should accept bounded wild card parameters
 -

 Key: ACCUMULO-2490
 URL: https://issues.apache.org/jira/browse/ACCUMULO-2490
 Project: Accumulo
  Issue Type: Improvement
  Components: client
Reporter: Mike Drob
Assignee: Christopher Tubbs
Priority: Minor
  Labels: API, newbie
 Fix For: 1.7.0


 The following \[psuedo-]code should be legal:
 {code}
 EntryInteger, String entry = new Entry(10, IO)
 PairObject,Object pair = Pair.fromEntry(entry)
 {code}
 This is possible if we replace the generic parameters with bounded wild cards.
 (Effective Java SE; Item 28)



--
This message was sent by Atlassian JIRA
(v6.2#6252)


[jira] [Commented] (ACCUMULO-2490) Pair.fromEntry should accept bounded wild card parameters

2014-03-18 Thread Bill Havanki (JIRA)

[ 
https://issues.apache.org/jira/browse/ACCUMULO-2490?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13939480#comment-13939480
 ] 

Bill Havanki commented on ACCUMULO-2490:


Reverting is a good idea. Both Effective Java and Angelika Langer's FAQ say to 
not use wildcards for return types.

This item is relevant to the discussion: 
http://www.angelikalanger.com/GenericsFAQ/FAQSections/TypeParameters.html#FAQ107

Basically you can't use super for type parameters of methods, which is such a 
pain here. The best bet may be to supply a static method; see the addToMap 
workaround in the item for the idea.

 Pair.fromEntry should accept bounded wild card parameters
 -

 Key: ACCUMULO-2490
 URL: https://issues.apache.org/jira/browse/ACCUMULO-2490
 Project: Accumulo
  Issue Type: Improvement
  Components: client
Reporter: Mike Drob
Assignee: Christopher Tubbs
Priority: Minor
  Labels: API, newbie
 Fix For: 1.7.0


 The following \[psuedo-]code should be legal:
 {code}
 EntryInteger, String entry = new Entry(10, IO)
 PairObject,Object pair = Pair.fromEntry(entry)
 {code}
 This is possible if we replace the generic parameters with bounded wild cards.
 (Effective Java SE; Item 28)



--
This message was sent by Atlassian JIRA
(v6.2#6252)


[jira] [Commented] (ACCUMULO-2490) Pair.fromEntry should accept bounded wild card parameters

2014-03-18 Thread Christopher Tubbs (JIRA)

[ 
https://issues.apache.org/jira/browse/ACCUMULO-2490?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13939488#comment-13939488
 ] 

Christopher Tubbs commented on ACCUMULO-2490:
-

The No, Mike is right was in reference to Eric's idea that I might have a 
defense. I do not. Bill and Mike are right.

 Pair.fromEntry should accept bounded wild card parameters
 -

 Key: ACCUMULO-2490
 URL: https://issues.apache.org/jira/browse/ACCUMULO-2490
 Project: Accumulo
  Issue Type: Improvement
  Components: client
Reporter: Mike Drob
Assignee: Christopher Tubbs
Priority: Minor
  Labels: API, newbie
 Fix For: 1.7.0


 The following \[psuedo-]code should be legal:
 {code}
 EntryInteger, String entry = new Entry(10, IO)
 PairObject,Object pair = Pair.fromEntry(entry)
 {code}
 This is possible if we replace the generic parameters with bounded wild cards.
 (Effective Java SE; Item 28)



--
This message was sent by Atlassian JIRA
(v6.2#6252)


[jira] [Commented] (ACCUMULO-2490) Pair.fromEntry should accept bounded wild card parameters

2014-03-18 Thread Christopher Tubbs (JIRA)

[ 
https://issues.apache.org/jira/browse/ACCUMULO-2490?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13939486#comment-13939486
 ] 

Christopher Tubbs commented on ACCUMULO-2490:
-

No, Mike is right. I made it worse for swap and toMapEntry. It seems there's no 
good way to do that, except to pass in the desired class as a parameter, which 
isn't very friendly or useful, either. Thanks for catching/reverting that Mike, 
I'll limit the improvements to just fromEntry and fix it.

 Pair.fromEntry should accept bounded wild card parameters
 -

 Key: ACCUMULO-2490
 URL: https://issues.apache.org/jira/browse/ACCUMULO-2490
 Project: Accumulo
  Issue Type: Improvement
  Components: client
Reporter: Mike Drob
Assignee: Christopher Tubbs
Priority: Minor
  Labels: API, newbie
 Fix For: 1.7.0


 The following \[psuedo-]code should be legal:
 {code}
 EntryInteger, String entry = new Entry(10, IO)
 PairObject,Object pair = Pair.fromEntry(entry)
 {code}
 This is possible if we replace the generic parameters with bounded wild cards.
 (Effective Java SE; Item 28)



--
This message was sent by Atlassian JIRA
(v6.2#6252)


[jira] [Commented] (ACCUMULO-2490) Pair.fromEntry should accept bounded wild card parameters

2014-03-18 Thread ASF subversion and git services (JIRA)

[ 
https://issues.apache.org/jira/browse/ACCUMULO-2490?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13939490#comment-13939490
 ] 

ASF subversion and git services commented on ACCUMULO-2490:
---

Commit beb494478f64ad6ec02f975edc8fb680bf012d8e in accumulo's branch 
refs/heads/master from [~ctubbsii]
[ https://git-wip-us.apache.org/repos/asf?p=accumulo.git;h=beb4944 ]

ACCUMULO-2490 Slight improvement to fromEntry w/test


 Pair.fromEntry should accept bounded wild card parameters
 -

 Key: ACCUMULO-2490
 URL: https://issues.apache.org/jira/browse/ACCUMULO-2490
 Project: Accumulo
  Issue Type: Improvement
  Components: client
Reporter: Mike Drob
Assignee: Christopher Tubbs
Priority: Minor
  Labels: API, newbie
 Fix For: 1.7.0


 The following \[psuedo-]code should be legal:
 {code}
 EntryInteger, String entry = new Entry(10, IO)
 PairObject,Object pair = Pair.fromEntry(entry)
 {code}
 This is possible if we replace the generic parameters with bounded wild cards.
 (Effective Java SE; Item 28)



--
This message was sent by Atlassian JIRA
(v6.2#6252)


[jira] [Commented] (ACCUMULO-2490) Pair.fromEntry should accept bounded wild card parameters

2014-03-17 Thread Mike Drob (JIRA)

[ 
https://issues.apache.org/jira/browse/ACCUMULO-2490?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13938740#comment-13938740
 ] 

Mike Drob commented on ACCUMULO-2490:
-

This could potentially be part of a larger scrub to make sure we are using 
generics appropriately in all places in our API.

 Pair.fromEntry should accept bounded wild card parameters
 -

 Key: ACCUMULO-2490
 URL: https://issues.apache.org/jira/browse/ACCUMULO-2490
 Project: Accumulo
  Issue Type: Bug
  Components: client
Reporter: Mike Drob
Priority: Minor
  Labels: API, newbie
 Fix For: 1.7.0


 The following \[psuedo-]code should be legal:
 {code}
 EntryInteger, String entry = new Entry(10, IO)
 PairObject,Object pair = Pair.fromEntry(entry)
 {code}
 This is possible if we replace the generic parameters with bounded wild cards.



--
This message was sent by Atlassian JIRA
(v6.2#6252)