1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-06-08 18:26:01 +02:00

Bug 247853 - AbsolutePathSourceContainer does a string comparison check using !=

Patch by James Blackburn
This commit is contained in:
Anton Leherbauer 2008-10-31 12:51:38 +00:00
parent 10f412ae84
commit e1e813365b

View file

@ -1,12 +1,13 @@
/******************************************************************************* /*******************************************************************************
* Copyright (c) 2006, 2007 Nokia and others. * Copyright (c) 2006, 2008 Nokia and others.
* All rights reserved. This program and the accompanying materials * All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0 * are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at * which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html * http://www.eclipse.org/legal/epl-v10.html
* *
* Contributors: * Contributors:
* Nokia - Initial implementation (159833) * Nokia - Initial implementation (159833)
* Broadcom - http://bugs.eclipse.org/247853
*******************************************************************************/ *******************************************************************************/
package org.eclipse.cdt.debug.core.sourcelookup; package org.eclipse.cdt.debug.core.sourcelookup;
@ -53,11 +54,11 @@ public class AbsolutePathSourceContainer extends AbstractSourceContainer {
ISourceLookupDirector director = getDirector(); ISourceLookupDirector director = getDirector();
if (director != null) if (director != null)
{ {
ILaunchConfiguration launch = director.getLaunchConfiguration(); ILaunchConfiguration launchConfiguration = director.getLaunchConfiguration();
if (launch != null) if (launchConfiguration != null)
{ {
String projectName = getDirector().getLaunchConfiguration().getAttribute(ICDTLaunchConfigurationConstants.ATTR_PROJECT_NAME, ""); //$NON-NLS-1$ String projectName = launchConfiguration.getAttribute(ICDTLaunchConfigurationConstants.ATTR_PROJECT_NAME, ""); //$NON-NLS-1$
if (projectName != "") { if (projectName.length() > 0) {
ICProject project = CoreModel.getDefault().getCModel().getCProject(projectName); ICProject project = CoreModel.getDefault().getCModel().getCProject(projectName);
if (project != null) if (project != null)
{ {
@ -107,10 +108,12 @@ public class AbsolutePathSourceContainer extends AbstractSourceContainer {
return getSourceContainerType( TYPE_ID ); return getSourceContainerType( TYPE_ID );
} }
@Override
public int hashCode() { public int hashCode() {
return TYPE_ID.hashCode(); return TYPE_ID.hashCode();
} }
@Override
public boolean equals(Object obj) { public boolean equals(Object obj) {
if (!(obj instanceof AbsolutePathSourceContainer)) if (!(obj instanceof AbsolutePathSourceContainer))
return false; return false;