git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@274920 13f79535-47bb-0310-9956-ffa450edef68master
@@ -1,7 +1,7 @@ | |||||
/* | /* | ||||
* The Apache Software License, Version 1.1 | * The Apache Software License, Version 1.1 | ||||
* | * | ||||
* Copyright (c) 2000,2002 The Apache Software Foundation. All rights | |||||
* Copyright (c) 2000,2002-2003 The Apache Software Foundation. All rights | |||||
* reserved. | * reserved. | ||||
* | * | ||||
* Redistribution and use in source and binary forms, with or without | * Redistribution and use in source and binary forms, with or without | ||||
@@ -123,7 +123,7 @@ public class KeySubst extends Task { | |||||
// ignore | // ignore | ||||
} | } | ||||
} | } | ||||
if (bw != null) { | |||||
if (br != null) { | |||||
try { | try { | ||||
br.close(); | br.close(); | ||||
} catch (IOException e) { | } catch (IOException e) { | ||||
@@ -172,10 +172,13 @@ public class ContainsRegexpSelector extends BaseExtendSelector { | |||||
} catch (IOException ioe) { | } catch (IOException ioe) { | ||||
throw new BuildException("Could not read file " + filename); | throw new BuildException("Could not read file " + filename); | ||||
} finally { | } finally { | ||||
try { | |||||
in.close(); | |||||
} catch (Exception e) { | |||||
throw new BuildException("Could not close file " + filename); | |||||
if (in != null) { | |||||
try { | |||||
in.close(); | |||||
} catch (Exception e) { | |||||
throw new BuildException("Could not close file " | |||||
+ filename); | |||||
} | |||||
} | } | ||||
} | } | ||||
} | } | ||||
@@ -214,10 +214,13 @@ public class ContainsSelector extends BaseExtendSelector { | |||||
} catch (IOException ioe) { | } catch (IOException ioe) { | ||||
throw new BuildException("Could not read file " + filename); | throw new BuildException("Could not read file " + filename); | ||||
} finally { | } finally { | ||||
try { | |||||
in.close(); | |||||
} catch (Exception e) { | |||||
throw new BuildException("Could not close file " + filename); | |||||
if (in != null) { | |||||
try { | |||||
in.close(); | |||||
} catch (Exception e) { | |||||
throw new BuildException("Could not close file " | |||||
+ filename); | |||||
} | |||||
} | } | ||||
} | } | ||||
} | } | ||||