DenisGallo / Neo4j-ParticleFiltering

A user-defined procedure based on Markov-chains to approximate the Personalized PageRank algorithm in Neo4j
GNU General Public License v3.0
8 stars 6 forks source link

Compile-time error: Cannot find symbol n in ParticleFilteringUnlabelled.java when running mvn package #8

Closed AssaadHalabi closed 2 years ago

AssaadHalabi commented 2 years ago

Error log

[INFO] --- maven-compiler-plugin:3.8.1:compile (default-compile) @ particlefiltering ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 4 source files to D:\Downloads\Compressed\Neo4j-ParticleFiltering\target\classes
[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] /D:/Downloads/Compressed/Neo4j-ParticleFiltering/src/main/java/pfiltering/ParticleFilteringUnlabelled.java:[80,31] cannot find symbol
  symbol:   variable n
  location: class pfiltering.ParticleFilteringUnlabelled
[ERROR] /D:/Downloads/Compressed/Neo4j-ParticleFiltering/src/main/java/pfiltering/ParticleFilteringUnlabelled.java:[81,31] cannot find symbol
  symbol:   variable n
  location: class pfiltering.ParticleFilteringUnlabelled
[INFO] 2 errors
[INFO] -------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  4.782 s
[INFO] Finished at: 2022-05-15T14:09:43+03:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.1:compile (default-compile) on project particlefiltering: Compilation failure: Compilation failure:
[ERROR] /D:/Downloads/Compressed/Neo4j-ParticleFiltering/src/main/java/pfiltering/ParticleFilteringUnlabelled.java:[80,31] cannot find symbol
[ERROR]   symbol:   variable n
[ERROR]   location: class pfiltering.ParticleFilteringUnlabelled
[ERROR] /D:/Downloads/Compressed/Neo4j-ParticleFiltering/src/main/java/pfiltering/ParticleFilteringUnlabelled.java:[81,31] cannot find symbol
[ERROR]   symbol:   variable n
[ERROR]   location: class pfiltering.ParticleFilteringUnlabelled
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException

Versions: Apache Maven 3.8.5 Java version: 17.0.2 Windows 10

Any ideas on what is causing this issue and how to fix it?

What I did to make it compile was defining n in Neo4j-ParticleFiltering\src\main\java\pfiltering\ParticleFilteringUnlabelled.java as follows in line 80:

        for(Integer i=0; i<nodeList.size(); i++) {
            Node n = nodeList.get(i);
            p.put(n.getId(), ((1.0/nodeList.size())*(num_particles*nodeWeights.get(i)))); 
            v.put(n.getId(), ((1.0/nodeList.size())*(num_particles*nodeWeights.get(i)))); 
        }

However, does this give the intended behavior?

Thank you and my regards, Assaad

kuzeko commented 2 years ago

Thanks for reporting it, yes, the code contains an error there.