CPD Results

The following document contains the results of PMD's CPD

Duplications

FileLine
org\tmforum\mtosi\simulator\client\MtosiClient.java116
org\tmforum\mtosi\simulator\server\MtosiServer.java90
	}

	public void setOption(String name, String value) {
		options.put(name, value);
	}

	public String getOption(String name) {
		return (String) options.get(name);
	}

	public boolean getAsBool(String name, boolean defaultValue) {
		String stringValue = getOption(name);
		if (stringValue == null) {
			return defaultValue;
		}

		try {
			return Boolean.getBoolean(stringValue);
		} catch (Throwable t) {
			log.warn(msgs.get(MessageConstants.UNABLE_TO_CONVERT, new Object[] {
					name, stringValue, "int", new Boolean(defaultValue) }));
			return defaultValue;
		}
	}

	public int getAsInt(String name, int defaultValue) {
		String stringValue = getOption(name);
		if (stringValue == null) {
			return defaultValue;
		}

		try {
			return Integer.parseInt(stringValue);
		} catch (Throwable t) {
			log.warn(msgs.get(MessageConstants.UNABLE_TO_CONVERT, new Object[] {
					name, stringValue, "int", new Integer(defaultValue) }));
			return defaultValue;
		}
	}

	public String getAsString(String name, String defaultValue) {
		String stringValue = getOption(name);
		if (stringValue == null) {
			return defaultValue;
		}

		return stringValue;
	}
}

FileLine
org\tmforum\mtosi\simulator\util\jaxrpc\axis13\MtosiMessageParserImpl.java84
org\tmforum\mtosi\simulator\util\jaxrpc\axis13\MtosiMessageParserImpl.java126
		try {
			classDef = Class.forName(className);
			Method method = classDef.getDeclaredMethod("getTypeDesc", null);
			typeDesc = (TypeDesc) method.invoke(null, null);
		} catch (ClassNotFoundException e) {
			throw new SOAPException(msgs.get(
					MessageConstants.CANNOT_LOAD_DATABINDING_CLASS, className),
					e);
		} catch (SecurityException e) {
			throw new SOAPException(msgs.get(
					MessageConstants.CANNOT_LOAD_TYPE_DESC, className), e);
		} catch (NoSuchMethodException e) {
			throw new SOAPException(msgs.get(
					MessageConstants.CANNOT_LOAD_TYPE_DESC, className), e);
		} catch (IllegalArgumentException e) {
			throw new SOAPException(msgs.get(
					MessageConstants.CANNOT_LOAD_TYPE_DESC, className), e);
		} catch (IllegalAccessException e) {
			throw new SOAPException(msgs.get(
					MessageConstants.CANNOT_LOAD_TYPE_DESC, className), e);
		} catch (InvocationTargetException e) {
			throw new SOAPException(msgs.get(
					MessageConstants.CANNOT_LOAD_TYPE_DESC, className), e);
		}

FileLine
org\tmforum\mtosi\simulator\util\jaxrpc\axis13\MtosiMessageParserImpl.java91
org\tmforum\mtosi\simulator\util\jaxrpc\axis13\MtosiMessageParserImpl.java179
			typeDesc = (TypeDesc) method.invoke(null, null);
		} catch (SecurityException e) {
			throw new SOAPException(msgs.get(
					MessageConstants.CANNOT_LOAD_TYPE_DESC, className), e);
		} catch (NoSuchMethodException e) {
			throw new SOAPException(msgs.get(
					MessageConstants.CANNOT_LOAD_TYPE_DESC, className), e);
		} catch (IllegalArgumentException e) {
			throw new SOAPException(msgs.get(
					MessageConstants.CANNOT_LOAD_TYPE_DESC, className), e);
		} catch (IllegalAccessException e) {
			throw new SOAPException(msgs.get(
					MessageConstants.CANNOT_LOAD_TYPE_DESC, className), e);
		} catch (InvocationTargetException e) {
			throw new SOAPException(msgs.get(
					MessageConstants.CANNOT_LOAD_TYPE_DESC, className), e);
		}

		QName qName = typeDesc.getXmlType();

FileLine
org\tmforum\mtosi\simulator\util\jaxrpc\axis13\MtosiMessageParserImpl.java133
org\tmforum\mtosi\simulator\util\jaxrpc\axis13\MtosiMessageParserImpl.java179
			typeDesc = (TypeDesc) method.invoke(null, null);
		} catch (SecurityException e) {
			throw new SOAPException(msgs.get(
					MessageConstants.CANNOT_LOAD_TYPE_DESC, className), e);
		} catch (NoSuchMethodException e) {
			throw new SOAPException(msgs.get(
					MessageConstants.CANNOT_LOAD_TYPE_DESC, className), e);
		} catch (IllegalArgumentException e) {
			throw new SOAPException(msgs.get(
					MessageConstants.CANNOT_LOAD_TYPE_DESC, className), e);
		} catch (IllegalAccessException e) {
			throw new SOAPException(msgs.get(
					MessageConstants.CANNOT_LOAD_TYPE_DESC, className), e);
		} catch (InvocationTargetException e) {
			throw new SOAPException(msgs.get(
					MessageConstants.CANNOT_LOAD_TYPE_DESC, className), e);
		}