From 8f0821a687238af5be83f68fb908998cf0d2dc04 Mon Sep 17 00:00:00 2001 From: singingbush Date: Tue, 1 Oct 2024 14:37:08 +0100 Subject: [PATCH] Annotate with @Deprecated if javadoc @deprecated used --- .../org/apache/fop/afp/ioca/ImageSegment.java | 2 ++ .../org/apache/fop/afp/modca/ImageObject.java | 2 ++ .../src/main/java/org/apache/fop/apps/Fop.java | 1 + .../org/apache/fop/apps/FopFactoryBuilder.java | 1 + .../fop/configuration/DefaultConfiguration.java | 1 + .../src/main/java/org/apache/fop/fo/FONode.java | 1 + .../java/org/apache/fop/fonts/FontCache.java | 2 ++ .../main/java/org/apache/fop/fonts/Glyphs.java | 1 + .../org/apache/fop/layoutmgr/TraitSetter.java | 1 + .../fop/render/AbstractGraphics2DAdapter.java | 1 + .../org/apache/fop/render/AbstractRenderer.java | 1 + .../org/apache/fop/render/Graphics2DAdapter.java | 1 + .../fop/render/Graphics2DImagePainter.java | 1 + .../java/org/apache/fop/render/Renderer.java | 1 + .../org/apache/fop/util/ColorProfileUtil.java | 3 +++ .../org/apache/fop/util/DataURIResolver.java | 2 ++ .../java/org/apache/fop/util/DataURLUtil.java | 9 +++++---- .../src/main/java/org/apache/fop/util/QName.java | 1 + .../main/java/org/apache/fop/util/UnitConv.java | 16 ++++++++++++++++ .../org/apache/fop/util/WriterOutputStream.java | 1 + 20 files changed, 45 insertions(+), 4 deletions(-) diff --git a/fop-core/src/main/java/org/apache/fop/afp/ioca/ImageSegment.java b/fop-core/src/main/java/org/apache/fop/afp/ioca/ImageSegment.java index 68e4dd74b71..e0320f7d318 100644 --- a/fop-core/src/main/java/org/apache/fop/afp/ioca/ImageSegment.java +++ b/fop-core/src/main/java/org/apache/fop/afp/ioca/ImageSegment.java @@ -114,6 +114,7 @@ public void setIDESize(byte size) { * @param colorModel the IDE color model. * @deprecated Use {@link IDEStructureParameter#setColorModel(byte)} instead. */ + @Deprecated public void setIDEColorModel(byte colorModel) { getImageContent().setImageIDEColorModel(colorModel); } @@ -123,6 +124,7 @@ public void setIDEColorModel(byte colorModel) { * @param subtractive true for subtractive mode, false for additive mode * @deprecated Use {@link IDEStructureParameter#setSubtractive(boolean)} instead. */ + @Deprecated public void setSubtractive(boolean subtractive) { getImageContent().setSubtractive(subtractive); } diff --git a/fop-core/src/main/java/org/apache/fop/afp/modca/ImageObject.java b/fop-core/src/main/java/org/apache/fop/afp/modca/ImageObject.java index 1239b12234f..53b87f3bbc3 100644 --- a/fop-core/src/main/java/org/apache/fop/afp/modca/ImageObject.java +++ b/fop-core/src/main/java/org/apache/fop/afp/modca/ImageObject.java @@ -141,6 +141,7 @@ public void setIDESize(byte size) { * @deprecated Use {@link org.apache.fop.afp.ioca.IDEStructureParameter#setColorModel(byte)} * instead. */ + @Deprecated public void setIDEColorModel(byte colorModel) { getImageSegment().setIDEColorModel(colorModel); } @@ -151,6 +152,7 @@ public void setIDEColorModel(byte colorModel) { * @deprecated Use {@link org.apache.fop.afp.ioca.IDEStructureParameter#setSubtractive(boolean)} * instead. */ + @Deprecated public void setSubtractive(boolean subtractive) { getImageSegment().setSubtractive(subtractive); } diff --git a/fop-core/src/main/java/org/apache/fop/apps/Fop.java b/fop-core/src/main/java/org/apache/fop/apps/Fop.java index f7b1c39b1fe..3d79f9824c0 100644 --- a/fop-core/src/main/java/org/apache/fop/apps/Fop.java +++ b/fop-core/src/main/java/org/apache/fop/apps/Fop.java @@ -86,6 +86,7 @@ public class Fop { * an instance of this object, it means they also have the {@link FOUserAgent} since this's * constructor is only used in {@link FOUserAgent} */ + @Deprecated public FOUserAgent getUserAgent() { return foUserAgent; } diff --git a/fop-core/src/main/java/org/apache/fop/apps/FopFactoryBuilder.java b/fop-core/src/main/java/org/apache/fop/apps/FopFactoryBuilder.java index ebb176c03a4..ae5a73ccd28 100644 --- a/fop-core/src/main/java/org/apache/fop/apps/FopFactoryBuilder.java +++ b/fop-core/src/main/java/org/apache/fop/apps/FopFactoryBuilder.java @@ -99,6 +99,7 @@ public FopFactoryBuilder(EnvironmentProfile enviro) { * @return build the {@link FopFactoryConfig} * @deprecated Exposing the {@link FopFactoryConfig} is only to maintain backwards compatibility */ + @Deprecated public FopFactoryConfig buildConfig() { return buildConfiguration(); } diff --git a/fop-core/src/main/java/org/apache/fop/configuration/DefaultConfiguration.java b/fop-core/src/main/java/org/apache/fop/configuration/DefaultConfiguration.java index b50fd8b1717..0a728837310 100644 --- a/fop-core/src/main/java/org/apache/fop/configuration/DefaultConfiguration.java +++ b/fop-core/src/main/java/org/apache/fop/configuration/DefaultConfiguration.java @@ -54,6 +54,7 @@ public class DefaultConfiguration implements Configuration { /** * @deprecated For debug only. */ + @Deprecated public static String toString(Document document) { try { Transformer transformer = TransformerFactory.newInstance().newTransformer(); diff --git a/fop-core/src/main/java/org/apache/fop/fo/FONode.java b/fop-core/src/main/java/org/apache/fop/fo/FONode.java index c6c8cc3ce54..63b15959c7c 100644 --- a/fop-core/src/main/java/org/apache/fop/fo/FONode.java +++ b/fop-core/src/main/java/org/apache/fop/fo/FONode.java @@ -302,6 +302,7 @@ protected static void validateChildNode( * @deprecated Please override {@link #characters(char[], int, int, PropertyList, Locator)} * instead! */ + @Deprecated protected void addCharacters(char[] data, int start, int end, PropertyList pList, Locator locator) throws FOPException { diff --git a/fop-core/src/main/java/org/apache/fop/fonts/FontCache.java b/fop-core/src/main/java/org/apache/fop/fonts/FontCache.java index 76ef2230059..c440da2ae70 100644 --- a/fop-core/src/main/java/org/apache/fop/fonts/FontCache.java +++ b/fop-core/src/main/java/org/apache/fop/fonts/FontCache.java @@ -140,6 +140,7 @@ public static File getDefaultCacheFile(boolean forWriting) { * file exists or if it could not be read) * @deprecated use {@link #loadFrom(File)} instead */ + @Deprecated public static FontCache load() { return loadFrom(getDefaultCacheFile(false)); } @@ -193,6 +194,7 @@ public static FontCache loadFrom(File cacheFile) { * @throws FOPException fop exception * @deprecated use {@link #saveTo(File)} instead */ + @Deprecated public void save() throws FOPException { saveTo(getDefaultCacheFile(true)); } diff --git a/fop-core/src/main/java/org/apache/fop/fonts/Glyphs.java b/fop-core/src/main/java/org/apache/fop/fonts/Glyphs.java index 04098f59095..b4f36f5d7e6 100644 --- a/fop-core/src/main/java/org/apache/fop/fonts/Glyphs.java +++ b/fop-core/src/main/java/org/apache/fop/fonts/Glyphs.java @@ -23,6 +23,7 @@ * This class provides a number of constants for glyph management. * @deprecated Use the Glyphs class from XML Graphics Commons instead! */ +@Deprecated public final class Glyphs { private Glyphs() { diff --git a/fop-core/src/main/java/org/apache/fop/layoutmgr/TraitSetter.java b/fop-core/src/main/java/org/apache/fop/layoutmgr/TraitSetter.java index 5addad5ab2d..9142747665a 100644 --- a/fop-core/src/main/java/org/apache/fop/layoutmgr/TraitSetter.java +++ b/fop-core/src/main/java/org/apache/fop/layoutmgr/TraitSetter.java @@ -126,6 +126,7 @@ private static void addBorderTrait(Area area, * @param context Property evaluation context * @deprecated Call the other addBorders() method and addPadding separately. */ + @Deprecated public static void addBorders(Area area, CommonBorderPaddingBackground borderProps, PercentBaseContext context) { BorderProps bps = getBorderProps(borderProps, CommonBorderPaddingBackground.BEFORE, context); diff --git a/fop-core/src/main/java/org/apache/fop/render/AbstractGraphics2DAdapter.java b/fop-core/src/main/java/org/apache/fop/render/AbstractGraphics2DAdapter.java index 913a72b0d0f..e408bba0fb0 100644 --- a/fop-core/src/main/java/org/apache/fop/render/AbstractGraphics2DAdapter.java +++ b/fop-core/src/main/java/org/apache/fop/render/AbstractGraphics2DAdapter.java @@ -152,6 +152,7 @@ protected void setRenderingHintsForBufferedImage(Graphics2D g2d) { * {@inheritDoc} * @deprecated */ + @Deprecated public void paintImage(Graphics2DImagePainter painter, RendererContext context, int x, int y, int width, int height) throws IOException { diff --git a/fop-core/src/main/java/org/apache/fop/render/AbstractRenderer.java b/fop-core/src/main/java/org/apache/fop/render/AbstractRenderer.java index e8ab76d536b..2eed3826054 100644 --- a/fop-core/src/main/java/org/apache/fop/render/AbstractRenderer.java +++ b/fop-core/src/main/java/org/apache/fop/render/AbstractRenderer.java @@ -297,6 +297,7 @@ private String convertToString(List children) { * {@inheritDoc} * @deprecated */ + @Deprecated public void startPageSequence(LineArea seqTitle) { //do nothing } diff --git a/fop-core/src/main/java/org/apache/fop/render/Graphics2DAdapter.java b/fop-core/src/main/java/org/apache/fop/render/Graphics2DAdapter.java index 6c389d0ec53..fbe78b65a82 100644 --- a/fop-core/src/main/java/org/apache/fop/render/Graphics2DAdapter.java +++ b/fop-core/src/main/java/org/apache/fop/render/Graphics2DAdapter.java @@ -62,6 +62,7 @@ void paintImage(org.apache.xmlgraphics.java2d.Graphics2DImagePainter painter, * @throws IOException In case of an I/O error while writing the output format * @deprecated Use the variant with the Graphics2DImagePainter from XML Graphics Commons instead */ + @Deprecated void paintImage(Graphics2DImagePainter painter, RendererContext context, int x, int y, int width, int height) throws IOException; diff --git a/fop-core/src/main/java/org/apache/fop/render/Graphics2DImagePainter.java b/fop-core/src/main/java/org/apache/fop/render/Graphics2DImagePainter.java index e72fc1e4695..f254d85bcee 100644 --- a/fop-core/src/main/java/org/apache/fop/render/Graphics2DImagePainter.java +++ b/fop-core/src/main/java/org/apache/fop/render/Graphics2DImagePainter.java @@ -25,6 +25,7 @@ * @deprecated use {@link org.apache.xmlgraphics.java2d.Graphics2DImagePainter} directly! */ // @SuppressFBWarnings("NM_SAME_SIMPLE_NAME_AS_INTERFACE") +@Deprecated public interface Graphics2DImagePainter extends org.apache.xmlgraphics.java2d.Graphics2DImagePainter { diff --git a/fop-core/src/main/java/org/apache/fop/render/Renderer.java b/fop-core/src/main/java/org/apache/fop/render/Renderer.java index 3ff6ffb2a62..e600b271602 100644 --- a/fop-core/src/main/java/org/apache/fop/render/Renderer.java +++ b/fop-core/src/main/java/org/apache/fop/render/Renderer.java @@ -151,6 +151,7 @@ void stopRenderer() * @param seqTitle The title of the page sequence * @deprecated Use {@link #startPageSequence(PageSequence)} instead */ + @Deprecated void startPageSequence(LineArea seqTitle); /** diff --git a/fop-core/src/main/java/org/apache/fop/util/ColorProfileUtil.java b/fop-core/src/main/java/org/apache/fop/util/ColorProfileUtil.java index 9ee34d2b625..b5d48a906f3 100644 --- a/fop-core/src/main/java/org/apache/fop/util/ColorProfileUtil.java +++ b/fop-core/src/main/java/org/apache/fop/util/ColorProfileUtil.java @@ -25,6 +25,7 @@ * Helper methods for handling color profiles. * @deprecated use org.apache.xmlgraphics.java2d.color.profile.ColorProfileUtil directly */ +@Deprecated public final class ColorProfileUtil { private ColorProfileUtil() { @@ -36,6 +37,7 @@ private ColorProfileUtil() { * @return the description * @deprecated use org.apache.xmlgraphics.java2d.color.profile.ColorProfileUtil directly */ + @Deprecated public static String getICCProfileDescription(ICC_Profile profile) { return org.apache.xmlgraphics.java2d.color.profile.ColorProfileUtil .getICCProfileDescription(profile); @@ -48,6 +50,7 @@ public static String getICCProfileDescription(ICC_Profile profile) { * @return true if it is the default sRGB profile * @deprecated use org.apache.xmlgraphics.java2d.color.profile.ColorProfileUtil directly */ + @Deprecated public static boolean isDefaultsRGB(ICC_Profile profile) { return org.apache.xmlgraphics.java2d.color.profile.ColorProfileUtil .isDefaultsRGB(profile); diff --git a/fop-core/src/main/java/org/apache/fop/util/DataURIResolver.java b/fop-core/src/main/java/org/apache/fop/util/DataURIResolver.java index 19ca31b221b..0e98ab14a94 100644 --- a/fop-core/src/main/java/org/apache/fop/util/DataURIResolver.java +++ b/fop-core/src/main/java/org/apache/fop/util/DataURIResolver.java @@ -27,6 +27,7 @@ * @deprecated * @see org.apache.xmlgraphics.util.uri.DataURIResolver */ +@Deprecated public class DataURIResolver implements URIResolver { private final URIResolver newResolver = new org.apache.xmlgraphics.util.uri.DataURIResolver(); @@ -40,6 +41,7 @@ public class DataURIResolver implements URIResolver { * @see org.apache.xmlgraphics.util.uri.DataURIResolver#resolve(String, * String) */ + @Deprecated public Source resolve(String href, String base) throws TransformerException { return newResolver.resolve(href, base); } diff --git a/fop-core/src/main/java/org/apache/fop/util/DataURLUtil.java b/fop-core/src/main/java/org/apache/fop/util/DataURLUtil.java index 46ff8635b33..33e8442db5f 100644 --- a/fop-core/src/main/java/org/apache/fop/util/DataURLUtil.java +++ b/fop-core/src/main/java/org/apache/fop/util/DataURLUtil.java @@ -27,6 +27,7 @@ * @deprecated use org.apache.xmlgraphics.util.uri.DataURLUtil directly * @see org.apache.xmlgraphics.util.uri.DataURLUtil */ +@Deprecated public final class DataURLUtil { private DataURLUtil() { @@ -38,9 +39,9 @@ private DataURLUtil() { * @return a data url as a string * @throws IOException if not caught * @deprecated - * @see org.apache.xmlgraphics.util.uri.DataURLUtil#createDataURL(InputStream, - * String) + * @see org.apache.xmlgraphics.util.uri.DataURLUtil#createDataURL(InputStream, String) */ + @Deprecated public static String createDataURL(InputStream in, String mediatype) throws IOException { return org.apache.xmlgraphics.util.uri.DataURLUtil.createDataURL(in, @@ -53,9 +54,9 @@ public static String createDataURL(InputStream in, String mediatype) * @param writer a writer * @throws IOException if not caught * @deprecated - * @see org.apache.xmlgraphics.util.uri.DataURLUtil#writeDataURL(InputStream, - * String, Writer) + * @see org.apache.xmlgraphics.util.uri.DataURLUtil#writeDataURL(InputStream, String, Writer) */ + @Deprecated public static void writeDataURL(InputStream in, String mediatype, Writer writer) throws IOException { org.apache.xmlgraphics.util.uri.DataURLUtil.writeDataURL(in, mediatype, diff --git a/fop-core/src/main/java/org/apache/fop/util/QName.java b/fop-core/src/main/java/org/apache/fop/util/QName.java index dcf76a98579..d137e917ad0 100644 --- a/fop-core/src/main/java/org/apache/fop/util/QName.java +++ b/fop-core/src/main/java/org/apache/fop/util/QName.java @@ -27,6 +27,7 @@ * @deprecated Use the XML Graphics Commons variant instead! */ // @SuppressFBWarnings("NM_SAME_SIMPLE_NAME_AS_SUPERCLASS") +@Deprecated public class QName extends org.apache.xmlgraphics.util.QName { private static final long serialVersionUID = -5225376740044770690L; diff --git a/fop-core/src/main/java/org/apache/fop/util/UnitConv.java b/fop-core/src/main/java/org/apache/fop/util/UnitConv.java index b0c87ec1890..1d2f125a34c 100644 --- a/fop-core/src/main/java/org/apache/fop/util/UnitConv.java +++ b/fop-core/src/main/java/org/apache/fop/util/UnitConv.java @@ -25,6 +25,7 @@ * Utility class for unit conversions. * @deprecated use org.apache.xmlgraphics.util.UnitConv instead. */ +@Deprecated public final class UnitConv { private UnitConv() { @@ -34,18 +35,21 @@ private UnitConv() { * conversion factory from millimeters to inches. * @deprecated use org.apache.xmlgraphics.util.UnitConv.IN2MM instead. */ + @Deprecated public static final float IN2MM = org.apache.xmlgraphics.util.UnitConv.IN2MM; /** * conversion factory from centimeters to inches. * @deprecated use org.apache.xmlgraphics.util.UnitConv.IN2CM instead. */ + @Deprecated public static final float IN2CM = org.apache.xmlgraphics.util.UnitConv.IN2CM; /** * conversion factory from inches to points. * @deprecated use org.apache.xmlgraphics.util.UnitConv.IN2PT instead. */ + @Deprecated public static final int IN2PT = org.apache.xmlgraphics.util.UnitConv.IN2PT; /** @@ -54,6 +58,7 @@ private UnitConv() { * @return the value in pt * @deprecated use org.apache.xmlgraphics.util.UnitConv.mm2pt(mm) instead. */ + @Deprecated public static double mm2pt(double mm) { return org.apache.xmlgraphics.util.UnitConv.mm2pt(mm); } @@ -64,6 +69,7 @@ public static double mm2pt(double mm) { * @return the value in mpt * @deprecated use org.apache.xmlgraphics.util.UnitConv.mm2mpt(mm) instead. */ + @Deprecated public static double mm2mpt(double mm) { return org.apache.xmlgraphics.util.UnitConv.mm2mpt(mm); } @@ -74,6 +80,7 @@ public static double mm2mpt(double mm) { * @return the value in mm * @deprecated use org.apache.xmlgraphics.util.UnitConv.pt2mm(pt) instead. */ + @Deprecated public static double pt2mm(double pt) { return org.apache.xmlgraphics.util.UnitConv.pt2mm(pt); } @@ -84,6 +91,7 @@ public static double pt2mm(double pt) { * @return the value in inches * @deprecated use org.apache.xmlgraphics.util.UnitConv.pt2mm(pt) instead. */ + @Deprecated public static double mm2in(double mm) { return org.apache.xmlgraphics.util.UnitConv.mm2in(mm); } @@ -94,6 +102,7 @@ public static double mm2in(double mm) { * @return the value in mm * @deprecated use org.apache.xmlgraphics.util.UnitConv.in2mm(in) instead. */ + @Deprecated public static double in2mm(double in) { return org.apache.xmlgraphics.util.UnitConv.in2mm(in); } @@ -104,6 +113,7 @@ public static double in2mm(double in) { * @return the value in mpt * @deprecated use org.apache.xmlgraphics.util.UnitConv.in2mpt(in) instead. */ + @Deprecated public static double in2mpt(double in) { return org.apache.xmlgraphics.util.UnitConv.in2mpt(in); } @@ -114,6 +124,7 @@ public static double in2mpt(double in) { * @return the value in pt * @deprecated use org.apache.xmlgraphics.util.UnitConv.in2pt(in) instead. */ + @Deprecated public static double in2pt(double in) { return org.apache.xmlgraphics.util.UnitConv.in2pt(in); } @@ -124,6 +135,7 @@ public static double in2pt(double in) { * @return the value in inches * @deprecated use org.apache.xmlgraphics.util.UnitConv.mpt2in(mpt) instead. */ + @Deprecated public static double mpt2in(double mpt) { return org.apache.xmlgraphics.util.UnitConv.mpt2in(mpt); } @@ -135,6 +147,7 @@ public static double mpt2in(double mpt) { * @return the value in pixels * @deprecated use org.apache.xmlgraphics.util.UnitConv.mm2px(mm, resolution) instead. */ + @Deprecated public static double mm2px(double mm, int resolution) { return org.apache.xmlgraphics.util.UnitConv.mm2px(mm, resolution); } @@ -146,6 +159,7 @@ public static double mm2px(double mm, int resolution) { * @return the value in pixels * @deprecated use org.apache.xmlgraphics.util.UnitConv.mpt2px(mpt, resolution) instead. */ + @Deprecated public static double mpt2px(double mpt, int resolution) { return org.apache.xmlgraphics.util.UnitConv.mpt2px(mpt, resolution); } @@ -156,6 +170,7 @@ public static double mpt2px(double mpt, int resolution) { * @return a point-based transformation matrix * @deprecated use org.apache.xmlgraphics.util.UnitConv.mptToPt(at) instead. */ + @Deprecated public static AffineTransform mptToPt(AffineTransform at) { return org.apache.xmlgraphics.util.UnitConv.mptToPt(at); } @@ -166,6 +181,7 @@ public static AffineTransform mptToPt(AffineTransform at) { * @return a millipoint-based transformation matrix * @deprecated use org.apache.xmlgraphics.util.UnitConv.ptToMpt(at) instead. */ + @Deprecated public static AffineTransform ptToMpt(AffineTransform at) { return org.apache.xmlgraphics.util.UnitConv.ptToMpt(at); } diff --git a/fop-core/src/main/java/org/apache/fop/util/WriterOutputStream.java b/fop-core/src/main/java/org/apache/fop/util/WriterOutputStream.java index 17ec5d6588a..0d889c06e1f 100644 --- a/fop-core/src/main/java/org/apache/fop/util/WriterOutputStream.java +++ b/fop-core/src/main/java/org/apache/fop/util/WriterOutputStream.java @@ -27,6 +27,7 @@ * @deprecated use org.apache.xmlgraphics.util.WriterOutputStream instead * @see org.apache.xmlgraphics.util.WriterOutputStream */ +@Deprecated public class WriterOutputStream extends OutputStream { private final org.apache.xmlgraphics.util.WriterOutputStream writerOutputStream;