aboutsummaryrefslogtreecommitdiffstats
path: root/poi/src
diff options
context:
space:
mode:
authorAndreas Beeker <kiwiwings@apache.org>2021-10-18 17:40:47 +0000
committerAndreas Beeker <kiwiwings@apache.org>2021-10-18 17:40:47 +0000
commit611f5273fdc6a2105a3239fc337b6500af6026ba (patch)
treea39407d3011cf4fdac1ff6da8a718bb0fbdb03e4 /poi/src
parent787af858e72b0c60ea8b89d47fed230c5582fb62 (diff)
downloadpoi-611f5273fdc6a2105a3239fc337b6500af6026ba.tar.gz
poi-611f5273fdc6a2105a3239fc337b6500af6026ba.zip
sonar fixes
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1894360 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'poi/src')
-rw-r--r--poi/src/main/java/org/apache/poi/sl/usermodel/Sheet.java1
-rw-r--r--poi/src/main/java/org/apache/poi/sl/usermodel/Slide.java7
-rw-r--r--poi/src/main/java/org/apache/poi/sl/usermodel/SlideShow.java11
-rw-r--r--poi/src/main/java/org/apache/poi/sl/usermodel/SlideShowFactory.java1
-rw-r--r--poi/src/main/java/org/apache/poi/sl/usermodel/TextParagraph.java1
-rw-r--r--poi/src/main/java/org/apache/poi/sl/usermodel/TextRun.java40
-rw-r--r--poi/src/main/java/org/apache/poi/util/GenericRecordUtil.java1
-rw-r--r--poi/src/main/java/org/apache/poi/util/GenericRecordXmlWriter.java1
8 files changed, 35 insertions, 28 deletions
diff --git a/poi/src/main/java/org/apache/poi/sl/usermodel/Sheet.java b/poi/src/main/java/org/apache/poi/sl/usermodel/Sheet.java
index ab187cbc5d..8be7ee46d5 100644
--- a/poi/src/main/java/org/apache/poi/sl/usermodel/Sheet.java
+++ b/poi/src/main/java/org/apache/poi/sl/usermodel/Sheet.java
@@ -23,6 +23,7 @@ import java.awt.Graphics2D;
/**
* Common parent of Slides, Notes and Masters
*/
+@SuppressWarnings("java:S1452")
public interface Sheet<
S extends Shape<S,P>,
P extends TextParagraph<S,P,? extends TextRun>
diff --git a/poi/src/main/java/org/apache/poi/sl/usermodel/Slide.java b/poi/src/main/java/org/apache/poi/sl/usermodel/Slide.java
index 7c0d566138..ade5b08ed6 100644
--- a/poi/src/main/java/org/apache/poi/sl/usermodel/Slide.java
+++ b/poi/src/main/java/org/apache/poi/sl/usermodel/Slide.java
@@ -58,17 +58,17 @@ public interface Slide<
boolean getDisplayPlaceholder(Placeholder placeholder);
/**
- * Sets the slide visibility
+ * Sets the slide visibility
*
* @param hidden slide visibility, if {@code true} the slide is hidden, {@code false} shows the slide
- *
+ *
* @since POI 4.0.0
*/
void setHidden(boolean hidden);
/**
* @return the slide visibility, the slide is hidden when {@code true} - or shown when {@code false}
- *
+ *
* @since POI 4.0.0
*/
boolean isHidden();
@@ -76,6 +76,7 @@ public interface Slide<
/**
* @return the comment(s) for this slide
*/
+ @SuppressWarnings("java:S1452")
List<? extends Comment> getComments();
/**
diff --git a/poi/src/main/java/org/apache/poi/sl/usermodel/SlideShow.java b/poi/src/main/java/org/apache/poi/sl/usermodel/SlideShow.java
index eaca055dfe..1ad08c2c88 100644
--- a/poi/src/main/java/org/apache/poi/sl/usermodel/SlideShow.java
+++ b/poi/src/main/java/org/apache/poi/sl/usermodel/SlideShow.java
@@ -29,6 +29,7 @@ import org.apache.poi.common.usermodel.fonts.FontInfo;
import org.apache.poi.extractor.POITextExtractor;
import org.apache.poi.sl.usermodel.PictureData.PictureType;
+@SuppressWarnings("java:S1452")
public interface SlideShow<
S extends Shape<S,P>,
P extends TextParagraph<S,P,? extends TextRun>
@@ -58,10 +59,10 @@ public interface SlideShow<
* @param pgsize page size (in points)
*/
void setPageSize(Dimension pgsize);
-
+
/**
* Returns all Pictures of this slideshow.
- * The returned {@link List} is unmodifiable.
+ * The returned {@link List} is unmodifiable.
* @return a {@link List} of {@link PictureData}.
*/
List<? extends PictureData> getPictureData();
@@ -97,10 +98,10 @@ public interface SlideShow<
* @since 3.15 beta 1
*/
PictureData addPicture(File pict, PictureType format) throws IOException;
-
+
/**
* check if a picture with this picture data already exists in this presentation
- *
+ *
* @param pictureData The picture data to find in the SlideShow
* @return {@code null} if picture data is not found in this slideshow
* @since 3.15 beta 3
@@ -121,7 +122,7 @@ public interface SlideShow<
/**
* @return an extractor for the slideshow metadata
- *
+ *
* @since POI 4.0.0
*/
POITextExtractor getMetadataTextExtractor();
diff --git a/poi/src/main/java/org/apache/poi/sl/usermodel/SlideShowFactory.java b/poi/src/main/java/org/apache/poi/sl/usermodel/SlideShowFactory.java
index 465c6f978b..cb4c81ca77 100644
--- a/poi/src/main/java/org/apache/poi/sl/usermodel/SlideShowFactory.java
+++ b/poi/src/main/java/org/apache/poi/sl/usermodel/SlideShowFactory.java
@@ -35,6 +35,7 @@ import org.apache.poi.poifs.filesystem.DirectoryNode;
import org.apache.poi.poifs.filesystem.FileMagic;
import org.apache.poi.poifs.filesystem.POIFSFileSystem;
+@SuppressWarnings("java:S1452")
public final class SlideShowFactory {
private static class Singleton {
diff --git a/poi/src/main/java/org/apache/poi/sl/usermodel/TextParagraph.java b/poi/src/main/java/org/apache/poi/sl/usermodel/TextParagraph.java
index a6c4394278..c0d0c3be3a 100644
--- a/poi/src/main/java/org/apache/poi/sl/usermodel/TextParagraph.java
+++ b/poi/src/main/java/org/apache/poi/sl/usermodel/TextParagraph.java
@@ -384,6 +384,7 @@ public interface TextParagraph<
*
* @since POI 4.0.0
*/
+ @SuppressWarnings("java:S1452")
List<? extends TabStop> getTabStops();
/**
diff --git a/poi/src/main/java/org/apache/poi/sl/usermodel/TextRun.java b/poi/src/main/java/org/apache/poi/sl/usermodel/TextRun.java
index 7dfd4933d8..11bc79c8ec 100644
--- a/poi/src/main/java/org/apache/poi/sl/usermodel/TextRun.java
+++ b/poi/src/main/java/org/apache/poi/sl/usermodel/TextRun.java
@@ -27,7 +27,7 @@ import org.apache.poi.util.Internal;
/**
* Some text.
*/
-@SuppressWarnings("unused")
+@SuppressWarnings({"unused","java:S1452"})
public interface TextRun {
/**
* Type of text capitals
@@ -37,7 +37,7 @@ public interface TextRun {
SMALL,
ALL
}
-
+
/**
* Type of placeholder fields
*/
@@ -96,18 +96,18 @@ public interface TextRun {
void setFontSize(Double fontSize);
/**
- * Get the font family - convenience method for {@link #getFontInfo(FontGroup)}
- *
+ * Get the font family - convenience method for {@link #getFontInfo(FontGroup)}
+ *
* @return font family or null if not set
*/
String getFontFamily();
/**
* Get the font family - convenience method for {@link #getFontInfo(FontGroup)}
- *
+ *
* @param fontGroup the font group, i.e. the range of glpyhs to be covered.
- * if {@code null}, the font group matching the first character will be returned
- *
+ * if {@code null}, the font group matching the first character will be returned
+ *
* @return font family or null if not set
*/
String getFontFamily(FontGroup fontGroup);
@@ -128,17 +128,17 @@ public interface TextRun {
* @param typeface the font to apply to this text run.
* The value of {@code null} removes the run specific font setting, so the default setting is activated again.
* @param fontGroup the font group, i.e. the range of glpyhs to be covered.
- * if {@code null}, the font group matching the first character will be returned
+ * if {@code null}, the font group matching the first character will be returned
*/
void setFontFamily(String typeface, FontGroup fontGroup);
/**
* Get the font info for the given font group
- *
+ *
* @param fontGroup the font group, i.e. the range of glpyhs to be covered.
- * if {@code null}, the font group matching the first character will be returned
+ * if {@code null}, the font group matching the first character will be returned
* @return font info or {@code null} if not set
- *
+ *
* @since POI 3.17-beta2
*/
FontInfo getFontInfo(FontGroup fontGroup);
@@ -149,11 +149,11 @@ public interface TextRun {
* @param fontInfo the font to apply to this text run.
* The value of {@code null} removes the run specific font setting, so the default setting is activated again.
* @param fontGroup the font group, i.e. the range of glpyhs to be covered. defaults to latin, if {@code null}.
- *
+ *
* @since POI 3.17-beta2
*/
void setFontInfo(FontInfo fontInfo, FontGroup fontGroup);
-
+
/**
* @return true, if text is bold
*/
@@ -165,7 +165,7 @@ public interface TextRun {
* @param bold set to true for bold text, false for normal weight
*/
void setBold(boolean bold);
-
+
/**
* @return true, if text is italic
*/
@@ -219,24 +219,24 @@ public interface TextRun {
/**
* Return the associated hyperlink
- *
+ *
* @return the associated hyperlink or null if no hyperlink was set
- *
+ *
* @since POI 3.14-Beta2
*/
Hyperlink<?,?> getHyperlink();
-
-
+
+
/**
* Creates a new hyperlink and assigns it to this text run.
* If the text run has already a hyperlink assigned, return it instead
*
* @return the associated hyperlink
- *
+ *
* @since POI 3.14-Beta2
*/
Hyperlink<?,?> createHyperlink();
-
+
/**
* Experimental method to determine the field type, e.g. slide number
*
diff --git a/poi/src/main/java/org/apache/poi/util/GenericRecordUtil.java b/poi/src/main/java/org/apache/poi/util/GenericRecordUtil.java
index f788ec8667..a341b060c3 100644
--- a/poi/src/main/java/org/apache/poi/util/GenericRecordUtil.java
+++ b/poi/src/main/java/org/apache/poi/util/GenericRecordUtil.java
@@ -26,6 +26,7 @@ import java.util.Map;
import java.util.function.Supplier;
import java.util.stream.Collectors;
+@SuppressWarnings("java:S1452")
@Internal
public final class GenericRecordUtil {
private GenericRecordUtil() {}
diff --git a/poi/src/main/java/org/apache/poi/util/GenericRecordXmlWriter.java b/poi/src/main/java/org/apache/poi/util/GenericRecordXmlWriter.java
index a90f9c94fb..793c1e845f 100644
--- a/poi/src/main/java/org/apache/poi/util/GenericRecordXmlWriter.java
+++ b/poi/src/main/java/org/apache/poi/util/GenericRecordXmlWriter.java
@@ -234,6 +234,7 @@ public class GenericRecordXmlWriter implements Closeable {
printObject("error", errorMsg);
}
+ @SuppressWarnings("java:S1452")
protected Stream<Map.Entry<String,Supplier<?>>> writeProp(Map.Entry<String,Supplier<?>> me) {
Object obj = me.getValue().get();
if (obj == null) {