-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: doConfigure method in Configuration class
PostPosted: Thu Aug 10, 2006 9:03 am 
Newbie

Joined: Thu Aug 10, 2006 8:57 am
Posts: 1
Hi All,

I am using Hibernate for about a month now . I happened to browse the source code of Configuration class of hibernate3.jar .

If you see there is a method called doConfigure .

Code:
protected Configuration doConfigure(InputStream stream, String resourceName) throws HibernateException {

      org.dom4j.Document doc;
      try {
         List errors = new ArrayList();
         doc = xmlHelper.createSAXReader( resourceName, errors, entityResolver )
               .read( new InputSource( stream ) );
         if ( errors.size() != 0 ) {
            throw new MappingException(
                  "invalid configuration",
                  (Throwable) errors.get( 0 )
               );
         }
      }
      catch (DocumentException e) {
         throw new HibernateException(
               "Could not parse configuration: " + resourceName,
               e
            );
      }
      finally {
         try {
            stream.close();
         }
         catch (IOException ioe) {
            log.warn( "could not close input stream for: " + resourceName, ioe );
         }
      }

      return doConfigure( doc );

   }


Here the "doc" variable has not been initialiazed anywhere (before the try bolck). This should have been a compilation issue .

Any inputs ?


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.