Fine tuning for  Bug 315310 -  [assist] creating before/after callin using completion should set return type to void
 - don't add "void" option if return type is already void
 - adjust post-selection in one test
diff --git a/plugins/org.eclipse.objectteams.otdt.jdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/assist/CompletionAdaptor/CreateMethodMappingCompletionProposal.java b/plugins/org.eclipse.objectteams.otdt.jdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/assist/CompletionAdaptor/CreateMethodMappingCompletionProposal.java
index 7070d2f..35b1a49 100644
--- a/plugins/org.eclipse.objectteams.otdt.jdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/assist/CompletionAdaptor/CreateMethodMappingCompletionProposal.java
+++ b/plugins/org.eclipse.objectteams.otdt.jdt.ui/src/org/eclipse/objectteams/otdt/internal/ui/assist/CompletionAdaptor/CreateMethodMappingCompletionProposal.java
@@ -169,11 +169,15 @@
 			MethodSpec roleMethodSpec = (MethodSpec)stub.getRoleMappingElement();
 			
 			// return type:
-			ITrackedNodePosition returnTypePosition = rewrite.track(roleMethodSpec.getReturnType2());
-			addLinkedPosition(returnTypePosition, true, ROLEMETHODRETURN_KEY);
-			LinkedProposalPositionGroup group1 = getLinkedProposalModel().getPositionGroup(ROLEMETHODRETURN_KEY, true);
-			group1.addProposal(new MyJavaLinkedModeProposal(iCU, method.getReturnType(), 13)); //$NON-NLS-1$
-			group1.addProposal("void", null, 13); //$NON-NLS-1$
+			ITrackedNodePosition returnTypePosition = null;
+			ITypeBinding returnType = method.getReturnType();
+			if (!(returnType.isPrimitive() && "void".equals(returnType.getName()))) {
+				returnTypePosition = rewrite.track(roleMethodSpec.getReturnType2());
+				addLinkedPosition(returnTypePosition, true, ROLEMETHODRETURN_KEY);
+				LinkedProposalPositionGroup group1 = getLinkedProposalModel().getPositionGroup(ROLEMETHODRETURN_KEY, true);
+				group1.addProposal(new MyJavaLinkedModeProposal(iCU, method.getReturnType(), 13)); //$NON-NLS-1$
+				group1.addProposal("void", null, 13); //$NON-NLS-1$
+			}
 			
 			// role method name:
 			addLinkedPosition(rewrite.track(roleMethodSpec.getName()), false, ROLEMETHODNAME_KEY);
@@ -207,7 +211,8 @@
 					throws CoreException 
 			{
 				MultiTextEdit edits = new MultiTextEdit();
-				edits.addChild(new ReplaceEdit(returnTypePosition.getStartPosition(), returnTypePosition.getLength(), "void"));
+				if (returnTypePosition != null)
+					edits.addChild(new ReplaceEdit(returnTypePosition.getStartPosition(), returnTypePosition.getLength(), "void"));
 				edits.addChild(super.computeEdits(offset, position, trigger, stateMask, model));
 				return edits;
 			}