idx
int32
46
1.86M
input
stringlengths
321
6.6k
target
stringlengths
9
1.24k
1,396,204
public ASN1Primitive toASN1Primitive() {<NEW_LINE>ASN1EncodableVector v = new ASN1EncodableVector(9);<NEW_LINE>if (version != DEFAULT_VERSION) {<NEW_LINE>v.<MASK><NEW_LINE>}<NEW_LINE>v.add(service);<NEW_LINE>if (nonce != null) {<NEW_LINE>v.add(new ASN1Integer(nonce));<NEW_LINE>}<NEW_LINE>if (requestTime != null) {<NEW_LINE>v.add(requestTime);<NEW_LINE>}<NEW_LINE>int[] tags = new int[] { TAG_REQUESTER, TAG_REQUEST_POLICY, TAG_DVCS, TAG_DATA_LOCATIONS, TAG_EXTENSIONS };<NEW_LINE>ASN1Encodable[] taggedObjects = new ASN1Encodable[] { requester, requestPolicy, dvcs, dataLocations, extensions };<NEW_LINE>for (int i = 0; i < tags.length; i++) {<NEW_LINE>int tag = tags[i];<NEW_LINE>ASN1Encodable taggedObject = taggedObjects[i];<NEW_LINE>if (taggedObject != null) {<NEW_LINE>v.add(new DERTaggedObject(false, tag, taggedObject));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return new DERSequence(v);<NEW_LINE>}
add(new ASN1Integer(version));
385,893
public Map<String, Object> unpublishEvent(final String inode) throws PortalException, SystemException, DotDataException, DotSecurityException {<NEW_LINE>// DOTCMS-5199<NEW_LINE>final Map<String, Object> callbackData = new HashMap<>();<NEW_LINE>final List<String> <MASK><NEW_LINE>final WebContext ctx = WebContextFactory.get();<NEW_LINE>final HttpServletRequest request = ctx.getHttpServletRequest();<NEW_LINE>// Retrieving the current user<NEW_LINE>final User user = userAPI.getLoggedInUser(request);<NEW_LINE>final boolean respectFrontendRoles = true;<NEW_LINE>final Event ev = eventAPI.findbyInode(inode, user, respectFrontendRoles);<NEW_LINE>try {<NEW_LINE>ev.setIndexPolicy(IndexPolicyProvider.getInstance().forSingleContent());<NEW_LINE>contAPI.unpublish(ev, user, respectFrontendRoles);<NEW_LINE>} catch (DotSecurityException | DotDataException | DotContentletStateException e) {<NEW_LINE>eventUnpublishErrors.add(e.getLocalizedMessage());<NEW_LINE>} finally {<NEW_LINE>if (eventUnpublishErrors.size() > 0) {<NEW_LINE>callbackData.put("eventUnpublishErrors", eventUnpublishErrors);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return callbackData;<NEW_LINE>}
eventUnpublishErrors = new ArrayList<>();
1,827,082
public static RemoteMemoryTable newRemoteMemoryTable(int proxy, Table table) {<NEW_LINE><MASK><NEW_LINE>int[] seqs = table.dataStruct().getPKIndex();<NEW_LINE>int keyCount = seqs == null ? 0 : seqs.length;<NEW_LINE>Object keyValue = null;<NEW_LINE>if (keyCount == 1) {<NEW_LINE>if (recordCount > 0) {<NEW_LINE>Record r = table.getRecord(1);<NEW_LINE>keyValue = r.getNormalFieldValue(seqs[0]);<NEW_LINE>}<NEW_LINE>} else if (keyCount > 1) {<NEW_LINE>Object[] vals = new Object[keyCount];<NEW_LINE>keyValue = vals;<NEW_LINE>if (recordCount > 0) {<NEW_LINE>Record r = table.getRecord(1);<NEW_LINE>for (int i = 0; i < keyCount; ++i) {<NEW_LINE>vals[i] = r.getNormalFieldValue(seqs[i]);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>HostManager hm = HostManager.instance();<NEW_LINE>String host = hm.getHost();<NEW_LINE>int port = hm.getPort();<NEW_LINE>RemoteMemoryTable rmt = new RemoteMemoryTable(host, port, proxy, recordCount);<NEW_LINE>if (keyCount > 0) {<NEW_LINE>rmt.setStartKeyValue(keyValue, keyCount);<NEW_LINE>}<NEW_LINE>if (table instanceof MemoryTable) {<NEW_LINE>MemoryTable mt = (MemoryTable) table;<NEW_LINE>rmt.setDistribute(mt.getDistribute(), mt.getPart());<NEW_LINE>}<NEW_LINE>return rmt;<NEW_LINE>}
int recordCount = table.length();
418,413
public Unit call() throws IOException, StreamNotFoundException, ShellNotRunningException, IllegalArgumentException {<NEW_LINE>OutputStream outputStream;<NEW_LINE>File destFile = null;<NEW_LINE>switch(fileAbstraction.scheme) {<NEW_LINE>case CONTENT:<NEW_LINE>Objects.requireNonNull(fileAbstraction.uri);<NEW_LINE>if (fileAbstraction.uri.getAuthority().equals(context.get().getPackageName())) {<NEW_LINE>DocumentFile documentFile = DocumentFile.fromSingleUri(AppConfig.getInstance(), fileAbstraction.uri);<NEW_LINE>if (documentFile != null && documentFile.exists() && documentFile.canWrite()) {<NEW_LINE>outputStream = contentResolver.openOutputStream(fileAbstraction.uri);<NEW_LINE>} else {<NEW_LINE>destFile = FileUtils.fromContentUri(fileAbstraction.uri);<NEW_LINE>outputStream = openFile(destFile, context.get());<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>outputStream = contentResolver.openOutputStream(fileAbstraction.uri);<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>case FILE:<NEW_LINE>final HybridFileParcelable hybridFileParcelable = fileAbstraction.hybridFileParcelable;<NEW_LINE>Objects.requireNonNull(hybridFileParcelable);<NEW_LINE>Context context = this.context.get();<NEW_LINE>if (context == null) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>outputStream = openFile(hybridFileParcelable.getFile(), context);<NEW_LINE>destFile <MASK><NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>throw new IllegalArgumentException("The scheme for '" + fileAbstraction.scheme + "' cannot be processed!");<NEW_LINE>}<NEW_LINE>Objects.requireNonNull(outputStream);<NEW_LINE>outputStream.write(dataToSave.getBytes());<NEW_LINE>outputStream.close();<NEW_LINE>if (cachedFile != null && cachedFile.exists() && destFile != null) {<NEW_LINE>// cat cache content to original file and delete cache file<NEW_LINE>ConcatenateFileCommand.INSTANCE.concatenateFile(cachedFile.getPath(), destFile.getPath());<NEW_LINE>cachedFile.delete();<NEW_LINE>}<NEW_LINE>return Unit.INSTANCE;<NEW_LINE>}
= fileAbstraction.hybridFileParcelable.getFile();
17,461
private Vector<Vector<Object>> fillTable(final String sql, final int parameter) {<NEW_LINE>log.debug(sql + "; Parameter=" + parameter);<NEW_LINE>final Vector<Vector<Object>> <MASK><NEW_LINE>PreparedStatement pstmt = null;<NEW_LINE>ResultSet rs = null;<NEW_LINE>try {<NEW_LINE>pstmt = DB.prepareStatement(sql, null);<NEW_LINE>pstmt.setInt(1, parameter);<NEW_LINE>rs = pstmt.executeQuery();<NEW_LINE>while (rs.next()) {<NEW_LINE>final Vector<Object> line = new Vector<>(6);<NEW_LINE>// 0-Name, 1-PriceActual, 2-QtyInvoiced, 3-Discount, 4-DocumentNo, 5-DateInvoiced<NEW_LINE>// Name<NEW_LINE>line.add(rs.getString(1));<NEW_LINE>// Price<NEW_LINE>line.add(rs.getBigDecimal(2));<NEW_LINE>// Qty<NEW_LINE>line.add(rs.getBigDecimal(4));<NEW_LINE>BigDecimal discountBD = rs.getBigDecimal(9);<NEW_LINE>if (discountBD == null) {<NEW_LINE>final BigDecimal priceList = rs.getBigDecimal(3);<NEW_LINE>final BigDecimal priceActual = rs.getBigDecimal(2);<NEW_LINE>if (!Check.isEmpty(priceList)) {<NEW_LINE>final CurrencyPrecision pricePrecision = Services.get(IPriceListBL.class).getPricePrecision(PriceListId.ofRepoId(rs.getInt(10)));<NEW_LINE>discountBD = priceList.subtract(priceActual).divide(priceList, pricePrecision.toInt(), pricePrecision.getRoundingMode()).multiply(Env.ONEHUNDRED);<NEW_LINE>// Rounding:<NEW_LINE>discountBD = pricePrecision.roundIfNeeded(discountBD);<NEW_LINE>} else {<NEW_LINE>discountBD = BigDecimal.ZERO;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Discount<NEW_LINE>line.add(discountBD);<NEW_LINE>// DocNo 7<NEW_LINE>line.add(rs.getString(7));<NEW_LINE>// Date<NEW_LINE>line.add(rs.getTimestamp(5));<NEW_LINE>// DatePromised<NEW_LINE>line.add(rs.getTimestamp(6));<NEW_LINE>// Org/Warehouse 8<NEW_LINE>line.add(rs.getString(8));<NEW_LINE>// ASI 11<NEW_LINE>line.add(rs.getString(11));<NEW_LINE>// Primary ID 12<NEW_LINE>line.add(rs.getInt(12));<NEW_LINE>// Secondary ID 13<NEW_LINE>line.add(rs.getInt(13));<NEW_LINE>data.add(line);<NEW_LINE>}<NEW_LINE>} catch (final SQLException e) {<NEW_LINE>log.error(sql, e);<NEW_LINE>} finally {<NEW_LINE>DB.close(rs, pstmt);<NEW_LINE>rs = null;<NEW_LINE>pstmt = null;<NEW_LINE>}<NEW_LINE>log.debug("#" + data.size());<NEW_LINE>return data;<NEW_LINE>}
data = new Vector<>();
1,180,506
public void marshall(APNSVoipChannelResponse aPNSVoipChannelResponse, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (aPNSVoipChannelResponse == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(aPNSVoipChannelResponse.getApplicationId(), APPLICATIONID_BINDING);<NEW_LINE>protocolMarshaller.marshall(aPNSVoipChannelResponse.getCreationDate(), CREATIONDATE_BINDING);<NEW_LINE>protocolMarshaller.marshall(aPNSVoipChannelResponse.getDefaultAuthenticationMethod(), DEFAULTAUTHENTICATIONMETHOD_BINDING);<NEW_LINE>protocolMarshaller.marshall(aPNSVoipChannelResponse.getEnabled(), ENABLED_BINDING);<NEW_LINE>protocolMarshaller.marshall(aPNSVoipChannelResponse.getHasCredential(), HASCREDENTIAL_BINDING);<NEW_LINE>protocolMarshaller.marshall(aPNSVoipChannelResponse.getHasTokenKey(), HASTOKENKEY_BINDING);<NEW_LINE>protocolMarshaller.marshall(aPNSVoipChannelResponse.getId(), ID_BINDING);<NEW_LINE>protocolMarshaller.marshall(aPNSVoipChannelResponse.getIsArchived(), ISARCHIVED_BINDING);<NEW_LINE>protocolMarshaller.marshall(aPNSVoipChannelResponse.getLastModifiedBy(), LASTMODIFIEDBY_BINDING);<NEW_LINE>protocolMarshaller.marshall(<MASK><NEW_LINE>protocolMarshaller.marshall(aPNSVoipChannelResponse.getPlatform(), PLATFORM_BINDING);<NEW_LINE>protocolMarshaller.marshall(aPNSVoipChannelResponse.getVersion(), VERSION_BINDING);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>}
aPNSVoipChannelResponse.getLastModifiedDate(), LASTMODIFIEDDATE_BINDING);
760,591
public Void visitSpecialForm(SpecialFormExpression specialForm, Set<RowExpression> context) {<NEW_LINE>if (specialForm.getForm() != DEREFERENCE) {<NEW_LINE>return super.visitSpecialForm(specialForm, context);<NEW_LINE>}<NEW_LINE>RowExpression expression = specialForm;<NEW_LINE>while (true) {<NEW_LINE>if (expression instanceof VariableReferenceExpression) {<NEW_LINE>context.add(specialForm);<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>if (expression instanceof SpecialFormExpression && ((SpecialFormExpression) expression).getForm() == DEREFERENCE) {<NEW_LINE>SpecialFormExpression dereferenceExpression = (SpecialFormExpression) expression;<NEW_LINE>RowExpression base = dereferenceExpression.<MASK><NEW_LINE>RowType baseType = (RowType) base.getType();<NEW_LINE>RowExpression indexExpression = expressionOptimizer.optimize(dereferenceExpression.getArguments().get(1), ExpressionOptimizer.Level.OPTIMIZED, connectorSession);<NEW_LINE>if (indexExpression instanceof ConstantExpression) {<NEW_LINE>Object index = ((ConstantExpression) indexExpression).getValue();<NEW_LINE>if (index instanceof Number) {<NEW_LINE>Optional<String> fieldName = baseType.getFields().get(((Number) index).intValue()).getName();<NEW_LINE>if (fieldName.isPresent()) {<NEW_LINE>expression = base;<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>return super.visitSpecialForm(specialForm, context);<NEW_LINE>}
getArguments().get(0);
608,496
private ImmutableSet<IdlingResourceProxy> syncIdlingResources() {<NEW_LINE>// Collect unique registered idling resources.<NEW_LINE>HashMap<String, IdlingResource> registeredResourceByName = new HashMap<>();<NEW_LINE>for (IdlingResource resource : IdlingRegistry.getInstance().getResources()) {<NEW_LINE>String name = resource.getName();<NEW_LINE>if (registeredResourceByName.containsKey(name)) {<NEW_LINE>logDuplicate(name, registeredResourceByName.get(name), resource);<NEW_LINE>} else {<NEW_LINE>registeredResourceByName.put(name, resource);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>Iterator<IdlingResourceProxyImpl> iterator = syncedIdlingResources.iterator();<NEW_LINE>while (iterator.hasNext()) {<NEW_LINE>IdlingResourceProxyImpl proxy = iterator.next();<NEW_LINE>if (registeredResourceByName.get(proxy.name) == proxy.resource) {<NEW_LINE>// Already registered, don't need to add.<NEW_LINE>registeredResourceByName.remove(proxy.name);<NEW_LINE>} else {<NEW_LINE>// Previously registered, but no longer registered, remove.<NEW_LINE>iterator.remove();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Add new idling resources that weren't previously registered.<NEW_LINE>for (Map.Entry<String, IdlingResource> entry : registeredResourceByName.entrySet()) {<NEW_LINE>syncedIdlingResources.add(new IdlingResourceProxyImpl(entry.getKey()<MASK><NEW_LINE>}<NEW_LINE>return ImmutableSet.<IdlingResourceProxy>builder().addAll(syncedIdlingResources).addAll(IdlingRegistry.getInstance().getLoopers().stream().map(LooperIdlingResource::new).iterator()).build();<NEW_LINE>}
, entry.getValue()));
1,643,489
final GetDocumentationVersionsResult executeGetDocumentationVersions(GetDocumentationVersionsRequest getDocumentationVersionsRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(getDocumentationVersionsRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<GetDocumentationVersionsRequest> request = null;<NEW_LINE>Response<GetDocumentationVersionsResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new GetDocumentationVersionsRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(getDocumentationVersionsRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "API Gateway");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "GetDocumentationVersions");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<GetDocumentationVersionsResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new GetDocumentationVersionsResultJsonUnmarshaller());<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.CLIENT_ENDPOINT, endpoint);
603,919
public void handleRequest(HttpServerExchange exchange) throws Exception {<NEW_LINE>var request = MongoRequest.of(exchange);<NEW_LINE>var response = MongoResponse.of(exchange);<NEW_LINE>if (request.isInError()) {<NEW_LINE>next(exchange);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>var etag = request.getETag() == null ? null : ObjectId.isValid(request.getETag()) ? new BsonObjectId(new ObjectId(request.getETag())) : new BsonObjectId();<NEW_LINE>var result = dbs.deleteDatabase(Optional.ofNullable(request.getClientSession()), request.getDBName(), etag, request.isETagCheckRequired());<NEW_LINE>response.setDbOperationResult(result);<NEW_LINE>// inject the etag<NEW_LINE>if (result.getEtag() != null) {<NEW_LINE>ResponseHelper.injectEtagHeader(exchange, result.getEtag());<NEW_LINE>}<NEW_LINE>if (result.getHttpCode() == HttpStatus.SC_CONFLICT) {<NEW_LINE>response.setInError(HttpStatus.SC_CONFLICT, "The database's ETag must be provided using the '" + Headers.IF_MATCH + "' header.");<NEW_LINE>next(exchange);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>response.setStatusCode(result.getHttpCode());<NEW_LINE>MetadataCachesSingleton.getInstance().<MASK><NEW_LINE>next(exchange);<NEW_LINE>}
invalidateDb(request.getDBName());
1,698,840
public void print(Annotation doc, OutputStream target, Options options) throws IOException {<NEW_LINE>PrintWriter writer = new PrintWriter(IOUtils.encodedOutputStreamWriter<MASK><NEW_LINE>List<CoreMap> sentences = doc.get(CoreAnnotations.SentencesAnnotation.class);<NEW_LINE>for (CoreMap sentence : sentences) {<NEW_LINE>SemanticGraph sg = sentence.get(SemanticGraphCoreAnnotations.BasicDependenciesAnnotation.class);<NEW_LINE>if (sg != null) {<NEW_LINE>switch(dependenciesType) {<NEW_LINE>case ENHANCED:<NEW_LINE>case ENHANCEDPLUSPLUS:<NEW_LINE>writer.print(conllUWriter.printSemanticGraph(sg, sentence.get(dependenciesType.annotation())));<NEW_LINE>break;<NEW_LINE>case BASIC:<NEW_LINE>writer.print(conllUWriter.printSemanticGraph(sg));<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>throw new IllegalArgumentException("CoNLLUOutputter: unknown dependencies type " + dependenciesType);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>writer.print(conllUWriter.printPOSAnnotations(sentence, options.printFakeDeps));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>writer.flush();<NEW_LINE>}
(target, options.encoding));
650,920
public Request<DescribeEventsRequest> marshall(DescribeEventsRequest describeEventsRequest) {<NEW_LINE>if (describeEventsRequest == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>Request<DescribeEventsRequest> request = new DefaultRequest<DescribeEventsRequest>(describeEventsRequest, "AmazonElastiCache");<NEW_LINE>request.addParameter("Action", "DescribeEvents");<NEW_LINE>request.addParameter("Version", "2015-02-02");<NEW_LINE>request.setHttpMethod(HttpMethodName.POST);<NEW_LINE>if (describeEventsRequest.getSourceIdentifier() != null) {<NEW_LINE>request.addParameter("SourceIdentifier", StringUtils.fromString(describeEventsRequest.getSourceIdentifier()));<NEW_LINE>}<NEW_LINE>if (describeEventsRequest.getSourceType() != null) {<NEW_LINE>request.addParameter("SourceType", StringUtils.fromString(describeEventsRequest.getSourceType()));<NEW_LINE>}<NEW_LINE>if (describeEventsRequest.getStartTime() != null) {<NEW_LINE>request.addParameter("StartTime", StringUtils.fromDate<MASK><NEW_LINE>}<NEW_LINE>if (describeEventsRequest.getEndTime() != null) {<NEW_LINE>request.addParameter("EndTime", StringUtils.fromDate(describeEventsRequest.getEndTime()));<NEW_LINE>}<NEW_LINE>if (describeEventsRequest.getDuration() != null) {<NEW_LINE>request.addParameter("Duration", StringUtils.fromInteger(describeEventsRequest.getDuration()));<NEW_LINE>}<NEW_LINE>if (describeEventsRequest.getMaxRecords() != null) {<NEW_LINE>request.addParameter("MaxRecords", StringUtils.fromInteger(describeEventsRequest.getMaxRecords()));<NEW_LINE>}<NEW_LINE>if (describeEventsRequest.getMarker() != null) {<NEW_LINE>request.addParameter("Marker", StringUtils.fromString(describeEventsRequest.getMarker()));<NEW_LINE>}<NEW_LINE>return request;<NEW_LINE>}
(describeEventsRequest.getStartTime()));
946,538
protected List<ColumnValue> convertColumnValue(Long tbId, String tableName, String dbName) {<NEW_LINE>List<ColumnValue> columns = new ArrayList<>();<NEW_LINE>ResultSet resultSet = null;<NEW_LINE>try {<NEW_LINE>DatabaseMetaData dbMetadata = connection.getMetaData();<NEW_LINE>resultSet = dbMetadata.getColumns(null, dbName.toUpperCase(), tableName.toUpperCase(), "%");<NEW_LINE>while (resultSet.next()) {<NEW_LINE>String name = resultSet.getString("COLUMN_NAME");<NEW_LINE>String type = resultSet.getString("TYPE_NAME");<NEW_LINE>int <MASK><NEW_LINE>ColumnValue value = new ColumnValue();<NEW_LINE>value.setColumnName(name);<NEW_LINE>value.setTypeName(type);<NEW_LINE>value.setCdId(tbId);<NEW_LINE>value.setIntegerIdx(columnIdx);<NEW_LINE>columns.add(value);<NEW_LINE>}<NEW_LINE>return columns;<NEW_LINE>} catch (SQLException ex) {<NEW_LINE>throw new RuntimeException(ex);<NEW_LINE>} finally {<NEW_LINE>DbUtils.closeQuietly(resultSet);<NEW_LINE>}<NEW_LINE>}
columnIdx = resultSet.getInt("ORDINAL_POSITION");
206,757
public void process(@Element Metadata dlqFile, MultiOutputReceiver outputs) throws IOException {<NEW_LINE>LOG.info("Found DLQ File: {}", dlqFile.resourceId().toString());<NEW_LINE>if (dlqFile.resourceId().toString().contains("/tmp/.temp")) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>BufferedReader jsonReader;<NEW_LINE>try {<NEW_LINE>jsonReader = readFile(dlqFile.resourceId());<NEW_LINE>} catch (FileNotFoundException e) {<NEW_LINE>// If the file does exist, it will be retried on the next trigger.<NEW_LINE>LOG.warn("DLQ File Not Found: {}", dlqFile.resourceId().toString());<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// Assuming that files are JSONLines formatted.<NEW_LINE>ObjectMapper mapper = new ObjectMapper();<NEW_LINE>jsonReader.lines().forEach(line -> {<NEW_LINE>ObjectNode resultNode;<NEW_LINE>// Each line is expecting this format: {"message": ROW, "error_message": ERROR}<NEW_LINE>try {<NEW_LINE>JsonNode jsonDLQElement = mapper.readTree(line);<NEW_LINE>if (!jsonDLQElement.get("message").isObject()) {<NEW_LINE>throw new IOException("Unable to parse JSON record " + line);<NEW_LINE>}<NEW_LINE>resultNode = (<MASK><NEW_LINE>resultNode.put("_metadata_error", jsonDLQElement.get("error_message"));<NEW_LINE>// Populate the retried count.<NEW_LINE>long retryErrorCount = getRetryCountForRecord(resultNode);<NEW_LINE>resultNode.put("_metadata_retry_count", retryErrorCount);<NEW_LINE>outputs.get(contentTag).output(resultNode.toString());<NEW_LINE>reconsumedElements.inc();<NEW_LINE>} catch (IOException e) {<NEW_LINE>LOG.error("Issue parsing JSON record {}. Unable to continue.", line, e);<NEW_LINE>throw new RuntimeException(e);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>outputs.get(filesTag).output(dlqFile);<NEW_LINE>}
ObjectNode) jsonDLQElement.get("message");
1,055,792
public void fromJSON(JsonReader jsonReader, ScmMaterialConfig scmMaterialConfig, ConfigHelperOptions options) {<NEW_LINE>jsonReader.readStringIfPresent("destination", scmMaterialConfig::setFolder);<NEW_LINE>jsonReader.optBoolean("invert_filter").ifPresent(scmMaterialConfig::setInvertFilter);<NEW_LINE>jsonReader.optJsonObject("filter").ifPresent(filterReader -> {<NEW_LINE>scmMaterialConfig.setFilter(FilterRepresenter.fromJSON(filterReader));<NEW_LINE>});<NEW_LINE>jsonReader.readCaseInsensitiveStringIfPresent("name", scmMaterialConfig::setName);<NEW_LINE>jsonReader.optBoolean("auto_update").ifPresent(scmMaterialConfig::setAutoUpdate);<NEW_LINE>jsonReader.<MASK><NEW_LINE>String password = null, encryptedPassword = null;<NEW_LINE>if (jsonReader.hasJsonObject("password")) {<NEW_LINE>password = jsonReader.getString("password");<NEW_LINE>}<NEW_LINE>if (jsonReader.hasJsonObject("encrypted_password")) {<NEW_LINE>encryptedPassword = jsonReader.getString("encrypted_password");<NEW_LINE>}<NEW_LINE>PasswordDeserializer passwordDeserializer = options.getPasswordDeserializer();<NEW_LINE>String encryptedPasswordValue = passwordDeserializer.deserialize(password, encryptedPassword, scmMaterialConfig);<NEW_LINE>scmMaterialConfig.setEncryptedPassword(encryptedPasswordValue);<NEW_LINE>}
readStringIfPresent("username", scmMaterialConfig::setUserName);
1,295,020
public void requestLocation(Context context, @NonNull LocationCallback callback) {<NEW_LINE>mLocationManager = (LocationManager) context.getSystemService(Context.LOCATION_SERVICE);<NEW_LINE>mGMSClient = gmsEnabled(context) ? LocationServices.getFusedLocationProviderClient(context) : null;<NEW_LINE>if (mLocationManager == null || !locationEnabled(context, mLocationManager) || !hasPermissions(context)) {<NEW_LINE>callback.onCompleted(null);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>mNetworkListener = new LocationListener();<NEW_LINE>mGPSListener = new LocationListener();<NEW_LINE>mGMSListener = new GMSLocationListener();<NEW_LINE>mLocationCallback = callback;<NEW_LINE>mLastKnownLocation = getLastKnownLocation();<NEW_LINE>if (mLastKnownLocation == null && mGMSClient != null) {<NEW_LINE>mGMSClient.getLastLocation().<MASK><NEW_LINE>}<NEW_LINE>if (mLocationManager.isProviderEnabled(LocationManager.NETWORK_PROVIDER)) {<NEW_LINE>mLocationManager.requestLocationUpdates(LocationManager.NETWORK_PROVIDER, 0, 0, mNetworkListener, Looper.getMainLooper());<NEW_LINE>}<NEW_LINE>if (mLocationManager.isProviderEnabled(LocationManager.GPS_PROVIDER)) {<NEW_LINE>mLocationManager.requestLocationUpdates(LocationManager.GPS_PROVIDER, 0, 0, mGPSListener, Looper.getMainLooper());<NEW_LINE>}<NEW_LINE>if (mGMSClient != null) {<NEW_LINE>mGMSClient.requestLocationUpdates(LocationRequest.create().setPriority(LocationRequest.PRIORITY_BALANCED_POWER_ACCURACY).setNumUpdates(1), mGMSListener, Looper.getMainLooper());<NEW_LINE>}<NEW_LINE>mTimer.postDelayed(() -> {<NEW_LINE>stopLocationUpdates();<NEW_LINE>handleLocation(mLastKnownLocation);<NEW_LINE>}, TIMEOUT_MILLIS);<NEW_LINE>}
addOnSuccessListener(location -> mLastKnownLocation = location);
698,322
private static GrpcClientConfiguration testConfig(GrpcServerConfiguration serverConfiguration) {<NEW_LINE>GrpcClientConfiguration config = new GrpcClientConfiguration();<NEW_LINE>config.port = serverConfiguration.testPort;<NEW_LINE>config.host = serverConfiguration.host;<NEW_LINE>config.plainText = Optional.of(serverConfiguration.plainText);<NEW_LINE>config.compression = Optional.empty();<NEW_LINE>config<MASK><NEW_LINE>config.idleTimeout = Optional.empty();<NEW_LINE>config.keepAliveTime = Optional.empty();<NEW_LINE>config.keepAliveTimeout = Optional.empty();<NEW_LINE>config.loadBalancingPolicy = "pick_first";<NEW_LINE>config.maxHedgedAttempts = 5;<NEW_LINE>config.maxInboundMessageSize = OptionalInt.empty();<NEW_LINE>config.maxInboundMetadataSize = OptionalInt.empty();<NEW_LINE>config.maxRetryAttempts = 0;<NEW_LINE>config.maxTraceEvents = OptionalInt.empty();<NEW_LINE>config.nameResolver = GrpcClientConfiguration.DNS;<NEW_LINE>config.negotiationType = "PLAINTEXT";<NEW_LINE>config.overrideAuthority = Optional.empty();<NEW_LINE>config.perRpcBufferLimit = OptionalLong.empty();<NEW_LINE>config.retry = false;<NEW_LINE>config.retryBufferSize = OptionalLong.empty();<NEW_LINE>config.ssl = new SslClientConfig();<NEW_LINE>config.ssl.key = Optional.empty();<NEW_LINE>config.ssl.certificate = Optional.empty();<NEW_LINE>config.ssl.trustStore = Optional.empty();<NEW_LINE>config.userAgent = Optional.empty();<NEW_LINE>if (serverConfiguration.ssl.certificate.isPresent() || serverConfiguration.ssl.keyStore.isPresent()) {<NEW_LINE>LOGGER.warn("gRPC client created without configuration and the gRPC server is configured for SSL. " + "Configuring SSL for such clients is not supported.");<NEW_LINE>}<NEW_LINE>return config;<NEW_LINE>}
.flowControlWindow = OptionalInt.empty();
1,624,996
public ORemoteQueryResult serverCommand(String query, Map args) {<NEW_LINE>int recordsPerPage = OGlobalConfiguration.QUERY_REMOTE_RESULTSET_PAGE_SIZE.getValueAsInteger();<NEW_LINE>if (recordsPerPage <= 0) {<NEW_LINE>recordsPerPage = 100;<NEW_LINE>}<NEW_LINE>OServerQueryRequest request = new OServerQueryRequest("sql", query, args, OServerQueryRequest.COMMAND, ORecordSerializerNetworkV37Client.INSTANCE, recordsPerPage);<NEW_LINE>OServerQueryResponse response = networkOperationNoRetry(request, "Error on executing command: " + query);<NEW_LINE>ORemoteResultSet rs = new ORemoteResultSet(null, response.getQueryId(), response.getResult(), response.getExecutionPlan(), response.getQueryStats(), response.isHasNextPage());<NEW_LINE>// if (response.isHasNextPage()) {<NEW_LINE>// stickToSession();<NEW_LINE>// } else {<NEW_LINE>// db.queryClosed(response.getQueryId());<NEW_LINE>// }<NEW_LINE>return new ORemoteQueryResult(rs, response.isTxChanges(<MASK><NEW_LINE>}
), response.isReloadMetadata());
601,214
public GetMedicalVocabularyResult unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>GetMedicalVocabularyResult getMedicalVocabularyResult = new GetMedicalVocabularyResult();<NEW_LINE>AwsJsonReader reader = context.getReader();<NEW_LINE>reader.beginObject();<NEW_LINE>while (reader.hasNext()) {<NEW_LINE>String name = reader.nextName();<NEW_LINE>if (name.equals("VocabularyName")) {<NEW_LINE>getMedicalVocabularyResult.setVocabularyName(StringJsonUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>} else if (name.equals("LanguageCode")) {<NEW_LINE>getMedicalVocabularyResult.setLanguageCode(StringJsonUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>} else if (name.equals("VocabularyState")) {<NEW_LINE>getMedicalVocabularyResult.setVocabularyState(StringJsonUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>} else if (name.equals("LastModifiedTime")) {<NEW_LINE>getMedicalVocabularyResult.setLastModifiedTime(DateJsonUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>} else if (name.equals("FailureReason")) {<NEW_LINE>getMedicalVocabularyResult.setFailureReason(StringJsonUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>} else if (name.equals("DownloadUri")) {<NEW_LINE>getMedicalVocabularyResult.setDownloadUri(StringJsonUnmarshaller.getInstance<MASK><NEW_LINE>} else {<NEW_LINE>reader.skipValue();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>reader.endObject();<NEW_LINE>return getMedicalVocabularyResult;<NEW_LINE>}
().unmarshall(context));
1,176,229
public BeanDefinition parse(Element element, ParserContext pc) {<NEW_LINE>String loginProcessingUrl = element.getAttribute(ATT_LOGIN_PROCESSING_URL);<NEW_LINE>if (StringUtils.hasText(loginProcessingUrl)) {<NEW_LINE>this.loginProcessingUrl = loginProcessingUrl;<NEW_LINE>}<NEW_LINE>BeanDefinition saml2LoginBeanConfig = BeanDefinitionBuilder.rootBeanDefinition(Saml2LoginBeanConfig.class).getBeanDefinition();<NEW_LINE>String saml2LoginBeanConfigId = pc.getReaderContext().generateBeanName(saml2LoginBeanConfig);<NEW_LINE>pc.registerBeanComponent(new BeanComponentDefinition(saml2LoginBeanConfig, saml2LoginBeanConfigId));<NEW_LINE>registerDefaultCsrfOverride();<NEW_LINE>BeanMetadataElement relyingPartyRegistrationRepository = Saml2LoginBeanDefinitionParserUtils.getRelyingPartyRegistrationRepository(element);<NEW_LINE>BeanMetadataElement authenticationRequestRepository = Saml2LoginBeanDefinitionParserUtils.getAuthenticationRequestRepository(element);<NEW_LINE>BeanMetadataElement authenticationRequestResolver = Saml2LoginBeanDefinitionParserUtils.getAuthenticationRequestResolver(element);<NEW_LINE>if (authenticationRequestResolver == null) {<NEW_LINE>authenticationRequestResolver = Saml2LoginBeanDefinitionParserUtils.createDefaultAuthenticationRequestResolver(relyingPartyRegistrationRepository);<NEW_LINE>}<NEW_LINE>BeanMetadataElement authenticationConverter = Saml2LoginBeanDefinitionParserUtils.getAuthenticationConverter(element);<NEW_LINE>if (authenticationConverter == null) {<NEW_LINE>if (!this.loginProcessingUrl.contains("{registrationId}")) {<NEW_LINE>pc.getReaderContext().error("loginProcessingUrl must contain {registrationId} path variable", element);<NEW_LINE>}<NEW_LINE>authenticationConverter = Saml2LoginBeanDefinitionParserUtils.createDefaultAuthenticationConverter(relyingPartyRegistrationRepository);<NEW_LINE>}<NEW_LINE>// Configure the Saml2WebSsoAuthenticationFilter<NEW_LINE>BeanDefinitionBuilder saml2WebSsoAuthenticationFilterBuilder = BeanDefinitionBuilder.rootBeanDefinition(Saml2WebSsoAuthenticationFilter.class).addConstructorArgValue(authenticationConverter).addConstructorArgValue(this.loginProcessingUrl).addPropertyValue("authenticationRequestRepository", authenticationRequestRepository);<NEW_LINE>resolveLoginPage(element, pc);<NEW_LINE>resolveAuthenticationSuccessHandler(element, saml2WebSsoAuthenticationFilterBuilder);<NEW_LINE>resolveAuthenticationFailureHandler(element, saml2WebSsoAuthenticationFilterBuilder);<NEW_LINE>resolveAuthenticationManager(element, saml2WebSsoAuthenticationFilterBuilder);<NEW_LINE>resolveSecurityContextRepository(element, saml2WebSsoAuthenticationFilterBuilder);<NEW_LINE>// Configure the Saml2WebSsoAuthenticationRequestFilter<NEW_LINE>this.saml2WebSsoAuthenticationRequestFilter = BeanDefinitionBuilder.rootBeanDefinition(Saml2WebSsoAuthenticationRequestFilter.class).addConstructorArgValue(authenticationRequestResolver).addPropertyValue(<MASK><NEW_LINE>BeanDefinition saml2AuthenticationProvider = Saml2LoginBeanDefinitionParserUtils.createAuthenticationProvider();<NEW_LINE>this.authenticationProviders.add(new RuntimeBeanReference(pc.getReaderContext().registerWithGeneratedName(saml2AuthenticationProvider)));<NEW_LINE>this.saml2AuthenticationUrlToProviderName = BeanDefinitionBuilder.rootBeanDefinition(Map.class).setFactoryMethodOnBean("getAuthenticationUrlToProviderName", saml2LoginBeanConfigId).getBeanDefinition();<NEW_LINE>return saml2WebSsoAuthenticationFilterBuilder.getBeanDefinition();<NEW_LINE>}
"authenticationRequestRepository", authenticationRequestRepository).getBeanDefinition();
1,178,507
public JimfsPath toRealPath(JimfsPath path, PathService pathService, Set<? super LinkOption> options) throws IOException {<NEW_LINE>checkNotNull(path);<NEW_LINE>checkNotNull(options);<NEW_LINE>store.readLock().lock();<NEW_LINE>try {<NEW_LINE>DirectoryEntry entry = lookUp(path, options).requireExists(path);<NEW_LINE>List<Name> names = new ArrayList<>();<NEW_LINE>names.add(entry.name());<NEW_LINE>while (!entry.file().isRootDirectory()) {<NEW_LINE>entry = entry.directory().entryInParent();<NEW_LINE>names.<MASK><NEW_LINE>}<NEW_LINE>// names are ordered last to first in the list, so get the reverse view<NEW_LINE>List<Name> reversed = Lists.reverse(names);<NEW_LINE>Name root = reversed.remove(0);<NEW_LINE>return pathService.createPath(root, reversed);<NEW_LINE>} finally {<NEW_LINE>store.readLock().unlock();<NEW_LINE>}<NEW_LINE>}
add(entry.name());
1,042,066
private static void addSort(final AppCompatActivity activity, final Menu menu, final Sort order) {<NEW_LINE>@StringRes<NEW_LINE>final int menuTitle;<NEW_LINE>if (activity instanceof OptionsMenuCommentsListener && ((OptionsMenuCommentsListener) activity).getSuggestedCommentSort() != null && ((OptionsMenuCommentsListener) activity).getSuggestedCommentSort().equals(order)) {<NEW_LINE>menuTitle = ((<MASK><NEW_LINE>} else {<NEW_LINE>menuTitle = order.getMenuTitle();<NEW_LINE>}<NEW_LINE>final MenuItem menuItem = menu.add(activity.getString(menuTitle)).setOnMenuItemClickListener(item -> {<NEW_LINE>order.onSortSelected(activity);<NEW_LINE>return true;<NEW_LINE>});<NEW_LINE>if (activity instanceof OptionsMenuPostsListener && ((OptionsMenuPostsListener) activity).getPostSort() != null && ((OptionsMenuPostsListener) activity).getPostSort().equals(order)) {<NEW_LINE>menuItem.setChecked(true);<NEW_LINE>} else if (activity instanceof OptionsMenuCommentsListener && ((OptionsMenuCommentsListener) activity).getCommentSort() != null && ((OptionsMenuCommentsListener) activity).getCommentSort().equals(order)) {<NEW_LINE>menuItem.setChecked(true);<NEW_LINE>}<NEW_LINE>}
PostCommentSort) order).getSuggestedTitle();
503,257
public void initialise() throws Exception {<NEW_LINE>setLayout(new BorderLayout());<NEW_LINE>ExplanationPreferencesPanelPluginLoader loader = new ExplanationPreferencesPanelPluginLoader(getEditorKit());<NEW_LINE>Set<PreferencesPanelPlugin> plugins = new TreeSet<>((o1, o2) -> {<NEW_LINE>String s1 = o1.getLabel();<NEW_LINE><MASK><NEW_LINE>return s1.compareTo(s2);<NEW_LINE>});<NEW_LINE>plugins.addAll(loader.getPlugins());<NEW_LINE>for (PreferencesPanelPlugin plugin : plugins) {<NEW_LINE>try {<NEW_LINE>PreferencesPanel panel = plugin.newInstance();<NEW_LINE>panel.initialise();<NEW_LINE>String label = plugin.getLabel();<NEW_LINE>final JScrollPane sp = new JScrollPane(panel);<NEW_LINE>sp.setBorder(new EmptyBorder(0, 0, 0, 0));<NEW_LINE>map.put(label, panel);<NEW_LINE>componentMap.put(label, sp);<NEW_LINE>tabbedPane.addTab(label, sp);<NEW_LINE>} catch (Throwable e) {<NEW_LINE>logger.warn("An error occurred whilst trying to instantiate the explanation preferences panel plugin '{}': {}", plugin.getLabel(), e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>add(tabbedPane);<NEW_LINE>updatePanelSelection(null);<NEW_LINE>}
String s2 = o2.getLabel();
1,727,304
private static Pair<String, String> preIndexedLSL(final long offset, final ITranslationEnvironment environment, final List<ReilInstruction> instructions, final String registerNodeValue1, final String registerNodeValue2, final String immediateNodeValue) {<NEW_LINE>final String address = environment.getNextVariableString();<NEW_LINE>final String tmpVar1 = environment.getNextVariableString();<NEW_LINE>final String tmpVar2 = environment.getNextVariableString();<NEW_LINE>final String index = environment.getNextVariableString();<NEW_LINE>long baseOffset = offset;<NEW_LINE>instructions.add(ReilHelpers.createBsh(baseOffset++, dw, registerNodeValue2, dw<MASK><NEW_LINE>instructions.add(ReilHelpers.createAnd(baseOffset++, qw, tmpVar1, dw, dWordBitMask, dw, index));<NEW_LINE>instructions.add(ReilHelpers.createAdd(baseOffset++, dw, registerNodeValue1, dw, index, dw, tmpVar2));<NEW_LINE>instructions.add(ReilHelpers.createAnd(baseOffset++, dw, tmpVar2, dw, dWordBitMask, dw, address));<NEW_LINE>instructions.add(ReilHelpers.createStr(baseOffset++, dw, address, dw, registerNodeValue1));<NEW_LINE>return new Pair<String, String>(address, registerNodeValue1);<NEW_LINE>}
, immediateNodeValue, qw, tmpVar1));
179,069
public SeqParameterSet initSPS(Size sz) {<NEW_LINE>SeqParameterSet sps = new SeqParameterSet();<NEW_LINE>sps.picWidthInMbsMinus1 = ((sz.getWidth() + 15) >> 4) - 1;<NEW_LINE>sps.picHeightInMapUnitsMinus1 = ((sz.getHeight() + 15) >> 4) - 1;<NEW_LINE>sps.chromaFormatIdc = ColorSpace.YUV420J;<NEW_LINE>sps.profileIdc = 66;<NEW_LINE>sps.levelIdc = 40;<NEW_LINE>sps.numRefFrames = 1;<NEW_LINE>sps.frameMbsOnlyFlag = true;<NEW_LINE>sps.log2MaxFrameNumMinus4 = Math.max(0, MathUtil<MASK><NEW_LINE>int codedWidth = (sps.picWidthInMbsMinus1 + 1) << 4;<NEW_LINE>int codedHeight = (sps.picHeightInMapUnitsMinus1 + 1) << 4;<NEW_LINE>sps.frameCroppingFlag = codedWidth != sz.getWidth() || codedHeight != sz.getHeight();<NEW_LINE>sps.frameCropRightOffset = (codedWidth - sz.getWidth() + 1) >> 1;<NEW_LINE>sps.frameCropBottomOffset = (codedHeight - sz.getHeight() + 1) >> 1;<NEW_LINE>return sps;<NEW_LINE>}
.log2(keyInterval) - 3);
93,981
public StartChangeRequestExecutionResult unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>StartChangeRequestExecutionResult startChangeRequestExecutionResult = new StartChangeRequestExecutionResult();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE><MASK><NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return startChangeRequestExecutionResult;<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("AutomationExecutionId", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>startChangeRequestExecutionResult.setAutomationExecutionId(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 startChangeRequestExecutionResult;<NEW_LINE>}
String currentParentElement = context.getCurrentParentElement();
828,320
final DisassociateCustomerGatewayResult executeDisassociateCustomerGateway(DisassociateCustomerGatewayRequest disassociateCustomerGatewayRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(disassociateCustomerGatewayRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DisassociateCustomerGatewayRequest> request = null;<NEW_LINE>Response<DisassociateCustomerGatewayResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DisassociateCustomerGatewayRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(disassociateCustomerGatewayRequest));<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, "NetworkManager");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DisassociateCustomerGateway");<NEW_LINE>request.<MASK><NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DisassociateCustomerGatewayResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DisassociateCustomerGatewayResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
432,407
protected void okPressed() {<NEW_LINE>// Set props<NEW_LINE>driver.setName(driverNameText.getText());<NEW_LINE>driver.setDescription(CommonUtils.notEmpty(driverDescText.getText()));<NEW_LINE>driver.setDriverClassName(driverClassText.getText());<NEW_LINE>driver.setSampleURL(driverURLText.getText());<NEW_LINE>driver.setDriverDefaultPort(driverPortText.getText());<NEW_LINE>driver.setDriverDefaultDatabase(driverDatabaseText.getText());<NEW_LINE>driver.setDriverDefaultUser(driverUserText.getText());<NEW_LINE>driver.setEmbedded(embeddedDriverCheck.getSelection());<NEW_LINE>driver.setAnonymousAccess(anonymousDriverCheck.getSelection());<NEW_LINE>driver.setAllowsEmptyPassword(allowsEmptyPasswordCheck.getSelection());<NEW_LINE>driver.setInstantiable(!nonInstantiableCheck.getSelection());<NEW_LINE>// driver.setAnonymousAccess(anonymousCheck.getSelection());<NEW_LINE>driver.setModified(true);<NEW_LINE>driver.<MASK><NEW_LINE>driver.setConnectionProperties(connectionPropertySource.getPropertyValues());<NEW_LINE>// Store client homes<NEW_LINE>if (clientHomesPanel != null) {<NEW_LINE>driver.setNativeClientLocations(clientHomesPanel.getLocalLocations());<NEW_LINE>}<NEW_LINE>DriverDescriptor oldDriver = provider.getDriverByName(driver.getCategory(), driver.getName());<NEW_LINE>if (oldDriver != null && oldDriver != driver && !oldDriver.isDisabled() && oldDriver.getReplacedBy() == null) {<NEW_LINE>UIUtils.showMessageBox(getShell(), UIConnectionMessages.dialog_edit_driver_dialog_save_exists_title, NLS.bind(UIConnectionMessages.dialog_edit_driver_dialog_save_exists_message, driver.getName()), SWT.ICON_ERROR);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// Finish<NEW_LINE>if (provider.getDriver(driver.getId()) == null) {<NEW_LINE>provider.addDriver(driver);<NEW_LINE>}<NEW_LINE>provider.getRegistry().saveDrivers();<NEW_LINE>super.okPressed();<NEW_LINE>}
setDriverParameters(driverPropertySource.getPropertiesWithDefaults());
973,939
public static void dumpParameters(XMLStringBuffer xsb, Map<String, String> parameters) {<NEW_LINE>// parameters<NEW_LINE>if (parameters.isEmpty()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>for (Map.Entry<String, String> para : parameters.entrySet()) {<NEW_LINE>Properties paramProps = new Properties();<NEW_LINE>if (para.getKey() == null) {<NEW_LINE>Utils.log("Skipping a null parameter.");<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (para.getValue() == null) {<NEW_LINE>String msg = String.format("Skipping parameter [%s] since it has a null value", para.getKey());<NEW_LINE>Utils.log(msg);<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>paramProps.setProperty("name", para.getKey());<NEW_LINE>paramProps.setProperty(<MASK><NEW_LINE>// BUGFIX: TESTNG-27<NEW_LINE>xsb.addEmptyElement("parameter", paramProps);<NEW_LINE>}<NEW_LINE>}
"value", para.getValue());
535,702
private void addTextSettingFields() {<NEW_LINE>textTextField = new JTextField();<NEW_LINE>textTextField.setVisible(false);<NEW_LINE>textTextField.<MASK><NEW_LINE>textLabel = new JLabel("Text", SwingConstants.RIGHT);<NEW_LINE>textLabel.setVisible(false);<NEW_LINE>GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();<NEW_LINE>String[] fontNames = Arrays.stream(ge.getAvailableFontFamilyNames()).distinct().toArray(String[]::new);<NEW_LINE>fontDropDown = new JComboBox<>(fontNames);<NEW_LINE>fontDropDown.setRenderer(new FontDropDownRenderer());<NEW_LINE>fontDropDown.addItemListener(this);<NEW_LINE>fontDropDown.setVisible(false);<NEW_LINE>Dimension minimumSize = fontDropDown.getMinimumSize();<NEW_LINE>fontDropDown.setMinimumSize(new Dimension(100, minimumSize.height));<NEW_LINE>fontLabel = new JLabel("Font", SwingConstants.RIGHT);<NEW_LINE>fontLabel.setVisible(false);<NEW_LINE>fontSeparator = new JSeparator(SwingConstants.HORIZONTAL);<NEW_LINE>fontSeparator.setVisible(false);<NEW_LINE>add(textLabel, "grow");<NEW_LINE>add(textTextField, "grow");<NEW_LINE>add(fontLabel, "grow");<NEW_LINE>add(fontDropDown, "grow");<NEW_LINE>add(fontSeparator, "grow, spanx, wrap");<NEW_LINE>}
getDocument().addDocumentListener(this);
997,200
static void c_9() throws Exception {<NEW_LINE>AkSourceBatchOp train_data = new AkSourceBatchOp().setFilePath(DATA_DIR + TRAIN_FILE);<NEW_LINE>AkSourceBatchOp test_data = new AkSourceBatchOp(<MASK><NEW_LINE>new FmClassifier().setNumEpochs(10).setLearnRate(0.5).setNumFactor(2).setFeatureCols(FEATURE_COL_NAMES).setLabelCol(LABEL_COL_NAME).setPredictionCol(PREDICTION_COL_NAME).setPredictionDetailCol(PRED_DETAIL_COL_NAME).enableLazyPrintTrainInfo().enableLazyPrintModelInfo().fit(train_data).transform(test_data).link(new EvalBinaryClassBatchOp().setPositiveLabelValueString("1").setLabelCol(LABEL_COL_NAME).setPredictionDetailCol(PRED_DETAIL_COL_NAME).lazyPrintMetrics("FM"));<NEW_LINE>BatchOperator.execute();<NEW_LINE>}
).setFilePath(DATA_DIR + TEST_FILE);
1,197,867
private static SuggestedFix generateFix(MethodInvocationTree tree, VisitorState state) {<NEW_LINE>NewClassTree receiver = (NewClassTree) getReceiver(tree);<NEW_LINE>List<? extends ExpressionTree<MASK><NEW_LINE>MethodSymbol methodSymbol = getSymbol(receiver);<NEW_LINE>String unit = ((MemberSelectTree) tree.getMethodSelect()).getIdentifier().toString().replace("get", "");<NEW_LINE>SuggestedFix.Builder fixBuilder = SuggestedFix.builder();<NEW_LINE>// new Period(long, long).getUnits() -> new Duration(long, long).getStandardUnits();<NEW_LINE>if (isSameType(state.getTypes().unboxedTypeOrType(methodSymbol.params().get(0).type), state.getSymtab().longType, state)) {<NEW_LINE>String duration = SuggestedFixes.qualifyType(state, fixBuilder, "org.joda.time.Duration");<NEW_LINE>return fixBuilder.replace(tree, String.format("new %s(%s, %s).getStandard%s()", duration, state.getSourceForNode(arguments.get(0)), state.getSourceForNode(arguments.get(1)), unit)).build();<NEW_LINE>}<NEW_LINE>// new Period(ReadableFoo, ReadableFoo).getUnits() -> Units.unitsBetween(RF, RF).getUnits();<NEW_LINE>String unitImport = SuggestedFixes.qualifyType(state, fixBuilder, "org.joda.time." + unit);<NEW_LINE>return fixBuilder.replace(tree, String.format("%s.%sBetween(%s, %s).get%s()", unitImport, unit.toLowerCase(), state.getSourceForNode(arguments.get(0)), state.getSourceForNode(arguments.get(1)), unit)).build();<NEW_LINE>}
> arguments = receiver.getArguments();
202,014
private void sendMessage(String message, MessageColor color, String[] roomIds, String from, String authToken, boolean notify) {<NEW_LINE>for (String roomId : roomIds) {<NEW_LINE>LOGGER.info("Posting: {} to {}: {} {}", from, roomId, message, color);<NEW_LINE>HttpClient client = HttpClientBuilder.create().useSystemProperties().build();<NEW_LINE>HttpPost post = new HttpPost();<NEW_LINE>try {<NEW_LINE>String url = baseUrl + "/v2/room/" + URLEncoder.encode(roomId, "UTF-8").replaceAll("\\+", "%20") + "/notification?auth_token=" + authToken;<NEW_LINE>post = new HttpPost(url);<NEW_LINE>List<BasicNameValuePair> parameters = new ArrayList<BasicNameValuePair>();<NEW_LINE>parameters.add(<MASK><NEW_LINE>parameters.add(new BasicNameValuePair("color", color.name().toLowerCase()));<NEW_LINE>parameters.add(new BasicNameValuePair("message_format", "html"));<NEW_LINE>if (notify) {<NEW_LINE>parameters.add(new BasicNameValuePair("notify", "true"));<NEW_LINE>}<NEW_LINE>post.setEntity(new UrlEncodedFormEntity(parameters));<NEW_LINE>client.execute(post);<NEW_LINE>} catch (Exception e) {<NEW_LINE>LOGGER.warn("Error posting to HipChat", e);<NEW_LINE>} finally {<NEW_LINE>post.releaseConnection();<NEW_LINE>HttpClientUtils.closeQuietly(client);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
new BasicNameValuePair("message", message));
1,520,939
final DeleteJobTemplateResult executeDeleteJobTemplate(DeleteJobTemplateRequest deleteJobTemplateRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(deleteJobTemplateRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DeleteJobTemplateRequest> request = null;<NEW_LINE>Response<DeleteJobTemplateResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DeleteJobTemplateRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(deleteJobTemplateRequest));<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, "DeleteJobTemplate");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DeleteJobTemplateResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DeleteJobTemplateResultJsonUnmarshaller());<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, "IoT");
274,341
final DescribeServiceUpdatesResult executeDescribeServiceUpdates(DescribeServiceUpdatesRequest describeServiceUpdatesRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(describeServiceUpdatesRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE><MASK><NEW_LINE>Request<DescribeServiceUpdatesRequest> request = null;<NEW_LINE>Response<DescribeServiceUpdatesResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DescribeServiceUpdatesRequestMarshaller().marshall(super.beforeMarshalling(describeServiceUpdatesRequest));<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, "DescribeServiceUpdates");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>StaxResponseHandler<DescribeServiceUpdatesResult> responseHandler = new StaxResponseHandler<DescribeServiceUpdatesResult>(new DescribeServiceUpdatesResultStaxUnmarshaller());<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,552,766
private static String fixRelativeLink(Pattern pattern, Path helpFile, String fileContents) {<NEW_LINE>int currentPosition = 0;<NEW_LINE>StringBuffer newContents = new StringBuffer();<NEW_LINE>Matcher matcher = pattern.matcher(fileContents);<NEW_LINE>boolean hasMatches = matcher.find();<NEW_LINE>if (!hasMatches) {<NEW_LINE>// no work to do<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>while (hasMatches) {<NEW_LINE>int matchStart = matcher.start();<NEW_LINE>String fullMatch = matcher.group(0);<NEW_LINE>String beforeMatchString = <MASK><NEW_LINE>newContents.append(beforeMatchString);<NEW_LINE>currentPosition = matchStart + fullMatch.length();<NEW_LINE>String HREFText = matcher.group(1);<NEW_LINE>debug("Found HREF text: " + HREFText + " in file: " + helpFile.getFileName());<NEW_LINE>String updatedHREFText = resolveLink(HREFText);<NEW_LINE>debug("\tnew link text: " + updatedHREFText);<NEW_LINE>newContents.append('"').append(updatedHREFText).append('"');<NEW_LINE>hasMatches = matcher.find();<NEW_LINE>}<NEW_LINE>// grab the remaining content<NEW_LINE>if (currentPosition < fileContents.length()) {<NEW_LINE>newContents.append(fileContents.substring(currentPosition));<NEW_LINE>}<NEW_LINE>return newContents.toString();<NEW_LINE>}
fileContents.substring(currentPosition, matchStart);
819,206
final ListExperimentsResult executeListExperiments(ListExperimentsRequest listExperimentsRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(listExperimentsRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<ListExperimentsRequest> request = null;<NEW_LINE>Response<ListExperimentsResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new ListExperimentsRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(listExperimentsRequest));<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, "SageMaker");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ListExperiments");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<ListExperimentsResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new ListExperimentsResultJsonUnmarshaller());<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);
613,831
// NOTE: Copied from earlier `copyCurrentEvent()`<NEW_LINE>private void _copyBufferValue(JsonParser p, JsonToken t) throws IOException {<NEW_LINE>if (_mayHaveNativeIds) {<NEW_LINE>_checkNativeIds(p);<NEW_LINE>}<NEW_LINE>switch(t) {<NEW_LINE>case VALUE_STRING:<NEW_LINE>if (p.hasTextCharacters()) {<NEW_LINE>writeString(p.getTextCharacters(), p.getTextOffset(), p.getTextLength());<NEW_LINE>} else {<NEW_LINE>writeString(p.getText());<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>case VALUE_NUMBER_INT:<NEW_LINE>switch(p.getNumberType()) {<NEW_LINE>case INT:<NEW_LINE>writeNumber(p.getIntValue());<NEW_LINE>break;<NEW_LINE>case BIG_INTEGER:<NEW_LINE>writeNumber(p.getBigIntegerValue());<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>writeNumber(p.getLongValue());<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>case VALUE_NUMBER_FLOAT:<NEW_LINE>if (_forceBigDecimal) {<NEW_LINE>writeNumber(p.getDecimalValue());<NEW_LINE>} else {<NEW_LINE>// 09-Jul-2020, tatu: Used to just copy using most optimal method, but<NEW_LINE>// issues like [databind#2644] force to use exact, not optimal type<NEW_LINE>final Number n = p.getNumberValueExact();<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>break;<NEW_LINE>case VALUE_TRUE:<NEW_LINE>writeBoolean(true);<NEW_LINE>break;<NEW_LINE>case VALUE_FALSE:<NEW_LINE>writeBoolean(false);<NEW_LINE>break;<NEW_LINE>case VALUE_NULL:<NEW_LINE>writeNull();<NEW_LINE>break;<NEW_LINE>case VALUE_EMBEDDED_OBJECT:<NEW_LINE>writeObject(p.getEmbeddedObject());<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>throw new RuntimeException("Internal error: unexpected token: " + t);<NEW_LINE>}<NEW_LINE>}
_appendValue(JsonToken.VALUE_NUMBER_FLOAT, n);
1,475,313
protected void updateSelectedFilesFieldImpl(final Collection<File> selected) {<NEW_LINE>// Filtered selected files<NEW_LINE>final List<File> files = getFilteredSelectedFiles(selected);<NEW_LINE>// Updating controls<NEW_LINE>folderNew.setEnabled(currentFolder != null);<NEW_LINE>remove.setEnabled(currentFolder != null && selected.size() > 0);<NEW_LINE>// Updating selected files view component<NEW_LINE>if (chooserType == FileChooserType.save) {<NEW_LINE>if (files.size() > 0) {<NEW_LINE>final File file = files.get(0);<NEW_LINE>selectedFilesViewField.setSelectedFile(file);<NEW_LINE>selectedFilesTextField.setText(getSingleFileView(file));<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>selectedFilesViewField.setSelectedFiles(files);<NEW_LINE>selectedFilesTextField<MASK><NEW_LINE>}<NEW_LINE>// When choose action allowed<NEW_LINE>updateAcceptButtonState(files);<NEW_LINE>// Firing selection change<NEW_LINE>fireFileSelectionChanged(files);<NEW_LINE>}
.setText(getFilesView(files));
1,480,487
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><MASK><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, "SESv2");<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>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
1,557,114
public static ListBriefSkillGroupsResponse unmarshall(ListBriefSkillGroupsResponse listBriefSkillGroupsResponse, UnmarshallerContext _ctx) {<NEW_LINE>listBriefSkillGroupsResponse.setRequestId(_ctx.stringValue("ListBriefSkillGroupsResponse.RequestId"));<NEW_LINE>listBriefSkillGroupsResponse.setCode(_ctx.stringValue("ListBriefSkillGroupsResponse.Code"));<NEW_LINE>listBriefSkillGroupsResponse.setHttpStatusCode(_ctx.integerValue("ListBriefSkillGroupsResponse.HttpStatusCode"));<NEW_LINE>listBriefSkillGroupsResponse.setMessage(_ctx.stringValue("ListBriefSkillGroupsResponse.Message"));<NEW_LINE>Data data = new Data();<NEW_LINE>data.setPageNumber(_ctx.integerValue("ListBriefSkillGroupsResponse.Data.PageNumber"));<NEW_LINE>data.setPageSize(_ctx.integerValue("ListBriefSkillGroupsResponse.Data.PageSize"));<NEW_LINE>data.setTotalCount(_ctx.integerValue("ListBriefSkillGroupsResponse.Data.TotalCount"));<NEW_LINE>List<SkillGroup> list = new ArrayList<SkillGroup>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("ListBriefSkillGroupsResponse.Data.List.Length"); i++) {<NEW_LINE>SkillGroup skillGroup = new SkillGroup();<NEW_LINE>skillGroup.setDisplayName(_ctx.stringValue("ListBriefSkillGroupsResponse.Data.List[" + i + "].DisplayName"));<NEW_LINE>skillGroup.setDescription(_ctx.stringValue("ListBriefSkillGroupsResponse.Data.List[" + i + "].Description"));<NEW_LINE>skillGroup.setPhoneNumberCount(_ctx.integerValue("ListBriefSkillGroupsResponse.Data.List[" + i + "].PhoneNumberCount"));<NEW_LINE>skillGroup.setSkillGroupId(_ctx.stringValue<MASK><NEW_LINE>skillGroup.setSkillGroupName(_ctx.stringValue("ListBriefSkillGroupsResponse.Data.List[" + i + "].SkillGroupName"));<NEW_LINE>skillGroup.setUserCount(_ctx.integerValue("ListBriefSkillGroupsResponse.Data.List[" + i + "].UserCount"));<NEW_LINE>skillGroup.setInstanceId(_ctx.stringValue("ListBriefSkillGroupsResponse.Data.List[" + i + "].InstanceId"));<NEW_LINE>list.add(skillGroup);<NEW_LINE>}<NEW_LINE>data.setList(list);<NEW_LINE>listBriefSkillGroupsResponse.setData(data);<NEW_LINE>return listBriefSkillGroupsResponse;<NEW_LINE>}
("ListBriefSkillGroupsResponse.Data.List[" + i + "].SkillGroupId"));
58,784
public okhttp3.Call call123testSpecialTagsCall(Client body, final ApiCallback _callback) throws ApiException {<NEW_LINE>String basePath = null;<NEW_LINE>// Operation Servers<NEW_LINE>String[] localBasePaths = new String[] {};<NEW_LINE>// Determine Base Path to Use<NEW_LINE>if (localCustomBaseUrl != null) {<NEW_LINE>basePath = localCustomBaseUrl;<NEW_LINE>} else if (localBasePaths.length > 0) {<NEW_LINE>basePath = localBasePaths[localHostIndex];<NEW_LINE>} else {<NEW_LINE>basePath = null;<NEW_LINE>}<NEW_LINE>Object localVarPostBody = body;<NEW_LINE>// create path and map variables<NEW_LINE>String localVarPath = "/another-fake/dummy";<NEW_LINE>List<Pair> localVarQueryParams = new ArrayList<Pair>();<NEW_LINE>List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();<NEW_LINE>Map<String, String> localVarHeaderParams = new HashMap<String, String>();<NEW_LINE>Map<String, String> localVarCookieParams = new HashMap<String, String>();<NEW_LINE>Map<String, Object> localVarFormParams = new HashMap<String, Object>();<NEW_LINE>final String[] localVarAccepts = { "application/json" };<NEW_LINE>final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);<NEW_LINE>if (localVarAccept != null) {<NEW_LINE>localVarHeaderParams.put("Accept", localVarAccept);<NEW_LINE>}<NEW_LINE>final String[] localVarContentTypes = { "application/json" };<NEW_LINE>final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);<NEW_LINE>if (localVarContentType != null) {<NEW_LINE>localVarHeaderParams.put("Content-Type", localVarContentType);<NEW_LINE>}<NEW_LINE>String[] <MASK><NEW_LINE>return localVarApiClient.buildCall(basePath, localVarPath, "PATCH", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);<NEW_LINE>}
localVarAuthNames = new String[] {};
741,721
public List<TermedStatementEntityEdit> schedule(List<TermedStatementEntityEdit> updates) throws ImpossibleSchedulingException {<NEW_LINE>pointerUpdates = new HashMap<>();<NEW_LINE>pointerFreeUpdates = new UpdateSequence();<NEW_LINE>for (TermedStatementEntityEdit update : updates) {<NEW_LINE>splitUpdate(update);<NEW_LINE>}<NEW_LINE>// Reconstruct<NEW_LINE>List<TermedStatementEntityEdit> fullSchedule = new ArrayList<>();<NEW_LINE>Set<EntityIdValue> mentionedNewEntities = new HashSet<<MASK><NEW_LINE>for (TermedStatementEntityEdit update : pointerFreeUpdates.getUpdates()) {<NEW_LINE>fullSchedule.add(update);<NEW_LINE>UpdateSequence backPointers = pointerUpdates.get(update.getEntityId());<NEW_LINE>if (backPointers != null) {<NEW_LINE>fullSchedule.addAll(backPointers.getUpdates());<NEW_LINE>}<NEW_LINE>mentionedNewEntities.remove(update.getEntityId());<NEW_LINE>}<NEW_LINE>// Create any entity that was referred to but untouched<NEW_LINE>// (this is just for the sake of correctness, it would be bad to do that<NEW_LINE>// as the entities would remain blank in this batch).<NEW_LINE>for (EntityIdValue missingId : mentionedNewEntities) {<NEW_LINE>fullSchedule.add(new TermedStatementEntityEditBuilder(missingId).build());<NEW_LINE>fullSchedule.addAll(pointerUpdates.get(missingId).getUpdates());<NEW_LINE>}<NEW_LINE>return fullSchedule;<NEW_LINE>}
>(pointerUpdates.keySet());
1,703,697
final ListArchivesResult executeListArchives(ListArchivesRequest listArchivesRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(listArchivesRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<ListArchivesRequest> request = null;<NEW_LINE>Response<ListArchivesResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new ListArchivesRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(listArchivesRequest));<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, "CloudWatch Events");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ListArchives");<NEW_LINE>request.<MASK><NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<ListArchivesResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new ListArchivesResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
37,068
public static Set<Class<?>> collectTypesInSignature(Method controllerMethod) {<NEW_LINE>Set<Class<?>> collector = new TreeSet<>(Comparator.comparing(Class::getName));<NEW_LINE>Type genericReturnType;<NEW_LINE>Type[] genericParameterTypes;<NEW_LINE>if (KotlinDetector.isSuspendingFunction(controllerMethod) && !controllerMethod.isSynthetic()) {<NEW_LINE>Type[] types = controllerMethod.getGenericParameterTypes();<NEW_LINE>ParameterizedType continuation = (ParameterizedType) types[types.length - 1];<NEW_LINE>genericReturnType = ((WildcardType) continuation.getActualTypeArguments()[0]<MASK><NEW_LINE>genericParameterTypes = Arrays.copyOf(types, types.length - 1);<NEW_LINE>} else {<NEW_LINE>genericReturnType = controllerMethod.getGenericReturnType();<NEW_LINE>genericParameterTypes = controllerMethod.getGenericParameterTypes();<NEW_LINE>}<NEW_LINE>collectReferenceTypesUsed(genericReturnType, collector);<NEW_LINE>for (Type parameterType : genericParameterTypes) {<NEW_LINE>collectReferenceTypesUsed(parameterType, collector);<NEW_LINE>}<NEW_LINE>return collector;<NEW_LINE>}
).getLowerBounds()[0];
1,626,337
protected String doInBackground(Void[] params) {<NEW_LINE>String items = "";<NEW_LINE>long fileLength = file.length(context);<NEW_LINE>if (file.isDirectory(context)) {<NEW_LINE>final AtomicInteger x = new AtomicInteger(0);<NEW_LINE>file.forEachChildrenFile(context, false, file -> x.incrementAndGet());<NEW_LINE>final int folderLength = x.intValue();<NEW_LINE>long folderSize;<NEW_LINE>if (isStorage) {<NEW_LINE>folderSize = file.getUsableSpace();<NEW_LINE>} else {<NEW_LINE>folderSize = FileUtils.folderSize(file, data -> publishProgress(new Pair<<MASK><NEW_LINE>}<NEW_LINE>items = getText(folderLength, folderSize, false);<NEW_LINE>} else {<NEW_LINE>items = Formatter.formatFileSize(context, fileLength) + (" (" + fileLength + " " + // truncation is insignificant<NEW_LINE>context.getResources().// truncation is insignificant<NEW_LINE>getQuantityString(// truncation is insignificant<NEW_LINE>R.plurals.bytes, (int) fileLength) + ")");<NEW_LINE>}<NEW_LINE>return items;<NEW_LINE>}
>(folderLength, data)));
1,305,588
private void initInfo(int record_id, String value) {<NEW_LINE>if (!(record_id == 0) && value != null && value.length() > 0) {<NEW_LINE>log.severe("Received both a record_id and a value: " + record_id + " - " + value);<NEW_LINE>}<NEW_LINE>//<NEW_LINE>if (record_id != 0) {<NEW_LINE>fieldID = record_id;<NEW_LINE>// Have to set boolean fields in query<NEW_LINE>String trxName = Trx.createTrxName();<NEW_LINE>MOrder o = new MOrder(Env.getCtx(), record_id, trxName);<NEW_LINE>fIsSOTrx.setSelected(o.isSOTrx());<NEW_LINE>fIsDelivered.setSelected(o.isDelivered());<NEW_LINE>o = null;<NEW_LINE>Trx.get(trxName, false).close();<NEW_LINE>} else // Try to find other criteria in the context<NEW_LINE>{<NEW_LINE>String id;<NEW_LINE>// C_BPartner_ID - restrict the search to the current BPartner<NEW_LINE>id = Env.getContext(Env.getCtx(), p_WindowNo, p_TabNo, "C_BPartner_ID", true);<NEW_LINE>if (id != null && id.length() != 0 && (new Integer(id).intValue() > 0))<NEW_LINE>fBPartner_ID.setValue(new Integer(id));<NEW_LINE>// The value passed in from the field<NEW_LINE>if (value != null && value.length() > 0) {<NEW_LINE>fDocumentNo.setValue(value);<NEW_LINE>} else {<NEW_LINE>// C_Order_ID<NEW_LINE>id = Env.getContext(Env.getCtx(), p_WindowNo, p_TabNo, "C_Order_ID", true);<NEW_LINE>if (id != null && id.length() != 0 && (new Integer(id).intValue() > 0)) {<NEW_LINE>fieldID = new Integer(id).intValue();<NEW_LINE>// Have to set boolean fields in query<NEW_LINE>String trxName = Trx.createTrxName();<NEW_LINE>MOrder o = new MOrder(Env.getCtx(), record_id, trxName);<NEW_LINE>fIsSOTrx.setSelected(o.isSOTrx());<NEW_LINE>fIsDelivered.<MASK><NEW_LINE>o = null;<NEW_LINE>Trx.get(trxName, false).close();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
setSelected(o.isDelivered());
1,283,231
final TestMetricFilterResult executeTestMetricFilter(TestMetricFilterRequest testMetricFilterRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(testMetricFilterRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<TestMetricFilterRequest> request = null;<NEW_LINE>Response<TestMetricFilterResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new TestMetricFilterRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(testMetricFilterRequest));<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, "CloudWatch Logs");<NEW_LINE>request.<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<TestMetricFilterResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new TestMetricFilterResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
addHandlerContext(HandlerContextKey.OPERATION_NAME, "TestMetricFilter");
279,564
private void prepareFramebuffer(int width, int height) {<NEW_LINE>GlUtil.checkGlError("start");<NEW_LINE>int[] values = new int[1];<NEW_LINE>// Create a texture object and bind it. This will be the color buffer.<NEW_LINE>GLES20.glGenTextures(1, values, 0);<NEW_LINE>GlUtil.checkGlError("glGenTextures");<NEW_LINE>// expected > 0<NEW_LINE>mOffscreenTexture = values[0];<NEW_LINE>Log.i(TAG, "prepareFramebuffer mOffscreenTexture:" + mOffscreenTexture);<NEW_LINE>GLES20.glBindTexture(GLES20.GL_TEXTURE_2D, mOffscreenTexture);<NEW_LINE>GlUtil.checkGlError("glBindTexture");<NEW_LINE>// Create texture storage.<NEW_LINE>GLES20.glTexImage2D(GLES20.GL_TEXTURE_2D, 0, GLES20.GL_RGBA, width, height, 0, GLES20.GL_RGBA, GLES20.GL_UNSIGNED_BYTE, null);<NEW_LINE>GLES20.glTexParameterf(GLES20.GL_TEXTURE_2D, GLES20.GL_TEXTURE_MAG_FILTER, GLES20.GL_LINEAR);<NEW_LINE>GLES20.glTexParameterf(GLES20.GL_TEXTURE_2D, GLES20.GL_TEXTURE_MIN_FILTER, GLES20.GL_LINEAR);<NEW_LINE>GLES20.glTexParameterf(GLES20.GL_TEXTURE_2D, GLES20.GL_TEXTURE_WRAP_S, GLES20.GL_CLAMP_TO_EDGE);<NEW_LINE>GLES20.glTexParameterf(GLES20.GL_TEXTURE_2D, GLES20.GL_TEXTURE_WRAP_T, GLES20.GL_CLAMP_TO_EDGE);<NEW_LINE>GlUtil.checkGlError("glTexParameter");<NEW_LINE>// Create framebuffer object and bind it.<NEW_LINE>GLES20.glGenFramebuffers(1, values, 0);<NEW_LINE>GlUtil.checkGlError("glGenFramebuffers");<NEW_LINE>// expected > 0<NEW_LINE>mFramebuffer = values[0];<NEW_LINE>GLES20.glBindFramebuffer(GLES20.GL_FRAMEBUFFER, mFramebuffer);<NEW_LINE><MASK><NEW_LINE>GLES20.glFramebufferTexture2D(GLES20.GL_FRAMEBUFFER, GLES20.GL_COLOR_ATTACHMENT0, GLES20.GL_TEXTURE_2D, mOffscreenTexture, 0);<NEW_LINE>// See if GLES is happy with all this.<NEW_LINE>int status = GLES20.glCheckFramebufferStatus(GLES20.GL_FRAMEBUFFER);<NEW_LINE>if (status != GLES20.GL_FRAMEBUFFER_COMPLETE) {<NEW_LINE>throw new RuntimeException("Framebuffer not complete, status=" + status);<NEW_LINE>}<NEW_LINE>GLES20.glBindTexture(GLES20.GL_TEXTURE_2D, 0);<NEW_LINE>// Switch back to the default framebuffer.<NEW_LINE>GLES20.glBindFramebuffer(GLES20.GL_FRAMEBUFFER, 0);<NEW_LINE>GlUtil.checkGlError("glBindFramebuffer");<NEW_LINE>}
GlUtil.checkGlError("glBindFramebuffer " + mFramebuffer);
1,509,877
public PCollection<KV<K, V>> expand(PBegin input) {<NEW_LINE>validateTransform();<NEW_LINE>// Get the key and value coders based on the key and value classes.<NEW_LINE>CoderRegistry coderRegistry = input.getPipeline().getCoderRegistry();<NEW_LINE>Coder<K> keyCoder = getKeyCoder();<NEW_LINE>if (keyCoder == null) {<NEW_LINE>keyCoder = getDefaultCoder(getKeyTypeDescriptor(), coderRegistry);<NEW_LINE>}<NEW_LINE>Coder<V> valueCoder = getValueCoder();<NEW_LINE>if (valueCoder == null) {<NEW_LINE>valueCoder = <MASK><NEW_LINE>}<NEW_LINE>HadoopInputFormatBoundedSource<K, V> source = new HadoopInputFormatBoundedSource<>(getConfiguration(), keyCoder, valueCoder, getKeyTranslationFunction(), getValueTranslationFunction(), getSkipKeyClone(), getSkipValueClone());<NEW_LINE>return input.getPipeline().apply(org.apache.beam.sdk.io.Read.from(source));<NEW_LINE>}
getDefaultCoder(getValueTypeDescriptor(), coderRegistry);
846,798
private Long countExpiredTaskTaskCompleted(Business business, DateRange dateRange, String applicationId, String processId, String activityId, List<String> units, String person) throws Exception {<NEW_LINE>EntityManager em = business.entityManagerContainer().get(TaskCompleted.class);<NEW_LINE>CriteriaBuilder cb = em.getCriteriaBuilder();<NEW_LINE>CriteriaQuery<Long> cq = cb.createQuery(Long.class);<NEW_LINE>Root<TaskCompleted> root = cq.from(TaskCompleted.class);<NEW_LINE>Predicate p = cb.between(root.get(TaskCompleted_.expireTime), dateRange.getStart(), dateRange.getEnd());<NEW_LINE>p = cb.and(p, cb.equal(root.get(TaskCompleted_.expired), true));<NEW_LINE>if (!StringUtils.equals(applicationId, StandardJaxrsAction.EMPTY_SYMBOL)) {<NEW_LINE>p = cb.and(p, cb.equal(root.get(TaskCompleted_.application), applicationId));<NEW_LINE>}<NEW_LINE>if (!StringUtils.equals(processId, StandardJaxrsAction.EMPTY_SYMBOL)) {<NEW_LINE>p = cb.and(p, cb.equal(root.get(TaskCompleted_.process), processId));<NEW_LINE>}<NEW_LINE>if (!StringUtils.equals(activityId, StandardJaxrsAction.EMPTY_SYMBOL)) {<NEW_LINE>p = cb.and(p, cb.equal(root.get(TaskCompleted_.activity), activityId));<NEW_LINE>}<NEW_LINE>if (ListTools.isNotEmpty(units)) {<NEW_LINE>p = cb.and(p, root.get(TaskCompleted_.unit).in(units));<NEW_LINE>}<NEW_LINE>if (!StringUtils.equals(person, StandardJaxrsAction.EMPTY_SYMBOL)) {<NEW_LINE>p = cb.and(p, cb.equal(root.get(TaskCompleted_.person), person));<NEW_LINE>}<NEW_LINE>cq.select(cb.count(<MASK><NEW_LINE>return em.createQuery(cq).getSingleResult();<NEW_LINE>}
root)).where(p);
1,433,036
public ListProvisionedConcurrencyConfigsResult unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>ListProvisionedConcurrencyConfigsResult listProvisionedConcurrencyConfigsResult = new ListProvisionedConcurrencyConfigsResult();<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 listProvisionedConcurrencyConfigsResult;<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("ProvisionedConcurrencyConfigs", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>listProvisionedConcurrencyConfigsResult.setProvisionedConcurrencyConfigs(new ListUnmarshaller<ProvisionedConcurrencyConfigListItem>(ProvisionedConcurrencyConfigListItemJsonUnmarshaller.getInstance()).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("NextMarker", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>listProvisionedConcurrencyConfigsResult.setNextMarker(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 listProvisionedConcurrencyConfigsResult;<NEW_LINE>}
int originalDepth = context.getCurrentDepth();
320,515
public JsonResult execute() {<NEW_LINE>String recoveryEmailAddress = getNonNullRequestParamValue(Const.ParamsNames.STUDENT_EMAIL);<NEW_LINE>if (!StringHelper.isMatching(recoveryEmailAddress, REGEX_EMAIL)) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>String userCaptchaResponse = getRequestParamValue(Const.ParamsNames.USER_CAPTCHA_RESPONSE);<NEW_LINE>if (!recaptchaVerifier.isVerificationSuccessful(userCaptchaResponse)) {<NEW_LINE>return new JsonResult(new SessionLinksRecoveryResponseData(false, "Something went wrong with " + "the reCAPTCHA verification. Please try again."));<NEW_LINE>}<NEW_LINE>EmailWrapper email = emailGenerator.generateSessionLinksRecoveryEmailForStudent(recoveryEmailAddress);<NEW_LINE>EmailSendingStatus status = emailSender.sendEmail(email);<NEW_LINE>if (status.isSuccess()) {<NEW_LINE>return new JsonResult(new SessionLinksRecoveryResponseData(true, "The recovery links for your feedback sessions have been sent to the " + "specified email address: " + recoveryEmailAddress));<NEW_LINE>} else {<NEW_LINE>return new JsonResult(new SessionLinksRecoveryResponseData(false, "An error occurred. " + "The email could not be sent."));<NEW_LINE>}<NEW_LINE>}
throw new InvalidHttpParameterException("Invalid email address: " + recoveryEmailAddress);
372,802
public void read(org.apache.thrift.protocol.TProtocol prot, initiateFlush_args struct) throws org.apache.thrift.TException {<NEW_LINE>org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot;<NEW_LINE>java.util.BitSet incoming = iprot.readBitSet(3);<NEW_LINE>if (incoming.get(0)) {<NEW_LINE>struct.tinfo = new org.apache.accumulo.core.trace.thrift.TInfo();<NEW_LINE>struct.tinfo.read(iprot);<NEW_LINE>struct.setTinfoIsSet(true);<NEW_LINE>}<NEW_LINE>if (incoming.get(1)) {<NEW_LINE>struct.credentials = new org.apache.accumulo.core<MASK><NEW_LINE>struct.credentials.read(iprot);<NEW_LINE>struct.setCredentialsIsSet(true);<NEW_LINE>}<NEW_LINE>if (incoming.get(2)) {<NEW_LINE>struct.tableName = iprot.readString();<NEW_LINE>struct.setTableNameIsSet(true);<NEW_LINE>}<NEW_LINE>}
.securityImpl.thrift.TCredentials();
827,632
private void internalGetAndPut(final byte[] key, final byte[] value, final CompletableFuture<byte[]> future, final int retriesLeft, final Errors lastCause) {<NEW_LINE>final Region region = this.pdClient.findRegionByKey(key, ErrorsHelper.isInvalidEpoch(lastCause));<NEW_LINE>final RegionEngine regionEngine = getRegionEngine(region.getId(), true);<NEW_LINE>final RetryRunner retryRunner = retryCause -> internalGetAndPut(key, value, <MASK><NEW_LINE>final FailoverClosure<byte[]> closure = new FailoverClosureImpl<>(future, retriesLeft, retryRunner);<NEW_LINE>if (regionEngine != null) {<NEW_LINE>if (ensureOnValidEpoch(region, regionEngine, closure)) {<NEW_LINE>getRawKVStore(regionEngine).getAndPut(key, value, closure);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>final GetAndPutRequest request = new GetAndPutRequest();<NEW_LINE>request.setKey(key);<NEW_LINE>request.setValue(value);<NEW_LINE>request.setRegionId(region.getId());<NEW_LINE>request.setRegionEpoch(region.getRegionEpoch());<NEW_LINE>this.rheaKVRpcService.callAsyncWithRpc(request, closure, lastCause);<NEW_LINE>}<NEW_LINE>}
future, retriesLeft - 1, retryCause);
1,470,307
private void validate(APIAddHostRouteToL3NetworkMsg msg) {<NEW_LINE>if (!NetworkUtils.isCidr(msg.getPrefix())) {<NEW_LINE>throw new ApiMessageInterceptionException(argerr("prefix [%s] is not a IPv4 network cidr", msg.getL3NetworkUuid()));<NEW_LINE>}<NEW_LINE>if (!NetworkUtils.isIpv4Address(msg.getNexthop())) {<NEW_LINE>throw new ApiMessageInterceptionException(argerr("nexthop[%s] is not a IPv4 address", msg.getNexthop()));<NEW_LINE>}<NEW_LINE>SimpleQuery<L3NetworkHostRouteVO> q = dbf.createQuery(L3NetworkHostRouteVO.class);<NEW_LINE>q.add(L3NetworkHostRouteVO_.l3NetworkUuid, Op.<MASK><NEW_LINE>q.add(L3NetworkHostRouteVO_.prefix, Op.EQ, msg.getPrefix());<NEW_LINE>if (q.isExists()) {<NEW_LINE>throw new ApiMessageInterceptionException(operr("there has been a hostroute for prefix[%s] on L3 network[uuid:%s]", msg.getPrefix(), msg.getL3NetworkUuid()));<NEW_LINE>}<NEW_LINE>}
EQ, msg.getL3NetworkUuid());
751,417
public long update() {<NEW_LINE>Database db = session.getDatabase();<NEW_LINE>Schema schema = db.findSchema(schemaName);<NEW_LINE>if (schema == null) {<NEW_LINE>if (!ifExists) {<NEW_LINE>throw DbException.get(ErrorCode.SCHEMA_NOT_FOUND_1, schemaName);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>session.getUser().checkSchemaOwner(schema);<NEW_LINE>if (!schema.canDrop()) {<NEW_LINE>throw DbException.get(ErrorCode.SCHEMA_CAN_NOT_BE_DROPPED_1, schemaName);<NEW_LINE>}<NEW_LINE>if (dropAction == ConstraintActionType.RESTRICT && !schema.isEmpty()) {<NEW_LINE>ArrayList<SchemaObject> all = schema.getAll(null);<NEW_LINE>int size = all.size();<NEW_LINE>if (size > 0) {<NEW_LINE>StringBuilder builder = new StringBuilder();<NEW_LINE>for (int i = 0; i < size; i++) {<NEW_LINE>if (i > 0) {<NEW_LINE>builder.append(", ");<NEW_LINE>}<NEW_LINE>builder.append(all.get(i).getName());<NEW_LINE>}<NEW_LINE>throw DbException.get(ErrorCode.CANNOT_DROP_2, <MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>db.removeDatabaseObject(session, schema);<NEW_LINE>}<NEW_LINE>return 0;<NEW_LINE>}
schemaName, builder.toString());
1,431,932
public void printResults(boolean showResults, double duration, int passes) {<NEW_LINE>if (showResults) {<NEW_LINE>System.out.print("2, ");<NEW_LINE>}<NEW_LINE>int count = 1;<NEW_LINE>for (int num = 3; num <= this.sieveSize; num++) {<NEW_LINE>if (getBit(num)) {<NEW_LINE>if (showResults) {<NEW_LINE>System.<MASK><NEW_LINE>}<NEW_LINE>count++;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (showResults) {<NEW_LINE>System.out.println();<NEW_LINE>}<NEW_LINE>System.out.printf("Passes: %d, Time: %f, Avg: %f, Limit: %d, Count: %d, Valid: %s%n", passes, duration, (duration / passes), sieveSize, count, validateResults());<NEW_LINE>// Following 2 lines added by rbergen to conform to drag race output format<NEW_LINE>System.out.println();<NEW_LINE>System.out.printf("MansenC-native;%d;%f;1;algorithm=base,faithful=yes\n", passes, duration);<NEW_LINE>}
out.print(num + ", ");
600,403
public FileObject[] listSavedSnapshots(Lookup.Provider project, File directory) {<NEW_LINE>try {<NEW_LINE>FileObject snapshotsFolder = null;<NEW_LINE>if (project == null && directory != null) {<NEW_LINE>snapshotsFolder = FileUtil.toFileObject(directory);<NEW_LINE>} else {<NEW_LINE>snapshotsFolder = ProfilerStorage.getProjectFolder(project, false);<NEW_LINE>}<NEW_LINE>if (snapshotsFolder == null) {<NEW_LINE>return new FileObject[0];<NEW_LINE>}<NEW_LINE>snapshotsFolder.refresh();<NEW_LINE>FileObject[] children = snapshotsFolder.getChildren();<NEW_LINE>ArrayList /*<FileObject>*/<NEW_LINE>files = new ArrayList();<NEW_LINE>for (int i = 0; i < children.length; i++) {<NEW_LINE>FileObject child = children[i];<NEW_LINE>if (child.getExt().equalsIgnoreCase(SNAPSHOT_EXTENSION)) {<NEW_LINE>files.add(child);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>Collections.sort(files, new Comparator() {<NEW_LINE><NEW_LINE>public int compare(Object o1, Object o2) {<NEW_LINE>FileObject f1 = (FileObject) o1;<NEW_LINE>FileObject f2 = (FileObject) o2;<NEW_LINE>return f1.getName().<MASK><NEW_LINE>}<NEW_LINE>});<NEW_LINE>return (FileObject[]) files.toArray(new FileObject[0]);<NEW_LINE>} catch (IOException e) {<NEW_LINE>LOGGER.log(Level.SEVERE, Bundle.ResultsManager_ObtainSavedSnapshotsFailedMsg(e.getMessage()), e);<NEW_LINE>return new FileObject[0];<NEW_LINE>}<NEW_LINE>}
compareTo(f2.getName());
1,219,310
private SqlNodeList buildTargetColumn(SqlUpdate oldUpdate, String tableNameAlias, List<Integer> pickedColumnIndexes) {<NEW_LINE><MASK><NEW_LINE>SqlNodeList newTargetColumns = new SqlNodeList(oldTargetColumns.getParserPosition());<NEW_LINE>for (int i = 0; i < oldTargetColumns.size(); i++) {<NEW_LINE>SqlIdentifier sqlIdentifier = (SqlIdentifier) oldTargetColumns.get(i);<NEW_LINE>List<String> names = sqlIdentifier.names;<NEW_LINE>String columnName = null;<NEW_LINE>if (names.size() > 1) {<NEW_LINE>if (tableNameAlias.equalsIgnoreCase(names.get(0))) {<NEW_LINE>columnName = names.get(1);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>columnName = names.get(0);<NEW_LINE>}<NEW_LINE>if (columnName != null) {<NEW_LINE>SqlIdentifier newSqlIdentifier = new SqlIdentifier(columnName, sqlIdentifier.getParserPosition());<NEW_LINE>newTargetColumns.add(newSqlIdentifier);<NEW_LINE>pickedColumnIndexes.add(i);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return newTargetColumns;<NEW_LINE>}
SqlNodeList oldTargetColumns = oldUpdate.getTargetColumnList();
1,598,103
public void onViewAdded(View view) {<NEW_LINE>super.onViewAdded(view);<NEW_LINE>ConstraintWidget widget = getViewWidget(view);<NEW_LINE>if (view instanceof androidx.constraintlayout.widget.Guideline) {<NEW_LINE>if (!(widget instanceof Guideline)) {<NEW_LINE>LayoutParams layoutParams = (LayoutParams) view.getLayoutParams();<NEW_LINE>layoutParams.mWidget = new Guideline();<NEW_LINE>layoutParams.mIsGuideline = true;<NEW_LINE>((Guideline) layoutParams.mWidget).setOrientation(layoutParams.orientation);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (view instanceof ConstraintHelper) {<NEW_LINE>ConstraintHelper helper = (ConstraintHelper) view;<NEW_LINE>helper.validateParams();<NEW_LINE>LayoutParams layoutParams = <MASK><NEW_LINE>layoutParams.mIsHelper = true;<NEW_LINE>if (!mConstraintHelpers.contains(helper)) {<NEW_LINE>mConstraintHelpers.add(helper);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>mChildrenByIds.put(view.getId(), view);<NEW_LINE>mDirtyHierarchy = true;<NEW_LINE>}
(LayoutParams) view.getLayoutParams();
1,789,634
// ---------//<NEW_LINE>// touches //<NEW_LINE>// ---------//<NEW_LINE>@Override<NEW_LINE>public boolean touches(Section that) {<NEW_LINE><MASK><NEW_LINE>thatFatBox.grow(1, 1);<NEW_LINE>// Very rough test<NEW_LINE>if (!getPolygon().intersects(thatFatBox)) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>int pos = getFirstPos();<NEW_LINE>for (Run run : runs) {<NEW_LINE>final int start = run.getStart();<NEW_LINE>final Rectangle r1 = (orientation == HORIZONTAL) ? new Rectangle(start, pos, run.getLength(), 1) : new Rectangle(pos, start, 1, run.getLength());<NEW_LINE>if (thatFatBox.intersects(r1)) {<NEW_LINE>// Check contact between this run and one of that runs<NEW_LINE>int thatPos = that.getFirstPos();<NEW_LINE>for (Run thatRun : that.getRuns()) {<NEW_LINE>final int thatStart = thatRun.getStart();<NEW_LINE>final int thatLength = thatRun.getLength();<NEW_LINE>final Rectangle r2 = (that.getOrientation() == HORIZONTAL) ? new Rectangle(thatStart, thatPos, thatLength, 1) : new Rectangle(thatPos, thatStart, 1, thatLength);<NEW_LINE>if (GeoUtil.touch(r1, r2)) {<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>thatPos++;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>pos++;<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>}
Rectangle thatFatBox = that.getBounds();
606,971
public static DescribeDesktopGroupsResponse unmarshall(DescribeDesktopGroupsResponse describeDesktopGroupsResponse, UnmarshallerContext _ctx) {<NEW_LINE>describeDesktopGroupsResponse.setRequestId(_ctx.stringValue("DescribeDesktopGroupsResponse.RequestId"));<NEW_LINE>describeDesktopGroupsResponse.setNextToken(_ctx.stringValue("DescribeDesktopGroupsResponse.NextToken"));<NEW_LINE>List<DesktopGroup> desktopGroups = new ArrayList<DesktopGroup>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("DescribeDesktopGroupsResponse.DesktopGroups.Length"); i++) {<NEW_LINE>DesktopGroup desktopGroup = new DesktopGroup();<NEW_LINE>desktopGroup.setCreateTime(_ctx.stringValue("DescribeDesktopGroupsResponse.DesktopGroups[" + i + "].CreateTime"));<NEW_LINE>desktopGroup.setPayType(_ctx.stringValue("DescribeDesktopGroupsResponse.DesktopGroups[" + i + "].PayType"));<NEW_LINE>desktopGroup.setPolicyGroupName(_ctx.stringValue("DescribeDesktopGroupsResponse.DesktopGroups[" + i + "].PolicyGroupName"));<NEW_LINE>desktopGroup.setCreator(_ctx.stringValue("DescribeDesktopGroupsResponse.DesktopGroups[" + i + "].Creator"));<NEW_LINE>desktopGroup.setMaxDesktopsCount(_ctx.integerValue("DescribeDesktopGroupsResponse.DesktopGroups[" + i + "].MaxDesktopsCount"));<NEW_LINE>desktopGroup.setSystemDiskSize(_ctx.integerValue("DescribeDesktopGroupsResponse.DesktopGroups[" + i + "].SystemDiskSize"));<NEW_LINE>desktopGroup.setPolicyGroupId(_ctx.stringValue("DescribeDesktopGroupsResponse.DesktopGroups[" + i + "].PolicyGroupId"));<NEW_LINE>desktopGroup.setOwnBundleId(_ctx.stringValue("DescribeDesktopGroupsResponse.DesktopGroups[" + i + "].OwnBundleId"));<NEW_LINE>desktopGroup.setGpuCount(_ctx.floatValue("DescribeDesktopGroupsResponse.DesktopGroups[" + i + "].GpuCount"));<NEW_LINE>desktopGroup.setMemory(_ctx.longValue("DescribeDesktopGroupsResponse.DesktopGroups[" + i + "].Memory"));<NEW_LINE>desktopGroup.setGpuSpec(_ctx.stringValue("DescribeDesktopGroupsResponse.DesktopGroups[" + i + "].GpuSpec"));<NEW_LINE>desktopGroup.setDirectoryId(_ctx.stringValue("DescribeDesktopGroupsResponse.DesktopGroups[" + i + "].DirectoryId"));<NEW_LINE>desktopGroup.setOwnBundleName(_ctx.stringValue("DescribeDesktopGroupsResponse.DesktopGroups[" + i + "].OwnBundleName"));<NEW_LINE>desktopGroup.setDataDiskCategory(_ctx.stringValue("DescribeDesktopGroupsResponse.DesktopGroups[" + i + "].DataDiskCategory"));<NEW_LINE>desktopGroup.setDesktopGroupName(_ctx.stringValue("DescribeDesktopGroupsResponse.DesktopGroups[" + i + "].DesktopGroupName"));<NEW_LINE>desktopGroup.setSystemDiskCategory(_ctx.stringValue("DescribeDesktopGroupsResponse.DesktopGroups[" + i + "].SystemDiskCategory"));<NEW_LINE>desktopGroup.setOfficeSiteId(_ctx.stringValue("DescribeDesktopGroupsResponse.DesktopGroups[" + i + "].OfficeSiteId"));<NEW_LINE>desktopGroup.setKeepDuration(_ctx.longValue("DescribeDesktopGroupsResponse.DesktopGroups[" + i + "].KeepDuration"));<NEW_LINE>desktopGroup.setMinDesktopsCount(_ctx.integerValue("DescribeDesktopGroupsResponse.DesktopGroups[" + i + "].MinDesktopsCount"));<NEW_LINE>desktopGroup.setEndUserCount(_ctx.integerValue("DescribeDesktopGroupsResponse.DesktopGroups[" + i + "].EndUserCount"));<NEW_LINE>desktopGroup.setDataDiskSize(_ctx.stringValue("DescribeDesktopGroupsResponse.DesktopGroups[" + i + "].DataDiskSize"));<NEW_LINE>desktopGroup.setDesktopGroupId(_ctx.stringValue("DescribeDesktopGroupsResponse.DesktopGroups[" + i + "].DesktopGroupId"));<NEW_LINE>desktopGroup.setOfficeSiteName(_ctx.stringValue("DescribeDesktopGroupsResponse.DesktopGroups[" + i + "].OfficeSiteName"));<NEW_LINE>desktopGroup.setDirectoryType(_ctx.stringValue("DescribeDesktopGroupsResponse.DesktopGroups[" + i + "].DirectoryType"));<NEW_LINE>desktopGroup.setCpu(_ctx.integerValue("DescribeDesktopGroupsResponse.DesktopGroups[" + i + "].Cpu"));<NEW_LINE>desktopGroup.setExpiredTime(_ctx.stringValue("DescribeDesktopGroupsResponse.DesktopGroups[" + i + "].ExpiredTime"));<NEW_LINE>desktopGroup.setComments(_ctx.stringValue("DescribeDesktopGroupsResponse.DesktopGroups[" + i + "].Comments"));<NEW_LINE>desktopGroup.setOfficeSiteType(_ctx.stringValue("DescribeDesktopGroupsResponse.DesktopGroups[" + i + "].OfficeSiteType"));<NEW_LINE>desktopGroup.setStatus(_ctx.integerValue("DescribeDesktopGroupsResponse.DesktopGroups[" + i + "].Status"));<NEW_LINE>desktopGroup.setResetType(_ctx.longValue<MASK><NEW_LINE>desktopGroups.add(desktopGroup);<NEW_LINE>}<NEW_LINE>describeDesktopGroupsResponse.setDesktopGroups(desktopGroups);<NEW_LINE>return describeDesktopGroupsResponse;<NEW_LINE>}
("DescribeDesktopGroupsResponse.DesktopGroups[" + i + "].ResetType"));
555,383
public static void enqueue(@NonNull final Collection<PurchaseCandidateId> purchaseCandidateIds, @Nullable final DocTypeId docTypeId) {<NEW_LINE>final Multimap<Integer, I_C_PurchaseCandidate> //<NEW_LINE>//<NEW_LINE>vendorId2purchaseCandidate = loadByIds(PurchaseCandidateId.toIntSet(purchaseCandidateIds), I_C_PurchaseCandidate.class).stream().collect(// key function<NEW_LINE>Multimaps.// key function<NEW_LINE>toMultimap(// value function<NEW_LINE>I_C_PurchaseCandidate::getVendor_ID, // multimap builder<NEW_LINE>Functions.identity(), MultimapBuilder.treeKeys().arrayListValues()::build));<NEW_LINE>if (vendorId2purchaseCandidate.isEmpty()) {<NEW_LINE>throw new AdempiereException("No purchase candidates to enqueue");<NEW_LINE>}<NEW_LINE>final Collection<Collection<I_C_PurchaseCandidate>> values = vendorId2purchaseCandidate<MASK><NEW_LINE>for (final Collection<I_C_PurchaseCandidate> candidateRecords : values) {<NEW_LINE>final LockOwner lockOwner = LockOwner.newOwner(C_PurchaseCandidates_GeneratePurchaseOrders.class.getSimpleName());<NEW_LINE>final ILockCommand elementsLocker = Services.get(ILockManager.class).lock().setOwner(lockOwner).setAutoCleanup(false);<NEW_LINE>final List<TableRecordReference> //<NEW_LINE>//<NEW_LINE>candidateRecordReferences = TableRecordReference.ofCollection(candidateRecords);<NEW_LINE>Services.get(IWorkPackageQueueFactory.class).getQueueForEnqueuing(C_PurchaseCandidates_GeneratePurchaseOrders.class).newWorkPackage().setElementsLocker(elementsLocker).bindToThreadInheritedTrx().addElements(candidateRecordReferences).setUserInChargeId(Env.getLoggedUserIdIfExists().orElse(null)).parameter(DOC_TYPE_ID, docTypeId).buildAndEnqueue();<NEW_LINE>}<NEW_LINE>}
.asMap().values();
1,523,200
protected void startSendFile() {<NEW_LINE><MASK><NEW_LINE>requestPermission(SEND_FILE, new PermissionUtils.SimpleCallback() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onGranted() {<NEW_LINE>Intent intent = new Intent(Intent.ACTION_GET_CONTENT);<NEW_LINE>intent.setType("*/*");<NEW_LINE>intent.addCategory(Intent.CATEGORY_OPENABLE);<NEW_LINE>mInputMoreFragment.setCallback(new IUIKitCallback() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onSuccess(Object data) {<NEW_LINE>TUIMessageBean info = ChatMessageBuilder.buildFileMessage((Uri) data);<NEW_LINE>if (mMessageHandler != null) {<NEW_LINE>mMessageHandler.sendMessage(info);<NEW_LINE>hideSoftInput();<NEW_LINE>}<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onError(String module, int errCode, String errMsg) {<NEW_LINE>ToastUtil.toastLongMessage(errMsg);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>mInputMoreFragment.startActivityForResult(intent, InputMoreFragment.REQUEST_CODE_FILE);<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onDenied() {<NEW_LINE>TUIChatLog.i(TAG, "startSendFile checkPermission failed");<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}
TUIChatLog.i(TAG, "startSendFile");
49,994
private void excludeSelected(boolean recurse) {<NEW_LINE>final ArrayList<PackageSet> selected = getSelectedSets(recurse);<NEW_LINE>if (selected == null || selected.isEmpty())<NEW_LINE>return;<NEW_LINE>for (PackageSet set : selected) {<NEW_LINE>if (myCurrentScope == null) {<NEW_LINE>myCurrentScope = new ComplementPackageSet(set);<NEW_LINE>} else if (myCurrentScope instanceof InvalidPackageSet) {<NEW_LINE>myCurrentScope = StringUtil.isEmpty(myCurrentScope.getText()) ? new ComplementPackageSet(set) : new IntersectionPackageSet(myCurrentScope, new ComplementPackageSet(set));<NEW_LINE>} else {<NEW_LINE>final boolean[] append = { true };<NEW_LINE>final PackageSet simplifiedScope = processComplementaryScope(<MASK><NEW_LINE>if (!append[0]) {<NEW_LINE>myCurrentScope = simplifiedScope;<NEW_LINE>} else {<NEW_LINE>myCurrentScope = simplifiedScope != null ? new IntersectionPackageSet(simplifiedScope, new ComplementPackageSet(set)) : new ComplementPackageSet(set);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>rebuild(true);<NEW_LINE>}
myCurrentScope, set, false, append);
1,143,592
public void put(Object key, Object value) {<NEW_LINE>if (cacheSize <= memoryCache.size()) {<NEW_LINE>// we need to find the oldest entry<NEW_LINE>Enumeration e = memoryCache.keys();<NEW_LINE>long oldest = System.currentTimeMillis();<NEW_LINE>Object oldestKey = null;<NEW_LINE>Object[] oldestValue = null;<NEW_LINE>while (e.hasMoreElements()) {<NEW_LINE><MASK><NEW_LINE>Object[] currentValue = (Object[]) memoryCache.get(currentKey);<NEW_LINE>long currentAge = ((Long) currentValue[0]).longValue();<NEW_LINE>if (currentAge <= oldest || oldestValue == null) {<NEW_LINE>oldest = currentAge;<NEW_LINE>oldestKey = currentKey;<NEW_LINE>oldestValue = currentValue;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>placeInStorageCache(oldestKey, oldest, oldestValue[1]);<NEW_LINE>weakCache.put(oldestKey, Display.getInstance().createSoftWeakRef(oldestValue[1]));<NEW_LINE>memoryCache.remove(oldestKey);<NEW_LINE>}<NEW_LINE>long lastAccess = System.currentTimeMillis();<NEW_LINE>memoryCache.put(key, new Object[] { new Long(lastAccess), value });<NEW_LINE>if (alwaysStore) {<NEW_LINE>placeInStorageCache(key, lastAccess, value);<NEW_LINE>}<NEW_LINE>}
Object currentKey = e.nextElement();
1,440,851
private boolean checkAndLockRelationshipsIfNodeIsGoingToBeDense(NodeRecord node, RelationshipModifications.NodeRelationshipIds byNode, RecordAccess<RelationshipRecord, Void> relRecords, ResourceLocker locks, LockTracer lockTracer) {<NEW_LINE>// We have an exclusively locked sparse not that may turn dense<NEW_LINE>long nextRel = node.getNextRel();<NEW_LINE>if (!isNull(nextRel)) {<NEW_LINE>RelationshipRecord rel = relRecords.getOrLoad(nextRel, null).forReadingData();<NEW_LINE>long nodeId = node.getId();<NEW_LINE>if (!rel.isFirstInChain(nodeId)) {<NEW_LINE>throw new IllegalStateException("Expected node " + rel + " to be first in chain for node " + nodeId);<NEW_LINE>}<NEW_LINE>int <MASK><NEW_LINE>if (currentDegree + byNode.creations().size() >= denseNodeThreshold) {<NEW_LINE>// The current length plus our additions in this transaction is above threshold, it will be converted so we need to lock all the relationships<NEW_LINE>// Since it is sparse and locked we can trust this chain read to be stable<NEW_LINE>// find all id's and lock them as we will create new chains based on type and direction<NEW_LINE>MutableLongList ids = LongLists.mutable.withInitialCapacity(currentDegree);<NEW_LINE>do {<NEW_LINE>ids.add(nextRel);<NEW_LINE>nextRel = relRecords.getOrLoad(nextRel, null).forReadingData().getNextRel(nodeId);<NEW_LINE>} while (!isNull(nextRel));<NEW_LINE>locks.acquireExclusive(lockTracer, RELATIONSHIP, ids.toSortedArray());<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>}
currentDegree = relCount(nodeId, rel);
1,854,991
private MTreeNode retrieveRootNodeModel() {<NEW_LINE>final UserMenuInfo userMenuInfo = getUserMenuInfo();<NEW_LINE>final <MASK><NEW_LINE>if (adTreeId == null) {<NEW_LINE>throw new AdempiereException("Menu tree not found");<NEW_LINE>}<NEW_LINE>final MTree mTree = MTree.builder().setCtx(Env.getCtx()).setTrxName(ITrx.TRXNAME_None).setAD_Tree_ID(adTreeId.getRepoId()).setEditable(false).setClientTree(true).setLanguage(getAD_Language()).build();<NEW_LINE>final MTreeNode rootNodeModel = mTree.getRoot();<NEW_LINE>final AdMenuId rootMenuIdEffective = userMenuInfo.getRootMenuId();<NEW_LINE>if (rootMenuIdEffective != null) {<NEW_LINE>final MTreeNode rootNodeModelEffective = rootNodeModel.findNode(rootMenuIdEffective.getRepoId());<NEW_LINE>if (rootNodeModelEffective != null) {<NEW_LINE>return rootNodeModelEffective;<NEW_LINE>} else {<NEW_LINE>logger.warn("Cannot find Root_Menu_ID={} in {}", rootMenuIdEffective, mTree);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return rootNodeModel;<NEW_LINE>}
AdTreeId adTreeId = userMenuInfo.getAdTreeId();
1,790,269
public boolean nest(SETNode other) {<NEW_LINE>if (other.resolve(this) == false) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>IterableSet otherBody = other.get_Body();<NEW_LINE>Iterator<IterableSet> sbit = subBodies.iterator();<NEW_LINE>while (sbit.hasNext()) {<NEW_LINE>IterableSet subBody = sbit.next();<NEW_LINE>if (subBody.intersects(otherBody)) {<NEW_LINE>IterableSet childChain = body2childChain.get(subBody);<NEW_LINE>Iterator ccit = childChain.snapshotIterator();<NEW_LINE>while (ccit.hasNext()) {<NEW_LINE>SETNode curChild = (SETNode) ccit.next();<NEW_LINE><MASK><NEW_LINE>if (childBody.intersects(otherBody)) {<NEW_LINE>if (childBody.isSupersetOf(otherBody)) {<NEW_LINE>return curChild.nest(other);<NEW_LINE>} else {<NEW_LINE>remove_Child(curChild, childChain);<NEW_LINE>Iterator<IterableSet> osbit = other.subBodies.iterator();<NEW_LINE>while (osbit.hasNext()) {<NEW_LINE>IterableSet otherSubBody = osbit.next();<NEW_LINE>if (otherSubBody.isSupersetOf(childBody)) {<NEW_LINE>other.add_Child(curChild, other.get_Body2ChildChain().get(otherSubBody));<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>add_Child(other, childChain);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>}
IterableSet childBody = curChild.get_Body();
1,068,881
private RouteSubregion readRouteTree(RouteSubregion thisTree, RouteSubregion parentTree, int depth, boolean readCoordinates) throws IOException {<NEW_LINE>boolean readChildren = depth != 0;<NEW_LINE>if (readChildren) {<NEW_LINE>thisTree.subregions = new ArrayList<BinaryMapRouteReaderAdapter.RouteSubregion>();<NEW_LINE>}<NEW_LINE>thisTree.routeReg.regionsRead++;<NEW_LINE>while (true) {<NEW_LINE>int t = codedIS.readTag();<NEW_LINE>int tag = WireFormat.getTagFieldNumber(t);<NEW_LINE>switch(tag) {<NEW_LINE>case 0:<NEW_LINE>return thisTree;<NEW_LINE>case RouteDataBox.LEFT_FIELD_NUMBER:<NEW_LINE>int i = codedIS.readSInt32();<NEW_LINE>if (readCoordinates) {<NEW_LINE>thisTree.left = i + (parentTree != null ? parentTree.left : 0);<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>case RouteDataBox.RIGHT_FIELD_NUMBER:<NEW_LINE>i = codedIS.readSInt32();<NEW_LINE>if (readCoordinates) {<NEW_LINE>thisTree.right = i + (parentTree != null ? parentTree.right : 0);<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>case RouteDataBox.TOP_FIELD_NUMBER:<NEW_LINE>i = codedIS.readSInt32();<NEW_LINE>if (readCoordinates) {<NEW_LINE>thisTree.top = i + (parentTree != null ? parentTree.top : 0);<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>case RouteDataBox.BOTTOM_FIELD_NUMBER:<NEW_LINE>i = codedIS.readSInt32();<NEW_LINE>if (readCoordinates) {<NEW_LINE>thisTree.bottom = i + (parentTree != null ? parentTree.bottom : 0);<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>case RouteDataBox.SHIFTTODATA_FIELD_NUMBER:<NEW_LINE>thisTree.shiftToData = readInt();<NEW_LINE>if (!readChildren) {<NEW_LINE>// usually 0<NEW_LINE>thisTree.subregions = new ArrayList<BinaryMapRouteReaderAdapter.RouteSubregion>();<NEW_LINE>readChildren = true;<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>case RouteDataBox.BOXES_FIELD_NUMBER:<NEW_LINE>if (readChildren) {<NEW_LINE>RouteSubregion subregion = new RouteSubregion(thisTree.routeReg);<NEW_LINE>subregion.length = readInt();<NEW_LINE>subregion.filePointer = codedIS.getTotalBytesRead();<NEW_LINE>int oldLimit = codedIS.pushLimit(subregion.length);<NEW_LINE>readRouteTree(subregion, thisTree, depth - 1, true);<NEW_LINE><MASK><NEW_LINE>codedIS.popLimit(oldLimit);<NEW_LINE>codedIS.seek(subregion.filePointer + subregion.length);<NEW_LINE>} else {<NEW_LINE>codedIS.seek(thisTree.filePointer + thisTree.length);<NEW_LINE>// skipUnknownField(t);<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>skipUnknownField(t);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
thisTree.subregions.add(subregion);
36,755
// testargumentContainsExceptionInTwoCallbackClasses<NEW_LINE>public void testargumentContainsExceptionInTwoCallbackClasses(String BASE_URL, StringBuilder sb) throws Exception {<NEW_LINE>Client client = ClientBuilder.newClient();<NEW_LINE>invokeClear(client, BASE_URL);<NEW_LINE>invokeReset(client, BASE_URL);<NEW_LINE>Future<Response> suspend2 = client.target(BASE_URL + "rest/resource/suspend").request().async().get();<NEW_LINE>Future<Response> register2 = client.target(BASE_URL + "rest/resource/registerclasses?stage=0").request().async().get();<NEW_LINE>sb.append(compareResult(register2, FALSE));<NEW_LINE>Future<Response> exception2 = client.target(BASE_URL + "rest/resource/resumechecked?stage=1").request().async().get();<NEW_LINE>Response response3 = exception2.get();<NEW_LINE>Response suspendResponse3 = suspend2.get();<NEW_LINE>sb.append(intequalCompare(suspendResponse3.getStatusInfo().getStatusCode(), Response.Status.INTERNAL_SERVER_ERROR.getStatusCode(), true));<NEW_LINE>// assertEquals(suspendResponse3.getStatusInfo().getStatusCode(), Response.Status.INTERNAL_SERVER_ERROR.getStatusCode());<NEW_LINE>suspendResponse3.close();<NEW_LINE>Future<Response> error3 = client.target(BASE_URL + "rest/resource/error").request()<MASK><NEW_LINE>sb.append(compareResult(error3, RuntimeException.class.getName()));<NEW_LINE>error3 = client.target(BASE_URL + "rest/resource/seconderror").request().async().get();<NEW_LINE>sb.append(compareResult(error3, RuntimeException.class.getName()));<NEW_LINE>System.out.println("from testargumentContainsExceptionInTwoCallbackClasses: " + sb);<NEW_LINE>// return sb.toString();<NEW_LINE>}
.async().get();
1,171,992
public PermissionCalculator build(QueryOptions queryOptions, CacheMetadata metadata) {<NEW_LINE>List<PermissionProcessor> processors = new ArrayList<>(8);<NEW_LINE>processors.add(new DirectProcessor());<NEW_LINE>if (this.plugin.getConfiguration().get(ConfigKeys.APPLY_BUKKIT_CHILD_PERMISSIONS)) {<NEW_LINE>processors.add(new ChildProcessor(this.plugin));<NEW_LINE>}<NEW_LINE>if (this.plugin.getConfiguration().get(ConfigKeys.APPLYING_REGEX)) {<NEW_LINE>processors.add(new RegexProcessor());<NEW_LINE>}<NEW_LINE>if (this.plugin.getConfiguration().get(ConfigKeys.APPLYING_WILDCARDS)) {<NEW_LINE>processors.add(new WildcardProcessor());<NEW_LINE>}<NEW_LINE>if (this.plugin.getConfiguration().get(ConfigKeys.APPLYING_WILDCARDS_SPONGE)) {<NEW_LINE>processors.add(new SpongeWildcardProcessor());<NEW_LINE>}<NEW_LINE>boolean op = queryOptions.option(BukkitContextManager.OP_OPTION).orElse(false);<NEW_LINE>if (metadata.getHolderType() == HolderType.USER && this.plugin.getConfiguration().get(ConfigKeys.APPLY_BUKKIT_DEFAULT_PERMISSIONS)) {<NEW_LINE>boolean overrideWildcards = this.plugin.getConfiguration().get(ConfigKeys.APPLY_DEFAULT_NEGATIONS_BEFORE_WILDCARDS);<NEW_LINE>processors.add(new DefaultPermissionMapProcessor(this.plugin, op));<NEW_LINE>processors.add(new PermissionMapProcessor(this.plugin, overrideWildcards, op));<NEW_LINE>}<NEW_LINE>if (op) {<NEW_LINE>processors.add(OpProcessor.INSTANCE);<NEW_LINE>}<NEW_LINE>return new PermissionCalculator(<MASK><NEW_LINE>}
this.plugin, metadata, processors);
510,140
protected void parseData(Node data) {<NEW_LINE>try {<NEW_LINE>NodeList list = ((Element) data).getElementsByTagName(s_policyMapDetails);<NEW_LINE>if (list.getLength() > 0) {<NEW_LINE>NodeList readOnlyList = ((Element) list.item(0)).getElementsByTagName("__readonly__");<NEW_LINE>Element readOnly = (Element) readOnlyList.item(0);<NEW_LINE>for (Node node = readOnly.getFirstChild(); node != null; node = node.getNextSibling()) {<NEW_LINE>String currentNode = node.getNodeName();<NEW_LINE>String value = node.getTextContent();<NEW_LINE>if ("pmap-name-out".equalsIgnoreCase(currentNode)) {<NEW_LINE>_policyMap.policyMapName = value;<NEW_LINE>} else if ("cir".equalsIgnoreCase(currentNode)) {<NEW_LINE>_policyMap.committedRate = Integer.parseInt(value.trim());<NEW_LINE>} else if ("bc".equalsIgnoreCase(currentNode)) {<NEW_LINE>_policyMap.burstRate = Integer.<MASK><NEW_LINE>} else if ("pir".equalsIgnoreCase(currentNode)) {<NEW_LINE>_policyMap.peakRate = Integer.parseInt(value.trim());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (DOMException e) {<NEW_LINE>s_logger.error("Error parsing the response : " + e.toString());<NEW_LINE>}<NEW_LINE>}
parseInt(value.trim());
1,162,092
public boolean apply(Game game, Ability source) {<NEW_LINE>Player controller = game.getPlayer(source.getControllerId());<NEW_LINE>if (controller == null) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>int countersRemoved = 0;<NEW_LINE>for (Cost cost : source.getCosts()) {<NEW_LINE>if (cost instanceof RemoveAllCountersSourceCost) {<NEW_LINE>countersRemoved = ((RemoveAllCountersSourceCost) cost).getRemovedCounters();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>Cards cards = new CardsImpl(controller.getLibrary().getTopCards(game, countersRemoved));<NEW_LINE>controller.lookAtCards(source, null, cards, game);<NEW_LINE>TargetCard target = new TargetCard(Zone.LIBRARY, new FilterCard("card to put into your hand"));<NEW_LINE>if (controller.choose(Outcome.DrawCard, cards, target, game)) {<NEW_LINE>Cards targetCards = new CardsImpl(target.getTargets());<NEW_LINE>controller.moveCards(targetCards, Zone.HAND, source, game);<NEW_LINE>cards.removeAll(targetCards);<NEW_LINE>}<NEW_LINE>controller.putCardsOnBottomOfLibrary(<MASK><NEW_LINE>return true;<NEW_LINE>}
cards, game, source, true);
1,164,896
public List<SignalStorageRecord> readStorageRecords(StorageKey storageKey, List<StorageId> storageKeys) throws IOException, InvalidKeyException {<NEW_LINE>if (storageKeys.isEmpty()) {<NEW_LINE>return Collections.emptyList();<NEW_LINE>}<NEW_LINE>List<SignalStorageRecord> result = new ArrayList<>();<NEW_LINE>Map<ByteString, Integer> typeMap = new HashMap<>();<NEW_LINE>List<ReadOperation> readOperations = new LinkedList<>();<NEW_LINE>ReadOperation.Builder currentOperation = ReadOperation.newBuilder();<NEW_LINE>for (StorageId key : storageKeys) {<NEW_LINE>typeMap.put(ByteString.copyFrom(key.getRaw()), key.getType());<NEW_LINE>if (currentOperation.getReadKeyCount() >= STORAGE_READ_MAX_ITEMS) {<NEW_LINE>Log.i(TAG, "Going over max read items. Starting a new read operation.");<NEW_LINE>readOperations.add(currentOperation.build());<NEW_LINE>currentOperation = ReadOperation.newBuilder();<NEW_LINE>}<NEW_LINE>if (StorageId.isKnownType(key.getType())) {<NEW_LINE>currentOperation.addReadKey(ByteString.copyFrom(key.getRaw()));<NEW_LINE>} else {<NEW_LINE>result.add(SignalStorageRecord.forUnknown(key));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (currentOperation.getReadKeyCount() > 0) {<NEW_LINE>readOperations.add(currentOperation.build());<NEW_LINE>}<NEW_LINE>Log.i(TAG, "Reading " + storageKeys.size() + " items split over " + readOperations.size() + " page(s).");<NEW_LINE>String authToken = this.pushServiceSocket.getStorageAuth();<NEW_LINE>for (ReadOperation readOperation : readOperations) {<NEW_LINE>StorageItems items = this.pushServiceSocket.readStorageItems(authToken, readOperation);<NEW_LINE>for (StorageItem item : items.getItemsList()) {<NEW_LINE>Integer type = typeMap.get(item.getKey());<NEW_LINE>if (type != null) {<NEW_LINE>result.add(SignalStorageModels.remoteToLocalStorageRecord<MASK><NEW_LINE>} else {<NEW_LINE>Log.w(TAG, "No type found! Skipping.");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>}
(item, type, storageKey));
146,413
private Future<ZooKeeperAdmin> connect(ZKClientConfig clientConfig) {<NEW_LINE>Promise<ZooKeeperAdmin> connected = Promise.promise();<NEW_LINE>try {<NEW_LINE>ZooKeeperAdmin zkAdmin = zooAdminProvider.createZookeeperAdmin(this.zookeeperConnectionString, zkAdminSessionTimeoutMs, watchedEvent -> LOGGER.debugCr(reconciliation, "Received event {} from ZooKeeperAdmin client connected to {}", watchedEvent, zookeeperConnectionString), clientConfig);<NEW_LINE>Util.waitFor(reconciliation, vertx, String.format("ZooKeeperAdmin connection to %s", zookeeperConnectionString), "connected", 1_000, operationTimeoutMs, () -> zkAdmin.getState().isAlive() && zkAdmin.getState().isConnected()).onSuccess(nothing -> connected.complete(zkAdmin)).onFailure(cause -> {<NEW_LINE>String message = String.format("Failed to connect to Zookeeper %s. Connection was not ready in %d ms.", zookeeperConnectionString, operationTimeoutMs);<NEW_LINE>LOGGER.warnCr(reconciliation, message);<NEW_LINE>closeConnection(zkAdmin).onComplete(nothing -> connected.fail(new <MASK><NEW_LINE>});<NEW_LINE>} catch (IOException e) {<NEW_LINE>LOGGER.warnCr(reconciliation, "Failed to connect to {} to scale Zookeeper", zookeeperConnectionString, e);<NEW_LINE>connected.fail(new ZookeeperScalingException("Failed to connect to Zookeeper " + zookeeperConnectionString, e));<NEW_LINE>}<NEW_LINE>return connected.future();<NEW_LINE>}
ZookeeperScalingException(message, cause)));
1,512,121
public void marshall(LambdaFunctionRecommendation lambdaFunctionRecommendation, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (lambdaFunctionRecommendation == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(lambdaFunctionRecommendation.getFunctionArn(), FUNCTIONARN_BINDING);<NEW_LINE>protocolMarshaller.marshall(lambdaFunctionRecommendation.getFunctionVersion(), FUNCTIONVERSION_BINDING);<NEW_LINE>protocolMarshaller.marshall(lambdaFunctionRecommendation.getAccountId(), ACCOUNTID_BINDING);<NEW_LINE>protocolMarshaller.marshall(lambdaFunctionRecommendation.getCurrentMemorySize(), CURRENTMEMORYSIZE_BINDING);<NEW_LINE>protocolMarshaller.marshall(lambdaFunctionRecommendation.getNumberOfInvocations(), NUMBEROFINVOCATIONS_BINDING);<NEW_LINE>protocolMarshaller.marshall(lambdaFunctionRecommendation.getUtilizationMetrics(), UTILIZATIONMETRICS_BINDING);<NEW_LINE>protocolMarshaller.marshall(lambdaFunctionRecommendation.getLookbackPeriodInDays(), LOOKBACKPERIODINDAYS_BINDING);<NEW_LINE>protocolMarshaller.marshall(lambdaFunctionRecommendation.getLastRefreshTimestamp(), LASTREFRESHTIMESTAMP_BINDING);<NEW_LINE>protocolMarshaller.marshall(lambdaFunctionRecommendation.getFinding(), FINDING_BINDING);<NEW_LINE>protocolMarshaller.marshall(lambdaFunctionRecommendation.getFindingReasonCodes(), FINDINGREASONCODES_BINDING);<NEW_LINE>protocolMarshaller.marshall(<MASK><NEW_LINE>protocolMarshaller.marshall(lambdaFunctionRecommendation.getCurrentPerformanceRisk(), CURRENTPERFORMANCERISK_BINDING);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>}
lambdaFunctionRecommendation.getMemorySizeRecommendationOptions(), MEMORYSIZERECOMMENDATIONOPTIONS_BINDING);
862,387
public <ReturnType> ReturnType execute(final boolean requestedRO, final EntitySqlDaoTransactionWrapper<ReturnType> entitySqlDaoTransactionWrapper) {<NEW_LINE>final String debugInfo = logger.isDebugEnabled() ? getDebugInfo() : null;<NEW_LINE>final Handle handle = dbRouter.getHandle(requestedRO);<NEW_LINE><MASK><NEW_LINE>try {<NEW_LINE>final EntitySqlDao<EntityModelDao<Entity>, Entity> entitySqlDao = handle.attach(InitialEntitySqlDao.class);<NEW_LINE>// The transaction isolation level is now set at the pool level: this avoids 3 roundtrips for each transaction<NEW_LINE>// Note that if the pool isn't used (tests or PostgreSQL), the transaction level will depend on the DB configuration<NEW_LINE>// return entitySqlDao.inTransaction(TransactionIsolationLevel.READ_COMMITTED, new JdbiTransaction<ReturnType, EntityModelDao<Entity>, Entity>(handle, entitySqlDaoTransactionWrapper));<NEW_LINE>logger.debug("Starting transaction {}", debugInfo);<NEW_LINE>final ReturnType returnType = entitySqlDao.inTransaction(new JdbiTransaction<ReturnType, EntityModelDao<Entity>, Entity>(handle, entitySqlDaoTransactionWrapper));<NEW_LINE>logger.debug("Exiting transaction {}, returning {}", debugInfo, returnType);<NEW_LINE>return returnType;<NEW_LINE>} finally {<NEW_LINE>handle.close();<NEW_LINE>logger.debug("DBI handle closed, transaction: {}", debugInfo);<NEW_LINE>}<NEW_LINE>}
logger.debug("DBI handle created, transaction: {}", debugInfo);
420,296
protected void exportRectangle(JRPrintElement rectangle, JRPen pen, int radius) {<NEW_LINE>slideHelper.write("<p:sp>\n");<NEW_LINE>slideHelper.write(" <p:nvSpPr>\n");<NEW_LINE>slideHelper.write(" <p:cNvPr id=\"" + toOOXMLId(rectangle) + "\" name=\"Rectangle\"/>\n");<NEW_LINE>slideHelper.write(" <p:cNvSpPr>\n");<NEW_LINE>slideHelper.write(" <a:spLocks noGrp=\"1\"/>\n");<NEW_LINE>slideHelper.write(" </p:cNvSpPr>\n");<NEW_LINE>slideHelper.write(" <p:nvPr/>\n");<NEW_LINE>slideHelper.write(" </p:nvSpPr>\n");<NEW_LINE>slideHelper.write(" <p:spPr>\n");<NEW_LINE>slideHelper.write(" <a:xfrm>\n");<NEW_LINE>slideHelper.write(" <a:off x=\"" + LengthUtil.emu(rectangle.getX() + getOffsetX()) + "\" y=\"" + LengthUtil.emu(rectangle.getY() <MASK><NEW_LINE>slideHelper.write(" <a:ext cx=\"" + LengthUtil.emu(rectangle.getWidth()) + "\" cy=\"" + LengthUtil.emu(rectangle.getHeight()) + "\"/>\n");<NEW_LINE>slideHelper.write(" </a:xfrm><a:prstGeom prst=\"" + (radius == 0 ? "rect" : "roundRect") + "\">");<NEW_LINE>if (radius > 0) {<NEW_LINE>// a rounded rectangle radius cannot exceed 1/2 of its lower side;<NEW_LINE>int size = Math.min(50000, (radius * 100000) / Math.min(rectangle.getHeight(), rectangle.getWidth()));<NEW_LINE>slideHelper.write("<a:avLst><a:gd name=\"adj\" fmla=\"val " + size + "\"/></a:avLst></a:prstGeom>\n");<NEW_LINE>} else {<NEW_LINE>slideHelper.write("<a:avLst/></a:prstGeom>\n");<NEW_LINE>}<NEW_LINE>if (rectangle.getModeValue() == ModeEnum.OPAQUE && rectangle.getBackcolor() != null) {<NEW_LINE>slideHelper.write("<a:solidFill><a:srgbClr val=\"" + JRColorUtil.getColorHexa(rectangle.getBackcolor()) + "\"/></a:solidFill>\n");<NEW_LINE>}<NEW_LINE>exportPen(pen);<NEW_LINE>slideHelper.write(" </p:spPr>\n");<NEW_LINE>slideHelper.write(" <p:txBody>\n");<NEW_LINE>slideHelper.write(" <a:bodyPr rtlCol=\"0\" anchor=\"ctr\"/>\n");<NEW_LINE>slideHelper.write(" <a:lstStyle/>\n");<NEW_LINE>slideHelper.write(" <a:p>\n");<NEW_LINE>slideHelper.write("<a:pPr algn=\"ctr\"/>\n");<NEW_LINE>slideHelper.write(" </a:p>\n");<NEW_LINE>slideHelper.write(" </p:txBody>\n");<NEW_LINE>slideHelper.write("</p:sp>\n");<NEW_LINE>}
+ getOffsetY()) + "\"/>\n");
1,236,708
public void onViewCreated(@NonNull View view, Bundle savedInstanceState) {<NEW_LINE>FloatingActionButton fab = view.findViewById(R.id.fab);<NEW_LINE>fab.setOnClickListener(v -> startImportIconPack());<NEW_LINE>_fabScrollHelper = new FabScrollHelper(fab);<NEW_LINE>_noIconPacksView = view.findViewById(R.id.vEmptyList);<NEW_LINE>((TextView) view.findViewById(R.id.txt_no_icon_packs)).setMovementMethod(LinkMovementMethod.getInstance());<NEW_LINE>_iconPacksView = view.findViewById(R.id.view_icon_packs);<NEW_LINE>_adapter = new IconPackAdapter(this);<NEW_LINE>_iconPacksRecyclerView = view.findViewById(R.id.list_icon_packs);<NEW_LINE>LinearLayoutManager layoutManager <MASK><NEW_LINE>_iconPacksRecyclerView.setLayoutManager(layoutManager);<NEW_LINE>_iconPacksRecyclerView.setAdapter(_adapter);<NEW_LINE>_iconPacksRecyclerView.setNestedScrollingEnabled(false);<NEW_LINE>_iconPacksRecyclerView.addOnScrollListener(new RecyclerView.OnScrollListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onScrolled(@NonNull RecyclerView recyclerView, int dx, int dy) {<NEW_LINE>super.onScrolled(recyclerView, dx, dy);<NEW_LINE>_fabScrollHelper.onScroll(dx, dy);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>for (IconPack pack : _iconPackManager.getIconPacks()) {<NEW_LINE>_adapter.addIconPack(pack);<NEW_LINE>}<NEW_LINE>updateEmptyState();<NEW_LINE>}
= new LinearLayoutManager(getContext());
1,602,606
private void recipesVanilla(@Nonnull Consumer<FinishedRecipe> out) {<NEW_LINE>FluidAwareShapedRecipeBuilder.builder(Items.TORCH, 12).pattern("wc ").pattern("sss").define('w', ItemTags.WOOL).define('c', new IngredientFluidStack(IETags.fluidCreosote, FluidAttributes.BUCKET_VOLUME)).define('s', Tags.Items.RODS_WOODEN).unlockedBy("has_wool", has(ItemTags.WOOL)).unlockedBy("has_stick", has(Tags.Items.RODS_WOODEN)).unlockedBy("has_creosote", has(IEContent.fluidCreosote.getBucket())).save(out, toRL(toPath(Items.TORCH)));<NEW_LINE>ShapelessRecipeBuilder.shapeless(Items.STRING).requires(Ingredient.of(IETags.fiberHemp), 3).unlockedBy("has_hemp_fiber", has(Ingredients.hempFiber)).save(out, toRL(toPath(Items.STRING)));<NEW_LINE>ShapelessRecipeBuilder.shapeless(Items.GUNPOWDER, 6).requires(Ingredient.of(IETags.saltpeterDust), 4).requires(IETags.sulfurDust).requires(Items.CHARCOAL).unlockedBy("has_sulfur", has(IETags.sulfurDust)).save(out, toRL("gunpowder_from_dusts"));<NEW_LINE>FluidAwareShapelessRecipeBuilder.builder(Items.PAPER, 2).requires(Ingredient.of(IETags.sawdust), 4).requires(new IngredientFluidStack(FluidTags.WATER, FluidAttributes.BUCKET_VOLUME)).unlockedBy("has_sawdust", has(IETags.sawdust)).save<MASK><NEW_LINE>}
(out, toRL("paper_from_sawdust"));
1,292,560
private TrackerResponse tryForAllTrackers(Function<Tracker, TrackerResponse> func) {<NEW_LINE>List<TrackerResponse> responses = new ArrayList<>();<NEW_LINE>for (List<Tracker> trackerTier : trackerTiers) {<NEW_LINE>TrackerResponse response;<NEW_LINE>Tracker currentTracker;<NEW_LINE>for (int i = 0; i < trackerTier.size(); i++) {<NEW_LINE>currentTracker = trackerTier.get(i);<NEW_LINE>response = func.apply(currentTracker);<NEW_LINE>responses.add(response);<NEW_LINE>if (response.isSuccess()) {<NEW_LINE>if (trackerTier.size() > 1 && i != 0) {<NEW_LINE>trackerTier.remove(i);<NEW_LINE>trackerTier.add(0, currentTracker);<NEW_LINE>}<NEW_LINE>return response;<NEW_LINE>} else if (response.getError().isPresent()) {<NEW_LINE>Throwable e = response<MASK><NEW_LINE>LOGGER.warn("Unexpected error during interaction with the tracker: " + currentTracker, e);<NEW_LINE>} else {<NEW_LINE>LOGGER.warn("Unexpected error during interaction with the tracker: " + currentTracker + "; message: " + response.getErrorMessage());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>throw new BtException("All trackers failed; responses (in chrono order): " + responses);<NEW_LINE>}
.getError().get();
1,188,598
private boolean testCase(String test, int count) {<NEW_LINE>boolean wasOk = false;<NEW_LINE>try {<NEW_LINE>Slime input = SlimeUtils.jsonToSlime(test);<NEW_LINE>Slime result = new Slime();<NEW_LINE>var top = result.setObject();<NEW_LINE>SlimeUtils.copyObject(input.get(), top);<NEW_LINE>var num_tests = input.<MASK><NEW_LINE>if (input.get().field("num_tests").valid()) {<NEW_LINE>long expect = input.get().field("num_tests").asLong();<NEW_LINE>wasOk = (expect == count);<NEW_LINE>} else if (input.get().field("expression").valid()) {<NEW_LINE>String expression = input.get().field("expression").asString();<NEW_LINE>MapContext context = getInput(input.get().field("inputs"));<NEW_LINE>Tensor actual = evaluate(expression, context);<NEW_LINE>top.field("result").setData("vespajlib", TypedBinaryFormat.encode(actual));<NEW_LINE>wasOk = true;<NEW_LINE>} else {<NEW_LINE>System.err.println(count + " : Invalid input >>>" + test + "<<<");<NEW_LINE>wasOk = false;<NEW_LINE>}<NEW_LINE>output(result);<NEW_LINE>} catch (Exception e) {<NEW_LINE>System.err.println(count + " : " + e.toString());<NEW_LINE>wasOk = false;<NEW_LINE>}<NEW_LINE>return wasOk;<NEW_LINE>}
get().field("num_tests");
1,229,391
@SubmarineApi<NEW_LINE>public Response list(@QueryParam("dictCode") String dictCode, @QueryParam("itemText") String itemText, @QueryParam("itemValue") String itemValue, @QueryParam("column") String column, @QueryParam("field") String field, @QueryParam("order") String order, @QueryParam("pageNo") int pageNo, @QueryParam("pageSize") int pageSize) {<NEW_LINE>LOG.info("queryList dictId:{}, itemText:{}, itemValue:{}, pageNo:{}, pageSize:{}", dictCode, itemText, itemValue, pageNo, pageSize);<NEW_LINE>List<SysDictItemEntity> list = null;<NEW_LINE>SqlSession sqlSession = MyBatisUtil.getSqlSession();<NEW_LINE>SysDictItemMapper sysDictItemMapper = sqlSession.getMapper(SysDictItemMapper.class);<NEW_LINE>try {<NEW_LINE>Map<String, Object> where = new HashMap<>();<NEW_LINE>where.put("dictCode", dictCode);<NEW_LINE>where.put("itemText", itemText);<NEW_LINE>where.put("itemValue", itemValue);<NEW_LINE>list = sysDictItemMapper.selectAll(where, new RowBounds(pageNo, pageSize));<NEW_LINE>} catch (Exception e) {<NEW_LINE>LOG.error(e.getMessage(), e);<NEW_LINE>return new JsonResponse.Builder<>(Response.Status.OK).success(false).build();<NEW_LINE>} finally {<NEW_LINE>sqlSession.close();<NEW_LINE>}<NEW_LINE>PageInfo<SysDictItemEntity> page = new PageInfo<>(list);<NEW_LINE>ListResult<SysDictItemEntity> listResult = new ListResult(list, page.getTotal());<NEW_LINE>return new JsonResponse.Builder<ListResult>(Response.Status.OK).success(true).<MASK><NEW_LINE>}
result(listResult).build();
800,117
private Result seekMatchInAlternativePaths(ParserRuleContext currentCtx, int lookahead, int currentDepth, int matchingRulesCount, boolean isEntryPoint) {<NEW_LINE>ParserRuleContext[] alternativeRules;<NEW_LINE>switch(currentCtx) {<NEW_LINE>case XML_CONTENT:<NEW_LINE>alternativeRules = XML_CONTENT;<NEW_LINE>break;<NEW_LINE>case XML_ATTRIBUTES:<NEW_LINE>alternativeRules = XML_ATTRIBUTES;<NEW_LINE>break;<NEW_LINE>case XML_START_OR_EMPTY_TAG_END:<NEW_LINE>alternativeRules = XML_START_OR_EMPTY_TAG_END;<NEW_LINE>break;<NEW_LINE>case XML_ATTRIBUTE_VALUE_ITEM:<NEW_LINE>alternativeRules = XML_ATTRIBUTE_VALUE_ITEM;<NEW_LINE>break;<NEW_LINE>case XML_PI_TARGET_RHS:<NEW_LINE>alternativeRules = XML_PI_TARGET_RHS;<NEW_LINE>break;<NEW_LINE>case XML_OPTIONAL_CDATA_CONTENT:<NEW_LINE>alternativeRules = XML_OPTIONAL_CDATA_CONTENT;<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>return seekInAlternativesPaths(lookahead, currentDepth, matchingRulesCount, alternativeRules, isEntryPoint);<NEW_LINE>}
throw new IllegalStateException("seekMatchInExprRelatedAlternativePaths found: " + currentCtx);
820,487
private static List<ClassInfo> listOfficial() throws Exception {<NEW_LINE>try (ScanResult scanResult = new ClassGraph().addClassLoader(ClassLoaderTools.urlClassLoader(true, false, true, false, false)).enableAnnotationInfo().scan()) {<NEW_LINE>List<ClassInfo> list = new ArrayList<>();<NEW_LINE>List<ClassInfo> classInfos = scanResult.getClassesWithAnnotation(Module.class.getName());<NEW_LINE>for (ClassInfo info : classInfos) {<NEW_LINE>Class<?> clz = Class.forName(info.getName());<NEW_LINE>Module module = clz.getAnnotation(Module.class);<NEW_LINE>if (Objects.equals(module.type(), ModuleType.ASSEMBLE) || Objects.equals(module.type(), ModuleType.SERVICE)) {<NEW_LINE>list.add(info);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>List<String> filters = new ArrayList<>();<NEW_LINE>for (ClassInfo info : list) {<NEW_LINE>Class<?> clz = Class.forName(info.getName());<NEW_LINE>Module module = clz.getAnnotation(Module.class);<NEW_LINE>if (Objects.equals(ModuleCategory.OFFICIAL, module.category())) {<NEW_LINE>filters.add(info.getName());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>filters = StringTools.includesExcludesWithWildcard(filters, Config.currentNode().getApplication().getIncludes(), Config.currentNode().<MASK><NEW_LINE>List<ClassInfo> os = new ArrayList<>();<NEW_LINE>for (ClassInfo info : list) {<NEW_LINE>if (filters.contains(info.getName())) {<NEW_LINE>os.add(info);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>os = os.stream().sorted(Comparator.comparing(ClassInfo::getName, (x, y) -> {<NEW_LINE>int indx = OFFICIAL_MODULE_SORTED_TEMPLATE.indexOf(x);<NEW_LINE>int indy = OFFICIAL_MODULE_SORTED_TEMPLATE.indexOf(y);<NEW_LINE>if (indx == indy) {<NEW_LINE>return 0;<NEW_LINE>} else if (indx == -1) {<NEW_LINE>return 1;<NEW_LINE>} else if (indy == -1) {<NEW_LINE>return -1;<NEW_LINE>} else {<NEW_LINE>return indx - indy;<NEW_LINE>}<NEW_LINE>})).collect(Collectors.toList());<NEW_LINE>return os;<NEW_LINE>}<NEW_LINE>}
getApplication().getExcludes());
866,311
public void run() {<NEW_LINE>try {<NEW_LINE>if (isCanceled()) {<NEW_LINE>// NOI18N<NEW_LINE>showDiffError(NbBundle.getMessage(DiffResultsView.class, "MSG_DiffPanel_NoRevisions"));<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final DiffController view = DiffController.createEnhanced(leftSource, rightSource);<NEW_LINE>int leftMaxLineNumber = getLastLineIndex(leftSource);<NEW_LINE>int rightMaxLineNumber = getLastLineIndex(rightSource);<NEW_LINE>if (currentTask == ShowDiffTask.this) {<NEW_LINE>currentDiff = view;<NEW_LINE>setBottomComponent(currentDiff.getJComponent());<NEW_LINE>if (leftMaxLineNumber != -1) {<NEW_LINE>setLocation(Math.min<MASK><NEW_LINE>}<NEW_LINE>if (rightMaxLineNumber != -1) {<NEW_LINE>setLocation(Math.min(rightMaxLineNumber, lineNumber), true);<NEW_LINE>}<NEW_LINE>parent.refreshComponents(false);<NEW_LINE>}<NEW_LINE>} catch (IOException e) {<NEW_LINE>Subversion.LOG.log(Level.INFO, null, e);<NEW_LINE>}<NEW_LINE>}
(leftMaxLineNumber, lineNumber), false);
377,028
public static String scramble323(String pass, String seed) {<NEW_LINE>if ((pass == null) || (pass.length() == 0)) {<NEW_LINE>return pass;<NEW_LINE>}<NEW_LINE>byte b;<NEW_LINE>double d;<NEW_LINE>long[] pw = hash(seed);<NEW_LINE>long[] msg = hash(pass);<NEW_LINE>long max = 0x3fffffffL;<NEW_LINE>long seed1 = (pw[0] ^ msg[0]) % max;<NEW_LINE>long seed2 = (pw[1] ^ msg[1]) % max;<NEW_LINE>char[] chars = new char[seed.length()];<NEW_LINE>for (int i = 0; i < seed.length(); i++) {<NEW_LINE>seed1 = ((seed1 * 3) + seed2) % max;<NEW_LINE>seed2 = (seed1 + seed2 + 33) % max;<NEW_LINE>d = (double) seed1 / (double) max;<NEW_LINE>b = (byte) java.lang.Math.floor((d * 31) + 64);<NEW_LINE>chars[i] = (char) b;<NEW_LINE>}<NEW_LINE>seed1 = ((seed1 <MASK><NEW_LINE>seed2 = (seed1 + seed2 + 33) % max;<NEW_LINE>d = (double) seed1 / (double) max;<NEW_LINE>b = (byte) java.lang.Math.floor(d * 31);<NEW_LINE>for (int i = 0; i < seed.length(); i++) {<NEW_LINE>chars[i] ^= (char) b;<NEW_LINE>}<NEW_LINE>return new String(chars);<NEW_LINE>}
* 3) + seed2) % max;
584,218
public com.amazonaws.services.comprehend.model.UnsupportedLanguageException unmarshallFromContext(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>com.amazonaws.services.comprehend.model.UnsupportedLanguageException unsupportedLanguageException = new com.amazonaws.services.comprehend.model.UnsupportedLanguageException(null);<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE><MASK><NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return unsupportedLanguageException;<NEW_LINE>}
String currentParentElement = context.getCurrentParentElement();
959,075
private void validateTransparent(ShieldedTransferContract shieldedTransferContract, long fee) throws ContractValidateException {<NEW_LINE>boolean hasTransparentFrom;<NEW_LINE>boolean hasTransparentTo;<NEW_LINE>byte[] toAddress = shieldedTransferContract.getTransparentToAddress().toByteArray();<NEW_LINE>byte[] ownerAddress = shieldedTransferContract.getTransparentFromAddress().toByteArray();<NEW_LINE>hasTransparentFrom = (ownerAddress.length > 0);<NEW_LINE>hasTransparentTo = (toAddress.length > 0);<NEW_LINE>AccountStore accountStore = chainBaseManager.getAccountStore();<NEW_LINE>long fromAmount = shieldedTransferContract.getFromAmount();<NEW_LINE>long toAmount = shieldedTransferContract.getToAmount();<NEW_LINE>if (fromAmount < 0) {<NEW_LINE>throw new ContractValidateException("from_amount should not be less than 0");<NEW_LINE>}<NEW_LINE>if (toAmount < 0) {<NEW_LINE>throw new ContractValidateException("to_amount should not be less than 0");<NEW_LINE>}<NEW_LINE>if (hasTransparentFrom && !DecodeUtil.addressValid(ownerAddress)) {<NEW_LINE>throw new ContractValidateException("Invalid transparent_from_address");<NEW_LINE>}<NEW_LINE>if (!hasTransparentFrom && fromAmount != 0) {<NEW_LINE>throw new ContractValidateException("no transparent_from_address, from_amount should be 0");<NEW_LINE>}<NEW_LINE>if (hasTransparentTo && !DecodeUtil.addressValid(toAddress)) {<NEW_LINE>throw new ContractValidateException("Invalid transparent_to_address");<NEW_LINE>}<NEW_LINE>if (!hasTransparentTo && toAmount != 0) {<NEW_LINE>throw new ContractValidateException("no transparent_to_address, to_amount should be 0");<NEW_LINE>}<NEW_LINE>if (hasTransparentFrom && hasTransparentTo && Arrays.equals(toAddress, ownerAddress)) {<NEW_LINE>throw new ContractValidateException("Can't transfer zen to yourself");<NEW_LINE>}<NEW_LINE>if (hasTransparentFrom) {<NEW_LINE>AccountCapsule ownerAccount = accountStore.get(ownerAddress);<NEW_LINE>if (ownerAccount == null) {<NEW_LINE>throw new ContractValidateException("Validate ShieldedTransferContract error, " + "no OwnerAccount");<NEW_LINE>}<NEW_LINE>long balance = getZenBalance(ownerAccount);<NEW_LINE>if (fromAmount <= 0) {<NEW_LINE>throw new ContractValidateException("from_amount must be greater than 0");<NEW_LINE>}<NEW_LINE>if (balance < fromAmount) {<NEW_LINE>throw new ContractValidateException("Validate ShieldedTransferContract error, balance is not sufficient");<NEW_LINE>}<NEW_LINE>if (fromAmount <= fee) {<NEW_LINE>throw new ContractValidateException("Validate ShieldedTransferContract error, fromAmount should be great than fee");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (hasTransparentTo) {<NEW_LINE>if (toAmount <= 0) {<NEW_LINE>throw new ContractValidateException("to_amount must be greater than 0");<NEW_LINE>}<NEW_LINE>AccountCapsule toAccount = accountStore.get(toAddress);<NEW_LINE>if (toAccount != null) {<NEW_LINE>try {<NEW_LINE>Math.addExact(getZenBalance(toAccount), toAmount);<NEW_LINE>} catch (ArithmeticException e) {<NEW_LINE>logger.debug(e.getMessage(), e);<NEW_LINE>throw new <MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
ContractValidateException(e.getMessage());
375,551
private void processSelectControl(ControlFontPair pair, Control ctrl, PDAcroForm acro, int i, Box root) throws IOException {<NEW_LINE>PDComboBox field = new PDComboBox(acro);<NEW_LINE>setPartialNameToField(ctrl, field);<NEW_LINE>List<String> labels = new ArrayList<>();<NEW_LINE>List<String> values = new ArrayList<>();<NEW_LINE>String selectedLabel = populateOptions(ctrl.box.getElement(), labels, values, null);<NEW_LINE>field.setOptions(values, labels);<NEW_LINE>field.setValue(selectedLabel);<NEW_LINE>field.setDefaultValue(selectedLabel);<NEW_LINE>FSColor color = ctrl.box<MASK><NEW_LINE>String colorOperator = getColorOperator(color);<NEW_LINE>String fontInstruction = "/" + pair.fontName + " 0 Tf";<NEW_LINE>field.setDefaultAppearance(fontInstruction + ' ' + colorOperator);<NEW_LINE>if (ctrl.box.getElement().hasAttribute("required")) {<NEW_LINE>field.setRequired(true);<NEW_LINE>}<NEW_LINE>if (ctrl.box.getElement().hasAttribute("readonly")) {<NEW_LINE>field.setReadOnly(true);<NEW_LINE>}<NEW_LINE>if (ctrl.box.getElement().hasAttribute("title")) {<NEW_LINE>field.setAlternateFieldName(ctrl.box.getElement().getAttribute("title"));<NEW_LINE>}<NEW_LINE>if (ctrl.box.getElement().getNodeName().equals("openhtmltopdf-combo")) {<NEW_LINE>field.setEdit(true);<NEW_LINE>field.setCombo(true);<NEW_LINE>}<NEW_LINE>PDAnnotationWidget widget = field.getWidgets().get(0);<NEW_LINE>Rectangle2D rect2D = PdfBoxFastLinkManager.createTargetArea(ctrl.c, ctrl.box, ctrl.pageHeight, ctrl.transform, root, od);<NEW_LINE>PDRectangle rect = new PDRectangle((float) rect2D.getMinX(), (float) rect2D.getMinY(), (float) rect2D.getWidth(), (float) rect2D.getHeight());<NEW_LINE>widget.setRectangle(rect);<NEW_LINE>widget.setPage(ctrl.page);<NEW_LINE>widget.setPrinted(true);<NEW_LINE>ctrl.page.getAnnotations().add(widget);<NEW_LINE>}
.getStyle().getColor();
1,558,140
public void startScaling(final SchemaVersionPreparedEvent event) {<NEW_LINE>String activeVersion = schemaVersionPersistService.getSchemaActiveVersion(event.getSchemaName()).get();<NEW_LINE>String sourceDataSource = repository.get(SchemaMetaDataNode.getMetaDataDataSourcePath(event.getSchemaName(), activeVersion));<NEW_LINE>String targetDataSource = repository.get(SchemaMetaDataNode.getMetaDataDataSourcePath(event.getSchemaName()<MASK><NEW_LINE>String sourceRule = repository.get(SchemaMetaDataNode.getRulePath(event.getSchemaName(), activeVersion));<NEW_LINE>String targetRule = repository.get(SchemaMetaDataNode.getRulePath(event.getSchemaName(), event.getVersion()));<NEW_LINE>log.info("start scaling job, locked the schema name, event={}", event);<NEW_LINE>StartScalingEvent startScalingEvent = new StartScalingEvent(event.getSchemaName(), sourceDataSource, sourceRule, targetDataSource, targetRule, Integer.parseInt(activeVersion), Integer.parseInt(event.getVersion()));<NEW_LINE>ShardingSphereEventBus.getInstance().post(startScalingEvent);<NEW_LINE>}
, event.getVersion()));
1,499,207
static String formatTime(long t) {<NEW_LINE>String str;<NEW_LINE>if (t < 1 * MINUTE) {<NEW_LINE>// NOI18N<NEW_LINE>String seconds = String.format("%.3f", t / (double) SECOND);<NEW_LINE>// NOI18N<NEW_LINE>str = Resources.getText("LBL_DurationSeconds", seconds);<NEW_LINE>} else {<NEW_LINE>long remaining = t;<NEW_LINE>long days = remaining / DAY;<NEW_LINE>remaining %= 1 * DAY;<NEW_LINE>long hours = remaining / HOUR;<NEW_LINE>remaining %= 1 * HOUR;<NEW_LINE>long minutes = remaining / MINUTE;<NEW_LINE>if (t >= 1 * DAY) {<NEW_LINE>// NOI18N<NEW_LINE>str = // NOI18N<NEW_LINE>Resources.// NOI18N<NEW_LINE>getText(<MASK><NEW_LINE>} else if (t >= 1 * HOUR) {<NEW_LINE>// NOI18N<NEW_LINE>str = // NOI18N<NEW_LINE>Resources.// NOI18N<NEW_LINE>getText("LBL_DurationHoursMinutes", hours, minutes);<NEW_LINE>} else {<NEW_LINE>// NOI18N<NEW_LINE>str = Resources.getText("LBL_DurationMinutes", minutes);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return str;<NEW_LINE>}
"LBL_DurationDaysHoursMinutes", days, hours, minutes);
1,639,414
public void saveParam(Object obj) throws Exception {<NEW_LINE>OptionsParam options = (OptionsParam) obj;<NEW_LINE>ScannerParam param = options.getParamSet(ScannerParam.class);<NEW_LINE>param.setHostPerScan(getSliderHostPerScan().getValue());<NEW_LINE>param.setThreadPerHost(getSliderThreadsPerHost().getValue());<NEW_LINE>param.setDelayInMs(getDelayInMs());<NEW_LINE>param.setMaxResultsToList(this.getSpinnerMaxResultsList().getValue());<NEW_LINE>param.setMaxRuleDurationInMins(this.getSpinnerMaxRuleDuration().getValue());<NEW_LINE>param.setMaxScanDurationInMins(this.getSpinnerMaxScanDuration().getValue());<NEW_LINE>param.setInjectPluginIdInHeader(getChkInjectPluginIdInHeader().isSelected());<NEW_LINE>param.setHandleAntiCSRFTokens(<MASK><NEW_LINE>param.setPromptInAttackMode(getChkPromptInAttackMode().isSelected());<NEW_LINE>param.setRescanInAttackMode(getChkRescanInAttackMode().isSelected());<NEW_LINE>param.setDefaultPolicy((String) this.getDefaultAscanPolicyPulldown().getSelectedItem());<NEW_LINE>param.setAttackPolicy((String) this.getDefaultAttackPolicyPulldown().getSelectedItem());<NEW_LINE>param.setAllowAttackOnStart(this.getAllowAttackModeOnStart().isSelected());<NEW_LINE>param.setMaxChartTimeInMins(this.getSpinnerMaxChartTime().getValue());<NEW_LINE>}
getChkHandleAntiCSRFTokens().isSelected());
752,389
public static EnableOrderResponse unmarshall(EnableOrderResponse enableOrderResponse, UnmarshallerContext _ctx) {<NEW_LINE>enableOrderResponse.setRequestId(_ctx.stringValue("EnableOrderResponse.RequestId"));<NEW_LINE>enableOrderResponse.setCode(_ctx.stringValue("EnableOrderResponse.Code"));<NEW_LINE>enableOrderResponse.setMessage(_ctx.stringValue("EnableOrderResponse.Message"));<NEW_LINE>enableOrderResponse.setSubCode(_ctx.stringValue("EnableOrderResponse.SubCode"));<NEW_LINE>enableOrderResponse.setSubMessage(_ctx.stringValue("EnableOrderResponse.SubMessage"));<NEW_LINE>enableOrderResponse.setLogsId(_ctx.stringValue("EnableOrderResponse.LogsId"));<NEW_LINE>enableOrderResponse.setSuccess(_ctx.booleanValue("EnableOrderResponse.Success"));<NEW_LINE>enableOrderResponse.setTotalCount(_ctx.longValue("EnableOrderResponse.TotalCount"));<NEW_LINE>Model model = new Model();<NEW_LINE>model.setRedirectUrl<MASK><NEW_LINE>List<String> orderIds = new ArrayList<String>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("EnableOrderResponse.Model.OrderIds.Length"); i++) {<NEW_LINE>orderIds.add(_ctx.stringValue("EnableOrderResponse.Model.OrderIds[" + i + "]"));<NEW_LINE>}<NEW_LINE>model.setOrderIds(orderIds);<NEW_LINE>List<String> payTradeIds = new ArrayList<String>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("EnableOrderResponse.Model.PayTradeIds.Length"); i++) {<NEW_LINE>payTradeIds.add(_ctx.stringValue("EnableOrderResponse.Model.PayTradeIds[" + i + "]"));<NEW_LINE>}<NEW_LINE>model.setPayTradeIds(payTradeIds);<NEW_LINE>List<LmOrderListItem> lmOrderList = new ArrayList<LmOrderListItem>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("EnableOrderResponse.Model.LmOrderList.Length"); i++) {<NEW_LINE>LmOrderListItem lmOrderListItem = new LmOrderListItem();<NEW_LINE>lmOrderListItem.setLmOrderId(_ctx.stringValue("EnableOrderResponse.Model.LmOrderList[" + i + "].LmOrderId"));<NEW_LINE>lmOrderList.add(lmOrderListItem);<NEW_LINE>}<NEW_LINE>model.setLmOrderList(lmOrderList);<NEW_LINE>enableOrderResponse.setModel(model);<NEW_LINE>return enableOrderResponse;<NEW_LINE>}
(_ctx.stringValue("EnableOrderResponse.Model.RedirectUrl"));
577,038
public JsonNode sendBeat(BeatInfo beatInfo, boolean lightBeatEnabled) throws NacosException {<NEW_LINE>if (NAMING_LOGGER.isDebugEnabled()) {<NEW_LINE>NAMING_LOGGER.debug("[BEAT] {} sending beat to server: {}", namespaceId, beatInfo.toString());<NEW_LINE>}<NEW_LINE>Map<String, String> params = new HashMap<String, String>(16);<NEW_LINE>Map<String, String> bodyMap = new HashMap<String, String>(2);<NEW_LINE>if (!lightBeatEnabled) {<NEW_LINE>bodyMap.put("beat", JacksonUtils.toJson(beatInfo));<NEW_LINE>}<NEW_LINE>params.put(CommonParams.NAMESPACE_ID, namespaceId);<NEW_LINE>params.put(CommonParams.SERVICE_NAME, beatInfo.getServiceName());<NEW_LINE>params.put(CommonParams.CLUSTER_NAME, beatInfo.getCluster());<NEW_LINE>params.put(IP_PARAM, beatInfo.getIp());<NEW_LINE>params.put(PORT_PARAM, String.valueOf(beatInfo.getPort()));<NEW_LINE>String result = reqApi(UtilAndComs.nacosUrlBase + "/instance/beat", <MASK><NEW_LINE>return JacksonUtils.toObj(result);<NEW_LINE>}
params, bodyMap, HttpMethod.PUT);
1,267,742
public List<Class<?>> findAnnotatedTypes(Class<?> annotation) {<NEW_LINE>final List<Class<?>> classes = new ArrayList<Class<?>>();<NEW_LINE>TypeReporter reporter = new ListReporter(classes);<NEW_LINE>final AnnotationDetector cf = new AnnotationDetector(reporter);<NEW_LINE>try {<NEW_LINE>ClassLoader loader = this.getClass().getClassLoader();<NEW_LINE>if (loader instanceof URLClassLoader) {<NEW_LINE>URLClassLoader urlClassLoader = (URLClassLoader) loader;<NEW_LINE>URL[] urls = urlClassLoader.getURLs();<NEW_LINE>List<File> files = new ArrayList<File>();<NEW_LINE>for (URL url : urls) {<NEW_LINE>if (url.getProtocol().equals("file")) {<NEW_LINE>files.add(JarUtil.urlToFile(url));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>cf.detect(files.toArray(new File[0]));<NEW_LINE>} else {<NEW_LINE>cf.detect();<NEW_LINE>}<NEW_LINE>} catch (IOException e) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>return classes;<NEW_LINE>}
throw new BugException("Unable to search class path", e);
1,455,675
public MetastoreOperationResult addPartitions(MetastoreContext metastoreContext, String databaseName, String tableName, List<PartitionWithStatistics> partitions) {<NEW_LINE>try {<NEW_LINE>List<Future<BatchCreatePartitionResult>> <MASK><NEW_LINE>for (List<PartitionWithStatistics> partitionBatch : Lists.partition(partitions, BATCH_CREATE_PARTITION_MAX_PAGE_SIZE)) {<NEW_LINE>List<PartitionInput> partitionInputs = mappedCopy(partitionBatch, GlueInputConverter::convertPartition);<NEW_LINE>futures.add(glueClient.batchCreatePartitionAsync(new BatchCreatePartitionRequest().withCatalogId(catalogId).withDatabaseName(databaseName).withTableName(tableName).withPartitionInputList(partitionInputs), stats.getBatchCreatePartitions().metricsAsyncHandler()));<NEW_LINE>}<NEW_LINE>for (Future<BatchCreatePartitionResult> future : futures) {<NEW_LINE>BatchCreatePartitionResult result = future.get();<NEW_LINE>propagatePartitionErrorToPrestoException(databaseName, tableName, result.getErrors());<NEW_LINE>}<NEW_LINE>return EMPTY_RESULT;<NEW_LINE>} catch (AmazonServiceException | InterruptedException | ExecutionException e) {<NEW_LINE>if (e instanceof InterruptedException) {<NEW_LINE>Thread.currentThread().interrupt();<NEW_LINE>}<NEW_LINE>throw new PrestoException(HIVE_METASTORE_ERROR, e);<NEW_LINE>}<NEW_LINE>}
futures = new ArrayList<>();
1,215,042
final DeleteDomainResult executeDeleteDomain(DeleteDomainRequest deleteDomainRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(deleteDomainRequest);<NEW_LINE><MASK><NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DeleteDomainRequest> request = null;<NEW_LINE>Response<DeleteDomainResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DeleteDomainRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(deleteDomainRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "codeartifact");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DeleteDomain");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DeleteDomainResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DeleteDomainResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();