[ 
https://issues.apache.org/jira/browse/HADOOP-17726?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17543420#comment-17543420
 ] 

Samrat Deb edited comment on HADOOP-17726 at 5/28/22 6:03 AM:
--------------------------------------------------------------

[~ayushtkn] 
these are absolutely the same thing! 
its just an added overhead of extra function call everytime trying to create 
TreeSet object . If internally java8 provides the same (creating from direct 
interface ) whats the point in creating extra layers of abstraction?
I felt its a kind of cleanup activity. 

[please note that m new to the framework ! Trying to understand internally, so 
understanding might not be well enough] 

Also , according to code Sets.newHashSet is also on similar note, internally 
calling pain HashSet
{code:java}
public static <E> HashSet<E> newHashSet()
{ return new HashSet(); }{code}
 


was (Author: samrat007):
[~ayushtkn] 
these are absolutely the same thing! 
its just an added overhead of extra function call everytime trying to create 
TreeSet object . If internally java8 provides the same (creating from direct 
interface ) whats the point in creating extra layers of abstraction?
I felt its a kind of cleanup activity. 

[please note that m new to the framework ! Trying to understand internally, so 
understanding might not be well enough] 

Also , according to code Sets.newHashSet is also on similar note, internally 
calling pain HashSet

```

public static <E> HashSet<E> newHashSet() {
return new HashSet();
}


```

> Replace Sets#newHashSet() and newTreeSet() with constructors directly
> ---------------------------------------------------------------------
>
>                 Key: HADOOP-17726
>                 URL: https://issues.apache.org/jira/browse/HADOOP-17726
>             Project: Hadoop Common
>          Issue Type: Task
>            Reporter: Viraj Jasani
>            Assignee: Samrat Deb
>            Priority: Major
>              Labels: beginner, beginner-friendly, newbie
>
> As per the guidelines provided by Guava Sets#newHashSet() and 
> Sets#newTreeSet(), we should get rid of them and use newHashSet<>() and 
> newTreeSet<>() directly.
> Once HADOOP-17115, HADOOP-17721, HADOOP-17722 and HADOOP-17720 are fixed, 
> please feel free to take this up.



--
This message was sent by Atlassian Jira
(v8.20.7#820007)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to