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
			}
(-)src/scratchpad/src/org/apache/poi/hdgf/chunks/ChunkFactory.java (-3 / +3 lines)
Lines 51-57 Link Here
51
		"/org/apache/poi/hdgf/chunks_parse_cmds.tbl";
51
		"/org/apache/poi/hdgf/chunks_parse_cmds.tbl";
52
52
53
	/** For logging problems we spot with the file */
53
	/** For logging problems we spot with the file */
54
	private POILogger logger = POILogFactory.getLogger(ChunkFactory.class);
54
	private static POILogger logger = POILogFactory.getLogger(ChunkFactory.class);
55
55
56
	public ChunkFactory(int version) throws IOException {
56
	public ChunkFactory(int version) throws IOException {
57
		this.version = version;
57
		this.version = version;
Lines 153-159 Link Here
153
					data, endOfDataPos);
153
					data, endOfDataPos);
154
				endOfDataPos += 8;
154
				endOfDataPos += 8;
155
			} else {
155
			} else {
156
				System.err.println("Header claims a length to " + endOfDataPos + " there's then no space for the trailer in the data (" + data.length + ")");
156
				logger.log(POILogger.ERROR, "Header claims a length to " + endOfDataPos + " there's then no space for the trailer in the data (" + data.length + ")");
157
			}
157
			}
158
		}
158
		}
159
		if(header.hasSeparator()) {
159
		if(header.hasSeparator()) {
Lines 161-167 Link Here
161
				separator = new ChunkSeparator(
161
				separator = new ChunkSeparator(
162
						data, endOfDataPos);
162
						data, endOfDataPos);
163
			} else {
163
			} else {
164
				System.err.println("Header claims a length to " + endOfDataPos + " there's then no space for the separator in the data (" + data.length + ")");
164
				logger.log(POILogger.ERROR, "Header claims a length to " + endOfDataPos + " there's then no space for the separator in the data (" + data.length + ")");
165
			}
165
			}
166
		}
166
		}
167
167
(-)src/scratchpad/src/org/apache/poi/hdgf/streams/ChunkStream.java (-2 / +6 lines)
Lines 23-30 Link Here
23
import org.apache.poi.hdgf.chunks.ChunkFactory;
23
import org.apache.poi.hdgf.chunks.ChunkFactory;
24
import org.apache.poi.hdgf.chunks.ChunkHeader;
24
import org.apache.poi.hdgf.chunks.ChunkHeader;
25
import org.apache.poi.hdgf.pointers.Pointer;
25
import org.apache.poi.hdgf.pointers.Pointer;
26
import org.apache.poi.util.POILogFactory;
27
import org.apache.poi.util.POILogger;
26
28
27
public final class ChunkStream extends Stream {
29
public final class ChunkStream extends Stream {
30
	private static POILogger logger = POILogFactory.getLogger(ChunkStream.class);
31
	
28
	private ChunkFactory chunkFactory;
32
	private ChunkFactory chunkFactory;
29
	/** All the Chunks we contain */
33
	/** All the Chunks we contain */
30
	private Chunk[] chunks;
34
	private Chunk[] chunks;
Lines 62-75 Link Here
62
66
63
					pos += chunk.getOnDiskSize();
67
					pos += chunk.getOnDiskSize();
64
				} else {
68
				} else {
65
					System.err.println("Needed " + headerSize + " bytes to create the next chunk header, but only found " + (contents.length-pos) + " bytes, ignoring rest of data");
69
					logger.log(POILogger.WARN, "Needed " + headerSize + " bytes to create the next chunk header, but only found " + (contents.length-pos) + " bytes, ignoring rest of data");
66
					pos = contents.length;
70
					pos = contents.length;
67
				}
71
				}
68
			}
72
			}
69
		}
73
		}
70
		catch (Exception e)
74
		catch (Exception e)
71
		{
75
		{
72
			System.err.println("Failed to create chunk at " + pos + ", ignoring rest of data." + e);
76
			logger.log(POILogger.ERROR, "Failed to create chunk at " + pos + ", ignoring rest of data." + e);
73
		}
77
		}
74
78
75
		chunks = chunksA.toArray(new Chunk[chunksA.size()]);
79
		chunks = chunksA.toArray(new Chunk[chunksA.size()]);
(-)src/scratchpad/src/org/apache/poi/hmef/attribute/MAPIDateAttribute.java (-1 / +4 lines)
Lines 24-35 Link Here
24
import org.apache.poi.hpsf.Util;
24
import org.apache.poi.hpsf.Util;
25
import org.apache.poi.hsmf.datatypes.MAPIProperty;
25
import org.apache.poi.hsmf.datatypes.MAPIProperty;
26
import org.apache.poi.util.LittleEndian;
26
import org.apache.poi.util.LittleEndian;
27
import org.apache.poi.util.POILogFactory;
28
import org.apache.poi.util.POILogger;
27
29
28
/**
30
/**
29
 * A pure-MAPI attribute holding a Date, which applies 
31
 * A pure-MAPI attribute holding a Date, which applies 
30
 *  to a {@link HMEFMessage} or one of its {@link Attachment}s.
32
 *  to a {@link HMEFMessage} or one of its {@link Attachment}s.
31
 */
33
 */
32
public final class MAPIDateAttribute extends MAPIAttribute {
34
public final class MAPIDateAttribute extends MAPIAttribute {
35
   private static POILogger logger = POILogFactory.getLogger(MAPIDateAttribute.class);
33
   private Date data;
36
   private Date data;
34
   
37
   
35
   /**
38
   /**
Lines 64-70 Link Here
64
         return ((MAPIDateAttribute)attr).getDate();
67
         return ((MAPIDateAttribute)attr).getDate();
65
      }
68
      }
66
      
69
      
67
      System.err.println("Warning, non date property found: " + attr.toString());
70
      logger.log(POILogger.WARN, "Warning, non date property found: " + attr.toString());
68
      return null;
71
      return null;
69
  }
72
  }
70
}
73
}
(-)src/scratchpad/src/org/apache/poi/hmef/attribute/MAPIStringAttribute.java (-1 / +4 lines)
Lines 23-28 Link Here
23
import org.apache.poi.hmef.HMEFMessage;
23
import org.apache.poi.hmef.HMEFMessage;
24
import org.apache.poi.hsmf.datatypes.MAPIProperty;
24
import org.apache.poi.hsmf.datatypes.MAPIProperty;
25
import org.apache.poi.hsmf.datatypes.Types;
25
import org.apache.poi.hsmf.datatypes.Types;
26
import org.apache.poi.util.POILogFactory;
27
import org.apache.poi.util.POILogger;
26
import org.apache.poi.util.StringUtil;
28
import org.apache.poi.util.StringUtil;
27
29
28
/**
30
/**
Lines 30-35 Link Here
30
 *  to a {@link HMEFMessage} or one of its {@link Attachment}s.
32
 *  to a {@link HMEFMessage} or one of its {@link Attachment}s.
31
 */
33
 */
32
public final class MAPIStringAttribute extends MAPIAttribute {
34
public final class MAPIStringAttribute extends MAPIAttribute {
35
   private static POILogger logger = POILogFactory.getLogger(MAPIStringAttribute.class);
33
   private static final String CODEPAGE = "CP1252";
36
   private static final String CODEPAGE = "CP1252";
34
   private final String data;
37
   private final String data;
35
   
38
   
Lines 78-84 Link Here
78
         return ((MAPIRtfAttribute)attr).getDataString();
81
         return ((MAPIRtfAttribute)attr).getDataString();
79
      }
82
      }
80
      
83
      
81
      System.err.println("Warning, non string property found: " + attr.toString());
84
      logger.log(POILogger.WARN, "Warning, non string property found: " + attr.toString());
82
      return null;
85
      return null;
83
  }
86
  }
84
}
87
}
(-)src/scratchpad/src/org/apache/poi/hmef/attribute/TNEFDateAttribute.java (-1 / +4 lines)
Lines 27-38 Link Here
27
import org.apache.poi.hmef.HMEFMessage;
27
import org.apache.poi.hmef.HMEFMessage;
28
import org.apache.poi.hpsf.Util;
28
import org.apache.poi.hpsf.Util;
29
import org.apache.poi.util.LittleEndian;
29
import org.apache.poi.util.LittleEndian;
30
import org.apache.poi.util.POILogFactory;
31
import org.apache.poi.util.POILogger;
30
32
31
/**
33
/**
32
 * A Date attribute which applies to a {@link HMEFMessage}
34
 * A Date attribute which applies to a {@link HMEFMessage}
33
 *  or one of its {@link Attachment}s.
35
 *  or one of its {@link Attachment}s.
34
 */
36
 */
35
public final class TNEFDateAttribute extends TNEFAttribute {
37
public final class TNEFDateAttribute extends TNEFAttribute {
38
   private static POILogger logger = POILogFactory.getLogger(TNEFDateAttribute.class);
36
   private Date data;
39
   private Date data;
37
   
40
   
38
   /**
41
   /**
Lines 85-91 Link Here
85
         return ((TNEFDateAttribute)attr).getDate();
88
         return ((TNEFDateAttribute)attr).getDate();
86
      }
89
      }
87
      
90
      
88
      System.err.println("Warning, non date property found: " + attr.toString());
91
      logger.log(POILogger.WARN, "Warning, non date property found: " + attr.toString());
89
      return null;
92
      return null;
90
  }
93
  }
91
}
94
}
(-)src/scratchpad/src/org/apache/poi/hmef/attribute/TNEFStringAttribute.java (-1 / +4 lines)
Lines 22-27 Link Here
22
22
23
import org.apache.poi.hmef.Attachment;
23
import org.apache.poi.hmef.Attachment;
24
import org.apache.poi.hmef.HMEFMessage;
24
import org.apache.poi.hmef.HMEFMessage;
25
import org.apache.poi.util.POILogFactory;
26
import org.apache.poi.util.POILogger;
25
import org.apache.poi.util.StringUtil;
27
import org.apache.poi.util.StringUtil;
26
28
27
/**
29
/**
Lines 29-34 Link Here
29
 *  or one of its {@link Attachment}s.
31
 *  or one of its {@link Attachment}s.
30
 */
32
 */
31
public final class TNEFStringAttribute extends TNEFAttribute {
33
public final class TNEFStringAttribute extends TNEFAttribute {
34
   private static POILogger logger = POILogFactory.getLogger(TNEFStringAttribute.class);
32
   private String data;
35
   private String data;
33
   
36
   
34
   /**
37
   /**
Lines 75-81 Link Here
75
         return ((TNEFStringAttribute)attr).getString();
78
         return ((TNEFStringAttribute)attr).getString();
76
      }
79
      }
77
      
80
      
78
      System.err.println("Warning, non string property found: " + attr.toString());
81
      logger.log(POILogger.WARN, "Warning, non string property found: " + attr.toString());
79
      return null;
82
      return null;
80
  }
83
  }
81
}
84
}
(-)src/scratchpad/src/org/apache/poi/hslf/model/Sheet.java (-1 / +5 lines)
Lines 20-25 Link Here
20
import org.apache.poi.ddf.*;
20
import org.apache.poi.ddf.*;
21
import org.apache.poi.hslf.record.*;
21
import org.apache.poi.hslf.record.*;
22
import org.apache.poi.hslf.usermodel.SlideShow;
22
import org.apache.poi.hslf.usermodel.SlideShow;
23
import org.apache.poi.util.POILogFactory;
24
import org.apache.poi.util.POILogger;
23
25
24
import java.util.ArrayList;
26
import java.util.ArrayList;
25
import java.util.Iterator;
27
import java.util.Iterator;
Lines 35-40 Link Here
35
 */
37
 */
36
38
37
public abstract class Sheet {
39
public abstract class Sheet {
40
	private static POILogger logger = POILogFactory.getLogger(Sheet.class);
41
38
    /**
42
    /**
39
     * The <code>SlideShow</code> we belong to
43
     * The <code>SlideShow</code> we belong to
40
     */
44
     */
Lines 194-200 Link Here
194
                } else if (records[i + 1].getRecordType() == 4010l) {
198
                } else if (records[i + 1].getRecordType() == 4010l) {
195
                    // TextSpecInfoAtom - Safe to ignore
199
                    // TextSpecInfoAtom - Safe to ignore
196
                } else {
200
                } else {
197
                    System.err.println("Found a TextHeaderAtom not followed by a TextBytesAtom or TextCharsAtom: Followed by " + records[i + 1].getRecordType());
201
                	logger.log(POILogger.ERROR, "Found a TextHeaderAtom not followed by a TextBytesAtom or TextCharsAtom: Followed by " + records[i + 1].getRecordType());
198
                }
202
                }
199
203
200
                if (trun != null) {
204
                if (trun != null) {
(-)src/scratchpad/src/org/apache/poi/hslf/record/CurrentUserAtom.java (-2 / +6 lines)
Lines 23-28 Link Here
23
import java.io.*;
23
import java.io.*;
24
import org.apache.poi.poifs.filesystem.*;
24
import org.apache.poi.poifs.filesystem.*;
25
import org.apache.poi.util.LittleEndian;
25
import org.apache.poi.util.LittleEndian;
26
import org.apache.poi.util.POILogFactory;
27
import org.apache.poi.util.POILogger;
26
import org.apache.poi.util.StringUtil;
28
import org.apache.poi.util.StringUtil;
27
import org.apache.poi.hslf.exceptions.CorruptPowerPointFileException;
29
import org.apache.poi.hslf.exceptions.CorruptPowerPointFileException;
28
import org.apache.poi.hslf.exceptions.EncryptedPowerPointFileException;
30
import org.apache.poi.hslf.exceptions.EncryptedPowerPointFileException;
Lines 39-44 Link Here
39
41
40
public class CurrentUserAtom
42
public class CurrentUserAtom
41
{
43
{
44
	private static POILogger logger = POILogFactory.getLogger(CurrentUserAtom.class);
45
42
	/** Standard Atom header */
46
	/** Standard Atom header */
43
	public static final byte[] atomHeader = new byte[] { 0, 0, -10, 15 };
47
	public static final byte[] atomHeader = new byte[] { 0, 0, -10, 15 };
44
	/** The PowerPoint magic number for a non-encrypted file */
48
	/** The PowerPoint magic number for a non-encrypted file */
Lines 128-134 Link Here
128
			if(_contents.length >= 4) {
132
			if(_contents.length >= 4) {
129
				// PPT95 has 4 byte size, then data
133
				// PPT95 has 4 byte size, then data
130
				int size = LittleEndian.getInt(_contents);
134
				int size = LittleEndian.getInt(_contents);
131
				System.err.println(size);
135
				//System.err.println(size);
132
				if(size + 4 == _contents.length) {
136
				if(size + 4 == _contents.length) {
133
					throw new OldPowerPointFormatException("Based on the Current User stream, you seem to have supplied a PowerPoint95 file, which isn't supported");
137
					throw new OldPowerPointFormatException("Based on the Current User stream, you seem to have supplied a PowerPoint95 file, which isn't supported");
134
				}
138
				}
Lines 173-179 Link Here
173
		long usernameLen = LittleEndian.getUShort(_contents,20);
177
		long usernameLen = LittleEndian.getUShort(_contents,20);
174
		if(usernameLen > 512) {
178
		if(usernameLen > 512) {
175
			// Handle the case of it being garbage
179
			// Handle the case of it being garbage
176
			System.err.println("Warning - invalid username length " + usernameLen + " found, treating as if there was no username set");
180
			logger.log(POILogger.WARN, "Warning - invalid username length " + usernameLen + " found, treating as if there was no username set");
177
			usernameLen = 0;
181
			usernameLen = 0;
178
		}
182
		}
179
183
(-)src/scratchpad/src/org/apache/poi/hslf/record/Record.java (-2 / +2 lines)
Lines 38-44 Link Here
38
public abstract class Record
38
public abstract class Record
39
{
39
{
40
    // For logging
40
    // For logging
41
    protected POILogger logger = POILogFactory.getLogger(this.getClass());
41
	protected static POILogger logger = POILogFactory.getLogger(Record.class);
42
42
43
	/**
43
	/**
44
	 * Is this record type an Atom record (only has data),
44
	 * Is this record type an Atom record (only has data),
Lines 155-161 Link Here
155
		// Handle case of a corrupt last record, whose claimed length
155
		// Handle case of a corrupt last record, whose claimed length
156
		//  would take us passed the end of the file
156
		//  would take us passed the end of the file
157
		if(start + len > b.length) {
157
		if(start + len > b.length) {
158
			System.err.println("Warning: Skipping record of type " + type + " at position " + start + " which claims to be longer than the file! (" + len + " vs " + (b.length-start) + ")");
158
			logger.log(POILogger.WARN, "Warning: Skipping record of type " + type + " at position " + start + " which claims to be longer than the file! (" + len + " vs " + (b.length-start) + ")");
159
			return null;
159
			return null;
160
		}
160
		}
161
161
(-)src/scratchpad/src/org/apache/poi/hsmf/datatypes/AttachmentChunks.java (-1 / +4 lines)
Lines 37-47 Link Here
37
import java.util.List;
37
import java.util.List;
38
38
39
import org.apache.poi.hsmf.MAPIMessage;
39
import org.apache.poi.hsmf.MAPIMessage;
40
import org.apache.poi.util.POILogFactory;
41
import org.apache.poi.util.POILogger;
40
42
41
/**
43
/**
42
 * Collection of convenence chunks for standard parts of the MSG file attachment.
44
 * Collection of convenence chunks for standard parts of the MSG file attachment.
43
 */
45
 */
44
public class AttachmentChunks implements ChunkGroup {
46
public class AttachmentChunks implements ChunkGroup {
47
   private static POILogger logger = POILogFactory.getLogger(AttachmentChunks.class);
45
   public static final String PREFIX = "__attach_version1.0_#";
48
   public static final String PREFIX = "__attach_version1.0_#";
46
   
49
   
47
   public ByteChunk attachData;
50
   public ByteChunk attachData;
Lines 131-137 Link Here
131
         } else if(chunk instanceof DirectoryChunk) {
134
         } else if(chunk instanceof DirectoryChunk) {
132
             attachmentDirectory = (DirectoryChunk)chunk;
135
             attachmentDirectory = (DirectoryChunk)chunk;
133
         } else {
136
         } else {
134
             System.err.println("Unexpected data chunk of type " + chunk);
137
        	 logger.log(POILogger.ERROR, "Unexpected data chunk of type " + chunk);
135
         }
138
         }
136
      }
139
      }
137
      else if(chunk.getChunkId() == ATTACH_DISPOSITION.id) {
140
      else if(chunk.getChunkId() == ATTACH_DISPOSITION.id) {
(-)src/scratchpad/src/org/apache/poi/hsmf/datatypes/MessageSubmissionChunk.java (-1 / +4 lines)
Lines 26-31 Link Here
26
26
27
import org.apache.poi.hsmf.datatypes.Types.MAPIType;
27
import org.apache.poi.hsmf.datatypes.Types.MAPIType;
28
import org.apache.poi.util.IOUtils;
28
import org.apache.poi.util.IOUtils;
29
import org.apache.poi.util.POILogFactory;
30
import org.apache.poi.util.POILogger;
29
31
30
/**
32
/**
31
 * A Chunk that holds the details given back by the
33
 * A Chunk that holds the details given back by the
Lines 36-41 Link Here
36
 */
38
 */
37
39
38
public class MessageSubmissionChunk extends Chunk {
40
public class MessageSubmissionChunk extends Chunk {
41
	private static POILogger logger = POILogFactory.getLogger(MessageSubmissionChunk.class);
39
	private String rawId;
42
	private String rawId;
40
	private Calendar date;
43
	private Calendar date;
41
	
44
	
Lines 87-93 Link Here
87
                  date.set(Calendar.SECOND,      Integer.parseInt(m.group(6)));
90
                  date.set(Calendar.SECOND,      Integer.parseInt(m.group(6)));
88
                  date.set(Calendar.MILLISECOND, 0);
91
                  date.set(Calendar.MILLISECOND, 0);
89
               } else {
92
               } else {
90
                  System.err.println("Warning - unable to make sense of date " + dateS);
93
            	   logger.log(POILogger.WARN, "Warning - unable to make sense of date " + dateS);
91
               }
94
               }
92
            }
95
            }
93
         }
96
         }
(-)src/scratchpad/src/org/apache/poi/hsmf/datatypes/RecipientChunks.java (-1 / +6 lines)
Lines 21-27 Link Here
21
import java.util.Comparator;
21
import java.util.Comparator;
22
import java.util.List;
22
import java.util.List;
23
23
24
import org.apache.poi.util.POILogFactory;
25
import org.apache.poi.util.POILogger;
24
26
27
25
/**
28
/**
26
 * Collection of convenience chunks for the
29
 * Collection of convenience chunks for the
27
 *  Recip(ient) part of an outlook file.
30
 *  Recip(ient) part of an outlook file.
Lines 30-35 Link Here
30
 *  several of these.
33
 *  several of these.
31
 */
34
 */
32
public final class RecipientChunks implements ChunkGroup {
35
public final class RecipientChunks implements ChunkGroup {
36
   private static POILogger logger = POILogFactory.getLogger(RecipientChunks.class);
37
33
   public static final String PREFIX = "__recip_version1.0_#";
38
   public static final String PREFIX = "__recip_version1.0_#";
34
   
39
   
35
   public static final MAPIProperty RECIPIENT_NAME   = MAPIProperty.DISPLAY_NAME;
40
   public static final MAPIProperty RECIPIENT_NAME   = MAPIProperty.DISPLAY_NAME;
Lines 82-88 Link Here
82
         try {
87
         try {
83
            recipientNumber = Integer.parseInt(number, 16);
88
            recipientNumber = Integer.parseInt(number, 16);
84
         } catch(NumberFormatException e) {
89
         } catch(NumberFormatException e) {
85
            System.err.println("Invalid recipient number in name " + name);
90
        	 logger.log(POILogger.ERROR, "Invalid recipient number in name " + name);
86
         }
91
         }
87
      }
92
      }
88
   }
93
   }
(-)src/scratchpad/src/org/apache/poi/hsmf/parsers/POIFSChunkParser.java (-1 / +5 lines)
Lines 41-46 Link Here
41
import org.apache.poi.poifs.filesystem.DocumentNode;
41
import org.apache.poi.poifs.filesystem.DocumentNode;
42
import org.apache.poi.poifs.filesystem.Entry;
42
import org.apache.poi.poifs.filesystem.Entry;
43
import org.apache.poi.poifs.filesystem.POIFSFileSystem;
43
import org.apache.poi.poifs.filesystem.POIFSFileSystem;
44
import org.apache.poi.util.POILogFactory;
45
import org.apache.poi.util.POILogger;
44
46
45
/**
47
/**
46
 * Processes a POIFS of a .msg file into groups of Chunks, such as
48
 * Processes a POIFS of a .msg file into groups of Chunks, such as
Lines 48-53 Link Here
48
 * data and so on.
50
 * data and so on.
49
 */
51
 */
50
public final class POIFSChunkParser {
52
public final class POIFSChunkParser {
53
   private static POILogger logger = POILogFactory.getLogger(POIFSChunkParser.class);
54
51
   public static ChunkGroup[] parse(POIFSFileSystem fs) throws IOException {
55
   public static ChunkGroup[] parse(POIFSFileSystem fs) throws IOException {
52
      return parse(fs.getRoot());
56
      return parse(fs.getRoot());
53
   }
57
   }
Lines 200-206 Link Here
200
                chunk.readValue(inp);
204
                chunk.readValue(inp);
201
                grouping.record(chunk);
205
                grouping.record(chunk);
202
             } catch(IOException e) {
206
             } catch(IOException e) {
203
                System.err.println("Error reading from part " + entry.getName() + " - " + e.toString());
207
            	 logger.log(POILogger.ERROR, "Error reading from part " + entry.getName() + " - " + e.toString());
204
             }
208
             }
205
          } else {
209
          } else {
206
             grouping.record(chunk);
210
             grouping.record(chunk);
(-)src/scratchpad/src/org/apache/poi/hwpf/converter/AbstractWordUtils.java (-1 / +1 lines)
Lines 453-459 Link Here
453
    {
453
    {
454
454
455
        if ( format != 0 )
455
        if ( format != 0 )
456
            System.err.println( "NYI: toListItemNumberLabel(): " + format );
456
        	logger.log( POILogger.INFO, "NYI: toListItemNumberLabel(): " + format );
457
457
458
        return String.valueOf( number );
458
        return String.valueOf( number );
459
    }
459
    }

Return to bug 52628