小编xyz*_*xyz的帖子

如何使用JBoss Tattletale工具?

我需要减少项目中JAR文件的大小,即9.17MB,我已经通过删除所有记录器语句和死代码将其减少到6.31MB.我还通过删除它并编译它来单独检查每个JAR文件.我删除了最多6个文件.

现在我想将JAR文件的大小减少到2到3 MB,我决定使用JBoss Tattletale工具,

有没有人以前用过它?如果是,那么请提供安装和运行它的步骤.顺便说一下,我已经从www.jboss.org网站下载了该工具.

提前致谢!

java web-applications

4
推荐指数
1
解决办法
6791
查看次数

将jQuery自动完成应用于克隆元素

我正在使用jQuery自动完成功能,它可以与现有元素一起使用,但不能使用动态添加的元素.

这是我的自动完成代码(我已经改了一点)

$(function() {

        (function( $ ) {
        $.widget( "ui.combobox", {
            _create: function() {
                var self = this,
                    select = this.element.hide(),
                    selected = select.children( ":selected" ),
                    value = selected.val() ? selected.text() : "";
                var input = this.input = $( ".editableCombobox" )    // your input box
                    //.insertAfter( select )
                    .val( value )
                    .autocomplete({
                        delay: 0,
                        minLength: 0,
                        source: function( request, response ) {
                            var matcher = new RegExp( $.ui.autocomplete.escapeRegex(request.term), "i" );
                            response( select.children( "option" ).map(function() {
                                var text = …
Run Code Online (Sandbox Code Playgroud)

javascript jquery drop-down-menu

4
推荐指数
1
解决办法
4333
查看次数

Eclipse条件断点.如何检查是否发生异常?

我有这个功能:

public static FradId readFradId(DataInput pIn) throws IOException {
    Integer lMainId = Integer.valueOf(pIn.readInt());
    Integer lReferenceId = Integer.valueOf(pIn.readInt());
    String lShortname = pIn.readUTF();
    return new FradId(lMainId,lReferenceId,lShortname);
  }
Run Code Online (Sandbox Code Playgroud)

我在这一行得到了一个断点:

String lShortname = pIn.readUTF();
Run Code Online (Sandbox Code Playgroud)

我的问题是在某些情况下函数readUTF抛出一个RuntimeException.应用程序执行该功能超过100次,因此我很难找到问题.

我的问题:有没有办法用断点条件捕获该异常?我已经在简单的布尔条件下使用了这些条件,但我不知道在抛出异常时如何在该行中停止.

Thx提前

斯特凡

java eclipse conditional-breakpoint

4
推荐指数
1
解决办法
3490
查看次数

Log4j java.lang.NoClassDefFoundError

我无法理解导致此错误的原因:

ERROR>Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/log4j/PropertyConfigurator

ERROR>Caused by: java.lang.ClassNotFoundException: org.apache.log4j.PropertyConfigurator
Run Code Online (Sandbox Code Playgroud)

已经到了log4j-1.2.8.jar项目的所有地方,但我无法做到.如何让这个错误消失?谢谢!

java log4j

3
推荐指数
1
解决办法
3万
查看次数

Android,如何将第一个标签始终设置为默认标签

public class SoapBox extends TabActivity{

    private TabHost tabHost;

    private void setupTabhost()
    {
        tabHost=(TabHost)findViewById(android.R.id.tabhost);
        tabHost.setup();
    }
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.tab);

        TabHost tabHost=getTabHost();
        setupTabhost();
        tabHost.getTabWidget().setDividerDrawable(R.drawable.tab_space);

        Intent intent1=new Intent().setClass(this, MySoapBox.class);
        setupTab(new TextView(this), "My SoapBox", intent1);
        Intent intent2=new Intent().setClass(this, FriendsSoapBox.class);
        setupTab(new TextView(this),"Friends SoapBox", intent2);
        Intent intent3=new Intent().setClass(this, Recommendations.class);
        setupTab(new TextView(this),"Recommendations", intent3);

        tabHost.setCurrentTab(0);

    }
    private void setupTab(final View view, final String tag, Intent intent)
    {
        View tabView=createTabView(tabHost.getContext(), tag);
        TabSpec tabSpec=tabHost.newTabSpec(tag).setIndicator(tabView).setContent(intent);
        tabHost.addTab(tabSpec);
    }
    private static View createTabView(final Context context,final String text)
    { …
Run Code Online (Sandbox Code Playgroud)

android tabwidget

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

强制Java虚拟机运行垃圾收集器

我有一个在大型数据集上运行的复杂Java应用程序.该应用程序执行速度相当快,但随着时间的推移,它似乎占用了大量内存并减速.有没有办法在不重新启动应用程序的情况下运行JVM垃圾收集器?

java garbage-collection

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

设置双格式,带2位小数

我有一个简短的等式:

double compute,computed2;

compute=getminutes/60;
Run Code Online (Sandbox Code Playgroud)

这里getminutesint我想设置相当于compute有2位小数.0.00如何格式化2位小数的等效?

例:

compute=45/60 it should be 0.75 
Run Code Online (Sandbox Code Playgroud)

这是我的工作:

DecimalFormat df2 = new DecimalFormat("00.00000");
double computed,computed2 = 00.000;

computed=60/getitbyminutes;
df2.format(computed);
computed2=computed-8;
df2.format(computed2);

System.out.printf("%1$.2f",computed);
System.out.println();
System.out.printf("%1$.2f",computed2);
Run Code Online (Sandbox Code Playgroud)

输出将如下:

1.00
7.00 
Run Code Online (Sandbox Code Playgroud)

java int swing decimal decimalformat

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

检查jQuery是否存在单选按钮?

我想检查radiojQuery 是否存在某个按钮,我有以下内容:

if (jQuery('input[name=list_in]', '#sell_form').length) {
    return true;
}
Run Code Online (Sandbox Code Playgroud)

这有效,但即使该字段不是无线电场,它也会返回.如果字段是命名的list_in 并且radio字段,我需要它返回true .

jquery

3
推荐指数
1
解决办法
4914
查看次数

在页面上停留30分钟,然后执行操作(Webdriver-Java)

我有一个场景,我登录到一个应用程序,执行下载操作,然后在该页面上等待(停留)30分钟,然后再次执行下载操作.

implicitwait30分钟,在该方案是否可行?还有更好的选择吗?

selenium webdriver selenium-webdriver

3
推荐指数
1
解决办法
2022
查看次数

模拟匿名函数

我正在编写 jUnits 并被 Lambda 表达式卡住了。

有没有办法模拟匿名函数?

  return retryTemplate.execute(retryContext -> {
     return mockedResponse;
  });
Run Code Online (Sandbox Code Playgroud)

在上面的代码中,我试图模拟retryTemplate. retryTemplate是类型 -org.springframework.retry.support.RetryTemplate

java spring mockito

3
推荐指数
1
解决办法
3432
查看次数