diff options
author | Sébastien Lesaint <sebastien.lesaint@sonarsource.com> | 2015-08-13 12:45:10 +0200 |
---|---|---|
committer | Sébastien Lesaint <sebastien.lesaint@sonarsource.com> | 2015-08-13 15:02:15 +0200 |
commit | 7eec379c123480440fe01c1acddd2640bd170c19 (patch) | |
tree | 5f5bef979a07c084e30d1e613efcc07e27f9ed98 | |
parent | af64189f09f3d5913c629a883ec47f75c59e3ff0 (diff) | |
download | sonarqube-7eec379c123480440fe01c1acddd2640bd170c19.tar.gz sonarqube-7eec379c123480440fe01c1acddd2640bd170c19.zip |
fix duplication of implementation of PathAwareVisitor.PathElement
3 files changed, 43 insertions, 39 deletions
diff --git a/server/sonar-server/src/main/java/org/sonar/server/computation/component/PathAwareCrawler.java b/server/sonar-server/src/main/java/org/sonar/server/computation/component/PathAwareCrawler.java index d0a0d7e27f0..cc669661ca4 100644 --- a/server/sonar-server/src/main/java/org/sonar/server/computation/component/PathAwareCrawler.java +++ b/server/sonar-server/src/main/java/org/sonar/server/computation/component/PathAwareCrawler.java @@ -100,24 +100,4 @@ public abstract class PathAwareCrawler<T> extends PathAwareVisitorAdapter<T> imp } } - public static final class PathElementImpl<T> implements PathElement<T> { - private final Component component; - private final T element; - - public PathElementImpl(Component component, T element) { - this.component = component; - this.element = element; - } - - @Override - public Component getComponent() { - return component; - } - - @Override - public T getElement() { - return element; - } - } - } diff --git a/server/sonar-server/src/main/java/org/sonar/server/computation/component/PathAwareVisitorWrapper.java b/server/sonar-server/src/main/java/org/sonar/server/computation/component/PathAwareVisitorWrapper.java index 101932dbae4..ca4e12853f2 100644 --- a/server/sonar-server/src/main/java/org/sonar/server/computation/component/PathAwareVisitorWrapper.java +++ b/server/sonar-server/src/main/java/org/sonar/server/computation/component/PathAwareVisitorWrapper.java @@ -90,23 +90,4 @@ public class PathAwareVisitorWrapper<T> implements VisitorWrapper { } } - public static final class PathElementImpl<T> implements PathAwareVisitor.PathElement<T> { - private final Component component; - private final T element; - - public PathElementImpl(Component component, T element) { - this.component = component; - this.element = element; - } - - @Override - public Component getComponent() { - return component; - } - - @Override - public T getElement() { - return element; - } - } } diff --git a/server/sonar-server/src/main/java/org/sonar/server/computation/component/PathElementImpl.java b/server/sonar-server/src/main/java/org/sonar/server/computation/component/PathElementImpl.java new file mode 100644 index 00000000000..537c7684788 --- /dev/null +++ b/server/sonar-server/src/main/java/org/sonar/server/computation/component/PathElementImpl.java @@ -0,0 +1,43 @@ +/* + * SonarQube, open source software quality management tool. + * Copyright (C) 2008-2014 SonarSource + * mailto:contact AT sonarsource DOT com + * + * SonarQube is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * SonarQube is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +package org.sonar.server.computation.component; + +import javax.annotation.concurrent.Immutable; + +@Immutable +final class PathElementImpl<T> implements PathAwareVisitor.PathElement<T> { + private final Component component; + private final T element; + + public PathElementImpl(Component component, T element) { + this.component = component; + this.element = element; + } + + @Override + public Component getComponent() { + return component; + } + + @Override + public T getElement() { + return element; + } +} |