/** * Makes sure that the zero is positive. We do that in order to workaround a JDK 6 to 8 bug, where * {@link AffineTransform#hashCode()} is inconsistent with {@link AffineTransform#equals(Object)} * if there is zeros of opposite sign. * * <p>The inconsistency is in the use of {@link Double#doubleToLongBits(double)} for hash code and * {@code ==} for testing equality. The former is sensitive to the sign of 0 while the later is not.</p> */ @Workaround(library="JDK", version="8") // Last verified in 1.8.0_05. private static double pz(final double value) { return (value != 0) ? value : 0; }
/** * Makes sure that the zero is positive. We do that in order to workaround a JDK 6 to 8 bug, where * {@link AffineTransform#hashCode()} is inconsistent with {@link AffineTransform#equals(Object)} * if there is zeros of opposite sign. * * <p>The inconsistency is in the use of {@link Double#doubleToLongBits(double)} for hash code and * {@code ==} for testing equality. The former is sensitive to the sign of 0 while the later is not.</p> */ @Workaround(library="JDK", version="8") // Last verified in 1.8.0_05. private static double pz(final double value) { return (value != 0) ? value : 0; }
/** * Work around for RFE #4093999 in Sun's bug database * ("Relax constraint on placement of this()/super() call in constructors"). */ @Workaround(library="JDK", version="1.7") private static ParameterDescriptor<?>[] addAxisLengths(final ParameterDescriptor<?>[] parameters) { final ParameterDescriptor<?>[] ext = new ParameterDescriptor<?>[parameters.length + 2]; ext[0] = MapProjection.SEMI_MAJOR; ext[1] = MapProjection.SEMI_MINOR; System.arraycopy(parameters, 0, ext, 2, parameters.length); return ext; }
/** * Work around for RFE #4093999 in Sun's bug database * ("Relax constraint on placement of this()/super() call in constructors"). */ @Workaround(library="JDK", version="1.7") private static ParameterDescriptor<?>[] addAxisLengths(final ParameterDescriptor<?>[] parameters) { final ParameterDescriptor<?>[] ext = new ParameterDescriptor<?>[parameters.length + 2]; ext[0] = MapProjection.SEMI_MAJOR; ext[1] = MapProjection.SEMI_MINOR; System.arraycopy(parameters, 0, ext, 2, parameters.length); return ext; }
/** * Workaround for RFE #4093999 * ("Relax constraint on placement of this()/super() call in constructors"). */ @Workaround(library="JDK", version="1.8") private LocalizedParseException(final Locale locale, final Class<?> type, final CharSequence text, final int offset, final int errorOffset) { this(locale, parameters(type, text, offset, Math.max(offset, errorOffset)), errorOffset); }
/** * Workaround for RFE #4093999 * ("Relax constraint on placement of this()/super() call in constructors"). */ @Workaround(library="JDK", version="1.8") private DataStoreException(final Locale locale, final Object[] params) { this(locale, IOUtilities.errorMessageKey(params), params); }
/** * Workaround for RFE #4093999 * ("Relax constraint on placement of this()/super() call in constructors"). */ @Workaround(library="JDK", version="1.8") private LocalizedParseException(final Locale locale, final Object[] parameters, final int errorOffset) { this(locale, key(parameters), parameters, errorOffset); }
/** * Workaround for RFE #4093999 * ("Relax constraint on placement of this()/super() call in constructors"). */ @Workaround(library="JDK", version="1.8") private DataStoreException(final Locale locale, final Object[] params) { this(locale, IOUtilities.errorMessageKey(params), params); }
/** * Work around for RFE #4093999 in Sun's bug database * ("Relax constraint on placement of this()/super() call in constructors"). */ @Workaround(library="JDK", version="1.8") private static Initializer initializer(final OperationMethod method, final Parameters parameters) { final EnumMap<ParameterRole, ParameterDescriptor<Double>> roles = new EnumMap<>(ParameterRole.class); roles.put(ParameterRole.CENTRAL_MERIDIAN, CENTRAL_MERIDIAN); roles.put(ParameterRole.FALSE_EASTING, FALSE_EASTING); roles.put(ParameterRole.FALSE_NORTHING, FALSE_NORTHING); return new Initializer(method, parameters, roles, Initializer.AUTHALIC_RADIUS); }
/** * Workaround for RFE #4093999 * ("Relax constraint on placement of this()/super() call in constructors"). */ @Workaround(library="JDK", version="1.8") private LocalizedParseException(final Locale locale, final Class<?> type, final CharSequence text, final int offset, final int errorOffset) { this(locale, parameters(type, text, offset, Math.max(offset, errorOffset)), errorOffset); }
/** * Work around for RFE #4093999 in Sun's bug database * ("Relax constraint on placement of this()/super() call in constructors"). */ @Workaround(library="JDK", version="1.7") private static Initializer initializer(final OperationMethod method, final Parameters parameters) { final EnumMap<ParameterRole, ParameterDescriptor<Double>> roles = new EnumMap<>(ParameterRole.class); roles.put(ParameterRole.CENTRAL_MERIDIAN, LONGITUDE_OF_ORIGIN); roles.put(ParameterRole.SCALE_FACTOR, SCALE_FACTOR); roles.put(ParameterRole.FALSE_EASTING, FALSE_EASTING); roles.put(ParameterRole.FALSE_NORTHING, FALSE_NORTHING); return new Initializer(method, parameters, roles, (byte) 0); }
/** * Work around for RFE #4093999 in Sun's bug database * ("Relax constraint on placement of this()/super() call in constructors"). */ @Workaround(library="JDK", version="1.7") private static EnumSet<Option> options() { final EnumSet<Option> options = MetadataCommand.options(); options.remove(Option.TIMEZONE); options.remove(Option.FORMAT); return options; }
/** * Workaround for RFE #4093999 * ("Relax constraint on placement of this()/super() call in constructors"). */ @Workaround(library="JDK", version="1.8") private LocalizedParseException(final Locale locale, final Object[] parameters, final int errorOffset) { this(locale, key(parameters), parameters, errorOffset); }
/** * This is a work around for RFE #4093999 in Sun's bug database * ("Relax constraint on placement of this()/super() call in constructors"). * * @param components the coordinate systems. */ @Workaround(library="JDK", version="1.7") private DefaultCompoundCS(final CoordinateSystem[] components, final CoordinateSystemAxis[] axes) { super(singletonMap(NAME_KEY, AxisDirections.appendTo(new StringBuilder(60).append("Compound CS"), axes)), axes); this.components = UnmodifiableArrayList.wrap(components); }
/** * This is a work around for RFE #4093999 in Sun's bug database * ("Relax constraint on placement of this()/super() call in constructors"). * * @param components the coordinate systems. */ @Workaround(library="JDK", version="1.7") private DefaultCompoundCS(final CoordinateSystem[] components, final CoordinateSystemAxis[] axes) { super(singletonMap(NAME_KEY, AxisDirections.appendTo(new StringBuilder(60).append("Compound CS"), axes)), axes); this.components = UnmodifiableArrayList.wrap(components); }
/** * Work around for the inability to define the variable {@code <V>} locally. */ @Workaround(library="JDK", version="1.7") private <V> void formatValue(final CompoundFormat<V> format, final Object value) throws IOException { format.format(format.getValueType().cast(value), this); }
/** * Work around for the inability to define the variable {@code <V>} locally. */ @Workaround(library="JDK", version="1.7") private <V> void formatValue(final CompoundFormat<V> format, final Object value) throws IOException { format.format(format.getValueType().cast(value), this); }
/** * Work around for RFE #4093999 in Sun's bug database * ("Relax constraint on placement of this()/super() call in constructors"). */ @Workaround(library="JDK", version="1.8") private static ModifiableLocationType[] types() { final ModifiableLocationType gzd = new ModifiableLocationType("Geohash"); gzd.addIdentification(Vocabulary.formatInternational(Vocabulary.Keys.Code)); return new ModifiableLocationType[] {gzd}; }
/** * Work around for RFE #4093999 in Sun's bug database * ("Relax constraint on placement of this()/super() call in constructors"). */ @Workaround(library="JDK", version="1.8") private static Map<String,?> properties() { AbstractParty party = new AbstractParty("North Atlantic Treaty Organization", null); return properties(new NamedIdentifier(null, "NATO", Resources.formatInternational(Resources.Keys.MGRS), null, null), party); }
/** * Work around for RFE #4093999 in Sun's bug database * ("Relax constraint on placement of this()/super() call in constructors"). */ @Workaround(library="JDK", version="1.7") private NoOp(final Parameters parameters) { super(new Initializer(new DefaultOperationMethod( Collections.singletonMap(DefaultOperationMethod.NAME_KEY, parameters.getDescriptor().getName()), 2, 2, parameters.getDescriptor()), parameters, Collections.emptyMap(), (byte) 0)); super.computeCoefficients(); }