-
Notifications
You must be signed in to change notification settings - Fork 73
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Upgrade to JDK 1.8 #126
Merged
Merged
Upgrade to JDK 1.8 #126
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,11 @@ | ||
language: java | ||
|
||
jdk: | ||
- oraclejdk8 | ||
|
||
script: | ||
- mvn install javadoc:aggregate | ||
|
||
notifications: | ||
email: | ||
- crawler-commons@googlegroups.com |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -74,13 +74,13 @@ public static EffectiveTldFinder getInstance() { | |
return instance; | ||
} | ||
|
||
public boolean initialize(InputStream effective_tld_data_stream) { | ||
domains = new HashMap<String, EffectiveTLD>(); | ||
public boolean initialize(InputStream effectiveTldDataStream) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Are _ not allowed in Java8? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes... but they are flagged as warn's for the Javac. It is not Java convention. |
||
domains = new HashMap<>(); | ||
try { | ||
if (null == effective_tld_data_stream && null != this.getClass().getResource(ETLD_DATA)) { | ||
effective_tld_data_stream = this.getClass().getResourceAsStream(ETLD_DATA); | ||
if (null == effectiveTldDataStream && null != this.getClass().getResource(ETLD_DATA)) { | ||
effectiveTldDataStream = this.getClass().getResourceAsStream(ETLD_DATA); | ||
} | ||
BufferedReader input = new BufferedReader(new InputStreamReader(effective_tld_data_stream, Charset.defaultCharset())); | ||
BufferedReader input = new BufferedReader(new InputStreamReader(effectiveTldDataStream, Charset.defaultCharset())); | ||
String line = null; | ||
while (null != (line = input.readLine())) { | ||
if (line.length() == 0 || (line.length() > 1 && line.startsWith(COMMENT))) { | ||
|
@@ -109,7 +109,10 @@ public static Map<String, EffectiveTLD> getEffectiveTLDs() { | |
|
||
/** | ||
* @param hostname | ||
* @return the Effective TLD | ||
* the hostname for which to find the | ||
* {@link crawlercommons.domains.EffectiveTldFinder.EffectiveTLD} | ||
* @return the | ||
* {@link crawlercommons.domains.EffectiveTldFinder.EffectiveTLD} | ||
*/ | ||
public static EffectiveTLD getEffectiveTLD(String hostname) { | ||
if (getInstance().domains.containsKey(hostname)) { | ||
|
@@ -145,15 +148,15 @@ public static EffectiveTLD getEffectiveTLD(String hostname) { | |
* is the NIC-assigned domain name. | ||
* | ||
* @param hostname | ||
* a string for which to obtain a NIC-assigned domain name | ||
* @return the NIC-assigned domain name | ||
*/ | ||
public static String getAssignedDomain(String hostname) { | ||
EffectiveTLD etld = getEffectiveTLD(hostname); | ||
if (null == etld || etld.getDomain() == hostname.toLowerCase(Locale.getDefault())) { | ||
return hostname.toLowerCase(Locale.getDefault()); | ||
} | ||
String domain = hostname.replaceFirst(".*?([^.]+\\.)" + etld.getDomain() + "$", "$1" + etld.getDomain()); | ||
return domain; | ||
return hostname.replaceFirst(".*?([^.]+\\.)" + etld.getDomain() + "$", "$1" + etld.getDomain()); | ||
} | ||
|
||
public boolean isConfigured() { | ||
|
@@ -185,10 +188,10 @@ public EffectiveTLD(String line) { | |
} else { | ||
domain = line; | ||
} | ||
domain = normalize_name(domain); | ||
domain = normalizeName(domain); | ||
} | ||
|
||
private String normalize_name(String name) { | ||
private String normalizeName(String name) { | ||
String[] parts = name.split(DOT_REGEX); | ||
if (parts.length < 2) { | ||
return name; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what's this one for?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This defines the targets to run... we always wish to build the Javadoc target as this lets us know if the Javadoc is JDK8 compliant.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok, thanks. I assumed the javadoc was checked by Travis