Author: byron
Date: Wed Dec 31 00:32:36 2008
New Revision: 730348
URL: http://svn.apache.org/viewvc?rev=730348&view=rev
Log:
VELOCITY-659 Remove IOException from Velocity.java methods, update changes.xml
Modified:
velocity/engine/trunk/src/changes/changes.xml
velocity/engine/trunk/src/java/org/apache/velocity/app/Velocity.java
velocity/engine/trunk/src/java/org/apache/velocity/runtime/RuntimeServices.java
Modified: velocity/engine/trunk/src/changes/changes.xml
URL:
http://svn.apache.org/viewvc/velocity/engine/trunk/src/changes/changes.xml?rev=730348&r1=730347&r2=730348&view=diff
==============================================================================
--- velocity/engine/trunk/src/changes/changes.xml (original)
+++ velocity/engine/trunk/src/changes/changes.xml Wed Dec 31 00:32:36 2008
@@ -27,8 +27,14 @@
<body>
<release version="1.7" date="In Subversion">
+ <action type="add" dev="byron" issue="VELOCITY-659">
+ Removed java.lang.Exception from throws clause of Velocity
+ and VelocityEngine API. Also removed IOException so that all
+ method calls use unchecked exceptions.
+ </action>
+
<action type="fix" dev="byron" issue="VELOCITY-658" due-to="Jarkko
Viinamäki">
- Fix $hasNext so that it works in nested foreach blocks.
+ Fix $hasNext so that it works in nested foreach blocks.
</action>
<action type="fix" dev="byron" issue="VELOCITY-645">
Modified: velocity/engine/trunk/src/java/org/apache/velocity/app/Velocity.java
URL:
http://svn.apache.org/viewvc/velocity/engine/trunk/src/java/org/apache/velocity/app/Velocity.java?rev=730348&r1=730347&r2=730348&view=diff
==============================================================================
--- velocity/engine/trunk/src/java/org/apache/velocity/app/Velocity.java
(original)
+++ velocity/engine/trunk/src/java/org/apache/velocity/app/Velocity.java Wed
Dec 31 00:32:36 2008
@@ -20,7 +20,6 @@
*/
import java.io.BufferedReader;
-import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.Reader;
@@ -34,7 +33,6 @@
import org.apache.velocity.exception.MethodInvocationException;
import org.apache.velocity.exception.ParseErrorException;
import org.apache.velocity.exception.ResourceNotFoundException;
-import org.apache.velocity.exception.VelocityException;
import org.apache.velocity.runtime.RuntimeConstants;
import org.apache.velocity.runtime.RuntimeSingleton;
import org.apache.velocity.runtime.log.Log;
@@ -175,12 +173,11 @@
* @throws ParseErrorException The template could not be parsed.
* @throws MethodInvocationException A method on a context object could
not be invoked.
* @throws ResourceNotFoundException A referenced resource could not be
loaded.
- * @throws IOException While rendering to the writer, an I/O problem
occured.
*/
public static boolean evaluate( Context context, Writer out,
String logTag, String instring )
throws ParseErrorException, MethodInvocationException,
- ResourceNotFoundException, IOException
+ ResourceNotFoundException
{
return RuntimeSingleton.getRuntimeServices()
.evaluate(context, out, logTag, instring);
@@ -210,7 +207,7 @@
public static boolean evaluate( Context context, Writer writer,
String logTag, InputStream instream )
throws ParseErrorException, MethodInvocationException,
- ResourceNotFoundException, IOException
+ ResourceNotFoundException
{
/*
* first, parse - convert ParseException if thrown
@@ -249,14 +246,12 @@
* @throws ParseErrorException The template could not be parsed.
* @throws MethodInvocationException A method on a context object could
not be invoked.
* @throws ResourceNotFoundException A referenced resource could not be
loaded.
- * @throws IOException While reading from the reader or rendering to the
writer,
- * an I/O problem occured.
* @since Velocity v1.1
*/
public static boolean evaluate( Context context, Writer writer,
String logTag, Reader reader )
throws ParseErrorException, MethodInvocationException,
- ResourceNotFoundException,IOException
+ ResourceNotFoundException
{
return RuntimeSingleton.getRuntimeServices().evaluate(context, writer,
logTag, reader);
@@ -281,17 +276,8 @@
String params[], Context context,
Writer writer )
{
- try
- {
- return RuntimeSingleton.getRuntimeServices()
- .invokeVelocimacro(vmName, logTag, params, context, writer);
- }
- catch (IOException ioe)
- {
- String msg = "Velocity.invokeVelocimacro("+vmName+") failed";
- getLog().error(msg, ioe);
- throw new VelocityException(msg, ioe);
- }
+ return RuntimeSingleton.getRuntimeServices()
+ .invokeVelocimacro(vmName, logTag, params, context, writer);
}
/**
Modified:
velocity/engine/trunk/src/java/org/apache/velocity/runtime/RuntimeServices.java
URL:
http://svn.apache.org/viewvc/velocity/engine/trunk/src/java/org/apache/velocity/runtime/RuntimeServices.java?rev=730348&r1=730347&r2=730348&view=diff
==============================================================================
---
velocity/engine/trunk/src/java/org/apache/velocity/runtime/RuntimeServices.java
(original)
+++
velocity/engine/trunk/src/java/org/apache/velocity/runtime/RuntimeServices.java
Wed Dec 31 00:32:36 2008
@@ -19,7 +19,6 @@
* under the License.
*/
-import java.io.IOException;
import java.io.Reader;
import java.io.Writer;
import java.util.Properties;
@@ -210,7 +209,7 @@
* @since Velocity 1.6
*/
public boolean evaluate(Context context, Writer out,
- String logTag, String instring) throws IOException;
+ String logTag, String instring);
/**
* Renders the input reader using the context into the output writer.
@@ -228,12 +227,10 @@
* @throws ParseErrorException The template could not be parsed.
* @throws MethodInvocationException A method on a context object could
not be invoked.
* @throws ResourceNotFoundException A referenced resource could not be
loaded.
- * @throws IOException While reading from the reader or rendering to the
writer,
- * an I/O problem occured.
* @since Velocity 1.6
*/
public boolean evaluate(Context context, Writer writer,
- String logTag, Reader reader) throws IOException;
+ String logTag, Reader reader);
/**
* Invokes a currently registered Velocimacro with the params provided
@@ -249,12 +246,11 @@
* @param context Context object containing data/objects used for
rendering.
* @param writer Writer for output stream
* @return true if Velocimacro exists and successfully invoked, false
otherwise.
- * @throws IOException While rendering to the writer, an I/O problem
occured.
* @since 1.6
*/
public boolean invokeVelocimacro(final String vmName, String logTag,
String[] params, final Context context,
- final Writer writer) throws IOException;
+ final Writer writer);
/**
* Returns a <code>Template</code> from the resource manager.
@@ -268,10 +264,9 @@
* from any available source.
* @throws ParseErrorException if template cannot be parsed due
* to syntax (or other) error.
- * @throws Exception if an error occurs in template initialization
*/
public Template getTemplate(String name)
- throws ResourceNotFoundException, ParseErrorException, Exception;
+ throws ResourceNotFoundException, ParseErrorException;
/**
* Returns a <code>Template</code> from the resource manager
@@ -283,10 +278,9 @@
* from any available source.
* @throws ParseErrorException if template cannot be parsed due
* to syntax (or other) error.
- * @throws Exception if an error occurs in template initialization
*/
public Template getTemplate(String name, String encoding)
- throws ResourceNotFoundException, ParseErrorException, Exception;
+ throws ResourceNotFoundException, ParseErrorException;
/**
* Returns a static content resource from the
@@ -301,7 +295,7 @@
* @throws Exception
*/
public ContentResource getContent(String name)
- throws ResourceNotFoundException, ParseErrorException, Exception;
+ throws ResourceNotFoundException, ParseErrorException;
/**
* Returns a static content resource from the
@@ -316,7 +310,7 @@
* @throws Exception
*/
public ContentResource getContent( String name, String encoding )
- throws ResourceNotFoundException, ParseErrorException, Exception;
+ throws ResourceNotFoundException, ParseErrorException;
/**
* Determines is a template exists, and returns name of the loader that