{"id":37018611,"url":"https://github.com/guujiang/jacob","last_synced_at":"2026-01-14T02:01:03.520Z","repository":{"id":57724778,"uuid":"132652517","full_name":"GuuJiang/Jacob","owner":"GuuJiang","description":"A lightweight library to provide coroutines in Java","archived":false,"fork":false,"pushed_at":"2018-05-31T13:34:06.000Z","size":38,"stargazers_count":16,"open_issues_count":0,"forks_count":3,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-07-12T18:30:27.734Z","etag":null,"topics":["bytecode","coroutine","coroutines","generator","java"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/GuuJiang.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}},"created_at":"2018-05-08T19:01:00.000Z","updated_at":"2023-04-12T01:54:58.000Z","dependencies_parsed_at":"2022-09-11T04:31:01.844Z","dependency_job_id":null,"html_url":"https://github.com/GuuJiang/Jacob","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/GuuJiang/Jacob","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GuuJiang%2FJacob","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GuuJiang%2FJacob/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GuuJiang%2FJacob/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GuuJiang%2FJacob/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/GuuJiang","download_url":"https://codeload.github.com/GuuJiang/Jacob/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GuuJiang%2FJacob/sbom","scorecard":{"id":60092,"data":{"date":"2025-08-11","repo":{"name":"github.com/GuuJiang/Jacob","commit":"236875af7bcdde38a2eca9052369d405d1b88ab4"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3,"checks":[{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Code-Review","score":0,"reason":"Found 0/7 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: BSD 3-Clause \"New\" or \"Revised\" License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-15T01:30:26.547Z","repository_id":57724778,"created_at":"2025-08-15T01:30:26.547Z","updated_at":"2025-08-15T01:30:26.547Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28408709,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T01:52:23.358Z","status":"online","status_checked_at":"2026-01-14T02:00:06.678Z","response_time":107,"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":["bytecode","coroutine","coroutines","generator","java"],"created_at":"2026-01-14T02:00:40.754Z","updated_at":"2026-01-14T02:01:03.471Z","avatar_url":"https://github.com/GuuJiang.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Jacob\nA lightweight library to provide coroutines in Java\n\n# Usage\n\n## add dependency for jacob-core\n```xml\n\u003cdependency\u003e\n    \u003cgroupId\u003ecom.guujiang\u003c/groupId\u003e\n    \u003cartifactId\u003ejacob-core\u003c/artifactId\u003e\n    \u003cversion\u003e0.0.1\u003c/version\u003e\n\u003c/dependency\u003e\n```\n\n## write a class contains one or more *generator methods*.  \nA *generator method* is a method which returns ```Iterable``` and *generate* some values in the middle with the ```yield``` method.  \nHere is a example.\n```java\n// strongly recomended to import the yield method as static to make the syntax more natural\nimport static com.guujiang.jacob.Stub.yield;\n\nimport com.guujiang.jacob.annotation.Generator;\nimport com.guujiang.jacob.annotation.GeneratorMethod;\n\n// add the @Generator annotation to class\n@Generator\nclass Generator {\n\n    // add the @GeneratorMethod to methods\n    @GeneratorMethod\n    public Iterator\u003cInteger\u003e someMethod() {\n        for (int i = 0; i \u003c 5; ++i) {\n            // call the yield method whenever you want to \"return\" a value out\n            yield(i);\n        }\n\n        // a return statement must be added in the end to make the compiler happy\n        // the return value does not matter, offen use null\n        return null;\n    }\n}\n```\n\n## Enhance the bytecode\njacob convert your normal Java method into coroutine with bytecode manuplation, which can happen at two points. You only need to choose **one** of them.\n\n1. Enhance at the compile time.(recommended)  \nadd the following plugin to your maven project's pom.xml.\n```xml\n\u003cplugin\u003e\n    \u003cgroupId\u003ecom.guujiang\u003c/groupId\u003e\n    \u003cartifactId\u003ejacob-maven-plugin\u003c/artifactId\u003e\n    \u003cversion\u003e0.0.1\u003c/version\u003e\n    \u003cexecutions\u003e\n        \u003cexecution\u003e\n            \u003cgoals\u003e\n                \u003cgoal\u003eenhance\u003c/goal\u003e\n            \u003c/goals\u003e\n        \u003c/execution\u003e\n    \u003c/executions\u003e\n\u003c/plugin\u003e\n```\nPackage jar file with ```mvn package```, the plugin will automatically convert all the classed with proper annotations into coroutine form. Then you just need to execute the generated jar file or use as dependency.\n\n2. Enhance at runtime.  \nIf you cannot enhance the classes at compile time, you can also do it at classloading.  \nFirst compile the ```jacob-core``` project with ```mvn package``` to get a file called ```jacob.jar```.\nThen add the following parameters to your java command line when launch the program which used the generator code.\n```\n-javaagent:\u003cpath of jacob.jar\u003e\n```\n\n## For more information, refer to the [jacob-samples](https://github.com/GuuJiang/Jacob/tree/master/jacob-samples) project\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fguujiang%2Fjacob","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fguujiang%2Fjacob","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fguujiang%2Fjacob/lists"}