1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-01 06:05:24 +02:00

Restore assertion statements in tm.terminal

Change-Id: I37c18cb5274d589feae941386ce912eb5ba2b94c
Signed-off-by: gwatson <g.watson@computer.org>
This commit is contained in:
gwatson 2014-05-28 09:41:46 -04:00
parent 6375198da9
commit eacc6dd5ba
9 changed files with 75 additions and 35 deletions

View file

@ -1,6 +1,13 @@
eclipse.preferences.version=1 eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.annotation.inheritNullAnnotations=disabled
org.eclipse.jdt.core.compiler.annotation.missingNonNullByDefaultAnnotation=ignore
org.eclipse.jdt.core.compiler.annotation.nonnull=org.eclipse.jdt.annotation.NonNull
org.eclipse.jdt.core.compiler.annotation.nonnullbydefault=org.eclipse.jdt.annotation.NonNullByDefault
org.eclipse.jdt.core.compiler.annotation.nullable=org.eclipse.jdt.annotation.Nullable
org.eclipse.jdt.core.compiler.annotation.nullanalysis=disabled
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.2 org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.4
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
org.eclipse.jdt.core.compiler.compliance=1.4 org.eclipse.jdt.core.compiler.compliance=1.4
org.eclipse.jdt.core.compiler.debug.lineNumber=generate org.eclipse.jdt.core.compiler.debug.lineNumber=generate
@ -8,20 +15,25 @@ org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.debug.sourceFile=generate org.eclipse.jdt.core.compiler.debug.sourceFile=generate
org.eclipse.jdt.core.compiler.doc.comment.support=enabled org.eclipse.jdt.core.compiler.doc.comment.support=enabled
org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning
org.eclipse.jdt.core.compiler.problem.assertIdentifier=warning org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.autoboxing=warning org.eclipse.jdt.core.compiler.problem.autoboxing=warning
org.eclipse.jdt.core.compiler.problem.comparingIdentical=warning
org.eclipse.jdt.core.compiler.problem.deadCode=warning
org.eclipse.jdt.core.compiler.problem.deprecation=warning org.eclipse.jdt.core.compiler.problem.deprecation=warning
org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=enabled org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=enabled
org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=enabled org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=enabled
org.eclipse.jdt.core.compiler.problem.discouragedReference=warning org.eclipse.jdt.core.compiler.problem.discouragedReference=warning
org.eclipse.jdt.core.compiler.problem.emptyStatement=warning org.eclipse.jdt.core.compiler.problem.emptyStatement=warning
org.eclipse.jdt.core.compiler.problem.enumIdentifier=warning org.eclipse.jdt.core.compiler.problem.enumIdentifier=warning
org.eclipse.jdt.core.compiler.problem.explicitlyClosedAutoCloseable=ignore
org.eclipse.jdt.core.compiler.problem.fallthroughCase=warning org.eclipse.jdt.core.compiler.problem.fallthroughCase=warning
org.eclipse.jdt.core.compiler.problem.fatalOptionalError=disabled
org.eclipse.jdt.core.compiler.problem.fieldHiding=warning org.eclipse.jdt.core.compiler.problem.fieldHiding=warning
org.eclipse.jdt.core.compiler.problem.finalParameterBound=warning org.eclipse.jdt.core.compiler.problem.finalParameterBound=warning
org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning
org.eclipse.jdt.core.compiler.problem.forbiddenReference=error org.eclipse.jdt.core.compiler.problem.forbiddenReference=error
org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning
org.eclipse.jdt.core.compiler.problem.includeNullInfoFromAsserts=disabled
org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning
org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=warning org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=warning
org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=warning org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=warning
@ -32,43 +44,71 @@ org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsNotVisibleRef=disabled
org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsVisibility=protected org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsVisibility=protected
org.eclipse.jdt.core.compiler.problem.localVariableHiding=ignore org.eclipse.jdt.core.compiler.problem.localVariableHiding=ignore
org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=error org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=error
org.eclipse.jdt.core.compiler.problem.missingDefaultCase=ignore
org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=ignore org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=ignore
org.eclipse.jdt.core.compiler.problem.missingEnumCaseDespiteDefault=disabled
org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=ignore
org.eclipse.jdt.core.compiler.problem.missingJavadocComments=ignore org.eclipse.jdt.core.compiler.problem.missingJavadocComments=ignore
org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsOverriding=enabled org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsOverriding=enabled
org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsVisibility=public org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsVisibility=public
org.eclipse.jdt.core.compiler.problem.missingJavadocTagDescription=all_standard_tags org.eclipse.jdt.core.compiler.problem.missingJavadocTagDescription=all_standard_tags
org.eclipse.jdt.core.compiler.problem.missingJavadocTags=ignore org.eclipse.jdt.core.compiler.problem.missingJavadocTags=ignore
org.eclipse.jdt.core.compiler.problem.missingJavadocTagsMethodTypeParameters=disabled
org.eclipse.jdt.core.compiler.problem.missingJavadocTagsOverriding=disabled org.eclipse.jdt.core.compiler.problem.missingJavadocTagsOverriding=disabled
org.eclipse.jdt.core.compiler.problem.missingJavadocTagsVisibility=public org.eclipse.jdt.core.compiler.problem.missingJavadocTagsVisibility=public
org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=ignore org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=ignore
org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotationForInterfaceMethodImplementation=enabled
org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning
org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=ignore
org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning
org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning
org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=warning org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=warning
org.eclipse.jdt.core.compiler.problem.nonnullParameterAnnotationDropped=warning
org.eclipse.jdt.core.compiler.problem.nullAnnotationInferenceConflict=error
org.eclipse.jdt.core.compiler.problem.nullReference=warning org.eclipse.jdt.core.compiler.problem.nullReference=warning
org.eclipse.jdt.core.compiler.problem.nullSpecViolation=error
org.eclipse.jdt.core.compiler.problem.nullUncheckedConversion=warning
org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=error org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=error
org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore
org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=warning org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=warning
org.eclipse.jdt.core.compiler.problem.potentialNullReference=ignore
org.eclipse.jdt.core.compiler.problem.potentiallyUnclosedCloseable=ignore
org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning
org.eclipse.jdt.core.compiler.problem.redundantNullAnnotation=warning
org.eclipse.jdt.core.compiler.problem.redundantNullCheck=ignore
org.eclipse.jdt.core.compiler.problem.redundantSpecificationOfTypeArguments=ignore
org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=ignore
org.eclipse.jdt.core.compiler.problem.reportMethodCanBePotentiallyStatic=ignore
org.eclipse.jdt.core.compiler.problem.reportMethodCanBeStatic=ignore
org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled
org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning
org.eclipse.jdt.core.compiler.problem.suppressOptionalErrors=disabled
org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled
org.eclipse.jdt.core.compiler.problem.syntacticNullAnalysisForFields=disabled
org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore
org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning
org.eclipse.jdt.core.compiler.problem.unavoidableGenericTypeProblems=enabled
org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning
org.eclipse.jdt.core.compiler.problem.unclosedCloseable=warning
org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore
org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning
org.eclipse.jdt.core.compiler.problem.unnecessaryElse=ignore org.eclipse.jdt.core.compiler.problem.unnecessaryElse=ignore
org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=warning org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=warning
org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore
org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=ignore org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=ignore
org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExceptionAndThrowable=enabled
org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=enabled
org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled
org.eclipse.jdt.core.compiler.problem.unusedImport=warning org.eclipse.jdt.core.compiler.problem.unusedImport=warning
org.eclipse.jdt.core.compiler.problem.unusedLabel=warning org.eclipse.jdt.core.compiler.problem.unusedLabel=warning
org.eclipse.jdt.core.compiler.problem.unusedLocal=warning org.eclipse.jdt.core.compiler.problem.unusedLocal=warning
org.eclipse.jdt.core.compiler.problem.unusedObjectAllocation=ignore
org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore
org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=enabled
org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled
org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled
org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning
org.eclipse.jdt.core.compiler.problem.unusedTypeParameter=ignore
org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning
org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
org.eclipse.jdt.core.compiler.source=1.3 org.eclipse.jdt.core.compiler.source=1.4

View file

@ -206,7 +206,7 @@ public class VT100EmulatorBackend implements IVT100EmulatorBackend {
synchronized (fTerminal) { synchronized (fTerminal) {
if(!isCusorInScrollingRegion()) if(!isCusorInScrollingRegion())
return; return;
// assert n>0; assert n>0;
int line=toAbsoluteLine(fCursorLine); int line=toAbsoluteLine(fCursorLine);
int nLines=fTerminal.getHeight()-line; int nLines=fTerminal.getHeight()-line;
fTerminal.scroll(line, nLines, n); fTerminal.scroll(line, nLines, n);
@ -236,7 +236,7 @@ public class VT100EmulatorBackend implements IVT100EmulatorBackend {
synchronized (fTerminal) { synchronized (fTerminal) {
if(!isCusorInScrollingRegion()) if(!isCusorInScrollingRegion())
return; return;
// assert n>0; assert n>0;
int line=toAbsoluteLine(fCursorLine); int line=toAbsoluteLine(fCursorLine);
int nLines=fTerminal.getHeight()-line; int nLines=fTerminal.getHeight()-line;
fTerminal.scroll(line, nLines, -n); fTerminal.scroll(line, nLines, -n);

View file

@ -254,7 +254,7 @@ public class SnapshotChanges implements ISnapshotChanges {
* @param shift must be negative! * @param shift must be negative!
*/ */
private void scrollChangesLinesWithNegativeShift(int line, int n, int shift) { private void scrollChangesLinesWithNegativeShift(int line, int n, int shift) {
// assert shift <0 || throwRuntimeException(); assert shift <0 || throwRuntimeException();
// scroll the region // scroll the region
// don't run out of bounds! // don't run out of bounds!
int m=Math.min(line+n+shift,getChangedLineLength()+shift); int m=Math.min(line+n+shift,getChangedLineLength()+shift);

View file

@ -34,8 +34,8 @@ public class TerminalTextDataFastScroll implements ITerminalTextData {
fMaxHeight=maxHeight; fMaxHeight=maxHeight;
fData=data; fData=data;
fData.setDimensions(maxHeight, fData.getWidth()); fData.setDimensions(maxHeight, fData.getWidth());
// if(maxHeight>2) if(maxHeight>2)
// assert shiftOffset(-2) || throwRuntimeException(); assert shiftOffset(-2) || throwRuntimeException();
} }
public TerminalTextDataFastScroll(int maxHeight) { public TerminalTextDataFastScroll(int maxHeight) {
this(new TerminalTextDataStore(),maxHeight); this(new TerminalTextDataStore(),maxHeight);
@ -64,7 +64,7 @@ public class TerminalTextDataFastScroll implements ITerminalTextData {
* @param delta * @param delta
*/ */
void moveOffset(int delta) { void moveOffset(int delta) {
// assert Math.abs(delta)<fMaxHeight || throwRuntimeException(); assert Math.abs(delta)<fMaxHeight || throwRuntimeException();
fOffset=(fMaxHeight+fOffset+delta)%fMaxHeight; fOffset=(fMaxHeight+fOffset+delta)%fMaxHeight;
} }
@ -101,19 +101,19 @@ public class TerminalTextDataFastScroll implements ITerminalTextData {
} }
public void copyRange(ITerminalTextData source, int sourceStartLine, int destStartLine, int length) { public void copyRange(ITerminalTextData source, int sourceStartLine, int destStartLine, int length) {
// assert (destStartLine>=0 && destStartLine+length<=fHeight) || throwRuntimeException(); assert (destStartLine>=0 && destStartLine+length<=fHeight) || throwRuntimeException();
for (int i = 0; i < length; i++) { for (int i = 0; i < length; i++) {
fData.copyLine(source, i+sourceStartLine, getPositionOfLine(i+destStartLine)); fData.copyLine(source, i+sourceStartLine, getPositionOfLine(i+destStartLine));
} }
} }
public char getChar(int line, int column) { public char getChar(int line, int column) {
// assert (line>=0 && line<fHeight) || throwRuntimeException(); assert (line>=0 && line<fHeight) || throwRuntimeException();
return fData.getChar(getPositionOfLine(line), column); return fData.getChar(getPositionOfLine(line), column);
} }
public char[] getChars(int line) { public char[] getChars(int line) {
// assert (line>=0 && line<fHeight) || throwRuntimeException(); assert (line>=0 && line<fHeight) || throwRuntimeException();
return fData.getChars(getPositionOfLine(line)); return fData.getChars(getPositionOfLine(line));
} }
@ -122,7 +122,7 @@ public class TerminalTextDataFastScroll implements ITerminalTextData {
} }
public LineSegment[] getLineSegments(int line, int startCol, int numberOfCols) { public LineSegment[] getLineSegments(int line, int startCol, int numberOfCols) {
// assert (line>=0 && line<fHeight) || throwRuntimeException(); assert (line>=0 && line<fHeight) || throwRuntimeException();
return fData.getLineSegments(getPositionOfLine(line), startCol, numberOfCols); return fData.getLineSegments(getPositionOfLine(line), startCol, numberOfCols);
} }
@ -131,12 +131,12 @@ public class TerminalTextDataFastScroll implements ITerminalTextData {
} }
public Style getStyle(int line, int column) { public Style getStyle(int line, int column) {
// assert (line>=0 && line<fHeight) || throwRuntimeException(); assert (line>=0 && line<fHeight) || throwRuntimeException();
return fData.getStyle(getPositionOfLine(line), column); return fData.getStyle(getPositionOfLine(line), column);
} }
public Style[] getStyles(int line) { public Style[] getStyles(int line) {
// assert (line>=0 && line<fHeight) || throwRuntimeException(); assert (line>=0 && line<fHeight) || throwRuntimeException();
return fData.getStyles(getPositionOfLine(line)); return fData.getStyles(getPositionOfLine(line));
} }
@ -153,7 +153,7 @@ public class TerminalTextDataFastScroll implements ITerminalTextData {
} }
} }
public void scroll(int startLine, int size, int shift) { public void scroll(int startLine, int size, int shift) {
// assert (startLine>=0 && startLine+size<=fHeight) || throwRuntimeException(); assert (startLine>=0 && startLine+size<=fHeight) || throwRuntimeException();
if(shift>=fMaxHeight || -shift>=fMaxHeight) { if(shift>=fMaxHeight || -shift>=fMaxHeight) {
cleanLines(startLine, fMaxHeight-startLine); cleanLines(startLine, fMaxHeight-startLine);
return; return;
@ -187,23 +187,23 @@ public class TerminalTextDataFastScroll implements ITerminalTextData {
} }
public void setChar(int line, int column, char c, Style style) { public void setChar(int line, int column, char c, Style style) {
// assert (line>=0 && line<fHeight) || throwRuntimeException(); assert (line>=0 && line<fHeight) || throwRuntimeException();
fData.setChar(getPositionOfLine(line), column, c, style); fData.setChar(getPositionOfLine(line), column, c, style);
} }
public void setChars(int line, int column, char[] chars, int start, int len, Style style) { public void setChars(int line, int column, char[] chars, int start, int len, Style style) {
// assert (line>=0 && line<fHeight) || throwRuntimeException(); assert (line>=0 && line<fHeight) || throwRuntimeException();
fData.setChars(getPositionOfLine(line), column, chars, start, len, style); fData.setChars(getPositionOfLine(line), column, chars, start, len, style);
} }
public void setChars(int line, int column, char[] chars, Style style) { public void setChars(int line, int column, char[] chars, Style style) {
// assert (line>=0 && line<fHeight) || throwRuntimeException(); assert (line>=0 && line<fHeight) || throwRuntimeException();
fData.setChars(getPositionOfLine(line), column, chars, style); fData.setChars(getPositionOfLine(line), column, chars, style);
} }
public void setDimensions(int height, int width) { public void setDimensions(int height, int width) {
// assert height>=0 || throwRuntimeException(); assert height>=0 || throwRuntimeException();
// assert width>=0 || throwRuntimeException(); assert width>=0 || throwRuntimeException();
if(height > fMaxHeight) if(height > fMaxHeight)
setMaxHeight(height); setMaxHeight(height);
fHeight=height; fHeight=height;
@ -212,7 +212,7 @@ public class TerminalTextDataFastScroll implements ITerminalTextData {
} }
public void setMaxHeight(int maxHeight) { public void setMaxHeight(int maxHeight) {
// assert maxHeight>=fHeight || throwRuntimeException(); assert maxHeight>=fHeight || throwRuntimeException();
// move everything to offset0 // move everything to offset0
int start=getPositionOfLine(0); int start=getPositionOfLine(0);
if(start!=0) { if(start!=0) {

View file

@ -267,8 +267,8 @@ class TerminalTextDataSnapshot implements ITerminalTextDataSnapshot {
} }
public void setInterestWindow(int startLine, int size) { public void setInterestWindow(int startLine, int size) {
// assert startLine>=0 || throwRuntimeException(); assert startLine>=0 || throwRuntimeException();
// assert size>=0 || throwRuntimeException(); assert size>=0 || throwRuntimeException();
fInterestWindowStartLine=startLine; fInterestWindowStartLine=startLine;
fInterestWindowSize=size; fInterestWindowSize=size;
fSnapshot.setWindow(startLine, size); fSnapshot.setWindow(startLine, size);

View file

@ -62,8 +62,8 @@ public class TerminalTextDataStore implements ITerminalTextData {
* @see org.eclipse.tm.internal.terminal.text.ITerminalTextData#setDimensions(int, int) * @see org.eclipse.tm.internal.terminal.text.ITerminalTextData#setDimensions(int, int)
*/ */
public void setDimensions(int height, int width) { public void setDimensions(int height, int width) {
// assert height>=0 || throwRuntimeException(); assert height>=0 || throwRuntimeException();
// assert width>=0 || throwRuntimeException(); assert width>=0 || throwRuntimeException();
// just extend the region // just extend the region
if(height>fChars.length) { if(height>fChars.length) {
int h=4*height/3; int h=4*height/3;
@ -144,7 +144,7 @@ public class TerminalTextDataStore implements ITerminalTextData {
* @see org.eclipse.tm.internal.terminal.text.ITerminalTextData#getChar(int, int) * @see org.eclipse.tm.internal.terminal.text.ITerminalTextData#getChar(int, int)
*/ */
public char getChar(int line, int column) { public char getChar(int line, int column) {
// assert column<fWidth || throwRuntimeException(); assert column<fWidth || throwRuntimeException();
if(fChars[line]==null||column>=fChars[line].length) if(fChars[line]==null||column>=fChars[line].length)
return 0; return 0;
return fChars[line][column]; return fChars[line][column];
@ -153,7 +153,7 @@ public class TerminalTextDataStore implements ITerminalTextData {
* @see org.eclipse.tm.internal.terminal.text.ITerminalTextData#getStyle(int, int) * @see org.eclipse.tm.internal.terminal.text.ITerminalTextData#getStyle(int, int)
*/ */
public Style getStyle(int line, int column) { public Style getStyle(int line, int column) {
// assert column<fWidth || throwRuntimeException(); assert column<fWidth || throwRuntimeException();
if(fStyle[line]==null || column>=fStyle[line].length) if(fStyle[line]==null || column>=fStyle[line].length)
return null; return null;
return fStyle[line][column]; return fStyle[line][column];
@ -202,7 +202,7 @@ public class TerminalTextDataStore implements ITerminalTextData {
* @see org.eclipse.tm.internal.terminal.text.ITerminalTextData#scroll(int, int, int) * @see org.eclipse.tm.internal.terminal.text.ITerminalTextData#scroll(int, int, int)
*/ */
public void scroll(int startLine, int size, int shift) { public void scroll(int startLine, int size, int shift) {
// assert startLine+size <= getHeight() || throwRuntimeException(); assert startLine+size <= getHeight() || throwRuntimeException();
if(shift<0) { if(shift<0) {
// move the region up // move the region up
// shift is negative!! // shift is negative!!

View file

@ -128,7 +128,7 @@ public class TerminalTextDataWindow implements ITerminalTextData {
fData.copyLine(source, sourceLine, destLine-fWindowStartLine); fData.copyLine(source, sourceLine, destLine-fWindowStartLine);
} }
public void scroll(int startLine, int size, int shift) { public void scroll(int startLine, int size, int shift) {
// assert (startLine>=0 && startLine+size<=fHeight) || throwRuntimeException(); assert (startLine>=0 && startLine+size<=fHeight) || throwRuntimeException();
int n=size; int n=size;
int start=startLine-fWindowStartLine; int start=startLine-fWindowStartLine;
// if start outside our range, cut the length to copy // if start outside our range, cut the length to copy
@ -157,7 +157,7 @@ public class TerminalTextDataWindow implements ITerminalTextData {
fData.setChars(line-fWindowStartLine, column, chars, style); fData.setChars(line-fWindowStartLine, column, chars, style);
} }
public void setDimensions(int height, int width) { public void setDimensions(int height, int width) {
// assert height>=0 || throwRuntimeException(); assert height>=0 || throwRuntimeException();
fData.setDimensions(fWindowSize, width); fData.setDimensions(fWindowSize, width);
fHeight=height; fHeight=height;
} }
@ -165,7 +165,7 @@ public class TerminalTextDataWindow implements ITerminalTextData {
fMaxHeight=height; fMaxHeight=height;
} }
public void setWindow(int startLine, int size) { public void setWindow(int startLine, int size) {
// assert startLine+size<=getHeight()||throwRuntimeException(); assert startLine+size<=getHeight()||throwRuntimeException();
fWindowStartLine=startLine; fWindowStartLine=startLine;
fWindowSize=size; fWindowSize=size;
fData.setDimensions(fWindowSize, getWidth()); fData.setDimensions(fWindowSize, getWidth());

View file

@ -231,7 +231,7 @@ abstract public class AbstractTextCanvasModel implements ITextCanvasModel {
fCurrentSelection=extractSelectedText(); fCurrentSelection=extractSelectedText();
} }
private void doSetSelection(int startLine, int endLine, int startColumn, int endColumn) { private void doSetSelection(int startLine, int endLine, int startColumn, int endColumn) {
// assert(startLine<0 || startLine<=endLine); assert(startLine<0 || startLine<=endLine);
if(startLine>=0) { if(startLine>=0) {
if(fSelectionSnapshot==null) { if(fSelectionSnapshot==null) {
fSelectionSnapshot=fSnapshot.getTerminalTextData().makeSnapshot(); fSelectionSnapshot=fSnapshot.getTerminalTextData().makeSnapshot();

View file

@ -97,7 +97,7 @@ public class PipedInputStream extends InputStream {
return fBuffer.length - fUsedSlots; return fBuffer.length - fUsedSlots;
} }
public void write(byte[] b, int off, int len) throws InterruptedException { public void write(byte[] b, int off, int len) throws InterruptedException {
// assert len<=getFreeSlots(); assert len<=getFreeSlots();
while (fUsedSlots == fBuffer.length) while (fUsedSlots == fBuffer.length)
// wait until not full // wait until not full
wait(); wait();
@ -133,7 +133,7 @@ public class PipedInputStream extends InputStream {
return b; return b;
} }
public int read(byte[] cbuf, int off, int len) throws InterruptedException { public int read(byte[] cbuf, int off, int len) throws InterruptedException {
// assert len<=available(); assert len<=available();
while (fUsedSlots == 0) { while (fUsedSlots == 0) {
if(fClosed) if(fClosed)
return 0; return 0;