[demo] some minor improvements

Summary: Ended up presenting this version at F8.

Reviewed By: jeremydubreil

Differential Revision: D15189643

fbshipit-source-id: 332b7c0da
master
Jules Villard 6 years ago committed by Facebook Github Bot
parent 144847219e
commit 535e65c624

@ -12,15 +12,15 @@ import java.io.IOException;
class Resources {
public static void cat() throws IOException {
FileInputStream fis = null;
FileOutputStream fos = null;
FileInputStream infile = null;
FileOutputStream outfile = null;
try {
fis = new FileInputStream(new File("infile.txt"));
fos = new FileOutputStream(new File("outfile.txt"));
fos.write(fis.read());
infile = new FileInputStream(new File("infile.txt"));
outfile = new FileOutputStream(new File("outfile.txt"));
outfile.write(infile.read());
} finally {
if (fis != null) fis.close();
if (fos != null) fos.close();
if (infile != null) infile.close();
if (outfile != null) outfile.close();
}
}
}

@ -12,9 +12,9 @@ import java.io.IOException;
public class ResourcesFixed {
public static void cat() throws IOException {
try (FileInputStream fis = new FileInputStream(new File("infile.txt"));
FileOutputStream fos = new FileOutputStream(new File("outfile.txt")); ) {
fos.write(fis.read());
try (FileInputStream infile = new FileInputStream(new File("infile.txt"));
FileOutputStream outfile = new FileOutputStream(new File("outfile.txt")); ) {
outfile.write(infile.read());
}
}
}

@ -4,7 +4,6 @@
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
@ThreadSafe
public class Client {
Account account;

@ -3,12 +3,14 @@
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
SUBDIRS = 00 01 02 03
SUBDIRS = 00 01 02 03 03.fixed 04 04.fixed
default: all
clean:
$(foreach subdir,$(SUBDIRS),$(MAKE) -C $(subdir) clean;)
rm -fr $(foreach subdir,$(SUBDIRS),$(subdir)/infer-out/)
rm -fr infer-out/
all: $(OBJECTS)
all:
$(foreach subdir,$(SUBDIRS),$(MAKE) -C $(subdir) all;)

Loading…
Cancel
Save