Author: rjung Date: Fri Jul 15 07:48:27 2011 New Revision: 1146994 URL: http://svn.apache.org/viewvc?rev=1146994&view=rev Log: Missing svn:eol-style.
Please fix your svn config. Thanks. Modified: tomcat/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/TrapException.java (contents, props changed) tomcat/trunk/modules/jdbc-pool/src/test/java/org/apache/tomcat/jdbc/test/Bug50571.java (contents, props changed) tomcat/trunk/res/maven/tomcat-jdbc.pom (contents, props changed) Modified: tomcat/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/TrapException.java URL: http://svn.apache.org/viewvc/tomcat/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/TrapException.java?rev=1146994&r1=1146993&r2=1146994&view=diff ============================================================================== --- tomcat/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/TrapException.java (original) +++ tomcat/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/TrapException.java Fri Jul 15 07:48:27 2011 @@ -1,79 +1,79 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.apache.tomcat.jdbc.pool; - - -import java.lang.reflect.InvocationTargetException; -import java.lang.reflect.Method; -import java.sql.SQLException; -/** - * Interceptor that traps any unhandled exception types and throws an exception that has been declared by the method - * called, or throw a SQLException if it is declared. - * If the caught exception is not declared, and the method doesn't throw SQLException, then this interceptor will - * throw a RuntimeException - * @author fhanik - * - */ -public class TrapException extends JdbcInterceptor { - - - public TrapException() { - } - - @Override - public Object invoke(Object proxy, Method method, Object[] args) throws Throwable { - try { - return super.invoke(proxy, method, args); - }catch (Exception t) { - Throwable exception = t; - if (t instanceof InvocationTargetException) { - exception = t.getCause()!=null?t.getCause():t; - } - Class<?> exceptionClass = exception.getClass(); - if (!isDeclaredException(method, exceptionClass)) { - if (isDeclaredException(method,SQLException.class)) { - SQLException sqlx = new SQLException("Uncaught underlying exception."); - sqlx.initCause(exception); - exception = sqlx; - } else { - RuntimeException rx = new RuntimeException("Uncaught underlying exception."); - rx.initCause(exception); - exception = rx; - } - } - throw exception; - } - - } - - public boolean isDeclaredException(Method m, Class<?> clazz) { - for (Class<?> cl : m.getExceptionTypes()) { - if (cl.equals(clazz) || cl.isAssignableFrom(clazz)) return true; - } - return false; - } - - /** - * no-op for this interceptor. no state is stored. - */ - @Override - public void reset(ConnectionPool parent, PooledConnection con) { - // NOOP - } - -} +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.tomcat.jdbc.pool; + + +import java.lang.reflect.InvocationTargetException; +import java.lang.reflect.Method; +import java.sql.SQLException; +/** + * Interceptor that traps any unhandled exception types and throws an exception that has been declared by the method + * called, or throw a SQLException if it is declared. + * If the caught exception is not declared, and the method doesn't throw SQLException, then this interceptor will + * throw a RuntimeException + * @author fhanik + * + */ +public class TrapException extends JdbcInterceptor { + + + public TrapException() { + } + + @Override + public Object invoke(Object proxy, Method method, Object[] args) throws Throwable { + try { + return super.invoke(proxy, method, args); + }catch (Exception t) { + Throwable exception = t; + if (t instanceof InvocationTargetException) { + exception = t.getCause()!=null?t.getCause():t; + } + Class<?> exceptionClass = exception.getClass(); + if (!isDeclaredException(method, exceptionClass)) { + if (isDeclaredException(method,SQLException.class)) { + SQLException sqlx = new SQLException("Uncaught underlying exception."); + sqlx.initCause(exception); + exception = sqlx; + } else { + RuntimeException rx = new RuntimeException("Uncaught underlying exception."); + rx.initCause(exception); + exception = rx; + } + } + throw exception; + } + + } + + public boolean isDeclaredException(Method m, Class<?> clazz) { + for (Class<?> cl : m.getExceptionTypes()) { + if (cl.equals(clazz) || cl.isAssignableFrom(clazz)) return true; + } + return false; + } + + /** + * no-op for this interceptor. no state is stored. + */ + @Override + public void reset(ConnectionPool parent, PooledConnection con) { + // NOOP + } + +} Propchange: tomcat/trunk/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/TrapException.java ------------------------------------------------------------------------------ svn:eol-style = native Modified: tomcat/trunk/modules/jdbc-pool/src/test/java/org/apache/tomcat/jdbc/test/Bug50571.java URL: http://svn.apache.org/viewvc/tomcat/trunk/modules/jdbc-pool/src/test/java/org/apache/tomcat/jdbc/test/Bug50571.java?rev=1146994&r1=1146993&r2=1146994&view=diff ============================================================================== --- tomcat/trunk/modules/jdbc-pool/src/test/java/org/apache/tomcat/jdbc/test/Bug50571.java (original) +++ tomcat/trunk/modules/jdbc-pool/src/test/java/org/apache/tomcat/jdbc/test/Bug50571.java Fri Jul 15 07:48:27 2011 @@ -1,39 +1,39 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.apache.tomcat.jdbc.test; - -import org.apache.tomcat.jdbc.pool.interceptor.ConnectionState; - -public class Bug50571 extends DefaultTestCase{ - - public Bug50571(String name) { - super(name); - } - - @Override - public void setUp() throws Exception { - super.setUp(); - this.datasource.setUrl("jdbc:h2:~/.h2/test;QUERY_TIMEOUT=0;DB_CLOSE_ON_EXIT=FALSE"); - this.datasource.setJdbcInterceptors(ConnectionState.class.getName()); - this.datasource.setDefaultTransactionIsolation(-55); - this.datasource.setInitialSize(1); - } - - public void testBug50571() throws Exception { - this.datasource.getConnection().close(); - } -} +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.tomcat.jdbc.test; + +import org.apache.tomcat.jdbc.pool.interceptor.ConnectionState; + +public class Bug50571 extends DefaultTestCase{ + + public Bug50571(String name) { + super(name); + } + + @Override + public void setUp() throws Exception { + super.setUp(); + this.datasource.setUrl("jdbc:h2:~/.h2/test;QUERY_TIMEOUT=0;DB_CLOSE_ON_EXIT=FALSE"); + this.datasource.setJdbcInterceptors(ConnectionState.class.getName()); + this.datasource.setDefaultTransactionIsolation(-55); + this.datasource.setInitialSize(1); + } + + public void testBug50571() throws Exception { + this.datasource.getConnection().close(); + } +} Propchange: tomcat/trunk/modules/jdbc-pool/src/test/java/org/apache/tomcat/jdbc/test/Bug50571.java ------------------------------------------------------------------------------ svn:eol-style = native Modified: tomcat/trunk/res/maven/tomcat-jdbc.pom URL: http://svn.apache.org/viewvc/tomcat/trunk/res/maven/tomcat-jdbc.pom?rev=1146994&r1=1146993&r2=1146994&view=diff ============================================================================== --- tomcat/trunk/res/maven/tomcat-jdbc.pom (original) +++ tomcat/trunk/res/maven/tomcat-jdbc.pom Fri Jul 15 07:48:27 2011 @@ -1,32 +1,32 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - Licensed to the Apache Software Foundation (ASF) under one or more - contributor license agreements. See the NOTICE file distributed with - this work for additional information regarding copyright ownership. - The ASF licenses this file to You under the Apache License, Version 2.0 - (the "License"); you may not use this file except in compliance with - the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. ---> -<project> - <modelVersion>4.0.0</modelVersion> - <groupId>org.apache.tomcat</groupId> - <artifactId>tomcat-jdbc</artifactId> - <version>@MAVEN.DEPLOY.VERSION@</version> - <description>Tomcat JDBC Pool Package</description> - <dependencies> - <dependency> - <groupId>org.apache.tomcat</groupId> - <artifactId>tomcat-jdbc</artifactId> - <version>@MAVEN.DEPLOY.VERSION@</version> - <scope>compile</scope> - </dependency> - </dependencies> -</project> +<?xml version="1.0" encoding="UTF-8"?> +<!-- + Licensed to the Apache Software Foundation (ASF) under one or more + contributor license agreements. See the NOTICE file distributed with + this work for additional information regarding copyright ownership. + The ASF licenses this file to You under the Apache License, Version 2.0 + (the "License"); you may not use this file except in compliance with + the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +--> +<project> + <modelVersion>4.0.0</modelVersion> + <groupId>org.apache.tomcat</groupId> + <artifactId>tomcat-jdbc</artifactId> + <version>@MAVEN.DEPLOY.VERSION@</version> + <description>Tomcat JDBC Pool Package</description> + <dependencies> + <dependency> + <groupId>org.apache.tomcat</groupId> + <artifactId>tomcat-jdbc</artifactId> + <version>@MAVEN.DEPLOY.VERSION@</version> + <scope>compile</scope> + </dependency> + </dependencies> +</project> Propchange: tomcat/trunk/res/maven/tomcat-jdbc.pom ------------------------------------------------------------------------------ svn:eol-style = native --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org