Skip to content

Commit

Permalink
#168: Tiny issue corrected during review
Browse files Browse the repository at this point in the history
  • Loading branch information
maybeec committed Jan 10, 2016
1 parent 530de51 commit 2ba80c4
Showing 1 changed file with 1 addition and 108 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
import freemarker.template.TemplateException;

/**
*
* Wrapper for CobiGen providing an eclipse compliant API.
* @author mbrunnli (02.12.2014)
*/
public abstract class CobiGenWrapper extends AbstractCobiGenWrapper {
Expand Down Expand Up @@ -432,111 +432,4 @@ public List<String> getMatchingTriggerIds(Object loadClass) {
*/
public abstract boolean isValidInput(IStructuredSelection selection) throws InvalidInputException;

// /**
// * Checks if the selected items are supported by one or more {@link Trigger}s, and if they are supported
// * by the same {@link Trigger}s
// *
// * @param selection
// * the selection made
// * @return true, if all items are supported by the same trigger(s)<br>
// * false, if they are not supported by any trigger at all
// * @throws InvalidInputException
// * if the input could not be read as expected
// * @author trippl (22.04.2013)
// */
// public boolean isValidInput(IStructuredSelection selection) throws InvalidInputException {
//
// Iterator<?> it = selection.iterator();
// List<String> firstTriggers = null;
//
// boolean uniqueSourceSelected = false;
//
// while (it.hasNext()) {
// Object tmp = it.next();
// if (tmp instanceof ICompilationUnit) {
// if (firstTriggers == null) {
// firstTriggers = findMatchingTriggers((ICompilationUnit) tmp);
// } else {
// if (!firstTriggers.equals(findMatchingTriggers((ICompilationUnit) tmp))) {
// throw new InvalidInputException(
// "You selected at least two inputs, which are not matching the same triggers. "
// + "For batch processing all inputs have to match the same triggers.");
// }
// }
// } else if (tmp instanceof IPackageFragment) {
// uniqueSourceSelected = true;
// firstTriggers =
// cobiGen.getMatchingTriggerIds(new PackageFolder(((IPackageFragment) tmp).getResource()
// .getLocationURI(), ((IPackageFragment) tmp).getElementName()));
// } else if (tmp instanceof IFile) {
// uniqueSourceSelected = true;
// try (InputStream stream = ((IFile) tmp).getContents()) {
// LOG.debug("Try parsing file {} as xml...", ((IFile) tmp).getName());
// Document domDocument = XmlUtil.parseXmlStreamToDom(stream);
// firstTriggers = cobiGen.getMatchingTriggerIds(domDocument);
// } catch (CoreException e) {
// throw new InvalidInputException("An eclipse internal exception occured! ", e);
// } catch (IOException e) {
// throw new InvalidInputException("The file " + ((IFile) tmp).getName()
// + " could not be read!", e);
// } catch (ParserConfigurationException e) {
// throw new InvalidInputException("The file " + ((IFile) tmp).getName()
// + " could not be parsed, because of an internal configuration error!", e);
// } catch (SAXException e) {
// throw new InvalidInputException("The contents of the file " + ((IFile) tmp).getName()
// + " could not be detected as an instance of any CobiGen supported input language.");
// }
// } else {
// throw new InvalidInputException(
// "You selected at least one input, which type is currently not supported as input for generation. "
// + "Please choose a different one or read the CobiGen documentation for more details.");
// }
//
// if (uniqueSourceSelected && selection.size() > 1) {
// throw new InvalidInputException(
// "You selected at least one input in a mass-selection,"
// + " which type is currently not supported for batch processing. "
// + "Please just select multiple inputs only if batch processing is supported for all inputs.");
// }
// }
// return firstTriggers != null && !firstTriggers.isEmpty();
// }
//
// /**
// * Returns a {@link Set} of {@link Trigger}s that support the give {@link ICompilationUnit}
// *
// * @param cu
// * {@link ICompilationUnit} to be checked
// * @return the {@link Set} of {@link Trigger}s
// * @throws InvalidInputException
// * if the input could not be read as expected
// * @author trippl (22.04.2013)
// */
// private List<String> findMatchingTriggers(ICompilationUnit cu) throws InvalidInputException {
//
// ClassLoader classLoader;
// IType type = null;
// try {
// classLoader = ClassLoaderUtil.getProjectClassLoader(cu.getJavaProject());
// type = EclipseJavaModelUtil.getJavaClassType(cu);
// return cobiGen.getMatchingTriggerIds(classLoader.loadClass(type.getFullyQualifiedName()));
// } catch (MalformedURLException e) {
// throw new InvalidInputException("Error while retrieving the project's ('"
// + cu.getJavaProject().getElementName() + "') classloader.", e);
// } catch (CoreException e) {
// throw new InvalidInputException("An eclipse internal exception occured!", e);
// } catch (ClassNotFoundException e) {
// throw new InvalidInputException("The class '" + type.getFullyQualifiedName()
// + "' could not be found. "
// + "This may be cause of a non-compiling host project of the selected input.", e);
// } catch (UnsupportedClassVersionError e) {
// throw new InvalidInputException(
// "Incompatible java version: "
// +
// "You have selected a java class, which Java version is higher than the Java runtime your eclipse is running with. "
// +
// "Please update your PATH variable to reference the latest Java runtime you are developing for and restart eclipse.\n"
// + "Current runtime: " + System.getProperty("java.version"), e);
// }
// }
}

0 comments on commit 2ba80c4

Please sign in to comment.