git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1738031 13f79535-47bb-0310-9956-ffa450edef68tags/REL_3_15_BETA2
@@ -46,7 +46,7 @@ public class HybridStreaming { | |||
if (!SHEET_TO_STREAM.equals(ctSheet.getName())) { | |||
super.parseSheet(shIdMap, ctSheet); | |||
} | |||
}; | |||
} | |||
}; | |||
// Having avoided a DOM-based parse of the sheet, we can stream it instead. |
@@ -31,7 +31,7 @@ public class EscherPropertyMetaData | |||
public final static byte TYPE_RGB = (byte) 2; | |||
public final static byte TYPE_SHAPEPATH = (byte) 3; | |||
public final static byte TYPE_SIMPLE = (byte)4; | |||
public final static byte TYPE_ARRAY = (byte)5;; | |||
public final static byte TYPE_ARRAY = (byte)5; | |||
private String description; | |||
private byte type; |
@@ -36,8 +36,7 @@ public enum CipherAlgorithm { | |||
des3_112(null, "DESede", -1, 128, new int[]{128}, 8, 32, "3DES_112", true), | |||
// only for digital signatures | |||
rsa(null, "RSA", -1, 1024, new int[]{1024, 2048, 3072, 4096}, -1, -1, "", false); | |||
; | |||
public final CipherProvider provider; | |||
public final String jceId; | |||
public final int ecmaId; |
@@ -35,7 +35,6 @@ public enum HashAlgorithm { | |||
whirlpool("Whirlpool", -1, "WHIRLPOOL", 64, "HMac-Whirlpool", true), | |||
// only for xml signing | |||
sha224 ( "SHA-224", -1, "SHA224", 28, "HmacSHA224", true); | |||
; | |||
public final String jceId; | |||
public final int ecmaId; |
@@ -14,9 +14,9 @@ | |||
See the License for the specific language governing permissions and | |||
limitations under the License. | |||
==================================================================== */ | |||
package org.apache.poi.poifs.filesystem; | |||
package org.apache.poi.poifs.filesystem; | |||
import java.io.ByteArrayOutputStream; | |||
import java.io.IOException; | |||
import java.io.OutputStream; | |||
@@ -30,24 +30,24 @@ import org.apache.poi.util.StringUtil; | |||
* Represents an Ole10Native record which is wrapped around certain binary | |||
* files being embedded in OLE2 documents. | |||
* | |||
* @author Rainer Schwarze | |||
*/ | |||
public class Ole10Native { | |||
public static final String OLE10_NATIVE = "\u0001Ole10Native"; | |||
protected static final String ISO1 = "ISO-8859-1"; | |||
* @author Rainer Schwarze | |||
*/ | |||
public class Ole10Native { | |||
public static final String OLE10_NATIVE = "\u0001Ole10Native"; | |||
protected static final String ISO1 = "ISO-8859-1"; | |||
// (the fields as they appear in the raw record:) | |||
private int totalSize; // 4 bytes, total size of record not including this field | |||
private short flags1 = 2; // 2 bytes, unknown, mostly [02 00] | |||
private String label; // ASCIIZ, stored in this field without the terminating zero | |||
private String fileName; // ASCIIZ, stored in this field without the terminating zero | |||
private short flags2 = 0; // 2 bytes, unknown, mostly [00 00] | |||
private short unknown1 = 3; // see below | |||
private String command; // ASCIIZ, stored in this field without the terminating zero | |||
private byte[] dataBuffer; // varying size, the actual native data | |||
private short flags3 = 0; // some final flags? or zero terminators?, sometimes not there | |||
private int totalSize; // 4 bytes, total size of record not including this field | |||
private short flags1 = 2; // 2 bytes, unknown, mostly [02 00] | |||
private String label; // ASCIIZ, stored in this field without the terminating zero | |||
private String fileName; // ASCIIZ, stored in this field without the terminating zero | |||
private short flags2 = 0; // 2 bytes, unknown, mostly [00 00] | |||
private short unknown1 = 3; // see below | |||
private String command; // ASCIIZ, stored in this field without the terminating zero | |||
private byte[] dataBuffer; // varying size, the actual native data | |||
private short flags3 = 0; // some final flags? or zero terminators?, sometimes not there | |||
/** | |||
* the field encoding mode - merely a try-and-error guess ... | |||
**/ | |||
@@ -63,16 +63,16 @@ public class Ole10Native { | |||
/** | |||
* the data is stored raw after the length field and the flags1 field | |||
*/ | |||
compact; | |||
compact | |||
} | |||
private EncodingMode mode; | |||
/** | |||
* Creates an instance of this class from an embedded OLE Object. The OLE Object is expected | |||
* to include a stream "{01}Ole10Native" which contains the actual | |||
/** | |||
* Creates an instance of this class from an embedded OLE Object. The OLE Object is expected | |||
* to include a stream "{01}Ole10Native" which contains the actual | |||
* data relevant for this class. | |||
* | |||
* @param poifs POI Filesystem object | |||
@@ -102,18 +102,18 @@ public class Ole10Native { | |||
assert(readBytes == data.length); | |||
return new Ole10Native(data, 0); | |||
} | |||
/** | |||
* Creates an instance and fills the fields based on ... the fields | |||
*/ | |||
public Ole10Native(String label, String filename, String command, byte[] data) { | |||
setLabel(label); | |||
setFileName(filename); | |||
setCommand(command); | |||
} | |||
/** | |||
* Creates an instance and fills the fields based on ... the fields | |||
*/ | |||
public Ole10Native(String label, String filename, String command, byte[] data) { | |||
setLabel(label); | |||
setFileName(filename); | |||
setCommand(command); | |||
setDataBuffer(data); | |||
mode = EncodingMode.parsed; | |||
} | |||
mode = EncodingMode.parsed; | |||
} | |||
/** | |||
* Creates an instance and fills the fields based on the data in the given buffer. | |||
@@ -128,11 +128,11 @@ public class Ole10Native { | |||
public Ole10Native(byte[] data, int offset, boolean plain) throws Ole10NativeException { | |||
this(data, offset); | |||
} | |||
/** | |||
* Creates an instance and fills the fields based on the data in the given buffer. | |||
* | |||
* @param data The buffer containing the Ole10Native record | |||
/** | |||
* Creates an instance and fills the fields based on the data in the given buffer. | |||
* | |||
* @param data The buffer containing the Ole10Native record | |||
* @param offset The start offset of the record in the buffer | |||
* @throws Ole10NativeException on invalid or unexcepted data format | |||
*/ | |||
@@ -174,25 +174,25 @@ public class Ole10Native { | |||
ofs += len; | |||
flags2 = LittleEndian.getShort(data, ofs); | |||
ofs += LittleEndianConsts.SHORT_SIZE; | |||
unknown1 = LittleEndian.getShort(data, ofs); | |||
ofs += LittleEndianConsts.SHORT_SIZE; | |||
len = LittleEndian.getInt(data, ofs); | |||
ofs += LittleEndianConsts.SHORT_SIZE; | |||
unknown1 = LittleEndian.getShort(data, ofs); | |||
ofs += LittleEndianConsts.SHORT_SIZE; | |||
len = LittleEndian.getInt(data, ofs); | |||
ofs += LittleEndianConsts.INT_SIZE; | |||
command = StringUtil.getFromCompressedUnicode(data, ofs, len - 1); | |||
ofs += len; | |||
if (totalSize < ofs) { | |||
throw new Ole10NativeException("Invalid Ole10Native"); | |||
} | |||
dataSize = LittleEndian.getInt(data, ofs); | |||
ofs += LittleEndianConsts.INT_SIZE; | |||
if (dataSize < 0 || totalSize - (ofs - LittleEndianConsts.INT_SIZE) < dataSize) { | |||
throw new Ole10NativeException("Invalid Ole10Native"); | |||
command = StringUtil.getFromCompressedUnicode(data, ofs, len - 1); | |||
ofs += len; | |||
if (totalSize < ofs) { | |||
throw new Ole10NativeException("Invalid Ole10Native"); | |||
} | |||
dataSize = LittleEndian.getInt(data, ofs); | |||
ofs += LittleEndianConsts.INT_SIZE; | |||
if (dataSize < 0 || totalSize - (ofs - LittleEndianConsts.INT_SIZE) < dataSize) { | |||
throw new Ole10NativeException("Invalid Ole10Native"); | |||
} | |||
break; | |||
} | |||
@@ -205,11 +205,11 @@ public class Ole10Native { | |||
case unparsed: | |||
dataSize = totalSize; | |||
break; | |||
} | |||
dataBuffer = new byte[dataSize]; | |||
System.arraycopy(data, ofs, dataBuffer, 0, dataSize); | |||
ofs += dataSize; | |||
} | |||
dataBuffer = new byte[dataSize]; | |||
System.arraycopy(data, ofs, dataBuffer, 0, dataSize); | |||
ofs += dataSize; | |||
} | |||
/* | |||
@@ -326,12 +326,12 @@ public class Ole10Native { | |||
return flags3; | |||
} | |||
/** | |||
* Have the contents printer out into an OutputStream, used when writing a | |||
* file back out to disk (Normally, atom classes will keep their bytes | |||
* around, but non atom classes will just request the bytes from their | |||
* children, then chuck on their header and return) | |||
*/ | |||
/** | |||
* Have the contents printer out into an OutputStream, used when writing a | |||
* file back out to disk (Normally, atom classes will keep their bytes | |||
* around, but non atom classes will just request the bytes from their | |||
* children, then chuck on their header and return) | |||
*/ | |||
public void writeOut(OutputStream out) throws IOException { | |||
// byte intbuf[] = new byte[LittleEndianConsts.INT_SIZE]; | |||
// byte shortbuf[] = new byte[LittleEndianConsts.SHORT_SIZE]; | |||
@@ -377,7 +377,7 @@ public class Ole10Native { | |||
} | |||
} | |||
public void setFlags1(short flags1) { | |||
this.flags1 = flags1; | |||
} | |||
@@ -409,4 +409,4 @@ public class Ole10Native { | |||
public void setDataBuffer(byte dataBuffer[]) { | |||
this.dataBuffer = dataBuffer; | |||
} | |||
} | |||
} |
@@ -918,7 +918,6 @@ public final class SLGraphics extends Graphics2D implements Cloneable { | |||
* @see java.awt.Graphics#create | |||
*/ | |||
public void dispose() { | |||
; | |||
} | |||
/** | |||
@@ -1145,7 +1144,6 @@ public final class SLGraphics extends Graphics2D implements Cloneable { | |||
} | |||
public void copyArea(int x, int y, int width, int height, int dx, int dy) { | |||
; | |||
} | |||
/** |
@@ -26,8 +26,8 @@ public interface TableCell< | |||
S extends Shape<S,P>, | |||
P extends TextParagraph<S,P,?> | |||
> extends TextShape<S,P> { | |||
enum BorderEdge { bottom, left, top, right }; | |||
enum BorderEdge { bottom, left, top, right } | |||
/** | |||
* Return line style of given edge or {@code null} if border is not defined | |||
* |
@@ -104,7 +104,7 @@ public interface TextParagraph< | |||
* This is different than BASELINE because of letters such as "g", "q", and "y". | |||
* Also known as "UpholdFixed" | |||
*/ | |||
BOTTOM; | |||
BOTTOM | |||
} | |||
public interface BulletStyle { |
@@ -50,7 +50,7 @@ public interface TextShape< | |||
* Determines if all of the text is vertical | |||
* ("one letter on top of another"). | |||
*/ | |||
STACKED; | |||
STACKED | |||
} | |||
/** |
@@ -96,7 +96,7 @@ public class CellNumberFormatter extends CellFormatter { | |||
public void simpleValue(StringBuffer toAppendTo, Object value) { | |||
formatValue(toAppendTo, value); | |||
} | |||
}; | |||
} | |||
/** |
@@ -106,7 +106,7 @@ public final class LinearRegressionFunction extends Fixed2ArgFunction { | |||
} | |||
} | |||
public enum FUNCTION {INTERCEPT, SLOPE}; | |||
public enum FUNCTION {INTERCEPT, SLOPE} | |||
public FUNCTION function; | |||
public LinearRegressionFunction(FUNCTION function) { |
@@ -78,6 +78,6 @@ public enum FillPatternType { | |||
LESS_DOTS, | |||
/** Least Dots */ | |||
LEAST_DOTS; | |||
LEAST_DOTS | |||
} |
@@ -79,5 +79,5 @@ public enum IgnoredErrorType { | |||
* Whether to check for unprotected formulas. | |||
* HSSF + XSSF. | |||
*/ | |||
UNLOCKED_FORMULA; | |||
UNLOCKED_FORMULA | |||
} |
@@ -39,5 +39,5 @@ public enum PaperSize { | |||
FOLIO_PAPER, | |||
QUARTO_PAPER, | |||
STANDARD_PAPER_10_14, | |||
STANDARD_PAPER_11_17; | |||
STANDARD_PAPER_11_17 | |||
} |
@@ -47,7 +47,7 @@ public class CellReference { | |||
NAMED_RANGE, | |||
COLUMN, | |||
ROW, | |||
BAD_CELL_OR_NAMED_RANGE; | |||
BAD_CELL_OR_NAMED_RANGE | |||
} | |||
/** The character ($) that signifies a row or column value is absolute instead of relative */ |
@@ -453,8 +453,7 @@ public abstract class PackagePart implements RelationshipSource, Comparable<Pack | |||
return true; | |||
} | |||
} catch (InvalidFormatException e){ | |||
; | |||
} | |||
} | |||
return false; | |||
} | |||
@@ -37,12 +37,12 @@ import java.util.Map; | |||
import java.util.Vector; | |||
import java.util.jar.JarEntry; | |||
import java.util.jar.JarFile; | |||
import java.util.regex.Pattern; | |||
import java.util.regex.Pattern; | |||
import junit.framework.TestCase; | |||
import junit.framework.TestCase; | |||
import org.junit.Test; | |||
import org.junit.internal.TextListener; | |||
import org.junit.Test; | |||
import org.junit.internal.TextListener; | |||
import org.junit.runner.JUnitCore;import org.junit.runner.Result; | |||
/** | |||
@@ -201,7 +201,7 @@ public final class OOXMLLite { | |||
if (TestCase.class.isAssignableFrom(testclass) | |||
|| checkForTestAnnotation(testclass)) { | |||
out.add(testclass); | |||
}; | |||
} | |||
} | |||
} | |||
@@ -182,7 +182,7 @@ public abstract class XSLFShape implements Shape<XSLFShape,XSLFTextParagraph> { | |||
if (paint != null) { | |||
setValue(paint); | |||
return true; | |||
}; | |||
} | |||
} | |||
return false; |
@@ -303,7 +303,7 @@ public class XSSFExportToXml implements Comparator<String>{ | |||
} | |||
break; | |||
default: ; | |||
default: | |||
} | |||
if (node instanceof Element) { |
@@ -59,7 +59,7 @@ public class ThemesTable extends POIXMLDocumentPart { | |||
} | |||
public final int idx; | |||
public final String name; | |||
}; | |||
} | |||
private ThemeDocument theme; | |||
@@ -44,5 +44,5 @@ public enum TextDirection { | |||
* Determines if all of the text is vertical | |||
* ("one letter on top of another"). | |||
*/ | |||
STACKED; | |||
STACKED | |||
} |
@@ -1227,7 +1227,7 @@ public class XWPFDocument extends POIXMLDocument implements Document, IBody { | |||
* @param zoomPercent A percent value denoting the zoom setting for this document. | |||
*/ | |||
public void setZoomPercent(long zoomPercent) { | |||
settings.setZoomPercent(zoomPercent);; | |||
settings.setZoomPercent(zoomPercent); | |||
} | |||
/** |
@@ -150,8 +150,6 @@ public class XWPFRun implements ISDTContents, IRunElement, CharacterRun { | |||
} | |||
} | |||
; | |||
/** | |||
* @deprecated Use {@link XWPFRun#XWPFRun(CTR, IRunBody)} | |||
*/ |
@@ -74,7 +74,6 @@ public class XWPFTable implements IBodyElement, ISDTContents { | |||
protected StringBuffer text = new StringBuffer(); | |||
protected List<XWPFTableRow> tableRows; | |||
; | |||
protected List<String> styleIDs; | |||
protected IBody part; | |||
private CTTbl ctTbl; |
@@ -68,7 +68,6 @@ public class XWPFTableCell implements IBody, ICell { | |||
protected List<XWPFTable> tables = null; | |||
protected List<IBodyElement> bodyElements = null; | |||
; | |||
protected IBody part; | |||
private XWPFTableRow tableRow = null; | |||
@@ -1319,7 +1319,7 @@ public final class TestXSSFSheet extends BaseTestSheet { | |||
@Test(timeout=180000) | |||
public void bug51585() throws IOException { | |||
XSSFTestDataSamples.openSampleWorkbook("51585.xlsx").close();; | |||
XSSFTestDataSamples.openSampleWorkbook("51585.xlsx").close(); | |||
} | |||
private XSSFWorkbook setupSheet(){ |
@@ -23,8 +23,8 @@ package org.apache.poi.hslf.blip; | |||
*/ | |||
public final class JPEG extends Bitmap { | |||
public enum ColorSpace { rgb, cymk }; | |||
public enum ColorSpace { rgb, cymk } | |||
private ColorSpace colorSpace = ColorSpace.rgb; | |||
@Override |
@@ -928,7 +928,6 @@ public final class PPGraphics2D extends Graphics2D implements Cloneable { | |||
* @see java.awt.Graphics#create | |||
*/ | |||
public void dispose() { | |||
; | |||
} | |||
/** | |||
@@ -1155,7 +1154,6 @@ public final class PPGraphics2D extends Graphics2D implements Cloneable { | |||
} | |||
public void copyArea(int x, int y, int width, int height, int dx, int dy) { | |||
; | |||
} | |||
/** |
@@ -91,8 +91,8 @@ public abstract class BitMaskTextProp extends TextProp implements Cloneable { | |||
*/ | |||
@Override | |||
public int getValue() { | |||
int val = dataValue, i = 0;; | |||
for (int mask : subPropMasks) { | |||
int val = dataValue, i = 0; | |||
for (int mask : subPropMasks) { | |||
if (!subPropMatches[i++]) { | |||
val &= ~mask; | |||
} |
@@ -86,7 +86,7 @@ public class TextPropCollection { | |||
}; | |||
public enum TextPropType { | |||
paragraph, character; | |||
paragraph, character | |||
} | |||
private int charactersCovered; |
@@ -159,7 +159,7 @@ public final class PPDrawing extends RecordAtom { | |||
final Record r1 = progBinaryTag.getChildRecords()[1]; | |||
if (!(r0 instanceof CString)) { return null; } | |||
if (!("___PPT9".equals(((CString) r0).getText()))) { return null; }; | |||
if (!("___PPT9".equals(((CString) r0).getText()))) { return null; } | |||
if (!(r1 instanceof BinaryTagDataBlob )) { return null; } | |||
final BinaryTagDataBlob blob = (BinaryTagDataBlob) r1; | |||
if (1 != blob.getChildRecords().length) { return null; } |
@@ -95,8 +95,8 @@ import org.apache.poi.util.Units; | |||
*/ | |||
public final class HSLFSlideShow implements SlideShow<HSLFShape,HSLFTextParagraph>, Closeable { | |||
enum LoadSavePhase { | |||
INIT, LOADED; | |||
} | |||
INIT, LOADED | |||
} | |||
private static ThreadLocal<LoadSavePhase> loadSavePhase = new ThreadLocal<LoadSavePhase>(); | |||
// What we're based on |
@@ -335,13 +335,13 @@ public class HwmfText { | |||
public enum HwmfTextAlignment { | |||
LEFT, | |||
RIGHT, | |||
CENTER; | |||
CENTER | |||
} | |||
public enum HwmfTextVerticalAlignment { | |||
TOP, | |||
BOTTOM, | |||
BASELINE; | |||
BASELINE | |||
} | |||
/** |
@@ -69,11 +69,11 @@ public interface OfficeDrawing | |||
* The shape is horizontally positioned at the right side of the page | |||
* element. | |||
*/ | |||
RIGHT; | |||
RIGHT | |||
} | |||
public enum HorizontalRelativeElement { | |||
CHAR, MARGIN, PAGE, TEXT; | |||
CHAR, MARGIN, PAGE, TEXT | |||
} | |||
public enum VerticalPositioning { | |||
@@ -109,11 +109,11 @@ public interface OfficeDrawing | |||
/** | |||
* The shape is vertically positioned at the top of the page element | |||
*/ | |||
TOP; | |||
TOP | |||
} | |||
public enum VerticalRelativeElement { | |||
LINE, MARGIN, PAGE, TEXT; | |||
LINE, MARGIN, PAGE, TEXT | |||
} | |||
/** |
@@ -49,7 +49,7 @@ public final class TestSheet { | |||
HSLFSlideShow ppt = new HSLFSlideShow(_slTests.openResourceAsStream(file)); | |||
doSlideShow(ppt); | |||
} catch (EncryptedPowerPointFileException e){ | |||
; //skip encrypted ppt | |||
//skip encrypted ppt | |||
} | |||
} | |||
} |
@@ -162,7 +162,6 @@ public final class TestSlideMaster { | |||
} | |||
} | |||
; | |||
for (List<HSLFTextParagraph> tparas : slide.get(1).getTextParagraphs()) { | |||
HSLFTextParagraph tpara = tparas.get(0); | |||
if (tpara.getRunType() == TextHeaderAtom.TITLE_TYPE){ |
@@ -133,7 +133,7 @@ public final class TestSlides { | |||
s2 = ppt.getSlides().get(1); | |||
assertEquals(257, s2._getSheetNumber()); | |||
assertEquals(4, s2._getSheetRefId()); | |||
s3 = ppt.getSlides().get(2);; | |||
s3 = ppt.getSlides().get(2); | |||
assertEquals(3, ppt.getSlides().size()); | |||
assertEquals(258, s3._getSheetNumber()); | |||
assertEquals(5, s3._getSheetRefId()); |
@@ -238,15 +238,13 @@ public final class TestAddingSlides extends TestCase { | |||
ppt.removeSlide(-1); | |||
fail("expected exception"); | |||
} catch (Exception e){ | |||
; | |||
} | |||
} | |||
try { | |||
ppt.removeSlide(2); | |||
fail("expected exception"); | |||
} catch (Exception e){ | |||
; | |||
} | |||
} | |||
assertEquals(1, slide1.getSlideNumber()); | |||
@@ -838,7 +838,7 @@ public final class TestBugs extends BaseTestBugzillaIssues { | |||
public void bug28774() throws Exception { | |||
HSSFWorkbook wb = openSample("28774.xls"); | |||
assertTrue("no errors reading sample xls", true); | |||
writeOutAndReadBack(wb).close();; | |||
writeOutAndReadBack(wb).close(); | |||
assertTrue("no errors writing sample xls", true); | |||
wb.close(); | |||
} |
@@ -452,8 +452,8 @@ public final class TestCellStyle extends TestCase { | |||
public Throwable getException() { | |||
return exception; | |||
} | |||
}; | |||
} | |||
public void test56563() throws Throwable { | |||
CellFormatBugExample threadA = new CellFormatBugExample("56563a.xls"); | |||
threadA.start(); |
@@ -49,8 +49,7 @@ public class TestFunctionRegistry extends TestCase { | |||
cv = fe.evaluate(cellA); | |||
fail("expectecd exception"); | |||
} catch (NotImplementedException e) { | |||
; | |||
} | |||
} | |||
FunctionEval.registerFunction("FISHER", new Function() { | |||
public ValueEval evaluate(ValueEval[] args, int srcRowIndex, int srcColumnIndex) { | |||
@@ -67,7 +66,6 @@ public class TestFunctionRegistry extends TestCase { | |||
cv = fe.evaluate(cellB); | |||
fail("expectecd exception"); | |||
} catch (NotImplementedException e) { | |||
; | |||
} | |||
AnalysisToolPak.registerFunction("CUBEMEMBERPROPERTY", new FreeRefFunction() { |