IClasspathEntry[] newentries = new IClasspathEntry[entries.length + 1]; System.arraycopy(entries, 0, newentries, 0, entries.length); newentries[newentries.length - 1] = conEntry;
IClasspathEntry[] newentries; int index=entries.length;  for (int i = 0; i < entries.length; i++) { if(entries[i].equals(conEntry)){ index=i; break; } }   if(index==entries.length){ newentries = new IClasspathEntry[entries.length + 1]; System.arraycopy(entries, 0, newentries, 0, entries.length); newentries[newentries.length - 1] = conEntry; }else{ newentries=entries; }
    public void configure(IJavaProject javaProject)        throws CoreException {        IPath path = new Path(IResourceIDs.CLASSPATH_CONTAINER_ID);        IClasspathEntry conEntry = JavaCore.newContainerEntry(path, false);        IClasspathEntry[] entries = javaProject.getRawClasspath();        IClasspathEntry[] newentries = new IClasspathEntry[entries.length + 1];        System.arraycopy(entries, 0, newentries, 0, entries.length);        newentries[newentries.length - 1] = conEntry;        IJavaModelStatus validation = JavaConventions.validateClasspath(javaProject,                newentries, javaProject.getOutputLocation());        if (!validation.isOK()) {            throw new CoreException(validation);        }        javaProject.setRawClasspath(newentries, null);    }