- 欢迎加入,贡献源码分析,申请加入请联系[email protected]
LinkedHashMap # afterNodeAccess中有一处有疑问,求大神解答
- 部分类使用了lombok注解,对对象进行简化,具体使用到的为@Data @AllArgsConstructor @NoArgsConstructor @Builder(toBuilder = true)可以自行查阅具体使用方法
java8源码分析
License: Apache License 2.0
LinkedHashMap # afterNodeAccess中有一处有疑问,求大神解答
// 使用对象
@DaTa
@AllArgsConstructor
public class User {
private Integer id;
private String username;
}
这里是不是缺了个带参的构造方法。Main中是这样的:
// 测试类
public class Main {
public static void main(String[] args) {
ZooProxy proxy = new ZooProxy(new ZooImpl());
proxy.enter(new User(1, "stalary"));
proxy.enter(new User(2, "hawk"));
proxy.enter(new User(3, "claire"));
}
}
另外还有get/set以及toString()方法,否则与测试结果不符。
//构造一个包含特定元素的list,用iterator依次取出collection中的元素
public ArrayList(Collection<? extends E> c) {
elementData = c.toArray();
if ((size = elementData.length) != 0) {
//这里有个bug,c.toArray()可能不会返回Object[]
//这里为什么会不返回Object[]数组,能给解释一下么? 您指的bug是什么呢?
if (elementData.getClass() != Object[].class)
elementData = Arrays.copyOf(elementData, size, Object[].class);
} else {
// replace with empty array.
this.elementData = EMPTY_ELEMENTDATA;
}
}
设计模式的例子有的感觉不太恰当,比如策略模式的例子。同时,在介绍各个模式的时候,缺乏一些经验性的总结,比如什么情况下建议使用、好处是什么、坏处是什么,最好可以再加上一点很有代表性的例子,比如 spring 中是怎么使用这种设计模式的。
spring 源码的解读,个人建议不要从 AppLicationContext 开始往下看,这样容易摸不着头脑。你会对一些步骤感到很奇怪。我觉得在解读源码之前,最好先理清 spring 都做了哪些事;为什么要做;如果是你,你会怎么做;spring 是怎么做的;为什么要这样做。。从下往上看,思路会更清晰一些。通俗一点就是,从 BeanFactory、Resource、ResourceLoader、BeanDefination 这部分开始看起。先看加载过程,然后看初始化过程,最后看整体设计。当然,从上往下看也没问题,但是感觉不是很好,个人建议。
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.