Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 1 addition & 6 deletions src/main/groovy/lang/GroovyCodeSource.java
Original file line number Diff line number Diff line change
Expand Up @@ -173,12 +173,7 @@ public GroovyCodeSource(URL url) {
this.name = url.toExternalForm();
this.codeSource = new CodeSource(url, (java.security.cert.Certificate[]) null);
try {
String contentEncoding = url.openConnection().getContentEncoding();
if (contentEncoding != null) {
this.scriptText = ResourceGroovyMethods.getText(url, contentEncoding);
} else {
this.scriptText = ResourceGroovyMethods.getText(url); // falls-back on default encoding
}
this.scriptText = ResourceGroovyMethods.getText(url); // default encoding
} catch (IOException e) {
throw new RuntimeException("Impossible to read the text content from " + name, e);
}
Expand Down
3 changes: 1 addition & 2 deletions src/main/groovy/util/GroovyScriptEngine.java
Original file line number Diff line number Diff line change
Expand Up @@ -563,8 +563,7 @@ public Class loadScriptByName(String scriptName) throws ResourceException, Scrip
try {
if (isSourceNewer(entry)) {
try {
String encoding = conn.getContentEncoding() != null ? conn.getContentEncoding() : config.getSourceEncoding();
String content = IOGroovyMethods.getText(conn.getInputStream(), encoding);
String content = IOGroovyMethods.getText(conn.getInputStream(), config.getSourceEncoding());
clazz = groovyLoader.parseClass(content, path);
} catch (IOException e) {
throw new ResourceException(e);
Expand Down
4 changes: 0 additions & 4 deletions src/test/groovy/util/GroovyScriptEngineReloadingTest.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -482,10 +482,6 @@ class GroovyScriptEngineReloadingTest extends GroovyTestCase {
}

class MapUrlConnection extends URLConnection {
String getContentEncoding() {
return CHARSET
}

Object getContent() throws IOException {
return super.content
}
Expand Down