idx
int32
46
1.86M
input
stringlengths
321
6.6k
target
stringlengths
9
1.24k
1,209,438
public static List<List<Poker>> distributePoker() {<NEW_LINE>Collections.shuffle(basePokers);<NEW_LINE>List<List<Poker>> pokersList = new ArrayList<List<Poker>>();<NEW_LINE>List<Poker> pokers1 = new ArrayList<>(17);<NEW_LINE>pokers1.addAll(basePokers.subList(0, 17));<NEW_LINE>List<Poker> pokers2 = new ArrayList<>(17);<NEW_LINE>pokers2.addAll(basePokers.subList(17, 34));<NEW_LINE>List<Poker> pokers3 <MASK><NEW_LINE>pokers3.addAll(basePokers.subList(34, 51));<NEW_LINE>List<Poker> pokers4 = new ArrayList<>(3);<NEW_LINE>pokers4.addAll(basePokers.subList(51, 54));<NEW_LINE>pokersList.add(pokers1);<NEW_LINE>pokersList.add(pokers2);<NEW_LINE>pokersList.add(pokers3);<NEW_LINE>pokersList.add(pokers4);<NEW_LINE>for (List<Poker> pokers : pokersList) {<NEW_LINE>sortPoker(pokers);<NEW_LINE>}<NEW_LINE>return pokersList;<NEW_LINE>}
= new ArrayList<>(17);
1,006,819
public void loadDocument() {<NEW_LINE>// Only trigger the load process if constructing or file updated<NEW_LINE>final long modTime = _document.lastModified();<NEW_LINE>final boolean isStarted = getLifecycle().getCurrentState().isAtLeast(Lifecycle.State.STARTED);<NEW_LINE>if (!isStarted || modTime > _loadModTime) {<NEW_LINE>_loadModTime = modTime;<NEW_LINE>final String content = _document.loadContent(getContext());<NEW_LINE>if (!_document.isContentSame(_hlEditor.getText())) {<NEW_LINE>final int[] sel = StringUtils.getSelection(_hlEditor);<NEW_LINE>sel[0] = Math.min(sel[0<MASK><NEW_LINE>sel[1] = Math.min(sel[1], content.length());<NEW_LINE>_hlEditor.withAutoFormatDisabled(() -> _hlEditor.setText(content));<NEW_LINE>_hlEditor.setSelection(sel[0], sel[1]);<NEW_LINE>}<NEW_LINE>checkTextChangeState();<NEW_LINE>if (_isPreviewVisible) {<NEW_LINE>updateViewModeText();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
], content.length());
609,162
public CellSet execute() throws Exception {<NEW_LINE>try {<NEW_LINE>if (statement != null) {<NEW_LINE>statement.close();<NEW_LINE>statement = null;<NEW_LINE>}<NEW_LINE>if (scenario != null && query.getDimension(SCENARIO) != null) {<NEW_LINE>QueryDimension dimension = query.getDimension(SCENARIO);<NEW_LINE>moveDimension(dimension, Axis.FILTER);<NEW_LINE>Selection sel = dimension.createSelection(IdentifierParser.parseIdentifier("[Scenario].[" + getScenario().getId() + "]"));<NEW_LINE>if (!dimension.getInclusions().contains(sel)) {<NEW_LINE>dimension.getInclusions().add(sel);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>String mdx = getMdx();<NEW_LINE>log.trace("Executing query (" + this.getName() + ") :\n" + mdx);<NEW_LINE>final Catalog catalog = query.getCube().getSchema().getCatalog();<NEW_LINE>this.connection.setCatalog(catalog.getName());<NEW_LINE><MASK><NEW_LINE>this.statement = stmt;<NEW_LINE>CellSet cellSet = stmt.executeOlapQuery(mdx);<NEW_LINE>if (scenario != null && query.getDimension(SCENARIO) != null) {<NEW_LINE>QueryDimension dimension = query.getDimension(SCENARIO);<NEW_LINE>dimension.getInclusions().clear();<NEW_LINE>moveDimension(dimension, null);<NEW_LINE>}<NEW_LINE>return cellSet;<NEW_LINE>} finally {<NEW_LINE>if (this.statement != null) {<NEW_LINE>this.statement.close();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
OlapStatement stmt = connection.createStatement();
1,271,110
public static void partialReduceDoubleMultCarrierValue(double[] inputArray, double[] outputArray, int gidx, double value) {<NEW_LINE>int localIdx = PTXIntrinsics.get_local_id(0);<NEW_LINE>int localGroupSize = PTXIntrinsics.get_local_size(0);<NEW_LINE>int groupID = PTXIntrinsics.get_group_id(0);<NEW_LINE>double[] localArray = (double[]) NewArrayNode.newUninitializedArray(double.class, LOCAL_WORK_GROUP_SIZE);<NEW_LINE>localArray[localIdx] = value;<NEW_LINE>for (int stride = (localGroupSize / 2); stride > 0; stride /= 2) {<NEW_LINE>PTXIntrinsics.localBarrier();<NEW_LINE>if (localIdx < stride) {<NEW_LINE>localArray[localIdx] *= localArray[localIdx + stride];<NEW_LINE>}<NEW_LINE>}<NEW_LINE>PTXIntrinsics.globalBarrier();<NEW_LINE>if (localIdx == 0) {<NEW_LINE>outputArray[groupID <MASK><NEW_LINE>}<NEW_LINE>}
+ 1] = localArray[0];
795,110
public void exitRmsipnh_literal(Rmsipnh_literalContext ctx) {<NEW_LINE>// Incompatible with:<NEW_LINE>// - peer-address (TODO)<NEW_LINE>// - redist-unchanged (TODO)<NEW_LINE>// - unchanged<NEW_LINE>ImmutableList.Builder<Ip> nextHops = ImmutableList.builder();<NEW_LINE>RouteMapSetIpNextHop old = _currentRouteMapEntry.getSetIpNextHop();<NEW_LINE>if (old != null) {<NEW_LINE>if (!(old instanceof RouteMapSetIpNextHopLiteral)) {<NEW_LINE>warn(ctx, "Cannot mix literal next-hop IP(s) with peer-address, redist-unchanged, nor unchanged");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>nextHops.addAll(((RouteMapSetIpNextHopLiteral) old).getNextHops());<NEW_LINE>}<NEW_LINE>ctx.next_hops.stream().map(CiscoNxosControlPlaneExtractor::toIp).forEach(nextHops::add);<NEW_LINE>_currentRouteMapEntry.setSetIpNextHop(new RouteMapSetIpNextHopLiteral<MASK><NEW_LINE>}
(nextHops.build()));
1,011,284
public UpdateFrameworkResult unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>UpdateFrameworkResult updateFrameworkResult = new UpdateFrameworkResult();<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 updateFrameworkResult;<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("FrameworkName", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>updateFrameworkResult.setFrameworkName(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("FrameworkArn", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>updateFrameworkResult.setFrameworkArn(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("CreationTime", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>updateFrameworkResult.setCreationTime(DateJsonUnmarshallerFactory.getInstance("unixTimestamp").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 updateFrameworkResult;<NEW_LINE>}
int originalDepth = context.getCurrentDepth();
1,843,482
public Map<String, List<ImageOwnership>> handle(final ResultSet rs) throws SQLException {<NEW_LINE>if (!rs.next()) {<NEW_LINE>return Collections.emptyMap();<NEW_LINE>}<NEW_LINE>final Map<String, List<ImageOwnership>> imageTypeOwnershipMap = new HashMap<>();<NEW_LINE>do {<NEW_LINE>final String imageTypeName = rs.getString("name");<NEW_LINE>final int id = rs.getInt("id");<NEW_LINE>final String owner = rs.getString("owner");<NEW_LINE>final String role = rs.getString("role");<NEW_LINE>final String <MASK><NEW_LINE>final String createdBy = rs.getString("created_by");<NEW_LINE>final String modifiedOn = rs.getString("modified_on");<NEW_LINE>final String modifiedBy = rs.getString("modified_by");<NEW_LINE>final ImageOwnership imageOwnership = new ImageOwnership();<NEW_LINE>imageOwnership.setId(id);<NEW_LINE>imageOwnership.setName(imageTypeName);<NEW_LINE>imageOwnership.setOwner(owner);<NEW_LINE>imageOwnership.setRole(Role.valueOf(role));<NEW_LINE>imageOwnership.setCreatedOn(createdOn);<NEW_LINE>imageOwnership.setCreatedBy(createdBy);<NEW_LINE>imageOwnership.setModifiedOn(modifiedOn);<NEW_LINE>imageOwnership.setModifiedBy(modifiedBy);<NEW_LINE>if (imageTypeOwnershipMap.containsKey(imageTypeName)) {<NEW_LINE>imageTypeOwnershipMap.get(imageTypeName).add(imageOwnership);<NEW_LINE>} else {<NEW_LINE>final List<ImageOwnership> imageOwnerships = new ArrayList<>();<NEW_LINE>imageOwnerships.add(imageOwnership);<NEW_LINE>imageTypeOwnershipMap.put(imageTypeName, imageOwnerships);<NEW_LINE>}<NEW_LINE>} while (rs.next());<NEW_LINE>return imageTypeOwnershipMap;<NEW_LINE>}
createdOn = rs.getString("created_on");
1,622,575
final ListClassificationJobsResult executeListClassificationJobs(ListClassificationJobsRequest listClassificationJobsRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(listClassificationJobsRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<ListClassificationJobsRequest> request = null;<NEW_LINE>Response<ListClassificationJobsResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new ListClassificationJobsRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(listClassificationJobsRequest));<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.<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ListClassificationJobs");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<ListClassificationJobsResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new ListClassificationJobsResultJsonUnmarshaller());<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.SERVICE_ID, "Macie2");
1,599,594
void lookupContentSupport(final long file_size, final byte networks, final RelatedContentLookupListener listener) throws ContentException {<NEW_LINE>if (!enabled) {<NEW_LINE>throw (new ContentException("rcm is disabled"));<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>final byte[] key_bytes = ("az:rcm:size:assoc:" + file_size).getBytes("UTF-8");<NEW_LINE>// we need something to use<NEW_LINE>final byte[] from_hash = new SHA1Simple().calculateHash(key_bytes);<NEW_LINE>String op_str = "Content rel read: size=" + file_size;<NEW_LINE>lookupContentSupport0(from_hash, key_bytes, op_str, 0, networks, true, listener);<NEW_LINE>} catch (ContentException e) {<NEW_LINE>throw (e);<NEW_LINE>} catch (Throwable e) {<NEW_LINE>throw (<MASK><NEW_LINE>}<NEW_LINE>}
new ContentException("lookup failed", e));
953,921
private void decodeVariableInformation(BufferedReader reader) throws IOException {<NEW_LINE>if (reader == null) {<NEW_LINE>throw new IllegalArgumentException("decodeVariableInformation: reader == null!");<NEW_LINE>}<NEW_LINE>// step 1: variable type<NEW_LINE>int variableType = parseNumericField(reader);<NEW_LINE>variableTypelList.add(variableType);<NEW_LINE>isCurrentVariableString = (variableType > 0);<NEW_LINE>// step 2: variable name<NEW_LINE>String variableName = parseStringField(reader);<NEW_LINE>currentVariableName = variableName;<NEW_LINE>variableNameList.add(variableName);<NEW_LINE>variableTypeTable.put(variableName, variableType);<NEW_LINE>// step 3: format(print/write)<NEW_LINE>int[] printWriteFormatTable = new int[6];<NEW_LINE>for (int i = 0; i < 6; i++) {<NEW_LINE>printWriteFormatTable[i] = parseNumericField(reader);<NEW_LINE>}<NEW_LINE>int formatCode = printWriteFormatTable[0];<NEW_LINE>int formatWidth = printWriteFormatTable[1];<NEW_LINE>int formatDecimalPointPosition = printWriteFormatTable[2];<NEW_LINE>formatDecimalPointPositionList.add(formatDecimalPointPosition);<NEW_LINE>if (!SPSSConstants.FORMAT_CODE_TABLE_POR.containsKey(formatCode)) {<NEW_LINE>throw new IOException("Unknown format code was found = " + formatCode);<NEW_LINE>} else {<NEW_LINE>printFormatList.add(printWriteFormatTable[0]);<NEW_LINE>}<NEW_LINE>if (!SPSSConstants.ORDINARY_FORMAT_CODE_SET.contains(formatCode)) {<NEW_LINE>StringBuilder sb = new StringBuilder(SPSSConstants.FORMAT_CODE_TABLE_POR.get(formatCode) + formatWidth);<NEW_LINE>if (formatDecimalPointPosition > 0) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>printFormatNameTable.put(variableName, sb.toString());<NEW_LINE>}<NEW_LINE>printFormatTable.put(variableName, SPSSConstants.FORMAT_CODE_TABLE_POR.get(formatCode));<NEW_LINE>}
sb.append("." + formatDecimalPointPosition);
971,817
private void parserChildTable(SchemaInfo schemaInfo, final RouteResultset rrs, MySqlInsertStatement insertStmt, final ShardingService service, boolean isExplain) throws SQLNonTransientException {<NEW_LINE>final <MASK><NEW_LINE>String tableName = schemaInfo.getTable();<NEW_LINE>final ChildTableConfig tc = (ChildTableConfig) (schema.getTables().get(tableName));<NEW_LINE>if (isMultiInsert(insertStmt)) {<NEW_LINE>String msg = "ChildTable multi insert not provided";<NEW_LINE>LOGGER.info(msg);<NEW_LINE>throw new SQLNonTransientException(msg);<NEW_LINE>}<NEW_LINE>String joinColumn = tc.getJoinColumn();<NEW_LINE>int joinColumnIndex = getJoinColumnIndex(schemaInfo, insertStmt, joinColumn);<NEW_LINE>final String joinColumnVal = insertStmt.getValues().getValues().get(joinColumnIndex).toString();<NEW_LINE>String realVal = StringUtil.removeApostrophe(joinColumnVal);<NEW_LINE>final String sql = RouterUtil.removeSchema(statementToString(insertStmt), schemaInfo.getSchema());<NEW_LINE>rrs.setStatement(sql);<NEW_LINE>// try to route by ER parent partion key<NEW_LINE>RouteResultset theRrs = routeByERParentColumn(rrs, tc, realVal, schemaInfo, service.getCharset().getClient());<NEW_LINE>if (theRrs != null) {<NEW_LINE>rrs.setFinishedRoute(true);<NEW_LINE>} else {<NEW_LINE>rrs.setFinishedExecute(true);<NEW_LINE>fetchChildTableToRoute(tc, joinColumnVal, service, schema, sql, rrs, isExplain, tableName);<NEW_LINE>}<NEW_LINE>}
SchemaConfig schema = schemaInfo.getSchemaConfig();
186,938
// A graph is considered sparse if its number of edges is within a small constant factor of V<NEW_LINE>public List<EdgeWeightedGraph> randomSparseEdgeWeightedGraphsGenerator(int numberOfGraphs, boolean uniformWeightDistribution) {<NEW_LINE>if (numberOfGraphs < 0) {<NEW_LINE>throw new IllegalArgumentException("Number of graphs cannot be negative");<NEW_LINE>}<NEW_LINE>RandomEdgeWeightedGraphs randomEdgeWeightedGraphsGenerator = new RandomEdgeWeightedGraphs();<NEW_LINE>List<EdgeWeightedGraph> randomEdgeWeightedGraphs = new ArrayList<>();<NEW_LINE>int[] graphVerticesCount = { 10, 100, 1000, 10000 };<NEW_LINE>for (int graph = 0; graph < numberOfGraphs; graph++) {<NEW_LINE>int <MASK><NEW_LINE>int edges = vertices * 3;<NEW_LINE>EdgeWeightedGraph randomEdgeWeightedGraph;<NEW_LINE>if (uniformWeightDistribution) {<NEW_LINE>randomEdgeWeightedGraph = randomEdgeWeightedGraphsGenerator.erdosRenyiGraphUniformWeights(vertices, edges);<NEW_LINE>} else {<NEW_LINE>randomEdgeWeightedGraph = randomEdgeWeightedGraphsGenerator.erdosRenyiGraphGaussianWeights(vertices, edges);<NEW_LINE>}<NEW_LINE>randomEdgeWeightedGraphs.add(randomEdgeWeightedGraph);<NEW_LINE>}<NEW_LINE>return randomEdgeWeightedGraphs;<NEW_LINE>}
vertices = graphVerticesCount[graph % 4];
267,680
protected void saveState() {<NEW_LINE>super.saveState();<NEW_LINE><MASK><NEW_LINE>if (context == null || bitmap == null || parent.getSurface().getComponent().isService())<NEW_LINE>return;<NEW_LINE>try {<NEW_LINE>// Saving current width and height to avoid restoring the screen after a screen rotation<NEW_LINE>restoreWidth = pixelWidth;<NEW_LINE>restoreHeight = pixelHeight;<NEW_LINE>int size = bitmap.getHeight() * bitmap.getRowBytes();<NEW_LINE>ByteBuffer restoreBitmap = ByteBuffer.allocate(size);<NEW_LINE>bitmap.copyPixelsToBuffer(restoreBitmap);<NEW_LINE>// Tries to use external but if not mounted, falls back on internal storage, as shown in<NEW_LINE>// https://developer.android.com/topic/performance/graphics/cache-bitmap#java<NEW_LINE>File cacheDir = Environment.MEDIA_MOUNTED == Environment.getExternalStorageState() || !isExternalStorageRemovable() ? context.getExternalCacheDir() : context.getCacheDir();<NEW_LINE>File cacheFile = new File(cacheDir + File.separator + "restore_pixels");<NEW_LINE>restoreFilename = cacheFile.getAbsolutePath();<NEW_LINE>FileOutputStream stream = new FileOutputStream(cacheFile);<NEW_LINE>ObjectOutputStream dout = new ObjectOutputStream(stream);<NEW_LINE>byte[] array = new byte[size];<NEW_LINE>restoreBitmap.rewind();<NEW_LINE>restoreBitmap.get(array);<NEW_LINE>dout.writeObject(array);<NEW_LINE>dout.flush();<NEW_LINE>stream.getFD().sync();<NEW_LINE>stream.close();<NEW_LINE>} catch (Exception ex) {<NEW_LINE>PGraphics.showWarning("Could not save screen contents to cache");<NEW_LINE>ex.printStackTrace();<NEW_LINE>}<NEW_LINE>}
Context context = parent.getContext();
896,685
public static DatabaseConfiguration deserialize(final Path file) {<NEW_LINE>try (final FileReader fileReader = new FileReader(file.toAbsolutePath().resolve(DatabasePaths.CONFIGBINARY.getFile()).toFile());<NEW_LINE>final JsonReader jsonReader = new JsonReader(fileReader)) {<NEW_LINE>jsonReader.beginObject();<NEW_LINE>final <MASK><NEW_LINE>assert fileName.equals("file");<NEW_LINE>final Path dbFile = Paths.get(jsonReader.nextString());<NEW_LINE>final String IDName = jsonReader.nextName();<NEW_LINE>assert IDName.equals("ID");<NEW_LINE>final int ID = jsonReader.nextInt();<NEW_LINE>final String databaseType = jsonReader.nextName();<NEW_LINE>assert databaseType.equals("databaseType");<NEW_LINE>final String type = jsonReader.nextString();<NEW_LINE>jsonReader.endObject();<NEW_LINE>final DatabaseType dbType = DatabaseType.fromString(type).orElseThrow(() -> new IllegalStateException("Type can not be unknown."));<NEW_LINE>return new DatabaseConfiguration(dbFile).setMaximumResourceID(ID).setDatabaseType(dbType);<NEW_LINE>} catch (final IOException e) {<NEW_LINE>throw new SirixIOException(e);<NEW_LINE>}<NEW_LINE>}
String fileName = jsonReader.nextName();
1,667,345
public void onError(java.lang.Exception e) {<NEW_LINE>byte msgType = org.apache.thrift.protocol.TMessageType.REPLY;<NEW_LINE>org.apache.thrift.TSerializable msg;<NEW_LINE>query_cfg_result result = new query_cfg_result();<NEW_LINE>if (e instanceof org.apache.thrift.transport.TTransportException) {<NEW_LINE>_LOGGER.error("TTransportException inside handler", e);<NEW_LINE>fb.close();<NEW_LINE>return;<NEW_LINE>} else if (e instanceof org.apache.thrift.TApplicationException) {<NEW_LINE>_LOGGER.error("TApplicationException inside handler", e);<NEW_LINE>msgType = org.apache<MASK><NEW_LINE>msg = (org.apache.thrift.TApplicationException) e;<NEW_LINE>} else {<NEW_LINE>_LOGGER.error("Exception inside handler", e);<NEW_LINE>msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION;<NEW_LINE>msg = new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage());<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>fcall.sendResponse(fb, msg, msgType, seqid);<NEW_LINE>} catch (java.lang.Exception ex) {<NEW_LINE>_LOGGER.error("Exception writing to internal frame buffer", ex);<NEW_LINE>fb.close();<NEW_LINE>}<NEW_LINE>}
.thrift.protocol.TMessageType.EXCEPTION;
1,754,969
private void displayEmailMsg(MesssageArtifactData artifactData) {<NEW_LINE>enableCommonFields();<NEW_LINE>directionText.setEnabled(false);<NEW_LINE>ccLabel.setEnabled(true);<NEW_LINE>this.fromText.setText(artifactData.getAttributeDisplayString(TSK_EMAIL_FROM));<NEW_LINE>this.fromText.setToolTipText(artifactData.getAttributeDisplayString(TSK_EMAIL_FROM));<NEW_LINE>this.toText.setText(artifactData.getAttributeDisplayString(TSK_EMAIL_TO));<NEW_LINE>this.toText.setToolTipText(artifactData.getAttributeDisplayString(TSK_EMAIL_TO));<NEW_LINE>this.directionText.setText("");<NEW_LINE>this.ccText.setText<MASK><NEW_LINE>this.ccText.setToolTipText(artifactData.getAttributeDisplayString(TSK_EMAIL_CC));<NEW_LINE>this.subjectText.setText(artifactData.getAttributeDisplayString(TSK_SUBJECT));<NEW_LINE>this.datetimeText.setText(artifactData.getAttributeDisplayString(TSK_DATETIME_RCVD));<NEW_LINE>configureTextArea(artifactData.getAttributeDisplayString(TSK_HEADERS), HDR_TAB_INDEX);<NEW_LINE>configureTextArea(artifactData.getAttributeDisplayString(TSK_EMAIL_CONTENT_PLAIN), TEXT_TAB_INDEX);<NEW_LINE>configureTextArea(artifactData.getAttributeDisplayString(TSK_EMAIL_CONTENT_HTML), HTML_TAB_INDEX);<NEW_LINE>configureTextArea(artifactData.getAttributeDisplayString(TSK_EMAIL_CONTENT_RTF), RTF_TAB_INDEX);<NEW_LINE>configureAttachments(artifactData.getAttachements());<NEW_LINE>}
(artifactData.getAttributeDisplayString(TSK_EMAIL_CC));
1,567,676
private void hostSuspendedTablet(TabletLists tLists, TabletLocationState tls, TServerInstance location, TableConfiguration tableConf) {<NEW_LINE>if (manager.getSteadyTime() - tls.suspend.suspensionTime < tableConf.getTimeInMillis(Property.TABLE_SUSPEND_DURATION)) {<NEW_LINE>// Tablet is suspended. See if its tablet server is back.<NEW_LINE>TServerInstance returnInstance = null;<NEW_LINE>Iterator<TServerInstance> find = tLists.destinations.tailMap(new TServerInstance(tls.suspend.server, " ")).keySet().iterator();<NEW_LINE>if (find.hasNext()) {<NEW_LINE>TServerInstance found = find.next();<NEW_LINE>if (found.getHostAndPort().equals(tls.suspend.server)) {<NEW_LINE>returnInstance = found;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Old tablet server is back. Return this tablet to its previous owner.<NEW_LINE>if (returnInstance != null) {<NEW_LINE>tLists.assignments.add(new Assignment(tls.extent, returnInstance));<NEW_LINE>}<NEW_LINE>// else - tablet server not back. Don't ask for a new assignment right now.<NEW_LINE>} else {<NEW_LINE>// Treat as unassigned, ask for a new assignment.<NEW_LINE>tLists.unassigned.<MASK><NEW_LINE>}<NEW_LINE>}
put(tls.extent, location);
1,676,146
private List<String> extractFields(String decisionDefinitionId) {<NEW_LINE>List<String> fields <MASK><NEW_LINE>ProcessEngine processEngine = Beans.get(ProcessEngineService.class).getEngine();<NEW_LINE>DecisionDefinition decisionDefinition = processEngine.getRepositoryService().createDecisionDefinitionQuery().decisionDefinitionKey(decisionDefinitionId).latestVersion().singleResult();<NEW_LINE>DmnModelInstance dmnModelInstance = processEngine.getRepositoryService().getDmnModelInstance(decisionDefinition.getId());<NEW_LINE>if (dmnModelInstance == null) {<NEW_LINE>return fields;<NEW_LINE>}<NEW_LINE>log.debug("Definition: {}", dmnModelInstance.getDefinitions());<NEW_LINE>Collection<DecisionTable> decisionTables = dmnModelInstance.getModelElementsByType(DecisionTable.class);<NEW_LINE>log.debug("DecisionTables: {}", decisionTables);<NEW_LINE>if (decisionTables == null) {<NEW_LINE>return fields;<NEW_LINE>}<NEW_LINE>for (DecisionTable decisionTable : decisionTables) {<NEW_LINE>Collection<Output> outputs = decisionTable.getOutputs();<NEW_LINE>for (Output output : outputs) {<NEW_LINE>fields.add(output.getName());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>log.debug("Output fields: {}", fields);<NEW_LINE>return fields;<NEW_LINE>}
= new ArrayList<String>();
660,277
// pack an int32/64/128 value into ByteBuffer in little endian<NEW_LINE>ByteBuffer packDecimal() {<NEW_LINE>ByteBuffer buffer = ByteBuffer.allocate(type.getTypeSize());<NEW_LINE>buffer.order(ByteOrder.LITTLE_ENDIAN);<NEW_LINE>int scale = ((ScalarType) type).getScalarScale();<NEW_LINE>BigDecimal scaledValue = value.multiply(SCALE_FACTOR[scale]);<NEW_LINE>switch(type.getPrimitiveType()) {<NEW_LINE>case DECIMAL32:<NEW_LINE>buffer.putInt(scaledValue.intValue());<NEW_LINE>break;<NEW_LINE>case DECIMAL64:<NEW_LINE>buffer.putLong(scaledValue.longValue());<NEW_LINE>break;<NEW_LINE>case DECIMAL128:<NEW_LINE>case DECIMALV2:<NEW_LINE>// BigInteger::toByteArray returns a big-endian byte[], so copy in reverse order one by one byte.<NEW_LINE>byte[] bytes = scaledValue.toBigInteger().toByteArray();<NEW_LINE>for (int i = bytes.length - 1; i >= 0; --i) {<NEW_LINE>buffer<MASK><NEW_LINE>}<NEW_LINE>// pad with sign bits<NEW_LINE>byte prefixByte = scaledValue.signum() >= 0 ? (byte) 0 : (byte) 0xff;<NEW_LINE>int numPaddingBytes = 16 - bytes.length;<NEW_LINE>for (int i = 0; i < numPaddingBytes; ++i) {<NEW_LINE>buffer.put(prefixByte);<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>Preconditions.checkArgument(false, "Type bust be decimal type");<NEW_LINE>}<NEW_LINE>buffer.flip();<NEW_LINE>return buffer;<NEW_LINE>}
.put(bytes[i]);
1,080,387
private Mono<Response<Flux<ByteBuffer>>> deleteWithResponseAsync(String resourceGroupName, String configStoreName, Context context) {<NEW_LINE>if (this.client.getEndpoint() == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (this.client.getSubscriptionId() == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (resourceGroupName == null) {<NEW_LINE>return Mono.<MASK><NEW_LINE>}<NEW_LINE>if (configStoreName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter configStoreName is required and cannot be null."));<NEW_LINE>}<NEW_LINE>final String accept = "application/json";<NEW_LINE>context = this.client.mergeContext(context);<NEW_LINE>return service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, configStoreName, this.client.getApiVersion(), accept, context);<NEW_LINE>}
error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
636,995
private PublisherAgreementResponse parseAgreementResponse(ResponseEntity<String> response) {<NEW_LINE>var json = response.getBody();<NEW_LINE>try {<NEW_LINE>if (json.startsWith("[\"")) {<NEW_LINE>var error = objectMapper.readValue(json, TYPE_LIST_STRING);<NEW_LINE>logger.error("Publisher agreement request failed:\n" + json);<NEW_LINE>throw new ErrorResultException("Request to the Eclipse Foundation server failed: " + error, HttpStatus.INTERNAL_SERVER_ERROR);<NEW_LINE>} else if (json.startsWith("[")) {<NEW_LINE>var profileList = objectMapper.readValue(json, TYPE_LIST_AGREEMENT);<NEW_LINE>if (profileList.isEmpty()) {<NEW_LINE>throw new ErrorResultException("No publisher agreement available.", HttpStatus.INTERNAL_SERVER_ERROR);<NEW_LINE>}<NEW_LINE>return profileList.get(0);<NEW_LINE>} else {<NEW_LINE>return objectMapper.<MASK><NEW_LINE>}<NEW_LINE>} catch (JsonProcessingException exc) {<NEW_LINE>logger.error("Failed to parse JSON response (" + response.getStatusCode() + "):\n" + json, exc);<NEW_LINE>throw new ErrorResultException("Parsing publisher agreement response failed: " + exc.getMessage(), HttpStatus.INTERNAL_SERVER_ERROR);<NEW_LINE>}<NEW_LINE>}
readValue(json, PublisherAgreementResponse.class);
736,622
public void bindData(TagsBean target, ViewHolder<RecyMutedTagBinding> bindView, int position) {<NEW_LINE>if (TextUtils.isEmpty(allItems.get(position).getName())) {<NEW_LINE>bindView.baseBind.starSize.<MASK><NEW_LINE>} else {<NEW_LINE>if (!TextUtils.isEmpty(allItems.get(position).getTranslated_name())) {<NEW_LINE>bindView.baseBind.starSize.setText(String.format("#%s/%s", allItems.get(position).getName(), allItems.get(position).getTranslated_name()));<NEW_LINE>} else {<NEW_LINE>bindView.baseBind.starSize.setText(String.format("#%s", allItems.get(position).getName()));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>bindView.baseBind.sideDecorator.setVisibility(allItems.get(position).getFilter_mode() != 0 ? View.VISIBLE : View.GONE);<NEW_LINE>bindView.baseBind.isEffective.setOnCheckedChangeListener(null);<NEW_LINE>bindView.baseBind.isEffective.setChecked(target.isEffective());<NEW_LINE>bindView.baseBind.isEffective.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {<NEW_LINE>target.setEffective(isChecked);<NEW_LINE>PixivOperate.updateTag(target);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>if (mOnItemClickListener != null) {<NEW_LINE>bindView.baseBind.deleteItem.setOnClickListener(new View.OnClickListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onClick(View v) {<NEW_LINE>mOnItemClickListener.onItemClick(v, position, 1);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>bindView.itemView.setOnClickListener(v -> mOnItemClickListener.onItemClick(v, position, 0));<NEW_LINE>}<NEW_LINE>}
setText(R.string.string_155);
1,430,081
protected void run(StructuredGraph graph) {<NEW_LINE>// Prevent Pragma Unroll for non-fpga devices<NEW_LINE>if (graph.hasLoops() && (deviceContext.isPlatformFPGA())) {<NEW_LINE>boolean peeled;<NEW_LINE>do {<NEW_LINE>peeled = false;<NEW_LINE>final <MASK><NEW_LINE>dataCounted.detectedCountedLoops();<NEW_LINE>for (LoopEx loop : dataCounted.countedLoops()) {<NEW_LINE>if (shouldFullUnrollOrPipeline(graph.getOptions(), loop)) {<NEW_LINE>List<EndNode> snapshot = graph.getNodes().filter(EndNode.class).snapshot();<NEW_LINE>int idx = 0;<NEW_LINE>for (EndNode end : snapshot) {<NEW_LINE>idx++;<NEW_LINE>if (idx == 2) {<NEW_LINE>if (deviceContext.isPlatformXilinxFPGA()) {<NEW_LINE>XilinxPipeliningPragmaNode pipeliningPragmaNode = graph.addOrUnique(new XilinxPipeliningPragmaNode(XILINX_PIPELINING_II_NUMBER));<NEW_LINE>graph.addBeforeFixed(end, pipeliningPragmaNode);<NEW_LINE>} else {<NEW_LINE>IntelUnrollPragmaNode unrollPragmaNode = graph.addOrUnique(new IntelUnrollPragmaNode(UNROLL_FACTOR_NUMBER));<NEW_LINE>graph.addBeforeFixed(end, unrollPragmaNode);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>peeled = false;<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} while (peeled);<NEW_LINE>}<NEW_LINE>}
LoopsData dataCounted = new TornadoLoopsData(graph);
739,057
private CompletableFuture<Void> generateSnapshotIfRequired() {<NEW_LINE>// Generate a snapshot if no snapshot was saved before or when threshold for either time or number batches is reached.<NEW_LINE>boolean shouldGenerate = true;<NEW_LINE>if (lastSavedSystemSnapshot.get() == null) {<NEW_LINE>log.debug("SystemJournal[{}] Generating first snapshot.", containerId);<NEW_LINE>} else if (recordsSinceSnapshot.get() > config.getMaxJournalUpdatesPerSnapshot()) {<NEW_LINE>log.debug("SystemJournal[{}] Generating snapshot based on update threshold. {} updates since last snapshot.", containerId, recordsSinceSnapshot.get());<NEW_LINE>} else if (currentTimeSupplier.get() - lastSavedSnapshotTime.get() > config.getJournalSnapshotInfoUpdateFrequency().toMillis()) {<NEW_LINE>log.debug("SystemJournal[{}] Generating snapshot based on time threshold. current time={} last saved ={}.", containerId, currentTimeSupplier.get(), lastSavedSnapshotTime.get());<NEW_LINE>} else {<NEW_LINE>shouldGenerate = false;<NEW_LINE>}<NEW_LINE>if (shouldGenerate) {<NEW_LINE>// Write a snapshot.<NEW_LINE>val txn = metadataStore.beginTransaction(true, getSystemSegments());<NEW_LINE>return validateAndSaveSnapshot(txn, true, config.isSelfCheckEnabled()).thenAcceptAsync(saved -> {<NEW_LINE>txn.close();<NEW_LINE>if (saved) {<NEW_LINE>lastSavedSnapshotTime.set(currentTimeSupplier.get());<NEW_LINE>recordsSinceSnapshot.set(0);<NEW_LINE>// Always start a new journal after snapshot<NEW_LINE>newChunkRequired.set(true);<NEW_LINE>}<NEW_LINE>}, executor).exceptionally(e -> {<NEW_LINE>log.<MASK><NEW_LINE>return null;<NEW_LINE>});<NEW_LINE>} else {<NEW_LINE>return CompletableFuture.completedFuture(null);<NEW_LINE>}<NEW_LINE>}
error("SystemJournal[{}] Error while creating snapshot", containerId, e);
1,399,390
private void persistFields() {<NEW_LINE>String selectedJavaHome = null;<NEW_LINE>JavaPlatform selectedPlatform = isJavaPlatformDefault() ? null : javaPlatform();<NEW_LINE>if (selectedPlatform != null) {<NEW_LINE>Iterator<FileObject> platformIterator = selectedPlatform.getInstallFolders().iterator();<NEW_LINE>if (platformIterator.hasNext()) {<NEW_LINE>FileObject javaHomeFO = platformIterator.next();<NEW_LINE>selectedJavaHome = javaHomeFO != null ? FileUtil.toFile(javaHomeFO).getAbsolutePath() : null;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>instance.setJavaHome(selectedJavaHome);<NEW_LINE>instance.putProperty(PayaraModule.USE_SHARED_MEM_ATTR, Boolean.toString(useSharedMemRB.isSelected()));<NEW_LINE>instance.putProperty(PayaraModule.USE_IDE_PROXY_FLAG, Boolean.toString(useIDEProxyInfo.isSelected()));<NEW_LINE>instance.putProperty(PayaraModule.DEBUG_PORT, <MASK><NEW_LINE>}
getAddressValue().toString());
182,488
static Element show(Element element, String color) {<NEW_LINE>if (element != null) {<NEW_LINE>if (highlights == null) {<NEW_LINE>highlights = new HashSet<>();<NEW_LINE>}<NEW_LINE>Element highlight = DOM.createDiv();<NEW_LINE>Style style = highlight.getStyle();<NEW_LINE>style.setTop(element.getAbsoluteTop(), Unit.PX);<NEW_LINE>style.setLeft(element.getAbsoluteLeft(), Unit.PX);<NEW_LINE>int width = element.getOffsetWidth();<NEW_LINE>if (width < MIN_WIDTH) {<NEW_LINE>width = MIN_WIDTH;<NEW_LINE>}<NEW_LINE>style.setWidth(width, Unit.PX);<NEW_LINE>int height = element.getOffsetHeight();<NEW_LINE>if (height < MIN_HEIGHT) {<NEW_LINE>height = MIN_HEIGHT;<NEW_LINE>}<NEW_LINE>style.setHeight(height, Unit.PX);<NEW_LINE>RootPanel.getBodyElement().appendChild(highlight);<NEW_LINE>style.setPosition(Position.ABSOLUTE);<NEW_LINE>style.setZIndex(VWindow.Z_INDEX + 1000);<NEW_LINE>style.setBackgroundColor(color);<NEW_LINE>style.setOpacity(DEFAULT_OPACITY);<NEW_LINE>if (BrowserInfo.get().isIE()) {<NEW_LINE>style.setProperty("filter", "alpha(opacity=" + <MASK><NEW_LINE>}<NEW_LINE>highlights.add(highlight);<NEW_LINE>return highlight;<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>}
(DEFAULT_OPACITY * 100) + ")");
1,211,110
public UnprocessedAccount unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>UnprocessedAccount unprocessedAccount = new UnprocessedAccount();<NEW_LINE>int originalDepth = context.getCurrentDepth();<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("accountId", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>unprocessedAccount.setAccountId(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("errorCode", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>unprocessedAccount.setErrorCode(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("errorMessage", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>unprocessedAccount.setErrorMessage(context.getUnmarshaller(String.<MASK><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 unprocessedAccount;<NEW_LINE>}
class).unmarshall(context));
123,008
void uiDestroy() {<NEW_LINE>for (Image image : icon_list) {<NEW_LINE>image.dispose();<NEW_LINE>}<NEW_LINE>icon_list.clear();<NEW_LINE>SubscriptionManager subs_man = SubscriptionManagerFactory.getSingleton();<NEW_LINE>if (subs_man != null) {<NEW_LINE>if (subman_listener_delayed != null) {<NEW_LINE>subs_man.removeListener(subman_listener_delayed);<NEW_LINE>}<NEW_LINE>if (subman_listener_quick != null) {<NEW_LINE>subs_man.removeListener(subman_listener_quick);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>subman_listener_quick = null;<NEW_LINE>subman_listener_delayed = null;<NEW_LINE>try {<NEW_LINE>TableManager tableManager = PluginInitializer.getDefaultInterface().getUIManager().getTableManager();<NEW_LINE>if (columnCreationSubs != null) {<NEW_LINE>tableManager.unregisterColumn(Download.class, "azsubs.ui.column.subs", columnCreationSubs);<NEW_LINE>columnCreationSubs = null;<NEW_LINE>}<NEW_LINE>if (columnCreationSubsLink != null) {<NEW_LINE>tableManager.unregisterColumn(Download.class, "azsubs.ui.column.subs_link", columnCreationSubsLink);<NEW_LINE>columnCreationSubsLink = null;<NEW_LINE>}<NEW_LINE>} catch (Throwable ignore) {<NEW_LINE>}<NEW_LINE>if (pluginConfigListener != null) {<NEW_LINE>default_pi.<MASK><NEW_LINE>pluginConfigListener = null;<NEW_LINE>}<NEW_LINE>if (configModel != null) {<NEW_LINE>configModel.destroy();<NEW_LINE>configModel = null;<NEW_LINE>}<NEW_LINE>}
getPluginconfig().removeListener(pluginConfigListener);
928,568
public boolean apply(Game game, Ability source) {<NEW_LINE>Player controller = game.getPlayer(source.getControllerId());<NEW_LINE>if (controller != null) {<NEW_LINE><MASK><NEW_LINE>choice.setMessage("Choose mode");<NEW_LINE>choice.setChoices(choices);<NEW_LINE>if (!controller.choose(outcome, choice, game)) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>Card sourceCard = game.getCard(source.getSourceId());<NEW_LINE>if (sourceCard != null) {<NEW_LINE>for (Object cost : source.getCosts()) {<NEW_LINE>if (cost instanceof SacrificeTargetCost) {<NEW_LINE>Permanent p = (Permanent) game.getLastKnownInformation(((SacrificeTargetCost) cost).getPermanents().get(0).getId(), Zone.BATTLEFIELD);<NEW_LINE>if (p != null) {<NEW_LINE>String chosen = choice.getChoice();<NEW_LINE>switch(chosen) {<NEW_LINE>case "Gain life equal to creature's power":<NEW_LINE>new GainLifeEffect(p.getPower().getValue()).apply(game, source);<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>// "Gain life equal to creature's toughness"<NEW_LINE>new GainLifeEffect(p.getToughness().getValue()).apply(game, source);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>}
Choice choice = new ChoiceImpl(true);
1,241,480
public static RexCall pushPredicateIntoCase(RexCall call) {<NEW_LINE>if (call.getType().getSqlTypeName() != SqlTypeName.BOOLEAN) {<NEW_LINE>return call;<NEW_LINE>}<NEW_LINE>switch(call.getKind()) {<NEW_LINE>case CASE:<NEW_LINE>case AND:<NEW_LINE>case OR:<NEW_LINE>// don't push CASE into CASE!<NEW_LINE>return call;<NEW_LINE>case EQUALS:<NEW_LINE>{<NEW_LINE>// checks that the EQUALS operands may be splitted and<NEW_LINE>// doesn't push EQUALS into CASE<NEW_LINE>List<RexNode> equalsOperands = call.getOperands();<NEW_LINE>ImmutableBitSet left = RelOptUtil.InputFinder.bits(equalsOperands.get(0));<NEW_LINE>ImmutableBitSet right = RelOptUtil.InputFinder.bits(equalsOperands.get(1));<NEW_LINE>if (!left.isEmpty() && !right.isEmpty() && left.intersect(right).isEmpty()) {<NEW_LINE>return call;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>int caseOrdinal = -1;<NEW_LINE>final List<RexNode> operands = call.getOperands();<NEW_LINE>for (int i = 0; i < operands.size(); i++) {<NEW_LINE>RexNode operand = operands.get(i);<NEW_LINE>if (operand.getKind() == SqlKind.CASE) {<NEW_LINE>caseOrdinal = i;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (caseOrdinal < 0) {<NEW_LINE>return call;<NEW_LINE>}<NEW_LINE>// Convert<NEW_LINE>// f(CASE WHEN p1 THEN v1 ... END, arg)<NEW_LINE>// to<NEW_LINE>// CASE WHEN p1 THEN f(v1, arg) ... END<NEW_LINE>final RexCall case_ = (RexCall) operands.get(caseOrdinal);<NEW_LINE>final List<RexNode> nodes = new ArrayList<>();<NEW_LINE>for (int i = 0; i < case_.getOperands().size(); i++) {<NEW_LINE>RexNode node = case_.getOperands().get(i);<NEW_LINE>if (!RexUtil.isCasePredicate(case_, i)) {<NEW_LINE>node = substitute(call, caseOrdinal, node);<NEW_LINE>}<NEW_LINE>nodes.add(node);<NEW_LINE>}<NEW_LINE>return case_.clone(<MASK><NEW_LINE>}
call.getType(), nodes);
1,709,598
// </editor-fold>//GEN-END:initComponents<NEW_LINE>private void resetButtonActionPerformed(java.awt.event.ActionEvent evt) {<NEW_LINE>// GEN-FIRST:event_resetButtonActionPerformed<NEW_LINE>NbPreferences.forModule(VizConfig.class<MASK><NEW_LINE>NbPreferences.forModule(VizConfig.class).remove(VizConfig.NEIGHBOUR_SELECT);<NEW_LINE>NbPreferences.forModule(VizConfig.class).remove(VizConfig.BACKGROUND_COLOR);<NEW_LINE>NbPreferences.forModule(VizConfig.class).remove(VizConfig.NODE_LABEL_COLOR);<NEW_LINE>NbPreferences.forModule(VizConfig.class).remove(VizConfig.EDGE_LABEL_COLOR);<NEW_LINE>NbPreferences.forModule(VizConfig.class).remove(VizConfig.NODE_LABEL_FONT);<NEW_LINE>NbPreferences.forModule(VizConfig.class).remove(VizConfig.EDGE_LABEL_FONT);<NEW_LINE>load();<NEW_LINE>}
).remove(VizConfig.HIGHLIGHT);
1,789,936
final ReplicationGroup executeIncreaseReplicaCount(IncreaseReplicaCountRequest increaseReplicaCountRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(increaseReplicaCountRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<IncreaseReplicaCountRequest> request = null;<NEW_LINE>Response<ReplicationGroup> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new IncreaseReplicaCountRequestMarshaller().marshall(super.beforeMarshalling(increaseReplicaCountRequest));<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, "ElastiCache");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "IncreaseReplicaCount");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>StaxResponseHandler<ReplicationGroup> responseHandler = new StaxResponseHandler<ReplicationGroup>(new ReplicationGroupStaxUnmarshaller());<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>}
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
1,414,933
// Display header<NEW_LINE>private static void header(Comparable[] array) {<NEW_LINE><MASK><NEW_LINE>StdDraw.text(array.length / 2.0, -3, "array[ ]");<NEW_LINE>for (int i = 0; i < array.length; i++) {<NEW_LINE>StdDraw.text(i, -2, String.valueOf(i));<NEW_LINE>}<NEW_LINE>StdDraw.text(-2.50, -2, "i");<NEW_LINE>StdDraw.text(-1.25, -2, "j");<NEW_LINE>StdDraw.setPenColor(StdDraw.BOOK_RED);<NEW_LINE>StdDraw.line(-4, -1.65, array.length - 0.5, -1.65);<NEW_LINE>StdDraw.setPenColor(StdDraw.BLACK);<NEW_LINE>for (int i = 0; i < array.length; i++) {<NEW_LINE>StdDraw.text(i, -1, String.format("%.1f", Double.parseDouble(String.valueOf(array[i]))));<NEW_LINE>}<NEW_LINE>}
StdDraw.setPenColor(StdDraw.BLACK);
624,441
public boolean onNavigationItemSelected(@NonNull MenuItem item) {<NEW_LINE>super.onNavigationItemSelected(item);<NEW_LINE>updateNotificationIndicator(item.getItemId());<NEW_LINE>if (mFactory != null && mFactory.onDrawerItemSelected(item)) {<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>int id = item.getItemId();<NEW_LINE>FragmentFactory factory = getFactoryForItem(id);<NEW_LINE>if (factory != null) {<NEW_LINE>switchTo(id, factory);<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>switch(id) {<NEW_LINE>case R.id.profile:<NEW_LINE>startActivity(UserActivity.makeIntent(this, mUserLogin));<NEW_LINE>return true;<NEW_LINE>case R.id.logout:<NEW_LINE>Gh4Application.get().logout();<NEW_LINE>goToToplevelActivity();<NEW_LINE>finish();<NEW_LINE>return true;<NEW_LINE>case R.id.add_account:<NEW_LINE>LoginModeChooserFragment.newInstance().show(getSupportFragmentManager(), "loginmode");<NEW_LINE>return true;<NEW_LINE>case R.id.settings:<NEW_LINE>mSettingsLauncher.launch(null);<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>int accountCount = Gh4Application.get()<MASK><NEW_LINE>if (id >= OTHER_ACCOUNTS_GROUP_BASE_ID && id < OTHER_ACCOUNTS_GROUP_BASE_ID + accountCount) {<NEW_LINE>switchActiveUser(item.getTitle().toString());<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>}
.getAccounts().size();
1,159,108
final CreateCertificateAuthorityAuditReportResult executeCreateCertificateAuthorityAuditReport(CreateCertificateAuthorityAuditReportRequest createCertificateAuthorityAuditReportRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(createCertificateAuthorityAuditReportRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE><MASK><NEW_LINE>Request<CreateCertificateAuthorityAuditReportRequest> request = null;<NEW_LINE>Response<CreateCertificateAuthorityAuditReportResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new CreateCertificateAuthorityAuditReportRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(createCertificateAuthorityAuditReportRequest));<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, "ACM PCA");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "CreateCertificateAuthorityAuditReport");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<CreateCertificateAuthorityAuditReportResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new CreateCertificateAuthorityAuditReportResultJsonUnmarshaller());<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>}
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
1,404,694
public I_C_BP_BankAccount createNewC_BP_BankAccount(final IContextAware contextProvider, final int bpartnerId) {<NEW_LINE>final PaymentString paymentString = getPaymentString();<NEW_LINE>final I_C_BP_BankAccount bpBankAccount = InterfaceWrapperHelper.newInstance(I_C_BP_BankAccount.class, contextProvider);<NEW_LINE>Check.assume(<MASK><NEW_LINE>bpBankAccount.setC_BPartner_ID(bpartnerId);<NEW_LINE>// CHF, because it's ESR<NEW_LINE>final Currency currency = currencyDAO.getByCurrencyCode(CurrencyCode.CHF);<NEW_LINE>bpBankAccount.setC_Currency_ID(currency.getId().getRepoId());<NEW_LINE>// ..because we are creating this from an ESR/QRR string<NEW_LINE>bpBankAccount.setIsEsrAccount(true);<NEW_LINE>bpBankAccount.setIsACH(true);<NEW_LINE>final String bPartnerName = bpartnerDAO.getBPartnerNameById(BPartnerId.ofRepoId(bpartnerId));<NEW_LINE>bpBankAccount.setA_Name(bPartnerName);<NEW_LINE>bpBankAccount.setName(bPartnerName);<NEW_LINE>bpBankAccount.setAccountNo(paymentString.getInnerAccountNo());<NEW_LINE>bpBankAccount.setESR_RenderedAccountNo(paymentString.getPostAccountNo());<NEW_LINE>InterfaceWrapperHelper.save(bpBankAccount);<NEW_LINE>return bpBankAccount;<NEW_LINE>}
bpartnerId > 0, "We assume the bPartnerId to be greater than 0. This={}", this);
248,638
private AmazonS3 buildClient(final S3ClientSettings clientSettings) {<NEW_LINE>final AmazonS3ClientBuilder builder = AmazonS3ClientBuilder.standard();<NEW_LINE>builder.withCredentials<MASK><NEW_LINE>builder.withClientConfiguration(buildConfiguration(clientSettings));<NEW_LINE>final String endpoint = Strings.hasLength(clientSettings.endpoint) ? clientSettings.endpoint : Constants.S3_HOSTNAME;<NEW_LINE>LOGGER.debug("using endpoint [{}]", endpoint);<NEW_LINE>// If the endpoint configuration isn't set on the builder then the default behaviour is to try<NEW_LINE>// and work out what region we are in and use an appropriate endpoint - see AwsClientBuilder#setRegion.<NEW_LINE>// In contrast, directly-constructed clients use s3.amazonaws.com unless otherwise instructed. We currently<NEW_LINE>// use a directly-constructed client, and need to keep the existing behaviour to avoid a breaking change,<NEW_LINE>// so to move to using the builder we must set it explicitly to keep the existing behaviour.<NEW_LINE>//<NEW_LINE>// We do this because directly constructing the client is deprecated (was already deprecated in 1.1.223 too)<NEW_LINE>// so this change removes that usage of a deprecated API.<NEW_LINE>builder.withEndpointConfiguration(new AwsClientBuilder.EndpointConfiguration(endpoint, null));<NEW_LINE>return builder.build();<NEW_LINE>}
(buildCredentials(LOGGER, clientSettings));
304,860
public static void main(String[] argv) {<NEW_LINE>Scanner input = new Scanner(System.in);<NEW_LINE>System.out.println("Enter the matrix size (Square matrix only): ");<NEW_LINE>int n = input.nextInt();<NEW_LINE>double[][] a = <MASK><NEW_LINE>System.out.println("Enter the elements of matrix: ");<NEW_LINE>for (int i = 0; i < n; i++) {<NEW_LINE>for (int j = 0; j < n; j++) {<NEW_LINE>a[i][j] = input.nextDouble();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>double[][] d = invert(a);<NEW_LINE>System.out.println();<NEW_LINE>System.out.println("The inverse is: ");<NEW_LINE>for (int i = 0; i < n; ++i) {<NEW_LINE>for (int j = 0; j < n; ++j) {<NEW_LINE>System.out.print(d[i][j] + " ");<NEW_LINE>}<NEW_LINE>System.out.println();<NEW_LINE>}<NEW_LINE>input.close();<NEW_LINE>}
new double[n][n];
221,288
public void start() throws IOException {<NEW_LINE>logger.info("starting StoreService...");<NEW_LINE>List<Integer> partitionIds = this.metaService.getPartitionsByStoreId(this.storeId);<NEW_LINE>this.idToPartition = new HashMap<>(partitionIds.size());<NEW_LINE>for (int partitionId : partitionIds) {<NEW_LINE>try {<NEW_LINE>GraphPartition partition = makeGraphPartition(this.configs, partitionId);<NEW_LINE>this.idToPartition.put(partitionId, partition);<NEW_LINE>} catch (IOException e) {<NEW_LINE>throw new MaxGraphException(e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>initMetrics();<NEW_LINE>this.shouldStop = false;<NEW_LINE>this.writeExecutor = new ThreadPoolExecutor(writeThreadCount, writeThreadCount, 0L, TimeUnit.MILLISECONDS, new LinkedBlockingQueue<>(), ThreadFactoryUtils.daemonThreadFactoryWithLogExceptionHandler("store-write", logger));<NEW_LINE>this.ingestExecutor = new ThreadPoolExecutor(1, 1, 0L, TimeUnit.MILLISECONDS, new LinkedBlockingQueue<>(1), ThreadFactoryUtils.daemonThreadFactoryWithLogExceptionHandler("store-ingest", logger));<NEW_LINE>logger.info(<MASK><NEW_LINE>}
"StoreService started. storeId [" + this.storeId + "]");
253,920
public List<Article> findRelevantListByArticleId(long articleId, String status, Integer count) {<NEW_LINE>List<ArticleCategory> tags = categoryService.findListByArticleId(articleId, ArticleCategory.TYPE_TAG);<NEW_LINE>if (tags == null || tags.isEmpty()) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>List<Long> tagIds = tags.stream().map(category -> category.getId()).collect(Collectors.toList());<NEW_LINE>Columns columns = Columns.create();<NEW_LINE>columns.in("m.category_id", tagIds.toArray());<NEW_LINE>columns.ne("article.id", articleId);<NEW_LINE>columns.eq("article.status", status);<NEW_LINE>List<Article> articles = DAO.leftJoin("article_category_mapping").as("m").on("article.id = m.`article_id`"<MASK><NEW_LINE>return joinUserInfo(articles);<NEW_LINE>}
).findListByColumns(columns, count);
77,153
private void readAllFields(PageCursor cursor) throws IOException {<NEW_LINE>do {<NEW_LINE>creationTimeField = getRecordValue(cursor, Position.TIME);<NEW_LINE>randomNumberField = getRecordValue(cursor, Position.RANDOM_NUMBER);<NEW_LINE>versionField = getRecordValue(cursor, Position.LOG_VERSION);<NEW_LINE>long lastCommittedTxId = getRecordValue(cursor, Position.LAST_TRANSACTION_ID);<NEW_LINE>lastCommittingTxField.set(lastCommittedTxId);<NEW_LINE>storeVersionField = getRecordValue(cursor, Position.STORE_VERSION);<NEW_LINE>getRecordValue(cursor, Position.FIRST_GRAPH_PROPERTY);<NEW_LINE>latestConstraintIntroducingTxField = getRecordValue(cursor, Position.LAST_CONSTRAINT_TRANSACTION);<NEW_LINE>upgradeTxIdField = getRecordValue(cursor, Position.UPGRADE_TRANSACTION_ID);<NEW_LINE>upgradeTxChecksumField = (int) getRecordValue(cursor, Position.UPGRADE_TRANSACTION_CHECKSUM);<NEW_LINE>upgradeTimeField = getRecordValue(cursor, Position.UPGRADE_TIME);<NEW_LINE>long lastClosedTransactionLogVersion = getRecordValue(cursor, Position.LAST_CLOSED_TRANSACTION_LOG_VERSION);<NEW_LINE>long lastClosedTransactionLogByteOffset = <MASK><NEW_LINE>lastClosedTx.set(lastCommittedTxId, new long[] { lastClosedTransactionLogVersion, lastClosedTransactionLogByteOffset });<NEW_LINE>highestCommittedTransaction.set(lastCommittedTxId, (int) getRecordValue(cursor, Position.LAST_TRANSACTION_CHECKSUM), getRecordValue(cursor, Position.LAST_TRANSACTION_COMMIT_TIMESTAMP, UNKNOWN_TX_COMMIT_TIMESTAMP));<NEW_LINE>upgradeCommitTimestampField = getRecordValue(cursor, Position.UPGRADE_TRANSACTION_COMMIT_TIMESTAMP, BASE_TX_COMMIT_TIMESTAMP);<NEW_LINE>externalStoreUUID = readExternalStoreUUID(cursor);<NEW_LINE>databaseUUID = readDatabaseUUID(cursor);<NEW_LINE>upgradeTransaction = new TransactionId(upgradeTxIdField, upgradeTxChecksumField, upgradeCommitTimestampField);<NEW_LINE>checkpointLogVersionField = getRecordValue(cursor, CHECKPOINT_LOG_VERSION, 0);<NEW_LINE>kernelVersion = getRecordValue(cursor, KERNEL_VERSION);<NEW_LINE>} while (cursor.shouldRetry());<NEW_LINE>if (cursor.checkAndClearBoundsFlag()) {<NEW_LINE>throw new UnderlyingStorageException("Out of page bounds when reading all meta-data fields. The page in question is page " + cursor.getCurrentPageId() + " of file " + storageFile.toAbsolutePath() + ", which is " + cursor.getCurrentPageSize() + " bytes in size");<NEW_LINE>}<NEW_LINE>}
getRecordValue(cursor, Position.LAST_CLOSED_TRANSACTION_LOG_BYTE_OFFSET);
1,129,611
protected Object valueOf(Object value) {<NEW_LINE>Class type = definition.getDataType();<NEW_LINE>if (value == null) {<NEW_LINE>return value;<NEW_LINE>} else if (type.isAssignableFrom(value.getClass())) {<NEW_LINE>return value;<NEW_LINE>} else if (value instanceof String) {<NEW_LINE>if (type.equals(Boolean.class)) {<NEW_LINE>return Boolean.valueOf((String) value);<NEW_LINE>} else if (type.equals(Integer.class)) {<NEW_LINE>return Integer.valueOf((String) value);<NEW_LINE>} else if (type.equals(BigDecimal.class)) {<NEW_LINE>return <MASK><NEW_LINE>} else if (type.equals(Long.class)) {<NEW_LINE>return Long.valueOf((String) value);<NEW_LINE>} else if (type.equals(List.class)) {<NEW_LINE>return StringUtil.splitAndTrim((String) value, ",");<NEW_LINE>} else {<NEW_LINE>throw new UnexpectedLiquibaseException("Cannot parse property " + value.getClass().getSimpleName() + " to a " + type.getSimpleName());<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>throw new UnexpectedLiquibaseException("Could not convert " + value.getClass().getSimpleName() + " to a " + type.getSimpleName());<NEW_LINE>}<NEW_LINE>}
new BigDecimal((String) value);
1,757,961
Configuration toConfigurationNode(String subnetId, ConvertedConfiguration awsConfiguration, Region region, Warnings warnings) {<NEW_LINE>Configuration cfgNode = Utils.newAwsConfiguration(getNodeId(subnetId, _id), "aws", DeviceModel.AWS_VPC_ENDPOINT_INTERFACE);<NEW_LINE>cfgNode.setHumanName<MASK><NEW_LINE>cfgNode.getVendorFamily().getAws().setVpcId(_vpcId);<NEW_LINE>cfgNode.getVendorFamily().getAws().setSubnetId(subnetId);<NEW_LINE>cfgNode.getVendorFamily().getAws().setRegion(region.getName());<NEW_LINE>Subnet subnet = region.getSubnets().get(subnetId);<NEW_LINE>if (subnet == null) {<NEW_LINE>warnings.redFlag(String.format("Subnet with id %s, associated with VPC endpoint %s, not found", subnetId, _id));<NEW_LINE>return cfgNode;<NEW_LINE>}<NEW_LINE>// find the network interface that is in this subnet and is one of our interfaces<NEW_LINE>Optional<NetworkInterface> networkInterface = region.getNetworkInterfaces().values().stream().filter(iface -> _networkInterfaceIds.contains(iface.getId()) && iface.getSubnetId().equals(subnetId)).findFirst();<NEW_LINE>if (!networkInterface.isPresent()) {<NEW_LINE>warnings.redFlag(String.format("Network interface not found for VPC endpoint %s in subnet %s", _id, subnetId));<NEW_LINE>return cfgNode;<NEW_LINE>}<NEW_LINE>Interface viIface = addNodeToSubnet(cfgNode, networkInterface.get(), subnet, awsConfiguration, warnings);<NEW_LINE>// Create LocationInfo the interface<NEW_LINE>cfgNode.setLocationInfo(ImmutableMap.of(interfaceLocation(viIface), instanceInterfaceLocationInfo(viIface), interfaceLinkLocation(viIface), INSTANCE_INTERFACE_LINK_LOCATION_INFO));<NEW_LINE>return cfgNode;<NEW_LINE>}
(_tags.get(TAG_NAME));
890,893
public void update(NQueensBoard board) {<NEW_LINE>int size = board.getSize();<NEW_LINE>if (queens.length != size * size) {<NEW_LINE>gridPane.getChildren().clear();<NEW_LINE>gridPane.getColumnConstraints().clear();<NEW_LINE>gridPane.getRowConstraints().clear();<NEW_LINE>queens = new Polygon[size * size];<NEW_LINE>RowConstraints c1 = new RowConstraints();<NEW_LINE>c1.setPercentHeight(100.0 / size);<NEW_LINE>ColumnConstraints c2 = new ColumnConstraints();<NEW_LINE>c2.setPercentWidth(100.0 / size);<NEW_LINE>for (int i = 0; i < board.getSize(); i++) {<NEW_LINE>gridPane.<MASK><NEW_LINE>gridPane.getColumnConstraints().add(c2);<NEW_LINE>}<NEW_LINE>for (int i = 0; i < queens.length; i++) {<NEW_LINE>StackPane field = new StackPane();<NEW_LINE>queens[i] = createQueen();<NEW_LINE>field.getChildren().add(queens[i]);<NEW_LINE>int col = i % size;<NEW_LINE>int row = i / size;<NEW_LINE>field.setBackground(new Background(new BackgroundFill((col % 2 == row % 2) ? Color.WHITE : Color.LIGHTGRAY, null, null)));<NEW_LINE>gridPane.add(field, col, row);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>double scale = 0.2 * gridPane.getWidth() / gridPane.getColumnConstraints().size();<NEW_LINE>for (int i = 0; i < queens.length; i++) {<NEW_LINE>Polygon queen = queens[i];<NEW_LINE>queen.setScaleX(scale);<NEW_LINE>queen.setScaleY(scale);<NEW_LINE>XYLocation loc = new XYLocation(i % size, i / size);<NEW_LINE>if (board.queenExistsAt(loc)) {<NEW_LINE>queen.setVisible(true);<NEW_LINE>queen.setFill(board.isSquareUnderAttack(loc) ? Color.RED : Color.BLACK);<NEW_LINE>} else {<NEW_LINE>queen.setVisible(false);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
getRowConstraints().add(c1);
1,249,022
public void saveGraph(DirectedGraph graph, String destFile) throws IOException {<NEW_LINE>if (graph == null)<NEW_LINE>throw new NullPointerException("Cannot dump null graph");<NEW_LINE>if (destFile == null)<NEW_LINE>throw new NullPointerException("No destination file");<NEW_LINE>logger.debug("Dumping directed graph in Mary format to " + destFile + " ...");<NEW_LINE>// Open the destination file and output the header<NEW_LINE>DataOutputStream out = new DataOutputStream(new BufferedOutputStream(new FileOutputStream(destFile)));<NEW_LINE>// create new CART-header and write it to output file<NEW_LINE>MaryHeader hdr = new MaryHeader(MaryHeader.DIRECTED_GRAPH);<NEW_LINE>hdr.writeTo(out);<NEW_LINE>Properties props = graph.getProperties();<NEW_LINE>if (props == null) {<NEW_LINE>out.writeShort(0);<NEW_LINE>} else {<NEW_LINE>ByteArrayOutputStream baos = new ByteArrayOutputStream();<NEW_LINE>props.store(baos, null);<NEW_LINE>byte[] propData = baos.toByteArray();<NEW_LINE>out.writeShort(propData.length);<NEW_LINE>out.write(propData);<NEW_LINE>}<NEW_LINE>// feature definition<NEW_LINE>graph.<MASK><NEW_LINE>// dump graph<NEW_LINE>dumpBinary(graph, out);<NEW_LINE>// finish<NEW_LINE>out.close();<NEW_LINE>logger.debug(" ... done\n");<NEW_LINE>}
getFeatureDefinition().writeBinaryTo(out);
1,670,127
private static Timestamp calculateDateDue(Timestamp DocDate, int FixMonthDay, int FixMonthOffset, int FixMonthCutoff) {<NEW_LINE>GregorianCalendar cal = new GregorianCalendar();<NEW_LINE>cal.setTime(DocDate);<NEW_LINE>cal.set(Calendar.HOUR_OF_DAY, 0);<NEW_LINE>cal.<MASK><NEW_LINE>cal.set(Calendar.SECOND, 0);<NEW_LINE>cal.set(Calendar.MILLISECOND, 0);<NEW_LINE>// Cutoff<NEW_LINE>int maxDayCut = cal.getActualMaximum(Calendar.DAY_OF_MONTH);<NEW_LINE>if (// 28-Feb<NEW_LINE>FixMonthCutoff > maxDayCut)<NEW_LINE>cal.set(Calendar.DAY_OF_MONTH, maxDayCut);<NEW_LINE>else<NEW_LINE>cal.set(Calendar.DAY_OF_MONTH, FixMonthCutoff);<NEW_LINE>if (DocDate.after(cal.getTime()))<NEW_LINE>FixMonthOffset += 1;<NEW_LINE>cal.add(Calendar.MONTH, FixMonthOffset);<NEW_LINE>// Due Date<NEW_LINE>int maxDay = cal.getActualMaximum(Calendar.DAY_OF_MONTH);<NEW_LINE>if (// 32 -> 28<NEW_LINE>FixMonthDay > maxDay)<NEW_LINE>cal.set(Calendar.DAY_OF_MONTH, maxDay);<NEW_LINE>else if (// 30 -> 31<NEW_LINE>FixMonthDay >= 30 && maxDay > FixMonthDay)<NEW_LINE>cal.set(Calendar.DAY_OF_MONTH, maxDay);<NEW_LINE>else<NEW_LINE>cal.set(Calendar.DAY_OF_MONTH, FixMonthDay);<NEW_LINE>//<NEW_LINE>java.util.Date temp = cal.getTime();<NEW_LINE>return new Timestamp(temp.getTime());<NEW_LINE>}
set(Calendar.MINUTE, 0);
710,702
private static HybridInspectResponse inspectRowsWithHybrid(DlpServiceClient dlpClient, String hybridJobName, List<FieldId> headers, List<Table.Row> rows, HybridFindingDetails hybridFindingDetails) {<NEW_LINE>Table table = Table.newBuilder().addAllHeaders(headers).addAllRows(rows).build();<NEW_LINE>ContentItem tableItem = ContentItem.newBuilder().setTable(table).build();<NEW_LINE>System.out.print(".");<NEW_LINE>HybridContentItem hybridContentItem = HybridContentItem.newBuilder().setItem(tableItem).setFindingDetails(hybridFindingDetails).build();<NEW_LINE>// Use either HybridDlpJob or HybridJobTrigger depending on the command line parameter<NEW_LINE>if (hybridJobName.contains("/dlpJobs/i-")) {<NEW_LINE>HybridInspectDlpJobRequest request = HybridInspectDlpJobRequest.newBuilder().setName(hybridJobName).<MASK><NEW_LINE>return dlpClient.hybridInspectDlpJob(request);<NEW_LINE>} else {<NEW_LINE>HybridInspectJobTriggerRequest request = HybridInspectJobTriggerRequest.newBuilder().setName(hybridJobName).setHybridItem(hybridContentItem).build();<NEW_LINE>return dlpClient.hybridInspectJobTrigger(request);<NEW_LINE>}<NEW_LINE>}
setHybridItem(hybridContentItem).build();
462,843
protected void doCommit(TableMetadata base, TableMetadata metadata) {<NEW_LINE>String newMetadataLocation = writeNewMetadata(metadata, currentVersion() + 1);<NEW_LINE>CommitStatus commitStatus = CommitStatus.FAILURE;<NEW_LINE>try {<NEW_LINE>lock(newMetadataLocation);<NEW_LINE>Table glueTable = getGlueTable();<NEW_LINE>checkMetadataLocation(glueTable, base);<NEW_LINE>Map<String, String> properties = prepareProperties(glueTable, newMetadataLocation);<NEW_LINE>persistGlueTable(glueTable, properties, metadata);<NEW_LINE>commitStatus = CommitStatus.SUCCESS;<NEW_LINE>} catch (CommitFailedException e) {<NEW_LINE>throw e;<NEW_LINE>} catch (ConcurrentModificationException e) {<NEW_LINE>throw new CommitFailedException(e, "Cannot commit %s because Glue detected concurrent update", tableName());<NEW_LINE>} catch (software.amazon.awssdk.services.glue.model.AlreadyExistsException e) {<NEW_LINE>throw new AlreadyExistsException(<MASK><NEW_LINE>} catch (RuntimeException persistFailure) {<NEW_LINE>LOG.error("Confirming if commit to {} indeed failed to persist, attempting to reconnect and check.", fullTableName, persistFailure);<NEW_LINE>commitStatus = checkCommitStatus(newMetadataLocation, metadata);<NEW_LINE>switch(commitStatus) {<NEW_LINE>case SUCCESS:<NEW_LINE>break;<NEW_LINE>case FAILURE:<NEW_LINE>throw new CommitFailedException(persistFailure, "Cannot commit %s due to unexpected exception", tableName());<NEW_LINE>case UNKNOWN:<NEW_LINE>throw new CommitStateUnknownException(persistFailure);<NEW_LINE>}<NEW_LINE>} finally {<NEW_LINE>cleanupMetadataAndUnlock(commitStatus, newMetadataLocation);<NEW_LINE>}<NEW_LINE>}
e, "Cannot commit %s because its Glue table already exists when trying to create one", tableName());
1,566,486
private AWTEvent mapMetaState(@Nonnull AWTEvent e) {<NEW_LINE>if (myWinMetaPressed) {<NEW_LINE>Application app = ApplicationManager.getApplication();<NEW_LINE>boolean weAreNotActive = app == <MASK><NEW_LINE>weAreNotActive |= e instanceof FocusEvent && ((FocusEvent) e).getOppositeComponent() == null;<NEW_LINE>if (weAreNotActive) {<NEW_LINE>myWinMetaPressed = false;<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (e instanceof KeyEvent) {<NEW_LINE>KeyEvent ke = (KeyEvent) e;<NEW_LINE>if (ke.getKeyCode() == KeyEvent.VK_WINDOWS) {<NEW_LINE>if (ke.getID() == KeyEvent.KEY_PRESSED)<NEW_LINE>myWinMetaPressed = true;<NEW_LINE>if (ke.getID() == KeyEvent.KEY_RELEASED)<NEW_LINE>myWinMetaPressed = false;<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>if (myWinMetaPressed) {<NEW_LINE>return new KeyEvent(ke.getComponent(), ke.getID(), ke.getWhen(), ke.getModifiers() | ke.getModifiersEx() | InputEvent.META_MASK, ke.getKeyCode(), ke.getKeyChar(), ke.getKeyLocation());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (myWinMetaPressed && e instanceof MouseEvent && ((MouseEvent) e).getButton() != 0) {<NEW_LINE>MouseEvent me = (MouseEvent) e;<NEW_LINE>return new MouseEvent(me.getComponent(), me.getID(), me.getWhen(), me.getModifiers() | me.getModifiersEx() | InputEvent.META_MASK, me.getX(), me.getY(), me.getClickCount(), me.isPopupTrigger(), me.getButton());<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>}
null || !app.isActive();
1,479,595
private TableViewer createServerTable(Composite parent) {<NEW_LINE>TableViewer tableViewer = new TableViewer(parent, SWT.SINGLE | SWT.FULL_SELECTION);<NEW_LINE>Table serverTable = tableViewer.getTable();<NEW_LINE>serverTable.setHeaderVisible(true);<NEW_LINE>serverTable.setLinesVisible(true);<NEW_LINE>serverTable.setLayoutData(<MASK><NEW_LINE>TableColumn nameCol = new TableColumn(serverTable, SWT.LEFT);<NEW_LINE>nameCol.setText(Messages.ServersView_NAME);<NEW_LINE>nameCol.setWidth(150);<NEW_LINE>TableColumn statusCol = new TableColumn(serverTable, SWT.LEFT);<NEW_LINE>statusCol.setText(Messages.ServersView_STATUS);<NEW_LINE>statusCol.setWidth(75);<NEW_LINE>TableColumn typeColumn = new TableColumn(serverTable, SWT.LEFT);<NEW_LINE>typeColumn.setText(Messages.ServersView_TYPE);<NEW_LINE>typeColumn.setWidth(125);<NEW_LINE>TableColumn hostColumn = new TableColumn(serverTable, SWT.LEFT);<NEW_LINE>hostColumn.setText(Messages.GenericServersView_HOST);<NEW_LINE>hostColumn.setWidth(150);<NEW_LINE>TableColumn portColumn = new TableColumn(serverTable, SWT.LEFT);<NEW_LINE>portColumn.setText(Messages.GenericServersView_PORT);<NEW_LINE>portColumn.setWidth(50);<NEW_LINE>WebServerCorePlugin.getDefault().getServerManager().addServerChangeListener(this);<NEW_LINE>tableViewer.setLabelProvider(new ServerLabelProvider());<NEW_LINE>tableViewer.setContentProvider(ArrayContentProvider.getInstance());<NEW_LINE>tableViewer.setInput(WebServerCorePlugin.getDefault().getServerManager().getServers());<NEW_LINE>return tableViewer;<NEW_LINE>}
new GridData(GridData.FILL_BOTH));
689,889
private void populateTabStrip() {<NEW_LINE>final PagerAdapter adapter = mViewPager.getAdapter();<NEW_LINE>final View.OnClickListener tabClickListener = new TabClickListener();<NEW_LINE>final DisplayMetrics metrics = getResources().getDisplayMetrics();<NEW_LINE>final float fontSize = TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_SP, TAB_VIEW_TEXT_SIZE_SP, metrics);<NEW_LINE>final TextPaint paint = new TextPaint();<NEW_LINE>paint.setTextSize(fontSize);<NEW_LINE>paint.setTypeface(Typeface.DEFAULT_BOLD);<NEW_LINE>int targetWidth = 0;<NEW_LINE>final int tabs = adapter.getCount();<NEW_LINE>for (int i = 0; i < tabs; i++) {<NEW_LINE>String str = adapter.getPageTitle(i).toString();<NEW_LINE>str = str.toUpperCase(Locale.getDefault());<NEW_LINE>int width = (<MASK><NEW_LINE>width = width + 2 * mTabPadding;<NEW_LINE>if (width > targetWidth) {<NEW_LINE>targetWidth = width;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (targetWidth * tabs < metrics.widthPixels) {<NEW_LINE>targetWidth = metrics.widthPixels / tabs;<NEW_LINE>}<NEW_LINE>for (int i = 0; i < adapter.getCount(); i++) {<NEW_LINE>View tabView = null;<NEW_LINE>TextView tabTitleView = null;<NEW_LINE>if (mTabViewLayoutId != 0) {<NEW_LINE>// If there is a custom tab view layout id set, try and inflate it<NEW_LINE>tabView = LayoutInflater.from(getContext()).inflate(mTabViewLayoutId, mTabStrip, false);<NEW_LINE>tabTitleView = tabView.findViewById(mTabViewTextViewId);<NEW_LINE>}<NEW_LINE>if (tabView == null) {<NEW_LINE>tabView = createDefaultTabView(getContext());<NEW_LINE>}<NEW_LINE>if (tabTitleView == null && TextView.class.isInstance(tabView)) {<NEW_LINE>tabTitleView = (TextView) tabView;<NEW_LINE>}<NEW_LINE>if (tabTitleView != null) {<NEW_LINE>tabTitleView.setText(adapter.getPageTitle(i));<NEW_LINE>}<NEW_LINE>tabView.setOnClickListener(tabClickListener);<NEW_LINE>final LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(targetWidth, ViewGroup.LayoutParams.WRAP_CONTENT);<NEW_LINE>mTabStrip.addView(tabView, params);<NEW_LINE>}<NEW_LINE>}
int) paint.measureText(str);
1,596,738
private void updateFieldInDb(Field field) throws DotDataException {<NEW_LINE>DotConnect dc = new DotConnect();<NEW_LINE>dc.setSQL(sql.updateField);<NEW_LINE>dc.addParam(field.contentTypeId());<NEW_LINE>dc.addParam(field.name());<NEW_LINE>dc.addParam(field.type().getCanonicalName());<NEW_LINE>dc.addParam(field.relationType());<NEW_LINE>dc.addParam(field.dbColumn());<NEW_LINE>dc.addParam(field.required());<NEW_LINE>dc.addParam(field.indexed());<NEW_LINE>dc.addParam(field.listed());<NEW_LINE>dc.addParam(field.variable());<NEW_LINE>dc.addParam(field.sortOrder());<NEW_LINE>dc.addParam(field.values());<NEW_LINE>dc.addParam(field.regexCheck());<NEW_LINE>dc.addParam(field.hint());<NEW_LINE>dc.addParam(field.defaultValue());<NEW_LINE>dc.addParam(field.fixed());<NEW_LINE>dc.addParam(field.readOnly());<NEW_LINE>dc.<MASK><NEW_LINE>dc.addParam(field.unique());<NEW_LINE>dc.addParam(field.modDate());<NEW_LINE>dc.addParam(field.id());<NEW_LINE>dc.loadResult();<NEW_LINE>}
addParam(field.searchable());
377,740
final CompleteMultipartUploadResult executeCompleteMultipartUpload(CompleteMultipartUploadRequest completeMultipartUploadRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(completeMultipartUploadRequest);<NEW_LINE><MASK><NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<CompleteMultipartUploadRequest> request = null;<NEW_LINE>Response<CompleteMultipartUploadResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new CompleteMultipartUploadRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(completeMultipartUploadRequest));<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, "Glacier");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "CompleteMultipartUpload");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<CompleteMultipartUploadResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new CompleteMultipartUploadResultJsonUnmarshaller());<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>}
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
298,196
public void run() {<NEW_LINE>// init remoting server<NEW_LINE>NettyServerConfig serverConfig = new NettyServerConfig();<NEW_LINE>serverConfig.setListenPort(workerConfig.getListenPort());<NEW_LINE>this<MASK><NEW_LINE>this.nettyRemotingServer.registerProcessor(CommandType.TASK_EXECUTE_REQUEST, taskExecuteProcessor);<NEW_LINE>this.nettyRemotingServer.registerProcessor(CommandType.TASK_KILL_REQUEST, taskKillProcessor);<NEW_LINE>this.nettyRemotingServer.registerProcessor(CommandType.TASK_EXECUTE_RUNNING_ACK, taskExecuteRunningAckProcessor);<NEW_LINE>this.nettyRemotingServer.registerProcessor(CommandType.TASK_EXECUTE_RESPONSE_ACK, taskExecuteResponseAckProcessor);<NEW_LINE>this.nettyRemotingServer.registerProcessor(CommandType.PROCESS_HOST_UPDATE_REQUEST, hostUpdateProcessor);<NEW_LINE>// logger server<NEW_LINE>this.nettyRemotingServer.registerProcessor(CommandType.GET_LOG_BYTES_REQUEST, loggerRequestProcessor);<NEW_LINE>this.nettyRemotingServer.registerProcessor(CommandType.ROLL_VIEW_LOG_REQUEST, loggerRequestProcessor);<NEW_LINE>this.nettyRemotingServer.registerProcessor(CommandType.VIEW_WHOLE_LOG_REQUEST, loggerRequestProcessor);<NEW_LINE>this.nettyRemotingServer.registerProcessor(CommandType.REMOVE_TAK_LOG_REQUEST, loggerRequestProcessor);<NEW_LINE>this.nettyRemotingServer.start();<NEW_LINE>// worker registry<NEW_LINE>try {<NEW_LINE>this.workerRegistryClient.registry();<NEW_LINE>this.workerRegistryClient.setRegistryStoppable(this);<NEW_LINE>Set<String> workerZkPaths = this.workerRegistryClient.getWorkerZkPaths();<NEW_LINE>this.workerRegistryClient.handleDeadServer(workerZkPaths, NodeType.WORKER, Constants.DELETE_OP);<NEW_LINE>} catch (Exception e) {<NEW_LINE>logger.error(e.getMessage(), e);<NEW_LINE>throw new RuntimeException(e);<NEW_LINE>}<NEW_LINE>// task execute manager<NEW_LINE>this.workerManagerThread.start();<NEW_LINE>// retry report task status<NEW_LINE>this.retryReportTaskStatusThread.start();<NEW_LINE>Runtime.getRuntime().addShutdownHook(new Thread(() -> {<NEW_LINE>if (Stopper.isRunning()) {<NEW_LINE>close("shutdownHook");<NEW_LINE>}<NEW_LINE>}));<NEW_LINE>}
.nettyRemotingServer = new NettyRemotingServer(serverConfig);
917,397
public void toSrt(Path srtFile) {<NEW_LINE>try (FileOutputStream fos = new FileOutputStream(srtFile.toFile());<NEW_LINE>OutputStreamWriter osw = new OutputStreamWriter(fos, StandardCharsets.UTF_8);<NEW_LINE>PrintWriter writer = new PrintWriter(osw)) {<NEW_LINE>long counter = 1;<NEW_LINE>for (Subtitle title : subtitleList) {<NEW_LINE>writer.println(counter);<NEW_LINE>writer.println(srtFormat.format(title.begin) + " --> " + srtFormat<MASK><NEW_LINE>for (StyledString entry : title.listOfStrings) {<NEW_LINE>if (!entry.color.isEmpty()) {<NEW_LINE>writer.print("<font color=\"" + entry.color + "\">");<NEW_LINE>}<NEW_LINE>writer.print(entry.text);<NEW_LINE>if (!entry.color.isEmpty()) {<NEW_LINE>writer.print("</font>");<NEW_LINE>}<NEW_LINE>writer.println();<NEW_LINE>}<NEW_LINE>writer.println("");<NEW_LINE>counter++;<NEW_LINE>}<NEW_LINE>} catch (Exception ex) {<NEW_LINE>logger.error("File: " + srtFile, ex);<NEW_LINE>}<NEW_LINE>}
.format(title.end));
681,226
final TagResourceResult executeTagResource(TagResourceRequest tagResourceRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(tagResourceRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<TagResourceRequest> request = null;<NEW_LINE>Response<TagResourceResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new TagResourceRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(tagResourceRequest));<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, "schemas");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "TagResource");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<TagResourceResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new TagResourceResultJsonUnmarshaller());<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);
985,528
// re-compute the editor state with the cursor location implied by the passed slide index<NEW_LINE>public static PresentationEditorLocation locationForSlideIndex(int slideIndex, PresentationEditorLocation location, int slideLevel) {<NEW_LINE>// determine the slide level (either the arg, which is explicitly from the user, or<NEW_LINE>// from the location, which we auto-detected with the same logic as pandoc)<NEW_LINE>if (slideLevel == -1)<NEW_LINE>slideLevel = location.getAutoSlideLevel();<NEW_LINE>// break into slides<NEW_LINE>JsArray<PresentationEditorSlide> slides = asSlides(location, slideLevel, false);<NEW_LINE>// insert the cursor in the requisite slide<NEW_LINE>if (slideIndex < slides.length()) {<NEW_LINE>PresentationEditorSlide slide = slides.get(slideIndex);<NEW_LINE>slide.getItems().unshift(PresentationEditorLocationItem.cursor(slide.getItems().get(0).getRow()));<NEW_LINE>}<NEW_LINE>// unroll the slides into a new location<NEW_LINE>JsArray<PresentationEditorLocationItem> items = JsArray.createArray().cast();<NEW_LINE>for (int i = 0; i < slides.length(); i++) {<NEW_LINE>PresentationEditorSlide <MASK><NEW_LINE>for (int j = 0; j < slide.getItems().length(); j++) {<NEW_LINE>items.push(slide.getItems().get(j));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return PresentationEditorLocation.create(items, location.getAutoSlideLevel());<NEW_LINE>}
slide = slides.get(i);
580,761
public void transformJson(HistoryJobEntity job, ObjectNode historicalData, CommandContext commandContext) {<NEW_LINE>HistoricCaseInstanceEntityManager historicCaseInstanceEntityManager = cmmnEngineConfiguration.getHistoricCaseInstanceEntityManager();<NEW_LINE>HistoricCaseInstanceEntity historicCaseInstanceEntity = getHistoricCaseInstanceEntity(historicalData, commandContext);<NEW_LINE>if (historicCaseInstanceEntity == null) {<NEW_LINE>historicCaseInstanceEntity = historicCaseInstanceEntityManager.create();<NEW_LINE>historicCaseInstanceEntity.setId(getStringFromJson(historicalData, CmmnAsyncHistoryConstants.FIELD_ID));<NEW_LINE>historicCaseInstanceEntity.setName(getStringFromJson(historicalData, CmmnAsyncHistoryConstants.FIELD_NAME));<NEW_LINE>historicCaseInstanceEntity.setBusinessKey(getStringFromJson(historicalData, CmmnAsyncHistoryConstants.FIELD_BUSINESS_KEY));<NEW_LINE>historicCaseInstanceEntity.setBusinessStatus(getStringFromJson(historicalData, CmmnAsyncHistoryConstants.FIELD_BUSINESS_STATUS));<NEW_LINE>historicCaseInstanceEntity.setParentId(getStringFromJson(historicalData, CmmnAsyncHistoryConstants.FIELD_PARENT_ID));<NEW_LINE>historicCaseInstanceEntity.setCaseDefinitionId(getStringFromJson(historicalData, CmmnAsyncHistoryConstants.FIELD_CASE_DEFINITION_ID));<NEW_LINE>historicCaseInstanceEntity.setState(getStringFromJson(historicalData, CmmnAsyncHistoryConstants.FIELD_STATE));<NEW_LINE>historicCaseInstanceEntity.setStartUserId(getStringFromJson(historicalData, CmmnAsyncHistoryConstants.FIELD_START_USER_ID));<NEW_LINE>historicCaseInstanceEntity.setStartTime(getDateFromJson(historicalData, CmmnAsyncHistoryConstants.FIELD_START_TIME));<NEW_LINE>historicCaseInstanceEntity.setCallbackId(getStringFromJson<MASK><NEW_LINE>historicCaseInstanceEntity.setCallbackType(getStringFromJson(historicalData, CmmnAsyncHistoryConstants.FIELD_CALLBACK_TYPE));<NEW_LINE>historicCaseInstanceEntity.setReferenceId(getStringFromJson(historicalData, CmmnAsyncHistoryConstants.FIELD_REFERENCE_ID));<NEW_LINE>historicCaseInstanceEntity.setReferenceType(getStringFromJson(historicalData, CmmnAsyncHistoryConstants.FIELD_REFERENCE_TYPE));<NEW_LINE>historicCaseInstanceEntity.setTenantId(getStringFromJson(historicalData, CmmnAsyncHistoryConstants.FIELD_TENANT_ID));<NEW_LINE>historicCaseInstanceEntityManager.insert(historicCaseInstanceEntity);<NEW_LINE>} else {<NEW_LINE>Date endTime = getDateFromJson(historicalData, CmmnAsyncHistoryConstants.FIELD_END_TIME);<NEW_LINE>historicCaseInstanceEntity.setEndTime(endTime);<NEW_LINE>historicCaseInstanceEntity.setState(getStringFromJson(historicalData, CmmnAsyncHistoryConstants.FIELD_STATE));<NEW_LINE>historicCaseInstanceEntityManager.update(historicCaseInstanceEntity);<NEW_LINE>}<NEW_LINE>}
(historicalData, CmmnAsyncHistoryConstants.FIELD_CALLBACK_ID));
329,478
final StopEntitiesDetectionV2JobResult executeStopEntitiesDetectionV2Job(StopEntitiesDetectionV2JobRequest stopEntitiesDetectionV2JobRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(stopEntitiesDetectionV2JobRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<StopEntitiesDetectionV2JobRequest> request = null;<NEW_LINE>Response<StopEntitiesDetectionV2JobResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new StopEntitiesDetectionV2JobRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(stopEntitiesDetectionV2JobRequest));<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, "ComprehendMedical");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "StopEntitiesDetectionV2Job");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<StopEntitiesDetectionV2JobResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new StopEntitiesDetectionV2JobResultJsonUnmarshaller());<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>}
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
1,446,875
public void propertyChange(PropertyChangeEvent event) {<NEW_LINE>if (event.getPropertyName().equals(PreviewLabel.BACKGROUND_COLOR_PROPERTY_NAME))<NEW_LINE>getViewport().setBackground(data.getColor(isActive ? Theme.FILE_TABLE_BACKGROUND_COLOR : Theme.FILE_TABLE_INACTIVE_BACKGROUND_COLOR));<NEW_LINE>else if (event.getPropertyName().equals(PreviewLabel.BORDER_COLOR_PROPERTY_NAME)) {<NEW_LINE>// Some (rather evil) look and feels will change borders outside of muCommander's control,<NEW_LINE>// this check is necessary to ensure no exception is thrown.<NEW_LINE>if (getBorder() instanceof MutableLineBorder)<NEW_LINE>((MutableLineBorder) getBorder()).setLineColor(data.getColor(isActive ? Theme<MASK><NEW_LINE>} else if (!event.getPropertyName().equals(PreviewLabel.FOREGROUND_COLOR_PROPERTY_NAME))<NEW_LINE>return;<NEW_LINE>repaint();<NEW_LINE>}
.FILE_TABLE_BORDER_COLOR : Theme.FILE_TABLE_INACTIVE_BORDER_COLOR));
1,791,824
protected static final QueryMap parseApiRequestQueryParams(String queryString) {<NEW_LINE>QueryMap rval = new QueryMap();<NEW_LINE>if (queryString != null) {<NEW_LINE>try {<NEW_LINE>// $NON-NLS-1$<NEW_LINE>String[] pairSplit = queryString.split("&");<NEW_LINE>for (String paramPair : pairSplit) {<NEW_LINE>// $NON-NLS-1$<NEW_LINE>int <MASK><NEW_LINE>String key, value;<NEW_LINE>if (idx != -1) {<NEW_LINE>// $NON-NLS-1$<NEW_LINE>key = URLDecoder.decode(paramPair.substring(0, idx), "UTF-8");<NEW_LINE>// $NON-NLS-1$<NEW_LINE>value = URLDecoder.decode(paramPair.substring(idx + 1), "UTF-8");<NEW_LINE>} else {<NEW_LINE>// $NON-NLS-1$<NEW_LINE>key = URLDecoder.decode(paramPair, "UTF-8");<NEW_LINE>value = null;<NEW_LINE>}<NEW_LINE>rval.add(key, value);<NEW_LINE>}<NEW_LINE>} catch (UnsupportedEncodingException e) {<NEW_LINE>throw new RuntimeException(e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return rval;<NEW_LINE>}
idx = paramPair.indexOf("=");
1,022,957
private static Geometry readPolygon(ByteBuffer byteBuffer, boolean multitype, GeometryFactory factory) {<NEW_LINE>int partCount = byteBuffer.getInt();<NEW_LINE>if (partCount == 0) {<NEW_LINE>if (multitype) {<NEW_LINE>return factory.createMultiPolygon();<NEW_LINE>}<NEW_LINE>return factory.createPolygon();<NEW_LINE>}<NEW_LINE>int pointCount = byteBuffer.getInt();<NEW_LINE>int[] startIndexes = new int[partCount];<NEW_LINE>for (int i = 0; i < partCount; i++) {<NEW_LINE>startIndexes[i] = byteBuffer.getInt();<NEW_LINE>}<NEW_LINE>int[] partLengths = new int[partCount];<NEW_LINE>if (partCount > 1) {<NEW_LINE>partLengths[0] = startIndexes[1];<NEW_LINE>for (int i = 1; i < partCount - 1; i++) {<NEW_LINE>partLengths[i] = startIndexes[i <MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>partLengths[partCount - 1] = pointCount - startIndexes[partCount - 1];<NEW_LINE>LinearRing shell = null;<NEW_LINE>List<LinearRing> holes = new ArrayList<>();<NEW_LINE>List<Polygon> polygons = new ArrayList<>();<NEW_LINE>try {<NEW_LINE>for (int i = 0; i < partCount; i++) {<NEW_LINE>Coordinate[] coordinates = readCoordinates(byteBuffer, partLengths[i]);<NEW_LINE>if (isClockwise(coordinates)) {<NEW_LINE>// next polygon has started<NEW_LINE>if (shell != null) {<NEW_LINE>polygons.add(factory.createPolygon(shell, holes.toArray(new LinearRing[0])));<NEW_LINE>holes.clear();<NEW_LINE>}<NEW_LINE>shell = factory.createLinearRing(coordinates);<NEW_LINE>} else {<NEW_LINE>holes.add(factory.createLinearRing(coordinates));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>polygons.add(factory.createPolygon(shell, holes.toArray(new LinearRing[0])));<NEW_LINE>} catch (IllegalArgumentException e) {<NEW_LINE>throw new TopologyException("Error constructing Polygon: " + e.getMessage());<NEW_LINE>}<NEW_LINE>if (multitype) {<NEW_LINE>return factory.createMultiPolygon(polygons.toArray(new Polygon[0]));<NEW_LINE>}<NEW_LINE>return Iterables.getOnlyElement(polygons);<NEW_LINE>}
+ 1] - startIndexes[i];
815,302
public void run() {<NEW_LINE>EditableProperties ep = null;<NEW_LINE>EditableProperties ep1 = null;<NEW_LINE>try {<NEW_LINE>ep = WSUtils.getEditableProperties(project, AntProjectHelper.PROJECT_PROPERTIES_PATH);<NEW_LINE>ep1 = WSUtils.getEditableProperties(project, AntProjectHelper.PRIVATE_PROPERTIES_PATH);<NEW_LINE>assert ep != null;<NEW_LINE>assert ep1 != null;<NEW_LINE>} catch (IOException ex) {<NEW_LINE>ErrorManager.<MASK><NEW_LINE>}<NEW_LINE>boolean proxyModif = addJVMProxyOptions(ep);<NEW_LINE>if (proxyModif)<NEW_LINE>try {<NEW_LINE>WSUtils.storeEditableProperties(project, AntProjectHelper.PROJECT_PROPERTIES_PATH, ep);<NEW_LINE>ProjectManager.getDefault().saveProject(project);<NEW_LINE>} catch (IOException ex) {<NEW_LINE>NotifyDescriptor desc = new // NOI18N<NEW_LINE>NotifyDescriptor.Message(NbBundle.getMessage(J2SEProjectJAXWSClientSupport.class, "MSG_ErrorSavingOnWSClientAdd", clientName, ex.getLocalizedMessage()), NotifyDescriptor.ERROR_MESSAGE);<NEW_LINE>DialogDisplayer.getDefault().notify(desc);<NEW_LINE>}<NEW_LINE>}
getDefault().notify(ex);
1,165,180
public RankProfile clone() {<NEW_LINE>try {<NEW_LINE>RankProfile clone = (RankProfile) super.clone();<NEW_LINE>clone.rankSettings = new LinkedHashSet<>(this.rankSettings);<NEW_LINE>// hmm?<NEW_LINE>clone.matchPhaseSettings = this.matchPhaseSettings;<NEW_LINE>clone.summaryFeatures = summaryFeatures != null ? new LinkedHashSet<>(this.summaryFeatures) : null;<NEW_LINE>clone.matchFeatures = matchFeatures != null ? new LinkedHashSet<<MASK><NEW_LINE>clone.rankFeatures = rankFeatures != null ? new LinkedHashSet<>(this.rankFeatures) : null;<NEW_LINE>clone.rankProperties = new LinkedHashMap<>(this.rankProperties);<NEW_LINE>clone.inputFeatures = new LinkedHashMap<>(this.inputFeatures);<NEW_LINE>clone.functions = new LinkedHashMap<>(this.functions);<NEW_LINE>clone.allFunctionsCached = null;<NEW_LINE>clone.filterFields = new HashSet<>(this.filterFields);<NEW_LINE>clone.constants = new HashMap<>(this.constants);<NEW_LINE>return clone;<NEW_LINE>} catch (CloneNotSupportedException e) {<NEW_LINE>throw new RuntimeException("Won't happen", e);<NEW_LINE>}<NEW_LINE>}
>(this.matchFeatures) : null;
18,659
public void postProcessMergedBeanDefinition(RootBeanDefinition beanDefinition, Class<?> beanType, String beanName) {<NEW_LINE>if (beanType != null) {<NEW_LINE>if (isReferenceBean(beanDefinition)) {<NEW_LINE>// mark property value as optional<NEW_LINE>List<PropertyValue> propertyValues = beanDefinition<MASK><NEW_LINE>for (PropertyValue propertyValue : propertyValues) {<NEW_LINE>propertyValue.setOptional(true);<NEW_LINE>}<NEW_LINE>} else if (isAnnotatedReferenceBean(beanDefinition)) {<NEW_LINE>// extract beanClass from java-config bean method generic return type: ReferenceBean<DemoService><NEW_LINE>// Class beanClass = getBeanFactory().getType(beanName);<NEW_LINE>} else {<NEW_LINE>AnnotatedInjectionMetadata metadata = findInjectionMetadata(beanName, beanType, null);<NEW_LINE>metadata.checkConfigMembers(beanDefinition);<NEW_LINE>try {<NEW_LINE>prepareInjection(metadata);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new IllegalStateException("Prepare dubbo reference injection element failed", e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
.getPropertyValues().getPropertyValueList();
1,632,170
public Builder mergeFrom(io.kubernetes.client.proto.Meta.APIVersions other) {<NEW_LINE>if (other == io.kubernetes.client.proto.Meta.APIVersions.getDefaultInstance())<NEW_LINE>return this;<NEW_LINE>if (!other.versions_.isEmpty()) {<NEW_LINE>if (versions_.isEmpty()) {<NEW_LINE>versions_ = other.versions_;<NEW_LINE>bitField0_ = (bitField0_ & ~0x00000001);<NEW_LINE>} else {<NEW_LINE>ensureVersionsIsMutable();<NEW_LINE>versions_.addAll(other.versions_);<NEW_LINE>}<NEW_LINE>onChanged();<NEW_LINE>}<NEW_LINE>if (serverAddressByClientCIDRsBuilder_ == null) {<NEW_LINE>if (!other.serverAddressByClientCIDRs_.isEmpty()) {<NEW_LINE>if (serverAddressByClientCIDRs_.isEmpty()) {<NEW_LINE>serverAddressByClientCIDRs_ = other.serverAddressByClientCIDRs_;<NEW_LINE>bitField0_ = (bitField0_ & ~0x00000002);<NEW_LINE>} else {<NEW_LINE>ensureServerAddressByClientCIDRsIsMutable();<NEW_LINE>serverAddressByClientCIDRs_.addAll(other.serverAddressByClientCIDRs_);<NEW_LINE>}<NEW_LINE>onChanged();<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>if (!other.serverAddressByClientCIDRs_.isEmpty()) {<NEW_LINE>if (serverAddressByClientCIDRsBuilder_.isEmpty()) {<NEW_LINE>serverAddressByClientCIDRsBuilder_.dispose();<NEW_LINE>serverAddressByClientCIDRsBuilder_ = null;<NEW_LINE>serverAddressByClientCIDRs_ = other.serverAddressByClientCIDRs_;<NEW_LINE>bitField0_ = (bitField0_ & ~0x00000002);<NEW_LINE>serverAddressByClientCIDRsBuilder_ = com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? getServerAddressByClientCIDRsFieldBuilder() : null;<NEW_LINE>} else {<NEW_LINE>serverAddressByClientCIDRsBuilder_.addAllMessages(other.serverAddressByClientCIDRs_);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>onChanged();<NEW_LINE>return this;<NEW_LINE>}
this.mergeUnknownFields(other.unknownFields);
773,147
private static void tryAssertionNestedDotMethod(RegressionEnvironment env, boolean grouped, boolean soda, AtomicInteger milestone) {<NEW_LINE>RegressionPath path = new RegressionPath();<NEW_LINE>String eplDeclare = "@public create table varaggNDM (" + (grouped ? "key string primary key, " : "") + "windowSupportBean window(*) @type('SupportBean'))";<NEW_LINE>env.compileDeploy(soda, eplDeclare, path);<NEW_LINE>String eplInto = "into table varaggNDM " + "select window(*) as windowSupportBean from SupportBean#length(2)" + (grouped ? " group by theString" : "");<NEW_LINE>env.compileDeploy(soda, eplInto, path);<NEW_LINE>String key = grouped ? "[\"E1\"]" : "";<NEW_LINE>String eplSelect = "@name('s0') select " + "varaggNDM" + key + ".windowSupportBean.last(*).intPrimitive as c0, " + "varaggNDM" + key + ".windowSupportBean.window(*).countOf() as c1, " + "varaggNDM" + key + ".windowSupportBean.window(intPrimitive).take(1) as c2" + " from SupportBean_S0";<NEW_LINE>env.compileDeploy(soda, eplSelect, path).addListener("s0");<NEW_LINE>Object[][] expectedAggType = new Object[][] { { "c0", Integer.class }, { "c1", Integer.class }, { "c2", Collection.class } };<NEW_LINE>env.assertStatement("s0", statement -> SupportEventTypeAssertionUtil.assertEventTypeProperties(expectedAggType, statement.getEventType(), SupportEventTypeAssertionEnum.NAME, SupportEventTypeAssertionEnum.TYPE));<NEW_LINE>String[] fields = "c0,c1,c2".split(",");<NEW_LINE>makeSendBean(env, "E1", 10, 0);<NEW_LINE>env.sendEventBean(new SupportBean_S0(0));<NEW_LINE>env.assertPropsNew("s0", fields, new Object[] { 10, 1, Collections.singletonList(10) });<NEW_LINE>makeSendBean(env, "E1", 20, 0);<NEW_LINE>env.sendEventBean(new SupportBean_S0(0));<NEW_LINE>env.assertPropsNew("s0", fields, new Object[] { 20, 2, Collections.singletonList(10) });<NEW_LINE>env.milestoneInc(milestone);<NEW_LINE>makeSendBean(<MASK><NEW_LINE>env.sendEventBean(new SupportBean_S0(0));<NEW_LINE>env.assertPropsNew("s0", fields, new Object[] { 30, 2, Collections.singletonList(20) });<NEW_LINE>env.undeployAll();<NEW_LINE>}
env, "E1", 30, 0);
917,979
void read(WizardDescriptor settings) {<NEW_LINE>this.wizardDescriptor = settings;<NEW_LINE>String path = null;<NEW_LINE>String projectName = null;<NEW_LINE>// NOI18N<NEW_LINE>File projectLocation = (File) settings.getProperty("projdir");<NEW_LINE>if (projectLocation == null) {<NEW_LINE>projectLocation = ProjectChooser.getProjectsFolder();<NEW_LINE>int index = WizardSettings.getNewProjectCount();<NEW_LINE>// NOI18N<NEW_LINE>String formater = NbBundle.getMessage(PanelSourceFolders.class, "TXT_JavaProject");<NEW_LINE>File file;<NEW_LINE>do {<NEW_LINE>index++;<NEW_LINE>projectName = MessageFormat.format(formater, new Object[] { index });<NEW_LINE>file = new File(projectLocation, projectName);<NEW_LINE>} while (file.exists());<NEW_LINE>settings.putProperty(JavaFXProjectWizardIterator.PROP_NAME_INDEX, index);<NEW_LINE>this.projectLocation.setText(projectLocation.getAbsolutePath());<NEW_LINE>this.setCalculateProjectFolder(true);<NEW_LINE>} else {<NEW_LINE>// NOI18N<NEW_LINE>projectName = (String) settings.getProperty("name");<NEW_LINE>boolean tmpFlag = this.calculatePF;<NEW_LINE>this.projectLocation.setText(projectLocation.getAbsolutePath());<NEW_LINE>this.setCalculateProjectFolder(tmpFlag);<NEW_LINE>}<NEW_LINE>this.projectName.setText(projectName);<NEW_LINE>this.projectName.selectAll();<NEW_LINE>// NOI18N<NEW_LINE>String buildScriptName = (String) settings.getProperty("buildScriptName");<NEW_LINE>if (buildScriptName == null) {<NEW_LINE>assert projectLocation != null;<NEW_LINE>buildScriptName = DEFAULT_BUILD_SCRIPT_NAME;<NEW_LINE>File bf = new File(projectLocation, buildScriptName);<NEW_LINE>if (bf.exists()) {<NEW_LINE>buildScriptName = NB_BUILD_SCRIPT_NAME;<NEW_LINE>}<NEW_LINE>// Todo: Mybe generate other name, like nb-build2.xml - not sure if it's desirable<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>}
this.buildScriptName.setText(buildScriptName);
1,328,139
public void initialize(TemplateWizard wizard) {<NEW_LINE>this.wizard = wizard;<NEW_LINE>// NOI18N<NEW_LINE>selectedText = (String) wizard.getProperty("selectedText");<NEW_LINE>Project project = Templates.getProject(wizard);<NEW_LINE>Sources sources = project.getLookup().lookup(org.netbeans.api.project.Sources.class);<NEW_LINE>SourceGroup[] sourceGroups = <MASK><NEW_LINE>WizardDescriptor.Panel folderPanel;<NEW_LINE>if (sourceGroups == null || sourceGroups.length == 0) {<NEW_LINE>sourceGroups = sources.getSourceGroups(Sources.TYPE_GENERIC);<NEW_LINE>}<NEW_LINE>FileObject targetFolder = null;<NEW_LINE>FileObject resourceFolder = sourceGroups[0].getRootFolder().getFileObject(RESOURCES_FOLDER);<NEW_LINE>if (resourceFolder != null) {<NEW_LINE>FileObject componentFolder = resourceFolder.getFileObject(COMPONENT_FOLDER);<NEW_LINE>if (componentFolder != null) {<NEW_LINE>targetFolder = componentFolder;<NEW_LINE>} else {<NEW_LINE>targetFolder = resourceFolder;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (targetFolder != null) {<NEW_LINE>Templates.setTargetFolder(wizard, targetFolder);<NEW_LINE>}<NEW_LINE>folderPanel = new CompositeComponentWizardPanel(wizard, sourceGroups, selectedText);<NEW_LINE>panels = new WizardDescriptor.Panel[] { folderPanel };<NEW_LINE>// NOI18N<NEW_LINE>Object prop = wizard.getProperty(WizardDescriptor.PROP_CONTENT_DATA);<NEW_LINE>String[] beforeSteps = null;<NEW_LINE>if (prop != null && prop instanceof String[]) {<NEW_LINE>beforeSteps = (String[]) prop;<NEW_LINE>}<NEW_LINE>String[] steps = Utilities.createSteps(beforeSteps, panels);<NEW_LINE>for (int i = 0; i < panels.length; i++) {<NEW_LINE>JComponent jc = (JComponent) panels[i].getComponent();<NEW_LINE>if (steps[i] == null) {<NEW_LINE>steps[i] = jc.getName();<NEW_LINE>}<NEW_LINE>// NOI18N<NEW_LINE>jc.putClientProperty(WizardDescriptor.PROP_CONTENT_SELECTED_INDEX, i);<NEW_LINE>// NOI18N<NEW_LINE>jc.putClientProperty(WizardDescriptor.PROP_CONTENT_DATA, steps);<NEW_LINE>}<NEW_LINE>}
sources.getSourceGroups(WebProjectConstants.TYPE_DOC_ROOT);
67,456
public final void updateView() {<NEW_LINE>this.view.clear();<NEW_LINE>this.view.ensureCapacity(<MASK><NEW_LINE>SearchMode searchMode = SearchMode.NAME;<NEW_LINE>if (AEConfig.instance().getSearchTooltips() != YesNo.NO) {<NEW_LINE>searchMode = SearchMode.NAME_OR_TOOLTIP;<NEW_LINE>}<NEW_LINE>String innerSearch = this.searchString;<NEW_LINE>if (innerSearch.startsWith("@")) {<NEW_LINE>searchMode = SearchMode.MOD;<NEW_LINE>innerSearch = innerSearch.substring(1);<NEW_LINE>}<NEW_LINE>Pattern m;<NEW_LINE>try {<NEW_LINE>m = Pattern.compile(innerSearch.toLowerCase(), Pattern.CASE_INSENSITIVE | Pattern.UNICODE_CASE);<NEW_LINE>} catch (PatternSyntaxException ignored) {<NEW_LINE>m = Pattern.compile(Pattern.quote(innerSearch.toLowerCase()), Pattern.CASE_INSENSITIVE | Pattern.UNICODE_CASE);<NEW_LINE>}<NEW_LINE>var viewMode = this.sortSrc.getSortDisplay();<NEW_LINE>var typeFilter = this.sortSrc.getTypeFilter().getFilter();<NEW_LINE>for (GridInventoryEntry entry : this.entries.values()) {<NEW_LINE>if (this.partitionList != null && !this.partitionList.isListed(entry.getWhat())) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (viewMode == ViewItems.CRAFTABLE && !entry.isCraftable()) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (viewMode == ViewItems.STORED && entry.getStoredAmount() == 0) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (!typeFilter.matches(entry.getWhat())) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (matchesSearch(searchMode, m, entry.getWhat())) {<NEW_LINE>this.view.add(entry);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>SortOrder sortOrder = this.sortSrc.getSortBy();<NEW_LINE>SortDir sortDir = this.sortSrc.getSortDir();<NEW_LINE>this.view.sort(getComparator(sortOrder, sortDir));<NEW_LINE>if (this.updateViewListener != null) {<NEW_LINE>this.updateViewListener.run();<NEW_LINE>}<NEW_LINE>}
this.entries.size());
1,095,346
public void visitSignatureAttribute(Clazz clazz, SignatureAttribute signatureAttribute) {<NEW_LINE>try {<NEW_LINE>// Change the referenced classes.<NEW_LINE>updateReferencedClasses(signatureAttribute.referencedClasses);<NEW_LINE>} catch (RuntimeException e) {<NEW_LINE>logger.error("Unexpected error while adapting signatures for merged classes:");<NEW_LINE>logger.error(" Class = [{}]", clazz.getName());<NEW_LINE>logger.error(" Signature = [{}]", signatureAttribute.getSignature(clazz));<NEW_LINE>Clazz[] referencedClasses = signatureAttribute.referencedClasses;<NEW_LINE>if (referencedClasses != null) {<NEW_LINE>for (int index = 0; index < referencedClasses.length; index++) {<NEW_LINE>Clazz referencedClass = referencedClasses[index];<NEW_LINE>logger.<MASK><NEW_LINE>if (referencedClass != null) {<NEW_LINE>ClassOptimizationInfo info = ClassOptimizationInfo.getClassOptimizationInfo(referencedClass);<NEW_LINE>logger.error(" info = {}", info);<NEW_LINE>if (info != null) {<NEW_LINE>logger.error(" target = {}", info.getTargetClass());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>logger.error(" Exception = [{}] ({})", e.getClass().getName(), e.getMessage());<NEW_LINE>throw e;<NEW_LINE>}<NEW_LINE>}
error(" Referenced class #{} = {}", index, referencedClass);
1,161,238
public void performOperation(POMModel pomModel) {<NEW_LINE>Build build = pomModel.getProject().getBuild();<NEW_LINE>Plugin felixPlugin = null;<NEW_LINE>if (build != null) {<NEW_LINE>felixPlugin = build.findPluginById(OSGiConstants.GROUPID_FELIX, OSGiConstants.ARTIFACTID_BUNDLE_PLUGIN);<NEW_LINE>} else {<NEW_LINE>build = pomModel.getFactory().createBuild();<NEW_LINE>pomModel.getProject().setBuild(build);<NEW_LINE>}<NEW_LINE>Configuration config = null;<NEW_LINE>if (felixPlugin != null) {<NEW_LINE>config = felixPlugin.getConfiguration();<NEW_LINE>} else {<NEW_LINE>felixPlugin = pomModel.getFactory().createPlugin();<NEW_LINE>felixPlugin.setGroupId(OSGiConstants.GROUPID_FELIX);<NEW_LINE>felixPlugin.setArtifactId(OSGiConstants.ARTIFACTID_BUNDLE_PLUGIN);<NEW_LINE>felixPlugin.setExtensions(Boolean.TRUE);<NEW_LINE>build.addPlugin(felixPlugin);<NEW_LINE>}<NEW_LINE>if (config == null) {<NEW_LINE>config = pomModel<MASK><NEW_LINE>felixPlugin.setConfiguration(config);<NEW_LINE>}<NEW_LINE>POMExtensibilityElement instructionsEl = null;<NEW_LINE>List<POMExtensibilityElement> confEls = config.getConfigurationElements();<NEW_LINE>for (POMExtensibilityElement el : confEls) {<NEW_LINE>if (OSGiConstants.PARAM_INSTRUCTIONS.equals(el.getQName().getLocalPart())) {<NEW_LINE>instructionsEl = el;<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (instructionsEl == null) {<NEW_LINE>instructionsEl = pomModel.getFactory().createPOMExtensibilityElement(new QName(OSGiConstants.PARAM_INSTRUCTIONS));<NEW_LINE>config.addExtensibilityElement(instructionsEl);<NEW_LINE>}<NEW_LINE>POMExtensibilityElement exportEl = ModelUtils.getOrCreateChild(instructionsEl, OSGiConstants.EXPORT_PACKAGE, pomModel);<NEW_LINE>POMExtensibilityElement privateEl = ModelUtils.getOrCreateChild(instructionsEl, OSGiConstants.PRIVATE_PACKAGE, pomModel);<NEW_LINE>exportEl.setElementText(exportIns.get(InstructionsConverter.EXPORT_PACKAGE));<NEW_LINE>privateEl.setElementText(exportIns.get(InstructionsConverter.PRIVATE_PACKAGE));<NEW_LINE>}
.getFactory().createConfiguration();
1,409,354
protected void updateMovement(Unit unit) {<NEW_LINE><MASK><NEW_LINE>float speed = unit.speed();<NEW_LINE>float xa = Core.input.axis(Binding.move_x);<NEW_LINE>float ya = Core.input.axis(Binding.move_y);<NEW_LINE>boolean boosted = (unit instanceof Mechc && unit.isFlying());<NEW_LINE>movement.set(xa, ya).nor().scl(speed);<NEW_LINE>if (Core.input.keyDown(Binding.mouse_move)) {<NEW_LINE>movement.add(input.mouseWorld().sub(player).scl(1f / 25f * speed)).limit(speed);<NEW_LINE>}<NEW_LINE>float mouseAngle = Angles.mouseAngle(unit.x, unit.y);<NEW_LINE>boolean aimCursor = omni && player.shooting && unit.type.hasWeapons() && unit.type.faceTarget && !boosted && unit.type.rotateShooting;<NEW_LINE>if (aimCursor) {<NEW_LINE>unit.lookAt(mouseAngle);<NEW_LINE>} else {<NEW_LINE>unit.lookAt(unit.prefRotation());<NEW_LINE>}<NEW_LINE>unit.movePref(movement);<NEW_LINE>unit.aim(unit.type.faceTarget ? Core.input.mouseWorld() : Tmp.v1.trns(unit.rotation, Core.input.mouseWorld().dst(unit)).add(unit.x, unit.y));<NEW_LINE>unit.controlWeapons(true, player.shooting && !boosted);<NEW_LINE>player.boosting = Core.input.keyDown(Binding.boost);<NEW_LINE>player.mouseX = unit.aimX();<NEW_LINE>player.mouseY = unit.aimY();<NEW_LINE>// update payload input<NEW_LINE>if (unit instanceof Payloadc) {<NEW_LINE>if (Core.input.keyTap(Binding.pickupCargo)) {<NEW_LINE>tryPickupPayload();<NEW_LINE>}<NEW_LINE>if (Core.input.keyTap(Binding.dropCargo)) {<NEW_LINE>tryDropPayload();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// update commander unit<NEW_LINE>if (Core.input.keyTap(Binding.command) && unit.type.commandLimit > 0) {<NEW_LINE>Call.unitCommand(player);<NEW_LINE>}<NEW_LINE>}
boolean omni = unit.type.omniMovement;
1,495,826
public Permission unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>Permission permission = new Permission();<NEW_LINE>int originalDepth = context.getCurrentDepth();<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("GranteeId", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>permission.setGranteeId(context.getUnmarshaller(String.<MASK><NEW_LINE>}<NEW_LINE>if (context.testExpression("GranteeType", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>permission.setGranteeType(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("PermissionValues", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>permission.setPermissionValues(new ListUnmarshaller<String>(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 permission;<NEW_LINE>}
class).unmarshall(context));
1,420,694
public String bPartnerLocation(final ICalloutField calloutField) {<NEW_LINE>// FIXME !!!<NEW_LINE>// 05291: In case current record is on dataNew phase with Copy option set<NEW_LINE>// then just don't update the Bill fields but let them copy from original record<NEW_LINE>if (calloutField.isRecordCopyingMode()) {<NEW_LINE>return NO_ERROR;<NEW_LINE>}<NEW_LINE>final I_C_Order order = <MASK><NEW_LINE>if (order == null) {<NEW_LINE>// nothing to do<NEW_LINE>return NO_ERROR;<NEW_LINE>}<NEW_LINE>final BPartnerId bpartnerId = BPartnerId.ofRepoIdOrNull(order.getC_BPartner_ID());<NEW_LINE>if (bpartnerId == null) {<NEW_LINE>// nothing to do<NEW_LINE>return NO_ERROR;<NEW_LINE>}<NEW_LINE>final I_C_BPartner bpartner = Services.get(IBPartnerDAO.class).getById(bpartnerId);<NEW_LINE>final IOrderBL orderBL = Services.get(IOrderBL.class);<NEW_LINE>if (order.getC_BPartner_Location_ID() <= 0) {<NEW_LINE>orderBL.setBPLocation(order, bpartner);<NEW_LINE>}<NEW_LINE>if (!orderBL.setBillLocation(order)) {<NEW_LINE>final String localizedMessage = new BPartnerNoBillToAddressException(bpartner).getLocalizedMessage();<NEW_LINE>// this appears onHover<NEW_LINE>calloutField.// this appears onHover<NEW_LINE>fireDataStatusEEvent(// this appears onHover<NEW_LINE>localizedMessage, localizedMessage, true);<NEW_LINE>}<NEW_LINE>return NO_ERROR;<NEW_LINE>}
calloutField.getModel(I_C_Order.class);
1,041,639
public InteractionResult use(BlockState state, Level worldIn, BlockPos pos, Player player, InteractionHand handIn, BlockHitResult hit) {<NEW_LINE>if (!player.mayBuild())<NEW_LINE>return InteractionResult.PASS;<NEW_LINE>if (player.isShiftKeyDown())<NEW_LINE>return InteractionResult.PASS;<NEW_LINE>if (!player.getItemInHand(handIn).is(Tags.Items.SLIMEBALLS)) {<NEW_LINE>if (player.getItemInHand(handIn).isEmpty()) {<NEW_LINE>withTileEntityDo(worldIn, pos, te -> te.assembleNextTick = true);<NEW_LINE>return InteractionResult.SUCCESS;<NEW_LINE>}<NEW_LINE>return InteractionResult.PASS;<NEW_LINE>}<NEW_LINE>if (state.getValue(STATE) != PistonState.RETRACTED)<NEW_LINE>return InteractionResult.PASS;<NEW_LINE>Direction <MASK><NEW_LINE>if (hit.getDirection() != direction)<NEW_LINE>return InteractionResult.PASS;<NEW_LINE>if (((MechanicalPistonBlock) state.getBlock()).isSticky)<NEW_LINE>return InteractionResult.PASS;<NEW_LINE>if (worldIn.isClientSide) {<NEW_LINE>Vec3 vec = hit.getLocation();<NEW_LINE>worldIn.addParticle(ParticleTypes.ITEM_SLIME, vec.x, vec.y, vec.z, 0, 0, 0);<NEW_LINE>return InteractionResult.SUCCESS;<NEW_LINE>}<NEW_LINE>AllSoundEvents.SLIME_ADDED.playOnServer(worldIn, pos, .5f, 1);<NEW_LINE>if (!player.isCreative())<NEW_LINE>player.getItemInHand(handIn).shrink(1);<NEW_LINE>worldIn.setBlockAndUpdate(pos, AllBlocks.STICKY_MECHANICAL_PISTON.getDefaultState().setValue(FACING, direction).setValue(AXIS_ALONG_FIRST_COORDINATE, state.getValue(AXIS_ALONG_FIRST_COORDINATE)));<NEW_LINE>return InteractionResult.SUCCESS;<NEW_LINE>}
direction = state.getValue(FACING);
1,292,216
protected Content prepare(@Nonnull Source field, @Nonnull Function<? super String, String> onShow) {<NEW_LINE>Font font = field.getFont();<NEW_LINE>FontMetrics metrics = font == null ? null : field.getFontMetrics(font);<NEW_LINE>int height = metrics == null ? 16 : metrics.getHeight();<NEW_LINE>Dimension size = new Dimension(height * 32, height * 16);<NEW_LINE>JTextArea area = new JTextArea(onShow.fun(field.getText()));<NEW_LINE>area.putClientProperty(Expandable.class, this);<NEW_LINE>area.setEditable(field.isEditable());<NEW_LINE>area.setBackground(field.getBackground());<NEW_LINE>area.setForeground(field.getForeground());<NEW_LINE>area.setFont(font);<NEW_LINE>area.setWrapStyleWord(true);<NEW_LINE>area.setLineWrap(true);<NEW_LINE>copyCaretPosition(field, area);<NEW_LINE>UIUtil.addUndoRedoActions(area);<NEW_LINE>JLabel label = ExpandableSupport.createLabel(createCollapseExtension());<NEW_LINE>label.setBorder(JBUI.Borders.empty(5, 0, 5, 5));<NEW_LINE>JBScrollPane pane = new JBScrollPane(area);<NEW_LINE>pane.setVerticalScrollBarPolicy(VERTICAL_SCROLLBAR_ALWAYS);<NEW_LINE>pane.getVerticalScrollBar().add(JBScrollBar.LEADING, label);<NEW_LINE>pane.getVerticalScrollBar().setBackground(area.getBackground());<NEW_LINE>Insets insets = field.getInsets();<NEW_LINE>Insets margin = field.getMargin();<NEW_LINE>if (margin != null) {<NEW_LINE>insets.top += margin.top;<NEW_LINE>insets.left += margin.left;<NEW_LINE>insets.right += margin.right;<NEW_LINE>insets.bottom += margin.bottom;<NEW_LINE>}<NEW_LINE>JBInsets.addTo(size, insets);<NEW_LINE>JBInsets.addTo(size, pane.getInsets());<NEW_LINE>pane.setPreferredSize(size);<NEW_LINE>pane.setViewportBorder(insets != null ? createEmptyBorder(insets.top, insets.left, insets.bottom, insets.right) : createEmptyBorder());<NEW_LINE>return new Content() {<NEW_LINE><NEW_LINE>@Nonnull<NEW_LINE>@Override<NEW_LINE>public JComponent getContentComponent() {<NEW_LINE>return pane;<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public JComponent getFocusableComponent() {<NEW_LINE>return area;<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void cancel(@Nonnull Function<? super String, String> onHide) {<NEW_LINE>if (field.isEditable()) {<NEW_LINE>field.setText(onHide.fun<MASK><NEW_LINE>copyCaretPosition(area, field);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>};<NEW_LINE>}
(area.getText()));
233,815
public static void evaluateProposals(IType type, String prefix, int offset, int length, int relevance, Collection<CompletionProposal> result) throws JavaModelException {<NEW_LINE>if (prefix.length() == 0) {<NEW_LINE>relevance--;<NEW_LINE>}<NEW_LINE>IField[] fields = type.getFields();<NEW_LINE>IMethod[] methods = type.getMethods();<NEW_LINE>for (IField curr : fields) {<NEW_LINE>if (!JdtFlags.isEnum(curr)) {<NEW_LINE>String getterName = GetterSetterUtil.getGetterName(curr, null);<NEW_LINE>if (Strings.startsWithIgnoreCase(getterName, prefix) && !hasMethod(methods, getterName)) {<NEW_LINE>int getterRelevance = relevance;<NEW_LINE>if (JdtFlags.isStatic(curr) && JdtFlags.isFinal(curr)) {<NEW_LINE>getterRelevance = relevance - 1;<NEW_LINE>}<NEW_LINE>CompletionProposal proposal = new GetterSetterCompletionProposal(curr, true, offset);<NEW_LINE>proposal.setName(getterName.toCharArray());<NEW_LINE>String signature = Signature.createMethodSignature(new String[] {}, curr.getTypeSignature());<NEW_LINE>proposal.setReplaceRange(offset, offset + prefix.length());<NEW_LINE>proposal.setSignature(signature.toCharArray());<NEW_LINE>proposal.setCompletion(getterName.toCharArray());<NEW_LINE>proposal.setDeclarationSignature(curr.getTypeSignature().toCharArray());<NEW_LINE>result.add(proposal);<NEW_LINE>}<NEW_LINE>if (!JdtFlags.isFinal(curr)) {<NEW_LINE>String setterName = GetterSetterUtil.getSetterName(curr, null);<NEW_LINE>if (Strings.startsWithIgnoreCase(setterName, prefix) && !hasMethod(methods, setterName)) {<NEW_LINE>CompletionProposal proposal = new GetterSetterCompletionProposal(curr, false, offset);<NEW_LINE>proposal.setName(setterName.toCharArray());<NEW_LINE>String signature = Signature.createMethodSignature(new String[] { curr.getTypeSignature() }, Signature.SIG_VOID);<NEW_LINE>proposal.setReplaceRange(offset, offset + prefix.length());<NEW_LINE>proposal.setSignature(signature.toCharArray());<NEW_LINE>proposal.setParameterNames(new char[][] { curr.getElementName().toCharArray() });<NEW_LINE>proposal.<MASK><NEW_LINE>proposal.setDeclarationSignature(curr.getTypeSignature().toCharArray());<NEW_LINE>result.add(proposal);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
setCompletion(getterName.toCharArray());
1,847,022
public static AbstractFilePickerFragment<FtpFile> newInstance(String startPath, int mode, boolean allowMultiple, boolean allowCreateDir, boolean allowExistingFile, boolean singleClick, String server, int port, String username, String password, String rootDir) {<NEW_LINE>FtpPickerFragment fragment = new FtpPickerFragment();<NEW_LINE>// Add arguments<NEW_LINE>fragment.setArgs(startPath, mode, allowMultiple, allowCreateDir, allowExistingFile, singleClick);<NEW_LINE>Bundle args = fragment.getArguments();<NEW_LINE>// Add ftp related stuff<NEW_LINE>args.putString(KEY_FTP_ROOTDIR, rootDir);<NEW_LINE><MASK><NEW_LINE>args.putInt(KEY_FTP_PORT, port);<NEW_LINE>if (username != null && password != null) {<NEW_LINE>args.putString(KEY_FTP_USERNAME, username);<NEW_LINE>args.putString(KEY_FTP_PASSWORD, password);<NEW_LINE>}<NEW_LINE>return fragment;<NEW_LINE>}
args.putString(KEY_FTP_SERVER, server);
1,842,310
Future<Void> cruiseControlApiSecret() {<NEW_LINE>if (cruiseControl != null) {<NEW_LINE>return secretOperator.getAsync(reconciliation.namespace(), CruiseControlResources.apiSecretName(reconciliation.name())).compose(oldSecret -> {<NEW_LINE><MASK><NEW_LINE>if (oldSecret != null) {<NEW_LINE>// The credentials should not change with every release<NEW_LINE>// So if the secret with credentials already exists, we re-use the values<NEW_LINE>// But we use the new secret to update labels etc. if needed<NEW_LINE>newSecret.setData(oldSecret.getData());<NEW_LINE>}<NEW_LINE>return secretOperator.reconcile(reconciliation, reconciliation.namespace(), CruiseControlResources.apiSecretName(reconciliation.name()), newSecret).map((Void) null);<NEW_LINE>});<NEW_LINE>} else {<NEW_LINE>return secretOperator.reconcile(reconciliation, reconciliation.namespace(), CruiseControlResources.apiSecretName(reconciliation.name()), null).map((Void) null);<NEW_LINE>}<NEW_LINE>}
Secret newSecret = cruiseControl.generateApiSecret();
203,188
public boolean visit(SuperMethodInvocation node) {<NEW_LINE>if (!hasChildrenChanges(node)) {<NEW_LINE>return doVisitUnchangedChildren(node);<NEW_LINE>}<NEW_LINE>int pos = rewriteOptionalQualifier(node, SuperMethodInvocation.QUALIFIER_PROPERTY, node.getStartPosition());<NEW_LINE>if (node.getAST().apiLevel() >= JLS3_INTERNAL) {<NEW_LINE>if (isChanged(node, SuperMethodInvocation.TYPE_ARGUMENTS_PROPERTY)) {<NEW_LINE>try {<NEW_LINE>pos = getScanner().getTokenEndOffset(TerminalTokens.TokenNameDOT, pos);<NEW_LINE>rewriteOptionalTypeParameters(node, SuperMethodInvocation.TYPE_ARGUMENTS_PROPERTY, pos, Util.EMPTY_STRING, false, false);<NEW_LINE>} catch (CoreException e) {<NEW_LINE>handleException(e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>pos = rewriteRequiredNode(node, SuperMethodInvocation.NAME_PROPERTY);<NEW_LINE>if (isChanged(node, SuperMethodInvocation.ARGUMENTS_PROPERTY)) {<NEW_LINE>// eval position after opening parent<NEW_LINE>try {<NEW_LINE>pos = getScanner().<MASK><NEW_LINE>// $NON-NLS-1$<NEW_LINE>rewriteNodeList(node, SuperMethodInvocation.ARGUMENTS_PROPERTY, pos, Util.EMPTY_STRING, ", ");<NEW_LINE>} catch (CoreException e) {<NEW_LINE>handleException(e);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>voidVisit(node, SuperMethodInvocation.ARGUMENTS_PROPERTY);<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>}
getTokenEndOffset(TerminalTokens.TokenNameLPAREN, pos);
849,737
final DeregisterMailDomainResult executeDeregisterMailDomain(DeregisterMailDomainRequest deregisterMailDomainRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(deregisterMailDomainRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DeregisterMailDomainRequest> request = null;<NEW_LINE>Response<DeregisterMailDomainResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DeregisterMailDomainRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(deregisterMailDomainRequest));<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, "WorkMail");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DeregisterMailDomain");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DeregisterMailDomainResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DeregisterMailDomainResultJsonUnmarshaller());<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);
999,600
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {<NEW_LINE>ExpressionFactory factory = ExpressionFactory.newInstance();<NEW_LINE>ELContextImpl context = new ELContextImpl(factory);<NEW_LINE>PrintWriter pw = response.getWriter();<NEW_LINE>ELResolver elResolver = ELContextImpl.getDefaultResolver(factory);<NEW_LINE>// Getting all EL Resolvers from the CompositeELResolver<NEW_LINE>pw.println("ELResolvers.");<NEW_LINE>ELResolver[] resolvers = getELResolvers(elResolver, pw);<NEW_LINE>if (checkOrderAndSize(resolvers, pw)) {<NEW_LINE>pw.println("The order and number of ELResolvers from the CompositeELResolver are correct!");<NEW_LINE>} else {<NEW_LINE>pw.println("Error: Order and number of ELResolvers are incorrect!");<NEW_LINE>}<NEW_LINE>// Test the behavior of the new ELResolvers. That is the StaticFieldELResolver and StreamELResolver.<NEW_LINE>pw.println("\nTesting implementation.");<NEW_LINE>try {<NEW_LINE>ELClass elClass = new ELClass(Boolean.class);<NEW_LINE>pw.println("Testing StaticFieldELResolver with Boolean.TRUE (Expected: true): " + elResolver.getValue(context, elClass, "TRUE"));<NEW_LINE>elClass = new ELClass(Integer.class);<NEW_LINE>pw.println("Testing StaticFieldELResolver with Integer.parseInt (Expected: 86): " + elResolver.invoke(context, elClass, "parseInt", new Class<?>[] { String.class, Integer.class }, new Object[<MASK><NEW_LINE>Stream stream = (Stream) elResolver.invoke(context, myList, "stream", null, new Object[] {});<NEW_LINE>pw.println("Testing StreamELResolver with distinct method (Expected: [1, 4, 3, 2, 5]): " + stream.distinct().toList());<NEW_LINE>ELProcessor elp = new ELProcessor();<NEW_LINE>LambdaExpression expression = (LambdaExpression) elp.eval("e->e>2");<NEW_LINE>stream = (Stream) elResolver.invoke(context, myList, "stream", null, new Object[] {});<NEW_LINE>pw.println("Testing StreamELResolver with filter method (Expected: [4, 3, 5, 3]): " + stream.filter(expression).toList());<NEW_LINE>} catch (Exception e) {<NEW_LINE>pw.println("Exception caught: " + e.getMessage());<NEW_LINE>pw.println("Test Failed. An exception was thrown: " + e.toString());<NEW_LINE>}<NEW_LINE>}
] { "1010110", 2 }));
264,448
public static void main(String[] args) {<NEW_LINE>Exercise26_3Collinearity exercise26_3Collinearity = new Exercise26_3Collinearity();<NEW_LINE>Point2D[] points = new Point2D[6];<NEW_LINE>for (int i = 0; i < points.length; i++) {<NEW_LINE>Point2D point = new Point2D(i, i + 1.5);<NEW_LINE>points[i] = point;<NEW_LINE>}<NEW_LINE>int numberOfTriples1 = exercise26_3Collinearity.countTriples(points);<NEW_LINE>StdOut.println("Number of triples: " + numberOfTriples1 + " Expected: 20");<NEW_LINE>// Based on https://www.algebra.com/algebra/homework/Length-and-distance/Length-and-distance.faq.question.530663.html<NEW_LINE>// (-3,4) (3,2) (6,1) are on the same line<NEW_LINE>Point2D pointA = new Point2D(-3, 4);<NEW_LINE>Point2D pointB = new Point2D(3, 2);<NEW_LINE>Point2D pointC = new Point2D(6, 1);<NEW_LINE>Point2D[] points2 = { pointA, pointB, pointC };<NEW_LINE>int numberOfTriples2 = exercise26_3Collinearity.countTriples(points2);<NEW_LINE>StdOut.println("Number of triples: " + numberOfTriples2 + " Expected: 1");<NEW_LINE>Point2D pointD = new Point2D(6, 1);<NEW_LINE>Point2D[] points3 = { pointA, pointB, pointC, pointD };<NEW_LINE>int numberOfTriples3 = exercise26_3Collinearity.countTriples(points3);<NEW_LINE>StdOut.<MASK><NEW_LINE>// Case with cubic y coordinate<NEW_LINE>Point2D pointE = new Point2D(1, 1);<NEW_LINE>Point2D pointF = new Point2D(2, 8);<NEW_LINE>Point2D pointG = new Point2D(-3, -27);<NEW_LINE>Point2D[] points4 = { pointE, pointF, pointG };<NEW_LINE>int numberOfTriples4 = exercise26_3Collinearity.countTriples(points4);<NEW_LINE>StdOut.println("Number of triples: " + numberOfTriples4 + " Expected: 1");<NEW_LINE>}
println("Number of triples: " + numberOfTriples3 + " Expected: 4");
1,374,205
private List<Embedding> predicates(Snapshot snapshot, Result parsed) {<NEW_LINE>List<Embedding> result = new LinkedList<>();<NEW_LINE>result.add(snapshot.create(GLOBAL_PATTERN_PACKAGE, "text/x-java"));<NEW_LINE>if (parsed.importsBlock != null) {<NEW_LINE>result.add(snapshot.create(parsed.importsBlock[0], parsed.importsBlock[1] - parsed.importsBlock[0], "text/x-java"));<NEW_LINE>result.add(snapshot<MASK><NEW_LINE>}<NEW_LINE>for (String imp : MethodInvocationContext.AUXILIARY_IMPORTS) {<NEW_LINE>result.add(snapshot.create(imp + "\n", "text/x-java"));<NEW_LINE>}<NEW_LINE>result.add(snapshot.create(GLOBAL_PATTERN_CLASS, "text/x-java"));<NEW_LINE>result.add(snapshot.create(CUSTOM_CONDITIONS_VARIABLES, "text/x-java"));<NEW_LINE>for (int[] span : parsed.blocks) {<NEW_LINE>result.add(snapshot.create(span[0], span[1] - span[0], "text/x-java"));<NEW_LINE>}<NEW_LINE>result.add(snapshot.create(GLOBAL_PATTERN_SUFFIX, "text/x-java"));<NEW_LINE>return result;<NEW_LINE>}
.create("\n", "text/x-java"));
951,405
protected void printObject(Object o) {<NEW_LINE>if (o == null) {<NEW_LINE>commandOutput.print("null");<NEW_LINE>} else if (o instanceof String) {<NEW_LINE>commandOutput.print('"');<NEW_LINE>commandOutput.print(o);<NEW_LINE>commandOutput.print('"');<NEW_LINE>} else if (o instanceof Date) {<NEW_LINE>DateFormat df = DateFormat.getDateTimeInstance(DateFormat.SHORT, DateFormat.SHORT);<NEW_LINE>commandOutput.print("'");<NEW_LINE>commandOutput.print(df.format((Date) o));<NEW_LINE>commandOutput.print("'");<NEW_LINE>} else if (o instanceof List) {<NEW_LINE>List<Object> l = (List<Object>) o;<NEW_LINE>commandOutput.print("[");<NEW_LINE>for (Object obj : l) {<NEW_LINE>printObject(obj);<NEW_LINE>commandOutput.print(", ");<NEW_LINE>}<NEW_LINE>commandOutput.print("]");<NEW_LINE>} else if (o instanceof Map) {<NEW_LINE>Map<Object, Object> m = (Map<Object, Object>) o;<NEW_LINE>commandOutput.print('{');<NEW_LINE>for (Object key : m.keySet()) {<NEW_LINE>printObject(key);<NEW_LINE>commandOutput.print(':');<NEW_LINE>printObject<MASK><NEW_LINE>commandOutput.print(", ");<NEW_LINE>}<NEW_LINE>commandOutput.print('}');<NEW_LINE>} else if (o instanceof Object[]) {<NEW_LINE>Object[] a = (Object[]) o;<NEW_LINE>commandOutput.print(Arrays.deepToString(a));<NEW_LINE>} else if (o instanceof byte[]) {<NEW_LINE>byte[] a = (byte[]) o;<NEW_LINE>commandOutput.print(Arrays.toString(a));<NEW_LINE>} else if (o instanceof ByteBuffer) {<NEW_LINE>ByteBuffer buffer = (ByteBuffer) o;<NEW_LINE>commandOutput.print(ByteUtils.toHexString(buffer.array()));<NEW_LINE>} else {<NEW_LINE>commandOutput.print(o);<NEW_LINE>}<NEW_LINE>}
(m.get(key));
252,721
private String buildNumericPredicateQuery(QueryContext ctx, String field, NumericFilterPredicate numericFilterPredicate) {<NEW_LINE>String paramName = getNextParameterName(field);<NEW_LINE>ctx.addDoubleParameter(paramName, numericFilterPredicate.getValue().getValue());<NEW_LINE>String numericOperationQuery = "";<NEW_LINE>switch(numericFilterPredicate.getOperation()) {<NEW_LINE>case EQUAL:<NEW_LINE>numericOperationQuery = String.format("%s = :%s", field, paramName);<NEW_LINE>break;<NEW_LINE>case NOT_EQUAL:<NEW_LINE>numericOperationQuery = String.format("%s != :%s", field, paramName);<NEW_LINE>break;<NEW_LINE>case GREATER:<NEW_LINE>numericOperationQuery = String.format("%s > :%s", field, paramName);<NEW_LINE>break;<NEW_LINE>case GREATER_OR_EQUAL:<NEW_LINE>numericOperationQuery = String.format("%s >= :%s", field, paramName);<NEW_LINE>break;<NEW_LINE>case LESS:<NEW_LINE>numericOperationQuery = String.format("%s < :%s", field, paramName);<NEW_LINE>break;<NEW_LINE>case LESS_OR_EQUAL:<NEW_LINE>numericOperationQuery = String.format("%s <= :%s", field, paramName);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>return String.<MASK><NEW_LINE>}
format("(%s is not null and %s)", field, numericOperationQuery);
238,371
public void emit(ServiceEmitter emitter) {<NEW_LINE>FileSystem[] fss = null;<NEW_LINE>try {<NEW_LINE>fss = sigar.getFileSystemList();<NEW_LINE>} catch (SigarException e) {<NEW_LINE>log.error(e, "Failed to get FileSystem list");<NEW_LINE>}<NEW_LINE>if (fss != null) {<NEW_LINE>log.debug("Found FileSystem list: [%s]", Joiner.on(", ").join(fss));<NEW_LINE>for (FileSystem fs : fss) {<NEW_LINE>// (fs.getDevName() does something wonky here!)<NEW_LINE>final String name = fs.getDirName();<NEW_LINE>if (fsTypeWhitelist.contains(fs.getTypeName())) {<NEW_LINE>FileSystemUsage fsu = null;<NEW_LINE>try {<NEW_LINE><MASK><NEW_LINE>} catch (SigarException e) {<NEW_LINE>log.error(e, "Failed to get FileSystemUsage[%s]", name);<NEW_LINE>}<NEW_LINE>if (fsu != null) {<NEW_LINE>final Map<String, Long> stats = ImmutableMap.<String, Long>builder().put("sys/fs/max", fsu.getTotal() * 1024).put("sys/fs/used", fsu.getUsed() * 1024).put("sys/fs/files/count", fsu.getFiles()).put("sys/fs/files/free", fsu.getFreeFiles()).build();<NEW_LINE>final ServiceMetricEvent.Builder builder = builder().setDimension("fsDevName", fs.getDevName()).setDimension("fsDirName", fs.getDirName()).setDimension("fsTypeName", fs.getTypeName()).setDimension("fsSysTypeName", fs.getSysTypeName()).setDimension("fsOptions", fs.getOptions().split(","));<NEW_LINE>MonitorUtils.addDimensionsToBuilder(builder, dimensions);<NEW_LINE>for (Map.Entry<String, Long> entry : stats.entrySet()) {<NEW_LINE>emitter.emit(builder.build(entry.getKey(), entry.getValue()));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>log.debug("Not monitoring fs stats for name[%s] with typeName[%s]", name, fs.getTypeName());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
fsu = sigar.getFileSystemUsage(name);
196,160
private void connect(int attempt, CompletableFuture<SessionClient> future) {<NEW_LINE>if (attempt > MAX_ATTEMPTS) {<NEW_LINE>future.completeExceptionally<MASK><NEW_LINE>return;<NEW_LINE>}<NEW_LINE>primaryElection.getTerm().whenCompleteAsync((term, error) -> {<NEW_LINE>if (error == null) {<NEW_LINE>if (term.primary() == null) {<NEW_LINE>future.completeExceptionally(new PrimitiveException.Unavailable());<NEW_LINE>} else {<NEW_LINE>this.term = term;<NEW_LINE>protocol.registerEventListener(sessionId, this::handleEvent, threadContext);<NEW_LINE>future.complete(this);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>Throwable cause = Throwables.getRootCause(error);<NEW_LINE>if (cause instanceof PrimitiveException.Unavailable || cause instanceof TimeoutException) {<NEW_LINE>threadContext.schedule(Duration.ofMillis(RETRY_DELAY), () -> connect(attempt + 1, future));<NEW_LINE>} else {<NEW_LINE>future.completeExceptionally(new PrimitiveException.Unavailable());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}, threadContext);<NEW_LINE>}
(new PrimitiveException.Unavailable());
1,794,841
public Size apply(MethodVisitor methodVisitor, Implementation.Context implementationContext) {<NEW_LINE>StringBuilder stringBuilder = new StringBuilder("(");<NEW_LINE>for (TypeDescription parameterType : parameterTypes) {<NEW_LINE>stringBuilder.append(parameterType.getDescriptor());<NEW_LINE>}<NEW_LINE>String methodDescriptor = stringBuilder.append(')').append(returnType.<MASK><NEW_LINE>Object[] constant = new Object[arguments.size()];<NEW_LINE>int index = 0;<NEW_LINE>for (JavaConstant argument : arguments) {<NEW_LINE>constant[index++] = argument.accept(JavaConstantValue.Visitor.INSTANCE);<NEW_LINE>}<NEW_LINE>methodVisitor.visitInvokeDynamicInsn(methodName, methodDescriptor, new Handle(handle == legacyHandle || implementationContext.getClassFileVersion().isAtLeast(ClassFileVersion.JAVA_V11) ? handle : legacyHandle, bootstrapMethod.getDeclaringType().getInternalName(), bootstrapMethod.getInternalName(), bootstrapMethod.getDescriptor(), bootstrapMethod.getDeclaringType().isInterface()), constant);<NEW_LINE>int stackSize = returnType.getStackSize().getSize() - StackSize.of(parameterTypes);<NEW_LINE>return new Size(stackSize, Math.max(stackSize, 0));<NEW_LINE>}
getDescriptor()).toString();
1,675,704
public void onPreviewNativeEvent(Event.NativePreviewEvent event) {<NEW_LINE>NativeEvent nativeEvent = event.getNativeEvent();<NEW_LINE>EventTarget eventTarget = nativeEvent.getEventTarget();<NEW_LINE>if (// chrome fix<NEW_LINE>!Element.is(eventTarget)) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>Element target = (Element) Element.as(eventTarget);<NEW_LINE>int type = event.getTypeInt();<NEW_LINE>if (type == Event.ONKEYDOWN) {<NEW_LINE>setKeyPressed(true);<NEW_LINE>if (DOM.getCaptureElement() != null)<NEW_LINE>return;<NEW_LINE>boolean eventTargetsPopup = (target != null) && DOM.isOrHasChild(getElement(), target);<NEW_LINE>int button = nativeEvent.getKeyCode();<NEW_LINE>boolean alt = nativeEvent.getAltKey();<NEW_LINE>boolean ctrl = nativeEvent.getCtrlKey();<NEW_LINE>boolean shift = nativeEvent.getShiftKey();<NEW_LINE>boolean hasModifiers = alt || ctrl || shift;<NEW_LINE>if (eventTargetsPopup && isListPanelOpened()) {<NEW_LINE>if (button == KeyCodes.KEY_UP && !hasModifiers) {<NEW_LINE>moveCursor(-1);<NEW_LINE>cancelAndPrevent(event);<NEW_LINE>} else if (button == KeyCodes.KEY_DOWN && !hasModifiers) {<NEW_LINE>moveCursor(1);<NEW_LINE>cancelAndPrevent(event);<NEW_LINE>} else if (button == KeyCodes.KEY_ENTER && !hasModifiers) {<NEW_LINE>select(getHighlightRow());<NEW_LINE><MASK><NEW_LINE>ChangeEvent changeEvent = new ComboBoxChangeEvent(getHighlightRow(), ComboBoxChangeEvent.ChangeEventInputDevice.KEYBOARD);<NEW_LINE>fireEvent(changeEvent);<NEW_LINE>setKeyPressed(false);<NEW_LINE>} else if (button == KeyCodes.KEY_ESCAPE && !hasModifiers) {<NEW_LINE>hideList();<NEW_LINE>setKeyPressed(false);<NEW_LINE>} else if (button == KeyCodes.KEY_TAB && (!hasModifiers || !alt && !ctrl && shift)) {<NEW_LINE>hideList();<NEW_LINE>setKeyPressed(false);<NEW_LINE>}<NEW_LINE>} else if (eventTargetsPopup && !hasModifiers && button == KeyCodes.KEY_ENTER && getModel().getCount() > 0) {<NEW_LINE>showList(true);<NEW_LINE>}<NEW_LINE>} else if (type == Event.ONKEYUP) {<NEW_LINE>setKeyPressed(false);<NEW_LINE>}<NEW_LINE>}
getChoiceButton().setFocus(false);
48,933
public void marshall(WorkspaceDescription workspaceDescription, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (workspaceDescription == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(workspaceDescription.getAccountAccessType(), ACCOUNTACCESSTYPE_BINDING);<NEW_LINE>protocolMarshaller.marshall(<MASK><NEW_LINE>protocolMarshaller.marshall(workspaceDescription.getCreated(), CREATED_BINDING);<NEW_LINE>protocolMarshaller.marshall(workspaceDescription.getDataSources(), DATASOURCES_BINDING);<NEW_LINE>protocolMarshaller.marshall(workspaceDescription.getDescription(), DESCRIPTION_BINDING);<NEW_LINE>protocolMarshaller.marshall(workspaceDescription.getEndpoint(), ENDPOINT_BINDING);<NEW_LINE>protocolMarshaller.marshall(workspaceDescription.getFreeTrialConsumed(), FREETRIALCONSUMED_BINDING);<NEW_LINE>protocolMarshaller.marshall(workspaceDescription.getFreeTrialExpiration(), FREETRIALEXPIRATION_BINDING);<NEW_LINE>protocolMarshaller.marshall(workspaceDescription.getGrafanaVersion(), GRAFANAVERSION_BINDING);<NEW_LINE>protocolMarshaller.marshall(workspaceDescription.getId(), ID_BINDING);<NEW_LINE>protocolMarshaller.marshall(workspaceDescription.getLicenseExpiration(), LICENSEEXPIRATION_BINDING);<NEW_LINE>protocolMarshaller.marshall(workspaceDescription.getLicenseType(), LICENSETYPE_BINDING);<NEW_LINE>protocolMarshaller.marshall(workspaceDescription.getModified(), MODIFIED_BINDING);<NEW_LINE>protocolMarshaller.marshall(workspaceDescription.getName(), NAME_BINDING);<NEW_LINE>protocolMarshaller.marshall(workspaceDescription.getNotificationDestinations(), NOTIFICATIONDESTINATIONS_BINDING);<NEW_LINE>protocolMarshaller.marshall(workspaceDescription.getOrganizationRoleName(), ORGANIZATIONROLENAME_BINDING);<NEW_LINE>protocolMarshaller.marshall(workspaceDescription.getOrganizationalUnits(), ORGANIZATIONALUNITS_BINDING);<NEW_LINE>protocolMarshaller.marshall(workspaceDescription.getPermissionType(), PERMISSIONTYPE_BINDING);<NEW_LINE>protocolMarshaller.marshall(workspaceDescription.getStackSetName(), STACKSETNAME_BINDING);<NEW_LINE>protocolMarshaller.marshall(workspaceDescription.getStatus(), STATUS_BINDING);<NEW_LINE>protocolMarshaller.marshall(workspaceDescription.getTags(), TAGS_BINDING);<NEW_LINE>protocolMarshaller.marshall(workspaceDescription.getWorkspaceRoleArn(), WORKSPACEROLEARN_BINDING);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>}
workspaceDescription.getAuthentication(), AUTHENTICATION_BINDING);
1,557,094
public SendMessageResult sendSyncMessage(SignalServiceSyncMessage message) {<NEW_LINE>var messageSender = dependencies.getMessageSender();<NEW_LINE>try {<NEW_LINE>return messageSender.sendSyncMessage(message, context.getUnidentifiedAccessHelper().getAccessForSync());<NEW_LINE>} catch (UnregisteredUserException e) {<NEW_LINE>var address = context.getRecipientHelper().resolveSignalServiceAddress(account.getSelfRecipientId());<NEW_LINE>return SendMessageResult.unregisteredFailure(address);<NEW_LINE>} catch (ProofRequiredException e) {<NEW_LINE>var address = context.getRecipientHelper().<MASK><NEW_LINE>return SendMessageResult.proofRequiredFailure(address, e);<NEW_LINE>} catch (RateLimitException e) {<NEW_LINE>var address = context.getRecipientHelper().resolveSignalServiceAddress(account.getSelfRecipientId());<NEW_LINE>logger.warn("Sending failed due to rate limiting from the signal server: {}", e.getMessage());<NEW_LINE>return SendMessageResult.networkFailure(address);<NEW_LINE>} catch (org.whispersystems.signalservice.api.crypto.UntrustedIdentityException e) {<NEW_LINE>var address = context.getRecipientHelper().resolveSignalServiceAddress(account.getSelfRecipientId());<NEW_LINE>return SendMessageResult.identityFailure(address, e.getIdentityKey());<NEW_LINE>} catch (IOException e) {<NEW_LINE>var address = context.getRecipientHelper().resolveSignalServiceAddress(account.getSelfRecipientId());<NEW_LINE>logger.warn("Failed to send message due to IO exception: {}", e.getMessage());<NEW_LINE>return SendMessageResult.networkFailure(address);<NEW_LINE>}<NEW_LINE>}
resolveSignalServiceAddress(account.getSelfRecipientId());
5,544
public void run(RegressionEnvironment env) {<NEW_LINE>String stmtText = "@name('s0') select t1.col1, t1.col2, t2.col1, t2.col2, t3.col1, t3.col2 from Type1#keepall as t1" + " left outer join Type2#keepall as t2" + " on t1.col2 = t2.col2 and t1.col1 = t2.col1" + " left outer join Type3#keepall as t3" + " on t1.col1 = t3.col1";<NEW_LINE>env.compileDeployAddListenerMileZero(stmtText, "s0");<NEW_LINE>String[] fields = new String[] { "t1.col1", "t1.col2", "t2.col1", "t2.col2", "t3.col1", "t3.col2" };<NEW_LINE>sendMapEvent(<MASK><NEW_LINE>env.assertListenerNotInvoked("s0");<NEW_LINE>sendMapEvent(env, "Type1", "b1", "a1");<NEW_LINE>env.assertPropsNew("s0", fields, new Object[] { "b1", "a1", null, null, null, null });<NEW_LINE>sendMapEvent(env, "Type1", "a1", "a1");<NEW_LINE>env.assertPropsNew("s0", fields, new Object[] { "a1", "a1", null, null, null, null });<NEW_LINE>sendMapEvent(env, "Type1", "b1", "b1");<NEW_LINE>env.assertPropsNew("s0", fields, new Object[] { "b1", "b1", null, null, null, null });<NEW_LINE>sendMapEvent(env, "Type1", "a1", "b1");<NEW_LINE>env.assertPropsNew("s0", fields, new Object[] { "a1", "b1", "a1", "b1", null, null });<NEW_LINE>sendMapEvent(env, "Type3", "c1", "b1");<NEW_LINE>env.assertListenerNotInvoked("s0");<NEW_LINE>sendMapEvent(env, "Type1", "d1", "b1");<NEW_LINE>env.assertPropsNew("s0", fields, new Object[] { "d1", "b1", null, null, null, null });<NEW_LINE>sendMapEvent(env, "Type3", "d1", "bx");<NEW_LINE>env.assertPropsNew("s0", fields, new Object[] { "d1", "b1", null, null, "d1", "bx" });<NEW_LINE>env.assertListenerNotInvoked("s0");<NEW_LINE>env.undeployAll();<NEW_LINE>}
env, "Type2", "a1", "b1");
1,215,631
public ChunkSection read(ByteBuf buffer) throws Exception {<NEW_LINE>// Reaad bits per block<NEW_LINE><MASK><NEW_LINE>int originalBitsPerBlock = bitsPerBlock;<NEW_LINE>if (bitsPerBlock == 0 || bitsPerBlock > 8) {<NEW_LINE>bitsPerBlock = GLOBAL_PALETTE;<NEW_LINE>}<NEW_LINE>// Read palette<NEW_LINE>ChunkSection chunkSection;<NEW_LINE>if (bitsPerBlock != GLOBAL_PALETTE) {<NEW_LINE>int paletteLength = Type.VAR_INT.readPrimitive(buffer);<NEW_LINE>chunkSection = new ChunkSectionImpl(true, paletteLength);<NEW_LINE>for (int i = 0; i < paletteLength; i++) {<NEW_LINE>chunkSection.addPaletteEntry(Type.VAR_INT.readPrimitive(buffer));<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>chunkSection = new ChunkSectionImpl(true);<NEW_LINE>}<NEW_LINE>// Read blocks<NEW_LINE>long[] blockData = new long[Type.VAR_INT.readPrimitive(buffer)];<NEW_LINE>if (blockData.length > 0) {<NEW_LINE>int expectedLength = (int) Math.ceil(ChunkSection.SIZE * bitsPerBlock / 64.0);<NEW_LINE>if (blockData.length != expectedLength) {<NEW_LINE>throw new IllegalStateException("Block data length (" + blockData.length + ") does not match expected length (" + expectedLength + ")! bitsPerBlock=" + bitsPerBlock + ", originalBitsPerBlock=" + originalBitsPerBlock);<NEW_LINE>}<NEW_LINE>for (int i = 0; i < blockData.length; i++) {<NEW_LINE>blockData[i] = buffer.readLong();<NEW_LINE>}<NEW_LINE>CompactArrayUtil.iterateCompactArray(bitsPerBlock, ChunkSection.SIZE, blockData, bitsPerBlock == GLOBAL_PALETTE ? chunkSection::setFlatBlock : chunkSection::setPaletteIndex);<NEW_LINE>}<NEW_LINE>return chunkSection;<NEW_LINE>}
int bitsPerBlock = buffer.readUnsignedByte();
411,953
private <B extends HttpSecurityBuilder<B>> List<AuthenticationProvider> createDefaultAuthenticationProviders(B builder) {<NEW_LINE>List<AuthenticationProvider> authenticationProviders = new ArrayList<>();<NEW_LINE>RegisteredClientRepository registeredClientRepository = OAuth2ConfigurerUtils.getRegisteredClientRepository(builder);<NEW_LINE>OAuth2AuthorizationService authorizationService = OAuth2ConfigurerUtils.getAuthorizationService(builder);<NEW_LINE>JwtClientAssertionAuthenticationProvider jwtClientAssertionAuthenticationProvider <MASK><NEW_LINE>authenticationProviders.add(jwtClientAssertionAuthenticationProvider);<NEW_LINE>ClientSecretAuthenticationProvider clientSecretAuthenticationProvider = new ClientSecretAuthenticationProvider(registeredClientRepository, authorizationService);<NEW_LINE>PasswordEncoder passwordEncoder = OAuth2ConfigurerUtils.getOptionalBean(builder, PasswordEncoder.class);<NEW_LINE>if (passwordEncoder != null) {<NEW_LINE>clientSecretAuthenticationProvider.setPasswordEncoder(passwordEncoder);<NEW_LINE>}<NEW_LINE>authenticationProviders.add(clientSecretAuthenticationProvider);<NEW_LINE>PublicClientAuthenticationProvider publicClientAuthenticationProvider = new PublicClientAuthenticationProvider(registeredClientRepository, authorizationService);<NEW_LINE>authenticationProviders.add(publicClientAuthenticationProvider);<NEW_LINE>return authenticationProviders;<NEW_LINE>}
= new JwtClientAssertionAuthenticationProvider(registeredClientRepository, authorizationService);
84,435
public static int uploadJRE(@NonNull final String localJreLocation, @NonNull final String remoteJreLocation, @NonNull final ConnectionMethod connectionMethod, @NullAllowed File buildScript) {<NEW_LINE>String[] antTargets = null;<NEW_LINE>final Properties prop = new Properties();<NEW_LINE>// NOI18N<NEW_LINE>prop.setProperty("remote.host", connectionMethod.getHost());<NEW_LINE>// NOI18N<NEW_LINE>prop.setProperty("remote.port", String.valueOf(connectionMethod.getPort()));<NEW_LINE>// NOI18N<NEW_LINE>prop.setProperty("remote.username", connectionMethod.getAuthentification().getUserName());<NEW_LINE>// NOI18N<NEW_LINE>prop.setProperty("remote.jre.dir", remoteJreLocation);<NEW_LINE>// NOI18N<NEW_LINE>prop.setProperty("jre.dir", localJreLocation);<NEW_LINE>ExecutorTask executorTask = null;<NEW_LINE>Set<String> concealedProps;<NEW_LINE>if (connectionMethod.getAuthentification().getKind() == ConnectionMethod.Authentification.Kind.PASSWORD) {<NEW_LINE>// NOI18N<NEW_LINE>antTargets = new String[] { "upload-JRE-password" };<NEW_LINE>// NOI18N<NEW_LINE>prop.setProperty("remote.password", ((ConnectionMethod.Authentification.Password) connectionMethod.getAuthentification()).getPassword());<NEW_LINE>// NOI18N<NEW_LINE><MASK><NEW_LINE>} else {<NEW_LINE>// NOI18N<NEW_LINE>antTargets = new String[] { "upload-JRE-keyfile" };<NEW_LINE>// NOI18N<NEW_LINE>prop.setProperty("keystore.file", ((ConnectionMethod.Authentification.Key) connectionMethod.getAuthentification()).getKeyStore().getAbsolutePath());<NEW_LINE>// NOI18N<NEW_LINE>prop.setProperty("keystore.passphrase", ((ConnectionMethod.Authentification.Key) connectionMethod.getAuthentification()).getPassPhrase());<NEW_LINE>// NOI18N<NEW_LINE>concealedProps = Collections.singleton("keystore.passphrase");<NEW_LINE>}<NEW_LINE>final FileObject antScript = FileUtil.toFileObject(buildScript != null ? buildScript : createBuildScript());<NEW_LINE>try {<NEW_LINE>executorTask = ActionUtils.runTarget(antScript, antTargets, prop, concealedProps);<NEW_LINE>} catch (IOException | IllegalArgumentException ex) {<NEW_LINE>Exceptions.printStackTrace(ex);<NEW_LINE>} finally {<NEW_LINE>if (executorTask != null) {<NEW_LINE>executorTask.getInputOutput().closeInputOutput();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return executorTask != null ? executorTask.result() : -1;<NEW_LINE>}
concealedProps = Collections.singleton("remote.password");
652,769
private List<WidgetEntity> createStatsCountWidget() {<NEW_LINE>final String function = config.getString("stats_function");<NEW_LINE>final String field = config.getString("field");<NEW_LINE>final boolean trend = config.getBoolean("trend");<NEW_LINE>final boolean lowerIsBetter = config.getBoolean("lower_is_better");<NEW_LINE>final AggregationConfigDTO widgetConfig = AggregationConfigDTO.Builder.builder().series(ImmutableList.of(createSeriesDTO(function, field))).visualization("numeric").visualizationConfig(NumberVisualizationConfigDTO.Builder.builder().trend(trend).trendPreference(lowerIsBetter ? NumberVisualizationConfigDTO.TrendPreference.LOWER : NumberVisualizationConfigDTO.TrendPreference.HIGHER).build()).rowPivots(Collections.emptyList()).columnPivots(Collections.emptyList()).sort(Collections.emptyList()).build();<NEW_LINE>final WidgetEntity.Builder widgetEntityBuilder = aggregationWidgetBuilder().config(widgetConfig);<NEW_LINE>final Optional<String> <MASK><NEW_LINE>query.ifPresent(s -> widgetEntityBuilder.query(ElasticsearchQueryString.of(s)));<NEW_LINE>return ImmutableList.of(widgetEntityBuilder.build());<NEW_LINE>}
query = config.getOptionalString("query");
614,449
public void marshall(AnalyzedResource analyzedResource, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (analyzedResource == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(analyzedResource.getActions(), ACTIONS_BINDING);<NEW_LINE>protocolMarshaller.marshall(analyzedResource.getAnalyzedAt(), ANALYZEDAT_BINDING);<NEW_LINE>protocolMarshaller.marshall(analyzedResource.getCreatedAt(), CREATEDAT_BINDING);<NEW_LINE>protocolMarshaller.marshall(analyzedResource.getError(), ERROR_BINDING);<NEW_LINE>protocolMarshaller.marshall(analyzedResource.getIsPublic(), ISPUBLIC_BINDING);<NEW_LINE>protocolMarshaller.marshall(analyzedResource.getResourceArn(), RESOURCEARN_BINDING);<NEW_LINE>protocolMarshaller.marshall(analyzedResource.getResourceOwnerAccount(), RESOURCEOWNERACCOUNT_BINDING);<NEW_LINE>protocolMarshaller.marshall(analyzedResource.getResourceType(), RESOURCETYPE_BINDING);<NEW_LINE>protocolMarshaller.marshall(analyzedResource.getSharedVia(), SHAREDVIA_BINDING);<NEW_LINE>protocolMarshaller.marshall(analyzedResource.getStatus(), STATUS_BINDING);<NEW_LINE>protocolMarshaller.marshall(<MASK><NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>}
analyzedResource.getUpdatedAt(), UPDATEDAT_BINDING);
1,836,518
public ModelAndView alarmAddForm(HttpSession session, HttpServletResponse response, HttpServletRequest request) {<NEW_LINE>String clusterAlias = session.getAttribute(KConstants.SessionAlias.CLUSTER_ALIAS).toString();<NEW_LINE>ModelAndView mav = new ModelAndView();<NEW_LINE>String group = request.getParameter("ke_alarm_consumer_group");<NEW_LINE>String topic = request.getParameter("ke_alarm_consumer_topic");<NEW_LINE>String lag = request.getParameter("ke_topic_lag");<NEW_LINE>String alarmLevel = request.getParameter("ke_alarm_cluster_level");<NEW_LINE>String alarmMaxTimes = request.getParameter("ke_alarm_cluster_maxtimes");<NEW_LINE>String alarmGroup = request.getParameter("ke_alarm_cluster_group");<NEW_LINE>AlarmConsumerInfo alarmConsumer = new AlarmConsumerInfo();<NEW_LINE>alarmConsumer.setGroup(group);<NEW_LINE>alarmConsumer.setAlarmGroup(alarmGroup);<NEW_LINE>alarmConsumer.setAlarmLevel(alarmLevel);<NEW_LINE>alarmConsumer.setAlarmMaxTimes(Integer.parseInt(alarmMaxTimes));<NEW_LINE>alarmConsumer.setAlarmTimes(0);<NEW_LINE>alarmConsumer.setCluster(clusterAlias);<NEW_LINE>alarmConsumer.setCreated(CalendarUtils.getDate());<NEW_LINE>alarmConsumer.setIsEnable("Y");<NEW_LINE>alarmConsumer.setIsNormal("Y");<NEW_LINE>alarmConsumer.setLag(Long.parseLong(lag));<NEW_LINE>alarmConsumer.setModify(CalendarUtils.getDate());<NEW_LINE>alarmConsumer.setTopic(topic);<NEW_LINE>int code = alertService.insertAlarmConsumer(alarmConsumer);<NEW_LINE>if (code > 0) {<NEW_LINE>session.removeAttribute("Alarm_Submit_Status");<NEW_LINE>session.setAttribute("Alarm_Submit_Status", "Insert success.");<NEW_LINE>mav.setViewName("redirect:/alarm/add/success");<NEW_LINE>} else {<NEW_LINE>session.removeAttribute("Alarm_Submit_Status");<NEW_LINE><MASK><NEW_LINE>mav.setViewName("redirect:/alarm/add/failed");<NEW_LINE>}<NEW_LINE>return mav;<NEW_LINE>}
session.setAttribute("Alarm_Submit_Status", "Insert failed.");