zoukankan      html  css  js  c++  java
  • Long类型的坑,第一次遇见

    注意下面标红的code,如果不加这段代码会有问题,原因是一个比较的是地址,一个比较的是value,会导致不同,程序逻辑出错!加上后比较的就是值!!!

              allViewMap.put("projid", projid);
                    // 查询企业历史担保项目
                    List<ProjBaseinfo> projList=new ArrayList<ProjBaseinfo>();
                    List<ProjBaseinfo> projList_1 = ProjectBaseFacade.queryCrmFinanProj(compserialid, projBaseinfo.getCustomertype());
                    
                    double sumHistoryPactmoney = 0.0;
                    double sumHistoryProlastsuming = 0.0;
                    for (int i = 0; i < projList_1.size(); i++) {
                        if (projList_1.get(i).getProjid().longValue()!=projid.longValue()) {
                            sumHistoryPactmoney = sumHistoryPactmoney + (projList_1.get(i).getAssuremoney() == null ? 0 : projList_1.get(i).getAssuremoney());
                            sumHistoryProlastsuming = sumHistoryProlastsuming + (projList_1.get(i).getLastsuming() == null ? 0 : projList_1.get(i).getLastsuming());
                            projList.add(projList_1.get(i));
                        }
                    }
  • 相关阅读:
    ReentrantLock和AQS
    CAS
    java8中ConcurrentHashMap
    java8中的HashMap
    TCP和UDP
    慢查询日志和profiling
    explain的使用
    select、poll、epoll之间的区别
    I/O模型
    生产者-消费者模式
  • 原文地址:https://www.cnblogs.com/xh_Blog/p/9408259.html
Copyright © 2011-2022 走看看