Skip to content

Commit

Permalink
Ensure JDK5 compatibility. Fixes jhy#392.
Browse files Browse the repository at this point in the history
ahus1 committed Mar 23, 2014

Verified

This commit was signed with the committer’s verified signature.
mganjoo Milind Ganjoo
1 parent 80158d6 commit 924c480
Showing 3 changed files with 25 additions and 1 deletion.
2 changes: 2 additions & 0 deletions README
Original file line number Diff line number Diff line change
@@ -12,4 +12,6 @@ jsoup implements the WHATWG HTML5 specification (http://whatwg.org/html), and pa

jsoup is designed to deal with all varieties of HTML found in the wild; from pristine and validating, to invalid tag-soup; jsoup will create a sensible parse tree.

jsoup runs on Java 1.5 and up.

See http://jsoup.org/ for downloads and documentation.
22 changes: 22 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
@@ -42,6 +42,28 @@
<encoding>UTF-8</encoding>
</configuration>
</plugin>
<plugin>
<!-- this plugin allows us to ensure Java 5 API compatibility -->
<groupId>org.codehaus.mojo</groupId>
<artifactId>animal-sniffer-maven-plugin</artifactId>
<version>1.9</version>
<executions>
<execution>
<id>animal-sniffer</id>
<phase>compile</phase>
<goals>
<goal>check</goal>
</goals>
<configuration>
<signature>
<groupId>org.codehaus.mojo.signature</groupId>
<artifactId>java15</artifactId>
<version>1.0</version>
</signature>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
2 changes: 1 addition & 1 deletion src/main/java/org/jsoup/helper/DataUtil.java
Original file line number Diff line number Diff line change
@@ -178,7 +178,7 @@ static String getCharsetFromContentType(String contentType) {
if (m.find()) {
String charset = m.group(1).trim();
charset = charset.replace("charset=", "");
if (charset.isEmpty()) return null;
if (charset.length() == 0) return null;
try {
if (Charset.isSupported(charset)) return charset;
charset = charset.toUpperCase(Locale.ENGLISH);

0 comments on commit 924c480

Please sign in to comment.