idx
int32
46
1.86M
input
stringlengths
321
6.6k
target
stringlengths
9
1.24k
217,943
public void prepare() throws Exception {<NEW_LINE>// The task ID is different for local and cluster executions<NEW_LINE>// So including that in the log can help associate the log to the run<NEW_LINE>LOG.info("Task ID is {}", mBaseParameters.mId);<NEW_LINE>// Prepare block IDs to use for this test<NEW_LINE>// We prepare the IDs before test starts so each RPC does not waste time in the conversion<NEW_LINE>Map<BlockStoreLocation, List<Long>> blockMap = RpcBenchPreparationUtils.generateBlockIdOnTiers(mParameters.mTiers);<NEW_LINE>BlockMasterClient client = new BlockMasterClient(MasterClientContext.newBuilder(ClientContext.create(<MASK><NEW_LINE>mLocationBlockIdList = client.convertBlockListMapToProto(blockMap);<NEW_LINE>// The preparation is done by the invoking shell process to ensure the preparation is only<NEW_LINE>// done once, so skip preparation when running in job worker<NEW_LINE>if (!mBaseParameters.mDistributed) {<NEW_LINE>// Prepare these block IDs concurrently<NEW_LINE>LOG.info("Preparing block IDs at the master");<NEW_LINE>RpcBenchPreparationUtils.prepareBlocksInMaster(blockMap);<NEW_LINE>LOG.info("Created all blocks at the master");<NEW_LINE>}<NEW_LINE>// Prepare simulated workers<NEW_LINE>int numWorkers = mParameters.mConcurrency;<NEW_LINE>LOG.info("Register {} simulated workers for the test", numWorkers);<NEW_LINE>mWorkerPool = RpcBenchPreparationUtils.prepareWorkerIds(client, numWorkers);<NEW_LINE>Preconditions.checkState(mWorkerPool.size() == numWorkers, "Expecting %s workers but registered %s", numWorkers, mWorkerPool.size());<NEW_LINE>RpcBenchPreparationUtils.registerWorkers(client, mWorkerPool);<NEW_LINE>LOG.info("All workers registered with the master {}", mWorkerPool);<NEW_LINE>}
mConf)).build());
762,315
public void run(FlowTrigger trigger, Map data) {<NEW_LINE>ApplianceVmVO avo = (ApplianceVmVO) chain.getData().get(ApplianceVmVO.class.getSimpleName());<NEW_LINE>final ApplianceVmInventory inv = ApplianceVmInventory.valueOf(avo);<NEW_LINE>StartNewCreatedApplianceVmMsg msg = new StartNewCreatedApplianceVmMsg();<NEW_LINE>List<VmNicSpec> <MASK><NEW_LINE>L3NetworkInventory mnL3 = L3NetworkInventory.valueOf(dbf.findByUuid(spec.getManagementNic().getL3NetworkUuid(), L3NetworkVO.class));<NEW_LINE>nicSpecs.add(new VmNicSpec(mnL3));<NEW_LINE>for (ApplianceVmNicSpec aSpec : spec.getAdditionalNics()) {<NEW_LINE>L3NetworkInventory l3 = L3NetworkInventory.valueOf(dbf.findByUuid(aSpec.getL3NetworkUuid(), L3NetworkVO.class));<NEW_LINE>nicSpecs.add(new VmNicSpec(l3));<NEW_LINE>}<NEW_LINE>msg.setL3NetworkUuids(nicSpecs);<NEW_LINE>msg.setVmInstanceInventory(inv);<NEW_LINE>msg.setApplianceVmSpec(spec);<NEW_LINE>bus.makeTargetServiceIdByResourceUuid(msg, VmInstanceConstant.SERVICE_ID, inv.getUuid());<NEW_LINE>bus.send(msg, new CloudBusCallBack(complete) {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void run(MessageReply reply) {<NEW_LINE>if (reply.isSuccess()) {<NEW_LINE>trigger.next();<NEW_LINE>} else {<NEW_LINE>trigger.fail(reply.getError());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}
nicSpecs = new ArrayList<>();
136,451
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {<NEW_LINE>String clientId = config.getValue("client.clientId", String.class);<NEW_LINE>String clientSecret = config.getValue("client.clientSecret", String.class);<NEW_LINE>JsonObject actualTokenResponse = (JsonObject) request.getSession().getAttribute("tokenResponse");<NEW_LINE>Client client = ClientBuilder.newClient();<NEW_LINE>WebTarget target = client.target(config.getValue("provider.tokenUri", String.class));<NEW_LINE>Form form = new Form();<NEW_LINE>form.param("grant_type", "refresh_token");<NEW_LINE>form.param("refresh_token"<MASK><NEW_LINE>String scope = request.getParameter("scope");<NEW_LINE>if (scope != null && !scope.isEmpty()) {<NEW_LINE>form.param("scope", scope);<NEW_LINE>}<NEW_LINE>Response jaxrsResponse = target.request(MediaType.APPLICATION_JSON_TYPE).header(HttpHeaders.AUTHORIZATION, getAuthorizationHeaderValue(clientId, clientSecret)).post(Entity.entity(form, MediaType.APPLICATION_FORM_URLENCODED_TYPE), Response.class);<NEW_LINE>JsonObject tokenResponse = jaxrsResponse.readEntity(JsonObject.class);<NEW_LINE>if (jaxrsResponse.getStatus() == 200) {<NEW_LINE>request.getSession().setAttribute("tokenResponse", tokenResponse);<NEW_LINE>} else {<NEW_LINE>request.setAttribute("error", tokenResponse.getString("error_description", "error!"));<NEW_LINE>}<NEW_LINE>dispatch("/", request, response);<NEW_LINE>}
, actualTokenResponse.getString("refresh_token"));
1,182,624
public void produceRedisClient(RedisClientRecorder recorder, BeanArchiveIndexBuildItem indexBuildItem, BuildProducer<SyntheticBeanBuildItem> syntheticBeans, VertxBuildItem vertxBuildItem) {<NEW_LINE>Set<String> clientNames = new HashSet<>();<NEW_LINE>clientNames.add(RedisClientUtil.DEFAULT_CLIENT);<NEW_LINE>IndexView indexView = indexBuildItem.getIndex();<NEW_LINE>Collection<AnnotationInstance> clientAnnotations = indexView.getAnnotations(REDIS_CLIENT_ANNOTATION);<NEW_LINE>for (AnnotationInstance annotation : clientAnnotations) {<NEW_LINE>clientNames.add(annotation.value().asString());<NEW_LINE>}<NEW_LINE>for (String clientName : clientNames) {<NEW_LINE>syntheticBeans.produce(createRedisClientSyntheticBean(recorder, clientName));<NEW_LINE>syntheticBeans.produce(createRedisReactiveClientSyntheticBean(recorder, clientName));<NEW_LINE>syntheticBeans.produce(createMutinyRedisAPISyntheticBean(recorder, clientName));<NEW_LINE>syntheticBeans.produce<MASK><NEW_LINE>syntheticBeans.produce(createRedisSyntheticBean(recorder, clientName));<NEW_LINE>syntheticBeans.produce(createRedisAPISyntheticBean(recorder, clientName));<NEW_LINE>}<NEW_LINE>}
(createMutinyRedisSyntheticBean(recorder, clientName));
483,300
public void add(int index, E element) {<NEW_LINE>ensureIsMutable();<NEW_LINE>if (index < 0 || index > size) {<NEW_LINE>throw new IndexOutOfBoundsException(makeOutOfBoundsExceptionMessage(index));<NEW_LINE>}<NEW_LINE>if (size < array.length) {<NEW_LINE>// Shift everything over to make room<NEW_LINE>System.arraycopy(array, index, array, index + 1, size - index);<NEW_LINE>} else {<NEW_LINE>// Resize to 1.5x the size<NEW_LINE>int length = ((size * 3) / 2) + 1;<NEW_LINE>E[] newArray = createArray(length);<NEW_LINE>// Copy the first part directly<NEW_LINE>System.arraycopy(array, <MASK><NEW_LINE>// Copy the rest shifted over by one to make room<NEW_LINE>System.arraycopy(array, index, newArray, index + 1, size - index);<NEW_LINE>array = newArray;<NEW_LINE>}<NEW_LINE>array[index] = element;<NEW_LINE>size++;<NEW_LINE>modCount++;<NEW_LINE>}
0, newArray, 0, index);
509,143
public UnsuccessfulInstanceCreditSpecificationItem unmarshall(StaxUnmarshallerContext context) throws Exception {<NEW_LINE>UnsuccessfulInstanceCreditSpecificationItem unsuccessfulInstanceCreditSpecificationItem = new UnsuccessfulInstanceCreditSpecificationItem();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>if (context.isStartOfDocument())<NEW_LINE>targetDepth += 1;<NEW_LINE>while (true) {<NEW_LINE>XMLEvent xmlEvent = context.nextEvent();<NEW_LINE>if (xmlEvent.isEndDocument())<NEW_LINE>return unsuccessfulInstanceCreditSpecificationItem;<NEW_LINE>if (xmlEvent.isAttribute() || xmlEvent.isStartElement()) {<NEW_LINE>if (context.testExpression("instanceId", targetDepth)) {<NEW_LINE>unsuccessfulInstanceCreditSpecificationItem.setInstanceId(StringStaxUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (context.testExpression("error", targetDepth)) {<NEW_LINE>unsuccessfulInstanceCreditSpecificationItem.setError(UnsuccessfulInstanceCreditSpecificationItemErrorStaxUnmarshaller.getInstance<MASK><NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>} else if (xmlEvent.isEndElement()) {<NEW_LINE>if (context.getCurrentDepth() < originalDepth) {<NEW_LINE>return unsuccessfulInstanceCreditSpecificationItem;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
().unmarshall(context));
1,755,350
public Response addTopLevelGroup(GroupRepresentation rep) {<NEW_LINE>auth.groups().requireManage();<NEW_LINE>GroupModel child;<NEW_LINE>Response.ResponseBuilder builder = Response.status(204);<NEW_LINE>String groupName = rep.getName();<NEW_LINE>if (ObjectUtil.isBlank(groupName)) {<NEW_LINE>return ErrorResponse.error("Group name is missing", Response.Status.BAD_REQUEST);<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>if (rep.getId() != null) {<NEW_LINE>child = realm.getGroupById(rep.getId());<NEW_LINE>if (child == null) {<NEW_LINE>throw new NotFoundException("Could not find child by id");<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>adminEvent.operation(OperationType.UPDATE).resourcePath(session.getContext().getUri());<NEW_LINE>} else {<NEW_LINE>child = realm.createGroup(groupName);<NEW_LINE>GroupResource.updateGroup(rep, child);<NEW_LINE>URI uri = session.getContext().getUri().getAbsolutePathBuilder().path(child.getId()).build();<NEW_LINE>builder.status(201).location(uri);<NEW_LINE>rep.setId(child.getId());<NEW_LINE>adminEvent.operation(OperationType.CREATE).resourcePath(session.getContext().getUri(), child.getId());<NEW_LINE>}<NEW_LINE>} catch (ModelDuplicateException mde) {<NEW_LINE>return ErrorResponse.exists("Top level group named '" + groupName + "' already exists.");<NEW_LINE>}<NEW_LINE>adminEvent.representation(rep).success();<NEW_LINE>return builder.build();<NEW_LINE>}
realm.moveGroup(child, null);
501,388
public byte[] encrypt(byte[] key, byte[] data) {<NEW_LINE>if (key == null) {<NEW_LINE>LOGGER.severe(Common.addTag("Key is null"));<NEW_LINE>return new byte[0];<NEW_LINE>}<NEW_LINE>if (data == null) {<NEW_LINE>LOGGER.severe(Common.addTag("data is null"));<NEW_LINE>return new byte[0];<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>byte[] iVec = new byte[I_VEC_LEN];<NEW_LINE>SecureRandom secureRandom = Common.getSecureRandom();<NEW_LINE>secureRandom.nextBytes(iVec);<NEW_LINE>SecretKeySpec skeySpec <MASK><NEW_LINE>Cipher cipher = Cipher.getInstance(cipherMod);<NEW_LINE>IvParameterSpec iv = new IvParameterSpec(iVec);<NEW_LINE>cipher.init(Cipher.ENCRYPT_MODE, skeySpec, iv);<NEW_LINE>byte[] encrypted = cipher.doFinal(data);<NEW_LINE>byte[] encryptedAddIv = new byte[encrypted.length + iVec.length];<NEW_LINE>System.arraycopy(iVec, 0, encryptedAddIv, 0, iVec.length);<NEW_LINE>System.arraycopy(encrypted, 0, encryptedAddIv, iVec.length, encrypted.length);<NEW_LINE>return encryptedAddIv;<NEW_LINE>} catch (NoSuchAlgorithmException | NoSuchPaddingException | InvalidKeyException | InvalidAlgorithmParameterException | IllegalBlockSizeException | BadPaddingException ex) {<NEW_LINE>LOGGER.severe(Common.addTag("catch NoSuchAlgorithmException or " + "NoSuchPaddingException or InvalidKeyException or InvalidAlgorithmParameterException or " + "IllegalBlockSizeException or BadPaddingException: " + ex.getMessage()));<NEW_LINE>return new byte[0];<NEW_LINE>}<NEW_LINE>}
= new SecretKeySpec(key, ALGORITHM);
131,897
public boolean clearAccounting(MAcctSchema accountSchema, I_M_CostType costType, PO model, int productId, Timestamp dateAcct) {<NEW_LINE>// check if costing type need reset accounting<NEW_LINE>if (!accountSchema.getCostingMethod().equals(costType.getCostingMethod())) {<NEW_LINE>MProduct product = MProduct.get(accountSchema.getCtx(), productId);<NEW_LINE>MProductCategoryAcct productCategoryAcct = MProductCategoryAcct.get(accountSchema.getCtx(), product.getM_Product_Category_ID(), accountSchema.get_ID(<MASK><NEW_LINE>if (productCategoryAcct == null || !costType.getCostingMethod().equals(productCategoryAcct.getCostingMethod()))<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>final String docBaseType;<NEW_LINE>// check if account period is open<NEW_LINE>if (model instanceof MMatchInv)<NEW_LINE>docBaseType = MPeriodControl.DOCBASETYPE_MatchInvoice;<NEW_LINE>else if (model instanceof MMatchPO)<NEW_LINE>docBaseType = MPeriodControl.DOCBASETYPE_MatchPO;<NEW_LINE>else if (model instanceof MProduction)<NEW_LINE>docBaseType = MPeriodControl.DOCBASETYPE_MaterialProduction;<NEW_LINE>else {<NEW_LINE>MDocType docType = MDocType.get(model.getCtx(), model.get_ValueAsInt(MDocType.COLUMNNAME_C_DocType_ID));<NEW_LINE>docBaseType = docType.getDocBaseType();<NEW_LINE>}<NEW_LINE>Boolean openPeriod = MPeriod.isOpen(model.getCtx(), dateAcct, docBaseType, model.getAD_Org_ID());<NEW_LINE>if (!openPeriod) {<NEW_LINE>System.out.println("Period closed.");<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>final String sqlUpdate = "UPDATE " + model.get_TableName() + " SET Posted = 'N' WHERE " + model.get_TableName() + "_ID=?";<NEW_LINE>DB.executeUpdate(sqlUpdate, new Object[] { model.get_ID() }, false, model.get_TrxName());<NEW_LINE>// Delete account<NEW_LINE>final String sqldelete = "DELETE FROM Fact_Acct WHERE Record_ID =? AND AD_Table_ID=?";<NEW_LINE>DB.executeUpdate(sqldelete, new Object[] { model.get_ID(), model.get_Table_ID() }, false, model.get_TrxName());<NEW_LINE>return true;<NEW_LINE>}
), model.get_TrxName());
1,095,958
private void addJumpValue(int from, int target) {<NEW_LINE>if (DEBUG) {<NEW_LINE>System.out.println("Set jump entry at " + methodName + ":" + target + " pc to " + stack + " : " + lvValues);<NEW_LINE>}<NEW_LINE>if (from >= target) {<NEW_LINE>backwardsBranch = true;<NEW_LINE>}<NEW_LINE>List<Item> atTarget = jumpEntries.get(Integer.valueOf(target));<NEW_LINE>if (atTarget == null) {<NEW_LINE>setJumpInfoChangedByBackwardBranch("new target", from, target);<NEW_LINE>setJumpInfoChangedByNewTarget();<NEW_LINE>jumpEntries.put(Integer.valueOf(target), new ArrayList<Item>(lvValues));<NEW_LINE>jumpEntryLocations.set(target);<NEW_LINE>if (stack.size() > 0) {<NEW_LINE>jumpStackEntries.put(Integer.valueOf(target), new ArrayList<Item>(stack));<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>if (mergeLists(atTarget, lvValues, false)) {<NEW_LINE>setJumpInfoChangedByBackwardBranch("locals", from, target);<NEW_LINE>}<NEW_LINE>List<Item> stackAtTarget = jumpStackEntries.get(Integer.valueOf(target));<NEW_LINE>if (stack.size() > 0 && stackAtTarget != null) {<NEW_LINE>if (mergeLists(stackAtTarget, stack, false)) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
setJumpInfoChangedByBackwardBranch("stack", from, target);
128,578
public static String encodedDigest(String code_verifier, String algorithm, String charset) {<NEW_LINE>MessageDigest md;<NEW_LINE>String output = null;<NEW_LINE>if (code_verifier != null && code_verifier.length() > 0) {<NEW_LINE>try {<NEW_LINE>md = MessageDigest.getInstance(algorithm);<NEW_LINE>md.update(code_verifier.getBytes(charset));<NEW_LINE>output = convertToBase64(md.digest());<NEW_LINE>} catch (NoSuchAlgorithmException nsae) {<NEW_LINE>if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {<NEW_LINE>Tr.debug(tc, "Exception instanciating MessageDigest. The algorithm is " + algorithm + nsae);<NEW_LINE>}<NEW_LINE>throw new RuntimeException("Exception instantiating MessageDigest : " + nsae);<NEW_LINE>} catch (UnsupportedEncodingException uee) {<NEW_LINE>if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {<NEW_LINE>Tr.debug(tc, "Exception converting String object : " + uee);<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>return output;<NEW_LINE>}
throw new RuntimeException("Exception converting String object : " + uee);
923,120
private int init() throws IOException {<NEW_LINE>if (null == fileChannel) {<NEW_LINE>if (!segmentFile.exists()) {<NEW_LINE>if (epochClock.time() > connectDeadlineMs) {<NEW_LINE>onError("recording segment not found " + segmentFile);<NEW_LINE>}<NEW_LINE>return 0;<NEW_LINE>} else {<NEW_LINE>final long startTermBasePosition = startPosition - (startPosition & (termLength - 1));<NEW_LINE>final int segmentOffset = (int) ((replayPosition - startTermBasePosition) & (segmentLength - 1));<NEW_LINE>final int termId = LogBufferDescriptor.computeTermIdFromPosition(replayPosition, publication.positionBitsToShift(), publication.initialTermId());<NEW_LINE>openRecordingSegment();<NEW_LINE>termOffset = (int) (<MASK><NEW_LINE>termBaseSegmentOffset = segmentOffset - termOffset;<NEW_LINE>if (replayPosition > startPosition && replayPosition != stopPosition) {<NEW_LINE>if (notHeaderAligned(fileChannel, replayBuffer, segmentOffset, termOffset, termId, streamId)) {<NEW_LINE>onError(replayPosition + " position not aligned to a data header");<NEW_LINE>return 0;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (!publication.isConnected()) {<NEW_LINE>if (epochClock.time() > connectDeadlineMs) {<NEW_LINE>onError("no connection established for replay");<NEW_LINE>}<NEW_LINE>return 0;<NEW_LINE>}<NEW_LINE>state(State.REPLAY);<NEW_LINE>return 1;<NEW_LINE>}
replayPosition & (termLength - 1));
1,286,903
public <RET extends List<?>> RET objectCommand(String iCommand, Object... iArgs) {<NEW_LINE>checkOpenness();<NEW_LINE>convertParameters(iArgs);<NEW_LINE>final OResultSet result = underlying.command(iCommand, iArgs);<NEW_LINE>if (result == null)<NEW_LINE>return null;<NEW_LINE>try {<NEW_LINE>final List<Object> resultPojo = new ArrayList<Object>();<NEW_LINE>Object obj;<NEW_LINE>while (result.hasNext()) {<NEW_LINE>OResult doc = result.next();<NEW_LINE>if (doc.isElement()) {<NEW_LINE>// GET THE ASSOCIATED DOCUMENT<NEW_LINE>OElement elem = doc<MASK><NEW_LINE>if (elem.getSchemaType().isPresent())<NEW_LINE>obj = getUserObjectByRecord(elem, null, true);<NEW_LINE>else<NEW_LINE>obj = elem;<NEW_LINE>resultPojo.add(obj);<NEW_LINE>} else {<NEW_LINE>resultPojo.add(doc);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return (RET) resultPojo;<NEW_LINE>} finally {<NEW_LINE>result.close();<NEW_LINE>}<NEW_LINE>}
.getElement().get();
220,231
private void initSwitchLineAction() {<NEW_LINE>final KeyStroke keyLinesDown = KeyStroke.getKeyStroke(KeyEvent.VK_DOWN, Event.SHIFT_MASK);<NEW_LINE>final KeyStroke keyLinesUp = KeyStroke.getKeyStroke(KeyEvent.VK_UP, Event.SHIFT_MASK);<NEW_LINE>aSwitchLinesDownAction = new SwitchAction("switchLinesDown", keyLinesDown, this);<NEW_LINE>aSwitchLinesUpAction = new SwitchAction("switchLinesUp", keyLinesUp, this);<NEW_LINE>final JTable table = m_curGC.getTable();<NEW_LINE>table.getInputMap(CPanel.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT<MASK><NEW_LINE>table.getInputMap(CPanel.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT).put(keyLinesUp, "none");<NEW_LINE>table.getInputMap(CPanel.WHEN_FOCUSED).put(keyLinesDown, "none");<NEW_LINE>table.getInputMap(CPanel.WHEN_FOCUSED).put(keyLinesUp, "none");<NEW_LINE>getInputMap(CPanel.WHEN_IN_FOCUSED_WINDOW).put(keyLinesDown, aSwitchLinesDownAction.getName());<NEW_LINE>getActionMap().put(aSwitchLinesDownAction.getName(), aSwitchLinesDownAction);<NEW_LINE>getInputMap(CPanel.WHEN_IN_FOCUSED_WINDOW).put(keyLinesUp, aSwitchLinesUpAction.getName());<NEW_LINE>getActionMap().put(aSwitchLinesUpAction.getName(), aSwitchLinesUpAction);<NEW_LINE>}
).put(keyLinesDown, "none");
186,371
public CreateStreamingImageResult unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>CreateStreamingImageResult createStreamingImageResult = new CreateStreamingImageResult();<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 createStreamingImageResult;<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("streamingImage", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>createStreamingImageResult.setStreamingImage(StreamingImageJsonUnmarshaller.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 createStreamingImageResult;<NEW_LINE>}
JsonToken token = context.getCurrentToken();
336,498
private void loadColumnsStrategies() {<NEW_LINE>JPanel strategiesPanel = new JPanel();<NEW_LINE>strategiesPanel.setLayout(new MigLayout("fillx"));<NEW_LINE>if (duplicateGroups != null && duplicateGroups.size() > 0) {<NEW_LINE>strategiesPanel.add(new JLabel(NbBundle.getMessage(MergeNodeDuplicatesUI.class, "MergeNodeDuplicatesUI.duplicateGroupsNumber", duplicateGroups.size())), "wrap 15px");<NEW_LINE>// Use first group of duplicated nodes to set strategies for all of them<NEW_LINE>List<Node> // Use first group of duplicated nodes to set strategies for all of them<NEW_LINE><MASK><NEW_LINE>// Prepare node rows:<NEW_LINE>rows = new Element[nodes.size()];<NEW_LINE>for (int i = 0; i < nodes.size(); i++) {<NEW_LINE>rows[i] = nodes.get(i);<NEW_LINE>}<NEW_LINE>strategiesConfigurationButtons = new StrategyConfigurationButton[columns.length];<NEW_LINE>strategiesComboBoxes = new StrategyComboBox[columns.length];<NEW_LINE>for (int i = 0; i < columns.length; i++) {<NEW_LINE>// Strategy information label:<NEW_LINE>StrategyInfoLabel infoLabel = new StrategyInfoLabel(i);<NEW_LINE>// Strategy configuration button:<NEW_LINE>strategiesConfigurationButtons[i] = new StrategyConfigurationButton(i);<NEW_LINE>// Strategy selection:<NEW_LINE>StrategyComboBox strategyComboBox = new StrategyComboBox(strategiesConfigurationButtons[i], infoLabel);<NEW_LINE>strategiesComboBoxes[i] = strategyComboBox;<NEW_LINE>for (AttributeRowsMergeStrategy strategy : getColumnAvailableStrategies(columns[i])) {<NEW_LINE>strategyComboBox.addItem(new StrategyWrapper(strategy));<NEW_LINE>}<NEW_LINE>strategyComboBox.refresh();<NEW_LINE>strategiesPanel.add(new JLabel(columns[i].getTitle() + ": "), "wrap");<NEW_LINE>strategiesPanel.add(infoLabel, "split 3");<NEW_LINE>strategiesPanel.add(strategiesConfigurationButtons[i]);<NEW_LINE>strategiesPanel.add(strategyComboBox, "growx, wrap 15px");<NEW_LINE>}<NEW_LINE>dialogControls.setOkButtonEnabled(true);<NEW_LINE>} else {<NEW_LINE>strategiesPanel.add(new JLabel(getMessage("MergeNodeDuplicatesUI.noDuplicatesText")));<NEW_LINE>dialogControls.setOkButtonEnabled(false);<NEW_LINE>}<NEW_LINE>scrollStrategies.setViewportView(strategiesPanel);<NEW_LINE>}
nodes = duplicateGroups.get(0);
720,070
public static // the given uri. Defaults to mpeg video for indeterminate local uris.<NEW_LINE>DLNAResource autoMatch(String uri, String name) {<NEW_LINE>try {<NEW_LINE>uri = URLDecoder.decode(uri, "UTF-8");<NEW_LINE>} catch (UnsupportedEncodingException e) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>boolean isweb = uri.matches("\\S+://.+");<NEW_LINE>Format format = FormatFactory.getAssociatedFormat(isweb ? "." + FileUtil.getUrlExtension(uri) : uri);<NEW_LINE>int type = format == null ? Format.VIDEO : format.getType();<NEW_LINE>if (name == null) {<NEW_LINE>name = new File(StringUtils.substringBefore(uri, "?")).getName();<NEW_LINE>}<NEW_LINE>DLNAResource resource = isweb ? type == Format.VIDEO ? new WebVideoStream(name, uri, null) : type == Format.AUDIO ? new WebAudioStream(name, uri, null) : type == Format.IMAGE ? new FeedItem(name, uri, null, null, Format.IMAGE) : null : new RealFile(new File(uri));<NEW_LINE>if (resource != null && format == null && !isweb) {<NEW_LINE>resource.setFormat(FormatFactory.getAssociatedFormat(".mpg"));<NEW_LINE>}<NEW_LINE>LOGGER.debug(resource == null ? ("Could not auto-match " + uri) : ("Created auto-matched container: " + resource));<NEW_LINE>return resource;<NEW_LINE>}
LOGGER.error("URL decoding error ", e);
168,370
public void printResponseParts(Object response, String testName, String additionalMessage) throws Exception {<NEW_LINE>Log.info(thisClass, testName, StringUtils.center(" Start Response Content ", 150, PRINT_DELIMITER_REQUEST_PARTS));<NEW_LINE>if (response == null) {<NEW_LINE>Log.<MASK><NEW_LINE>return;<NEW_LINE>}<NEW_LINE>printResponseClass(response, testName);<NEW_LINE>try {<NEW_LINE>if (additionalMessage != null) {<NEW_LINE>Log.info(thisClass, testName, additionalMessage);<NEW_LINE>}<NEW_LINE>printResponseStatusCode(response, testName);<NEW_LINE>printResponseTitle(response, testName);<NEW_LINE>printResponseUrl(response, testName);<NEW_LINE>printResponseHeaders(response, testName);<NEW_LINE>printResponseMessage(response, testName);<NEW_LINE>printResponseText(response, testName);<NEW_LINE>} catch (Exception e) {<NEW_LINE>e.printStackTrace();<NEW_LINE>Log.error(thisClass, testName, e, "Error printing response (log error and go on)");<NEW_LINE>}<NEW_LINE>Log.info(thisClass, testName, StringUtils.center(" End Response Content ", 150, PRINT_DELIMITER_REQUEST_PARTS));<NEW_LINE>}
info(thisClass, testName, "The response is null - nothing to print");
452,492
public void run(RegressionEnvironment env) {<NEW_LINE>String[] fields = "a_string,b_string,c_string,d_string".split(",");<NEW_LINE>String text = "@name('s0') select * from SupportRecogBean#keepall " + "match_recognize (" + " measures A.theString as a_string, B.theString as b_string, C.theString as c_string, D.theString as d_string " + " all matches pattern ( (A | B) (C | D) ) " + " define " + " A as (A.value = 1)," + " B as (B.value = 2)," + " C as (C.value = 3)," + " D as (D.value = 4)" + ")";<NEW_LINE>env.compileDeploy<MASK><NEW_LINE>env.sendEventBean(new SupportRecogBean("E1", 3));<NEW_LINE>env.sendEventBean(new SupportRecogBean("E2", 1));<NEW_LINE>env.sendEventBean(new SupportRecogBean("E3", 2));<NEW_LINE>env.sendEventBean(new SupportRecogBean("E4", 5));<NEW_LINE>env.sendEventBean(new SupportRecogBean("E5", 1));<NEW_LINE>env.assertListenerNotInvoked("s0");<NEW_LINE>env.assertIterator("s0", it -> assertFalse(it.hasNext()));<NEW_LINE>env.milestone(0);<NEW_LINE>env.sendEventBean(new SupportRecogBean("E6", 3));<NEW_LINE>env.assertPropsPerRowLastNew("s0", fields, new Object[][] { { "E5", null, "E6", null } });<NEW_LINE>env.assertPropsPerRowIterator("s0", fields, new Object[][] { { "E5", null, "E6", null } });<NEW_LINE>env.milestone(1);<NEW_LINE>env.sendEventBean(new SupportRecogBean("E7", 2));<NEW_LINE>env.sendEventBean(new SupportRecogBean("E8", 3));<NEW_LINE>env.assertPropsPerRowLastNew("s0", fields, new Object[][] { { null, "E7", "E8", null } });<NEW_LINE>env.assertPropsPerRowIterator("s0", fields, new Object[][] { { "E5", null, "E6", null }, { null, "E7", "E8", null } });<NEW_LINE>env.undeployAll();<NEW_LINE>}
(text).addListener("s0");
890,830
final AssociatePrincipalWithPortfolioResult executeAssociatePrincipalWithPortfolio(AssociatePrincipalWithPortfolioRequest associatePrincipalWithPortfolioRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(associatePrincipalWithPortfolioRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<AssociatePrincipalWithPortfolioRequest> request = null;<NEW_LINE>Response<AssociatePrincipalWithPortfolioResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new AssociatePrincipalWithPortfolioRequestProtocolMarshaller(protocolFactory).marshall<MASK><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, "Service Catalog");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "AssociatePrincipalWithPortfolio");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<AssociatePrincipalWithPortfolioResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new AssociatePrincipalWithPortfolioResultJsonUnmarshaller());<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>}
(super.beforeMarshalling(associatePrincipalWithPortfolioRequest));
993,742
private void doChangePlan(final DefaultSubscriptionBase subscription, final EntitlementSpecifier spec, final DateTime effectiveDate, final CallContext context) throws SubscriptionBaseApiException, CatalogApiException {<NEW_LINE>final InternalCallContext internalCallContext = createCallContextFromBundleId(subscription.getBundleId(), context);<NEW_LINE>final PlanPhasePriceOverridesWithCallContext overridesWithContext = new DefaultPlanPhasePriceOverridesWithCallContext(spec.getOverrides(), context);<NEW_LINE>final SubscriptionCatalog catalog = subscriptionCatalogApi.getFullCatalog(internalCallContext);<NEW_LINE>final PlanPhaseSpecifier planPhaseSpecifier = spec.getPlanPhaseSpecifier();<NEW_LINE>final StaticCatalog versionCatalog = catalog.versionForDate(effectiveDate);<NEW_LINE>final Plan newPlan = versionCatalog.createOrFindPlan(planPhaseSpecifier, overridesWithContext);<NEW_LINE>final PhaseType initialPhaseType = planPhaseSpecifier.getPhaseType();<NEW_LINE>if (ProductCategory.ADD_ON.toString().equalsIgnoreCase(newPlan.getProduct().getCategory().toString())) {<NEW_LINE>if (newPlan.getPlansAllowedInBundle() != -1 && newPlan.getPlansAllowedInBundle() > 0 && addonUtils.countExistingAddOnsWithSamePlanName(dao.getSubscriptions(subscription.getBundleId(), null, catalog, internalCallContext), newPlan.getName()) >= newPlan.getPlansAllowedInBundle()) {<NEW_LINE>// the plan can be changed to the new value, because it has reached its limit by bundle<NEW_LINE>throw new SubscriptionBaseApiException(ErrorCode.SUB_CHANGE_AO_MAX_PLAN_ALLOWED_BY_BUNDLE, newPlan.getName());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (newPlan.getProduct().getCategory() != subscription.getCategory()) {<NEW_LINE>throw new SubscriptionBaseApiException(ErrorCode.<MASK><NEW_LINE>}<NEW_LINE>final List<DefaultSubscriptionBase> addOnSubscriptionsToBeCancelled = new ArrayList<DefaultSubscriptionBase>();<NEW_LINE>final List<SubscriptionBaseEvent> addOnCancelEvents = new ArrayList<SubscriptionBaseEvent>();<NEW_LINE>final List<SubscriptionBaseEvent> changeEvents = getEventsOnChangePlan(subscription, newPlan, newPlan.getPriceList().getName(), effectiveDate, true, addOnSubscriptionsToBeCancelled, addOnCancelEvents, initialPhaseType, spec.getBillCycleDay(), catalog, internalCallContext);<NEW_LINE>dao.changePlan(subscription, changeEvents, addOnSubscriptionsToBeCancelled, addOnCancelEvents, catalog, internalCallContext);<NEW_LINE>subscription.rebuildTransitions(dao.getEventsForSubscription(subscription.getId(), internalCallContext), catalog);<NEW_LINE>}
SUB_CHANGE_INVALID, subscription.getId());
592,601
public static void destroy(String userName, String password, String appId) throws SaturnJobConsoleException {<NEW_LINE>String urlStr = SaturnEnvProperties.VIP_SATURN_DCOS_REST_URI + API_VERSION_DES + appId;<NEW_LINE>CloseableHttpClient httpClient = HttpClients.createDefault();<NEW_LINE>try {<NEW_LINE>HttpDelete httpDelete = new HttpDelete(urlStr);<NEW_LINE>httpDelete.setHeader(AUTHORIZATION_DES, BASIC_DES + Base64.encodeBase64String((userName + ":" + password).getBytes(UTF8_DES)));<NEW_LINE>CloseableHttpResponse httpResponse = httpClient.execute(httpDelete);<NEW_LINE>StatusLine statusLine = httpResponse.getStatusLine();<NEW_LINE>if (statusLine != null) {<NEW_LINE>int statusCode = statusLine.getStatusCode();<NEW_LINE>String reasonPhrase = statusLine.getReasonPhrase();<NEW_LINE>if (statusCode != 200) {<NEW_LINE>HttpEntity entity = httpResponse.getEntity();<NEW_LINE>if (entity != null) {<NEW_LINE>String entityContent = getEntityContent(entity);<NEW_LINE>throw new SaturnJobConsoleException(entityContent);<NEW_LINE>} else {<NEW_LINE>throw new SaturnJobConsoleException("statusCode is " + statusCode + ", reasonPhrase is " + reasonPhrase);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>throw new SaturnJobConsoleException("Not status returned, url is " + urlStr);<NEW_LINE>}<NEW_LINE>} catch (IOException e) {<NEW_LINE>log.error(<MASK><NEW_LINE>throw new SaturnJobConsoleException(e);<NEW_LINE>} finally {<NEW_LINE>try {<NEW_LINE>httpClient.close();<NEW_LINE>} catch (IOException e) {<NEW_LINE>log.error(e.getMessage(), e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
e.getMessage(), e);
1,048,700
public void marshall(GatewayInfo gatewayInfo, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (gatewayInfo == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(gatewayInfo.getGatewayId(), GATEWAYID_BINDING);<NEW_LINE>protocolMarshaller.marshall(gatewayInfo.getGatewayARN(), GATEWAYARN_BINDING);<NEW_LINE>protocolMarshaller.marshall(gatewayInfo.getGatewayType(), GATEWAYTYPE_BINDING);<NEW_LINE>protocolMarshaller.marshall(gatewayInfo.getGatewayOperationalState(), GATEWAYOPERATIONALSTATE_BINDING);<NEW_LINE>protocolMarshaller.marshall(gatewayInfo.getGatewayName(), GATEWAYNAME_BINDING);<NEW_LINE>protocolMarshaller.marshall(gatewayInfo.getEc2InstanceId(), EC2INSTANCEID_BINDING);<NEW_LINE>protocolMarshaller.marshall(<MASK><NEW_LINE>protocolMarshaller.marshall(gatewayInfo.getHostEnvironment(), HOSTENVIRONMENT_BINDING);<NEW_LINE>protocolMarshaller.marshall(gatewayInfo.getHostEnvironmentId(), HOSTENVIRONMENTID_BINDING);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>}
gatewayInfo.getEc2InstanceRegion(), EC2INSTANCEREGION_BINDING);
409,071
protected Sheet createSheet() {<NEW_LINE>Sheet sheet = super.createSheet();<NEW_LINE>Sheet.Set ps = sheet.get(Sheet.PROPERTIES);<NEW_LINE>if (ps == null) {<NEW_LINE>ps = Sheet.createPropertiesSet();<NEW_LINE>}<NEW_LINE>// NOI18N<NEW_LINE>ps.put(createProperty(AnnotationTypes.PROP_BACKGROUND_DRAWING, boolean.class));<NEW_LINE>// NOI18N<NEW_LINE>ps.put(createProperty(AnnotationTypes.PROP_BACKGROUND_GLYPH_ALPHA, int.class));<NEW_LINE>// NOI18N<NEW_LINE>ps.put(createProperty(AnnotationTypes.PROP_COMBINE_GLYPHS, boolean.class));<NEW_LINE>// NOI18N<NEW_LINE>ps.put(createProperty(AnnotationTypes.PROP_GLYPHS_OVER_LINE_NUMBERS, boolean.class));<NEW_LINE>// NOI18N<NEW_LINE>ps.put(createProperty(AnnotationTypes<MASK><NEW_LINE>sheet.put(ps);<NEW_LINE>return sheet;<NEW_LINE>}
.PROP_SHOW_GLYPH_GUTTER, boolean.class));
603,938
protected LineIndentResult determineIndent(IDocument doc, BlockHeuristicsScannner bhscanner, final int line, final int editOffset) throws BadLocationException {<NEW_LINE>IRegion lineRegion = doc.getLineInformation(line);<NEW_LINE>final int lineStart = lineRegion.getOffset();<NEW_LINE>assertTrue(lineStart <= editOffset && editOffset <= getRegionEnd(lineRegion));<NEW_LINE>ITypedRegion partition = bhscanner.getPartition(lineStart);<NEW_LINE>if (partitionIsIgnoredForLineIndentString(editOffset, partition)) {<NEW_LINE>if (line == 0) {<NEW_LINE>// empty/zero block balance<NEW_LINE>return new LineIndentResult(""<MASK><NEW_LINE>} else {<NEW_LINE>return determineIndent(doc, bhscanner, line - 1);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>BlockBalanceResult blockInfo = bhscanner.calculateBlockBalances(lineStart, editOffset);<NEW_LINE>if (blockInfo.unbalancedOpens == 0 && blockInfo.unbalancedCloses > 0) {<NEW_LINE>int blockStartOffset = bhscanner.findBlockStart(blockInfo.rightmostUnbalancedBlockCloseOffset);<NEW_LINE>assertTrue(doc.getLineOfOffset(blockStartOffset) <= doc.getLineOfOffset(lineStart));<NEW_LINE>String startLineIndent = getLineIndentForOffset(blockStartOffset);<NEW_LINE>// Now calculate the balance for the block start line, before the block start<NEW_LINE>int lineOffset = TextSourceUtils.findLineStartForOffset(docContents, blockStartOffset);<NEW_LINE>BlockBalanceResult blockStartInfo = bhscanner.calculateBlockBalances(lineOffset, blockStartOffset);<NEW_LINE>// Add the indent of the start line, plus the unbalanced opens there<NEW_LINE>String newLineIndent = addIndent(startLineIndent, blockStartInfo.unbalancedOpens);<NEW_LINE>return new LineIndentResult(null, newLineIndent, blockInfo);<NEW_LINE>}<NEW_LINE>// The indent string to be added to the new line<NEW_LINE>String lineIndent = getLineIndentForLineStart(lineStart, editOffset);<NEW_LINE>if (blockInfo.unbalancedOpens == 0 && blockInfo.unbalancedCloses == 0) {<NEW_LINE>// finished<NEW_LINE>return new LineIndentResult(null, lineIndent, blockInfo);<NEW_LINE>}<NEW_LINE>if (blockInfo.unbalancedOpens > 0) {<NEW_LINE>String newLineIndent = addIndent(lineIndent, blockInfo.unbalancedOpens);<NEW_LINE>// cache lineIndent so as to not recalculate<NEW_LINE>// finished<NEW_LINE>return new LineIndentResult(lineIndent, newLineIndent, blockInfo);<NEW_LINE>}<NEW_LINE>throw assertUnreachable();<NEW_LINE>}
, "", new BlockBalanceResult());
1,182,494
private QueryBuilder buildQueryString(@Nonnull String path, @Nonnull Map<String, String> requestMap, boolean isGroupQuery) {<NEW_LINE>final int browseDepthVal = getPathDepth(path) + 1;<NEW_LINE>final BoolQueryBuilder queryBuilder = QueryBuilders.boolQuery();<NEW_LINE>queryBuilder.mustNot(QueryBuilders.termQuery(REMOVED, "true"));<NEW_LINE>if (!path.isEmpty()) {<NEW_LINE>queryBuilder.filter(QueryBuilders.termQuery(BROWSE_PATH, path));<NEW_LINE>}<NEW_LINE>if (isGroupQuery) {<NEW_LINE>queryBuilder.filter(QueryBuilders.rangeQuery(<MASK><NEW_LINE>} else {<NEW_LINE>queryBuilder.filter(QueryBuilders.termQuery(BROWSE_PATH_DEPTH, browseDepthVal));<NEW_LINE>}<NEW_LINE>requestMap.forEach((field, val) -> queryBuilder.filter(QueryBuilders.termQuery(field, val)));<NEW_LINE>return queryBuilder;<NEW_LINE>}
BROWSE_PATH_DEPTH).gt(browseDepthVal));
1,549,420
public void vp8_loop_filter_update_sharpness(int sharpness_lvl) {<NEW_LINE>int i;<NEW_LINE>block_inside_limit = filt_lvl >> (<MASK><NEW_LINE>block_inside_limit = block_inside_limit >> (sharpness_lvl > 4 ? 1 : 0);<NEW_LINE>if (sharpness_lvl > 0) {<NEW_LINE>if (block_inside_limit > (9 - sharpness_lvl)) {<NEW_LINE>block_inside_limit = (9 - sharpness_lvl);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (block_inside_limit < 1)<NEW_LINE>block_inside_limit = 1;<NEW_LINE>Arrays.fill(lim[i], (short) block_inside_limit);<NEW_LINE>Arrays.fill(blim[i], (short) (2 * filt_lvl + block_inside_limit));<NEW_LINE>Arrays.fill(mblim[i], (short) (2 * (filt_lvl + 2) + block_inside_limit));<NEW_LINE>}<NEW_LINE>}
sharpness_lvl > 0 ? 1 : 0);
771,410
public Optional<ContentType> tryMatch(final String mimeType, final Host currentHost, final User user) throws DotSecurityException, DotDataException {<NEW_LINE>final List<ContentType> dotAssetContentTypes = APILocator.getContentTypeAPI(user).findByType(BaseContentType.DOTASSET);<NEW_LINE>if (UtilMethods.isSet(dotAssetContentTypes)) {<NEW_LINE>// Stores the content type indexed by mimetypes, on each index stores the subsets<NEW_LINE>// 0:Exact/on Site, 1:Exact/SYSTEM_HOST, 2:Partial Wildcard/on Site, 3:Partial Wildcard/SYSTEM_HOST,<NEW_LINE>// 4:Total Wildcard (or null)/on Site, 5:Total Wildcard (or null)/SYSTEM_HOST<NEW_LINE>final Map<String, ContentType>[] mimeTypeMappingArray = new Map[6];<NEW_LINE>// remove the ones that are not system host or current host<NEW_LINE>dotAssetContentTypes.stream().// remove the ones that are not system host or current host<NEW_LINE>filter(contentType -> isSystemHostOrCurrentHost(contentType, currentHost)).map(this::mapToContentTypeMimeType).forEach(contentTypeMimeType -> {<NEW_LINE>for (final String mimeTypeItem : contentTypeMimeType.mimeTypeFieldVariables) {<NEW_LINE>if (ALL_MIME_TYPE.equals(mimeTypeItem)) {<NEW_LINE>this.getMap(mimeTypeMappingArray, contentTypeMimeType.systemHost ? 5 : 4).put(mimeTypeItem, contentTypeMimeType.contentType);<NEW_LINE>} else if (mimeTypeItem.endsWith(PARTIAL_MIME_TYPE)) {<NEW_LINE>this.getMap(mimeTypeMappingArray, contentTypeMimeType.systemHost ? 3 : 2).<MASK><NEW_LINE>} else {<NEW_LINE>this.getMap(mimeTypeMappingArray, contentTypeMimeType.systemHost ? 1 : 0).put(mimeTypeItem, contentTypeMimeType.contentType);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>return findDotAssetContentType(mimeType, mimeTypeMappingArray);<NEW_LINE>}<NEW_LINE>return Optional.empty();<NEW_LINE>}
put(mimeTypeItem, contentTypeMimeType.contentType);
1,784,162
String makeUniqueTokenForMachine(final SessionLabel sessionLabel, final TokenMachine machine) throws PwmUnrecoverableException, PwmOperationalException {<NEW_LINE>String tokenKey = null;<NEW_LINE>int attempts = 0;<NEW_LINE>final int maxUniqueCreateAttempts = Integer.parseInt(pwmDomain.getConfig()<MASK><NEW_LINE>while (tokenKey == null && attempts < maxUniqueCreateAttempts) {<NEW_LINE>tokenKey = makeRandomCode(domainConfig);<NEW_LINE>LOGGER.trace(sessionLabel, () -> "generated new token random code, checking for uniqueness");<NEW_LINE>final Optional<TokenPayload> existingPayload = machine.retrieveToken(sessionLabel, tokenMachine.keyFromKey(tokenKey));<NEW_LINE>if (existingPayload.isPresent()) {<NEW_LINE>tokenKey = null;<NEW_LINE>}<NEW_LINE>attempts++;<NEW_LINE>}<NEW_LINE>if (tokenKey == null) {<NEW_LINE>throw new PwmOperationalException(new ErrorInformation(PwmError.ERROR_INTERNAL, "unable to generate a unique token key after " + attempts + " attempts"));<NEW_LINE>}<NEW_LINE>{<NEW_LINE>final int finalAttempts = attempts;<NEW_LINE>LOGGER.trace(sessionLabel, () -> "created new unique random token value after " + finalAttempts + " attempts");<NEW_LINE>}<NEW_LINE>return tokenKey;<NEW_LINE>}
.readAppProperty(AppProperty.TOKEN_MAX_UNIQUE_CREATE_ATTEMPTS));
356,895
private AmazonS3 createAmazonS3Client(Configuration hadoopConfig, ClientConfiguration clientConfig) {<NEW_LINE>Optional<EncryptionMaterialsProvider> encryptionMaterialsProvider = createEncryptionMaterialsProvider(hadoopConfig);<NEW_LINE>AmazonS3Builder<? extends AmazonS3Builder, ? extends AmazonS3> clientBuilder;<NEW_LINE>String signerType = hadoopConfig.get(S3_SIGNER_TYPE);<NEW_LINE>if (signerType != null) {<NEW_LINE>clientConfig.withSignerOverride(signerType);<NEW_LINE>}<NEW_LINE>if (encryptionMaterialsProvider.isPresent()) {<NEW_LINE>clientBuilder = AmazonS3EncryptionClient.encryptionBuilder().withCredentials(credentialsProvider).withEncryptionMaterials(encryptionMaterialsProvider.get()).withClientConfiguration(clientConfig).withMetricsCollector(METRIC_COLLECTOR);<NEW_LINE>} else {<NEW_LINE>clientBuilder = AmazonS3Client.builder().withCredentials(credentialsProvider).withClientConfiguration(clientConfig).withMetricsCollector(METRIC_COLLECTOR);<NEW_LINE>}<NEW_LINE>boolean regionOrEndpointSet = false;<NEW_LINE>// use local region when running inside of EC2<NEW_LINE>if (pinS3ClientToCurrentRegion) {<NEW_LINE>Region region = Regions.getCurrentRegion();<NEW_LINE>if (region != null) {<NEW_LINE>clientBuilder = clientBuilder.<MASK><NEW_LINE>regionOrEndpointSet = true;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>String endpoint = hadoopConfig.get(S3_ENDPOINT);<NEW_LINE>if (endpoint != null) {<NEW_LINE>clientBuilder = clientBuilder.withEndpointConfiguration(new EndpointConfiguration(endpoint, null));<NEW_LINE>regionOrEndpointSet = true;<NEW_LINE>}<NEW_LINE>if (isPathStyleAccess) {<NEW_LINE>clientBuilder = clientBuilder.enablePathStyleAccess();<NEW_LINE>}<NEW_LINE>if (!regionOrEndpointSet) {<NEW_LINE>clientBuilder = clientBuilder.withRegion(US_EAST_1);<NEW_LINE>clientBuilder.setForceGlobalBucketAccessEnabled(true);<NEW_LINE>}<NEW_LINE>return clientBuilder.build();<NEW_LINE>}
withRegion(region.getName());
1,775,590
public static <T> ServerServiceDefinition useMarshalledMessages(final ServerServiceDefinition serviceDef, final MethodDescriptor.Marshaller<T> marshaller) {<NEW_LINE>List<ServerMethodDefinition<?, ?>> wrappedMethods = new ArrayList<>();<NEW_LINE>List<MethodDescriptor<?, ?>> wrappedDescriptors = new ArrayList<>();<NEW_LINE>// Wrap the descriptors<NEW_LINE>for (final ServerMethodDefinition<?, ?> definition : serviceDef.getMethods()) {<NEW_LINE>final MethodDescriptor<?, ?> originalMethodDescriptor = definition.getMethodDescriptor();<NEW_LINE>final MethodDescriptor<T, T> wrappedMethodDescriptor = originalMethodDescriptor.toBuilder(<MASK><NEW_LINE>wrappedDescriptors.add(wrappedMethodDescriptor);<NEW_LINE>wrappedMethods.add(wrapMethod(definition, wrappedMethodDescriptor));<NEW_LINE>}<NEW_LINE>// Build the new service descriptor<NEW_LINE>final ServiceDescriptor.Builder serviceDescriptorBuilder = ServiceDescriptor.newBuilder(serviceDef.getServiceDescriptor().getName()).setSchemaDescriptor(serviceDef.getServiceDescriptor().getSchemaDescriptor());<NEW_LINE>for (MethodDescriptor<?, ?> wrappedDescriptor : wrappedDescriptors) {<NEW_LINE>serviceDescriptorBuilder.addMethod(wrappedDescriptor);<NEW_LINE>}<NEW_LINE>// Create the new service definition.<NEW_LINE>final ServerServiceDefinition.Builder serviceBuilder = ServerServiceDefinition.builder(serviceDescriptorBuilder.build());<NEW_LINE>for (ServerMethodDefinition<?, ?> definition : wrappedMethods) {<NEW_LINE>serviceBuilder.addMethod(definition);<NEW_LINE>}<NEW_LINE>return serviceBuilder.build();<NEW_LINE>}
marshaller, marshaller).build();
1,193,653
public void testTimeout(Map<String, String> param, StringBuilder ret) {<NEW_LINE>String serverIP = param.get("serverIP");<NEW_LINE>String <MASK><NEW_LINE>String timeout = param.get("timeout");<NEW_LINE>long longTimeout = 0L;<NEW_LINE>String res = null;<NEW_LINE>ClientBuilder cb = ClientBuilder.newBuilder();<NEW_LINE>Client c = null;<NEW_LINE>try {<NEW_LINE>longTimeout = Long.parseLong(timeout);<NEW_LINE>cb.connectTimeout(longTimeout * 2, TimeUnit.MILLISECONDS);<NEW_LINE>cb.readTimeout(longTimeout, TimeUnit.MILLISECONDS);<NEW_LINE>// cb.property("com.ibm.ws.jaxrs.client.connection.timeout", timeout);<NEW_LINE>// cb.property("com.ibm.ws.jaxrs.client.receive.timeout", timeout);<NEW_LINE>c = cb.build();<NEW_LINE>try {<NEW_LINE>res = c.target("http://" + serverIP + ":" + serverPort + "/" + moduleName + "/JAXRS21TimeoutClientTest/BasicResource").path("echo").path(param.get("param")).request().get(String.class);<NEW_LINE>} catch (Exception expected) {<NEW_LINE>expected.printStackTrace();<NEW_LINE>if (expected.toString().contains("SocketTimeoutException")) {<NEW_LINE>res = "[Timeout Error]:" + "SocketTimeoutException";<NEW_LINE>} else {<NEW_LINE>res = "[Timeout Error]:" + expected.toString();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (NumberFormatException e) {<NEW_LINE>e.printStackTrace();<NEW_LINE>res = "[Basic Resource]:timeoutValueInvalid";<NEW_LINE>} finally {<NEW_LINE>if (c != null) {<NEW_LINE>c.close();<NEW_LINE>}<NEW_LINE>ret.append(res);<NEW_LINE>}<NEW_LINE>}
serverPort = param.get("serverPort");
1,716,367
public MycatRel compileQuery(OptimizationContext optimizationContext, SchemaPlus plus, DrdsSql drdsSql) {<NEW_LINE>RelNode logPlan;<NEW_LINE>RelNodeContext relNodeContext = null;<NEW_LINE>{<NEW_LINE>relNodeContext = getRelRoot(plus, drdsSql);<NEW_LINE>logPlan = relNodeContext.getRoot().rel;<NEW_LINE>optimizationContext.relNodeContext = relNodeContext;<NEW_LINE>}<NEW_LINE>// if (logPlan instanceof TableModify) {<NEW_LINE>// LogicalTableModify tableModify = (LogicalTableModify) logPlan;<NEW_LINE>// switch (tableModify.getOperation()) {<NEW_LINE>// case DELETE:<NEW_LINE>// case UPDATE:<NEW_LINE>// return planUpdate(tableModify, drdsSql, optimizationContext);<NEW_LINE>// default:<NEW_LINE>// throw new UnsupportedOperationException("unsupported DML operation " + tableModify.getOperation());<NEW_LINE>// }<NEW_LINE>// }<NEW_LINE>RelDataType finalRowType = logPlan.getRowType();<NEW_LINE>RelNode rboLogPlan = optimizeWithRBO(logPlan);<NEW_LINE>// if (!RelOptUtil.areRowTypesEqual(rboLogPlan.getRowType(), logPlan.getRowType(), true)) {<NEW_LINE>// rboLogPlan = relNodeContext.getRelBuilder().push(rboLogPlan).rename(logPlan.getRowType().getFieldNames()).build();<NEW_LINE>// }<NEW_LINE>// rboLogPlan = rboLogPlan.accept(new RelShuttleImpl(){<NEW_LINE>// @Override<NEW_LINE>// public RelNode visit(TableScan scan) {<NEW_LINE>// return SQLRBORewriter.view(scan).orElse(scan);<NEW_LINE>// }<NEW_LINE>// });<NEW_LINE>// rboLogPlan = rboLogPlan.accept(new ToLocalConverter());<NEW_LINE>MycatRel mycatRel = optimizeWithCBO(<MASK><NEW_LINE>if (!RelOptUtil.areRowTypesEqual(mycatRel.getRowType(), finalRowType, true)) {<NEW_LINE>Project relNode = (Project) relNodeContext.getRelBuilder().push(mycatRel).rename(finalRowType.getFieldNames()).build();<NEW_LINE>mycatRel = MycatProject.create(relNode.getInput(), relNode.getProjects(), relNode.getRowType());<NEW_LINE>}<NEW_LINE>return mycatRel;<NEW_LINE>}
rboLogPlan, Collections.emptyList());
429,659
private static void printNode(Node n, String sp, java.io.PrintStream out, boolean instances) {<NEW_LINE>int i;<NEW_LINE>Iterator it;<NEW_LINE>Class type = n.getType();<NEW_LINE>out.print(sp);<NEW_LINE>// NOI18N<NEW_LINE>out.println("Node for: " + type + "\t" + ((type == null) ? null : type.getClassLoader()));<NEW_LINE>if (n.items != null) {<NEW_LINE>i = 0;<NEW_LINE>it = new ArrayList<Pair>(<MASK><NEW_LINE>while (it.hasNext()) {<NEW_LINE>AbstractLookup.Pair p = (AbstractLookup.Pair) it.next();<NEW_LINE>out.print(sp);<NEW_LINE>out.print(" item (" + i++ + "): ");<NEW_LINE>// NOI18N<NEW_LINE>out.print(p);<NEW_LINE>// NOI18N<NEW_LINE>out.print(" id: " + Integer.toHexString(System.identityHashCode(p)));<NEW_LINE>// NOI18N<NEW_LINE>out.print(" index: ");<NEW_LINE>out.print(p.getIndex());<NEW_LINE>if (instances) {<NEW_LINE>out.print(" I: " + p.getInstance());<NEW_LINE>}<NEW_LINE>out.println();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (n.children != null) {<NEW_LINE>i = 0;<NEW_LINE>it = n.children.iterator();<NEW_LINE>while (it.hasNext()) {<NEW_LINE>Node ch = (Node) it.next();<NEW_LINE>// NOI18N<NEW_LINE>printNode(ch, sp + " ", out, instances);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
n.items).iterator();
335,360
public void valueExprToString(StringBuilder out, int indent) {<NEW_LINE>if (inListConstantsOnly != null) {<NEW_LINE>out.append("constant values, ").append(inListConstantsOnly.length).append(" entries").append(NEWLINE);<NEW_LINE>for (int i = 0; i < inListConstantsOnly.length; i++) {<NEW_LINE>out.append(Indent.indent(indent)).append("value #").append(i).append(": ");<NEW_LINE>FilterSpecParamConstantForge.valueExprToString(out, inListConstantsOnly[i]);<NEW_LINE>out.append(NEWLINE);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>out.append("non-constant values, ").append(listOfValues.size()).append<MASK><NEW_LINE>int valueIndex = 0;<NEW_LINE>for (FilterSpecParamInValueForge forge : listOfValues) {<NEW_LINE>out.append(Indent.indent(indent)).append("value #").append(valueIndex).append(": ");<NEW_LINE>forge.valueToString(out);<NEW_LINE>out.append(NEWLINE);<NEW_LINE>valueIndex++;<NEW_LINE>}<NEW_LINE>}
(" entries").append(NEWLINE);
1,841,935
public static void horizontal5(Kernel1D_S32 kernel, GrayS16 image, GrayI16 dest, int divisor) {<NEW_LINE>final short[] dataSrc = image.data;<NEW_LINE>final short[] dataDst = dest.data;<NEW_LINE>final int k1 = kernel.data[0];<NEW_LINE>final int k2 = kernel.data[1];<NEW_LINE>final int k3 = kernel.data[2];<NEW_LINE>final int k4 = kernel.data[3];<NEW_LINE>final int k5 = kernel.data[4];<NEW_LINE>final int radius = kernel.getRadius();<NEW_LINE>final int width = image.getWidth();<NEW_LINE>final int halfDivisor = divisor / 2;<NEW_LINE>// CONCURRENT_BELOW BoofConcurrency.loopFor(0, image.height, i -> {<NEW_LINE>for (int i = 0; i < image.height; i++) {<NEW_LINE>int indexDst = dest.startIndex + i * dest.stride + radius;<NEW_LINE>int j = image.startIndex + i * image.stride - radius;<NEW_LINE>final int jEnd = j + width - radius;<NEW_LINE>for (j += radius; j < jEnd; j++) {<NEW_LINE>int indexSrc = j;<NEW_LINE>int total = (dataSrc[indexSrc++]) * k1;<NEW_LINE>total += (dataSrc[indexSrc++]) * k2;<NEW_LINE>total += (<MASK><NEW_LINE>total += (dataSrc[indexSrc++]) * k4;<NEW_LINE>total += (dataSrc[indexSrc]) * k5;<NEW_LINE>dataDst[indexDst++] = (short) ((total + halfDivisor) / divisor);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// CONCURRENT_ABOVE });<NEW_LINE>}
dataSrc[indexSrc++]) * k3;
1,041,780
public static String randomJsStringFromRanges(SortedListOfRanges ranges, int length) {<NEW_LINE>Random random = new Random(System.currentTimeMillis());<NEW_LINE><MASK><NEW_LINE>for (int i = 0; i < length; i++) {<NEW_LINE>int rangeIndex = random.nextInt(ranges.size());<NEW_LINE>int lo = ranges.getLo(rangeIndex);<NEW_LINE>int hi = ranges.getHi(rangeIndex);<NEW_LINE>int randChar = lo + random.nextInt((hi + 1) - lo);<NEW_LINE>if (randChar == '"') {<NEW_LINE>stringBuilder.append("\\\\\"");<NEW_LINE>} else if (randChar == '\\') {<NEW_LINE>stringBuilder.append("\\\\\\\\");<NEW_LINE>} else if (randChar > 0xffff) {<NEW_LINE>stringBuilder.append(String.format("\\u{%06x}", randChar));<NEW_LINE>} else if (randChar > 0x7f || Character.isISOControl(randChar)) {<NEW_LINE>stringBuilder.append(String.format("\\u%04x", randChar));<NEW_LINE>} else {<NEW_LINE>stringBuilder.append(randChar);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return stringBuilder.toString();<NEW_LINE>}
StringBuilder stringBuilder = new StringBuilder(length);
709,654
final BatchPutMessageResult executeBatchPutMessage(BatchPutMessageRequest batchPutMessageRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(batchPutMessageRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<BatchPutMessageRequest> request = null;<NEW_LINE>Response<BatchPutMessageResult> response = null;<NEW_LINE>try {<NEW_LINE><MASK><NEW_LINE>try {<NEW_LINE>request = new BatchPutMessageRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(batchPutMessageRequest));<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, "IoT Events Data");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "BatchPutMessage");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<BatchPutMessageResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new BatchPutMessageResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
1,267,864
private Mono<Response<Flux<ByteBuffer>>> refreshWithResponseAsync(String deviceName, String storageAccountName, String containerName, String resourceGroupName, Context context) {<NEW_LINE>if (this.client.getEndpoint() == null) {<NEW_LINE>return Mono.<MASK><NEW_LINE>}<NEW_LINE>if (deviceName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter deviceName is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (storageAccountName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter storageAccountName is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (containerName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter containerName is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (this.client.getSubscriptionId() == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (resourceGroupName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));<NEW_LINE>}<NEW_LINE>final String accept = "application/json";<NEW_LINE>context = this.client.mergeContext(context);<NEW_LINE>return service.refresh(this.client.getEndpoint(), deviceName, storageAccountName, containerName, this.client.getSubscriptionId(), resourceGroupName, this.client.getApiVersion(), accept, context);<NEW_LINE>}
error(new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
1,615,486
protected void logCommon(TraceComponent logger) {<NEW_LINE>ContainerData useImmediateContainerData = getImmediateContainerData();<NEW_LINE>Tr.debug(logger, MessageFormat.format(" Immediate container [ {0} ] [ {1} ]", useImmediateContainerData.name, useImmediateContainerData.container));<NEW_LINE>ContainerData useApplicationLibraryContainerData = getApplicationLibraryContainerData();<NEW_LINE>if (useApplicationLibraryContainerData != null) {<NEW_LINE>Tr.debug(logger, MessageFormat.format(" Application library container [ {0} ] [ {1} ]", useApplicationLibraryContainerData.name, useApplicationLibraryContainerData.container));<NEW_LINE>}<NEW_LINE>List<MASK><NEW_LINE>if (useLibrariesContainerData != null) {<NEW_LINE>for (ContainerData nextContainerData : useLibrariesContainerData) {<NEW_LINE>Tr.debug(logger, MessageFormat.format(" Application library element container [ {0} ] [ {1} ]", nextContainerData.name, nextContainerData.container));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>List<ContainerData> useManifestContainerData = getManifestContainerData();<NEW_LINE>if (useManifestContainerData != null) {<NEW_LINE>for (ContainerData nextContainerData : useManifestContainerData) {<NEW_LINE>Tr.debug(logger, MessageFormat.format(" Manifest element container [ {0} ] [ {1} ]", nextContainerData.name, nextContainerData.container));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
<ContainerData> useLibrariesContainerData = getApplicationLibrariesContainerData();
1,201,292
protected JenaConnection connect(Properties props, int compatibilityLevel) throws SQLException {<NEW_LINE>String location = props.getProperty(PARAM_LOCATION);<NEW_LINE>if (location == null)<NEW_LINE>throw new SQLException("Required connection parameter " + PARAM_LOCATION + " is not present in the connection URL or the provided Properties object");<NEW_LINE>// Determine location<NEW_LINE>boolean useMem = this.isSetToValue(props, PARAM_LOCATION, LOCATION_MEM);<NEW_LINE>File loc = new File(location);<NEW_LINE>if (useMem) {<NEW_LINE>LOGGER.warn("TDB Driver connection string specifies use of a pure in-memory dataset, this is not recommended for anything other than basic testing");<NEW_LINE>} else {<NEW_LINE>if (!loc.isAbsolute()) {<NEW_LINE>LOGGER.warn("TDB Driver connection string specifies location " + loc.getAbsolutePath() + ", if this was not the expected location consider using an absolute instead of a relative path");<NEW_LINE>} else {<NEW_LINE>LOGGER.info("TDB Driver connection string specifies location " + loc.getAbsolutePath());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Validate location if required<NEW_LINE>if (this.isTrue(props, PARAM_MUST_EXIST) && !useMem) {<NEW_LINE>if (!loc.exists()) {<NEW_LINE>throw new SQLException("TDB Driver connection string specifies location " + loc.getAbsolutePath() + " which does not exist, correct the " + PARAM_LOCATION + " parameter or set the " + PARAM_MUST_EXIST + " parameter to false");<NEW_LINE>} else if (!loc.isDirectory()) {<NEW_LINE>throw new SQLException("TDB Driver connection string specifies location " + loc.getAbsolutePath() + " which is not a directory, correct the " + PARAM_LOCATION + " parameter or set the " + PARAM_MUST_EXIST + " parameter to false");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Open the TDB dataset<NEW_LINE>try {<NEW_LINE>Dataset tdb = useMem ? TDBFactory.createDataset(<MASK><NEW_LINE>// Return a new connection for the TDB dataset<NEW_LINE>return new TDBConnection(tdb, ResultSet.HOLD_CURSORS_OVER_COMMIT, true, compatibilityLevel);<NEW_LINE>} catch (SQLException e) {<NEW_LINE>throw e;<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SQLException("Unexpected error establishing TDB driver connection, see inner exception for details", e);<NEW_LINE>}<NEW_LINE>}
) : TDBFactory.createDataset(location);
857,023
public static DescribeColumnsResponse unmarshall(DescribeColumnsResponse describeColumnsResponse, UnmarshallerContext _ctx) {<NEW_LINE>describeColumnsResponse.setRequestId(_ctx.stringValue("DescribeColumnsResponse.RequestId"));<NEW_LINE>List<Column> items = new ArrayList<Column>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("DescribeColumnsResponse.Items.Length"); i++) {<NEW_LINE>Column column = new Column();<NEW_LINE>column.setType(_ctx.stringValue("DescribeColumnsResponse.Items[" + i + "].Type"));<NEW_LINE>column.setColumnName(_ctx.stringValue("DescribeColumnsResponse.Items[" + i + "].ColumnName"));<NEW_LINE>column.setTableName(_ctx.stringValue("DescribeColumnsResponse.Items[" + i + "].TableName"));<NEW_LINE>column.setAutoIncrementColumn(_ctx.booleanValue("DescribeColumnsResponse.Items[" + i + "].AutoIncrementColumn"));<NEW_LINE>column.setDBClusterId(_ctx.stringValue<MASK><NEW_LINE>column.setPrimaryKey(_ctx.booleanValue("DescribeColumnsResponse.Items[" + i + "].PrimaryKey"));<NEW_LINE>column.setSchemaName(_ctx.stringValue("DescribeColumnsResponse.Items[" + i + "].SchemaName"));<NEW_LINE>items.add(column);<NEW_LINE>}<NEW_LINE>describeColumnsResponse.setItems(items);<NEW_LINE>return describeColumnsResponse;<NEW_LINE>}
("DescribeColumnsResponse.Items[" + i + "].DBClusterId"));
441,690
public void init(IBatchConfig batchConfig) throws BatchContainerServiceException {<NEW_LINE>logger.log(Level.CONFIG, "Entering CLASSNAME.init(), batchConfig ={0}", batchConfig);<NEW_LINE>this.batchConfig = batchConfig;<NEW_LINE>schema = batchConfig.getDatabaseConfigurationBean().getSchema();<NEW_LINE>jndiName = batchConfig.getDatabaseConfigurationBean().getJndiName();<NEW_LINE>prefix = batchConfig.getConfigProperties().getProperty(PAYARA_TABLE_PREFIX_PROPERTY, "");<NEW_LINE>suffix = batchConfig.getConfigProperties().getProperty(PAYARA_TABLE_SUFFIX_PROPERTY, "");<NEW_LINE>if (jndiName == null || jndiName.equals("")) {<NEW_LINE>throw new BatchContainerServiceException("JNDI name is not defined.");<NEW_LINE>}<NEW_LINE>Context ctx = null;<NEW_LINE>try {<NEW_LINE>ctx = new InitialContext();<NEW_LINE>dataSource = (DataSource) ctx.lookup(jndiName);<NEW_LINE>} catch (NamingException e) {<NEW_LINE>logger.severe("Lookup failed for JNDI name: " + jndiName + ". One cause of this could be that the batch runtime is incorrectly configured to EE mode when it should be in SE mode.");<NEW_LINE>throw new BatchContainerServiceException(e);<NEW_LINE>}<NEW_LINE>// Load the table names and queries shared between different database<NEW_LINE>// types<NEW_LINE>tableNames = getSharedTableMap();<NEW_LINE>try {<NEW_LINE>queryStrings = getSharedQueryMap(batchConfig);<NEW_LINE>} catch (SQLException e1) {<NEW_LINE>throw new BatchContainerServiceException(e1);<NEW_LINE>}<NEW_LINE>logger.log(<MASK><NEW_LINE>try {<NEW_LINE>if (!isSchemaValid()) {<NEW_LINE>setDefaultSchema();<NEW_LINE>}<NEW_LINE>checkTables();<NEW_LINE>} catch (SQLException e) {<NEW_LINE>logger.severe(e.getLocalizedMessage());<NEW_LINE>throw new BatchContainerServiceException(e);<NEW_LINE>}<NEW_LINE>logger.config("Exiting CLASSNAME.init()");<NEW_LINE>}
Level.CONFIG, "JNDI name = {0}", jndiName);
1,229,288
private Properties createJavaMailProperties() {<NEW_LINE>Properties javaMailProperties = new Properties();<NEW_LINE>String protocol = this.config.getSmtpProtocol();<NEW_LINE>javaMailProperties.put("mail.transport.protocol", protocol);<NEW_LINE>javaMailProperties.put(MAIL_PROP + protocol + ".host", this.config.getSmtpHost());<NEW_LINE>javaMailProperties.put(MAIL_PROP + protocol + ".port", this.config.getSmtpPort() + "");<NEW_LINE>javaMailProperties.put(MAIL_PROP + protocol + ".timeout", this.config.getTimeout() + "");<NEW_LINE>javaMailProperties.put(MAIL_PROP + protocol + ".auth", String.valueOf(StringUtils.isNotEmpty(this.config.getUsername())));<NEW_LINE>javaMailProperties.put(MAIL_PROP + protocol + ".starttls.enable", Boolean.valueOf(this.config.isEnableTls()).toString());<NEW_LINE>if (this.config.isEnableTls() && StringUtils.isNoneEmpty(this.config.getTlsVersion())) {<NEW_LINE>javaMailProperties.put(MAIL_PROP + protocol + ".ssl.protocols", this.config.getTlsVersion());<NEW_LINE>}<NEW_LINE>if (this.config.isEnableProxy()) {<NEW_LINE>javaMailProperties.put(MAIL_PROP + protocol + ".proxy.host", config.getProxyHost());<NEW_LINE>javaMailProperties.put(MAIL_PROP + protocol + <MASK><NEW_LINE>if (StringUtils.isNoneEmpty(config.getProxyUser())) {<NEW_LINE>javaMailProperties.put(MAIL_PROP + protocol + ".proxy.user", config.getProxyUser());<NEW_LINE>}<NEW_LINE>if (StringUtils.isNoneEmpty(config.getProxyPassword())) {<NEW_LINE>javaMailProperties.put(MAIL_PROP + protocol + ".proxy.password", config.getProxyPassword());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return javaMailProperties;<NEW_LINE>}
".proxy.port", config.getProxyPort());
930,125
final RunJobFlowResult executeRunJobFlow(RunJobFlowRequest runJobFlowRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(runJobFlowRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<RunJobFlowRequest> request = null;<NEW_LINE>Response<RunJobFlowResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new RunJobFlowRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(runJobFlowRequest));<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, "EMR");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "RunJobFlow");<NEW_LINE>request.<MASK><NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<RunJobFlowResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new RunJobFlowResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
1,346,012
private List<Rectangle> processCodeAreas(Parent pane) {<NEW_LINE>var nodes = pane.lookupAll("ContentEditor");<NEW_LINE>ArrayList<Rectangle> <MASK><NEW_LINE>for (Node node : nodes) {<NEW_LINE>ArrayList<TextBoundingBox> bboxes = new ArrayList<>();<NEW_LINE>var area = ((ContentEditor) node).getCodeArea();<NEW_LINE>LiveList<Paragraph<Collection<String>, String, Collection<String>>> visibleParagraphs = area.getVisibleParagraphs();<NEW_LINE>int visibleParIdx = 0;<NEW_LINE>for (Paragraph visiblePar : visibleParagraphs) {<NEW_LINE>int parIdx = area.visibleParToAllParIndex(visibleParIdx);<NEW_LINE>var parMatcher = tagPattern.matcher(visiblePar.getText());<NEW_LINE>if (parMatcher.find()) {<NEW_LINE>// var bounds = area.getVisibleParagraphBoundsOnScreen(visibleParIdx);<NEW_LINE>var matchStartIdxAbs = area.getAbsolutePosition(parIdx, parMatcher.start());<NEW_LINE>var bounds = area.getCharacterBoundsOnScreen(matchStartIdxAbs, matchStartIdxAbs + parMatcher.group().length());<NEW_LINE>bounds.ifPresent(b -> {<NEW_LINE>var localBounds = parent.sceneToLocal(area.localToScene(area.screenToLocal(b)));<NEW_LINE>bboxes.add(new TextBoundingBox(parMatcher.group(1), localBounds.getMinX(), localBounds.getMinY(), localBounds.getWidth(), localBounds.getHeight()));<NEW_LINE>});<NEW_LINE>}<NEW_LINE>visibleParIdx++;<NEW_LINE>}<NEW_LINE>var rectangles = getRectangles(area, bboxes);<NEW_LINE>if (rectangles.size() > 0) {<NEW_LINE>result.addAll(rectangles);<NEW_LINE>boxes.put(area, rectangles);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>}
result = new ArrayList<>();
1,427,734
public void sendTextCommand(String destAddress, Command command) throws Exception {<NEW_LINE>if (Context.getSmsManager() != null) {<NEW_LINE>if (command.getType().equals(Command.TYPE_CUSTOM)) {<NEW_LINE>Context.getSmsManager().sendMessageSync(destAddress, command.getString(Command.KEY_DATA), true);<NEW_LINE>} else if (supportedTextCommands.contains(command.getType()) && textCommandEncoder != null) {<NEW_LINE>String encodedCommand = (<MASK><NEW_LINE>if (encodedCommand != null) {<NEW_LINE>Context.getSmsManager().sendMessageSync(destAddress, encodedCommand, true);<NEW_LINE>} else {<NEW_LINE>throw new RuntimeException("Failed to encode command");<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>throw new RuntimeException("Command " + command.getType() + " is not supported in protocol " + getName());<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>throw new RuntimeException("SMS is not enabled");<NEW_LINE>}<NEW_LINE>}
String) textCommandEncoder.encodeCommand(command);
1,430,296
final UpdatePipelineResult executeUpdatePipeline(UpdatePipelineRequest updatePipelineRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(updatePipelineRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<UpdatePipelineRequest> request = null;<NEW_LINE>Response<UpdatePipelineResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new UpdatePipelineRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(updatePipelineRequest));<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(<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "IoTAnalytics");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "UpdatePipeline");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<UpdatePipelineResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new UpdatePipelineResultJsonUnmarshaller());<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>}
HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());
1,664,986
private int computeGeneralPoints(DMatrix leftPoint, DMatrix rightView, double[] input, int observationIndex, int viewIndex, SceneStructureCommon.Camera camera, int cameraParamStartIndex) {<NEW_LINE>SceneObservations.View obsView = observations.views.get(viewIndex);<NEW_LINE>SceneStructureMetric.View strView = structure.views.get(viewIndex);<NEW_LINE>for (int i = 0; i < obsView.size(); i++) {<NEW_LINE>int featureIndex = obsView.point.get(i);<NEW_LINE>int columnOfPointInJac = featureIndex * lengthPoint;<NEW_LINE>if (structure.isHomogenous()) {<NEW_LINE>worldPt4.x = input[columnOfPointInJac];<NEW_LINE>worldPt4.y = input[columnOfPointInJac + 1];<NEW_LINE>worldPt4.z = input[columnOfPointInJac + 2];<NEW_LINE>worldPt4.w = input[columnOfPointInJac + 3];<NEW_LINE>SePointOps_F64.transformV(world_to_view, worldPt4, cameraPt);<NEW_LINE>} else {<NEW_LINE>worldPt3.x = input[columnOfPointInJac];<NEW_LINE>worldPt3.y = input[columnOfPointInJac + 1];<NEW_LINE>worldPt3.z = input[columnOfPointInJac + 2];<NEW_LINE>SePointOps_F64.transform(world_to_view, worldPt3, cameraPt);<NEW_LINE>}<NEW_LINE>jacRowX = observationIndex * 2;<NEW_LINE>jacRowY = jacRowX + 1;<NEW_LINE>// ============ Partial of camera parameters<NEW_LINE>if (!camera.known) {<NEW_LINE>int N = camera.model.getIntrinsicCount();<NEW_LINE>camera.model.jacobian(cameraPt.x, cameraPt.y, cameraPt.z, pointGradX, pointGradY, true, calibGradX, calibGradY);<NEW_LINE>int location = indexLastMotion - indexFirstMotion + cameraParamStartIndex;<NEW_LINE>for (int j = 0; j < N; j++) {<NEW_LINE>set(rightView, jacRowX, location + j, calibGradX[j]);<NEW_LINE>set(rightView, jacRowY, location + j, calibGradY[j]);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>camera.model.jacobian(cameraPt.x, cameraPt.y, cameraPt.z, pointGradX, pointGradY, false, null, null);<NEW_LINE>}<NEW_LINE>// ============ Partial of worldPt<NEW_LINE>if (structure.isHomogenous()) {<NEW_LINE>partialPointH(leftPoint, rightView, strView, columnOfPointInJac);<NEW_LINE>} else {<NEW_LINE>partialPoint3(<MASK><NEW_LINE>}<NEW_LINE>observationIndex++;<NEW_LINE>}<NEW_LINE>return observationIndex;<NEW_LINE>}
leftPoint, rightView, strView, columnOfPointInJac);
425,091
private String format(String input, IParseNode parseResult, int indentationLevel, boolean isSelection) throws Exception {<NEW_LINE>int spacesCount = -1;<NEW_LINE>if (isSelection) {<NEW_LINE>spacesCount = countLeftWhitespaceChars(input);<NEW_LINE>}<NEW_LINE>final FormatterDocument document = createFormatterDocument(input);<NEW_LINE>FormatterWriter writer = new FormatterWriter(document, lineSeparator, createIndentGenerator());<NEW_LINE>final HTMLFormatterNodeBuilder builder = new HTMLFormatterNodeBuilder(writer);<NEW_LINE>IFormatterContainerNode root = builder.build(parseResult, document);<NEW_LINE>new HTMLFormatterNodeRewriter().rewrite(root);<NEW_LINE>IFormatterContext context = new HTMLFormatterContext(indentationLevel);<NEW_LINE>writer.setWrapLength<MASK><NEW_LINE>writer.setLinesPreserve(getInt(HTMLFormatterConstants.PRESERVED_LINES));<NEW_LINE>root.accept(context, writer);<NEW_LINE>writer.flush(context);<NEW_LINE>String output = writer.getOutput();<NEW_LINE>List<IRegion> offOnRegions = builder.getOffOnRegions();<NEW_LINE>if (offOnRegions != null && !offOnRegions.isEmpty()) {<NEW_LINE>// We re-parse the output to extract its On-Off regions, so we will be able to compute the offsets and<NEW_LINE>// adjust it.<NEW_LINE>List<IRegion> outputOnOffRegions = getOutputOnOffRegions(getString(HTMLFormatterConstants.FORMATTER_OFF), getString(HTMLFormatterConstants.FORMATTER_ON), new HTMLParseState(output));<NEW_LINE>output = FormatterUtils.applyOffOnRegions(input, output, offOnRegions, outputOnOffRegions);<NEW_LINE>}<NEW_LINE>if (isSelection) {<NEW_LINE>output = leftTrim(output, spacesCount);<NEW_LINE>}<NEW_LINE>return output;<NEW_LINE>}
(getInt(HTMLFormatterConstants.WRAP_COMMENTS_LENGTH));
1,034,315
public TOTorrent selectHybridHashType(int type) throws TOTorrentException {<NEW_LINE>if (torrent_type != TT_V1_V2) {<NEW_LINE>throw (new TOTorrentException("Torrent isn't hybrid", TOTorrentException.RT_CREATE_FAILED));<NEW_LINE>}<NEW_LINE>TOTorrent clone = TOTorrentFactory.deserialiseFromBEncodedByteArray(serialiseToByteArray());<NEW_LINE>TorrentUtils.clearTorrentFileName(clone);<NEW_LINE>Map<String, Object> private_props = (Map<String, Object>) clone.getAdditionalMapProperty(AZUREUS_PRIVATE_PROPERTIES);<NEW_LINE>if (type == TT_V1) {<NEW_LINE>if (private_props != null) {<NEW_LINE>private_props.remove(TorrentUtils.TORRENT_AZ_PROP_HYBRID_HASH_V2);<NEW_LINE>}<NEW_LINE>} else if (type == TT_V2) {<NEW_LINE>if (private_props == null) {<NEW_LINE>private_props = new HashMap<>();<NEW_LINE>}<NEW_LINE>private_props.<MASK><NEW_LINE>clone.setAdditionalMapProperty(AZUREUS_PRIVATE_PROPERTIES, private_props);<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>// recreate with new properties so result represents this<NEW_LINE>return (TOTorrentFactory.deserialiseFromBEncodedByteArray(BEncoder.encode(clone.serialiseToMap())));<NEW_LINE>} catch (Throwable e) {<NEW_LINE>throw (new TOTorrentException("Encode failed", TOTorrentException.RT_CREATE_FAILED, e));<NEW_LINE>}<NEW_LINE>}
put(TorrentUtils.TORRENT_AZ_PROP_HYBRID_HASH_V2, 1L);
1,132,369
final GetApplicationComponentStrategiesResult executeGetApplicationComponentStrategies(GetApplicationComponentStrategiesRequest getApplicationComponentStrategiesRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(getApplicationComponentStrategiesRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<GetApplicationComponentStrategiesRequest> request = null;<NEW_LINE>Response<GetApplicationComponentStrategiesResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new GetApplicationComponentStrategiesRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(getApplicationComponentStrategiesRequest));<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, "MigrationHubStrategy");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "GetApplicationComponentStrategies");<NEW_LINE>request.<MASK><NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<GetApplicationComponentStrategiesResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new GetApplicationComponentStrategiesResultJsonUnmarshaller());<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);
333,313
String tag(String namespace, String local, int type, boolean localIsQname) {<NEW_LINE>String prefix = ns.get(namespace);<NEW_LINE>if (type != FAST && type != FASTATTR) {<NEW_LINE>if ((!localIsQname) && !XMLChar.isValidNCName(local))<NEW_LINE>return splitTag(namespace + local, type);<NEW_LINE>if (namespace.equals(RDFNS)) {<NEW_LINE>// Description, ID, nodeID, about, aboutEach, aboutEachPrefix, li<NEW_LINE>// bagID parseType resource datatype RDF<NEW_LINE>if (badRDF.contains(local)) {<NEW_LINE>logger.warn("The URI rdf:" + local + " cannot be serialized in RDF/XML.");<NEW_LINE>throw new InvalidPropertyURIException("rdf:" + local);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>boolean cookUp = false;<NEW_LINE>if (prefix == null) {<NEW_LINE>checkURI(namespace);<NEW_LINE>logger.warn("Internal error: unexpected QName URI: <" + namespace + ">. Fixing up with j.cook.up code.", new BrokenException("unexpected QName URI " + namespace));<NEW_LINE>cookUp = true;<NEW_LINE>} else if (prefix.length() == 0) {<NEW_LINE>if (type == ATTR || type == FASTATTR)<NEW_LINE>cookUp = true;<NEW_LINE>else<NEW_LINE>return local;<NEW_LINE>}<NEW_LINE>if (cookUp)<NEW_LINE>return <MASK><NEW_LINE>return prefix + ":" + local;<NEW_LINE>}
cookUpAttribution(type, namespace, local);
1,587,253
final GetFaceSearchResult executeGetFaceSearch(GetFaceSearchRequest getFaceSearchRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(getFaceSearchRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<GetFaceSearchRequest> request = null;<NEW_LINE>Response<GetFaceSearchResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new GetFaceSearchRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(getFaceSearchRequest));<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, "Rekognition");<NEW_LINE>request.<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<GetFaceSearchResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new GetFaceSearchResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
addHandlerContext(HandlerContextKey.OPERATION_NAME, "GetFaceSearch");
1,291,926
protected String doIt() throws Exception {<NEW_LINE>// Instance current Payment Selection<NEW_LINE>MPaySelection paySelection = new MPaySelection(getCtx(), getRecord_ID(), get_TrxName());<NEW_LINE>sequence.set(paySelection.getLastLineNo());<NEW_LINE>// Loop for keys<NEW_LINE>getSelectionKeys().forEach(key -> {<NEW_LINE>// get values from result set<NEW_LINE>int movementId = key;<NEW_LINE>String paymentRule = getSelectionAsString(key, "HRM_PaymentRule");<NEW_LINE>BigDecimal <MASK><NEW_LINE>BigDecimal convertedAmount = getSelectionAsBigDecimal(key, "HRM_ConvertedAmount");<NEW_LINE>MPaySelectionLine line = new MPaySelectionLine(paySelection, sequence.getAndAdd(10), paymentRule);<NEW_LINE>// Add Order<NEW_LINE>X_HR_Movement payrollMovement = new X_HR_Movement(getCtx(), movementId, get_TrxName());<NEW_LINE>Optional<X_HR_Process> mybePayrollProcess = Optional.ofNullable(payrollProcessMap.get(payrollMovement.getHR_Process_ID()));<NEW_LINE>X_HR_Process payrollProcess = mybePayrollProcess.orElseGet(() -> {<NEW_LINE>X_HR_Process processFromMovement = (X_HR_Process) payrollMovement.getHR_Process();<NEW_LINE>payrollProcessMap.put(payrollMovement.getHR_Process_ID(), processFromMovement);<NEW_LINE>return processFromMovement;<NEW_LINE>});<NEW_LINE>// Set from Payroll Movement and conversion type<NEW_LINE>line.setHRMovement(payrollMovement, payrollProcess.getC_ConversionType_ID(), sourceAmount, convertedAmount);<NEW_LINE>// Save<NEW_LINE>line.saveEx();<NEW_LINE>});<NEW_LINE>// Default Ok<NEW_LINE>return "@OK@";<NEW_LINE>}
sourceAmount = getSelectionAsBigDecimal(key, "HRM_Amount");
1,768,253
public RbacTokenResponse queryToken(RbacTokenRequest request) {<NEW_LINE>try {<NEW_LINE>HttpResponse response = httpClient.postHttpRequestAbsoluteUrl("/v4/token", null, HttpUtils.serialize(request));<NEW_LINE>if (response.getStatusCode() == HttpStatus.SC_OK) {<NEW_LINE>RbacTokenResponse result = HttpUtils.deserialize(response.getContent(), RbacTokenResponse.class);<NEW_LINE>result.setStatusCode(HttpStatus.SC_OK);<NEW_LINE>return result;<NEW_LINE>}<NEW_LINE>if (response.getStatusCode() == HttpStatus.SC_NOT_FOUND) {<NEW_LINE>RbacTokenResponse result = new RbacTokenResponse();<NEW_LINE>result.<MASK><NEW_LINE>return result;<NEW_LINE>}<NEW_LINE>if (response.getStatusCode() == HttpStatus.SC_UNAUTHORIZED || response.getStatusCode() == HttpStatus.SC_FORBIDDEN) {<NEW_LINE>RbacTokenResponse result = new RbacTokenResponse();<NEW_LINE>result.setStatusCode(response.getStatusCode());<NEW_LINE>ErrorMessage errorMessage = HttpUtils.deserialize(response.getContent(), ErrorMessage.class);<NEW_LINE>result.setErrorCode(errorMessage.getErrorCode());<NEW_LINE>return result;<NEW_LINE>}<NEW_LINE>throw new OperationException("query token failed, statusCode = " + response.getStatusCode() + "; message = " + response.getMessage() + "; content = " + response.getContent());<NEW_LINE>} catch (IOException e) {<NEW_LINE>throw new OperationException("query token failed", e);<NEW_LINE>}<NEW_LINE>}
setStatusCode(response.getStatusCode());
357,674
static FillingSchedule create(int holeStart, int holeEnd, int[] counts, int[][] leftoverHoles) {<NEW_LINE>List<ScheduleEntry> schedule = new ArrayList<>();<NEW_LINE>if (leftoverHoles == EMPTY_INT_ARRAY_ARRAY) {<NEW_LINE>// packing static fields is not as interesting as instance fields: the array<NEW_LINE>// created<NEW_LINE>// to remember the hole would be bigger than what we would gain. Only schedule<NEW_LINE>// for<NEW_LINE>// direct parent.<NEW_LINE>scheduleHole(<MASK><NEW_LINE>return new FillingSchedule(schedule);<NEW_LINE>} else {<NEW_LINE>List<int[]> nextHoles = new ArrayList<>();<NEW_LINE>scheduleHole(holeStart, holeEnd, counts, schedule, nextHoles);<NEW_LINE>if (leftoverHoles != null) {<NEW_LINE>for (int[] hole : leftoverHoles) {<NEW_LINE>scheduleHole(hole[0], hole[1], counts, schedule, nextHoles);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return new FillingSchedule(schedule, nextHoles);<NEW_LINE>}<NEW_LINE>}
holeStart, holeEnd, counts, schedule);
1,709,218
public List<String> fakeFiles(final List<Integer> expectedTiles, final int[] expectedCycles, final IlluminaFileUtil.SupportedIlluminaFormat format) {<NEW_LINE>if (tileIndex == null) {<NEW_LINE>return Collections.singletonList("Tile index(" + <MASK><NEW_LINE>}<NEW_LINE>final List<String> ret = tileIndex.verify(expectedTiles);<NEW_LINE>for (final int expectedCycle : expectedCycles) {<NEW_LINE>if (!cycleFileMap.containsKey(expectedCycle)) {<NEW_LINE>// we need to fake a bci file for the tile index<NEW_LINE>final BclIndexFaker bciFileFaker = new BclIndexFaker();<NEW_LINE>final MultiTileBclFileFaker bclFileFaker = new MultiTileBclFileFaker();<NEW_LINE>try {<NEW_LINE>bciFileFaker.fakeBciFile(new File(basecallLaneDir, String.format("%04d", expectedCycle) + ".bcl.bgzf.bci"), tileIndex);<NEW_LINE>bclFileFaker.fakeMultiTileBclFile(new File(basecallLaneDir, String.format("%04d", expectedCycle) + ".bcl.bgzf"), tileIndex);<NEW_LINE>} catch (final IOException e) {<NEW_LINE>return Collections.singletonList("Could not create tile index file: " + bci.getAbsolutePath());<NEW_LINE>}<NEW_LINE>ret.add(expectedCycle + ".bcl.bgzf not found in " + base);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return ret;<NEW_LINE>}
bci.getAbsolutePath() + ") does not exist!");
528,186
private Map<String, Object> navToMap(final NavResult nav, final int maxDepth, final int currentDepth) throws Exception {<NEW_LINE>final Map<String, Object> navMap = new HashMap<String, Object>();<NEW_LINE>navMap.put("title", nav.getTitle());<NEW_LINE>navMap.put("target", nav.getTarget());<NEW_LINE>navMap.put("code", nav.getCodeLink());<NEW_LINE>navMap.put("folder", nav.getFolderId());<NEW_LINE>navMap.put("host", nav.getHostId());<NEW_LINE>navMap.put("href", nav.getHref());<NEW_LINE>navMap.put("languageId", nav.getLanguageId());<NEW_LINE>navMap.put("order", nav.getOrder());<NEW_LINE>navMap.put("type", nav.getType());<NEW_LINE>navMap.put("hash", nav.hashCode());<NEW_LINE>if (currentDepth < maxDepth) {<NEW_LINE>final List<Map<String, Object>> childs = new ArrayList<>();<NEW_LINE>for (final NavResult child : nav.getChildren()) {<NEW_LINE>int startDepth = currentDepth;<NEW_LINE>childs.add(navToMap(<MASK><NEW_LINE>}<NEW_LINE>navMap.put("children", childs);<NEW_LINE>}<NEW_LINE>return navMap;<NEW_LINE>}
child, maxDepth, ++startDepth));
165,670
public DataFlowInfo createDataFlow(InlongGroupInfo groupInfo, SinkResponse sinkResponse) {<NEW_LINE>String groupId = sinkResponse.getInlongGroupId();<NEW_LINE>String streamId = sinkResponse.getInlongStreamId();<NEW_LINE>// TODO Support all source type, include AUTO_PUSH.<NEW_LINE>List<SourceResponse> sourceList = streamSourceService.listSource(groupId, streamId);<NEW_LINE>if (CollectionUtils.isEmpty(sourceList)) {<NEW_LINE>throw new WorkflowListenerException(String.format("Source not found by groupId=%s and streamId=%s", groupId, streamId));<NEW_LINE>}<NEW_LINE>// Get all field info<NEW_LINE>List<FieldInfo> sourceFields = new ArrayList<>();<NEW_LINE>List<FieldInfo> sinkFields = new ArrayList<>();<NEW_LINE>// TODO Support more than one source and one sink<NEW_LINE>final SourceResponse sourceResponse = sourceList.get(0);<NEW_LINE>boolean isAllMigration = SourceInfoUtils.isBinlogAllMigration(sourceResponse);<NEW_LINE>List<FieldMappingUnit> mappingUnitList;<NEW_LINE>InlongStreamInfo streamInfo = streamService.get(groupId, streamId);<NEW_LINE>if (isAllMigration) {<NEW_LINE>mappingUnitList = FieldInfoUtils.setAllMigrationFieldMapping(sourceFields, sinkFields);<NEW_LINE>} else {<NEW_LINE>mappingUnitList = FieldInfoUtils.createFieldInfo(streamInfo.getFieldList(), sinkResponse.<MASK><NEW_LINE>}<NEW_LINE>FieldMappingRule fieldMappingRule = new FieldMappingRule(mappingUnitList.toArray(new FieldMappingUnit[0]));<NEW_LINE>// Get source info<NEW_LINE>String masterAddress = getSpecifiedParam(Constant.TUBE_MASTER_URL);<NEW_LINE>PulsarClusterInfo pulsarCluster = getPulsarClusterInfo(groupInfo.getMiddlewareType());<NEW_LINE>SourceInfo sourceInfo = SourceInfoUtils.createSourceInfo(pulsarCluster, masterAddress, clusterBean, groupInfo, streamInfo, sourceResponse, sourceFields);<NEW_LINE>// Get sink info<NEW_LINE>SinkInfo sinkInfo = SinkInfoUtils.createSinkInfo(sourceResponse, sinkResponse, sinkFields);<NEW_LINE>// Get transformation info<NEW_LINE>TransformationInfo transInfo = new TransformationInfo(fieldMappingRule);<NEW_LINE>// Get properties<NEW_LINE>Map<String, Object> properties = new HashMap<>();<NEW_LINE>if (MapUtils.isNotEmpty(sinkResponse.getProperties())) {<NEW_LINE>properties.putAll(sinkResponse.getProperties());<NEW_LINE>}<NEW_LINE>properties.put(Constant.DATA_FLOW_GROUP_ID_KEY, groupId);<NEW_LINE>return new DataFlowInfo(sinkResponse.getId(), sourceInfo, transInfo, sinkInfo, properties);<NEW_LINE>}
getFieldList(), sourceFields, sinkFields);
1,168,307
private BufferSet appendInvertedGeometry(IntBuffer indicesAsInt, DoubleBuffer verticesAsDouble, FloatBuffer normalsAsFloat, IntBuffer colorIndices) {<NEW_LINE>indicesAsInt.position(0);<NEW_LINE>normalsAsFloat.position(0);<NEW_LINE>ByteBuffer newVerticesByteBuffer = ByteBuffer.allocate(verticesAsDouble.capacity() * 16);<NEW_LINE>DoubleBuffer newVerticesBuffer = newVerticesByteBuffer.order(ByteOrder.LITTLE_ENDIAN).asDoubleBuffer();<NEW_LINE>verticesAsDouble.position(0);<NEW_LINE>newVerticesBuffer.put(verticesAsDouble);<NEW_LINE>verticesAsDouble.position(0);<NEW_LINE>newVerticesBuffer.put(verticesAsDouble);<NEW_LINE>int nrVertices = verticesAsDouble.capacity() / 3;<NEW_LINE>ByteBuffer newIntByteBuffer = ByteBuffer.allocate(indicesAsInt.capacity() * 8);<NEW_LINE>IntBuffer newIntBuffer = newIntByteBuffer.order(ByteOrder.LITTLE_ENDIAN).asIntBuffer();<NEW_LINE>for (int i = 0; i < indicesAsInt.capacity(); i += 3) {<NEW_LINE>int index1 = indicesAsInt.get();<NEW_LINE>int index2 = indicesAsInt.get();<NEW_LINE>int index3 = indicesAsInt.get();<NEW_LINE>newIntBuffer.put(i, index1);<NEW_LINE>newIntBuffer.put(i + 1, index2);<NEW_LINE>newIntBuffer.put(i + 2, index3);<NEW_LINE>// And draw the same triangle again in a different order<NEW_LINE>newIntBuffer.put(i + indicesAsInt.<MASK><NEW_LINE>newIntBuffer.put(i + indicesAsInt.capacity() + 1, index3 + nrVertices);<NEW_LINE>newIntBuffer.put(i + indicesAsInt.capacity() + 2, index2 + nrVertices);<NEW_LINE>}<NEW_LINE>ByteBuffer newNormalsByteBuffer = ByteBuffer.allocate(normalsAsFloat.capacity() * 8);<NEW_LINE>FloatBuffer newNormalsBuffer = newNormalsByteBuffer.order(ByteOrder.LITTLE_ENDIAN).asFloatBuffer();<NEW_LINE>normalsAsFloat.position(0);<NEW_LINE>newNormalsBuffer.put(normalsAsFloat);<NEW_LINE>for (int i = 0; i < normalsAsFloat.capacity(); i += 3) {<NEW_LINE>float[] normal = new float[] { normalsAsFloat.get(i + 0), normalsAsFloat.get(i + 1), normalsAsFloat.get(i + 2) };<NEW_LINE>normal = Vector.invert(normal);<NEW_LINE>newNormalsBuffer.put(i + normalsAsFloat.capacity(), normal[0]);<NEW_LINE>newNormalsBuffer.put(i + 1 + normalsAsFloat.capacity(), normal[1]);<NEW_LINE>newNormalsBuffer.put(i + 2 + normalsAsFloat.capacity(), normal[2]);<NEW_LINE>}<NEW_LINE>ByteBuffer newColorsByteBuffer = ByteBuffer.allocate(colorIndices.capacity() * 8);<NEW_LINE>IntBuffer newColorsBuffer = newColorsByteBuffer.order(ByteOrder.LITTLE_ENDIAN).asIntBuffer();<NEW_LINE>colorIndices.position(0);<NEW_LINE>newColorsBuffer.put(colorIndices);<NEW_LINE>colorIndices.position(0);<NEW_LINE>newColorsBuffer.put(colorIndices);<NEW_LINE>return new BufferSet(newIntByteBuffer, newVerticesByteBuffer, newNormalsByteBuffer, newColorsByteBuffer);<NEW_LINE>}
capacity(), index1 + nrVertices);
743,720
private void runBatfish(BindPortFutures bindPortFutures) throws ExecutionException, InterruptedException {<NEW_LINE>String batfishArgs = String.format("%s -%s %s -%s %s -%s %s -%s %s", _settings.getBatfishArgs(), org.batfish.config.Settings.ARG_RUN_MODE, _settings.getBatfishRunMode(), org.batfish.config.Settings.ARG_COORDINATOR_REGISTER, "true", org.batfish.config.Settings.ARG_COORDINATOR_POOL_PORT, bindPortFutures.getPoolPort().get(), org.batfish.config.Settings.ARG_TRACING_ENABLE, _settings.getTracingEnable());<NEW_LINE>// If we are running a command file, just use an ephemeral port for worker<NEW_LINE>if (_settings.getCommandFile() != null) {<NEW_LINE>batfishArgs += String.format(" -%s %s", org.batfish.config.Settings.ARG_SERVICE_PORT, 0);<NEW_LINE>}<NEW_LINE>String[] initialArgArray = getArgArrayFromString(batfishArgs);<NEW_LINE>List<String> args = new ArrayList<>(Arrays.asList(initialArgArray));<NEW_LINE>final String[] argArray = args.toArray(new String[] {});<NEW_LINE>_logger.debugf("Starting batfish worker with args: %s\n", Arrays.toString(argArray));<NEW_LINE>Thread thread = new Thread("batfishThread") {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void run() {<NEW_LINE>try {<NEW_LINE>org.batfish.main.<MASK><NEW_LINE>} catch (Exception e) {<NEW_LINE>_logger.errorf("Initialization of batfish failed with args: %s\nExceptionMessage: %s\n", Arrays.toString(argArray), e.getMessage());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>};<NEW_LINE>thread.start();<NEW_LINE>}
Driver.main(argArray, _logger);
391,747
private void initializeDefaultVirtualNetworkModels() {<NEW_LINE>List<TrafficType> types <MASK><NEW_LINE>types.add(TrafficType.Management);<NEW_LINE>types.add(TrafficType.Storage);<NEW_LINE>types.add(TrafficType.Control);<NEW_LINE>List<NetworkVO> dbNets = findManagedNetworks(types);<NEW_LINE>for (NetworkVO net : dbNets) {<NEW_LINE>VirtualNetworkModel vnModel = getDatabase().lookupVirtualNetwork(null, getCanonicalName(net), net.getTrafficType());<NEW_LINE>if (vnModel == null) {<NEW_LINE>vnModel = new VirtualNetworkModel(net, null, getCanonicalName(net), net.getTrafficType());<NEW_LINE>vnModel.build(getModelController(), net);<NEW_LINE>try {<NEW_LINE>if (!vnModel.verify(getModelController())) {<NEW_LINE>vnModel.update(getModelController());<NEW_LINE>}<NEW_LINE>} catch (Exception ex) {<NEW_LINE>s_logger.warn("virtual-network update: ", ex);<NEW_LINE>}<NEW_LINE>getDatabase().getVirtualNetworks().add(vnModel);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
= new ArrayList<TrafficType>();
614,676
public boolean eIsSet(int featureID) {<NEW_LINE>switch(featureID) {<NEW_LINE>case ModelPackage.LED_STRIP_CONFIGURATION__CHIPTYPE:<NEW_LINE>return CHIPTYPE_EDEFAULT == null ? chiptype != null : !CHIPTYPE_EDEFAULT.equals(chiptype);<NEW_LINE>case ModelPackage.LED_STRIP_CONFIGURATION__FRAMEDURATION:<NEW_LINE>return FRAMEDURATION_EDEFAULT == null ? frameduration != null <MASK><NEW_LINE>case ModelPackage.LED_STRIP_CONFIGURATION__CLOCKFREQUENCY:<NEW_LINE>return CLOCKFREQUENCY_EDEFAULT == null ? clockfrequency != null : !CLOCKFREQUENCY_EDEFAULT.equals(clockfrequency);<NEW_LINE>case ModelPackage.LED_STRIP_CONFIGURATION__COLOR_MAPPING:<NEW_LINE>return COLOR_MAPPING_EDEFAULT == null ? colorMapping != null : !COLOR_MAPPING_EDEFAULT.equals(colorMapping);<NEW_LINE>case ModelPackage.LED_STRIP_CONFIGURATION__SUB_DEVICES:<NEW_LINE>return SUB_DEVICES_EDEFAULT == null ? subDevices != null : !SUB_DEVICES_EDEFAULT.equals(subDevices);<NEW_LINE>}<NEW_LINE>return super.eIsSet(featureID);<NEW_LINE>}
: !FRAMEDURATION_EDEFAULT.equals(frameduration);
555,238
public void onRestoreInstanceState(Parcelable state) {<NEW_LINE>if (state instanceof Bundle) {<NEW_LINE>Bundle bundle = (Bundle) state;<NEW_LINE>Serializable brand = bundle.getSerializable(BootstrapBrand.KEY);<NEW_LINE>if (brand instanceof BootstrapBrand) {<NEW_LINE>bootstrapBrand = (BootstrapBrand) brand;<NEW_LINE>}<NEW_LINE>this.<MASK><NEW_LINE>this.drawnProgress = bundle.getInt(KEY_DRAWN_PROGRESS);<NEW_LINE>this.striped = bundle.getBoolean(KEY_STRIPED);<NEW_LINE>this.animated = bundle.getBoolean(KEY_ANIMATED);<NEW_LINE>this.rounded = bundle.getBoolean(RoundableView.KEY);<NEW_LINE>this.bootstrapSize = bundle.getFloat(BootstrapSizeView.KEY);<NEW_LINE>state = bundle.getParcelable(TAG);<NEW_LINE>}<NEW_LINE>super.onRestoreInstanceState(state);<NEW_LINE>updateBootstrapState();<NEW_LINE>setProgress(userProgress);<NEW_LINE>}
userProgress = bundle.getInt(KEY_USER_PROGRESS);
171,280
public static // FIXME: Proxy could just pass the pk index here which is much faster.<NEW_LINE>long createRowWithPrimaryKey(Table table, long primaryKeyColumnIndex, @Nullable Object primaryKeyValue) {<NEW_LINE>RealmFieldType type = table.getColumnType(primaryKeyColumnIndex);<NEW_LINE>final <MASK><NEW_LINE>if (type == RealmFieldType.STRING) {<NEW_LINE>if (primaryKeyValue != null && !(primaryKeyValue instanceof String)) {<NEW_LINE>throw new IllegalArgumentException("Primary key value is not a String: " + primaryKeyValue);<NEW_LINE>}<NEW_LINE>return nativeCreateRowWithStringPrimaryKey(sharedRealm.getNativePtr(), table.getNativePtr(), primaryKeyColumnIndex, (String) primaryKeyValue);<NEW_LINE>} else if (type == RealmFieldType.INTEGER) {<NEW_LINE>long value = primaryKeyValue == null ? 0 : Long.parseLong(primaryKeyValue.toString());<NEW_LINE>return nativeCreateRowWithLongPrimaryKey(sharedRealm.getNativePtr(), table.getNativePtr(), primaryKeyColumnIndex, value, primaryKeyValue == null);<NEW_LINE>} else if (type == RealmFieldType.OBJECT_ID) {<NEW_LINE>if (primaryKeyValue != null && !(primaryKeyValue instanceof ObjectId)) {<NEW_LINE>throw new IllegalArgumentException("Primary key value is not an ObjectId: " + primaryKeyValue);<NEW_LINE>}<NEW_LINE>String objectIdValue = primaryKeyValue == null ? null : primaryKeyValue.toString();<NEW_LINE>return nativeCreateRowWithObjectIdPrimaryKey(sharedRealm.getNativePtr(), table.getNativePtr(), primaryKeyColumnIndex, objectIdValue);<NEW_LINE>} else if (type == RealmFieldType.UUID) {<NEW_LINE>if (primaryKeyValue != null && !(primaryKeyValue instanceof UUID)) {<NEW_LINE>throw new IllegalArgumentException("Primary key value is not an UUID: " + primaryKeyValue);<NEW_LINE>}<NEW_LINE>String uuidValue = primaryKeyValue == null ? null : primaryKeyValue.toString();<NEW_LINE>return nativeCreateRowWithUUIDPrimaryKey(sharedRealm.getNativePtr(), table.getNativePtr(), primaryKeyColumnIndex, uuidValue);<NEW_LINE>} else {<NEW_LINE>throw new RealmException("Cannot check for duplicate rows for unsupported primary key type: " + type);<NEW_LINE>}<NEW_LINE>}
OsSharedRealm sharedRealm = table.getSharedRealm();
1,155,333
public static Component copyComponentProperties(Component source, Component target) throws Throwable {<NEW_LINE>if (!source.getClass().equals(target.getClass())) {<NEW_LINE>throw new IllegalArgumentException("Source and target classes must be identical");<NEW_LINE>}<NEW_LINE>final Class componentClass = source.getClass();<NEW_LINE>final Method[] componentMethods = componentClass.getMethods();<NEW_LINE>for (Method componentMethod : componentMethods) {<NEW_LINE>// A SimpleProperty which takes a single argument is a property setter.<NEW_LINE>if (componentMethod.isAnnotationPresent(SimpleProperty.class) && componentMethod.getParameterTypes().length == 1) {<NEW_LINE>final Method propertySetterMethod = componentMethod;<NEW_LINE>try {<NEW_LINE>final String propertyName = propertySetterMethod.getName();<NEW_LINE>// Look for a property copier method.<NEW_LINE>final Method propertyCopierMethod = getPropertyCopierMethod("Copy" + propertyName, componentClass);<NEW_LINE>if (propertyCopierMethod != null) {<NEW_LINE>propertyCopierMethod.invoke(target, source);<NEW_LINE>// Don't return here because we still need to copy more properties.<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>// It's fine if there's no copy method. We'll look for a getter.<NEW_LINE>// The getter will have the same name as the setter<NEW_LINE>final Method propertyGetterMethod = componentClass.getMethod(propertyName);<NEW_LINE>final Class propertySetterParameterType = <MASK><NEW_LINE>// The getter also needs to be a SimpleProperty and its return type needs to be<NEW_LINE>// compatible with the setter's single argument type<NEW_LINE>if (propertyGetterMethod.isAnnotationPresent(SimpleProperty.class) && propertySetterParameterType.isAssignableFrom(propertyGetterMethod.getReturnType())) {<NEW_LINE>final Object propertyValue = propertyGetterMethod.invoke(source);<NEW_LINE>propertySetterMethod.invoke(target, propertyValue);<NEW_LINE>}<NEW_LINE>} catch (NoSuchMethodException e) {<NEW_LINE>// It's fine if there's no getter method. We just won't invoke the setter.<NEW_LINE>continue;<NEW_LINE>} catch (InvocationTargetException e2) {<NEW_LINE>// This re-throws any Exceptions generated by the property getters or setters themselves.<NEW_LINE>throw e2.getCause();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return target;<NEW_LINE>}
propertySetterMethod.getParameterTypes()[0];
476,184
protected void checkTopics() {<NEW_LINE>if (this.containerProperties.isMissingTopicsFatal() && this.containerProperties.getTopicPattern() == null) {<NEW_LINE>Map<String, Object> configs = this.consumerFactory.getConfigurationProperties().entrySet().stream().filter(entry -> AdminClientConfig.configNames().contains(entry.getKey())).collect(Collectors.toMap(Entry::getKey, Entry::getValue));<NEW_LINE>List<String> missing = null;<NEW_LINE>try (AdminClient client = AdminClient.create(configs)) {<NEW_LINE>// NOSONAR - false positive null check<NEW_LINE>if (client != null) {<NEW_LINE>String[] topics = this.containerProperties.getTopics();<NEW_LINE>if (topics == null) {<NEW_LINE>topics = Arrays.stream(this.containerProperties.getTopicPartitions()).map(TopicPartitionOffset::getTopic).toArray(String[]::new);<NEW_LINE>}<NEW_LINE>DescribeTopicsResult result = client.describeTopics(Arrays.asList(topics));<NEW_LINE>missing = result.topicNameValues().entrySet().stream().filter(entry -> {<NEW_LINE>try {<NEW_LINE>entry.getValue().get(this.topicCheckTimeout, TimeUnit.SECONDS);<NEW_LINE>return false;<NEW_LINE>} catch (@SuppressWarnings("unused") Exception e) {<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>}).map(Entry::getKey).<MASK><NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>this.logger.error(e, "Failed to check topic existence");<NEW_LINE>}<NEW_LINE>if (missing != null && missing.size() > 0) {<NEW_LINE>throw new IllegalStateException("Topic(s) " + missing.toString() + " is/are not present and missingTopicsFatal is true");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
collect(Collectors.toList());
1,772,802
private static void downloadData() throws Exception {<NEW_LINE>// Create directory if required<NEW_LINE>File directory = new File(DATA_PATH);<NEW_LINE>if (!directory.exists())<NEW_LINE>directory.mkdir();<NEW_LINE>// Download file:<NEW_LINE>String archizePath = DATA_PATH + "aclImdb_v1.tar.gz";<NEW_LINE><MASK><NEW_LINE>String extractedPath = DATA_PATH + "aclImdb";<NEW_LINE>File extractedFile = new File(extractedPath);<NEW_LINE>if (!archiveFile.exists()) {<NEW_LINE>System.out.println("Starting data download (80MB)...");<NEW_LINE>FileUtils.copyURLToFile(new URL(DATA_URL), archiveFile);<NEW_LINE>System.out.println("Data (.tar.gz file) downloaded to " + archiveFile.getAbsolutePath());<NEW_LINE>// Extract tar.gz file to output directory<NEW_LINE>extractTarGz(archizePath, DATA_PATH);<NEW_LINE>} else {<NEW_LINE>// Assume if archive (.tar.gz) exists, then data has already been extracted<NEW_LINE>System.out.println("Data (.tar.gz file) already exists at " + archiveFile.getAbsolutePath());<NEW_LINE>if (!extractedFile.exists()) {<NEW_LINE>// Extract tar.gz file to output directory<NEW_LINE>extractTarGz(archizePath, DATA_PATH);<NEW_LINE>} else {<NEW_LINE>System.out.println("Data (extracted) already exists at " + extractedFile.getAbsolutePath());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
File archiveFile = new File(archizePath);
343,043
final ValidateSecurityProfileBehaviorsResult executeValidateSecurityProfileBehaviors(ValidateSecurityProfileBehaviorsRequest validateSecurityProfileBehaviorsRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(validateSecurityProfileBehaviorsRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<ValidateSecurityProfileBehaviorsRequest> request = null;<NEW_LINE>Response<ValidateSecurityProfileBehaviorsResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new ValidateSecurityProfileBehaviorsRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(validateSecurityProfileBehaviorsRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "IoT");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ValidateSecurityProfileBehaviors");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<ValidateSecurityProfileBehaviorsResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new ValidateSecurityProfileBehaviorsResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);
1,320,612
public static DescribeEventCountCurveResponse unmarshall(DescribeEventCountCurveResponse describeEventCountCurveResponse, UnmarshallerContext context) {<NEW_LINE>describeEventCountCurveResponse.setRequestId<MASK><NEW_LINE>describeEventCountCurveResponse.setSuccess(context.booleanValue("DescribeEventCountCurveResponse.Success"));<NEW_LINE>CurveData curveData = new CurveData();<NEW_LINE>TimeScope timeScope = new TimeScope();<NEW_LINE>timeScope.setStart(context.longValue("DescribeEventCountCurveResponse.CurveData.TimeScope.Start"));<NEW_LINE>timeScope.setEnd(context.longValue("DescribeEventCountCurveResponse.CurveData.TimeScope.End"));<NEW_LINE>timeScope.setInterval(context.integerValue("DescribeEventCountCurveResponse.CurveData.TimeScope.Interval"));<NEW_LINE>timeScope.setStep(context.integerValue("DescribeEventCountCurveResponse.CurveData.TimeScope.Step"));<NEW_LINE>curveData.setTimeScope(timeScope);<NEW_LINE>List<Item> items = new ArrayList<Item>();<NEW_LINE>for (int i = 0; i < context.lengthValue("DescribeEventCountCurveResponse.CurveData.Items.Length"); i++) {<NEW_LINE>Item item = new Item();<NEW_LINE>item.setName(context.stringValue("DescribeEventCountCurveResponse.CurveData.Items[" + i + "].Name"));<NEW_LINE>List<DataItem> data = new ArrayList<DataItem>();<NEW_LINE>for (int j = 0; j < context.lengthValue("DescribeEventCountCurveResponse.CurveData.Items[" + i + "].Data.Length"); j++) {<NEW_LINE>DataItem dataItem = new DataItem();<NEW_LINE>dataItem.setHigh(context.integerValue("DescribeEventCountCurveResponse.CurveData.Items[" + i + "].Data[" + j + "].High"));<NEW_LINE>dataItem.setTotal(context.integerValue("DescribeEventCountCurveResponse.CurveData.Items[" + i + "].Data[" + j + "].Total"));<NEW_LINE>dataItem.setLow(context.integerValue("DescribeEventCountCurveResponse.CurveData.Items[" + i + "].Data[" + j + "].Low"));<NEW_LINE>dataItem.setSerious(context.integerValue("DescribeEventCountCurveResponse.CurveData.Items[" + i + "].Data[" + j + "].Serious"));<NEW_LINE>dataItem.setSuspicious(context.integerValue("DescribeEventCountCurveResponse.CurveData.Items[" + i + "].Data[" + j + "].Suspicious"));<NEW_LINE>dataItem.setRemind(context.integerValue("DescribeEventCountCurveResponse.CurveData.Items[" + i + "].Data[" + j + "].Remind"));<NEW_LINE>dataItem.setMedium(context.integerValue("DescribeEventCountCurveResponse.CurveData.Items[" + i + "].Data[" + j + "].Medium"));<NEW_LINE>data.add(dataItem);<NEW_LINE>}<NEW_LINE>item.setData(data);<NEW_LINE>items.add(item);<NEW_LINE>}<NEW_LINE>curveData.setItems(items);<NEW_LINE>describeEventCountCurveResponse.setCurveData(curveData);<NEW_LINE>return describeEventCountCurveResponse;<NEW_LINE>}
(context.stringValue("DescribeEventCountCurveResponse.RequestId"));
217,790
private void configurePorts(Instance instance) {<NEW_LINE>BitWidth dataWid = instance.getAttributeValue(StdAttr.WIDTH);<NEW_LINE>int data = dataWid == null ? 32 : dataWid.getWidth();<NEW_LINE>int shift = 1;<NEW_LINE>while ((1 << shift) < data) shift++;<NEW_LINE>instance.getAttributeSet().setValue(SHIFT_BITS_ATTR, shift);<NEW_LINE>Port[] ps = new Port[3];<NEW_LINE>ps[IN0] = new Port(-40, -10, Port.INPUT, data);<NEW_LINE>ps[IN1] = new Port(-40, <MASK><NEW_LINE>ps[OUT] = new Port(0, 0, Port.OUTPUT, data);<NEW_LINE>ps[IN0].setToolTip(S.getter("shifterInputTip"));<NEW_LINE>ps[IN1].setToolTip(S.getter("shifterDistanceTip"));<NEW_LINE>ps[OUT].setToolTip(S.getter("shifterOutputTip"));<NEW_LINE>instance.setPorts(ps);<NEW_LINE>}
10, Port.INPUT, shift);
1,407,205
protected void addDefaultClientScopes(RealmModel realm, Stream<ClientModel> newClients) {<NEW_LINE>Set<ClientScopeModel> defaultClientScopes = realm.getDefaultClientScopesStream(true).filter(clientScope -> Objects.equals(getId(), clientScope.getProtocol())).collect(Collectors.toSet());<NEW_LINE>Set<ClientScopeModel> nonDefaultClientScopes = realm.getDefaultClientScopesStream(false).filter(clientScope -> Objects.equals(getId(), clientScope.getProtocol())).<MASK><NEW_LINE>Consumer<ClientModel> addDefault = c -> c.addClientScopes(defaultClientScopes, true);<NEW_LINE>Consumer<ClientModel> addNonDefault = c -> c.addClientScopes(nonDefaultClientScopes, false);<NEW_LINE>if (!defaultClientScopes.isEmpty() && !nonDefaultClientScopes.isEmpty())<NEW_LINE>newClients.forEach(addDefault.andThen(addNonDefault));<NEW_LINE>else if (!defaultClientScopes.isEmpty())<NEW_LINE>newClients.forEach(addDefault);<NEW_LINE>else if (!nonDefaultClientScopes.isEmpty())<NEW_LINE>newClients.forEach(addNonDefault);<NEW_LINE>}
collect(Collectors.toSet());
1,461,268
public void clear(int startIndex, int endIndex) {<NEW_LINE>assert startIndex >= 0 && startIndex < numBits : "startIndex=" + startIndex + ", numBits=" + numBits;<NEW_LINE>assert endIndex >= 0 && endIndex <= numBits : "endIndex=" + endIndex + ", numBits=" + numBits;<NEW_LINE>if (endIndex <= startIndex) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>int startWord = startIndex >> 6;<NEW_LINE>int endWord = (endIndex - 1) >> 6;<NEW_LINE>long startmask = -1L << startIndex;<NEW_LINE>long endmask <MASK><NEW_LINE>// invert masks since we are clearing<NEW_LINE>startmask = ~startmask;<NEW_LINE>endmask = ~endmask;<NEW_LINE>if (startWord == endWord) {<NEW_LINE>bits[startWord] &= (startmask | endmask);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>bits[startWord] &= startmask;<NEW_LINE>Arrays.fill(bits, startWord + 1, endWord, 0L);<NEW_LINE>bits[endWord] &= endmask;<NEW_LINE>}
= -1L >>> -endIndex;
412,461
/*@Override<NEW_LINE>public String getMenuName() {//KS TODO not implemented<NEW_LINE>return getString(R.string.snooze_alert);<NEW_LINE>}*/<NEW_LINE>public void addListenerOnButton() {<NEW_LINE>buttonSnooze = (Button) findViewById(R.id.button_snooze);<NEW_LINE>// low alerts<NEW_LINE>disableLowAlerts = (Button) findViewById(R.id.button_disable_low_alerts);<NEW_LINE>clearLowDisabled = (Button) findViewById(R.id.enable_low_alerts);<NEW_LINE>// high alerts<NEW_LINE>disableHighAlerts = (Button) <MASK><NEW_LINE>clearHighDisabled = (Button) findViewById(R.id.enable_high_alerts);<NEW_LINE>// all alerts<NEW_LINE>disableAlerts = (Button) findViewById(R.id.button_disable_alerts);<NEW_LINE>clearDisabled = (Button) findViewById(R.id.enable_alerts);<NEW_LINE>sendRemoteSnooze = (Button) findViewById(R.id.send_remote_snooze);<NEW_LINE>buttonSnooze.setOnClickListener(new View.OnClickListener() {<NEW_LINE><NEW_LINE>public void onClick(View v) {<NEW_LINE>int intValue = getTimeFromSnoozeValue(snoozeValue.getValue());<NEW_LINE>AlertPlayer.getPlayer().Snooze(getApplicationContext(), intValue);<NEW_LINE>Intent intent = new Intent(getApplicationContext(), Home.class);<NEW_LINE>if (ActiveBgAlert.getOnly() != null) {<NEW_LINE>Log.e(TAG, "Snoozed! ActiveBgAlert.getOnly() != null TODO restart Home.class - watchface?");<NEW_LINE>// KS TODO startActivity(intent);<NEW_LINE>}<NEW_LINE>finish();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>showDisableEnableButtons();<NEW_LINE>setOnClickListenerOnDisableButton(disableAlerts, "alerts_disabled_until");<NEW_LINE>setOnClickListenerOnDisableButton(disableLowAlerts, "low_alerts_disabled_until");<NEW_LINE>setOnClickListenerOnDisableButton(disableHighAlerts, "high_alerts_disabled_until");<NEW_LINE>setOnClickListenerOnClearDisabledButton(clearDisabled, "alerts_disabled_until");<NEW_LINE>setOnClickListenerOnClearDisabledButton(clearLowDisabled, "low_alerts_disabled_until");<NEW_LINE>setOnClickListenerOnClearDisabledButton(clearHighDisabled, "high_alerts_disabled_until");<NEW_LINE>}
findViewById(R.id.button_disable_high_alerts);
867,693
void checkConcreteInheritedMethod(MethodBinding concreteMethod, MethodBinding[] abstractMethods) {<NEW_LINE>// Remember that interfaces can only define public instance methods<NEW_LINE>if (concreteMethod.isStatic())<NEW_LINE>// Cannot inherit a static method which is specified as an instance method by an interface<NEW_LINE>problemReporter().staticInheritedMethodConflicts(this.type, concreteMethod, abstractMethods);<NEW_LINE>if (!concreteMethod.isPublic()) {<NEW_LINE>int index = 0, length = abstractMethods.length;<NEW_LINE>if (concreteMethod.isProtected()) {<NEW_LINE>for (; index < length; index++) if (abstractMethods[index].isPublic())<NEW_LINE>break;<NEW_LINE>} else if (concreteMethod.isDefault()) {<NEW_LINE>for (; index < length; index++) if (!abstractMethods[index].isDefault())<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>if (index < length)<NEW_LINE>problemReporter().inheritedMethodReducesVisibility(this.type, concreteMethod, abstractMethods);<NEW_LINE>}<NEW_LINE>if (concreteMethod.thrownExceptions != Binding.NO_EXCEPTIONS)<NEW_LINE>for (int i = abstractMethods.length; --i >= 0; ) checkExceptions(concreteMethod, abstractMethods[i]);<NEW_LINE>// A subclass inheriting this method and putting it up as the implementation to meet its own<NEW_LINE>// obligations should qualify as a use.<NEW_LINE>if (concreteMethod.isOrEnclosedByPrivateType())<NEW_LINE>concreteMethod.original<MASK><NEW_LINE>}
().modifiers |= ExtraCompilerModifiers.AccLocallyUsed;
1,046,453
private void startTests(final MaplyTestCase[] tests, final int index) {<NEW_LINE>if (tests.length != index) {<NEW_LINE>final MaplyTestCase head = tests[index];<NEW_LINE>if (ConfigOptions.getTestState(getApplicationContext(), head.getTestName()) == ConfigOptions.TestState.Selected) {<NEW_LINE>head.setOptions(ConfigOptions.getTestType(this));<NEW_LINE>ConfigOptions.setTestState(getApplicationContext(), head.getTestName(<MASK><NEW_LINE>MaplyTestCase.MaplyTestCaseListener listener = new MaplyTestCase.MaplyTestCaseListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onFinish(MaplyTestResult resultMap, MaplyTestResult resultGlobe) {<NEW_LINE>ConfigOptions.setTestState(getApplicationContext(), head.getTestName(), ConfigOptions.TestState.Selected);<NEW_LINE>if (MainActivity.this.cancelled) {<NEW_LINE>MainActivity.this.finishTests();<NEW_LINE>} else {<NEW_LINE>if (resultMap != null) {<NEW_LINE>MainActivity.this.testResults.add(resultMap);<NEW_LINE>}<NEW_LINE>if (resultGlobe != null) {<NEW_LINE>MainActivity.this.testResults.add(resultGlobe);<NEW_LINE>}<NEW_LINE>if (ConfigOptions.getViewSetting(MainActivity.this) == ConfigOptions.ViewMapOption.None) {<NEW_LINE>head.setIcon(R.drawable.ic_action_selectall);<NEW_LINE>MainActivity.this.testList.notifyIconChanged(index);<NEW_LINE>}<NEW_LINE>MainActivity.this.startTests(tests, index + 1);<NEW_LINE>}<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onStart(View view) {<NEW_LINE>if (ConfigOptions.getViewSetting(MainActivity.this) == ConfigOptions.ViewMapOption.ViewMap) {<NEW_LINE>viewTest = new ViewTestFragment();<NEW_LINE>viewTest.changeViewFragment(view);<NEW_LINE>selectFragment(viewTest);<NEW_LINE>}<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onExecute(View view) {<NEW_LINE>if (ConfigOptions.getViewSetting(MainActivity.this) == ConfigOptions.ViewMapOption.ViewMap || ConfigOptions.getExecutionMode(getApplicationContext()) == ConfigOptions.ExecutionMode.Interactive) {<NEW_LINE>viewTest = new ViewTestFragment();<NEW_LINE>viewTest.changeViewFragment(view);<NEW_LINE>selectFragment(viewTest);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>};<NEW_LINE>head.setListener(listener);<NEW_LINE>head.setActivity(this);<NEW_LINE>if (ConfigOptions.getViewSetting(this) == ConfigOptions.ViewMapOption.None) {<NEW_LINE>head.setIcon(R.drawable.ic_options_action);<NEW_LINE>this.testList.notifyIconChanged(index);<NEW_LINE>}<NEW_LINE>head.start();<NEW_LINE>} else {<NEW_LINE>startTests(tests, index + 1);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>finishTests();<NEW_LINE>}<NEW_LINE>}
), ConfigOptions.TestState.Executing);
967,646
public static void createCluster(String destZkString, String destClusterName, VcrHelixConfig config) {<NEW_LINE>HelixZkClient destZkClient = getHelixZkClient(destZkString);<NEW_LINE>HelixAdmin destAdmin = new ZKHelixAdmin(destZkClient);<NEW_LINE>if (ZKUtil.isClusterSetup(destClusterName, destZkClient)) {<NEW_LINE>errorAndExit("Failed to create cluster because " + destClusterName + " already exist.");<NEW_LINE>}<NEW_LINE>ClusterSetup clusterSetup = new ClusterSetup.Builder().setZkAddress(destZkString).build();<NEW_LINE>clusterSetup.addCluster(destClusterName, true);<NEW_LINE>// set ALLOW_PARTICIPANT_AUTO_JOIN<NEW_LINE>HelixConfigScope configScope = new HelixConfigScopeBuilder(HelixConfigScope.ConfigScopeProperty.CLUSTER).forCluster(destClusterName).build();<NEW_LINE>Map<String, String> <MASK><NEW_LINE>helixClusterProperties.put(ZKHelixManager.ALLOW_PARTICIPANT_AUTO_JOIN, String.valueOf(config.getClusterConfigFields().isAllowAutoJoin()));<NEW_LINE>destAdmin.setConfig(configScope, helixClusterProperties);<NEW_LINE>setClusterConfig(destZkClient, destClusterName, config, false);<NEW_LINE>logger.info("Cluster {} is created successfully!", destClusterName);<NEW_LINE>}
helixClusterProperties = new HashMap<>();
957,583
public void before(Object target, Object[] args) {<NEW_LINE>if (isDebug) {<NEW_LINE>logger.beforeInterceptor(target, args);<NEW_LINE>}<NEW_LINE>final Trace trace = traceContext.currentTraceObject();<NEW_LINE>if (trace == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>final InterceptorScopeInvocation invocation = interceptorScope.getCurrentInvocation();<NEW_LINE>final Object attachment = getAttachment(invocation);<NEW_LINE>if (attachment instanceof CommandContext) {<NEW_LINE><MASK><NEW_LINE>if (methodDescriptor.getMethodName().equals("sendCommand")) {<NEW_LINE>commandContext.setWriteBeginTime(System.currentTimeMillis());<NEW_LINE>} else {<NEW_LINE>commandContext.setReadBeginTime(System.currentTimeMillis());<NEW_LINE>}<NEW_LINE>if (logger.isDebugEnabled()) {<NEW_LINE>logger.debug("Set command context {}", commandContext);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (Throwable t) {<NEW_LINE>logger.warn("Failed to BEFORE process. {}", t.getMessage(), t);<NEW_LINE>}<NEW_LINE>}
final CommandContext commandContext = (CommandContext) attachment;
1,529,177
public void execute(FreezeBalanceParam param, Repository repo) {<NEW_LINE>// calculate expire time<NEW_LINE><MASK><NEW_LINE>long nowInMs = dynamicStore.getLatestBlockHeaderTimestamp();<NEW_LINE>long expireTime = nowInMs + param.getFrozenDuration() * FROZEN_PERIOD;<NEW_LINE>byte[] ownerAddress = param.getOwnerAddress();<NEW_LINE>byte[] receiverAddress = param.getReceiverAddress();<NEW_LINE>long frozenBalance = param.getFrozenBalance();<NEW_LINE>AccountCapsule accountCapsule = repo.getAccount(ownerAddress);<NEW_LINE>// acquire or delegate resource<NEW_LINE>if (param.isDelegating()) {<NEW_LINE>// delegate resource<NEW_LINE>switch(param.getResourceType()) {<NEW_LINE>case BANDWIDTH:<NEW_LINE>delegateResource(ownerAddress, receiverAddress, frozenBalance, expireTime, true, repo);<NEW_LINE>accountCapsule.addDelegatedFrozenBalanceForBandwidth(frozenBalance);<NEW_LINE>break;<NEW_LINE>case ENERGY:<NEW_LINE>delegateResource(ownerAddress, receiverAddress, frozenBalance, expireTime, false, repo);<NEW_LINE>accountCapsule.addDelegatedFrozenBalanceForEnergy(frozenBalance);<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>logger.debug("Resource Code Error.");<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>// acquire resource<NEW_LINE>switch(param.getResourceType()) {<NEW_LINE>case BANDWIDTH:<NEW_LINE>accountCapsule.setFrozenForBandwidth(frozenBalance + accountCapsule.getFrozenBalance(), expireTime);<NEW_LINE>break;<NEW_LINE>case ENERGY:<NEW_LINE>accountCapsule.setFrozenForEnergy(frozenBalance + accountCapsule.getAccountResource().getFrozenBalanceForEnergy().getFrozenBalance(), expireTime);<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>logger.debug("Resource Code Error.");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// adjust total resource<NEW_LINE>switch(param.getResourceType()) {<NEW_LINE>case BANDWIDTH:<NEW_LINE>repo.addTotalNetWeight(frozenBalance / TRX_PRECISION);<NEW_LINE>break;<NEW_LINE>case ENERGY:<NEW_LINE>repo.addTotalEnergyWeight(frozenBalance / TRX_PRECISION);<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>// this should never happen<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>// deduce balance of owner account<NEW_LINE>long newBalance = accountCapsule.getBalance() - frozenBalance;<NEW_LINE>accountCapsule.setBalance(newBalance);<NEW_LINE>repo.updateAccount(accountCapsule.createDbKey(), accountCapsule);<NEW_LINE>}
DynamicPropertiesStore dynamicStore = repo.getDynamicPropertiesStore();
47,584
public com.squareup.okhttp.Call endpointCertificatesGetCall(String xWSO2Tenant, String alias, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {<NEW_LINE>Object localVarPostBody = null;<NEW_LINE>// create path and map variables<NEW_LINE>String localVarPath = "/endpoint-certificates";<NEW_LINE>List<Pair> localVarQueryParams = new ArrayList<Pair>();<NEW_LINE>List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();<NEW_LINE>if (alias != null)<NEW_LINE>localVarQueryParams.addAll(apiClient.parameterToPair("alias", alias));<NEW_LINE>Map<String, String> localVarHeaderParams = new HashMap<String, String>();<NEW_LINE>if (xWSO2Tenant != null)<NEW_LINE>localVarHeaderParams.put("xWSO2Tenant", apiClient.parameterToString(xWSO2Tenant));<NEW_LINE>Map<String, Object> localVarFormParams = new HashMap<String, Object>();<NEW_LINE>final String[] localVarAccepts = { "application/json" };<NEW_LINE>final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);<NEW_LINE>if (localVarAccept != null)<NEW_LINE>localVarHeaderParams.put("Accept", localVarAccept);<NEW_LINE><MASK><NEW_LINE>final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);<NEW_LINE>localVarHeaderParams.put("Content-Type", localVarContentType);<NEW_LINE>if (progressListener != null) {<NEW_LINE>apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException {<NEW_LINE>com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request());<NEW_LINE>return originalResponse.newBuilder().body(new ProgressResponseBody(originalResponse.body(), progressListener)).build();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}<NEW_LINE>String[] localVarAuthNames = new String[] {};<NEW_LINE>return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);<NEW_LINE>}
final String[] localVarContentTypes = {};
564,520
public static String generateTokenImagePath(CardDownloadData card) {<NEW_LINE>if (card.isToken()) {<NEW_LINE>String filePath = getTokenImagePath(card);<NEW_LINE>if (pathCache.containsKey(card)) {<NEW_LINE>if (filePath.equals(pathCache.get(card))) {<NEW_LINE>return pathCache.get(card);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>TFile file = new TFile(filePath);<NEW_LINE>if (!file.exists() && card.getTokenSetCode() != null) {<NEW_LINE>filePath = searchForCardImage(card);<NEW_LINE>file = new TFile(filePath);<NEW_LINE>}<NEW_LINE>if (file.exists()) {<NEW_LINE>pathCache.put(card, filePath);<NEW_LINE>return filePath;<NEW_LINE>}<NEW_LINE>// log.warn("Token image file not found. Set: " + card.getSet() + " Token Set Code: " + card.getTokenSetCode() + " Name: " + card.getName() + " File path: " + getTokenImagePath(card));<NEW_LINE>} else {<NEW_LINE>LOGGER.warn("Trying to get token path for non token card. Set: " + card.getSet() + " Set Code: " + card.getTokenSetCode() + <MASK><NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>}
" Name: " + card.getName());
637,527
final DeletePermissionPolicyResult executeDeletePermissionPolicy(DeletePermissionPolicyRequest deletePermissionPolicyRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(deletePermissionPolicyRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DeletePermissionPolicyRequest> request = null;<NEW_LINE>Response<DeletePermissionPolicyResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DeletePermissionPolicyRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(deletePermissionPolicyRequest));<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, "WAF");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DeletePermissionPolicy");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DeletePermissionPolicyResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DeletePermissionPolicyResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>}
endClientExecution(awsRequestMetrics, request, response);
450,418
public void validatePeriods(final I_C_Flatrate_Term term) {<NEW_LINE>if (term.getStartDate() != null && !term.isProcessed()) {<NEW_LINE>Services.get(IFlatrateBL.class).updateNoticeDateAndEndDate(term);<NEW_LINE>setMasterEndDate(term);<NEW_LINE>}<NEW_LINE>final Properties ctx = InterfaceWrapperHelper.getCtx(term);<NEW_LINE>final String trxName = InterfaceWrapperHelper.getTrxName(term);<NEW_LINE>final List<String> errors = new ArrayList<>();<NEW_LINE>final IMsgBL msgBL = Services.get(IMsgBL.class);<NEW_LINE>if (term.getStartDate() != null && term.getEndDate() != null && !X_C_Flatrate_Conditions.TYPE_CONDITIONS_Subscription.equals(term.getType_Conditions())) {<NEW_LINE>final ICalendarDAO calendarDAO = Services.get(ICalendarDAO.class);<NEW_LINE>final I_C_Calendar invoicingCal = term.getC_Flatrate_Conditions().getC_Flatrate_Transition().getC_Calendar_Contract();<NEW_LINE>final List<I_C_Period> periodsOfTerm = calendarDAO.retrievePeriods(ctx, invoicingCal, term.getStartDate(), <MASK><NEW_LINE>if (periodsOfTerm.isEmpty()) {<NEW_LINE>errors.add(msgBL.getMsg(ctx, MSG_TERM_ERROR_YEAR_WITHOUT_PERIODS_2P, new Object[] { term.getStartDate(), term.getEndDate() }));<NEW_LINE>} else {<NEW_LINE>if (periodsOfTerm.get(0).getStartDate().after(term.getStartDate())) {<NEW_LINE>errors.add(msgBL.getMsg(ctx, MSG_TERM_ERROR_PERIOD_START_DATE_AFTER_TERM_START_DATE_2P, new Object[] { term.getStartDate(), invoicingCal.getName() }));<NEW_LINE>}<NEW_LINE>final I_C_Period lastPeriodOfTerm = periodsOfTerm.get(periodsOfTerm.size() - 1);<NEW_LINE>if (lastPeriodOfTerm.getEndDate().before(term.getEndDate())) {<NEW_LINE>errors.add(msgBL.getMsg(ctx, MSG_TERM_ERROR_PERIOD_END_DATE_BEFORE_TERM_END_DATE_2P, new Object[] { lastPeriodOfTerm.getEndDate(), invoicingCal.getName() }));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (!errors.isEmpty()) {<NEW_LINE>throw new AdempiereException(concatStrings(errors)).markAsUserValidationError();<NEW_LINE>}<NEW_LINE>}
term.getEndDate(), trxName);
1,666,299
public boolean runPlugin(final PathPlugin<BufferedImage> plugin, final String arg, final boolean doInteractive) throws Exception {<NEW_LINE>// try {<NEW_LINE>// TODO: Check safety...<NEW_LINE>if (doInteractive && plugin instanceof PathInteractivePlugin) {<NEW_LINE>PathInteractivePlugin<BufferedImage> pluginInteractive = (PathInteractivePlugin<BufferedImage>) plugin;<NEW_LINE>ParameterList params = pluginInteractive.getDefaultParameterList(getImageData());<NEW_LINE>// Update parameter list, if necessary<NEW_LINE>if (arg != null) {<NEW_LINE>Map<String, String> <MASK><NEW_LINE>// We use the US locale because we need to ensure decimal points (not commas)<NEW_LINE>ParameterList.updateParameterList(params, map, Locale.US);<NEW_LINE>}<NEW_LINE>var runner = new PluginRunnerFX(this);<NEW_LINE>ParameterDialogWrapper<BufferedImage> dialog = new ParameterDialogWrapper<>(pluginInteractive, params, runner);<NEW_LINE>dialog.showDialog();<NEW_LINE>return !runner.isCancelled();<NEW_LINE>} else {<NEW_LINE>try {<NEW_LINE>pluginRunning.set(true);<NEW_LINE>var runner = new PluginRunnerFX(this);<NEW_LINE>@SuppressWarnings("unused")<NEW_LINE>var completed = plugin.runPlugin(runner, arg);<NEW_LINE>return !runner.isCancelled();<NEW_LINE>} finally {<NEW_LINE>pluginRunning.set(false);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// } catch (Exception e) {<NEW_LINE>// logger.error("Unable to run plugin " + plugin, e);<NEW_LINE>// return false;<NEW_LINE>// }<NEW_LINE>}
map = GeneralTools.parseArgStringValues(arg);
1,788,741
public void encryptionSample() {<NEW_LINE>CosmosClientBuilder builder = new CosmosClientBuilder();<NEW_LINE>CosmosAsyncClient client = builder.key("key").endpoint("endpoint").buildAsyncClient();<NEW_LINE>// creating container with client encryption policy<NEW_LINE>createContainerWithClientEncryptionPolicy(client);<NEW_LINE>CosmosEncryptionAsyncClient cosmosEncryptionAsyncClient = new CosmosEncryptionClientBuilder().cosmosAsyncClient(client).keyEncryptionKeyResolver(new SimpleKeyEncryptionKeyResolver()).keyEncryptionKeyResolverName(CosmosEncryptionClientBuilder.KEY_RESOLVER_NAME_AZURE_KEY_VAULT).buildAsyncClient();<NEW_LINE>CosmosEncryptionAsyncDatabase cosmosEncryptionAsyncDatabase = cosmosEncryptionAsyncClient.getCosmosEncryptionAsyncDatabase("myDb");<NEW_LINE>CosmosEncryptionAsyncContainer cosmosEncryptionAsyncContainer = cosmosEncryptionAsyncDatabase.getCosmosEncryptionAsyncContainer("myCol");<NEW_LINE>// create client encryption key to be store on database<NEW_LINE>createClientEncryptionKey(cosmosEncryptionAsyncDatabase);<NEW_LINE>Pojo originalItem = new Pojo();<NEW_LINE>originalItem.id = UUID.randomUUID().toString();<NEW_LINE>originalItem.mypk = UUID<MASK><NEW_LINE>originalItem.nonSensitive = UUID.randomUUID().toString();<NEW_LINE>originalItem.sensitiveString = "this is a secret string to be encrypted";<NEW_LINE>// "this is a secret int to be encrypted";<NEW_LINE>originalItem.sensitiveInt = 1234;<NEW_LINE>// "this is a secret float to be encrypted";<NEW_LINE>originalItem.sensitiveFloat = 1234.01f;<NEW_LINE>// "this is a secret double to be encrypted";<NEW_LINE>originalItem.sensitiveDouble = 1234.1234;<NEW_LINE>// "this is a secret long to be encrypted";<NEW_LINE>originalItem.sensitiveLong = 1234;<NEW_LINE>// "this is a secret boolean to be encrypted";<NEW_LINE>originalItem.sensitiveBoolean = true;<NEW_LINE>CosmosItemResponse<Pojo> response = cosmosEncryptionAsyncContainer.createItem(originalItem, new PartitionKey(originalItem.mypk), new CosmosItemRequestOptions()).block();<NEW_LINE>// read and decrypt the item<NEW_LINE>CosmosItemResponse<Pojo> readResponse = cosmosEncryptionAsyncContainer.readItem(originalItem.id, new PartitionKey(originalItem.mypk), null, Pojo.class).block();<NEW_LINE>Pojo readItem = readResponse.getItem();<NEW_LINE>assert (originalItem.sensitiveString.equals(readItem.sensitiveString));<NEW_LINE>assert (originalItem.sensitiveInt == readItem.sensitiveInt);<NEW_LINE>assert (originalItem.sensitiveFloat == readItem.sensitiveFloat);<NEW_LINE>assert (originalItem.sensitiveDouble == readItem.sensitiveDouble);<NEW_LINE>assert (originalItem.sensitiveLong == readItem.sensitiveLong);<NEW_LINE>assert (originalItem.sensitiveBoolean == readItem.sensitiveBoolean);<NEW_LINE>}
.randomUUID().toString();
1,565,351
public DevicePoolCompatibilityResult unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>DevicePoolCompatibilityResult devicePoolCompatibilityResult = new DevicePoolCompatibilityResult();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE><MASK><NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>if (context.testExpression("device", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>devicePoolCompatibilityResult.setDevice(DeviceJsonUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("compatible", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>devicePoolCompatibilityResult.setCompatible(context.getUnmarshaller(Boolean.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("incompatibilityMessages", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>devicePoolCompatibilityResult.setIncompatibilityMessages(new ListUnmarshaller<IncompatibilityMessage>(IncompatibilityMessageJsonUnmarshaller.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 devicePoolCompatibilityResult;<NEW_LINE>}
String currentParentElement = context.getCurrentParentElement();
1,773,767
public static PointDescription deserializeFromString(String s, LatLon l) {<NEW_LINE>PointDescription pd = null;<NEW_LINE>if (s != null && s.length() > 0) {<NEW_LINE>int in = s.indexOf('#');<NEW_LINE>if (in >= 0) {<NEW_LINE>int ii = s.indexOf('#', in + 1);<NEW_LINE>String name;<NEW_LINE>String icon = null;<NEW_LINE>if (ii > 0) {<NEW_LINE>name = s.substring(in + 1, ii).trim();<NEW_LINE>icon = s.substring(ii + 1).trim();<NEW_LINE>} else {<NEW_LINE>name = s.substring(in + 1).trim();<NEW_LINE>}<NEW_LINE>String tp = <MASK><NEW_LINE>if (tp.contains(".")) {<NEW_LINE>pd = new PointDescription(tp.substring(0, tp.indexOf('.')), tp.substring(tp.indexOf('.') + 1), name);<NEW_LINE>} else {<NEW_LINE>pd = new PointDescription(tp, name);<NEW_LINE>}<NEW_LINE>if (!Algorithms.isEmpty(icon)) {<NEW_LINE>pd.setIconName(icon);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (pd == null) {<NEW_LINE>pd = new PointDescription(POINT_TYPE_LOCATION, "");<NEW_LINE>}<NEW_LINE>if (pd.isLocation() && l != null) {<NEW_LINE>pd.lat = l.getLatitude();<NEW_LINE>pd.lon = l.getLongitude();<NEW_LINE>}<NEW_LINE>return pd;<NEW_LINE>}
s.substring(0, in);
601,214
public GetMedicalVocabularyResult unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>GetMedicalVocabularyResult getMedicalVocabularyResult = new GetMedicalVocabularyResult();<NEW_LINE><MASK><NEW_LINE>reader.beginObject();<NEW_LINE>while (reader.hasNext()) {<NEW_LINE>String name = reader.nextName();<NEW_LINE>if (name.equals("VocabularyName")) {<NEW_LINE>getMedicalVocabularyResult.setVocabularyName(StringJsonUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>} else if (name.equals("LanguageCode")) {<NEW_LINE>getMedicalVocabularyResult.setLanguageCode(StringJsonUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>} else if (name.equals("VocabularyState")) {<NEW_LINE>getMedicalVocabularyResult.setVocabularyState(StringJsonUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>} else if (name.equals("LastModifiedTime")) {<NEW_LINE>getMedicalVocabularyResult.setLastModifiedTime(DateJsonUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>} else if (name.equals("FailureReason")) {<NEW_LINE>getMedicalVocabularyResult.setFailureReason(StringJsonUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>} else if (name.equals("DownloadUri")) {<NEW_LINE>getMedicalVocabularyResult.setDownloadUri(StringJsonUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>} else {<NEW_LINE>reader.skipValue();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>reader.endObject();<NEW_LINE>return getMedicalVocabularyResult;<NEW_LINE>}
AwsJsonReader reader = context.getReader();
173,616
private void registerItemConfig(MqttitudeItemConfig itemConfig) {<NEW_LINE>if (itemConfig == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>String topic = itemConfig.getTopic();<NEW_LINE>// get the consumer for this broker/topic (might not exist)<NEW_LINE>MqttitudeConsumer consumer = getConsumer(broker, topic);<NEW_LINE>// NOTE: we only create a single consumer for each topic, but a topic may<NEW_LINE>// have multiple item bindings - i.e. monitoring multiple regions<NEW_LINE>if (consumer == null) {<NEW_LINE>// create a new consumer for this topic<NEW_LINE>consumer = new MqttitudeConsumer(homeLocation, geoFence);<NEW_LINE>consumer.setTopic(topic);<NEW_LINE>// register the new consumer<NEW_LINE>logger.debug("Registering Mqttitude consumer for {} (on {})", topic, broker);<NEW_LINE>mqttService.registerMessageConsumer(broker, consumer);<NEW_LINE>if (!consumers.containsKey(broker)) {<NEW_LINE>consumers.put(broker, new ArrayList<MqttitudeConsumer>());<NEW_LINE>}<NEW_LINE>consumers.get(broker).add(consumer);<NEW_LINE>}<NEW_LINE>// add this item to our consumer (will replace any existing config for the same item name)<NEW_LINE>consumer.addItemConfig(itemConfig);<NEW_LINE>}
String broker = itemConfig.getBroker();
24,262
/*<NEW_LINE>* (non-Javadoc)<NEW_LINE>*<NEW_LINE>* @see<NEW_LINE>* com.sitewhere.grpc.service.DeviceManagementGrpc.DeviceManagementImplBase#<NEW_LINE>* listDeviceStatuses(com.sitewhere.grpc.service.GListDeviceStatusesRequest,<NEW_LINE>* io.grpc.stub.StreamObserver)<NEW_LINE>*/<NEW_LINE>@Override<NEW_LINE>public void listDeviceStatuses(GListDeviceStatusesRequest request, StreamObserver<GListDeviceStatusesResponse> responseObserver) {<NEW_LINE>try {<NEW_LINE>GrpcUtils.handleServerMethodEntry(this, DeviceManagementGrpc.getListDeviceStatusesMethod());<NEW_LINE>ISearchResults<? extends IDeviceStatus> apiResult = getDeviceManagement().listDeviceStatuses(DeviceModelConverter.asApiDeviceStatusSearchCriteria(request.getCriteria()));<NEW_LINE>GListDeviceStatusesResponse.Builder response = GListDeviceStatusesResponse.newBuilder();<NEW_LINE>GDeviceStatusSearchResults.Builder results = GDeviceStatusSearchResults.newBuilder();<NEW_LINE>for (IDeviceStatus apiType : apiResult.getResults()) {<NEW_LINE>results.addDeviceStatuses<MASK><NEW_LINE>}<NEW_LINE>results.setCount(apiResult.getNumResults());<NEW_LINE>response.setResults(results.build());<NEW_LINE>responseObserver.onNext(response.build());<NEW_LINE>responseObserver.onCompleted();<NEW_LINE>} catch (Throwable e) {<NEW_LINE>GrpcUtils.handleServerMethodException(DeviceManagementGrpc.getListDeviceStatusesMethod(), e, responseObserver);<NEW_LINE>} finally {<NEW_LINE>GrpcUtils.handleServerMethodExit(DeviceManagementGrpc.getListDeviceStatusesMethod());<NEW_LINE>}<NEW_LINE>}
(DeviceModelConverter.asGrpcDeviceStatus(apiType));
250,963
public AltererResult<G, C> alter(final Seq<Phenotype<G, C>> population, final long generation) {<NEW_LINE>final double p = pow(_probability, 1.0 / 3.0);<NEW_LINE>final IntRef alterations = new IntRef(0);<NEW_LINE>final MSeq<Phenotype<G, C>> pop = MSeq.of(population);<NEW_LINE>indexes(RandomRegistry.random(), pop.size(), p).forEach(i -> {<NEW_LINE>final Phenotype<G, C> pt = pop.get(i);<NEW_LINE>final Genotype<G> gt = pt.genotype();<NEW_LINE>final Genotype<G> mgt = mutate(gt, p, alterations);<NEW_LINE>final Phenotype<G, C> mpt = <MASK><NEW_LINE>pop.set(i, mpt);<NEW_LINE>});<NEW_LINE>return new AltererResult<>(pop.toISeq(), alterations.value);<NEW_LINE>}
Phenotype.of(mgt, generation);
669,939
@SchedulerSupport(SchedulerSupport.NONE)<NEW_LINE>public static <@NonNull T> Observable<T> just(@NonNull T item1, @NonNull T item2, @NonNull T item3, @NonNull T item4, @NonNull T item5, @NonNull T item6, @NonNull T item7, @NonNull T item8, @NonNull T item9) {<NEW_LINE>Objects.requireNonNull(item1, "item1 is null");<NEW_LINE>Objects.requireNonNull(item2, "item2 is null");<NEW_LINE>Objects.requireNonNull(item3, "item3 is null");<NEW_LINE>Objects.requireNonNull(item4, "item4 is null");<NEW_LINE><MASK><NEW_LINE>Objects.requireNonNull(item6, "item6 is null");<NEW_LINE>Objects.requireNonNull(item7, "item7 is null");<NEW_LINE>Objects.requireNonNull(item8, "item8 is null");<NEW_LINE>Objects.requireNonNull(item9, "item9 is null");<NEW_LINE>return fromArray(item1, item2, item3, item4, item5, item6, item7, item8, item9);<NEW_LINE>}
Objects.requireNonNull(item5, "item5 is null");
1,700,291
private boolean isResourceReferenceEnabled(ResourceInfo resourceInfo) {<NEW_LINE>String enabled = "false";<NEW_LINE>if (ConnectorsUtil.isModuleScopedResource(resourceInfo) || ConnectorsUtil.isApplicationScopedResource(resourceInfo)) {<NEW_LINE>ApplicationRef appRef = getServer().getApplicationRef(resourceInfo.getApplicationName());<NEW_LINE>if (appRef != null) {<NEW_LINE>enabled = appRef.getEnabled();<NEW_LINE>} else {<NEW_LINE>// for an application-scoped-resource, if the application is being deployed,<NEW_LINE>// <application> element and <application-ref> will be null until deployment<NEW_LINE>// is complete. Hence this workaround.<NEW_LINE>enabled = "true";<NEW_LINE>if (_logger.isLoggable(Level.FINE)) {<NEW_LINE>_logger.fine("ResourcesUtil :: isResourceReferenceEnabled null app-ref");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>ResourceRef ref = getServer().<MASK><NEW_LINE>if (ref != null) {<NEW_LINE>enabled = ref.getEnabled();<NEW_LINE>} else {<NEW_LINE>if (_logger.isLoggable(Level.FINE)) {<NEW_LINE>_logger.fine("ResourcesUtil :: isResourceReferenceEnabled null ref");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (_logger.isLoggable(Level.FINE)) {<NEW_LINE>_logger.fine("ResourcesUtil :: isResourceReferenceEnabled ref enabled ?" + enabled);<NEW_LINE>}<NEW_LINE>return ConnectorsUtil.parseBoolean(enabled);<NEW_LINE>}
getResourceRef(resourceInfo.getName());
657,247
private void testPollCache(String key, Object expectedValue) throws Exception {<NEW_LINE>byte[] expectedBytes = expectedValue == null ? null : toBytes(expectedValue);<NEW_LINE>System.out.println("testPollCache cache entry " + key + " should eventually have value: " + expectedValue);<NEW_LINE>System.out.println("as a byte array, this is: " + Arrays.toString(expectedBytes));<NEW_LINE>// need to use same config file as server.xml<NEW_LINE>String <MASK><NEW_LINE>System.setProperty("hazelcast.config", hazelcastConfigLoc);<NEW_LINE>boolean found = false;<NEW_LINE>byte[] bytes = null;<NEW_LINE>Cache<String, byte[]> cache = Caching.getCache("com.ibm.ws.session.attr.default_host%2FsessionCacheConfigApp", String.class, byte[].class);<NEW_LINE>try {<NEW_LINE>for (long start = System.nanoTime(); !found && System.nanoTime() - start < TIMEOUT_NS; TimeUnit.MILLISECONDS.sleep(500)) {<NEW_LINE>bytes = cache.get(key);<NEW_LINE>found = Arrays.equals(expectedBytes, bytes);<NEW_LINE>}<NEW_LINE>} finally {<NEW_LINE>cache.close();<NEW_LINE>}<NEW_LINE>assertTrue("Expected cache entry " + key + " to have value " + expectedValue + ", not " + toObject(bytes) + ". " + EOLN + "Bytes expected: " + Arrays.toString(expectedBytes) + EOLN + "Bytes observed: " + Arrays.toString(bytes), found);<NEW_LINE>}
hazelcastConfigLoc = InitialContext.doLookup("hazelcast/configlocation");
1,131,513
private BlobServiceClientBuilder applyLocationMode(final BlobServiceClientBuilder builder, final AzureStorageSettings settings) {<NEW_LINE>final StorageConnectionString storageConnectionString = StorageConnectionString.create(settings.getConnectString(), logger);<NEW_LINE>final StorageEndpoint endpoint = storageConnectionString.getBlobEndpoint();<NEW_LINE>if (endpoint == null || endpoint.getPrimaryUri() == null) {<NEW_LINE>throw new IllegalArgumentException("connectionString missing required settings to derive blob service primary endpoint.");<NEW_LINE>}<NEW_LINE>final <MASK><NEW_LINE>if (locationMode == LocationMode.PRIMARY_ONLY) {<NEW_LINE>builder.retryOptions(createRetryPolicy(settings, null));<NEW_LINE>} else if (locationMode == LocationMode.SECONDARY_ONLY) {<NEW_LINE>if (endpoint.getSecondaryUri() == null) {<NEW_LINE>throw new IllegalArgumentException("connectionString missing required settings to derive blob service secondary endpoint.");<NEW_LINE>}<NEW_LINE>builder.endpoint(endpoint.getSecondaryUri()).retryOptions(createRetryPolicy(settings, null));<NEW_LINE>} else if (locationMode == LocationMode.PRIMARY_THEN_SECONDARY) {<NEW_LINE>builder.retryOptions(createRetryPolicy(settings, endpoint.getSecondaryUri()));<NEW_LINE>} else if (locationMode == LocationMode.SECONDARY_THEN_PRIMARY) {<NEW_LINE>if (endpoint.getSecondaryUri() == null) {<NEW_LINE>throw new IllegalArgumentException("connectionString missing required settings to derive blob service secondary endpoint.");<NEW_LINE>}<NEW_LINE>builder.endpoint(endpoint.getSecondaryUri()).retryOptions(createRetryPolicy(settings, endpoint.getPrimaryUri()));<NEW_LINE>} else {<NEW_LINE>throw new IllegalArgumentException("Unsupported location mode: " + locationMode);<NEW_LINE>}<NEW_LINE>return builder;<NEW_LINE>}
LocationMode locationMode = settings.getLocationMode();
547,647
private void manageFilePattern() {<NEW_LINE>// disable custom filter text box when 'Custom Filter' is not selected<NEW_LINE>showDivIf(divCustomFilter_, listPresetFilePatterns_.getSelectedIndex() == Include.CustomFilter.ordinal());<NEW_LINE>// disable 'Package' option when chosen directory is not a package<NEW_LINE>if (!packageStatus_) {<NEW_LINE>((Element) listPresetFilePatterns_.getElement().getChild(Include.PackageSource.ordinal())).setAttribute("disabled", "disabled");<NEW_LINE>((Element) listPresetFilePatterns_.getElement().getChild(Include.PackageTests.ordinal())<MASK><NEW_LINE>if (listPresetFilePatterns_.getSelectedIndex() == Include.PackageSource.ordinal() || listPresetFilePatterns_.getSelectedIndex() == Include.PackageTests.ordinal())<NEW_LINE>listPresetFilePatterns_.setSelectedIndex(Include.AllFiles.ordinal());<NEW_LINE>} else {<NEW_LINE>((Element) listPresetFilePatterns_.getElement().getChild(Include.PackageSource.ordinal())).removeAttribute("disabled");<NEW_LINE>((Element) listPresetFilePatterns_.getElement().getChild(Include.PackageTests.ordinal())).removeAttribute("disabled");<NEW_LINE>}<NEW_LINE>}
).setAttribute("disabled", "disabled");
1,260,512
void addHistoryItem(@NonNull WikivoyageSearchHistoryItem item) {<NEW_LINE>String travelBook = item.getTravelBook(context);<NEW_LINE>if (travelBook == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>SQLiteConnection conn = openConnection(false);<NEW_LINE>if (conn != null) {<NEW_LINE>try {<NEW_LINE>conn.execSQL("INSERT INTO " + HISTORY_TABLE_NAME + "(" + HISTORY_COL_ARTICLE_TITLE + ", " + HISTORY_COL_LANG + ", " + HISTORY_COL_IS_PART_OF + ", " + HISTORY_COL_LAST_ACCESSED + ", " + HISTORY_COL_TRAVEL_BOOK + ") VALUES (?, ?, ?, ?, ?)", new Object[] { item.articleTitle, item.lang, item.isPartOf<MASK><NEW_LINE>} finally {<NEW_LINE>conn.close();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
, item.lastAccessed, travelBook });
563,326
public void addAssertions(TestSuiteChromosome suite) {<NEW_LINE>setupClassLoader(suite);<NEW_LINE>if (!Properties.hasTargetClassBeenLoaded()) {<NEW_LINE>// Need to load class explicitly since it was re-instrumented<NEW_LINE>Properties.getTargetClassAndDontInitialise();<NEW_LINE>if (!Properties.hasTargetClassBeenLoaded()) {<NEW_LINE>logger.warn("Could not initialize SUT before Assertion generation");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>Set<Integer> tkilled = new HashSet<>();<NEW_LINE>int numTest = 0;<NEW_LINE>boolean timeIsShort = false;<NEW_LINE>for (TestCase test : suite.getTests()) {<NEW_LINE>if (!TimeController.getInstance().isThereStillTimeInThisPhase()) {<NEW_LINE>logger.warn("Reached maximum time to generate assertions, aborting assertion generation");<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>// If at 50% of the time we have only done X% of the tests, then don't minimise<NEW_LINE>if (!timeIsShort && TimeController.getInstance().getPhasePercentage() > Properties.ASSERTION_MINIMIZATION_FALLBACK_TIME) {<NEW_LINE>if (numTest < Properties.ASSERTION_MINIMIZATION_FALLBACK * suite.size()) {<NEW_LINE>logger.warn("Assertion minimization is taking too long ({}% of time used, but only {}/{} tests minimized), falling back to using all assertions", TimeController.getInstance().getPhasePercentage(), <MASK><NEW_LINE>timeIsShort = true;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (timeIsShort) {<NEW_LINE>CompleteAssertionGenerator generator = new CompleteAssertionGenerator();<NEW_LINE>generator.addAssertions(test);<NEW_LINE>numTest++;<NEW_LINE>} else {<NEW_LINE>// Set<Integer> killed = new HashSet<Integer>();<NEW_LINE>addAssertions(test, tkilled);<NEW_LINE>// progressMonitor.updateStatus((100 * numTest++) / tests.size());<NEW_LINE>ClientState state = ClientState.ASSERTION_GENERATION;<NEW_LINE>ClientStateInformation information = new ClientStateInformation(state);<NEW_LINE>information.setProgress((100 * numTest++) / suite.size());<NEW_LINE>ClientServices.getInstance().getClientNode().changeState(state, information);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>calculateMutationScore(tkilled);<NEW_LINE>restoreCriterion(suite);<NEW_LINE>}
numTest, suite.size());
164,647
private SessionMetadata prepareSession(io.helidon.config.Config config, ConnectionFactory factory) throws JMSException {<NEW_LINE>Optional<String> sessionGroupId = config.get(SESSION_GROUP_ID_ATTRIBUTE).asString().asOptional();<NEW_LINE>if (sessionGroupId.isPresent() && sessionRegister.containsKey(sessionGroupId.get())) {<NEW_LINE>return sessionRegister.get(sessionGroupId.get());<NEW_LINE>} else {<NEW_LINE>Optional<String> user = config.get(USERNAME_ATTRIBUTE).asString().asOptional();<NEW_LINE>Optional<String> password = config.get(PASSWORD_ATTRIBUTE).asString().asOptional();<NEW_LINE>Optional<String> userId = config.get(CLIENT_ID_ATTRIBUTE).asString().asOptional();<NEW_LINE>Connection connection;<NEW_LINE>if (user.isPresent() && password.isPresent()) {<NEW_LINE>connection = factory.createConnection(user.get(), password.get());<NEW_LINE>} else {<NEW_LINE>connection = factory.createConnection();<NEW_LINE>}<NEW_LINE>if (userId.isPresent()) {<NEW_LINE>connection.setClientID(userId.get());<NEW_LINE>}<NEW_LINE>boolean transacted = config.get(TRANSACTED_ATTRIBUTE).asBoolean().orElse(TRANSACTED_DEFAULT);<NEW_LINE>int acknowledgeMode = config.get(ACK_MODE_ATTRIBUTE).asString().map(AcknowledgeMode::parse).orElse(ACK_MODE_DEFAULT).getAckMode();<NEW_LINE>Session session = <MASK><NEW_LINE>SessionMetadata sharedSessionEntry = new SessionMetadata(session, connection, factory);<NEW_LINE>sessionRegister.put(sessionGroupId.orElseGet(() -> UUID.randomUUID().toString()), sharedSessionEntry);<NEW_LINE>return sharedSessionEntry;<NEW_LINE>}<NEW_LINE>}
connection.createSession(transacted, acknowledgeMode);