Skip to content

Commit

Permalink
Simplify
Browse files Browse the repository at this point in the history
  • Loading branch information
dfuchss committed Nov 29, 2024
1 parent 67573bf commit d1e4d1a
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ private ImmutableSet<TraceLink<SentenceEntity, CodeCompilationUnit>> combineToTr
for (TraceLink<SentenceEntity, ArchitectureEntity> sadSamTraceLink : sadSamTraceLinks) {
String modelElementUid = sadSamTraceLink.getSecondEndpoint().getId();
for (TraceLink<ArchitectureEntity, CodeCompilationUnit> samCodeTraceLink : samCodeTraceLinks) {
String samCodeTraceLinkModelElementId = samCodeTraceLink.asPair().first().getId();
String samCodeTraceLinkModelElementId = samCodeTraceLink.getFirstEndpoint().getId();
if (modelElementUid.equals(samCodeTraceLinkModelElementId)) {
var transitiveTraceLinkOptional = TransitiveTraceLink.createTransitiveTraceLink(sadSamTraceLink, samCodeTraceLink);
transitiveTraceLinkOptional.ifPresent(it -> transitiveTraceLinks.add(it));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ public final class ArCoTLModelProviderInformant extends Informant {
private final File fromFile;

// Needed for Configuration Generation
@SuppressWarnings("unused")
private ArCoTLModelProviderInformant() {
super(null, null);
this.extractor = null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,41 +15,40 @@ public class CoreNLPProvider extends NlpInformant {
private Text annotatedText;

// Needed for Configuration Generation
@SuppressWarnings("unused")
private CoreNLPProvider() {
super(CoreNLPProvider.class.getSimpleName(), null);
}

public CoreNLPProvider(DataRepository data) {
super(CoreNLPProvider.class.getSimpleName(), data);
annotatedText = null;
this.annotatedText = null;
}

@Override
public void process() {
if (!DataRepositoryHelper.hasAnnotatedText(getDataRepository())) {
var preprocessingData = new PreprocessingData(getAnnotatedText());
DataRepositoryHelper.putPreprocessingData(getDataRepository(), preprocessingData);
if (!DataRepositoryHelper.hasAnnotatedText(this.getDataRepository())) {
var preprocessingData = new PreprocessingData(this.getAnnotatedText());
DataRepositoryHelper.putPreprocessingData(this.getDataRepository(), preprocessingData);
}
}

@Override
public Text getAnnotatedText(String textName) {
logger.warn("Returning annotated text ignoring the provided name");
return getAnnotatedText();
this.logger.warn("Returning annotated text ignoring the provided name");
return this.getAnnotatedText();
}

@Override
public synchronized Text getAnnotatedText() {
if (annotatedText == null) {
if (DataRepositoryHelper.hasAnnotatedText(getDataRepository())) {
annotatedText = DataRepositoryHelper.getAnnotatedText(getDataRepository());
if (this.annotatedText == null) {
if (DataRepositoryHelper.hasAnnotatedText(this.getDataRepository())) {
this.annotatedText = DataRepositoryHelper.getAnnotatedText(this.getDataRepository());
} else {
String text = DataRepositoryHelper.getInputText(getDataRepository());
annotatedText = processText(text);
String text = DataRepositoryHelper.getInputText(this.getDataRepository());
this.annotatedText = this.processText(text);
}
}
return annotatedText;
return this.annotatedText;
}

private Text processText(String inputText) {
Expand Down

0 comments on commit d1e4d1a

Please sign in to comment.