reduced the number of compiler warnings generated by JDK 1.6.13 with -Xlint

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@821551 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Yegor Kozlov 2009-10-04 16:01:29 +00:00
parent 2ad9b00e9f
commit 5d21532e8f
11 changed files with 24 additions and 14 deletions

View File

@ -152,7 +152,7 @@ public class ExtractorFactory {
*/
public static POITextExtractor[] getEmbededDocsTextExtractors(POIOLE2TextExtractor ext) throws IOException {
// Find all the embeded directories
ArrayList dirs = new ArrayList();
ArrayList<Entry> dirs = new ArrayList<Entry>();
POIFSFileSystem fs = ext.getFileSystem();
if(fs == null) {
throw new IllegalStateException("The extractor didn't know which POIFS it came from!");

View File

@ -37,6 +37,7 @@ import org.apache.poi.util.POILogger;
* @author Julien Chable, CDubet
*
*/
@Deprecated
public abstract class Package extends OPCPackage {
/**
@ -48,7 +49,8 @@ public abstract class Package extends OPCPackage {
/**
* @deprecated use {@link OPCPackage}
*/
protected Package(PackageAccess access) {
@Deprecated
protected Package(PackageAccess access) {
super(access);
}
@ -56,6 +58,7 @@ public abstract class Package extends OPCPackage {
/**
* @deprecated use {@link OPCPackage#open(String)}
*/
@Deprecated
public static Package open(String path) throws InvalidFormatException {
return open(path, defaultPackageAccess);
}
@ -63,6 +66,7 @@ public abstract class Package extends OPCPackage {
/**
* @deprecated use {@link OPCPackage#open(String,PackageAccess)}
*/
@Deprecated
public static Package open(String path, PackageAccess access)
throws InvalidFormatException {
if (path == null || "".equals(path.trim())
@ -80,6 +84,7 @@ public abstract class Package extends OPCPackage {
/**
* @deprecated use {@link OPCPackage#open(InputStream)}
*/
@Deprecated
public static Package open(InputStream in) throws InvalidFormatException,
IOException {
Package pack = new ZipPackage(in, PackageAccess.READ);
@ -92,6 +97,7 @@ public abstract class Package extends OPCPackage {
/**
* @deprecated use {@link OPCPackage#openOrCreate(java.io.File)}
*/
@Deprecated
public static Package openOrCreate(File file) throws InvalidFormatException {
Package retPackage = null;
if (file.exists()) {
@ -105,6 +111,7 @@ public abstract class Package extends OPCPackage {
/**
* @deprecated use {@link OPCPackage#create(String)}
*/
@Deprecated
public static Package create(String path) {
return create(new File(path));
}
@ -112,6 +119,7 @@ public abstract class Package extends OPCPackage {
/**
* @deprecated use {@link OPCPackage#create(File)}
*/
@Deprecated
public static Package create(File file) {
if (file == null || (file.exists() && file.isDirectory()))
throw new IllegalArgumentException("file");
@ -133,6 +141,7 @@ public abstract class Package extends OPCPackage {
/**
* @deprecated use {@link OPCPackage#create(OutputStream)}
*/
@Deprecated
public static Package create(OutputStream output) {
Package pkg = null;
pkg = new ZipPackage();

View File

@ -297,7 +297,7 @@ public class XSSFExportToXml implements Comparator<String>{
case XSSFCell.CELL_TYPE_STRING: value = cell.getStringCellValue(); break;
case XSSFCell.CELL_TYPE_BOOLEAN: value += cell.getBooleanCellValue(); break;
case XSSFCell.CELL_TYPE_ERROR: value = cell.getErrorCellString();
case XSSFCell.CELL_TYPE_ERROR: value = cell.getErrorCellString(); break;
case XSSFCell.CELL_TYPE_FORMULA: value = cell.getStringCellValue(); break;
case XSSFCell.CELL_TYPE_NUMERIC: value += cell.getRawValue(); break;
default: ;

View File

@ -97,7 +97,7 @@ public final class XSSFDrawing extends POIXMLDocumentPart implements Drawing {
xmlns:xdr="http://schemas.openxmlformats.org/drawingml/2006/spreadsheetDrawing">
*/
if(isNew) xmlOptions.setSaveSyntheticDocumentElement(new QName(CTDrawing.type.getName().getNamespaceURI(), "wsDr", "xdr"));
Map map = new HashMap();
Map<String, String> map = new HashMap<String, String>();
map.put("http://schemas.openxmlformats.org/drawingml/2006/main", "a");
map.put(STRelationshipId.type.getName().getNamespaceURI(), "r");
xmlOptions.setSaveSuggestedPrefixes(map);

View File

@ -54,7 +54,7 @@ public final class XSSFFactory extends POIXMLFactory {
}
try {
Class cls = descriptor.getRelationClass();
Class<? extends POIXMLDocumentPart> cls = descriptor.getRelationClass();
Constructor<? extends POIXMLDocumentPart> constructor = cls.getDeclaredConstructor(PackagePart.class, PackageRelationship.class);
return constructor.newInstance(part, rel);
} catch (Exception e){
@ -64,7 +64,7 @@ public final class XSSFFactory extends POIXMLFactory {
public POIXMLDocumentPart newDocumentPart(POIXMLRelation descriptor){
try {
Class cls = descriptor.getRelationClass();
Class<? extends POIXMLDocumentPart> cls = descriptor.getRelationClass();
Constructor<? extends POIXMLDocumentPart> constructor = cls.getDeclaredConstructor();
return constructor.newInstance();
} catch (Exception e){

View File

@ -55,9 +55,10 @@ public class XSSFFormulaEvaluator implements FormulaEvaluator {
* @param stabilityClassifier used to optimise caching performance. Pass <code>null</code>
* for the (conservative) assumption that any cell may have its definition changed after
* evaluation begins.
* @deprecated (Sep 2009) (reduce overloading) use {@link #create(HSSFWorkbook, IStabilityClassifier, UDFFinder)}
* @deprecated (Sep 2009) (reduce overloading) use {@link #create(XSSFWorkbook, org.apache.poi.ss.formula.IStabilityClassifier, org.apache.poi.hssf.record.formula.udf.UDFFinder)}
*/
public XSSFFormulaEvaluator(XSSFWorkbook workbook, IStabilityClassifier stabilityClassifier) {
@Deprecated
public XSSFFormulaEvaluator(XSSFWorkbook workbook, IStabilityClassifier stabilityClassifier) {
_bookEvaluator = new WorkbookEvaluator(XSSFEvaluationWorkbook.create(workbook), stabilityClassifier, null);
}
private XSSFFormulaEvaluator(XSSFWorkbook workbook, IStabilityClassifier stabilityClassifier, UDFFinder udfFinder) {

View File

@ -2326,7 +2326,7 @@ public class XSSFSheet extends POIXMLDocumentPart implements Sheet {
XmlOptions xmlOptions = new XmlOptions(DEFAULT_XML_OPTIONS);
xmlOptions.setSaveSyntheticDocumentElement(new QName(CTWorksheet.type.getName().getNamespaceURI(), "worksheet"));
Map map = new HashMap();
Map<String, String> map = new HashMap<String, String>();
map.put(STRelationshipId.type.getName().getNamespaceURI(), "r");
xmlOptions.setSaveSuggestedPrefixes(map);

View File

@ -263,7 +263,7 @@ public class XWPFHeaderFooterPolicy {
private XmlOptions commit(XWPFHeaderFooter wrapper) {
XmlOptions xmlOptions = new XmlOptions(wrapper.DEFAULT_XML_OPTIONS);
Map map = new HashMap();
Map<String, String> map = new HashMap<String, String>();
map.put("http://schemas.openxmlformats.org/officeDocument/2006/math", "m");
map.put("urn:schemas-microsoft-com:office:office", "o");
map.put("http://schemas.openxmlformats.org/officeDocument/2006/relationships", "r");

View File

@ -326,7 +326,7 @@ public class XWPFDocument extends POIXMLDocument {
XmlOptions xmlOptions = new XmlOptions(DEFAULT_XML_OPTIONS);
xmlOptions.setSaveSyntheticDocumentElement(new QName(CTDocument1.type.getName().getNamespaceURI(), "document"));
Map map = new HashMap();
Map<String, String> map = new HashMap<String, String>();
map.put("http://schemas.openxmlformats.org/officeDocument/2006/math", "m");
map.put("urn:schemas-microsoft-com:office:office", "o");
map.put("http://schemas.openxmlformats.org/officeDocument/2006/relationships", "r");

View File

@ -53,7 +53,7 @@ public final class XWPFFactory extends POIXMLFactory {
}
try {
Class cls = descriptor.getRelationClass();
Class<? extends POIXMLDocumentPart> cls = descriptor.getRelationClass();
Constructor<? extends POIXMLDocumentPart> constructor = cls.getDeclaredConstructor(PackagePart.class, PackageRelationship.class);
return constructor.newInstance(part, rel);
} catch (Exception e){
@ -63,7 +63,7 @@ public final class XWPFFactory extends POIXMLFactory {
public POIXMLDocumentPart newDocumentPart(POIXMLRelation descriptor){
try {
Class cls = descriptor.getRelationClass();
Class<? extends POIXMLDocumentPart> cls = descriptor.getRelationClass();
Constructor<? extends POIXMLDocumentPart> constructor = cls.getDeclaredConstructor();
return constructor.newInstance();
} catch (Exception e){

View File

@ -91,7 +91,7 @@ public final class TestOPCCompliancePartName extends TestCase {
try {
uri = new URI(s);
} catch (URISyntaxException e) {
assertTrue(s == "[Content_Types].xml");
assertTrue(s.equals("[Content_Types].xml"));
continue;
}
assertFalse("This part name SHOULD NOT be valid: " + s,