Skip to content

Commit

Permalink
* 改进pom,在开发时使用较高版本的java,发布时使用保守的Java 1.5。
Browse files Browse the repository at this point in the history
* 除去eclipse警告
  • Loading branch information
Michael Zhou committed Nov 26, 2011
1 parent 2248723 commit a642b5c
Show file tree
Hide file tree
Showing 6 changed files with 789 additions and 779 deletions.
2 changes: 2 additions & 0 deletions CHANGES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -228,3 +228,5 @@

* 添加方法:navigator.redirectTo(name).withParameter(..).end(); 通过end()方法可以明确结束语句,并发出重定向请求。
* 所有源码改用UTF-8,符合多数开发环境的默认配置。
* 改进pom,在开发时使用较高版本的java,发布时使用保守的Java 1.5。

Original file line number Diff line number Diff line change
Expand Up @@ -1766,7 +1766,7 @@ InputSource getRelative(String relativePath) throws Exception {
String sourceURI = null;

if (source instanceof File) {
sourceURI = ((File) source).toURL().toExternalForm();
sourceURI = ((File) source).toURI().toString();
} else if (source instanceof URL) {
sourceURI = ((URL) source).toExternalForm();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ protected URL copyFile(String src, String dest) throws IOException {

io(new FileInputStream(new File(srcdir, src)), new FileOutputStream(destfile), true, true);

return destfile.toURL();
return destfile.toURI().toURL();
}

protected URL copyFilesToJar(String destJar, String... srcdest) throws IOException {
Expand All @@ -124,7 +124,7 @@ protected URL copyFilesToJar(String destJar, String... srcdest) throws IOExcepti

jos.close();

return destJarFile.toURL();
return destJarFile.toURI().toURL();
}

protected void acceptFailure(Object visitor) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ public void charsetDetection() throws IOException {

// -----------------
content = repeat("#", 1024 * 4) + "\n";
content += " #@charset GB18030\n"; // 超过了readlimit
content += " #@charset GB18030\n"; // 超过了readlimit

assertEquals("default", detectCharset(content));
}
Expand All @@ -100,10 +100,10 @@ public void getRelative_File() throws Exception {
assertNull(parentSource.getRelative(" "));

inputSource = parentSource.getRelative(" b.txt ");
assertEquals(new File("/aa/bb/b.txt").toURL().toExternalForm(), inputSource.systemId);
assertEquals(new File("/aa/bb/b.txt").toURI().toURL().toExternalForm(), inputSource.systemId);

inputSource = parentSource.getRelative(" /b.txt ");
assertEquals(new File("/aa/bb/b.txt").toURL().toExternalForm(), inputSource.systemId);
assertEquals(new File("/aa/bb/b.txt").toURI().toURL().toExternalForm(), inputSource.systemId);

inputSource = parentSource.getRelative(" ../b.txt ");
assertEquals(new File("/aa/b.txt").toURI().normalize().toURL().toExternalForm(), inputSource.systemId);
Expand Down Expand Up @@ -171,8 +171,8 @@ public void getReader() throws IOException {
assertReader("GBK", f, f.toURI().toString());

// file: url as input source
inputSource = new InputSource(f.toURL());
assertReader("GBK", f, f.toURL().toExternalForm());
inputSource = new InputSource(f.toURI().toURL());
assertReader("GBK", f, f.toURI().toURL().toExternalForm());

// url as input source
URL jarurl = copyFilesToJar("test.jar", "test05_param_gbk.txt", "gbk.txt");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -939,7 +939,7 @@ public void test08_import_notfound() {

@Test
public void test08_import_invalid() throws Exception {
String importedFile = repeat("../", countMatches(srcdir.toURL().toExternalForm(), "/")) + "../def.htm";
String importedFile = repeat("../", countMatches(srcdir.toURI().toURL().toExternalForm(), "/")) + "../def.htm";
String s = "#@trimming on\n";
s += "${abc: #abc}\n";
s += "#abc(" + importedFile + ") ## xxxx";
Expand Down
Loading

0 comments on commit a642b5c

Please sign in to comment.