Read The Fucking Source Code ---- RTFM
In front of the source code, there are no secrets ---- Hou Jie
This project mainly organizes/records the understanding and experience when reading JDK
source code, for reference only.
The project contains multiple branches. The main branch is named master
, the test branch is named test
, and the source code/notes branch is named after JDK-X
( X is the JDK version ).
The master
branch occasionally compiles snapshots of source code notes and test code.
The JDK-X
branch stores the source code and notes of JDK
. Notes generated during the reading process are written directly in the source code file in the form of comments .
The test
branch stores test code to assist understanding and can be run directly.
OracleJDK
/ OpenJDK
11 Ready to use right out of the box. Clone/download the project locally and open it with IntelliJ IDEA
.
Please switch to the JDK-X
branch when reading the source code, and there is no need to associate JDK
.
When testing the source code, please switch to the test
branch. At this time, you need to associate OracleJDK
/ OpenJDK
.
This source code does not support direct compilation. If you want to completely compile the entire JDK
project, please refer to the official tutorial Building the JDK.
If the source code reports an error due to missing individual dependency files, please search for the relevant jar package on Google and import it. Or you can leave feedback on Github Issues.
Welcome to exchange good ideas, suggestions, and opinions on Github Issues.
serial number | emoji | What it means in this project | abbreviation mark |
---|---|---|---|
(0) | ? | Initialize project | :tada: |
(1) | Update documentation, including but not limited to README | :memo: | |
(2) | Publish new reading notes (Note 1) | :bulb: | |
(3) | Incremental update of reading notes | :sparkles: | |
(4) | ♻️ | Refactoring mainly refers to modifying existing reading notes. In rare cases, the source code will be modified (Note 2) | :recycle: |
(5) | ✏️ | Proofreading mainly refers to correcting typos, adjusting source code grouping, modifying source code typesetting, etc. | :pencil2: |
(6) | ✅ | Publish test files | :white_check_mark: |
Note 1:
For the current reading progress of a certain source code, please refer to the Read Code List_Sort by Function.
Note 2: Scenarios involving source code modification include but are not limited to:
Modify meaningless variable names to more understandable variable names;
Completion of curly braces on control statement scope;
Reconstruct the control statement structure (such as the splitting of if statements and the interchange of for/while);
Conversion between for loop and foreach loop;
Split the call chain that is too long and difficult to read, and isolate the intermediate processes;
Extract a frequently occurring operation into a single method;
Split multiple top-level classes in one file into different files (internal classes are not split);
Conversion between anonymous classes and non-anonymous classes;
Conversion of anonymous classes and function expressions;
Conversion between functional calls and ordinary calls;The principle of modification is: modify as little as possible without changing the original code logic and running results (code involving multi-threading is a bit confusing)
The purpose of the modification is to enhance readability and facilitate insertion of notes
Oracle JDK
OpenJDK
Reference source of emoji
in Commit information:
Full Emoji List
gitmoji