Bug 74928 NPE in AdvancedQuickAssistProcessor$3.isCovered
eclipse.buildId=I200409231635 java.fullversion=J2RE 1.4.2 IBM J9 2.2 Windows XP x86-32 j9n142-20040915 (JIT enabled) J9VM - 20040914_1123_lHdSMR JIT - r7_level20040912_1800 BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=de_CH Command-line arguments: -update -keyring c:\eclipse\.keyring -application org.eclipse.ui.ide.workbench -showlocation Sorry no steps. Found in .log. Nothing special in UI !ENTRY org.eclipse.jdt.ui 4 10001 Sep 24, 2004 08:54:10.548 !MESSAGE Internal Error !STACK 0 java.lang.NullPointerException at org.eclipse.jdt.internal.ui.text.correction.AdvancedQuickAssistProcessor$3.isCovered(AdvancedQuickAssistProcessor.java:679) at org.eclipse.jdt.internal.ui.text.correction.AdvancedQuickAssistProcessor$3.postVisit(AdvancedQuickAssistProcessor.java:673) at org.eclipse.jdt.core.dom.ASTNode.accept(ASTNode.java:2452) at org.eclipse.jdt.internal.ui.text.correction.AdvancedQuickAssistProcessor.getFullyCoveredNodes(AdvancedQuickAssistProcessor.java:670) at org.eclipse.jdt.internal.ui.text.correction.AdvancedQuickAssistProcessor.getInverseConditionProposals(AdvancedQuickAssistProcessor.java:344) at org.eclipse.jdt.internal.ui.text.correction.AdvancedQuickAssistProcessor.hasAssists(AdvancedQuickAssistProcessor.java:51) at org.eclipse.jdt.internal.ui.text.correction.JavaCorrectionProcessor.hasAssists(JavaCorrectionProcessor.java:143) at org.eclipse.jdt.internal.ui.text.correction.QuickAssistLightBulbUpdater.calculateLightBulb(QuickAssistLightBulbUpdater.java:229) at org.eclipse.jdt.internal.ui.text.correction.QuickAssistLightBulbUpdater.doSelectionChanged(QuickAssistLightBulbUpdater.java:222) at org.eclipse.jdt.internal.ui.text.correction.QuickAssistLightBulbUpdater.access$0(QuickAssistLightBulbUpdater.java:205) at org.eclipse.jdt.internal.ui.text.correction.QuickAssistLightBulbUpdater$1.selectionChanged(QuickAssistLightBulbUpdater.java:129) at org.eclipse.jdt.internal.ui.viewsupport.SelectionListenerWithASTManager$PartListenerGroup.calculateASTandInform(SelectionListenerWithASTManager.java:172) at org.eclipse.jdt.internal.ui.viewsupport.SelectionListenerWithASTManager$3.run(SelectionListenerWithASTManager.java:141) at org.eclipse.core.internal.jobs.Worker.run(Worker.java:66)
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/AdvancedQuickAssistProcessor.java
PrefixExpression prefixExpression = ast.newPrefixExpression();
			prefixExpression.setOperator(PrefixExpression.Operator.NOT);
			prefixExpression.setOperand((Expression) rewrite.createMoveTarget(expression));
			return prefixExpression;
		}
		return (Expression) rewrite.createCopyTarget(expression);
	}
	private static Expression getInversedInfixBooleanExpression(AST ast, ASTRewrite rewrite,
			InfixExpression expression, InfixExpression.Operator newOperator) {
		InfixExpression newExpression = ast.newInfixExpression();
		newExpression.setOperator(newOperator);
		newExpression.setLeftOperand(getInversedBooleanExpression(ast, rewrite, expression.getLeftOperand()));
		newExpression.setRightOperand(getInversedBooleanExpression(ast, rewrite, expression.getRightOperand()));
		return newExpression;
	}
	private static Expression getInversedAndOrExpression(AST ast, ASTRewrite rewrite, InfixExpression infixExpression,
			Operator newOperator) {
		int newOperatorPrecedence = getInfixOperatorPrecedence(newOperator);
		
		Expression leftOperand = getInversedBooleanExpression(ast, rewrite, infixExpression.getLeftOperand());
		int leftPrecedence = getExpressionPrecedence(leftOperand);
		if (newOperatorPrecedence < leftPrecedence) {
			leftOperand = getParenthesizedExpression(ast, leftOperand);
		}
		
		Expression rightOperand = getInversedBooleanExpression(ast, rewrite, infixExpression.getRightOperand());
		int rightPrecedence = getExpressionPrecedence(rightOperand);
		if (newOperatorPrecedence < rightPrecedence) {
			rightOperand = getParenthesizedExpression(ast, rightOperand);
		}