Skip to content

Commit ca7ef04

Browse files
authored
Merge pull request #2441 from Haehnchen/feature/doctrine-repo
Fix read thread access of Doctrine repository lookup rendering
2 parents 001cb40 + 08edafd commit ca7ef04

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

src/main/java/fr/adrienbrault/idea/symfony2plugin/doctrine/metadata/lookup/DoctrineRepositoryLookupElement.java

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,25 +14,27 @@
1414
* @author Daniel Espendiller <daniel@espendiller.net>
1515
*/
1616
public class DoctrineRepositoryLookupElement extends LookupElement {
17-
@NotNull
18-
private final PhpClass phpClass;
17+
private final @NotNull String phpClassPresentableFQN;
18+
19+
private final @NotNull String phpClassName;
1920

2021
private DoctrineRepositoryLookupElement(@NotNull PhpClass phpClass) {
21-
this.phpClass = phpClass;
22+
this.phpClassName = phpClass.getName();
23+
this.phpClassPresentableFQN = phpClass.getPresentableFQN();
2224
}
2325

2426
@Override
2527
public void renderElement(LookupElementPresentation presentation) {
26-
presentation.setItemText(phpClass.getName());
27-
presentation.setTypeText(phpClass.getPresentableFQN());
28+
presentation.setItemText(phpClassName);
29+
presentation.setTypeText(phpClassPresentableFQN);
2830
presentation.setTypeGrayed(true);
2931
presentation.setIcon(Symfony2Icons.DOCTRINE);
3032
}
3133

3234
@NotNull
3335
@Override
3436
public String getLookupString() {
35-
return StringUtils.stripStart(phpClass.getPresentableFQN(), "\\");
37+
return StringUtils.stripStart(phpClassPresentableFQN, "\\");
3638
}
3739

3840
public static DoctrineRepositoryLookupElement create(@NotNull PhpClass phpClass) {

0 commit comments

Comments
 (0)