{"id":19368638,"url":"https://github.com/ghusta/java-code-conventions","last_synced_at":"2026-02-14T15:02:14.847Z","repository":{"id":13410183,"uuid":"16098673","full_name":"ghusta/java-code-conventions","owner":"ghusta","description":"Java Code Conventions and Formatting","archived":false,"fork":false,"pushed_at":"2014-01-21T22:58:32.000Z","size":152,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-09-06T22:42:28.417Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ghusta.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-01-21T09:56:32.000Z","updated_at":"2014-01-21T22:58:32.000Z","dependencies_parsed_at":"2022-09-16T01:11:22.760Z","dependency_job_id":null,"html_url":"https://github.com/ghusta/java-code-conventions","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ghusta/java-code-conventions","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ghusta%2Fjava-code-conventions","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ghusta%2Fjava-code-conventions/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ghusta%2Fjava-code-conventions/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ghusta%2Fjava-code-conventions/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ghusta","download_url":"https://codeload.github.com/ghusta/java-code-conventions/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ghusta%2Fjava-code-conventions/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29447768,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-14T14:10:32.461Z","status":"ssl_error","status_checked_at":"2026-02-14T14:09:49.945Z","response_time":53,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":[],"created_at":"2024-11-10T08:07:26.374Z","updated_at":"2026-02-14T15:02:14.815Z","avatar_url":"https://github.com/ghusta.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"java-code-conventions\n=====================\n\nJava Code Conventions and Formatting\n\n\n# General\n\nIt is often useful to adopt common code conventions, almost when working on a team or on open source projects.  \nIn modern IDEs, the source code can also be automatically formatted, like in Eclipse.\n\n\n# Eclipse\n\n### How to import a code style file ?\n\nIn Eclipse : __Window \u003e Preferences \u003e Java \u003e Code Style \u003e Formatter__  \nThen click __Import__ and pick a file.\n\nYou can pick my code style file by example : \u003e\u003e [here](eclipse/eclipse-java5-codestyle.xml) \u003c\u003c.\nIt will then be available within the current workspace.\n\nAs you can see, I don't like much the Sun or [K\u0026R style](http://en.wikipedia.org/wiki/Indent_style#K.26R_style) of indentation. \nI prefer to adopt the [Allman style](http://en.wikipedia.org/wiki/Indent_style#Allman_style), \nwhere the opening and closing braces are aligned vertically. \n\n\n### How to format source code ?\n\nRight click in the source code, then __Source \u003e Format__ (shortcut : Ctrl + Shift + F).\n\n\n# Other useful references\n\n* [Google Java Style](http://google-styleguide.googlecode.com/svn/trunk/javaguide.html) (Souce file structure, Formatting, Naming, Programming practices, ...)\n* Chapter 5 : Formatting, in _Clean Code - A Handbook of Agile Software Craftsmanship_ - [On Amazon](http://www.amazon.fr/Clean-Code-Handbook-Software-Craftsmanship/dp/0132350882)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fghusta%2Fjava-code-conventions","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fghusta%2Fjava-code-conventions","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fghusta%2Fjava-code-conventions/lists"}