Closed vaa25 closed 8 years ago
@vaa25 you can temporary add your branches for Travis integration in .travis.yml
here:
branches:
only:
- master
Later when you merge to master
you will delete them.
@vaa25 base branch for this is master or #214=fix-pmd-crawler ?
Disclaimer: I review all code of crawler in this pull request.
HttpFetcher
needs a contract (interface).HttpFetcher.fetchAsString
is too complicated. Use private methods inside try block.HttpFetcher.fetchAsString
. It's a logic so it should be tested (you are need check the text of exception messages).EngineObserver
is handleEvent
? It's non-obvious.Engine
implements EngineObserver
and has public method run
. But EngineObserver
hasn't method run
.StringLoader
. It is hard to reading and understanding. I will explain you how it needs to be implemented by example.public interface StringFromSource {
String value();
}
public class StringFromFile implements StringFromSource {
private final String value;
public StringFromFile(final String path) {
// load file etc.
this.value = ... ; // make new String from file bytes
}
@Override
public final String value() {
return this.value;
}
}
getting string value of file:
String s = new StringFromFile("d:/file.txt").value();`
It's easy, isn't it?
Engine
is not only EngineObserver
, but it has other logic also.value()
instead getValue()
?getValue()
if you like it.@AndriyBaibak 4h
connect to #214