You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@nutch.apache.org by kamaci <gi...@git.apache.org> on 2016/05/19 23:42:28 UTC
[GitHub] nutch pull request: NUTCH-2264 Check Forbidden API's at Build
GitHub user kamaci opened a pull request:
https://github.com/apache/nutch/pull/115
NUTCH-2264 Check Forbidden API's at Build
Forbidden APIs is checked at ant build.
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/kamaci/nutch NUTCH-2264
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/nutch/pull/115.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #115
----
commit 37f88caf0f8a52b960a5ed06e1b73c6137b66cf0
Author: Furkan KAMACI <fu...@gmail.com>
Date: 2016-05-19T23:40:35Z
NUTCH-2264 Forbidden APIs is checked at ant build.
----
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] nutch pull request #115: NUTCH-2264 Check Forbidden API's at Build
Posted by kamaci <gi...@git.apache.org>.
Github user kamaci commented on a diff in the pull request:
https://github.com/apache/nutch/pull/115#discussion_r69448239
--- Diff: build.xml ---
@@ -1035,4 +1039,11 @@
</classpath>
</eclipse>
</target>
+
+ <target name="check-forbidden-apis" depends="compile">
+ <fa:forbiddenapis internalRuntimeForbidden="true" classpathref="classpath" dir="${build.dir}">
+ <bundledsignatures name="jdk-unsafe-${javac.version}"/>
--- End diff --
@lewismc I wrote it at my second comment for this PR:
`BUILD FAILED
/home/furkan/projects/gsoc2016/nutch/build.xml:1044: Check for forbidden API calls failed: java.lang.ClassNotFoundException: org.apache.avro.util.Utf8
at de.thetaphi.forbiddenapis.Checker.getClassFromClassLoader(Checker.java:264)
at de.thetaphi.forbiddenapis.Checker.lookupRelatedClass(Checker.java:277)
at de.thetaphi.forbiddenapis.ClassScanner.checkType(ClassScanner.java:178)
at de.thetaphi.forbiddenapis.ClassScanner.checkDescriptor(ClassScanner.java:218)
at de.thetaphi.forbiddenapis.ClassScanner$1.<init>(ClassScanner.java:284)
at de.thetaphi.forbiddenapis.ClassScanner.visitField(ClassScanner.java:279)
at de.thetaphi.forbiddenapis.asm.ClassReader.a(Unknown Source)
at de.thetaphi.forbiddenapis.asm.ClassReader.accept(Unknown Source)
at de.thetaphi.forbiddenapis.asm.ClassReader.accept(Unknown Source)
at de.thetaphi.forbiddenapis.Checker.checkClass(Checker.java:528)
at de.thetaphi.forbiddenapis.Checker.run(Checker.java:545)
at de.thetaphi.forbiddenapis.ant.AntTask.execute(AntTask.java:189)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:292)
at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
at org.apache.tools.ant.Task.perform(Task.java:348)
at org.apache.tools.ant.Target.execute(Target.java:435)
at org.apache.tools.ant.Target.performTasks(Target.java:456)
at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1393)
at org.apache.tools.ant.Project.executeTarget(Project.java:1364)
at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
at org.apache.tools.ant.Project.executeTargets(Project.java:1248)
at org.apache.tools.ant.Main.runBuild(Main.java:851)
at org.apache.tools.ant.Main.startAnt(Main.java:235)
at org.apache.tools.ant.launch.Launcher.run(Launcher.java:280)
at org.apache.tools.ant.launch.Launcher.main(Launcher.java:109)`
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] nutch pull request: NUTCH-2264 Check Forbidden API's at Build
Posted by kamaci <gi...@git.apache.org>.
Github user kamaci commented on a diff in the pull request:
https://github.com/apache/nutch/pull/115#discussion_r64141310
--- Diff: build.xml ---
@@ -1035,4 +1039,11 @@
</classpath>
</eclipse>
</target>
+
+ <target name="check-forbidden-apis" depends="compile">
+ <fa:forbiddenapis internalRuntimeForbidden="true" classpathref="classpath" dir="${build.dir}">
+ <bundledsignatures name="jdk-unsafe-${javac.version}"/>
--- End diff --
I've prepared much more complicated PR for this. However I got the same error. So, I wanted to solve it and then improve the PR. Do you have any idea about the error?
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] nutch pull request: NUTCH-2264 Check Forbidden API's at Build
Posted by lewismc <gi...@git.apache.org>.
Github user lewismc commented on a diff in the pull request:
https://github.com/apache/nutch/pull/115#discussion_r63980262
--- Diff: build.xml ---
@@ -1035,4 +1039,11 @@
</classpath>
</eclipse>
</target>
+
+ <target name="check-forbidden-apis" depends="compile">
+ <fa:forbiddenapis internalRuntimeForbidden="true" classpathref="classpath" dir="${build.dir}">
+ <bundledsignatures name="jdk-unsafe-${javac.version}"/>
--- End diff --
yes I think we should make full use of the plugin e.g. add more checks from the available options. If you wish to split these in to separate items and merge them gradually then I would be happy to merge. Please say what you want to do.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] nutch pull request: NUTCH-2264 Check Forbidden API's at Build
Posted by lewismc <gi...@git.apache.org>.
Github user lewismc commented on a diff in the pull request:
https://github.com/apache/nutch/pull/115#discussion_r63976670
--- Diff: build.xml ---
@@ -1035,4 +1039,11 @@
</classpath>
</eclipse>
</target>
+
+ <target name="check-forbidden-apis" depends="compile">
+ <fa:forbiddenapis internalRuntimeForbidden="true" classpathref="classpath" dir="${build.dir}">
+ <bundledsignatures name="jdk-unsafe-${javac.version}"/>
--- End diff --
Are there no other tests which we could do here?
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] nutch pull request #115: NUTCH-2264 Check Forbidden API's at Build
Posted by lewismc <gi...@git.apache.org>.
Github user lewismc commented on a diff in the pull request:
https://github.com/apache/nutch/pull/115#discussion_r68627471
--- Diff: build.xml ---
@@ -1035,4 +1039,11 @@
</classpath>
</eclipse>
</target>
+
+ <target name="check-forbidden-apis" depends="compile">
+ <fa:forbiddenapis internalRuntimeForbidden="true" classpathref="classpath" dir="${build.dir}">
+ <bundledsignatures name="jdk-unsafe-${javac.version}"/>
--- End diff --
What error?
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] nutch pull request: NUTCH-2264 Check Forbidden API's at Build
Posted by kamaci <gi...@git.apache.org>.
Github user kamaci commented on a diff in the pull request:
https://github.com/apache/nutch/pull/115#discussion_r63977002
--- Diff: build.xml ---
@@ -1035,4 +1039,11 @@
</classpath>
</eclipse>
</target>
+
+ <target name="check-forbidden-apis" depends="compile">
+ <fa:forbiddenapis internalRuntimeForbidden="true" classpathref="classpath" dir="${build.dir}">
+ <bundledsignatures name="jdk-unsafe-${javac.version}"/>
--- End diff --
Here is a list for what we can do: [(https://github.com/policeman-tools/forbidden-apis/wiki/BundledSignatures)] On the other hand we can write some custom checks as like: [https://github.com/apache/lucene-solr/blob/master/lucene/tools/forbiddenApis/base.txt]
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] nutch pull request #115: NUTCH-2264 Check Forbidden API's at Build
Posted by kamaci <gi...@git.apache.org>.
Github user kamaci closed the pull request at:
https://github.com/apache/nutch/pull/115
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---