CPD Results

The following document contains the results of PMD's CPD 5.0.2.

Duplications

FileLine
com\legstar\coxb\convert\simple\CobolZonedDecimalSimpleConverter.java103
com\legstar\coxb\convert\simple\CobolZonedDecimalSimpleConverterNoCodePage.java126
                    newOffset, getCobolContext().getHostIntegerSigns());
            ce.setBigDecimalValue(javaDecimal);
            newOffset += ce.getByteLength();
        } catch (CobolConversionException e) {
            throwHostException(ce, e);
        }
        return newOffset;
    }

    /** {@inheritDoc} */
    public int fromHost(final ICobolArrayZonedDecimalBinding ce,
            final byte[] hostSource, final int offset, final int currentOccurs)
            throws HostException {
        List < BigDecimal > lArray = new ArrayList < BigDecimal >();
        int newOffset = offset;
        try {
            for (int i = 0; i < currentOccurs; i++) {
                BigDecimal javaDecimal = fromHostSingle(ce.getItemByteLength(),
                        ce.getTotalDigits(), ce.getFractionDigits(),
                        ce.isSigned(), ce.isSignSeparate(), ce.isSignLeading(),
                        hostSource, newOffset, getCobolContext()
FileLine
com\legstar\coxb\convert\simple\CobolDbcsSimpleConverter.java124
com\legstar\coxb\convert\simple\CobolStringSimpleConverter.java108
            final ICobolArrayDbcsBinding ce,
            final byte[] hostSource,
            final int offset,
            final int currentOccurs)
            throws HostException {
        List < String > lArray = new ArrayList < String >();
        int newOffset = offset;
        try {
            for (int i = 0; i < currentOccurs; i++) {
                String javaString = fromHostSingle(
                        getCobolContext().getHostCharsetName(),
                        ce.getItemByteLength(),
                        hostSource,
                        newOffset);
                lArray.add(javaString);
                newOffset += ce.getItemByteLength();
            }
            ce.setStringList(lArray);
        } catch (CobolConversionException e) {
            throwHostException(ce, e);
        }
        return newOffset;
    }

    /**
     * Converts a Java String to a host character stream within the host
     * character set.
     * 
     * @param javaString java string to convert
     * @param hostCharsetName host character set
     * @param cobolByteLength host byte length
     * @param isJustifiedRight is Cobol data right justified
     * @param hostTarget target host buffer
     * @param offset offset in target host buffer
     * @return offset after host buffer is updated
     * @throws CobolConversionException if conversion fails
     */
    public static final int toHostSingle(
            final String javaString,
            final String hostCharsetName,
            final int cobolByteLength,
FileLine
com\legstar\coxb\convert\simple\CobolZonedDecimalSimpleConverter.java61
com\legstar\coxb\convert\simple\CobolZonedDecimalSimpleConverterNoCodePage.java65
                            .getHostIntegerSigns());
        } catch (CobolConversionException e) {
            throwHostException(ce, e);
        }
        return newOffset;
    }

    /** {@inheritDoc} */
    public int toHost(final ICobolArrayZonedDecimalBinding ce,
            final byte[] hostTarget, final int offset, final int currentOccurs)
            throws HostException {
        int newOffset = offset;
        try {
            for (BigDecimal javaSource : ce.getBigDecimalList()) {
                newOffset = toHostSingle(javaSource, ce.getItemByteLength(),
                        ce.getTotalDigits(), ce.getFractionDigits(),
                        ce.isSigned(), ce.isSignSeparate(), ce.isSignLeading(),
                        hostTarget, newOffset, getCobolContext()
FileLine
com\legstar\coxb\impl\CArrayDoubleBinding.java106
com\legstar\coxb\impl\CArrayFloatBinding.java105
        if (type.equals(Double.class)) {
            return mList;
        } else if (type.equals(BigDecimal.class)) {
            return getBigDecimalList();
        } else {
            throw new HostException("Attempt to get binding " + getBindingName()
                    + " as an incompatible type " + type);
        }
    }

    /** {@inheritDoc} */
    @SuppressWarnings("unchecked")
    public void setObjectValue(final Object value) throws HostException {
        if (value == null) {
            mList = null;
            return;
        }
        if (value instanceof List) {
            if (((List < ? >) value).size() == 0) {
                mList = new ArrayList < Double >();
FileLine
com\legstar\coxb\impl\reflect\ReflectHostToJavaTransformer.java41
com\legstar\coxb\impl\reflect\ReflectJavaToHostTransformer.java41
    public ReflectHostToJavaTransformer(
            final String jaxbPackageName,
            final String jaxbType) throws ReflectBindingException {
        try {
            _jaxbElementDescriptor = new JAXBElementDescriptor(jaxbPackageName,
                    jaxbType);
        } catch (JAXBAnnotationException e) {
            throw new ReflectBindingException(e);
        }
    }

    /** {@inheritDoc} */
    public ICobolComplexBinding getBinding() throws CobolBindingException {
        try {
            CComplexReflectBinding ccem = new CComplexReflectBinding(
                    getObjectFactory(), getJaxbClass());
            return ccem;
        } catch (ReflectBindingException e) {
            throw new CobolBindingException(e);
        }
    }

    /**
     * @return the JAXB type factory to use for the JAXB object type
     */
    public Object getObjectFactory() {
        return _jaxbElementDescriptor.getObjectFactory();
    }

    /**
     * @return the JAXB type class
     */
    public Class < ? > getJaxbClass() {
        return getJaxbElementDescriptor().getJaxbClass();