Author: kiwiwings
Date: Thu Mar 10 00:32:33 2016
New Revision: 1734339

URL: http://svn.apache.org/viewvc?rev=1734339&view=rev
Log:
sonar fixes

Modified:
    
poi/trunk/src/scratchpad/src/org/apache/poi/hslf/usermodel/HSLFFreeformShape.java
    
poi/trunk/src/scratchpad/src/org/apache/poi/hslf/usermodel/HSLFSimpleShape.java

Modified: 
poi/trunk/src/scratchpad/src/org/apache/poi/hslf/usermodel/HSLFFreeformShape.java
URL: 
http://svn.apache.org/viewvc/poi/trunk/src/scratchpad/src/org/apache/poi/hslf/usermodel/HSLFFreeformShape.java?rev=1734339&r1=1734338&r2=1734339&view=diff
==============================================================================
--- 
poi/trunk/src/scratchpad/src/org/apache/poi/hslf/usermodel/HSLFFreeformShape.java
 (original)
+++ 
poi/trunk/src/scratchpad/src/org/apache/poi/hslf/usermodel/HSLFFreeformShape.java
 Thu Mar 10 00:32:33 2016
@@ -283,10 +283,8 @@ public final class HSLFFreeformShape ext
         Iterator<byte[]> vertIter = verticesProp.iterator();
         Iterator<byte[]> segIter = segmentsProp.iterator();
         
-        byte segPushBack[] = null;
         while (vertIter.hasNext() && segIter.hasNext()) {
-            byte[] segElem = (segPushBack != null) ? segPushBack : 
segIter.next();
-            segPushBack = null;
+            byte[] segElem = segIter.next();
             PathInfo pi = getPathInfo(segElem);
             switch (pi) {
                 case escape: {

Modified: 
poi/trunk/src/scratchpad/src/org/apache/poi/hslf/usermodel/HSLFSimpleShape.java
URL: 
http://svn.apache.org/viewvc/poi/trunk/src/scratchpad/src/org/apache/poi/hslf/usermodel/HSLFSimpleShape.java?rev=1734339&r1=1734338&r2=1734339&view=diff
==============================================================================
--- 
poi/trunk/src/scratchpad/src/org/apache/poi/hslf/usermodel/HSLFSimpleShape.java 
(original)
+++ 
poi/trunk/src/scratchpad/src/org/apache/poi/hslf/usermodel/HSLFSimpleShape.java 
Thu Mar 10 00:32:33 2016
@@ -310,12 +310,13 @@ public abstract class HSLFSimpleShape ex
     public CustomGeometry getGeometry() {
         PresetGeometries dict = PresetGeometries.getInstance();
         ShapeType st = getShapeType();
-        String name = st.getOoxmlName();
+        String name = (st != null) ? st.getOoxmlName() : null;
         CustomGeometry geom = dict.get(name);
-        if(geom == null) {
-            if (name == null && st != null) name = st.toString();
+        if (geom == null) {
+            if (name == null) {
+                name = (st != null) ? st.toString() : "<unknown>";
+            }
             logger.log(POILogger.WARN, "No preset shape definition for 
shapeType: "+name);
-            return null;
         }
 
         return geom;



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to