forked from eclipse-jdt/eclipse.jdt.core
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix 4 more parameterized search tests
Signed-off-by: Rob Stryker <[email protected]>
- Loading branch information
Rob Stryker
committed
Feb 20, 2025
1 parent
965ed48
commit 588822f
Showing
5 changed files
with
126 additions
and
54 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
68 changes: 68 additions & 0 deletions
68
...pse.jdt.core.javac/src/org/eclipse/jdt/internal/core/search/DOMPatternLocatorFactory.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
/******************************************************************************* | ||
* Copyright (c) 2024 Red Hat Inc and others. | ||
* | ||
* This program and the accompanying materials | ||
* are made available under the terms of the Eclipse Public License 2.0 | ||
* which accompanies this distribution, and is available at | ||
* https://www.eclipse.org/legal/epl-2.0/ | ||
* | ||
* SPDX-License-Identifier: EPL-2.0 | ||
* | ||
*******************************************************************************/ | ||
package org.eclipse.jdt.internal.core.search; | ||
|
||
import org.eclipse.jdt.internal.core.search.matching.ConstructorLocator; | ||
import org.eclipse.jdt.internal.core.search.matching.DOMConstructorLocator; | ||
import org.eclipse.jdt.internal.core.search.matching.DOMFieldLocator; | ||
import org.eclipse.jdt.internal.core.search.matching.DOMLocalVariableLocator; | ||
import org.eclipse.jdt.internal.core.search.matching.DOMMethodLocator; | ||
import org.eclipse.jdt.internal.core.search.matching.DOMPackageReferenceLocator; | ||
import org.eclipse.jdt.internal.core.search.matching.DOMPatternLocator; | ||
import org.eclipse.jdt.internal.core.search.matching.DOMSuperTypeReferenceLocator; | ||
import org.eclipse.jdt.internal.core.search.matching.DOMTypeDeclarationLocator; | ||
import org.eclipse.jdt.internal.core.search.matching.DOMTypeParameterLocator; | ||
import org.eclipse.jdt.internal.core.search.matching.DOMTypeReferenceLocator; | ||
import org.eclipse.jdt.internal.core.search.matching.FieldLocator; | ||
import org.eclipse.jdt.internal.core.search.matching.LocalVariableLocator; | ||
import org.eclipse.jdt.internal.core.search.matching.MethodLocator; | ||
import org.eclipse.jdt.internal.core.search.matching.PackageReferenceLocator; | ||
import org.eclipse.jdt.internal.core.search.matching.PatternLocator; | ||
import org.eclipse.jdt.internal.core.search.matching.SuperTypeReferenceLocator; | ||
import org.eclipse.jdt.internal.core.search.matching.TypeDeclarationLocator; | ||
import org.eclipse.jdt.internal.core.search.matching.TypeParameterLocator; | ||
import org.eclipse.jdt.internal.core.search.matching.TypeReferenceLocator; | ||
|
||
public class DOMPatternLocatorFactory { | ||
|
||
public static DOMPatternLocator createWrapper(PatternLocator locator) { | ||
// TODO implement all this. | ||
if( locator instanceof FieldLocator fl) { | ||
return new DOMFieldLocator(fl); | ||
} | ||
if( locator instanceof ConstructorLocator cl) { | ||
return new DOMConstructorLocator(cl); | ||
} | ||
if( locator instanceof LocalVariableLocator lcl) { | ||
return new DOMLocalVariableLocator(lcl); | ||
} | ||
if( locator instanceof MethodLocator ml) { | ||
return new DOMMethodLocator(ml); | ||
} | ||
if( locator instanceof PackageReferenceLocator prl) { | ||
return new DOMPackageReferenceLocator(prl); | ||
} | ||
if( locator instanceof SuperTypeReferenceLocator strl) { | ||
return new DOMSuperTypeReferenceLocator(strl); | ||
} | ||
if( locator instanceof TypeDeclarationLocator tdl) { | ||
return new DOMTypeDeclarationLocator(tdl); | ||
} | ||
if( locator instanceof TypeParameterLocator tpl) { | ||
return new DOMTypeParameterLocator(tpl); | ||
} | ||
if( locator instanceof TypeReferenceLocator trl) { | ||
return new DOMTypeReferenceLocator(trl); | ||
} | ||
return new DOMPatternLocator(null); // stub | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters