[java-psi-api] add missing override PsiNameValuePairPattern.withName(ElementPattern<String>)

This commit is contained in:
Yann Cébron
2016-10-11 13:16:27 +02:00
parent 689f75556f
commit 4b7e12c95d
@@ -1,5 +1,5 @@
/*
* Copyright 2000-2009 JetBrains s.r.o.
* Copyright 2000-2016 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -16,6 +16,7 @@
package com.intellij.patterns;
import com.intellij.openapi.util.text.StringUtil;
import com.intellij.psi.PsiNameValuePair;
import com.intellij.util.ProcessingContext;
import org.jetbrains.annotations.NonNls;
@@ -39,4 +40,18 @@ public class PsiNameValuePairPattern extends PsiElementPattern<PsiNameValuePair,
}
});
}
@Override
public PsiNameValuePairPattern withName(@NotNull final ElementPattern<String> name) {
return with(new PsiNamePatternCondition<PsiNameValuePair>("withName", name) {
@Override
public String getPropertyValue(@NotNull Object o) {
if (o instanceof PsiNameValuePair) {
final String nameValue = ((PsiNameValuePair)o).getName();
return StringUtil.notNullize(nameValue, "value");
}
return null;
}
});
}
}