idx
int32
46
1.86M
input
stringlengths
321
6.6k
target
stringlengths
9
1.24k
921,845
public static DescribeClientVersionResponse unmarshall(DescribeClientVersionResponse describeClientVersionResponse, UnmarshallerContext _ctx) {<NEW_LINE>describeClientVersionResponse.setRequestId(_ctx.stringValue("DescribeClientVersionResponse.RequestId"));<NEW_LINE>describeClientVersionResponse.setSuccess<MASK><NEW_LINE>describeClientVersionResponse.setCode(_ctx.stringValue("DescribeClientVersionResponse.Code"));<NEW_LINE>describeClientVersionResponse.setMessage(_ctx.stringValue("DescribeClientVersionResponse.Message"));<NEW_LINE>describeClientVersionResponse.setMinVersion(_ctx.stringValue("DescribeClientVersionResponse.MinVersion"));<NEW_LINE>describeClientVersionResponse.setMaxVersion(_ctx.stringValue("DescribeClientVersionResponse.MaxVersion"));<NEW_LINE>UpdateOpinion updateOpinion = new UpdateOpinion();<NEW_LINE>updateOpinion.setAction(_ctx.stringValue("DescribeClientVersionResponse.UpdateOpinion.Action"));<NEW_LINE>updateOpinion.setVersion(_ctx.stringValue("DescribeClientVersionResponse.UpdateOpinion.Version"));<NEW_LINE>List<PatchDetail> patchDetails = new ArrayList<PatchDetail>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("DescribeClientVersionResponse.UpdateOpinion.PatchDetails.Length"); i++) {<NEW_LINE>PatchDetail patchDetail = new PatchDetail();<NEW_LINE>patchDetail.setVersion(_ctx.stringValue("DescribeClientVersionResponse.UpdateOpinion.PatchDetails[" + i + "].Version"));<NEW_LINE>patchDetail.setFileName(_ctx.stringValue("DescribeClientVersionResponse.UpdateOpinion.PatchDetails[" + i + "].FileName"));<NEW_LINE>patchDetail.setSize(_ctx.longValue("DescribeClientVersionResponse.UpdateOpinion.PatchDetails[" + i + "].Size"));<NEW_LINE>patchDetail.setUrl(_ctx.stringValue("DescribeClientVersionResponse.UpdateOpinion.PatchDetails[" + i + "].Url"));<NEW_LINE>patchDetails.add(patchDetail);<NEW_LINE>}<NEW_LINE>updateOpinion.setPatchDetails(patchDetails);<NEW_LINE>describeClientVersionResponse.setUpdateOpinion(updateOpinion);<NEW_LINE>return describeClientVersionResponse;<NEW_LINE>}
(_ctx.booleanValue("DescribeClientVersionResponse.Success"));
1,786,183
public Decision canAllocate(final ShardRouting shardRouting, final RoutingAllocation allocation) {<NEW_LINE>final RecoverySource recoverySource = shardRouting.recoverySource();<NEW_LINE>if (recoverySource == null || recoverySource.getType() != RecoverySource.Type.SNAPSHOT) {<NEW_LINE>return allocation.decision(Decision.YES, NAME, "ignored as shard is not being recovered from a snapshot");<NEW_LINE>}<NEW_LINE>final RecoverySource.SnapshotRecoverySource source = (RecoverySource.SnapshotRecoverySource) recoverySource;<NEW_LINE>if (source.restoreUUID().equals(RecoverySource.SnapshotRecoverySource.NO_API_RESTORE_UUID)) {<NEW_LINE>return allocation.decision(Decision.YES, NAME, "not an API-level restore");<NEW_LINE>}<NEW_LINE>final RestoreInProgress restoresInProgress = <MASK><NEW_LINE>if (restoresInProgress != null) {<NEW_LINE>RestoreInProgress.Entry restoreInProgress = restoresInProgress.get(source.restoreUUID());<NEW_LINE>if (restoreInProgress != null) {<NEW_LINE>RestoreInProgress.ShardRestoreStatus shardRestoreStatus = restoreInProgress.shards().get(shardRouting.shardId());<NEW_LINE>if (shardRestoreStatus != null && shardRestoreStatus.state().completed() == false) {<NEW_LINE>assert shardRestoreStatus.state() != RestoreInProgress.State.SUCCESS : "expected shard [" + shardRouting + "] to be in initializing state but got [" + shardRestoreStatus.state() + "]";<NEW_LINE>return allocation.decision(Decision.YES, NAME, "shard is currently being restored");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return allocation.decision(Decision.NO, NAME, "shard has failed to be restored from the snapshot [%s] because of [%s] - " + "manually close or delete the index [%s] in order to retry to restore the snapshot again or use the reroute API to force the " + "allocation of an empty primary shard", source.snapshot(), shardRouting.unassignedInfo().getDetails(), shardRouting.getIndexName());<NEW_LINE>}
allocation.custom(RestoreInProgress.TYPE);
177,587
public void uploadExecutableFlow(final ExecutableFlow flow) throws ExecutorManagerException {<NEW_LINE>final String useExecutorParam = flow.getExecutionOptions().getFlowParameters().get(ExecutionOptions.USE_EXECUTOR);<NEW_LINE>final String executorId = StringUtils.isNotEmpty(useExecutorParam) ? useExecutorParam : null;<NEW_LINE>final String flowPriorityParam = flow.getExecutionOptions().getFlowParameters().get(ExecutionOptions.FLOW_PRIORITY);<NEW_LINE>final int flowPriority = StringUtils.isNotEmpty(flowPriorityParam) ? Integer.parseInt(flowPriorityParam) : ExecutionOptions.DEFAULT_FLOW_PRIORITY;<NEW_LINE>final String INSERT_EXECUTABLE_FLOW = "INSERT INTO execution_flows " + "(project_id, flow_id, version, status, submit_time, submit_user, update_time, " + "use_executor, flow_priority, execution_source, dispatch_method) values (?,?,?,?,?,?,?," + "?,?,?,?)";<NEW_LINE>final long submitTime = flow.getSubmitTime();<NEW_LINE>final String executionSource = flow.getExecutionSource();<NEW_LINE>final DispatchMethod dispatchMethod = flow.getDispatchMethod();<NEW_LINE>final SQLTransaction<Long> insertAndGetLastID = transOperator -> {<NEW_LINE>transOperator.update(INSERT_EXECUTABLE_FLOW, flow.getProjectId(), flow.getFlowId(), flow.getVersion(), flow.getStatus().getNumVal(), submitTime, flow.getSubmitUser(), submitTime, executorId, flowPriority, <MASK><NEW_LINE>transOperator.getConnection().commit();<NEW_LINE>return transOperator.getLastInsertId();<NEW_LINE>};<NEW_LINE>try {<NEW_LINE>final long id = this.dbOperator.transaction(insertAndGetLastID);<NEW_LINE>logger.info("Flow given " + flow.getFlowId() + " given id " + id);<NEW_LINE>flow.setExecutionId((int) id);<NEW_LINE>updateExecutableFlow(flow);<NEW_LINE>} catch (final SQLException e) {<NEW_LINE>throw new ExecutorManagerException("Error creating execution.", e);<NEW_LINE>}<NEW_LINE>}
executionSource, dispatchMethod.getNumVal());
847,185
public Set<String> doGetExpired(long timeLimit) {<NEW_LINE>// now ask mongo to find sessions for this context, last managed by any<NEW_LINE>// node, that expired before timeLimit<NEW_LINE>Set<String> <MASK><NEW_LINE>BasicDBObject query = new BasicDBObject();<NEW_LINE>BasicDBObject gt = new BasicDBObject(__EXPIRY, new BasicDBObject("$gt", 0));<NEW_LINE>BasicDBObject lt = new BasicDBObject(__EXPIRY, new BasicDBObject("$lte", timeLimit));<NEW_LINE>BasicDBList list = new BasicDBList();<NEW_LINE>list.add(gt);<NEW_LINE>list.add(lt);<NEW_LINE>query.append("$and", list);<NEW_LINE>DBCursor oldExpiredSessions = null;<NEW_LINE>try {<NEW_LINE>BasicDBObject bo = new BasicDBObject(__ID, 1);<NEW_LINE>bo.append(__EXPIRY, 1);<NEW_LINE>oldExpiredSessions = _dbSessions.find(query, bo);<NEW_LINE>for (DBObject session : oldExpiredSessions) {<NEW_LINE>String id = (String) session.get(__ID);<NEW_LINE>// TODO we should verify if there is a session for my context, not any context<NEW_LINE>expiredSessions.add(id);<NEW_LINE>}<NEW_LINE>} finally {<NEW_LINE>if (oldExpiredSessions != null)<NEW_LINE>oldExpiredSessions.close();<NEW_LINE>}<NEW_LINE>return expiredSessions;<NEW_LINE>}
expiredSessions = new HashSet<>();
695,955
private void jbInit() throws Exception {<NEW_LINE>CompiereColor.setBackground(panel);<NEW_LINE>newBorder = new TitledBorder("");<NEW_LINE>accountBorder = new TitledBorder("");<NEW_LINE>mainPanel.setLayout(mainLayout);<NEW_LINE>newPanel.setBorder(newBorder);<NEW_LINE>newPanel.setLayout(newLayout);<NEW_LINE>newBorder.setTitle(Msg.getMsg(Env.getCtx(), "ChargeNewAccount"));<NEW_LINE>valueLabel.setText(Msg.translate(Env.getCtx(), "Value"));<NEW_LINE>isExpense.setSelected(true);<NEW_LINE>isExpense.setText(Msg.getMsg(Env.getCtx(), "Expense"));<NEW_LINE>nameLabel.setText(Msg.translate(Env.getCtx(), "Name"));<NEW_LINE>nameField.setColumns(20);<NEW_LINE>valueField.setColumns(10);<NEW_LINE>newButton.setText(Msg.getMsg(Env.getCtx(), "Create") + " " + Util.cleanAmp(Msg.getMsg(Env.getCtx(), "New")));<NEW_LINE>newButton.addActionListener(this);<NEW_LINE>accountPanel.setBorder(accountBorder);<NEW_LINE>accountPanel.setLayout(accountLayout);<NEW_LINE>accountBorder.setTitle(Msg.getMsg(Env.getCtx(), "ChargeFromAccount"));<NEW_LINE>accountButton.setText(Msg.getMsg(Env.getCtx(), "Create") + " " + Msg.getMsg(Env.getCtx(), "From") + " " + Msg.getElement(Env.getCtx(), "Account_ID"));<NEW_LINE>accountButton.addActionListener(this);<NEW_LINE>accountOKPanel.setLayout(accountOKLayout);<NEW_LINE>accountOKLayout.setAlignment(FlowLayout.RIGHT);<NEW_LINE>confirmPanel.addActionListener(this);<NEW_LINE>//<NEW_LINE>mainPanel.add(newPanel, BorderLayout.NORTH);<NEW_LINE>newPanel.add(valueLabel, new GridBagConstraints(0, 0, 1, 1, 0.0, 0.0, GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0));<NEW_LINE>newPanel.add(valueField, new GridBagConstraints(1, 0, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(5, 0, 5, <MASK><NEW_LINE>newPanel.add(nameLabel, new GridBagConstraints(0, 1, 1, 1, 0.0, 0.0, GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0));<NEW_LINE>newPanel.add(nameField, new GridBagConstraints(1, 1, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(5, 0, 5, 5), 0, 0));<NEW_LINE>newPanel.add(isExpense, new GridBagConstraints(2, 0, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0));<NEW_LINE>newPanel.add(newButton, new GridBagConstraints(2, 1, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0));<NEW_LINE>mainPanel.add(accountPanel, BorderLayout.CENTER);<NEW_LINE>accountPanel.add(accountOKPanel, BorderLayout.SOUTH);<NEW_LINE>accountOKPanel.add(accountButton, null);<NEW_LINE>accountPanel.add(dataPane, BorderLayout.CENTER);<NEW_LINE>dataPane.getViewport().add(dataTable, null);<NEW_LINE>}
5), 0, 0));
1,738,957
public static Kernel makeKernel(final float radius) {<NEW_LINE>final int r = (int) Math.ceil(radius);<NEW_LINE>final int rows = r * 2 + 1;<NEW_LINE>final float[<MASK><NEW_LINE>final float sigma = radius / 3;<NEW_LINE>final float sigma22 = 2 * sigma * sigma;<NEW_LINE>final float sigmaPi2 = 2 * ImageMath.PI * sigma;<NEW_LINE>final float sqrtSigmaPi2 = (float) Math.sqrt(sigmaPi2);<NEW_LINE>final float radius2 = radius * radius;<NEW_LINE>float total = 0;<NEW_LINE>int index = 0;<NEW_LINE>for (int row = -r; row <= r; row++) {<NEW_LINE>final float distance = row * row;<NEW_LINE>if (distance > radius2) {<NEW_LINE>matrix[index] = 0;<NEW_LINE>} else {<NEW_LINE>matrix[index] = (float) Math.exp(-distance / sigma22) / sqrtSigmaPi2;<NEW_LINE>}<NEW_LINE>total += matrix[index];<NEW_LINE>index++;<NEW_LINE>}<NEW_LINE>for (int i = 0; i < rows; i++) {<NEW_LINE>matrix[i] /= total;<NEW_LINE>}<NEW_LINE>return new Kernel(rows, 1, matrix);<NEW_LINE>}
] matrix = new float[rows];
1,731,915
public IdToken create(ClientDetails clientDetails, UaaUser uaaUser, UserAuthenticationData userAuthenticationData) throws IdTokenCreationException {<NEW_LINE>Date expiryDate = tokenValidityResolver.<MASK><NEW_LINE>Date issuedAt = timeService.getCurrentDate();<NEW_LINE>String givenName = getIfScopeContainsProfile(uaaUser.getGivenName(), userAuthenticationData.scopes);<NEW_LINE>String familyName = getIfScopeContainsProfile(uaaUser.getFamilyName(), userAuthenticationData.scopes);<NEW_LINE>String phoneNumber = getIfScopeContainsProfile(uaaUser.getPhoneNumber(), userAuthenticationData.scopes);<NEW_LINE>String issuerUrl = tokenEndpointBuilder.getTokenEndpoint(identityZoneManager.getCurrentIdentityZone());<NEW_LINE>String identityZoneId = identityZoneManager.getCurrentIdentityZoneId();<NEW_LINE>Map<String, List<String>> userAttributes = buildUserAttributes(userAuthenticationData, uaaUser);<NEW_LINE>Set<String> roles = buildRoles(userAuthenticationData, uaaUser);<NEW_LINE>String clientTokenSalt = (String) clientDetails.getAdditionalInformation().get(ClientConstants.TOKEN_SALT);<NEW_LINE>String revSig = getRevocableTokenSignature(uaaUser, clientTokenSalt, clientDetails.getClientId(), clientDetails.getClientSecret());<NEW_LINE>return new IdToken(getIfNotExcluded(uaaUser.getId(), USER_ID), getIfNotExcluded(newArrayList(clientDetails.getClientId()), AUD), getIfNotExcluded(issuerUrl, ISS), getIfNotExcluded(expiryDate, EXPIRY_IN_SECONDS), getIfNotExcluded(issuedAt, IAT), getIfNotExcluded(userAuthenticationData.authTime, AUTH_TIME), getIfNotExcluded(userAuthenticationData.authenticationMethods, AMR), getIfNotExcluded(userAuthenticationData.contextClassRef, ACR), getIfNotExcluded(clientDetails.getClientId(), AZP), getIfNotExcluded(givenName, GIVEN_NAME), getIfNotExcluded(familyName, FAMILY_NAME), getIfNotExcluded(uaaUser.getPreviousLogonTime(), PREVIOUS_LOGON_TIME), getIfNotExcluded(phoneNumber, PHONE_NUMBER), getIfNotExcluded(roles, ROLES), getIfNotExcluded(userAttributes, USER_ATTRIBUTES), getIfNotExcluded(uaaUser.isVerified(), EMAIL_VERIFIED), getIfNotExcluded(userAuthenticationData.nonce, NONCE), getIfNotExcluded(uaaUser.getEmail(), EMAIL), getIfNotExcluded(clientDetails.getClientId(), CID), getIfNotExcluded(userAuthenticationData.grantType, GRANT_TYPE), getIfNotExcluded(uaaUser.getUsername(), USER_NAME), getIfNotExcluded(identityZoneId, ZONE_ID), getIfNotExcluded(uaaUser.getOrigin(), ORIGIN), getIfNotExcluded(userAuthenticationData.jti, JTI), getIfNotExcluded(revSig, REVOCATION_SIGNATURE));<NEW_LINE>}
resolve(clientDetails.getClientId());
1,350,828
public void run() {<NEW_LINE>try {<NEW_LINE>if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R) {<NEW_LINE>WindowInsetsController controller = getActivity()<MASK><NEW_LINE>if (controller != null) {<NEW_LINE>controller.hide(WindowInsets.Type.statusBars() | WindowInsets.Type.navigationBars());<NEW_LINE>controller.setSystemBarsBehavior(WindowInsetsController.BEHAVIOR_SHOW_TRANSIENT_BARS_BY_SWIPE);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>final int uiOptions = View.SYSTEM_UI_FLAG_LAYOUT_STABLE | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN | View.SYSTEM_UI_FLAG_HIDE_NAVIGATION | View.SYSTEM_UI_FLAG_FULLSCREEN | View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY;<NEW_LINE>View decorView = getActivity().getWindow().getDecorView();<NEW_LINE>decorView.setSystemUiVisibility(uiOptions);<NEW_LINE>}<NEW_LINE>call.resolve();<NEW_LINE>} catch (Exception ex) {<NEW_LINE>call.reject(ex.getLocalizedMessage(), null, ex);<NEW_LINE>}<NEW_LINE>}
.getWindow().getInsetsController();
146,563
public AuthOutcome authenticate(HttpFacade exchange) {<NEW_LINE>List<String> authHeaders = exchange.getRequest().getHeaders("Authorization");<NEW_LINE>if (authHeaders == null || authHeaders.isEmpty()) {<NEW_LINE>challenge = challengeResponse(exchange, OIDCAuthenticationError.Reason.NO_BEARER_TOKEN, null, null);<NEW_LINE>return AuthOutcome.NOT_ATTEMPTED;<NEW_LINE>}<NEW_LINE>tokenString = null;<NEW_LINE>for (String authHeader : authHeaders) {<NEW_LINE>String[] split = authHeader.trim().split("\\s+");<NEW_LINE>if (split.length != 2)<NEW_LINE>continue;<NEW_LINE>if (split[0].equalsIgnoreCase("Bearer")) {<NEW_LINE>tokenString = split[1];<NEW_LINE>log.debugf("Found [%d] values in authorization header, selecting the first value for Bearer.", (<MASK><NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (tokenString == null) {<NEW_LINE>challenge = challengeResponse(exchange, OIDCAuthenticationError.Reason.NO_BEARER_TOKEN, null, null);<NEW_LINE>return AuthOutcome.NOT_ATTEMPTED;<NEW_LINE>}<NEW_LINE>return (authenticateToken(exchange, tokenString));<NEW_LINE>}
Integer) authHeaders.size());
636,863
public NetworkACLItemResponse createNetworkACLItemResponse(NetworkACLItem aclItem) {<NEW_LINE>NetworkACLItemResponse response = new NetworkACLItemResponse();<NEW_LINE>response.setId(aclItem.getUuid());<NEW_LINE>response.setProtocol(aclItem.getProtocol());<NEW_LINE>if (aclItem.getSourcePortStart() != null) {<NEW_LINE>response.setStartPort(Integer.toString(aclItem.getSourcePortStart()));<NEW_LINE>}<NEW_LINE>if (aclItem.getSourcePortEnd() != null) {<NEW_LINE>response.setEndPort(Integer.toString(aclItem.getSourcePortEnd()));<NEW_LINE>}<NEW_LINE>response.setCidrList(StringUtils.join(aclItem.getSourceCidrList(), ","));<NEW_LINE>response.setTrafficType(aclItem.getTrafficType().toString());<NEW_LINE>NetworkACLItem.State state = aclItem.getState();<NEW_LINE>String stateToSet = state.toString();<NEW_LINE>if (state.equals(NetworkACLItem.State.Revoke)) {<NEW_LINE>stateToSet = "Deleting";<NEW_LINE>}<NEW_LINE>response.setIcmpCode(aclItem.getIcmpCode());<NEW_LINE>response.setIcmpType(aclItem.getIcmpType());<NEW_LINE>response.setState(stateToSet);<NEW_LINE>response.<MASK><NEW_LINE>response.setAction(aclItem.getAction().toString());<NEW_LINE>response.setForDisplay(aclItem.isDisplay());<NEW_LINE>NetworkACL acl = ApiDBUtils.findByNetworkACLId(aclItem.getAclId());<NEW_LINE>if (acl != null) {<NEW_LINE>response.setAclId(acl.getUuid());<NEW_LINE>response.setAclName(acl.getName());<NEW_LINE>}<NEW_LINE>// set tag information<NEW_LINE>List<? extends ResourceTag> tags = ApiDBUtils.listByResourceTypeAndId(ResourceObjectType.NetworkACL, aclItem.getId());<NEW_LINE>List<ResourceTagResponse> tagResponses = new ArrayList<ResourceTagResponse>();<NEW_LINE>for (ResourceTag tag : tags) {<NEW_LINE>ResourceTagResponse tagResponse = createResourceTagResponse(tag, true);<NEW_LINE>CollectionUtils.addIgnoreNull(tagResponses, tagResponse);<NEW_LINE>}<NEW_LINE>response.setTags(tagResponses);<NEW_LINE>response.setReason(aclItem.getReason());<NEW_LINE>response.setObjectName("networkacl");<NEW_LINE>return response;<NEW_LINE>}
setNumber(aclItem.getNumber());
1,021,102
public static void datasetHtmlDDI(InputStream datafile, OutputStream outputStream) throws XMLStreamException {<NEW_LINE>DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();<NEW_LINE>try {<NEW_LINE>Document document;<NEW_LINE>InputStream styleSheetInput = DdiExportUtil.class.getClassLoader().getResourceAsStream("edu/harvard/iq/dataverse/codebook2-0.xsl");<NEW_LINE>DocumentBuilder builder = factory.newDocumentBuilder();<NEW_LINE>document = builder.parse(datafile);<NEW_LINE>// Use a Transformer for output<NEW_LINE>TransformerFactory tFactory = TransformerFactory.newInstance();<NEW_LINE>StreamSource stylesource = new StreamSource(styleSheetInput);<NEW_LINE>Transformer transformer = tFactory.newTransformer(stylesource);<NEW_LINE>DOMSource source = new DOMSource(document);<NEW_LINE>StreamResult result = new StreamResult(outputStream);<NEW_LINE>transformer.transform(source, result);<NEW_LINE>} catch (TransformerConfigurationException tce) {<NEW_LINE>// Error generated by the parser<NEW_LINE>logger.severe("Transformer Factory error" + " " + tce.getMessage());<NEW_LINE>} catch (TransformerException te) {<NEW_LINE>// Error generated by the parser<NEW_LINE>logger.severe("Transformation error" + " " + te.getMessage());<NEW_LINE>} catch (SAXException sxe) {<NEW_LINE>// Error generated by this application<NEW_LINE>// (or a parser-initialization error)<NEW_LINE>logger.severe(<MASK><NEW_LINE>} catch (ParserConfigurationException pce) {<NEW_LINE>// Parser with specified options can't be built<NEW_LINE>logger.severe("Parser configuration error " + pce.getMessage());<NEW_LINE>} catch (IOException ioe) {<NEW_LINE>// I/O error<NEW_LINE>logger.warning("I/O error " + ioe.getMessage());<NEW_LINE>}<NEW_LINE>}
"SAX error " + sxe.getMessage());
1,099,759
public com.amazonaws.services.lakeformation.model.ResourceNumberLimitExceededException unmarshallFromContext(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>com.amazonaws.services.lakeformation.model.ResourceNumberLimitExceededException resourceNumberLimitExceededException = new com.amazonaws.services.lakeformation.model.ResourceNumberLimitExceededException(null);<NEW_LINE><MASK><NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>} 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 resourceNumberLimitExceededException;<NEW_LINE>}
int originalDepth = context.getCurrentDepth();
716,078
public void run(Object[] objects, ZContext zContext, Socket socket) {<NEW_LINE>File file = new File("testdata");<NEW_LINE>FileInputStream fr;<NEW_LINE>try {<NEW_LINE>fr = new FileInputStream(file);<NEW_LINE>} catch (FileNotFoundException e) {<NEW_LINE>e.printStackTrace();<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>Socket router = zContext.createSocket(ZMQ.ROUTER);<NEW_LINE>// Default HWM is 1000, which will drop messages here<NEW_LINE>// because we send more than 1,000 chunks of test data,<NEW_LINE>// so set an infinite HWM as a simple, stupid solution:<NEW_LINE>router.setHWM(0);<NEW_LINE>router.bind("tcp://*:6000");<NEW_LINE>while (!Thread.currentThread().isInterrupted()) {<NEW_LINE>// First frame in each message is the sender identity<NEW_LINE>ZFrame identity;<NEW_LINE>try {<NEW_LINE>identity = ZFrame.recvFrame(router);<NEW_LINE>} catch (ZMQException e) {<NEW_LINE>if (e.getErrorCode() == ZError.ETERM)<NEW_LINE>break;<NEW_LINE>e.printStackTrace();<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>// Second frame is "fetch" command<NEW_LINE>String command = router.recvStr();<NEW_LINE>assert ("fetch".equals(command));<NEW_LINE>byte[] data = new byte[CHUNK_SIZE];<NEW_LINE>int size;<NEW_LINE>while (true) {<NEW_LINE>try {<NEW_LINE>if (fr.available() <= CHUNK_SIZE)<NEW_LINE>size = fr.read(data);<NEW_LINE>else<NEW_LINE>size = fr.read(data, 0, CHUNK_SIZE);<NEW_LINE>} catch (IOException e) {<NEW_LINE>e.printStackTrace();<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>ZFrame chunk = new ZFrame(Arrays.copyOf(data, size <MASK><NEW_LINE>identity.send(router, ZMQ.SNDMORE);<NEW_LINE>chunk.sendAndDestroy(router, 0);<NEW_LINE>if (size <= 0)<NEW_LINE>// Always end with a zero-size frame<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>identity.destroy();<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>fr.close();<NEW_LINE>} catch (IOException e) {<NEW_LINE>e.printStackTrace();<NEW_LINE>}<NEW_LINE>}
< 0 ? 0 : size));
1,188,429
public RoutineLoadJob checkPrivAndGetJob(String dbName, String jobName) throws MetaNotFoundException, DdlException, AnalysisException {<NEW_LINE>RoutineLoadJob routineLoadJob = getJob(dbName, jobName);<NEW_LINE>if (routineLoadJob == null) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>// check auth<NEW_LINE>String dbFullName;<NEW_LINE>String tableName;<NEW_LINE>try {<NEW_LINE>dbFullName = routineLoadJob.getDbFullName();<NEW_LINE>tableName = routineLoadJob.getTableName();<NEW_LINE>} catch (MetaNotFoundException e) {<NEW_LINE>throw new DdlException("The metadata of job has been changed. The job will be cancelled automatically", e);<NEW_LINE>}<NEW_LINE>if (!Catalog.getCurrentCatalog().getAuth().checkTblPriv(ConnectContext.get(), dbFullName, tableName, PrivPredicate.LOAD)) {<NEW_LINE>ErrorReport.reportAnalysisException(ErrorCode.ERR_TABLEACCESS_DENIED_ERROR, "LOAD", ConnectContext.get().getQualifiedUser(), ConnectContext.get().getRemoteIP(), dbFullName + ": " + tableName);<NEW_LINE>}<NEW_LINE>return routineLoadJob;<NEW_LINE>}
throw new DdlException("There is not operable routine load job with name " + jobName);
484,784
public static void onHarvest(@Nonnull BlockEvent.HarvestDropsEvent event) {<NEW_LINE>final World world = event.getWorld();<NEW_LINE>if (world == null || world.isRemote || event.getHarvester() == null || event.isSilkTouching() || !isEquipped(event.getHarvester())) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final IBlockState state = event.getState();<NEW_LINE>if (state == null || !IHarvestingTarget.isDefaultLeaves(state)) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final boolean exnihilo = hasExNihilo();<NEW_LINE>final boolean powered = isPowered(event.getHarvester(), 1);<NEW_LINE>if (exnihilo && !powered) {<NEW_LINE>// ex nihilo already adds extra drops<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>NNList<ItemStack> <MASK><NEW_LINE>final int start = exnihilo ? DarkSteelConfig.crookExtraDropsUnpowered.get() : 0;<NEW_LINE>final int loops = Math.max(start, (powered ? DarkSteelConfig.crookExtraDropsPowered : DarkSteelConfig.crookExtraDropsUnpowered).get());<NEW_LINE>for (int i = start; i < loops; i++) {<NEW_LINE>state.getBlock().getDrops(list, world, event.getPos(), state, event.getFortuneLevel());<NEW_LINE>}<NEW_LINE>event.getDrops().addAll(list);<NEW_LINE>}
list = new NNList<>();
1,776,295
private void loadFile(File file) throws SAXException, IOException {<NEW_LINE>if (!file.exists())<NEW_LINE>return;<NEW_LINE>if (!file.getName().endsWith(".xml"))<NEW_LINE>return;<NEW_LINE>if (file.getName().equals("build.xml"))<NEW_LINE>return;<NEW_LINE>log.log(Level.CONFIG, "Loading file: " + file);<NEW_LINE>Document doc = builder.parse(file);<NEW_LINE>NodeList migrations = doc.getDocumentElement().getElementsByTagName("Migration");<NEW_LINE>for (int i = 0; i < migrations.getLength(); i++) {<NEW_LINE>Element element = (Element) migrations.item(i);<NEW_LINE>// Top level - create a new transaction for every migration and commit<NEW_LINE>Trx.run(trxName -> {<NEW_LINE>Properties ctx = Env.getCtx();<NEW_LINE>MMigration migration;<NEW_LINE>try {<NEW_LINE>migration = MMigration.fromXmlNode(ctx, element, trxName);<NEW_LINE>if (migration == null) {<NEW_LINE>log.log(Level.INFO, "XML file not a Migration. Skipping.");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (isApply()) {<NEW_LINE>if (MMigration.STATUSCODE_Applied.equals(migration.getStatusCode())) {<NEW_LINE>log.log(Level.INFO, migration.toString() + " ---> Migration already applied - skipping.");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (MMigration.STATUSCODE_Failed.equals(migration.getStatusCode()) || MMigration.STATUSCODE_PartiallyApplied.equals(migration.getStatusCode())) {<NEW_LINE>log.log(Level.INFO, migration.toString() + " ---> Migration exists but has to be rolled back.");<NEW_LINE>// Rollback the migration to try and correct the error.<NEW_LINE>applyMigration(migration.getCtx(), migration.getAD_Migration_ID(), trxName);<NEW_LINE>}<NEW_LINE>// Apply the migration<NEW_LINE>applyMigration(migration.getCtx(), migration.getAD_Migration_ID(), trxName);<NEW_LINE>}<NEW_LINE>} catch (AdempiereException | SQLException e) {<NEW_LINE>if (!isForce()) {<NEW_LINE>throw new AdempiereException("Loading migration from " + file.<MASK><NEW_LINE>} else {<NEW_LINE>log.log(Level.SEVERE, e.getLocalizedMessage());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}<NEW_LINE>}
toString() + " failed.", e);
850,563
protected List<MetadataValueDTO> collection2Metadata(Collection collection) {<NEW_LINE>List<MetadataValueDTO> metadata = new ArrayList<>();<NEW_LINE>String description = collectionService.getMetadataFirstValue(collection, CollectionService.MD_INTRODUCTORY_TEXT, Item.ANY);<NEW_LINE>String description_abstract = collectionService.getMetadataFirstValue(collection, CollectionService.MD_SHORT_DESCRIPTION, Item.ANY);<NEW_LINE>String description_table = collectionService.getMetadataFirstValue(collection, CollectionService.MD_SIDEBAR_TEXT, Item.ANY);<NEW_LINE>String identifier_uri = handleService.getCanonicalPrefix() + collection.getHandle();<NEW_LINE>String provenance = collectionService.getMetadataFirstValue(collection, CollectionService.MD_PROVENANCE_DESCRIPTION, Item.ANY);<NEW_LINE>String rights = collectionService.getMetadataFirstValue(collection, CollectionService.MD_COPYRIGHT_TEXT, Item.ANY);<NEW_LINE>String rights_license = collectionService.getMetadataFirstValue(collection, CollectionService.MD_LICENSE, Item.ANY);<NEW_LINE>String title = collectionService.getMetadataFirstValue(collection, CollectionService.MD_NAME, Item.ANY);<NEW_LINE>if (description != null) {<NEW_LINE>metadata.add(createDCValue("description", null, description));<NEW_LINE>}<NEW_LINE>if (description_abstract != null) {<NEW_LINE>metadata.add(createDCValue("description", "abstract", description_abstract));<NEW_LINE>}<NEW_LINE>if (description_table != null) {<NEW_LINE>metadata.add(createDCValue("description", "tableofcontents", description_table));<NEW_LINE>}<NEW_LINE>if (identifier_uri != null) {<NEW_LINE>metadata.add(createDCValue("identifier", "uri", identifier_uri));<NEW_LINE>}<NEW_LINE>if (provenance != null) {<NEW_LINE>metadata.add(createDCValue("provenance", null, provenance));<NEW_LINE>}<NEW_LINE>if (rights != null) {<NEW_LINE>metadata.add(createDCValue("rights", null, rights));<NEW_LINE>}<NEW_LINE>if (rights_license != null) {<NEW_LINE>metadata.add(createDCValue<MASK><NEW_LINE>}<NEW_LINE>if (title != null) {<NEW_LINE>metadata.add(createDCValue("title", null, title));<NEW_LINE>}<NEW_LINE>return metadata;<NEW_LINE>}
("rights.license", null, rights_license));
705,480
private void writeSetUpdateToXml(EwsServiceXmlWriter writer, PropertyDefinition propertyDefinition) throws Exception {<NEW_LINE>// The following test should not be necessary since the property bag<NEW_LINE>// prevents<NEW_LINE>// property to be updated if they don't have the CanUpdate flag, but<NEW_LINE>// it<NEW_LINE>// doesn't hurt...<NEW_LINE>if (propertyDefinition.hasFlag(PropertyDefinitionFlags.CanUpdate)) {<NEW_LINE>Object propertyValue = this.getObjectFromPropertyDefinition(propertyDefinition);<NEW_LINE>boolean handled = false;<NEW_LINE>if (propertyValue instanceof ICustomXmlUpdateSerializer) {<NEW_LINE>ICustomXmlUpdateSerializer updateSerializer = (ICustomXmlUpdateSerializer) propertyValue;<NEW_LINE>handled = updateSerializer.writeSetUpdateToXml(writer, this.getOwner(), propertyDefinition);<NEW_LINE>}<NEW_LINE>if (!handled) {<NEW_LINE>writer.writeStartElement(XmlNamespace.Types, this.<MASK><NEW_LINE>propertyDefinition.writeToXml(writer);<NEW_LINE>writer.writeStartElement(XmlNamespace.Types, this.getOwner().getXmlElementName());<NEW_LINE>propertyDefinition.writePropertyValueToXml(writer, this, true);<NEW_LINE>writer.writeEndElement();<NEW_LINE>writer.writeEndElement();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
getOwner().getSetFieldXmlElementName());
701,275
public List<OpenLineage.OutputDataset> apply(AlterTable alterTable) {<NEW_LINE>TableCatalog tableCatalog = alterTable.catalog();<NEW_LINE>Table table;<NEW_LINE>try {<NEW_LINE>table = alterTable.catalog().<MASK><NEW_LINE>} catch (Exception e) {<NEW_LINE>return Collections.emptyList();<NEW_LINE>}<NEW_LINE>Optional<DatasetIdentifier> di = PlanUtils3.getDatasetIdentifier(context, tableCatalog, alterTable.ident(), table.properties());<NEW_LINE>if (di.isPresent()) {<NEW_LINE>OpenLineage openLineage = context.getOpenLineage();<NEW_LINE>OpenLineage.DatasetFacetsBuilder builder = openLineage.newDatasetFacetsBuilder().schema(PlanUtils.schemaFacet(openLineage, table.schema())).dataSource(PlanUtils.datasourceFacet(openLineage, di.get().getNamespace()));<NEW_LINE>Optional<String> datasetVersion = CatalogUtils3.getDatasetVersion(tableCatalog, alterTable.ident(), table.properties());<NEW_LINE>datasetVersion.ifPresent(version -> builder.version(openLineage.newDatasetVersionDatasetFacet(version)));<NEW_LINE>return Collections.singletonList(outputDataset().getDataset(di.get().getName(), di.get().getNamespace(), builder.build()));<NEW_LINE>} else {<NEW_LINE>return Collections.emptyList();<NEW_LINE>}<NEW_LINE>}
loadTable(alterTable.ident());
1,420,335
private void sendErrorResponse(HttpServletRequest request, HttpServletResponse response, AuthenticationException exception) throws IOException {<NEW_LINE>OAuth2AuthorizationCodeRequestAuthenticationException authorizationCodeRequestAuthenticationException = (OAuth2AuthorizationCodeRequestAuthenticationException) exception;<NEW_LINE>OAuth2Error error = authorizationCodeRequestAuthenticationException.getError();<NEW_LINE>OAuth2AuthorizationCodeRequestAuthenticationToken authorizationCodeRequestAuthentication = authorizationCodeRequestAuthenticationException.getAuthorizationCodeRequestAuthentication();<NEW_LINE>if (authorizationCodeRequestAuthentication == null || !StringUtils.hasText(authorizationCodeRequestAuthentication.getRedirectUri())) {<NEW_LINE>// TODO Send default html error response<NEW_LINE>response.sendError(HttpStatus.BAD_REQUEST.value(), error.toString());<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>UriComponentsBuilder uriBuilder = UriComponentsBuilder.fromUriString(authorizationCodeRequestAuthentication.getRedirectUri()).queryParam(OAuth2ParameterNames.ERROR, error.getErrorCode());<NEW_LINE>if (StringUtils.hasText(error.getDescription())) {<NEW_LINE>uriBuilder.queryParam(OAuth2ParameterNames.<MASK><NEW_LINE>}<NEW_LINE>if (StringUtils.hasText(error.getUri())) {<NEW_LINE>uriBuilder.queryParam(OAuth2ParameterNames.ERROR_URI, error.getUri());<NEW_LINE>}<NEW_LINE>if (StringUtils.hasText(authorizationCodeRequestAuthentication.getState())) {<NEW_LINE>uriBuilder.queryParam(OAuth2ParameterNames.STATE, authorizationCodeRequestAuthentication.getState());<NEW_LINE>}<NEW_LINE>this.redirectStrategy.sendRedirect(request, response, uriBuilder.toUriString());<NEW_LINE>}
ERROR_DESCRIPTION, error.getDescription());
1,492,675
public static FSDerivedValue newDerivedValue(CalculatedStyle style, CSSName cssName, PropertyValue value) {<NEW_LINE>if (value.getCssValueType() == CSSValue.CSS_INHERIT) {<NEW_LINE>return style.getParent().valueByName(cssName);<NEW_LINE>}<NEW_LINE>switch(value.getPropertyValueType()) {<NEW_LINE>case PropertyValue.VALUE_TYPE_LENGTH:<NEW_LINE>return new LengthValue(style, cssName, value);<NEW_LINE>case PropertyValue.VALUE_TYPE_IDENT:<NEW_LINE>IdentValue ident = value.getIdentValue();<NEW_LINE>if (ident == null) {<NEW_LINE>ident = IdentValue.getByIdentString(value.getStringValue());<NEW_LINE>}<NEW_LINE>return ident;<NEW_LINE>case PropertyValue.VALUE_TYPE_STRING:<NEW_LINE>return new StringValue(cssName, value);<NEW_LINE>case PropertyValue.VALUE_TYPE_NUMBER:<NEW_LINE>return new NumberValue(cssName, value);<NEW_LINE>case PropertyValue.VALUE_TYPE_COLOR:<NEW_LINE>return new ColorValue(cssName, value);<NEW_LINE>case PropertyValue.VALUE_TYPE_LIST:<NEW_LINE>return new ListValue(cssName, value);<NEW_LINE>case PropertyValue.VALUE_TYPE_COUNTERS:<NEW_LINE>return new CountersValue(cssName, value);<NEW_LINE>case PropertyValue.VALUE_TYPE_FUNCTION:<NEW_LINE><MASK><NEW_LINE>default:<NEW_LINE>throw new IllegalArgumentException();<NEW_LINE>}<NEW_LINE>}
return new FunctionValue(cssName, value);
670,178
private void buildWhere(JoinNode planNode, MysqlVisitor leftVisitor, MysqlVisitor rightVisitor) {<NEW_LINE>if (!visited)<NEW_LINE>replaceableSqlBuilder.getCurrentElement().setRepString(replaceableWhere);<NEW_LINE>StringBuilder whereBuilder = new StringBuilder();<NEW_LINE>Item filter = planNode.getWhereFilter();<NEW_LINE>if (filter != null) {<NEW_LINE>String <MASK><NEW_LINE>whereBuilder.append(" where ").append(pdName);<NEW_LINE>} else {<NEW_LINE>whereBuilder.append(" where 1=1 ");<NEW_LINE>}<NEW_LINE>// is not left join<NEW_LINE>if (leftVisitor.getWhereFilter() != null && !planNode.getLeftOuter()) {<NEW_LINE>String pdName = visitUnSelPushDownName(leftVisitor.getWhereFilter(), false);<NEW_LINE>whereBuilder.append(" and (");<NEW_LINE>whereBuilder.append(pdName);<NEW_LINE>whereBuilder.append(")");<NEW_LINE>}<NEW_LINE>// is not right join<NEW_LINE>if (rightVisitor.getWhereFilter() != null && !planNode.getRightOuter()) {<NEW_LINE>String pdName = visitUnSelPushDownName(rightVisitor.getWhereFilter(), false);<NEW_LINE>whereBuilder.append(" and (");<NEW_LINE>whereBuilder.append(pdName);<NEW_LINE>whereBuilder.append(")");<NEW_LINE>}<NEW_LINE>// left join<NEW_LINE>if (leftVisitor.getWhereFilter() != null && !planNode.getRightOuter() && planNode.getLeftOuter()) {<NEW_LINE>String pdName = visitUnSelPushDownName(leftVisitor.getWhereFilter(), false);<NEW_LINE>whereBuilder.append(" and (");<NEW_LINE>whereBuilder.append(pdName);<NEW_LINE>whereBuilder.append(")");<NEW_LINE>}<NEW_LINE>// right join<NEW_LINE>if (rightVisitor.getWhereFilter() != null && !planNode.getLeftOuter() && planNode.getRightOuter()) {<NEW_LINE>String pdName = visitUnSelPushDownName(rightVisitor.getWhereFilter(), false);<NEW_LINE>whereBuilder.append(" and (");<NEW_LINE>whereBuilder.append(pdName);<NEW_LINE>whereBuilder.append(")");<NEW_LINE>}<NEW_LINE>replaceableWhere.set(whereBuilder.toString());<NEW_LINE>// refresh sqlbuilder<NEW_LINE>sqlBuilder = replaceableSqlBuilder.getCurrentElement().getSb();<NEW_LINE>}
pdName = visitUnSelPushDownName(filter, false);
339,862
IterableSet patch_PackageContext(IterableSet currentContext) {<NEW_LINE>IterableSet newContext = new IterableSet();<NEW_LINE><MASK><NEW_LINE>while (it.hasNext()) {<NEW_LINE>String currentPackage = (String) it.next(), newPackage = null;<NEW_LINE>StringTokenizer st = new StringTokenizer(currentPackage, ".");<NEW_LINE>if (st.hasMoreTokens() == false) {<NEW_LINE>newContext.add(currentPackage);<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>String firstToken = st.nextToken();<NEW_LINE>Iterator<NameHolder> arit = appRoots.iterator();<NEW_LINE>while (arit.hasNext()) {<NEW_LINE>NameHolder h = arit.next();<NEW_LINE>if (h.get_PackageName().equals(firstToken)) {<NEW_LINE>newPackage = h.get_OriginalPackageName(st);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (newPackage != null) {<NEW_LINE>newContext.add(newPackage);<NEW_LINE>} else {<NEW_LINE>newContext.add(currentPackage);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return newContext;<NEW_LINE>}
Iterator it = currentContext.iterator();
1,085,813
public boolean prompt(final Host bookmark, final String message, final LoginCallback prompt, final LoginOptions options) throws LoginCanceledException {<NEW_LINE>final Credentials credentials = bookmark.getCredentials();<NEW_LINE>if (options.password) {<NEW_LINE>final Credentials input = prompt.prompt(bookmark, credentials.getUsername(), String.format("%s %s", LocaleFactory.localizedString("Login", "Login"), bookmark.getHostname()), message, options);<NEW_LINE>credentials.setSaved(input.isSaved());<NEW_LINE>credentials.setUsername(input.getUsername());<NEW_LINE>credentials.setPassword(input.getPassword());<NEW_LINE>credentials.setIdentity(input.getIdentity());<NEW_LINE>}<NEW_LINE>if (options.token) {<NEW_LINE>final Credentials input = prompt.prompt(bookmark, LocaleFactory.localizedString("Provide additional login credentials", "Credentials"), message, options);<NEW_LINE>credentials.setSaved(input.isSaved());<NEW_LINE>credentials.<MASK><NEW_LINE>}<NEW_LINE>if (options.oauth) {<NEW_LINE>log.warn(String.format("Reset OAuth tokens for %s", bookmark));<NEW_LINE>credentials.setOauth(OAuthTokens.EMPTY);<NEW_LINE>}<NEW_LINE>return options.password || options.token || options.oauth;<NEW_LINE>}
setToken(input.getPassword());
89,257
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {<NEW_LINE>super.onViewCreated(view, savedInstanceState);<NEW_LINE>currentFilterOptions = getArguments().getParcelable(BundleConstant.ITEM);<NEW_LINE>if (currentFilterOptions == null)<NEW_LINE>return;<NEW_LINE>ArrayAdapter<String> typesAdapter = new ArrayAdapter<>(getContext(), android.R.layout.simple_list_item_1, currentFilterOptions.getTypesList());<NEW_LINE>ArrayAdapter<String> sortOptionsAdapter = new ArrayAdapter<>(getContext(), android.R.layout.simple_list_item_1, currentFilterOptions.getSortOptionList());<NEW_LINE>ArrayAdapter<String> sortDirectionAdapter = new ArrayAdapter<>(getContext(), android.R.layout.<MASK><NEW_LINE>typeSelectionSpinner.setAdapter(typesAdapter);<NEW_LINE>sortSelectionSpinner.setAdapter(sortOptionsAdapter);<NEW_LINE>sortDirectionSpinner.setAdapter(sortDirectionAdapter);<NEW_LINE>typeSelectionSpinner.setSelection(currentFilterOptions.getSelectedTypeIndex());<NEW_LINE>sortSelectionSpinner.setSelection(currentFilterOptions.getSelectedSortOptionIndex());<NEW_LINE>sortDirectionSpinner.setSelection(currentFilterOptions.getSelectedSortDirectionIndex());<NEW_LINE>if (currentFilterOptions.isOrg()) {<NEW_LINE>sortLayout.setVisibility(View.GONE);<NEW_LINE>sortDirectionlayout.setVisibility(View.GONE);<NEW_LINE>}<NEW_LINE>}
simple_list_item_1, currentFilterOptions.getSortDirectionList());
51,216
public static ByteBuffer[] collectv(EObject io_list) {<NEW_LINE>final List<ByteBuffer> list = new ArrayList<ByteBuffer>();<NEW_LINE>final IO.BARR[] barr = new IO.BARR[1];<NEW_LINE>io_list.visitIOList(new EIOListVisitor() {<NEW_LINE><NEW_LINE>private void flush() {<NEW_LINE>if (barr[0] != null) {<NEW_LINE>list.add(barr[0].wrap());<NEW_LINE>barr[0] = null;<NEW_LINE>}<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void visit(ByteBuffer buf) {<NEW_LINE>flush();<NEW_LINE>list.add(buf);<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void visit(byte[] array, int off, int len) {<NEW_LINE>if (barr[0] != null && len < 32) {<NEW_LINE>barr[0].write(array, off, len);<NEW_LINE>} else {<NEW_LINE>flush();<NEW_LINE>list.add(ByteBuffer.wrap(array, off, len));<NEW_LINE>}<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>void visit(int aByte) {<NEW_LINE>if (barr[0] == null) {<NEW_LINE>barr[0] = new BARR();<NEW_LINE>}<NEW_LINE>barr[0].write(aByte);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>if (barr[0] != null) {<NEW_LINE>list.add(barr<MASK><NEW_LINE>barr[0] = null;<NEW_LINE>}<NEW_LINE>return list.toArray(new ByteBuffer[list.size()]);<NEW_LINE>}
[0].wrap());
1,499,779
public DoubleMatrix apply(DoubleArray x) {<NEW_LINE>SabrParametersIborCapletFloorletVolatilities volsNew = updateParameters(volatilities, nExpiries, timeIndex, betaFixed, x);<NEW_LINE>double[][] jacobian = new double[nCaplets][4];<NEW_LINE>for (int i = 0; i < nCaplets; ++i) {<NEW_LINE>PointSensitivities point = capList.get(currentStart + i).getCapletFloorletPeriods().stream().filter(p -> p.getFixingDateTime().isAfter(prevExpiry)).map(p -> sabrPeriodPricer.presentValueSensitivityModelParamsSabr(p, ratesProvider, volsNew)).reduce((c1, c2) -> c1.combinedWith(c2)).get().build();<NEW_LINE>double targetPrice = priceList.get(currentStart + i);<NEW_LINE>CurrencyParameterSensitivities sensi = volsNew.parameterSensitivity(point);<NEW_LINE>jacobian[i][0] = sensi.getSensitivity(alphaCurve.getName(), currency).getSensitivity().get(timeIndex) / targetPrice;<NEW_LINE>if (betaFixed) {<NEW_LINE>jacobian[i][1] = 0d;<NEW_LINE>jacobian[i][2] = sensi.getSensitivity(rhoCurve.getName(), currency).getSensitivity().get(timeIndex) / targetPrice;<NEW_LINE>} else {<NEW_LINE>jacobian[i][1] = sensi.getSensitivity(betaCurve.getName(), currency).getSensitivity().get(timeIndex) / targetPrice;<NEW_LINE>jacobian<MASK><NEW_LINE>}<NEW_LINE>jacobian[i][3] = sensi.getSensitivity(nuCurve.getName(), currency).getSensitivity().get(timeIndex) / targetPrice;<NEW_LINE>}<NEW_LINE>return DoubleMatrix.ofUnsafe(jacobian);<NEW_LINE>}
[i][2] = 0d;
1,078,366
private JComponent createGainPanel() {<NEW_LINE>final JSlider gainSlider;<NEW_LINE>gainSlider = new JSlider(0, 200);<NEW_LINE>gainSlider.setValue(100);<NEW_LINE>gainSlider.setPaintLabels(true);<NEW_LINE>gainSlider.setPaintTicks(true);<NEW_LINE>final JLabel label = new JLabel("Gain: 100%");<NEW_LINE>gainSlider.addChangeListener(new ChangeListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void stateChanged(ChangeEvent arg0) {<NEW_LINE>double gainValue = gainSlider.getValue() / 100.0;<NEW_LINE>label.setText(String.format("Gain: %3d", gainSlider.getValue()) + "%");<NEW_LINE>if (gain != null)<NEW_LINE>gain.setGain(gainValue);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>JPanel gainPanel = <MASK><NEW_LINE>label.setToolTipText("Volume in % (100 is no change).");<NEW_LINE>gainPanel.add(label, BorderLayout.NORTH);<NEW_LINE>gainPanel.add(gainSlider, BorderLayout.CENTER);<NEW_LINE>gainPanel.setBorder(new TitledBorder("Volume control"));<NEW_LINE>return gainPanel;<NEW_LINE>}
new JPanel(new BorderLayout());
1,596,129
public com.squareup.okhttp.Call statsHistoryUSDAsync(final ApiCallback<List<StatsUSD>> callback) throws ApiException {<NEW_LINE>ProgressResponseBody.ProgressListener progressListener = null;<NEW_LINE>ProgressRequestBody.ProgressRequestListener progressRequestListener = null;<NEW_LINE>if (callback != null) {<NEW_LINE>progressListener = new ProgressResponseBody.ProgressListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void update(long bytesRead, long contentLength, boolean done) {<NEW_LINE>callback.onDownloadProgress(bytesRead, contentLength, done);<NEW_LINE>}<NEW_LINE>};<NEW_LINE>progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onRequestProgress(long bytesWritten, long contentLength, boolean done) {<NEW_LINE>callback.onUploadProgress(bytesWritten, contentLength, done);<NEW_LINE>}<NEW_LINE>};<NEW_LINE>}<NEW_LINE>com.squareup.okhttp.Call call = statsHistoryUSDValidateBeforeCall(progressListener, progressRequestListener);<NEW_LINE>Type localVarReturnType = new TypeToken<List<StatsUSD>>() {<NEW_LINE>}.getType();<NEW_LINE>apiClient.<MASK><NEW_LINE>return call;<NEW_LINE>}
executeAsync(call, localVarReturnType, callback);
461,338
public Dataset createOrUpdateDataset(Dataset dataset, String workspaceName, boolean create, UserInfo userInfo) throws ModelDBException, NoSuchAlgorithmException {<NEW_LINE>try (var session = modelDBHibernateUtil.getSessionFactory().openSession()) {<NEW_LINE>var repositoryIdBuilder = RepositoryIdentification.newBuilder();<NEW_LINE>if (dataset.getId().isEmpty()) {<NEW_LINE>repositoryIdBuilder.setNamedId(RepositoryNamedIdentification.newBuilder().setName(dataset.getName()).setWorkspaceName(workspaceName).build());<NEW_LINE>} else {<NEW_LINE>repositoryIdBuilder.setRepoId(Long.parseLong<MASK><NEW_LINE>}<NEW_LINE>var repository = createDatasetRepository(session, dataset, repositoryIdBuilder.build(), workspaceName, create, userInfo);<NEW_LINE>return repositoryToDataset(session, metadataDAO, repository);<NEW_LINE>} catch (Exception ex) {<NEW_LINE>if (ModelDBUtils.needToRetry(ex)) {<NEW_LINE>return createOrUpdateDataset(dataset, workspaceName, create, userInfo);<NEW_LINE>} else {<NEW_LINE>throw ex;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
(dataset.getId()));
330,704
public void onUsingTick(ItemStack stack, LivingEntity user, int count) {<NEW_LINE>int inUse = this.getUseDuration(stack) - count;<NEW_LINE>if (inUse > getChargeTime(stack) && inUse % 20 == user.getRandom().nextInt(20)) {<NEW_LINE>user.level.playSound(null, user.getX(), user.getY(), user.getZ(), IESounds.spark, SoundSource.PLAYERS, .8f + (.2f * user.getRandom().nextFloat()), .5f + (.5f * user.getRandom().nextFloat()));<NEW_LINE>Triple<ItemStack, ShaderRegistryEntry, ShaderCase> <MASK><NEW_LINE>if (shader != null) {<NEW_LINE>Vec3 pos = Utils.getLivingFrontPos(user, .4375, user.getBbHeight() * .75, ItemUtils.getLivingHand(user, user.getUsedItemHand()), false, 1);<NEW_LINE>shader.getMiddle().getEffectFunction().execute(user.level, shader.getLeft(), stack, shader.getRight().getShaderType().toString(), pos, null, .0625f);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
shader = ShaderRegistry.getStoredShaderAndCase(stack);
1,161,492
public static void vertical(Kernel1D_S32 kernel, GrayS16 input, GrayI16 output, int skip) {<NEW_LINE>final short[] dataSrc = input.data;<NEW_LINE>final short[] dataDst = output.data;<NEW_LINE>final int[] dataKer = kernel.data;<NEW_LINE>final int radius = kernel.getRadius();<NEW_LINE>final int offset = UtilDownConvolve.computeOffset(skip, radius);<NEW_LINE>final int offsetEnd = UtilDownConvolve.computeMaxSide(input.height, skip, radius) + skip;<NEW_LINE>final int width = input.width;<NEW_LINE>final int height = input.height - input.height % skip;<NEW_LINE>for (int y = 0; y < offset; y += skip) {<NEW_LINE>int indexDest = output.startIndex + (y / skip) * output.stride;<NEW_LINE>for (int x = 0; x < width; x++) {<NEW_LINE>int indexSrc = input.startIndex + y * input.stride + x;<NEW_LINE>int total = 0;<NEW_LINE>int weight = 0;<NEW_LINE>for (int k = -y; k <= radius; k++) {<NEW_LINE>int w = dataKer[k + radius];<NEW_LINE>weight += w;<NEW_LINE>total += (dataSrc[indexSrc + k <MASK><NEW_LINE>}<NEW_LINE>dataDst[indexDest++] = (short) ((total + weight / 2) / weight);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>for (int y = offsetEnd; y < height; y += skip) {<NEW_LINE>int indexDest = output.startIndex + (y / skip) * output.stride;<NEW_LINE>int endKernel = input.height - y - 1;<NEW_LINE>if (endKernel > radius)<NEW_LINE>endKernel = radius;<NEW_LINE>for (int x = 0; x < width; x++) {<NEW_LINE>int indexSrc = input.startIndex + y * input.stride + x;<NEW_LINE>int total = 0;<NEW_LINE>int weight = 0;<NEW_LINE>for (int k = -radius; k <= endKernel; k++) {<NEW_LINE>int w = dataKer[k + radius];<NEW_LINE>weight += w;<NEW_LINE>total += (dataSrc[indexSrc + k * input.stride]) * w;<NEW_LINE>}<NEW_LINE>dataDst[indexDest++] = (short) ((total + weight / 2) / weight);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
* input.stride]) * w;
577,400
private static ClassNode findGenericsTypeHolderForClass(ClassNode source, ClassNode type) {<NEW_LINE>if (isPrimitiveType(source))<NEW_LINE>source = getWrapper(source);<NEW_LINE>if (source.equals(type))<NEW_LINE>return source;<NEW_LINE>if (type.isInterface()) {<NEW_LINE>for (ClassNode interfaceNode : source.getAllInterfaces()) {<NEW_LINE>if (interfaceNode.equals(type)) {<NEW_LINE>ClassNode parameterizedInterface = GenericsUtils.parameterizeType(source, interfaceNode);<NEW_LINE>return parameterizedInterface;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>ClassNode superClass = source.getUnresolvedSuperClass();<NEW_LINE>// copy generic type information if available<NEW_LINE>if (superClass != null && superClass.isUsingGenerics()) {<NEW_LINE>Map<GenericsType.GenericsTypeName, GenericsType> genericsTypeMap = GenericsUtils.extractPlaceholders(source);<NEW_LINE>GenericsType[] genericsTypes = superClass.getGenericsTypes();<NEW_LINE>if (genericsTypes != null) {<NEW_LINE>GenericsType[] copyTypes = new GenericsType[genericsTypes.length];<NEW_LINE>for (int i = 0; i < genericsTypes.length; i++) {<NEW_LINE>GenericsType genericsType = genericsTypes[i];<NEW_LINE>GenericsType.GenericsTypeName gtn = new GenericsType.GenericsTypeName(genericsType.getName());<NEW_LINE>if (genericsType.isPlaceholder() && genericsTypeMap.containsKey(gtn)) {<NEW_LINE>copyTypes[i<MASK><NEW_LINE>} else {<NEW_LINE>copyTypes[i] = genericsType;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>superClass = superClass.getPlainNodeReference();<NEW_LINE>superClass.setGenericsTypes(copyTypes);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (superClass != null)<NEW_LINE>return findGenericsTypeHolderForClass(superClass, type);<NEW_LINE>return null;<NEW_LINE>}
] = genericsTypeMap.get(gtn);
1,173,850
public void toEPL(StringWriter writer) {<NEW_LINE>writer.write(" match_recognize (");<NEW_LINE>if (partitionExpressions.size() > 0) {<NEW_LINE>String delimiter = "";<NEW_LINE>writer.write(" partition by ");<NEW_LINE>for (Expression part : partitionExpressions) {<NEW_LINE>writer.write(delimiter);<NEW_LINE>part.toEPL(writer, ExpressionPrecedenceEnum.MINIMUM);<NEW_LINE>delimiter = ", ";<NEW_LINE>}<NEW_LINE>}<NEW_LINE>String delimiter = "";<NEW_LINE>writer.write(" measures ");<NEW_LINE>for (SelectClauseExpression part : measures) {<NEW_LINE>writer.write(delimiter);<NEW_LINE>part.toEPLElement(writer);<NEW_LINE>delimiter = ", ";<NEW_LINE>}<NEW_LINE>if (all) {<NEW_LINE>writer.write(" all matches");<NEW_LINE>}<NEW_LINE>if (skipClause != MatchRecognizeSkipClause.PAST_LAST_ROW) {<NEW_LINE>writer.write(" after match skip " + skipClause.getText());<NEW_LINE>}<NEW_LINE>writer.write(" pattern (");<NEW_LINE>pattern.writeEPL(writer);<NEW_LINE>writer.write(")");<NEW_LINE>if ((intervalClause != null) && (intervalClause.getExpression() != null)) {<NEW_LINE>writer.write(" interval ");<NEW_LINE>intervalClause.getExpression().<MASK><NEW_LINE>if (intervalClause.isOrTerminated()) {<NEW_LINE>writer.write(" or terminated");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>delimiter = "";<NEW_LINE>if (!defines.isEmpty()) {<NEW_LINE>writer.write(" define ");<NEW_LINE>for (MatchRecognizeDefine def : defines) {<NEW_LINE>writer.write(delimiter);<NEW_LINE>writer.write(def.getName());<NEW_LINE>writer.write(" as ");<NEW_LINE>def.getExpression().toEPL(writer, ExpressionPrecedenceEnum.MINIMUM);<NEW_LINE>delimiter = ", ";<NEW_LINE>}<NEW_LINE>}<NEW_LINE>writer.write(")");<NEW_LINE>}
toEPL(writer, ExpressionPrecedenceEnum.MINIMUM);
1,162,199
public void translate(final ITranslationEnvironment environment, final IInstruction instruction, final List<ReilInstruction> instructions) throws InternalTranslationException {<NEW_LINE>Preconditions.checkNotNull(environment, "Error: Argument environment can't be null");<NEW_LINE>Preconditions.checkNotNull(instruction, "Error: Argument instruction can't be null");<NEW_LINE>Preconditions.checkNotNull(instructions, "Error: Argument instructions can't be null");<NEW_LINE>Preconditions.checkArgument(instruction.getOperands().size() == 1, "Error: Argument instruction is not a conditional jump instruction (invalid number of operands)");<NEW_LINE>final long baseOffset = instruction.getAddress().toLong() * 0x100;<NEW_LINE>long offset = baseOffset;<NEW_LINE>// JCC instructions have exactly one operand.<NEW_LINE>final IOperandTree operand = instruction.getOperands().get(0);<NEW_LINE>// Load the operand.<NEW_LINE>final TranslationResult result = Helpers.translateOperand(<MASK><NEW_LINE>instructions.addAll(result.getInstructions());<NEW_LINE>final String jumpTarget = result.getRegister();<NEW_LINE>// Adjust the offset of the next REIL instruction.<NEW_LINE>offset = baseOffset + instructions.size();<NEW_LINE>final Pair<OperandSize, String> condition = conditionGenerator.generate(environment, offset, instructions);<NEW_LINE>// Adjust the offset of the next REIL instruction.<NEW_LINE>offset = baseOffset + instructions.size();<NEW_LINE>instructions.add(ReilHelpers.createJcc(offset, condition.first(), condition.second(), environment.getArchitectureSize(), jumpTarget));<NEW_LINE>}
environment, offset, operand, true);
1,042,085
private static ServerBuilder configureService(ServerBuilder sb, HttpHandler httpHandler, DataBufferFactoryWrapper<?> factoryWrapper, @Nullable String serverHeader) {<NEW_LINE>final ArmeriaHttpHandlerAdapter handler = new ArmeriaHttpHandlerAdapter(httpHandler, factoryWrapper);<NEW_LINE>return sb.route().addRoute(Route.ofCatchAll()).defaultServiceName("SpringWebFlux").build((ctx, req) -> {<NEW_LINE>final CompletableFuture<HttpResponse> future = new CompletableFuture<>();<NEW_LINE>final HttpResponse response = HttpResponse.from(future);<NEW_LINE>final Disposable disposable = handler.handle(ctx, req, <MASK><NEW_LINE>response.whenComplete().handle((unused, cause) -> {<NEW_LINE>if (cause != null) {<NEW_LINE>if (ctx.method() != HttpMethod.HEAD) {<NEW_LINE>logger.debug("{} Response stream has been cancelled.", ctx, cause);<NEW_LINE>}<NEW_LINE>disposable.dispose();<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>});<NEW_LINE>return response;<NEW_LINE>});<NEW_LINE>}
future, serverHeader).subscribe();
1,444,024
protected AppDefinitionRepresentation createRepresentation(AppDefinition appDefinition, BaseAppModel baseAppModel) {<NEW_LINE>AppDefinitionRepresentation resultAppDef = new AppDefinitionRepresentation();<NEW_LINE>resultAppDef.setAppDefinitionId(appDefinition.getId());<NEW_LINE>resultAppDef.setAppDefinitionKey(appDefinition.getKey());<NEW_LINE>resultAppDef.setName(appDefinition.getName());<NEW_LINE>resultAppDef.setTheme(baseAppModel.getTheme());<NEW_LINE>resultAppDef.<MASK><NEW_LINE>resultAppDef.setDescription(baseAppModel.getDescription());<NEW_LINE>resultAppDef.setTenantId(appDefinition.getTenantId());<NEW_LINE>if (StringUtils.isNotEmpty(baseAppModel.getUsersAccess())) {<NEW_LINE>resultAppDef.setUsersAccess(convertToList(baseAppModel.getUsersAccess()));<NEW_LINE>}<NEW_LINE>if (StringUtils.isNotEmpty(baseAppModel.getGroupsAccess())) {<NEW_LINE>resultAppDef.setGroupsAccess(convertToList(baseAppModel.getGroupsAccess()));<NEW_LINE>}<NEW_LINE>return resultAppDef;<NEW_LINE>}
setIcon(baseAppModel.getIcon());
1,726,510
private String fixQuery(boolean isSPARUL, String query, Dataset dataset, boolean includeInferred, BindingSet bindings, List<Value> pstmtParams, String baseURI) throws RepositoryException {<NEW_LINE>boolean added_def_graph = false;<NEW_LINE>Set<URI> list;<NEW_LINE>String removeGraph = null;<NEW_LINE>String insertGraph = null;<NEW_LINE>if (dataset != null) {<NEW_LINE>// TODO update later, when support of new defines will be added<NEW_LINE>list = dataset.getDefaultRemoveGraphs();<NEW_LINE>if (list != null) {<NEW_LINE>if (list.size() > 1)<NEW_LINE>throw new RepositoryException("Only ONE DefaultRemoveGraph is supported");<NEW_LINE>Iterator<URI> it = list.iterator();<NEW_LINE>while (it.hasNext()) {<NEW_LINE>removeGraph = " <" + it.next().toString() + "> ";<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>URI g = dataset.getDefaultInsertGraph();<NEW_LINE>if (g != null)<NEW_LINE>insertGraph = " <" + g.toString() + "> ";<NEW_LINE>}<NEW_LINE>query = SubstGraphs(query, insertGraph, removeGraph);<NEW_LINE>StringBuffer ret = new StringBuffer("sparql\n ");<NEW_LINE>if (includeInferred && ruleSet != null && ruleSet.length() > 0)<NEW_LINE>ret.append("define input:inference '" + ruleSet + "'\n ");<NEW_LINE>if (dataset != null) {<NEW_LINE>list = dataset.getDefaultGraphs();<NEW_LINE>if (list != null) {<NEW_LINE>Iterator<URI> it = list.iterator();<NEW_LINE>while (it.hasNext()) {<NEW_LINE>URI v = it.next();<NEW_LINE>ret.append(" define input:default-graph-uri <" + v.toString() + "> \n");<NEW_LINE>added_def_graph = true;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>list = dataset.getNamedGraphs();<NEW_LINE>if (list != null) {<NEW_LINE>Iterator<URI> it = list.iterator();<NEW_LINE>while (it.hasNext()) {<NEW_LINE>URI v = it.next();<NEW_LINE>ret.append(" define input:named-graph-uri <" + v.toString() + "> \n");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (!added_def_graph && useDefGraphForQueries)<NEW_LINE>ret.append(" define input:default-graph-uri <" + defGraph + "> \n");<NEW_LINE>if (baseURI != null && baseURI.length() > 0)<NEW_LINE>ret.<MASK><NEW_LINE>ret.append(substBindings(query, bindings, pstmtParams, isSPARUL));<NEW_LINE>return ret.toString();<NEW_LINE>}
append(" BASE <" + baseURI + "> \n");
1,588,792
public boolean apply(Game game, Ability source) {<NEW_LINE>Player player = game.getPlayer(source.getControllerId());<NEW_LINE>Permanent permanent = game.<MASK><NEW_LINE>if (player == null || permanent == null) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>FilterCard filter = new FilterCreatureCard("creature card with the same name as " + permanent.getName());<NEW_LINE>filter.add(new MarchOfBurgeoningLifePredicate(permanent));<NEW_LINE>TargetCardInLibrary target = new TargetCardInLibrary(0, 1, filter);<NEW_LINE>player.searchLibrary(target, source, game);<NEW_LINE>Card card = player.getLibrary().getCard(target.getFirstTarget(), game);<NEW_LINE>if (card != null) {<NEW_LINE>player.moveCards(card, Zone.BATTLEFIELD, source, game, true, false, false, null);<NEW_LINE>}<NEW_LINE>player.shuffleLibrary(source, game);<NEW_LINE>return true;<NEW_LINE>}
getPermanent(source.getFirstTarget());
968,781
public void transform(Row row, PointCollector collector) throws IOException, UDFInputSeriesDataTypeNotValidException {<NEW_LINE>boolean needAddNewRecord;<NEW_LINE>switch(dataType) {<NEW_LINE>case INT32:<NEW_LINE>needAddNewRecord = transformInt(row.getTime(), row.getInt(0));<NEW_LINE>break;<NEW_LINE>case INT64:<NEW_LINE>needAddNewRecord = transformLong(row.getTime()<MASK><NEW_LINE>break;<NEW_LINE>case FLOAT:<NEW_LINE>needAddNewRecord = transformFloat(row.getTime(), row.getFloat(0));<NEW_LINE>break;<NEW_LINE>case DOUBLE:<NEW_LINE>needAddNewRecord = transformDouble(row.getTime(), row.getDouble(0));<NEW_LINE>break;<NEW_LINE>case BOOLEAN:<NEW_LINE>needAddNewRecord = transformBoolean(row.getTime(), row.getBoolean(0));<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>// This will not happen<NEW_LINE>throw new UDFInputSeriesDataTypeNotValidException(0, dataType, TSDataType.INT32, TSDataType.INT64, TSDataType.FLOAT, TSDataType.DOUBLE);<NEW_LINE>}<NEW_LINE>if (needAddNewRecord) {<NEW_LINE>collector.putLong(interval.left, interval.right);<NEW_LINE>}<NEW_LINE>}
, row.getLong(0));
252,513
public void marshall(GlacierJobDescription glacierJobDescription, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (glacierJobDescription == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(glacierJobDescription.getJobId(), JOBID_BINDING);<NEW_LINE>protocolMarshaller.marshall(glacierJobDescription.getJobDescription(), JOBDESCRIPTION_BINDING);<NEW_LINE>protocolMarshaller.marshall(glacierJobDescription.getAction(), ACTION_BINDING);<NEW_LINE>protocolMarshaller.marshall(glacierJobDescription.getArchiveId(), ARCHIVEID_BINDING);<NEW_LINE>protocolMarshaller.marshall(glacierJobDescription.getVaultARN(), VAULTARN_BINDING);<NEW_LINE>protocolMarshaller.marshall(<MASK><NEW_LINE>protocolMarshaller.marshall(glacierJobDescription.getCompleted(), COMPLETED_BINDING);<NEW_LINE>protocolMarshaller.marshall(glacierJobDescription.getStatusCode(), STATUSCODE_BINDING);<NEW_LINE>protocolMarshaller.marshall(glacierJobDescription.getStatusMessage(), STATUSMESSAGE_BINDING);<NEW_LINE>protocolMarshaller.marshall(glacierJobDescription.getArchiveSizeInBytes(), ARCHIVESIZEINBYTES_BINDING);<NEW_LINE>protocolMarshaller.marshall(glacierJobDescription.getInventorySizeInBytes(), INVENTORYSIZEINBYTES_BINDING);<NEW_LINE>protocolMarshaller.marshall(glacierJobDescription.getSNSTopic(), SNSTOPIC_BINDING);<NEW_LINE>protocolMarshaller.marshall(glacierJobDescription.getCompletionDate(), COMPLETIONDATE_BINDING);<NEW_LINE>protocolMarshaller.marshall(glacierJobDescription.getSHA256TreeHash(), SHA256TREEHASH_BINDING);<NEW_LINE>protocolMarshaller.marshall(glacierJobDescription.getArchiveSHA256TreeHash(), ARCHIVESHA256TREEHASH_BINDING);<NEW_LINE>protocolMarshaller.marshall(glacierJobDescription.getRetrievalByteRange(), RETRIEVALBYTERANGE_BINDING);<NEW_LINE>protocolMarshaller.marshall(glacierJobDescription.getTier(), TIER_BINDING);<NEW_LINE>protocolMarshaller.marshall(glacierJobDescription.getInventoryRetrievalParameters(), INVENTORYRETRIEVALPARAMETERS_BINDING);<NEW_LINE>protocolMarshaller.marshall(glacierJobDescription.getJobOutputPath(), JOBOUTPUTPATH_BINDING);<NEW_LINE>protocolMarshaller.marshall(glacierJobDescription.getSelectParameters(), SELECTPARAMETERS_BINDING);<NEW_LINE>protocolMarshaller.marshall(glacierJobDescription.getOutputLocation(), OUTPUTLOCATION_BINDING);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>}
glacierJobDescription.getCreationDate(), CREATIONDATE_BINDING);
1,119,808
public void marshall(TransferDomainRequest transferDomainRequest, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (transferDomainRequest == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(<MASK><NEW_LINE>protocolMarshaller.marshall(transferDomainRequest.getIdnLangCode(), IDNLANGCODE_BINDING);<NEW_LINE>protocolMarshaller.marshall(transferDomainRequest.getDurationInYears(), DURATIONINYEARS_BINDING);<NEW_LINE>protocolMarshaller.marshall(transferDomainRequest.getNameservers(), NAMESERVERS_BINDING);<NEW_LINE>protocolMarshaller.marshall(transferDomainRequest.getAuthCode(), AUTHCODE_BINDING);<NEW_LINE>protocolMarshaller.marshall(transferDomainRequest.getAutoRenew(), AUTORENEW_BINDING);<NEW_LINE>protocolMarshaller.marshall(transferDomainRequest.getAdminContact(), ADMINCONTACT_BINDING);<NEW_LINE>protocolMarshaller.marshall(transferDomainRequest.getRegistrantContact(), REGISTRANTCONTACT_BINDING);<NEW_LINE>protocolMarshaller.marshall(transferDomainRequest.getTechContact(), TECHCONTACT_BINDING);<NEW_LINE>protocolMarshaller.marshall(transferDomainRequest.getPrivacyProtectAdminContact(), PRIVACYPROTECTADMINCONTACT_BINDING);<NEW_LINE>protocolMarshaller.marshall(transferDomainRequest.getPrivacyProtectRegistrantContact(), PRIVACYPROTECTREGISTRANTCONTACT_BINDING);<NEW_LINE>protocolMarshaller.marshall(transferDomainRequest.getPrivacyProtectTechContact(), PRIVACYPROTECTTECHCONTACT_BINDING);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>}
transferDomainRequest.getDomainName(), DOMAINNAME_BINDING);
1,620,197
private void updateSeparateViews(ModeAccessor[] separateModeAccessors) {<NEW_LINE>Map<ModeView, ModeAccessor> newViews = new HashMap<ModeView, ModeAccessor>();<NEW_LINE>for (int i = 0; i < separateModeAccessors.length; i++) {<NEW_LINE>ModeAccessor ma = separateModeAccessors[i];<NEW_LINE>ModeView mv = (ModeView) updateViewForAccessor(ma);<NEW_LINE>newViews.put(mv, ma);<NEW_LINE>}<NEW_LINE>Set<ModeView> oldViews = new HashSet<ModeView>(separateModeViews.keySet());<NEW_LINE>oldViews.removeAll(newViews.keySet());<NEW_LINE>separateModeViews.clear();<NEW_LINE>separateModeViews.putAll(newViews);<NEW_LINE>// #212590 - main window must be visible before showing child Dialogs<NEW_LINE>if (WindowManagerImpl.getInstance().getMainWindow().isVisible()) {<NEW_LINE>// Close all old views.<NEW_LINE>for (Iterator it = oldViews.iterator(); it.hasNext(); ) {<NEW_LINE>ModeView mv = (ModeView) it.next();<NEW_LINE>Component comp = mv.getComponent();<NEW_LINE>if (comp.isVisible()) {<NEW_LINE>comp.setVisible(false);<NEW_LINE>}<NEW_LINE>((<MASK><NEW_LINE>}<NEW_LINE>// Open all new views.<NEW_LINE>for (Iterator it = newViews.keySet().iterator(); it.hasNext(); ) {<NEW_LINE>ModeView mv = (ModeView) it.next();<NEW_LINE>Component comp = mv.getComponent();<NEW_LINE>// #37463, it is needed to provide a check, otherwise the window would<NEW_LINE>// get fronted each time.<NEW_LINE>if (!comp.isVisible()) {<NEW_LINE>comp.setVisible(true);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
Window) comp).dispose();
768,190
private void processType(ResolvableType type, InspectionCache cache, Consumer<TypeModel> callback) {<NEW_LINE>if (ResolvableType.NONE.equals(type) || cache.contains(type.toClass()) || !typeFilter.test(type.toClass())) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>TypeModel result = new TypeModel(type.toClass());<NEW_LINE>cache.put(result.getType(), result);<NEW_LINE>Set<Type> additionalTypes = new LinkedHashSet<>();<NEW_LINE>additionalTypes.addAll(TypeUtils.resolveTypesInSignature(type));<NEW_LINE>additionalTypes.addAll<MASK><NEW_LINE>additionalTypes.addAll(visitMethodsOfType(type, result));<NEW_LINE>additionalTypes.addAll(visitFieldsOfType(type, result));<NEW_LINE>if (result.hasDeclaredClasses()) {<NEW_LINE>additionalTypes.addAll(Arrays.asList(result.getType().getDeclaredClasses()));<NEW_LINE>}<NEW_LINE>callback.accept(result);<NEW_LINE>for (Type discoveredType : additionalTypes) {<NEW_LINE>processType(ResolvableType.forType(discoveredType, type), cache, callback);<NEW_LINE>}<NEW_LINE>}
(visitConstructorsOfType(type, result));
506,847
public void visit(AssignmentStatement statement) {<NEW_LINE>pushLocation(statement.getLocation());<NEW_LINE>if (statement.getLeftValue() != null) {<NEW_LINE>if (statement.getLeftValue() instanceof QualificationExpr) {<NEW_LINE>QualificationExpr qualification = (QualificationExpr) statement.getLeftValue();<NEW_LINE>FieldReference field = qualification.getField();<NEW_LINE>if (isMonitorField(field)) {<NEW_LINE>writer.print("TEAVM_FIELD(");<NEW_LINE>qualification.getQualified().acceptVisitor(this);<NEW_LINE>field = new FieldReference(RuntimeObject.class.getName(), "hashCode");<NEW_LINE>writer.print(", ").print(names.forClass(field.getClassName()) + ", " + names<MASK><NEW_LINE>statement.getRightValue().acceptVisitor(this);<NEW_LINE>writer.println(");");<NEW_LINE>popLocation(statement.getLocation());<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>statement.getLeftValue().acceptVisitor(this);<NEW_LINE>writer.print(" = ");<NEW_LINE>}<NEW_LINE>statement.getRightValue().acceptVisitor(this);<NEW_LINE>writer.println(";");<NEW_LINE>if (volatileDefinitions.shouldBackup(statement)) {<NEW_LINE>VariableExpr lhs = (VariableExpr) statement.getLeftValue();<NEW_LINE>spilledVariables.add(lhs.getIndex());<NEW_LINE>writer.println("teavm_spill_" + lhs.getIndex() + " = " + getVariableName(lhs.getIndex()) + ";");<NEW_LINE>}<NEW_LINE>popLocation(statement.getLocation());<NEW_LINE>}
.forMemberField(field) + ") = TEAVM_PACK_MONITOR(");
1,816,848
private List<EdgeWeightedDigraphInterface> generateDigraphsWithNotManyNegativeCycles(int digraphsOfEachConfiguration) {<NEW_LINE>int[] verticesCount = { 10, 20, 50, 100 };<NEW_LINE>// E = V * edgesMultiplier[i]<NEW_LINE>double[] edgesMultiplier = { 1, 1.5, 1.7 };<NEW_LINE>int largePercentageOfNegativeWeights = 60;<NEW_LINE>int acceptableNumberOfNegativeCycles = 10;<NEW_LINE>List<EdgeWeightedDigraphInterface> digraphsWithNotManyNegativeCycles = new ArrayList<>();<NEW_LINE>Exercise53_NegativeWeightsII.RandomEdgeWeightedDigraphsGenerator randomEdgeWeightedDigraphsGenerator = new Exercise53_NegativeWeightsII().new RandomEdgeWeightedDigraphsGenerator();<NEW_LINE>for (int vertexCountIndex = 0; vertexCountIndex < verticesCount.length; vertexCountIndex++) {<NEW_LINE>for (int edgesMultiplierIndex = 0; edgesMultiplierIndex < edgesMultiplier.length; edgesMultiplierIndex++) {<NEW_LINE>int vertices = verticesCount[vertexCountIndex];<NEW_LINE>int edges = (int) (vertices * edgesMultiplier[edgesMultiplierIndex]);<NEW_LINE>for (int digraph = 0; digraph < digraphsOfEachConfiguration; digraph++) {<NEW_LINE>// Generate one random edge weighted digraph at a time<NEW_LINE>List<EdgeWeightedDigraphInterface> randomEdgeWeightedDigraphs = randomEdgeWeightedDigraphsGenerator.randomEdgeWeightedDigraphsGenerator(1, vertices, edges, largePercentageOfNegativeWeights);<NEW_LINE>EdgeWeightedDigraphInterface <MASK><NEW_LINE>// Count negative cycles<NEW_LINE>int numberOfNegativeCycles = countNegativeCycles(randomEdgeWeightedDigraph);<NEW_LINE>if (numberOfNegativeCycles <= acceptableNumberOfNegativeCycles) {<NEW_LINE>digraphsWithNotManyNegativeCycles.add(randomEdgeWeightedDigraph);<NEW_LINE>} else {<NEW_LINE>// Too many negative cycles in the digraph. Try again.<NEW_LINE>digraph--;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return digraphsWithNotManyNegativeCycles;<NEW_LINE>}
randomEdgeWeightedDigraph = randomEdgeWeightedDigraphs.get(0);
547,355
public boolean solvePositionConstraints(SolverData data) {<NEW_LINE>Vec2 cA = <MASK><NEW_LINE>float aA = data.positions[m_indexA].a;<NEW_LINE>Vec2 cB = data.positions[m_indexB].c;<NEW_LINE>float aB = data.positions[m_indexB].a;<NEW_LINE>final Rot qA = pool.popRot();<NEW_LINE>final Rot qB = pool.popRot();<NEW_LINE>final Vec2 temp = pool.popVec2();<NEW_LINE>qA.set(aA);<NEW_LINE>qB.set(aB);<NEW_LINE>Rot.mulToOut(qA, temp.set(m_localAnchorA).subLocal(m_localCenterA), rA);<NEW_LINE>Rot.mulToOut(qB, temp.set(m_localAnchorB).subLocal(m_localCenterB), rB);<NEW_LINE>d.set(cB).subLocal(cA).addLocal(rB).subLocal(rA);<NEW_LINE>Vec2 ay = pool.popVec2();<NEW_LINE>Rot.mulToOut(qA, m_localYAxisA, ay);<NEW_LINE>float sAy = Vec2.cross(temp.set(d).addLocal(rA), ay);<NEW_LINE>float sBy = Vec2.cross(rB, ay);<NEW_LINE>float C = Vec2.dot(d, ay);<NEW_LINE>float k = m_invMassA + m_invMassB + m_invIA * m_sAy * m_sAy + m_invIB * m_sBy * m_sBy;<NEW_LINE>float impulse;<NEW_LINE>if (k != 0.0f) {<NEW_LINE>impulse = -C / k;<NEW_LINE>} else {<NEW_LINE>impulse = 0.0f;<NEW_LINE>}<NEW_LINE>final Vec2 P = pool.popVec2();<NEW_LINE>P.x = impulse * ay.x;<NEW_LINE>P.y = impulse * ay.y;<NEW_LINE>float LA = impulse * sAy;<NEW_LINE>float LB = impulse * sBy;<NEW_LINE>cA.x -= m_invMassA * P.x;<NEW_LINE>cA.y -= m_invMassA * P.y;<NEW_LINE>aA -= m_invIA * LA;<NEW_LINE>cB.x += m_invMassB * P.x;<NEW_LINE>cB.y += m_invMassB * P.y;<NEW_LINE>aB += m_invIB * LB;<NEW_LINE>pool.pushVec2(3);<NEW_LINE>pool.pushRot(2);<NEW_LINE>// data.positions[m_indexA].c = cA;<NEW_LINE>data.positions[m_indexA].a = aA;<NEW_LINE>// data.positions[m_indexB].c = cB;<NEW_LINE>data.positions[m_indexB].a = aB;<NEW_LINE>return MathUtils.abs(C) <= Settings.linearSlop;<NEW_LINE>}
data.positions[m_indexA].c;
385,499
public com.amazonaws.services.resiliencehub.model.ResourceNotFoundException unmarshallFromContext(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>com.amazonaws.services.resiliencehub.model.ResourceNotFoundException resourceNotFoundException = new com.amazonaws.services.resiliencehub.model.ResourceNotFoundException(null);<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE><MASK><NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>if (context.testExpression("resourceId", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>resourceNotFoundException.setResourceId(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("resourceType", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>resourceNotFoundException.setResourceType(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 resourceNotFoundException;<NEW_LINE>}
JsonToken token = context.getCurrentToken();
319,962
public static String constructNewName(FileObject javaFile, RenameRefactoring rename) {<NEW_LINE>final String fqn = JavaIdentifiers.getQualifiedName(javaFile);<NEW_LINE>if (isPackage(rename)) {<NEW_LINE>return rename.getNewName() + "." + JavaIdentifiers.unqualify(fqn);<NEW_LINE>}<NEW_LINE>final FileObject folder = rename.getRefactoringSource().lookup(FileObject.class);<NEW_LINE>final ClassPath classPath = ClassPath.getClassPath(folder, ClassPath.SOURCE);<NEW_LINE>if (classPath == null) {<NEW_LINE>return "";<NEW_LINE>}<NEW_LINE>final FileObject <MASK><NEW_LINE>final String prefix = FileUtil.getRelativePath(root, folder.getParent()).replace('/', '.');<NEW_LINE>final String oldName = buildName(prefix, folder.getName());<NEW_LINE>final String newName = buildName(prefix, rename.getNewName());<NEW_LINE>final int oldNameIndex = fqn.lastIndexOf(oldName) + oldName.length();<NEW_LINE>return newName + fqn.substring(oldNameIndex, fqn.length());<NEW_LINE>}
root = classPath.findOwnerRoot(folder);
1,121,783
protected void processNodePaths(Terminal terminal, Path[] dataPaths, OptionSet options, Environment env) throws IOException, UserException {<NEW_LINE>final List<String> customsToRemove = arguments.values(options);<NEW_LINE>if (customsToRemove.isEmpty()) {<NEW_LINE>throw new UserException(ExitCodes.USAGE, "Must supply at least one custom metadata name to remove");<NEW_LINE>}<NEW_LINE>final PersistedClusterStateService persistedClusterStateService = createPersistedClusterStateService(env.settings(), dataPaths);<NEW_LINE>terminal.println(Terminal.Verbosity.VERBOSE, "Loading cluster state");<NEW_LINE>final Tuple<Long, ClusterState> termAndClusterState = loadTermAndClusterState(persistedClusterStateService, env);<NEW_LINE>final ClusterState oldClusterState = termAndClusterState.v2();<NEW_LINE>terminal.println(Terminal.Verbosity.VERBOSE, "custom metadata names: " + oldClusterState.metadata().customs().keys());<NEW_LINE>final Metadata.Builder metaDataBuilder = Metadata.builder(oldClusterState.metadata());<NEW_LINE>for (String customToRemove : customsToRemove) {<NEW_LINE>boolean matched = false;<NEW_LINE>for (ObjectCursor<String> customKeyCur : oldClusterState.metadata().customs().keys()) {<NEW_LINE>final String customKey = customKeyCur.value;<NEW_LINE>if (Regex.simpleMatch(customToRemove, customKey)) {<NEW_LINE>metaDataBuilder.removeCustom(customKey);<NEW_LINE>if (matched == false) {<NEW_LINE>terminal.println("The following customs will be removed:");<NEW_LINE>}<NEW_LINE>matched = true;<NEW_LINE>terminal.println(customKey);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (matched == false) {<NEW_LINE>throw new UserException(ExitCodes.<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>final ClusterState newClusterState = ClusterState.builder(oldClusterState).metadata(metaDataBuilder.build()).build();<NEW_LINE>terminal.println(Terminal.Verbosity.VERBOSE, "[old cluster state = " + oldClusterState + ", new cluster state = " + newClusterState + "]");<NEW_LINE>confirm(terminal, CONFIRMATION_MSG);<NEW_LINE>try (PersistedClusterStateService.Writer writer = persistedClusterStateService.createWriter()) {<NEW_LINE>writer.writeFullStateAndCommit(termAndClusterState.v1(), newClusterState);<NEW_LINE>}<NEW_LINE>terminal.println(CUSTOMS_REMOVED_MSG);<NEW_LINE>}
USAGE, "No custom metadata matching [" + customToRemove + "] were found on this node");
1,370,361
public static void main(String[] args) throws InterruptedException {<NEW_LINE>// getInstance().retry("test", k -> {<NEW_LINE>// System.out.println("Requesting "+k);<NEW_LINE>// if (ThreadLocalRandom.current().nextBoolean()) {<NEW_LINE>// System.out.println("Error");<NEW_LINE>// getInstance().setError(k);<NEW_LINE>// }<NEW_LINE>// else {<NEW_LINE>// System.out.println("Success");<NEW_LINE>// getInstance().setSuccess(k);<NEW_LINE>// }<NEW_LINE>// System.out.println(getInstance().manager.debug());<NEW_LINE>// });<NEW_LINE>// getInstance().setSuccess("test");<NEW_LINE>// getInstance().forceOnce("test", k -> {<NEW_LINE>// System.out.println("Requesting "+k);<NEW_LINE>// System.out.println(getInstance().manager.debug());<NEW_LINE>// getInstance().setSuccess(k);<NEW_LINE>// System.out.println(getInstance().manager.debug());<NEW_LINE>// });<NEW_LINE>Debugging.command("retry println cbm");<NEW_LINE>getInstance().retry("test", k -> {<NEW_LINE>Timer t = new Timer(50, e -> {<NEW_LINE>System.out.println("Requesting A " + k);<NEW_LINE>if (ThreadLocalRandom.current().nextBoolean()) {<NEW_LINE>getInstance().setError(k);<NEW_LINE>} else {<NEW_LINE>System.out.println("A success");<NEW_LINE>getInstance().setSuccess(k);<NEW_LINE>}<NEW_LINE>System.out.println(getInstance().manager.debug());<NEW_LINE>});<NEW_LINE>t.setRepeats(false);<NEW_LINE>t.start();<NEW_LINE>});<NEW_LINE>getInstance().retry("test", k -> {<NEW_LINE>System.out.println("Requesting B " + k);<NEW_LINE>System.out.println(getInstance(<MASK><NEW_LINE>if (ThreadLocalRandom.current().nextBoolean()) {<NEW_LINE>getInstance().setError(k);<NEW_LINE>} else {<NEW_LINE>System.out.println("B success");<NEW_LINE>getInstance().setSuccess(k);<NEW_LINE>}<NEW_LINE>System.out.println(getInstance().manager.debug());<NEW_LINE>});<NEW_LINE>Thread.sleep(10 * 1000);<NEW_LINE>System.out.println(getInstance().manager.debug());<NEW_LINE>Thread.sleep(5000000);<NEW_LINE>}
).manager.debug());
1,146,024
private boolean nonScalarMappingEntryExists(Yaml.Mapping.Document document, Yaml.Mapping.Entry entry, String property, P p) {<NEW_LINE>AtomicBoolean exists = new AtomicBoolean(false);<NEW_LINE>String propertyToCheck = Boolean.TRUE.equals(relaxedBinding) ? NameCaseConvention.format(NameCaseConvention.LOWER_CAMEL, property) : property;<NEW_LINE>new YamlIsoVisitor<P>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public Yaml.Mapping visitMapping(Yaml.Mapping mapping, P p) {<NEW_LINE>Yaml.Mapping m = super.visitMapping(mapping, p);<NEW_LINE>if (m.getEntries().contains(entry)) {<NEW_LINE>for (Yaml.Mapping.Entry mEntry : m.getEntries()) {<NEW_LINE>if (!(mEntry.getValue() instanceof Yaml.Scalar)) {<NEW_LINE>String mKey = Boolean.TRUE.equals(relaxedBinding) ? NameCaseConvention.format(NameCaseConvention.LOWER_CAMEL, mEntry.getKey().getValue()) : mEntry.getKey().getValue();<NEW_LINE>if (propertyToCheck.startsWith(mKey)) {<NEW_LINE>exists.set(true);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return m;<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>return exists.get();<NEW_LINE>}
}.visitDocument(document, p);
470,234
private void insideAnnotationAttribute(Env env, TreePath annotationPath, Name attributeName) throws IOException {<NEW_LINE>CompilationController controller = env.getController();<NEW_LINE>controller.toPhase(Phase.ELEMENTS_RESOLVED);<NEW_LINE>Trees trees = controller.getTrees();<NEW_LINE>AnnotationTree at = (AnnotationTree) annotationPath.getLeaf();<NEW_LINE>Element annTypeElement = trees.getElement(new TreePath(annotationPath<MASK><NEW_LINE>Element el = null;<NEW_LINE>TreePath pPath = annotationPath.getParentPath();<NEW_LINE>if (pPath.getLeaf().getKind() == Tree.Kind.COMPILATION_UNIT) {<NEW_LINE>el = trees.getElement(pPath);<NEW_LINE>} else {<NEW_LINE>pPath = pPath.getParentPath();<NEW_LINE>Tree.Kind pKind = pPath.getLeaf().getKind();<NEW_LINE>if (TreeUtilities.CLASS_TREE_KINDS.contains(pKind) || pKind == Tree.Kind.METHOD || pKind == Tree.Kind.VARIABLE) {<NEW_LINE>el = trees.getElement(pPath);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (el != null && annTypeElement != null && annTypeElement.getKind() == ANNOTATION_TYPE) {<NEW_LINE>ExecutableElement memberElement = null;<NEW_LINE>for (Element e : ((TypeElement) annTypeElement).getEnclosedElements()) {<NEW_LINE>if (e.getKind() == METHOD && attributeName.contentEquals(e.getSimpleName())) {<NEW_LINE>memberElement = (ExecutableElement) e;<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (memberElement != null) {<NEW_LINE>AnnotationMirror annotation = null;<NEW_LINE>for (AnnotationMirror am : el.getAnnotationMirrors()) {<NEW_LINE>if (annTypeElement == am.getAnnotationType().asElement()) {<NEW_LINE>annotation = am;<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (annotation != null) {<NEW_LINE>addAttributeValues(env, el, annotation, memberElement);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
, at.getAnnotationType()));
382,008
private ContentValues mapStory(Map<String, Object> map, Story.FILTER filter, Integer rank) {<NEW_LINE>ContentValues storyValues = new ContentValues();<NEW_LINE>try {<NEW_LINE>String by = (String) map.get("by");<NEW_LINE>Long id = (Long) map.get("id");<NEW_LINE>String type = (String) map.get("type");<NEW_LINE>Long time = (Long) map.get("time");<NEW_LINE>Long score = (Long) map.get("score");<NEW_LINE>String title = (String) map.get("title");<NEW_LINE>String url = (String) map.get("url");<NEW_LINE>Long descendants = Long.valueOf(0);<NEW_LINE>if (map.get("descendants") != null) {<NEW_LINE>descendants = (Long) map.get("descendants");<NEW_LINE>}<NEW_LINE>storyValues.put(HNewsContract.StoryEntry.ITEM_ID, id);<NEW_LINE>storyValues.put(HNewsContract.StoryEntry.BY, by);<NEW_LINE>storyValues.put(HNewsContract.StoryEntry.TYPE, type);<NEW_LINE>storyValues.put(HNewsContract.StoryEntry.TIME_AGO, time * 1000);<NEW_LINE>storyValues.put(HNewsContract.StoryEntry.SCORE, score);<NEW_LINE>storyValues.put(HNewsContract.StoryEntry.TITLE, title);<NEW_LINE>storyValues.put(<MASK><NEW_LINE>storyValues.put(HNewsContract.StoryEntry.URL, url);<NEW_LINE>storyValues.put(HNewsContract.StoryEntry.RANK, rank);<NEW_LINE>storyValues.put(HNewsContract.StoryEntry.TIMESTAMP, System.currentTimeMillis());<NEW_LINE>storyValues.put(HNewsContract.StoryEntry.FILTER, filter.name());<NEW_LINE>} catch (Exception ex) {<NEW_LINE>Log.d(ex.getMessage());<NEW_LINE>}<NEW_LINE>return storyValues;<NEW_LINE>}
HNewsContract.StoryEntry.COMMENTS, descendants);
820,586
private void refreshDetails(@NonNull MapObject mapObject) {<NEW_LINE>refreshLatLon(mapObject);<NEW_LINE>if (mSponsored == null || mSponsored.getType() != Sponsored.TYPE_BOOKING) {<NEW_LINE>String website = mapObject.getMetadata(Metadata.MetadataType.FMD_WEBSITE);<NEW_LINE>String url = mapObject.getMetadata(Metadata.MetadataType.FMD_URL);<NEW_LINE>refreshMetadataOrHide(TextUtils.isEmpty(website) ? url : website, mWebsite, mTvWebsite);<NEW_LINE>}<NEW_LINE>refreshMetadataOrHide(mapObject.getMetadata(Metadata.MetadataType.FMD_PHONE_NUMBER), mPhone, mTvPhone);<NEW_LINE>refreshMetadataOrHide(mapObject.getMetadata(Metadata.MetadataType.FMD_EMAIL), mEmail, mTvEmail);<NEW_LINE>refreshMetadataOrHide(mapObject.getMetadata(Metadata.MetadataType.FMD_OPERATOR), mOperator, mTvOperator);<NEW_LINE>refreshMetadataOrHide(Framework.nativeGetActiveObjectFormattedCuisine(), mCuisine, mTvCuisine);<NEW_LINE>refreshMetadataOrHide(mapObject.getMetadata(Metadata.MetadataType.FMD_WIKIPEDIA), mWiki, null);<NEW_LINE>refreshMetadataOrHide(mapObject.getMetadata(Metadata.MetadataType.FMD_INTERNET), mWifi, null);<NEW_LINE>refreshMetadataOrHide(mapObject.getMetadata(Metadata.MetadataType.FMD_FLATS), mEntrance, mTvEntrance);<NEW_LINE>UiUtils.showIf(mapObject.hasMetadata(), mKeyInfo);<NEW_LINE>refreshOpeningHours(mapObject);<NEW_LINE>showTaxiOffer(mapObject);<NEW_LINE>if (RoutingController.get().isNavigating() || RoutingController.get().isPlanning()) {<NEW_LINE>UiUtils.hide(mEditPlace, mAddOrganisation, mAddPlace, mLocalAd, mEditTopSpace);<NEW_LINE>} else {<NEW_LINE>UiUtils.showIf(<MASK><NEW_LINE>UiUtils.showIf(Editor.nativeShouldShowAddBusiness(), mAddOrganisation);<NEW_LINE>UiUtils.showIf(Editor.nativeShouldShowAddPlace(), mAddPlace);<NEW_LINE>UiUtils.showIf(UiUtils.isVisible(mEditPlace) || UiUtils.isVisible(mAddOrganisation) || UiUtils.isVisible(mAddPlace), mEditTopSpace);<NEW_LINE>refreshLocalAdInfo(mapObject);<NEW_LINE>}<NEW_LINE>setPlaceDescription(mapObject);<NEW_LINE>}
Editor.nativeShouldShowEditPlace(), mEditPlace);
637,814
default CompletableFuture<Void> writeVariable(TraceThread thread, int frameLevel, Address address, byte[] data) {<NEW_LINE>if (address.isMemoryAddress()) {<NEW_LINE>return writeMemory(address, data);<NEW_LINE>}<NEW_LINE>if (address.isRegisterAddress()) {<NEW_LINE>Language lang = getTrace().getBaseLanguage();<NEW_LINE>Register register = lang.getRegister(address, data.length);<NEW_LINE>if (register == null) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>RegisterValue rv = new RegisterValue(register, Utils.bytesToBigInteger(data, data.length, lang.isBigEndian(), false));<NEW_LINE>TraceMemoryRegisterSpace regs = getTrace().getMemoryManager().getMemoryRegisterSpace(thread, frameLevel, false);<NEW_LINE>rv = TraceRegisterUtils.combineWithTraceBaseRegisterValue(rv, getSnap(), regs, true);<NEW_LINE>return writeThreadRegisters(thread, frameLevel, Map.of(rv.getRegister(), rv));<NEW_LINE>}<NEW_LINE>throw new IllegalArgumentException("Address is not in a recognized space: " + address);<NEW_LINE>}
throw new IllegalArgumentException("Cannot identify the (single) register to write: " + address);
562,147
public String importWkfModels(MetaFile metaFile, boolean isTranslate, String sourceLanguage, String targetLanguage) throws AxelorException {<NEW_LINE>if (metaFile == null) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>String extension = Files.getFileExtension(metaFile.getFileName());<NEW_LINE>if (extension == null || !extension.equals("xml")) {<NEW_LINE>throw new AxelorException(TraceBackRepository.CATEGORY_CONFIGURATION_ERROR, I18n.get(ITranslation.INVALID_WKF_MODEL_XML));<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>InputStream inputStream = getClass().getResourceAsStream(IMPORT_CONFIG_PATH);<NEW_LINE>File configFile = File.createTempFile("config", ".xml");<NEW_LINE>FileOutputStream fout = new FileOutputStream(configFile);<NEW_LINE>IOUtil.copyCompletely(inputStream, fout);<NEW_LINE>File xmlFile = MetaFiles.getPath(metaFile).toFile();<NEW_LINE>File tempDir = Files.createTempDir();<NEW_LINE>File importFile = new File(tempDir, "wkfModels.xml");<NEW_LINE>Files.copy(xmlFile, importFile);<NEW_LINE>if (isTranslate) {<NEW_LINE>importFile = this.translateNodeName(importFile, sourceLanguage, targetLanguage);<NEW_LINE>}<NEW_LINE>XMLImporter importer = new XMLImporter(configFile.getAbsolutePath(), tempDir.getAbsolutePath());<NEW_LINE>final StringBuilder log = new StringBuilder();<NEW_LINE>Listener listner = new Listener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void imported(Integer imported, Integer total) {<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void imported(Model arg0) {<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void handle(Model arg0, Exception err) {<NEW_LINE>log.append("Error in import: " + err.getStackTrace().toString());<NEW_LINE>}<NEW_LINE>};<NEW_LINE>importer.addListener(listner);<NEW_LINE>importer.run();<NEW_LINE>FileUtils.forceDelete(configFile);<NEW_LINE>FileUtils.forceDelete(tempDir);<NEW_LINE>FileUtils.forceDelete(xmlFile);<NEW_LINE>MetaFileRepository metaFileRepository = <MASK><NEW_LINE>metaFileRepository.remove(metaFile);<NEW_LINE>return log.toString();<NEW_LINE>} catch (Exception e) {<NEW_LINE>return e.getMessage();<NEW_LINE>}<NEW_LINE>}
Beans.get(MetaFileRepository.class);
1,818,366
public RuntimeHintDetails unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>RuntimeHintDetails runtimeHintDetails = new RuntimeHintDetails();<NEW_LINE><MASK><NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>if (context.testExpression("runtimeHintValues", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>runtimeHintDetails.setRuntimeHintValues(new ListUnmarshaller<RuntimeHintValue>(RuntimeHintValueJsonUnmarshaller.getInstance()).unmarshall(context));<NEW_LINE>}<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return runtimeHintDetails;<NEW_LINE>}
int originalDepth = context.getCurrentDepth();
1,574,078
public <M extends JbootModel> M joinMany(M model, ObjectFunc<M> modelValueGetter, String targetColumnName, String joinName, String[] attrs) {<NEW_LINE>if (model == null) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>Object value = modelValueGetter != null ? modelValueGetter.get(<MASK><NEW_LINE>if (value == null) {<NEW_LINE>return model;<NEW_LINE>}<NEW_LINE>List<M> list = joinManyByValue(targetColumnName, value, model);<NEW_LINE>if (list != null && !list.isEmpty()) {<NEW_LINE>joinName = StrUtil.isNotBlank(joinName) ? joinName : StrKit.firstCharToLowerCase(list.get(0).getClass().getSimpleName()) + "List";<NEW_LINE>model.put(joinName, ArrayUtil.isNotEmpty(attrs) ? keepModelListAttrs(list, attrs) : list);<NEW_LINE>}<NEW_LINE>return model;<NEW_LINE>}
model) : model._getIdValue();
396,194
public MaterialCockpitRow createIncludedRow(@NonNull final MainRowWithSubRows mainRowBucket) {<NEW_LINE>final MainRowBucketId productIdAndDate = assumeNotNull(mainRowBucket.getProductIdAndDate(), "productIdAndDate may not be null; mainRowBucket={}", mainRowBucket);<NEW_LINE>return MaterialCockpitRow.attributeSubRowBuilder().date(productIdAndDate.getDate()).productId(productIdAndDate.getProductId().getRepoId()).dimensionGroup(dimensionSpecGroup).pmmQtyPromised(getPmmQtyPromised()).qtyMaterialentnahme(getQtyMaterialentnahme()).qtyDemandPPOrder(getQtyDemandPPOrder()).qtySupplyPurchaseOrder(getQtySupplyPurchaseOrder()).qtyDemandSalesOrder(getQtyDemandSalesOrder()).qtyDemandDDOrder(getQtyDemandDDOrder()).qtyDemandSum(getQtyDemandSum()).qtySupplyPPOrder(getQtySupplyPPOrder()).qtySupplyDDOrder(getQtySupplyDDOrder()).qtySupplySum(getQtySupplySum()).qtySupplyRequired(getQtySupplyRequired()).qtySupplyToSchedule(getQtySupplyToSchedule()).qtyOnHandStock(getQtyOnHandStock()).qtyExpectedSurplus(getQtyExpectedSurplus()).allIncludedCockpitRecordIds(cockpitRecordIds).<MASK><NEW_LINE>}
allIncludedStockRecordIds(stockRecordIds).build();
1,001,653
public boolean performFinish() {<NEW_LINE>final IGithubManager ghManager = GitPlugin<MASK><NEW_LINE>final String owner = cloneSource.getOwner();<NEW_LINE>final String repoName = cloneSource.getRepoName();<NEW_LINE>// TODO Allow selecting a destination org to fork to!<NEW_LINE>// cloneSource.getOrganization();<NEW_LINE>final String organization = null;<NEW_LINE>final String dest = cloneSource.getDestination();<NEW_LINE>try {<NEW_LINE>getContainer().run(true, true, new IRunnableWithProgress() {<NEW_LINE><NEW_LINE>public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {<NEW_LINE>try {<NEW_LINE>monitor.subTask(Messages.GithubForkWizard_ForkSubTaskName);<NEW_LINE>IGithubRepository repo = ghManager.fork(owner, repoName, organization);<NEW_LINE>// Now clone the repo!<NEW_LINE>CloneJob job = new CloneJob(repo.getSSHURL(), dest);<NEW_LINE>IStatus status = job.run(monitor);<NEW_LINE>if (!status.isOK()) {<NEW_LINE>if (status instanceof ProcessStatus) {<NEW_LINE>ProcessStatus ps = (ProcessStatus) status;<NEW_LINE>String stderr = ps.getStdErr();<NEW_LINE>throw new InvocationTargetException(new CoreException(new Status(status.getSeverity(), status.getPlugin(), stderr)));<NEW_LINE>}<NEW_LINE>throw new InvocationTargetException(new CoreException(status));<NEW_LINE>}<NEW_LINE>// Add upstream remote pointing at parent!<NEW_LINE>Set<IProject> projects = job.getCreatedProjects();<NEW_LINE>if (!CollectionsUtil.isEmpty(projects)) {<NEW_LINE>monitor.subTask(Messages.GithubForkWizard_UpstreamSubTaskName);<NEW_LINE>IProject project = projects.iterator().next();<NEW_LINE>IGitRepositoryManager grManager = GitPlugin.getDefault().getGitRepositoryManager();<NEW_LINE>GitRepository clonedRepo = grManager.getAttached(project);<NEW_LINE>if (clonedRepo != null) {<NEW_LINE>IGithubRepository parentRepo = repo.getParent();<NEW_LINE>// $NON-NLS-1$<NEW_LINE>clonedRepo.addRemote("upstream", parentRepo.getSSHURL(), false);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (CoreException e) {<NEW_LINE>throw new InvocationTargetException(e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} catch (InvocationTargetException e) {<NEW_LINE>if (e.getCause() instanceof CoreException) {<NEW_LINE>CoreException ce = (CoreException) e.getCause();<NEW_LINE>MessageDialog.openError(getShell(), Messages.GithubForkWizard_FailedForkErr, ce.getMessage());<NEW_LINE>} else {<NEW_LINE>IdeLog.logError(GitUIPlugin.getDefault(), e, IDebugScopes.DEBUG);<NEW_LINE>}<NEW_LINE>} catch (InterruptedException e) {<NEW_LINE>IdeLog.logError(GitUIPlugin.getDefault(), e, IDebugScopes.DEBUG);<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>}
.getDefault().getGithubManager();
1,297,975
public static void locateFiles(final DownloadManager[] dms, final DiskManagerFileInfo[][] dm_files, Shell shell) {<NEW_LINE>if (!Utils.isSWTThread()) {<NEW_LINE>Utils.execSWTThread(() -> {<NEW_LINE>locateFiles(dms, dm_files, shell);<NEW_LINE>});<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>boolean all_bad = true;<NEW_LINE>boolean some_bad = false;<NEW_LINE>for (DownloadManager dm : dms) {<NEW_LINE>int dm_state = dm.getState();<NEW_LINE>if (!(dm_state == DownloadManager.STATE_STOPPED || dm_state == DownloadManager.STATE_ERROR)) {<NEW_LINE>some_bad = true;<NEW_LINE>} else {<NEW_LINE>all_bad = false;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (all_bad) {<NEW_LINE>MessageBoxShell mb = new MessageBoxShell(MessageText.getString("dlg.finddatafiles.title")<MASK><NEW_LINE>mb.setButtons(new String[] { MessageText.getString("Button.ok") });<NEW_LINE>mb.setIconResource("error");<NEW_LINE>mb.open((result) -> {<NEW_LINE>});<NEW_LINE>} else if (some_bad) {<NEW_LINE>MessageBoxShell mb = new MessageBoxShell(MessageText.getString("dlg.finddatafiles.title"), MessageText.getString("dlg.finddatafiles.dms.some.bad"));<NEW_LINE>mb.setButtons(0, new String[] { MessageText.getString("Button.yes"), MessageText.getString("Button.no") }, new Integer[] { 0, 1 });<NEW_LINE>mb.setIconResource("warning");<NEW_LINE>mb.open((result) -> {<NEW_LINE>if (result == 0) {<NEW_LINE>locateFilesSupport(dms, dm_files, shell);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} else {<NEW_LINE>locateFilesSupport(dms, dm_files, shell);<NEW_LINE>}<NEW_LINE>}
, MessageText.getString("dlg.finddatafiles.dms.all.bad"));
993,529
final ForkJoinTask<?>[] growArray() {<NEW_LINE>ForkJoinTask<?>[] oldA = array;<NEW_LINE>int size = oldA != null <MASK><NEW_LINE>if (size > MAXIMUM_QUEUE_CAPACITY)<NEW_LINE>throw new RejectedExecutionException("Queue capacity exceeded");<NEW_LINE>int oldMask, t, b;<NEW_LINE>ForkJoinTask<?>[] a = array = new ForkJoinTask<?>[size];<NEW_LINE>if (oldA != null && (oldMask = oldA.length - 1) >= 0 && (t = top) - (b = base) > 0) {<NEW_LINE>int mask = size - 1;<NEW_LINE>do {<NEW_LINE>// emulate poll from old array, push to new array<NEW_LINE>ForkJoinTask<?> x;<NEW_LINE>int oldj = ((b & oldMask) << ASHIFT) + ABASE;<NEW_LINE>int j = ((b & mask) << ASHIFT) + ABASE;<NEW_LINE>x = (ForkJoinTask<?>) U.getObjectVolatile(oldA, oldj);<NEW_LINE>if (x != null && U.compareAndSwapObject(oldA, oldj, x, null))<NEW_LINE>U.putObjectVolatile(a, j, x);<NEW_LINE>} while (++b != t);<NEW_LINE>}<NEW_LINE>return a;<NEW_LINE>}
? oldA.length << 1 : INITIAL_QUEUE_CAPACITY;
1,787,989
public static String formatDelay(Number data) {<NEW_LINE>if (data == null) {<NEW_LINE>return StringUtils.EMPTY;<NEW_LINE>}<NEW_LINE>long t = data.longValue();<NEW_LINE>if (t < 0) {<NEW_LINE>return String.valueOf(t);<NEW_LINE>}<NEW_LINE>int hour = 0;<NEW_LINE>int minute = 0;<NEW_LINE>while (t >= 60 * 60 * 1000) {<NEW_LINE>hour++;<NEW_LINE>t -= 60 * 60 * 1000;<NEW_LINE>}<NEW_LINE>while (t >= 60 * 1000) {<NEW_LINE>minute++;<NEW_LINE>t -= 60 * 1000;<NEW_LINE>}<NEW_LINE>List<String> result = new ArrayList<String>();<NEW_LINE>if (hour > 0) {<NEW_LINE>result.add(hour + " h");<NEW_LINE>}<NEW_LINE>if (minute > 0) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>if (t > 0) {<NEW_LINE>DecimalFormat format = new DecimalFormat(PATTERN);<NEW_LINE>result.add(format.format((t * 1.0) / 1000) + " s");<NEW_LINE>}<NEW_LINE>if (result.size() == 0) {<NEW_LINE>return "0";<NEW_LINE>}<NEW_LINE>return StringUtils.join(result, " ");<NEW_LINE>}
result.add(minute + " m");
781,424
public BDDBitVector divmod(long c, boolean which) {<NEW_LINE>if (c <= 0L) {<NEW_LINE>throw new BDDException();<NEW_LINE>}<NEW_LINE>BDDFactory bdd = getFactory();<NEW_LINE>BDDBitVector divisor = bdd.<MASK><NEW_LINE>BDDBitVector tmp = bdd.buildVector(bitvec.length, false);<NEW_LINE>BDDBitVector tmpremainder = tmp.shl(1, bitvec[bitvec.length - 1]);<NEW_LINE>BDDBitVector result = shl(1, bdd.zero());<NEW_LINE>BDDBitVector remainder;<NEW_LINE>div_rec(divisor, tmpremainder, result, divisor.bitvec.length);<NEW_LINE>remainder = tmpremainder.shr(1, bdd.zero());<NEW_LINE>tmp.free();<NEW_LINE>tmpremainder.free();<NEW_LINE>divisor.free();<NEW_LINE>if (which) {<NEW_LINE>remainder.free();<NEW_LINE>return result;<NEW_LINE>} else {<NEW_LINE>result.free();<NEW_LINE>return remainder;<NEW_LINE>}<NEW_LINE>}
constantVector(bitvec.length, c);
1,576,810
protected void onCreate(Bundle savedInstanceState) {<NEW_LINE>super.onCreate(savedInstanceState);<NEW_LINE>String url = getIntent().getStringExtra(EXTRA_URL);<NEW_LINE>if (TextUtils.isEmpty(url)) {<NEW_LINE>finish();<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>setTitle(url);<NEW_LINE>setContentView(R.layout.activity_offline_web);<NEW_LINE>final NestedScrollView scrollView = (NestedScrollView) findViewById(R.id.nested_scroll_view);<NEW_LINE>Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);<NEW_LINE>toolbar.setOnClickListener(v -> scrollView.smoothScrollTo(0, 0));<NEW_LINE>setSupportActionBar(toolbar);<NEW_LINE>getSupportActionBar().setDisplayOptions(ActionBar.DISPLAY_SHOW_HOME | ActionBar.DISPLAY_HOME_AS_UP | ActionBar.DISPLAY_SHOW_TITLE);<NEW_LINE>getSupportActionBar().setSubtitle(R.string.offline);<NEW_LINE>final ProgressBar progressBar = (ProgressBar) <MASK><NEW_LINE>final WebView webView = (WebView) findViewById(R.id.web_view);<NEW_LINE>webView.setBackgroundColor(Color.TRANSPARENT);<NEW_LINE>webView.setWebViewClient(new AdBlockWebViewClient(Preferences.adBlockEnabled(this)) {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onPageFinished(WebView view, String url) {<NEW_LINE>setTitle(view.getTitle());<NEW_LINE>}<NEW_LINE>});<NEW_LINE>webView.setWebChromeClient(new CacheableWebView.ArchiveClient() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onProgressChanged(WebView view, int newProgress) {<NEW_LINE>super.onProgressChanged(view, newProgress);<NEW_LINE>progressBar.setVisibility(View.VISIBLE);<NEW_LINE>progressBar.setProgress(newProgress);<NEW_LINE>if (newProgress == 100) {<NEW_LINE>progressBar.setVisibility(View.GONE);<NEW_LINE>webView.setBackgroundColor(Color.WHITE);<NEW_LINE>webView.setVisibility(View.VISIBLE);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>AppUtils.toggleWebViewZoom(webView.getSettings(), true);<NEW_LINE>webView.loadUrl(url);<NEW_LINE>}
findViewById(R.id.progress);
81,773
public Texture validateMaskTexture(MaskData maskData, boolean canScale) {<NEW_LINE>int pad = canScale ? 1 : 0;<NEW_LINE>int needW = maskData.getWidth() + pad + pad;<NEW_LINE>int needH = maskData.getHeight() + pad + pad;<NEW_LINE>int texW = 0, texH = 0;<NEW_LINE>if (maskTex != null) {<NEW_LINE>maskTex.lock();<NEW_LINE>if (maskTex.isSurfaceLost()) {<NEW_LINE>maskTex = null;<NEW_LINE>} else {<NEW_LINE>texW = maskTex.getContentWidth();<NEW_LINE>texH = maskTex.getContentHeight();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (maskTex == null || texW < needW || texH < needH) {<NEW_LINE>if (maskTex != null) {<NEW_LINE>flushVertexBuffer();<NEW_LINE>maskTex.dispose();<NEW_LINE>maskTex = null;<NEW_LINE>}<NEW_LINE>maskBuffer = null;<NEW_LINE>// grow the mask texture so that the new one is always<NEW_LINE>// at least as large as the previous one; this avoids<NEW_LINE>// lots of creation/disposal when the shapes alternate<NEW_LINE>// between narrow/tall and wide/short<NEW_LINE>int newTexW = Math.max(MIN_MASK_DIM, Math.max(needW, texW));<NEW_LINE>int newTexH = Math.max(MIN_MASK_DIM, Math<MASK><NEW_LINE>maskTex = getResourceFactory().createMaskTexture(newTexW, newTexH, WrapMode.CLAMP_NOT_NEEDED);<NEW_LINE>maskBuffer = ByteBuffer.allocate(newTexW * newTexH);<NEW_LINE>if (clearBuffer == null || clearBuffer.capacity() < newTexW) {<NEW_LINE>clearBuffer = null;<NEW_LINE>clearBuffer = ByteBuffer.allocate(newTexW);<NEW_LINE>}<NEW_LINE>curMaskRow = curMaskCol = nextMaskRow = highMaskCol = 0;<NEW_LINE>}<NEW_LINE>return maskTex;<NEW_LINE>}
.max(needH, texH));
542,052
public CloseResponseM2C consumerCloseClientC2M(CloseRequestC2M request, final String rmtAddress, boolean overtls) throws Exception {<NEW_LINE>StringBuilder strBuffer = new StringBuilder(512);<NEW_LINE>CloseResponseM2C.Builder builder = CloseResponseM2C.newBuilder();<NEW_LINE>builder.setSuccess(false);<NEW_LINE>CertifiedResult certResult = serverAuthHandler.identityValidUserInfo(<MASK><NEW_LINE>if (!certResult.result) {<NEW_LINE>builder.setErrCode(certResult.errCode);<NEW_LINE>builder.setErrMsg(certResult.errInfo);<NEW_LINE>return builder.build();<NEW_LINE>}<NEW_LINE>ParamCheckResult paramCheckResult = PBParameterUtils.checkClientId(request.getClientId(), strBuffer);<NEW_LINE>if (!paramCheckResult.result) {<NEW_LINE>builder.setErrCode(paramCheckResult.errCode);<NEW_LINE>builder.setErrMsg(paramCheckResult.errMsg);<NEW_LINE>return builder.build();<NEW_LINE>}<NEW_LINE>final String clientId = (String) paramCheckResult.checkData;<NEW_LINE>paramCheckResult = PBParameterUtils.checkGroupName(request.getGroupName(), strBuffer);<NEW_LINE>if (!paramCheckResult.result) {<NEW_LINE>builder.setErrCode(paramCheckResult.errCode);<NEW_LINE>builder.setErrMsg(paramCheckResult.errMsg);<NEW_LINE>return builder.build();<NEW_LINE>}<NEW_LINE>final String groupName = (String) paramCheckResult.checkData;<NEW_LINE>checkNodeStatus(clientId, strBuffer);<NEW_LINE>String nodeId = getConsumerKey(groupName, clientId);<NEW_LINE>logger.info(strBuffer.append("[Consumer Closed]").append(nodeId).append(", isOverTLS=").append(overtls).toString());<NEW_LINE>new ReleaseConsumer().run(nodeId, false);<NEW_LINE>heartbeatManager.unRegConsumerNode(nodeId);<NEW_LINE>builder.setSuccess(true);<NEW_LINE>builder.setErrCode(TErrCodeConstants.SUCCESS);<NEW_LINE>builder.setErrMsg("OK!");<NEW_LINE>return builder.build();<NEW_LINE>}
request.getAuthInfo(), false);
1,748,123
public void onViewClick(View v, FileInfo fileInfo) {<NEW_LINE>if (fileInfo.file.isFile()) {<NEW_LINE>Bundle bundle = new Bundle();<NEW_LINE>bundle.putSerializable(BundleKey.FILE_KEY, fileInfo.file);<NEW_LINE>if (DoKitFileUtil.isImage(fileInfo.file)) {<NEW_LINE><MASK><NEW_LINE>} else if (DoKitFileUtil.isDB(fileInfo.file)) {<NEW_LINE>showContent(DatabaseDetailFragment.class, bundle);<NEW_LINE>} else if (DoKitFileUtil.isVideo(fileInfo.file)) {<NEW_LINE>showContent(VideoPlayFragment.class, bundle);<NEW_LINE>} else if (DoKitFileUtil.isSp(fileInfo.file)) {<NEW_LINE>showContent(SpFragment.class, bundle);<NEW_LINE>} else {<NEW_LINE>showContent(TextDetailFragment.class, bundle);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>mCurDir = fileInfo.file;<NEW_LINE>mTitleBar.setTitle(mCurDir.getName());<NEW_LINE>setAdapterData(getFileInfos(mCurDir));<NEW_LINE>}<NEW_LINE>}
showContent(ImageDetailFragment.class, bundle);
1,516,692
public DataSet next(int num) {<NEW_LINE>if (exampleStartOffsets.size() == 0)<NEW_LINE>throw new NoSuchElementException();<NEW_LINE>int currMinibatchSize = Math.min(<MASK><NEW_LINE>// Allocate space:<NEW_LINE>// Note the order here:<NEW_LINE>// dimension 0 = number of examples in minibatch<NEW_LINE>// dimension 1 = size of each vector (i.e., number of characters)<NEW_LINE>// dimension 2 = length of each time series/example<NEW_LINE>// Why 'f' order here? See http://deeplearning4j.org/usingrnns.html#data section "Alternative: Implementing a custom DataSetIterator"<NEW_LINE>INDArray input = Nd4j.create(new int[] { currMinibatchSize, validCharacters.length, exampleLength }, 'f');<NEW_LINE>INDArray labels = Nd4j.create(new int[] { currMinibatchSize, validCharacters.length, exampleLength }, 'f');<NEW_LINE>for (int i = 0; i < currMinibatchSize; i++) {<NEW_LINE>int startIdx = exampleStartOffsets.removeFirst();<NEW_LINE>int endIdx = startIdx + exampleLength;<NEW_LINE>// Current input<NEW_LINE>int currCharIdx = charToIdxMap.get(fileCharacters[startIdx]);<NEW_LINE>int c = 0;<NEW_LINE>for (int j = startIdx + 1; j < endIdx; j++, c++) {<NEW_LINE>// Next character to predict<NEW_LINE>int nextCharIdx = charToIdxMap.get(fileCharacters[j]);<NEW_LINE>input.putScalar(new int[] { i, currCharIdx, c }, 1.0);<NEW_LINE>labels.putScalar(new int[] { i, nextCharIdx, c }, 1.0);<NEW_LINE>currCharIdx = nextCharIdx;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return new DataSet(input, labels);<NEW_LINE>}
num, exampleStartOffsets.size());
1,535,554
protected ClusterState.Builder becomeMasterAndTrimConflictingNodes(ClusterState currentState, List<Task> joiningNodes) {<NEW_LINE>assert currentState.nodes().getMasterNodeId() == null : currentState;<NEW_LINE>DiscoveryNodes currentNodes = currentState.nodes();<NEW_LINE>DiscoveryNodes.Builder nodesBuilder = DiscoveryNodes.builder(currentNodes);<NEW_LINE>nodesBuilder.masterNodeId(currentState.nodes().getLocalNodeId());<NEW_LINE>for (final Task joinTask : joiningNodes) {<NEW_LINE>if (joinTask.isBecomeMasterTask() || joinTask.isFinishElectionTask()) {<NEW_LINE>// noop<NEW_LINE>} else {<NEW_LINE>final DiscoveryNode joiningNode = joinTask.node();<NEW_LINE>final DiscoveryNode nodeWithSameId = nodesBuilder.get(joiningNode.getId());<NEW_LINE>if (nodeWithSameId != null && nodeWithSameId.equals(joiningNode) == false) {<NEW_LINE>logger.debug("removing existing node [{}], which conflicts with incoming join from [{}]", nodeWithSameId, joiningNode);<NEW_LINE>nodesBuilder.remove(nodeWithSameId.getId());<NEW_LINE>}<NEW_LINE>final DiscoveryNode nodeWithSameAddress = currentNodes.findByAddress(joiningNode.getAddress());<NEW_LINE>if (nodeWithSameAddress != null && nodeWithSameAddress.equals(joiningNode) == false) {<NEW_LINE>logger.debug("removing existing node [{}], which conflicts with incoming join from [{}]", nodeWithSameAddress, joiningNode);<NEW_LINE>nodesBuilder.remove(nodeWithSameAddress.getId());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// now trim any left over dead nodes - either left there when the previous master stepped down<NEW_LINE>// or removed by us above<NEW_LINE>ClusterState tmpState = ClusterState.builder(currentState).nodes(nodesBuilder).blocks(ClusterBlocks.builder().blocks(currentState.blocks()).removeGlobalBlock(NoMasterBlockService.NO_MASTER_BLOCK_ID)).build();<NEW_LINE>logger.trace("becomeMasterAndTrimConflictingNodes: {}", tmpState.nodes());<NEW_LINE>allocationService.cleanCaches();<NEW_LINE>return ClusterState.builder(allocationService.disassociateDeadNodes<MASK><NEW_LINE>}
(tmpState, false, "removed dead nodes on election"));
1,320,890
public static Object dialogSelectFiles(String fileExts, String currentDirectory, String buttonText, Object oldFiles, boolean multiSelect, String dialogTitle, Component parent) {<NEW_LINE>if (currentDirectory == null) {<NEW_LINE>currentDirectory = ConfigOptions.sLastDirectory;<NEW_LINE>}<NEW_LINE>fileExts = fileExts.toLowerCase();<NEW_LINE>JFileChooser chooser = new JFileChooser(currentDirectory) {<NEW_LINE><NEW_LINE>private static final long serialVersionUID = 1L;<NEW_LINE><NEW_LINE>protected void setUI(ComponentUI newUI) {<NEW_LINE>super.setUI(new FileChooserUICN(this));<NEW_LINE>}<NEW_LINE>};<NEW_LINE>chooser.setFileView(new ImageFileView());<NEW_LINE>chooser.setMultiSelectionEnabled(multiSelect);<NEW_LINE>String[] exts = fileExts.split(",");<NEW_LINE>for (int i = exts.length - 1; i >= 0; i--) {<NEW_LINE>chooser.setFileFilter(getFileFilter("." + exts[i], "*." + exts[i]));<NEW_LINE>}<NEW_LINE>if (multiSelect) {<NEW_LINE>if (oldFiles != null) {<NEW_LINE>chooser.setSelectedFiles((File[]) oldFiles);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>chooser.setSelectedFile((File) oldFiles);<NEW_LINE>}<NEW_LINE>if (StringUtils.isValidString(dialogTitle)) {<NEW_LINE>chooser.setDialogTitle(dialogTitle);<NEW_LINE>}<NEW_LINE>int r;<NEW_LINE>if (StringUtils.isValidString(buttonText)) {<NEW_LINE>r = chooser.showDialog(parent, buttonText);<NEW_LINE>} else {<NEW_LINE>r = chooser.showOpenDialog(parent);<NEW_LINE>}<NEW_LINE>if (r == JFileChooser.APPROVE_OPTION) {<NEW_LINE>ConfigOptions.sLastDirectory = chooser.getSelectedFile().getParent();<NEW_LINE>if (multiSelect) {<NEW_LINE>return chooser.getSelectedFiles();<NEW_LINE>} else {<NEW_LINE>String fileExt = chooser.getFileFilter().getDescription();<NEW_LINE>int <MASK><NEW_LINE>if (dot < 0) {<NEW_LINE>fileExt = "";<NEW_LINE>} else {<NEW_LINE>fileExt = fileExt.substring(dot);<NEW_LINE>}<NEW_LINE>String path = chooser.getSelectedFile().getAbsolutePath();<NEW_LINE>// System.out.println("PATH: " + path);<NEW_LINE>boolean fileHasExt = path.toLowerCase().endsWith(fileExt);<NEW_LINE>if (!fileHasExt && fileExt.startsWith(".")) {<NEW_LINE>File fWithExt = new File(path + fileExt);<NEW_LINE>return fWithExt;<NEW_LINE>}<NEW_LINE>// System.out.println("FILE: " +<NEW_LINE>// chooser.getSelectedFile().getName());<NEW_LINE>return chooser.getSelectedFile();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>}
dot = fileExt.indexOf(".");
1,473,171
private boolean pingLDAP(StringBuilder sb) {<NEW_LINE>Properties env = new Properties();<NEW_LINE>env.put(Context.INITIAL_CONTEXT_FACTORY, "com.sun.jndi.ldap.LdapCtxFactory");<NEW_LINE>env.<MASK><NEW_LINE>if (url != null && url.startsWith(LDAPS_URL)) {<NEW_LINE>env.put(LDAP_SOCKET_FACTORY, DEFAULT_SSL_LDAP_SOCKET_FACTORY);<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>new InitialContext(env);<NEW_LINE>appendNL(sb, lsm.getString("ldap.ok", url));<NEW_LINE>return true;<NEW_LINE>} catch (AuthenticationNotSupportedException anse) {<NEW_LINE>// CR 6944776<NEW_LINE>// If the server throws this error, it is up<NEW_LINE>// and is configured with Anonymous bind disabled.<NEW_LINE>// Ignore this error while configuring ldap for admin<NEW_LINE>appendNL(sb, lsm.getString("ldap.ok", url));<NEW_LINE>return true;<NEW_LINE>} catch (Exception e) {<NEW_LINE>appendNL(sb, lsm.getString("ldap.na", url, e.getClass().getName(), e.getMessage()));<NEW_LINE>if (logger.isLoggable(Level.FINE)) {<NEW_LINE>logger.log(Level.FINE, StringUtils.getStackTrace(e));<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>}
put(Context.PROVIDER_URL, url);
764,280
public void rmspropUpdate(NDList inputs, NDList weights, float learningRate, float weightDecay, float rescaleGrad, float clipGrad, float gamma1, float gamma2, float epsilon, boolean centered) {<NEW_LINE>MxOpParams params = new MxOpParams();<NEW_LINE>params.addParam("lr", learningRate);<NEW_LINE>params.addParam("wd", weightDecay);<NEW_LINE>params.addParam("rescale_grad", rescaleGrad);<NEW_LINE>params.addParam("clip_gradient", clipGrad);<NEW_LINE><MASK><NEW_LINE>params.addParam("epsilon", epsilon);<NEW_LINE>if (!centered) {<NEW_LINE>getManager().invoke("rmsprop_update", inputs, weights, params);<NEW_LINE>} else {<NEW_LINE>params.addParam("gamma2", gamma2);<NEW_LINE>getManager().invoke("rmspropalex_update", inputs, weights, params);<NEW_LINE>}<NEW_LINE>}
params.addParam("gamma1", gamma1);
1,334,989
private void calcMainUnknownWordToSearch() {<NEW_LINE>if (mainUnknownWordToSearch != null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>List<String> unknownSearchWords = otherUnknownWords;<NEW_LINE>mainUnknownWordToSearch = firstUnknownSearchWord;<NEW_LINE>mainUnknownSearchWordComplete = lastUnknownSearchWordComplete;<NEW_LINE>if (!unknownSearchWords.isEmpty()) {<NEW_LINE>mainUnknownSearchWordComplete = true;<NEW_LINE>List<String> searchWords = new ArrayList<>(unknownSearchWords);<NEW_LINE>searchWords.add(0, getFirstUnknownSearchWord());<NEW_LINE><MASK><NEW_LINE>for (String s : searchWords) {<NEW_LINE>if (s.length() > 0 && !LocationParser.isValidOLC(s)) {<NEW_LINE>mainUnknownWordToSearch = s.trim();<NEW_LINE>if (mainUnknownWordToSearch.endsWith(".")) {<NEW_LINE>mainUnknownWordToSearch = mainUnknownWordToSearch.substring(0, mainUnknownWordToSearch.length() - 1);<NEW_LINE>mainUnknownSearchWordComplete = false;<NEW_LINE>}<NEW_LINE>int unknownInd = unknownSearchWords.indexOf(s);<NEW_LINE>if (!lastUnknownSearchWordComplete && unknownSearchWords.size() - 1 == unknownInd) {<NEW_LINE>mainUnknownSearchWordComplete = false;<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
Collections.sort(searchWords, commonWordsComparator);
1,527,205
// rb_reg_initialize<NEW_LINE>public final RubyRegexp regexpInitialize(ByteList bytes, Encoding enc, RegexpOptions options) {<NEW_LINE>Ruby runtime = metaClass.runtime;<NEW_LINE>this.options = options;<NEW_LINE>checkFrozen();<NEW_LINE>// FIXME: Something unsets this bit, but we aren't...be more permissive until we figure this out<NEW_LINE>// if (isLiteral()) throw runtime.newSecurityError("can't modify literal regexp");<NEW_LINE>if (pattern != null)<NEW_LINE>throw runtime.newTypeError("already initialized regexp");<NEW_LINE>if (enc.isDummy())<NEW_LINE>RegexpSupport.raiseRegexpError19(runtime, bytes, enc, options, "can't make regexp with dummy encoding");<NEW_LINE>Encoding[] fixedEnc = new Encoding[] { null };<NEW_LINE>ByteList unescaped = RegexpSupport.preprocess(runtime, bytes, enc, fixedEnc, RegexpSupport.ErrorMode.RAISE);<NEW_LINE>if (fixedEnc[0] != null) {<NEW_LINE>if ((fixedEnc[0] != enc && options.isFixed()) || (fixedEnc[0] != ASCIIEncoding.INSTANCE && options.isEncodingNone())) {<NEW_LINE>RegexpSupport.raiseRegexpError19(runtime, bytes, enc, options, "incompatible character encoding");<NEW_LINE>}<NEW_LINE>if (fixedEnc[0] != ASCIIEncoding.INSTANCE) {<NEW_LINE>options.setFixed(true);<NEW_LINE>enc = fixedEnc[0];<NEW_LINE>}<NEW_LINE>} else if (!options.isFixed()) {<NEW_LINE>enc = USASCIIEncoding.INSTANCE;<NEW_LINE>}<NEW_LINE>if (fixedEnc[0] != null)<NEW_LINE>options.setFixed(true);<NEW_LINE>if (options.isEncodingNone())<NEW_LINE>setEncodingNone();<NEW_LINE>pattern = getRegexpFromCache(<MASK><NEW_LINE>assert bytes != null;<NEW_LINE>str = bytes;<NEW_LINE>return this;<NEW_LINE>}
runtime, unescaped, enc, options);
974,606
public String sqlAction_checkDependencyExists(String vendorName, String catalogName, String schemaName, String localTableName, String localColumnName, String checkColumnName, String checkCondition, String foreignTableName, String foreignColumnName) {<NEW_LINE>// SELECT COUNT(foreignColumnName) FROM foreignTableName frntbl WHERE EXISTS (SELECT 1 FROM localTableName lcltbl WHERE lcltbl.localColumnName = frntbl.foreignColumnName AND lcltbl.checkColumnName=checkCondition)<NEW_LINE>// subquery<NEW_LINE>// SELECT 1 FROM localTableName lcltbl<NEW_LINE>// WHERE lcltbl.localColumnName = frntbl.foreignColumnName AND lcltbl.checkColumnName=checkCondition<NEW_LINE>ArrayList<String> columnNames = new ArrayList<String>();<NEW_LINE>columnNames.add("1");<NEW_LINE>ArrayList<String> conditions = new ArrayList<String>();<NEW_LINE>conditions.add(new StringBuffer("lcltbl.").append(localColumnName).append("=frntbl.").append(foreignColumnName).toString());<NEW_LINE>conditions.add(new StringBuffer("lcltbl.").append(checkColumnName).append("=").append(checkCondition).toString());<NEW_LINE>String sqlSubQuery = sql_select(vendorName, catalogName, schemaName, localTableName, "lcltbl", columnNames, null, conditions, null, false);<NEW_LINE>// main query<NEW_LINE>// SELECT * FROM foreignTableName frntbl WHERE EXISTS (subquery)<NEW_LINE>conditions <MASK><NEW_LINE>conditions.add(new StringBuffer("EXISTS (").append(sqlSubQuery).append(")").toString());<NEW_LINE>String sql = sql_select(vendorName, catalogName, schemaName, foreignTableName, "frntbl", null, null, conditions, null, false);<NEW_LINE>// return value<NEW_LINE>sql = sql.replaceFirst("\\*", new StringBuffer("COUNT(").append(foreignColumnName).append(") AS NumberOfDependencies").toString());<NEW_LINE>return sql;<NEW_LINE>}
= new ArrayList<String>();
672,969
public Request<GetUserEndpointsRequest> marshall(GetUserEndpointsRequest getUserEndpointsRequest) {<NEW_LINE>if (getUserEndpointsRequest == null) {<NEW_LINE>throw new AmazonClientException("Invalid argument passed to marshall(GetUserEndpointsRequest)");<NEW_LINE>}<NEW_LINE>Request<GetUserEndpointsRequest> request = new DefaultRequest<GetUserEndpointsRequest>(getUserEndpointsRequest, "AmazonPinpoint");<NEW_LINE>request.setHttpMethod(HttpMethodName.GET);<NEW_LINE>String uriResourcePath = "/v1/apps/{application-id}/users/{user-id}";<NEW_LINE>uriResourcePath = uriResourcePath.replace("{application-id}", (getUserEndpointsRequest.getApplicationId() == null) ? "" : StringUtils.fromString(getUserEndpointsRequest.getApplicationId()));<NEW_LINE>uriResourcePath = uriResourcePath.replace("{user-id}", (getUserEndpointsRequest.getUserId() == null) ? "" : StringUtils.fromString<MASK><NEW_LINE>request.setResourcePath(uriResourcePath);<NEW_LINE>if (!request.getHeaders().containsKey("Content-Type")) {<NEW_LINE>request.addHeader("Content-Type", "application/x-amz-json-1.1");<NEW_LINE>}<NEW_LINE>return request;<NEW_LINE>}
(getUserEndpointsRequest.getUserId()));
1,703,743
public <A extends Annotation> ExpressionResult checkPermission(Class<A> annotationClass, PersistentResource resource, Set<String> requestedFields) {<NEW_LINE>Supplier<Expression> expressionSupplier = () -> {<NEW_LINE>if (NonTransferable.class == annotationClass) {<NEW_LINE>if (requestScope.getDictionary().isTransferable(resource.getResourceType())) {<NEW_LINE>return expressionBuilder.buildAnyFieldExpressions(resource, ReadPermission.class, requestedFields, null);<NEW_LINE>}<NEW_LINE>return PermissionExpressionBuilder.FAIL_EXPRESSION;<NEW_LINE>}<NEW_LINE>return expressionBuilder.buildAnyFieldExpressions(resource, annotationClass, requestedFields, null);<NEW_LINE>};<NEW_LINE>Function<Expression, ExpressionResult> expressionExecutor = (expression) -> {<NEW_LINE>// for newly created object in PatchRequest limit to User checks<NEW_LINE>if (resource.isNewlyCreated()) {<NEW_LINE>return executeUserChecksDeferInline(annotationClass, expression);<NEW_LINE>}<NEW_LINE>return executeExpressions(expression, annotationClass, Expression.EvaluationMode.INLINE_CHECKS_ONLY);<NEW_LINE>};<NEW_LINE>return checkPermissions(resource.getResourceType(), <MASK><NEW_LINE>}
annotationClass, requestedFields, expressionSupplier, expressionExecutor);
284,343
// --- end defect #217279<NEW_LINE>static KeyStroke[] showDialog() {<NEW_LINE>Object[] buttons = new Object[] { DialogDescriptor.OK_OPTION, DialogDescriptor.CANCEL_OPTION };<NEW_LINE>final ShortcutEnterPanel sepPanel = new ShortcutEnterPanel();<NEW_LINE>DialogDescriptor descriptor = new DialogDescriptor(sepPanel, sepPanel.getTitle(), true, buttons, DialogDescriptor.OK_OPTION, DialogDescriptor.DEFAULT_ALIGN, null, sepPanel.listener);<NEW_LINE>descriptor.setClosingOptions(new Object[] { DialogDescriptor<MASK><NEW_LINE>descriptor.setAdditionalOptions(sepPanel.getAdditionalOptions());<NEW_LINE>DialogDisplayer.getDefault().notify(descriptor);<NEW_LINE>String shortcut = sepPanel.getShortcutText();<NEW_LINE>if (descriptor.getValue() == DialogDescriptor.OK_OPTION && shortcut != null && shortcut.trim().length() > 0) {<NEW_LINE>// NOI18N<NEW_LINE>return WizardUtils.stringToKeyStrokes(shortcut);<NEW_LINE>} else {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>}
.OK_OPTION, DialogDescriptor.CANCEL_OPTION });
959,301
public static TotalPhysicalMemoryNotificationInfo from(CompositeData cd) {<NEW_LINE>TotalPhysicalMemoryNotificationInfo result = null;<NEW_LINE>if (cd != null) {<NEW_LINE>// Does cd meet the necessary criteria to create a new<NEW_LINE>// TotalPhysicalMemoryNotificationInfo ? If not then one of the<NEW_LINE>// following method invocations will exit on an<NEW_LINE>// IllegalArgumentException...<NEW_LINE>ManagementUtils.verifyFieldNumber(cd, 1);<NEW_LINE>// $NON-NLS-1$<NEW_LINE>String[] attributeNames = { "newTotalPhysicalMemory" };<NEW_LINE><MASK><NEW_LINE>// $NON-NLS-1$<NEW_LINE>String[] attributeTypes = { "java.lang.Long" };<NEW_LINE>ManagementUtils.verifyFieldTypes(cd, attributeNames, attributeTypes);<NEW_LINE>// Extract the values of the attributes and use them to construct<NEW_LINE>// a new TotalPhysicalMemoryNotificationInfo.<NEW_LINE>Object[] attributeVals = cd.getAll(attributeNames);<NEW_LINE>long memoryVal = ((Long) attributeVals[0]).longValue();<NEW_LINE>result = new TotalPhysicalMemoryNotificationInfo(memoryVal);<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>}
ManagementUtils.verifyFieldNames(cd, attributeNames);
794,049
public Long addNewComplexTaskOutline(ComplexTaskOutlineRecord complexTaskOutlineRecord) {<NEW_LINE>try {<NEW_LINE>List<Map<Integer, ParameterContext>> paramsBatch = new ArrayList<>();<NEW_LINE>Map<Integer, ParameterContext> params = new HashMap<>();<NEW_LINE>int index = 1;<NEW_LINE>MetaDbUtil.setParameter(index++, params, ParameterMethod.setLong, complexTaskOutlineRecord.getJob_id());<NEW_LINE>MetaDbUtil.setParameter(index++, params, ParameterMethod.setString, complexTaskOutlineRecord.getTableSchema());<NEW_LINE>MetaDbUtil.setParameter(index++, params, ParameterMethod.setString, complexTaskOutlineRecord.getTableGroupName());<NEW_LINE>MetaDbUtil.setParameter(index++, params, ParameterMethod.setString, complexTaskOutlineRecord.getObjectName());<NEW_LINE>MetaDbUtil.setParameter(index++, params, ParameterMethod.setInt, complexTaskOutlineRecord.getType());<NEW_LINE>MetaDbUtil.setParameter(index++, params, ParameterMethod.setInt, complexTaskOutlineRecord.getStatus());<NEW_LINE>MetaDbUtil.setParameter(index++, params, ParameterMethod.setString, complexTaskOutlineRecord.getExtra());<NEW_LINE>MetaDbUtil.setParameter(index++, params, ParameterMethod.setString, complexTaskOutlineRecord.getSourceSql());<NEW_LINE>MetaDbUtil.setParameter(index++, params, ParameterMethod.setInt, complexTaskOutlineRecord.getSubTask());<NEW_LINE>paramsBatch.add(params);<NEW_LINE>DdlMetaLogUtil.logSql(INSERT_COMPLEXTASK_OUTLINE, paramsBatch);<NEW_LINE>return MetaDbUtil.insertAndRetureLastInsertId(<MASK><NEW_LINE>} catch (Exception e) {<NEW_LINE>LOGGER.error("Failed to insert into the system table " + GmsSystemTables.COMPLEX_TASK_OUTLINE, e);<NEW_LINE>throw new TddlRuntimeException(ErrorCode.ERR_GMS_ACCESS_TO_SYSTEM_TABLE, e, e.getMessage());<NEW_LINE>}<NEW_LINE>}
INSERT_COMPLEXTASK_OUTLINE, paramsBatch, this.connection);
1,543,289
private void generateNewInstance(GeneratorContext context, SourceWriter writer) throws IOException {<NEW_LINE>String cls = context.getParameterName(1);<NEW_LINE>writer.append("if").ws().append("($rt_resuming())").ws().append("{").indent().softNewLine();<NEW_LINE>writer.append("var $r = $rt_nativeThread().pop();").softNewLine();<NEW_LINE>writer.append(cls + ".$$constructor$$($r);").softNewLine();<NEW_LINE>writer.append("if").ws().append("($rt_suspending())").ws().append("{").indent().softNewLine();<NEW_LINE>writer.append("return $rt_nativeThread().push($r);").softNewLine();<NEW_LINE>writer.outdent().append("}").softNewLine();<NEW_LINE>writer.append("return $r;").softNewLine();<NEW_LINE>writer.outdent().append("}").softNewLine();<NEW_LINE>writer.append("if").ws().append("(!").append(cls).append(".hasOwnProperty('$$constructor$$'))").ws().append("{").indent().softNewLine();<NEW_LINE>writer.append("return null;").softNewLine();<NEW_LINE>writer.outdent().append("}").softNewLine();<NEW_LINE>writer.append("var $r").ws().append('=').ws().append("new ").append(cls).append("();").softNewLine();<NEW_LINE>writer.append(cls).append(".$$constructor$$($r);").softNewLine();<NEW_LINE>writer.append("if").ws().append("($rt_suspending())").ws().append("{").indent().softNewLine();<NEW_LINE>writer.append("return $rt_nativeThread().push($r);").softNewLine();<NEW_LINE>writer.outdent().append("}").softNewLine();<NEW_LINE>writer.<MASK><NEW_LINE>}
append("return $r;").softNewLine();
378,414
void renderDetails(Node node) {<NEW_LINE>String name = node.getNodeName();<NEW_LINE>if (name.equals("parameters")) {<NEW_LINE>assembly.append('\n').append(indentation(this.indentLevel)).append("Parameters:\n");<NEW_LINE>indentLevel += 4;<NEW_LINE>DomUtilities.traverseChildren(node, this::renderParameter, Node.ELEMENT_NODE);<NEW_LINE>indentLevel -= 4;<NEW_LINE>} else if (name.equals("throws")) {<NEW_LINE>assembly.append('\n').append(indentation(this.indentLevel)).append("Raises:\n");<NEW_LINE>indentLevel += 4;<NEW_LINE>DomUtilities.traverseChildren(node, <MASK><NEW_LINE>indentLevel -= 4;<NEW_LINE>} else if (SECTIONS.containsKey(name)) {<NEW_LINE>String title = SECTIONS.get(name);<NEW_LINE>if (title == null)<NEW_LINE>return;<NEW_LINE>assembly.append('\n').append(indentation(this.indentLevel)).append(title).append('\n');<NEW_LINE>indentLevel += 4;<NEW_LINE>renderText(node, true, true);<NEW_LINE>indentLevel -= 4;<NEW_LINE>} else {<NEW_LINE>System.err.println("Need renderer for section " + name);<NEW_LINE>}<NEW_LINE>}
this::renderThrow, Node.ELEMENT_NODE);
1,432,821
private Mono<PagedResponse<AnomalyIncident>> listIncidentsForAlertSinglePageAsync(String alertConfigurationId, String alertId, ListIncidentsAlertedOptions options, Context context) {<NEW_LINE><MASK><NEW_LINE>Objects.requireNonNull(alertId, "'alertId' is required.");<NEW_LINE>final Context withTracing = context.addData(AZ_TRACING_NAMESPACE_KEY, METRICS_ADVISOR_TRACING_NAMESPACE_VALUE);<NEW_LINE>return service.getIncidentsFromAlertByAnomalyAlertingConfigurationSinglePageAsync(UUID.fromString(alertConfigurationId), alertId, options == null ? null : options.getSkip(), options == null ? null : options.getMaxPageSize(), withTracing).doOnRequest(ignoredValue -> logger.info("Listing incidents for alert")).doOnSuccess(response -> logger.info("Listed incidents {}", response)).doOnError(error -> logger.warning("Failed to list the incidents for alert", error)).map(response -> IncidentTransforms.fromInnerPagedResponse(response));<NEW_LINE>}
Objects.requireNonNull(alertConfigurationId, "'alertConfigurationId' is required.");
1,541,917
protected Map<String, Object> buildCustomHeaders(ServiceBusReceivedMessage message) {<NEW_LINE>Map<String, Object> headers = new HashMap<>();<NEW_LINE>// Spring MessageHeaders<NEW_LINE>setValueIfHasText(headers, MessageHeaders.ID, message.getMessageId());<NEW_LINE>setValueIfHasText(headers, MessageHeaders.CONTENT_TYPE, message.getContentType());<NEW_LINE>setValueIfHasText(headers, MessageHeaders.REPLY_CHANNEL, message.getReplyTo());<NEW_LINE>// AzureHeaders.<NEW_LINE>// Does not have SCHEDULED_ENQUEUE_MESSAGE, because it's meaningless in receiver side.<NEW_LINE>// ServiceBusMessageHeaders.<NEW_LINE>setValueIfHasText(headers, ServiceBusMessageHeaders.CORRELATION_ID, message.getCorrelationId());<NEW_LINE>setValueIfHasText(headers, ServiceBusMessageHeaders.MESSAGE_ID, message.getMessageId());<NEW_LINE>setValueIfHasText(headers, ServiceBusMessageHeaders.PARTITION_KEY, message.getPartitionKey());<NEW_LINE>setValueIfHasText(headers, ServiceBusMessageHeaders.TO, message.getTo());<NEW_LINE>setValueIfPresent(headers, ServiceBusMessageHeaders.TIME_TO_LIVE, message.getTimeToLive());<NEW_LINE>setValueIfPresent(headers, ServiceBusMessageHeaders.SCHEDULED_ENQUEUE_TIME, message.getScheduledEnqueueTime());<NEW_LINE>setValueIfHasText(headers, ServiceBusMessageHeaders.REPLY_TO_SESSION_ID, message.getReplyToSessionId());<NEW_LINE>setValueIfHasText(headers, ServiceBusMessageHeaders.<MASK><NEW_LINE>setValueIfHasText(headers, ServiceBusMessageHeaders.DEAD_LETTER_ERROR_DESCRIPTION, message.getDeadLetterErrorDescription());<NEW_LINE>setValueIfHasText(headers, ServiceBusMessageHeaders.DEAD_LETTER_REASON, message.getDeadLetterReason());<NEW_LINE>setValueIfHasText(headers, ServiceBusMessageHeaders.DEAD_LETTER_SOURCE, message.getDeadLetterSource());<NEW_LINE>setValueIfPresent(headers, ServiceBusMessageHeaders.DELIVERY_COUNT, message.getDeliveryCount());<NEW_LINE>setValueIfPresent(headers, ServiceBusMessageHeaders.ENQUEUED_SEQUENCE_NUMBER, message.getEnqueuedSequenceNumber());<NEW_LINE>setValueIfPresent(headers, ServiceBusMessageHeaders.ENQUEUED_TIME, message.getEnqueuedTime());<NEW_LINE>setValueIfPresent(headers, ServiceBusMessageHeaders.EXPIRES_AT, message.getExpiresAt());<NEW_LINE>setValueIfHasText(headers, ServiceBusMessageHeaders.LOCK_TOKEN, message.getLockToken());<NEW_LINE>setValueIfPresent(headers, ServiceBusMessageHeaders.LOCKED_UNTIL, message.getLockedUntil());<NEW_LINE>setValueIfPresent(headers, ServiceBusMessageHeaders.SEQUENCE_NUMBER, message.getSequenceNumber());<NEW_LINE>setValueIfPresent(headers, ServiceBusMessageHeaders.STATE, message.getState());<NEW_LINE>setValueIfHasText(headers, ServiceBusMessageHeaders.SUBJECT, message.getSubject());<NEW_LINE>message.getApplicationProperties().forEach(headers::putIfAbsent);<NEW_LINE>return Collections.unmodifiableMap(headers);<NEW_LINE>}
SESSION_ID, message.getSessionId());
11,979
private Versioned<Object> convertStringToObject(String key, Versioned<String> value) {<NEW_LINE>Object valueObject = null;<NEW_LINE>if (CLUSTER_KEY.equals(key)) {<NEW_LINE>valueObject = clusterMapper.readCluster(new StringReader(value.getValue()));<NEW_LINE>} else if (STORES_KEY.equals(key)) {<NEW_LINE>valueObject = storeMapper.readStoreList(new StringReader(value.getValue()));<NEW_LINE>} else if (SERVER_STATE_KEY.equals(key)) {<NEW_LINE>valueObject = VoldemortState.valueOf(value.getValue());<NEW_LINE>} else if (NODE_ID_KEY.equals(key)) {<NEW_LINE>valueObject = Integer.parseInt(value.getValue());<NEW_LINE>} else if (SLOP_STREAMING_ENABLED_KEY.equals(key) || PARTITION_STREAMING_ENABLED_KEY.equals(key) || READONLY_FETCH_ENABLED_KEY.equals(key) || QUOTA_ENFORCEMENT_ENABLED_KEY.equals(key)) {<NEW_LINE>valueObject = Boolean.parseBoolean(value.getValue());<NEW_LINE>} else if (REBALANCING_STEAL_INFO.equals(key)) {<NEW_LINE>String valueString = value.getValue();<NEW_LINE>if (valueString.startsWith("[")) {<NEW_LINE>valueObject = RebalancerState.create(valueString);<NEW_LINE>} else {<NEW_LINE>valueObject = new RebalancerState(Arrays.asList(RebalanceTaskInfo.create(valueString)));<NEW_LINE>}<NEW_LINE>} else if (REBALANCING_SOURCE_CLUSTER_XML.equals(key)) {<NEW_LINE>if (value.getValue() != null && value.getValue().length() > 0) {<NEW_LINE>valueObject = clusterMapper.readCluster(new StringReader<MASK><NEW_LINE>}<NEW_LINE>} else if (REBALANCING_SOURCE_STORES_XML.equals(key)) {<NEW_LINE>if (value.getValue() != null && value.getValue().length() > 0) {<NEW_LINE>valueObject = storeMapper.readStoreList(new StringReader(value.getValue()));<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>throw new VoldemortException("Unhandled key:'" + key + "' for String to Object serialization.");<NEW_LINE>}<NEW_LINE>return new Versioned<Object>(valueObject, value.getVersion());<NEW_LINE>}
(value.getValue()));
1,034,921
final ExecuteTransactionResult executeExecuteTransaction(ExecuteTransactionRequest executeTransactionRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(executeTransactionRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<ExecuteTransactionRequest> request = null;<NEW_LINE>Response<ExecuteTransactionResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new ExecuteTransactionRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(executeTransactionRequest));<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, "ExecuteTransaction");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<ExecuteTransactionResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new ExecuteTransactionResultJsonUnmarshaller());<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, "DynamoDB");
764,475
private static WFActivity toWFActivity(final ManufacturingJobActivity jobActivity) {<NEW_LINE>final WFActivity.WFActivityBuilder builder = WFActivity.builder().id(WFActivityId.ofId(jobActivity.getId())).caption(TranslatableStrings.anyLanguage(jobActivity.getName())).status(jobActivity.getStatus());<NEW_LINE>switch(jobActivity.getType()) {<NEW_LINE>case RawMaterialsIssue:<NEW_LINE>return builder.wfActivityType(<MASK><NEW_LINE>case RawMaterialsIssueAdjustment:<NEW_LINE>return builder.wfActivityType(RawMaterialsIssueAdjustmentActivityHandler.HANDLED_ACTIVITY_TYPE).build();<NEW_LINE>case MaterialReceipt:<NEW_LINE>return builder.wfActivityType(MaterialReceiptActivityHandler.HANDLED_ACTIVITY_TYPE).build();<NEW_LINE>case WorkReport:<NEW_LINE>return builder.wfActivityType(WorkReportActivityHandler.HANDLED_ACTIVITY_TYPE).build();<NEW_LINE>case ActivityConfirmation:<NEW_LINE>return builder.wfActivityType(ConfirmationActivityHandler.HANDLED_ACTIVITY_TYPE).build();<NEW_LINE>case GenerateHUQRCodes:<NEW_LINE>return builder.wfActivityType(GenerateHUQRCodesActivityHandler.HANDLED_ACTIVITY_TYPE).build();<NEW_LINE>case ScanScaleDevice:<NEW_LINE>return builder.wfActivityType(ScanScaleDeviceActivityHandler.HANDLED_ACTIVITY_TYPE).build();<NEW_LINE>default:<NEW_LINE>throw new AdempiereException("Unknown type: " + jobActivity);<NEW_LINE>}<NEW_LINE>}
RawMaterialsIssueActivityHandler.HANDLED_ACTIVITY_TYPE).build();
627,607
final UpdateThemePermissionsResult executeUpdateThemePermissions(UpdateThemePermissionsRequest updateThemePermissionsRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(updateThemePermissionsRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<UpdateThemePermissionsRequest> request = null;<NEW_LINE>Response<UpdateThemePermissionsResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new UpdateThemePermissionsRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(updateThemePermissionsRequest));<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, "QuickSight");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "UpdateThemePermissions");<NEW_LINE>request.<MASK><NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<UpdateThemePermissionsResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new UpdateThemePermissionsResultJsonUnmarshaller());<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);
219,280
private void init() {<NEW_LINE>facade = Overlap2DFacade.getInstance();<NEW_LINE>projectManager = facade.retrieveProxy(ProjectManager.NAME);<NEW_LINE>resourceManager = facade.retrieveProxy(ResourceManager.NAME);<NEW_LINE>UIStageMediator uiStageMediator = facade.retrieveMediator(UIStageMediator.NAME);<NEW_LINE>uiStage = uiStageMediator.getViewComponent();<NEW_LINE>sceneLoader = new SceneLoader(resourceManager);<NEW_LINE>// adding spine as external component<NEW_LINE>sceneLoader.injectExternalItemType(new SpineItemType());<NEW_LINE>// Remove Physics System and add Adjusting System for box2d objects to follow items and stop world tick<NEW_LINE>sceneLoader.engine.removeSystem(sceneLoader.engine<MASK><NEW_LINE>sceneLoader.engine.addSystem(new PhysicsAdjustSystem(sceneLoader.world));<NEW_LINE>sceneLoader.engine.getSystem(Overlap2dRenderer.class).setPhysicsOn(false);<NEW_LINE>sceneControl = new SceneControlMediator(sceneLoader);<NEW_LINE>itemControl = new ItemControlMediator(sceneControl);<NEW_LINE>selector = new ItemSelector(this);<NEW_LINE>}
.getSystem(PhysicsSystem.class));
261,128
protected void send(final JsonArray reqInvocations, final JsonObject extraJson) {<NEW_LINE>startRequest();<NEW_LINE><MASK><NEW_LINE>String csrfToken = getMessageHandler().getCsrfToken();<NEW_LINE>if (!csrfToken.equals(ApplicationConstants.CSRF_TOKEN_DEFAULT_VALUE)) {<NEW_LINE>payload.put(ApplicationConstants.CSRF_TOKEN, csrfToken);<NEW_LINE>}<NEW_LINE>payload.put(ApplicationConstants.RPC_INVOCATIONS, reqInvocations);<NEW_LINE>payload.put(ApplicationConstants.SERVER_SYNC_ID, getMessageHandler().getLastSeenServerSyncId());<NEW_LINE>payload.put(ApplicationConstants.CLIENT_TO_SERVER_ID, clientToServerMessageId++);<NEW_LINE>if (extraJson != null) {<NEW_LINE>for (String key : extraJson.keys()) {<NEW_LINE>JsonValue value = extraJson.get(key);<NEW_LINE>payload.put(key, value);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>send(payload);<NEW_LINE>}
JsonObject payload = Json.createObject();
1,619,531
protected RecoveryResponse newResponse(RecoveryRequest request, int totalShards, int successfulShards, int failedShards, List<RecoveryState> responses, List<DefaultShardOperationFailedException> shardFailures, ClusterState clusterState) {<NEW_LINE>Map<String, List<RecoveryState>> shardResponses = new HashMap<>();<NEW_LINE>for (RecoveryState recoveryState : responses) {<NEW_LINE>if (recoveryState == null) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>String indexName = recoveryState.getShardId().getIndexName();<NEW_LINE>if (shardResponses.containsKey(indexName) == false) {<NEW_LINE>shardResponses.put(indexName, new ArrayList<>());<NEW_LINE>}<NEW_LINE>if (request.activeOnly()) {<NEW_LINE>if (recoveryState.getStage() != RecoveryState.Stage.DONE) {<NEW_LINE>shardResponses.get(indexName).add(recoveryState);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>shardResponses.get(indexName).add(recoveryState);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return new RecoveryResponse(totalShards, <MASK><NEW_LINE>}
successfulShards, failedShards, shardResponses, shardFailures);
727,611
private form createPageFind(HttpServletRequest request, HttpServletResponse response, WWindowStatus ws) throws ServletException, IOException {<NEW_LINE>boolean hasValue = false;<NEW_LINE>boolean hasName = false;<NEW_LINE>boolean hasDocNo = false;<NEW_LINE>boolean hasDescription = false;<NEW_LINE>if (ws.curTab == null)<NEW_LINE>return new form();<NEW_LINE>// Get Info from target Tab<NEW_LINE>int size = ws.curTab.getFieldCount();<NEW_LINE>for (int i = 0; i < size; i++) {<NEW_LINE>GridField mField = ws.curTab.getField(i);<NEW_LINE>String columnName = mField.getColumnName();<NEW_LINE>if (mField.isDisplayed()) {<NEW_LINE>if (columnName.equals("Value"))<NEW_LINE>hasValue = true;<NEW_LINE>else if (columnName.equals("Name"))<NEW_LINE>hasName = true;<NEW_LINE>else if (columnName.equals("DocumentNo"))<NEW_LINE>hasDocNo = true;<NEW_LINE>else if (columnName.equals("Description"))<NEW_LINE>hasDescription = true;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>form myForm = new form("WWindow", form.METHOD_GET);<NEW_LINE>myForm.setName("WFind");<NEW_LINE>myForm.setID("WFind");<NEW_LINE>myForm.setClass("dialog");<NEW_LINE>myForm.addAttribute("selected", "true");<NEW_LINE>myForm.setTarget("_self");<NEW_LINE>// myForm.addElement(createTabs("Find"));<NEW_LINE>fieldset fields = new fieldset();<NEW_LINE>// table.setClass("centerTable");<NEW_LINE>h1 h = new h1("Find");<NEW_LINE>fields.addElement(h);<NEW_LINE>a a = new a("#", "Cancel");<NEW_LINE>a.addAttribute("type", "cancel");<NEW_LINE>a.setClass("button leftButton");<NEW_LINE>fields.addElement(a);<NEW_LINE>a = new a("javascript:void(1);", "Search");<NEW_LINE>a.addAttribute("type", "submit");<NEW_LINE>// iui bug workaround http://code.google.com/p/iui/issues/detail?id=80<NEW_LINE>a.addAttribute("onclick", "(function(event) {return true;})()");<NEW_LINE>a.setClass("button");<NEW_LINE>fields.addElement(a);<NEW_LINE>input line = null;<NEW_LINE>if (hasValue) {<NEW_LINE>line = new input(input.TYPE_TEXT, "txtValue", "");<NEW_LINE>line.setID("txtValue");<NEW_LINE>line.addAttribute("placeholder", Msg.translate(ws.ctx, "Value"));<NEW_LINE>fields.addElement(line);<NEW_LINE>}<NEW_LINE>if (hasDocNo) {<NEW_LINE>line = new input(input.TYPE_TEXT, "txtDocumentNo", "");<NEW_LINE>line.addAttribute("placeholder", Msg.translate(ws.ctx, "DocumentNo"));<NEW_LINE>line.setID("txtDocumentNo");<NEW_LINE>fields.addElement(line);<NEW_LINE>}<NEW_LINE>if (hasName) {<NEW_LINE>line = new input(input.TYPE_TEXT, "txtName", "");<NEW_LINE>line.addAttribute("placeholder", Msg.translate(ws.ctx, "Name"));<NEW_LINE>line.setID("txtName");<NEW_LINE>fields.addElement(line);<NEW_LINE>}<NEW_LINE>if (hasDescription) {<NEW_LINE>line = new input(input.TYPE_TEXT, "txtDescription", "");<NEW_LINE>line.addAttribute("placeholder", Msg.translate(ws.ctx, "Description"));<NEW_LINE>line.setID("txtDescription");<NEW_LINE>fields.addElement(line);<NEW_LINE>}<NEW_LINE>if (!hasDescription && !hasDocNo && !hasName && !hasValue) {<NEW_LINE>fields.addElement(new h2("N/A!"));<NEW_LINE>}<NEW_LINE>fields.addElement(new input("hidden", "txtSQL", <MASK><NEW_LINE>myForm.addElement(fields);<NEW_LINE>return myForm;<NEW_LINE>}
"FIND").setID("txtSQL"));
834,706
static byte[] decode_base64(String s, int maxolen) throws IllegalArgumentException {<NEW_LINE>StringBuilder rs = new StringBuilder();<NEW_LINE>int off = 0, slen = s.length(), olen = 0;<NEW_LINE>byte[] ret;<NEW_LINE>byte c1, c2, c3, c4, o;<NEW_LINE>if (maxolen <= 0)<NEW_LINE>throw new IllegalArgumentException("Invalid maxolen");<NEW_LINE>while (off < slen - 1 && olen < maxolen) {<NEW_LINE>c1 = char64(s.charAt(off++));<NEW_LINE>c2 = char64(s.charAt(off++));<NEW_LINE>if (c1 == -1 || c2 == -1)<NEW_LINE>break;<NEW_LINE>o = (byte) (c1 << 2);<NEW_LINE>o |= <MASK><NEW_LINE>rs.append((char) o);<NEW_LINE>if (++olen >= maxolen || off >= slen)<NEW_LINE>break;<NEW_LINE>c3 = char64(s.charAt(off++));<NEW_LINE>if (c3 == -1)<NEW_LINE>break;<NEW_LINE>o = (byte) ((c2 & 0x0f) << 4);<NEW_LINE>o |= (c3 & 0x3c) >> 2;<NEW_LINE>rs.append((char) o);<NEW_LINE>if (++olen >= maxolen || off >= slen)<NEW_LINE>break;<NEW_LINE>c4 = char64(s.charAt(off++));<NEW_LINE>o = (byte) ((c3 & 0x03) << 6);<NEW_LINE>o |= c4;<NEW_LINE>rs.append((char) o);<NEW_LINE>++olen;<NEW_LINE>}<NEW_LINE>ret = new byte[olen];<NEW_LINE>for (off = 0; off < olen; off++) ret[off] = (byte) rs.charAt(off);<NEW_LINE>return ret;<NEW_LINE>}
(c2 & 0x30) >> 4;
621,441
public void write(org.apache.thrift.protocol.TProtocol prot, create_app_options struct) throws org.apache.thrift.TException {<NEW_LINE>org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot;<NEW_LINE>java.util.BitSet optionals = new java.util.BitSet();<NEW_LINE>if (struct.isSetPartition_count()) {<NEW_LINE>optionals.set(0);<NEW_LINE>}<NEW_LINE>if (struct.isSetReplica_count()) {<NEW_LINE>optionals.set(1);<NEW_LINE>}<NEW_LINE>if (struct.isSetSuccess_if_exist()) {<NEW_LINE>optionals.set(2);<NEW_LINE>}<NEW_LINE>if (struct.isSetApp_type()) {<NEW_LINE>optionals.set(3);<NEW_LINE>}<NEW_LINE>if (struct.isSetIs_stateful()) {<NEW_LINE>optionals.set(4);<NEW_LINE>}<NEW_LINE>if (struct.isSetEnvs()) {<NEW_LINE>optionals.set(5);<NEW_LINE>}<NEW_LINE>oprot.writeBitSet(optionals, 6);<NEW_LINE>if (struct.isSetPartition_count()) {<NEW_LINE>oprot.writeI32(struct.partition_count);<NEW_LINE>}<NEW_LINE>if (struct.isSetReplica_count()) {<NEW_LINE>oprot.writeI32(struct.replica_count);<NEW_LINE>}<NEW_LINE>if (struct.isSetSuccess_if_exist()) {<NEW_LINE>oprot.writeBool(struct.success_if_exist);<NEW_LINE>}<NEW_LINE>if (struct.isSetApp_type()) {<NEW_LINE>oprot.writeString(struct.app_type);<NEW_LINE>}<NEW_LINE>if (struct.isSetIs_stateful()) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>if (struct.isSetEnvs()) {<NEW_LINE>{<NEW_LINE>oprot.writeI32(struct.envs.size());<NEW_LINE>for (java.util.Map.Entry<java.lang.String, java.lang.String> _iter5 : struct.envs.entrySet()) {<NEW_LINE>oprot.writeString(_iter5.getKey());<NEW_LINE>oprot.writeString(_iter5.getValue());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
oprot.writeBool(struct.is_stateful);
1,547,342
private void loadNode1176() {<NEW_LINE>PropertyTypeNode node = new PropertyTypeNode(this.context, Identifiers.ProgramStateMachineType_ProgramDiagnostics_CreateClientName, new QualifiedName(0, "CreateClientName"), new LocalizedText("en", "CreateClientName"), LocalizedText.NULL_VALUE, UInteger.valueOf(0), UInteger.valueOf(0), new DataValue(Variant.NULL_VALUE), Identifiers.String, -1, new UInteger[] {}, UByte.valueOf(1), UByte.valueOf<MASK><NEW_LINE>node.addReference(new Reference(Identifiers.ProgramStateMachineType_ProgramDiagnostics_CreateClientName, Identifiers.HasTypeDefinition, Identifiers.PropertyType.expanded(), true));<NEW_LINE>node.addReference(new Reference(Identifiers.ProgramStateMachineType_ProgramDiagnostics_CreateClientName, Identifiers.HasModellingRule, Identifiers.ModellingRule_Mandatory.expanded(), true));<NEW_LINE>node.addReference(new Reference(Identifiers.ProgramStateMachineType_ProgramDiagnostics_CreateClientName, Identifiers.HasProperty, Identifiers.ProgramStateMachineType_ProgramDiagnostics.expanded(), false));<NEW_LINE>this.nodeManager.addNode(node);<NEW_LINE>}
(1), 0.0, false);
1,237,677
public void run(RegressionEnvironment env) {<NEW_LINE>RegressionPath path = new RegressionPath();<NEW_LINE>env.compileDeploy("@public create context MyContext initiated by SupportBean_S0 as s0 terminated by SupportBean_S1(id=s0.id)", path);<NEW_LINE>String eplOnInit = "@name('s0') context MyContext select context.s0 as ctxs0";<NEW_LINE>env.compileDeploy(soda, eplOnInit, path).addListener("s0");<NEW_LINE>String eplOnTerm = "@name('s1') context MyContext select context.s0 as ctxs0 output when terminated";<NEW_LINE>env.compileDeploy(soda, eplOnTerm, path).addListener("s1");<NEW_LINE>SupportBean_S0 s0A = new SupportBean_S0(10, "A");<NEW_LINE>env.sendEventBean(s0A);<NEW_LINE>env.assertEqualsNew("s0", "ctxs0", s0A);<NEW_LINE>env.assertIterator("s0", iterator -> assertEquals(s0A, iterator.next().get("ctxs0")));<NEW_LINE>env.milestone(0);<NEW_LINE>SupportBean_S0 s0B <MASK><NEW_LINE>env.sendEventBean(s0B);<NEW_LINE>env.assertEqualsNew("s0", "ctxs0", s0B);<NEW_LINE>assertIterator(env, "s0", s0A, s0B);<NEW_LINE>assertIterator(env, "s1", s0A, s0B);<NEW_LINE>env.milestone(1);<NEW_LINE>env.sendEventBean(new SupportBean_S1(10, "A"));<NEW_LINE>env.assertEqualsNew("s1", "ctxs0", s0A);<NEW_LINE>assertIterator(env, "s0", s0B);<NEW_LINE>assertIterator(env, "s1", s0B);<NEW_LINE>env.milestone(2);<NEW_LINE>env.sendEventBean(new SupportBean_S1(20, "A"));<NEW_LINE>env.assertEqualsNew("s1", "ctxs0", s0B);<NEW_LINE>assertIterator(env, "s0");<NEW_LINE>assertIterator(env, "s1");<NEW_LINE>env.undeployAll();<NEW_LINE>}
= new SupportBean_S0(20, "B");
1,776,913
private void selectFile() {<NEW_LINE>JFileChooser chooser = // NOI18N<NEW_LINE>new FileChooserBuilder(Presenter.class).setFileFilter(new HtmlOrDirFilter()).// NOI18N<NEW_LINE>setAccessibleDescription(NbBundle.getMessage(ExportHtmlAction.class, "ACD_Browse_Dialog")).setTitle(// NOI18N<NEW_LINE>NbBundle.getMessage(ExportHtmlAction.class, "CTL_Browse_Dialog_Title")).createFileChooser();<NEW_LINE>// NOI18N<NEW_LINE>chooser.getAccessibleContext().setAccessibleName(NbBundle.getMessage(ExportHtmlAction.class, "ACN_Browse_Dialog"));<NEW_LINE>chooser.setSelectedFile(new File(this<MASK><NEW_LINE>if (chooser.showDialog(this, NbBundle.getMessage(ExportHtmlAction.class, "CTL_Approve_Label")) == JFileChooser.APPROVE_OPTION) {<NEW_LINE>// NOI18N<NEW_LINE>this.fileName.setText(chooser.getSelectedFile().getAbsolutePath());<NEW_LINE>}<NEW_LINE>}
.fileName.getText()));
455,176
void registerFeature(BuildProducer<FeatureBuildItem> feature, Capabilities capabilities) {<NEW_LINE>boolean isResteasyClassicAvailable = <MASK><NEW_LINE>boolean isResteasyReactiveAvailable = capabilities.isPresent(Capability.RESTEASY_REACTIVE_JSON_JACKSON);<NEW_LINE>if (!isResteasyClassicAvailable && !isResteasyReactiveAvailable) {<NEW_LINE>throw new IllegalStateException("'quarkus-narayana-lra' can only work if 'quarkus-resteasy-jackson' or 'quarkus-resteasy-reactive-jackson' is present");<NEW_LINE>}<NEW_LINE>if (!capabilities.isPresent(Capability.REST_CLIENT)) {<NEW_LINE>throw new IllegalStateException("'quarkus-narayana-lra' can only work if 'quarkus-rest-client' or 'quarkus-rest-client-reactive' is present");<NEW_LINE>}<NEW_LINE>feature.produce(new FeatureBuildItem(Feature.NARAYANA_LRA));<NEW_LINE>}
capabilities.isPresent(Capability.RESTEASY_JSON_JACKSON);