while (slashes > 0) {
while (slashes > 0 && computed.length() > 0) {
	private boolean indentLine(IDocument document, int line, int caret, JavaIndenter indenter, JavaHeuristicScanner scanner) throws BadLocationException {		IRegion currentLine= document.getLineInformation(line);		int offset= currentLine.getOffset();		int wsStart= offset; // where we start searching for non-WS; after the "//" in single line comments				String indent= null;		if (offset < document.getLength()) {			ITypedRegion partition= TextUtilities.getPartition(document, IJavaPartitions.JAVA_PARTITIONING, offset);			String type= partition.getType();			if (partition.getOffset() < offset					&& type.equals(IJavaPartitions.JAVA_DOC)					|| type.equals(IJavaPartitions.JAVA_MULTI_LINE_COMMENT)) {								// TODO this is a hack				// what I want to do//				new JavaDocAutoIndentStrategy().indentLineAtOffset(document, offset);//				return;				int start= 0;				if (line > 0) {					IRegion previousLine= document.getLineInformation(line - 1);					start= previousLine.getOffset() + previousLine.getLength();				}				DocumentCommand command= new DocumentCommand() {};				command.text= "\n"; //$NON-NLS-1$				command.offset= start;				new JavaDocAutoIndentStrategy(IJavaPartitions.JAVA_PARTITIONING).customizeDocumentCommand(document, command);				int to= 1;				while (to < command.text.length() && Character.isWhitespace(command.text.charAt(to)))					to++;				indent= command.text.substring(1, to);							} else if (partition.getOffset() == offset && type.equals(IJavaPartitions.JAVA_SINGLE_LINE_COMMENT)) {								// line comment starting at position 0 -> indent inside				int slashes= 2;				while (slashes < document.getLength() - 1 && document.get(offset + slashes, 2).equals("//")) //$NON-NLS-1$					slashes+= 2;								wsStart= offset + slashes;								StringBuffer computed= indenter.computeIndentation(offset);				int tabSize= JavaPlugin.getDefault().getPreferenceStore().getInt(PreferenceConstants.EDITOR_TAB_WIDTH);				while (slashes > 0) {					char c= computed.charAt(0);					if (c == '\t')						if (slashes > tabSize)							slashes-= tabSize;						else							break;					else if (c == ' ')						slashes--;					else break;										computed.deleteCharAt(0);				}								indent= document.get(offset, wsStart - offset) + computed;							}		} 				// standard java indentation		if (indent == null) {			StringBuffer computed= indenter.computeIndentation(offset);			if (computed != null)				indent= computed.toString();			else				indent= new String();		}				// change document:		// get current white space		int lineLength= currentLine.getLength();		int end= scanner.findNonWhitespaceForwardInAnyPartition(wsStart, offset + lineLength);		if (end == JavaHeuristicScanner.NOT_FOUND)			end= offset + lineLength;		int length= end - offset;		String currentIndent= document.get(offset, length);				// if we are right before the text start / line end, and already after the insertion point		// then just insert a tab.		if (fIsTabAction && caret == end && whiteSpaceLength(currentIndent) >= whiteSpaceLength(indent)) {			String tab= getTabEquivalent();			document.replace(caret, 0, tab);			fCaretOffset= caret + tab.length();			return true;		}				// set the caret offset so it can be used when setting the selection		if (caret >= offset && caret <= end)			fCaretOffset= offset + indent.length();		else			fCaretOffset= -1;				// only change the document if it is a real change		if (!indent.equals(currentIndent)) {			document.replace(offset, length, indent);			return true;		} else			return false;	}