Bug 112617

Summary: [API] Add ToolFactory.createDefaultClassFileReader(InputStream,int)
Product: [Eclipse Project] JDT Reporter: Dirk Baeumer <dirk_baeumer>
Component: CoreAssignee: Olivier Thomann <Olivier_Thomann>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: P3    
Version: 3.2   
Target Milestone: 3.2 M3   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description Dirk Baeumer CLA 2005-10-14 08:33:33 EDT
To convert JDT/UI to EFS we need this additional API.
Comment 1 Olivier Thomann CLA 2005-10-14 10:14:21 EDT
Would this be fine?
/**
 * Create a default classfile reader, able to expose the internal representation
of a given classfile
 * according to the decoding flag used to initialize the reader.
 * Answer null if the uri is invalid or doesn't correspond to a .class file.
 * 
 * The decoding flags are described in IClassFileReader.
 * 
 * @param uri the given uri that refers to the corresponding IClassfile
 * @param decodingFlag the flag used to decode the class file reader.
 * @return a default classfile reader
 * 
 * @see IClassFileReader
 */
public static IClassFileReader createDefaultClassFileReader(URI, int)
Comment 2 Olivier Thomann CLA 2005-10-14 10:31:15 EDT
Would it be fine to pass a java.io.InputStream instead of an URI?
Comment 3 Olivier Thomann CLA 2005-10-14 11:03:55 EDT
Using an input stream seems to be a more general approach. I will update the
title accordingly.
Fixed and released in HEAD.
Regression test added in
org.eclipse.jdt.core.tests.compiler.regression.ClassFileReaderTest.test083.

There is no new API for the one that refers to a zip file entry.
Comment 4 Frederic Fusier CLA 2005-10-31 06:12:09 EST
Verified for 3.2 M3 using build I20051031-0010