FileConfigStore: Move function returns outside try blocks
This makes more clear what things can throw exceptions, and the functions' control flow. Signed-off-by: Samuel Holland <samuel@sholland.org>
This commit is contained in:
		
							parent
							
								
									0ab3e29432
								
							
						
					
					
						commit
						16c0b5b15a
					
				@ -38,8 +38,8 @@ public final class FileConfigStore implements ConfigStore {
 | 
				
			|||||||
        }
 | 
					        }
 | 
				
			||||||
        try (FileOutputStream stream = new FileOutputStream(file, false)) {
 | 
					        try (FileOutputStream stream = new FileOutputStream(file, false)) {
 | 
				
			||||||
            stream.write(config.toString().getBytes(StandardCharsets.UTF_8));
 | 
					            stream.write(config.toString().getBytes(StandardCharsets.UTF_8));
 | 
				
			||||||
            return config;
 | 
					 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					        return config;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    @Override
 | 
					    @Override
 | 
				
			||||||
@ -78,7 +78,7 @@ public final class FileConfigStore implements ConfigStore {
 | 
				
			|||||||
        }
 | 
					        }
 | 
				
			||||||
        try (FileOutputStream stream = new FileOutputStream(file, false)) {
 | 
					        try (FileOutputStream stream = new FileOutputStream(file, false)) {
 | 
				
			||||||
            stream.write(config.toString().getBytes(StandardCharsets.UTF_8));
 | 
					            stream.write(config.toString().getBytes(StandardCharsets.UTF_8));
 | 
				
			||||||
            return config;
 | 
					 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					        return config;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
		Reference in New Issue
	
	Block a user