Code Monkey home page Code Monkey logo

features-javac's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

features-javac's Issues

features-extract-error

javac -cp extractor/target/features-javac-extractor-1.0.0-SNAPSHOT-jar-with-dependencies.jar -Xplugin:FeaturePlugin
QueueDrainObserver.java:2: 错误: 找不到符号
protected final void fastPathOrderedEmit(U value, boolean delayError, Disposable disposable) {
^
符号: 类 U
位置: 类 QueueDrainObserver
QueueDrainObserver.java:2: 错误: 找不到符号
protected final void fastPathOrderedEmit(U value, boolean delayError, Disposable disposable) {
^
符号: 类 Disposable
位置: 类 QueueDrainObserver
QueueDrainObserver.java:3: 错误: 找不到符号
final Observer<? super V> observer = downstream;
^
符号: 类 Observer
位置: 类 QueueDrainObserver
QueueDrainObserver.java:3: 错误: 找不到符号
final Observer<? super V> observer = downstream;
^
符号: 类 V
位置: 类 QueueDrainObserver
QueueDrainObserver.java:3: 错误: 找不到符号
final Observer<? super V> observer = downstream;
^
符号: 变量 downstream
位置: 类 QueueDrainObserver
QueueDrainObserver.java:4: 错误: 找不到符号
final SimplePlainQueue q = queue;
^
符号: 类 SimplePlainQueue
位置: 类 QueueDrainObserver
QueueDrainObserver.java:4: 错误: 找不到符号
final SimplePlainQueue q = queue;
^
符号: 类 U
位置: 类 QueueDrainObserver
QueueDrainObserver.java:4: 错误: 找不到符号
final SimplePlainQueue q = queue;
^
符号: 变量 queue
位置: 类 QueueDrainObserver
QueueDrainObserver.java:6: 错误: 找不到符号
if (wip.get() == 0 && wip.compareAndSet(0, 1)) {
^
符号: 变量 wip
位置: 类 QueueDrainObserver
QueueDrainObserver.java:6: 错误: 找不到符号
if (wip.get() == 0 && wip.compareAndSet(0, 1)) {
^
符号: 变量 wip
位置: 类 QueueDrainObserver
QueueDrainObserver.java:9: 错误: 找不到符号
if (leave(-1) == 0) {
^
符号: 方法 leave(int)
位置: 类 QueueDrainObserver
QueueDrainObserver.java:17: 错误: 找不到符号
if (!enter()) {
^
符号: 方法 enter()
位置: 类 QueueDrainObserver
QueueDrainObserver.java:21: 错误: 找不到符号
QueueDrainHelper.drainLoop(q, observer, delayError, disposable, this);
^
符号: 变量 QueueDrainHelper
位置: 类 QueueDrainObserver
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by com.google.protobuf.UnsafeUtil (file:/D:/code/paper_impl_and_git_code/myself/pyBKT/hey/ast_deal/features-javac/extractor/target/features-javac-extractor-1.0.0-SNAPSHOT-jar-with-dependencies.jar) to field java.nio.Buffer.address
WARNING: Please consider reporting this to the maintainers of com.google.protobuf.UnsafeUtil
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
Feature extraction failed: QueueDrainObserver.java

May I be able to extract such a Java file with only a class name and one method, while not importing any packages, but the method references a certain class.

JavaDoc attached at token level when preceded by annotations

Problem

When an annotation proceeds a method javadoc, the javadoc is not attached to the method but to the next token instead.

Code to reproduce

public class Test {
  @Deprecated
  /**
   * Method Javadoc
   * @param s variable desc
   */
  Test(String s) {}
}

Test2 java (1)

Expected behaviour

I would expect the JavaDoc to be attached to the method as in the following code

public class Test {
  /**
   * Method Javadoc
   * @param s variable desc
   */
  @Deprecated
  Test(String s) {
  }
}

Test2 java

Test failures on OpenJDK 10.0.2

Tried mvn test.

Environment: Ubuntu 18.04; OpenJDK 10.0.2

Expected Outcome: Things work.

Actual Outcome:

Running uk.ac.cam.acr31.features.javac.SymbolScannerTest
Tests run: 5, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 2.379 sec
Running uk.ac.cam.acr31.features.javac.FeaturePluginTest
Tests run: 4, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.559 sec
Running uk.ac.cam.acr31.features.javac.ComputedFromTest
Tests run: 4, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.603 sec <<< FAILURE!
computedFrom_excludesAnonymousParameters(uk.ac.cam.acr31.features.javac.ComputedFromTest)  Time elapsed: 0.193 sec  <<< ERROR!
java.lang.NullPointerException
	at uk.ac.cam.acr31.features.javac.graph.FeatureGraph.toIdentifierNode(FeatureGraph.java:187)
	at uk.ac.cam.acr31.features.javac.syntactic.SymbolScanner.addNode(SymbolScanner.java:104)
	at uk.ac.cam.acr31.features.javac.syntactic.SymbolScanner.visitVariable(SymbolScanner.java:88)
	at uk.ac.cam.acr31.features.javac.syntactic.SymbolScanner.visitVariable(SymbolScanner.java:37)
[...]

SYMBOL_VAR not correctly attached

Steps to reproduce:

  1. Compile jsoup repository: https://github.com/jhy/jsoup
  2. Take https://github.com/jhy/jsoup/blob/a4b5e826f2440b19ee2a98fdece7211433cfdaed/src/test/java/org/jsoup/MultiLocaleRule.java and it's corresponding proto from the feature extractor.
  3. Create the graph for the corresponding proto. You will discover that node 608, corresponding to oldLocale usage inside Locale.setDefault method call is incorrectly mapped to have SYMBOL_MTH parent.
    image

Desired behaviour

oldLocale should be attached to SYMBOL_VAR similar to it's definition:
image

Error: need class interface or enum

Thank you very much for providing the code. I am having trouble using your code on a raw dataset from [https://github.com/xing-hu/DeepCom]. I am providing more details below:

  1. The data format

The code snippet from the dataset is always a method or function and an example is shown below:

public static String unEscapeString(String str,char escapeChar,char charToEscape){ return unEscapeString(str,escapeChar,new char[]{charToEscape});}

  1. The error messages:

When I ran javac -cp extractor/target/features-javac-extractor-1.0.0-SNAPSHOT-jar-with-dependencies.jar -Xplugin:FeaturePlugin test.java,

the program throws the errors:

test.java:1: Error: need class, interface or enum public static String unEscapeString(String str,char escapeChar,char charToEscape){ return unEscapeString(str,escapeChar,new char[]{charToEscape});}
test.java:1: Error: need class, interface or enum public static String unEscapeString(String str,char escapeChar,char charToEscape){ return unEscapeString(str,escapeChar,new char[]{charToEscape});}

Would you mind providing some insights on how to adjust the data or source code? Thanks!

Missing proto file when using absolute path.

Hi,

Thanks for the tool.

I may find a bug in generating proto files.

The following command works fine.

javac -cp extractor/target/features-javac-extractor-1.0.0-SNAPSHOT-jar-with-dependencies.jar -Xplugin:FeaturePlugin T.java

However, the following command can't generate the prote file.

javac -cp extractor/target/features-javac-extractor-1.0.0-SNAPSHOT-jar-with-dependencies.jar -Xplugin:FeaturePlugin /proj/fff000/modelAbil/features-javac/T.java

This is interesting that my working directory is /proj/fff000/modelAbil/features-javac.

My jdk version is javac 11.0.2

May I ask is it mean

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.