[trace] removed unused Type parameters and unused inverseView methods

This commit is contained in:
Sven Efftinge 2015-08-05 14:08:37 +02:00
parent 5c79f9b407
commit d2d3b10b56
7 changed files with 5 additions and 78 deletions

View file

@ -94,31 +94,6 @@ public interface ITrace {
*/
LanguageInfo getLocalLanguage();
/**
* Returns all available inverse trace information.
*
* @return the inverse trace information. Never <code>null</code>.
*/
Iterable<? extends ITrace> getAllInverseTraces();
/**
* Returns the inverse trace for the given associated resource or <code>null</code> if none.
*
* @param absoluteURI
* the expected associated, absolute URI. May not be <code>null</code>.
* @return the inverse trace for the given location or <code>null</code> if none.
*/
ITrace getInverseTrace(AbsoluteURI absoluteURI);
/**
* Returns the inverse trace for the given associated resource or <code>null</code> if none.
*
* @param srcRelativeURI
* the expected associated, absolute URI. May not be <code>null</code>.
* @return the inverse trace for the given location or <code>null</code> if none.
*/
ITrace getInverseTrace(SourceRelativeURI srcRelativeURI, IProjectConfig projectConfig);
/**
* Returns the best {@link ILocationInResource location} that matches the given
* {@code localRegion} in the {@code absoluteTargetResource}.

View file

@ -56,7 +56,7 @@ class SourceRelativeURI extends AbstractURIWrapper {
}
/**
* An absoute URI that allows to obtain a resource in a {@link IWorkspaceConfig workspace}.
* An absolute URI that allows to obtain a resource in a {@link IWorkspaceConfig workspace}.
*
* @author Sebastian Zarnekow - Initial contribution and API
*/

View file

@ -13,7 +13,6 @@ import java.io.Reader;
import java.util.Collections;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import org.eclipse.xtext.LanguageInfo;
import org.eclipse.xtext.generator.trace.AbsoluteURI;
@ -40,7 +39,6 @@ import com.google.common.base.Function;
import com.google.common.base.Predicate;
import com.google.common.collect.AbstractIterator;
import com.google.common.collect.ImmutableSet;
import com.google.common.collect.Iterables;
import com.google.common.collect.Iterators;
import com.google.common.io.CharStreams;
import com.google.inject.Inject;
@ -87,12 +85,6 @@ public abstract class AbstractTrace implements ITrace {
@Inject
private IResourceServiceProvider.Registry resourceServiceRegistry;
@Inject
private ITraceForURIProvider traceProvider;
@Inject
private ITraceURIConverter traceURIConverter;
private AbstractTraceRegion rootTraceRegion;
private ITraceRegionProvider traceRegionProvider;
@ -498,27 +490,6 @@ public abstract class AbstractTrace implements ITrace {
}
@Override
public Iterable<? extends ITrace> getAllInverseTraces() {
Map<SourceRelativeURI, List<AbstractTraceRegion>> inverted = getRootTraceRegion().invertAll(getSrcRelativeLocalURI());
return Iterables.transform(inverted.keySet(), new TraceAccess(isTraceToTarget(), getLocalProjectConfig(), traceProvider));
}
@Override
public ITrace getInverseTrace(AbsoluteURI uri) {
SourceRelativeURI uriForTrace = traceURIConverter.getURIForTrace(getLocalProjectConfig(), uri);
return getInverseTrace(uriForTrace, getLocalProjectConfig());
}
@Override
public ITrace getInverseTrace(SourceRelativeURI srcRelativeURI, IProjectConfig projectConfig) {
List<AbstractTraceRegion> result = getRootTraceRegion().invertFor(srcRelativeURI, getSrcRelativeLocalURI());
if (result.isEmpty()) {
return null;
}
return new TraceAccess(isTraceToTarget(), projectConfig, traceProvider).apply(srcRelativeURI);
}
protected abstract InputStream getContents(SourceRelativeURI uri, IProjectConfig projectConfig) throws IOException;
protected abstract Reader getContentsAsText(SourceRelativeURI uri, IProjectConfig projectConfig) throws IOException;

View file

@ -14,16 +14,11 @@ import org.eclipse.xtext.generator.trace.ILocationInResource;
*
* @author Sebastian Zarnekow - Initial contribution and API
*/
public interface IPlatformSpecificLocation<PlatformResource, PlatformProject> extends ILocationInResource {
public interface IPlatformSpecificLocation<PlatformResource> extends ILocationInResource {
/**
* @return the storage handle for this location. May be <code>null</code>.
*/
PlatformResource getPlatformResource();
/**
* @return the platform specific project representation for this location. Never <code>null</code>.
*/
PlatformProject getProject();
}

View file

@ -19,16 +19,8 @@ import org.eclipse.xtext.util.ITextRegion;
*/
public interface IPlatformSpecificTrace<
PlatformResource,
PlatformProject,
Location extends IPlatformSpecificLocation<PlatformResource, PlatformProject>,
Trace extends IPlatformSpecificTrace<PlatformResource, PlatformProject, Location, Trace>> extends ITrace {
Location extends IPlatformSpecificLocation<? extends PlatformResource>> extends ITrace {
/**
* Returns the source project. Never <code>null</code>.
* @return the source project. Never <code>null</code>.
*/
PlatformProject getLocalProject();
/**
* Returns the storage that is associated with this trace.
* @return the associated storage. Never <code>null</code>.
@ -79,12 +71,6 @@ public interface IPlatformSpecificTrace<
@Override
Iterable<? extends Location> getAllAssociatedLocations();
@Override
Iterable<? extends Trace> getAllInverseTraces();
@Override
Trace getInverseTrace(AbsoluteURI uri);
@Override
Location getBestAssociatedLocation(ITextRegion localRegion, AbsoluteURI uri);

View file

@ -20,7 +20,7 @@ import org.eclipse.xtext.workspace.IWorkspaceConfig;
*/
public interface IPlatformSpecificTraceProvider<
PlatformResource,
Trace extends IPlatformSpecificTrace<PlatformResource, ?, ?, Trace>>
Trace extends IPlatformSpecificTrace<PlatformResource, ?>>
extends ITraceForURIProvider {
/**

View file

@ -17,7 +17,7 @@ import org.eclipse.xtext.workspace.IWorkspaceConfig;
*
* @author Sebastian Zarnekow - Initial contribution and API
*/
public class NoTraces<PlatformResource, Trace extends IPlatformSpecificTrace<PlatformResource,?,?,Trace>> implements IPlatformSpecificTraceProvider<PlatformResource, Trace> {
public class NoTraces<PlatformResource, Trace extends IPlatformSpecificTrace<PlatformResource,?>> implements IPlatformSpecificTraceProvider<PlatformResource, Trace> {
@Override
public Trace getTraceToSource(PlatformResource derivedResource) {