Skip to main content
Code Review

Return to Answer

replaced http://stackoverflow.com/ with https://stackoverflow.com/
Source Link

A few to start with:

  • mFriendsList? Should it be mTotalNames.

  • This can be initialized to just new ArrayList<>(mTotalNames.size()); since you are already taking care of this in your function.

     private final List<String> mAvailableNames = new ArrayList<String>(mTotalNames);
    
  • Your helper functions ends up with the following results which seems erroneous

Name List: {"Nightly Nexus", "You Next", "thepace"};
Query String: y nex Your result: You Next.
Expected: The whole name should start with the given string irrespective of the space or the whole name should contain the string irrespective of the name.`

  • Naming: Please add some value either in name or comments, former preferred, so that it imparts individuality to the funciton. Correct this: helper0, helper1.

  • Use StringUtils.isBlank() instead of this to check null, empty and blank query string:

     if (s.length() <= 0)
    
  • Collective overuse of collections:

     new LinkedList<String>(Arrays.asList(name.split("\\s+")));
    

Link Link

A few to start with:

  • mFriendsList? Should it be mTotalNames.

  • This can be initialized to just new ArrayList<>(mTotalNames.size()); since you are already taking care of this in your function.

     private final List<String> mAvailableNames = new ArrayList<String>(mTotalNames);
    
  • Your helper functions ends up with the following results which seems erroneous

Name List: {"Nightly Nexus", "You Next", "thepace"};
Query String: y nex Your result: You Next.
Expected: The whole name should start with the given string irrespective of the space or the whole name should contain the string irrespective of the name.`

  • Naming: Please add some value either in name or comments, former preferred, so that it imparts individuality to the funciton. Correct this: helper0, helper1.

  • Use StringUtils.isBlank() instead of this to check null, empty and blank query string:

     if (s.length() <= 0)
    
  • Collective overuse of collections:

     new LinkedList<String>(Arrays.asList(name.split("\\s+")));
    

Link

A few to start with:

  • mFriendsList? Should it be mTotalNames.

  • This can be initialized to just new ArrayList<>(mTotalNames.size()); since you are already taking care of this in your function.

     private final List<String> mAvailableNames = new ArrayList<String>(mTotalNames);
    
  • Your helper functions ends up with the following results which seems erroneous

Name List: {"Nightly Nexus", "You Next", "thepace"};
Query String: y nex Your result: You Next.
Expected: The whole name should start with the given string irrespective of the space or the whole name should contain the string irrespective of the name.`

  • Naming: Please add some value either in name or comments, former preferred, so that it imparts individuality to the funciton. Correct this: helper0, helper1.

  • Use StringUtils.isBlank() instead of this to check null, empty and blank query string:

     if (s.length() <= 0)
    
  • Collective overuse of collections:

     new LinkedList<String>(Arrays.asList(name.split("\\s+")));
    

Link

deleted 1 character in body
Source Link
Jamal
  • 35.2k
  • 13
  • 134
  • 238

A few to start with:

  • mFriendsList? Should it be mTotalNames.

  • This can be initialized to just new ArrayList<>(mTotalNames.size()); since you are already taking care of this in your function.

     private final List<String> mAvailableNames = new ArrayList<String>(mTotalNames);
    
  • Your helper functions ends up with the following results which seems erroneous

    Name List: {"Nightly Nexus", "You Next", "thepace"}; Query String: y nex Your result: You Next. Expected: The whole name should start with the given string irrespective of the space or the whole name should contain the string irrespective of the name.

Name List: {"Nightly Nexus", "You Next", "thepace"};
Query String: y nex Your result: You Next.
Expected: The whole name should start with the given string irrespective of the space or the whole name should contain the string irrespective of the name.`

  • Naming: Please add some value either in name or comments, former preferred, so that it imparts individuality to the funciton. Correct this: helper0, helper1.

  • Use StringUtils.isBlank() instead of this to check null, empty and blank query string:

     if (s.length() <= 0)
    
  • Collective overuse of collections:

     new LinkedList<String>(Arrays.asList(name.split("\\s+")));
    

Link: http://stackoverflow.com/questions/157944/create-arraylist-arraylistt-from-array-tLink

A few to start with:

  • mFriendsList? Should it be mTotalNames.

  • This can be initialized to just new ArrayList<>(mTotalNames.size()); since you are already taking care of this in your function.

     private final List<String> mAvailableNames = new ArrayList<String>(mTotalNames);
    
  • Your helper functions ends up with the following results which seems erroneous

    Name List: {"Nightly Nexus", "You Next", "thepace"}; Query String: y nex Your result: You Next. Expected: The whole name should start with the given string irrespective of the space or the whole name should contain the string irrespective of the name.

  • Naming: Please add some value either in name or comments, former preferred, so that it imparts individuality to the funciton. Correct this: helper0, helper1.

  • Use StringUtils.isBlank() instead of this to check null, empty and blank query string:

     if (s.length() <= 0)
    
  • Collective overuse of collections:

     new LinkedList<String>(Arrays.asList(name.split("\\s+")));
    

Link: http://stackoverflow.com/questions/157944/create-arraylist-arraylistt-from-array-t

A few to start with:

  • mFriendsList? Should it be mTotalNames.

  • This can be initialized to just new ArrayList<>(mTotalNames.size()); since you are already taking care of this in your function.

     private final List<String> mAvailableNames = new ArrayList<String>(mTotalNames);
    
  • Your helper functions ends up with the following results which seems erroneous

Name List: {"Nightly Nexus", "You Next", "thepace"};
Query String: y nex Your result: You Next.
Expected: The whole name should start with the given string irrespective of the space or the whole name should contain the string irrespective of the name.`

  • Naming: Please add some value either in name or comments, former preferred, so that it imparts individuality to the funciton. Correct this: helper0, helper1.

  • Use StringUtils.isBlank() instead of this to check null, empty and blank query string:

     if (s.length() <= 0)
    
  • Collective overuse of collections:

     new LinkedList<String>(Arrays.asList(name.split("\\s+")));
    

Link

added 41 characters in body
Source Link
thepace
  • 2.3k
  • 10
  • 10

A few to start with:

  • mFriendsList? Should it be mTotalNames.

  • This can be initialized to just new ArrayList<>(mTotalNames.size()); since you are already taking care of this in your function.

     private final List<String> mAvailableNames = new ArrayList<String>(mTotalNames);
    
  • Your helper functions ends up with the following results which seems erroneous

    Name List: {"Nightly Nexus", "You Next", "thepace"}; Query String: y nex Your result: You Next. Expected: The whole name should start with the given string irrespective of the space or the whole name should contain the string irrespective of the name.

  • Naming: Please add some value either in name or comments, former preferred, so that it imparts individuality to the funciton. Correct this: helper0, helper1.

  • Use StringUtils.isBlank() instead of this to check null, empty and blank query string:

     if (s.length() <= 0)
    
  • Collective overuse of collections:

     new LinkedList<String>(Arrays.asList(name.split("\\s+")));
    

    A string array would have sufficed the objective.

Link: http://stackoverflow.com/questions/157944/create-arraylist-arraylistt-from-array-t

A few to start with:

  • mFriendsList? Should it be mTotalNames.

  • This can be initialized to just new ArrayList<>(mTotalNames.size()); since you are already taking care of this in your function.

     private final List<String> mAvailableNames = new ArrayList<String>(mTotalNames);
    
  • Your helper functions ends up with the following results which seems erroneous

    Name List: {"Nightly Nexus", "You Next", "thepace"}; Query String: y nex Your result: You Next. Expected: The whole name should start with the given string irrespective of the space or the whole name should contain the string irrespective of the name.

  • Naming: Please add some value either in name or comments, former preferred, so that it imparts individuality to the funciton. Correct this: helper0, helper1.

  • Use StringUtils.isBlank() instead of this to check null, empty and blank query string:

     if (s.length() <= 0)
    
  • Collective overuse of collections:

     new LinkedList<String>(Arrays.asList(name.split("\\s+")));
    

    A string array would have sufficed the objective.

A few to start with:

  • mFriendsList? Should it be mTotalNames.

  • This can be initialized to just new ArrayList<>(mTotalNames.size()); since you are already taking care of this in your function.

     private final List<String> mAvailableNames = new ArrayList<String>(mTotalNames);
    
  • Your helper functions ends up with the following results which seems erroneous

    Name List: {"Nightly Nexus", "You Next", "thepace"}; Query String: y nex Your result: You Next. Expected: The whole name should start with the given string irrespective of the space or the whole name should contain the string irrespective of the name.

  • Naming: Please add some value either in name or comments, former preferred, so that it imparts individuality to the funciton. Correct this: helper0, helper1.

  • Use StringUtils.isBlank() instead of this to check null, empty and blank query string:

     if (s.length() <= 0)
    
  • Collective overuse of collections:

     new LinkedList<String>(Arrays.asList(name.split("\\s+")));
    

Link: http://stackoverflow.com/questions/157944/create-arraylist-arraylistt-from-array-t

added 166 characters in body
Source Link
thepace
  • 2.3k
  • 10
  • 10
Loading
Source Link
thepace
  • 2.3k
  • 10
  • 10
Loading
lang-java

AltStyle によって変換されたページ (->オリジナル) /