# jlucasps/br.ufla.dcc.plugin.astclone architecture

> Architecture diagram of the GitHub repository jlucasps/br.ufla.dcc.plugin.astclone, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-05-16). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/jlucasps/br.ufla.dcc.plugin.astclone
- Repository: https://github.com/jlucasps/br.ufla.dcc.plugin.astclone

## Overview

##### Project type and purpose
- This is an Eclipse IDE plugin (OSGi bundle) named “br.ufla.dcc.plugin.ASTClone” whose goal is to identify crosscutting concerns by performing AST‐based clone analysis on Java code.

##### File structure
- Top‐level:
- plugin.xml & META-INF/MANIFEST.MF: OSGi/extension-point declarations
- src/br/ufla/dcc/plugin: Java source, organized into Activator, controller, model, view subpackages (an MVC pattern)
- libs/: external JARs (ANTLR, JCCD clone‐detection engine, Log4J)
- bin/: compiled classes mirroring src/ hierarchy
- tests/: minimal unit tests
- The presence of ‘controller’, ‘model’, ‘view’ packages indicates an MVC layering inside the plugin.
- ‘libs/org/eposoft/jccd/…’ is the full JCCD framework (parsers, detectors, data structures, filters, pooling strategies, preprocessors) that the plugin leverages.

##### README
- Confirms it’s an Eclipse plugin for AST Clone Analysis to discover crosscutting concerns.

## Diagram (Mermaid)

```mermaid
flowchart TD
    classDef ui fill:#ADD8E6,stroke:#000;
    classDef core fill:#90EE90,stroke:#000;
    classDef ext fill:#D3D3D3,stroke:#000;
    classDef cfg fill:#FFFF99,stroke:#000;
    classDef external fill:#F8F8F8,stroke:#000;

    User["User"]:::external

    subgraph "Eclipse Platform (OSGi container)" 
        direction TB
        EP["Eclipse Platform"]:::ext
    end

    subgraph "ASTClone Plugin Bundle"
        direction TB
        subgraph "Configuration"
            XML["plugin.xml"]:::cfg
            MF["META-INF/MANIFEST.MF"]:::cfg
        end
        Activator["Activator"]:::core
        subgraph "UI Layer"
            Action["ASTCloneActionDelegate"]:::ui
            View["ASTCloneView"]:::ui
            Label["ASTCloneLabelProvider"]:::ui
            Content["ASTCloneTreeContentProvider"]:::ui
            Parent["ParentObject"]:::ui
            Tree["TreeObject"]:::ui
        end
        Controller["ASTCloneController"]:::core
        subgraph "Model Layer"
            CloneObj["ASTClone"]:::core
            Analysis["ASTCloneAnalysis"]:::core
        end
    end

    subgraph "External Libraries & Tools"
        direction TB
        JCCDJar["JCCD Engine (JAR)"]:::ext
        JCCDDir["JCCD Framework Sources"]:::ext
        ANTLRJar["ANTLR Runtime"]:::ext
        ANTLRDir["ANTLR Java Parser Sources"]:::ext
        Log4JJar["Log4J JAR"]:::ext
        Log4JConf["log4j.properties"]:::cfg
    end

    User -->|"click \"Analyze AST clones\""| Action
    EP -->|"loads bundle"| Activator
    Activator -->|"initializes"| Controller
    Action -->|"invokeAnalysis()"| Controller
    Controller -->|"createAnalysis"| Analysis
    Analysis -->|"invoke JCCD API"| JCCDJar
    JCCDJar -->|"uses parser"| ANTLRJar
    ANTLRJar -->|"parse Java source"| JCCDDir
    JCCDJar -->|"return clone groups"| Analysis
    Analysis -->|"wrap results in ASTClone"| CloneObj
    Analysis -->|"return results"| Controller
    Controller -->|"provide data to"| Content
    Controller -->|"provide labels to"| Label
    Content --> View
    Label --> View
    EP -->|"reads UI extensions"| XML
    EP -->|"reads OSGi manifest"| MF
    Activator --> Log4JJar
    JCCDJar --> Log4JJar
    Log4JConf --> Log4JJar

    click XML "https://github.com/jlucasps/br.ufla.dcc.plugin.astclone/blob/master/plugin.xml"
    click MF "https://github.com/jlucasps/br.ufla.dcc.plugin.astclone/blob/master/META-INF/MANIFEST.MF"
    click Activator "https://github.com/jlucasps/br.ufla.dcc.plugin.astclone/blob/master/src/br/ufla/dcc/plugin/Activator.java"
    click Action "https://github.com/jlucasps/br.ufla.dcc.plugin.astclone/blob/master/src/br/ufla/dcc/plugin/view/action/ASTCloneActionDelegate.java"
    click View "https://github.com/jlucasps/br.ufla.dcc.plugin.astclone/blob/master/src/br/ufla/dcc/plugin/view/views/ASTCloneView.java"
    click Label "https://github.com/jlucasps/br.ufla.dcc.plugin.astclone/blob/master/src/br/ufla/dcc/plugin/view/views/ASTCloneLabelProvider.java"
    click Content "https://github.com/jlucasps/br.ufla.dcc.plugin.astclone/blob/master/src/br/ufla/dcc/plugin/view/views/ASTCloneTreeContentProvider.java"
    click Parent "https://github.com/jlucasps/br.ufla.dcc.plugin.astclone/blob/master/src/br/ufla/dcc/plugin/view/views/ParentObject.java"
    click Tree "https://github.com/jlucasps/br.ufla.dcc.plugin.astclone/blob/master/src/br/ufla/dcc/plugin/view/views/TreeObject.java"
    click Controller "https://github.com/jlucasps/br.ufla.dcc.plugin.astclone/blob/master/src/br/ufla/dcc/plugin/controller/ASTCloneController.java"
    click CloneObj "https://github.com/jlucasps/br.ufla.dcc.plugin.astclone/blob/master/src/br/ufla/dcc/plugin/model/analysis/astcloneanalysis/ASTClone.java"
    click Analysis "https://github.com/jlucasps/br.ufla.dcc.plugin.astclone/blob/master/src/br/ufla/dcc/plugin/model/analysis/astcloneanalysis/ASTCloneAnalysis.java"
    click Log4JConf "https://github.com/jlucasps/br.ufla.dcc.plugin.astclone/blob/master/log4j.properties"
    click Log4JJar "https://github.com/jlucasps/br.ufla.dcc.plugin.astclone/blob/master/libs/log4j-1.2.16.jar"
    click JCCDJar "https://github.com/jlucasps/br.ufla.dcc.plugin.astclone/blob/master/libs/jccd-1.0.6.jar"
    click JCCDDir "https://github.com/jlucasps/br.ufla.dcc.plugin.astclone/tree/master/libs/org/eposoft/jccd"
    click ANTLRJar "https://github.com/jlucasps/br.ufla.dcc.plugin.astclone/blob/master/libs/antlr-3.0.1.jar"
    click ANTLRDir "https://github.com/jlucasps/br.ufla.dcc.plugin.astclone/tree/master/libs/org/eposoft/jccd/parser/java/antlr3"

    class User external
    class EP ext
    class XML,MF cfg
    class Activator,Controller,CloneObj,Analysis core
    class Action,View,Label,Content,Parent,Tree ui
    class JCCDJar,JCCDDir,ANTLRJar,ANTLRDir,Log4JJar ext
    class Log4JConf cfg
```
