Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 110092 Details for
Bug 244268
[hotbug] GenericJpaFactory.contentType() not closing files
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
proposed patch - 2_0_maintenance stream
244268.txt (text/plain), 1.67 KB, created by
Karen Butzke
on 2008-08-15 10:05:13 EDT
(
hide
)
Description:
proposed patch - 2_0_maintenance stream
Filename:
MIME Type:
Creator:
Karen Butzke
Created:
2008-08-15 10:05:13 EDT
Size:
1.67 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.jpt.core >Index: src/org/eclipse/jpt/core/internal/platform/GenericJpaFactory.java >=================================================================== >RCS file: /cvsroot/webtools/org.eclipse.jpa/components/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/GenericJpaFactory.java,v >retrieving revision 1.14 >diff -u -r1.14 GenericJpaFactory.java >--- src/org/eclipse/jpt/core/internal/platform/GenericJpaFactory.java 20 Apr 2008 19:11:36 -0000 1.14 >+++ src/org/eclipse/jpt/core/internal/platform/GenericJpaFactory.java 15 Aug 2008 14:04:02 -0000 >@@ -10,6 +10,7 @@ > package org.eclipse.jpt.core.internal.platform; > > import java.io.IOException; >+import java.io.InputStream; > import org.eclipse.core.resources.IFile; > import org.eclipse.core.runtime.CoreException; > import org.eclipse.core.runtime.Platform; >@@ -295,8 +296,10 @@ > // have to check the file contents instead of just the file name > // because for xml we base it on the rootElement name > private IContentType contentType(IFile file) { >+ InputStream inputStream = null; > try { >- return Platform.getContentTypeManager().findContentTypeFor(file.getContents(), file.getName()); >+ inputStream = file.getContents(); >+ return Platform.getContentTypeManager().findContentTypeFor(inputStream, file.getName()); > } > catch (IOException ex) { > JptCorePlugin.log(ex); >@@ -304,6 +307,15 @@ > catch (CoreException ex) { > JptCorePlugin.log(ex); > } >+ finally { >+ try { >+ if (inputStream != null) { >+ inputStream.close(); >+ } >+ } catch (IOException ex) { >+ JptCorePlugin.log(ex); >+ } >+ } > return null; > } >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 244268
: 110092