private FunctionCompletion createFunctionCompletion() {

		FunctionCompletion fc = null;
		if (funcCompletionType!=null) {
			try {
				Class<?> clazz = null;
				if (completionCL!=null) {
					clazz = Class.forName(funcCompletionType, true,
											completionCL);
				}
				else {
					clazz = Class.forName(funcCompletionType);
				}
				Constructor<?> c = clazz.getDeclaredConstructor(
						CompletionProvider.class, String.class, String.class);
				fc = (FunctionCompletion)c.newInstance(provider, name,
						returnType);
			} catch (RuntimeException re) { // FindBugs
				throw re;
			} catch (Exception e) {
				e.printStackTrace();
			}
		}

		if (fc==null) { // Fallback if completion failed for some reason
			fc = new FunctionCompletion(provider, name, returnType);
		}

		if (desc.length()>0) {
			fc.setShortDescription(desc.toString());
			desc.setLength(0);
		}
		fc.setParams(params);
		fc.setDefinedIn(definedIn);
		if (returnValDesc.length()>0) {
			fc.setReturnValueDescription(returnValDesc.toString());
			returnValDesc.setLength(0);
		}

		return fc;

	}