Code Monkey home page Code Monkey logo

open-vocabulary-learning-on-source-code-with-a-graph-structured-cache--code-preprocessor's People

Contributors

mwcvitkovic avatar

Stargazers

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

Watchers

 avatar  avatar

open-vocabulary-learning-on-source-code-with-a-graph-structured-cache--code-preprocessor's Issues

Error while processing the dataset.

Hello, I was able to extract the repos successfully. But when I tried to execute processdataset.sh it gives the following error.

Error: Unable to access jarfile jar_path of javaparser-dloc-3.5.14-SNAPSHOT-jar-with-dependencies.jar

Augmented AST understanding

Hello!

I have studied *.gml code and some points are unclear for me.

Some nodes in graphs can contain the whole source code of module:

<node id="1">
    <data key="reference"></data>
    <data key="text">
        package org.slf4j.impl;

        import java.lang.reflect.Method;
        import org.slf4j.helpers.Util;

        public class VersionUtil {

            static final int MINIMAL_VERSION = 5;

            public static int getJavaMajorVersion() {
                String javaVersionString = Util.safeGetSystemProperty("java.version");
                return getJavaMajorVersion(javaVersionString);
            }

            static int getJavaMajorVersion(String versionString) {
                if (versionString == null)
                    return MINIMAL_VERSION;
                if (versionString.startsWith("1.")) {
                    return versionString.charAt(2) - '0';
                } else {
                    // we running under Java 9 or later
                    try {
                        Method versionMethod = Runtime.class.getMethod("version");
                        Object versionObj = versionMethod.invoke(null);
                        Method majorMethod = versionObj.getClass().getMethod("major");
                        Integer resultInteger = (Integer) majorMethod.invoke(versionObj);
                        return resultInteger.intValue();
                    } catch (Exception e) {
                        return MINIMAL_VERSION;
                    }
                }
            }
        }
    </data>
    <data key="type">CompilationUnit</data>
</node>

How do you process nodes like this?

Java 11 compatibility

Hello!

I have tried to reproduce your results and encountered some problems with Java 11.

Firstly, according to https://blog.codefx.org/java/java-11-migration-guide/#Removal-Of-Java-EE-Modules javax.annotation was removed. So this module should be imported manually in javaparser-core.

Secondly, by default jrt: protocol is used as default since Java 9. I know how to access Java modules (https://stackoverflow.com/a/46451977) but I could not find the way to fix the problem in this case.

I used the follow Dockerfile:

# Based on https://github.com/carlossg/docker-maven/blob/f581ea002e5d067deb6213c00a4d217297cad469/jdk-11/Dockerfile
FROM openjdk:11-jdk

ARG MAVEN_VERSION=3.5.4
ARG USER_HOME_DIR="/root"
ARG SHA=ce50b1c91364cb77efe3776f756a6d92b76d9038b0a0782f7d53acf1e997a14d
ARG BASE_URL=https://apache.osuosl.org/maven/maven-3/${MAVEN_VERSION}/binaries

# Maven fails with 'Can't read cryptographic policy directory: unlimited'
# because it looks for $JAVA_HOME/conf/security/policy/unlimited but it is in
# /etc/java-9-openjdk/security/policy/unlimited
RUN ln -s /etc/java-11-openjdk /usr/lib/jvm/java-11-openjdk-$(dpkg --print-architecture)/conf

RUN mkdir -p /usr/share/maven /usr/share/maven/ref \
  && curl -fsSL -o /tmp/apache-maven.tar.gz ${BASE_URL}/apache-maven-${MAVEN_VERSION}-bin.tar.gz \
  && echo "${SHA}  /tmp/apache-maven.tar.gz" | sha256sum -c - \
  && tar -xzf /tmp/apache-maven.tar.gz -C /usr/share/maven --strip-components=1 \
  && rm -f /tmp/apache-maven.tar.gz \
  && ln -s /usr/share/maven/bin/mvn /usr/bin/mvn

RUN mkdir /sources
WORKDIR /sources

CMD ["/bin/bash"]

When I have switched to Java 8, all worked without problem.

So I think it will be better to mention the Java version for usage, prepare a Dockerfile or update the code for Java 11.

Cannot open .gml file.

I have parsed file and saved the result in a .gml file.

However, the yEd app fails to show the graph. I always get the following error:

	at y.H.A.K.ā(Unknown Source)
	at y.H.H.ā(Unknown Source)
	at y.H.H.ā(Unknown Source)
	at y.H.G.ā(Unknown Source)
	at y.B.A.M.Đ(Unknown Source)
	at y.B.h.č(Unknown Source)
	at y.B.h.ā(Unknown Source)
	at y.B.h.ă(Unknown Source)
	at com.yworks.A.B.Z.ă(Unknown Source)
	at com.yworks.A.B.Z.ā(Unknown Source)
	at com.yworks.A.K.P.ā(Unknown Source)
	at com.yworks.A.K.P.ā(Unknown Source)
	at com.yworks.A.K.G.ā(Unknown Source)
	at com.yworks.A.K.G.ą(Unknown Source)
	at com.yworks.A.K.P$B.Ă(Unknown Source)
	at com.yworks.A.K.P.ā(Unknown Source)
	at com.yworks.A.L.D.ā(Unknown Source)
	at com.yworks.A.L.j.actionPerformed(Unknown Source)
	at java.desktop/javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1967)
	at java.desktop/javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2308)
	at java.desktop/javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:405)
	at java.desktop/javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:262)
	at java.desktop/javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:279)
	at com.jidesoft.plaf.basic.BasicJideButtonListener.mouseReleased(Unknown Source)
	at java.desktop/java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:297)
	at java.desktop/java.awt.Component.processMouseEvent(Component.java:6614)
	at java.desktop/javax.swing.JComponent.processMouseEvent(JComponent.java:3342)
	at java.desktop/java.awt.Component.processEvent(Component.java:6379)
	at java.desktop/java.awt.Container.processEvent(Container.java:2263)
	at java.desktop/java.awt.Component.dispatchEventImpl(Component.java:4990)
	at java.desktop/java.awt.Container.dispatchEventImpl(Container.java:2321)
	at java.desktop/java.awt.Component.dispatchEvent(Component.java:4822)
	at java.desktop/java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4919)
	at java.desktop/java.awt.LightweightDispatcher.processMouseEvent(Container.java:4548)
	at java.desktop/java.awt.LightweightDispatcher.dispatchEvent(Container.java:4489)
	at java.desktop/java.awt.Container.dispatchEventImpl(Container.java:2307)
	at java.desktop/java.awt.Window.dispatchEventImpl(Window.java:2769)
	at java.desktop/java.awt.Component.dispatchEvent(Component.java:4822)
	at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:772)
	at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:721)
	at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:715)
	at java.base/java.security.AccessController.doPrivileged(AccessController.java:391)
	at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85)
	at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:95)
	at java.desktop/java.awt.EventQueue$5.run(EventQueue.java:745)
	at java.desktop/java.awt.EventQueue$5.run(EventQueue.java:743)
	at java.base/java.security.AccessController.doPrivileged(AccessController.java:391)
	at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85)
	at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:742)
	at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:203)
	at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:124)
	at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:113)
	at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:109)
	at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
	at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:90)
Caused by: java.io.IOException: ParseException, did not find LETTER, EOF or ] but '<'
	at y.H.A.K.ă(Unknown Source)
	... 55 more

Augmented AST I attempted to open is here: https://pastebin.com/C81rZYa2

package javax.annotation does not exist

While trying to run the command mvn install -DskipTests, I receive the error package javax.annotation does not exist for a lot of files.
I also tried to include this dependency in the pom.xml file in casein was not there, and it still didn't work:
<dependency> <groupId>javax.annotation</groupId> <artifactId>javax.annotation-api</artifactId> <version>1.2</version> </dependency>
I was first using Java 12, but even when I use Java 8 (which seems to solve the problem for a few), I still get the same error, plus an additional error for the symbol additionalOption in the pom.xml file not being resolved.

Installation failed

I encountered this error by running the install command: mvn install -DskipTests

open-vocab-preprocessor/javaparser-core/src/main/java/com/github/javaparser/ast/modules/ModuleStmt.java:[8,24] package javax.annotation does not exist

Please, Have you a solution to fix it?

Thanks

Failed to execute goal org.apache.maven.plugins:maven-dependency-plugin:2.4:get (default-cli) on project standalone-pom

While trying to run the processDatasets.sh file, there are three BUILD FAILUREs, all of them issuing the same error:
Failed to execute goal org.apache.maven.plugins:maven-dependency-plugin:2.4:get (default-cli) on project standalone-pom
The Maven repos with this error are as follows:

org.codehaus.plexus:plexus-utils:3.1.0
org.eclipse.jetty:jetty-server:9.4.9.v20180320
org.mockito:mockito-core:2.17.0

java exception when processing dataset

Hello, I occur an exception when processing dataset, the output is as follow:

Exception in thread "main" java.nio.file.NoSuchFileException: /java.base
	at java.base/sun.nio.fs.UnixException.translateToIOException(UnixException.java:92)
	at java.base/sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:111)
	at java.base/sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:116)
	at java.base/sun.nio.fs.UnixFileAttributeViews$Basic.readAttributes(UnixFileAttributeViews.java:55)
	at java.base/sun.nio.fs.UnixFileSystemProvider.readAttributes(UnixFileSystemProvider.java:145)
	at java.base/java.nio.file.Files.readAttributes(Files.java:1755)
	at java.base/java.util.zip.ZipFile$Source.get(ZipFile.java:1220)
	at java.base/java.util.zip.ZipFile$CleanableResource.<init>(ZipFile.java:727)
	at java.base/java.util.zip.ZipFile$CleanableResource.get(ZipFile.java:845)
	at java.base/java.util.zip.ZipFile.<init>(ZipFile.java:245)
	at java.base/java.util.zip.ZipFile.<init>(ZipFile.java:175)
	at java.base/java.util.jar.JarFile.<init>(JarFile.java:341)
	at java.base/java.util.jar.JarFile.<init>(JarFile.java:312)
	at java.base/java.util.jar.JarFile.<init>(JarFile.java:251)
	at com.github.javaparser.symbolsolver.resolution.typesolvers.JarTypeSolver.addPathToJar(JarTypeSolver.java:94)
	at com.github.javaparser.symbolsolver.resolution.typesolvers.JarTypeSolver.<init>(JarTypeSolver.java:45)
	at com.amazon.javaparser.dloc.visualize.DataController.process(DataController.java:75)
	at com.amazon.javaparser.dloc.Main.main(Main.java:16)

It happens not only when I run processDataset.sh, but also when I run javaparser-dloc-3.5.14-SNAPSHOT-jar-with-dependencies.jar manually. What should I do?

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.