Fix some IntelliJ warnings in XDGF area

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1823988 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Dominik Stadler 2018-02-12 15:34:11 +00:00
parent b964cffa2c
commit 1523a433e6
25 changed files with 28 additions and 89 deletions

View File

@ -27,7 +27,6 @@ import java.util.Map;
import org.apache.poi.POIXMLException;
import org.apache.poi.openxml4j.opc.PackagePart;
import org.apache.poi.openxml4j.opc.PackageRelationship;
import org.apache.poi.util.Internal;
import org.apache.poi.xdgf.exceptions.XDGFException;
import org.apache.poi.xdgf.usermodel.shape.ShapeRenderer;
@ -112,7 +111,7 @@ public class XDGFBaseContents extends XDGFXMLDocumentPart {
/**
* Draws the contents of a page onto a Graphics2D object
*
* @param graphics
* @param graphics The context to draw on.
*/
public void draw(Graphics2D graphics) {
visitShapes(new ShapeRenderer(graphics));

View File

@ -102,7 +102,7 @@ public class XDGFCell {
}
/**
* @param cell
* @param cell The type of the cell
* @return A value converted to inches
*/
public static Double parseVLength(CellType cell) {

View File

@ -47,9 +47,7 @@ public class XDGFMasterContents extends XDGFBaseContents {
try {
_pageContents = MasterContentsDocument.Factory.parse(getPackagePart().getInputStream()).getMasterContents();
} catch (XmlException e) {
throw new POIXMLException(e);
} catch (IOException e) {
} catch (XmlException | IOException e) {
throw new POIXMLException(e);
}

View File

@ -62,9 +62,7 @@ public class XDGFMasters extends XDGFXMLDocumentPart {
try {
try {
_mastersObject = MastersDocument.Factory.parse(getPackagePart().getInputStream()).getMasters();
} catch (XmlException e) {
throw new POIXMLException(e);
} catch (IOException e) {
} catch (XmlException | IOException e) {
throw new POIXMLException(e);
}

View File

@ -46,9 +46,7 @@ public class XDGFPageContents extends XDGFBaseContents {
try {
try {
_pageContents = PageContentsDocument.Factory.parse(getPackagePart().getInputStream()).getPageContents();
} catch (XmlException e) {
throw new POIXMLException(e);
} catch (IOException e) {
} catch (XmlException | IOException e) {
throw new POIXMLException(e);
}

View File

@ -61,9 +61,7 @@ public class XDGFPages extends XDGFXMLDocumentPart {
try {
try {
_pagesObject = PagesDocument.Factory.parse(getPackagePart().getInputStream()).getPages();
} catch (XmlException e) {
throw new POIXMLException(e);
} catch (IOException e) {
} catch (XmlException | IOException e) {
throw new POIXMLException(e);
}

View File

@ -127,7 +127,7 @@ public abstract class XDGFSheet {
}
public Color getFontColor() {
Color fontColor = null;
Color fontColor;
if (_character != null) {
fontColor = _character.getFontColor();
@ -143,7 +143,7 @@ public abstract class XDGFSheet {
}
public Double getFontSize() {
Double fontSize = null;
Double fontSize;
if (_character != null) {
fontSize = _character.getFontSize();

View File

@ -26,7 +26,6 @@ import java.util.List;
import org.apache.poi.POIXMLDocument;
import org.apache.poi.POIXMLDocumentPart;
import org.apache.poi.POIXMLException;
import org.apache.poi.openxml4j.exceptions.OpenXML4JException;
import org.apache.poi.openxml4j.opc.OPCPackage;
import org.apache.poi.openxml4j.opc.PackagePart;
import org.apache.poi.openxml4j.opc.PackageRelationshipTypes;
@ -67,9 +66,7 @@ public class XmlVisioDocument extends POIXMLDocument {
try {
document = VisioDocumentDocument1.Factory.parse(getPackagePart().getInputStream()).getVisioDocument();
} catch (XmlException e) {
throw new POIXMLException(e);
} catch (IOException e) {
} catch (XmlException | IOException e) {
throw new POIXMLException(e);
}
@ -84,7 +81,7 @@ public class XmlVisioDocument extends POIXMLDocument {
}
@Override
protected void onDocumentRead() throws IOException {
protected void onDocumentRead() {
// by the time this gets called, all other document parts should
// have been loaded, so it's safe to build the document structure
@ -112,7 +109,7 @@ public class XmlVisioDocument extends POIXMLDocument {
* Not currently implemented
*/
@Override
public List<PackagePart> getAllEmbedds() throws OpenXML4JException {
public List<PackagePart> getAllEmbedds() {
return new ArrayList<>();
}

View File

@ -55,9 +55,7 @@ public abstract class XDGFSection {
_sectionTypes.put("Reviewer", GenericSection.class, SectionType.class, XDGFSheet.class);
_sectionTypes.put("Annotation", GenericSection.class, SectionType.class, XDGFSheet.class);
_sectionTypes.put("ActionTag", GenericSection.class, SectionType.class, XDGFSheet.class);
} catch (NoSuchMethodException e) {
throw new POIXMLException("Internal error");
} catch (SecurityException e) {
} catch (NoSuchMethodException | SecurityException e) {
throw new POIXMLException("Internal error");
}

View File

@ -71,10 +71,7 @@ public class ArcTo implements GeometryRow {
if (deleted != null)
return deleted;
if (_master != null)
return _master.getDel();
return false;
return _master != null && _master.getDel();
}
public Double getX() {

View File

@ -82,10 +82,7 @@ public class Ellipse implements GeometryRow {
if (deleted != null)
return deleted;
if (_master != null)
return _master.getDel();
return false;
return _master != null && _master.getDel();
}
public Double getX() {

View File

@ -94,10 +94,7 @@ public class EllipticalArcTo implements GeometryRow {
if (deleted != null)
return deleted;
if (_master != null)
return _master.getDel();
return false;
return _master != null && _master.getDel();
}
public Double getX() {

View File

@ -48,9 +48,7 @@ public class GeometryRowFactory {
_rowTypes.put("RelQuadBezTo", RelQuadBezTo.class, RowType.class);
_rowTypes.put("SplineKnot", SplineKnot.class, RowType.class);
_rowTypes.put("SplineStart", SplineStart.class, RowType.class);
} catch (NoSuchMethodException e) {
throw new POIXMLException("Internal error", e);
} catch (SecurityException e) {
} catch (NoSuchMethodException | SecurityException e) {
throw new POIXMLException("Internal error", e);
}

View File

@ -80,10 +80,7 @@ public class InfiniteLine implements GeometryRow {
if (deleted != null)
return deleted;
if (_master != null)
return _master.getDel();
return false;
return _master != null && _master.getDel();
}
public Double getX() {

View File

@ -63,10 +63,7 @@ public class LineTo implements GeometryRow {
if (deleted != null)
return deleted;
if (_master != null)
return _master.getDel();
return false;
return _master != null && _master.getDel();
}
public Double getX() {

View File

@ -68,10 +68,7 @@ public class MoveTo implements GeometryRow {
if (deleted != null)
return deleted;
if (_master != null)
return _master.getDel();
return false;
return _master != null && _master.getDel();
}
public Double getX() {

View File

@ -93,10 +93,7 @@ public class NURBSTo implements GeometryRow {
if (deleted != null)
return deleted;
if (_master != null)
return _master.getDel();
return false;
return _master != null && _master.getDel();
}
public Double getX() {

View File

@ -67,10 +67,7 @@ public class PolyLineTo implements GeometryRow {
if (deleted != null)
return deleted;
if (_master != null)
return _master.getDel();
return false;
return _master != null && _master.getDel();
}
public Double getX() {

View File

@ -89,10 +89,7 @@ public class RelCubBezTo implements GeometryRow {
if (deleted != null)
return deleted;
if (_master != null)
return _master.getDel();
return false;
return _master != null && _master.getDel();
}
public Double getX() {

View File

@ -86,10 +86,7 @@ public class RelEllipticalArcTo implements GeometryRow {
if (deleted != null)
return deleted;
if (_master != null)
return _master.getDel();
return false;
return _master != null && _master.getDel();
}
public Double getX() {

View File

@ -62,10 +62,7 @@ public class RelLineTo implements GeometryRow {
if (deleted != null)
return deleted;
if (_master != null)
return _master.getDel();
return false;
return _master != null && _master.getDel();
}
public Double getX() {

View File

@ -58,10 +58,7 @@ public class RelMoveTo implements GeometryRow {
if (deleted != null)
return deleted;
if (_master != null)
return _master.getDel();
return false;
return _master != null && _master.getDel();
}
public Double getX() {

View File

@ -81,10 +81,7 @@ public class RelQuadBezTo implements GeometryRow {
if (deleted != null)
return deleted;
if (_master != null)
return _master.getDel();
return false;
return _master != null && _master.getDel();
}
public Double getX() {

View File

@ -70,10 +70,7 @@ public class SplineKnot implements GeometryRow {
if (deleted != null)
return deleted;
if (_master != null)
return _master.getDel();
return false;
return _master != null && _master.getDel();
}
public Double getX() {

View File

@ -84,10 +84,7 @@ public class SplineStart implements GeometryRow {
if (deleted != null)
return deleted;
if (_master != null)
return _master.getDel();
return false;
return _master != null && _master.getDel();
}
public Double getX() {