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

From: Sébastien Sahuc (lis..ahuc.net)
Date: Wed Mar 29 2006 - 13:11:07 EST

  • Next message: Ken Anderson: "Missing dependent projects"

    I've added my local patch to
    http://objectstyle.org/jira/browse/WOL-224

    BTW, how do you keep indenting in the comment section. I copied there
    some line of codes, but it looks ugly.

    Seb

    On Mar 29, 2006, at 3:31 AM, Ulrich Köster wrote:

    > 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.AbstractBuildVis
    >> ito
    >> r
    >> org.objectstyle.wolips.core.resources.internal.types.file.ProjectPatt
    >> ern
    >> 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 - 13:11:09 EST