Skip to content

Commit 6877796

Browse files
committed
[Java] Remove redundant throws.
1 parent 5997c05 commit 6877796

File tree

2 files changed

+5
-12
lines changed

2 files changed

+5
-12
lines changed

sbe-tool/src/main/java/uk/co/real_logic/sbe/generation/TargetCodeGenerator.java

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,6 @@
1717

1818
import uk.co.real_logic.sbe.ir.Ir;
1919

20-
import java.io.IOException;
21-
2220
/**
2321
* Target a code generator for a given language.
2422
*/
@@ -30,7 +28,6 @@ public interface TargetCodeGenerator
3028
* @param ir describing the message schemas from which code should generated.
3129
* @param outputDir to which the generated code with be written.
3230
* @return a new instance of a {@link CodeGenerator} for the given target language.
33-
* @throws IOException if an error occurs when dealing with the output directory.
3431
*/
35-
CodeGenerator newInstance(Ir ir, String outputDir) throws IOException;
32+
CodeGenerator newInstance(Ir ir, String outputDir);
3633
}

sbe-tool/src/main/java/uk/co/real_logic/sbe/generation/TargetCodeGeneratorLoader.java

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,15 +23,13 @@
2323
import uk.co.real_logic.sbe.generation.java.JavaGenerator;
2424
import uk.co.real_logic.sbe.ir.Ir;
2525

26-
import java.io.IOException;
27-
2826
import static uk.co.real_logic.sbe.SbeTool.*;
2927

3028
public enum TargetCodeGeneratorLoader implements TargetCodeGenerator
3129
{
3230
JAVA()
3331
{
34-
public CodeGenerator newInstance(final Ir ir, final String outputDir) throws IOException
32+
public CodeGenerator newInstance(final Ir ir, final String outputDir)
3533
{
3634
return new JavaGenerator(
3735
ir,
@@ -46,15 +44,15 @@ public CodeGenerator newInstance(final Ir ir, final String outputDir) throws IOE
4644

4745
CPP()
4846
{
49-
public CodeGenerator newInstance(final Ir ir, final String outputDir) throws IOException
47+
public CodeGenerator newInstance(final Ir ir, final String outputDir)
5048
{
5149
return new CppGenerator(ir, new NamespaceOutputManager(outputDir, ir.applicableNamespace()));
5250
}
5351
},
5452

5553
GOLANG()
5654
{
57-
public CodeGenerator newInstance(final Ir ir, final String outputDir) throws IOException
55+
public CodeGenerator newInstance(final Ir ir, final String outputDir)
5856
{
5957
return new GolangGenerator(ir, new GolangOutputManager(outputDir, ir.applicableNamespace()));
6058
}
@@ -82,9 +80,7 @@ public static TargetCodeGenerator get(final String name)
8280
}
8381
catch (final Exception ex)
8482
{
85-
// do nothing and fall through
83+
throw new IllegalArgumentException("No code generator for name: " + name, ex);
8684
}
87-
88-
throw new IllegalArgumentException("No code generator for name: " + name);
8985
}
9086
}

0 commit comments

Comments
 (0)