idx int32 46 1.86M | input stringlengths 321 6.6k | target stringlengths 9 1.24k |
|---|---|---|
1,719,550 | static WebSocketClientHandshaker newHandshaker(URI webSocketURL, WebSocketVersion version, String subprotocol, boolean allowExtensions, HttpHeaders customHeaders, int maxFramePayloadLength, boolean performMasking) {<NEW_LINE>WebSocketDecoderConfig config = WebSocketDecoderConfig.newBuilder().expectMaskedFrames(false).allowExtensions(allowExtensions).maxFramePayloadLength(maxFramePayloadLength).allowMaskMismatch(false).closeOnProtocolViolation(false).build();<NEW_LINE>if (version == V13) {<NEW_LINE>return new WebSocketClientHandshaker13(webSocketURL, V13, subprotocol, allowExtensions, customHeaders, maxFramePayloadLength, performMasking, false, -1) {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>protected WebSocketFrameDecoder newWebsocketDecoder() {<NEW_LINE>return new WebSocket13FrameDecoder(config);<NEW_LINE>}<NEW_LINE>};<NEW_LINE>}<NEW_LINE>if (version == V08) {<NEW_LINE>return new WebSocketClientHandshaker08(webSocketURL, V08, subprotocol, allowExtensions, customHeaders, maxFramePayloadLength, performMasking, false, -1) {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>protected WebSocketFrameDecoder newWebsocketDecoder() {<NEW_LINE>return new WebSocket08FrameDecoder(config);<NEW_LINE>}<NEW_LINE>};<NEW_LINE>}<NEW_LINE>if (version == V07) {<NEW_LINE>return new WebSocketClientHandshaker07(webSocketURL, V07, subprotocol, allowExtensions, customHeaders, maxFramePayloadLength, performMasking, false, -1) {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>protected WebSocketFrameDecoder newWebsocketDecoder() {<NEW_LINE>return new WebSocket07FrameDecoder(config);<NEW_LINE>}<NEW_LINE>};<NEW_LINE>}<NEW_LINE>if (version == V00) {<NEW_LINE>return new WebSocketClientHandshaker00(webSocketURL, V00, subprotocol<MASK><NEW_LINE>}<NEW_LINE>throw new WebSocketHandshakeException("Protocol version " + version + " not supported.");<NEW_LINE>} | , customHeaders, maxFramePayloadLength, -1); |
238,162 | public static License fromXContent(XContentParser parser) throws IOException {<NEW_LINE>String licenseKey = null;<NEW_LINE>// advance from metadata START_OBJECT<NEW_LINE>XContentParser.Token token = parser.nextToken();<NEW_LINE>if (token != XContentParser.Token.FIELD_NAME || !Objects.equals(parser.currentName(), WRITEABLE_TYPE)) {<NEW_LINE>throw new IllegalArgumentException("license FIELD_NAME expected but got " + parser.currentToken());<NEW_LINE>}<NEW_LINE>// advance to license START_OBJECT<NEW_LINE>if (parser.nextToken() != XContentParser.Token.START_OBJECT) {<NEW_LINE>throw new IllegalArgumentException("license START_OBJECT expected but got " + parser.currentToken());<NEW_LINE>}<NEW_LINE>while ((token = parser.nextToken()) == XContentParser.Token.FIELD_NAME) {<NEW_LINE>if ("license_key".equals(parser.currentName())) {<NEW_LINE>licenseKey = parseStringField(parser);<NEW_LINE>} else {<NEW_LINE>throw new IllegalArgumentException(<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>// license END_OBJECT is already consumed - check for correctness<NEW_LINE>if (parser.currentToken() != XContentParser.Token.END_OBJECT) {<NEW_LINE>throw new IllegalArgumentException("expected the license object token at the end");<NEW_LINE>}<NEW_LINE>if (parser.nextToken() != XContentParser.Token.END_OBJECT) {<NEW_LINE>// each custom metadata is packed inside an object.<NEW_LINE>// each custom must move the parser to the end otherwise possible following customs won't be read<NEW_LINE>throw new IllegalArgumentException("expected an object token at the end");<NEW_LINE>}<NEW_LINE>return new License(licenseKey);<NEW_LINE>} | "unexpected FIELD_NAME " + parser.currentToken()); |
953,151 | private BindableValue bindableValueFor(JsonToken token) {<NEW_LINE>if (!JsonTokenType.STRING.equals(token.getType()) && !JsonTokenType.UNQUOTED_STRING.equals(token.getType()) && !JsonTokenType.REGULAR_EXPRESSION.equals(token.getType())) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>boolean isRegularExpression = token.getType().equals(JsonTokenType.REGULAR_EXPRESSION);<NEW_LINE>BindableValue bindableValue = new BindableValue();<NEW_LINE>String tokenValue = isRegularExpression ? token.getValue(BsonRegularExpression.class).getPattern() : String.class.cast(token.getValue());<NEW_LINE>Matcher matcher = PARAMETER_BINDING_PATTERN.matcher(tokenValue);<NEW_LINE>if (token.getType().equals(JsonTokenType.UNQUOTED_STRING)) {<NEW_LINE>Matcher regexMatcher = EXPRESSION_BINDING_PATTERN.matcher(tokenValue);<NEW_LINE>if (regexMatcher.find()) {<NEW_LINE>String binding = regexMatcher.group();<NEW_LINE>String expression = binding.substring(3, binding.length() - 1);<NEW_LINE>Matcher inSpelMatcher = PARAMETER_BINDING_PATTERN.matcher(expression);<NEW_LINE>while (inSpelMatcher.find()) {<NEW_LINE>int index = <MASK><NEW_LINE>expression = expression.replace(inSpelMatcher.group(), getBindableValueForIndex(index).toString());<NEW_LINE>}<NEW_LINE>Object value = evaluateExpression(expression);<NEW_LINE>bindableValue.setValue(value);<NEW_LINE>bindableValue.setType(bsonTypeForValue(value));<NEW_LINE>return bindableValue;<NEW_LINE>}<NEW_LINE>if (matcher.find()) {<NEW_LINE>int index = computeParameterIndex(matcher.group());<NEW_LINE>bindableValue.setValue(getBindableValueForIndex(index));<NEW_LINE>bindableValue.setType(bsonTypeForValue(getBindableValueForIndex(index)));<NEW_LINE>return bindableValue;<NEW_LINE>}<NEW_LINE>bindableValue.setValue(tokenValue);<NEW_LINE>bindableValue.setType(BsonType.STRING);<NEW_LINE>return bindableValue;<NEW_LINE>}<NEW_LINE>String computedValue = tokenValue;<NEW_LINE>Matcher regexMatcher = EXPRESSION_BINDING_PATTERN.matcher(computedValue);<NEW_LINE>while (regexMatcher.find()) {<NEW_LINE>String binding = regexMatcher.group();<NEW_LINE>String expression = binding.substring(3, binding.length() - 1);<NEW_LINE>Matcher inSpelMatcher = PARAMETER_BINDING_PATTERN.matcher(expression);<NEW_LINE>while (inSpelMatcher.find()) {<NEW_LINE>int index = computeParameterIndex(inSpelMatcher.group());<NEW_LINE>expression = expression.replace(inSpelMatcher.group(), getBindableValueForIndex(index).toString());<NEW_LINE>}<NEW_LINE>computedValue = computedValue.replace(binding, nullSafeToString(evaluateExpression(expression)));<NEW_LINE>bindableValue.setValue(computedValue);<NEW_LINE>bindableValue.setType(BsonType.STRING);<NEW_LINE>return bindableValue;<NEW_LINE>}<NEW_LINE>while (matcher.find()) {<NEW_LINE>String group = matcher.group();<NEW_LINE>int index = computeParameterIndex(group);<NEW_LINE>computedValue = computedValue.replace(group, nullSafeToString(getBindableValueForIndex(index)));<NEW_LINE>}<NEW_LINE>if (isRegularExpression) {<NEW_LINE>bindableValue.setValue(new BsonRegularExpression(computedValue));<NEW_LINE>bindableValue.setType(BsonType.REGULAR_EXPRESSION);<NEW_LINE>} else {<NEW_LINE>bindableValue.setValue(computedValue);<NEW_LINE>bindableValue.setType(BsonType.STRING);<NEW_LINE>}<NEW_LINE>return bindableValue;<NEW_LINE>} | computeParameterIndex(inSpelMatcher.group()); |
40,366 | public void paint(JComponent c, Graphics g, PaintContext context, Rectangle clip, FieldBackgroundColorManager map, RowColLocation cursorLoc, int rowHeight) {<NEW_LINE>// center in the heightAbove area (negative, since 0 is the baseline of text, which is at<NEW_LINE>// the bottom of the heightAbove)<NEW_LINE>int toggleHandleStartY = -((heightAbove / 2) + (toggleHandleSize / 2));<NEW_LINE>int toggleHandleStartX = startX + (indentLevel * fieldWidth) + insetSpace;<NEW_LINE>// TODO: If we're in printing mode, trying to render these open/close images<NEW_LINE>// causes the JVM to bomb. We'd like to eventually figure out why but in<NEW_LINE>// the meantime we can safely comment this out and still generate an acceptable<NEW_LINE>// image.<NEW_LINE>//<NEW_LINE>if (!context.isPrinting()) {<NEW_LINE>if (isOpen) {<NEW_LINE>g.drawImage(openImage.getImage(), toggleHandleStartX, toggleHandleStartY, <MASK><NEW_LINE>} else {<NEW_LINE>g.drawImage(closedImage.getImage(), toggleHandleStartX, toggleHandleStartY, context.getBackground(), null);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>g.setColor(Color.LIGHT_GRAY);<NEW_LINE>// draw the vertical lines to the left of the toggle handle (these are shown when<NEW_LINE>// there are vertical bars drawn for inset data)<NEW_LINE>int fieldTopY = -heightAbove;<NEW_LINE>int fieldBottomY = heightBelow;<NEW_LINE>int toggleHandleHalfLength = toggleHandleSize / 2;<NEW_LINE>for (int i = 1; i < indentLevel; i++) {<NEW_LINE>int fieldOffset = i * fieldWidth;<NEW_LINE>int previousButtonStartX = startX + fieldOffset + insetSpace;<NEW_LINE>int midpointX = previousButtonStartX + toggleHandleHalfLength;<NEW_LINE>g.drawLine(midpointX, fieldTopY, midpointX, fieldBottomY);<NEW_LINE>}<NEW_LINE>if (indentLevel > 0) {<NEW_LINE>// horizontal line to the right of the toggle handle<NEW_LINE>int indentOffset = getWidth();<NEW_LINE>int toggleHandleEndX = toggleHandleStartX + toggleHandleSize;<NEW_LINE>int midpointY = toggleHandleStartY + (toggleHandleSize / 2);<NEW_LINE>int endX = startX + indentOffset;<NEW_LINE>g.drawLine(toggleHandleEndX, midpointY, endX, midpointY);<NEW_LINE>// vertical line above toggle handle<NEW_LINE>int midpointX = toggleHandleStartX + toggleHandleHalfLength;<NEW_LINE>int endY = toggleHandleStartY - insetSpace;<NEW_LINE>g.drawLine(midpointX, fieldTopY, midpointX, endY);<NEW_LINE>boolean lastAndClosed = isLast && !isOpen;<NEW_LINE>if (!lastAndClosed) {<NEW_LINE>// extended vertical line below toggle handle<NEW_LINE>int buttonBottomY = toggleHandleStartY + toggleHandleSize;<NEW_LINE>g.drawLine(midpointX, buttonBottomY, midpointX, fieldBottomY);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>paintCursor(g, context.getCursorColor(), cursorLoc);<NEW_LINE>} | context.getBackground(), null); |
1,378,325 | public void actionPerformed(ActionEvent e) {<NEW_LINE>@SuppressWarnings("unchecked")<NEW_LINE>JComboBox<String> cb = (JComboBox<String>) e.getSource();<NEW_LINE>String filename = (String) cb.getSelectedItem();<NEW_LINE><MASK><NEW_LINE>MapPanel.INSTANCE.vertices = null;<NEW_LINE>try {<NEW_LINE>ControlPanel.this.building = new CleanBuilding(filename, false);<NEW_LINE>dataset = new DatasetCreator(building.getBuid(), 1456737260395L, true);<NEW_LINE>pairsPanel.remove(comboboxPath);<NEW_LINE>Integer[] temp = new Integer[dataset.getDataset().size()];<NEW_LINE>for (int i = 0; i < temp.length; i++) temp[i] = i;<NEW_LINE>comboboxPath = new JComboBox<>(temp);<NEW_LINE>pairsPanel.add(comboboxPath, 3);<NEW_LINE>pairsPanel.updateUI();<NEW_LINE>} catch (Exception e1) {<NEW_LINE>LOGGER.severe((e1.getMessage()));<NEW_LINE>}<NEW_LINE>} | LOGGER.info("Changed building to " + filename); |
1,474,293 | public static void main(String[] args) {<NEW_LINE>Path data = FileSystems.<MASK><NEW_LINE>try {<NEW_LINE>Map<String, String> config = SusiServer.readConfig(data);<NEW_LINE>DAO.init(config, data, true);<NEW_LINE>File f = new File("conf/os_skills/operation/en/en_0001_foundation.txt");<NEW_LINE>SusiSkill.ID skillid = new SusiSkill.ID(f);<NEW_LINE>String test = "pause | pause that | pause this | pause *\n" + "!console:\n" + "{\"actions\":[{\"type\":\"pause\"}]}\n" + "eol";<NEW_LINE>SusiSkillFile ssf = new SusiSkillFile(new BufferedReader(new StringReader(test)));<NEW_LINE>System.out.println(ssf.toString());<NEW_LINE>SusiSkill ss = new SusiSkill(ssf, skillid, false);<NEW_LINE>System.out.println(ss.toJSON().toString(2));<NEW_LINE>ssf = SusiSkillFile.load(f);<NEW_LINE>System.out.println(ssf.toString());<NEW_LINE>ss = new SusiSkill(ssf, skillid, false);<NEW_LINE>System.out.println(ss.toJSON().toString(2));<NEW_LINE>} catch (Exception e) {<NEW_LINE>e.printStackTrace();<NEW_LINE>}<NEW_LINE>System.exit(0);<NEW_LINE>} | getDefault().getPath("data"); |
337,822 | public void run(RegressionEnvironment env) {<NEW_LINE>String[] fields = "c0,c1,c2,c3,c4".split(",");<NEW_LINE>SupportEvalBuilder builder = new SupportEvalBuilder("SupportCollection");<NEW_LINE>builder.expression<MASK><NEW_LINE>builder.expression(fields[1], "strvals.distinctOf(v => extractNum(v))");<NEW_LINE>builder.expression(fields[2], "strvals.distinctOf((v, i) => case when i<2 then extractNum(v) else 0 end)");<NEW_LINE>builder.expression(fields[3], "strvals.distinctOf((v, i, s) => case when s<=2 then extractNum(v) else 0 end)");<NEW_LINE>builder.expression(fields[4], "strvals.distinctOf(v => null)");<NEW_LINE>builder.statementConsumer(stmt -> SupportEventPropUtil.assertTypesAllSame(stmt.getEventType(), fields, EPTypeClassParameterized.from(Collection.class, String.class)));<NEW_LINE>builder.assertion(SupportCollection.makeString("E2,E1,E2,E2")).verify("c0", val -> assertValuesArrayScalar(val, "E2", "E1")).verify("c1", val -> assertValuesArrayScalar(val, "E2", "E1")).verify("c2", val -> assertValuesArrayScalar(val, "E2", "E1", "E2")).verify("c3", val -> assertValuesArrayScalar(val, "E2")).verify("c4", val -> assertValuesArrayScalar(val, "E2"));<NEW_LINE>LambdaAssertionUtil.assertSingleAndEmptySupportColl(builder, fields);<NEW_LINE>builder.run(env);<NEW_LINE>} | (fields[0], "strvals.distinctOf()"); |
1,645,841 | public Boolean2DArrayAssert isDeepEqualTo(boolean[][] expected) {<NEW_LINE>// boolean[][] actual = new boolean[][] { { true, false }, { false, true } };<NEW_LINE>if (actual == expected)<NEW_LINE>return myself;<NEW_LINE>isNotNull();<NEW_LINE>if (expected.length != actual.length) {<NEW_LINE>throw failures.failure(info, shouldHaveSameSizeAs(actual, expected, actual<MASK><NEW_LINE>}<NEW_LINE>for (int i = 0; i < actual.length; i++) {<NEW_LINE>boolean[] actualSubArray = actual[i];<NEW_LINE>boolean[] expectedSubArray = expected[i];<NEW_LINE>if (actualSubArray == expectedSubArray)<NEW_LINE>continue;<NEW_LINE>if (actualSubArray == null)<NEW_LINE>throw failures.failure(info, shouldNotBeNull("actual[" + i + "]"));<NEW_LINE>if (expectedSubArray.length != actualSubArray.length) {<NEW_LINE>throw failures.failure(info, subarraysShouldHaveSameSize(actual, expected, actualSubArray, actualSubArray.length, expectedSubArray, expectedSubArray.length, i), info.representation().toStringOf(actual), info.representation().toStringOf(expected));<NEW_LINE>}<NEW_LINE>for (int j = 0; j < actualSubArray.length; j++) {<NEW_LINE>if (actualSubArray[j] != expectedSubArray[j]) {<NEW_LINE>throw failures.failure(info, elementShouldBeEqual(actualSubArray[j], expectedSubArray[j], i, j), info.representation().toStringOf(actual), info.representation().toStringOf(expected));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return myself;<NEW_LINE>} | .length, expected.length)); |
1,323,239 | public static void normalize() {<NEW_LINE>if (getDebugLookahead() && !getDebugParser()) {<NEW_LINE>if (cmdLineSetting.contains(USEROPTION__DEBUG_PARSER) || inputFileSetting.contains(USEROPTION__DEBUG_PARSER)) {<NEW_LINE>JavaCCErrors.warning("True setting of option DEBUG_LOOKAHEAD overrides " + "false setting of option DEBUG_PARSER.");<NEW_LINE>}<NEW_LINE>optionValues.<MASK><NEW_LINE>}<NEW_LINE>// Now set the "GENERATE" options from the supplied (or default) JDK<NEW_LINE>// version.<NEW_LINE>optionValues.put(USEROPTION__GENERATE_CHAINED_EXCEPTION, Boolean.valueOf(jdkVersionAtLeast(1.4)));<NEW_LINE>optionValues.put(USEROPTION__GENERATE_GENERICS, Boolean.valueOf(jdkVersionAtLeast(1.5)));<NEW_LINE>optionValues.put(USEROPTION__GENERATE_STRING_BUILDER, Boolean.valueOf(jdkVersionAtLeast(1.5)));<NEW_LINE>optionValues.put(USEROPTION__GENERATE_ANNOTATIONS, Boolean.valueOf(jdkVersionAtLeast(1.5)));<NEW_LINE>} | put(USEROPTION__DEBUG_PARSER, Boolean.TRUE); |
1,581,768 | public Description matchMethod(MethodTree tree, VisitorState state) {<NEW_LINE>Type stringType = state.getSymtab().stringType;<NEW_LINE>boolean isFormatMethod = ASTHelpers.hasAnnotation(ASTHelpers.getSymbol(tree), FormatMethod.class, state);<NEW_LINE>boolean foundFormatString = false;<NEW_LINE>boolean foundString = false;<NEW_LINE>for (VariableTree param : tree.getParameters()) {<NEW_LINE>VarSymbol paramSymbol = ASTHelpers.getSymbol(param);<NEW_LINE>boolean isStringParam = ASTHelpers.isSameType(<MASK><NEW_LINE>if (isStringParam) {<NEW_LINE>foundString = true;<NEW_LINE>}<NEW_LINE>if (ASTHelpers.hasAnnotation(paramSymbol, FormatString.class, state)) {<NEW_LINE>if (!isFormatMethod) {<NEW_LINE>return buildDescription(tree).setMessage("A parameter can only be annotated @FormatString in a method annotated " + "@FormatMethod: " + state.getSourceForNode(param)).build();<NEW_LINE>}<NEW_LINE>if (!isStringParam) {<NEW_LINE>return buildDescription(param).setMessage("Only strings can be annotated @FormatString.").build();<NEW_LINE>}<NEW_LINE>if (foundFormatString) {<NEW_LINE>return buildDescription(tree).setMessage("A method cannot have more than one @FormatString parameter.").build();<NEW_LINE>}<NEW_LINE>foundFormatString = true;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (isFormatMethod && !foundString) {<NEW_LINE>return buildDescription(tree).setMessage("An @FormatMethod must contain at least one String parameter.").build();<NEW_LINE>}<NEW_LINE>return Description.NO_MATCH;<NEW_LINE>} | paramSymbol.type, stringType, state); |
1,412,001 | // Suppress high Cognitive Complexity warning<NEW_LINE>@SuppressWarnings("squid:S3776")<NEW_LINE>private SingleQuery constructSelectPlan(FilterOperator filterOperator, List<String> columnNames) throws QueryOperatorException {<NEW_LINE>FilterOperator timeFilter = null;<NEW_LINE>FilterOperator valueFilter = null;<NEW_LINE>List<FilterOperator> columnFilterOperators = new ArrayList<>();<NEW_LINE>List<FilterOperator> singleFilterList = null;<NEW_LINE>if (filterOperator.isSingle()) {<NEW_LINE>singleFilterList = new ArrayList<>();<NEW_LINE>singleFilterList.add(filterOperator);<NEW_LINE>} else if (filterOperator.getTokenIntType() == SQLConstant.KW_AND) {<NEW_LINE>// original query plan has been dealt with merge optimizer, thus all nodes with same<NEW_LINE>// path have been merged to one node<NEW_LINE>singleFilterList = filterOperator.getChildren();<NEW_LINE>}<NEW_LINE>if (singleFilterList == null) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>List<FilterOperator> valueList = new ArrayList<>();<NEW_LINE>for (FilterOperator child : singleFilterList) {<NEW_LINE>if (!child.isSingle()) {<NEW_LINE>valueList.add(child);<NEW_LINE>} else {<NEW_LINE>String singlePath = child.getSinglePath();<NEW_LINE>if (columnNames.contains(singlePath)) {<NEW_LINE>if (!columnFilterOperators.contains(child)) {<NEW_LINE>columnFilterOperators.add(child);<NEW_LINE>} else {<NEW_LINE>throw new QueryOperatorException("The same key filter has been specified more than once: " + singlePath);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>switch(child.getSinglePath()) {<NEW_LINE>case SQLConstant.RESERVED_TIME:<NEW_LINE>if (timeFilter != null) {<NEW_LINE>throw new QueryOperatorException("time filter has been specified more than once");<NEW_LINE>}<NEW_LINE>timeFilter = child;<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>valueList.add(child);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (valueList.size() == 1) {<NEW_LINE><MASK><NEW_LINE>} else if (valueList.size() > 1) {<NEW_LINE>valueFilter = new FilterOperator(SQLConstant.KW_AND, false);<NEW_LINE>valueFilter.childOperators = valueList;<NEW_LINE>}<NEW_LINE>return new SingleQuery(columnFilterOperators, timeFilter, valueFilter);<NEW_LINE>} | valueFilter = valueList.get(0); |
1,444,352 | public final void compute() {<NEW_LINE>final BiFunction<? super V, ? super V, ? extends V> reducer;<NEW_LINE>if ((reducer = this.reducer) != null) {<NEW_LINE>for (int i = baseIndex, f, h; batch > 0 && (h = ((f = baseLimit) + i) >>> 1) > i; ) {<NEW_LINE>addToPendingCount(1);<NEW_LINE>(rights = new ReduceValuesTask<K, V>(this, batch >>>= 1, baseLimit = h, f, tab, rights, reducer)).fork();<NEW_LINE>}<NEW_LINE>V r = null;<NEW_LINE>for (Node<K, V> p; (p = advance()) != null; ) {<NEW_LINE>V v = p.val;<NEW_LINE>r = (r == null) ? v : reducer.apply(r, v);<NEW_LINE>}<NEW_LINE>result = r;<NEW_LINE>CountedCompleter<?> c;<NEW_LINE>for (c = firstComplete(); c != null; c = c.nextComplete()) {<NEW_LINE>ReduceValuesTask<K, V> t = (ReduceValuesTask<K, V>) c, s = t.rights;<NEW_LINE>while (s != null) {<NEW_LINE>V tr, sr;<NEW_LINE>if ((sr = s.result) != null)<NEW_LINE>t.result = (((tr = t.result) == null) ? sr : reducer<MASK><NEW_LINE>s = t.rights = s.nextRight;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | .apply(tr, sr)); |
824,529 | protected JFreeChart createScatterChart() throws JRException {<NEW_LINE>ChartFactory.setChartTheme(StandardChartTheme.createLegacyTheme());<NEW_LINE>JFreeChart jfreeChart = ChartFactory.createScatterPlot(evaluateTextExpression(getChart().getTitleExpression()), evaluateTextExpression(((JRScatterPlot) getPlot()).getXAxisLabelExpression()), evaluateTextExpression(((JRScatterPlot) getPlot()).getYAxisLabelExpression()), (XYDataset) getDataset(), getPlot().getOrientationValue().getOrientation(), isShowLegend(), true, false);<NEW_LINE>configureChart(jfreeChart, getPlot());<NEW_LINE>XYLineAndShapeRenderer plotRenderer = (XYLineAndShapeRenderer) ((XYPlot) jfreeChart.getPlot()).getRenderer();<NEW_LINE>JRScatterPlot scatterPlot = (JRScatterPlot) getPlot();<NEW_LINE>boolean isShowLines = scatterPlot.getShowLines() == null ? true : scatterPlot.getShowLines();<NEW_LINE>boolean isShowShapes = scatterPlot.getShowShapes() == null ? true : scatterPlot.getShowShapes();<NEW_LINE>plotRenderer.setBaseLinesVisible(isShowLines);<NEW_LINE>plotRenderer.setBaseShapesVisible(isShowShapes);<NEW_LINE>// Handle the axis formating for the category axis<NEW_LINE>configureAxis(jfreeChart.getXYPlot().getDomainAxis(), scatterPlot.getXAxisLabelFont(), scatterPlot.getXAxisLabelColor(), scatterPlot.getXAxisTickLabelFont(), scatterPlot.getXAxisTickLabelColor(), scatterPlot.getXAxisTickLabelMask(), scatterPlot.getXAxisVerticalTickLabels(), scatterPlot.getOwnXAxisLineColor(), false, (Comparable<?>) evaluateExpression(scatterPlot.getDomainAxisMinValueExpression()), (Comparable<?>) evaluateExpression(scatterPlot.getDomainAxisMaxValueExpression()));<NEW_LINE>// Handle the axis formating for the value axis<NEW_LINE>configureAxis(jfreeChart.getXYPlot().getRangeAxis(), scatterPlot.getYAxisLabelFont(), scatterPlot.getYAxisLabelColor(), scatterPlot.getYAxisTickLabelFont(), scatterPlot.getYAxisTickLabelColor(), scatterPlot.getYAxisTickLabelMask(), scatterPlot.getYAxisVerticalTickLabels(), scatterPlot.getOwnYAxisLineColor(), true, (Comparable<?>) evaluateExpression(scatterPlot.getRangeAxisMinValueExpression()), (Comparable<?>) evaluateExpression<MASK><NEW_LINE>return jfreeChart;<NEW_LINE>} | (scatterPlot.getRangeAxisMaxValueExpression())); |
39,022 | public CreateSecurityProfileResult unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>CreateSecurityProfileResult createSecurityProfileResult = new CreateSecurityProfileResult();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE><MASK><NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return createSecurityProfileResult;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>if (context.testExpression("securityProfileName", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>createSecurityProfileResult.setSecurityProfileName(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("securityProfileArn", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>createSecurityProfileResult.setSecurityProfileArn(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return createSecurityProfileResult;<NEW_LINE>} | JsonToken token = context.getCurrentToken(); |
79,198 | private void triggerScaleUp(String streamSegmentName, int numOfSplits) {<NEW_LINE>Pair<Long, Long> pair = cache.get(streamSegmentName);<NEW_LINE>long lastRequestTs = 0;<NEW_LINE>if (pair != null && pair.getKey() != null) {<NEW_LINE>lastRequestTs = pair.getKey();<NEW_LINE>}<NEW_LINE>long timestamp = getTimeMillis();<NEW_LINE>long requestId = requestIdGenerator.get();<NEW_LINE>if (timestamp - lastRequestTs > configuration.getMuteDuration().toMillis()) {<NEW_LINE>log.info(requestId, "sending request for scale up for {}", streamSegmentName);<NEW_LINE>Segment <MASK><NEW_LINE>AutoScaleEvent event = new AutoScaleEvent(segment.getScope(), segment.getStreamName(), segment.getSegmentId(), AutoScaleEvent.UP, timestamp, numOfSplits, false, requestId);<NEW_LINE>// Mute scale for timestamp for both scale up and down<NEW_LINE>writeRequest(event, () -> cache.put(streamSegmentName, new ImmutablePair<>(timestamp, timestamp)));<NEW_LINE>}<NEW_LINE>} | segment = Segment.fromScopedName(streamSegmentName); |
713,544 | private void sampleOldestActions(AnsiTerminalWriter terminalWriter) throws IOException {<NEW_LINE>// This method can only be called if 'activeActions.size()' was observed to be larger than 1 at<NEW_LINE>// some point in the past. But the 'activeActions' map can grow and shrink concurrent with this<NEW_LINE>// code here so we need to be very careful lest we fall victim to a check-then-act race.<NEW_LINE>int racyActiveActionsCount = activeActions.size();<NEW_LINE>PriorityQueue<Map.Entry<Artifact, ActionState>> priorityHeap = new // The 'initialCapacity' parameter must be positive.<NEW_LINE>PriorityQueue<>(/*initialCapacity=*/<NEW_LINE>Math.max(racyActiveActionsCount, 1), Comparator.comparing((Map.Entry<Artifact, ActionState> entry) -> entry.getValue().runningStrategiesBitmap == 0).thenComparingLong(entry -> entry.getValue().nanoStartTime).thenComparingInt(entry -> entry.getValue().hashCode()));<NEW_LINE>priorityHeap.<MASK><NEW_LINE>// From this point on, we no longer consume 'activeActions'. So now it's sound to look at how<NEW_LINE>// many entries were added to 'priorityHeap' and act appropriately based on that count.<NEW_LINE>int actualObservedActiveActionsCount = priorityHeap.size();<NEW_LINE>int count = 0;<NEW_LINE>int totalCount = 0;<NEW_LINE>long nanoTime = clock.nanoTime();<NEW_LINE>Set<Artifact> toSkip = new HashSet<>();<NEW_LINE>while (!priorityHeap.isEmpty()) {<NEW_LINE>Map.Entry<Artifact, ActionState> entry = priorityHeap.poll();<NEW_LINE>totalCount++;<NEW_LINE>if (toSkip.contains(entry.getKey())) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>count++;<NEW_LINE>if (count > sampleSize) {<NEW_LINE>totalCount--;<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>int width = targetWidth - 4 - ((count >= sampleSize && count < actualObservedActiveActionsCount) ? AND_MORE.length() : 0);<NEW_LINE>terminalWriter.newline().append(" " + describeAction(entry.getValue(), nanoTime, width, toSkip));<NEW_LINE>}<NEW_LINE>if (totalCount < actualObservedActiveActionsCount) {<NEW_LINE>terminalWriter.append(AND_MORE);<NEW_LINE>}<NEW_LINE>} | addAll(activeActions.entrySet()); |
1,687,487 | public SigningConfigurationOverrides unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>SigningConfigurationOverrides signingConfigurationOverrides = new SigningConfigurationOverrides();<NEW_LINE><MASK><NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>if (context.testExpression("encryptionAlgorithm", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>signingConfigurationOverrides.setEncryptionAlgorithm(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("hashAlgorithm", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>signingConfigurationOverrides.setHashAlgorithm(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return signingConfigurationOverrides;<NEW_LINE>} | int originalDepth = context.getCurrentDepth(); |
386,069 | public UpdateAssociationStatusResult unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>UpdateAssociationStatusResult updateAssociationStatusResult = new UpdateAssociationStatusResult();<NEW_LINE><MASK><NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return updateAssociationStatusResult;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>if (context.testExpression("AssociationDescription", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>updateAssociationStatusResult.setAssociationDescription(AssociationDescriptionJsonUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>}<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return updateAssociationStatusResult;<NEW_LINE>} | int originalDepth = context.getCurrentDepth(); |
1,460,786 | public ImageData create(int height, HSB backgroundColor, boolean embossed, boolean rotated) {<NEW_LINE>ImageData source = null;<NEW_LINE>if (embossed) {<NEW_LINE>if (rotated) {<NEW_LINE>source = CoreImages.getImageDescriptor(CoreImages.HANDLE_EMBOSSED_ROTATED).getImageData();<NEW_LINE>} else {<NEW_LINE>source = CoreImages.getImageDescriptor(CoreImages.HANDLE_EMBOSSED).getImageData();<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>if (rotated) {<NEW_LINE>source = CoreImages.getImageDescriptor(CoreImages.HANDLE_ROTATED).getImageData();<NEW_LINE>} else {<NEW_LINE>source = CoreImages.getImageDescriptor(<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>ImageData result = new ImageData(source.width, height, source.depth, source.palette);<NEW_LINE>int offset = (result.height - source.height) / 2;<NEW_LINE>for (int x = 0; x < result.width; x++) {<NEW_LINE>for (int y = 0; y < result.height; y++) {<NEW_LINE>if (y >= offset && y < offset + source.height) {<NEW_LINE>result.setPixel(x, y, source.getPixel(x, y - offset));<NEW_LINE>} else {<NEW_LINE>result.setPixel(x, y, source.transparentPixel);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>result.transparentPixel = source.transparentPixel;<NEW_LINE>List<RGB> newRGBs = new ArrayList<RGB>();<NEW_LINE>for (RGB each : result.palette.colors) {<NEW_LINE>try {<NEW_LINE>HSB hsb = backgroundColor.getCopy();<NEW_LINE>hsb.brightness = new HSB(each).brightness;<NEW_LINE>hsb = hsb.mixWith(backgroundColor, 0.7f);<NEW_LINE>newRGBs.add(hsb.toRGB());<NEW_LINE>} catch (Exception e) {<NEW_LINE>e.printStackTrace();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>result.palette.colors = newRGBs.toArray(new RGB[newRGBs.size()]);<NEW_LINE>return result;<NEW_LINE>} | CoreImages.HANDLE).getImageData(); |
1,196,215 | protected void convert(@NotNull BaseViewHolder helper, @Nullable Status item) {<NEW_LINE>switch(helper.getLayoutPosition() % 3) {<NEW_LINE>case 0:<NEW_LINE>helper.setImageResource(R.id.img, R.mipmap.animation_img1);<NEW_LINE>break;<NEW_LINE>case 1:<NEW_LINE>helper.setImageResource(R.id.img, R.mipmap.animation_img2);<NEW_LINE>break;<NEW_LINE>case 2:<NEW_LINE>helper.setImageResource(R.id.img, R.mipmap.animation_img3);<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>helper.setText(R.id.tweetName, "Hoteis in Rio de Janeiro");<NEW_LINE>String msg = "\"He was one of Australia's most of distinguished artistes, renowned for his portraits\"";<NEW_LINE>((TextView) helper.getView(R.id.tweetText)).setText(SpannableStringUtils.getBuilder(msg).append("landscapes and nedes").setClickSpan<MASK><NEW_LINE>((TextView) helper.getView(R.id.tweetText)).setMovementMethod(LinkMovementMethod.getInstance());<NEW_LINE>} | (clickableSpan).create()); |
387,498 | private String createHTML(PAGE_TYPE requestPage) {<NEW_LINE>String result = "<html><head>";<NEW_LINE>// READ CSS<NEW_LINE>URL url = getClass().getClassLoader().getResource("org/compiere/images/PAPanel.css");<NEW_LINE>InputStreamReader ins;<NEW_LINE>try {<NEW_LINE>ins = new InputStreamReader(url.openStream());<NEW_LINE>BufferedReader bufferedReader = new BufferedReader(ins);<NEW_LINE>String cssLine;<NEW_LINE>result += "<style type=\"text/css\">";<NEW_LINE>while ((cssLine = bufferedReader.readLine()) != null) result += cssLine + "\n";<NEW_LINE>result += "</style>";<NEW_LINE>} catch (IOException e1) {<NEW_LINE>log.log(Level.SEVERE, e1.getLocalizedMessage(), e1);<NEW_LINE>}<NEW_LINE>// System.out.println(result);<NEW_LINE>switch(requestPage) {<NEW_LINE>case PAGE_LOGO:<NEW_LINE>result += // + "<img src=\"res:at/freecom/apps/images/logo_fc.png\">"<NEW_LINE>"</head><body class=\"header\">" + "<table width=\"100%\"><tr><td>" <MASK><NEW_LINE>break;<NEW_LINE>case // **************************************************************<NEW_LINE>PAGE_HOME:<NEW_LINE>// "<link rel=\"stylesheet\" type=\"text/css\" href=\"file:///c:/standard.css\"/>"<NEW_LINE>result += "</head><body><div class=\"content\">\n";<NEW_LINE>queryZoom = null;<NEW_LINE>queryZoom = new ArrayList<MQuery>();<NEW_LINE>String appendToHome = null;<NEW_LINE>try {<NEW_LINE>for (final MDashboardContent dp : MDashboardContent.getForSession()) {<NEW_LINE>if (!Util.isEmpty(dp.getZulFilePath(), true))<NEW_LINE>continue;<NEW_LINE>//<NEW_LINE>appendToHome = dp.getHTML();<NEW_LINE>if (appendToHome != null) {<NEW_LINE>if (dp.getDescription() != null)<NEW_LINE>result += "<H2>" + dp.getDescription() + "</H2>\n";<NEW_LINE>result += stripHtml(appendToHome, false) + "<br>\n";<NEW_LINE>}<NEW_LINE>if (dp.getAD_Menu_ID() > 0) {<NEW_LINE>result += "<a class=\"hrefNode\" href=\"http:///window/node#" + // "AD_MENU_ID") fcsku 3.7.07<NEW_LINE>String.// "AD_MENU_ID") fcsku 3.7.07<NEW_LINE>valueOf(dp.getAD_Window_ID() + "\">" + dp.getDescription() + "</a><br>\n");<NEW_LINE>}<NEW_LINE>result += "<br>\n";<NEW_LINE>// result += "table id: " + rs.getInt("AD_TABLE_ID");<NEW_LINE>if (dp.getPA_Goal_ID() > 0)<NEW_LINE>result += goalsDetail(dp.getPA_Goal_ID());<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>log.log(Level.SEVERE, e.getLocalizedMessage(), e);<NEW_LINE>} finally {<NEW_LINE>}<NEW_LINE>result += "<br><br><br>\n" + "</div>\n</body>\n</html>\n";<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>// **************************************************************<NEW_LINE>log.warning("Unknown option - " + requestPage);<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>} | + "<img src=\"res:org/compiere/images/logo_ad.png\">" + "</td><td></td><td width=\"290\">" + "</td></tr></table>" + "</body></html>"; |
1,163,906 | public void run(RegressionEnvironment env) {<NEW_LINE>RegressionPath path = new RegressionPath();<NEW_LINE>env.compileDeploy("@public create window AWindow#keepall as A", path);<NEW_LINE>env.compileDeploy("insert into AWindow select * from A", path);<NEW_LINE>// preload<NEW_LINE>for (int i = 0; i < 10000; i++) {<NEW_LINE>env.sendEventBean(SupportTimeStartEndA.make("A" + i, "2002-05-30T09:00:00.000", 100), "A");<NEW_LINE>}<NEW_LINE>env.sendEventBean(SupportTimeStartEndA.make("AEarlier", "2002-05-30T08:00:00.000", 100), "A");<NEW_LINE>env.sendEventBean(SupportTimeStartEndA.make("ALater", "2002-05-30T10:00:00.000", 100), "A");<NEW_LINE>String epl = "@name('s0') select a.key as c0 from SupportDateTime unidirectional, AWindow as a where longdate.between(longdateStart, longdateEnd, false, true)";<NEW_LINE>env.compileDeploy(epl, path).addListener("s0");<NEW_LINE>// query<NEW_LINE>long startTime = System.currentTimeMillis();<NEW_LINE>for (int i = 0; i < 1000; i++) {<NEW_LINE>env.sendEventBean(SupportDateTime.make("2002-05-30T08:00:00.050"));<NEW_LINE>env.assertEqualsNew("s0", "c0", "AEarlier");<NEW_LINE>}<NEW_LINE>long endTime = System.currentTimeMillis();<NEW_LINE>long delta = endTime - startTime;<NEW_LINE>assertTrue("Delta=" + delta / 1000d, delta < 500);<NEW_LINE>env.sendEventBean(SupportDateTime.make("2002-05-30T10:00:00.050"));<NEW_LINE>env.<MASK><NEW_LINE>env.undeployAll();<NEW_LINE>} | assertEqualsNew("s0", "c0", "ALater"); |
1,766,049 | public void mouseMoved(MouseEvent evt) {<NEW_LINE>if (LOG.isLoggable(Level.FINE)) {<NEW_LINE>// NOI18N<NEW_LINE>LOG.log(Level.FINE, "mouseMoved: x=" + evt.getX() + "; y=" + evt.getY() + "enabled=" + enabled + ", status=" + status + ", flags=" + flags);<NEW_LINE>}<NEW_LINE>if (toolTip != null) {<NEW_LINE>Rectangle ignoredArea = (Rectangle) toolTip.getClientProperty(MOUSE_MOVE_IGNORED_AREA);<NEW_LINE>Point mousePosition = SwingUtilities.convertPoint(evt.getComponent(), evt.getPoint(), toolTip.getParent());<NEW_LINE>if (LOG.isLoggable(Level.FINE)) {<NEW_LINE>// NOI18N<NEW_LINE>LOG.// NOI18N<NEW_LINE>log(// NOI18N<NEW_LINE>Level.FINE, // NOI18N<NEW_LINE>"Mouse-Move-Ignored-Area=" + ignoredArea + "; mouse=" + mousePosition + "; is-inside=" + (ignoredArea != null ? ignoredArea.<MASK><NEW_LINE>}<NEW_LINE>if (ignoredArea != null && ignoredArea.contains(mousePosition)) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (!isToolTipShowing() || (flags & FLAG_HIDE_ON_MOUSE_MOVE) != 0) {<NEW_LINE>setToolTipVisible(false);<NEW_LINE>}<NEW_LINE>if (enabled) {<NEW_LINE>enterTimer.restart();<NEW_LINE>}<NEW_LINE>lastMouseEvent = evt;<NEW_LINE>} | contains(mousePosition) : null)); |
299,036 | public static GetOwnerApplyOrderDetailResponse unmarshall(GetOwnerApplyOrderDetailResponse getOwnerApplyOrderDetailResponse, UnmarshallerContext _ctx) {<NEW_LINE>getOwnerApplyOrderDetailResponse.setRequestId(_ctx.stringValue("GetOwnerApplyOrderDetailResponse.RequestId"));<NEW_LINE>getOwnerApplyOrderDetailResponse.setSuccess(_ctx.booleanValue("GetOwnerApplyOrderDetailResponse.Success"));<NEW_LINE>getOwnerApplyOrderDetailResponse.setErrorMessage(_ctx.stringValue("GetOwnerApplyOrderDetailResponse.ErrorMessage"));<NEW_LINE>getOwnerApplyOrderDetailResponse.setErrorCode(_ctx.stringValue("GetOwnerApplyOrderDetailResponse.ErrorCode"));<NEW_LINE>OwnerApplyOrderDetail ownerApplyOrderDetail = new OwnerApplyOrderDetail();<NEW_LINE>ownerApplyOrderDetail.setApplyType(_ctx.stringValue("GetOwnerApplyOrderDetailResponse.OwnerApplyOrderDetail.ApplyType"));<NEW_LINE>List<Resource> resources <MASK><NEW_LINE>for (int i = 0; i < _ctx.lengthValue("GetOwnerApplyOrderDetailResponse.OwnerApplyOrderDetail.Resources.Length"); i++) {<NEW_LINE>Resource resource = new Resource();<NEW_LINE>resource.setLogic(_ctx.booleanValue("GetOwnerApplyOrderDetailResponse.OwnerApplyOrderDetail.Resources[" + i + "].Logic"));<NEW_LINE>resource.setTargetId(_ctx.stringValue("GetOwnerApplyOrderDetailResponse.OwnerApplyOrderDetail.Resources[" + i + "].TargetId"));<NEW_LINE>ResourceDetail resourceDetail = new ResourceDetail();<NEW_LINE>resourceDetail.setSearchName(_ctx.stringValue("GetOwnerApplyOrderDetailResponse.OwnerApplyOrderDetail.Resources[" + i + "].ResourceDetail.SearchName"));<NEW_LINE>resourceDetail.setDbType(_ctx.stringValue("GetOwnerApplyOrderDetailResponse.OwnerApplyOrderDetail.Resources[" + i + "].ResourceDetail.DbType"));<NEW_LINE>resourceDetail.setEnvType(_ctx.stringValue("GetOwnerApplyOrderDetailResponse.OwnerApplyOrderDetail.Resources[" + i + "].ResourceDetail.EnvType"));<NEW_LINE>resourceDetail.setTableName(_ctx.stringValue("GetOwnerApplyOrderDetailResponse.OwnerApplyOrderDetail.Resources[" + i + "].ResourceDetail.TableName"));<NEW_LINE>List<Long> ownerIds = new ArrayList<Long>();<NEW_LINE>for (int j = 0; j < _ctx.lengthValue("GetOwnerApplyOrderDetailResponse.OwnerApplyOrderDetail.Resources[" + i + "].ResourceDetail.OwnerIds.Length"); j++) {<NEW_LINE>ownerIds.add(_ctx.longValue("GetOwnerApplyOrderDetailResponse.OwnerApplyOrderDetail.Resources[" + i + "].ResourceDetail.OwnerIds[" + j + "]"));<NEW_LINE>}<NEW_LINE>resourceDetail.setOwnerIds(ownerIds);<NEW_LINE>List<String> ownerNickNames = new ArrayList<String>();<NEW_LINE>for (int j = 0; j < _ctx.lengthValue("GetOwnerApplyOrderDetailResponse.OwnerApplyOrderDetail.Resources[" + i + "].ResourceDetail.OwnerNickNames.Length"); j++) {<NEW_LINE>ownerNickNames.add(_ctx.stringValue("GetOwnerApplyOrderDetailResponse.OwnerApplyOrderDetail.Resources[" + i + "].ResourceDetail.OwnerNickNames[" + j + "]"));<NEW_LINE>}<NEW_LINE>resourceDetail.setOwnerNickNames(ownerNickNames);<NEW_LINE>resource.setResourceDetail(resourceDetail);<NEW_LINE>resources.add(resource);<NEW_LINE>}<NEW_LINE>ownerApplyOrderDetail.setResources(resources);<NEW_LINE>getOwnerApplyOrderDetailResponse.setOwnerApplyOrderDetail(ownerApplyOrderDetail);<NEW_LINE>return getOwnerApplyOrderDetailResponse;<NEW_LINE>} | = new ArrayList<Resource>(); |
399,164 | public Request<DeleteClusterRequest> marshall(DeleteClusterRequest deleteClusterRequest) {<NEW_LINE>if (deleteClusterRequest == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>Request<DeleteClusterRequest> request = new DefaultRequest<DeleteClusterRequest>(deleteClusterRequest, "AmazonRedshift");<NEW_LINE>request.addParameter("Action", "DeleteCluster");<NEW_LINE>request.addParameter("Version", "2012-12-01");<NEW_LINE>request.setHttpMethod(HttpMethodName.POST);<NEW_LINE>if (deleteClusterRequest.getClusterIdentifier() != null) {<NEW_LINE>request.addParameter("ClusterIdentifier", StringUtils.fromString(deleteClusterRequest.getClusterIdentifier()));<NEW_LINE>}<NEW_LINE>if (deleteClusterRequest.getSkipFinalClusterSnapshot() != null) {<NEW_LINE>request.addParameter("SkipFinalClusterSnapshot", StringUtils.fromBoolean(deleteClusterRequest.getSkipFinalClusterSnapshot()));<NEW_LINE>}<NEW_LINE>if (deleteClusterRequest.getFinalClusterSnapshotIdentifier() != null) {<NEW_LINE>request.addParameter("FinalClusterSnapshotIdentifier", StringUtils.fromString(deleteClusterRequest.getFinalClusterSnapshotIdentifier()));<NEW_LINE>}<NEW_LINE>if (deleteClusterRequest.getFinalClusterSnapshotRetentionPeriod() != null) {<NEW_LINE>request.addParameter("FinalClusterSnapshotRetentionPeriod", StringUtils.fromInteger<MASK><NEW_LINE>}<NEW_LINE>return request;<NEW_LINE>} | (deleteClusterRequest.getFinalClusterSnapshotRetentionPeriod())); |
457,082 | public MultipartFormEntity buildEntity() {<NEW_LINE>String boundaryCopy = boundary;<NEW_LINE>if (boundaryCopy == null && contentType != null) {<NEW_LINE>boundaryCopy = contentType.getParameter("boundary");<NEW_LINE>}<NEW_LINE>if (boundaryCopy == null) {<NEW_LINE>boundaryCopy = generateBoundary();<NEW_LINE>}<NEW_LINE>Charset charsetCopy = charset;<NEW_LINE>if (charsetCopy == null && contentType != null) {<NEW_LINE>charsetCopy = contentType.getCharset();<NEW_LINE>}<NEW_LINE>final List<NameValue> paramsList = new ArrayList<NameValue>(2);<NEW_LINE>paramsList.add(new NameValue("boundary", boundaryCopy));<NEW_LINE>if (charsetCopy != null) {<NEW_LINE>paramsList.add(new NameValue("charset", charsetCopy.name()));<NEW_LINE>}<NEW_LINE>final NameValue[] params = paramsList.toArray(new NameValue[paramsList.size()]);<NEW_LINE>final ContentType contentTypeCopy = contentType != null ? contentType.withParameters(params) : ContentType.create("multipart/" + DEFAULT_SUBTYPE, params);<NEW_LINE>final List<FormBodyPart> bodyPartsCopy = bodyParts != null ? new ArrayList<FormBodyPart>(bodyParts) : <MASK><NEW_LINE>final HttpMultipartMode modeCopy = mode != null ? mode : HttpMultipartMode.STRICT;<NEW_LINE>final AbstractMultipartForm form;<NEW_LINE>switch(modeCopy) {<NEW_LINE>case BROWSER_COMPATIBLE:<NEW_LINE>form = new HttpBrowserCompatibleMultipart(charsetCopy, boundaryCopy, bodyPartsCopy);<NEW_LINE>break;<NEW_LINE>case RFC6532:<NEW_LINE>form = new HttpRFC6532Multipart(charsetCopy, boundaryCopy, bodyPartsCopy);<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>form = new HttpStrictMultipart(charsetCopy, boundaryCopy, bodyPartsCopy);<NEW_LINE>}<NEW_LINE>return new MultipartFormEntity(form, contentTypeCopy, form.getTotalLength());<NEW_LINE>} | Collections.<FormBodyPart>emptyList(); |
349,371 | public void change(final Host bookmark) {<NEW_LINE>passwordField.cell().<MASK><NEW_LINE>passwordField.setEnabled(options.password && !bookmark.getCredentials().isAnonymousLogin());<NEW_LINE>if (options.keychain && options.password) {<NEW_LINE>if (StringUtils.isBlank(bookmark.getHostname())) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (StringUtils.isBlank(bookmark.getCredentials().getUsername())) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>final String password = keychain.getPassword(bookmark.getProtocol().getScheme(), bookmark.getPort(), bookmark.getHostname(), bookmark.getCredentials().getUsername());<NEW_LINE>if (StringUtils.isNotBlank(password)) {<NEW_LINE>updateField(passwordField, password);<NEW_LINE>// Make sure password fetched from keychain and set in field is set in model<NEW_LINE>bookmark.getCredentials().setPassword(password);<NEW_LINE>}<NEW_LINE>} catch (LocalAccessDeniedException e) {<NEW_LINE>// Ignore<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | setPlaceholderString(options.getPasswordPlaceholder()); |
47,181 | public String formatAsFieldItemList(String content, String fieldName, boolean forceAsField) {<NEW_LINE>if (forceAsField) {<NEW_LINE>return ITEM_TOKEN + content;<NEW_LINE>}<NEW_LINE>if (!isModelField(content, fieldName)) {<NEW_LINE>return content;<NEW_LINE>}<NEW_LINE>int startIndex = content.indexOf(DOLLAR_TOTKEN);<NEW_LINE>startIndex = startIndex + DOLLAR_TOTKEN.length();<NEW_LINE>int endIndex = content.indexOf('}');<NEW_LINE>if (endIndex == -1) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>String startContent = content.substring(0, startIndex);<NEW_LINE>String endContent = content.substring(endIndex, content.length());<NEW_LINE>String contentToFormat = content.substring(startIndex, endIndex);<NEW_LINE>String formattedContent = StringUtils.replaceAll(contentToFormat, <MASK><NEW_LINE>return startContent + formattedContent + endContent;<NEW_LINE>} | fieldName, getItemToken() + fieldName); |
1,143,592 | public void put(Object key, Object value) {<NEW_LINE>if (cacheSize <= memoryCache.size()) {<NEW_LINE>// we need to find the oldest entry<NEW_LINE>Enumeration e = memoryCache.keys();<NEW_LINE>long oldest = System.currentTimeMillis();<NEW_LINE>Object oldestKey = null;<NEW_LINE>Object[] oldestValue = null;<NEW_LINE>while (e.hasMoreElements()) {<NEW_LINE>Object currentKey = e.nextElement();<NEW_LINE>Object[] currentValue = (Object[]) memoryCache.get(currentKey);<NEW_LINE>long currentAge = ((Long) currentValue<MASK><NEW_LINE>if (currentAge <= oldest || oldestValue == null) {<NEW_LINE>oldest = currentAge;<NEW_LINE>oldestKey = currentKey;<NEW_LINE>oldestValue = currentValue;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>placeInStorageCache(oldestKey, oldest, oldestValue[1]);<NEW_LINE>weakCache.put(oldestKey, Display.getInstance().createSoftWeakRef(oldestValue[1]));<NEW_LINE>memoryCache.remove(oldestKey);<NEW_LINE>}<NEW_LINE>long lastAccess = System.currentTimeMillis();<NEW_LINE>memoryCache.put(key, new Object[] { new Long(lastAccess), value });<NEW_LINE>if (alwaysStore) {<NEW_LINE>placeInStorageCache(key, lastAccess, value);<NEW_LINE>}<NEW_LINE>} | [0]).longValue(); |
168,226 | protected void dropClassInternal(ODatabaseDocumentInternal database, final String className) {<NEW_LINE>acquireSchemaWriteLock(database);<NEW_LINE>try {<NEW_LINE>if (database.getTransaction().isActive())<NEW_LINE>throw new IllegalStateException("Cannot drop a class inside a transaction");<NEW_LINE>if (className == null)<NEW_LINE>throw new IllegalArgumentException("Class name is null");<NEW_LINE>database.checkSecurity(ORule.ResourceGeneric.SCHEMA, ORole.PERMISSION_DELETE);<NEW_LINE>final String key = className.toLowerCase(Locale.ENGLISH);<NEW_LINE>final OClass <MASK><NEW_LINE>if (cls == null)<NEW_LINE>throw new OSchemaException("Class '" + className + "' was not found in current database");<NEW_LINE>if (!cls.getSubclasses().isEmpty())<NEW_LINE>throw new OSchemaException("Class '" + className + "' cannot be dropped because it has sub classes " + cls.getSubclasses() + ". Remove the dependencies before trying to drop it again");<NEW_LINE>checkEmbedded();<NEW_LINE>for (OClass superClass : cls.getSuperClasses()) {<NEW_LINE>// REMOVE DEPENDENCY FROM SUPERCLASS<NEW_LINE>((OClassImpl) superClass).removeBaseClassInternal(cls);<NEW_LINE>}<NEW_LINE>for (int id : cls.getClusterIds()) {<NEW_LINE>if (id != -1)<NEW_LINE>deleteCluster(database, id);<NEW_LINE>}<NEW_LINE>dropClassIndexes(database, cls);<NEW_LINE>classes.remove(key);<NEW_LINE>if (cls.getShortName() != null)<NEW_LINE>// REMOVE THE ALIAS TOO<NEW_LINE>classes.remove(cls.getShortName().toLowerCase(Locale.ENGLISH));<NEW_LINE>removeClusterClassMap(cls);<NEW_LINE>// WAKE UP DB LIFECYCLE LISTENER<NEW_LINE>for (Iterator<ODatabaseLifecycleListener> it = Orient.instance().getDbLifecycleListeners(); it.hasNext(); ) it.next().onDropClass(database, cls);<NEW_LINE>for (Iterator<ODatabaseListener> it = database.getListeners().iterator(); it.hasNext(); ) it.next().onDropClass(database, cls);<NEW_LINE>} finally {<NEW_LINE>releaseSchemaWriteLock(database);<NEW_LINE>}<NEW_LINE>} | cls = classes.get(key); |
449,262 | public static void main(String[] args) {<NEW_LINE>Exercise28_StackWithAQueue<Integer> exercise28_stackWithAQueue = new Exercise28_StackWithAQueue<>();<NEW_LINE>StdOut.println("IsEmpty: " + exercise28_stackWithAQueue.isEmpty() + " Expected: true");<NEW_LINE>exercise28_stackWithAQueue.push(1);<NEW_LINE>exercise28_stackWithAQueue.push(2);<NEW_LINE>exercise28_stackWithAQueue.push(3);<NEW_LINE>StdOut.println(exercise28_stackWithAQueue.pop());<NEW_LINE>StdOut.println(exercise28_stackWithAQueue.pop());<NEW_LINE>exercise28_stackWithAQueue.push(4);<NEW_LINE>exercise28_stackWithAQueue.push(5);<NEW_LINE>StdOut.println("Size: " + exercise28_stackWithAQueue.size() + " Expected: 3");<NEW_LINE>StdOut.println("IsEmpty: " + exercise28_stackWithAQueue.isEmpty() + " Expected: false");<NEW_LINE>StdOut.<MASK><NEW_LINE>StdOut.println(exercise28_stackWithAQueue.pop());<NEW_LINE>StdOut.println("Expected output from pop(): 3 2 5 4");<NEW_LINE>} | println(exercise28_stackWithAQueue.pop()); |
287,449 | public static ListDevicesResponse unmarshall(ListDevicesResponse listDevicesResponse, UnmarshallerContext _ctx) {<NEW_LINE>listDevicesResponse.setRequestId(_ctx.stringValue("ListDevicesResponse.RequestId"));<NEW_LINE>listDevicesResponse.setMessage(_ctx.stringValue("ListDevicesResponse.Message"));<NEW_LINE>listDevicesResponse.setCode(_ctx.stringValue("ListDevicesResponse.Code"));<NEW_LINE>Data data = new Data();<NEW_LINE>data.setTotalPage(_ctx.integerValue("ListDevicesResponse.Data.TotalPage"));<NEW_LINE>data.setPageNumber(_ctx.integerValue("ListDevicesResponse.Data.PageNumber"));<NEW_LINE>data.setPageSize(_ctx.integerValue("ListDevicesResponse.Data.PageSize"));<NEW_LINE>data.setTotalCount(_ctx.integerValue("ListDevicesResponse.Data.TotalCount"));<NEW_LINE>List<Record> records = new ArrayList<Record>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("ListDevicesResponse.Data.Records.Length"); i++) {<NEW_LINE>Record record = new Record();<NEW_LINE>record.setStatus(_ctx.integerValue("ListDevicesResponse.Data.Records[" + i + "].Status"));<NEW_LINE>record.setSipGBId(_ctx.stringValue("ListDevicesResponse.Data.Records[" + i + "].SipGBId"));<NEW_LINE>record.setDeviceDirection(_ctx.stringValue("ListDevicesResponse.Data.Records[" + i + "].DeviceDirection"));<NEW_LINE>record.setDeviceName(_ctx.stringValue("ListDevicesResponse.Data.Records[" + i + "].DeviceName"));<NEW_LINE>record.setDeviceAddress(_ctx.stringValue("ListDevicesResponse.Data.Records[" + i + "].DeviceAddress"));<NEW_LINE>record.setDeviceType(_ctx.stringValue("ListDevicesResponse.Data.Records[" + i + "].DeviceType"));<NEW_LINE>record.setCreateTime(_ctx.stringValue("ListDevicesResponse.Data.Records[" + i + "].CreateTime"));<NEW_LINE>record.setSipPassword(_ctx.stringValue("ListDevicesResponse.Data.Records[" + i + "].SipPassword"));<NEW_LINE>record.setSipServerPort(_ctx.stringValue("ListDevicesResponse.Data.Records[" + i + "].SipServerPort"));<NEW_LINE>record.setVendor(_ctx.stringValue("ListDevicesResponse.Data.Records[" + i + "].Vendor"));<NEW_LINE>record.setGbId(_ctx.stringValue("ListDevicesResponse.Data.Records[" + i + "].GbId"));<NEW_LINE>record.setCoverImageUrl(_ctx.stringValue("ListDevicesResponse.Data.Records[" + i + "].CoverImageUrl"));<NEW_LINE>record.setAccessProtocolType(_ctx.stringValue("ListDevicesResponse.Data.Records[" + i + "].AccessProtocolType"));<NEW_LINE>record.setDeviceSite(_ctx.stringValue<MASK><NEW_LINE>record.setLongitude(_ctx.stringValue("ListDevicesResponse.Data.Records[" + i + "].Longitude"));<NEW_LINE>record.setLatitude(_ctx.stringValue("ListDevicesResponse.Data.Records[" + i + "].Latitude"));<NEW_LINE>record.setResolution(_ctx.stringValue("ListDevicesResponse.Data.Records[" + i + "].Resolution"));<NEW_LINE>record.setSipServerIp(_ctx.stringValue("ListDevicesResponse.Data.Records[" + i + "].SipServerIp"));<NEW_LINE>record.setBitRate(_ctx.stringValue("ListDevicesResponse.Data.Records[" + i + "].BitRate"));<NEW_LINE>records.add(record);<NEW_LINE>}<NEW_LINE>data.setRecords(records);<NEW_LINE>listDevicesResponse.setData(data);<NEW_LINE>return listDevicesResponse;<NEW_LINE>} | ("ListDevicesResponse.Data.Records[" + i + "].DeviceSite")); |
754,470 | public double squaredDistance(NumberVector n, ClusterFeature ocf) {<NEW_LINE>if (!(ocf instanceof BIRCHCF)) {<NEW_LINE>throw new IllegalStateException("This distance only supports BIRCH clustering features.");<NEW_LINE>}<NEW_LINE>BIRCHCF cf = (BIRCHCF) ocf;<NEW_LINE>if (cf.getWeight() <= 0) {<NEW_LINE>return 0.;<NEW_LINE>}<NEW_LINE>final int dim = cf.getDimensionality();<NEW_LINE>final double div = 1. / (cf.getWeight() + 1);<NEW_LINE>// Sum_d sum_i squares<NEW_LINE><MASK><NEW_LINE>for (int d = 0; d < dim; d++) {<NEW_LINE>double v = n.doubleValue(d);<NEW_LINE>sum += v * v;<NEW_LINE>}<NEW_LINE>sum *= div;<NEW_LINE>// Sum_d square sum_i<NEW_LINE>for (int d = 0; d < dim; d++) {<NEW_LINE>double v = (cf.ls(d) + n.doubleValue(d)) * div;<NEW_LINE>sum -= v * v;<NEW_LINE>}<NEW_LINE>return sum > 0 ? sum : 0;<NEW_LINE>} | double sum = cf.sumOfSumOfSquares(); |
1,524,320 | public PlanFragment visitPhysicalMysqlScan(OptExpression optExpression, ExecPlan context) {<NEW_LINE>PhysicalMysqlScanOperator node = (PhysicalMysqlScanOperator) optExpression.getOp();<NEW_LINE>context.getDescTbl().<MASK><NEW_LINE>TupleDescriptor tupleDescriptor = context.getDescTbl().createTupleDescriptor();<NEW_LINE>tupleDescriptor.setTable(node.getTable());<NEW_LINE>for (Map.Entry<ColumnRefOperator, Column> entry : node.getColRefToColumnMetaMap().entrySet()) {<NEW_LINE>SlotDescriptor slotDescriptor = context.getDescTbl().addSlotDescriptor(tupleDescriptor, new SlotId(entry.getKey().getId()));<NEW_LINE>slotDescriptor.setColumn(entry.getValue());<NEW_LINE>slotDescriptor.setIsNullable(entry.getValue().isAllowNull());<NEW_LINE>slotDescriptor.setIsMaterialized(true);<NEW_LINE>context.getColRefToExpr().put(entry.getKey(), new SlotRef(entry.getKey().getName(), slotDescriptor));<NEW_LINE>}<NEW_LINE>tupleDescriptor.computeMemLayout();<NEW_LINE>MysqlScanNode scanNode = new MysqlScanNode(context.getNextNodeId(), tupleDescriptor, (MysqlTable) node.getTable());<NEW_LINE>// set predicate<NEW_LINE>List<ScalarOperator> predicates = Utils.extractConjuncts(node.getPredicate());<NEW_LINE>ScalarOperatorToExpr.FormatterContext formatterContext = new ScalarOperatorToExpr.FormatterContext(context.getColRefToExpr());<NEW_LINE>formatterContext.setImplicitCast(true);<NEW_LINE>for (ScalarOperator predicate : predicates) {<NEW_LINE>scanNode.getConjuncts().add(ScalarOperatorToExpr.buildExecExpression(predicate, formatterContext));<NEW_LINE>}<NEW_LINE>scanNode.setLimit(node.getLimit());<NEW_LINE>scanNode.computeColumnsAndFilters();<NEW_LINE>scanNode.computeStatistics(optExpression.getStatistics());<NEW_LINE>context.getScanNodes().add(scanNode);<NEW_LINE>PlanFragment fragment = new PlanFragment(context.getNextFragmentId(), scanNode, DataPartition.UNPARTITIONED);<NEW_LINE>context.getFragments().add(fragment);<NEW_LINE>return fragment;<NEW_LINE>} | addReferencedTable(node.getTable()); |
1,345,308 | private static void generateLogManagerLogger(ClassOutput output, BiFunction<MethodCreator, FieldDescriptor, BranchResult> isMinLevelEnabledFunction) {<NEW_LINE>try (ClassCreator cc = ClassCreator.builder().setFinal(true).className(LOGMANAGER_LOGGER_CLASS_NAME).classOutput(output).build()) {<NEW_LINE>AnnotationCreator targetClass = cc.addAnnotation("com.oracle.svm.core.annotate.TargetClass");<NEW_LINE>targetClass.addValue("className", "org.jboss.logmanager.Logger");<NEW_LINE>FieldCreator nameAlias = cc.getFieldCreator("name", String.class);<NEW_LINE>nameAlias.addAnnotation("com.oracle.svm.core.annotate.Alias");<NEW_LINE>FieldCreator loggerNodeAlias = cc.getFieldCreator("loggerNode", LOGGER_NODE_CLASS_NAME);<NEW_LINE>loggerNodeAlias.addAnnotation("com.oracle.svm.core.annotate.Alias");<NEW_LINE>final MethodCreator isLoggableMethod = cc.getMethodCreator("isLoggable", boolean.class, java.util.logging.Level.class);<NEW_LINE>isLoggableMethod.addAnnotation("com.oracle.svm.core.annotate.Substitute");<NEW_LINE>final ResultHandle levelIntValue = getParamLevelIntValue(isLoggableMethod);<NEW_LINE>final BranchResult levelBranch = isMinLevelEnabledFunction.apply(<MASK><NEW_LINE>final BytecodeCreator levelTrue = levelBranch.trueBranch();<NEW_LINE>levelTrue.returnValue(levelTrue.invokeVirtualMethod(MethodDescriptor.ofMethod(LOGGER_NODE_CLASS_NAME, "isLoggableLevel", boolean.class, int.class), levelTrue.readInstanceField(loggerNodeAlias.getFieldDescriptor(), levelTrue.getThis()), levelIntValue));<NEW_LINE>final BytecodeCreator levelFalse = levelBranch.falseBranch();<NEW_LINE>levelFalse.returnValue(levelFalse.load(false));<NEW_LINE>}<NEW_LINE>} | isLoggableMethod, nameAlias.getFieldDescriptor()); |
1,630,619 | public static DescribeBgpGroupsResponse unmarshall(DescribeBgpGroupsResponse describeBgpGroupsResponse, UnmarshallerContext _ctx) {<NEW_LINE>describeBgpGroupsResponse.setRequestId<MASK><NEW_LINE>describeBgpGroupsResponse.setPageSize(_ctx.integerValue("DescribeBgpGroupsResponse.PageSize"));<NEW_LINE>describeBgpGroupsResponse.setPageNumber(_ctx.integerValue("DescribeBgpGroupsResponse.PageNumber"));<NEW_LINE>describeBgpGroupsResponse.setTotalCount(_ctx.integerValue("DescribeBgpGroupsResponse.TotalCount"));<NEW_LINE>List<BgpGroup> bgpGroups = new ArrayList<BgpGroup>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("DescribeBgpGroupsResponse.BgpGroups.Length"); i++) {<NEW_LINE>BgpGroup bgpGroup = new BgpGroup();<NEW_LINE>bgpGroup.setStatus(_ctx.stringValue("DescribeBgpGroupsResponse.BgpGroups[" + i + "].Status"));<NEW_LINE>bgpGroup.setBgpGroupId(_ctx.stringValue("DescribeBgpGroupsResponse.BgpGroups[" + i + "].BgpGroupId"));<NEW_LINE>bgpGroup.setRouterId(_ctx.stringValue("DescribeBgpGroupsResponse.BgpGroups[" + i + "].RouterId"));<NEW_LINE>bgpGroup.setPeerAsn(_ctx.stringValue("DescribeBgpGroupsResponse.BgpGroups[" + i + "].PeerAsn"));<NEW_LINE>bgpGroup.setLocalAsn(_ctx.stringValue("DescribeBgpGroupsResponse.BgpGroups[" + i + "].LocalAsn"));<NEW_LINE>bgpGroup.setRegionId(_ctx.stringValue("DescribeBgpGroupsResponse.BgpGroups[" + i + "].RegionId"));<NEW_LINE>bgpGroup.setHold(_ctx.stringValue("DescribeBgpGroupsResponse.BgpGroups[" + i + "].Hold"));<NEW_LINE>bgpGroup.setIpVersion(_ctx.stringValue("DescribeBgpGroupsResponse.BgpGroups[" + i + "].IpVersion"));<NEW_LINE>bgpGroup.setDescription(_ctx.stringValue("DescribeBgpGroupsResponse.BgpGroups[" + i + "].Description"));<NEW_LINE>bgpGroup.setKeepalive(_ctx.stringValue("DescribeBgpGroupsResponse.BgpGroups[" + i + "].Keepalive"));<NEW_LINE>bgpGroup.setIsFake(_ctx.stringValue("DescribeBgpGroupsResponse.BgpGroups[" + i + "].IsFake"));<NEW_LINE>bgpGroup.setRouteLimit(_ctx.stringValue("DescribeBgpGroupsResponse.BgpGroups[" + i + "].RouteLimit"));<NEW_LINE>bgpGroup.setName(_ctx.stringValue("DescribeBgpGroupsResponse.BgpGroups[" + i + "].Name"));<NEW_LINE>bgpGroup.setAuthKey(_ctx.stringValue("DescribeBgpGroupsResponse.BgpGroups[" + i + "].AuthKey"));<NEW_LINE>bgpGroups.add(bgpGroup);<NEW_LINE>}<NEW_LINE>describeBgpGroupsResponse.setBgpGroups(bgpGroups);<NEW_LINE>return describeBgpGroupsResponse;<NEW_LINE>} | (_ctx.stringValue("DescribeBgpGroupsResponse.RequestId")); |
1,391,333 | public void mouseReleased(final MouseEvent e) {<NEW_LINE>final MainView v = (MainView) e.getSource();<NEW_LINE>if (!v.contains(e.getX(), e.getY())) {<NEW_LINE>v.setMouseArea(MouseArea.OUT);<NEW_LINE>}<NEW_LINE>if (!isDragActive()) {<NEW_LINE>super.mouseReleased(e);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final NodeView nodeV = getNodeView(e);<NEW_LINE>final NodeModel node = nodeV.getModel();<NEW_LINE>final ModeController modeController = nodeV.getMap().getModeController();<NEW_LINE>final Controller controller = modeController.getController();<NEW_LINE>MLocationController locationController = (MLocationController) LocationController.getController(controller.getModeController());<NEW_LINE>final NodeView parentView = nodeV.getParentView();<NEW_LINE>final NodeView childDistanceContainerView = parentView.getChildDistanceContainer();<NEW_LINE>NodeModel childDistanceContainer = childDistanceContainerView.getModel();<NEW_LINE>final Quantity<LengthUnit> parentVGap = locationController.getMinimalDistanceBetweenChildren(childDistanceContainer);<NEW_LINE>Quantity<LengthUnit> hgap = LocationModel.getModel(node).getHGap();<NEW_LINE>final Quantity<LengthUnit> shiftY = LocationModel.getModel(node).getShiftY();<NEW_LINE>adjustNodeIndices(nodeV);<NEW_LINE>resetPositions(node);<NEW_LINE><MASK><NEW_LINE>locationController.moveNodePosition(node, hGap, shiftY);<NEW_LINE>locationController.setMinimalDistanceBetweenChildren(childDistanceContainer, parentVGap);<NEW_LINE>stopDrag();<NEW_LINE>} | final Quantity<LengthUnit> hGap = hgap; |
565,748 | public org.mlflow.api.proto.ModelRegistry.RegisteredModel buildPartial() {<NEW_LINE>org.mlflow.api.proto.ModelRegistry.RegisteredModel result = new org.mlflow.api.proto.ModelRegistry.RegisteredModel(this);<NEW_LINE>int from_bitField0_ = bitField0_;<NEW_LINE>int to_bitField0_ = 0;<NEW_LINE>if (((from_bitField0_ & 0x00000001) == 0x00000001)) {<NEW_LINE>to_bitField0_ |= 0x00000001;<NEW_LINE>}<NEW_LINE>result.name_ = name_;<NEW_LINE>if (((from_bitField0_ & 0x00000002) == 0x00000002)) {<NEW_LINE>to_bitField0_ |= 0x00000002;<NEW_LINE>}<NEW_LINE>result.creationTimestamp_ = creationTimestamp_;<NEW_LINE>if (((from_bitField0_ & 0x00000004) == 0x00000004)) {<NEW_LINE>to_bitField0_ |= 0x00000004;<NEW_LINE>}<NEW_LINE>result.lastUpdatedTimestamp_ = lastUpdatedTimestamp_;<NEW_LINE>if (((from_bitField0_ & 0x00000008) == 0x00000008)) {<NEW_LINE>to_bitField0_ |= 0x00000008;<NEW_LINE>}<NEW_LINE>result.userId_ = userId_;<NEW_LINE>if (((from_bitField0_ & 0x00000010) == 0x00000010)) {<NEW_LINE>to_bitField0_ |= 0x00000010;<NEW_LINE>}<NEW_LINE>result.description_ = description_;<NEW_LINE>if (latestVersionsBuilder_ == null) {<NEW_LINE>if (((bitField0_ & 0x00000020) == 0x00000020)) {<NEW_LINE>latestVersions_ = java.util.Collections.unmodifiableList(latestVersions_);<NEW_LINE>bitField0_ = (bitField0_ & ~0x00000020);<NEW_LINE>}<NEW_LINE>result.latestVersions_ = latestVersions_;<NEW_LINE>} else {<NEW_LINE>result.latestVersions_ = latestVersionsBuilder_.build();<NEW_LINE>}<NEW_LINE>if (tagsBuilder_ == null) {<NEW_LINE>if (((bitField0_ & 0x00000040) == 0x00000040)) {<NEW_LINE>tags_ = java.<MASK><NEW_LINE>bitField0_ = (bitField0_ & ~0x00000040);<NEW_LINE>}<NEW_LINE>result.tags_ = tags_;<NEW_LINE>} else {<NEW_LINE>result.tags_ = tagsBuilder_.build();<NEW_LINE>}<NEW_LINE>result.bitField0_ = to_bitField0_;<NEW_LINE>onBuilt();<NEW_LINE>return result;<NEW_LINE>} | util.Collections.unmodifiableList(tags_); |
311,315 | final UntagResourceResult executeUntagResource(UntagResourceRequest untagResourceRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(untagResourceRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<UntagResourceRequest> request = null;<NEW_LINE>Response<UntagResourceResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new UntagResourceRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(untagResourceRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "Transcribe");<NEW_LINE>request.<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<UntagResourceResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new UntagResourceResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | addHandlerContext(HandlerContextKey.OPERATION_NAME, "UntagResource"); |
940,316 | public void updateGui() {<NEW_LINE>// Note: There is a reason for why we have to update the toolbar<NEW_LINE>// from the outside. The toolbar can not update itself because<NEW_LINE>// the toolbar state depends on the state of the TID box in the<NEW_LINE>// debug panel.<NEW_LINE>final IDebugger debugger = m_debugger.getCurrentSelectedDebugger();<NEW_LINE>final TargetProcessThread activeThread = debugger == null ? null : debugger.getProcessManager().getActiveThread();<NEW_LINE>final boolean connected = (debugger != null) && debugger.isConnected();<NEW_LINE>final boolean suspended = connected && (activeThread != null);<NEW_LINE>m_startAction.setEnabled(!connected);<NEW_LINE>final boolean haltBeforeCommunicating = (debugger != null) && connected && (debugger.getProcessManager().getTargetInformation() != null) && debugger.getProcessManager().getTargetInformation().getDebuggerOptions().mustHaltBeforeCommunicating();<NEW_LINE>m_detachAction.setEnabled(connected && (!haltBeforeCommunicating || suspended));<NEW_LINE>m_terminateAction.setEnabled(connected);<NEW_LINE>m_stepIntoAction.setEnabled(connected && suspended);<NEW_LINE>m_stepIntoAction.setEnabled(connected && suspended);<NEW_LINE>m_stepOverAction.setEnabled(connected && suspended);<NEW_LINE>m_stepBlockAction.setEnabled(connected && suspended);<NEW_LINE>m_stepEndAction.setEnabled(connected && suspended);<NEW_LINE>m_resumeAction.setEnabled(connected && suspended);<NEW_LINE>m_haltAction.setEnabled(connected && !suspended);<NEW_LINE>final boolean tracing = (debugger != null) && m_debugger.<MASK><NEW_LINE>m_startTraceAction.setEnabled(connected && (!haltBeforeCommunicating || suspended));<NEW_LINE>m_stopTraceAction.setEnabled(connected && tracing && (!haltBeforeCommunicating || suspended));<NEW_LINE>} | getTraceLogger(debugger).hasEchoBreakpoints(); |
1,371,502 | public void onCreate(Bundle savedInstanceState) {<NEW_LINE>super.onCreate(savedInstanceState);<NEW_LINE>((SyncthingApp) getApplication()).component().inject(this);<NEW_LINE>setContentView(R.layout.activity_main);<NEW_LINE>mDrawerLayout = findViewById(R.id.drawer_layout);<NEW_LINE>FragmentManager fm = getSupportFragmentManager();<NEW_LINE>if (savedInstanceState != null) {<NEW_LINE>mFolderListFragment = (FolderListFragment) fm.getFragment(savedInstanceState, FolderListFragment.class.getName());<NEW_LINE>mDeviceListFragment = (DeviceListFragment) fm.getFragment(savedInstanceState, <MASK><NEW_LINE>mDrawerFragment = (DrawerFragment) fm.getFragment(savedInstanceState, DrawerFragment.class.getName());<NEW_LINE>} else {<NEW_LINE>mFolderListFragment = new FolderListFragment();<NEW_LINE>mDeviceListFragment = new DeviceListFragment();<NEW_LINE>mDrawerFragment = new DrawerFragment();<NEW_LINE>}<NEW_LINE>mViewPager = findViewById(R.id.pager);<NEW_LINE>mViewPager.setAdapter(mSectionsPagerAdapter);<NEW_LINE>TabLayout tabLayout = findViewById(R.id.tabContainer);<NEW_LINE>tabLayout.setupWithViewPager(mViewPager);<NEW_LINE>if (savedInstanceState != null) {<NEW_LINE>mViewPager.setCurrentItem(savedInstanceState.getInt("currentTab"));<NEW_LINE>if (savedInstanceState.getBoolean(IS_SHOWING_RESTART_DIALOG)) {<NEW_LINE>showRestartDialog();<NEW_LINE>}<NEW_LINE>mBatteryOptimizationDialogDismissed = savedInstanceState.getBoolean(BATTERY_DIALOG_DISMISSED);<NEW_LINE>if (savedInstanceState.getBoolean(IS_QRCODE_DIALOG_DISPLAYED)) {<NEW_LINE>showQrCodeDialog(savedInstanceState.getString(DEVICEID_KEY), savedInstanceState.getParcelable(QRCODE_BITMAP_KEY));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>fm.beginTransaction().replace(R.id.drawer, mDrawerFragment).commit();<NEW_LINE>mDrawerToggle = new Toggle(this, mDrawerLayout);<NEW_LINE>mDrawerLayout.setDrawerLockMode(DrawerLayout.LOCK_MODE_LOCKED_CLOSED);<NEW_LINE>mDrawerLayout.addDrawerListener(mDrawerToggle);<NEW_LINE>setOptimalDrawerWidth(findViewById(R.id.drawer));<NEW_LINE>// SyncthingService needs to be started from this activity as the user<NEW_LINE>// can directly launch this activity from the recent activity switcher.<NEW_LINE>Intent serviceIntent = new Intent(this, SyncthingService.class);<NEW_LINE>if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {<NEW_LINE>startForegroundService(serviceIntent);<NEW_LINE>} else {<NEW_LINE>startService(serviceIntent);<NEW_LINE>}<NEW_LINE>onNewIntent(getIntent());<NEW_LINE>} | DeviceListFragment.class.getName()); |
975,020 | public SQLExpr buildPartitionBy(GsiMetaManager.GsiTableMetaBean indexTableMeta, boolean onTable) {<NEW_LINE>final String policy = onTable <MASK><NEW_LINE>final String key = onTable ? indexTableMeta.tbPartitionKey : indexTableMeta.dbPartitionKey;<NEW_LINE>if (null == indexTableMeta || TStringUtil.isBlank(policy)) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>final boolean singleParam = isSingleParam(policy);<NEW_LINE>if (!singleParam) {<NEW_LINE>try {<NEW_LINE>final MySqlCreateTableParser createParser = new MySqlCreateTableParser(new MySqlExprParser((onTable ? "TBPARTITION" : "DBPARTITION") + " BY " + policy));<NEW_LINE>final SQLPartitionBy partitionBy = createParser.parsePartitionBy();<NEW_LINE>if (partitionBy instanceof SQLPartitionByRange) {<NEW_LINE>final SQLPartitionByRange sqlPartitionBy = (SQLPartitionByRange) partitionBy;<NEW_LINE>return sqlPartitionBy.getInterval();<NEW_LINE>} else if (partitionBy instanceof SQLPartitionByHash) {<NEW_LINE>SQLMethodInvokeExpr partitionByInvoke = null;<NEW_LINE>if (((SQLPartitionByHash) partitionBy).isUnique()) {<NEW_LINE>final SQLMethodInvokeExpr finalPartitionBy = new SQLMethodInvokeExpr("UNI_HASH");<NEW_LINE>partitionBy.getColumns().forEach(finalPartitionBy::addArgument);<NEW_LINE>partitionByInvoke = finalPartitionBy;<NEW_LINE>} else {<NEW_LINE>partitionByInvoke = new SQLMethodInvokeExpr("HASH");<NEW_LINE>partitionByInvoke.addArgument(new SQLIdentifierExpr("`" + key + "`"));<NEW_LINE>}<NEW_LINE>return partitionByInvoke;<NEW_LINE>}<NEW_LINE>} catch (Exception ignored) {<NEW_LINE>// cannot parse tbpartition policy<NEW_LINE>}<NEW_LINE>}<NEW_LINE>final SQLMethodInvokeExpr partitionBy = new SQLMethodInvokeExpr(policy);<NEW_LINE>partitionBy.addArgument(new SQLIdentifierExpr("`" + key + "`"));<NEW_LINE>return partitionBy;<NEW_LINE>} | ? indexTableMeta.tbPartitionPolicy : indexTableMeta.dbPartitionPolicy; |
883,452 | public static ItineraryListFilterChain createFilterChain(SortOrder sortOrder, ItineraryFilterParameters params, int maxNumOfItineraries, Instant filterOnLatestDepartureTime, boolean removeWalkAllTheWayResults, boolean maxNumberOfItinerariesCropHead, Consumer<Itinerary> maxLimitReachedSubscriber) {<NEW_LINE>var builder = new ItineraryListFilterChainBuilder(sortOrder);<NEW_LINE>// Group by similar legs filter<NEW_LINE>if (params.groupSimilarityKeepOne >= 0.5) {<NEW_LINE>builder.addGroupBySimilarity(GroupBySimilarity<MASK><NEW_LINE>}<NEW_LINE>if (params.groupSimilarityKeepThree >= 0.5) {<NEW_LINE>builder.addGroupBySimilarity(GroupBySimilarity.createWithMoreThanOneItineraryPerGroup(params.groupSimilarityKeepThree, KEEP_THREE, true, params.groupedOtherThanSameLegsMaxCostMultiplier));<NEW_LINE>}<NEW_LINE>if (maxNumberOfItinerariesCropHead) {<NEW_LINE>builder.withMaxNumberOfItinerariesCrop(ListSection.HEAD);<NEW_LINE>}<NEW_LINE>builder.withMaxNumberOfItineraries(Math.min(maxNumOfItineraries, MAX_NUMBER_OF_ITINERARIES)).withTransitGeneralizedCostLimit(params.transitGeneralizedCostLimit).withBikeRentalDistanceRatio(params.bikeRentalDistanceRatio).withParkAndRideDurationRatio(params.parkAndRideDurationRatio).withNonTransitGeneralizedCostLimit(params.nonTransitGeneralizedCostLimit).withRemoveTransitWithHigherCostThanBestOnStreetOnly(true).withLatestDepartureTimeLimit(filterOnLatestDepartureTime).withMaxLimitReachedSubscriber(maxLimitReachedSubscriber).withRemoveWalkAllTheWayResults(removeWalkAllTheWayResults).withDebugEnabled(params.debug);<NEW_LINE>return builder.build();<NEW_LINE>} | .createWithOneItineraryPerGroup(params.groupSimilarityKeepOne)); |
804,868 | public void validate(CustomBindingResult bindingResult, PurchaseContext purchaseContext, SameCountryValidator vatValidator, Map<ConfigurationKeys, Boolean> formValidationParameters, Optional<Validator.TicketFieldsFilterer> ticketFieldsFilterer, boolean reservationRequiresPayment) {<NEW_LINE>formalValidation(bindingResult, formValidationParameters.getOrDefault(ConfigurationKeys.ENABLE_ITALY_E_INVOICING, false), reservationRequiresPayment);<NEW_LINE>purchaseContext.event().ifPresent(event -> {<NEW_LINE>if (!postponeAssignment) {<NEW_LINE>Optional<List<ValidationResult>> validationResults = Optional.ofNullable(tickets).filter(m -> !m.isEmpty()).map(m -> m.entrySet().stream().map(e -> {<NEW_LINE>var filteredForTicket = ticketFieldsFilterer.orElseThrow().getFieldsForTicket(e.getKey());<NEW_LINE>return Validator.validateTicketAssignment(e.getValue(), filteredForTicket, Optional.of(bindingResult), event, "tickets[" + e.getKey() + "]", vatValidator);<NEW_LINE>})).map(s -> s.collect(Collectors.toList()));<NEW_LINE>boolean success = validationResults.filter(l -> l.stream().allMatch(ValidationResult::isSuccess)).isPresent();<NEW_LINE>if (!success) {<NEW_LINE>String errorCode = validationResults.filter(this::containsVatValidationError)<MASK><NEW_LINE>bindingResult.reject(errorCode);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>if (purchaseContext.ofType(PurchaseContextType.subscription) && differentSubscriptionOwner) {<NEW_LINE>ValidationUtils.rejectIfEmptyOrWhitespace(bindingResult, "subscriptionOwner.firstName", ErrorsCode.STEP_2_EMPTY_FIRSTNAME);<NEW_LINE>ValidationUtils.rejectIfEmptyOrWhitespace(bindingResult, "subscriptionOwner.lastName", ErrorsCode.STEP_2_EMPTY_LASTNAME);<NEW_LINE>ValidationUtils.rejectIfEmptyOrWhitespace(bindingResult, "subscriptionOwner.email", ErrorsCode.STEP_2_EMPTY_EMAIL);<NEW_LINE>}<NEW_LINE>} | .isPresent() ? STEP_2_INVALID_VAT : STEP_2_MISSING_ATTENDEE_DATA; |
923,762 | public CELLTYPE join(Column<?, ?>... columns) {<NEW_LINE>if (columns.length <= 1) {<NEW_LINE>throw new IllegalArgumentException("You can't merge less than 2 columns together.");<NEW_LINE>}<NEW_LINE>HashSet<Column<?, ?>> columnGroup = new HashSet<Column<?, ?>>();<NEW_LINE>// NOTE: this doesn't care about hidden columns, those are<NEW_LINE>// filtered in calculateColspans()<NEW_LINE>for (Column<?, ?> column : columns) {<NEW_LINE>if (!cells.containsKey(column)) {<NEW_LINE>throw new IllegalArgumentException("Given column does not exists on row " + column);<NEW_LINE>} else if (getCellGroupForColumn(column) != null) {<NEW_LINE>throw new IllegalStateException("Column is already in a group.");<NEW_LINE>}<NEW_LINE>columnGroup.add(column);<NEW_LINE>}<NEW_LINE>CELLTYPE joinedCell = createCell();<NEW_LINE>cellGroups.put(columnGroup, joinedCell);<NEW_LINE><MASK><NEW_LINE>calculateColspans();<NEW_LINE>return joinedCell;<NEW_LINE>} | joinedCell.setSection(getSection()); |
1,555,643 | public Page<EntCustomer> findByCreaterAndSharesAndOrgi(String creater, String shares, String orgi, Date begin, Date end, boolean includeDeleteData, String q, Pageable page) {<NEW_LINE>BoolQueryBuilder boolQueryBuilder = QueryBuilders.boolQuery();<NEW_LINE>BoolQueryBuilder boolQueryBuilder1 = new BoolQueryBuilder();<NEW_LINE>boolQueryBuilder1.should(termQuery("creater", creater));<NEW_LINE>boolQueryBuilder1.should(termQuery("shares", creater));<NEW_LINE>boolQueryBuilder1.should(termQuery("shares", "all"));<NEW_LINE>boolQueryBuilder.must(boolQueryBuilder1);<NEW_LINE>boolQueryBuilder.must(termQuery("orgi", orgi));<NEW_LINE>if (includeDeleteData) {<NEW_LINE>boolQueryBuilder.must(termQuery("datastatus", true));<NEW_LINE>} else {<NEW_LINE>boolQueryBuilder.must(termQuery("datastatus", false));<NEW_LINE>}<NEW_LINE>RangeQueryBuilder rangeQuery = QueryBuilders.rangeQuery("createtime");<NEW_LINE>if (begin != null) {<NEW_LINE>rangeQuery.from(dateFromate.format(begin));<NEW_LINE>}<NEW_LINE>if (end != null) {<NEW_LINE>rangeQuery.to(dateFromate.format(end));<NEW_LINE>} else {<NEW_LINE>rangeQuery.to(dateFromate.format(new Date()));<NEW_LINE>}<NEW_LINE>if (begin != null || end != null) {<NEW_LINE>boolQueryBuilder.must(rangeQuery);<NEW_LINE>}<NEW_LINE>if (!StringUtils.isBlank(q)) {<NEW_LINE>boolQueryBuilder.must(new QueryStringQueryBuilder(q)<MASK><NEW_LINE>}<NEW_LINE>return processQuery(boolQueryBuilder, page);<NEW_LINE>} | .defaultOperator(Operator.AND)); |
1,454,486 | public Symbol tryApplyRules(Symbol node) {<NEW_LINE>final boolean isTraceEnabled = LOGGER.isTraceEnabled();<NEW_LINE>// Some rules may only become applicable after another rule triggered, so we keep<NEW_LINE>// trying to re-apply the rules as long as at least one plan was transformed.<NEW_LINE>boolean done = false;<NEW_LINE>int numIterations = 0;<NEW_LINE>while (!done && numIterations < 10_000) {<NEW_LINE>done = true;<NEW_LINE>Version minVersion = minNodeVersionInCluster.get();<NEW_LINE>for (Rule rule : rules) {<NEW_LINE>if (minVersion.before(rule.requiredVersion())) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>Match<?> match = rule.pattern().accept(node, Captures.empty());<NEW_LINE>if (match.isPresent()) {<NEW_LINE>if (isTraceEnabled) {<NEW_LINE>LOGGER.trace("Rule '" + rule.getClass().getSimpleName() + "' matched");<NEW_LINE>}<NEW_LINE>Symbol transformedNode = rule.apply(match.value(), match.captures(), nodeCtx, visitor.getParentFunction());<NEW_LINE>if (transformedNode != null) {<NEW_LINE>if (isTraceEnabled) {<NEW_LINE>LOGGER.trace("Rule '" + rule.getClass(<MASK><NEW_LINE>}<NEW_LINE>node = transformedNode;<NEW_LINE>done = false;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>numIterations++;<NEW_LINE>}<NEW_LINE>assert numIterations < 10_000 : "Optimizer reached 10_000 iterations safety guard. This is an indication of a broken rule that matches again and again";<NEW_LINE>return node;<NEW_LINE>} | ).getSimpleName() + "' transformed the symbol"); |
1,820,362 | /* Buggy implementation. Keep as first draft if we want to use it again<NEW_LINE>public void renameForDragAndDrop(Long draggedDeckDid, Long ontoDeckDid) throws DeckRenameException {<NEW_LINE>Deck draggedDeck = get(draggedDeckDid);<NEW_LINE>String draggedDeckName = draggedDeck.getString("name");<NEW_LINE>String ontoDeckName = get(ontoDeckDid).getString("name");<NEW_LINE><NEW_LINE>String draggedBasename = basename(draggedDeckName);<NEW_LINE>if (ontoDeckDid == null) {<NEW_LINE>if (!draggedBasename.equals(draggedDeckName)) {<NEW_LINE>rename(draggedDeck, draggedBasename);<NEW_LINE>}<NEW_LINE>} else if (_canDragAndDrop(draggedDeckName, ontoDeckName)) {<NEW_LINE>rename(draggedDeck, ontoDeckName + "::" + draggedBasename);<NEW_LINE>}<NEW_LINE>}<NEW_LINE><NEW_LINE><NEW_LINE>private boolean _canDragAndDrop(String draggedDeckName, String ontoDeckName) {<NEW_LINE>if (draggedDeckName.equals(ontoDeckName)<NEW_LINE>|| _isParent(ontoDeckName, draggedDeckName)<NEW_LINE>|| _isAncestor(draggedDeckName, ontoDeckName)) {<NEW_LINE>return false;<NEW_LINE>} else {<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>*/<NEW_LINE>private boolean _isParent(String parentDeckName, String childDeckName) {<NEW_LINE>String<MASK><NEW_LINE>String[] childDeckPath = path(childDeckName);<NEW_LINE>if (parentDeckPath.length + 1 != childDeckPath.length) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>for (int i = 0; i < parentDeckPath.length; i++) {<NEW_LINE>if (!parentDeckPath[i].equals(childDeckPath[i])) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>} | [] parentDeckPath = path(parentDeckName); |
74,693 | private static // F743-506<NEW_LINE>TimerMethodData.AutomaticTimer processAutomaticTimerFromXML(com.ibm.ws.javaee.dd.ejb.Timer timer) {<NEW_LINE>TimerSchedule timerSchedule = timer.getSchedule();<NEW_LINE>boolean persistent = !timer.isSetPersistent() || timer.isPersistent();<NEW_LINE>ScheduleExpression schedule = new ScheduleExpression();<NEW_LINE>String year = timerSchedule.getYear();<NEW_LINE>if (year != null) {<NEW_LINE>schedule.year(year);<NEW_LINE>}<NEW_LINE>String month = timerSchedule.getMonth();<NEW_LINE>if (month != null) {<NEW_LINE>schedule.month(month);<NEW_LINE>}<NEW_LINE>String dayOfMonth = timerSchedule.getDayOfMonth();<NEW_LINE>if (dayOfMonth != null) {<NEW_LINE>schedule.dayOfMonth(dayOfMonth);<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>if (dayOfWeek != null) {<NEW_LINE>schedule.dayOfWeek(dayOfWeek);<NEW_LINE>}<NEW_LINE>String hour = timerSchedule.getHour();<NEW_LINE>if (hour != null) {<NEW_LINE>schedule.hour(hour);<NEW_LINE>}<NEW_LINE>String minute = timerSchedule.getMinute();<NEW_LINE>if (minute != null) {<NEW_LINE>schedule.minute(minute);<NEW_LINE>}<NEW_LINE>String second = timerSchedule.getSecond();<NEW_LINE>if (second != null) {<NEW_LINE>schedule.second(second);<NEW_LINE>}<NEW_LINE>schedule.timezone(timer.getTimezone());<NEW_LINE>String start = timer.getStart();<NEW_LINE>String end = timer.getEnd();<NEW_LINE>Serializable info = timer.getInfo();<NEW_LINE>// F743-506CodRev<NEW_LINE>return new TimerMethodData.AutomaticTimer(true, persistent, schedule, start, end, info);<NEW_LINE>} | String dayOfWeek = timerSchedule.getDayOfWeek(); |
647,176 | protected Area createGridArea(int gridRadius) {<NEW_LINE>final Area cellArea = new Area(createCellShape(getSize()));<NEW_LINE>final Set<Point> points = generateRing(gridRadius);<NEW_LINE>Area gridArea = new Area();<NEW_LINE>// HACK! Hex cellShape is ever so off from grid so adding them to a single Area can produce gap<NEW_LINE>// artifacts in the rendering<NEW_LINE>// TODO: Look at cellShape and see if it needs adjusting, and if so what does that affect<NEW_LINE>// downstream if anything?<NEW_LINE>final double hexScale = 1.025;<NEW_LINE>for (Point point : points) {<NEW_LINE>final CellPoint cellPoint = new CellPoint(point.x, point.y);<NEW_LINE>final ZonePoint zp = cellPoint.convertToZonePoint(this);<NEW_LINE>final AffineTransform at = new AffineTransform();<NEW_LINE>at.translate(zp.x, zp.y);<NEW_LINE>if (isHexHorizontal()) {<NEW_LINE>at.scale(1, hexScale);<NEW_LINE>} else {<NEW_LINE>at.scale(hexScale, 1);<NEW_LINE>}<NEW_LINE>gridArea.add(cellArea.createTransformedArea(at));<NEW_LINE>}<NEW_LINE>// Fill inner Hex Area with one large area to save time<NEW_LINE>final int hexRadius = gridRadius * getSize();<NEW_LINE>if (isHexHorizontal()) {<NEW_LINE>gridArea.add(createHex(getSize(), getSize(), hexRadius, 0));<NEW_LINE>} else {<NEW_LINE>gridArea.add(createHex(getSize(), -getSize(), hexRadius, <MASK><NEW_LINE>}<NEW_LINE>setGridShapeCache(gridRadius, gridArea);<NEW_LINE>return gridArea;<NEW_LINE>} | Math.toRadians(90))); |
472,020 | public boolean apply(Game game, Ability source) {<NEW_LINE>Player controller = game.getPlayer(source.getControllerId());<NEW_LINE>if (controller == null) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>Set<String> choices = new HashSet<>();<NEW_LINE>choices.add("Artifacts");<NEW_LINE>choices.add("Creatures");<NEW_LINE>choices.add("Lands");<NEW_LINE>LinkedList<CardType> order = new LinkedList<>();<NEW_LINE>ChoiceImpl choice = new ChoiceImpl(true);<NEW_LINE>choice.setMessage("Choose a card type");<NEW_LINE>choice.setChoices(choices);<NEW_LINE>while (choices.size() > 1) {<NEW_LINE>if (!controller.choose(Outcome.Sacrifice, choice, game)) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>order.add(getCardType(choice.getChoice()));<NEW_LINE>choices.remove(choice.getChoice());<NEW_LINE>choice.clearChoice();<NEW_LINE>}<NEW_LINE>order.add(getCardType(choices.iterator().next()));<NEW_LINE>int count = 1;<NEW_LINE>for (CardType cardType : order) {<NEW_LINE>FilterControlledPermanent filter = new FilterControlledPermanent(cardType + " you control");<NEW_LINE>filter.add(cardType.getPredicate());<NEW_LINE>new SacrificeAllEffect(count, filter<MASK><NEW_LINE>count++;<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>} | ).apply(game, source); |
917,458 | public void validate(Context context, ActionListener<Context> listener) {<NEW_LINE>List<String> remoteIndices = new ArrayList<<MASK><NEW_LINE>Map<String, Version> remoteClusterVersions;<NEW_LINE>try {<NEW_LINE>List<String> remoteAliases = RemoteClusterLicenseChecker.remoteClusterAliases(context.getRegisteredRemoteClusterNames(), remoteIndices);<NEW_LINE>remoteClusterVersions = remoteAliases.stream().collect(toMap(identity(), context::getRemoteClusterVersion));<NEW_LINE>} catch (NoSuchRemoteClusterException e) {<NEW_LINE>context.addValidationError(e.getMessage());<NEW_LINE>listener.onResponse(context);<NEW_LINE>return;<NEW_LINE>} catch (Exception e) {<NEW_LINE>context.addValidationError(ERROR_REMOTE_CLUSTER_SEARCH, e.getMessage());<NEW_LINE>listener.onResponse(context);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>Map<String, Version> oldRemoteClusterVersions = remoteClusterVersions.entrySet().stream().filter(entry -> entry.getValue().before(minExpectedVersion)).collect(toMap(Map.Entry::getKey, Map.Entry::getValue));<NEW_LINE>if (oldRemoteClusterVersions.isEmpty() == false) {<NEW_LINE>context.addValidationError(REMOTE_CLUSTERS_TOO_OLD, minExpectedVersion, reason, // sort to have a deterministic order among clusters in the resulting string<NEW_LINE>oldRemoteClusterVersions.entrySet().stream().// sort to have a deterministic order among clusters in the resulting string<NEW_LINE>sorted(comparingByKey()).map(e -> e.getKey() + " (" + e.getValue() + ")").collect(joining(", ")));<NEW_LINE>}<NEW_LINE>listener.onResponse(context);<NEW_LINE>} | >(context.resolveRemoteSource()); |
92,223 | private MapValue removeInternal(String key, Optional<byte[]> value, Optional<MapValue> tombstone) {<NEW_LINE>checkState(!closed, destroyedMessage);<NEW_LINE>checkNotNull(key, ERROR_NULL_KEY);<NEW_LINE>checkNotNull(value, ERROR_NULL_VALUE);<NEW_LINE>tombstone.ifPresent(v -> checkState(v.isTombstone()));<NEW_LINE>counter.incrementCount();<NEW_LINE>AtomicBoolean updated = new AtomicBoolean(false);<NEW_LINE>AtomicReference<MapValue> previousValue = new AtomicReference<>();<NEW_LINE>items.compute(key, (k, existing) -> {<NEW_LINE>boolean valueMatches = true;<NEW_LINE>if (value.isPresent() && existing != null && existing.isAlive()) {<NEW_LINE>valueMatches = Arrays.equals(value.get(), existing.get());<NEW_LINE>}<NEW_LINE>if (existing == null) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>if (valueMatches) {<NEW_LINE>if (existing == null) {<NEW_LINE>updated.set(tombstone.isPresent());<NEW_LINE>} else {<NEW_LINE>updated.set(!tombstone.isPresent() || tombstone.get().isNewerThan(existing));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (updated.get()) {<NEW_LINE>previousValue.set(existing);<NEW_LINE>return tombstone.orElse(null);<NEW_LINE>} else {<NEW_LINE>return existing;<NEW_LINE>}<NEW_LINE>});<NEW_LINE>return previousValue.get();<NEW_LINE>} | LOGGER.trace("ECMap Remove: Existing value for key {} is already null", k); |
5,355 | public String extractBamlXml(String xml) throws AxelorException {<NEW_LINE>if (xml == null) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>DocumentBuilderFactory docBuilderFactory = new XPathParse().getDocumentBuilderFactory();<NEW_LINE>try {<NEW_LINE>docBuilderFactory.setNamespaceAware(false);<NEW_LINE>DocumentBuilder builder = docBuilderFactory.newDocumentBuilder();<NEW_LINE>InputStream inputStream = new <MASK><NEW_LINE>Document doc = builder.parse(inputStream);<NEW_LINE>inputStream.close();<NEW_LINE>NodeList nodeList = doc.getElementsByTagName("process-action");<NEW_LINE>xml = BamlParser.createEmptyBamlXml();<NEW_LINE>inputStream = new ByteArrayInputStream(xml.getBytes());<NEW_LINE>doc = builder.parse(inputStream);<NEW_LINE>inputStream.close();<NEW_LINE>for (int i = 0; i < nodeList.getLength(); i++) {<NEW_LINE>Node node = doc.importNode(nodeList.item(i), true);<NEW_LINE>doc.getFirstChild().appendChild(node);<NEW_LINE>}<NEW_LINE>TransformerFactory tFactory = TransformerFactory.newInstance();<NEW_LINE>Transformer transformer = tFactory.newTransformer();<NEW_LINE>DOMSource source = new DOMSource(doc);<NEW_LINE>ByteArrayOutputStream bout = new ByteArrayOutputStream();<NEW_LINE>StreamResult result = new StreamResult(bout);<NEW_LINE>transformer.transform(source, result);<NEW_LINE>xml = bout.toString();<NEW_LINE>bout.close();<NEW_LINE>return xml;<NEW_LINE>} catch (ParserConfigurationException | SAXException | IOException | TransformerException e) {<NEW_LINE>e.printStackTrace();<NEW_LINE>}<NEW_LINE>return xml;<NEW_LINE>} | ByteArrayInputStream(xml.getBytes()); |
880,929 | private void printGCSummary() {<NEW_LINE>if (!HeapOptions.PrintGCSummary.getValue()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>Log log = Log.log();<NEW_LINE>final String prefix = "PrintGCSummary: ";<NEW_LINE>log.string(prefix).string("MaximumYoungGenerationSize: ").unsigned(getPolicy().getMaximumYoungGenerationSize()).newline();<NEW_LINE>log.string(prefix).string("MinimumHeapSize: ").unsigned(getPolicy().getMinimumHeapSize()).newline();<NEW_LINE>log.string(prefix).string("MaximumHeapSize: ").unsigned(getPolicy().getMaximumHeapSize()).newline();<NEW_LINE>log.string(prefix).string("AlignedChunkSize: ").unsigned(HeapParameters.getAlignedHeapChunkSize()).newline();<NEW_LINE>FlushTLABsOperation vmOp = new FlushTLABsOperation();<NEW_LINE>vmOp.enqueue();<NEW_LINE><MASK><NEW_LINE>Space edenSpace = heap.getYoungGeneration().getEden();<NEW_LINE>UnsignedWord youngChunkBytes = edenSpace.getChunkBytes();<NEW_LINE>UnsignedWord youngObjectBytes = edenSpace.computeObjectBytes();<NEW_LINE>UnsignedWord allocatedChunkBytes = accounting.getAllocatedChunkBytes().add(youngChunkBytes);<NEW_LINE>UnsignedWord allocatedObjectBytes = accounting.getAllocatedObjectBytes().add(youngObjectBytes);<NEW_LINE>log.string(prefix).string("CollectedTotalChunkBytes: ").signed(accounting.getCollectedTotalChunkBytes()).newline();<NEW_LINE>log.string(prefix).string("CollectedTotalObjectBytes: ").signed(accounting.getCollectedTotalObjectBytes()).newline();<NEW_LINE>log.string(prefix).string("AllocatedNormalChunkBytes: ").signed(allocatedChunkBytes).newline();<NEW_LINE>log.string(prefix).string("AllocatedNormalObjectBytes: ").signed(allocatedObjectBytes).newline();<NEW_LINE>long incrementalNanos = accounting.getIncrementalCollectionTotalNanos();<NEW_LINE>log.string(prefix).string("IncrementalGCCount: ").signed(accounting.getIncrementalCollectionCount()).newline();<NEW_LINE>log.string(prefix).string("IncrementalGCNanos: ").signed(incrementalNanos).newline();<NEW_LINE>long completeNanos = accounting.getCompleteCollectionTotalNanos();<NEW_LINE>log.string(prefix).string("CompleteGCCount: ").signed(accounting.getCompleteCollectionCount()).newline();<NEW_LINE>log.string(prefix).string("CompleteGCNanos: ").signed(completeNanos).newline();<NEW_LINE>long gcNanos = incrementalNanos + completeNanos;<NEW_LINE>long mutatorNanos = timers.mutator.getMeasuredNanos();<NEW_LINE>long totalNanos = gcNanos + mutatorNanos;<NEW_LINE>long roundedGCLoad = (0 < totalNanos ? TimeUtils.roundedDivide(100 * gcNanos, totalNanos) : 0);<NEW_LINE>log.string(prefix).string("GCNanos: ").signed(gcNanos).newline();<NEW_LINE>log.string(prefix).string("TotalNanos: ").signed(totalNanos).newline();<NEW_LINE>log.string(prefix).string("GCLoadPercent: ").signed(roundedGCLoad).newline();<NEW_LINE>} | HeapImpl heap = HeapImpl.getHeapImpl(); |
858,236 | public static boolean stbir_resize_uint16_generic(@NativeType("stbir_uint16 const *") ShortBuffer input_pixels, int input_w, int input_h, int input_stride_in_bytes, @NativeType("stbir_uint16 *") ShortBuffer output_pixels, int output_w, int output_h, int output_stride_in_bytes, int num_channels, int alpha_channel, int flags, @NativeType("stbir_edge") int edge_wrap_mode, @NativeType("stbir_filter") int filter, @NativeType("stbir_colorspace") int space) {<NEW_LINE>if (CHECKS) {<NEW_LINE>check(input_pixels, input_h * (input_stride_in_bytes == 0 ? input_w * num_channels : (input_stride_in_bytes >> 1)));<NEW_LINE>check(output_pixels, output_h * (output_stride_in_bytes == 0 ? output_w * num_channels : <MASK><NEW_LINE>}<NEW_LINE>return nstbir_resize_uint16_generic(memAddress(input_pixels), input_w, input_h, input_stride_in_bytes, memAddress(output_pixels), output_w, output_h, output_stride_in_bytes, num_channels, alpha_channel, flags, edge_wrap_mode, filter, space, NULL) != 0;<NEW_LINE>} | (output_stride_in_bytes >> 1))); |
116,233 | public void writeElement(XmlWriter writer) throws SAXException {<NEW_LINE>final AttributesImpl attributes = new AttributesImpl();<NEW_LINE>if ((getRelationship() != null) && !getRelationship().equals("")) {<NEW_LINE>attributes.addAttribute("", "rel", null, "xs:token", getRelationship());<NEW_LINE>}<NEW_LINE>if ((getReverseRelationship() != null) && !getReverseRelationship().equals("")) {<NEW_LINE>attributes.addAttribute("", "rev", null, "xs:token", getReverseRelationship());<NEW_LINE>}<NEW_LINE>if ((getResourceType() != null) && (getResourceType().toString() != null)) {<NEW_LINE>attributes.addAttribute("", "resource_type", null, "xs:anyURI", getResourceType().toString());<NEW_LINE>}<NEW_LINE>if (getDocumentations().isEmpty()) {<NEW_LINE>writer.emptyElement(APP_NAMESPACE, "link", null, attributes);<NEW_LINE>} else {<NEW_LINE>writer.startElement(APP_NAMESPACE, "link", null, attributes);<NEW_LINE>for (final DocumentationInfo documentationInfo : getDocumentations()) {<NEW_LINE>documentationInfo.writeElement(writer);<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>} | writer.endElement(APP_NAMESPACE, "link"); |
285,372 | private static void addHostTransportPortToConnectorList(String host, String transport, String port) throws UnknownHostException {<NEW_LINE>if (c_logger.isTraceEntryExitEnabled()) {<NEW_LINE>c_logger.traceEntry(null, "addHostTransportPortToConnectorList", host, transport, port);<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>if (port == null || port.length() <= 0) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>Integer portInt = Integer.decode(port);<NEW_LINE>synchronized (sipConnectorEndpoint) {<NEW_LINE>InetAddress iaHost = normlizeHost(host);<NEW_LINE>Map<String, HashSet<Integer>> transports = sipConnectorEndpoint.get(iaHost);<NEW_LINE>if (transports == null) {<NEW_LINE>transports = new HashMap<String<MASK><NEW_LINE>sipConnectorEndpoint.put(iaHost, transports);<NEW_LINE>}<NEW_LINE>HashSet<Integer> ports = transports.get(transport);<NEW_LINE>if (ports == null) {<NEW_LINE>ports = new HashSet<Integer>();<NEW_LINE>transports.put(transport, ports);<NEW_LINE>}<NEW_LINE>ports.add(portInt);<NEW_LINE>}<NEW_LINE>} finally {<NEW_LINE>if (c_logger.isTraceEntryExitEnabled()) {<NEW_LINE>c_logger.traceExit(null, "addHostTransportPortToConnectorList");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | , HashSet<Integer>>(); |
1,671,308 | /* (non-Javadoc)<NEW_LINE>* @see org.netbeans.modules.web.beans.navigation.actions.ModelActionStrategy#isApplicable(org.netbeans.modules.web.beans.api.model.WebBeansModel, java.lang.Object[])<NEW_LINE>*/<NEW_LINE>@Override<NEW_LINE>public boolean isApplicable(WebBeansModel model, Object[] context) {<NEW_LINE>final Object handle = context[0];<NEW_LINE>if (handle == null) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>Element element = ((ElementHandle<?>) handle).<MASK><NEW_LINE>ExecutableElement method = null;<NEW_LINE>if (element instanceof ExecutableElement) {<NEW_LINE>method = (ExecutableElement) element;<NEW_LINE>} else {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>if (context[2] == InspectActionId.METHOD_CONTEXT && model.getObserverParameter(method) == null) {<NEW_LINE>StatusDisplayer.getDefault().setStatusText(// NOI18N<NEW_LINE>NbBundle.// NOI18N<NEW_LINE>getMessage(// NOI18N<NEW_LINE>GoToInjectableAtCaretAction.class, "LBL_NotObserverContext"), StatusDisplayer.IMPORTANCE_ERROR_HIGHLIGHT);<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>} | resolve(model.getCompilationController()); |
1,181,711 | private RFuture<ScanResult<Object>> distributedScanIteratorAsync(String iteratorName, int count) {<NEW_LINE>return commandExecutor.evalWriteAsync(getRawName(), codec, EVAL_LIST_SCAN, "local start_index = redis.call('get', KEYS[2]); " + "if start_index ~= false then " + "start_index = tonumber(start_index); " + "else " + "start_index = 0;" + "end;" + "if start_index == -1 then " + "return {0, {}}; " + "end;" + "local end_index = start_index + ARGV[1];" + "local result; " + "result = redis.call('lrange', KEYS[1], start_index, end_index - 1); " + "if end_index > redis.call('llen', KEYS[1]) then " + "end_index = -1;" + "end; " + "redis.call('setex', KEYS[2], 3600, end_index);" + "return {end_index, result};", Arrays.<Object>asList(getRawName<MASK><NEW_LINE>} | (), iteratorName), count); |
1,845,269 | final BatchGetImageResult executeBatchGetImage(BatchGetImageRequest batchGetImageRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(batchGetImageRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<BatchGetImageRequest> request = null;<NEW_LINE>Response<BatchGetImageResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new BatchGetImageRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(batchGetImageRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "ECR");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "BatchGetImage");<NEW_LINE>request.<MASK><NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<BatchGetImageResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new BatchGetImageResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig); |
1,352,112 | public Result uploadFile(Http.Request request, Long petId) throws Exception {<NEW_LINE>String[] valueadditionalMetadata = request.body().asMultipartFormData().asFormUrlEncoded().get("additionalMetadata");<NEW_LINE>String additionalMetadata;<NEW_LINE>if (valueadditionalMetadata != null) {<NEW_LINE>additionalMetadata = valueadditionalMetadata[0];<NEW_LINE>} else {<NEW_LINE>additionalMetadata = null;<NEW_LINE>}<NEW_LINE>Http.MultipartFormData<TemporaryFile> body_file = request.body().asMultipartFormData();<NEW_LINE>Http.MultipartFormData.FilePart<TemporaryFile> _file = body_file.getFile("file");<NEW_LINE>if (!securityAPIUtils.isRequestTokenValid(request, "petstore_auth")) {<NEW_LINE>return unauthorized();<NEW_LINE>}<NEW_LINE>ModelApiResponse obj = imp.uploadFile(<MASK><NEW_LINE>if (configuration.getBoolean("useOutputBeanValidation")) {<NEW_LINE>OpenAPIUtils.validate(obj);<NEW_LINE>}<NEW_LINE>JsonNode result = mapper.valueToTree(obj);<NEW_LINE>return ok(result);<NEW_LINE>} | request, petId, additionalMetadata, _file); |
1,548,839 | public void process(GrayF32 derivX, GrayF32 derivY, GrayF32 intensity) {<NEW_LINE>InputSanityCheck.checkSameShape(derivX, derivY);<NEW_LINE>intensity.reshape(derivX.width, derivX.height);<NEW_LINE>int w = derivX.width;<NEW_LINE>int h = derivX.height;<NEW_LINE>horizXX.reshape(w, h);<NEW_LINE>horizXY.reshape(w, h);<NEW_LINE>horizYY.reshape(w, h);<NEW_LINE>temp.reshape(w, h);<NEW_LINE>intensity.reshape(w, h);<NEW_LINE>// CONCURRENT_BELOW BoofConcurrency.loopFor(0,h,y->{<NEW_LINE>for (int y = 0; y < h; y++) {<NEW_LINE>int indexX = derivX.startIndex + derivX.stride * y;<NEW_LINE>int indexY = derivY.startIndex + derivY.stride * y;<NEW_LINE>int index = horizXX.stride * y;<NEW_LINE>for (int x = 0; x < w; x++, index++) {<NEW_LINE>float dx = derivX.data[indexX++];<NEW_LINE>float dy = derivY.data[indexY++];<NEW_LINE>horizXX.data[index] = dx * dx;<NEW_LINE>horizXY.data[index] = dx * dy;<NEW_LINE>horizYY.data[index] = dy * dy;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// CONCURRENT_ABOVE });<NEW_LINE>// apply the the Gaussian weights<NEW_LINE>blur(horizXX, temp);<NEW_LINE>blur(horizXY, temp);<NEW_LINE>blur(horizYY, temp);<NEW_LINE>// CONCURRENT_BELOW BoofConcurrency.loopFor(0,h,y->{<NEW_LINE>for (int y = 0; y < h; y++) {<NEW_LINE>int index = horizXX.stride * y;<NEW_LINE>for (int x = 0; x < w; x++, index++) {<NEW_LINE>float totalXX = horizXX.data[index];<NEW_LINE>float totalXY = horizXY.data[index];<NEW_LINE>float totalYY = horizYY.data[index];<NEW_LINE>intensity.data[index] = this.intensity.<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>// CONCURRENT_ABOVE });<NEW_LINE>} | compute(totalXX, totalXY, totalYY); |
1,612,708 | final PutRecordResult executePutRecord(PutRecordRequest putRecordRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(putRecordRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<PutRecordRequest> request = null;<NEW_LINE>Response<PutRecordResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new PutRecordRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(putRecordRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "Kinesis");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "PutRecord");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<PutRecordResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new PutRecordResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>} | endClientExecution(awsRequestMetrics, request, response); |
622,640 | void draw(Graphics g) {<NEW_LINE>int hs = 12;<NEW_LINE>setBbox(point1, point2, hs);<NEW_LINE>// draw first lead and plate<NEW_LINE>setVoltageColor(g, volts[0]);<NEW_LINE>drawThickLine(g, point1, lead1);<NEW_LINE>setPowerColor(g, false);<NEW_LINE>drawThickLine(g, plate1[0], plate1[1]);<NEW_LINE>if (sim.powerCheckItem.getState())<NEW_LINE>g.setColor(Color.gray);<NEW_LINE>// draw second lead and plate<NEW_LINE>setVoltageColor(g, volts[1]);<NEW_LINE>drawThickLine(g, point2, lead2);<NEW_LINE>setPowerColor(g, false);<NEW_LINE>if (platePoints == null)<NEW_LINE>drawThickLine(g, plate2[0], plate2[1]);<NEW_LINE>else {<NEW_LINE>int i;<NEW_LINE>for (i = 0; i != 7; i++) drawThickLine(g, platePoints[i], platePoints[i + 1]);<NEW_LINE>}<NEW_LINE>updateDotCount();<NEW_LINE>if (sim.dragElm != this) {<NEW_LINE>drawDots(g, point1, lead1, curcount);<NEW_LINE>drawDots(g<MASK><NEW_LINE>}<NEW_LINE>drawPosts(g);<NEW_LINE>if (sim.showValuesCheckItem.getState()) {<NEW_LINE>String s = getShortUnitText(capacitance, "F");<NEW_LINE>drawValues(g, s, hs);<NEW_LINE>}<NEW_LINE>} | , point2, lead2, -curcount); |
1,377,286 | public static BufferedImage generateTextImage(int w, int h, String text) {<NEW_LINE>BufferedImage img = new BufferedImage(w, h, BufferedImage.TYPE_3BYTE_BGR);<NEW_LINE>Graphics2D g = img.createGraphics();<NEW_LINE>g.setColor(Color.BLACK);<NEW_LINE>g.fillRect(0, 0, w, h);<NEW_LINE><MASK><NEW_LINE>try {<NEW_LINE>g.setFont(new Font(null, Font.PLAIN, 12));<NEW_LINE>FontMetrics fm = g.getFontMetrics();<NEW_LINE>int textWidth = fm.stringWidth(text);<NEW_LINE>int startx = (w - textWidth) / 2;<NEW_LINE>if (startx < 0)<NEW_LINE>startx = 0;<NEW_LINE>g.drawString(text, startx, h / 2);<NEW_LINE>} catch (Throwable e) {<NEW_LINE>s_logger.warn("Problem in generating text to thumnail image, return blank image");<NEW_LINE>}<NEW_LINE>return img;<NEW_LINE>} | g.setColor(Color.WHITE); |
1,788,172 | private void handleClientCoreMessage_TemplateChange(Message msg) {<NEW_LINE>SonicUtils.log(TAG, Log.INFO, "handleClientCoreMessage_TemplateChange wasLoadDataInvoked = " + wasLoadDataInvoked.get() + ",msg arg1 = " + msg.arg1);<NEW_LINE>if (wasLoadDataInvoked.get()) {<NEW_LINE>if (TEMPLATE_CHANGE_REFRESH == msg.arg1) {<NEW_LINE>String html = (String) msg.obj;<NEW_LINE>if (TextUtils.isEmpty(html)) {<NEW_LINE>SonicUtils.log(TAG, Log.INFO, "handleClientCoreMessage_TemplateChange:load url with preload=2, webCallback is null? ->" + (null != diffDataCallback));<NEW_LINE>sessionClient.loadUrl(srcUrl, null);<NEW_LINE>} else {<NEW_LINE>SonicUtils.log(TAG, Log.INFO, "handleClientCoreMessage_TemplateChange:load data.");<NEW_LINE>sessionClient.loadDataWithBaseUrlAndHeader(srcUrl, html, "text/html", getCharsetFromHeaders(), srcUrl, getHeaders());<NEW_LINE>}<NEW_LINE>setResult(SONIC_RESULT_CODE_TEMPLATE_CHANGE, SONIC_RESULT_CODE_TEMPLATE_CHANGE, false);<NEW_LINE>} else {<NEW_LINE>SonicUtils.log(TAG, Log.INFO, "handleClientCoreMessage_TemplateChange:not refresh.");<NEW_LINE>setResult(SONIC_RESULT_CODE_TEMPLATE_CHANGE, SONIC_RESULT_CODE_HIT_CACHE, true);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>SonicUtils.log(TAG, Log.INFO, "handleClientCoreMessage_TemplateChange:oh yeah template change hit 304.");<NEW_LINE>if (msg.obj instanceof String) {<NEW_LINE>String html = (String) msg.obj;<NEW_LINE>sessionClient.loadDataWithBaseUrlAndHeader(srcUrl, html, "text/html", getCharsetFromHeaders(), srcUrl, getHeaders());<NEW_LINE><MASK><NEW_LINE>} else {<NEW_LINE>SonicUtils.log(TAG, Log.ERROR, "handleClientCoreMessage_TemplateChange error:call load url.");<NEW_LINE>sessionClient.loadUrl(srcUrl, null);<NEW_LINE>setResult(SONIC_RESULT_CODE_TEMPLATE_CHANGE, SONIC_RESULT_CODE_FIRST_LOAD, false);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>diffDataCallback = null;<NEW_LINE>mainHandler.removeMessages(CLIENT_MSG_ON_WEB_READY);<NEW_LINE>} | setResult(SONIC_RESULT_CODE_TEMPLATE_CHANGE, SONIC_RESULT_CODE_HIT_CACHE, false); |
1,662,086 | public void keyPressed(KeyEvent ev) {<NEW_LINE>if (!chatboxPanelManager.shouldTakeInput()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>switch(ev.getKeyCode()) {<NEW_LINE>case KeyEvent.VK_ENTER:<NEW_LINE>ev.consume();<NEW_LINE>if (index > -1) {<NEW_LINE>if (onItemSelected != null) {<NEW_LINE>onItemSelected.accept(results.keySet().toArray(new Integer[results.size()])[index]);<NEW_LINE>}<NEW_LINE>chatboxPanelManager.close();<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>case KeyEvent.VK_TAB:<NEW_LINE>case KeyEvent.VK_RIGHT:<NEW_LINE>ev.consume();<NEW_LINE>if (!results.isEmpty()) {<NEW_LINE>index++;<NEW_LINE>if (index >= results.size()) {<NEW_LINE>index = 0;<NEW_LINE>}<NEW_LINE>clientThread.invokeLater(this::update);<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>case KeyEvent.VK_LEFT:<NEW_LINE>ev.consume();<NEW_LINE>if (!results.isEmpty()) {<NEW_LINE>index--;<NEW_LINE>if (index < 0) {<NEW_LINE>index = results.size() - 1;<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>break;<NEW_LINE>case KeyEvent.VK_UP:<NEW_LINE>ev.consume();<NEW_LINE>if (results.size() >= (MAX_RESULTS / 2)) {<NEW_LINE>index -= MAX_RESULTS / 2;<NEW_LINE>if (index < 0) {<NEW_LINE>if (results.size() == MAX_RESULTS) {<NEW_LINE>index += results.size();<NEW_LINE>} else {<NEW_LINE>index += MAX_RESULTS;<NEW_LINE>}<NEW_LINE>index = Ints.constrainToRange(index, 0, results.size() - 1);<NEW_LINE>}<NEW_LINE>clientThread.invokeLater(this::update);<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>case KeyEvent.VK_DOWN:<NEW_LINE>ev.consume();<NEW_LINE>if (results.size() >= (MAX_RESULTS / 2)) {<NEW_LINE>index += MAX_RESULTS / 2;<NEW_LINE>if (index >= MAX_RESULTS) {<NEW_LINE>if (results.size() == MAX_RESULTS) {<NEW_LINE>index -= results.size();<NEW_LINE>} else {<NEW_LINE>index -= MAX_RESULTS;<NEW_LINE>}<NEW_LINE>index = Ints.constrainToRange(index, 0, results.size() - 1);<NEW_LINE>}<NEW_LINE>clientThread.invokeLater(this::update);<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>super.keyPressed(ev);<NEW_LINE>}<NEW_LINE>} | clientThread.invokeLater(this::update); |
1,372,924 | private String dumpCreationTraces(@Nonnull FileElement fileElement) {<NEW_LINE>final StringBuilder traces = new StringBuilder("\nNow " + Thread.currentThread() + "\n");<NEW_LINE>traces.append("My creation trace:\n")<MASK><NEW_LINE>traces.append("AST creation traces:\n");<NEW_LINE>fileElement.acceptTree(new RecursiveTreeElementWalkingVisitor(false) {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void visitComposite(CompositeElement composite) {<NEW_LINE>PsiElement psi = composite.getPsi();<NEW_LINE>if (psi != null) {<NEW_LINE>traces.append(psi).append("@").append(System.identityHashCode(psi)).append("\n");<NEW_LINE>String trace = psi.getUserData(CREATION_TRACE);<NEW_LINE>if (trace != null) {<NEW_LINE>traces.append(trace).append("\n");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>super.visitComposite(composite);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>return traces.toString();<NEW_LINE>} | .append(getUserData(CREATION_TRACE)); |
1,848,813 | private void applyPatch() throws IOException {<NEW_LINE>byte[] vanillaHash = new byte[64];<NEW_LINE>byte[] appliedPatchHash = new byte[64];<NEW_LINE>try (InputStream is = ClientLoader.class.getResourceAsStream("/client.serial")) {<NEW_LINE>if (is == null) {<NEW_LINE>SwingUtilities.invokeLater(() -> new FatalErrorDialog("The client-patch is missing from the classpath. If you are building " + "the client you need to re-run maven").addHelpButtons().addBuildingGuide().open());<NEW_LINE>throw new NullPointerException();<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>dis.readFully(vanillaHash);<NEW_LINE>dis.readFully(appliedPatchHash);<NEW_LINE>}<NEW_LINE>byte[] vanillaCacheHash = Files.asByteSource(VANILLA_CACHE).hash(Hashing.sha512()).asBytes();<NEW_LINE>if (!Arrays.equals(vanillaHash, vanillaCacheHash)) {<NEW_LINE>log.info("Client is outdated!");<NEW_LINE>updateCheckMode = VANILLA;<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (PATCHED_CACHE.exists()) {<NEW_LINE>byte[] diskBytes = Files.asByteSource(PATCHED_CACHE).hash(Hashing.sha512()).asBytes();<NEW_LINE>if (!Arrays.equals(diskBytes, appliedPatchHash)) {<NEW_LINE>log.warn("Cached patch hash mismatches, regenerating patch");<NEW_LINE>} else {<NEW_LINE>log.info("Using cached patched client");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>try (HashingOutputStream hos = new HashingOutputStream(Hashing.sha512(), new FileOutputStream(PATCHED_CACHE));<NEW_LINE>InputStream patch = ClientLoader.class.getResourceAsStream("/client.patch")) {<NEW_LINE>new FileByFileV1DeltaApplier().applyDelta(VANILLA_CACHE, patch, hos);<NEW_LINE>if (!Arrays.equals(hos.hash().asBytes(), appliedPatchHash)) {<NEW_LINE>log.error("Patched client hash mismatch");<NEW_LINE>updateCheckMode = VANILLA;<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>} catch (IOException e) {<NEW_LINE>log.error("Unable to apply patch despite hash matching", e);<NEW_LINE>updateCheckMode = VANILLA;<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>} | DataInputStream dis = new DataInputStream(is); |
519,137 | public Template visitRawBlock(final RawBlockContext ctx) {<NEW_LINE>level += 1;<NEW_LINE>SexprContext sexpr = ctx.sexpr();<NEW_LINE>Token nameStart = sexpr.QID().getSymbol();<NEW_LINE>String name = nameStart.getText();<NEW_LINE>qualifier.addLast(name);<NEW_LINE>String nameEnd = ctx.nameEnd.getText();<NEW_LINE>if (!name.equals(nameEnd)) {<NEW_LINE>reportError(null, ctx.nameEnd.getLine(), ctx.nameEnd.getCharPositionInLine(), String.format("found: '%s', expected: '%s'", nameEnd, name));<NEW_LINE>}<NEW_LINE>hasTag(true);<NEW_LINE>Block block = new Block(handlebars, name, false, "{{", params(sexpr.param()), hash(sexpr.hash()), Collections.emptyList());<NEW_LINE>if (block.paramSize > 0) {<NEW_LINE>paramStack.addLast(block.params.get(0).toString());<NEW_LINE>}<NEW_LINE>block.filename(source.filename());<NEW_LINE>block.position(nameStart.getLine(), nameStart.getCharPositionInLine());<NEW_LINE>String startDelim = ctx.start.getText();<NEW_LINE>startDelim = startDelim.substring(0, <MASK><NEW_LINE>block.startDelimiter(startDelim);<NEW_LINE>block.endDelimiter(ctx.stop.getText());<NEW_LINE>Template body = visitBody(ctx.thenBody);<NEW_LINE>if (body != null) {<NEW_LINE>// rewrite raw template<NEW_LINE>block.body(new Text(handlebars, body.text()));<NEW_LINE>}<NEW_LINE>hasTag(true);<NEW_LINE>qualifier.removeLast();<NEW_LINE>if (block.paramSize > 0) {<NEW_LINE>paramStack.removeLast();<NEW_LINE>}<NEW_LINE>level -= 1;<NEW_LINE>return block;<NEW_LINE>} | startDelim.length() - 2); |
7,239 | protected void paintComponent(Graphics g) {<NEW_LINE>Graphics2D g2D = (Graphics2D) g;<NEW_LINE>// center icon<NEW_LINE>m_icon.paintIcon(this, g2D, s_size.width / 2 - m_icon.getIconWidth() / 2, 5);<NEW_LINE>// Paint Text<NEW_LINE>Color color = getForeground();<NEW_LINE>g2D.setPaint(color);<NEW_LINE>Font font = getFont();<NEW_LINE>//<NEW_LINE>AttributedString aString = new AttributedString(m_name);<NEW_LINE>aString.addAttribute(TextAttribute.FONT, font);<NEW_LINE>aString.addAttribute(TextAttribute.FOREGROUND, color);<NEW_LINE>AttributedCharacterIterator iter = aString.getIterator();<NEW_LINE>//<NEW_LINE>LineBreakMeasurer measurer = new LineBreakMeasurer(iter, g2D.getFontRenderContext());<NEW_LINE>float width = s_size.width - m_icon.getIconWidth() - 2;<NEW_LINE>TextLayout layout = measurer.nextLayout(width);<NEW_LINE>// center text<NEW_LINE>float xPos = (float) (s_size.width / 2 - layout.getBounds().getWidth() / 2);<NEW_LINE>float yPos <MASK><NEW_LINE>//<NEW_LINE>layout.draw(g2D, xPos, yPos);<NEW_LINE>// 2 pt<NEW_LINE>width = s_size.width - 4;<NEW_LINE>while (measurer.getPosition() < iter.getEndIndex()) {<NEW_LINE>layout = measurer.nextLayout(width);<NEW_LINE>yPos += layout.getAscent() + layout.getDescent() + layout.getLeading();<NEW_LINE>layout.draw(g2D, xPos, yPos);<NEW_LINE>}<NEW_LINE>} | = m_icon.getIconHeight() + 20; |
1,234,966 | public String exportAsZip() {<NEW_LINE>File file = new <MASK><NEW_LINE>if (file == null) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>String zipPath = file.getAbsolutePath();<NEW_LINE>if (!file.getAbsolutePath().endsWith(".skl")) {<NEW_LINE>zipPath += ".skl";<NEW_LINE>}<NEW_LINE>if (new File(zipPath).exists()) {<NEW_LINE>if (!Sikulix.popAsk(String.format("Overwrite existing file?\n%s", zipPath), "Exporting packed SikuliX Script")) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>String pSource = _editingFile.getParent();<NEW_LINE>try {<NEW_LINE>writeSrcFile();<NEW_LINE>zipDir(pSource, zipPath, _editingFile.getName());<NEW_LINE>log(lvl, "Exported packed SikuliX Script to:\n%s", zipPath);<NEW_LINE>} catch (Exception ex) {<NEW_LINE>log(-1, "Exporting packed SikuliX Script did not work:\n%s", zipPath);<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>return zipPath;<NEW_LINE>} | SikulixFileChooser(sikuliIDE).export(); |
358,620 | ImmutableList<CToolchain.Builder> createCrosstools() {<NEW_LINE>// clang<NEW_LINE>CToolchain.Builder x86Clang = // Workaround for https://code.google.com/p/android/issues/detail?id=220159.<NEW_LINE>createBaseX86ClangToolchain("x86", "i686", "i686-linux-android").addCompilerFlag("-mstackrealign").setToolchainIdentifier("x86-clang" + clangVersion).setTargetCpu("x86").addAllToolPath(ndkPaths.createClangToolpaths("x86-4.9", "i686-linux-android", null)).setBuiltinSysroot(ndkPaths.createBuiltinSysroot("x86"));<NEW_LINE>stlImpl.addStlImpl(x86Clang, "4.9");<NEW_LINE>CToolchain.Builder x8664Clang = createBaseX86ClangToolchain("x86_64", "x86_64", "x86_64-linux-android").setToolchainIdentifier("x86_64-clang" + clangVersion).setTargetCpu("x86_64").addAllToolPath(ndkPaths.createClangToolpaths("x86_64-4.9", "x86_64-linux-android", null)).setBuiltinSysroot<MASK><NEW_LINE>stlImpl.addStlImpl(x8664Clang, "4.9");<NEW_LINE>return ImmutableList.of(x86Clang, x8664Clang);<NEW_LINE>} | (ndkPaths.createBuiltinSysroot("x86_64")); |
1,301,196 | private void methods(final Element element, ParserContext parserContext, final Map<String, Object> gatewayAttributes) {<NEW_LINE>List<Element> methodElements = DomUtils.getChildElementsByTagName(element, "method");<NEW_LINE>if (!CollectionUtils.isEmpty(methodElements)) {<NEW_LINE>Map<String, BeanDefinition> methodMetadataMap = new ManagedMap<>();<NEW_LINE>for (Element methodElement : methodElements) {<NEW_LINE>String methodName = methodElement.getAttribute(AbstractBeanDefinitionParser.NAME_ATTRIBUTE);<NEW_LINE>BeanDefinitionBuilder methodMetadataBuilder = BeanDefinitionBuilder.genericBeanDefinition(GatewayMethodMetadata.class);<NEW_LINE>methodMetadataBuilder.addPropertyValue("requestChannelName", methodElement.getAttribute("request-channel"));<NEW_LINE>methodMetadataBuilder.addPropertyValue("replyChannelName", methodElement.getAttribute("reply-channel"));<NEW_LINE>methodMetadataBuilder.addPropertyValue("requestTimeout", methodElement.getAttribute("request-timeout"));<NEW_LINE>methodMetadataBuilder.addPropertyValue("replyTimeout", methodElement.getAttribute("reply-timeout"));<NEW_LINE>boolean hasMapper = StringUtils.hasText(element.getAttribute("mapper"));<NEW_LINE>String payloadExpression = methodElement.getAttribute("payload-expression");<NEW_LINE>Assert.state(!hasMapper || !StringUtils<MASK><NEW_LINE>if (StringUtils.hasText(payloadExpression)) {<NEW_LINE>methodMetadataBuilder.addPropertyValue("payloadExpression", BeanDefinitionBuilder.genericBeanDefinition(ExpressionFactoryBean.class).addConstructorArgValue(payloadExpression).getBeanDefinition());<NEW_LINE>}<NEW_LINE>List<Element> invocationHeaders = DomUtils.getChildElementsByTagName(methodElement, "header");<NEW_LINE>if (!CollectionUtils.isEmpty(invocationHeaders)) {<NEW_LINE>Assert.state(!hasMapper, "header elements are not allowed when a 'mapper' is provided");<NEW_LINE>Map<String, Object> headerExpressions = new ManagedMap<>();<NEW_LINE>for (Element headerElement : invocationHeaders) {<NEW_LINE>BeanDefinition expressionDef = IntegrationNamespaceUtils.createExpressionDefinitionFromValueOrExpression("value", "expression", parserContext, headerElement, true);<NEW_LINE>headerExpressions.put(headerElement.getAttribute(AbstractBeanDefinitionParser.NAME_ATTRIBUTE), expressionDef);<NEW_LINE>}<NEW_LINE>methodMetadataBuilder.addPropertyValue("headerExpressions", headerExpressions);<NEW_LINE>}<NEW_LINE>methodMetadataMap.put(methodName, methodMetadataBuilder.getBeanDefinition());<NEW_LINE>}<NEW_LINE>gatewayAttributes.put("methods", methodMetadataMap);<NEW_LINE>}<NEW_LINE>} | .hasText(payloadExpression), "'payload-expression' is not allowed when a 'mapper' is provided"); |
1,782,654 | private void loadNode773() {<NEW_LINE>PropertyTypeNode node = new PropertyTypeNode(this.context, Identifiers.AuditHistoryUpdateEventType_ParameterDataTypeId, new QualifiedName(0, "ParameterDataTypeId"), new LocalizedText("en", "ParameterDataTypeId"), LocalizedText.NULL_VALUE, UInteger.valueOf(0), UInteger.valueOf(0), new DataValue(Variant.NULL_VALUE), Identifiers.NodeId, -1, new UInteger[] {}, UByte.valueOf(1), UByte.valueOf(1), 0.0, false);<NEW_LINE>node.addReference(new Reference(Identifiers.AuditHistoryUpdateEventType_ParameterDataTypeId, Identifiers.HasTypeDefinition, Identifiers.PropertyType.expanded(), true));<NEW_LINE>node.addReference(new Reference(Identifiers.AuditHistoryUpdateEventType_ParameterDataTypeId, Identifiers.HasModellingRule, Identifiers.ModellingRule_Mandatory.expanded(), true));<NEW_LINE>node.addReference(new Reference(Identifiers.AuditHistoryUpdateEventType_ParameterDataTypeId, Identifiers.HasProperty, Identifiers.AuditHistoryUpdateEventType.expanded(), false));<NEW_LINE><MASK><NEW_LINE>} | this.nodeManager.addNode(node); |
207,634 | public Bundle addAccount(AccountAuthenticatorResponse response, String accountType, String authTokenType, String[] requiredFeatures, Bundle options) {<NEW_LINE>Log_OC.i(TAG, "Adding account with type " + accountType + " and auth token " + authTokenType);<NEW_LINE>AccountManager accountManager = AccountManager.get(mContext);<NEW_LINE>Account[] accounts = accountManager.getAccountsByType(MainApp.getAccountType(mContext));<NEW_LINE>final Bundle bundle = new Bundle();<NEW_LINE>if (mContext.getResources().getBoolean(R.bool.multiaccount_support) || accounts.length < 1) {<NEW_LINE>try {<NEW_LINE>validateAccountType(accountType);<NEW_LINE>} catch (AuthenticatorException e) {<NEW_LINE>Log_OC.e(TAG, "Failed to validate account type " + accountType + ": " + e.getMessage(), e);<NEW_LINE>return e.getFailureBundle();<NEW_LINE>}<NEW_LINE>Intent intent = new Intent(mContext, AuthenticatorActivity.class);<NEW_LINE>intent.putExtra(AccountManager.KEY_ACCOUNT_AUTHENTICATOR_RESPONSE, response);<NEW_LINE><MASK><NEW_LINE>intent.putExtra(KEY_REQUIRED_FEATURES, requiredFeatures);<NEW_LINE>intent.putExtra(KEY_LOGIN_OPTIONS, options);<NEW_LINE>intent.putExtra(AuthenticatorActivity.EXTRA_ACTION, AuthenticatorActivity.ACTION_CREATE);<NEW_LINE>setIntentFlags(intent);<NEW_LINE>bundle.putParcelable(AccountManager.KEY_INTENT, intent);<NEW_LINE>} else {<NEW_LINE>// Return an error<NEW_LINE>bundle.putInt(AccountManager.KEY_ERROR_CODE, AccountManager.ERROR_CODE_UNSUPPORTED_OPERATION);<NEW_LINE>final String message = String.format(mContext.getString(R.string.auth_unsupported_multiaccount), mContext.getString(R.string.app_name));<NEW_LINE>bundle.putString(AccountManager.KEY_ERROR_MESSAGE, message);<NEW_LINE>mHandler.post(() -> Toast.makeText(mContext, message, Toast.LENGTH_SHORT).show());<NEW_LINE>}<NEW_LINE>return bundle;<NEW_LINE>} | intent.putExtra(KEY_AUTH_TOKEN_TYPE, authTokenType); |
1,433,472 | public void marshall(StaticImageActivateScheduleActionSettings staticImageActivateScheduleActionSettings, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (staticImageActivateScheduleActionSettings == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(staticImageActivateScheduleActionSettings.getDuration(), DURATION_BINDING);<NEW_LINE>protocolMarshaller.marshall(staticImageActivateScheduleActionSettings.getFadeIn(), FADEIN_BINDING);<NEW_LINE>protocolMarshaller.marshall(staticImageActivateScheduleActionSettings.getFadeOut(), FADEOUT_BINDING);<NEW_LINE>protocolMarshaller.marshall(staticImageActivateScheduleActionSettings.getHeight(), HEIGHT_BINDING);<NEW_LINE>protocolMarshaller.marshall(staticImageActivateScheduleActionSettings.getImage(), IMAGE_BINDING);<NEW_LINE>protocolMarshaller.marshall(staticImageActivateScheduleActionSettings.getImageX(), IMAGEX_BINDING);<NEW_LINE>protocolMarshaller.marshall(staticImageActivateScheduleActionSettings.getImageY(), IMAGEY_BINDING);<NEW_LINE>protocolMarshaller.marshall(staticImageActivateScheduleActionSettings.getLayer(), LAYER_BINDING);<NEW_LINE>protocolMarshaller.marshall(staticImageActivateScheduleActionSettings.getOpacity(), OPACITY_BINDING);<NEW_LINE>protocolMarshaller.marshall(staticImageActivateScheduleActionSettings.getWidth(), WIDTH_BINDING);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + <MASK><NEW_LINE>}<NEW_LINE>} | e.getMessage(), e); |
1,792,587 | public void read(org.apache.thrift.protocol.TProtocol prot, getTableConfiguration_args struct) throws org.apache.thrift.TException {<NEW_LINE>org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot;<NEW_LINE>java.util.BitSet incoming = iprot.readBitSet(3);<NEW_LINE>if (incoming.get(0)) {<NEW_LINE>struct.tinfo = new org.apache.accumulo.core.trace.thrift.TInfo();<NEW_LINE>struct.tinfo.read(iprot);<NEW_LINE>struct.setTinfoIsSet(true);<NEW_LINE>}<NEW_LINE>if (incoming.get(1)) {<NEW_LINE>struct.credentials = new org.apache.accumulo.core.securityImpl.thrift.TCredentials();<NEW_LINE><MASK><NEW_LINE>struct.setCredentialsIsSet(true);<NEW_LINE>}<NEW_LINE>if (incoming.get(2)) {<NEW_LINE>struct.tableName = iprot.readString();<NEW_LINE>struct.setTableNameIsSet(true);<NEW_LINE>}<NEW_LINE>} | struct.credentials.read(iprot); |
1,387,173 | private void loadNode787() {<NEW_LINE>TransitionVariableTypeNode node = new TransitionVariableTypeNode(this.context, Identifiers.StateMachineType_LastTransition, new QualifiedName(0, "LastTransition"), new LocalizedText("en", "LastTransition"), LocalizedText.NULL_VALUE, UInteger.valueOf(0), UInteger.valueOf(0), new DataValue(Variant.NULL_VALUE), Identifiers.LocalizedText, -1, new UInteger[] {}, UByte.valueOf(1), UByte.valueOf(1), 0.0, false);<NEW_LINE>node.addReference(new Reference(Identifiers.StateMachineType_LastTransition, Identifiers.HasProperty, Identifiers.StateMachineType_LastTransition_Id.expanded(), true));<NEW_LINE>node.addReference(new Reference(Identifiers.StateMachineType_LastTransition, Identifiers.HasTypeDefinition, Identifiers.TransitionVariableType.expanded(), true));<NEW_LINE>node.addReference(new Reference(Identifiers.StateMachineType_LastTransition, Identifiers.HasModellingRule, Identifiers.ModellingRule_Optional.expanded(), true));<NEW_LINE>node.addReference(new Reference(Identifiers.StateMachineType_LastTransition, Identifiers.HasComponent, Identifiers.StateMachineType.expanded(), false));<NEW_LINE><MASK><NEW_LINE>} | this.nodeManager.addNode(node); |
29,603 | public void handleMessage(SoapMessage message) throws Fault {<NEW_LINE>Exchange ex = message.getExchange();<NEW_LINE>BindingOperationInfo bop = ex.getBindingOperationInfo();<NEW_LINE>if (bop == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (bop.isUnwrapped()) {<NEW_LINE>bop = bop.getWrappedOperation();<NEW_LINE>}<NEW_LINE>boolean client = isRequestor(message);<NEW_LINE>BindingMessageInfo bmi = client ? bop.getInput() : bop.getOutput();<NEW_LINE>if (bmi == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>Boolean newAttachment = false;<NEW_LINE>Message exOutMsg = ex.getOutMessage();<NEW_LINE>if (exOutMsg != null) {<NEW_LINE>newAttachment = MessageUtils.isTrue(exOutMsg.getContextualProperty("cxf.add.attachments"));<NEW_LINE>LOG.log(Level.FINE, "Request context attachment property: cxf.add.attachments is set to: " + newAttachment);<NEW_LINE>}<NEW_LINE>SoapBodyInfo sbi = bmi.getExtensor(SoapBodyInfo.class);<NEW_LINE>if (sbi == null || sbi.getAttachments() == null || sbi.getAttachments().size() == 0) {<NEW_LINE>Service s = ex.getService();<NEW_LINE>DataBinding db = s.getDataBinding();<NEW_LINE>if (db instanceof JAXBDataBinding && hasSwaRef((JAXBDataBinding) db)) {<NEW_LINE>Boolean includeAttachs = false;<NEW_LINE><MASK><NEW_LINE>LOG.log(Level.FINE, "Exchange Input message: " + exInpMsg);<NEW_LINE>if (exInpMsg != null) {<NEW_LINE>includeAttachs = MessageUtils.isTrue(exInpMsg.getContextualProperty("cxf.add.attachments"));<NEW_LINE>}<NEW_LINE>LOG.log(Level.FINE, "Add attachments message property: cxf.add.attachments value is " + includeAttachs);<NEW_LINE>if (!skipHasSwaRef || includeAttachs || newAttachment) {<NEW_LINE>setupAttachmentOutput(message);<NEW_LINE>} else {<NEW_LINE>skipAttachmentOutput(message);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>processAttachments(message, sbi);<NEW_LINE>} | Message exInpMsg = ex.getInMessage(); |
839,426 | private void generateToString(IntrospectedTable introspectedTable, TopLevelClass topLevelClass) {<NEW_LINE>// $NON-NLS-1$<NEW_LINE>Method method = new Method("toString");<NEW_LINE>method.setVisibility(JavaVisibility.PUBLIC);<NEW_LINE>method.setReturnType(FullyQualifiedJavaType.getStringInstance());<NEW_LINE>// $NON-NLS-1$<NEW_LINE>method.addAnnotation("@Override");<NEW_LINE>if (introspectedTable.getTargetRuntime() == TargetRuntime.MYBATIS3_DSQL) {<NEW_LINE>context.getCommentGenerator().addGeneralMethodAnnotation(method, introspectedTable, topLevelClass.getImportedTypes());<NEW_LINE>} else {<NEW_LINE>context.getCommentGenerator(<MASK><NEW_LINE>}<NEW_LINE>// $NON-NLS-1$<NEW_LINE>method.addBodyLine("StringBuilder sb = new StringBuilder();");<NEW_LINE>// $NON-NLS-1$<NEW_LINE>method.addBodyLine("sb.append(getClass().getSimpleName());");<NEW_LINE>// $NON-NLS-1$<NEW_LINE>method.addBodyLine("sb.append(\" [\");");<NEW_LINE>// $NON-NLS-1$<NEW_LINE>method.addBodyLine("sb.append(\"Hash = \").append(hashCode());");<NEW_LINE>StringBuilder sb = new StringBuilder();<NEW_LINE>for (Field field : topLevelClass.getFields()) {<NEW_LINE>String property = field.getName();<NEW_LINE>sb.setLength(0);<NEW_LINE>// $NON-NLS-1$ //$NON-NLS-2$<NEW_LINE>// $NON-NLS-1$ //$NON-NLS-2$<NEW_LINE>sb.append("sb.append(\"").append(", ").append(property).append("=\")").append(".append(").// $NON-NLS-1$ //$NON-NLS-2$<NEW_LINE>append(// $NON-NLS-1$<NEW_LINE>property).// $NON-NLS-1$<NEW_LINE>append(");");<NEW_LINE>method.addBodyLine(sb.toString());<NEW_LINE>}<NEW_LINE>// $NON-NLS-1$<NEW_LINE>method.addBodyLine("sb.append(\"]\");");<NEW_LINE>if (useToStringFromRoot && topLevelClass.getSuperClass().isPresent()) {<NEW_LINE>// $NON-NLS-1$<NEW_LINE>method.addBodyLine("sb.append(\", from super class \");");<NEW_LINE>// $NON-NLS-1$<NEW_LINE>method.addBodyLine("sb.append(super.toString());");<NEW_LINE>}<NEW_LINE>// $NON-NLS-1$<NEW_LINE>method.addBodyLine("return sb.toString();");<NEW_LINE>topLevelClass.addMethod(method);<NEW_LINE>} | ).addGeneralMethodComment(method, introspectedTable); |
1,215,042 | final DeleteDomainResult executeDeleteDomain(DeleteDomainRequest deleteDomainRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(deleteDomainRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DeleteDomainRequest> request = null;<NEW_LINE>Response<DeleteDomainResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DeleteDomainRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(deleteDomainRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "codeartifact");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DeleteDomain");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DeleteDomainResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DeleteDomainResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>} | endClientExecution(awsRequestMetrics, request, response); |
925,940 | protected void performLiquibaseTask(Liquibase liquibase) throws LiquibaseException {<NEW_LINE>//<NEW_LINE>// Check the Pro license<NEW_LINE>//<NEW_LINE>boolean hasProLicense = MavenUtils.checkProLicense(<MASK><NEW_LINE>if (!hasProLicense) {<NEW_LINE>throw new LiquibaseException("The 'rollbackOneUpdateSQL' command requires a valid Liquibase Pro license. Get a free Pro license key at https://liquibase.com/protrial and add liquibase.pro.licenseKey=<yourKey> into your defaults file or use --pro-license-key=<yourKey> before your command in the CLI.");<NEW_LINE>}<NEW_LINE>Database database = liquibase.getDatabase();<NEW_LINE>CommandScope liquibaseCommand = new CommandScope("internalRollbackOneUpdateSQL");<NEW_LINE>Map<String, Object> argsMap = getCommandArgsObjectMap(liquibase);<NEW_LINE>Writer outputWriter = null;<NEW_LINE>try {<NEW_LINE>outputWriter = createOutputWriter();<NEW_LINE>argsMap.put("outputWriter", outputWriter);<NEW_LINE>} catch (IOException ioe) {<NEW_LINE>throw new LiquibaseException("Error executing rollbackOneChangeSetSQL. Unable to create output writer.", ioe);<NEW_LINE>}<NEW_LINE>ChangeLogParameters clp = new ChangeLogParameters(database);<NEW_LINE>argsMap.put("changeLogParameters", clp);<NEW_LINE>if (force != null && !Boolean.parseBoolean(force)) {<NEW_LINE>throw new LiquibaseException("Invalid value for --force. You must specify 'liquibase.force=true' to use rollbackOneUpdateSQL.");<NEW_LINE>}<NEW_LINE>argsMap.put("force", Boolean.TRUE);<NEW_LINE>argsMap.put("liquibase", liquibase);<NEW_LINE>for (Map.Entry<String, Object> entry : argsMap.entrySet()) {<NEW_LINE>liquibaseCommand.addArgumentValue(entry.getKey(), entry.getValue());<NEW_LINE>}<NEW_LINE>liquibaseCommand.execute();<NEW_LINE>} | liquibaseProLicenseKey, commandName, getLog()); |
1,763,627 | private void assembleAudit(AuditEvent event) {<NEW_LINE>auditBuffer.append(event.queryId).append("\t");<NEW_LINE>auditBuffer.append(longToTimeString(event.timestamp)).append("\t");<NEW_LINE>auditBuffer.append(event.clientIp).append("\t");<NEW_LINE>auditBuffer.append(event.user).append("\t");<NEW_LINE>auditBuffer.append(event.db).append("\t");<NEW_LINE>auditBuffer.append(event.state).append("\t");<NEW_LINE>auditBuffer.append(event.queryTime).append("\t");<NEW_LINE>auditBuffer.append(event.scanBytes).append("\t");<NEW_LINE>auditBuffer.append(event.scanRows).append("\t");<NEW_LINE>auditBuffer.append(event.returnRows).append("\t");<NEW_LINE>auditBuffer.append(event<MASK><NEW_LINE>auditBuffer.append(event.isQuery ? 1 : 0).append("\t");<NEW_LINE>auditBuffer.append(event.feIp).append("\t");<NEW_LINE>auditBuffer.append(event.cpuTimeMs).append("\t");<NEW_LINE>auditBuffer.append(event.sqlHash).append("\t");<NEW_LINE>auditBuffer.append(event.sqlDigest).append("\t");<NEW_LINE>auditBuffer.append(event.peakMemoryBytes).append("\t");<NEW_LINE>// trim the query to avoid too long<NEW_LINE>// use `getBytes().length` to get real byte length<NEW_LINE>String stmt = truncateByBytes(event.stmt).replace("\n", " ").replace("\t", " ");<NEW_LINE>LOG.debug("receive audit event with stmt: {}", stmt);<NEW_LINE>auditBuffer.append(stmt).append("\n");<NEW_LINE>} | .stmtId).append("\t"); |
1,535,517 | // change all occurrences of oldSubString to newSubString<NEW_LINE>public static String changeString(String inString, String oldSubString, String newSubString) {<NEW_LINE>if (oldSubString.trim().equals(""))<NEW_LINE>return inString;<NEW_LINE>int start = 0;<NEW_LINE>int end = 0;<NEW_LINE>StringBuffer changedString = new StringBuffer("");<NEW_LINE>end = inString.indexOf(oldSubString, start);<NEW_LINE>while (end != -1) {<NEW_LINE>// add substring before oldSubString and append newSubString<NEW_LINE>changedString.append(inString.substring(start, end) + newSubString);<NEW_LINE>// recompute starting index to end of changed substring<NEW_LINE>start = end + oldSubString.length();<NEW_LINE>// recompute end index<NEW_LINE>end = inString.indexOf(oldSubString, start);<NEW_LINE>}<NEW_LINE>// append remainder of the String, if any<NEW_LINE>changedString.append<MASK><NEW_LINE>return changedString.toString();<NEW_LINE>} | (inString.substring(start)); |
1,647,881 | protected void addGuiElements() {<NEW_LINE>super.addGuiElements();<NEW_LINE>addRenderableWidget(new GuiSecurityTab(this, robit, 120));<NEW_LINE>addRenderableWidget(GuiSideHolder.create(this, 176, 6, 106, false, false, SpecialColors.TAB_ROBIT_MENU));<NEW_LINE>addRenderableWidget(new MekanismImageButton(this, 179, 10, 18, getButtonLocation("main"), () -> Mekanism.packetHandler().sendToServer(new PacketGuiButtonPress(ClickedEntityButton.ROBIT_MAIN, robit)), getOnHover(MekanismLang.ROBIT)));<NEW_LINE>addRenderableWidget(new MekanismImageButton(this, 179, 30, 18, getButtonLocation("crafting"), () -> {<NEW_LINE>if (shouldOpenGui(RobitGuiType.CRAFTING)) {<NEW_LINE>Mekanism.packetHandler().sendToServer(new PacketGuiButtonPress(ClickedEntityButton.ROBIT_CRAFTING, robit));<NEW_LINE>}<NEW_LINE>}, getOnHover(MekanismLang.ROBIT_CRAFTING)));<NEW_LINE>addRenderableWidget(new MekanismImageButton(this, 179, 50, 18, getButtonLocation("inventory"), () -> {<NEW_LINE>if (shouldOpenGui(RobitGuiType.INVENTORY)) {<NEW_LINE>Mekanism.packetHandler().sendToServer(new PacketGuiButtonPress<MASK><NEW_LINE>}<NEW_LINE>}, getOnHover(MekanismLang.ROBIT_INVENTORY)));<NEW_LINE>addRenderableWidget(new MekanismImageButton(this, 179, 70, 18, getButtonLocation("smelting"), () -> {<NEW_LINE>if (shouldOpenGui(RobitGuiType.SMELTING)) {<NEW_LINE>Mekanism.packetHandler().sendToServer(new PacketGuiButtonPress(ClickedEntityButton.ROBIT_SMELTING, robit));<NEW_LINE>}<NEW_LINE>}, getOnHover(MekanismLang.ROBIT_SMELTING)));<NEW_LINE>addRenderableWidget(new MekanismImageButton(this, 179, 90, 18, getButtonLocation("repair"), () -> {<NEW_LINE>if (shouldOpenGui(RobitGuiType.REPAIR)) {<NEW_LINE>Mekanism.packetHandler().sendToServer(new PacketGuiButtonPress(ClickedEntityButton.ROBIT_REPAIR, robit));<NEW_LINE>}<NEW_LINE>}, getOnHover(MekanismLang.ROBIT_REPAIR)));<NEW_LINE>} | (ClickedEntityButton.ROBIT_INVENTORY, robit)); |
1,607,054 | private void startElasticsearchProcess(Path distroArtifact) {<NEW_LINE>logger.info("Running `bin/elasticsearch` in `{}` for {}", workingDir, this);<NEW_LINE>final ProcessBuilder processBuilder = new ProcessBuilder();<NEW_LINE>if (OperatingSystem.current().isWindows()) {<NEW_LINE>processBuilder.command("cmd", "/c", distroArtifact.resolve("\\bin\\elasticsearch.bat").toAbsolutePath().toString());<NEW_LINE>} else {<NEW_LINE>processBuilder.command(distroArtifact.resolve("bin/elasticsearch").toAbsolutePath().toString());<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>processBuilder.directory(workingDir.toFile());<NEW_LINE>Map<String, String> environment = processBuilder.environment();<NEW_LINE>// Don't inherit anything from the environment for as that would lack reproductability<NEW_LINE>environment.clear();<NEW_LINE>environment.put("JAVA_HOME", getJavaHome().getAbsolutePath());<NEW_LINE>environment.put("ES_PATH_CONF", configFile.getParent().toAbsolutePath().toString());<NEW_LINE><MASK><NEW_LINE>// don't buffer all in memory, make sure we don't block on the default pipes<NEW_LINE>processBuilder.redirectError(ProcessBuilder.Redirect.appendTo(esStderrFile.toFile()));<NEW_LINE>processBuilder.redirectOutput(ProcessBuilder.Redirect.appendTo(esStdoutFile.toFile()));<NEW_LINE>esProcess = processBuilder.start();<NEW_LINE>} catch (IOException e) {<NEW_LINE>throw new TestClustersException("Failed to start ES process for " + this, e);<NEW_LINE>}<NEW_LINE>} | environment.put("ES_JAVA_OPTIONS", "-Xms512m -Xmx512m"); |
1,020,194 | private static List<Artifact> collect(ActionExecutionContext actionExecutionContext, Set<Artifact> includes, List<PathFragment> absoluteBuiltInIncludeDirs) throws ExecException {<NEW_LINE>// Collect inputs and output<NEW_LINE>List<Artifact> inputs = new ArrayList<>(includes.size());<NEW_LINE>for (Artifact included : includes) {<NEW_LINE>// Check for absolute includes -- we assign the file system root as<NEW_LINE>// the root path for such includes<NEW_LINE>if (included.getRoot().getRoot().isAbsolute()) {<NEW_LINE>if (FileSystemUtils.startsWithAny(actionExecutionContext.getInputPath(included).asFragment(), absoluteBuiltInIncludeDirs)) {<NEW_LINE>// Skip include files found in absolute include directories.<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>throw new UserExecException(createFailureDetail("illegal absolute path to include file: " + actionExecutionContext.getInputPath(included), Code.ILLEGAL_ABSOLUTE_PATH));<NEW_LINE>}<NEW_LINE>if (included.hasParent() && included.getParent().isTreeArtifact()) {<NEW_LINE>// Note that this means every file in the TreeArtifact becomes an input to the action, and<NEW_LINE>// we have spurious rebuilds if non-included files change.<NEW_LINE>Preconditions.checkArgument(<MASK><NEW_LINE>inputs.add(included.getParent());<NEW_LINE>} else {<NEW_LINE>inputs.add(included);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return inputs;<NEW_LINE>} | included instanceof TreeFileArtifact, "Not a TreeFileArtifact: %s", included); |
1,813,687 | private void writeBody(ByteBuffer buffer) {<NEW_LINE>byte nullVal = 0;<NEW_LINE>BufferUtil.writeWithLength(buffer, catalog, nullVal);<NEW_LINE>BufferUtil.writeWithLength(buffer, db, nullVal);<NEW_LINE>BufferUtil.writeWithLength(buffer, table, nullVal);<NEW_LINE>BufferUtil.writeWithLength(buffer, orgTable, nullVal);<NEW_LINE>BufferUtil.<MASK><NEW_LINE>BufferUtil.writeWithLength(buffer, orgName, nullVal);<NEW_LINE>buffer.put((byte) 0x0C);<NEW_LINE>BufferUtil.writeUB2(buffer, charsetIndex);<NEW_LINE>BufferUtil.writeUB4(buffer, length);<NEW_LINE>buffer.put((byte) (type & 0xff));<NEW_LINE>BufferUtil.writeUB2(buffer, flags);<NEW_LINE>buffer.put(decimals);<NEW_LINE>buffer.put((byte) 0x00);<NEW_LINE>buffer.put((byte) 0x00);<NEW_LINE>// buffer.position(buffer.position() + FILLER.length);<NEW_LINE>if (definition != null) {<NEW_LINE>BufferUtil.writeWithLength(buffer, definition);<NEW_LINE>}<NEW_LINE>} | writeWithLength(buffer, name, nullVal); |
1,054,942 | private void drawSplitItems(Canvas canvas, RotatedTileBox tileBox, List<GpxDisplayItem> items, DrawSettings settings) {<NEW_LINE>final <MASK><NEW_LINE>int r = (int) (12 * tileBox.getDensity());<NEW_LINE>paintTextIcon.setTextSize(r);<NEW_LINE>int dr = r * 3 / 2;<NEW_LINE>float px = -1;<NEW_LINE>float py = -1;<NEW_LINE>for (int k = 0; k < items.size(); k++) {<NEW_LINE>GpxDisplayItem i = items.get(k);<NEW_LINE>WptPt point = i.locationEnd;<NEW_LINE>if (point != null && point.lat >= latLonBounds.bottom && point.lat <= latLonBounds.top && point.lon >= latLonBounds.left && point.lon <= latLonBounds.right) {<NEW_LINE>float x = tileBox.getPixXFromLatLon(point.lat, point.lon);<NEW_LINE>float y = tileBox.getPixYFromLatLon(point.lat, point.lon);<NEW_LINE>if (px != -1 || py != -1) {<NEW_LINE>if (Math.abs(x - px) <= dr && Math.abs(y - py) <= dr) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>px = x;<NEW_LINE>py = y;<NEW_LINE>String name = i.splitName;<NEW_LINE>if (name != null) {<NEW_LINE>int ind = name.indexOf(' ');<NEW_LINE>if (ind > 0) {<NEW_LINE>name = name.substring(0, ind);<NEW_LINE>}<NEW_LINE>Rect bounds = new Rect();<NEW_LINE>paintTextIcon.getTextBounds(name, 0, name.length(), bounds);<NEW_LINE>float nameHalfWidth = bounds.width() / 2f;<NEW_LINE>float nameHalfHeight = bounds.height() / 2f;<NEW_LINE>float density = (float) Math.ceil(tileBox.getDensity());<NEW_LINE>RectF rect = new RectF(x - nameHalfWidth - 2 * density, y + nameHalfHeight + 3 * density, x + nameHalfWidth + 3 * density, y - nameHalfHeight - 2 * density);<NEW_LINE>canvas.drawRoundRect(rect, 0, 0, paintInnerRect);<NEW_LINE>canvas.drawRoundRect(rect, 0, 0, paintOuterRect);<NEW_LINE>canvas.drawText(name, x, y + nameHalfHeight, paintTextIcon);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | QuadRect latLonBounds = tileBox.getLatLonBounds(); |
373,777 | static public void main(String[] args) {<NEW_LINE>int[][] fm = new int[8][8];<NEW_LINE>if (args.length != 1) {<NEW_LINE>System.out.println("usage: java DCT <matrix-filename>");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>File f = new File(args[0]);<NEW_LINE>if (!f.canRead()) {<NEW_LINE>System.out.println("Error! can't open " + args[0] + " for reading");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>@SuppressWarnings("resource")<NEW_LINE>BufferedReader br = new BufferedReader(new FileReader(f));<NEW_LINE>for (int i = 0; i < 8; i++) {<NEW_LINE>String line = br.readLine();<NEW_LINE>StringTokenizer tok <MASK><NEW_LINE>if (tok.countTokens() != 8) {<NEW_LINE>System.out.println("Error! File format error: 8 tokens required!");<NEW_LINE>throw new IOException("Error");<NEW_LINE>}<NEW_LINE>for (int j = 0; j < 8; j++) {<NEW_LINE>String numstr = tok.nextToken();<NEW_LINE>int num = Integer.parseInt(numstr);<NEW_LINE>fm[i][j] = num;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>br.close();<NEW_LINE>} catch (FileNotFoundException e) {<NEW_LINE>System.out.println("Error! can't create FileReader for " + args[0]);<NEW_LINE>return;<NEW_LINE>} catch (IOException e) {<NEW_LINE>System.out.println("Error! during read of " + args[0]);<NEW_LINE>return;<NEW_LINE>} catch (NumberFormatException e) {<NEW_LINE>System.out.println("Error! NumberFormatExecption");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>DCT dct = new DCT(fm);<NEW_LINE>dct.transform();<NEW_LINE>dct.printout();<NEW_LINE>dct.inverse();<NEW_LINE>dct.printoutinv();<NEW_LINE>} | = new StringTokenizer(line, ", "); |
716,947 | @Override<NEW_LINE>public Component createUIComponent(@Nonnull Disposable uiDisposable) {<NEW_LINE>if (myRootComponent == null) {<NEW_LINE>Configurable firstConfigurable = children[0];<NEW_LINE>if (children.length == 1) {<NEW_LINE>myRootComponent = firstConfigurable.createUIComponent(uiDisposable);<NEW_LINE>} else {<NEW_LINE><MASK><NEW_LINE>for (Configurable configurable : children) {<NEW_LINE>Component uiComponent = configurable.createUIComponent(uiDisposable);<NEW_LINE>if (uiComponent == null) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>String displayName = configurable.getDisplayName();<NEW_LINE>if (StringUtil.isEmpty(displayName)) {<NEW_LINE>verticalLayout.add(uiComponent);<NEW_LINE>} else {<NEW_LINE>LabeledLayout labeledLayout = LabeledLayout.create(LocalizeValue.of(displayName));<NEW_LINE>labeledLayout.set(uiComponent);<NEW_LINE>verticalLayout.add(labeledLayout);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>myRootComponent = verticalLayout;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return myRootComponent;<NEW_LINE>} | VerticalLayout verticalLayout = VerticalLayout.create(); |
801,125 | public com.amazonaws.services.resourcegroupstaggingapi.model.InternalServiceException unmarshallFromContext(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>com.amazonaws.services.resourcegroupstaggingapi.model.InternalServiceException internalServiceException = new com.amazonaws.services.resourcegroupstaggingapi.model.InternalServiceException(null);<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE><MASK><NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return internalServiceException;<NEW_LINE>} | String currentParentElement = context.getCurrentParentElement(); |
1,463,706 | public boolean handler(ServerConfiguration conf, LBRDFlags flags) throws InterruptedException, BKException, IOException, ReplicationException.UnavailableException, ReplicationException.CompatibilityException, KeeperException {<NEW_LINE>boolean getter = flags.get;<NEW_LINE>boolean setter = false;<NEW_LINE>if (flags.set != DEFAULT) {<NEW_LINE>setter = true;<NEW_LINE>}<NEW_LINE>if ((!getter && !setter) || (getter && setter)) {<NEW_LINE>LOG.error("One and only one of -get and -set must be specified");<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>ClientConfiguration adminConf = new ClientConfiguration(conf);<NEW_LINE>BookKeeperAdmin admin = new BookKeeperAdmin(adminConf);<NEW_LINE>try {<NEW_LINE>if (getter) {<NEW_LINE>int lostBookieRecoveryDelay = admin.getLostBookieRecoveryDelay();<NEW_LINE>LOG.info("LostBookieRecoveryDelay value in ZK: {}"<MASK><NEW_LINE>} else {<NEW_LINE>int lostBookieRecoveryDelay = flags.set;<NEW_LINE>admin.setLostBookieRecoveryDelay(lostBookieRecoveryDelay);<NEW_LINE>LOG.info("Successfully set LostBookieRecoveryDelay value in ZK: {}", String.valueOf(lostBookieRecoveryDelay));<NEW_LINE>}<NEW_LINE>} finally {<NEW_LINE>if (admin != null) {<NEW_LINE>admin.close();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>} | , String.valueOf(lostBookieRecoveryDelay)); |
915,099 | public static // }<NEW_LINE>BlockedTerm parse(JSONObject data, String streamLogin) {<NEW_LINE>String id = JSONUtil.getString(data, "id");<NEW_LINE>long createdAt = JSONUtil.getDatetime(data, "created_at", -1);<NEW_LINE>long updatedAt = JSONUtil.getDatetime(data, "updated_at", -1);<NEW_LINE>long expiresAt = JSONUtil.getDatetime(data, "expires_at", -1);<NEW_LINE>String text = JSONUtil.getString(data, "text");<NEW_LINE>String moderatorId = JSONUtil.getString(data, "moderator_id");<NEW_LINE>String streamId = JSONUtil.getString(data, "broadcaster_id");<NEW_LINE>if (!StringUtil.isNullOrEmpty(id, text, streamId)) {<NEW_LINE>return new BlockedTerm(id, createdAt, updatedAt, expiresAt, <MASK><NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>} | text, moderatorId, streamId, streamLogin); |
175,972 | public static DescribeNamespaceListResponse unmarshall(DescribeNamespaceListResponse describeNamespaceListResponse, UnmarshallerContext _ctx) {<NEW_LINE>describeNamespaceListResponse.setRequestId(_ctx.stringValue("DescribeNamespaceListResponse.RequestId"));<NEW_LINE>describeNamespaceListResponse.setCode(_ctx.stringValue("DescribeNamespaceListResponse.Code"));<NEW_LINE>describeNamespaceListResponse.setMessage(_ctx.stringValue("DescribeNamespaceListResponse.Message"));<NEW_LINE>describeNamespaceListResponse.setSuccess(_ctx.booleanValue("DescribeNamespaceListResponse.Success"));<NEW_LINE>describeNamespaceListResponse.setErrorCode(_ctx.stringValue("DescribeNamespaceListResponse.ErrorCode"));<NEW_LINE>describeNamespaceListResponse.setTraceId(_ctx.stringValue("DescribeNamespaceListResponse.TraceId"));<NEW_LINE>List<RegionList> data = new ArrayList<RegionList>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("DescribeNamespaceListResponse.Data.Length"); i++) {<NEW_LINE>RegionList regionList = new RegionList();<NEW_LINE>regionList.setNamespaceName(_ctx.stringValue("DescribeNamespaceListResponse.Data[" + i + "].NamespaceName"));<NEW_LINE>regionList.setNamespaceId(_ctx.stringValue("DescribeNamespaceListResponse.Data[" + i + "].NamespaceId"));<NEW_LINE>regionList.setAgentInstall(_ctx.stringValue("DescribeNamespaceListResponse.Data[" + i + "].AgentInstall"));<NEW_LINE>regionList.setCurrent(_ctx.booleanValue("DescribeNamespaceListResponse.Data[" + i + "].Current"));<NEW_LINE>regionList.setCustom(_ctx.booleanValue("DescribeNamespaceListResponse.Data[" + i + "].Custom"));<NEW_LINE>regionList.setRegionId(_ctx.stringValue("DescribeNamespaceListResponse.Data[" + i + "].RegionId"));<NEW_LINE>regionList.setHybridCloudEnable(_ctx.booleanValue("DescribeNamespaceListResponse.Data[" + i + "].HybridCloudEnable"));<NEW_LINE>regionList.setVpcId(_ctx.stringValue<MASK><NEW_LINE>regionList.setVSwitchId(_ctx.stringValue("DescribeNamespaceListResponse.Data[" + i + "].VSwitchId"));<NEW_LINE>regionList.setSecurityGroupId(_ctx.stringValue("DescribeNamespaceListResponse.Data[" + i + "].SecurityGroupId"));<NEW_LINE>data.add(regionList);<NEW_LINE>}<NEW_LINE>describeNamespaceListResponse.setData(data);<NEW_LINE>return describeNamespaceListResponse;<NEW_LINE>} | ("DescribeNamespaceListResponse.Data[" + i + "].VpcId")); |
32,529 | public byte[] assignUid(final String type, final String name) {<NEW_LINE>Tags.validateString(type, name);<NEW_LINE>if (type.toLowerCase().equals("metric")) {<NEW_LINE>try {<NEW_LINE>final byte[] uid = this.metrics.getId(name);<NEW_LINE>throw new IllegalArgumentException("Name already exists with UID: " <MASK><NEW_LINE>} catch (NoSuchUniqueName nsue) {<NEW_LINE>return this.metrics.getOrCreateId(name);<NEW_LINE>}<NEW_LINE>} else if (type.toLowerCase().equals("tagk")) {<NEW_LINE>try {<NEW_LINE>final byte[] uid = this.tag_names.getId(name);<NEW_LINE>throw new IllegalArgumentException("Name already exists with UID: " + UniqueId.uidToString(uid));<NEW_LINE>} catch (NoSuchUniqueName nsue) {<NEW_LINE>return this.tag_names.getOrCreateId(name);<NEW_LINE>}<NEW_LINE>} else if (type.toLowerCase().equals("tagv")) {<NEW_LINE>try {<NEW_LINE>final byte[] uid = this.tag_values.getId(name);<NEW_LINE>throw new IllegalArgumentException("Name already exists with UID: " + UniqueId.uidToString(uid));<NEW_LINE>} catch (NoSuchUniqueName nsue) {<NEW_LINE>return this.tag_values.getOrCreateId(name);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>LOG.warn("Unknown type name: " + type);<NEW_LINE>throw new IllegalArgumentException("Unknown type name");<NEW_LINE>}<NEW_LINE>} | + UniqueId.uidToString(uid)); |
157,290 | public FieldBinding addSyntheticFieldForEnumValues() {<NEW_LINE>if (!isPrototype())<NEW_LINE>throw new IllegalStateException();<NEW_LINE>if (this.synthetics == null)<NEW_LINE>this.synthetics = new Map[MAX_SYNTHETICS];<NEW_LINE>if (this.synthetics[SourceTypeBinding.FIELD_EMUL] == null)<NEW_LINE>this.synthetics[SourceTypeBinding.FIELD_EMUL] = new LinkedHashMap(5);<NEW_LINE>// $NON-NLS-1$<NEW_LINE>FieldBinding synthField = (FieldBinding) this.synthetics[SourceTypeBinding.FIELD_EMUL].get("enumConstantValues");<NEW_LINE>if (synthField == null) {<NEW_LINE>synthField = new SyntheticFieldBinding(TypeConstants.SYNTHETIC_ENUM_VALUES, this.scope.createArrayType(this, 1), ClassFileConstants.AccPrivate | ClassFileConstants.AccStatic | ClassFileConstants.AccSynthetic | ClassFileConstants.AccFinal, this, Constant.NotAConstant, this.synthetics[SourceTypeBinding.FIELD_EMUL].size());<NEW_LINE>// $NON-NLS-1$<NEW_LINE>this.synthetics[SourceTypeBinding.FIELD_EMUL].put("enumConstantValues", synthField);<NEW_LINE>}<NEW_LINE>// ensure there is not already such a field defined by the user<NEW_LINE>// ensure there is not already such a field defined by the user<NEW_LINE>boolean needRecheck;<NEW_LINE>int index = 0;<NEW_LINE>do {<NEW_LINE>needRecheck = false;<NEW_LINE>FieldBinding existingField;<NEW_LINE>if ((existingField = getField(synthField.name, true)) != null) {<NEW_LINE>TypeDeclaration typeDecl = this.scope.referenceContext;<NEW_LINE>FieldDeclaration[] fieldDeclarations = typeDecl.fields;<NEW_LINE>int max = fieldDeclarations <MASK><NEW_LINE>for (int i = 0; i < max; i++) {<NEW_LINE>FieldDeclaration fieldDecl = fieldDeclarations[i];<NEW_LINE>if (fieldDecl.binding == existingField) {<NEW_LINE>synthField.name = // $NON-NLS-1$<NEW_LINE>CharOperation.// $NON-NLS-1$<NEW_LINE>concat(// $NON-NLS-1$<NEW_LINE>TypeConstants.SYNTHETIC_ENUM_VALUES, ("_" + String.valueOf(index++)).toCharArray());<NEW_LINE>needRecheck = true;<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} while (needRecheck);<NEW_LINE>return synthField;<NEW_LINE>} | == null ? 0 : fieldDeclarations.length; |
62,407 | public boolean replacePushbuttonField(String field, PdfFormField button, int order) {<NEW_LINE>if (getFieldType(field) != FIELD_TYPE_PUSHBUTTON) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>Item item = getFieldItem(field);<NEW_LINE>if (order >= item.size()) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>PdfDictionary merged = item.getMerged(order);<NEW_LINE>PdfDictionary <MASK><NEW_LINE>PdfDictionary widgets = item.getWidget(order);<NEW_LINE>for (PdfName pdfName : buttonRemove) {<NEW_LINE>merged.remove(pdfName);<NEW_LINE>values.remove(pdfName);<NEW_LINE>widgets.remove(pdfName);<NEW_LINE>}<NEW_LINE>for (PdfName key : button.getKeys()) {<NEW_LINE>if (key.equals(PdfName.T) || key.equals(PdfName.RECT))<NEW_LINE>continue;<NEW_LINE>if (key.equals(PdfName.FF))<NEW_LINE>values.put(key, button.get(key));<NEW_LINE>else<NEW_LINE>widgets.put(key, button.get(key));<NEW_LINE>merged.put(key, button.get(key));<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>} | values = item.getValue(order); |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.