Browse Source

Enabled LineLength check and fixed corresponding issues


git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@1547372 13f79535-47bb-0310-9956-ffa450edef68
tags/fop-2_0
Vincent Hennebert 10 years ago
parent
commit
9df34113b5

+ 6
- 0
checkstyle-5.5.xml View File

@@ -50,6 +50,12 @@
<!-- ===================================================================================================== -->
<module name="TreeWalker">

<!-- ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... -->
<module name="LineLength">
<property name="max" value="120"/>
</module>
<!-- ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... -->

<!-- ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... -->
<module name="AnnotationUseStyle"/>
<!-- ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... -->

+ 2
- 0
src/java/org/apache/fop/complexscripts/util/CharScript.java View File

@@ -35,6 +35,8 @@ import org.apache.fop.util.CharUtilities;
*/
public final class CharScript {

// CSOFF: LineLength

//
// The following script codes are based on ISO 15924. Codes less than 1000 are
// official assignments from 15924; those equal to or greater than 1000 are FOP

+ 2
- 1
src/java/org/apache/fop/fo/expr/FunctionBase.java View File

@@ -36,7 +36,8 @@ public abstract class FunctionBase implements Function {
/** {@inheritDoc} */
public Property getOptionalArgDefault(int index, PropertyInfo pi) throws PropertyException {
if (index >= getOptionalArgsCount()) {
PropertyException e = new PropertyException(new IndexOutOfBoundsException("illegal optional argument index"));
PropertyException e = new PropertyException(
new IndexOutOfBoundsException("illegal optional argument index"));
e.setPropertyInfo(pi);
throw e;
} else {

+ 2
- 1
src/java/org/apache/fop/fo/expr/PropertyParser.java View File

@@ -385,7 +385,8 @@ public final class PropertyParser extends PropertyTokenizer {
}
int numArgs = args.size();
if (numArgs < numReq) {
throw new PropertyException("Expected " + numReq + " required arguments, but only " + numArgs + " specified");
throw new PropertyException("Expected " + numReq + " required arguments, but only "
+ numArgs + " specified");
} else {
for (int i = 0; i < numOpt; i++) {
if (args.size() < (numReq + i + 1)) {

+ 2
- 1
src/java/org/apache/fop/fonts/FontTriplet.java View File

@@ -27,7 +27,8 @@ import java.io.Serializable;
*/
public class FontTriplet implements Comparable<FontTriplet>, Serializable {

public static final FontTriplet DEFAULT_FONT_TRIPLET = new FontTriplet("any", Font.STYLE_NORMAL, Font.WEIGHT_NORMAL);
public static final FontTriplet DEFAULT_FONT_TRIPLET
= new FontTriplet("any", Font.STYLE_NORMAL, Font.WEIGHT_NORMAL);

/** serial version UID */
private static final long serialVersionUID = 1168991106658033508L;

+ 2
- 1
src/java/org/apache/fop/fonts/truetype/OTFSubSetFile.java View File

@@ -451,7 +451,8 @@ public class OTFSubSetFile extends OTFFile {
localUniques = foundLocalUniquesB.get(subsetFDSelect.get(subsetGlyphs.get(gid)).getNewFDIndex());
byte[] data = charStringsIndex.getValue(gid);
subsetLocalIndexSubr = fdSubrs.get(subsetFDSelect.get(subsetGlyphs.get(gid)).getNewFDIndex());
subsetLocalSubrCount = foundLocalUniques.get(subsetFDSelect.get(subsetGlyphs.get(gid)).getNewFDIndex()).size();
subsetLocalSubrCount = foundLocalUniques.get(
subsetFDSelect.get(subsetGlyphs.get(gid)).getNewFDIndex()).size();
data = readCharStringData(data, subsetLocalSubrCount);
subsetCharStringsIndex.add(data);
}

+ 2
- 2
src/java/org/apache/fop/render/afp/AFPFontConfig.java View File

@@ -316,8 +316,8 @@ public final class AFPFontConfig implements FontConfig {

private final String characterset;

private CIDKeyedFontConfig(List<FontTriplet> triplets, String type, String codePage,
String encoding, String characterset, String name, CharacterSetType charsetType, boolean embeddable, String uri) {
private CIDKeyedFontConfig(List<FontTriplet> triplets, String type, String codePage, String encoding,
String characterset, String name, CharacterSetType charsetType, boolean embeddable, String uri) {
super(triplets, type, codePage, encoding, name, embeddable, uri);
this.characterset = characterset;
this.charsetType = charsetType;

+ 2
- 1
src/java/org/apache/fop/render/afp/AFPRendererConfig.java View File

@@ -103,7 +103,8 @@ public final class AFPRendererConfig implements RendererConfig {
}
}

private final EnumMap<AFPRendererOption, Object> params = new EnumMap<AFPRendererOption, Object>(AFPRendererOption.class);
private final EnumMap<AFPRendererOption, Object> params
= new EnumMap<AFPRendererOption, Object>(AFPRendererOption.class);

private final EnumMap<ImagesModeOptions, Object> imageModeParams
= new EnumMap<ImagesModeOptions, Object>(ImagesModeOptions.class);

+ 2
- 1
src/java/org/apache/fop/render/pdf/PDFRenderingUtil.java View File

@@ -463,7 +463,8 @@ class PDFRenderingUtil {
private PDFDictionary augmentDictionary(PDFDictionary dictionary, PDFDictionaryExtension extension) {
for (PDFCollectionEntryExtension entry : extension.getEntries()) {
if (entry instanceof PDFDictionaryExtension) {
dictionary.put(entry.getKey(), augmentDictionary(new PDFDictionary(dictionary), (PDFDictionaryExtension) entry));
dictionary.put(entry.getKey(),
augmentDictionary(new PDFDictionary(dictionary), (PDFDictionaryExtension) entry));
} else if (entry instanceof PDFArrayExtension) {
dictionary.put(entry.getKey(), augmentArray(new PDFArray(dictionary), (PDFArrayExtension) entry));
} else {

+ 6
- 3
src/java/org/apache/fop/render/ps/svg/PSSVGGraphics2D.java View File

@@ -119,7 +119,8 @@ public class PSSVGGraphics2D extends PSGraphics2D implements GradientRegistrar {
List<Double> theCoords = new java.util.ArrayList<Double>();


AffineTransform start = applyTransform(lgp.getTransform(), lgp.getStartPoint().getX(), lgp.getStartPoint().getY());
AffineTransform start = applyTransform(lgp.getTransform(),
lgp.getStartPoint().getX(), lgp.getStartPoint().getY());
AffineTransform end = applyTransform(lgp.getTransform(), lgp.getEndPoint().getX(), lgp.getEndPoint().getY());
double startX = start.getTranslateX();
double startY = start.getTranslateY();
@@ -177,8 +178,10 @@ public class PSSVGGraphics2D extends PSGraphics2D implements GradientRegistrar {
transform.concatenate(getTransform());
transform.concatenate(rgp.getTransform());

AffineTransform resultCentre = applyTransform(rgp.getTransform(), rgp.getCenterPoint().getX(), rgp.getCenterPoint().getY());
AffineTransform resultFocus = applyTransform(rgp.getTransform(), rgp.getFocusPoint().getX(), rgp.getFocusPoint().getY());
AffineTransform resultCentre = applyTransform(rgp.getTransform(),
rgp.getCenterPoint().getX(), rgp.getCenterPoint().getY());
AffineTransform resultFocus = applyTransform(rgp.getTransform(),
rgp.getFocusPoint().getX(), rgp.getFocusPoint().getY());
double scale = Math.sqrt(rgp.getTransform().getDeterminant());
double radius = rgp.getRadius() * scale;
double centreX = resultCentre.getTranslateX();

+ 2
- 1
src/java/org/apache/fop/svg/PDFDocumentGraphics2DConfigurator.java View File

@@ -88,7 +88,8 @@ public class PDFDocumentGraphics2DConfigurator {
final boolean strict = false;
if (cfg != null) {
URI thisUri = new File(".").getAbsoluteFile().toURI();
InternalResourceResolver resourceResolver = ResourceResolverFactory.createDefaultInternalResourceResolver(thisUri);
InternalResourceResolver resourceResolver
= ResourceResolverFactory.createDefaultInternalResourceResolver(thisUri);
//TODO The following could be optimized by retaining the FontManager somewhere
FontManager fontManager = new FontManager(resourceResolver, FontDetectorFactory.createDefault(),
FontCacheManagerFactory.createDefault());

Loading…
Cancel
Save