Bug 40205 automatically insert closing brace: does not handle '//' in strings
200307150800 1. Try this snippet { String s= "//"; void m() <CURSOR> } 2. Insert an opening brace 3. Press <ENTER> The expected closing brace does not get inserted
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/java/JavaAutoIndentStrategy.java
int docLength= document.getLength();
		if (command.offset == -1 || docLength == 0)
			return 0;
		try {
			
			int p= (command.offset == docLength ? command.offset - 1 : command.offset);
			int line= document.getLineOfOffset(p);
			IRegion region= document.getLineInformation(line);
			String string= document.get(region.getOffset(), command.offset - region.getOffset());
			if (line != 0 && string.trim().length() == 0)
				--line;
			
			while (line != 0 && isLineEmpty(document, line))
				--line;
			int start= document.getLineOffset(line);
			
			
			IDocumentPartitioner partitioner= document.getDocumentPartitioner();
			if (partitioner != null) {
				ITypedRegion typedRegion= partitioner.getPartition(start);
				if (IJavaPartitions.JAVA_DOC.equals(typedRegion.getType()))
					start= document.getLineInformationOfOffset(typedRegion.getOffset()).getOffset();
				else if (IJavaPartitions.JAVA_SINGLE_LINE_COMMENT.equals(typedRegion.getType())) {
					buffer.append(COMMENT);
					start += 2;
				}
			}
			int whiteend= findEndOfWhiteSpace(document, start, command.offset);
			buffer.append(document.get(start, whiteend - start));
			if (getBracketCount(document, start, command.offset, true) > 0) {