Bug 441046 - Potential ClassCastException in org.eclipse.cdt.managedbuilder.internal.core.Tool.java
Summary: Potential ClassCastException in org.eclipse.cdt.managedbuilder.internal.core....
Status: NEW
Alias: None
Product: CDT
Classification: Tools
Component: cdt-build-managed (show other bugs)
Version: 8.3.0   Edit
Hardware: PC Windows 7
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact: Jonah Graham CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-08-04 03:27 EDT by chiu brad CLA
Modified: 2020-09-04 15:17 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description chiu brad CLA 2014-08-04 03:27:51 EDT
There are two methods have potential ClassCastException situation.

Methods list as below
private void getConverter(String convertToId) {
		...
		IToolChain parent = (IToolChain) getParent();
		IConfiguration parentConfig = parent.getParent();
		IManagedProject managedProject = parentConfig.getManagedProject();
		if (managedProject != null) {
			managedProject.setValid(false);
		}
		...
}


public void checkForMigrationSupport() {
		...
		IToolChain parent = (IToolChain) getParent();
		IConfiguration parentConfig = parent.getParent();
		IManagedProject managedProject = parentConfig.getManagedProject();
		if (managedProject != null) {
			managedProject.setValid(false);
		}
		...
}

Maybe in-correction to 
IToolChain parent = null;
if (getParent() instanceof IToolChain) {
....