CPD Results

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

Duplications

FileProjectLine
org/x4o/xml/eld/xsd/X4OLanguageEldXsdWriter.javax4o-core77
org/x4o/xml/eld/doc/X4OLanguageEldDocWriter.javax4o-elddoc67
				languageSchema.setLanguageNamespaceUri(arguIterator.next());
				continue;
			}
			if ("-class".equals(arg)) {
				if (arguIterator.hasNext()==false) {
					System.out.println("No argument for -class given.");
					System.exit(1);
					return;
				}
				String apiClass = arguIterator.next();
				try {
					languageSchema.setLanguageParserSupport((Class<X4OParserSupport>) X4OLanguageClassLoader.loadClass(apiClass));
				} catch (ClassNotFoundException e) {
					System.out.println("Schema api class is not found: "+apiClass);
					System.exit(1);
					return;
				}
				continue;
			}
		}
		try {
			languageSchema.execute();
		} catch (X4OParserSupportException e) {
			System.out.println("Error while schema writing: "+e.getMessage());
			e.printStackTrace();
			System.exit(1);
			return;
		}
	}

	public void execute() throws X4OParserSupportException {
		try {
			// Get the support context
			X4OParserSupport languageSupport = (X4OParserSupport)getLanguageParserSupport().newInstance();
			ElementLanguage context = languageSupport.loadElementLanguageSupport();
FileProjectLine
org/x4o/xml/eld/doc/EldDocHtmlWriter.javax4o-elddoc480
org/x4o/xml/eld/doc/EldDocHtmlWriter.javax4o-elddoc505
			for (TreeNode n:parents) {
				pw.print("\t\t\t&nbsp;<a href=\"");
				pw.print(pathPrefix);
				pw.print(toSafeUri(n.module.getId()));
				pw.print("/");
				pw.print(toSafeUri(n.namespace.getId()));
				pw.print("/");
				pw.print(toSafeUri(n.elementClass.getTag()));
				pw.print("/index.html\">");
				pw.print(n.namespace.getId());
				pw.print(":");
				pw.print(n.elementClass.getTag());
				pw.print("</a>\n");
			}
			pw.print("</td>\n");
			pw.print("\t</tr>\n");
			printTableEnd(pw);
FileProjectLine
org/x4o/xml/eld/xsd/X4OLanguageEldXsdWriter.javax4o-core51
org/x4o/xml/eld/doc/X4OLanguageEldDocWriter.javax4o-elddoc50
		X4OLanguageEldXsdWriter languageSchema = new X4OLanguageEldXsdWriter();
		List<String> arguList = Arrays.asList(argu);
		Iterator<String> arguIterator = arguList.iterator();
		while (arguIterator.hasNext()) {
			String arg = arguIterator.next();
			if ("-path".equals(arg)) {
				if (arguIterator.hasNext()==false) {
					System.out.println("No argument for -path given.");
					System.exit(1);
					return;
				}
				File schemaBasePath = new File(arguIterator.next());
				if (schemaBasePath.exists()==false) {
					System.out.println("path does not exists; "+schemaBasePath);
					System.exit(1);
					return;
				}
				languageSchema.setBasePath(schemaBasePath);
				continue;
			}
			if ("-uri".equals(arg)) {
FileProjectLine
org/x4o/plugin/ant/eld/doc/EldDocWriterTask.javax4o-plugin-ant-elddoc43
org/x4o/plugin/ant/eld/xsd/EldXsdWriterTask.javax4o-plugin-ant-schema44
	private String supportclass = null;
	private String destdir = null;
	private boolean verbose = false;
	private boolean failonerror = true;
	
	/**
	 * Executes the x4o eld schema task.
	 * @see org.apache.tools.ant.Task#execute()
	 */
	@Override
	public void execute() throws BuildException {
		try {
			executeTask();
		} catch (BuildException e) {
			if (isFailonerror()) {
				throw e;
			} else {
				log(e.getMessage(), Project.MSG_WARN);
			}
		}
	}
	
	private void executeTask() throws BuildException {
		if (getSupportclass()==null) {
			throw new BuildException("supportclass attribute is not set.");
		}
		if (getDestdir()==null) {
			throw new BuildException("basePath attribute is not set.");
FileProjectLine
org/x4o/xml/eld/EldModuleLoaderCore.javax4o-core251
org/x4o/xml/eld/EldModuleLoaderCore.javax4o-core267
		ec.addElementParent(CEL_CORE_URI, "element");
		try {
			attr = (ElementClassAttribute)X4OLanguageClassLoader.newInstance(elementLanguage.getLanguageConfiguration().getDefaultElementClassAttribute());
			attr.setName("bean.class");
			attr.setRequired(true);
			ec.addElementClassAttribute(attr);
			
			attr = (ElementClassAttribute)X4OLanguageClassLoader.newInstance(elementLanguage.getLanguageConfiguration().getDefaultElementClassAttribute());
			attr.setName("configAction");
			ec.addElementClassAttribute(attr);
		} catch (Exception e) {
			throw new ElementLanguageModuleLoaderException(this,e.getMessage(),e);
		}
		elementClassList.add(ec);
		
		ec = new DefaultElementClass("configuratorGlobal",null,BeanElement.class);