aboutsummaryrefslogtreecommitdiffstats
path: root/src/java
diff options
context:
space:
mode:
authorAndreas Beeker <kiwiwings@apache.org>2020-10-24 20:24:13 +0000
committerAndreas Beeker <kiwiwings@apache.org>2020-10-24 20:24:13 +0000
commitebdd3c37d42166c1318f819b37af23eb1ebb6a2e (patch)
treee71d62fa4a14291bb43cc5414ddcfc854fd06aa6 /src/java
parent0be61931616b3f1f02972c3aa08f043332f284c8 (diff)
downloadpoi-ebdd3c37d42166c1318f819b37af23eb1ebb6a2e.tar.gz
poi-ebdd3c37d42166c1318f819b37af23eb1ebb6a2e.zip
Sonar fixes - a few "String literals should not be duplicated"
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1882819 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/java')
-rw-r--r--src/java/org/apache/poi/poifs/crypt/EncryptionInfo.java2
-rw-r--r--src/java/org/apache/poi/sl/draw/SLGraphics.java80
2 files changed, 25 insertions, 57 deletions
diff --git a/src/java/org/apache/poi/poifs/crypt/EncryptionInfo.java b/src/java/org/apache/poi/poifs/crypt/EncryptionInfo.java
index f02fb16d8c..30fc9539e3 100644
--- a/src/java/org/apache/poi/poifs/crypt/EncryptionInfo.java
+++ b/src/java/org/apache/poi/poifs/crypt/EncryptionInfo.java
@@ -102,7 +102,7 @@ public class EncryptionInfo implements GenericRecord {
* Opens for decryption
*/
public EncryptionInfo(DirectoryNode dir) throws IOException {
- this(dir.createDocumentInputStream("EncryptionInfo"), null);
+ this(dir.createDocumentInputStream(ENCRYPTION_INFO_ENTRY), null);
}
public EncryptionInfo(LittleEndianInput dis, EncryptionMode preferredEncryptionMode) throws IOException {
diff --git a/src/java/org/apache/poi/sl/draw/SLGraphics.java b/src/java/org/apache/poi/sl/draw/SLGraphics.java
index fada4c6431..dfd74444cd 100644
--- a/src/java/org/apache/poi/sl/draw/SLGraphics.java
+++ b/src/java/org/apache/poi/sl/draw/SLGraphics.java
@@ -383,9 +383,7 @@ public class SLGraphics extends Graphics2D implements Cloneable {
*/
@NotImplemented
public void clip(Shape s){
- if (LOG.check(POILogger.WARN)) {
- LOG.log(POILogger.WARN, "Not implemented");
- }
+ logNotImplemented();
}
/**
@@ -406,9 +404,7 @@ public class SLGraphics extends Graphics2D implements Cloneable {
*/
@NotImplemented
public Shape getClip(){
- if (LOG.check(POILogger.WARN)) {
- LOG.log(POILogger.WARN, "Not implemented");
- }
+ logNotImplemented();
return null;
}
@@ -675,10 +671,7 @@ public class SLGraphics extends Graphics2D implements Cloneable {
public boolean drawImage(Image img, int x, int y,
Color bgcolor,
ImageObserver observer){
- if (LOG.check(POILogger.WARN)) {
- LOG.log(POILogger.WARN, "Not implemented");
- }
-
+ logNotImplemented();
return false;
}
@@ -725,10 +718,7 @@ public class SLGraphics extends Graphics2D implements Cloneable {
int width, int height,
Color bgcolor,
ImageObserver observer){
- if (LOG.check(POILogger.WARN)) {
- LOG.log(POILogger.WARN, "Not implemented");
- }
-
+ logNotImplemented();
return false;
}
@@ -785,9 +775,7 @@ public class SLGraphics extends Graphics2D implements Cloneable {
int dx1, int dy1, int dx2, int dy2,
int sx1, int sy1, int sx2, int sy2,
ImageObserver observer){
- if (LOG.check(POILogger.WARN)) {
- LOG.log(POILogger.WARN, "Not implemented");
- }
+ logNotImplemented();
return false;
}
@@ -850,9 +838,7 @@ public class SLGraphics extends Graphics2D implements Cloneable {
int sx1, int sy1, int sx2, int sy2,
Color bgcolor,
ImageObserver observer){
- if (LOG.check(POILogger.WARN)) {
- LOG.log(POILogger.WARN, "Not implemented");
- }
+ logNotImplemented();
return false;
}
@@ -891,9 +877,7 @@ public class SLGraphics extends Graphics2D implements Cloneable {
@NotImplemented
public boolean drawImage(Image img, int x, int y,
ImageObserver observer) {
- if (LOG.check(POILogger.WARN)) {
- LOG.log(POILogger.WARN, "Not implemented");
- }
+ logNotImplemented();
return false;
}
@@ -1078,9 +1062,7 @@ public class SLGraphics extends Graphics2D implements Cloneable {
*/
@NotImplemented
public void setClip(Shape clip) {
- if (LOG.check(POILogger.WARN)) {
- LOG.log(POILogger.WARN, "Not implemented");
- }
+ logNotImplemented();
}
/**
@@ -1101,9 +1083,7 @@ public class SLGraphics extends Graphics2D implements Cloneable {
* @since JDK1.1
*/
public Rectangle getClipBounds(){
- if (LOG.check(POILogger.WARN)) {
- LOG.log(POILogger.WARN, "Not implemented");
- }
+ logNotImplemented();
return null;
}
@@ -1377,9 +1357,7 @@ public class SLGraphics extends Graphics2D implements Cloneable {
*/
@NotImplemented
public void setComposite(Composite comp){
- if (LOG.check(POILogger.WARN)) {
- LOG.log(POILogger.WARN, "Not implemented");
- }
+ logNotImplemented();
}
/**
@@ -1391,9 +1369,7 @@ public class SLGraphics extends Graphics2D implements Cloneable {
*/
@NotImplemented
public Composite getComposite(){
- if (LOG.check(POILogger.WARN)) {
- LOG.log(POILogger.WARN, "Not implemented");
- }
+ logNotImplemented();
return null;
}
@@ -1535,9 +1511,7 @@ public class SLGraphics extends Graphics2D implements Cloneable {
*/
@NotImplemented
public void drawString(AttributedCharacterIterator iterator, float x, float y) {
- if (LOG.check(POILogger.WARN)) {
- LOG.log(POILogger.WARN, "Not implemented");
- }
+ logNotImplemented();
}
/**
@@ -1642,9 +1616,7 @@ public class SLGraphics extends Graphics2D implements Cloneable {
*/
@NotImplemented
public boolean drawImage(Image img, AffineTransform xform, ImageObserver obs) {
- if (LOG.check(POILogger.WARN)) {
- LOG.log(POILogger.WARN, "Not implemented");
- }
+ logNotImplemented();
return false;
}
@@ -1688,9 +1660,7 @@ public class SLGraphics extends Graphics2D implements Cloneable {
public boolean drawImage(Image img, int x, int y,
int width, int height,
ImageObserver observer) {
- if (LOG.check(POILogger.WARN)) {
- LOG.log(POILogger.WARN, "Not implemented");
- }
+ logNotImplemented();
return false;
}
@@ -1739,9 +1709,7 @@ public class SLGraphics extends Graphics2D implements Cloneable {
*/
@NotImplemented
public void setXORMode(Color c1) {
- if (LOG.check(POILogger.WARN)) {
- LOG.log(POILogger.WARN, "Not implemented");
- }
+ logNotImplemented();
}
/**
@@ -1753,9 +1721,7 @@ public class SLGraphics extends Graphics2D implements Cloneable {
*/
@NotImplemented
public void setPaintMode() {
- if (LOG.check(POILogger.WARN)) {
- LOG.log(POILogger.WARN, "Not implemented");
- }
+ logNotImplemented();
}
/**
@@ -1791,9 +1757,7 @@ public class SLGraphics extends Graphics2D implements Cloneable {
*/
@NotImplemented
public void drawRenderedImage(RenderedImage img, AffineTransform xform) {
- if (LOG.check(POILogger.WARN)) {
- LOG.log(POILogger.WARN, "Not implemented");
- }
+ logNotImplemented();
}
/**
@@ -1819,9 +1783,7 @@ public class SLGraphics extends Graphics2D implements Cloneable {
*/
@NotImplemented
public void drawRenderableImage(RenderableImage img, AffineTransform xform) {
- if (LOG.check(POILogger.WARN)) {
- LOG.log(POILogger.WARN, "Not implemented");
- }
+ logNotImplemented();
}
protected void applyStroke(SimpleShape<?,?> shape) {
@@ -1841,4 +1803,10 @@ public class SLGraphics extends Graphics2D implements Cloneable {
shape.setFillColor((Color)_paint);
}
}
+
+ private void logNotImplemented() {
+ if (LOG.check(POILogger.WARN)) {
+ LOG.log(POILogger.WARN, "Not implemented");
+ }
+ }
}