View | Details | Raw Unified | Return to bug 52628
Collapse All | Expand All

(-)src/java/org/apache/poi/hpsf/HPSFRuntimeException.java (-37 / +35 lines)
Lines 17-24 Link Here
17
17
18
package org.apache.poi.hpsf;
18
package org.apache.poi.hpsf;
19
19
20
import java.io.PrintStream;
21
import java.io.PrintWriter;
22
20
23
/**
21
/**
24
 * <p>This exception is the superclass of all other unchecked
22
 * <p>This exception is the superclass of all other unchecked
Lines 30-37 Link Here
30
 */
28
 */
31
public class HPSFRuntimeException extends RuntimeException
29
public class HPSFRuntimeException extends RuntimeException
32
{
30
{
33
31
	private static final long serialVersionUID = -7804271670232727159L;
34
    /** <p>The underlying reason for this exception - may be
32
	/** <p>The underlying reason for this exception - may be
35
     * <code>null</code>.</p> */
33
     * <code>null</code>.</p> */
36
    private Throwable reason;
34
    private Throwable reason;
37
35
Lines 105-148 Link Here
105
103
106
104
107
105
108
    /**
106
//    /**
109
     * @see Throwable#printStackTrace()
107
//     * @see Throwable#printStackTrace()
110
     */
108
//     */
111
    public void printStackTrace()
109
//    public void printStackTrace()
112
    {
110
//    {
113
        printStackTrace(System.err);
111
//        printStackTrace(System.err);
114
    }
112
//    }
115
113
116
114
117
115
118
    /**
116
//    /**
119
     * @see Throwable#printStackTrace(java.io.PrintStream)
117
//     * @see Throwable#printStackTrace(java.io.PrintStream)
120
     */
118
//     */
121
    public void printStackTrace(final PrintStream p)
119
//    public void printStackTrace(final PrintStream p)
122
    {
120
//    {
123
        final Throwable reason = getReason();
121
//        final Throwable reason = getReason();
124
        super.printStackTrace(p);
122
//        super.printStackTrace(p);
125
        if (reason != null)
123
//        if (reason != null)
126
        {
124
//        {
127
            p.println("Caused by:");
125
//            p.println("Caused by:");
128
            reason.printStackTrace(p);
126
//            reason.printStackTrace(p);
129
        }
127
//        }
130
    }
128
//    }
131
129
132
130
133
131
134
    /**
132
//    /**
135
     * @see Throwable#printStackTrace(java.io.PrintWriter)
133
//     * @see Throwable#printStackTrace(java.io.PrintWriter)
136
     */
134
//     */
137
    public void printStackTrace(final PrintWriter p)
135
//    public void printStackTrace(final PrintWriter p)
138
    {
136
//    {
139
        final Throwable reason = getReason();
137
//        final Throwable reason = getReason();
140
        super.printStackTrace(p);
138
//        super.printStackTrace(p);
141
        if (reason != null)
139
//        if (reason != null)
142
        {
140
//        {
143
            p.println("Caused by:");
141
//            p.println("Caused by:");
144
            reason.printStackTrace(p);
142
//            reason.printStackTrace(p);
145
        }
143
//        }
146
    }
144
//    }
147
145
148
}
146
}
(-)src/java/org/apache/poi/hpsf/VariantSupport.java (-4 / +7 lines)
Lines 24-29 Link Here
24
import java.util.LinkedList;
24
import java.util.LinkedList;
25
import java.util.List;
25
import java.util.List;
26
26
27
import org.apache.poi.util.POILogFactory;
28
import org.apache.poi.util.POILogger;
29
27
/**
30
/**
28
 * <p>Supports reading and writing of variant data.</p>
31
 * <p>Supports reading and writing of variant data.</p>
29
 *
32
 *
Lines 45-51 Link Here
45
 */
48
 */
46
public class VariantSupport extends Variant
49
public class VariantSupport extends Variant
47
{
50
{
48
51
	private static POILogger logger = POILogFactory.getLogger(VariantSupport.class);
49
    private static boolean logUnsupportedTypes = false;
52
    private static boolean logUnsupportedTypes = false;
50
53
51
    /**
54
    /**
Lines 78-84 Link Here
78
     * <p>Keeps a list of the variant types an "unsupported" message has already
81
     * <p>Keeps a list of the variant types an "unsupported" message has already
79
     * been issued for.</p>
82
     * been issued for.</p>
80
     */
83
     */
81
    protected static List unsupportedMessage;
84
    protected static List<Long> unsupportedMessage;
82
85
83
    /**
86
    /**
84
     * <p>Writes a warning to <code>System.err</code> that a variant type is
87
     * <p>Writes a warning to <code>System.err</code> that a variant type is
Lines 93-103 Link Here
93
        if (isLogUnsupportedTypes())
96
        if (isLogUnsupportedTypes())
94
        {
97
        {
95
            if (unsupportedMessage == null)
98
            if (unsupportedMessage == null)
96
                unsupportedMessage = new LinkedList();
99
                unsupportedMessage = new LinkedList<Long>();
97
            Long vt = Long.valueOf(ex.getVariantType());
100
            Long vt = Long.valueOf(ex.getVariantType());
98
            if (!unsupportedMessage.contains(vt))
101
            if (!unsupportedMessage.contains(vt))
99
            {
102
            {
100
                System.err.println(ex.getMessage());
103
            	logger.log( POILogger.ERROR, ex.getMessage());
101
                unsupportedMessage.add(vt);
104
                unsupportedMessage.add(vt);
102
            }
105
            }
103
        }
106
        }
(-)src/java/org/apache/poi/hssf/eventusermodel/FormatTrackingHSSFListener.java (-2 / +5 lines)
Lines 31-36 Link Here
31
import org.apache.poi.hssf.record.Record;
31
import org.apache.poi.hssf.record.Record;
32
import org.apache.poi.hssf.usermodel.HSSFDataFormat;
32
import org.apache.poi.hssf.usermodel.HSSFDataFormat;
33
import org.apache.poi.hssf.usermodel.HSSFDataFormatter;
33
import org.apache.poi.hssf.usermodel.HSSFDataFormatter;
34
import org.apache.poi.util.POILogFactory;
35
import org.apache.poi.util.POILogger;
34
36
35
/**
37
/**
36
 * A proxy HSSFListener that keeps track of the document formatting records, and
38
 * A proxy HSSFListener that keeps track of the document formatting records, and
Lines 38-43 Link Here
38
 * ids.
40
 * ids.
39
 */
41
 */
40
public class FormatTrackingHSSFListener implements HSSFListener {
42
public class FormatTrackingHSSFListener implements HSSFListener {
43
	private static POILogger logger = POILogFactory.getLogger(FormatTrackingHSSFListener.class);
41
	private final HSSFListener _childListener;
44
	private final HSSFListener _childListener;
42
	private final HSSFDataFormatter _formatter;
45
	private final HSSFDataFormatter _formatter;
43
	private final NumberFormat _defaultFormat;
46
	private final NumberFormat _defaultFormat;
Lines 137-143 Link Here
137
		if (formatIndex >= HSSFDataFormat.getNumberOfBuiltinBuiltinFormats()) {
140
		if (formatIndex >= HSSFDataFormat.getNumberOfBuiltinBuiltinFormats()) {
138
			FormatRecord tfr = _customFormatRecords.get(Integer.valueOf(formatIndex));
141
			FormatRecord tfr = _customFormatRecords.get(Integer.valueOf(formatIndex));
139
			if (tfr == null) {
142
			if (tfr == null) {
140
				System.err.println("Requested format at index " + formatIndex
143
				logger.log( POILogger.ERROR, "Requested format at index " + formatIndex
141
						+ ", but it wasn't found");
144
						+ ", but it wasn't found");
142
			} else {
145
			} else {
143
				format = tfr.getFormatString();
146
				format = tfr.getFormatString();
Lines 167-173 Link Here
167
	public int getFormatIndex(CellValueRecordInterface cell) {
170
	public int getFormatIndex(CellValueRecordInterface cell) {
168
		ExtendedFormatRecord xfr = _xfRecords.get(cell.getXFIndex());
171
		ExtendedFormatRecord xfr = _xfRecords.get(cell.getXFIndex());
169
		if (xfr == null) {
172
		if (xfr == null) {
170
			System.err.println("Cell " + cell.getRow() + "," + cell.getColumn()
173
			logger.log( POILogger.ERROR, "Cell " + cell.getRow() + "," + cell.getColumn()
171
					+ " uses XF with index " + cell.getXFIndex() + ", but we don't have that");
174
					+ " uses XF with index " + cell.getXFIndex() + ", but we don't have that");
172
			return -1;
175
			return -1;
173
		}
176
		}
(-)src/java/org/apache/poi/hssf/record/common/UnicodeString.java (-1 / +1 lines)
Lines 179-185 Link Here
179
179
180
          int extraDataLength = runData - (numRuns*6);
180
          int extraDataLength = runData - (numRuns*6);
181
          if(extraDataLength < 0) {
181
          if(extraDataLength < 0) {
182
             System.err.println("Warning - ExtRst overran by " + (0-extraDataLength) + " bytes");
182
        	 _logger.log( POILogger.WARN, "Warning - ExtRst overran by " + (0-extraDataLength) + " bytes");
183
             extraDataLength = 0;
183
             extraDataLength = 0;
184
          }
184
          }
185
          extraData = new byte[extraDataLength];
185
          extraData = new byte[extraDataLength];
(-)src/java/org/apache/poi/hssf/record/EmbeddedObjectRefSubRecord.java (-1 / +4 lines)
Lines 29-34 Link Here
29
import org.apache.poi.util.LittleEndianInput;
29
import org.apache.poi.util.LittleEndianInput;
30
import org.apache.poi.util.LittleEndianInputStream;
30
import org.apache.poi.util.LittleEndianInputStream;
31
import org.apache.poi.util.LittleEndianOutput;
31
import org.apache.poi.util.LittleEndianOutput;
32
import org.apache.poi.util.POILogFactory;
33
import org.apache.poi.util.POILogger;
32
import org.apache.poi.util.StringUtil;
34
import org.apache.poi.util.StringUtil;
33
35
34
/**
36
/**
Lines 39-44 Link Here
39
 * @author Daniel Noll
41
 * @author Daniel Noll
40
 */
42
 */
41
public final class EmbeddedObjectRefSubRecord extends SubRecord {
43
public final class EmbeddedObjectRefSubRecord extends SubRecord {
44
	private static POILogger logger = POILogFactory.getLogger(EmbeddedObjectRefSubRecord.class);
42
	public static final short sid = 0x0009;
45
	public static final short sid = 0x0009;
43
46
44
	private static final byte[] EMPTY_BYTE_ARRAY = { };
47
	private static final byte[] EMPTY_BYTE_ARRAY = { };
Lines 137-143 Link Here
137
		int nUnexpectedPadding = remaining - dataLenAfterFormula;
140
		int nUnexpectedPadding = remaining - dataLenAfterFormula;
138
141
139
		if (nUnexpectedPadding > 0) {
142
		if (nUnexpectedPadding > 0) {
140
			System.err.println("Discarding " + nUnexpectedPadding + " unexpected padding bytes ");
143
			logger.log( POILogger.ERROR, "Discarding " + nUnexpectedPadding + " unexpected padding bytes ");
141
			readRawData(in, nUnexpectedPadding);
144
			readRawData(in, nUnexpectedPadding);
142
			remaining-=nUnexpectedPadding;
145
			remaining-=nUnexpectedPadding;
143
		}
146
		}
(-)src/java/org/apache/poi/hssf/record/FeatRecord.java (-1 / +4 lines)
Lines 24-29 Link Here
24
import org.apache.poi.hssf.record.common.SharedFeature;
24
import org.apache.poi.hssf.record.common.SharedFeature;
25
import org.apache.poi.ss.util.CellRangeAddress;
25
import org.apache.poi.ss.util.CellRangeAddress;
26
import org.apache.poi.util.LittleEndianOutput;
26
import org.apache.poi.util.LittleEndianOutput;
27
import org.apache.poi.util.POILogFactory;
28
import org.apache.poi.util.POILogger;
27
29
28
/**
30
/**
29
 * Title: Feat (Feature) Record
31
 * Title: Feat (Feature) Record
Lines 32-37 Link Here
32
 *  up with a {@link FeatHdrRecord}.
34
 *  up with a {@link FeatHdrRecord}.
33
 */
35
 */
34
public final class FeatRecord extends StandardRecord  {
36
public final class FeatRecord extends StandardRecord  {
37
	private static POILogger logger = POILogFactory.getLogger(FeatRecord.class);
35
	public final static short sid = 0x0868;
38
	public final static short sid = 0x0868;
36
	
39
	
37
	private FtrHeader futureHeader;
40
	private FtrHeader futureHeader;
Lines 90-96 Link Here
90
			sharedFeature = new FeatSmartTag(in);
93
			sharedFeature = new FeatSmartTag(in);
91
			break;
94
			break;
92
		default:
95
		default:
93
			System.err.println("Unknown Shared Feature " + isf_sharedFeatureType + " found!");
96
			logger.log( POILogger.ERROR, "Unknown Shared Feature " + isf_sharedFeatureType + " found!");
94
		}
97
		}
95
	}
98
	}
96
99
(-)src/java/org/apache/poi/hssf/record/HyperlinkRecord.java (-2 / +2 lines)
Lines 41-47 Link Here
41
 */
41
 */
42
public final class HyperlinkRecord extends StandardRecord {
42
public final class HyperlinkRecord extends StandardRecord {
43
    public final static short sid = 0x01B8;
43
    public final static short sid = 0x01B8;
44
    private POILogger logger = POILogFactory.getLogger(getClass());
44
    private static POILogger logger = POILogFactory.getLogger(HyperlinkRecord.class);
45
45
46
    static final class GUID {
46
    static final class GUID {
47
		/*
47
		/*
Lines 641-647 Link Here
641
    	if (false) { // Quite a few examples in the unit tests which don't have the exact expected tail
641
    	if (false) { // Quite a few examples in the unit tests which don't have the exact expected tail
642
            for (int i = 0; i < expectedTail.length; i++) {
642
            for (int i = 0; i < expectedTail.length; i++) {
643
                if (expectedTail[i] != result[i]) {
643
                if (expectedTail[i] != result[i]) {
644
                    System.err.println("Mismatch in tail byte [" + i + "]"
644
                	logger.log( POILogger.ERROR, "Mismatch in tail byte [" + i + "]"
645
                    		+ "expected " + (expectedTail[i] & 0xFF) + " but got " + (result[i] & 0xFF));
645
                    		+ "expected " + (expectedTail[i] & 0xFF) + " but got " + (result[i] & 0xFF));
646
                }
646
                }
647
            }
647
            }
(-)src/java/org/apache/poi/hssf/record/SSTDeserializer.java (-2 / +4 lines)
Lines 21-26 Link Here
21
21
22
import org.apache.poi.hssf.record.common.UnicodeString;
22
import org.apache.poi.hssf.record.common.UnicodeString;
23
import org.apache.poi.util.IntMapper;
23
import org.apache.poi.util.IntMapper;
24
import org.apache.poi.util.POILogFactory;
25
import org.apache.poi.util.POILogger;
24
26
25
/**
27
/**
26
 * Handles the task of deserializing a SST string.  The two main entry points are
28
 * Handles the task of deserializing a SST string.  The two main entry points are
Lines 30-36 Link Here
30
 */
32
 */
31
class SSTDeserializer
33
class SSTDeserializer
32
{
34
{
33
35
	private static POILogger logger = POILogFactory.getLogger(SSTDeserializer.class);
34
    private IntMapper<UnicodeString> strings;
36
    private IntMapper<UnicodeString> strings;
35
37
36
    public SSTDeserializer( IntMapper<UnicodeString> strings )
38
    public SSTDeserializer( IntMapper<UnicodeString> strings )
Lines 49-55 Link Here
49
         // Extract exactly the count of strings from the SST record.
51
         // Extract exactly the count of strings from the SST record.
50
         UnicodeString str;
52
         UnicodeString str;
51
         if(in.available() == 0 && ! in.hasNextRecord()) {
53
         if(in.available() == 0 && ! in.hasNextRecord()) {
52
            System.err.println("Ran out of data before creating all the strings! String at index " + i + "");
54
        	 logger.log( POILogger.ERROR, "Ran out of data before creating all the strings! String at index " + i + "");
53
            str = new UnicodeString("");
55
            str = new UnicodeString("");
54
         } else {
56
         } else {
55
            str = new UnicodeString(in);
57
            str = new UnicodeString(in);
(-)src/java/org/apache/poi/hssf/usermodel/HSSFEvaluationWorkbook.java (-2 / +4 lines)
Lines 34-39 Link Here
34
import org.apache.poi.ss.formula.FormulaRenderingWorkbook;
34
import org.apache.poi.ss.formula.FormulaRenderingWorkbook;
35
import org.apache.poi.ss.formula.FormulaType;
35
import org.apache.poi.ss.formula.FormulaType;
36
import org.apache.poi.ss.formula.udf.UDFFinder;
36
import org.apache.poi.ss.formula.udf.UDFFinder;
37
import org.apache.poi.util.POILogFactory;
38
import org.apache.poi.util.POILogger;
37
39
38
/**
40
/**
39
 * Internal POI use only
41
 * Internal POI use only
Lines 41-47 Link Here
41
 * @author Josh Micich
43
 * @author Josh Micich
42
 */
44
 */
43
public final class HSSFEvaluationWorkbook implements FormulaRenderingWorkbook, EvaluationWorkbook, FormulaParsingWorkbook {
45
public final class HSSFEvaluationWorkbook implements FormulaRenderingWorkbook, EvaluationWorkbook, FormulaParsingWorkbook {
44
46
	private static POILogger logger = POILogFactory.getLogger(HSSFEvaluationWorkbook.class);
45
	private final HSSFWorkbook _uBook;
47
	private final HSSFWorkbook _uBook;
46
	private final InternalWorkbook _iBook;
48
	private final InternalWorkbook _iBook;
47
49
Lines 139-145 Link Here
139
				// Note - as of Bugzilla 48036 (svn r828244, r828247) POI is capable of evaluating
141
				// Note - as of Bugzilla 48036 (svn r828244, r828247) POI is capable of evaluating
140
				// IntesectionPtg.  However it is still not capable of parsing it.
142
				// IntesectionPtg.  However it is still not capable of parsing it.
141
				// So FormulaEvalTestData.xls now contains a few formulas that produce errors here.
143
				// So FormulaEvalTestData.xls now contains a few formulas that produce errors here.
142
				System.err.println(e.getMessage());
144
				logger.log( POILogger.ERROR, e.getMessage());
143
			}
145
			}
144
		}
146
		}
145
		FormulaRecordAggregate fra = (FormulaRecordAggregate) cell.getCellValueRecord();
147
		FormulaRecordAggregate fra = (FormulaRecordAggregate) cell.getCellValueRecord();
(-)src/java/org/apache/poi/hssf/usermodel/HSSFPicture.java (-1 / +5 lines)
Lines 27-32 Link Here
27
import org.apache.poi.hssf.record.ObjRecord;
27
import org.apache.poi.hssf.record.ObjRecord;
28
import org.apache.poi.ss.usermodel.Picture;
28
import org.apache.poi.ss.usermodel.Picture;
29
import org.apache.poi.ss.util.ImageUtils;
29
import org.apache.poi.ss.util.ImageUtils;
30
import org.apache.poi.util.POILogFactory;
31
import org.apache.poi.util.POILogger;
30
import org.apache.poi.hssf.model.InternalWorkbook;
32
import org.apache.poi.hssf.model.InternalWorkbook;
31
33
32
/**
34
/**
Lines 36-41 Link Here
36
 * @author Yegor Kozlov (yegor at apache.org)
38
 * @author Yegor Kozlov (yegor at apache.org)
37
 */
39
 */
38
public class HSSFPicture extends HSSFSimpleShape implements Picture {
40
public class HSSFPicture extends HSSFSimpleShape implements Picture {
41
	private static POILogger logger = POILogFactory.getLogger(HSSFPicture.class);
42
	
39
    public static final int PICTURE_TYPE_EMF = HSSFWorkbook.PICTURE_TYPE_EMF;                // Windows Enhanced Metafile
43
    public static final int PICTURE_TYPE_EMF = HSSFWorkbook.PICTURE_TYPE_EMF;                // Windows Enhanced Metafile
40
    public static final int PICTURE_TYPE_WMF = HSSFWorkbook.PICTURE_TYPE_WMF;                // Windows Metafile
44
    public static final int PICTURE_TYPE_WMF = HSSFWorkbook.PICTURE_TYPE_WMF;                // Windows Metafile
41
    public static final int PICTURE_TYPE_PICT = HSSFWorkbook.PICTURE_TYPE_PICT;              // Macintosh PICT
45
    public static final int PICTURE_TYPE_PICT = HSSFWorkbook.PICTURE_TYPE_PICT;              // Macintosh PICT
Lines 283-289 Link Here
283
            EscherComplexProperty prop = new EscherComplexProperty(EscherProperties.BLIP__BLIPFILENAME, true, data.getBytes("UTF-16LE"));
287
            EscherComplexProperty prop = new EscherComplexProperty(EscherProperties.BLIP__BLIPFILENAME, true, data.getBytes("UTF-16LE"));
284
            setPropertyValue(prop);
288
            setPropertyValue(prop);
285
        } catch (UnsupportedEncodingException e) {
289
        } catch (UnsupportedEncodingException e) {
286
            System.out.println("Unsupported encoding: UTF-16LE");
290
        	logger.log( POILogger.ERROR, "Unsupported encoding: UTF-16LE");
287
        }
291
        }
288
    }
292
    }
289
293
(-)src/java/org/apache/poi/hssf/usermodel/HSSFPolygon.java (-3 / +5 lines)
Lines 20-31 Link Here
20
import org.apache.poi.ddf.*;
20
import org.apache.poi.ddf.*;
21
import org.apache.poi.hssf.record.*;
21
import org.apache.poi.hssf.record.*;
22
import org.apache.poi.util.LittleEndian;
22
import org.apache.poi.util.LittleEndian;
23
import org.apache.poi.util.POILogFactory;
24
import org.apache.poi.util.POILogger;
23
25
24
/**
26
/**
25
 * @author Glen Stampoultzis  (glens at superlinksoftware.com)
27
 * @author Glen Stampoultzis  (glens at superlinksoftware.com)
26
 */
28
 */
27
public class HSSFPolygon  extends HSSFSimpleShape {
29
public class HSSFPolygon  extends HSSFSimpleShape {
28
30
	private static POILogger logger = POILogFactory.getLogger(HSSFPolygon.class);
29
    public final static short OBJECT_TYPE_MICROSOFT_OFFICE_DRAWING = 0x1E;
31
    public final static short OBJECT_TYPE_MICROSOFT_OFFICE_DRAWING = 0x1E;
30
32
31
    public HSSFPolygon(EscherContainerRecord spContainer, ObjRecord objRecord, TextObjectRecord _textObjectRecord) {
33
    public HSSFPolygon(EscherContainerRecord spContainer, ObjRecord objRecord, TextObjectRecord _textObjectRecord) {
Lines 157-167 Link Here
157
     */
159
     */
158
    public void setPoints(int[] xPoints, int[] yPoints) {
160
    public void setPoints(int[] xPoints, int[] yPoints) {
159
        if (xPoints.length != yPoints.length){
161
        if (xPoints.length != yPoints.length){
160
            System.out.println("xPoint.length must be equal to yPoints.length");
162
        	logger.log( POILogger.ERROR, "xPoint.length must be equal to yPoints.length");
161
            return;
163
            return;
162
        }
164
        }
163
        if (xPoints.length == 0){
165
        if (xPoints.length == 0){
164
            System.out.println("HSSFPolygon must have at least one point");
166
        	logger.log( POILogger.ERROR, "HSSFPolygon must have at least one point");
165
        }
167
        }
166
        EscherArrayProperty verticesProp = new EscherArrayProperty(EscherProperties.GEOMETRY__VERTICES, false, new byte[0] );
168
        EscherArrayProperty verticesProp = new EscherArrayProperty(EscherProperties.GEOMETRY__VERTICES, false, new byte[0] );
167
        verticesProp.setNumberOfElementsInArray(xPoints.length+1);
169
        verticesProp.setNumberOfElementsInArray(xPoints.length+1);
(-)src/java/org/apache/poi/POIDocument.java (-1 / +1 lines)
Lines 221-227 Link Here
221
221
222
			logger.log(POILogger.INFO, "Wrote property set " + name + " of size " + data.length);
222
			logger.log(POILogger.INFO, "Wrote property set " + name + " of size " + data.length);
223
		} catch(org.apache.poi.hpsf.WritingNotSupportedException wnse) {
223
		} catch(org.apache.poi.hpsf.WritingNotSupportedException wnse) {
224
			System.err.println("Couldn't write property set with name " + name + " as not supported by HPSF yet");
224
			logger.log( POILogger.ERROR, "Couldn't write property set with name " + name + " as not supported by HPSF yet");
225
		}
225
		}
226
	}
226
	}
227
	
227
	
(-)src/java/org/apache/poi/poifs/filesystem/EntryUtils.java (-1 / +1 lines)
Lines 36-42 Link Here
36
    public static void copyNodeRecursively( Entry entry, DirectoryEntry target )
36
    public static void copyNodeRecursively( Entry entry, DirectoryEntry target )
37
            throws IOException
37
            throws IOException
38
    {
38
    {
39
        // System.err.println("copyNodeRecursively called with "+entry.getName()+
39
        // logger.log( POILogger.ERROR, "copyNodeRecursively called with "+entry.getName()+
40
        // ","+target.getName());
40
        // ","+target.getName());
41
        DirectoryEntry newTarget = null;
41
        DirectoryEntry newTarget = null;
42
        if ( entry.isDirectoryEntry() )
42
        if ( entry.isDirectoryEntry() )
(-)src/java/org/apache/poi/ss/formula/constant/ErrorConstant.java (-1 / +4 lines)
Lines 18-23 Link Here
18
package org.apache.poi.ss.formula.constant;
18
package org.apache.poi.ss.formula.constant;
19
19
20
import org.apache.poi.ss.usermodel.ErrorConstants;
20
import org.apache.poi.ss.usermodel.ErrorConstants;
21
import org.apache.poi.util.POILogFactory;
22
import org.apache.poi.util.POILogger;
21
/**
23
/**
22
 * Represents a constant error code value as encoded in a constant values array. <p/>
24
 * Represents a constant error code value as encoded in a constant values array. <p/>
23
 * 
25
 * 
Lines 27-32 Link Here
27
 * @author Josh Micich
29
 * @author Josh Micich
28
 */
30
 */
29
public class ErrorConstant {
31
public class ErrorConstant {
32
	private static POILogger logger = POILogFactory.getLogger(ErrorConstant.class);
30
	// convenient access to name space
33
	// convenient access to name space
31
	private static final ErrorConstants EC = null;
34
	private static final ErrorConstants EC = null;
32
35
Lines 64-70 Link Here
64
			case ErrorConstants.ERROR_NUM:   return NUM;
67
			case ErrorConstants.ERROR_NUM:   return NUM;
65
			case ErrorConstants.ERROR_NA:	return NA;
68
			case ErrorConstants.ERROR_NA:	return NA;
66
		}
69
		}
67
		System.err.println("Warning - unexpected error code (" + errorCode + ")");
70
		logger.log( POILogger.WARN, "Warning - unexpected error code (" + errorCode + ")");
68
		return new ErrorConstant(errorCode);
71
		return new ErrorConstant(errorCode);
69
	}
72
	}
70
	public String toString() {
73
	public String toString() {
(-)src/java/org/apache/poi/ss/util/DateFormatConverter.java (-1 / +5 lines)
Lines 24-29 Link Here
24
import java.util.Locale;
24
import java.util.Locale;
25
import java.util.Map;
25
import java.util.Map;
26
26
27
import org.apache.poi.util.POILogFactory;
28
import org.apache.poi.util.POILogger;
29
27
/**
30
/**
28
 *  Convert java DateFormat patterns into Excel custom number formats.
31
 *  Convert java DateFormat patterns into Excel custom number formats.
29
 *  For example, to format a date in excel using the "dd MMMM, yyyy" pattern and Japanese
32
 *  For example, to format a date in excel using the "dd MMMM, yyyy" pattern and Japanese
Lines 45-50 Link Here
45
 *
48
 *
46
 */
49
 */
47
public class DateFormatConverter  {
50
public class DateFormatConverter  {
51
	private static POILogger logger = POILogFactory.getLogger(DateFormatConverter.class);
48
	
52
	
49
	public static class DateFormatTokenizer {
53
	public static class DateFormatTokenizer {
50
		String format;
54
		String format;
Lines 329-335 Link Here
329
			result = localePrefixes.get( localeString.substring( 0, 2 ) );
333
			result = localePrefixes.get( localeString.substring( 0, 2 ) );
330
			if( result ==  null ) {
334
			if( result ==  null ) {
331
				Locale parentLocale = new Locale(localeString.substring( 0, 2 ));
335
				Locale parentLocale = new Locale(localeString.substring( 0, 2 ));
332
				System.out.println( "Unable to find prefix for " + locale + "(" + locale.getDisplayName() + ") or " 
336
				logger.log( POILogger.ERROR, "Unable to find prefix for " + locale + "(" + locale.getDisplayName() + ") or " 
333
						+ localeString.substring( 0, 2 ) + "(" + parentLocale.getDisplayName() + ")" );
337
						+ localeString.substring( 0, 2 ) + "(" + parentLocale.getDisplayName() + ")" );
334
				return "";
338
				return "";
335
			}
339
			}

Return to bug 52628