在JDK源代码中java.lang.String.toCharArray,它不Arrays.copyOf用于实现它,它说:
由于类初始化顺序问题,无法使用Arrays.copyOf
什么是"类初始化顺序问题"?
public char[] toCharArray() {
// Cannot use Arrays.copyOf because of class initialization order issues
char result[] = new char[value.length];
System.arraycopy(value, 0, result, 0, value.length);
return result;
}
Run Code Online (Sandbox Code Playgroud) 我正在测试9补丁图像.
在一切正常之前,我将drawable文件重命名ic_button_beat_box_default.png为ic_button_beat_box_default.9.png,然后我得到错误:
某些文件崩溃失败,请参阅日志以获取详细信息
.然后我重新命名,它正常工作.那怎么会这样呢?
完整的错误是:
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:mergeDebugResources'.
> Some file crunching failed, see logs for details
* Try:
Run with --info or --debug option to get more log output.
* Exception is:
org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':app:mergeDebugResources'.
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:69)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:46)
at org.gradle.api.internal.tasks.execution.PostExecutionAnalysisTaskExecuter.execute(PostExecutionAnalysisTaskExecuter.java:35)
...
Caused by: java.lang.RuntimeException: Some file crunching failed, see logs for details
at com.android.builder.png.QueuedCruncher.waitForAll(QueuedCruncher.java:260)
at com.android.builder.png.QueuedCruncher.end(QueuedCruncher.java:280)
at …Run Code Online (Sandbox Code Playgroud) 当我开始jvm(jdk 8)时,我发现这个cms gc日志.它显示老一代使用0K(0K(1747648K)),但jvm执行cms collect.为什么?
2019-01-31T18:00:28.603+0800: 4.466: [GC (CMS Initial Mark) [1 CMS-initial-mark: 0K(1747648K)] 65577K(2534080K), 0.0077440 secs] [Times: user=0.03 sys=0.00, real=0.01 secs]
2019-01-31T18:00:28.611+0800: 4.474: [CMS-concurrent-mark-start]
2019-01-31T18:00:28.627+0800: 4.490: [CMS-concurrent-mark: 0.016/0.016 secs] [Times: user=0.06 sys=0.01, real=0.02 secs]
2019-01-31T18:00:28.627+0800: 4.490: [CMS-concurrent-preclean-start]
2019-01-31T18:00:28.630+0800: 4.493: [CMS-concurrent-preclean: 0.003/0.003 secs] [Times: user=0.01 sys=0.00, real=0.00 secs]
2019-01-31T18:00:28.630+0800: 4.493: [CMS-concurrent-abortable-preclean-start]
2019-01-31T18:00:29.748+0800: 5.611: [CMS-concurrent-abortable-preclean: 0.824/1.117 secs] [Times: user=4.06 sys=0.13, real=1.12 secs]
2019-01-31T18:00:29.749+0800: 5.612: [GC (CMS Final Remark) [YG occupancy: 437791 K (786432 K)]2019-01-31T18:00:29.749+0800: 5.612: [Rescan (parallel) , 0.2379222 secs]2019-01-31T18:00:29.987+0800: …Run Code Online (Sandbox Code Playgroud) 我测试我的github网站具有杰基尔,但是当我添加一个新的职位是不是产生在后_posts的文件夹,所以无法获得site.posts的index.html.我jekyll serve在当地跑步.
我的文件夹:
本地页面:
本地的:
但是,它在github网站上运行良好.所以有什么问题?
在这个 HelloWorld 应用程序中,我使用了该android:colorBackground属性,但它没有应用红色背景。
AndroidManifest.xml :
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:supportsRtl="true"
android:theme="@style/AppTheme" >
<activity
android:name=".EditTextActivity"
android:label="@string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
Run Code Online (Sandbox Code Playgroud)
布局xml:
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".EditTextActivity">
<TextView
android:text="Hello World!"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="40sp"
/>
</RelativeLayout>
Run Code Online (Sandbox Code Playgroud)
样式.xml :
<resources>
<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
<item name="android:colorBackground">#ff0000</item>
</style>
</resources>
Run Code Online (Sandbox Code Playgroud)