//////////////////////////////////////
322782
@javax.jdo.annotations.NotPersistent
    @MemberOrder(sequence="2")
    public String getSector() {
        final Tag existingTag = getSectorTag();
        return existingTag != null ? existingTag.getValue() : null;
    }
4310
private void createDayPanel() {

        CmsCheckBox box = new CmsCheckBox(Messages.get().key(Messages.GUI_SERIALDATE_DAY_MONDAY_0));
        box.setInternalValue(WeekDay.MONDAY.toString());
        box.addValueChangeHandler(m_checkBoxValueChangeHandler);
        m_checkboxes.add(box);
        m_dayPanel.add(box);
        box = new CmsCheckBox(Messages.get().key(Messages.GUI_SERIALDATE_DAY_TUESDAY_0));
        box.setInternalValue(WeekDay.TUESDAY.toString());
        box.addValueChangeHandler(m_checkBoxValueChangeHandler);
        m_checkboxes.add(box);
        m_dayPanel.add(box);
        box = new CmsCheckBox(Messages.get().key(Messages.GUI_SERIALDATE_DAY_WEDNESDAY_0));
        box.setInternalValue(WeekDay.WEDNESDAY.toString());
        box.addValueChangeHandler(m_checkBoxValueChangeHandler);
        m_checkboxes.add(box);
        m_dayPanel.add(box);
        box = new CmsCheckBox(Messages.get().key(Messages.GUI_SERIALDATE_DAY_THURSDAY_0));
        box.setInternalValue(WeekDay.THURSDAY.toString());
        box.addValueChangeHandler(m_checkBoxValueChangeHandler);
        m_checkboxes.add(box);
        m_dayPanel.add(box);
        box = new CmsCheckBox(Messages.get().key(Messages.GUI_SERIALDATE_DAY_FRIDAY_0));
        box.setInternalValue(WeekDay.FRIDAY.toString());
        box.addValueChangeHandler(m_checkBoxValueChangeHandler);
        m_checkboxes.add(box);
        m_dayPanel.add(box);
        box = new CmsCheckBox(Messages.get().key(Messages.GUI_SERIALDATE_DAY_SATURDAY_0));
        box.setInternalValue(WeekDay.SATURDAY.toString());
        box.addValueChangeHandler(m_checkBoxValueChangeHandler);
        m_checkboxes.add(box);
        m_dayPanel.add(box);
        box = new CmsCheckBox(Messages.get().key(Messages.GUI_SERIALDATE_DAY_SUNDAY_0));
        box.setInternalValue(WeekDay.SUNDAY.toString());
        box.addValueChangeHandler(m_checkBoxValueChangeHandler);
        box.addValueChangeHandler(m_checkBoxValueChangeHandler);
        m_checkboxes.add(box);
        m_dayPanel.add(box);
    }
917582
function(data) {
            if (data.row.index === 5) {
                data.cell.styles.fillColor = [40, 170, 100];
            }

            if ((data.row.section === 'head' || data.row.section === 'foot') && data.column.dataKey === "expenses") {
                data.cell.text = '' // Use an icon in didDrawCell instead
            }

            if (data.row.index === 0 && data.row.section === 'body' && data.column.dataKey === 'city') {
                data.cell.text = 'とうきょう'
            }
        }
259283
function(article, options, callback) {

            if (arguments.length === 2) {
                callback = options;
                options = null;
            }

            var self = this;

            //noinspection JSValidateTypes
            flow()
                .seq(function(cb) {
                    article.fetch(null, cb);
                })
                .seq("product", function(cb) {
                    self.initializeProduct(article.$.product, options, cb);
                })
                .exec(function(err, results) {
                    callback && callback(err, results.product);
                });
        }
512149
public void updateChangeLog(final Principal user, final Verb verb, final String linkType, final String linkId, final String object, final Direction direction) {

		if (Settings.ChangelogEnabled.getValue()) {

			final JsonObject obj = new JsonObject();

			obj.add("time",     toElement(System.currentTimeMillis()));
			obj.add("userId",   toElement(user.getUuid()));
			obj.add("userName", toElement(user.getName()));
			obj.add("verb",     toElement(verb));
			obj.add("rel",      toElement(linkType));
			obj.add("relId",    toElement(linkId));
			obj.add("relDir",   toElement(direction));
			obj.add("target",   toElement(object));

			changeLog.append(obj.toString());
			changeLog.append("\n");
		}
	}
281171
private void initSelectBoxes() {

        m_atDay.getOpener().setStyleName(
            org.opencms.acacia.client.css.I_CmsWidgetsLayoutBundle.INSTANCE.widgetCss().selectBoxSelected());
        m_atDay.getSelectorPopup().addStyleName(I_CmsLayoutBundle.INSTANCE.globalWidgetCss().selectBoxPopup());
        m_atDay.addOption(WeekDay.SUNDAY.toString(), Messages.get().key(Messages.GUI_SERIALDATE_DAY_SUNDAY_0));
        m_atDay.addOption(WeekDay.MONDAY.toString(), Messages.get().key(Messages.GUI_SERIALDATE_DAY_MONDAY_0));
        m_atDay.addOption(WeekDay.TUESDAY.toString(), Messages.get().key(Messages.GUI_SERIALDATE_DAY_TUESDAY_0));
        m_atDay.addOption(WeekDay.WEDNESDAY.toString(), Messages.get().key(Messages.GUI_SERIALDATE_DAY_WEDNESDAY_0));
        m_atDay.addOption(WeekDay.THURSDAY.toString(), Messages.get().key(Messages.GUI_SERIALDATE_DAY_THURSDAY_0));
        m_atDay.addOption(WeekDay.FRIDAY.toString(), Messages.get().key(Messages.GUI_SERIALDATE_DAY_FRIDAY_0));
        m_atDay.addOption(WeekDay.SATURDAY.toString(), Messages.get().key(Messages.GUI_SERIALDATE_DAY_SATURDAY_0));
        m_atDay.setWidth("100px");
    }
480649
public static List<String> requiredColumns(String idColumnName) {

		if (idColumnName == null) {
			idColumnName = COLUMN_ID;
		}

		List<String> requiredColumns = new ArrayList<>();
		requiredColumns.add(idColumnName);
		requiredColumns.add(COLUMN_DATA);
		requiredColumns.add(COLUMN_CONTENT_TYPE);
		return requiredColumns;
	}
1363690
@Override
    public void onCreate(SQLiteDatabase db) {
        try {
            if(builder.tables == null){
                throw new SQLiteHelperException("The array of String tables can't be null!!");
            }
            executePragma(db);

            builder.onCreateCallback.onCreate(db);
        } catch (SQLiteHelperException e) {
            Log.e(this.getClass().toString(), Log.getStackTraceString(e), e);
        }
    }
1297424
private void setGeneratedKeyColumns(final SqlContext context, final MappingColumn[] idColumns,
			final TableMetadata metadata) {
		// 実行結果から生成されたIDを取得できるようにPreparedStatementにIDカラムを渡す
		if (idColumns != null && idColumns.length > 0) {
			List<String> keyColumnNames = new ArrayList<>();
			for (MappingColumn idColumn : idColumns) {
				for (TableMetadata.Column column : metadata.getColumns()) {
					if (idColumn.getCamelName().equals(column.getCamelColumnName())) {
						keyColumnNames.add(column.getColumnName());
						break;
					}
				}
			}
			context.setGeneratedKeyColumns(keyColumnNames.toArray(new String[keyColumnNames.size()]));
		}
	}
58582
private void checkIndices(int row, int col) {
        if (row < 0 || col < 0 || row >= rows || col >= columns) {
            throw new IndexOutOfBoundsException();
        }
    }
90967
private static List<Map<String, Object>> handleResultSetToMapList(ResultSet result,
                                                                      List<Map<String, Object>> listProperties)
            throws SQLException {
        // 存放记录的信息
        Map<String, Object> property = null;

        // 获取结果集中的列名
        List<String> listColumns = DBUtils.getColumnLabels(result);

        // 存放记录
        while (result.next()) {
            property = new HashMap<String, Object>();
            // 将每条记录的列以及相应的列值存入一个Map对象中
            for (int i = 0; i < listColumns.size(); i++) {
                property.put(listColumns.get(i), result.getObject(i + 1));
            }
            // 将存入记录的每个map对象放入数组中
            listProperties.add(property);
        }
        return listProperties;
    }
1300157
protected static void reOrganizeType(QueryColumnImpl column) {
	if ((column.type == Types.OTHER) && !column.typeChecked) {
	    column.typeChecked = true;
	    if (column.size() > 0) {
		checkOther(column, column.data[0]);

		// get Type
		for (int i = 1; i < column.size(); i++) {
		    switch (column.type) {
		    case Types.NULL:
			checkOther(column, column.data[i]);
			break;
		    case Types.TIMESTAMP:
			checkDate(column, column.data[i]);
			break;
		    // case Types.DATE:checkDate(column.data[i]);break;
		    case Types.BOOLEAN:
			checkBoolean(column, column.data[i]);
			break;
		    case Types.DOUBLE:
			checkDouble(column, column.data[i]);
			break;
		    case Types.VARCHAR:
			checkBasic(column, column.data[i]);
			break;
		    default:
			break;
		    }
		}
	    }
	}
    }
1086042
public static void main(String[] args) {
    SparkSession spark = SparkSession
      .builder()
      .appName("Java Spark SQL user-defined Datasets aggregation example")
      .getOrCreate();

    // $example on:typed_custom_aggregation$
    Encoder<Employee> employeeEncoder = Encoders.bean(Employee.class);
    String path = "examples/src/main/resources/employees.json";
    Dataset<Employee> ds = spark.read().json(path).as(employeeEncoder);
    ds.show();
    // +-------+------+
    // |   name|salary|
    // +-------+------+
    // |Michael|  3000|
    // |   Andy|  4500|
    // | Justin|  3500|
    // |  Berta|  4000|
    // +-------+------+

    MyAverage myAverage = new MyAverage();
    // Convert the function to a `TypedColumn` and give it a name
    TypedColumn<Employee, Double> averageSalary = myAverage.toColumn().name("average_salary");
    Dataset<Double> result = ds.select(averageSalary);
    result.show();
    // +--------------+
    // |average_salary|
    // +--------------+
    // |        3750.0|
    // +--------------+
    // 
    spark.stop();
  }
132141
public final void makeOrdLn(final Map<String, Object> pRqVs,
    final List<CustOrder> pOrders, final AItemPlace<?, ?> pItPl,
      final CartLn pCartLn, final TradingSettings pTs) throws Exception {
    CustOrder cuOr = null;
    boolean isNdOrInit = true;
    for (CustOrder co : pOrders) {
      if (co.getCurr() != null) {
        cuOr = co;
        isNdOrInit = false;
        break;
      }
    }
    if (cuOr == null) {
      cuOr = new CustOrder();
      cuOr.setIsNew(true);
      cuOr.setTaxes(new ArrayList<CustOrderTxLn>());
      cuOr.setGoods(new ArrayList<CustOrderGdLn>());
      cuOr.setServs(new ArrayList<CustOrderSrvLn>());
      pOrders.add(cuOr);
    }
    if (isNdOrInit) {
      cuOr.setDat(new Date());
      cuOr.setStat(EOrdStat.NEW);
      cuOr.setDeliv(pCartLn.getItsOwner().getDeliv());
      cuOr.setPayMeth(pCartLn.getItsOwner().getPayMeth());
      cuOr.setBuyer(pCartLn.getItsOwner().getBuyer());
      //TODO method "pickup by buyer from several places"
      //cuOr.setPlace(pItPl.getPickUpPlace());
      cuOr.setPur(pCartLn.getItsOwner().getItsVersion());
      cuOr.setCurr(pCartLn.getItsOwner().getCurr());
      cuOr.setExcRt(pCartLn.getItsOwner().getExcRt());
      cuOr.setDescr(pCartLn.getItsOwner().getDescr());
    }
    pRqVs.put(CartItTxLn.class.getSimpleName() + "itsOwnerdeepLevel", 1);
    pRqVs.put(CartItTxLn.class.getSimpleName() + "taxdeepLevel", 1);
    List<CartItTxLn> citls = getSrvOrm().retrieveListWithConditions(pRqVs,
      CartItTxLn.class, "where DISAB=0 and ITSOWNER=" + pCartLn.getItsId());
    pRqVs.remove(CartItTxLn.class.getSimpleName() + "itsOwnerdeepLevel");
    pRqVs.remove(CartItTxLn.class.getSimpleName() + "taxdeepLevel");
    ACustOrderLn ol;
    if (pCartLn.getItTyp().equals(EShopItemType.GOODS)) {
      CustOrderGdLn ogl = null;
      if (!cuOr.getIsNew()) {
        for (CustOrderGdLn gl : cuOr.getGoods()) {
          if (gl.getGood() == null) {
            ogl = gl;
            break;
          }
        }
      }
      if (ogl == null) {
        ogl = new CustOrderGdLn();
        ogl.setIsNew(true);
        cuOr.getGoods().add(ogl);
      }
      InvItem gd = new InvItem();
      gd.setItsId(pCartLn.getItId());
      gd.setItsName(pCartLn.getItsName());
      ogl.setGood(gd);
      if (citls.size() > 0) {
        if (ogl.getIsNew()) {
          ogl.setItTxs(new ArrayList<CuOrGdTxLn>());
        }
        for (CartItTxLn citl : citls) {
          CuOrGdTxLn oitl = null;
          if (!cuOr.getIsNew()) {
            for (CuOrGdTxLn itl : ogl.getItTxs()) {
              if (itl.getTax() == null) {
                oitl = itl;
                break;
              }
            }
          }
          if (oitl == null) {
            oitl = new CuOrGdTxLn();
            oitl.setIsNew(true);
            ogl.getItTxs().add(oitl);
          }
          oitl.setItsOwner(ogl);
          Tax tx = new Tax();
          tx.setItsId(citl.getTax().getItsId());
          tx.setItsName(citl.getTax().getItsName());
          oitl.setTax(tx);
          oitl.setTot(citl.getTot());
        }
      }
      ol = ogl;
    } else {
      CustOrderSrvLn osl = null;
      if (!cuOr.getIsNew()) {
        for (CustOrderSrvLn sl : cuOr.getServs()) {
          if (sl.getService() == null) {
            osl = sl;
            break;
          }
        }
      }
      if (osl == null) {
        osl = new CustOrderSrvLn();
        osl.setIsNew(true);
        cuOr.getServs().add(osl);
      }
      ServiceToSale sr = new ServiceToSale();
      sr.setItsId(pCartLn.getItId());
      sr.setItsName(pCartLn.getItsName());
      osl.setService(sr);
      osl.setDt1(pCartLn.getDt1());
      osl.setDt2(pCartLn.getDt2());
      if (citls.size() > 0) {
        if (osl.getIsNew()) {
          osl.setItTxs(new ArrayList<CuOrSrTxLn>());
        }
        for (CartItTxLn citl : citls) {
          CuOrSrTxLn oitl = null;
          if (!cuOr.getIsNew()) {
            for (CuOrSrTxLn itl : osl.getItTxs()) {
              if (itl.getTax() == null) {
                oitl = itl;
                break;
              }
            }
          }
          if (oitl == null) {
            oitl = new CuOrSrTxLn();
            oitl.setIsNew(true);
            osl.getItTxs().add(oitl);
          }
          oitl.setItsOwner(osl);
          Tax tx = new Tax();
          tx.setItsId(citl.getTax().getItsId());
          tx.setItsName(citl.getTax().getItsName());
          oitl.setTax(tx);
          oitl.setTot(citl.getTot());
        }
      }
      ol = osl;
    }
    ol.setItsName(pCartLn.getItsName());
    ol.setDescr(pCartLn.getDescr());
    ol.setUom(pCartLn.getUom());
    ol.setPrice(pCartLn.getPrice());
    ol.setQuant(pCartLn.getQuant());
    ol.setSubt(pCartLn.getSubt());
    ol.setTot(pCartLn.getTot());
    ol.setTotTx(pCartLn.getTotTx());
    ol.setTxCat(pCartLn.getTxCat());
    ol.setTxDsc(pCartLn.getTxDsc());
  }
1309773
protected void init() {

        m_elementMappings = new HashMap<String, List<String>>();
        m_elementWidgets = new HashMap<String, I_CmsWidget>();
        m_validationErrorRules = new HashMap<String, String>();
        m_validationErrorMessages = new HashMap<String, String>();
        m_validationWarningRules = new HashMap<String, String>();
        m_validationWarningMessages = new HashMap<String, String>();
        m_defaultValues = new HashMap<String, String>();
        m_configurationValues = new HashMap<String, String>();
        m_searchSettings = new HashMap<String, Boolean>();
        m_relations = new HashMap<String, CmsRelationType>();
        m_relationChecks = new HashMap<String, Boolean>();
        m_previewLocation = null;
        m_modelFolder = null;
        m_tabs = new ArrayList<CmsXmlContentTab>();
        m_cssHeadIncludes = new LinkedHashSet<String>();
        m_jsHeadIncludes = new LinkedHashSet<String>();
        m_settings = new LinkedHashMap<String, CmsXmlContentProperty>();
        m_titleMappings = new ArrayList<String>(2);
        m_formatters = new ArrayList<CmsFormatterBean>();
        m_searchFields = new HashMap<String, CmsSearchField>();
        m_searchFieldsPage = new HashMap<String, CmsSearchField>();
        m_allowedTemplates = new CmsDefaultSet<String>();
        m_allowedTemplates.setDefaultMembership(true);
        m_displayTypes = new HashMap<String, DisplayType>();
        m_synchronizations = new ArrayList<String>();
        m_editorChangeHandlers = new ArrayList<I_CmsXmlContentEditorChangeHandler>();
        m_nestedFormatterElements = new HashSet<String>();
        try (
        InputStream stream = CmsDefaultXmlContentHandler.class.getResourceAsStream("simple-searchsetting-configs.st")) {
            m_searchTemplateGroup = CmsStringUtil.readStringTemplateGroup(stream);
        } catch (IOException e) {
            LOG.error(e.getLocalizedMessage(), e);
        }
    }
788560
@Override
    public void selectionChanged(IAction action, ISelection selection) {

        bugInstance = null;
        // TODO learn to deal with ALL elements
        IMarker markerFromSelection = MarkerUtil.getMarkerFromSingleSelection(selection);
        marker = markerFromSelection;

        if (marker == null) {
            // No marker selected.
            return;
        }
        if (DEBUG) {
            System.out.println("Found a marker!");
        }

        bugInstance = MarkerUtil.findBugInstanceForMarker(marker);
        if (bugInstance != null) {
            if (DEBUG) {
                System.out.println("Found BugInstance for SpotBugs warning marker!");
            }
        }
    }
241300
public static void main(String[] args) throws Exception {

		final ParameterTool params = ParameterTool.fromArgs(args);

		if (!params.has("lineitem") && !params.has("customer") && !params.has("orders")) {
			System.err.println("  This program expects data from the TPC-H benchmark as input data.");
			System.err.println("  Due to legal restrictions, we can not ship generated data.");
			System.out.println("  You can find the TPC-H data generator at http://www.tpc.org/tpch/.");
			System.out.println("  Usage: TPCHQuery3 --lineitem <path> --customer <path> --orders <path> [--output <path>]");
			return;
		}

		final ExecutionEnvironment env = ExecutionEnvironment.getExecutionEnvironment();

		env.getConfig().setGlobalJobParameters(params);

		// get input data
		DataSet<Lineitem> lineitems = getLineitemDataSet(env, params.get("lineitem"));
		DataSet<Customer> customers = getCustomerDataSet(env, params.get("customer"));
		DataSet<Order> orders = getOrdersDataSet(env, params.get("orders"));

		// Filter market segment "AUTOMOBILE"
		customers = customers.filter(
								new FilterFunction<Customer>() {
									@Override
									public boolean filter(Customer c) {
										return c.getMktsegment().equals("AUTOMOBILE");
									}
								});

		// Filter all Orders with o_orderdate < 12.03.1995
		orders = orders.filter(
							new FilterFunction<Order>() {
								private final DateFormat format = new SimpleDateFormat("yyyy-MM-dd");
								private final Date date = format.parse("1995-03-12");

								@Override
								public boolean filter(Order o) throws ParseException {
									return format.parse(o.getOrderdate()).before(date);
								}
							});

		// Filter all Lineitems with l_shipdate > 12.03.1995
		lineitems = lineitems.filter(
								new FilterFunction<Lineitem>() {
									private final DateFormat format = new SimpleDateFormat("yyyy-MM-dd");
									private final Date date = format.parse("1995-03-12");

									@Override
									public boolean filter(Lineitem l) throws ParseException {
										return format.parse(l.getShipdate()).after(date);
									}
								});

		// Join customers with orders and package them into a ShippingPriorityItem
		DataSet<ShippingPriorityItem> customerWithOrders =
				customers.join(orders).where(0).equalTo(1)
							.with(
								new JoinFunction<Customer, Order, ShippingPriorityItem>() {
									@Override
									public ShippingPriorityItem join(Customer c, Order o) {
										return new ShippingPriorityItem(o.getOrderKey(), 0.0, o.getOrderdate(),
												o.getShippriority());
									}
								});

		// Join the last join result with Lineitems
		DataSet<ShippingPriorityItem> result =
				customerWithOrders.join(lineitems).where(0).equalTo(0)
									.with(
											new JoinFunction<ShippingPriorityItem, Lineitem, ShippingPriorityItem>() {
												@Override
												public ShippingPriorityItem join(ShippingPriorityItem i, Lineitem l) {
													i.setRevenue(l.getExtendedprice() * (1 - l.getDiscount()));
													return i;
												}
											})
								// Group by l_orderkey, o_orderdate and o_shippriority and compute revenue sum
								.groupBy(0, 2, 3)
								.aggregate(Aggregations.SUM, 1);

		// emit result
		if (params.has("output")) {
			result.writeAsCsv(params.get("output"), "\n", "|");
			// execute program
			env.execute("TPCH Query 3 Example");
		} else {
			System.out.println("Printing result to stdout. Use --output to specify output path.");
			result.print();
		}

	}