https://github.com/feenkcom/jdt2famix

Jdt2Famix takes Java sources and produces MSE files that can be imported into Glamorous Toolkit.

https://github.com/feenkcom/jdt2famix

Science Score: 26.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
  • Academic email domains
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (13.5%) to scientific vocabulary

Keywords

glamorous-toolkit java mse
Last synced: 4 months ago · JSON representation

Repository

Jdt2Famix takes Java sources and produces MSE files that can be imported into Glamorous Toolkit.

Basic Info
  • Host: GitHub
  • Owner: feenkcom
  • License: epl-1.0
  • Language: Java
  • Default Branch: master
  • Homepage: https://gtoolkit.com
  • Size: 1.99 MB
Statistics
  • Stars: 38
  • Watchers: 15
  • Forks: 22
  • Open Issues: 26
  • Releases: 12
Topics
glamorous-toolkit java mse
Created over 10 years ago · Last pushed about 4 years ago
Metadata Files
Readme License

README.md

This project offers the mechanism for producing MSE files out of Java code. It is based on JDT Core and Fame for Java, and it requires Java 8.

Build Status Coverage Status

Overview

Installation

Run a release

  1. Download a binary release
  2. The downloaded folder contains all jar files and a jdt2famix.sh script (jdt2famix.cmd for Windows)

Create a binary release from sources

  1. Clone or download this repository
  2. Make sure you have Maven installed and that mvn is in the execution path (i.e., change $PATH)
  3. Execute in the root folder: release.sh
  4. This created a ./release folder that includes all jar files and a jdt2famix.sh script (jdt2famix.cmd for Windows)

How to create an MSE model from a target system

Suppose you have a mysystem root folder in which you have the sources and all jar dependencies of your target Java system.

After having created the release, go to mysystem, and execute /path/to/jdt2famix.sh (/path/to/jdt2famix.cmd for Windows). This will result in an MSE file named like the folder of your target system (in our case mysystem.mse).

You can now import the mysystem.mse file into Glamorous Toolkit.

The importance of including external dependencies

It is important to have all external dependencies in a subfolder of mysystem. This ensures that the importer can correctly identify dependencies to outside entities. Consider the following example of a class definition

@ExternalAnnotation
public class MyClass extends ExternalClass { ... }

In order to describe completely MyClass, we need to extract information about all its immediate dependencies. For example, in our case we need to have information about ExternalClass and @ExternalAnnotation. That is why, we need to have the external libraries available in the Classpath of the importer. As the importer automatically retrieves all jars/ears/wars from the root folder of mysystem, it is enough to place these dependencies somewhere under that folder.

A note about Maven projects

If you happen to have a Java project that defines dependencies through Maven, you can use the following command to copy all dependencies:

mvn dependency:copy-dependencies -DoutputDirectory=dependencies -DoverWriteSnapshots=true -DoverWriteReleases=false

A note about Gradle projects

If you happen to have a Java project that defines dependencies through Gradle, you can take the following steps to create the MSE model: 1. In your project's build.gradle file include the build.gradle file from jdt2famix instalation:

    apply from: "../jdt2famix/build.gradle"
  1. In your project folder use the following command:

    gradle famix
    

Understanding import problems through logging

jdt2famix logs the problems encountered during import.

These problems do not stop the import, but they do lead to loss of information quality in the model. These problems are typically due to missing jars in the classpath, and if you know which parts are problematic, you get a chance of fixing them.

To give you an example, entries might look like this:

unresolved type declaration - TestPlatform - .../jdt2famix/tmp/guava/guava-tests/test/com/google/common/math/TestPlatform.java - line 21
unresolved method declaration - suite - .../jdt2famix/tmp/guava/guava-tests/test/com/google/common/primitives/ByteArrayAsListTest.java - line 51

For example, in the case of guava, importing just the checked out code, gives us 419 problems, most of which were method declaration problems (due to unknown return types). However, after downloading all jars from the maven dependencies, we got only 47 problems (only type declaration problems, but no more method declaration problems). Interestingly, guava is made out of several sub-projects, and these problems appear if we import the overall project. But, if we import only a subproject at a time, the problems do not appear anymore, so likely the issue is related to conflicting jars, or duplicated sources.

License

Owner

  • Name: feenk
  • Login: feenkcom
  • Kind: organization
  • Location: Switzerland

We make your systems explainable

GitHub Events

Total
  • Watch event: 1
Last Year
  • Watch event: 1

Issues and Pull Requests

Last synced: 11 months ago

All Time
  • Total issues: 37
  • Total pull requests: 22
  • Average time to close issues: 5 months
  • Average time to close pull requests: 3 months
  • Total issue authors: 12
  • Total pull request authors: 10
  • Average comments per issue: 1.46
  • Average comments per pull request: 1.45
  • Merged pull requests: 14
  • Bot issues: 0
  • Bot pull requests: 4
Past Year
  • Issues: 0
  • Pull requests: 0
  • Average time to close issues: N/A
  • Average time to close pull requests: N/A
  • Issue authors: 0
  • Pull request authors: 0
  • Average comments per issue: 0
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • VincentBlondeau (20)
  • girba (6)
  • alexlehn (2)
  • fuhrmanator (1)
  • rillig (1)
  • wettel (1)
  • jdestefani (1)
  • ynoir (1)
  • JanBliznicenko (1)
  • jespertp-systematic (1)
  • peteruhnak (1)
  • philippengler2794 (1)
Pull Request Authors
  • VincentBlondeau (7)
  • rillig (4)
  • dependabot[bot] (4)
  • LasseRafn (1)
  • Ducasse (1)
  • jdestefani (1)
  • LiviuArln (1)
  • RainerWinkler (1)
  • fuhrmanator (1)
  • rbonifacio (1)
Top Labels
Issue Labels
wontfix (1)
Pull Request Labels
dependencies (4)

Dependencies

pom.xml maven
  • ch.akuhn:fame 1.1
  • org.apache.logging.log4j:log4j-api 2.6.2
  • org.apache.logging.log4j:log4j-core 2.6.2
  • org.eclipse.jdt:org.eclipse.jdt.core 3.13.102
  • junit:junit 4.13.1 test