You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@poi.apache.org by ce...@apache.org on 2021/07/07 10:04:24 UTC

svn commit: r1891347 - in /poi/trunk: poi-ooxml/src/main/java/org/apache/poi/xslf/draw/SVGImageRenderer.java poi/src/main/java/org/apache/poi/hpsf/CustomProperties.java

Author: centic
Date: Wed Jul  7 10:04:24 2021
New Revision: 1891347

URL: http://svn.apache.org/viewvc?rev=1891347&view=rev
Log:
Apply some IDE suggestions

Modified:
    poi/trunk/poi-ooxml/src/main/java/org/apache/poi/xslf/draw/SVGImageRenderer.java
    poi/trunk/poi/src/main/java/org/apache/poi/hpsf/CustomProperties.java

Modified: poi/trunk/poi-ooxml/src/main/java/org/apache/poi/xslf/draw/SVGImageRenderer.java
URL: http://svn.apache.org/viewvc/poi/trunk/poi-ooxml/src/main/java/org/apache/poi/xslf/draw/SVGImageRenderer.java?rev=1891347&r1=1891346&r2=1891347&view=diff
==============================================================================
--- poi/trunk/poi-ooxml/src/main/java/org/apache/poi/xslf/draw/SVGImageRenderer.java (original)
+++ poi/trunk/poi-ooxml/src/main/java/org/apache/poi/xslf/draw/SVGImageRenderer.java Wed Jul  7 10:04:24 2021
@@ -99,7 +99,7 @@ public class SVGImageRenderer implements
         g2d.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING, RenderingHints.VALUE_TEXT_ANTIALIAS_ON);
         g2d.setRenderingHint(RenderingHints.KEY_STROKE_CONTROL, RenderingHints.VALUE_STROKE_PURE);
         g2d.setRenderingHint(RenderingHints.KEY_INTERPOLATION, RenderingHints.VALUE_INTERPOLATION_BILINEAR);
-        g2d.setRenderingHint(RenderingHintsKeyExt.KEY_BUFFERED_IMAGE, new WeakReference(bi));
+        g2d.setRenderingHint(RenderingHintsKeyExt.KEY_BUFFERED_IMAGE, new WeakReference<>(bi));
         Dimension2D dimSVG = getDimension();
 
         double scaleX = dim.getWidth() / dimSVG.getWidth();

Modified: poi/trunk/poi/src/main/java/org/apache/poi/hpsf/CustomProperties.java
URL: http://svn.apache.org/viewvc/poi/trunk/poi/src/main/java/org/apache/poi/hpsf/CustomProperties.java?rev=1891347&r1=1891346&r2=1891347&view=diff
==============================================================================
--- poi/trunk/poi/src/main/java/org/apache/poi/hpsf/CustomProperties.java (original)
+++ poi/trunk/poi/src/main/java/org/apache/poi/hpsf/CustomProperties.java Wed Jul  7 10:04:24 2021
@@ -73,7 +73,7 @@ public class CustomProperties implements
      * The custom properties
      */
     private final HashMap<Long,CustomProperty> props = new HashMap<>();
-    
+
     /**
      * Maps property IDs to property names and vice versa.
      */
@@ -90,10 +90,10 @@ public class CustomProperties implements
      * Puts a {@link CustomProperty} into this map. It is assumed that the
      * {@link CustomProperty} already has a valid ID. Otherwise use
      * {@link #put(CustomProperty)}.
-     * 
+     *
      * @param name the property name
      * @param cp the property
-     * 
+     *
      * @return the previous property stored under this name
      */
     public CustomProperty put(final String name, final CustomProperty cp) {
@@ -102,7 +102,7 @@ public class CustomProperties implements
             isPure = false;
             return null;
         }
-        
+
         if (!name.equals(cp.getName())) {
             throw new IllegalArgumentException("Parameter \"name\" (" + name +
                     ") and custom property's name (" + cp.getName() +
@@ -110,7 +110,7 @@ public class CustomProperties implements
         }
 
         checkCodePage(name);
-        
+
         /* Register name and ID in the dictionary. Mapping in both directions is possible. If there is already a  */
         props.remove(dictionary.getKey(name));
         dictionary.put(cp.getID(), name);
@@ -156,7 +156,7 @@ public class CustomProperties implements
         final Property p = new Property(-1, variantType, value);
         return put(new CustomProperty(p, key));
     }
-    
+
     /**
      * Gets a named value from the custom properties - only works for keys of type String
      *
@@ -196,7 +196,7 @@ public class CustomProperties implements
     public void clear() {
         props.clear();
     }
-    
+
     @Override
     public int hashCode() {
         return props.hashCode();
@@ -222,9 +222,9 @@ public class CustomProperties implements
         list.addAll(props.values());
         return Collections.unmodifiableList(list);
     }
-    
+
     /**
-     * @return the list of property values - use {@link #properties()} for the wrapped values 
+     * @return the list of property values - use {@link #properties()} for the wrapped values
      */
     @Override
     public Collection<Object> values() {
@@ -247,18 +247,17 @@ public class CustomProperties implements
     /**
      * Returns a set of all the names of our custom properties.
      * Equivalent to {@link #nameSet()}
-     * 
+     *
      * @return a set of all the names of our custom properties
      */
     @Override
-    @SuppressWarnings({ "rawtypes", "unchecked" })
-    public Set keySet() {
+    public Set<String> keySet() {
         return Collections.unmodifiableSet(dictionary.values());
     }
 
     /**
      * Returns a set of all the names of our custom properties
-     * 
+     *
      * @return a set of all the names of our custom properties
      */
     public Set<String> nameSet() {
@@ -267,7 +266,7 @@ public class CustomProperties implements
 
     /**
      * Returns a set of all the IDs of our custom properties
-     * 
+     *
      * @return a set of all the IDs of our custom properties
      */
     public Set<Long> idSet() {
@@ -313,14 +312,14 @@ public class CustomProperties implements
     }
 
     /**
-     * Checks against both the property, and its values. 
+     * Checks against both the property, and its values.
      */
     @Override
     public boolean containsValue(Object value) {
         if(value instanceof CustomProperty) {
             return props.containsValue(value);
         }
-      
+
         for(CustomProperty cp : props.values()) {
             if(cp.getValue() == value) {
                 return true;



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@poi.apache.org
For additional commands, e-mail: commits-help@poi.apache.org