Bug 48641 [typing] Smart paste "fixes" comments
A new feature was added to M5 where smart paste fixes C style comments into Java style comments: /* * */ becomes: /* * */ The problem is that we have lots of text that is formatted the using C style and using smart paste makes the code inconistent. I don't use the feature but others on the team do. Shouldn't smart paste just indent the code?
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/java/JavaAutoIndentStrategy.java
installJavaStuff(temp);
			
			int lines= temp.getNumberOfLines();
			for (int l= document.computeNumberOfLines(prefix); l < lines; l++) { 
				IRegion r= temp.getLineInformation(l);
				lineOffset= r.getOffset();
				int lineLength= r.getLength();
				
				if (lineLength == 0) 
					continue;
				
				if (lineOffset < temp.getLength() - 1) {
					
					String s= temp.get(lineOffset, 2);
					if ("//".equals(s)) { 
						continue;
					}
				}
				
				StringBuffer indent= indenter.computeIndentation(lineOffset);
				if (indent == null) 
					return;
				
				
				ITypedRegion partition= temp.getPartition(IJavaPartitions.JAVA_PARTITIONING, lineOffset);
				String type= partition.getType();
				if (type.equals(IJavaPartitions.JAVA_DOC) || type.equals(IJavaPartitions.JAVA_MULTI_LINE_COMMENT))
					if (partition.getOffset() != lineOffset) 
						indent.append(' ');