[jira] [Commented] (AVRO-1577) TestSpecificCompiler is not closing resources

2019-01-17 Thread Hudson (JIRA)


[ 
https://issues.apache.org/jira/browse/AVRO-1577?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16745491#comment-16745491
 ] 

Hudson commented on AVRO-1577:
--

FAILURE: Integrated in Jenkins build AvroJava #586 (See 
[https://builds.apache.org/job/AvroJava/586/])
[AVRO-1577] Update couple more methods to use try-with-resources (dkulp: 
[https://github.com/apache/avro/commit/411cfb96db6126a06df9e8093106e690b7e35dfc])
* (edit) 
lang/java/compiler/src/test/java/org/apache/avro/compiler/specific/TestSpecificCompiler.java


> TestSpecificCompiler is not closing resources
> -
>
> Key: AVRO-1577
> URL: https://issues.apache.org/jira/browse/AVRO-1577
> Project: Apache Avro
>  Issue Type: Bug
>  Components: java
>Affects Versions: 1.7.7
> Environment: Windows
>Reporter: Stevo Slavic
>Assignee: Daniel Kulp
>Priority: Major
> Fix For: 1.9.0
>
> Attachments: AVRO-1577.patch
>
>
> Test methods in {{TestSpecificCompiler}} are opening various {{Closable}} 
> resources, but they are not closing them. Because of this, file deletion in 
> {{tearDown}} silently fails (on platforms like Windows which are locking 
> files that are being used). This causes few test methods to fail since they 
> are using same temp file as output file - they generate new file content but 
> only if file is not already present, and then assertions comparing actual and 
> expected output content fail.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (AVRO-1577) TestSpecificCompiler is not closing resources

2019-01-17 Thread ASF subversion and git services (JIRA)


[ 
https://issues.apache.org/jira/browse/AVRO-1577?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16745480#comment-16745480
 ] 

ASF subversion and git services commented on AVRO-1577:
---

Commit 411cfb96db6126a06df9e8093106e690b7e35dfc in avro's branch 
refs/heads/master from Daniel Kulp
[ https://gitbox.apache.org/repos/asf?p=avro.git;h=411cfb9 ]

[AVRO-1577] Update couple more methods to use try-with-resources


> TestSpecificCompiler is not closing resources
> -
>
> Key: AVRO-1577
> URL: https://issues.apache.org/jira/browse/AVRO-1577
> Project: Apache Avro
>  Issue Type: Bug
>  Components: java
>Affects Versions: 1.7.7
> Environment: Windows
>Reporter: Stevo Slavic
>Priority: Major
> Fix For: 1.9.0
>
> Attachments: AVRO-1577.patch
>
>
> Test methods in {{TestSpecificCompiler}} are opening various {{Closable}} 
> resources, but they are not closing them. Because of this, file deletion in 
> {{tearDown}} silently fails (on platforms like Windows which are locking 
> files that are being used). This causes few test methods to fail since they 
> are using same temp file as output file - they generate new file content but 
> only if file is not already present, and then assertions comparing actual and 
> expected output content fail.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (AVRO-1577) TestSpecificCompiler is not closing resources

2015-07-07 Thread Tom White (JIRA)

[ 
https://issues.apache.org/jira/browse/AVRO-1577?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14616722#comment-14616722
 ] 

Tom White commented on AVRO-1577:
-

[~zolyfarkas] - this is adding a test dependency, so it's ok, no?

 TestSpecificCompiler is not closing resources
 -

 Key: AVRO-1577
 URL: https://issues.apache.org/jira/browse/AVRO-1577
 Project: Avro
  Issue Type: Bug
  Components: java
Affects Versions: 1.7.7
 Environment: Windows
Reporter: Stevo Slavic
 Fix For: 1.8.0

 Attachments: AVRO-1577.patch


 Test methods in {{TestSpecificCompiler}} are opening various {{Closable}} 
 resources, but they are not closing them. Because of this, file deletion in 
 {{tearDown}} silently fails (on platforms like Windows which are locking 
 files that are being used). This causes few test methods to fail since they 
 are using same temp file as output file - they generate new file content but 
 only if file is not already present, and then assertions comparing actual and 
 expected output content fail.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (AVRO-1577) TestSpecificCompiler is not closing resources

2014-09-08 Thread Zoltan Farkas (JIRA)

[ 
https://issues.apache.org/jira/browse/AVRO-1577?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14125867#comment-14125867
 ] 

Zoltan Farkas commented on AVRO-1577:
-

can wherever a file deletion is being done changed to:

if (!this.outputFile.delete()) {
  throw new RuntimeException(cannot delete  + this.outputFile);
}

this will make the code more robust.

also IOUtils.closeQuietly not really needed here (and the extra dependency), 
code can be written instead:

  BufferedReader reader = new BufferedReader(new FileReader(this.outputFile));
try {
  reader = new BufferedReader(new FileReader(this.outputFile));
  String line = null;
  while ((line = reader.readLine()) != null) {
// No line, once trimmed, should start with a deprecated field 
declaration
// nor a private field declaration.  Since the nested builder uses 
private
// fields, we cannot do the second check.
line = line.trim();
assertFalse(Line started with a deprecated field declaration:  + line,
  line.startsWith(@Deprecated public int value));
  }
} finally {
   reader.close();
}


we should consider using findbugs as part of the build, issues like this can be 
avoided.


 TestSpecificCompiler is not closing resources
 -

 Key: AVRO-1577
 URL: https://issues.apache.org/jira/browse/AVRO-1577
 Project: Avro
  Issue Type: Bug
  Components: java
Affects Versions: 1.7.7
 Environment: Windows
Reporter: Stevo Slavic
 Fix For: 1.8.0

 Attachments: AVRO-1577.patch


 Test methods in {{TestSpecificCompiler}} are opening various {{Closable}} 
 resources, but they are not closing them. Because of this, file deletion in 
 {{tearDown}} silently fails (on platforms like Windows which are locking 
 files that are being used). This causes few test methods to fail since they 
 are using same temp file as output file - they generate new file content but 
 only if file is not already present, and then assertions comparing actual and 
 expected output content fail.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (AVRO-1577) TestSpecificCompiler is not closing resources

2014-09-03 Thread Stevo Slavic (JIRA)

[ 
https://issues.apache.org/jira/browse/AVRO-1577?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14119837#comment-14119837
 ] 

Stevo Slavic commented on AVRO-1577:


Attached patch makes use of {{IOUtils.closeQuietly(Closable)}} from 
{{commons-io}} - it's Apache, and only for tests.

If not upgrade target JVM to 1.7 and use {{try-with-resources}}, another 
alternative is using [Google Guava's 
Closer|https://code.google.com/p/guava-libraries/wiki/ClosingResourcesExplained].

 TestSpecificCompiler is not closing resources
 -

 Key: AVRO-1577
 URL: https://issues.apache.org/jira/browse/AVRO-1577
 Project: Avro
  Issue Type: Bug
  Components: java
Affects Versions: 1.7.7
 Environment: Windows
Reporter: Stevo Slavic
 Fix For: 1.8.0

 Attachments: AVRO-1577.patch


 Test methods in {{TestSpecificCompiler}} are opening various {{Closable}} 
 resources, but they are not closing them. Because of this, file deletion in 
 {{tearDown}} silently fails (on platforms like Windows which are locking 
 files that are being used). This causes few test methods to fail since they 
 are using same temp file as output file - they generate new file content but 
 only if file is not already present, and then assertions comparing actual and 
 expected output content fail.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)