Skip to content

Commit

Permalink
Merge pull request #21 from Rtfsc-8/master
Browse files Browse the repository at this point in the history
fix bug: some reverse code error like qualifiedName attribute undefined.
  • Loading branch information
niklauslee authored Oct 21, 2020
2 parents 8c993ff + 5bb1726 commit 6ba7b20
Show file tree
Hide file tree
Showing 2 changed files with 181 additions and 0 deletions.
173 changes: 173 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,176 @@ Thumbs.db
#Java Test Sources
/unittest-files/src-jdk
jisonOutput.txt
### Node template
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# Runtime data
pids
*.pid
*.seed
*.pid.lock

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage

# nyc test coverage
.nyc_output

# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# Bower dependency directory (https://bower.io/)
bower_components

# node-waf configuration
.lock-wscript

# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release

# Dependency directories
node_modules/
jspm_packages/

# TypeScript v1 declaration files
typings/

# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# Optional REPL history
.node_repl_history

# Output of 'npm pack'
*.tgz

# Yarn Integrity file
.yarn-integrity

# dotenv environment variables file
.env

# parcel-bundler cache (https://parceljs.org/)
.cache

# next.js build output
.next

# nuxt.js build output
.nuxt

# vuepress build output
.vuepress/dist

# Serverless directories
.serverless
### Eclipse template

.metadata
bin/
tmp/
*.tmp
*.bak
*.swp
*~.nib
local.properties
.settings/
.loadpath
.recommenders

# External tool builders
.externalToolBuilders/

# Locally stored "Eclipse launch configurations"
*.launch

# PyDev specific (Python IDE for Eclipse)
*.pydevproject

# CDT-specific (C/C++ Development Tooling)
.cproject

# CDT- autotools
.autotools

# Java annotation processor (APT)
.factorypath

# PDT-specific (PHP Development Tools)
.buildpath

# sbteclipse plugin
.target

# Tern plugin
.tern-project

# TeXlipse plugin
.texlipse

# STS (Spring Tool Suite)
.springBeans

# Code Recommenders
.recommenders/

# Annotation Processing
.apt_generated/

# Scala IDE specific (Scala & Java development for Eclipse)
.cache-main
.scala_dependencies
.worksheet
### Linux template
*~

# temporary files which can be created if a process still has a handle open of a deleted file
.fuse_hidden*

# KDE directory preferences
.directory

# Linux trash folder which might appear on any partition or disk
.Trash-*

# .nfs files are created when an open file is removed but is still being accessed
.nfs*
### JetBrains template
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and WebStorm
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839

# ignore .idea directory
.idea/

# CMake
cmake-build-*/

# File-based project format
*.iws

# IntelliJ
out/

# mpeltonen/sbt-idea plugin
.idea_modules/

# JIRA plugin
atlassian-ide-plugin.xml

# Crashlytics plugin (for Android Studio and IntelliJ)
com_crashlytics_export_strings.xml
crashlytics.properties
crashlytics-build.properties
fabric.properties

8 changes: 8 additions & 0 deletions code-analyzer.js
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,10 @@ class JavaCodeAnalyzer {
this._files.forEach(file => {
var data = fs.readFileSync(file, 'utf8')
try {
/* Not processing empty file @author Rtfsc8([email protected]) */
if (!!!data) {
return;
}
var ast = java7.parse(data)
this._currentCompilationUnit = ast
this._currentCompilationUnit.file = file
Expand Down Expand Up @@ -303,6 +307,10 @@ class JavaCodeAnalyzer {
// Resolve Type References
for (i = 0, len = this._typedFeaturePendings.length; i < len; i++) {
var _typedFeature = this._typedFeaturePendings[i]
//Fix bug: some reverse code error like qualifiedName attribute undefined
if (!!!_typedFeature.node.type.qualifiedName) {
continue;
}
_typeName = _typedFeature.node.type.qualifiedName.name

// Find type and assign
Expand Down

0 comments on commit 6ba7b20

Please sign in to comment.