Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
89 changes: 28 additions & 61 deletions fop-core/src/main/java/org/apache/fop/afp/Factory.java
Original file line number Diff line number Diff line change
Expand Up @@ -157,8 +157,7 @@ public Factory() {
public ImageObject createImageObject() {
String name = IMAGE_NAME_PREFIX
+ StringUtils.lpad(String.valueOf(++imageCount), '0', 5);
ImageObject imageObject = new ImageObject(this, name);
return imageObject;
return new ImageObject(this, name);
}

/**
Expand All @@ -169,8 +168,7 @@ public ImageObject createImageObject() {
public IMImageObject createIMImageObject() {
String name = IM_IMAGE_NAME_PREFIX
+ StringUtils.lpad(String.valueOf(++imImageCount), '0', 3);
IMImageObject imImageObject = new IMImageObject(name);
return imImageObject;
return new IMImageObject(name);
}

/**
Expand All @@ -181,8 +179,7 @@ public IMImageObject createIMImageObject() {
public GraphicsObject createGraphicsObject() {
String name = GRAPHIC_NAME_PREFIX
+ StringUtils.lpad(String.valueOf(++graphicCount), '0', 5);
GraphicsObject graphicsObj = new GraphicsObject(this, name);
return graphicsObj;
return new GraphicsObject(this, name);
}

/**
Expand Down Expand Up @@ -323,9 +320,8 @@ public Overlay createOverlay(int width, int height,
int widthRes, int heightRes, int overlayRotation) {
String overlayName = OVERLAY_NAME_PREFIX
+ StringUtils.lpad(String.valueOf(++overlayCount), '0', 5);
Overlay overlay = new Overlay(this, overlayName, width, height,
return new Overlay(this, overlayName, width, height,
overlayRotation, widthRes, heightRes);
return overlay;
}

/**
Expand All @@ -336,8 +332,7 @@ public Overlay createOverlay(int width, int height,
public Document createDocument() {
String documentName = DOCUMENT_NAME_PREFIX
+ StringUtils.lpad(String.valueOf(++documentCount), '0', 5);
Document document = new Document(this, documentName);
return document;
return new Document(this, documentName);
}

/**
Expand All @@ -346,8 +341,7 @@ public Document createDocument() {
* @return a new {@link MapCodedFont}
*/
public MapCodedFont createMapCodedFont() {
MapCodedFont mapCodedFont = new MapCodedFont();
return mapCodedFont;
return new MapCodedFont();
}

/**
Expand All @@ -360,8 +354,7 @@ public MapCodedFont createMapCodedFont() {
* @return a new {@link IncludePageSegment}
*/
public IncludePageSegment createIncludePageSegment(String name, int x, int y) {
IncludePageSegment includePageSegment = new IncludePageSegment(name, x, y);
return includePageSegment;
return new IncludePageSegment(name, x, y);
}

/**
Expand All @@ -371,8 +364,7 @@ public IncludePageSegment createIncludePageSegment(String name, int x, int y) {
* @return a new {@link IncludeObject}
*/
public IncludeObject createInclude(String name) {
IncludeObject includeObject = new IncludeObject(name);
return includeObject;
return new IncludeObject(name);
}

/**
Expand All @@ -382,8 +374,7 @@ public IncludeObject createInclude(String name) {
* @return a new {@link TagLogicalElement}
*/
public TagLogicalElement createTagLogicalElement(TagLogicalElement.State state) {
TagLogicalElement tle = new TagLogicalElement(state);
return tle;
return new TagLogicalElement(state);
}

/**
Expand All @@ -394,8 +385,7 @@ public TagLogicalElement createTagLogicalElement(TagLogicalElement.State state)
* @return a new {@link DataStream}
*/
public DataStream createDataStream(AFPPaintingState paintingState, OutputStream outputStream) {
DataStream dataStream = new DataStream(this, paintingState, outputStream);
return dataStream;
return new DataStream(this, paintingState, outputStream);
}

/**
Expand All @@ -408,8 +398,7 @@ public DataStream createDataStream(AFPPaintingState paintingState, OutputStream
* @return a new {@link PageDescriptor}
*/
public PageDescriptor createPageDescriptor(int width, int height, int widthRes, int heightRes) {
PageDescriptor pageDescriptor = new PageDescriptor(width, height, widthRes, heightRes);
return pageDescriptor;
return new PageDescriptor(width, height, widthRes, heightRes);
}

/**
Expand All @@ -420,8 +409,7 @@ public PageDescriptor createPageDescriptor(int width, int height, int widthRes,
public ObjectEnvironmentGroup createObjectEnvironmentGroup() {
String oegName = OBJECT_ENVIRONMENT_GROUP_NAME_PREFIX
+ StringUtils.lpad(String.valueOf(++objectEnvironmentGroupCount), '0', 5);
ObjectEnvironmentGroup objectEnvironmentGroup = new ObjectEnvironmentGroup(oegName);
return objectEnvironmentGroup;
return new ObjectEnvironmentGroup(oegName);
}

/**
Expand All @@ -430,8 +418,7 @@ public ObjectEnvironmentGroup createObjectEnvironmentGroup() {
* @return a new {@link GraphicsData}
*/
public GraphicsData createGraphicsData() {
GraphicsData graphicsData = new GraphicsData();
return graphicsData;
return new GraphicsData();
}

/**
Expand All @@ -445,9 +432,7 @@ public GraphicsData createGraphicsData() {
*/
public ObjectAreaDescriptor createObjectAreaDescriptor(
int width, int height, int widthRes, int heightRes) {
ObjectAreaDescriptor objectAreaDescriptor
= new ObjectAreaDescriptor(width, height, widthRes, heightRes);
return objectAreaDescriptor;
return new ObjectAreaDescriptor(width, height, widthRes, heightRes);
}

/**
Expand All @@ -460,9 +445,8 @@ public ObjectAreaDescriptor createObjectAreaDescriptor(
*/
public ObjectAreaPosition createObjectAreaPosition(int x, int y,
int rotation) {
ObjectAreaPosition objectAreaPosition = new ObjectAreaPosition(
return new ObjectAreaPosition(
x, y, rotation);
return objectAreaPosition;
}

/**
Expand All @@ -476,9 +460,8 @@ public ObjectAreaPosition createObjectAreaPosition(int x, int y,
*/
public ImageDataDescriptor createImageDataDescriptor(
int width, int height, int widthRes, int heightRes) {
ImageDataDescriptor imageDataDescriptor = new ImageDataDescriptor(
return new ImageDataDescriptor(
width, height, widthRes, heightRes);
return imageDataDescriptor;
}

/**
Expand All @@ -494,9 +477,8 @@ public ImageDataDescriptor createImageDataDescriptor(
*/
public GraphicsDataDescriptor createGraphicsDataDescriptor(
int xlwind, int xrwind, int ybwind, int ytwind, int widthRes, int heightRes) {
GraphicsDataDescriptor graphicsDataDescriptor = new GraphicsDataDescriptor(
return new GraphicsDataDescriptor(
xlwind, xrwind, ybwind, ytwind, widthRes, heightRes);
return graphicsDataDescriptor;
}

/**
Expand All @@ -510,9 +492,7 @@ public GraphicsDataDescriptor createGraphicsDataDescriptor(
*/
public ContainerDataDescriptor createContainerDataDescriptor(
int dataWidth, int dataHeight, int widthRes, int heightRes) {
ContainerDataDescriptor containerDataDescriptor
= new ContainerDataDescriptor(dataWidth, dataHeight, widthRes, heightRes);
return containerDataDescriptor;
return new ContainerDataDescriptor(dataWidth, dataHeight, widthRes, heightRes);
}

/**
Expand All @@ -522,8 +502,7 @@ public ContainerDataDescriptor createContainerDataDescriptor(
* @return a new {@link MapContainerData}
*/
public MapContainerData createMapContainerData(byte optionValue) {
MapContainerData mapContainerData = new MapContainerData(optionValue);
return mapContainerData;
return new MapContainerData(optionValue);
}

/**
Expand All @@ -532,8 +511,7 @@ public MapContainerData createMapContainerData(byte optionValue) {
* @return a new {@link MapDataResource}
*/
public MapDataResource createMapDataResource() {
MapDataResource mapDataResource = new MapDataResource();
return mapDataResource;
return new MapDataResource();
}

/**
Expand All @@ -546,10 +524,8 @@ public MapDataResource createMapDataResource() {
*/
public PresentationTextDescriptor createPresentationTextDataDescriptor(
int width, int height, int widthRes, int heightRes) {
PresentationTextDescriptor presentationTextDescriptor
= new PresentationTextDescriptor(width, height,
return new PresentationTextDescriptor(width, height,
widthRes, heightRes);
return presentationTextDescriptor;
}

/**
Expand All @@ -558,9 +534,7 @@ public PresentationTextDescriptor createPresentationTextDataDescriptor(
* @return a new {@link PresentationEnvironmentControl}
*/
public PresentationEnvironmentControl createPresentationEnvironmentControl() {
PresentationEnvironmentControl presentationEnvironmentControl
= new PresentationEnvironmentControl();
return presentationEnvironmentControl;
return new PresentationEnvironmentControl();
}

/**
Expand All @@ -570,8 +544,7 @@ public PresentationEnvironmentControl createPresentationEnvironmentControl() {
* @return a new {@link InvokeMediumMap}
*/
public InvokeMediumMap createInvokeMediumMap(String name) {
InvokeMediumMap invokeMediumMap = new InvokeMediumMap(name);
return invokeMediumMap;
return new InvokeMediumMap(name);
}

/**
Expand All @@ -580,8 +553,7 @@ public InvokeMediumMap createInvokeMediumMap(String name) {
* @return a new {@link ResourceEnvironmentGroup}
*/
public ResourceEnvironmentGroup createResourceEnvironmentGroup() {
ResourceEnvironmentGroup resourceEnvironmentGroup = new ResourceEnvironmentGroup();
return resourceEnvironmentGroup;
return new ResourceEnvironmentGroup();
}

/**
Expand All @@ -592,8 +564,7 @@ public ResourceEnvironmentGroup createResourceEnvironmentGroup() {
public ImageSegment createImageSegment() {
String name = IMAGE_SEGMENT_NAME_PREFIX
+ StringUtils.lpad(String.valueOf(++imageSegmentCount), '0', 2);
ImageSegment imageSegment = new ImageSegment(this, name);
return imageSegment;
return new ImageSegment(this, name);
}

/**
Expand All @@ -602,8 +573,7 @@ public ImageSegment createImageSegment() {
* @return an {@link ImageContent}
*/
public ImageContent createImageContent() {
ImageContent imageContent = new ImageContent();
return imageContent;
return new ImageContent();
}

/**
Expand All @@ -613,8 +583,7 @@ public ImageContent createImageContent() {
* @return a new {@link ImageRasterData}
*/
public ImageRasterData createImageRasterData(byte[] rasterData) {
ImageRasterData imageRasterData = new ImageRasterData(rasterData);
return imageRasterData;
return new ImageRasterData(rasterData);
}

/**
Expand All @@ -628,9 +597,7 @@ public ImageRasterData createImageRasterData(byte[] rasterData) {
*/
public ImageSizeParameter createImageSizeParameter(int hsize, int vsize,
int hresol, int vresol) {
ImageSizeParameter imageSizeParameter
= new ImageSizeParameter(hsize, vsize, hresol, vresol);
return imageSizeParameter;
return new ImageSizeParameter(hsize, vsize, hresol, vresol);
}

public TileTOC createTileTOC() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -662,8 +662,7 @@ public FontDescriptor(byte[] data) {
}

public int getNominalFontSizeInMillipoints() {
int nominalFontSize = 100 * getUBIN(data, 39);
return nominalFontSize;
return 100 * getUBIN(data, 39);
}
}

Expand Down
3 changes: 1 addition & 2 deletions fop-core/src/main/java/org/apache/fop/apps/FopFactory.java
Original file line number Diff line number Diff line change
Expand Up @@ -193,8 +193,7 @@ public Object run() {
* @return the newly created FOUserAgent instance initialized with default values
*/
public FOUserAgent newFOUserAgent() {
FOUserAgent userAgent = new FOUserAgent(this, resolver);
return userAgent;
return new FOUserAgent(this, resolver);
}

boolean isComplexScriptFeaturesEnabled() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,8 +135,7 @@ public static URI cleanURI(String uriStr) throws URISyntaxException {
fixedUri = fixedUri.replace(" ", "%20");
fixedUri = fixedUri.replace("{", "%7B");
fixedUri = fixedUri.replace("}", "%7D");
URI baseURI = new URI(fixedUri);
return baseURI;
return new URI(fixedUri);
}

/**
Expand Down
3 changes: 1 addition & 2 deletions fop-core/src/main/java/org/apache/fop/cli/InputHandler.java
Original file line number Diff line number Diff line change
Expand Up @@ -253,8 +253,7 @@ private XMLReader getXMLReader() throws ParserConfigurationException, SAXExcepti
spf.setFeature("http://xml.org/sax/features/namespaces", true);
spf.setFeature("http://apache.org/xml/features/xinclude", true);
spf.setFeature("http://apache.org/xml/features/disallow-doctype-decl", true);
XMLReader xr = spf.newSAXParser().getXMLReader();
return xr;
return spf.newSAXParser().getXMLReader();
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -167,8 +167,7 @@ public int[] getAdjustment(int offset) throws IndexOutOfBoundsException {
public boolean apply(GlyphPositioningSubtable st) {
assert st != null;
updateSubtableState(st);
boolean applied = st.position(this);
return applied;
return st.position(this);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -189,8 +189,7 @@ public GlyphSequence getOutput() {
public boolean apply(GlyphSubstitutionSubtable st) {
assert st != null;
updateSubtableState(st);
boolean applied = st.substitute(this);
return applied;
return st.substitute(this);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -350,8 +350,7 @@ private GlyphSequence reorder(GlyphSequence gs, int source, int target) {
/** {@inheritDoc} */
@Override
public boolean position(GlyphSequence gs, String script, String language, int fontSize, GlyphTable.UseSpec[] usa, int[] widths, int[][] adjustments, ScriptContextTester sct) {
boolean adjusted = super.position(gs, script, language, fontSize, usa, widths, adjustments, sct);
return adjusted;
return super.position(gs, script, language, fontSize, usa, widths, adjustments, sct);
}

/** Abstract syllabizer. */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,7 @@ public class UnsupportedOperationExceptionFactory implements ExceptionFactory {
/** {@inheritDoc} */
public Throwable createException(Event event) {
String msg = EventFormatter.format(event, Locale.ENGLISH);
UnsupportedOperationException ex = new UnsupportedOperationException(msg);
return ex;
return new UnsupportedOperationException(msg);
}

/** {@inheritDoc} */
Expand Down
3 changes: 1 addition & 2 deletions fop-core/src/main/java/org/apache/fop/fo/PropertyList.java
Original file line number Diff line number Diff line change
Expand Up @@ -686,8 +686,7 @@ public CommonMarginInline getMarginInlineProps() throws PropertyException {
* @throws PropertyException if there's a problem while processing the properties
*/
public CommonAural getAuralProps() throws PropertyException {
CommonAural props = new CommonAural(this);
return props;
return new CommonAural(this);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -273,9 +273,8 @@ public SimplePageMaster getLastSimplePageMaster(boolean isOddPage, boolean isFir
}
}

SimplePageMaster pageMaster = currentSubSequence.getLastPageMaster(isOddPage, isFirstPage, isBlank,
return currentSubSequence.getLastPageMaster(isOddPage, isFirstPage, isBlank,
blockLevelEventProducer);
return pageMaster;
}

}
Expand Down
Loading