[
https://issues.apache.org/jira/browse/LUCENE-5945?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14132972#comment-14132972
]
Uwe Schindler edited comment on LUCENE-5945 at 9/13/14 9:46 PM:
----------------------------------------------------------------
Basically, thats my change, which is trivial:
{code:xml}
<condition property="isLucene">
<not>
<or>
<matches pattern="^(solr)\b" string="${name}"/>
<matches pattern="tools" string="${name}"/>
</or>
</not>
</condition>
<!-- applies to both source and test code -->
<target name="-check-forbidden-all"
depends="-init-forbidden-apis,compile-core,compile-test">
<forbidden-apis internalRuntimeForbidden="true"
classpathref="forbidden-apis.allclasses.classpath">
<bundledSignatures name="jdk-unsafe-${javac.target}"/>
<bundledSignatures name="jdk-deprecated-${javac.target}"/>
<signaturesFileSet dir="${common.dir}/tools/forbiddenApis">
<include name="base.txt"/>
<include name="lucene.txt" if="isLucene"/>
</signaturesFileSet>
<fileset dir="${build.dir}/classes/java"
excludes="${forbidden-base-excludes}"/>
<fileset dir="${build.dir}/classes/test"
excludes="${forbidden-tests-excludes}" erroronmissingdir="false"/>
</forbidden-apis>
</target>
{code}
was (Author: thetaphi):
Basically, thats my change, which is trivial:
{code:xml}
<condition property="isLucene" value="true" else="false">
<not>
<or>
<matches pattern="^(solr)\b" string="${name}"/>
<matches pattern="tools" string="${name}"/>
</or>
</not>
</condition>
<!-- applies to both source and test code -->
<target name="-check-forbidden-all"
depends="-init-forbidden-apis,compile-core,compile-test">
<forbidden-apis internalRuntimeForbidden="true"
classpathref="forbidden-apis.allclasses.classpath">
<bundledSignatures name="jdk-unsafe-${javac.target}"/>
<bundledSignatures name="jdk-deprecated-${javac.target}"/>
<signaturesFileSet dir="${common.dir}/tools/forbiddenApis">
<include name="base.txt"/>
<include name="lucene.txt" if="isLucene"/>
</signaturesFileSet>
<fileset dir="${build.dir}/classes/java"
excludes="${forbidden-base-excludes}"/>
<fileset dir="${build.dir}/classes/test"
excludes="${forbidden-tests-excludes}" erroronmissingdir="false"/>
</forbidden-apis>
</target>
{code}
> Full cutover to Path api from java.io.File
> ------------------------------------------
>
> Key: LUCENE-5945
> URL: https://issues.apache.org/jira/browse/LUCENE-5945
> Project: Lucene - Core
> Issue Type: Task
> Reporter: Robert Muir
> Attachments: LUCENE-5945.patch, LUCENE-5945_core.patch
>
>
> Using NIO2 has a lot of benefits:
> * more fine grained exception handling
> * clearer semantics about what happens
> * additional functionality
> * possibility to work with virtual filesystems, etc.
> We already banned File.delete and switched to Files.delete, I think we should
> ban File completely (except for some sugar methods that just forward with
> .toPath, like FSDirectory.open)
> For tests, ideally we go a little further and ban methods like
> FileSystems.getDefault(). Instead we could exempt LuceneTestCase and ensure
> all Paths are created via one protected method. This leaves open the
> possibility to mock up filesystem behavior at a lower level in tests in the
> future.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]