ShredInfo () { if (myShredIndex == -1) throw new IllegalStateException("Iterator doesn't contain any shreds"); myShredIndex = findFirstNonEmptyShredIndex(); if (myShredIndex == -1) throw new IllegalStateException("Iterator doesn't contain non-empty shreds"); if (myShredText == null) { myShredText = extractShredText(myShreds.get(myShredIndex)); if (StringUtil.isEmpty(myShredText)) throw new IllegalStateException("Current shred text is empty"); mySymbolIndex = 0; } int shredIndex = myShredIndex; char shredSymbol = myShredText.charAt(mySymbolIndex); int symbolIndex = mySymbolIndex; PsiLanguageInjectionHost.Shred shred = myShreds.get(this.myShredIndex); updateIndexes(); return new ShredInfo(shredIndex, shredSymbol, symbolIndex, shred.getHost()); }