mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
TextDescriptor#getText: @NotNull
GitOrigin-RevId: 52a7b9b227104d11370f40c387c59ee4a942fc3c
This commit is contained in:
committed by
intellij-monorepo-bot
parent
a926913886
commit
34aa95a47e
+5
-1
@@ -35,10 +35,14 @@ class ResourceTextDescriptor implements TextDescriptor {
|
||||
return Objects.hash(myLoader, myResourcePath);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public String getText() throws IOException {
|
||||
InputStream stream = myLoader.getResourceAsStream(myResourcePath);
|
||||
return stream != null ? ResourceUtil.loadText(stream) : null;
|
||||
if (stream == null) {
|
||||
throw new IOException("Resource not found: " + myResourcePath);
|
||||
}
|
||||
return ResourceUtil.loadText(stream);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
|
||||
+1
@@ -24,6 +24,7 @@ import java.io.IOException;
|
||||
* @author yole
|
||||
*/
|
||||
public interface TextDescriptor {
|
||||
@NotNull
|
||||
String getText() throws IOException;
|
||||
@NotNull
|
||||
String getFileName();
|
||||
|
||||
+1
@@ -67,6 +67,7 @@ public final class PostfixTemplateMetaData extends BeforeAfterActionMetaData {
|
||||
List<TextDescriptor> list = new ArrayList<>(before.length);
|
||||
for (final TextDescriptor descriptor : before) {
|
||||
list.add(new TextDescriptor() {
|
||||
@NotNull
|
||||
@Override
|
||||
public String getText() throws IOException {
|
||||
return StringUtil.replace(descriptor.getText(), KEY, key);
|
||||
|
||||
Reference in New Issue
Block a user