CPD Results

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

Duplications

FileLine
org\nhindirect\policy\x509\CertificatePolicyCpsUriExtensionField.java59
org\nhindirect\policy\x509\CertificatePolicyIndentifierExtensionField.java57
	public CertificatePolicyCpsUriExtensionField(boolean required)
	{
		super(required);
	}

	/**
	 * {@inheritDoc}
	 */
	@Override
	public void injectReferenceValue(X509Certificate value) throws PolicyProcessException
	{
		this.certificate = value;
		
		final DERObject exValue = getExtensionValue(value);
		
		if (exValue == null)
		{
			if (isRequired())
				throw new PolicyRequiredException("Extention " + getExtentionIdentifier().getDisplay() + " is marked as required by is not present.");
			else
			{
				final Collection<String> emptyList = Collections.emptyList();
				this.policyValue = PolicyValueFactory.getInstance(emptyList);
				return;
			}
		}
		
		final Collection<String> retVal = new ArrayList<String>();
		
		final ASN1Sequence seq = (ASN1Sequence)exValue;
		
		@SuppressWarnings("unchecked")
		final Enumeration<DEREncodable> pols = seq.getObjects();
		while (pols.hasMoreElements())
		{
			final PolicyInformation pol = PolicyInformation.getInstance(pols.nextElement());
FileLine
org\nhindirect\policy\x509\AuthorityInfoAccessExtentionField.java60
org\nhindirect\policy\x509\AuthorityInfoAccessOCSPLocExtentionField.java55
	public AuthorityInfoAccessExtentionField(boolean required)
	{
		super(required);
	}

	/**
	 * {@inheritDoc}
	 */
	@Override
	public void injectReferenceValue(X509Certificate value) throws PolicyProcessException
	{
		this.certificate = value;
		
		final DERObject exValue = getExtensionValue(value);
		
		if (exValue == null)
		{
			if (isRequired())
				throw new PolicyRequiredException("Extention " + getExtentionIdentifier().getDisplay() + " is marked as required by is not present.");
			else
			{
				final Collection<String> coll = Collections.emptyList();
				this.policyValue = PolicyValueFactory.getInstance(coll);
				return;
			}
		}
		
		final AuthorityInformationAccess aia = AuthorityInformationAccess.getInstance(exValue);
		
		final Collection<String> retVal = new ArrayList<String>();
		
        for (AccessDescription accessDescription : aia.getAccessDescriptions())
    	{