Skip to content

Commit

Permalink
squid:S1197 - Array designators [] should be on the type, not the var…
Browse files Browse the repository at this point in the history
…iable
  • Loading branch information
George Kankava committed May 11, 2016
1 parent d25a13f commit a3ee3cc
Show file tree
Hide file tree
Showing 13 changed files with 32 additions and 32 deletions.
Expand Up @@ -619,7 +619,7 @@ protected final void decimationOnReadingControl(Integer imageChoice, ImageReadPa
protected final void decimationOnReadingControl(String coverageName, Integer imageChoice, ImageReadParam readP, double[] requestedRes) {
{
int w, h;
double selectedRes[] = new double[2];
double[] selectedRes = new double[2];
final int choice = imageChoice.intValue();
if (choice == 0) {
// highest resolution
Expand Down
Expand Up @@ -80,7 +80,7 @@ private void deleteFile(File file) {
@Override
public void purge() {
if (!fileSet.isEmpty()) {
String files[] = (String[])fileSet.toArray(new String[fileSet.size()]);
String[] files = (String[])fileSet.toArray(new String[fileSet.size()]);
for (String filePath: files) {
removeFile(filePath);
}
Expand Down
Expand Up @@ -39,7 +39,7 @@ of this software and associated documentation files (the "Software"), to deal
* GeoTools - The Open Source Java GIS Toolkit
* http://geotools.org
*
* (C) 2004-2008, Open Source Geospatial Foundation (OSGeo)
* (C) 2004-2016, Open Source Geospatial Foundation (OSGeo)
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
Expand Down Expand Up @@ -330,12 +330,12 @@ private TiePoint[] calculateTiePoints(Node rootNode) {
if (node == null) {
return null;
}
final double tiePoints[] = getTiffDoubles(node);
final double[] tiePoints = getTiffDoubles(node);
if (tiePoints == null || tiePoints.length <= 0) {
return null;
}
final int numTiePoints = tiePoints.length / 6;
final TiePoint retVal[] = new TiePoint[numTiePoints];
final TiePoint[] retVal = new TiePoint[numTiePoints];
int initialIndex = 0;
for (int i = 0; i < numTiePoints; i++) {
initialIndex = i * 6;
Expand Down
Expand Up @@ -2,7 +2,7 @@
* GeoTools - The Open Source Java GIS Toolkit
* http://geotools.org
*
* (C) 2005-2008, Open Source Geospatial Foundation (OSGeo)
* (C) 2005-2016, Open Source Geospatial Foundation (OSGeo)
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
Expand Down Expand Up @@ -769,7 +769,7 @@ private void createMetadataElement(Element ifd) {
Iterator<String> keys = tiffTagsMetadata.keySet().iterator();
while (keys.hasNext()){
String key = keys.next();
String setIdPair[] = key.split(":");
String[] setIdPair = key.split(":");
String set = TagSet.BASELINE.toString();
if (setIdPair.length > 1){
set = setIdPair[0].toUpperCase();
Expand Down
Expand Up @@ -2,7 +2,7 @@
* GeoTools - The Open Source Java GIS Toolkit
* http://geotools.org
*
* (C) 2005-2015, Open Source Geospatial Foundation (OSGeo)
* (C) 2005-2016, Open Source Geospatial Foundation (OSGeo)
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
Expand Down Expand Up @@ -329,7 +329,7 @@ protected static java.awt.Polygon convertPolygon(final Polygon roiInput,
MathTransform worldToGridTransform) throws TransformException {
final boolean isIdentity = worldToGridTransform.isIdentity();
final java.awt.Polygon retValue = new java.awt.Polygon();
final double coords[] = new double[2];
final double[] coords = new double[2];
final LineString exteriorRing = roiInput.getExteriorRing();
final CoordinateSequence exteriorRingCS = exteriorRing
.getCoordinateSequence();
Expand Down
Expand Up @@ -2,7 +2,7 @@
* GeoTools - The Open Source Java GIS Toolkit
* http://geotools.org
*
* (C) 2011-2015, Open Source Geospatial Foundation (OSGeo)
* (C) 2011-2016, Open Source Geospatial Foundation (OSGeo)
* (C) 2014 TOPP - www.openplans.org.
*
* This library is free software; you can redistribute it and/or
Expand Down Expand Up @@ -323,7 +323,7 @@ public Point2D mapSourcePoint(Point2D srcPt, int sourceIndex) {
throw new IndexOutOfBoundsException("Bad src");// JaiI18N.getString("Generic1"));
}

double coords[] = new double[] { srcPt.getX(), srcPt.getY() };
double[] coords = new double[] { srcPt.getX(), srcPt.getY() };

try {
mapSrcPoint(coords);
Expand Down Expand Up @@ -416,7 +416,7 @@ public Point2D mapDestPoint(Point2D destPt, int sourceIndex) {
throw new IndexOutOfBoundsException("Bad src");// JaiI18N.getString("Generic1"));
}

double coords[] = new double[] { destPt.getX(), destPt.getY() };
double[] coords = new double[] { destPt.getX(), destPt.getY() };

try {
mapDestPoint(coords);
Expand Down Expand Up @@ -1355,7 +1355,7 @@ public float[] warpSparseRect(int x0, int y0, int width, int height, int periodX
height += y0;
int index = 0; // destRect index

double xy[] = new double[2];
double[] xy = new double[2];

for (int y = y0; y < height; y += periodY) {
for (int x = x0; x < width; x += periodX) {
Expand Down
Expand Up @@ -2,7 +2,7 @@
* GeoTools - The Open Source Java GIS Toolkit
* http://geotools.org
*
* (C) 2006-2015, Open Source Geospatial Foundation (OSGeo)
* (C) 2006-2016, Open Source Geospatial Foundation (OSGeo)
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
Expand Down Expand Up @@ -1708,7 +1708,7 @@ public final ImageWorker forceComponentColorModel(boolean checkTransparent, bool

switch (datatype) {
case DataBuffer.TYPE_BYTE: {
final byte data[][] = new byte[numDestinationBands][256];
final byte[][] data = new byte[numDestinationBands][256];
icm.getReds(data[0]);
if (numDestinationBands >= 2)
// remember to optimize for grayscale images
Expand Down Expand Up @@ -1755,7 +1755,7 @@ public final ImageWorker forceComponentColorModel(boolean checkTransparent, bool

case DataBuffer.TYPE_USHORT: {
final int mapSize = icm.getMapSize();
final short data[][] = new short[numDestinationBands][mapSize];
final short[][] data = new short[numDestinationBands][mapSize];
for (int i = 0; i < mapSize; i++) {
data[0][i] = (short) icm.getRed(i);
if (numDestinationBands >= 2)
Expand Down Expand Up @@ -2515,7 +2515,7 @@ private final ImageWorker maskIndexColorModel(final Color transparentColor) {

// Prepare the new ColorModel.
// Get the old map and update it as needed.
final byte rgb[][] = new byte[4][mapSize];
final byte[][] rgb = new byte[4][mapSize];
cm.getReds(rgb[0]);
cm.getGreens(rgb[1]);
cm.getBlues(rgb[2]);
Expand Down
Expand Up @@ -2,7 +2,7 @@
* GeoTools - The Open Source Java GIS Toolkit
* http://geotools.org
*
* (C) 2008-2015, Open Source Geospatial Foundation (OSGeo)
* (C) 2008-2016, Open Source Geospatial Foundation (OSGeo)
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
Expand Down Expand Up @@ -114,7 +114,7 @@ public Raster computeTile(int tx, int ty) {
final int w = sourceRaster.getWidth();
final int h = sourceRaster.getHeight();
final int numBands = sourceRaster.getSampleModel().getNumBands();
final int rgba[] = new int[numBands];
final int[] rgba = new int[numBands];
final boolean sourceHasAlpha = sourceColorModel.hasAlpha();
final int alphaBand = sourceHasAlpha ? numBands - 1 : -1;
final int minx = sourceRaster.getMinX();
Expand Down
Expand Up @@ -2,7 +2,7 @@
* GeoTools - The Open Source Java GIS Toolkit
* http://geotools.org
*
* (C) 2008, Open Source Geospatial Foundation (OSGeo)
* (C) 2016, Open Source Geospatial Foundation (OSGeo)
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
Expand Down Expand Up @@ -155,7 +155,7 @@ public RenderedImage getIndexedImage() {
//
// //
final int numBands = src.getSampleModel().getNumBands();
final int rgba[] = new int[numBands];
final int[] rgba = new int[numBands];
final boolean sourceHasAlpha = (numBands % 2 == 0);
final int alphaBand = sourceHasAlpha ? numBands - 1 : -1;
final int minx_ = src.getMinX();
Expand Down Expand Up @@ -411,7 +411,7 @@ public CustomPaletteBuilder buildPalette() {
//
// //
final int numBands = src.getSampleModel().getNumBands();
final int rgba[] = new int[numBands];
final int[] rgba = new int[numBands];
final boolean discriminantTransparency = transparency != Transparency.OPAQUE;
final int transpBand = numBands - 1;
final int minx_ = src.getMinX();
Expand Down
Expand Up @@ -2,7 +2,7 @@
* GeoTools - The Open Source Java GIS Toolkit
* http://geotools.org
*
* (C) 2008, Open Source Geospatial Foundation (OSGeo)
* (C) 2016, Open Source Geospatial Foundation (OSGeo)
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
Expand Down Expand Up @@ -145,7 +145,7 @@ public BufferedImage filterRenderedImage(RenderedImage src) {
//
// //
final int numBands = src.getSampleModel().getNumBands();
final int rgba[] = new int[numBands];
final int[] rgba = new int[numBands];
final boolean sourceHasAlpha = (numBands % 2 == 0);
final int alphaBand = sourceHasAlpha ? numBands - 1 : -1;
final EfficientInverseColorMapComputation invCM = rasterOp.getInvCM();
Expand Down
Expand Up @@ -2,7 +2,7 @@
* GeoTools - The Open Source Java GIS Toolkit
* http://geotools.org
*
* (C) 2008, Open Source Geospatial Foundation (OSGeo)
* (C) 2016, Open Source Geospatial Foundation (OSGeo)
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
Expand Down Expand Up @@ -131,7 +131,7 @@ public WritableRaster filter(Raster src, WritableRaster dest) {
final int numBands = src.getSampleModel().getNumBands();
final boolean sourceHasAlpha = (numBands % 2 == 0);
final int alphaBand = sourceHasAlpha ? numBands - 1 : -1;
final int rgba[] = new int[numBands];
final int[] rgba = new int[numBands];
for (int y = srcMinY, y_ = dstMinY; y < srcMaxY; y++, y_++) {
for (int x = srcMinX, x_ = dstMinX; x < srcMaxX; x++, x_++) {
src.getPixel(x, y, rgba);
Expand Down
Expand Up @@ -312,7 +312,7 @@ public static java.awt.Polygon convertPolygonToPointArray(final Polygon roiInput
MathTransform worldToGridTransform, List<Point2D> points)
throws TransformException {
final boolean isIdentity = worldToGridTransform.isIdentity();
final double coords[] = new double[2];
final double[] coords = new double[2];
final LineString exteriorRing = roiInput.getExteriorRing();
final CoordinateSequence exteriorRingCS = exteriorRing
.getCoordinateSequence();
Expand Down
Expand Up @@ -2,7 +2,7 @@
* GeoTools - The Open Source Java GIS Toolkit
* http://geotools.org
*
* (C) 2001-2015, Open Source Geospatial Foundation (OSGeo)
* (C) 2001-2016, Open Source Geospatial Foundation (OSGeo)
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
Expand Down Expand Up @@ -135,12 +135,12 @@ public final class ImageUtilities {
mediaLib=AccessController.doPrivileged(new PrivilegedAction<Boolean>() {
public Boolean run() {
try {
//get the method
final Class<?> params[] = {};
Method method= mImage.getDeclaredMethod("isAvailable", params);
//get the method
final Class<?>[] params = {};
Method method= mImage.getDeclaredMethod("isAvailable", params);

//invoke
final Object paramsObj[] = {};
final Object[] paramsObj = {};

final Object o=mImage.newInstance();
return (Boolean) method.invoke(o, paramsObj);
Expand Down

0 comments on commit a3ee3cc

Please sign in to comment.