|
24 | 24 | <meta property="og:url" content="/">
|
25 | 25 | <meta property="og:description" content="Eureka is a elegant and powerful theme for Hugo.">
|
26 | 26 | <meta property="og:site_name" content="IO01 Blog">
|
27 |
| -<meta property="og:updated_time" content="2021-06-18T00:00:00+00:00"> |
| 27 | +<meta property="og:updated_time" content="2021-09-16T00:00:00+00:00"> |
28 | 28 | <meta property="article:section" content>
|
29 | 29 | <link rel=alternate type=application/rss+xml href=/index.xml title="IO01 Blog">
|
30 | 30 | <body class="flex flex-col min-h-screen">
|
|
68 | 68 | <div class="flex flex-col-reverse lg:flex-row justify-between">
|
69 | 69 | <div class=w-full>
|
70 | 70 | <div class=mb-4>
|
71 |
| -<a href=/posts/%E4%BB%8E%E9%98%BF%E9%87%8C%E8%A7%84%E7%BA%A6%E8%B0%88%E8%B5%B7-hashmap%E5%88%9D%E5%A7%8B%E5%8C%96%E5%92%8C%E6%89%A9%E5%AE%B9%E7%9B%B8%E5%85%B3/ class="font-bold text-xl hover:text-eureka">从阿里规约谈起-HashMap 初始化和扩容相关</a> |
| 71 | +<a href=/posts/%E4%BB%8E%E9%98%BF%E9%87%8C%E8%A7%84%E7%BA%A6%E8%B0%88%E8%B5%B7-arrays.aslist%E4%B8%89%E5%9D%91/ class="font-bold text-xl hover:text-eureka">从阿里规约谈起-Arrays.asList 三坑</a> |
72 | 72 | </div>
|
73 | 73 | <div class=content>
|
74 |
| -引言 日常开发中使用 HashMap 方法如下: |
75 |
| -Map&lt;String, Object&gt; HashMap = new HashMap&lt;&gt;(); 但是阿里规约会提示有问题: |
76 |
| -由此我们可以看一下 HashMap 初始化和扩容相关。 |
77 |
| -注:本文涉及了少许 HashMap 基础,由于与主线无关,不详讲。源码均加了些注释,注释无法解释清楚的地方放在源码之后论述。 |
| 74 | +前言 将数组转换成 List 是日常开发十分常见的操作,对此 JDK 提供了一个非常好用的工具类: |
| 75 | +List list = Arrays.asList(array); 但是如果操纵 List 的内容的话,阿里规约会给出一个提示: |
| 76 | +于是深入看了下,发现 Arrays.asList 有三个日常开发中容易坑人的地方。 |
78 | 77 | </div>
|
79 | 78 | <div class="flex flex-wrap flex-row items-center mt-2 text-tertiary-text">
|
80 | 79 | <div class="mr-6 my-2">
|
81 | 80 | <i class="fas fa-calendar mr-1"></i>
|
82 |
| -<span>2019-08-30</span> |
| 81 | +<span>2019-09-24</span> |
83 | 82 | </div>
|
84 | 83 | <div class="mr-6 my-2">
|
85 | 84 | <i class="fas fa-th-list mr-1"></i>
|
|
93 | 92 | <div class="flex flex-col-reverse lg:flex-row justify-between">
|
94 | 93 | <div class=w-full>
|
95 | 94 | <div class=mb-4>
|
96 |
| -<a href=/posts/%E4%BB%8E%E9%98%BF%E9%87%8C%E8%A7%84%E7%BA%A6%E8%B0%88%E8%B5%B7-%E7%A6%81%E7%94%A8executors%E5%88%9B%E5%BB%BA%E7%BA%BF%E7%A8%8B%E6%B1%A0/ class="font-bold text-xl hover:text-eureka">从阿里规约谈起-禁用 Executors 创建线程池</a> |
| 95 | +<a href=/posts/%E4%BB%8E%E9%98%BF%E9%87%8C%E8%A7%84%E7%BA%A6%E8%B0%88%E8%B5%B7-hashmap%E5%88%9D%E5%A7%8B%E5%8C%96%E5%92%8C%E6%89%A9%E5%AE%B9%E7%9B%B8%E5%85%B3/ class="font-bold text-xl hover:text-eureka">从阿里规约谈起-HashMap 初始化和扩容相关</a> |
97 | 96 | </div>
|
98 | 97 | <div class=content>
|
99 |
| -前言 Android 开发中耗时任务应该放在子线程中进行,否则会阻塞 UI 造成 ANR。但是如果直接创建子线程,阿里规约会提示: |
100 |
| -关于禁止直接创建线程的原因如图,不再赘述。 |
| 98 | +引言 日常开发中使用 HashMap 方法如下: |
| 99 | +Map&lt;String, Object&gt; HashMap = new HashMap&lt;&gt;(); 但是阿里规约会提示有问题: |
| 100 | +由此我们可以看一下 HashMap 初始化和扩容相关。 |
| 101 | +注:本文涉及了少许 HashMap 基础,由于与主线无关,不详讲。源码均加了些注释,注释无法解释清楚的地方放在源码之后论述。 |
101 | 102 | </div>
|
102 | 103 | <div class="flex flex-wrap flex-row items-center mt-2 text-tertiary-text">
|
103 | 104 | <div class="mr-6 my-2">
|
|
116 | 117 | <div class="flex flex-col-reverse lg:flex-row justify-between">
|
117 | 118 | <div class=w-full>
|
118 | 119 | <div class=mb-4>
|
119 |
| -<a href=/posts/%E6%B7%B1%E5%85%A5%E6%BA%90%E7%A0%81%E6%8E%92%E6%9F%A5-flag_activity_new_task-%E5%AF%BC%E8%87%B4%E7%9A%84-activity-%E6%97%A0%E6%B3%95%E6%AD%A3%E5%B8%B8%E5%90%AF%E5%8A%A8/ class="font-bold text-xl hover:text-eureka"></a> |
| 120 | +<a href=/posts/%E4%BB%8E%E9%98%BF%E9%87%8C%E8%A7%84%E7%BA%A6%E8%B0%88%E8%B5%B7-%E7%A6%81%E7%94%A8executors%E5%88%9B%E5%BB%BA%E7%BA%BF%E7%A8%8B%E6%B1%A0/ class="font-bold text-xl hover:text-eureka">从阿里规约谈起-禁用 Executors 创建线程池</a> |
120 | 121 | </div>
|
121 | 122 | <div class=content>
|
122 |
| -深入源码排查 FLAG_ACTIVITY_NEW_TASK 导致的 Activity 无法正常启动 引言 众所周知 Android 中 Activity 有四种启动模式,决定了是否创建新的 Activity 实例或复用当前实例。但是实际上 Activity 的启动十分复杂,不单单是 android:launchMode 就能 |
| 123 | +前言 Android 开发中耗时任务应该放在子线程中进行,否则会阻塞 UI 造成 ANR。但是如果直接创建子线程,阿里规约会提示: |
| 124 | +关于禁止直接创建线程的原因如图,不再赘述。 |
123 | 125 | </div>
|
124 | 126 | <div class="flex flex-wrap flex-row items-center mt-2 text-tertiary-text">
|
125 | 127 | <div class="mr-6 my-2">
|
126 | 128 | <i class="fas fa-calendar mr-1"></i>
|
127 |
| -<span>0001-01-01</span> |
| 129 | +<span>2019-08-30</span> |
| 130 | +</div> |
| 131 | +<div class="mr-6 my-2"> |
| 132 | +<i class="fas fa-th-list mr-1"></i> |
| 133 | +<a href=/series/%E9%98%BF%E9%87%8C%E8%A7%84%E7%BA%A6/ class=hover:text-eureka>阿里规约</a> |
128 | 134 | </div>
|
129 | 135 | </div>
|
130 | 136 | </div>
|
|
0 commit comments