Permalink
Browse files

Tag for Groovy 1.5.5

git-svn-id: http://svn.codehaus.org/groovy/tags/GROOVY_1_5_5@11624 a5544e8c-8a19-0410-ba12-f9af4593a198
  • Loading branch information...
2 parents 3f54ad0 + fd0b5f3 commit 8f649e5e022c48294c534e39d398ca2d5e10ca8b @glaforge glaforge committed Apr 14, 2008
Showing 1,690 changed files with 287 additions and 158 deletions.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -84,9 +84,9 @@ class MockFor {
instance.metaClass = thisproxy
def wrapped = null
if (clazz.isInterface()) {
- wrapped = ProxyGenerator.instantiateDelegate([clazz], instance)
+ wrapped = ProxyGenerator.INSTANCE.instantiateDelegate([clazz], instance)
} else {
- wrapped = ProxyGenerator.instantiateDelegate(instance)
+ wrapped = ProxyGenerator.INSTANCE.instantiateDelegate(instance)
}
instanceExpectations[wrapped] = thisexpect
return wrapped
@@ -95,20 +95,20 @@ class MockFor {
private getInstance(Class clazz, args) {
def instance = null
if (clazz.isInterface()) {
- instance = ProxyGenerator.instantiateAggregateFromInterface(clazz)
+ instance = ProxyGenerator.INSTANCE.instantiateAggregateFromInterface(clazz)
} else if (Modifier.isAbstract(clazz.modifiers)) {
- instance = ProxyGenerator.instantiateAggregateFromBaseClass(clazz, args)
+ instance = ProxyGenerator.INSTANCE.instantiateAggregateFromBaseClass(clazz, args)
} else if (args != null) {
if (clazz instanceof GroovyObject) {
instance = clazz.newInstance(args)
} else {
- instance = ProxyGenerator.instantiateDelegate(clazz.newInstance(args))
+ instance = ProxyGenerator.INSTANCE.instantiateDelegate(clazz.newInstance(args))
}
} else {
if (clazz instanceof GroovyObject) {
instance = clazz.newInstance()
} else {
- instance = ProxyGenerator.instantiateDelegate(clazz.newInstance())
+ instance = ProxyGenerator.INSTANCE.instantiateDelegate(clazz.newInstance())
}
}
return instance
@@ -134,6 +134,11 @@
protected boolean verbose;
/**
+ * Encoding to use, becomes charset part of contentType.
+ */
+ protected String encoding = "UTF-8";
+
+ /**
* Mirrors the static value of the reflection flag in MetaClass.
* See AbstractHttpServlet#logGROOVY861
*/
@@ -301,17 +306,19 @@ public void init(ServletConfig config) throws ServletException {
*/
this.servletContext = config.getServletContext();
- /*
- * Get verbosity hint.
- */
+ // Get verbosity hint.
String value = config.getInitParameter("verbose");
if (value != null) {
this.verbose = Boolean.valueOf(value).booleanValue();
}
- /*
- * And now the real init work...
- */
+ // get encoding
+ value = config.getInitParameter("encoding");
+ if (value != null) {
+ this.encoding = value;
+ }
+
+ // And now the real init work...
if (verbose) {
log("Parsing init parameters...");
}
@@ -105,7 +105,7 @@ public void service(HttpServletRequest request, HttpServletResponse response) th
final String scriptUri = getScriptUri(request);
// Set it to HTML by default
- response.setContentType("text/html");
+ response.setContentType("text/html; charset="+encoding);
// Set up the script context
final Binding binding = new ServletBinding(request, response, servletContext);
@@ -386,7 +386,7 @@ public void service(HttpServletRequest request, HttpServletResponse response) th
// Prepare the response buffer content type _before_ getting the writer.
// and set status code to ok
//
- response.setContentType(CONTENT_TYPE_TEXT_HTML);
+ response.setContentType(CONTENT_TYPE_TEXT_HTML+"; charset="+encoding);
response.setStatus(HttpServletResponse.SC_OK);
//
Oops, something went wrong.

0 comments on commit 8f649e5

Please sign in to comment.