idx
int32
46
1.86M
input
stringlengths
321
6.6k
target
stringlengths
9
1.24k
1,358,870
public String render(EnumModel model, int index, int size, Map<String, Object> session) {<NEW_LINE>if (isExcludedClass(model.getType().getName())) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>StringWriter sw = new StringWriter();<NEW_LINE>PrintWriter writer = new PrintWriter(sw);<NEW_LINE>if (index == 0) {<NEW_LINE>Util.generateLicense(writer);<NEW_LINE>// include a file if present<NEW_LINE>writer.print(includeFileIfPresent("enum.header.d.ts"));<NEW_LINE>} else {<NEW_LINE>writer.print("\n");<NEW_LINE>}<NEW_LINE>generateDoc(writer, model.getDoc(), "");<NEW_LINE>writer.printf("export enum %s {\n", model.getType().getRaw().getSimpleName());<NEW_LINE>for (int i = 0; i < model.getValues().size(); i++) {<NEW_LINE>EnumValueInfo value = model.getValues().get(i);<NEW_LINE>writer.printf(" %s", value.getIdentifier());<NEW_LINE>if (i != model.getValues().size() - 1) {<NEW_LINE>writer.print(",");<NEW_LINE>}<NEW_LINE>writer.print("\n");<NEW_LINE>}<NEW_LINE>writer.print("}\n");<NEW_LINE>if (index == size - 1) {<NEW_LINE>// include a file if present<NEW_LINE>writer<MASK><NEW_LINE>}<NEW_LINE>return sw.toString();<NEW_LINE>}
.print(includeFileIfPresent("enum.footer.d.ts"));
6,055
final GetLaunchTemplateDataResult executeGetLaunchTemplateData(GetLaunchTemplateDataRequest getLaunchTemplateDataRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(getLaunchTemplateDataRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<GetLaunchTemplateDataRequest> request = null;<NEW_LINE>Response<GetLaunchTemplateDataResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new GetLaunchTemplateDataRequestMarshaller().marshall(super.beforeMarshalling(getLaunchTemplateDataRequest));<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, "EC2");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "GetLaunchTemplateData");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>StaxResponseHandler<GetLaunchTemplateDataResult> responseHandler = new StaxResponseHandler<GetLaunchTemplateDataResult>(new GetLaunchTemplateDataResultStaxUnmarshaller());<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,451,596
public void toggleSimilarNames() {<NEW_LINE>ArrayList<MASK><NEW_LINE>for (int i = 0; i < checkedItemsIndexes.size(); i++) {<NEW_LINE>LayoutElementParcelable selectedElement = getItemsDigested().get(checkedItemsIndexes.get(i)).getElem();<NEW_LINE>int fuzzinessFactor = selectedElement.title.length() / SelectionPopupMenu.FUZZYNESS_FACTOR;<NEW_LINE>if (fuzzinessFactor >= 1) {<NEW_LINE>for (int z = 0; z < getItemsDigested().size(); z++) {<NEW_LINE>ListItem currentItem = getItemsDigested().get(z);<NEW_LINE>if (currentItem.getElem() == null) {<NEW_LINE>// header type list item ('Files' / 'Folders')<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>int remainingFuzzyness = fuzzinessFactor;<NEW_LINE>char[] currentItemName = currentItem.getElem().title.toCharArray();<NEW_LINE>char[] selectedElementName = selectedElement.title.toCharArray();<NEW_LINE>boolean isSimilar = true;<NEW_LINE>for (int j = 0; j < Math.min(currentItemName.length, selectedElementName.length); j++) {<NEW_LINE>if (currentItemName[j] != selectedElementName[j] && remainingFuzzyness-- < 0) {<NEW_LINE>isSimilar = false;<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (isSimilar && Math.abs(currentItemName.length - selectedElementName.length) <= remainingFuzzyness) {<NEW_LINE>if (currentItem.getChecked() != ListItem.CHECKED) {<NEW_LINE>currentItem.setChecked(true);<NEW_LINE>notifyItemChanged(z);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
<Integer> checkedItemsIndexes = getCheckedItemsIndex();
1,291,311
private void completeUDPWrite(InetSocketAddress srcAddr, InetSocketAddress dstAddr, ByteBuf udpBuf, ByteBufAllocator byteBufAllocator, ChannelHandlerContext ctx) {<NEW_LINE>ByteBuf ipBuf = byteBufAllocator.buffer();<NEW_LINE>ByteBuf ethernetBuf = byteBufAllocator.buffer();<NEW_LINE>ByteBuf pcap = byteBufAllocator.buffer();<NEW_LINE>try {<NEW_LINE>if (srcAddr.getAddress() instanceof Inet4Address && dstAddr.getAddress() instanceof Inet4Address) {<NEW_LINE>IPPacket.writeUDPv4(ipBuf, udpBuf, NetUtil.ipv4AddressToInt((Inet4Address) srcAddr.getAddress()), NetUtil.ipv4AddressToInt((Inet4Address) dstAddr.getAddress()));<NEW_LINE>EthernetPacket.writeIPv4(ethernetBuf, ipBuf);<NEW_LINE>} else if (srcAddr.getAddress() instanceof Inet6Address && dstAddr.getAddress() instanceof Inet6Address) {<NEW_LINE>IPPacket.writeUDPv6(ipBuf, udpBuf, srcAddr.getAddress().getAddress(), dstAddr.<MASK><NEW_LINE>EthernetPacket.writeIPv6(ethernetBuf, ipBuf);<NEW_LINE>} else {<NEW_LINE>logger.error("Source and Destination IP Address versions are not same. Source Address: {}, " + "Destination Address: {}", srcAddr.getAddress(), dstAddr.getAddress());<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// Write Packet into Pcap<NEW_LINE>pCapWriter.writePacket(pcap, ethernetBuf);<NEW_LINE>} catch (IOException ex) {<NEW_LINE>logger.error("Caught Exception While Writing Packet into Pcap", ex);<NEW_LINE>ctx.fireExceptionCaught(ex);<NEW_LINE>} finally {<NEW_LINE>ipBuf.release();<NEW_LINE>ethernetBuf.release();<NEW_LINE>pcap.release();<NEW_LINE>}<NEW_LINE>}
getAddress().getAddress());
841,172
private String[] generateListenerMethodHeader(String methodName, Method originalMethod, Writer writer) throws IOException {<NEW_LINE>Class[] paramTypes = originalMethod.getParameterTypes();<NEW_LINE>String[] paramNames;<NEW_LINE>if (paramTypes.length == 1 && EventObject.class.isAssignableFrom(paramTypes[0])) {<NEW_LINE>paramNames = new String[] { EVT_VARIABLE_NAME };<NEW_LINE>} else {<NEW_LINE>paramNames = new String[paramTypes.length];<NEW_LINE>for (// NOI18N<NEW_LINE>int i = 0; // NOI18N<NEW_LINE>i < paramTypes.length; // NOI18N<NEW_LINE>i++) paramNames[i] = "param" + i;<NEW_LINE>}<NEW_LINE>// generate the method<NEW_LINE>// NOI18N<NEW_LINE>writer.write(methodName != null ? "private " : "public ");<NEW_LINE>writer.write(getSourceClassName(originalMethod.getReturnType()));<NEW_LINE>// NOI18N<NEW_LINE>writer.write(" ");<NEW_LINE>writer.write(methodName != null ? methodName : originalMethod.getName());<NEW_LINE>// NOI18N<NEW_LINE>writer.write("(");<NEW_LINE>for (int i = 0; i < paramTypes.length; i++) {<NEW_LINE>writer.write(getSourceClassName(paramTypes[i]));<NEW_LINE>// NOI18N<NEW_LINE>writer.write(" ");<NEW_LINE>writer<MASK><NEW_LINE>if (i + 1 < paramTypes.length)<NEW_LINE>// NOI18N<NEW_LINE>writer.write(", ");<NEW_LINE>}<NEW_LINE>// NOI18N<NEW_LINE>writer.write(")");<NEW_LINE>Class[] exceptions = originalMethod.getExceptionTypes();<NEW_LINE>if (exceptions.length != 0) {<NEW_LINE>// NOI18N<NEW_LINE>writer.write("throws ");<NEW_LINE>for (int i = 0; i < exceptions.length; i++) {<NEW_LINE>writer.write(getSourceClassName(exceptions[i]));<NEW_LINE>if (i + 1 < exceptions.length)<NEW_LINE>// NOI18N<NEW_LINE>writer.write(", ");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// NOI18N<NEW_LINE>writer.write(" {\n");<NEW_LINE>return paramNames;<NEW_LINE>}
.write(paramNames[i]);
463,073
public Object importSaleOrderFromSupplyChain(Object bean, Map<String, Object> values) {<NEW_LINE>try {<NEW_LINE>SaleOrderWorkflowService saleOrderWorkflowService = <MASK><NEW_LINE>StockMoveService stockMoveService = Beans.get(StockMoveService.class);<NEW_LINE>SaleOrder saleOrder = (SaleOrder) importSaleOrder.importSaleOrder(bean, values);<NEW_LINE>for (SaleOrderLine line : saleOrder.getSaleOrderLineList()) {<NEW_LINE>Product product = line.getProduct();<NEW_LINE>if (product.getMassUnit() == null) {<NEW_LINE>product.setMassUnit(stockConfigService.getStockConfig(saleOrder.getCompany()).getCustomsMassUnit());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (saleOrder.getStatusSelect() == SaleOrderRepository.STATUS_FINALIZED_QUOTATION) {<NEW_LINE>// taskSaleOrderService.createTasks(saleOrder); TODO once we will have done the generation//<NEW_LINE>// of tasks in project module<NEW_LINE>saleOrderWorkflowService.confirmSaleOrder(saleOrder);<NEW_LINE>// Beans.get(SaleOrderPurchaseService.class).createPurchaseOrders(saleOrder);<NEW_LINE>// productionOrderSaleOrderService.generateProductionOrder(saleOrder);<NEW_LINE>// saleOrder.setClientPartner(saleOrderWorkflowService.validateCustomer(saleOrder));<NEW_LINE>// Generate invoice from sale order<NEW_LINE>Invoice invoice = Beans.get(SaleOrderInvoiceService.class).generateInvoice(saleOrder);<NEW_LINE>if (saleOrder.getConfirmationDateTime() != null) {<NEW_LINE>invoice.setInvoiceDate(saleOrder.getConfirmationDateTime().toLocalDate());<NEW_LINE>} else {<NEW_LINE>invoice.setInvoiceDate(Beans.get(AppBaseService.class).getTodayDate(saleOrder.getCompany()));<NEW_LINE>}<NEW_LINE>invoiceService.validateAndVentilate(invoice);<NEW_LINE>List<Long> idList = saleOrderStockService.createStocksMovesFromSaleOrder(saleOrder);<NEW_LINE>for (Long id : idList) {<NEW_LINE>StockMove stockMove = stockMoveRepo.find(id);<NEW_LINE>if (stockMove.getStockMoveLineList() != null && !stockMove.getStockMoveLineList().isEmpty()) {<NEW_LINE>stockMoveService.copyQtyToRealQty(stockMove);<NEW_LINE>stockMoveService.validate(stockMove);<NEW_LINE>if (saleOrder.getConfirmationDateTime() != null) {<NEW_LINE>stockMove.setRealDate(saleOrder.getConfirmationDateTime().toLocalDate());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>saleOrderRepo.save(saleOrder);<NEW_LINE>} catch (Exception e) {<NEW_LINE>TraceBackService.trace(e);<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>}
Beans.get(SaleOrderWorkflowService.class);
1,029,875
public List<CatalogPartitionSpec> listPartitions(ObjectPath tablePath, CatalogPartitionSpec partitionSpec) throws TableNotExistException, TableNotPartitionedException, PartitionSpecInvalidException, CatalogException {<NEW_LINE>try {<NEW_LINE>Iterator<Partition> partitionIterator = getCurrentOdps().tables().get(tablePath.getDatabaseName(), tablePath.getObjectName()).getPartitionIterator(mapToPartitionSpec(partitionSpec.getPartitionSpec()));<NEW_LINE>List<CatalogPartitionSpec> partitionSpecs = new ArrayList<>();<NEW_LINE>while (partitionIterator.hasNext()) {<NEW_LINE>Partition partition = partitionIterator.next();<NEW_LINE>PartitionSpec partitionSpecIn = partition.getPartitionSpec();<NEW_LINE>Map<String, String> <MASK><NEW_LINE>for (String key : partitionSpecIn.keys()) {<NEW_LINE>partitionMap.put(key, partitionSpecIn.get(key));<NEW_LINE>}<NEW_LINE>partitionSpecs.add(new CatalogPartitionSpec(partitionMap));<NEW_LINE>}<NEW_LINE>return partitionSpecs;<NEW_LINE>} catch (Exception ex) {<NEW_LINE>throw new RuntimeException(ex);<NEW_LINE>}<NEW_LINE>}
partitionMap = new LinkedHashMap<>();
472,455
// autogenerated by CtBiScannerGenerator<NEW_LINE>@java.lang.Override<NEW_LINE>public <T> void visitCtArrayWrite(final spoon.reflect.code.CtArrayWrite<T> arrayWrite) {<NEW_LINE>spoon.reflect.code.CtArrayWrite other = ((spoon.reflect.code.CtArrayWrite) (this.stack.peek()));<NEW_LINE>enter(arrayWrite);<NEW_LINE>biScan(spoon.reflect.path.CtRole.ANNOTATION, arrayWrite.getAnnotations(), other.getAnnotations());<NEW_LINE>biScan(spoon.reflect.path.CtRole.TYPE, arrayWrite.getType(), other.getType());<NEW_LINE>biScan(spoon.reflect.path.CtRole.CAST, arrayWrite.getTypeCasts(<MASK><NEW_LINE>biScan(spoon.reflect.path.CtRole.TARGET, arrayWrite.getTarget(), other.getTarget());<NEW_LINE>biScan(spoon.reflect.path.CtRole.EXPRESSION, arrayWrite.getIndexExpression(), other.getIndexExpression());<NEW_LINE>biScan(spoon.reflect.path.CtRole.COMMENT, arrayWrite.getComments(), other.getComments());<NEW_LINE>exit(arrayWrite);<NEW_LINE>}
), other.getTypeCasts());
773,918
public void connect(final OnTransportConnected callback) {<NEW_LINE>new Thread(() -> {<NEW_LINE>final int timeout = candidate.getType() == JingleCandidate.TYPE_DIRECT ? SOCKET_TIMEOUT_DIRECT : SOCKET_TIMEOUT_PROXY;<NEW_LINE>try {<NEW_LINE>final boolean useTor = this.account.isOnion() || connection.getConnectionManager().getXmppConnectionService().useTorToConnect();<NEW_LINE>if (useTor) {<NEW_LINE>socket = SocksSocketFactory.createSocketOverTor(candidate.getHost(), candidate.getPort());<NEW_LINE>} else {<NEW_LINE>socket = new Socket();<NEW_LINE>SocketAddress address = new InetSocketAddress(candidate.getHost(<MASK><NEW_LINE>socket.connect(address, timeout);<NEW_LINE>}<NEW_LINE>inputStream = socket.getInputStream();<NEW_LINE>outputStream = socket.getOutputStream();<NEW_LINE>socket.setSoTimeout(timeout);<NEW_LINE>SocksSocketFactory.createSocksConnection(socket, destination, 0);<NEW_LINE>socket.setSoTimeout(0);<NEW_LINE>isEstablished = true;<NEW_LINE>callback.established();<NEW_LINE>} catch (final IOException e) {<NEW_LINE>callback.failed();<NEW_LINE>}<NEW_LINE>}).start();<NEW_LINE>}
), candidate.getPort());
1,190,789
protected void startSession(Capabilities capabilities) {<NEW_LINE>Response response = <MASK><NEW_LINE>if (response == null) {<NEW_LINE>throw new SessionNotCreatedException("The underlying command executor returned a null response.");<NEW_LINE>}<NEW_LINE>Object responseValue = response.getValue();<NEW_LINE>if (responseValue == null) {<NEW_LINE>throw new SessionNotCreatedException("The underlying command executor returned a response without payload: " + response);<NEW_LINE>}<NEW_LINE>if (!(responseValue instanceof Map)) {<NEW_LINE>throw new SessionNotCreatedException("The underlying command executor returned a response with a non well formed payload: " + response);<NEW_LINE>}<NEW_LINE>@SuppressWarnings("unchecked")<NEW_LINE>Map<String, Object> rawCapabilities = (Map<String, Object>) responseValue;<NEW_LINE>// A workaround for Selenium API enforcing some legacy capability values<NEW_LINE>rawCapabilities.remove(CapabilityType.PLATFORM);<NEW_LINE>if (rawCapabilities.containsKey(CapabilityType.BROWSER_NAME) && isBlank((String) rawCapabilities.get(CapabilityType.BROWSER_NAME))) {<NEW_LINE>rawCapabilities.remove(CapabilityType.BROWSER_NAME);<NEW_LINE>}<NEW_LINE>MutableCapabilities returnedCapabilities = new BaseOptions<>(rawCapabilities);<NEW_LINE>try {<NEW_LINE>Field capsField = RemoteWebDriver.class.getDeclaredField("capabilities");<NEW_LINE>capsField.setAccessible(true);<NEW_LINE>capsField.set(this, returnedCapabilities);<NEW_LINE>} catch (NoSuchFieldException | IllegalAccessException e) {<NEW_LINE>throw new WebDriverException(e);<NEW_LINE>}<NEW_LINE>setSessionId(response.getSessionId());<NEW_LINE>}
execute(new AppiumNewSessionCommandPayload(capabilities));
3,592
static void registerTypeAdapters(final Moshi.Builder moshiBuilder, final JsonProvider.Flag... flags) {<NEW_LINE>moshiBuilder.add(Date.class, applyFlagsToAdapter(new DateTypeAdapter(), flags));<NEW_LINE>moshiBuilder.add(Instant.class, applyFlagsToAdapter(new InstantTypeAdapter(), flags));<NEW_LINE>moshiBuilder.add(X509Certificate.class, applyFlagsToAdapter(new X509CertificateAdapter(), flags));<NEW_LINE>moshiBuilder.add(PasswordData.class, applyFlagsToAdapter(new PasswordDataAdapter(), flags));<NEW_LINE>moshiBuilder.add(DomainID.class, applyFlagsToAdapter(new DomainIdAdaptor(), flags));<NEW_LINE>moshiBuilder.add(LongAdder.class, applyFlagsToAdapter(<MASK><NEW_LINE>moshiBuilder.add(BigInteger.class, applyFlagsToAdapter(new BigIntegerTypeAdaptor(), flags));<NEW_LINE>moshiBuilder.add(Locale.class, applyFlagsToAdapter(new LocaleTypeAdaptor(), flags));<NEW_LINE>}
new LongAdderTypeAdaptor(), flags));
946,064
public void writeText(char c) throws IOException {<NEW_LINE>// process the rest<NEW_LINE>if (c == '<') {<NEW_LINE>super.w.write("&lt;");<NEW_LINE>} else if (c == '>') {<NEW_LINE><MASK><NEW_LINE>} else if (c == '&') {<NEW_LINE>super.w.write("&amp;");<NEW_LINE>} else if (c == '"') {<NEW_LINE>super.w.write("&quot;");<NEW_LINE>} else if (c == '\'') {<NEW_LINE>super.w.write("&apos;");<NEW_LINE>} else if (c > 255) {<NEW_LINE>super.w.write("&#" + (int) c + ";");<NEW_LINE>} else if (c == '\n' || c == '\r' || c == '\t') {<NEW_LINE>super.w.write(c);<NEW_LINE>} else if (c < 32) {<NEW_LINE>doNothing();<NEW_LINE>} else if (c >= 127 && c < 160) {<NEW_LINE>doNothing();<NEW_LINE>} else {<NEW_LINE>super.w.write(c);<NEW_LINE>}<NEW_LINE>}
super.w.write("&gt;");
971,827
public void openConsole(String absolutePath) throws IOException {<NEW_LINE>Runtime runtime = Runtime.getRuntime();<NEW_LINE>Process p = runtime.exec("readlink /etc/alternatives/x-terminal-emulator");<NEW_LINE>BufferedReader reader = new BufferedReader(new InputStreamReader(p.getInputStream()));<NEW_LINE>String emulatorName = reader.readLine();<NEW_LINE>if (emulatorName != null) {<NEW_LINE>emulatorName = emulatorName.substring(emulatorName.lastIndexOf<MASK><NEW_LINE>if (emulatorName.contains("gnome")) {<NEW_LINE>runtime.exec("gnome-terminal --working-directory=" + absolutePath);<NEW_LINE>} else if (emulatorName.contains("xfce4")) {<NEW_LINE>runtime.exec("xfce4-terminal --working-directory=" + absolutePath);<NEW_LINE>} else if (emulatorName.contains("konsole")) {<NEW_LINE>runtime.exec("konsole --workdir=" + absolutePath);<NEW_LINE>} else {<NEW_LINE>runtime.exec(emulatorName, null, new File(absolutePath));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
(File.separator) + 1);
331,803
private void switchType(boolean writable) {<NEW_LINE>int index = findMatchingComboItem();<NEW_LINE>if (index == -1) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>String s = typeComboBox<MASK><NEW_LINE>int last = s.indexOf("<");<NEW_LINE>String suffix = last == -1 ? "" : s.substring(last);<NEW_LINE>if (writable) {<NEW_LINE>typeComboBox.setModel(new DefaultComboBoxModel(WRITABLE_PROPS));<NEW_LINE>typeComboBox.setSelectedIndex(index);<NEW_LINE>} else {<NEW_LINE>typeComboBox.setModel(new DefaultComboBoxModel(READONLY_PROPS));<NEW_LINE>typeComboBox.setSelectedIndex(index);<NEW_LINE>}<NEW_LINE>if (last != -1) {<NEW_LINE>String newType = typeComboBox.getSelectedItem().toString();<NEW_LINE>int idx = newType.indexOf("<?>");<NEW_LINE>if (idx != -1) {<NEW_LINE>newType = newType.substring(0, idx) + suffix;<NEW_LINE>}<NEW_LINE>typeComboBox.setSelectedItem(newType);<NEW_LINE>}<NEW_LINE>}
.getSelectedItem().toString();
196,064
private void initializeMeta() throws BlockAlreadyExistsException, IOException, WorkerOutOfSpaceException, InvalidPathException {<NEW_LINE>// Create the storage directory path<NEW_LINE>boolean isDirectoryNewlyCreated = FileUtils.createStorageDirPath(mDirPath, ServerConfiguration.getString(PropertyKey.WORKER_DATA_FOLDER_PERMISSIONS));<NEW_LINE>String tmpDir = Paths.get(ServerConfiguration.getString(PropertyKey.WORKER_DATA_TMP_FOLDER)).getName(0).toString();<NEW_LINE>if (isDirectoryNewlyCreated) {<NEW_LINE>LOG.info("Folder {} was created!", mDirPath);<NEW_LINE>}<NEW_LINE>File dir = new File(mDirPath);<NEW_LINE>File[] paths = dir.listFiles();<NEW_LINE>if (paths == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>for (File path : paths) {<NEW_LINE>if (!path.isFile()) {<NEW_LINE>if (!path.getName().equals(tmpDir)) {<NEW_LINE>LOG.error("{} in StorageDir is not a file", path.getAbsolutePath());<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>// TODO(calvin): Resolve this conflict in class names.<NEW_LINE>org.apache.commons.io.FileUtils.deleteDirectory(path);<NEW_LINE>} catch (IOException e) {<NEW_LINE>LOG.error("can not delete directory {}", path.getAbsolutePath(), e);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>try {<NEW_LINE>long blockId = Long.parseLong(path.getName());<NEW_LINE>addBlockMeta(new DefaultBlockMeta(blockId, path.length(), this));<NEW_LINE>} catch (NumberFormatException e) {<NEW_LINE>LOG.error("filename of {} in StorageDir can not be parsed into long", path.getAbsolutePath(), e);<NEW_LINE>if (path.delete()) {<NEW_LINE>LOG.warn("file {} has been deleted", path.getAbsolutePath());<NEW_LINE>} else {<NEW_LINE>LOG.error(<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
"can not delete file {}", path.getAbsolutePath());
1,394,028
private static int[] square(int[] w, int[] x) {<NEW_LINE>// Note: this method allows w to be only (2 * x.Length - 1) words if result will fit<NEW_LINE>// if (w.length != 2 * x.length)<NEW_LINE>// {<NEW_LINE>// throw new IllegalArgumentException("no I don't think so...");<NEW_LINE>// }<NEW_LINE>long c;<NEW_LINE>int wBase = w.length - 1;<NEW_LINE>for (int i = x.length - 1; i != 0; --i) {<NEW_LINE>long v = x[i] & IMASK;<NEW_LINE>c = v * v + (w[wBase] & IMASK);<NEW_LINE>w[wBase] = (int) c;<NEW_LINE>c >>>= 32;<NEW_LINE>for (int j = i - 1; j >= 0; --j) {<NEW_LINE>long prod = v * <MASK><NEW_LINE>c += (w[--wBase] & IMASK) + ((prod << 1) & IMASK);<NEW_LINE>w[wBase] = (int) c;<NEW_LINE>c = (c >>> 32) + (prod >>> 31);<NEW_LINE>}<NEW_LINE>c += w[--wBase] & IMASK;<NEW_LINE>w[wBase] = (int) c;<NEW_LINE>if (--wBase >= 0) {<NEW_LINE>w[wBase] = (int) (c >> 32);<NEW_LINE>}<NEW_LINE>wBase += i;<NEW_LINE>}<NEW_LINE>c = x[0] & IMASK;<NEW_LINE>c = c * c + (w[wBase] & IMASK);<NEW_LINE>w[wBase] = (int) c;<NEW_LINE>if (--wBase >= 0) {<NEW_LINE>w[wBase] += (int) (c >> 32);<NEW_LINE>}<NEW_LINE>return w;<NEW_LINE>}
(x[j] & IMASK);
743,690
private GroupManager.GroupActionResult fetchGroupStateAndSendUpdate(@NonNull Recipient groupRecipient, @NonNull DecryptedGroup decryptedGroup, @NonNull DecryptedGroupChange decryptedChange, @NonNull GroupChange signedGroupChange) throws GroupChangeFailedException, IOException {<NEW_LINE>try {<NEW_LINE>new GroupsV2StateProcessor(context).forGroup(groupMasterKey).updateLocalGroupToRevision(decryptedChange.getRevision(), System.currentTimeMillis(), decryptedChange);<NEW_LINE>RecipientAndThread recipientAndThread = sendGroupUpdateHelper.sendGroupUpdate(groupMasterKey, new GroupMutation(null, decryptedChange, decryptedGroup), signedGroupChange);<NEW_LINE>return new GroupManager.GroupActionResult(groupRecipient, recipientAndThread.threadId, 1, Collections.emptyList());<NEW_LINE>} catch (GroupNotAMemberException e) {<NEW_LINE>Log.w(TAG, "Despite adding self to group, server says we are not a member, scheduling refresh of group info " + groupId, e);<NEW_LINE>ApplicationDependencies.getJobManager().add(new RequestGroupV2InfoJob(groupId));<NEW_LINE>throw new GroupChangeFailedException(e);<NEW_LINE>} catch (IOException e) {<NEW_LINE>Log.w(TAG, "Group data fetch failed, scheduling refresh of group info " + groupId, e);<NEW_LINE>ApplicationDependencies.getJobManager().<MASK><NEW_LINE>throw e;<NEW_LINE>}<NEW_LINE>}
add(new RequestGroupV2InfoJob(groupId));
1,593,087
public void transform(Templates xslt, Map<String, Object> transformParameters, Result result) throws Docx4JException {<NEW_LINE>// JAXBResult result = XmlUtils.prepareJAXBResult(jc);<NEW_LINE>if (jaxbElement == null) {<NEW_LINE>PartStore partStore = this.getPackage().getSourcePartStore();<NEW_LINE>String name = this.getPartName().getName();<NEW_LINE>try (InputStream is = partStore.loadPart(name.substring(1))) {<NEW_LINE>if (is == null) {<NEW_LINE>log.warn(name + " missing from part store");<NEW_LINE>throw new Docx4JException(name + " missing from part store");<NEW_LINE>}<NEW_LINE>// Guard against XXE<NEW_LINE>XMLInputFactory xif = XMLInputFactory.newInstance();<NEW_LINE>xif.setProperty(XMLInputFactory.IS_SUPPORTING_EXTERNAL_ENTITIES, false);<NEW_LINE>// a DTD is merely ignored, its presence doesn't cause an exception<NEW_LINE>xif.setProperty(XMLInputFactory.SUPPORT_DTD, false);<NEW_LINE>XMLStreamReader xsr = xif.createXMLStreamReader(is);<NEW_LINE>XmlUtils.transform(new StAXSource(xsr), xslt, transformParameters, result);<NEW_LINE>} catch (IOException e) /* closing InputStream */<NEW_LINE>{<NEW_LINE>throw new Docx4JException(e.getMessage(), e);<NEW_LINE>} catch (XMLStreamException e) {<NEW_LINE>throw new Docx4JException(e.getMessage(), e);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>org.w3c.dom.Document doc = org<MASK><NEW_LINE>try {<NEW_LINE>this.marshal(doc);<NEW_LINE>} catch (JAXBException e) {<NEW_LINE>// shouldn't happen<NEW_LINE>throw new Docx4JException("Marshalling exception preparing content for transform", e);<NEW_LINE>}<NEW_LINE>org.docx4j.XmlUtils.transform(doc, xslt, transformParameters, result);<NEW_LINE>}<NEW_LINE>// try {<NEW_LINE>// return (E) XmlUtils.unwrap(result.getResult() );<NEW_LINE>// } catch (JAXBException e) {<NEW_LINE>// throw new Docx4JException("Problem with transform result", e);<NEW_LINE>// }<NEW_LINE>}
.docx4j.XmlUtils.neww3cDomDocument();
1,059,045
protected void init(Properties props) throws BadRealmException, NoSuchRealmException {<NEW_LINE>super.init(props);<NEW_LINE>String file = props.getProperty(PARAM_KEYFILE);<NEW_LINE>if (file == null) {<NEW_LINE>throw new BadRealmException<MASK><NEW_LINE>}<NEW_LINE>if (file.contains("$")) {<NEW_LINE>file = RelativePathResolver.resolvePath(file);<NEW_LINE>}<NEW_LINE>setProperty(PARAM_KEYFILE, file);<NEW_LINE>String jaasCtx = props.getProperty(JAAS_CONTEXT_PARAM);<NEW_LINE>if (jaasCtx == null) {<NEW_LINE>throw new BadRealmException(sm.getString("filerealm.nomodule"));<NEW_LINE>}<NEW_LINE>setProperty(JAAS_CONTEXT_PARAM, jaasCtx);<NEW_LINE>_logger.log(FINE, "FileRealm : " + PARAM_KEYFILE + "={0}", file);<NEW_LINE>_logger.log(FINE, "FileRealm : " + JAAS_CONTEXT_PARAM + "={0}", jaasCtx);<NEW_LINE>try {<NEW_LINE>if (isEmbeddedServer()) {<NEW_LINE>file = writeConfigFileToTempDir(file).getAbsolutePath();<NEW_LINE>}<NEW_LINE>fileRealmStorageManager = new FileRealmStorageManager(file);<NEW_LINE>} catch (IOException ioe) {<NEW_LINE>throw new BadRealmException(sm.getString("filerealm.noaccess", ioe.toString()));<NEW_LINE>}<NEW_LINE>}
(sm.getString("filerealm.nofile"));
332,210
public TransitionState unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>TransitionState transitionState = new TransitionState();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>if (context.testExpression("enabled", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>transitionState.setEnabled(context.getUnmarshaller(Boolean.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("lastChangedBy", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>transitionState.setLastChangedBy(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("lastChangedAt", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>transitionState.setLastChangedAt(DateJsonUnmarshallerFactory.getInstance("unixTimestamp").unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("disabledReason", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>transitionState.setDisabledReason(context.getUnmarshaller(String.<MASK><NEW_LINE>}<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return transitionState;<NEW_LINE>}
class).unmarshall(context));
808,563
public void run(RegressionEnvironment env) {<NEW_LINE>String[] fields = new String[] { "symbol" };<NEW_LINE>sendTimer(env, 1000);<NEW_LINE>String text = "@name('s0') select irstream * from SupportMarketDataBean#time_length_batch(10 sec, 3, 'force_update')";<NEW_LINE>env.compileDeployAddListenerMileZero(text, "s0");<NEW_LINE>sendTimer(env, 1000);<NEW_LINE>sendEvent(env, "E1");<NEW_LINE>env.milestone(1);<NEW_LINE>sendTimer(env, 5000);<NEW_LINE>sendEvent(env, "E2");<NEW_LINE>env.milestone(2);<NEW_LINE>sendTimer(env, 10999);<NEW_LINE>env.assertListenerNotInvoked("s0");<NEW_LINE>sendTimer(env, 11000);<NEW_LINE>env.assertPropsPerRowIRPair("s0", fields, new Object[][] { { "E1" }, { "E2" } }, null);<NEW_LINE>env.milestone(3);<NEW_LINE>sendTimer(env, 12000);<NEW_LINE>sendEvent(env, "E3");<NEW_LINE>sendEvent(env, "E4");<NEW_LINE>env.milestone(4);<NEW_LINE>sendTimer(env, 15000);<NEW_LINE>sendEvent(env, "E5");<NEW_LINE>env.assertPropsPerRowIRPair("s0", fields, new Object[][] { { "E3" }, { "E4" }, { "E5" } }, new Object[][] { { "E1" }, { "E2" } });<NEW_LINE>env.milestone(5);<NEW_LINE>sendTimer(env, 24999);<NEW_LINE>env.assertListenerNotInvoked("s0");<NEW_LINE>// wait 10 second, check call<NEW_LINE>sendTimer(env, 25000);<NEW_LINE>env.assertPropsPerRowIRPair("s0", fields, null, new Object[][] { { "E3" }, { "E4" }, { "E5" } });<NEW_LINE>env.milestone(6);<NEW_LINE>// wait 10 second, check call, should receive event<NEW_LINE>sendTimer(env, 35000);<NEW_LINE>env.assertPropsPerRowIRPair(<MASK><NEW_LINE>env.undeployAll();<NEW_LINE>}
"s0", fields, null, null);
747,915
void UIThreadInit(@NonNull final GLViewHolder viewHolder, @Nullable final HttpHandler handler) {<NEW_LINE>// Use the DefaultHttpHandler if none is provided<NEW_LINE>if (handler == null) {<NEW_LINE>httpHandler = new DefaultHttpHandler();<NEW_LINE>} else {<NEW_LINE>httpHandler = handler;<NEW_LINE>}<NEW_LINE>Context context = viewHolder.getView().getContext();<NEW_LINE>uiThreadHandler = new Handler(context.getMainLooper());<NEW_LINE>mapRenderer <MASK><NEW_LINE>// Set up MapView<NEW_LINE>this.viewHolder = viewHolder;<NEW_LINE>viewHolder.setRenderer(mapRenderer);<NEW_LINE>viewHolder.setRenderMode(GLViewHolder.RenderMode.RENDER_WHEN_DIRTY);<NEW_LINE>touchInput = new TouchInput(context);<NEW_LINE>touchInput.setPanResponder(getPanResponder());<NEW_LINE>touchInput.setScaleResponder(getScaleResponder());<NEW_LINE>touchInput.setRotateResponder(getRotateResponder());<NEW_LINE>touchInput.setShoveResponder(getShoveResponder());<NEW_LINE>touchInput.setSimultaneousDetectionDisabled(Gestures.SHOVE, Gestures.ROTATE);<NEW_LINE>touchInput.setSimultaneousDetectionDisabled(Gestures.ROTATE, Gestures.SHOVE);<NEW_LINE>touchInput.setSimultaneousDetectionDisabled(Gestures.SHOVE, Gestures.SCALE);<NEW_LINE>touchInput.setSimultaneousDetectionDisabled(Gestures.SHOVE, Gestures.PAN);<NEW_LINE>touchInput.setSimultaneousDetectionDisabled(Gestures.SCALE, Gestures.LONG_PRESS);<NEW_LINE>}
= new MapRenderer(this, uiThreadHandler);
1,441,187
private // ---------//<NEW_LINE>void addSlur(SlurInter slur, Integer num, HorizontalSide side, boolean continuation) {<NEW_LINE>final Staff staff = current.note.getStaff();<NEW_LINE>final CubicCurve2D curve = slur.getCurve();<NEW_LINE>// Slur element<NEW_LINE>final Slur pmSlur = factory.createSlur();<NEW_LINE>if (num != null) {<NEW_LINE>pmSlur.setNumber(num);<NEW_LINE>}<NEW_LINE>// Type<NEW_LINE>pmSlur.setType(continuation ? StartStopContinue.CONTINUE : ((side == LEFT) ? StartStopContinue.START : StartStopContinue.STOP));<NEW_LINE>// Placement<NEW_LINE>if (side == LEFT) {<NEW_LINE>pmSlur.setPlacement(slur.isAbove() ? <MASK><NEW_LINE>}<NEW_LINE>// End point<NEW_LINE>final Point2D end = (side == LEFT) ? curve.getP1() : curve.getP2();<NEW_LINE>pmSlur.setDefaultX(toTenths(end.getX() - current.note.getCenterLeft().x));<NEW_LINE>pmSlur.setDefaultY(yOf(end, staff));<NEW_LINE>// Control point<NEW_LINE>final Point2D ctrl = (side == LEFT) ? curve.getCtrlP1() : curve.getCtrlP2();<NEW_LINE>if ((side == LEFT) && continuation) {<NEW_LINE>pmSlur.setBezierX2(toTenths(ctrl.getX() - end.getX()));<NEW_LINE>pmSlur.setBezierY2(toTenths(end.getY() - ctrl.getY()));<NEW_LINE>} else {<NEW_LINE>pmSlur.setBezierX(toTenths(ctrl.getX() - end.getX()));<NEW_LINE>pmSlur.setBezierY(toTenths(end.getY() - ctrl.getY()));<NEW_LINE>}<NEW_LINE>getNotations().getTiedOrSlurOrTuplet().add(pmSlur);<NEW_LINE>}
AboveBelow.ABOVE : AboveBelow.BELOW);
584,866
public static void show(final Context context, @NonNull final MuteSelectionListener listener) {<NEW_LINE>AlertDialog.Builder builder = new AlertDialog.Builder(context);<NEW_LINE>builder.setTitle(R.string.menu_mute);<NEW_LINE>builder.setNegativeButton(R.string.cancel, null);<NEW_LINE>builder.setItems(R.array.mute_durations, (dialog, which) -> {<NEW_LINE>final long muteUntil;<NEW_LINE>// See https://c.delta.chat/classdc__context__t.html#a6460395925d49d2053bc95224bf5ce37.<NEW_LINE>switch(which) {<NEW_LINE>case 0:<NEW_LINE>muteUntil = TimeUnit.HOURS.toSeconds(1);<NEW_LINE>break;<NEW_LINE>case 1:<NEW_LINE>muteUntil = TimeUnit.HOURS.toSeconds(2);<NEW_LINE>break;<NEW_LINE>case 2:<NEW_LINE>muteUntil = <MASK><NEW_LINE>break;<NEW_LINE>case 3:<NEW_LINE>muteUntil = TimeUnit.DAYS.toSeconds(7);<NEW_LINE>break;<NEW_LINE>// mute forever<NEW_LINE>case 4:<NEW_LINE>muteUntil = -1;<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>muteUntil = 0;<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>listener.onMuted(muteUntil);<NEW_LINE>});<NEW_LINE>builder.show();<NEW_LINE>}
TimeUnit.DAYS.toSeconds(1);
481,570
public // added by Gary - ghuang@cs.umass.edu<NEW_LINE>InstanceList sampleWithWeights(java.util.Random r, double[] weights) {<NEW_LINE>if (weights.length != size())<NEW_LINE>throw new IllegalArgumentException("length of weight vector must equal number of instances");<NEW_LINE>if (size() == 0)<NEW_LINE>return cloneEmpty();<NEW_LINE>@Var<NEW_LINE>double sumOfWeights = 0;<NEW_LINE>for (int i = 0; i < size(); i++) {<NEW_LINE>if (weights[i] < 0)<NEW_LINE>throw new IllegalArgumentException("weight vector must be non-negative");<NEW_LINE>sumOfWeights += weights[i];<NEW_LINE>}<NEW_LINE>if (sumOfWeights <= 0)<NEW_LINE>throw new IllegalArgumentException("weights must sum to positive value");<NEW_LINE>InstanceList newList = new InstanceList(getPipe(), size());<NEW_LINE>double[] probabilities = new double[size()];<NEW_LINE>@Var<NEW_LINE>double sumProbs = 0;<NEW_LINE>for (int i = 0; i < size(); i++) {<NEW_LINE>sumProbs += r.nextDouble();<NEW_LINE>probabilities[i] = sumProbs;<NEW_LINE>}<NEW_LINE>MatrixOps.timesEquals(probabilities, sumOfWeights / sumProbs);<NEW_LINE>// make sure rounding didn't mess things up<NEW_LINE>probabilities[size() - 1] = sumOfWeights;<NEW_LINE>// do sampling<NEW_LINE>@Var<NEW_LINE>int a = 0;<NEW_LINE>@Var<NEW_LINE>int b = 0;<NEW_LINE>sumProbs = 0;<NEW_LINE>while (a < size() && b < size()) {<NEW_LINE>sumProbs += weights[b];<NEW_LINE>while (a < size() && probabilities[a] <= sumProbs) {<NEW_LINE>newList<MASK><NEW_LINE>newList.setInstanceWeight(a, 1);<NEW_LINE>a++;<NEW_LINE>}<NEW_LINE>b++;<NEW_LINE>}<NEW_LINE>return newList;<NEW_LINE>}
.add(get(b));
395,721
/* *<NEW_LINE>* Remove the redundant rows for the same option based on the scope and return<NEW_LINE>* the value that takes precedence over others. For example the option set in session<NEW_LINE>* scope takes precedence over system and boot and etc.,<NEW_LINE>*/<NEW_LINE>public Iterator<OptionValue> sortOptions(Iterator<OptionValue> options) {<NEW_LINE>List<OptionValue> optionslist = Lists.newArrayList(options);<NEW_LINE>HashMap<String, OptionValue> optionsmap = new HashMap<>();<NEW_LINE>for (OptionValue option : optionslist) {<NEW_LINE>if (option.scope == OptionScope.QUERY) {<NEW_LINE>// Option set on query level should be ignored here as its value should not be shown to user<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (optionsmap.containsKey(option.getName())) {<NEW_LINE>if (option.scope.compareTo(optionsmap.get(option.getName()).scope) > 0) {<NEW_LINE>optionsmap.put(option.getName(), option);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>optionsmap.put(option.getName(), option);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>optionslist.clear();<NEW_LINE>for (String name : optionsmap.keySet()) {<NEW_LINE>optionslist.add<MASK><NEW_LINE>}<NEW_LINE>optionslist.sort(Comparator.comparing(OptionValue::getName));<NEW_LINE>return optionslist.iterator();<NEW_LINE>}
(optionsmap.get(name));
709,121
private static SuggestedFix convertListToSetInit(VariableTree var, VisitorState state) {<NEW_LINE>SuggestedFix.Builder fix = SuggestedFix.builder().addImport(ImmutableSet.class.getName()).replace(stripParameters(var.getType()), "ImmutableSet");<NEW_LINE>if (IMMUTABLE_LIST_FACTORIES.matches(var.getInitializer(), state)) {<NEW_LINE>fix.replace(getReceiver(var.getInitializer()), "ImmutableSet");<NEW_LINE>return fix.build();<NEW_LINE>}<NEW_LINE>if (IMMUTABLE_COLLECTION.matches(var.getInitializer(), state)) {<NEW_LINE>fix.addStaticImport("com.google.common.collect.ImmutableSet.toImmutableSet").replace(getOnlyElement(((MethodInvocationTree) var.getInitializer()).getArguments()), "toImmutableSet()");<NEW_LINE>return fix.build();<NEW_LINE>}<NEW_LINE>if (IMMUTABLE_LIST_BUILD.matches(var.getInitializer(), state)) {<NEW_LINE>Optional<ExpressionTree> rootExpr = getRootMethod((MethodInvocationTree) var.getInitializer(), state);<NEW_LINE>if (rootExpr.isPresent()) {<NEW_LINE>if (rootExpr.get().getKind().equals(Kind.METHOD_INVOCATION)) {<NEW_LINE>MethodInvocationTree methodTree = (MethodInvocationTree) rootExpr.get();<NEW_LINE>fix.replace(getReceiver(methodTree), "ImmutableSet");<NEW_LINE>return fix.build();<NEW_LINE>}<NEW_LINE>if (rootExpr.get().getKind().equals(Kind.NEW_CLASS)) {<NEW_LINE>NewClassTree ctorTree = (NewClassTree) rootExpr.get();<NEW_LINE>fix.replace(stripParameters(ctorTree<MASK><NEW_LINE>}<NEW_LINE>return fix.build();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return fix.replace(var.getInitializer(), "ImmutableSet.copyOf(" + state.getSourceForNode(var.getInitializer()) + ")").build();<NEW_LINE>}
.getIdentifier()), "ImmutableSet.Builder");
975,368
public void calculateDerivedFields() {<NEW_LINE>// In doubleton sets, the rate of different alleles over het sites is half the replication rate,<NEW_LINE>biSiteHeterogeneityRate = nDifferentAllelesBiDups / (double) (nDifferentAllelesBiDups + nAlternateAllelesBiDups + nReferenceAllelesBiDups);<NEW_LINE>biSiteHomogeneityRate = 1 - biSiteHeterogeneityRate;<NEW_LINE>this.independentReplicationRateFromBiDups = 2 * biSiteHeterogeneityRate;<NEW_LINE>// in tripleton sets, the calculation is a little more complicated....see below<NEW_LINE>triSiteHeterogeneityRate = nDifferentAllelesTriDups / (double) (nDifferentAllelesTriDups + nAlternateAllelesTriDups + nReferenceAllelesTriDups);<NEW_LINE>triSiteHomogeneityRate = 1 - triSiteHeterogeneityRate;<NEW_LINE>independentReplicationRateFromTriDups = 2 * (1 - Math.sqrt(triSiteHomogeneityRate));<NEW_LINE>// Some more metric collection here:<NEW_LINE>pSameUmiInIndependentBiDup = nMatchingUMIsInDiffBiDups / (double) (nMismatchingUMIsInDiffBiDups + nMatchingUMIsInDiffBiDups);<NEW_LINE>pSameAlleleWhenMismatchingUmi = nMismatchingUMIsInSameBiDups / (double) (nMismatchingUMIsInSameBiDups + nMismatchingUMIsInDiffBiDups);<NEW_LINE>independentReplicationRateFromUmi = (nMismatchingUMIsInDiffBiDups <MASK><NEW_LINE>final int numberOfBigSets = nDuplicateSets - nExactlyDouble - nExactlyDouble;<NEW_LINE>replicationRateFromReplicateSets = (nExactlyDouble + nExactlyTriple * 2 + nReadsInBigSets - numberOfBigSets) / (double) nTotalReads;<NEW_LINE>}
+ nMismatchingUMIsInSameBiDups) / (double) nExactlyDouble;
972,301
public boolean onGenericMotion(View v, MotionEvent event) {<NEW_LINE>if (activity.joystickActive == false) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>int id = event.getDeviceId();<NEW_LINE>int index = activity.indexOfJoystick(id);<NEW_LINE>if (index >= 0) {<NEW_LINE>float ax = event.getAxisValue(MotionEvent.AXIS_X, 0);<NEW_LINE>float ay = event.getAxisValue(MotionEvent.AXIS_Y, 0);<NEW_LINE>float ahx = event.getAxisValue(MotionEvent.AXIS_HAT_X, 0);<NEW_LINE>float ahy = event.getAxisValue(MotionEvent.AXIS_HAT_Y, 0);<NEW_LINE>float az = event.getAxisValue(MotionEvent.AXIS_Z, 0);<NEW_LINE>float arz = event.getAxisValue(MotionEvent.AXIS_RZ, 0);<NEW_LINE>if (ax != axis0_x || ay != axis0_y) {<NEW_LINE>surface.nativeOnJoystickAxis(index, 0, 0, ax);<NEW_LINE>surface.nativeOnJoystickAxis(index, 0, 1, ay);<NEW_LINE>axis0_x = ax;<NEW_LINE>axis0_y = ay;<NEW_LINE>} else if (ahx != axis0_hat_x || ahy != axis0_hat_y) {<NEW_LINE>handleHat(index, axis0_hat_x, ahx, AllegroActivity.JS_DPAD_L, AllegroActivity.JS_DPAD_R);<NEW_LINE>handleHat(index, axis0_hat_y, ahy, AllegroActivity.JS_DPAD_U, AllegroActivity.JS_DPAD_D);<NEW_LINE>axis0_hat_x = ahx;<NEW_LINE>axis0_hat_y = ahy;<NEW_LINE>}<NEW_LINE>if (az != axis1_x || arz != axis1_y) {<NEW_LINE>surface.nativeOnJoystickAxis(<MASK><NEW_LINE>surface.nativeOnJoystickAxis(index, 1, 1, arz);<NEW_LINE>axis1_x = az;<NEW_LINE>axis1_y = arz;<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>}
index, 1, 0, az);
281,159
public void toGraphviz(@Nullable CircuitOperator sourceToShow, boolean deep, int indent, StringBuilder builder) {<NEW_LINE>String src = sourceToShow != null ? sourceToShow.graphvizId() : this.source.graphvizId();<NEW_LINE>for (Pair<ComputationalElement, ComputationalElement> cp : this.consumers) {<NEW_LINE>Utilities.indent(indent, builder);<NEW_LINE>ComputationalElement toShow = cp.first;<NEW_LINE>if (sourceToShow != null && toShow.parent == sourceToShow.circuit)<NEW_LINE>// The destination is a member of the circuit element which is the source,<NEW_LINE>// skip it.<NEW_LINE>continue;<NEW_LINE>if (cp.second instanceof CircuitOperator) {<NEW_LINE>CircuitOperator co = (CircuitOperator) cp.second;<NEW_LINE>if (!deep && co.basic)<NEW_LINE>toShow = co;<NEW_LINE>}<NEW_LINE>builder.append(src).append(" -> ").append(toShow.graphvizId()).append(" [label=\"(").append(this.id).append(")").append(this.valueAsString()).append<MASK><NEW_LINE>}<NEW_LINE>}
("\"]").append("\n");
532,831
private static RequestInput parseRequest(ChannelHandlerContext ctx, FullHttpRequest req, QueryStringDecoder decoder) {<NEW_LINE>String requestId = NettyUtils.<MASK><NEW_LINE>RequestInput inputData = new RequestInput(requestId);<NEW_LINE>if (decoder != null) {<NEW_LINE>for (Map.Entry<String, List<String>> entry : decoder.parameters().entrySet()) {<NEW_LINE>String key = entry.getKey();<NEW_LINE>for (String value : entry.getValue()) {<NEW_LINE>inputData.addParameter(new InputParameter(key, value));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>CharSequence contentType = HttpUtil.getMimeType(req);<NEW_LINE>for (Map.Entry<String, String> entry : req.headers().entries()) {<NEW_LINE>inputData.updateHeaders(entry.getKey(), entry.getValue());<NEW_LINE>}<NEW_LINE>if (HttpPostRequestDecoder.isMultipart(req) || HttpHeaderValues.APPLICATION_X_WWW_FORM_URLENCODED.contentEqualsIgnoreCase(contentType)) {<NEW_LINE>HttpDataFactory factory = new DefaultHttpDataFactory(6553500);<NEW_LINE>HttpPostRequestDecoder form = new HttpPostRequestDecoder(factory, req);<NEW_LINE>try {<NEW_LINE>while (form.hasNext()) {<NEW_LINE>inputData.addParameter(NettyUtils.getFormData(form.next()));<NEW_LINE>}<NEW_LINE>} catch (HttpPostRequestDecoder.EndOfDataDecoderException ignore) {<NEW_LINE>logger.trace("End of multipart items.");<NEW_LINE>} finally {<NEW_LINE>form.cleanFiles();<NEW_LINE>form.destroy();<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>byte[] content = NettyUtils.getBytes(req.content());<NEW_LINE>inputData.addParameter(new InputParameter("body", content, contentType));<NEW_LINE>}<NEW_LINE>return inputData;<NEW_LINE>}
getRequestId(ctx.channel());
1,412,118
private void sortTypeDescContextItems(BallerinaCompletionContext context, List<LSCompletionItem> completionItems) {<NEW_LINE>for (LSCompletionItem lsItem : completionItems) {<NEW_LINE>String sortText = "";<NEW_LINE>boolean isModuleCItem = SortingUtil.isModuleCompletionItem(lsItem);<NEW_LINE>if (!isModuleCItem && lsItem.getType() == LSCompletionItem.CompletionItemType.SYMBOL) {<NEW_LINE>Symbol symbol = ((SymbolCompletionItem) lsItem).getSymbol().orElse(null);<NEW_LINE>Optional<TypeSymbol> typeDesc = SymbolUtil.getTypeDescriptor(symbol);<NEW_LINE>if (typeDesc.isPresent()) {<NEW_LINE>TypeSymbol rawType = CommonUtil.getRawType(typeDesc.get());<NEW_LINE>sortText = rawType.kind() == SymbolKind.CLASS ? genSortText(1) : genSortText(2);<NEW_LINE>}<NEW_LINE>} else if (isModuleCItem) {<NEW_LINE>sortText = genSortText(3<MASK><NEW_LINE>}<NEW_LINE>if (sortText.isEmpty()) {<NEW_LINE>sortText = genSortText(4);<NEW_LINE>}<NEW_LINE>lsItem.getCompletionItem().setSortText(sortText);<NEW_LINE>}<NEW_LINE>}
) + genSortTextForModule(context, lsItem);
1,100,545
private CCLicense retrieveLicenseObject(final String licenseId, CloseableHttpResponse response) throws IOException, JDOMException {<NEW_LINE>String responseString = EntityUtils.toString(response.getEntity());<NEW_LINE>XPathExpression<Object> licenseClassXpath = XPathFactory.instance().compile("//licenseclass", Filters.fpassthrough());<NEW_LINE>XPathExpression<Element> licenseFieldXpath = XPathFactory.instance().compile("field", Filters.element());<NEW_LINE>try (StringReader stringReader = new StringReader(responseString)) {<NEW_LINE>InputSource is = new InputSource(stringReader);<NEW_LINE>org.jdom2.Document classDoc = <MASK><NEW_LINE>Object element = licenseClassXpath.evaluateFirst(classDoc);<NEW_LINE>String licenseLabel = getSingleNodeValue(element, "label");<NEW_LINE>List<CCLicenseField> ccLicenseFields = new LinkedList<>();<NEW_LINE>List<Element> licenseFields = licenseFieldXpath.evaluate(element);<NEW_LINE>for (Element licenseField : licenseFields) {<NEW_LINE>CCLicenseField ccLicenseField = parseLicenseField(licenseField);<NEW_LINE>ccLicenseFields.add(ccLicenseField);<NEW_LINE>}<NEW_LINE>return new CCLicense(licenseId, licenseLabel, ccLicenseFields);<NEW_LINE>}<NEW_LINE>}
this.parser.build(is);
739,665
protected static BufferedImage applyExplicitMask(BufferedImage baseImage, Color fill) {<NEW_LINE>// create an<NEW_LINE>int baseWidth = baseImage.getWidth();<NEW_LINE>int baseHeight = baseImage.getHeight();<NEW_LINE>BufferedImage imageMask;<NEW_LINE>if (hasAlpha(baseImage)) {<NEW_LINE>imageMask = baseImage;<NEW_LINE>} else {<NEW_LINE>imageMask = ImageUtility.createTranslucentCompatibleImage(baseWidth, baseHeight);<NEW_LINE>}<NEW_LINE>// apply the mask by simply painting white to the base image where<NEW_LINE>// the mask specified no colour.<NEW_LINE>int[] srcBand = new int[baseWidth];<NEW_LINE>int[] maskBnd = new int[baseWidth];<NEW_LINE><MASK><NEW_LINE>// iterate over each band to apply the mask<NEW_LINE>for (int i = 0; i < baseHeight; i++) {<NEW_LINE>baseImage.getRGB(0, i, baseWidth, 1, srcBand, 0, baseWidth);<NEW_LINE>imageMask.getRGB(0, i, baseWidth, 1, maskBnd, 0, baseWidth);<NEW_LINE>// apply the soft mask blending<NEW_LINE>for (int j = 0; j < baseWidth; j++) {<NEW_LINE>if (!(srcBand[j] == -1 || srcBand[j] == 0xffffff)) {<NEW_LINE>maskBnd[j] = fillRgb;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>imageMask.setRGB(0, i, baseWidth, 1, maskBnd, 0, baseWidth);<NEW_LINE>}<NEW_LINE>// clean up the old image.<NEW_LINE>baseImage.flush();<NEW_LINE>// return the mask.<NEW_LINE>return imageMask;<NEW_LINE>}
int fillRgb = fill.getRGB();
609,695
public VoidResult extendBucketWorm(ExtendBucketWormRequest extendBucketWormRequest) throws OSSException, ClientException {<NEW_LINE>assertParameterNotNull(extendBucketWormRequest, "extendBucketWormRequest");<NEW_LINE>String bucketName = extendBucketWormRequest.getBucketName();<NEW_LINE>String wormId = extendBucketWormRequest.getWormId();<NEW_LINE>assertParameterNotNull(wormId, "wormId");<NEW_LINE>assertParameterNotNull(bucketName, "bucketName");<NEW_LINE>ensureBucketNameValid(bucketName);<NEW_LINE>Map<String, String> params = new HashMap<String, String>();<NEW_LINE>params.put(SUBRESOURCE_WORM_ID, wormId);<NEW_LINE>params.put(SUBRESOURCE_WORM_EXTEND, null);<NEW_LINE>byte[] rawContent = extendBucketWormRequestMarshaller.marshall(extendBucketWormRequest);<NEW_LINE>Map<String, String> headers = new <MASK><NEW_LINE>addRequestRequiredHeaders(headers, rawContent);<NEW_LINE>RequestMessage request = new OSSRequestMessageBuilder(getInnerClient()).setEndpoint(getEndpoint(extendBucketWormRequest)).setMethod(HttpMethod.POST).setBucket(bucketName).setParameters(params).setHeaders(headers).setOriginalRequest(extendBucketWormRequest).setInputSize(rawContent.length).setInputStream(new ByteArrayInputStream(rawContent)).build();<NEW_LINE>return doOperation(request, requestIdResponseParser, bucketName, null);<NEW_LINE>}
HashMap<String, String>();
1,301,648
public Container andNot(BitmapContainer x) {<NEW_LINE>// could be implemented as toTemporaryBitmap().iandNot(x);<NEW_LINE>int card = this.getCardinality();<NEW_LINE>if (card <= ArrayContainer.DEFAULT_MAX_SIZE) {<NEW_LINE>// result can only be an array (assuming that we never make a RunContainer)<NEW_LINE>ArrayContainer answer = new ArrayContainer(card);<NEW_LINE>answer.cardinality = 0;<NEW_LINE>for (int rlepos = 0; rlepos < this.nbrruns; ++rlepos) {<NEW_LINE>int runStart = (this.getValue(rlepos));<NEW_LINE>int runEnd = runStart + (this.getLength(rlepos));<NEW_LINE>for (int runValue = runStart; runValue <= runEnd; ++runValue) {<NEW_LINE>if (!x.contains((char) runValue)) {<NEW_LINE>// it looks like contains() should be cheap enough if<NEW_LINE>// accessed sequentially<NEW_LINE>answer.content[answer.cardinality++] = (char) runValue;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return answer;<NEW_LINE>}<NEW_LINE>// we expect the answer to be a bitmap (if we are lucky)<NEW_LINE>BitmapContainer answer = x.clone();<NEW_LINE>int lastPos = 0;<NEW_LINE>for (int rlepos = 0; rlepos < this.nbrruns; ++rlepos) {<NEW_LINE>int start = (this.getValue(rlepos));<NEW_LINE>int end = start + (this.getLength(rlepos)) + 1;<NEW_LINE>int prevOnes = answer.cardinalityInRange(lastPos, start);<NEW_LINE>int flippedOnes = answer.cardinalityInRange(start, end);<NEW_LINE>Util.resetBitmapRange(answer.bitmap, lastPos, start);<NEW_LINE>Util.flipBitmapRange(answer.bitmap, start, end);<NEW_LINE>answer.updateCardinality(prevOnes + flippedOnes, end - start - flippedOnes);<NEW_LINE>lastPos = end;<NEW_LINE>}<NEW_LINE>int ones = answer.<MASK><NEW_LINE>Util.resetBitmapRange(answer.bitmap, lastPos, BitmapContainer.MAX_CAPACITY);<NEW_LINE>answer.updateCardinality(ones, 0);<NEW_LINE>if (answer.getCardinality() > ArrayContainer.DEFAULT_MAX_SIZE) {<NEW_LINE>return answer;<NEW_LINE>} else {<NEW_LINE>return answer.toArrayContainer();<NEW_LINE>}<NEW_LINE>}
cardinalityInRange(lastPos, BitmapContainer.MAX_CAPACITY);
244,568
public OCompositeKey preprocess(OCompositeKey value, Object... hints) {<NEW_LINE>if (value == null) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>final OType[] types = (OType[]) hints;<NEW_LINE>final List<Object> keys = value.getKeys();<NEW_LINE>boolean preprocess = false;<NEW_LINE>for (int i = 0; i < keys.size(); i++) {<NEW_LINE>final OType type = types[i];<NEW_LINE>if (type == OType.DATE || (type == OType.LINK && !(keys.get(i) instanceof ORID))) {<NEW_LINE>preprocess = true;<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (!preprocess) {<NEW_LINE>return value;<NEW_LINE>}<NEW_LINE>final OCompositeKey compositeKey = new OCompositeKey();<NEW_LINE>for (int i = 0; i < keys.size(); i++) {<NEW_LINE>final Object key = keys.get(i);<NEW_LINE>final OType type = types[i];<NEW_LINE>if (key != null) {<NEW_LINE>if (type == OType.DATE) {<NEW_LINE>final Calendar calendar = Calendar.getInstance();<NEW_LINE>calendar.setTime((Date) key);<NEW_LINE>calendar.set(Calendar.HOUR_OF_DAY, 0);<NEW_LINE>calendar.set(Calendar.MINUTE, 0);<NEW_LINE>calendar.set(Calendar.SECOND, 0);<NEW_LINE>calendar.set(Calendar.MILLISECOND, 0);<NEW_LINE>compositeKey.<MASK><NEW_LINE>} else if (type == OType.LINK) {<NEW_LINE>compositeKey.addKey(((OIdentifiable) key).getIdentity());<NEW_LINE>} else {<NEW_LINE>compositeKey.addKey(key);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>compositeKey.addKey(null);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return compositeKey;<NEW_LINE>}
addKey(calendar.getTime());
661,784
public ListSnapshotsResult unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>ListSnapshotsResult listSnapshotsResult = new ListSnapshotsResult();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return listSnapshotsResult;<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("NextToken", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>listSnapshotsResult.setNextToken(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("Snapshots", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>listSnapshotsResult.setSnapshots(new ListUnmarshaller<SnapshotSummary>(SnapshotSummaryJsonUnmarshaller.getInstance(<MASK><NEW_LINE>}<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return listSnapshotsResult;<NEW_LINE>}
)).unmarshall(context));
1,160,309
public void convertToJson(BpmnJsonConverterContext converterContext, BaseElement baseElement, ActivityProcessor processor, BpmnModel model, FlowElementsContainer container, ArrayNode shapesArrayNode, double subProcessX, double subProcessY) {<NEW_LINE>MessageFlow messageFlow = (MessageFlow) baseElement;<NEW_LINE>ObjectNode flowNode = BpmnJsonConverterUtil.createChildShape(messageFlow.getId(), STENCIL_MESSAGE_FLOW, 172, 212, 128, 212);<NEW_LINE>ArrayNode dockersArrayNode = objectMapper.createArrayNode();<NEW_LINE>ObjectNode dockNode = objectMapper.createObjectNode();<NEW_LINE>dockNode.put(EDITOR_BOUNDS_X, model.getGraphicInfo(messageFlow.getSourceRef()).getWidth() / 2.0);<NEW_LINE>dockNode.put(EDITOR_BOUNDS_Y, model.getGraphicInfo(messageFlow.getSourceRef()).getHeight() / 2.0);<NEW_LINE>dockersArrayNode.add(dockNode);<NEW_LINE>if (model.getFlowLocationGraphicInfo(messageFlow.getId()).size() > 2) {<NEW_LINE>for (int i = 1; i < model.getFlowLocationGraphicInfo(messageFlow.getId()).size() - 1; i++) {<NEW_LINE>GraphicInfo graphicInfo = model.getFlowLocationGraphicInfo(messageFlow.getId()).get(i);<NEW_LINE>dockNode = objectMapper.createObjectNode();<NEW_LINE>dockNode.put(EDITOR_BOUNDS_X, graphicInfo.getX());<NEW_LINE>dockNode.put(<MASK><NEW_LINE>dockersArrayNode.add(dockNode);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>dockNode = objectMapper.createObjectNode();<NEW_LINE>dockNode.put(EDITOR_BOUNDS_X, model.getGraphicInfo(messageFlow.getTargetRef()).getWidth() / 2.0);<NEW_LINE>dockNode.put(EDITOR_BOUNDS_Y, model.getGraphicInfo(messageFlow.getTargetRef()).getHeight() / 2.0);<NEW_LINE>dockersArrayNode.add(dockNode);<NEW_LINE>flowNode.set("dockers", dockersArrayNode);<NEW_LINE>ArrayNode outgoingArrayNode = objectMapper.createArrayNode();<NEW_LINE>outgoingArrayNode.add(BpmnJsonConverterUtil.createResourceNode(messageFlow.getTargetRef()));<NEW_LINE>flowNode.set("outgoing", outgoingArrayNode);<NEW_LINE>flowNode.set("target", BpmnJsonConverterUtil.createResourceNode(messageFlow.getTargetRef()));<NEW_LINE>ObjectNode propertiesNode = objectMapper.createObjectNode();<NEW_LINE>propertiesNode.put(PROPERTY_OVERRIDE_ID, messageFlow.getId());<NEW_LINE>if (StringUtils.isNotEmpty(messageFlow.getName())) {<NEW_LINE>propertiesNode.put(PROPERTY_NAME, messageFlow.getName());<NEW_LINE>}<NEW_LINE>flowNode.set(EDITOR_SHAPE_PROPERTIES, propertiesNode);<NEW_LINE>shapesArrayNode.add(flowNode);<NEW_LINE>}
EDITOR_BOUNDS_Y, graphicInfo.getY());
444,716
public void run(RegressionEnvironment env) {<NEW_LINE>String name = "MyContextStartS0EndS1";<NEW_LINE>RegressionPath path = new RegressionPath();<NEW_LINE>String contextEPL = "@name('ctx') @public create context MyContextStartS0EndS1 start SupportBean_S0 as s0 end SupportBean_S1";<NEW_LINE>env.compileDeploy(contextEPL, path);<NEW_LINE>String depIdCtx = env.deploymentId("ctx");<NEW_LINE>SupportContextListener listener = new SupportContextListener(env);<NEW_LINE>env.runtime().getContextPartitionService().addContextPartitionStateListener(depIdCtx, "MyContextStartS0EndS1", listener);<NEW_LINE>env.compileDeploy("@name('a') context MyContextStartS0EndS1 select count(*) from SupportBean", path);<NEW_LINE>String depIdA = env.deploymentId("a");<NEW_LINE>env.compileDeploy("@name('b') context MyContextStartS0EndS1 select count(*) from SupportBean_S0", path);<NEW_LINE>String depIdB = env.deploymentId("b");<NEW_LINE>listener.assertAndReset(SupportContextListenUtil.eventContextWStmt(depIdCtx, name, ContextStateEventContextStatementAdded.class, depIdA, "a"), SupportContextListenUtil.eventContext(depIdCtx, name, ContextStateEventContextActivated.class), SupportContextListenUtil.eventContextWStmt(depIdCtx, name, ContextStateEventContextStatementAdded.class, depIdB, "b"));<NEW_LINE>env.<MASK><NEW_LINE>listener.assertAndReset(SupportContextListenUtil.eventPartitionInitTerm(depIdCtx, name, ContextStateEventContextPartitionAllocated.class));<NEW_LINE>env.undeployAll();<NEW_LINE>}
sendEventBean(new SupportBean_S0(1));
69,852
private Mono<Response<Void>> deleteWithResponseAsync(String resourceGroupName, String serviceTopologyName) {<NEW_LINE>if (this.client.getEndpoint() == null) {<NEW_LINE>return Mono.<MASK><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>if (serviceTopologyName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter serviceTopologyName is required and cannot be null."));<NEW_LINE>}<NEW_LINE>final String accept = "application/json";<NEW_LINE>return FluxUtil.withContext(context -> service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, serviceTopologyName, this.client.getApiVersion(), accept, context)).contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));<NEW_LINE>}
error(new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
1,166,830
private String processCompiledCode(DefDescriptor<ModuleDef> descriptor, String code, CodeType codeType, Location location) throws InvalidDefinitionException {<NEW_LINE>StringBuilder processedCode = new StringBuilder();<NEW_LINE>if (codeType == CodeType.COMPAT || codeType == CodeType.PROD_COMPAT) {<NEW_LINE>String amdString = "define(";<NEW_LINE>int amdIndex = code.indexOf(amdString);<NEW_LINE>String polyfills = code.substring(0, amdIndex);<NEW_LINE>String module = code.substring(amdIndex + amdString.length());<NEW_LINE>processedCode.append("function() { ").append(polyfills).append("$A.componentService.addModule('").append(descriptor.getQualifiedName()).append("', ").append<MASK><NEW_LINE>} else {<NEW_LINE>if (!code.substring(0, 7).equals("define(")) {<NEW_LINE>throw new InvalidDefinitionException("Compiled code does not start with AMD 'define'", location);<NEW_LINE>}<NEW_LINE>processedCode.append("function() { $A.componentService.addModule('").append(descriptor.getQualifiedName()).append("', ").append(code.substring(7)).append("}");<NEW_LINE>}<NEW_LINE>return processedCode.toString();<NEW_LINE>}
(module).append("}");
1,821,445
private void loadNode44() {<NEW_LINE>DataTypeEncodingTypeNode node = new DataTypeEncodingTypeNode(this.context, Identifiers.AddReferencesItem_Encoding_DefaultBinary, new QualifiedName(0, "Default Binary"), new LocalizedText("en", "Default Binary"), LocalizedText.NULL_VALUE, UInteger.valueOf(0), UInteger.valueOf(0)<MASK><NEW_LINE>node.addReference(new Reference(Identifiers.AddReferencesItem_Encoding_DefaultBinary, Identifiers.HasEncoding, Identifiers.AddReferencesItem.expanded(), false));<NEW_LINE>node.addReference(new Reference(Identifiers.AddReferencesItem_Encoding_DefaultBinary, Identifiers.HasDescription, Identifiers.OpcUa_BinarySchema_AddReferencesItem.expanded(), true));<NEW_LINE>node.addReference(new Reference(Identifiers.AddReferencesItem_Encoding_DefaultBinary, Identifiers.HasTypeDefinition, Identifiers.DataTypeEncodingType.expanded(), true));<NEW_LINE>this.nodeManager.addNode(node);<NEW_LINE>}
, UByte.valueOf(0));
547,476
private void processLocalProperty(PropertyTokenHolder tokens, PropertyValue pv) {<NEW_LINE>PropertyHandler ph = getLocalPropertyHandler(tokens.actualName);<NEW_LINE>if (ph == null || !ph.isWritable()) {<NEW_LINE>if (pv.isOptional()) {<NEW_LINE>if (logger.isDebugEnabled()) {<NEW_LINE>logger.debug("Ignoring optional value for property '" + tokens.actualName + "' - property not found on bean class [" + getRootClass().getName() + "]");<NEW_LINE>}<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (this.suppressNotWritablePropertyException) {<NEW_LINE>// Optimization for common ignoreUnknown=true scenario since the<NEW_LINE>// exception would be caught and swallowed higher up anyway...<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>throw createNotWritablePropertyException(tokens.canonicalName);<NEW_LINE>}<NEW_LINE>Object oldValue = null;<NEW_LINE>try {<NEW_LINE>Object originalValue = pv.getValue();<NEW_LINE>Object valueToApply = originalValue;<NEW_LINE>if (!Boolean.FALSE.equals(pv.conversionNecessary)) {<NEW_LINE>if (pv.isConverted()) {<NEW_LINE>valueToApply = pv.getConvertedValue();<NEW_LINE>} else {<NEW_LINE>if (isExtractOldValueForEditor() && ph.isReadable()) {<NEW_LINE>try {<NEW_LINE>oldValue = ph.getValue();<NEW_LINE>} catch (Exception ex) {<NEW_LINE>if (ex instanceof PrivilegedActionException) {<NEW_LINE>ex = ((PrivilegedActionException) ex).getException();<NEW_LINE>}<NEW_LINE>if (logger.isDebugEnabled()) {<NEW_LINE>logger.debug("Could not read previous value of property '" + this.nestedPath + <MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>valueToApply = convertForProperty(tokens.canonicalName, oldValue, originalValue, ph.toTypeDescriptor());<NEW_LINE>}<NEW_LINE>pv.getOriginalPropertyValue().conversionNecessary = (valueToApply != originalValue);<NEW_LINE>}<NEW_LINE>ph.setValue(valueToApply);<NEW_LINE>} catch (TypeMismatchException ex) {<NEW_LINE>throw ex;<NEW_LINE>} catch (InvocationTargetException ex) {<NEW_LINE>PropertyChangeEvent propertyChangeEvent = new PropertyChangeEvent(getRootInstance(), this.nestedPath + tokens.canonicalName, oldValue, pv.getValue());<NEW_LINE>if (ex.getTargetException() instanceof ClassCastException) {<NEW_LINE>throw new TypeMismatchException(propertyChangeEvent, ph.getPropertyType(), ex.getTargetException());<NEW_LINE>} else {<NEW_LINE>Throwable cause = ex.getTargetException();<NEW_LINE>if (cause instanceof UndeclaredThrowableException) {<NEW_LINE>// May happen e.g. with Groovy-generated methods<NEW_LINE>cause = cause.getCause();<NEW_LINE>}<NEW_LINE>throw new MethodInvocationException(propertyChangeEvent, cause);<NEW_LINE>}<NEW_LINE>} catch (Exception ex) {<NEW_LINE>PropertyChangeEvent pce = new PropertyChangeEvent(getRootInstance(), this.nestedPath + tokens.canonicalName, oldValue, pv.getValue());<NEW_LINE>throw new MethodInvocationException(pce, ex);<NEW_LINE>}<NEW_LINE>}
tokens.canonicalName + "'", ex);
1,278,264
public PurchaseOrder mergePurchaseOrders(List<PurchaseOrder> purchaseOrderList, Currency currency, Partner supplierPartner, Company company, StockLocation stockLocation, Partner contactPartner, PriceList priceList, TradingName tradingName) throws AxelorException {<NEW_LINE>String numSeq = "";<NEW_LINE>String externalRef = "";<NEW_LINE>for (PurchaseOrder purchaseOrderLocal : purchaseOrderList) {<NEW_LINE>if (!numSeq.isEmpty()) {<NEW_LINE>numSeq += "-";<NEW_LINE>}<NEW_LINE>numSeq += purchaseOrderLocal.getPurchaseOrderSeq();<NEW_LINE>if (!externalRef.isEmpty()) {<NEW_LINE>externalRef += "|";<NEW_LINE>}<NEW_LINE>if (purchaseOrderLocal.getExternalReference() != null) {<NEW_LINE>externalRef += purchaseOrderLocal.getExternalReference();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>PurchaseOrder purchaseOrderMerged = this.createPurchaseOrder(AuthUtils.getUser(), company, contactPartner, currency, null, numSeq, externalRef, stockLocation, appBaseService.getTodayDate(company<MASK><NEW_LINE>super.attachToNewPurchaseOrder(purchaseOrderList, purchaseOrderMerged);<NEW_LINE>this.computePurchaseOrder(purchaseOrderMerged);<NEW_LINE>purchaseOrderRepo.save(purchaseOrderMerged);<NEW_LINE>super.removeOldPurchaseOrders(purchaseOrderList);<NEW_LINE>return purchaseOrderMerged;<NEW_LINE>}
), priceList, supplierPartner, tradingName);
519,418
private void initializeViews() {<NEW_LINE>setContentView(R.layout.activity_pc_view);<NEW_LINE>UiHelper.notifyNewRootView(this);<NEW_LINE>// Set default preferences if we've never been run<NEW_LINE>PreferenceManager.setDefaultValues(this, R.xml.preferences, false);<NEW_LINE>// Set the correct layout for the PC grid<NEW_LINE>pcGridAdapter.updateLayoutWithPreferences(this, PreferenceConfiguration.readPreferences(this));<NEW_LINE>// Setup the list view<NEW_LINE>ImageButton settingsButton = findViewById(R.id.settingsButton);<NEW_LINE>ImageButton addComputerButton = findViewById(R.id.manuallyAddPc);<NEW_LINE>ImageButton helpButton = <MASK><NEW_LINE>settingsButton.setOnClickListener(new OnClickListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onClick(View v) {<NEW_LINE>startActivity(new Intent(PcView.this, StreamSettings.class));<NEW_LINE>}<NEW_LINE>});<NEW_LINE>addComputerButton.setOnClickListener(new OnClickListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onClick(View v) {<NEW_LINE>Intent i = new Intent(PcView.this, AddComputerManually.class);<NEW_LINE>startActivity(i);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>helpButton.setOnClickListener(new OnClickListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onClick(View v) {<NEW_LINE>HelpLauncher.launchSetupGuide(PcView.this);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>// Amazon review didn't like the help button because the wiki was not entirely<NEW_LINE>// navigable via the Fire TV remote (though the relevant parts were). Let's hide<NEW_LINE>// it on Fire TV.<NEW_LINE>if (getPackageManager().hasSystemFeature("amazon.hardware.fire_tv")) {<NEW_LINE>helpButton.setVisibility(View.GONE);<NEW_LINE>}<NEW_LINE>getFragmentManager().beginTransaction().replace(R.id.pcFragmentContainer, new AdapterFragment()).commitAllowingStateLoss();<NEW_LINE>noPcFoundLayout = findViewById(R.id.no_pc_found_layout);<NEW_LINE>if (pcGridAdapter.getCount() == 0) {<NEW_LINE>noPcFoundLayout.setVisibility(View.VISIBLE);<NEW_LINE>} else {<NEW_LINE>noPcFoundLayout.setVisibility(View.INVISIBLE);<NEW_LINE>}<NEW_LINE>pcGridAdapter.notifyDataSetChanged();<NEW_LINE>}
findViewById(R.id.helpButton);
1,468,654
public void addRuleInstances(Digester digester) {<NEW_LINE>digester.addObjectCreate(PATTERN_ROOT, JRSimpleTemplate.class);<NEW_LINE>digester.addCallMethod(PATTERN_INCLUDED_TEMPLATE, "addIncludedTemplate", 0);<NEW_LINE>digester.addFactoryCreate(PATTERN_STYLE, JRTemplateStyleFactory.class);<NEW_LINE>digester.addSetNext(PATTERN_STYLE, "addStyle", JRStyle.class.getName());<NEW_LINE>digester.addFactoryCreate(PATTERN_STYLE_PEN, JRPenFactory.Style.class.getName());<NEW_LINE>digester.addFactoryCreate(PATTERN_BOX, JRBoxFactory.class.getName());<NEW_LINE>digester.addFactoryCreate(PATTERN_BOX_PEN, JRPenFactory.Box.class.getName());<NEW_LINE>digester.addFactoryCreate(PATTERN_BOX_TOP_PEN, JRPenFactory.Top.class.getName());<NEW_LINE>digester.addFactoryCreate(PATTERN_BOX_LEFT_PEN, JRPenFactory.<MASK><NEW_LINE>digester.addFactoryCreate(PATTERN_BOX_BOTTOM_PEN, JRPenFactory.Bottom.class.getName());<NEW_LINE>digester.addFactoryCreate(PATTERN_BOX_RIGHT_PEN, JRPenFactory.Right.class.getName());<NEW_LINE>digester.addFactoryCreate(PATTERN_PARAGRAPH, JRParagraphFactory.class.getName());<NEW_LINE>digester.addFactoryCreate(PATTERN_TAB_STOP, TabStopFactory.class.getName());<NEW_LINE>digester.addSetNext(PATTERN_TAB_STOP, "addTabStop", TabStop.class.getName());<NEW_LINE>}
Left.class.getName());
418,413
public Unit call() throws IOException, StreamNotFoundException, ShellNotRunningException, IllegalArgumentException {<NEW_LINE>OutputStream outputStream;<NEW_LINE>File destFile = null;<NEW_LINE>switch(fileAbstraction.scheme) {<NEW_LINE>case CONTENT:<NEW_LINE>Objects.requireNonNull(fileAbstraction.uri);<NEW_LINE>if (fileAbstraction.uri.getAuthority().equals(context.get().getPackageName())) {<NEW_LINE>DocumentFile documentFile = DocumentFile.fromSingleUri(AppConfig.getInstance(), fileAbstraction.uri);<NEW_LINE>if (documentFile != null && documentFile.exists() && documentFile.canWrite()) {<NEW_LINE>outputStream = contentResolver.openOutputStream(fileAbstraction.uri);<NEW_LINE>} else {<NEW_LINE>destFile = FileUtils.fromContentUri(fileAbstraction.uri);<NEW_LINE>outputStream = openFile(destFile, context.get());<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>outputStream = contentResolver.openOutputStream(fileAbstraction.uri);<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>case FILE:<NEW_LINE>final HybridFileParcelable hybridFileParcelable = fileAbstraction.hybridFileParcelable;<NEW_LINE>Objects.requireNonNull(hybridFileParcelable);<NEW_LINE>Context context = this.context.get();<NEW_LINE>if (context == null) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>outputStream = openFile(hybridFileParcelable.getFile(), context);<NEW_LINE>destFile = fileAbstraction.hybridFileParcelable.getFile();<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>throw new IllegalArgumentException("The scheme for '" + fileAbstraction.scheme + "' cannot be processed!");<NEW_LINE>}<NEW_LINE>Objects.requireNonNull(outputStream);<NEW_LINE>outputStream.<MASK><NEW_LINE>outputStream.close();<NEW_LINE>if (cachedFile != null && cachedFile.exists() && destFile != null) {<NEW_LINE>// cat cache content to original file and delete cache file<NEW_LINE>ConcatenateFileCommand.INSTANCE.concatenateFile(cachedFile.getPath(), destFile.getPath());<NEW_LINE>cachedFile.delete();<NEW_LINE>}<NEW_LINE>return Unit.INSTANCE;<NEW_LINE>}
write(dataToSave.getBytes());
778,759
public void cancelRequest(DnsMessage msg, boolean isTimeout) {<NEW_LINE>if (c_logger.isTraceEntryExitEnabled())<NEW_LINE>c_logger.traceEntry(this, "SipResolver: cancelRequest: entry id=" + hashCode());<NEW_LINE>RequestPending request;<NEW_LINE>synchronized (_requestPending) {<NEW_LINE>if (c_logger.isTraceDebugEnabled()) {<NEW_LINE>c_logger.traceDebug("SipResolver: cancelRequest: remove from _requestPending: " + new Integer(msg.getId()));<NEW_LINE>}<NEW_LINE>request = _requestPending.remove(new Integer(msg.getId()));<NEW_LINE>}<NEW_LINE>if (isTimeout && request != null) {<NEW_LINE>long endTime = 0;<NEW_LINE>if (usePreciseSystemTimer) {<NEW_LINE>// Convert nanoseconds to milliseconds<NEW_LINE>endTime = System.nanoTime() / 1000000L;<NEW_LINE>} else {<NEW_LINE>endTime = System.currentTimeMillis();<NEW_LINE>}<NEW_LINE>long startTime = request.getStartTime();<NEW_LINE>if ((endTime - startTime) > _dnsRequestTimeout) {<NEW_LINE>if (c_logger.isTraceDebugEnabled()) {<NEW_LINE>c_logger.traceDebug("SipResolver: responseReceived: DNS responded after : " + (endTime - startTime) + " millisec");<NEW_LINE>}<NEW_LINE>int total = _eventsCounter.reportEvent();<NEW_LINE>if (total > _allowed_failures && _enableSecondaryDNS) {<NEW_LINE>if (c_logger.isInfoEnabled()) {<NEW_LINE>c_logger.info("SipResolver: switching to secondary DNS");<NEW_LINE>}<NEW_LINE>_eventsCounter.reset();<NEW_LINE>_udpTransport.destroyFromTimeout(new SipURILookupException("No Response from DNS Server"));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (c_logger.isTraceEntryExitEnabled())<NEW_LINE><MASK><NEW_LINE>}
c_logger.traceExit(this, "SipResolver: cancelRequest: exit");
465,414
private static void addContentsOfFolderToManifest(String folderPath, String pathPrefix, ArrayList<String> manifest) {<NEW_LINE>File folder = new File(folderPath);<NEW_LINE>File[] folderFiles = folder.listFiles();<NEW_LINE>for (File file : folderFiles) {<NEW_LINE>String fileName = file.getName();<NEW_LINE><MASK><NEW_LINE>String relativePath = (pathPrefix.isEmpty() ? "" : (pathPrefix + "/")) + fileName;<NEW_LINE>if (CodePushUpdateUtils.isHashIgnored(relativePath)) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (file.isDirectory()) {<NEW_LINE>addContentsOfFolderToManifest(fullFilePath, relativePath, manifest);<NEW_LINE>} else {<NEW_LINE>try {<NEW_LINE>manifest.add(relativePath + ":" + computeHash(new FileInputStream(file)));<NEW_LINE>} catch (FileNotFoundException e) {<NEW_LINE>// Should not happen.<NEW_LINE>throw new CodePushUnknownException("Unable to compute hash of update contents.", e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
String fullFilePath = file.getAbsolutePath();
1,508,591
private boolean isCurrentUserAdminJ() {<NEW_LINE>boolean adm = false;<NEW_LINE>try {<NEW_LINE>try {<NEW_LINE>setEnvironmentVariable("LANG", "C", EnvironmentScope.PROCESS, false);<NEW_LINE>setEnvironmentVariable("LC_COLLATE", "C", EnvironmentScope.PROCESS, false);<NEW_LINE>setEnvironmentVariable("LC_CTYPE", "C", EnvironmentScope.PROCESS, false);<NEW_LINE>setEnvironmentVariable("LC_MESSAGES", "C", EnvironmentScope.PROCESS, false);<NEW_LINE>setEnvironmentVariable("LC_MONETARY", "C", EnvironmentScope.PROCESS, false);<NEW_LINE>setEnvironmentVariable("LC_NUMERIC", "C", EnvironmentScope.PROCESS, false);<NEW_LINE>setEnvironmentVariable("LC_TIME", "C", EnvironmentScope.PROCESS, false);<NEW_LINE>} catch (NativeException e) {<NEW_LINE>LogManager.log(e);<NEW_LINE>}<NEW_LINE>String stdout = SystemUtils.executeCommand("id").getStdOut();<NEW_LINE>Matcher matcher = Pattern.compile("euid=([0-9]+)\\(").matcher(stdout);<NEW_LINE>if (!matcher.find()) {<NEW_LINE>matcher = Pattern.compile<MASK><NEW_LINE>}<NEW_LINE>if (matcher.find()) {<NEW_LINE>adm = Integer.parseInt(matcher.group(1)) == 0;<NEW_LINE>}<NEW_LINE>} catch (IOException | NumberFormatException e) {<NEW_LINE>LogManager.log(e);<NEW_LINE>}<NEW_LINE>return adm;<NEW_LINE>}
("uid=([0-9]+)\\(").matcher(stdout);
1,431,596
public static ListAggregateConfigRulesResponse unmarshall(ListAggregateConfigRulesResponse listAggregateConfigRulesResponse, UnmarshallerContext _ctx) {<NEW_LINE>listAggregateConfigRulesResponse.setRequestId(_ctx.stringValue("ListAggregateConfigRulesResponse.RequestId"));<NEW_LINE>ConfigRules configRules = new ConfigRules();<NEW_LINE>configRules.setPageSize(_ctx.integerValue("ListAggregateConfigRulesResponse.ConfigRules.PageSize"));<NEW_LINE>configRules.setPageNumber(_ctx.integerValue("ListAggregateConfigRulesResponse.ConfigRules.PageNumber"));<NEW_LINE>configRules.setTotalCount(_ctx.longValue("ListAggregateConfigRulesResponse.ConfigRules.TotalCount"));<NEW_LINE>List<ConfigRule> configRuleList = new ArrayList<ConfigRule>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("ListAggregateConfigRulesResponse.ConfigRules.ConfigRuleList.Length"); i++) {<NEW_LINE>ConfigRule configRule = new ConfigRule();<NEW_LINE>configRule.setRiskLevel(_ctx.integerValue("ListAggregateConfigRulesResponse.ConfigRules.ConfigRuleList[" + i + "].RiskLevel"));<NEW_LINE>configRule.setSourceOwner(_ctx.stringValue("ListAggregateConfigRulesResponse.ConfigRules.ConfigRuleList[" + i + "].SourceOwner"));<NEW_LINE>configRule.setAccountId(_ctx.longValue("ListAggregateConfigRulesResponse.ConfigRules.ConfigRuleList[" + i + "].AccountId"));<NEW_LINE>configRule.setConfigRuleState(_ctx.stringValue("ListAggregateConfigRulesResponse.ConfigRules.ConfigRuleList[" + i + "].ConfigRuleState"));<NEW_LINE>configRule.setSourceIdentifier(_ctx.stringValue("ListAggregateConfigRulesResponse.ConfigRules.ConfigRuleList[" + i + "].SourceIdentifier"));<NEW_LINE>configRule.setConfigRuleArn(_ctx.stringValue("ListAggregateConfigRulesResponse.ConfigRules.ConfigRuleList[" + i + "].ConfigRuleArn"));<NEW_LINE>configRule.setDescription(_ctx.stringValue("ListAggregateConfigRulesResponse.ConfigRules.ConfigRuleList[" + i + "].Description"));<NEW_LINE>configRule.setAutomationType(_ctx.stringValue("ListAggregateConfigRulesResponse.ConfigRules.ConfigRuleList[" + i + "].AutomationType"));<NEW_LINE>configRule.setConfigRuleName(_ctx.stringValue("ListAggregateConfigRulesResponse.ConfigRules.ConfigRuleList[" + i + "].ConfigRuleName"));<NEW_LINE>configRule.setConfigRuleId(_ctx.stringValue("ListAggregateConfigRulesResponse.ConfigRules.ConfigRuleList[" + i + "].ConfigRuleId"));<NEW_LINE>Compliance compliance = new Compliance();<NEW_LINE>compliance.setComplianceType(_ctx.stringValue("ListAggregateConfigRulesResponse.ConfigRules.ConfigRuleList[" + i + "].Compliance.ComplianceType"));<NEW_LINE>compliance.setCount(_ctx.integerValue("ListAggregateConfigRulesResponse.ConfigRules.ConfigRuleList[" + i + "].Compliance.Count"));<NEW_LINE>configRule.setCompliance(compliance);<NEW_LINE>CreateBy createBy = new CreateBy();<NEW_LINE>createBy.setCompliancePackId(_ctx.stringValue("ListAggregateConfigRulesResponse.ConfigRules.ConfigRuleList[" + i + "].CreateBy.CompliancePackId"));<NEW_LINE>createBy.setAggregatorName(_ctx.stringValue<MASK><NEW_LINE>createBy.setCompliancePackName(_ctx.stringValue("ListAggregateConfigRulesResponse.ConfigRules.ConfigRuleList[" + i + "].CreateBy.CompliancePackName"));<NEW_LINE>createBy.setCreatorName(_ctx.stringValue("ListAggregateConfigRulesResponse.ConfigRules.ConfigRuleList[" + i + "].CreateBy.CreatorName"));<NEW_LINE>createBy.setCreatorType(_ctx.stringValue("ListAggregateConfigRulesResponse.ConfigRules.ConfigRuleList[" + i + "].CreateBy.CreatorType"));<NEW_LINE>createBy.setCreatorId(_ctx.stringValue("ListAggregateConfigRulesResponse.ConfigRules.ConfigRuleList[" + i + "].CreateBy.CreatorId"));<NEW_LINE>createBy.setAggregatorId(_ctx.stringValue("ListAggregateConfigRulesResponse.ConfigRules.ConfigRuleList[" + i + "].CreateBy.AggregatorId"));<NEW_LINE>configRule.setCreateBy(createBy);<NEW_LINE>configRuleList.add(configRule);<NEW_LINE>}<NEW_LINE>configRules.setConfigRuleList(configRuleList);<NEW_LINE>listAggregateConfigRulesResponse.setConfigRules(configRules);<NEW_LINE>return listAggregateConfigRulesResponse;<NEW_LINE>}
("ListAggregateConfigRulesResponse.ConfigRules.ConfigRuleList[" + i + "].CreateBy.AggregatorName"));
188,550
TypeBinding substituteInferenceVariable(InferenceVariable var, TypeBinding substituteType) {<NEW_LINE>if (this.inRecursiveFunction)<NEW_LINE>return this;<NEW_LINE>this.inRecursiveFunction = true;<NEW_LINE>try {<NEW_LINE>boolean haveSubstitution = false;<NEW_LINE>ReferenceBinding currentSuperclass = this.superclass;<NEW_LINE>if (currentSuperclass != null) {<NEW_LINE>currentSuperclass = (ReferenceBinding) currentSuperclass.substituteInferenceVariable(var, substituteType);<NEW_LINE>haveSubstitution |= TypeBinding.notEquals(currentSuperclass, this.superclass);<NEW_LINE>}<NEW_LINE>ReferenceBinding[] currentSuperInterfaces = null;<NEW_LINE>if (this.superInterfaces != null) {<NEW_LINE><MASK><NEW_LINE>if (haveSubstitution)<NEW_LINE>System.arraycopy(this.superInterfaces, 0, currentSuperInterfaces = new ReferenceBinding[length], 0, length);<NEW_LINE>for (int i = 0; i < length; i++) {<NEW_LINE>ReferenceBinding currentSuperInterface = this.superInterfaces[i];<NEW_LINE>if (currentSuperInterface != null) {<NEW_LINE>currentSuperInterface = (ReferenceBinding) currentSuperInterface.substituteInferenceVariable(var, substituteType);<NEW_LINE>if (TypeBinding.notEquals(currentSuperInterface, this.superInterfaces[i])) {<NEW_LINE>if (currentSuperInterfaces == null)<NEW_LINE>System.arraycopy(this.superInterfaces, 0, currentSuperInterfaces = new ReferenceBinding[length], 0, length);<NEW_LINE>currentSuperInterfaces[i] = currentSuperInterface;<NEW_LINE>haveSubstitution = true;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (haveSubstitution) {<NEW_LINE>TypeVariableBinding newVar = new TypeVariableBinding(this.sourceName, this.declaringElement, this.rank, this.environment);<NEW_LINE>newVar.superclass = currentSuperclass;<NEW_LINE>newVar.superInterfaces = currentSuperInterfaces;<NEW_LINE>newVar.tagBits = this.tagBits;<NEW_LINE>return newVar;<NEW_LINE>}<NEW_LINE>return this;<NEW_LINE>} finally {<NEW_LINE>this.inRecursiveFunction = false;<NEW_LINE>}<NEW_LINE>}
int length = this.superInterfaces.length;
405,329
protected void initialize(ThrowAnalysis throwAnalysis, boolean omitExceptingUnitEdges) {<NEW_LINE>int size = unitChain.size();<NEW_LINE>if (Options.v().time()) {<NEW_LINE>Timers.v().graphTimer.start();<NEW_LINE>}<NEW_LINE>unitToUnexceptionalSuccs = new LinkedHashMap<Unit, List<Unit>>(size * 2 + 1, 0.7f);<NEW_LINE>unitToUnexceptionalPreds = new LinkedHashMap<Unit, List<Unit>>(<MASK><NEW_LINE>buildUnexceptionalEdges(unitToUnexceptionalSuccs, unitToUnexceptionalPreds);<NEW_LINE>this.throwAnalysis = throwAnalysis;<NEW_LINE>Set<Unit> trapUnitsThatAreHeads;<NEW_LINE>if (body.getTraps().isEmpty()) {<NEW_LINE>// No handlers, so all exceptional control flow exits the method.<NEW_LINE>unitToExceptionDests = Collections.emptyMap();<NEW_LINE>unitToExceptionalSuccs = Collections.emptyMap();<NEW_LINE>unitToExceptionalPreds = Collections.emptyMap();<NEW_LINE>trapUnitsThatAreHeads = Collections.emptySet();<NEW_LINE>unitToSuccs = unitToUnexceptionalSuccs;<NEW_LINE>unitToPreds = unitToUnexceptionalPreds;<NEW_LINE>} else {<NEW_LINE>unitToExceptionDests = buildExceptionDests(throwAnalysis);<NEW_LINE>unitToExceptionalSuccs = new LinkedHashMap<Unit, List<Unit>>(unitToExceptionDests.size() * 2 + 1, 0.7f);<NEW_LINE>unitToExceptionalPreds = new LinkedHashMap<Unit, List<Unit>>(body.getTraps().size() * 2 + 1, 0.7f);<NEW_LINE>trapUnitsThatAreHeads = buildExceptionalEdges(throwAnalysis, unitToExceptionDests, unitToExceptionalSuccs, unitToExceptionalPreds, omitExceptingUnitEdges);<NEW_LINE>// We'll need separate maps for the combined<NEW_LINE>// exceptional and unexceptional edges:<NEW_LINE>unitToSuccs = combineMapValues(unitToUnexceptionalSuccs, unitToExceptionalSuccs);<NEW_LINE>unitToPreds = combineMapValues(unitToUnexceptionalPreds, unitToExceptionalPreds);<NEW_LINE>}<NEW_LINE>buildHeadsAndTails(trapUnitsThatAreHeads);<NEW_LINE>if (Options.v().time()) {<NEW_LINE>Timers.v().graphTimer.end();<NEW_LINE>}<NEW_LINE>soot.util.PhaseDumper.v().dumpGraph(this);<NEW_LINE>}
size * 2 + 1, 0.7f);
402,608
public CompletableFuture<Void> updateCheckpoint(CompleteLease lease, Checkpoint checkpoint) {<NEW_LINE>AzureBlobLease updatedLease = new AzureBlobLease((AzureBlobLease) lease);<NEW_LINE>TRACE_LOGGER.debug(this.hostContext.withHostAndPartition(checkpoint.getPartitionId(), "Checkpointing at " + checkpoint.getOffset() + " // " <MASK><NEW_LINE>updatedLease.setOffset(checkpoint.getOffset());<NEW_LINE>updatedLease.setSequenceNumber(checkpoint.getSequenceNumber());<NEW_LINE>CompletableFuture<Void> future = null;<NEW_LINE>try {<NEW_LINE>if (updateLeaseInternal(updatedLease, this.checkpointOperationOptions)) {<NEW_LINE>future = CompletableFuture.completedFuture(null);<NEW_LINE>} else {<NEW_LINE>TRACE_LOGGER.warn(this.hostContext.withHostAndPartition(lease, "Lease lost"));<NEW_LINE>future = new CompletableFuture<Void>();<NEW_LINE>future.completeExceptionally(LoggingUtils.wrapException(new RuntimeException("Lease lost while updating checkpoint"), EventProcessorHostActionStrings.UPDATING_CHECKPOINT));<NEW_LINE>}<NEW_LINE>} catch (StorageException | IOException e) {<NEW_LINE>TRACE_LOGGER.warn(this.hostContext.withHostAndPartition(lease, "Failure updating checkpoint"), e);<NEW_LINE>future = new CompletableFuture<Void>();<NEW_LINE>future.completeExceptionally(LoggingUtils.wrapException(e, EventProcessorHostActionStrings.UPDATING_CHECKPOINT));<NEW_LINE>}<NEW_LINE>return future;<NEW_LINE>}
+ checkpoint.getSequenceNumber()));
889,586
public void updateConfig(String subject, CompatibilityLevel compatibility) throws MojoExecutionException {<NEW_LINE>try {<NEW_LINE>String updatedCompatibility;<NEW_LINE>if (subject.equalsIgnoreCase("null") || subject.equals("__GLOBAL")) {<NEW_LINE>updatedCompatibility = this.client().updateCompatibility(null, compatibility.toString());<NEW_LINE>getLog().info("Global Compatibility set to " + updatedCompatibility);<NEW_LINE>} else {<NEW_LINE>Collection<String> allSubjects = this.client().getAllSubjects();<NEW_LINE>if (!allSubjects.contains(subject)) {<NEW_LINE>throw new MojoExecutionException("Subject not found");<NEW_LINE>}<NEW_LINE>updatedCompatibility = this.client().updateCompatibility(<MASK><NEW_LINE>getLog().info("Compatibility of " + subject + " set to " + updatedCompatibility);<NEW_LINE>}<NEW_LINE>} catch (RestClientException | IOException e) {<NEW_LINE>e.printStackTrace();<NEW_LINE>throw new MojoExecutionException("Exception thrown while updating config", e);<NEW_LINE>}<NEW_LINE>}
subject, compatibility.toString());
1,548,998
protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws IOException, ServletException {<NEW_LINE>JsonObject input = InputParser.parseJsonObjectOrThrowError(req);<NEW_LINE>String email = InputParser.parseStringOrThrowError(input, "email", false);<NEW_LINE>String password = InputParser.parseStringOrThrowError(input, "password", false);<NEW_LINE>assert password != null;<NEW_LINE>assert email != null;<NEW_LINE>// logic according to https://github.com/supertokens/supertokens-core/issues/101<NEW_LINE>String <MASK><NEW_LINE>if (password.equals("")) {<NEW_LINE>throw new ServletException(new WebserverAPI.BadRequestException("Password cannot be an empty string"));<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>UserInfo user = EmailPassword.signUp(super.main, normalisedEmail, password);<NEW_LINE>JsonObject result = new JsonObject();<NEW_LINE>result.addProperty("status", "OK");<NEW_LINE>JsonObject userJson = new JsonParser().parse(new Gson().toJson(user)).getAsJsonObject();<NEW_LINE>if (super.getVersionFromRequest(req).equals("2.4")) {<NEW_LINE>userJson.remove("timeJoined");<NEW_LINE>}<NEW_LINE>result.add("user", userJson);<NEW_LINE>super.sendJsonResponse(200, result, resp);<NEW_LINE>} catch (DuplicateEmailException e) {<NEW_LINE>Logging.debug(main, Utils.exceptionStacktraceToString(e));<NEW_LINE>JsonObject result = new JsonObject();<NEW_LINE>result.addProperty("status", "EMAIL_ALREADY_EXISTS_ERROR");<NEW_LINE>super.sendJsonResponse(200, result, resp);<NEW_LINE>} catch (StorageQueryException e) {<NEW_LINE>throw new ServletException(e);<NEW_LINE>}<NEW_LINE>}
normalisedEmail = Utils.normaliseEmail(email);
419,248
private <K> K wrapHttpExecute(Class<K> returnType, CloseableHttpClient httpClient, HttpUriRequest httpUriRequest, Map<String, String> headers) throws IOException {<NEW_LINE>CloseableHttpResponse response;<NEW_LINE>String xid = RootContext.getXID();<NEW_LINE>if (xid != null) {<NEW_LINE>headers.put(RootContext.KEY_XID, xid);<NEW_LINE>}<NEW_LINE>if (!headers.isEmpty()) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>response = httpClient.execute(httpUriRequest);<NEW_LINE>int statusCode = response.getStatusLine().getStatusCode();<NEW_LINE>if (statusCode < HttpStatus.SC_OK || statusCode > HttpStatus.SC_MULTI_STATUS) {<NEW_LINE>throw new RuntimeException("Failed to invoke the http method " + httpUriRequest.getURI() + " in the service " + ". return status by: " + response.getStatusLine().getStatusCode());<NEW_LINE>}<NEW_LINE>return convertResult(response, returnType);<NEW_LINE>}
headers.forEach(httpUriRequest::addHeader);
1,324,139
protected void paintLoc(Graphics2D g2, String loc) {<NEW_LINE>Map map = getMapEnv().getMap();<NEW_LINE>Point2D pt = map.getPosition(loc);<NEW_LINE>if (pt != null) {<NEW_LINE>int x = x(pt);<NEW_LINE>int y = y(pt);<NEW_LINE>String info = "";<NEW_LINE>List<String> track = new ArrayList<>();<NEW_LINE>if (!env.getAgents().isEmpty())<NEW_LINE>// show details only for track of first agent...<NEW_LINE>track = getTrack(env.getAgents().get(0));<NEW_LINE>ArrayList<Integer> <MASK><NEW_LINE>for (int i = 0; i < track.size(); i++) if (track.get(i).equals(loc))<NEW_LINE>list.add(i + 1);<NEW_LINE>if (!list.isEmpty())<NEW_LINE>info = list.toString();<NEW_LINE>// if (getMapEnv().hasObjects(loc)) {<NEW_LINE>// g2.setColor(Color.green);<NEW_LINE>// g2.fillOval(x - 5, y - 5, 10, 10);<NEW_LINE>// }<NEW_LINE>if (scenario != null && scenario.getInitAgentLocation().equals(loc)) {<NEW_LINE>g2.setColor(Color.red);<NEW_LINE>g2.fillOval(x - 7, y - 7, 14, 14);<NEW_LINE>}<NEW_LINE>if (getAgentLocs().contains(loc)) {<NEW_LINE>g2.setColor(Color.red);<NEW_LINE>g2.fillOval(x - 4, y - 4, 8, 8);<NEW_LINE>}<NEW_LINE>// if (maModel.hasInfos(loc)) {<NEW_LINE>// g2.setColor(Color.blue);<NEW_LINE>// g2.drawString("i", x, y + 12);<NEW_LINE>// }<NEW_LINE>// if (model.isStart(loc))<NEW_LINE>// g2.setColor(Color.red);<NEW_LINE>// else<NEW_LINE>if (destinations != null && destinations.contains(loc))<NEW_LINE>g2.setColor(Color.green);<NEW_LINE>else if (track.contains(loc))<NEW_LINE>g2.setColor(Color.black);<NEW_LINE>else<NEW_LINE>g2.setColor(Color.gray);<NEW_LINE>g2.drawString(loc + info, x, y);<NEW_LINE>}<NEW_LINE>}
list = new ArrayList<>();
637,515
public void marshall(ChannelMessageCallback channelMessageCallback, AwsJsonWriter jsonWriter) throws Exception {<NEW_LINE>jsonWriter.beginObject();<NEW_LINE>if (channelMessageCallback.getMessageId() != null) {<NEW_LINE>String messageId = channelMessageCallback.getMessageId();<NEW_LINE>jsonWriter.name("MessageId");<NEW_LINE>jsonWriter.value(messageId);<NEW_LINE>}<NEW_LINE>if (channelMessageCallback.getContent() != null) {<NEW_LINE>String content = channelMessageCallback.getContent();<NEW_LINE>jsonWriter.name("Content");<NEW_LINE>jsonWriter.value(content);<NEW_LINE>}<NEW_LINE>if (channelMessageCallback.getMetadata() != null) {<NEW_LINE><MASK><NEW_LINE>jsonWriter.name("Metadata");<NEW_LINE>jsonWriter.value(metadata);<NEW_LINE>}<NEW_LINE>if (channelMessageCallback.getPushNotification() != null) {<NEW_LINE>PushNotificationConfiguration pushNotification = channelMessageCallback.getPushNotification();<NEW_LINE>jsonWriter.name("PushNotification");<NEW_LINE>PushNotificationConfigurationJsonMarshaller.getInstance().marshall(pushNotification, jsonWriter);<NEW_LINE>}<NEW_LINE>if (channelMessageCallback.getMessageAttributes() != null) {<NEW_LINE>java.util.Map<String, MessageAttributeValue> messageAttributes = channelMessageCallback.getMessageAttributes();<NEW_LINE>jsonWriter.name("MessageAttributes");<NEW_LINE>jsonWriter.beginObject();<NEW_LINE>for (java.util.Map.Entry<String, MessageAttributeValue> messageAttributesEntry : messageAttributes.entrySet()) {<NEW_LINE>MessageAttributeValue messageAttributesValue = messageAttributesEntry.getValue();<NEW_LINE>if (messageAttributesValue != null) {<NEW_LINE>jsonWriter.name(messageAttributesEntry.getKey());<NEW_LINE>MessageAttributeValueJsonMarshaller.getInstance().marshall(messageAttributesValue, jsonWriter);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>jsonWriter.endObject();<NEW_LINE>}<NEW_LINE>jsonWriter.endObject();<NEW_LINE>}
String metadata = channelMessageCallback.getMetadata();
512,208
// **********************************************************************<NEW_LINE>// Check for illegal re-assignment<NEW_LINE>// **********************************************************************<NEW_LINE>@Override<NEW_LINE>public Void visitUnary(UnaryTree tree, Void p) {<NEW_LINE>Tree.Kind treeKind = tree.getKind();<NEW_LINE>if (treeKind == Tree.Kind.PREFIX_DECREMENT || treeKind == Tree.Kind.PREFIX_INCREMENT || treeKind == Tree.Kind.POSTFIX_DECREMENT || treeKind == Tree.Kind.POSTFIX_INCREMENT) {<NEW_LINE>// Check the assignment that occurs at the increment/decrement. i.e.:<NEW_LINE>// exp = exp + 1 or exp = exp - 1<NEW_LINE>AnnotatedTypeMirror varType = atypeFactory.getAnnotatedTypeLhs(tree.getExpression());<NEW_LINE>AnnotatedTypeMirror valueType;<NEW_LINE>if (treeKind == Tree.Kind.POSTFIX_DECREMENT || treeKind == Tree.Kind.POSTFIX_INCREMENT) {<NEW_LINE>// For postfixed increments or decrements, the type of the tree the type of the expression<NEW_LINE>// before 1 is added or subtracted. So, use a special method to get the type after 1 has<NEW_LINE>// been added or subtracted.<NEW_LINE><MASK><NEW_LINE>} else {<NEW_LINE>// For prefixed increments or decrements, the type of the tree the type of the expression<NEW_LINE>// after 1 is added or subtracted. So, its type can be found using the usual method.<NEW_LINE>valueType = atypeFactory.getAnnotatedType(tree);<NEW_LINE>}<NEW_LINE>String errorKey = (treeKind == Tree.Kind.PREFIX_INCREMENT || treeKind == Tree.Kind.POSTFIX_INCREMENT) ? "unary.increment" : "unary.decrement";<NEW_LINE>commonAssignmentCheck(varType, valueType, tree, errorKey);<NEW_LINE>}<NEW_LINE>return super.visitUnary(tree, p);<NEW_LINE>}
valueType = atypeFactory.getAnnotatedTypeRhsUnaryAssign(tree);
1,661,806
public void paint(Graphics g) {<NEW_LINE>List target = (List) _target;<NEW_LINE>Dimension sz = target.getSize();<NEW_LINE>int w = sz.width;<NEW_LINE>int h = sz.height;<NEW_LINE>g.setColor(target.getBackground());<NEW_LINE>FakePeerUtils.drawLoweredBox(g, 0, 0, w, h);<NEW_LINE><MASK><NEW_LINE>if (n <= 0)<NEW_LINE>return;<NEW_LINE>if (target.isEnabled()) {<NEW_LINE>g.setColor(target.getForeground());<NEW_LINE>} else {<NEW_LINE>g.setColor(SystemColor.controlShadow);<NEW_LINE>}<NEW_LINE>g.setFont(target.getFont());<NEW_LINE>g.setClip(1, 1, w - 5, h - 4);<NEW_LINE>FontMetrics fm = g.getFontMetrics();<NEW_LINE>int th = fm.getHeight(), ty = th + 2;<NEW_LINE>for (int i = 0; i < n; i++) {<NEW_LINE>g.drawString(target.getItem(i), 4, ty);<NEW_LINE>if (ty > h)<NEW_LINE>break;<NEW_LINE>ty += th;<NEW_LINE>}<NEW_LINE>}
int n = target.getItemCount();
1,127,457
public static List<String> cutString(String s, ChatFormatting defaultColor, ChatFormatting highlightColor, int indent) {<NEW_LINE>// Apply markup<NEW_LINE>String markedUp = s.replaceAll("_([^_]+)_", highlightColor + "$1" + defaultColor);<NEW_LINE>// Split words<NEW_LINE>List<String> words = new LinkedList<>();<NEW_LINE>BreakIterator iterator = BreakIterator.getLineInstance(MinecraftForgeClient.getLocale());<NEW_LINE>iterator.setText(markedUp);<NEW_LINE>int start = iterator.first();<NEW_LINE>for (int end = iterator.next(); end != BreakIterator.DONE; start = end, end = iterator.next()) {<NEW_LINE>String word = markedUp.substring(start, end);<NEW_LINE>words.add(word);<NEW_LINE>}<NEW_LINE>Font font = Minecraft.getInstance().font;<NEW_LINE>List<String> lines = FontHelper.cutString(font, markedUp, maxWidthPerLine);<NEW_LINE>// Format<NEW_LINE>String lineStart = Strings.repeat(" ", indent);<NEW_LINE>List<String> formattedLines = new ArrayList<>(lines.size());<NEW_LINE><MASK><NEW_LINE>for (String line : lines) {<NEW_LINE>String formattedLine = format + lineStart + line;<NEW_LINE>formattedLines.add(formattedLine);<NEW_LINE>// format = TextFormatting.getFormatString(formattedLine);<NEW_LINE>}<NEW_LINE>return formattedLines;<NEW_LINE>}
String format = defaultColor.toString();
761,761
public void onRenderTooltip(RenderTooltipEvent.PostText event) {<NEW_LINE>ItemStack stack = event.getStack();<NEW_LINE>if (stack.getItem() instanceof IBulletContainer) {<NEW_LINE>NonNullList<ItemStack> bullets = ((IBulletContainer) stack.getItem()).getBullets(stack);<NEW_LINE>if (bullets != null) {<NEW_LINE>int bulletAmount = ((IBulletContainer) stack.getItem()).getBulletCount(stack);<NEW_LINE>List<String> linesString = event.getLines().stream().map(FormattedText::getString).collect(Collectors.toList());<NEW_LINE>int line = event.getLines().size() - Utils.findSequenceInList(linesString, BULLET_TOOLTIP, (a, b) -> b.endsWith(a));<NEW_LINE>int currentX = event.getX();<NEW_LINE>int currentY = line > 0 ? event.getY() + (event.getHeight() + 1 - line * 10) : event.getY() - 42;<NEW_LINE>PoseStack transform = new PoseStack();<NEW_LINE>transform.pushPose();<NEW_LINE>transform.translate(currentX, currentY, 700);<NEW_LINE>transform.<MASK><NEW_LINE>RevolverScreen.drawExternalGUI(bullets, bulletAmount, transform);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
scale(.5f, .5f, 1);
46,829
static Map<Address, List<Shard>> assignShards(Collection<Shard> shards, Collection<Address> addresses) {<NEW_LINE>Map<String, List<Shard>> nodeCandidates = shards.stream().collect(groupingBy(Shard::getIp));<NEW_LINE>Map<Address, List<Shard>> nodeAssigned = new HashMap<>();<NEW_LINE>if (!addresses.stream().map(Address::getHost).collect(toSet()).containsAll(nodeCandidates.keySet())) {<NEW_LINE>throw new JetException("Shard locations are not equal to Hazelcast members locations, " + "shards=" + nodeCandidates.keySet() + ", Hazelcast members=" + addresses);<NEW_LINE>}<NEW_LINE>int uniqueShards = (int) shards.stream().map(Shard::indexShard).distinct().count();<NEW_LINE>Set<String> assignedShards = new HashSet<>();<NEW_LINE>int candidatesSize = nodeCandidates.size();<NEW_LINE>// Same as Math.ceil for float div<NEW_LINE>int iterations = (uniqueShards + candidatesSize - 1) / candidatesSize;<NEW_LINE>for (int i = 0; i < iterations; i++) {<NEW_LINE>for (Address address : addresses) {<NEW_LINE>String host = address.getHost();<NEW_LINE>List<Shard> thisNodeCandidates = nodeCandidates.<MASK><NEW_LINE>if (thisNodeCandidates.isEmpty()) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>Shard shard = thisNodeCandidates.remove(0);<NEW_LINE>List<Shard> nodeShards = nodeAssigned.computeIfAbsent(address, (key) -> new ArrayList<>());<NEW_LINE>nodeShards.add(shard);<NEW_LINE>nodeCandidates.values().forEach(candidates -> candidates.removeIf(next -> next.indexShard().equals(shard.indexShard())));<NEW_LINE>assignedShards.add(shard.indexShard());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (assignedShards.size() != uniqueShards) {<NEW_LINE>throw new JetException("Not all shards have been assigned");<NEW_LINE>}<NEW_LINE>return nodeAssigned;<NEW_LINE>}
getOrDefault(host, emptyList());
1,669,403
private void split(double[] e, int p, int k, boolean wantu) {<NEW_LINE>double f = e[k - 1];<NEW_LINE>e[k - 1] = 0.0;<NEW_LINE>for (int j = k; j < p; j++) {<NEW_LINE>double t = FastMath.hypot(s[j], f);<NEW_LINE>double cs = s[j] / t;<NEW_LINE>double sn = f / t;<NEW_LINE>s[j] = t;<NEW_LINE>f = -sn * e[j];<NEW_LINE>e[j<MASK><NEW_LINE>if (wantu) {<NEW_LINE>for (int i = 0; i < m; i++) {<NEW_LINE>t = cs * U[i][j] + sn * U[i][k - 1];<NEW_LINE>U[i][k - 1] = -sn * U[i][j] + cs * U[i][k - 1];<NEW_LINE>U[i][j] = t;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
] = cs * e[j];
381,076
private void addThisOrSuperConstructor(final Env env, final TypeMirror type, final Element elem, final String name, final ExecutableElement toExclude) throws IOException {<NEW_LINE>final CompilationController controller = env.getController();<NEW_LINE>final Elements elements = controller.getElements();<NEW_LINE>final Types types = controller.getTypes();<NEW_LINE>final Trees trees = controller.getTrees();<NEW_LINE>final <MASK><NEW_LINE>ElementUtilities.ElementAcceptor acceptor = new ElementUtilities.ElementAcceptor() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public boolean accept(Element e, TypeMirror t) {<NEW_LINE>switch(e.getKind()) {<NEW_LINE>case CONSTRUCTOR:<NEW_LINE>return toExclude != e && (Utilities.isShowDeprecatedMembers() || !elements.isDeprecated(e)) && (trees.isAccessible(scope, e, (DeclaredType) t) || (elem.getModifiers().contains(ABSTRACT) && !e.getModifiers().contains(PRIVATE)));<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>};<NEW_LINE>for (Element e : controller.getElementUtilities().getMembers(type, acceptor)) {<NEW_LINE>if (e.getKind() == CONSTRUCTOR) {<NEW_LINE>ExecutableType et = (ExecutableType) asMemberOf(e, type, types);<NEW_LINE>results.add(itemFactory.createThisOrSuperConstructorItem(env.getController(), (ExecutableElement) e, et, anchorOffset, elements.isDeprecated(e), name));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
Scope scope = env.getScope();
578,906
private void initializeBcp47LanguageMap() {<NEW_LINE>Map<String, String> regionsMap;<NEW_LINE>Map<String, String> languagesMap;<NEW_LINE>ourLog.info("Loading BCP47 Language Registry");<NEW_LINE>String input = ClasspathUtil.loadResource("org/hl7/fhir/common/hapi/validation/support/registry.json");<NEW_LINE>ArrayNode map;<NEW_LINE>try {<NEW_LINE>map = (ArrayNode) new ObjectMapper().readTree(input);<NEW_LINE>} catch (JsonProcessingException e) {<NEW_LINE>throw new ConfigurationException(Msg<MASK><NEW_LINE>}<NEW_LINE>languagesMap = new HashMap<>();<NEW_LINE>regionsMap = new HashMap<>();<NEW_LINE>for (int i = 0; i < map.size(); i++) {<NEW_LINE>ObjectNode next = (ObjectNode) map.get(i);<NEW_LINE>String type = next.get("Type").asText();<NEW_LINE>if ("language".equals(type)) {<NEW_LINE>String language = next.get("Subtag").asText();<NEW_LINE>ArrayNode descriptions = (ArrayNode) next.get("Description");<NEW_LINE>String description = null;<NEW_LINE>if (descriptions.size() > 0) {<NEW_LINE>description = descriptions.get(0).asText();<NEW_LINE>}<NEW_LINE>languagesMap.put(language, description);<NEW_LINE>}<NEW_LINE>if ("region".equals(type)) {<NEW_LINE>String region = next.get("Subtag").asText();<NEW_LINE>ArrayNode descriptions = (ArrayNode) next.get("Description");<NEW_LINE>String description = null;<NEW_LINE>if (descriptions.size() > 0) {<NEW_LINE>description = descriptions.get(0).asText();<NEW_LINE>}<NEW_LINE>regionsMap.put(region, description);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>ourLog.info("Have {} languages and {} regions", languagesMap.size(), regionsMap.size());<NEW_LINE>myLanguagesLanugageMap = languagesMap;<NEW_LINE>myLanguagesRegionMap = regionsMap;<NEW_LINE>}
.code(694) + e);
1,377,730
protected Object handleFallback(Invocation inv, String fallback, String defaultFallback, Class<?>[] fallbackClass, Throwable ex) throws Throwable {<NEW_LINE>Object[] originArgs = inv.getArgs();<NEW_LINE>// Execute fallback function if configured.<NEW_LINE>Method fallbackMethod = <MASK><NEW_LINE>if (fallbackMethod != null) {<NEW_LINE>// Construct args.<NEW_LINE>int paramCount = fallbackMethod.getParameterTypes().length;<NEW_LINE>Object[] args;<NEW_LINE>if (paramCount == originArgs.length) {<NEW_LINE>args = originArgs;<NEW_LINE>} else {<NEW_LINE>args = Arrays.copyOf(originArgs, originArgs.length + 1);<NEW_LINE>args[args.length - 1] = ex;<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>if (isStatic(fallbackMethod)) {<NEW_LINE>return fallbackMethod.invoke(null, args);<NEW_LINE>}<NEW_LINE>return fallbackMethod.invoke(inv.getTarget(), args);<NEW_LINE>} catch (InvocationTargetException e) {<NEW_LINE>// throw the actual exception<NEW_LINE>throw e.getTargetException();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// If fallback is absent, we'll try the defaultFallback if provided.<NEW_LINE>return handleDefaultFallback(inv, defaultFallback, fallbackClass, ex);<NEW_LINE>}
extractFallbackMethod(inv, fallback, fallbackClass);
471,359
protected Object convertToInternal(Object payload, MessageHeaders headers, Object conversionHint) {<NEW_LINE>// encode payload to json string or byte[]<NEW_LINE>Object obj = null;<NEW_LINE>if (byte[].class == getSerializedPayloadClass()) {<NEW_LINE>if (payload instanceof String && config.isJSONB()) {<NEW_LINE>obj = JSONB.fromJSONString((String) payload);<NEW_LINE>} else if (payload instanceof String && !config.isJSONB()) {<NEW_LINE>obj = ((String) payload).getBytes(config.getCharset());<NEW_LINE>} else if (config.isJSONB()) {<NEW_LINE>obj = JSONB.toBytes(payload, config.getSymbolTable(), config.getWriterFilters(), config.getWriterFeatures());<NEW_LINE>} else {<NEW_LINE>obj = JSON.toJSONBytes(payload, config.getDateFormat(), config.getWriterFilters(<MASK><NEW_LINE>}<NEW_LINE>} else if (String.class == getSerializedPayloadClass()) {<NEW_LINE>if (payload instanceof String && JSON.isValid((String) payload)) {<NEW_LINE>obj = payload;<NEW_LINE>} else {<NEW_LINE>obj = JSON.toJSONString(payload, config.getDateFormat(), config.getWriterFilters(), config.getWriterFeatures());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return obj;<NEW_LINE>}
), config.getWriterFeatures());
1,364,916
public ArrayList<Actor> scrapeActors() {<NEW_LINE>Elements castElements = document.select("span.cast");<NEW_LINE>ArrayList<Actor> actorList = new ArrayList<>(castElements.size());<NEW_LINE>for (Element castElement : castElements) {<NEW_LINE>String actressName = castElement.select("span.star a").text().trim();<NEW_LINE>Elements aliasElements = castElement.select("span.alias");<NEW_LINE>String[] aliasNames = new String[aliasElements.size()];<NEW_LINE>// index of loop iteration<NEW_LINE>int i = 0;<NEW_LINE>for (Element aliasElement : aliasElements) {<NEW_LINE>String currentAlias = aliasElement<MASK><NEW_LINE>// we might need to reverse the alias name from lastname, firstname to firstname lastname, if we're scraping in english and<NEW_LINE>// we specify in options<NEW_LINE>if (reverseAsianNameInEnglish && siteLanguageToScrape == englishLanguageCode && currentAlias.contains(" "))<NEW_LINE>currentAlias = StringUtils.reverseDelimited(currentAlias, ' ');<NEW_LINE>aliasNames[i] = currentAlias;<NEW_LINE>i++;<NEW_LINE>}<NEW_LINE>// String aliasName = castElement.select("span.alias").text().trim();<NEW_LINE>// JavLibrary has asian names in Lastname, first format. Reverse it, if we specify it with the option to do so<NEW_LINE>// but only do this if we're scraping in english<NEW_LINE>if (reverseAsianNameInEnglish && (siteLanguageToScrape == englishLanguageCode || scrapingLanguage == Language.ENGLISH) && actressName.contains(" ")) {<NEW_LINE>actressName = StringUtils.reverseDelimited(actressName, ' ');<NEW_LINE>}<NEW_LINE>if (aliasNames.length > 0) {<NEW_LINE>for (int j = 0; j < aliasNames.length; j++) {<NEW_LINE>actressName = actressName + " (" + aliasNames[j] + ")";<NEW_LINE>}<NEW_LINE>}<NEW_LINE>actorList.add(new Actor(actressName, "", null));<NEW_LINE>}<NEW_LINE>return actorList;<NEW_LINE>}
.text().trim();
167,738
protected Rectangle calculateTrackRect() {<NEW_LINE>int w = slider.getWidth();<NEW_LINE>int h = slider.getHeight();<NEW_LINE>Rectangle r = new Rectangle();<NEW_LINE>if (slider.getOrientation() == GradientSlider.HORIZONTAL) {<NEW_LINE>r.x = TRIANGLE_SIZE;<NEW_LINE>r.y = 3;<NEW_LINE>r.height = h - TRIANGLE_SIZE - r.y;<NEW_LINE>r.width = w - 2 * TRIANGLE_SIZE;<NEW_LINE>if (r.width > img.getWidth()) {<NEW_LINE>r.width = img.getWidth();<NEW_LINE>r.x = (w - 2 * TRIANGLE_SIZE) <MASK><NEW_LINE>}<NEW_LINE>if (r.height > 2 * DEPTH) {<NEW_LINE>r.height = 2 * DEPTH;<NEW_LINE>r.y = (h - TRIANGLE_SIZE) / 2 - r.height / 2;<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>r.x = 3;<NEW_LINE>r.y = TRIANGLE_SIZE;<NEW_LINE>r.width = w - TRIANGLE_SIZE - r.x;<NEW_LINE>r.height = h - 2 * TRIANGLE_SIZE;<NEW_LINE>if (r.height > img.getWidth()) {<NEW_LINE>r.height = img.getWidth();<NEW_LINE>r.y = (h - 2 * TRIANGLE_SIZE) / 2 - r.height / 2;<NEW_LINE>}<NEW_LINE>if (r.width > 2 * DEPTH) {<NEW_LINE>r.width = 2 * DEPTH;<NEW_LINE>r.x = (w - TRIANGLE_SIZE) / 2 - r.width / 2;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return r;<NEW_LINE>}
/ 2 - r.width / 2;
1,614,901
private void mergeBucketsWithPlan(List<Bucket> buckets, List<BucketRange> plan, ReduceContext reduceContext) {<NEW_LINE>for (int i = plan.size() - 1; i >= 0; i--) {<NEW_LINE>BucketRange <MASK><NEW_LINE>int endIdx = range.endIdx;<NEW_LINE>int startIdx = range.startIdx;<NEW_LINE>if (startIdx == endIdx)<NEW_LINE>continue;<NEW_LINE>List<Bucket> toMerge = new ArrayList<>();<NEW_LINE>for (int idx = endIdx; idx > startIdx; idx--) {<NEW_LINE>toMerge.add(buckets.get(idx));<NEW_LINE>buckets.remove(idx);<NEW_LINE>}<NEW_LINE>// Don't remove the startIdx bucket because it will be replaced by the merged bucket<NEW_LINE>toMerge.add(buckets.get(startIdx));<NEW_LINE>int toRemove = toMerge.stream().mapToInt(b -> countInnerBucket(b) + 1).sum();<NEW_LINE>reduceContext.consumeBucketsAndMaybeBreak(-toRemove + 1);<NEW_LINE>Bucket merged_bucket = reduceBucket(toMerge, reduceContext);<NEW_LINE>buckets.set(startIdx, merged_bucket);<NEW_LINE>}<NEW_LINE>}
range = plan.get(i);
62,763
private int createAcmeFile(WsLocationAdmin wslocation) {<NEW_LINE>acmeFile = wslocation.getServerWorkareaResource(acmeFileName).asFile();<NEW_LINE>if (tc.isDebugEnabled()) {<NEW_LINE>Tr.debug(tc, "Acme history filed prepped from workarea " + acmeFile.getAbsolutePath());<NEW_LINE>}<NEW_LINE>if (acmeFile.exists()) {<NEW_LINE>return FILE_EXISTS;<NEW_LINE>}<NEW_LINE>if (tc.isDebugEnabled()) {<NEW_LINE>Tr.debug(tc, "Acme history does not exist, write initial entry");<NEW_LINE>}<NEW_LINE>headers = new ArrayList<String>();<NEW_LINE>acmeFile.getParentFile().mkdirs();<NEW_LINE>LocalDateTime now = LocalDateTime.now();<NEW_LINE>String date = FORMATTER.format(now);<NEW_LINE>// Save headers<NEW_LINE>headers.add("# WARNING!!! DO NOT MODIFY THIS FILE. IT HAS BEEN AUTO-GENERATED: " + date);<NEW_LINE>headers.add("# Version 1.0");<NEW_LINE>headers.add("# Date" + spaceDelim + "Serial" + spaceDelim + "DirectoryURI" + spaceDelim + "Account URI" + spaceDelim + "Expiration");<NEW_LINE>headers.add("# -------------------------------------------------------------------------------------------------------------------------");<NEW_LINE>FileWriter fr = null;<NEW_LINE>try {<NEW_LINE>acmeFile.createNewFile();<NEW_LINE>fr = new FileWriter(acmeFile, false);<NEW_LINE>for (String h : headers) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>fr.close();<NEW_LINE>return FILE_CREATED;<NEW_LINE>} catch (IOException e) {<NEW_LINE>Tr.event(tc, "Stack trace of IOException", e);<NEW_LINE>Tr.error(tc, "CWPKI2072W", acmeFile.getAbsolutePath(), e.getMessage());<NEW_LINE>} finally {<NEW_LINE>if (fr != null) {<NEW_LINE>try {<NEW_LINE>fr.close();<NEW_LINE>} catch (IOException e) {<NEW_LINE>Tr.event(tc, "Stack trace of IOException while closing", e);<NEW_LINE>Tr.error(tc, "CWPKI2072W", acmeFile.getAbsolutePath(), e.getMessage());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return FILE_NOT_CREATED;<NEW_LINE>}
fr.write(h + "\n");
313,880
public Object execute(ExecutionEvent event) throws ExecutionException {<NEW_LINE>if (RELEASE_NOTES_URL == null) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>IWorkbenchBrowserSupport support = PlatformUI.getWorkbench().getBrowserSupport();<NEW_LINE>if (support.isInternalWebBrowserAvailable()) {<NEW_LINE>// $NON-NLS-1$<NEW_LINE>support.// $NON-NLS-1$<NEW_LINE>createBrowser(// $NON-NLS-1$<NEW_LINE>IWorkbenchBrowserSupport.NAVIGATION_BAR | IWorkbenchBrowserSupport.LOCATION_BAR | IWorkbenchBrowserSupport.AS_EDITOR | IWorkbenchBrowserSupport.STATUS, // Set the name to null. That way the browser tab will display the title of page loaded in<NEW_LINE>"ViewReleaseNotes", // the browser.<NEW_LINE>null, null).openURL(RELEASE_NOTES_URL);<NEW_LINE>} else {<NEW_LINE>support.<MASK><NEW_LINE>}<NEW_LINE>} catch (PartInitException e) {<NEW_LINE>IdeLog.logError(UIPlugin.getDefault(), e);<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>}
getExternalBrowser().openURL(RELEASE_NOTES_URL);
1,667,190
private void onRestoreFileVersionOperationFinish(RemoteOperationResult result) {<NEW_LINE>if (result.isSuccess()) {<NEW_LINE>OCFile file = getFile();<NEW_LINE>// delete old local copy<NEW_LINE>if (file.isDown()) {<NEW_LINE>List<OCFile> <MASK><NEW_LINE>list.add(file);<NEW_LINE>getFileOperationsHelper().removeFiles(list, true, true);<NEW_LINE>// download new version, only if file was previously download<NEW_LINE>getFileOperationsHelper().syncFile(file);<NEW_LINE>}<NEW_LINE>OCFile parent = getStorageManager().getFileById(file.getParentId());<NEW_LINE>startSyncFolderOperation(parent, true, true);<NEW_LINE>Fragment leftFragment = getLeftFragment();<NEW_LINE>if (leftFragment instanceof FileDetailFragment) {<NEW_LINE>FileDetailFragment fileDetailFragment = (FileDetailFragment) leftFragment;<NEW_LINE>fileDetailFragment.getFileDetailActivitiesFragment().reload();<NEW_LINE>}<NEW_LINE>DisplayUtils.showSnackMessage(this, R.string.file_version_restored_successfully);<NEW_LINE>} else {<NEW_LINE>DisplayUtils.showSnackMessage(this, R.string.file_version_restored_error);<NEW_LINE>}<NEW_LINE>}
list = new ArrayList<>();
345,482
public static DescribeGatewayBlockVolumesResponse unmarshall(DescribeGatewayBlockVolumesResponse describeGatewayBlockVolumesResponse, UnmarshallerContext _ctx) {<NEW_LINE>describeGatewayBlockVolumesResponse.setRequestId<MASK><NEW_LINE>describeGatewayBlockVolumesResponse.setMessage(_ctx.stringValue("DescribeGatewayBlockVolumesResponse.Message"));<NEW_LINE>describeGatewayBlockVolumesResponse.setCode(_ctx.stringValue("DescribeGatewayBlockVolumesResponse.Code"));<NEW_LINE>describeGatewayBlockVolumesResponse.setSuccess(_ctx.booleanValue("DescribeGatewayBlockVolumesResponse.Success"));<NEW_LINE>List<BlockVolume> blockVolumes = new ArrayList<BlockVolume>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("DescribeGatewayBlockVolumesResponse.BlockVolumes.Length"); i++) {<NEW_LINE>BlockVolume blockVolume = new BlockVolume();<NEW_LINE>blockVolume.setStatus(_ctx.integerValue("DescribeGatewayBlockVolumesResponse.BlockVolumes[" + i + "].Status"));<NEW_LINE>blockVolume.setSerialNumber(_ctx.stringValue("DescribeGatewayBlockVolumesResponse.BlockVolumes[" + i + "].SerialNumber"));<NEW_LINE>blockVolume.setChunkSize(_ctx.integerValue("DescribeGatewayBlockVolumesResponse.BlockVolumes[" + i + "].ChunkSize"));<NEW_LINE>blockVolume.setTotalUpload(_ctx.longValue("DescribeGatewayBlockVolumesResponse.BlockVolumes[" + i + "].TotalUpload"));<NEW_LINE>blockVolume.setDiskType(_ctx.stringValue("DescribeGatewayBlockVolumesResponse.BlockVolumes[" + i + "].DiskType"));<NEW_LINE>blockVolume.setDiskId(_ctx.stringValue("DescribeGatewayBlockVolumesResponse.BlockVolumes[" + i + "].DiskId"));<NEW_LINE>blockVolume.setPort(_ctx.integerValue("DescribeGatewayBlockVolumesResponse.BlockVolumes[" + i + "].Port"));<NEW_LINE>blockVolume.setIndexId(_ctx.stringValue("DescribeGatewayBlockVolumesResponse.BlockVolumes[" + i + "].IndexId"));<NEW_LINE>blockVolume.setChapOutUser(_ctx.stringValue("DescribeGatewayBlockVolumesResponse.BlockVolumes[" + i + "].ChapOutUser"));<NEW_LINE>blockVolume.setTotalDownload(_ctx.longValue("DescribeGatewayBlockVolumesResponse.BlockVolumes[" + i + "].TotalDownload"));<NEW_LINE>blockVolume.setChapEnabled(_ctx.booleanValue("DescribeGatewayBlockVolumesResponse.BlockVolumes[" + i + "].ChapEnabled"));<NEW_LINE>blockVolume.setEnabled(_ctx.booleanValue("DescribeGatewayBlockVolumesResponse.BlockVolumes[" + i + "].Enabled"));<NEW_LINE>blockVolume.setAddress(_ctx.stringValue("DescribeGatewayBlockVolumesResponse.BlockVolumes[" + i + "].Address"));<NEW_LINE>blockVolume.setName(_ctx.stringValue("DescribeGatewayBlockVolumesResponse.BlockVolumes[" + i + "].Name"));<NEW_LINE>blockVolume.setTarget(_ctx.stringValue("DescribeGatewayBlockVolumesResponse.BlockVolumes[" + i + "].Target"));<NEW_LINE>blockVolume.setOssEndpoint(_ctx.stringValue("DescribeGatewayBlockVolumesResponse.BlockVolumes[" + i + "].OssEndpoint"));<NEW_LINE>blockVolume.setOssBucketName(_ctx.stringValue("DescribeGatewayBlockVolumesResponse.BlockVolumes[" + i + "].OssBucketName"));<NEW_LINE>blockVolume.setCacheMode(_ctx.stringValue("DescribeGatewayBlockVolumesResponse.BlockVolumes[" + i + "].CacheMode"));<NEW_LINE>blockVolume.setState(_ctx.stringValue("DescribeGatewayBlockVolumesResponse.BlockVolumes[" + i + "].State"));<NEW_LINE>blockVolume.setBizProtocol(_ctx.stringValue("DescribeGatewayBlockVolumesResponse.BlockVolumes[" + i + "].Protocol"));<NEW_LINE>blockVolume.setLunId(_ctx.integerValue("DescribeGatewayBlockVolumesResponse.BlockVolumes[" + i + "].LunId"));<NEW_LINE>blockVolume.setOssBucketSsl(_ctx.booleanValue("DescribeGatewayBlockVolumesResponse.BlockVolumes[" + i + "].OssBucketSsl"));<NEW_LINE>blockVolume.setVolumeState(_ctx.integerValue("DescribeGatewayBlockVolumesResponse.BlockVolumes[" + i + "].VolumeState"));<NEW_LINE>blockVolume.setLocalPath(_ctx.stringValue("DescribeGatewayBlockVolumesResponse.BlockVolumes[" + i + "].LocalPath"));<NEW_LINE>blockVolume.setChapInUser(_ctx.stringValue("DescribeGatewayBlockVolumesResponse.BlockVolumes[" + i + "].ChapInUser"));<NEW_LINE>blockVolume.setSize(_ctx.longValue("DescribeGatewayBlockVolumesResponse.BlockVolumes[" + i + "].Size"));<NEW_LINE>blockVolumes.add(blockVolume);<NEW_LINE>}<NEW_LINE>describeGatewayBlockVolumesResponse.setBlockVolumes(blockVolumes);<NEW_LINE>return describeGatewayBlockVolumesResponse;<NEW_LINE>}
(_ctx.stringValue("DescribeGatewayBlockVolumesResponse.RequestId"));
283,429
public void renderResource(String templateName, Map<String, Object> model, Writer writer) {<NEW_LINE>String language = (String) model.get(PippoConstants.REQUEST_PARAMETER_LANG);<NEW_LINE>if (StringUtils.isNullOrEmpty(language)) {<NEW_LINE>language = getLanguageOrDefault(language);<NEW_LINE>}<NEW_LINE>// prepare the locale<NEW_LINE>Locale locale = (Locale) model.get(PippoConstants.REQUEST_PARAMETER_LOCALE);<NEW_LINE>if (locale == null) {<NEW_LINE>locale = getLocaleOrDefault(language);<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>Mustache template = null;<NEW_LINE>localeSupport.setCurrentLocale(locale);<NEW_LINE>templateName = StringUtils.removeEnd(templateName, "." + getFileExtension());<NEW_LINE>if (locale != null) {<NEW_LINE>// try the complete Locale<NEW_LINE>template = getMustacheEngine().getMustache(getLocalizedTemplateName(templateName, locale.toString()));<NEW_LINE>if (template == null) {<NEW_LINE>// try only the language<NEW_LINE>template = getMustacheEngine().getMustache(getLocalizedTemplateName(templateName, locale.getLanguage()));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (template == null) {<NEW_LINE>// fallback to the template without any language or locale<NEW_LINE>template = getMustacheEngine().getMustache(templateName);<NEW_LINE>}<NEW_LINE>if (template == null) {<NEW_LINE>throw new PippoRuntimeException("Template '{}' not found!", templateName);<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>writer.flush();<NEW_LINE>} catch (Exception e) {<NEW_LINE>if (e instanceof PippoRuntimeException) {<NEW_LINE>throw (PippoRuntimeException) e;<NEW_LINE>}<NEW_LINE>throw new PippoRuntimeException(e);<NEW_LINE>} finally {<NEW_LINE>localeSupport.remove();<NEW_LINE>}<NEW_LINE>}
template.render(writer, model);
239,562
public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {<NEW_LINE>// Setting IpAddress To Log and taking header for original IP if forwarded from proxy<NEW_LINE>ShepherdLogManager.setRequestIp(request.getRemoteAddr(), request.getHeader("X-Forwarded-For"));<NEW_LINE>log.debug("*** servlets.Admin.GetJsonProgress ***");<NEW_LINE>PrintWriter out = response.getWriter();<NEW_LINE>out.print(getServletInfo());<NEW_LINE>HttpSession ses = request.getSession(true);<NEW_LINE>Cookie tokenCookie = Validate.getToken(request.getCookies());<NEW_LINE>Object tokenParmeter = request.getParameter("csrfToken");<NEW_LINE>if (Validate.validateAdminSession(ses, tokenCookie, tokenParmeter)) {<NEW_LINE>ShepherdLogManager.setRequestIp(request.getRemoteAddr(), request.getHeader("X-Forwarded-For"), ses.getAttribute("userName").toString());<NEW_LINE>if (Validate.validateTokens(tokenCookie, tokenParmeter)) {<NEW_LINE>String classId = Validate.validateParameter(request.getParameter("classId"), 64);<NEW_LINE>log.debug("classId: " + classId);<NEW_LINE>String ApplicationRoot = getServletContext().getRealPath("");<NEW_LINE>String jsonOutput = <MASK><NEW_LINE>if (jsonOutput.isEmpty()) {<NEW_LINE>jsonOutput = "No Progress Found for that class!";<NEW_LINE>}<NEW_LINE>out.write(jsonOutput);<NEW_LINE>} else {<NEW_LINE>out.write("Error Occurred!");<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>out.write("<img src='css/images/loggedOutSheep.jpg'/>");<NEW_LINE>}<NEW_LINE>log.debug("*** END servlets.Admin.GetProgress ***");<NEW_LINE>}
Getter.getProgressJSON(ApplicationRoot, classId);
413,267
public HopDestination unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>HopDestination hopDestination = new HopDestination();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>if (context.testExpression("priority", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>hopDestination.setPriority(context.getUnmarshaller(Integer.<MASK><NEW_LINE>}<NEW_LINE>if (context.testExpression("queue", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>hopDestination.setQueue(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("waitMinutes", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>hopDestination.setWaitMinutes(context.getUnmarshaller(Integer.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return hopDestination;<NEW_LINE>}
class).unmarshall(context));
1,578,962
public String test() {<NEW_LINE>// AppsServer<NEW_LINE>String server = p_data.getAppsServer();<NEW_LINE>boolean pass = server != null && server.length() > 0 && server.toLowerCase().indexOf("localhost") == -1 && !server.equals("127.0.0.1");<NEW_LINE>InetAddress appsServer = null;<NEW_LINE>String error = "Not correct: AppsServer = " + server;<NEW_LINE>try {<NEW_LINE>if (pass)<NEW_LINE>appsServer = InetAddress.getByName(server);<NEW_LINE>} catch (Exception e) {<NEW_LINE>error += " - " + e.getMessage();<NEW_LINE>pass = false;<NEW_LINE>}<NEW_LINE>if (getPanel() != null)<NEW_LINE>signalOK(getPanel().okAppsServer, "ErrorAppsServer", pass, true, error);<NEW_LINE>if (!pass)<NEW_LINE>return error;<NEW_LINE>log.info("OK: AppsServer = " + appsServer);<NEW_LINE>setProperty(ConfigurationData.ADEMPIERE_APPS_SERVER, appsServer.getHostName());<NEW_LINE>setProperty(ConfigurationData.ADEMPIERE_APPS_TYPE, p_data.getAppsServerType());<NEW_LINE>// Server Dir<NEW_LINE>File serverPath = new File(p_data.getAppsServerDir());<NEW_LINE>pass = serverPath.exists();<NEW_LINE>error = "Not found: " + serverPath;<NEW_LINE>if (getPanel() != null)<NEW_LINE>signalOK(getPanel().okServerDir, "ErrorServerDir", pass, true, error);<NEW_LINE>if (!pass)<NEW_LINE>return error;<NEW_LINE>setProperty(ConfigurationData.ADEMPIERE_APPS_PATH, p_data.getAppsServerDir());<NEW_LINE>log.info("OK: Deploy Directory = " + serverPath);<NEW_LINE>// Deployment Dir<NEW_LINE>p_data.setAppsServerDeployDir(getDeployDir());<NEW_LINE>File deploy = new File(p_data.getAppsServerDeployDir());<NEW_LINE>pass = deploy.exists();<NEW_LINE>error = "Not found: " + deploy;<NEW_LINE>if (getPanel() != null)<NEW_LINE>signalOK(getPanel().okDeployDir, "ErrorDeployDir", pass, true, error);<NEW_LINE>if (!pass)<NEW_LINE>return error;<NEW_LINE>setProperty(ConfigurationData.ADEMPIERE_APPS_DEPLOY, p_data.getAppsServerDeployDir());<NEW_LINE>log.info("OK: Deploy Directory = " + deploy);<NEW_LINE>// JNP Port<NEW_LINE>setProperty(ConfigurationData.ADEMPIERE_JNP_PORT, String.valueOf(p_data.getAppsServerJNPPort()));<NEW_LINE>// Web Port<NEW_LINE>int WebPort = p_data.getAppsServerWebPort();<NEW_LINE>pass = !p_data.testPort("http", appsServer.getHostName(), WebPort, "/") && p_data.testServerPort(WebPort);<NEW_LINE>error = "Not correct: Web Port = " + WebPort;<NEW_LINE>if (getPanel() != null)<NEW_LINE>signalOK(getPanel().okWebPort, "ErrorWebPort", pass, true, error);<NEW_LINE>if (!pass)<NEW_LINE>return error;<NEW_LINE>log.info("OK: Web Port = " + WebPort);<NEW_LINE>setProperty(ConfigurationData.ADEMPIERE_WEB_PORT, String.valueOf(WebPort));<NEW_LINE>// SSL Port<NEW_LINE><MASK><NEW_LINE>pass = !p_data.testPort("https", appsServer.getHostName(), sslPort, "/") && p_data.testServerPort(sslPort);<NEW_LINE>error = "Not correct: SSL Port = " + sslPort;<NEW_LINE>if (getPanel() != null)<NEW_LINE>signalOK(getPanel().okSSLPort, "ErrorWebPort", pass, true, error);<NEW_LINE>if (!pass)<NEW_LINE>return error;<NEW_LINE>log.info("OK: SSL Port = " + sslPort);<NEW_LINE>setProperty(ConfigurationData.ADEMPIERE_SSL_PORT, String.valueOf(sslPort));<NEW_LINE>//<NEW_LINE>return null;<NEW_LINE>}
int sslPort = p_data.getAppsServerSSLPort();
1,442,920
public double[] transformToDoubleValuesSV(ProjectionBlock projectionBlock) {<NEW_LINE>int length = projectionBlock.getNumDocs();<NEW_LINE>if (_differences == null || _differences.length < length) {<NEW_LINE>_differences = new double[length];<NEW_LINE>}<NEW_LINE>if (_firstTransformFunction == null) {<NEW_LINE>Arrays.fill(_differences, 0, length, _firstLiteral);<NEW_LINE>} else {<NEW_LINE>double[] <MASK><NEW_LINE>System.arraycopy(values, 0, _differences, 0, length);<NEW_LINE>}<NEW_LINE>if (_secondTransformFunction == null) {<NEW_LINE>for (int i = 0; i < length; i++) {<NEW_LINE>_differences[i] -= _secondLiteral;<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>double[] values = _secondTransformFunction.transformToDoubleValuesSV(projectionBlock);<NEW_LINE>for (int i = 0; i < length; i++) {<NEW_LINE>_differences[i] -= values[i];<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return _differences;<NEW_LINE>}
values = _firstTransformFunction.transformToDoubleValuesSV(projectionBlock);
233,723
public TaskProvider<? extends Task> createTask(Project project) {<NEW_LINE>project.getPlugins().apply(CompileOnlyResolvePlugin.class);<NEW_LINE>project.getConfigurations().create("forbiddenApisCliJar");<NEW_LINE>project.getDependencies().add("forbiddenApisCliJar", "de.thetaphi:forbiddenapis:3.2");<NEW_LINE>Configuration jdkJarHellConfig = project.getConfigurations().create(JDK_JAR_HELL_CONFIG_NAME);<NEW_LINE>if (BuildParams.isInternal() && project.getPath().equals(":libs:opensearch-core") == false) {<NEW_LINE>// External plugins will depend on this already via transitive dependencies.<NEW_LINE>// Internal projects are not all plugins, so make sure the check is available<NEW_LINE>// we are not doing this for this project itself to avoid jar hell with itself<NEW_LINE>project.getDependencies().add(JDK_JAR_HELL_CONFIG_NAME, project.project(LIBS_OPENSEARCH_CORE_PROJECT_PATH));<NEW_LINE>}<NEW_LINE>TaskProvider<ExportOpenSearchBuildResourcesTask> resourcesTask = project.getTasks().register("thirdPartyAuditResources", ExportOpenSearchBuildResourcesTask.class);<NEW_LINE>Path resourcesDir = project.getBuildDir().toPath().resolve("third-party-audit-config");<NEW_LINE>resourcesTask.configure(t -> {<NEW_LINE>t.setOutputDir(resourcesDir.toFile());<NEW_LINE>t.copy("forbidden/third-party-audit.txt");<NEW_LINE>});<NEW_LINE>TaskProvider<ThirdPartyAuditTask> audit = project.getTasks().register("thirdPartyAudit", ThirdPartyAuditTask.class);<NEW_LINE>audit.configure(t -> {<NEW_LINE>t.dependsOn(resourcesTask);<NEW_LINE>t.setJavaHome(BuildParams.getRuntimeJavaHome().toString());<NEW_LINE>t.getTargetCompatibility().set(project<MASK><NEW_LINE>t.setSignatureFile(resourcesDir.resolve("forbidden/third-party-audit.txt").toFile());<NEW_LINE>});<NEW_LINE>project.getTasks().withType(ThirdPartyAuditTask.class).configureEach(t -> t.setJdkJarHellClasspath(jdkJarHellConfig));<NEW_LINE>return audit;<NEW_LINE>}
.provider(BuildParams::getRuntimeJavaVersion));
191,332
private static Map<String, IndexAbstraction> filterIndicesLookup(Context context, SortedMap<String, IndexAbstraction> indicesLookup, Predicate<? super Map.Entry<String, IndexAbstraction>> filter, IndicesOptions options) {<NEW_LINE>boolean shouldConsumeStream = false;<NEW_LINE>Stream<Map.Entry<String, IndexAbstraction>> stream = indicesLookup.entrySet().stream();<NEW_LINE>if (options.ignoreAliases()) {<NEW_LINE>shouldConsumeStream = true;<NEW_LINE>stream = stream.filter(e -> e.getValue().getType() != IndexAbstraction.Type.ALIAS);<NEW_LINE>}<NEW_LINE>if (filter != null) {<NEW_LINE>shouldConsumeStream = true;<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>if (context.includeDataStreams() == false) {<NEW_LINE>shouldConsumeStream = true;<NEW_LINE>stream = stream.filter(e -> e.getValue().isDataStreamRelated() == false);<NEW_LINE>}<NEW_LINE>if (shouldConsumeStream) {<NEW_LINE>return stream.collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue));<NEW_LINE>} else {<NEW_LINE>return indicesLookup;<NEW_LINE>}<NEW_LINE>}
stream = stream.filter(filter);
1,559,593
public void indexAll(IProject project) {<NEW_LINE>// New index is disabled, see bug 544898<NEW_LINE>// this.indexer.makeDirty(project);<NEW_LINE>if (JavaCore.getPlugin() == null)<NEW_LINE>return;<NEW_LINE>try {<NEW_LINE>// Disable index manager to avoid synchronization lock contention when adding new index requests to the queue.<NEW_LINE>disable();<NEW_LINE>// Also request indexing of binaries on the classpath<NEW_LINE>// determine the new children<NEW_LINE>try {<NEW_LINE>JavaModel model = JavaModelManager.getJavaModelManager().getJavaModel();<NEW_LINE>JavaProject javaProject = (JavaProject) model.getJavaProject(project);<NEW_LINE>// only consider immediate libraries - each project will do the same<NEW_LINE>// NOTE: force to resolve CP variables before calling indexer - 19303, so that initializers<NEW_LINE>// will be run in the current thread.<NEW_LINE>IClasspathEntry[] entries = javaProject.getResolvedClasspath();<NEW_LINE>for (int i = 0; i < entries.length; i++) {<NEW_LINE>IClasspathEntry entry = entries[i];<NEW_LINE>if (entry.getEntryKind() == IClasspathEntry.CPE_LIBRARY)<NEW_LINE>indexLibrary(entry.getPath(), project, ((ClasspathEntry<MASK><NEW_LINE>}<NEW_LINE>} catch (JavaModelException e) {<NEW_LINE>// cannot retrieve classpath info<NEW_LINE>}<NEW_LINE>// check if the same request is not already in the queue<NEW_LINE>IndexRequest request = new IndexAllProject(project, this);<NEW_LINE>requestIfNotWaiting(request);<NEW_LINE>} finally {<NEW_LINE>// Enable index manager after adding all new index requests to the queue.<NEW_LINE>enable();<NEW_LINE>}<NEW_LINE>}
) entry).getLibraryIndexLocation());
1,285,333
public static void process_sub(GrayS16 orig, GrayS16 derivX, GrayS16 derivY) {<NEW_LINE>final short[] data = orig.data;<NEW_LINE>final short[] imgX = derivX.data;<NEW_LINE>final short[] imgY = derivY.data;<NEW_LINE>final int width = orig.getWidth();<NEW_LINE>final int height = orig.getHeight() - 1;<NEW_LINE>final int strideSrc = orig.getStride();<NEW_LINE>// CONCURRENT_BELOW BoofConcurrency.loopFor(1,height,y->{<NEW_LINE>for (int y = 1; y < height; y++) {<NEW_LINE>int indexSrc = orig.startIndex + orig.stride * y + 1;<NEW_LINE>final int endX = indexSrc + width - 2;<NEW_LINE>int indexX = derivX.startIndex + derivX.stride * y + 1;<NEW_LINE>int indexY = derivY.startIndex <MASK><NEW_LINE>for (; indexSrc < endX; indexSrc++) {<NEW_LINE>int v = data[indexSrc + strideSrc + 1] - data[indexSrc - strideSrc - 1];<NEW_LINE>int w = data[indexSrc + strideSrc - 1] - data[indexSrc - strideSrc + 1];<NEW_LINE>imgY[indexY++] = (short) ((data[indexSrc + strideSrc] - data[indexSrc - strideSrc]) * 2 + v + w);<NEW_LINE>imgX[indexX++] = (short) ((data[indexSrc + 1] - data[indexSrc - 1]) * 2 + v - w);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// CONCURRENT_ABOVE });<NEW_LINE>}
+ derivY.stride * y + 1;
1,304,876
public static WorkerConfigs buildSpecWorkerConfigs(final Configs configs) {<NEW_LINE>final Optional<Map<String, String>> nodeSelectors = configs.getSpecJobKubeNodeSelectors().isPresent() ? configs.getSpecJobKubeNodeSelectors<MASK><NEW_LINE>return new WorkerConfigs(configs.getWorkerEnvironment(), new ResourceRequirements().withCpuRequest(configs.getJobMainContainerCpuRequest()).withCpuLimit(configs.getJobMainContainerCpuLimit()).withMemoryRequest(configs.getJobMainContainerMemoryRequest()).withMemoryLimit(configs.getJobMainContainerMemoryLimit()), configs.getJobKubeTolerations(), nodeSelectors, configs.getJobKubeMainContainerImagePullSecret(), configs.getJobKubeMainContainerImagePullPolicy(), configs.getJobKubeSocatImage(), configs.getJobKubeBusyboxImage(), configs.getJobKubeCurlImage(), configs.getJobDefaultEnvMap());<NEW_LINE>}
() : configs.getJobKubeNodeSelectors();
1,815,715
public static ListConvertableEcuResponse unmarshall(ListConvertableEcuResponse listConvertableEcuResponse, UnmarshallerContext _ctx) {<NEW_LINE>listConvertableEcuResponse.setRequestId(_ctx.stringValue("ListConvertableEcuResponse.RequestId"));<NEW_LINE>listConvertableEcuResponse.setCode(_ctx.integerValue("ListConvertableEcuResponse.Code"));<NEW_LINE>listConvertableEcuResponse.setMessage(_ctx.stringValue("ListConvertableEcuResponse.Message"));<NEW_LINE>List<Instance> instanceList = new ArrayList<Instance>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("ListConvertableEcuResponse.InstanceList.Length"); i++) {<NEW_LINE>Instance instance = new Instance();<NEW_LINE>instance.setInstanceId(_ctx.stringValue("ListConvertableEcuResponse.InstanceList[" + i + "].InstanceId"));<NEW_LINE>instance.setInstanceName(_ctx.stringValue("ListConvertableEcuResponse.InstanceList[" + i + "].InstanceName"));<NEW_LINE>instance.setEcuId(_ctx.stringValue("ListConvertableEcuResponse.InstanceList[" + i + "].EcuId"));<NEW_LINE>instance.setVpcId(_ctx.stringValue("ListConvertableEcuResponse.InstanceList[" + i + "].VpcId"));<NEW_LINE>instance.setVpcName(_ctx.stringValue("ListConvertableEcuResponse.InstanceList[" + i + "].VpcName"));<NEW_LINE>instance.setExpired(_ctx.booleanValue("ListConvertableEcuResponse.InstanceList[" + i + "].Expired"));<NEW_LINE>instance.setStatus(_ctx.stringValue("ListConvertableEcuResponse.InstanceList[" + i + "].Status"));<NEW_LINE>instance.setRegionId(_ctx.stringValue("ListConvertableEcuResponse.InstanceList[" + i + "].RegionId"));<NEW_LINE>instance.setCpu(_ctx.integerValue("ListConvertableEcuResponse.InstanceList[" + i + "].Cpu"));<NEW_LINE>instance.setMem(_ctx.integerValue<MASK><NEW_LINE>instance.setPublicIp(_ctx.stringValue("ListConvertableEcuResponse.InstanceList[" + i + "].PublicIp"));<NEW_LINE>instance.setInnerIp(_ctx.stringValue("ListConvertableEcuResponse.InstanceList[" + i + "].InnerIp"));<NEW_LINE>instance.setPrivateIp(_ctx.stringValue("ListConvertableEcuResponse.InstanceList[" + i + "].PrivateIp"));<NEW_LINE>instance.setEip(_ctx.stringValue("ListConvertableEcuResponse.InstanceList[" + i + "].Eip"));<NEW_LINE>instanceList.add(instance);<NEW_LINE>}<NEW_LINE>listConvertableEcuResponse.setInstanceList(instanceList);<NEW_LINE>return listConvertableEcuResponse;<NEW_LINE>}
("ListConvertableEcuResponse.InstanceList[" + i + "].Mem"));
1,293,761
private boolean promptToRemoveMeasurements() {<NEW_LINE>var selectedItems = new ArrayList<>(listView.getSelectionModel().getSelectedItems());<NEW_LINE>if (selectedItems.isEmpty()) {<NEW_LINE>Dialogs.showErrorMessage("Remove measurements", "No measurements selected!");<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>String number = selectedItems.size() == 1 ? String.format("'%s'", selectedItems.iterator().next()) : selectedItems.size() + " measurements";<NEW_LINE>if (!Dialogs.showConfirmDialog("Remove measurements", "Are you sure you want to permanently remove " + number + "?"))<NEW_LINE>return false;<NEW_LINE>String removeString = selectedItems.stream().map(m -> "\"" + m + "\"").collect(Collectors.joining(", "));<NEW_LINE><MASK><NEW_LINE>Class<? extends PathObject> cls = comboBox.getSelectionModel().getSelectedItem();<NEW_LINE>QP.removeMeasurements(imageData.getHierarchy(), cls, selectedItems.toArray(String[]::new));<NEW_LINE>// Keep for scripting<NEW_LINE>WorkflowStep step = new DefaultScriptableWorkflowStep("Remove measurements", String.format("removeMeasurements(%s, %s);", cls.getName(), removeString));<NEW_LINE>imageData.getHistoryWorkflow().addStep(step);<NEW_LINE>// Update<NEW_LINE>refreshMeasurements();<NEW_LINE>updateCurrentList();<NEW_LINE>filterText.set("");<NEW_LINE>return true;<NEW_LINE>}
logger.info("Removing measurements: {}", removeString);
1,417,770
private static int unescapeUnicodeList(Ruby runtime, ByteList to, byte[] bytes, int p, int end, Encoding[] encp, ByteList str, ErrorMode mode) {<NEW_LINE>while (p < end && ASCIIEncoding.INSTANCE.isSpace(bytes[p] & 0xff)) p++;<NEW_LINE>boolean hasUnicode = false;<NEW_LINE>while (true) {<NEW_LINE>int code = StringSupport.scanHex(bytes, p, end - p);<NEW_LINE>int len = StringSupport.hexLength(bytes, p, end - p);<NEW_LINE>if (len == 0)<NEW_LINE>break;<NEW_LINE>if (len > 6)<NEW_LINE>raisePreprocessError(runtime, str, "invalid Unicode range", mode);<NEW_LINE>p += len;<NEW_LINE>if (to != null)<NEW_LINE>appendUtf8(runtime, to, code, encp, str, mode);<NEW_LINE>hasUnicode = true;<NEW_LINE>while (p < end && ASCIIEncoding.INSTANCE.isSpace(bytes[p] & 0xff)) p++;<NEW_LINE>}<NEW_LINE>if (!hasUnicode)<NEW_LINE>raisePreprocessError(<MASK><NEW_LINE>return p;<NEW_LINE>}
runtime, str, "invalid Unicode list", mode);
1,589,577
private ImmutableMap<CommissionShare, I_C_Commission_Share> syncShareRecords(@NonNull final ImmutableList<CommissionShare> shares, @NonNull final CommissionInstanceId commissionInstanceId, @NonNull final OrgId orgId, @NonNull final CommissionStagingRecords records) {<NEW_LINE>final ImmutableList<I_C_Commission_Share> shareRecords = records.getShareRecordsForInstanceRecordId(commissionInstanceId);<NEW_LINE>// noteth that we have a UC to make sure that instanceId, level and contract are unique<NEW_LINE>final ImmutableMap<ArrayKey, I_C_Commission_Share> instanceRecordIdAndLevelToShareRecord = Maps.uniqueIndex(shareRecords, r -> ArrayKey.of(r.getC_Commission_Instance_ID(), r.getLevelHierarchy(), r.getC_Flatrate_Term_ID()));<NEW_LINE>final ImmutableMap.Builder<CommissionShare, I_C_Commission_Share> result = ImmutableMap.builder();<NEW_LINE>final HashSet<CommissionShare> unPersistedShares = new HashSet<>(shares);<NEW_LINE>final HashSet<I_C_Commission_Share> shareRecordsToDelete = new HashSet<>(shareRecords);<NEW_LINE>for (final CommissionShare share : shares) {<NEW_LINE>final ArrayKey instanceAndLevelKey = ArrayKey.of(commissionInstanceId.getRepoId(), share.getLevel().toInt(), share.getContract().getId().getRepoId());<NEW_LINE>final I_C_Commission_Share shareRecordOrNull = instanceRecordIdAndLevelToShareRecord.get(instanceAndLevelKey);<NEW_LINE>if (shareRecordOrNull != null) {<NEW_LINE>shareRecordsToDelete.remove(shareRecordOrNull);<NEW_LINE>}<NEW_LINE>final I_C_Commission_Share shareRecord = createOrUpdateShareRecord(share, commissionInstanceId, orgId, shareRecordOrNull);<NEW_LINE>result.put(share, shareRecord);<NEW_LINE>unPersistedShares.remove(share);<NEW_LINE>}<NEW_LINE>for (final CommissionShare share : unPersistedShares) {<NEW_LINE>final I_C_Commission_Share shareRecord = createOrUpdateShareRecord(share, commissionInstanceId, orgId, null);<NEW_LINE>result.put(share, shareRecord);<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>return result.build();<NEW_LINE>}
shareRecordsToDelete.forEach(InterfaceWrapperHelper::delete);
1,400,523
static OrcaRefill create(@NonNull DesfireRecord record) {<NEW_LINE>byte[] useData = record<MASK><NEW_LINE>long[] usefulData = new long[useData.length];<NEW_LINE>for (int i = 0; i < useData.length; i++) {<NEW_LINE>usefulData[i] = ((long) useData[i]) & 0xFF;<NEW_LINE>}<NEW_LINE>long timestamp = ((0x0F & usefulData[3]) << 28) | (usefulData[4] << 20) | (usefulData[5] << 12) | (usefulData[6] << 4) | (usefulData[7] >> 4);<NEW_LINE>long ftpType = ((usefulData[7] & 0xf) << 4) | ((usefulData[8] & 0xf0) >> 4);<NEW_LINE>long ftpId = ((usefulData[8] & 0xf) << 20) | (usefulData[9] << 12) | (usefulData[10] << 4) | ((usefulData[11] & 0xf0) >> 4);<NEW_LINE>long amount;<NEW_LINE>amount = (usefulData[15] << 7) | (usefulData[16] >> 1);<NEW_LINE>long newBalance = (usefulData[34] << 8) | usefulData[35];<NEW_LINE>long agency = usefulData[3] >> 4;<NEW_LINE>long transType = (usefulData[17]);<NEW_LINE>return new AutoValue_OrcaRefill(timestamp, amount, agency);<NEW_LINE>}
.getData().bytes();
477,875
public ActionCollectionDTO updateCollectionDTOWithDefaultResources(ActionCollectionDTO collection) {<NEW_LINE>DefaultResources defaultResourceIds = collection.getDefaultResources();<NEW_LINE>if (defaultResourceIds == null || StringUtils.isEmpty(defaultResourceIds.getApplicationId()) || StringUtils.isEmpty(defaultResourceIds.getPageId()) || StringUtils.isEmpty(defaultResourceIds.getCollectionId())) {<NEW_LINE>if (defaultResourceIds == null) {<NEW_LINE>return collection;<NEW_LINE>}<NEW_LINE>if (StringUtils.isEmpty(defaultResourceIds.getApplicationId())) {<NEW_LINE>defaultResourceIds.setApplicationId(collection.getApplicationId());<NEW_LINE>}<NEW_LINE>if (StringUtils.isEmpty(defaultResourceIds.getPageId())) {<NEW_LINE>defaultResourceIds.<MASK><NEW_LINE>}<NEW_LINE>if (StringUtils.isEmpty(defaultResourceIds.getCollectionId())) {<NEW_LINE>defaultResourceIds.setCollectionId(collection.getId());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>collection.setApplicationId(defaultResourceIds.getApplicationId());<NEW_LINE>collection.setPageId(defaultResourceIds.getPageId());<NEW_LINE>collection.setId(defaultResourceIds.getCollectionId());<NEW_LINE>// Update actions within the collection<NEW_LINE>collection.getActions().forEach(this::updateActionDTOWithDefaultResources);<NEW_LINE>collection.getArchivedActions().forEach(this::updateActionDTOWithDefaultResources);<NEW_LINE>return collection;<NEW_LINE>}
setPageId(collection.getPageId());
1,071,191
static SampledDataDt mapValueToSampledData(Components.SampledData value, String unit) {<NEW_LINE>SampledDataDt recordData = new SampledDataDt();<NEW_LINE>SimpleQuantityDt origin = new SimpleQuantityDt();<NEW_LINE>origin.setValue(new BigDecimal(value.originValue)).setCode(unit).setSystem<MASK><NEW_LINE>recordData.setOrigin(origin);<NEW_LINE>// Use the period from the first series. They should all be the same.<NEW_LINE>// FHIR output is milliseconds so we need to convert from TimeSeriesData seconds.<NEW_LINE>recordData.setPeriod(value.series.get(0).getPeriod() * 1000);<NEW_LINE>// Set optional fields if they were provided<NEW_LINE>if (value.factor != null) {<NEW_LINE>recordData.setFactor(value.factor);<NEW_LINE>}<NEW_LINE>if (value.lowerLimit != null) {<NEW_LINE>recordData.setLowerLimit(value.lowerLimit);<NEW_LINE>}<NEW_LINE>if (value.upperLimit != null) {<NEW_LINE>recordData.setUpperLimit(value.upperLimit);<NEW_LINE>}<NEW_LINE>recordData.setDimensions(value.series.size());<NEW_LINE>recordData.setData(ExportHelper.sampledDataToValueString(value));<NEW_LINE>return recordData;<NEW_LINE>}
(UNITSOFMEASURE_URI).setUnit(unit);
930,246
final StartMulticastGroupSessionResult executeStartMulticastGroupSession(StartMulticastGroupSessionRequest startMulticastGroupSessionRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(startMulticastGroupSessionRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<StartMulticastGroupSessionRequest> request = null;<NEW_LINE>Response<StartMulticastGroupSessionResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new StartMulticastGroupSessionRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(startMulticastGroupSessionRequest));<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 Wireless");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "StartMulticastGroupSession");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<StartMulticastGroupSessionResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new StartMulticastGroupSessionResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
650,267
public boolean onCreateOptionsMenu(Menu menu) {<NEW_LINE>Log.d(TAG, "OnCreateOptionsMenu called");<NEW_LINE>try {<NEW_LINE>getMenuInflater().inflate(R.menu.vnccanvasactivitymenu, menu);<NEW_LINE>Menu inputMenu = menu.findItem(R.id.itemInputMode).getSubMenu();<NEW_LINE>inputModeMenuItems = new MenuItem[inputModeIds.length];<NEW_LINE>for (int i = 0; i < inputModeIds.length; i++) {<NEW_LINE>inputModeMenuItems[i] = inputMenu.findItem(inputModeIds[i]);<NEW_LINE>}<NEW_LINE>updateInputMenu();<NEW_LINE>Menu scalingMenu = menu.findItem(R.id.itemScaling).getSubMenu();<NEW_LINE>scalingModeMenuItems = new MenuItem[scalingModeIds.length];<NEW_LINE>for (int i = 0; i < scalingModeIds.length; i++) {<NEW_LINE>scalingModeMenuItems[i] = scalingMenu.findItem(scalingModeIds[i]);<NEW_LINE>}<NEW_LINE>updateScalingMenu();<NEW_LINE>// Set the text of the Extra Keys menu item appropriately.<NEW_LINE>// TODO: Implement for Opaque<NEW_LINE>if (connection != null && connection.getExtraKeysToggleType() == Constants.EXTRA_KEYS_ON)<NEW_LINE>menu.findItem(R.id.itemExtraKeys).setTitle(R.string.extra_keys_disable);<NEW_LINE>else<NEW_LINE>menu.findItem(R.id.itemExtraKeys).setTitle(R.string.extra_keys_enable);<NEW_LINE>OnTouchListener moveListener = new OnTouchViewMover(toolbar, handler, toolbarHider, hideToolbarDelay);<NEW_LINE>ImageButton moveButton = new ImageButton(this);<NEW_LINE>moveButton.setBackgroundResource(R.drawable.ic_all_out_gray_36dp);<NEW_LINE>MenuItem moveToolbar = menu.findItem(R.id.moveToolbar);<NEW_LINE>moveToolbar.setActionView(moveButton);<NEW_LINE>moveToolbar.getActionView().setOnTouchListener(moveListener);<NEW_LINE>} catch (NullPointerException e) {<NEW_LINE>e.printStackTrace();<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>return true;<NEW_LINE>}
Log.d(TAG, "OnCreateOptionsMenu complete");
1,468,622
public Object readObject(JSONReader jsonReader, Type fieldType, Object fieldName, long features) {<NEW_LINE>if (jsonReader.readIfNull()) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>if (jsonReader.nextIfMatch('[')) {<NEW_LINE>Float[] values = new Float[16];<NEW_LINE>int size = 0;<NEW_LINE>for (; ; ) {<NEW_LINE>if (jsonReader.nextIfMatch(']')) {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>int minCapacity = size + 1;<NEW_LINE>if (minCapacity - values.length > 0) {<NEW_LINE>int oldCapacity = values.length;<NEW_LINE>int newCapacity = oldCapacity + (oldCapacity >> 1);<NEW_LINE>if (newCapacity - minCapacity < 0) {<NEW_LINE>newCapacity = minCapacity;<NEW_LINE>}<NEW_LINE>values = Arrays.copyOf(values, newCapacity);<NEW_LINE>}<NEW_LINE>values[size++] = jsonReader.readFloat();<NEW_LINE>}<NEW_LINE>jsonReader.nextIfMatch(',');<NEW_LINE>return Arrays.copyOf(values, size);<NEW_LINE>}<NEW_LINE>if (jsonReader.isString()) {<NEW_LINE>String str = jsonReader.readString();<NEW_LINE>if (str.isEmpty()) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>throw new JSONException(jsonReader<MASK><NEW_LINE>}<NEW_LINE>throw new JSONException(jsonReader.info("TODO"));<NEW_LINE>}
.info("not support input " + str));
1,716,208
protected void drawFrame(Canvas canvas) {<NEW_LINE>float percent = progress;<NEW_LINE>float percent2 = (float) (Math.sqrt(3.38f - (percent - 1.7f) * (percent - 1.7f)) - 0.7);<NEW_LINE>int width = mHTextView.getWidth();<NEW_LINE>int height = mHTextView.getHeight();<NEW_LINE>pA.x = 0;<NEW_LINE>pA.y = 0;<NEW_LINE>pB.x = width;<NEW_LINE>pB.y = 0;<NEW_LINE>pC.x = width;<NEW_LINE>pC.y = height;<NEW_LINE>pD.x = 0;<NEW_LINE>pD.y = height;<NEW_LINE>p1.x = width * percent2;<NEW_LINE>p1.y = pB.y;<NEW_LINE>drawLine(canvas, p1, pB);<NEW_LINE>p2.x = pB.x;<NEW_LINE>p2.y = height * percent;<NEW_LINE>drawLine(canvas, pB, p2);<NEW_LINE>p3.x = width;<NEW_LINE>p3.y = height * percent2;<NEW_LINE>drawLine(canvas, p3, pC);<NEW_LINE>p4.x = width * (1 - percent);<NEW_LINE>p4.y = height;<NEW_LINE>drawLine(canvas, pC, p4);<NEW_LINE>p5.x = width * (1 - percent2);<NEW_LINE>p5.y = height;<NEW_LINE>drawLine(canvas, p5, pD);<NEW_LINE>p6.x = 0;<NEW_LINE>p6.y = height * (1 - percent);<NEW_LINE><MASK><NEW_LINE>p7.x = 0;<NEW_LINE>p7.y = height * (1 - percent2);<NEW_LINE>drawLine(canvas, p7, pA);<NEW_LINE>p8.x = width * percent;<NEW_LINE>p8.y = 0;<NEW_LINE>drawLine(canvas, pA, p8);<NEW_LINE>}
drawLine(canvas, pD, p6);
105,410
private void printPostInstallStepsDebian(File serviceFile) {<NEW_LINE>System.out.println(INTENSITY_BOLD + "Ubuntu/Debian Linux system detected (SystemV):" + INTENSITY_NORMAL);<NEW_LINE>System.out.println(" To install the service:");<NEW_LINE>System.out.println(" $ ln -s " + serviceFile.getPath() + " /etc/init.d/");<NEW_LINE><MASK><NEW_LINE>System.out.println(" To start the service when the machine is rebooted:");<NEW_LINE>System.out.println(" $ update-rc.d " + serviceFile.getName() + " defaults");<NEW_LINE>System.out.println("");<NEW_LINE>System.out.println(" To disable starting the service when the machine is rebooted:");<NEW_LINE>System.out.println(" $ update-rc.d -f " + serviceFile.getName() + " remove");<NEW_LINE>System.out.println("");<NEW_LINE>System.out.println(" To start the service:");<NEW_LINE>System.out.println(" $ /etc/init.d/" + serviceFile.getName() + " start");<NEW_LINE>System.out.println("");<NEW_LINE>System.out.println(" To stop the service:");<NEW_LINE>System.out.println(" $ /etc/init.d/" + serviceFile.getName() + " stop");<NEW_LINE>System.out.println("");<NEW_LINE>System.out.println(" To uninstall the service:");<NEW_LINE>System.out.println(" $ rm /etc/init.d/" + serviceFile.getName());<NEW_LINE>}
System.out.println("");
544,316
private void exportMagiskZipQAndAbove() {<NEW_LINE>Intent intent = new Intent(Intent.ACTION_CREATE_DOCUMENT);<NEW_LINE>intent.addCategory(Intent.CATEGORY_OPENABLE);<NEW_LINE>// you can set file mime-type<NEW_LINE>intent.setType("*/*");<NEW_LINE>// default file name<NEW_LINE>String backupFileNameWithExt <MASK><NEW_LINE>intent.putExtra(Intent.EXTRA_TITLE, backupFileNameWithExt);<NEW_LINE>try {<NEW_LINE>if (activity != null) {<NEW_LINE>activity.startActivityForResult(intent, REQUEST_CODE_EXPORT_MAGISK_FILE_PICKED);<NEW_LINE>} else {<NEW_LINE>fragment.startActivityForResult(intent, REQUEST_CODE_EXPORT_MAGISK_FILE_PICKED);<NEW_LINE>}<NEW_LINE>} catch (ActivityNotFoundException e) {<NEW_LINE>Toast.makeText(requireContext(), "Activity not found, please install Files app", Toast.LENGTH_LONG).show();<NEW_LINE>}<NEW_LINE>}
= "zygisk_thanox-" + BuildProp.THANOS_VERSION_NAME + ".zip";