Author: epbernard
Date: 2007-02-15 23:26:52 -0500 (Thu, 15 Feb 2007)
New Revision: 11212
Modified:
branches/Branch_3_2/HibernateExt/entitymanager/src/java/org/hibernate/ejb/Ejb3Configuration.java
Log:
Use BufferedInputStreams on xml file reading and JavassistClass reading
Modified:
branches/Branch_3_2/HibernateExt/entitymanager/src/java/org/hibernate/ejb/Ejb3Configuration.java
===================================================================
---
branches/Branch_3_2/HibernateExt/entitymanager/src/java/org/hibernate/ejb/Ejb3Configuration.java 2007-02-16
03:51:12 UTC (rev 11211)
+++
branches/Branch_3_2/HibernateExt/entitymanager/src/java/org/hibernate/ejb/Ejb3Configuration.java 2007-02-16
04:26:52 UTC (rev 11212)
@@ -277,6 +277,7 @@
while ( homogeneousEntry.hasNext() ) {
JarVisitor.Entry entry = (JarVisitor.Entry) homogeneousEntry.next();
if ( filters[index] instanceof JarVisitor.ClassFilter ) {
+ //TODO only add entry if there is annotations (Javassist)
classes.add( entry.getName() );
}
else if ( filters[index] instanceof JarVisitor.PackageFilter ) {
@@ -628,7 +629,7 @@
// defined.
while ( it.hasNext() ) {
InputStream stream = (InputStream) it.next();
- DataInputStream dstream = new DataInputStream( stream );
+ DataInputStream dstream = new DataInputStream( new BufferedInputStream( stream ) );
ClassFile cf = null;
try {
try {
@@ -890,6 +891,7 @@
);
addNamedAnnotatedClasses( this, classNames, workingVars );
}
+ //TODO apparently only used for Tests, get rid of it?
if ( workingVars.containsKey( HibernatePersistence.LOADED_CLASSES ) ) {
Collection<Class> classes = (Collection<Class>) workingVars.get(
HibernatePersistence.LOADED_CLASSES );
for ( Class clazz : classes ) {
@@ -945,7 +947,7 @@
for ( NamedInputStream is : hbmXmlFiles ) {
try {
//addInputStream has the responsibility to close the stream
- cfg.addInputStream( is.getStream() );
+ cfg.addInputStream( new BufferedInputStream( is.getStream() ) );
}
catch (MappingException me) {
//try our best to give the file name