Skip to content

Java02. ДЗ 03, Гусев Андрей#4

Open
ASGusev wants to merge 2 commits intomasterfrom
functional
Open

Java02. ДЗ 03, Гусев Андрей#4
ASGusev wants to merge 2 commits intomasterfrom
functional

Conversation

@ASGusev
Copy link
Owner

@ASGusev ASGusev commented Oct 25, 2016

No description provided.

Copy link

@sproshev sproshev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

надо поправить

resList.add(function.apply(curElement));
}
return resList;
}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

обычно длинные сигнатуры функций форматируются, как отформатирована сигнатура filter -- на первой строке первый параметр, последующие параметры под ним

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

остальных функций это тоже касается)
кроме того, видно, что форматирование кода не производится, Ctrl + Alt + L в помощь )

}
}
return resList;
}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

это можно было написать проще, вспомнив про break

return false;
}
};
}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

в этом классе маловато generic'ов

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

А ALWAYS_TRUE и ALWAYS_FALSE должны быть методами, final-объектами, или классами?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

public static final полями

sum += i;
}

Assert.assertEquals("Foldl doesn't work correctly.", sum, foldlSum);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

этот тест не проверяет, действительно ли свертка левая

fail("Or should be lazy.");
}
}
}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

в F1Test, F2Test, PTest не хватает дженериков, и идея это все подсвечивает

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

и еще, в тестах не проверяются wildcard'ы (это которые ? extends ..., ? super ...)

fail("Or should be lazy.");
}
}
}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

и еще, в тестах не проверяются wildcard'ы (это которые ? extends ..., ? super ...)

@ASGusev ASGusev changed the title PR: Java02. ДЗ 03, Гусев Андрей Java02. ДЗ 03, Гусев Андрей Oct 31, 2016
@ASGusev
Copy link
Owner Author

ASGusev commented Oct 31, 2016

Поправил: #4

29.10.2016 21:22, Semyon Proshev пишет:

@sproshev requested changes on this pull request.


In src/test/java/PredicateTest.java
#4 (review):

  •            Predicate.ALWAYS_FALSE.or(Predicate.ALWAYS_TRUE).apply(null));
    
  •    Assert.assertFalse("Or should perform disjunction.",
    
  •            Predicate.ALWAYS_FALSE.or(Predicate.ALWAYS_FALSE).apply(null));
    
  •    try {
    
  •        Predicate.ALWAYS_TRUE.or(new Predicate() {
    
  •            @Override
    
  •            public Boolean apply(Object x) throws Exception {
    
  •                throw new Exception();
    
  •            }
    
  •        }).apply(null);
    
  •    } catch (Exception e) {
    
  •        fail("Or should be lazy.");
    
  •    }
    
  • }
    +}

и еще, в тестах не проверяются wildcard'ы (это которые ? extends ...,
? super ...)


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
#4 (review),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AFrdn5ZPZZW1SaI0nLbnzRUv3yTxNGs0ks5q447wgaJpZM4KgdRQ.

Copy link

@sproshev sproshev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

10

resList.add(function.apply(curElement));
}
return resList;
}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

остальных функций это тоже касается)
кроме того, видно, что форматирование кода не производится, Ctrl + Alt + L в помощь )

resList.add(curElem);
}
return resList;
}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

еще короче, вообще без итератора

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants