Re: Strange method toProjectRelativePaths / duplicated 3 times in the code base ?

From: Ulrich Köster (ulric..bjectstyle.org)
Date: Wed Mar 29 2006 - 06:31:16 EST

  • Next message: Sébastien Sahuc: "Re: How do I enable Eclipse/WOLips Logging ?"

    Moin Sébastien,

    most of the stuff in the datasets plugin is deprecated. (Not marked
    as deprecated.)

    Could be more specific about the bug?

    I have to take a look at the code later today.

    Uli
    Am 29.03.2006 um 02:57 schrieb Sébastien Sahuc:

    > Guys,
    >
    > I'm hitting a bug with the new code that Ulrich committed to remove
    > the .WOLips dependencies. While debugging I noticed the following
    > SAME method in exactly three different location. On top of that I do
    > not understand what is the purpose of this method, but I do know that
    > is the cause of my matching problem I'd like to fix. Please throw in
    > any hints you have you this method .
    >
    > this method appears in the classes:
    > org.objectstyle.wolips.core.resources.internal.build.AbstractBuildVisi
    > to
    > r
    > org.objectstyle.wolips.core.resources.internal.types.file.ProjectPatte
    > rn
    > sets
    > org.objectstyle.wolips.datasets.adaptable.ProjectPatternsets
    >
    >
    > private String[] toProjectRelativePaths(IResource resource) {
    > String[] returnValue = null;
    > if (resource.getParent().getType() != IResource.ROOT
    > /* && resource.getParent().getType() != IResource.PROJECT */) {
    > returnValue = new String[2];
    > String string = null;
    > if (resource.getType() != IResource.FOLDER) {
    > IPath path = resource.getParent().getProjectRelativePath();
    > /*
    > * String string = resource.getProject().getName() + "/" +
    > * path.toString() + "/";
    > */
    > string = path.toString() + "/";
    > } else {
    > string = "/" + resource.getName() + "/";
    > }
    > returnValue[0] = string;
    > } else {
    > returnValue = new String[1];
    > }
    > IPath path = resource.getProjectRelativePath();
    > //String string = resource.getProject().getName() + "/" +
    > // path.toString();
    > String string = path.toString();
    > if (returnValue.length == 2) {
    > returnValue[1] = string;
    > } else {
    > returnValue[0] = string;
    > }
    > return returnValue;
    > }
    >
    >
    >
    >
    >
    > Thanks,
    >
    > Sebastien
    >



    This archive was generated by hypermail 2.0.0 : Wed Mar 29 2006 - 06:31:18 EST