diff --git a/JavaCompilerPlugin/bundles/JavaCompilerPlugin.Plugin/src/typinferenzplugin/editor/JavEditor.java b/JavaCompilerPlugin/bundles/JavaCompilerPlugin.Plugin/src/typinferenzplugin/editor/JavEditor.java index 676dab5..9f7597f 100644 --- a/JavaCompilerPlugin/bundles/JavaCompilerPlugin.Plugin/src/typinferenzplugin/editor/JavEditor.java +++ b/JavaCompilerPlugin/bundles/JavaCompilerPlugin.Plugin/src/typinferenzplugin/editor/JavEditor.java @@ -256,7 +256,6 @@ public class JavEditor extends TextEditor implements UnifyResultListener { // Add extra offset for the additional insert points of "typeReplaceMarker" // to "toCheck" // ... - /* for (TypeInsertPoint additionalPoint : typeReplaceMarker.getInsertPoint().getAdditionalPointsUnsorted()) { int lengthAdditionalInsert = additionalPoint.getInsertString().length(); int positionAdditionalInsert = additionalPoint.getPositionInCode(); @@ -265,13 +264,12 @@ public class JavEditor extends TextEditor implements UnifyResultListener { toCheck.getInsertPoint().point.addExtraOffset(lengthAdditionalInsert); } } - */ for (TypeInsertPoint tip : typeReplaceMarker.getInsertPoint().getAdditionalPointsUnsorted()) { // Add to all other type replace markers the extra offsets of the additional // points of this type replace marker. // ... - if (toCheck.getPoint().getPositionInCode() > postitionOfInsert - tip.getInsertString().length()) { + if (toCheck.getPoint().getPositionInCode() > tip.getPositionInCode()) { toCheck.getInsertPoint().point.addExtraOffset(tip.getInsertString().length()); } } @@ -285,7 +283,7 @@ public class JavEditor extends TextEditor implements UnifyResultListener { int lengthAdditionalInsert = additionalPoint.getInsertString().length(); int positionAdditionalInsert = additionalPoint.getPositionInCode(); - if (positionAdditionalInsert + lengthAdditionalInsert < toCheckAddi.getPositionInCode() ) { + if (toCheckAddi.getPositionInCode() > positionAdditionalInsert) { toCheckAddi.addExtraOffset(lengthAdditionalInsert); } }