Bug 82167 [typing] Smart Typing Preferences: Plural of "parenthesis" is "parentheses"
Smart Typing Preferences says: Typing > Automatically close... - Strings - Brackets and parenthesis' - Braces [..] The correct plural of "parenthesis" is "parentheses". I would find it more convenient, if the characters of the bracket classes would also be part of the preference names, e.g.: - (Parentheses), [square] and <angular> brackets - {Braces} or - Parentheses(), square[] and angular<> brackets - Braces{}
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/CompilationUnitEditor.java
final Point selection= sourceViewer.getSelectedRange();
			final int offset= selection.x;
			final int length= selection.y;
			
			try {
				IRegion startLine= document.getLineInformationOfOffset(offset);
				IRegion endLine= document.getLineInformationOfOffset(offset + length);
				
				JavaHeuristicScanner scanner= new JavaHeuristicScanner(document);
				int nextToken= scanner.nextToken(offset + length, endLine.getOffset() + endLine.getLength());
				String next= nextToken == Symbols.TokenEOF ? null : document.get(offset, scanner.getPosition() - offset).trim();
				int prevToken= scanner.previousToken(offset - 1, startLine.getOffset());
				int prevTokenOffset= scanner.getPosition() + 1;
				String previous= prevToken == Symbols.TokenEOF ? null : document.get(prevTokenOffset, offset - prevTokenOffset).trim();
				
				switch (event.character) {
					case '(':
						if (!fCloseBrackets
								|| nextToken == Symbols.TokenLPAREN
								|| nextToken == Symbols.TokenIDENT 
								|| next != null && next.length() > 1)
							return;
						break;
						
					case '<':
						if (!fCloseAngularBrackets
								|| nextToken == Symbols.TokenLESSTHAN 
								|| nextToken == Symbols.TokenIDENT
								|| 		   prevToken != Symbols.TokenLBRACE	
										&& prevToken != Symbols.TokenRBRACE