小编Alm*_*mer的帖子

由于Xalan(XSLT)安全处理功能,Ant <junitreport>失败

我的junit测试从我的Eclipse环境中通过ant 1.7运行,但是在执行junitreport任务时构建失败:

BUILD FAILED .../build.xml:222:应用转换时的错误:javax.xml.transform.TransformerException:java.lang.RuntimeException:使用扩展函数'xalan://org.apache.tools.ant.util当安全处理功能设置为true时,不允许使用.stringUtils:replace'.

我试图弄清楚如何使junitreport任务禁用安全处理功能(我不需要并且此时只是我的方式)但我不知道如何因为任务没有要禁用的属性它.或者我应该做些什么来使这项工作?

eclipse ant xslt xalan

6
推荐指数
1
解决办法
4156
查看次数

onCreate(Bundle savedInstanceState)始终为null

我知道,这个问题之前在stackoverflow上被问到,但是没有答案对我有用.

可能值得一提的是:

  • 我将ActionBarSherlock与支持包一起使用.
  • onSaveInstanceState我按下主页按钮时调用方法IS.该方法onCreate总是为NULL提供NULL Bundle savedInstanceState.
  • onRestoreInstanceState从来没有调用过方法.(我不介意,如果onCreate工作;)).
  • 另外(应该没关系)我试着把它放在super.onSaveInstanceState(outState)底部onSaveInstanceState.也没有运气.

这是代码.我希望有人有这个问题并解决了它.

public class MainActivity extends SherlockFragmentActivity {

    private static final String LOG_TAG = MainActivity.class.getSimpleName();

    private static String STATE_TO_STORE = "state_to_store";

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);        

        Log.d(LOG_TAG, "onCreate: savedInstanceState = " + (savedInstanceState == null ? "NULL" : "Not NULL"));

        // ... more code...
    }

    @Override
    public void onRestoreInstanceState(Bundle savedInstanceState) {
        super.onRestoreInstanceState(savedInstanceState);

        Log.d(LOG_TAG, "onRestoreInstanceState: savedInstanceState = " + (savedInstanceState == …
Run Code Online (Sandbox Code Playgroud)

android activity-lifecycle android-lifecycle

5
推荐指数
2
解决办法
2万
查看次数