{"id":18839525,"url":"https://github.com/aserg-ufmg/apidiff","last_synced_at":"2025-10-17T17:51:22.301Z","repository":{"id":46317707,"uuid":"80201691","full_name":"aserg-ufmg/apidiff","owner":"aserg-ufmg","description":"A tool to identify breaking and non-breaking changes between two versions of a Java library","archived":false,"fork":false,"pushed_at":"2023-09-18T19:20:38.000Z","size":508,"stargazers_count":54,"open_issues_count":1,"forks_count":19,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-04-14T06:52:40.303Z","etag":null,"topics":["api","breaking-change","hacktoberfest","non-breaking-change","tool"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/aserg-ufmg.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2017-01-27T11:19:00.000Z","updated_at":"2024-10-19T13:38:55.000Z","dependencies_parsed_at":"2025-04-14T06:51:58.527Z","dependency_job_id":"23d85de7-1a2b-4aa6-9f9b-949d7ba22291","html_url":"https://github.com/aserg-ufmg/apidiff","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/aserg-ufmg/apidiff","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aserg-ufmg%2Fapidiff","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aserg-ufmg%2Fapidiff/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aserg-ufmg%2Fapidiff/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aserg-ufmg%2Fapidiff/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/aserg-ufmg","download_url":"https://codeload.github.com/aserg-ufmg/apidiff/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aserg-ufmg%2Fapidiff/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267376359,"owners_count":24077300,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-07-27T02:00:11.917Z","response_time":82,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["api","breaking-change","hacktoberfest","non-breaking-change","tool"],"created_at":"2024-11-08T02:43:20.060Z","updated_at":"2025-10-17T17:51:17.238Z","avatar_url":"https://github.com/aserg-ufmg.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# APIDiff\n\nA tool to identify API breaking and non-breaking changes between two versions of a Java library. APIDiff analyses libraries hosted on the distributed version control system _git_.\n\n## Catalog\n\n_Breaking Changes_ are modifications performed in API elements such as types, methods, and fields that may break client applications:\n\n| Element  | Breaking Changes (BC) |\n| ------------- | ------------- |\n| Type  | rename, move, move and rename, remove, lost visibility, add final modifier,  remove static modifier, change in supertype, remove supertype |\n| Method  | move, rename, remove, push down, inline, change in parameter list, change in exception list, change in return type, lost visibility, add final modifier, remove static modifier  | \n| Field  |  remove, move, push down field, change in default value, change in type field,  lost visibility, add final modifier | \n\n_Non-breaking Changes_ are modifications that do not break clients:\n\n| Element  | Non-breaking Changes (NBC) |\n| ------------- | ------------- |\n| Type  | add, extract supertype, gain visibility, remove final modifier, add static modifier, add supertype, deprecated type|\n| Method  | pull up, gain visibility, remove final modifier, add static modifier, deprecated method, add, extract| \n| Field  | pull up, add, deprecated field, gain visibility, remove final modifier|\n\n\nThe refactorings catalog is reused from [RefDiff](https://github.com/aserg-ufmg/RefDiff).\n\n## Examples\n\n* Detecting changes in version histories:\n\n```java\nAPIDiff diff = new APIDiff(\"bumptech/glide\", \"https://github.com/bumptech/glide.git\");\ndiff.setPath(\"/home/projects/github\");\n\nResult result = diff.detectChangeAllHistory(\"master\", Classifier.API);\nfor(Change changeMethod : result.getChangeMethod()){\n    System.out.println(\"\\n\" + changeMethod.getCategory().getDisplayName() + \" - \" + changeMethod.getDescription());\n}\n```\n* Detecting changes in specific commit:\n\n```java\nAPIDiff diff = new APIDiff(\"mockito/mockito\", \"https://github.com/mockito/mockito.git\");\ndiff.setPath(\"/home/projects/github\");\n\nResult result = diff.detectChangeAtCommit(\"4ad5fdc14ca4b979155d10dcea0182c82380aefa\", Classifier.API);\nfor(Change changeMethod : result.getChangeMethod()){\n    System.out.println(\"\\n\" + changeMethod.getCategory().getDisplayName() + \" - \" + changeMethod.getDescription());\n}\n```\n* Fetching new commits:\n\n```java\nAPIDiff diff = new APIDiff(\"bumptech/glide\", \"https://github.com/bumptech/glide.git\");\ndiff.setPath(\"/home/projects/github\");\n    \nResult result = diff.fetchAndDetectChange(Classifier.API);\nfor(Change changeMethod : result.getChangeMethod()){\n    System.out.println(\"\\n\" + changeMethod.getCategory().getDisplayName() + \" - \" + changeMethod.getDescription());\n}\n```\n\n* Writing a CSV file:\n\n```java\nAPIDiff diff = new APIDiff(\"mockito/mockito\", \"https://github.com/mockito/mockito.git\");\ndiff.setPath(\"/home/projects/github\");\nResult result = diff.detectChangeAtCommit(\"4ad5fdc14ca4b979155d10dcea0182c82380aefa\", Classifier.API);\n\t\t\nList\u003cString\u003e listChanges = new ArrayList\u003cString\u003e();\nlistChanges.add(\"Category;isDeprecated;containsJavadoc\");\nfor(Change changeMethod : result.getChangeMethod()){\n    String change = changeMethod.getCategory().getDisplayName() + \";\" + changeMethod.isDeprecated()  + \";\" + changeMethod.containsJavadoc() ;\n    listChanges.add(change);\n}\nUtilFile.writeFile(\"output.csv\", listChanges);\n```\n\n* Filtering Packages according to their names:\n\n```java \nClassifier.INTERNAL: Elements that are in packages with the term \"internal\".\n\nClassifier.TEST: Elements that are in packages with the terms \"test\"|\"tests\", or is in source file \"src/test\", or ends with \"test.java\"|\"tests.java\".\n\nClassifier.EXAMPLE: Elements that are in packages with the terms \"example\"|\"examples\"|\"sample\"|\"samples\"|\"demo\"|\"demos\"\n\nClassifier.EXPERIMENTAL: Elements that are in packages with the term \"experimental\".\n\nClassifier.NON_API: Internal, test, example or experimental elements.\n\nClassifier.API: Elements that are not non-APIs.\n``` \n\n## Usage\n\nAPIDiff is available in the [Maven Central Repository](https://mvnrepository.com/artifact/com.github.aserg-ufmg/apidiff/2.0.0):\n\n```xml\n\u003cdependency\u003e\n    \u003cgroupId\u003ecom.github.aserg-ufmg\u003c/groupId\u003e\n    \u003cartifactId\u003eapidiff\u003c/artifactId\u003e\n    \u003cversion\u003e2.0.0\u003c/version\u003e\n\u003c/dependency\u003e\n```\n## Publications\n\nAline Brito, Laerte Xavier, Andre Hora, Marco Tulio Valente. [APIDiff: Detecting API Breaking Changes](http://homepages.dcc.ufmg.br/~mtov/pub/2018-saner-apidiff.pdf). In 25th International Conference on Software Analysis, Evolution and Reengineering (SANER), Tool Track, pages 1-5, 2018.\n\nLearn more about our research group at http://aserg.labsoft.dcc.ufmg.br/\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faserg-ufmg%2Fapidiff","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faserg-ufmg%2Fapidiff","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faserg-ufmg%2Fapidiff/lists"}