idx int32 46 1.86M | input stringlengths 321 6.6k | target stringlengths 9 1.24k |
|---|---|---|
1,251,140 | public static void response(ServerConnection c, boolean hasMore) {<NEW_LINE>ByteBufferHolder buffer = c.allocate();<NEW_LINE>IPacketOutputProxy proxy = PacketOutputProxyFactory.getInstance().createProxy(c, buffer);<NEW_LINE>proxy.packetBegin();<NEW_LINE>// write header<NEW_LINE><MASK><NEW_LINE>// write fields<NEW_LINE>for (FieldPacket field : fields) {<NEW_LINE>proxy = field.write(proxy);<NEW_LINE>}<NEW_LINE>// write eof<NEW_LINE>proxy = eof.write(proxy);<NEW_LINE>// write rows<NEW_LINE>byte packetId = eof.packetId;<NEW_LINE>RowDataPacket row = new RowDataPacket(FIELD_COUNT);<NEW_LINE>row.add(VERSION_COMMENT);<NEW_LINE>row.packetId = ++packetId;<NEW_LINE>proxy = row.write(proxy);<NEW_LINE>// write last eof<NEW_LINE>EOFPacket lastEof = new EOFPacket();<NEW_LINE>lastEof.packetId = ++packetId;<NEW_LINE>if (hasMore) {<NEW_LINE>lastEof.status |= MySQLPacket.SERVER_MORE_RESULTS_EXISTS;<NEW_LINE>}<NEW_LINE>proxy = lastEof.write(proxy);<NEW_LINE>// post write<NEW_LINE>proxy.packetEnd();<NEW_LINE>} | proxy = header.write(proxy); |
1,422,673 | private void createPO() {<NEW_LINE>int noOrders = 0;<NEW_LINE>String info = "";<NEW_LINE>//<NEW_LINE>MOrder order = null;<NEW_LINE>I_M_Warehouse wh = null;<NEW_LINE>X_T_Replenish[] replenishs = getReplenish("M_WarehouseSource_ID IS NULL");<NEW_LINE>for (int i = 0; i < replenishs.length; i++) {<NEW_LINE>X_T_Replenish replenish = replenishs[i];<NEW_LINE>if (wh == null || wh.getM_Warehouse_ID() != replenish.getM_Warehouse_ID())<NEW_LINE>wh = warehousesRepo.getById(WarehouseId.ofRepoId(replenish.getM_Warehouse_ID()));<NEW_LINE>//<NEW_LINE>if (order == null || order.getC_BPartner_ID() != replenish.getC_BPartner_ID() || order.getM_Warehouse_ID() != replenish.getM_Warehouse_ID()) {<NEW_LINE>order = new MOrder(getCtx(), 0, get_TrxName());<NEW_LINE>order.setIsSOTrx(false);<NEW_LINE>Services.get(IOrderBL.class).setDocTypeTargetIdAndUpdateDescription(order, p_C_DocType_ID);<NEW_LINE>I_C_BPartner bp = Services.get(IBPartnerDAO.class).getById(replenish.getC_BPartner_ID());<NEW_LINE>order.setBPartner(bp);<NEW_LINE>order.setSalesRep_ID(getAD_User_ID());<NEW_LINE>order.setDescription(Msg.getMsg(getCtx(), "Replenishment"));<NEW_LINE>// Set Org/WH<NEW_LINE>order.setAD_Org_ID(wh.getAD_Org_ID());<NEW_LINE>order.setM_Warehouse_ID(wh.getM_Warehouse_ID());<NEW_LINE>if (!order.save())<NEW_LINE>return;<NEW_LINE>log.debug(order.toString());<NEW_LINE>noOrders++;<NEW_LINE>info <MASK><NEW_LINE>}<NEW_LINE>MOrderLine line = new MOrderLine(order);<NEW_LINE>line.setM_Product_ID(replenish.getM_Product_ID());<NEW_LINE>line.setQty(replenish.getQtyToOrder());<NEW_LINE>line.setPrice();<NEW_LINE>line.save();<NEW_LINE>}<NEW_LINE>m_info = "#" + noOrders + info;<NEW_LINE>log.info(m_info);<NEW_LINE>} | += " - " + order.getDocumentNo(); |
1,497,362 | private void printData(TopicRouteData topicRouteData, boolean useListFormat) {<NEW_LINE>if (!useListFormat) {<NEW_LINE>System.out.printf("%s%n", topicRouteData.toJson(true));<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>int totalReadQueue = 0, totalWriteQueue = 0;<NEW_LINE>List<QueueData<MASK><NEW_LINE>Map<String, QueueData> /*brokerName*/<NEW_LINE>map = new HashMap<>();<NEW_LINE>for (QueueData queueData : queueDataList) {<NEW_LINE>map.put(queueData.getBrokerName(), queueData);<NEW_LINE>}<NEW_LINE>queueDataList.sort(Comparator.comparing(QueueData::getBrokerName));<NEW_LINE>List<BrokerData> brokerDataList = topicRouteData.getBrokerDatas();<NEW_LINE>brokerDataList.sort(Comparator.comparing(BrokerData::getBrokerName));<NEW_LINE>System.out.printf(FORMAT, "#ClusterName", "#BrokerName", "#BrokerAddrs", "#ReadQueue", "#WriteQueue", "#Perm");<NEW_LINE>for (BrokerData brokerData : brokerDataList) {<NEW_LINE>String brokerName = brokerData.getBrokerName();<NEW_LINE>QueueData queueData = map.get(brokerName);<NEW_LINE>totalReadQueue += queueData.getReadQueueNums();<NEW_LINE>totalWriteQueue += queueData.getWriteQueueNums();<NEW_LINE>System.out.printf(FORMAT, brokerData.getCluster(), brokerName, brokerData.getBrokerAddrs(), queueData.getReadQueueNums(), queueData.getWriteQueueNums(), queueData.getPerm());<NEW_LINE>}<NEW_LINE>for (int i = 0; i < 158; i++) {<NEW_LINE>System.out.print("-");<NEW_LINE>}<NEW_LINE>System.out.printf("%n");<NEW_LINE>System.out.printf(FORMAT, "Total:", map.keySet().size(), "", totalReadQueue, totalWriteQueue, "");<NEW_LINE>} | > queueDataList = topicRouteData.getQueueDatas(); |
558,839 | public void draw(GLAutoDrawable drawable, boolean idle, Position machineCoord, Position workCoord, Position focusMin, Position focusMax, double scaleFactor, Position mouseCoordinates, Position rotation) {<NEW_LINE>GL2 gl = drawable.getGL().getGL2();<NEW_LINE>double scale = 1. / scaleFactor;<NEW_LINE>gl.glPushMatrix();<NEW_LINE>gl.glTranslated(workCoord.x, workCoord.y, workCoord.z);<NEW_LINE>gl.<MASK><NEW_LINE>gl.glColor4fv(VisualizerOptions.colorToFloatArray(toolColor), 0);<NEW_LINE>glu.gluQuadricNormals(gq, GLU.GLU_SMOOTH);<NEW_LINE>glu.gluCylinder(gq, 0f, .03f, .2, 16, 1);<NEW_LINE>gl.glTranslated(0, 0, 0.2);<NEW_LINE>glu.gluCylinder(gq, 0.03f, .0f, .01, 16, 1);<NEW_LINE>gl.glPopMatrix();<NEW_LINE>} | glScaled(scale, scale, scale); |
861,884 | private void encryptInsertValue(final EncryptAlgorithm encryptAlgorithm, final int parameterIndex, final Object originalValue, final StandardParameterBuilder parameterBuilder, final EncryptContext encryptContext) {<NEW_LINE>parameterBuilder.addReplacedParameters(parameterIndex, encryptAlgorithm.encrypt(originalValue, encryptContext));<NEW_LINE>Collection<Object> addedParameters = new LinkedList<>();<NEW_LINE>if (encryptAlgorithm instanceof QueryAssistedEncryptAlgorithm) {<NEW_LINE>Optional<String> assistedColumnName = encryptRule.findAssistedQueryColumn(encryptContext.getTableName(<MASK><NEW_LINE>Preconditions.checkArgument(assistedColumnName.isPresent(), "Can not find assisted query Column Name");<NEW_LINE>addedParameters.add(((QueryAssistedEncryptAlgorithm) encryptAlgorithm).queryAssistedEncrypt(originalValue, encryptContext));<NEW_LINE>}<NEW_LINE>if (encryptRule.findPlainColumn(encryptContext.getTableName(), encryptContext.getColumnName()).isPresent()) {<NEW_LINE>addedParameters.add(originalValue);<NEW_LINE>}<NEW_LINE>if (!addedParameters.isEmpty()) {<NEW_LINE>if (!parameterBuilder.getAddedIndexAndParameters().containsKey(parameterIndex + 1)) {<NEW_LINE>parameterBuilder.getAddedIndexAndParameters().put(parameterIndex + 1, new LinkedList<>());<NEW_LINE>}<NEW_LINE>parameterBuilder.getAddedIndexAndParameters().get(parameterIndex + 1).addAll(addedParameters);<NEW_LINE>}<NEW_LINE>} | ), encryptContext.getColumnName()); |
1,536,222 | /*<NEW_LINE>* this http interface is used to return configuration information requested by other fe.<NEW_LINE>*/<NEW_LINE>@RequestMapping(path = "/config", method = RequestMethod.GET)<NEW_LINE>public Object config(HttpServletRequest request, HttpServletResponse response) {<NEW_LINE>executeCheckPassword(request, response);<NEW_LINE>checkGlobalAuth(ConnectContext.get().getCurrentUserIdentity(), PrivPredicate.ADMIN);<NEW_LINE>List<List<String>> configs = ConfigBase.getConfigInfo(null);<NEW_LINE>// Sort all configs by config key.<NEW_LINE>configs.sort(Comparator.comparing(o -> o.get(0)));<NEW_LINE>// reorder the fields<NEW_LINE>List<List<String>> results = Lists.newArrayList();<NEW_LINE>for (List<String> config : configs) {<NEW_LINE>List<String> list = Lists.newArrayList();<NEW_LINE>list.add(config.get(0));<NEW_LINE>list.add<MASK><NEW_LINE>list.add(config.get(4));<NEW_LINE>list.add(config.get(1));<NEW_LINE>list.add(config.get(3));<NEW_LINE>results.add(list);<NEW_LINE>}<NEW_LINE>return results;<NEW_LINE>} | (config.get(2)); |
1,058,466 | final ListPolicyPrincipalsResult executeListPolicyPrincipals(ListPolicyPrincipalsRequest listPolicyPrincipalsRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(listPolicyPrincipalsRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE><MASK><NEW_LINE>Request<ListPolicyPrincipalsRequest> request = null;<NEW_LINE>Response<ListPolicyPrincipalsResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new ListPolicyPrincipalsRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(listPolicyPrincipalsRequest));<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");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ListPolicyPrincipals");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<ListPolicyPrincipalsResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new ListPolicyPrincipalsResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | awsRequestMetrics.startEvent(Field.ClientExecuteTime); |
1,093,514 | public int compareTo(Node o) {<NEW_LINE>double normH1 = a1 * (1 - h1 / n);<NEW_LINE>double normH2 = a2 * h2 / MAX_DIST;<NEW_LINE>double normH3 = a3 * h3 / MAX_DIST_H3;<NEW_LINE>double otherNormH1 = a1 * (1 - o.h1 / n);<NEW_LINE>double otherNormH2 <MASK><NEW_LINE>double otherNormH3 = a3 * o.h3 / MAX_DIST_H3;<NEW_LINE>double s1 = normH1 + normH2 + normH3;<NEW_LINE>double s2 = otherNormH1 + otherNormH2 + otherNormH3;<NEW_LINE>// If I have less => better<NEW_LINE>if (s1 < s2)<NEW_LINE>return -1;<NEW_LINE>if (s1 > s2)<NEW_LINE>return 1;<NEW_LINE>return 0;<NEW_LINE>} | = a2 * o.h2 / MAX_DIST; |
1,076,234 | public HeapWalkerNode[] computeChildren() {<NEW_LINE>int itemsCount = endIndex - startIndex + 1;<NEW_LINE>HeapWalkerNode[] children = new HeapWalkerNode[itemsCount];<NEW_LINE>List instances = ((ClassNode) getParent()).getJavaClass().getInstances();<NEW_LINE>List <MASK><NEW_LINE>List sortedFilteredInstances = getSortedInstances(filteredInstances, sortingColumn, sortingOrder);<NEW_LINE>for (int i = 0; i < children.length; i++) {<NEW_LINE>Instance instance = (Instance) sortedFilteredInstances.get(startIndex + i);<NEW_LINE>children[i] = new InstancesListInstanceNode(instance, InstancesListContainerNode.this);<NEW_LINE>if ((instanceToSelect != null) && ((((startIndex + i) == 0) && (instanceToSelect == INSTANCE_FIRST)) || (instance.equals(instanceToSelect)))) {<NEW_LINE>pathToSelect = new TreePath(new Object[] { children[i].getParent().getParent(), children[i].getParent(), children[i] });<NEW_LINE>instanceToSelect = null;<NEW_LINE>containerToSelectIndex = -1;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return children;<NEW_LINE>} | filteredInstances = getFilteredInstances(instances, filterValue); |
361,083 | /*<NEW_LINE>* Method that will read the log files.<NEW_LINE>*<NEW_LINE>* @param {String} file<NEW_LINE>* @return {String}<NEW_LINE>*/<NEW_LINE>private static String readFile(String file) {<NEW_LINE>BufferedReader bufferedReader = null;<NEW_LINE>String data = "----" + file + "----\r\n";<NEW_LINE>String line = "";<NEW_LINE>try {<NEW_LINE>if (new File(file).exists()) {<NEW_LINE>bufferedReader = new BufferedReader(new FileReader(file));<NEW_LINE>while ((line = bufferedReader.readLine()) != null) {<NEW_LINE>data += (line + "\r\n");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (IOException ex) {<NEW_LINE>com.gmt2001.Console.err.printStackTrace(ex);<NEW_LINE>} finally {<NEW_LINE>if (bufferedReader != null) {<NEW_LINE>try {<NEW_LINE>bufferedReader.close();<NEW_LINE>} catch (IOException ex) {<NEW_LINE>com.gmt2001.<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return data;<NEW_LINE>} | Console.err.printStackTrace(ex); |
47,374 | protected static String createPodName(final String fullImagePath, final String jobId, final int attempt) {<NEW_LINE>final var versionDelimiter = ":";<NEW_LINE>final var noVersion = fullImagePath.split(versionDelimiter)[0];<NEW_LINE>final var dockerDelimiter = "/";<NEW_LINE>final var nameParts = noVersion.split(dockerDelimiter);<NEW_LINE>var imageName = nameParts[nameParts.length - 1];<NEW_LINE>final var randSuffix = RandomStringUtils.randomAlphabetic(5).toLowerCase();<NEW_LINE>final String suffix = "sync" + "-" + jobId + "-" + attempt + "-" + randSuffix;<NEW_LINE>var podName = imageName + "-" + suffix;<NEW_LINE>final var podNameLenLimit = 63;<NEW_LINE>if (podName.length() > podNameLenLimit) {<NEW_LINE>final var extra = podName.length() - podNameLenLimit;<NEW_LINE>imageName = imageName.substring(extra);<NEW_LINE>podName = imageName + "-" + suffix;<NEW_LINE>}<NEW_LINE>final Matcher <MASK><NEW_LINE>// Since we add sync-UUID as a suffix a couple of lines up, there will always be a substring<NEW_LINE>// starting with an alphabetic character.<NEW_LINE>// If the image name is a no-op, this function should always return `sync-UUID` at the minimum.<NEW_LINE>m.find();<NEW_LINE>return podName.substring(m.start());<NEW_LINE>} | m = ALPHABETIC.matcher(podName); |
1,344,210 | public AnnotationVisitor visitAnnotation(String desc, boolean vis) {<NEW_LINE>if (desc.equals(DTRACE_DESC)) {<NEW_LINE>return new AnnotationVisitor(Opcodes.ASM7) {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void visit(String name, Object value) {<NEW_LINE>if (name.equals("value")) {<NEW_LINE>result[0] = value;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>};<NEW_LINE>} else if (desc.equals(DTRACE_REF_DESC)) {<NEW_LINE>return new AnnotationVisitor(Opcodes.ASM7) {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void visit(String name, Object value) {<NEW_LINE>if (name.equals("value")) {<NEW_LINE>String tmp = value.toString();<NEW_LINE>File file = new File(tmp);<NEW_LINE>if (file.isAbsolute()) {<NEW_LINE>result[0] = file;<NEW_LINE>} else {<NEW_LINE>int index = fileName.lastIndexOf(File.separatorChar);<NEW_LINE>String dir;<NEW_LINE>if (index == -1) {<NEW_LINE>dir = ".";<NEW_LINE>} else {<NEW_LINE>dir = fileName.substring(0, index);<NEW_LINE>}<NEW_LINE>result[0] <MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>};<NEW_LINE>} else {<NEW_LINE>return super.visitAnnotation(desc, vis);<NEW_LINE>}<NEW_LINE>} | = new File(dir, tmp); |
1,594,123 | private HttpResult handleClusterRequest(String clusterName, String fleetControllerPath) throws InterruptedException {<NEW_LINE>ContainerStatusPageServer <MASK><NEW_LINE>if (statusServer == null) {<NEW_LINE>return new HttpResult().setHttpCode(404, "No controller exists for cluster '" + clusterName + "'.");<NEW_LINE>}<NEW_LINE>if (fleetControllerPath == null || fleetControllerPath.isEmpty()) {<NEW_LINE>fleetControllerPath = "/";<NEW_LINE>}<NEW_LINE>StatusPageServer.HttpRequest req = new StatusPageServer.HttpRequest(fleetControllerPath);<NEW_LINE>req.setPathPrefix("/clustercontroller-status/v1");<NEW_LINE>StatusPageResponse response = statusServer.getStatus(req);<NEW_LINE>HttpResult result = new HttpResult();<NEW_LINE>if (response.getResponseCode() != null) {<NEW_LINE>result.setHttpCode(response.getResponseCode().getCode(), response.getResponseCode().getMessage());<NEW_LINE>}<NEW_LINE>if (response.getContentType() != null) {<NEW_LINE>result.addHeader("Content-Type", response.getContentType());<NEW_LINE>}<NEW_LINE>result.setContent(response.getOutputStream().toString(StandardCharsets.UTF_8));<NEW_LINE>return result;<NEW_LINE>} | statusServer = statusClusters.get(clusterName); |
812,751 | // DO NOT MODIFY THIS CODE, GENERATED AUTOMATICALLY<NEW_LINE>public static com.sun.jdi.ThreadReference thread(com.sun.jdi.event.ClassPrepareEvent a) throws org.netbeans.modules.debugger.jpda.jdi.InternalExceptionWrapper, org.netbeans.modules.debugger.jpda.jdi.VMDisconnectedExceptionWrapper {<NEW_LINE>if (org.netbeans.modules.debugger.jpda.JDIExceptionReporter.isLoggable()) {<NEW_LINE>org.netbeans.modules.debugger.jpda.JDIExceptionReporter.logCallStart("com.sun.jdi.event.ClassPrepareEvent", "thread", "JDI CALL: com.sun.jdi.event.ClassPrepareEvent({0}).thread()", new Object[] { a });<NEW_LINE>}<NEW_LINE>Object retValue = null;<NEW_LINE>try {<NEW_LINE>com.sun.jdi.ThreadReference ret;<NEW_LINE>ret = a.thread();<NEW_LINE>retValue = ret;<NEW_LINE>return ret;<NEW_LINE>} catch (com.sun.jdi.InternalException ex) {<NEW_LINE>retValue = ex;<NEW_LINE>org.netbeans.modules.debugger.<MASK><NEW_LINE>throw new org.netbeans.modules.debugger.jpda.jdi.InternalExceptionWrapper(ex);<NEW_LINE>} catch (com.sun.jdi.VMDisconnectedException ex) {<NEW_LINE>retValue = ex;<NEW_LINE>if (a instanceof com.sun.jdi.Mirror) {<NEW_LINE>com.sun.jdi.VirtualMachine vm = ((com.sun.jdi.Mirror) a).virtualMachine();<NEW_LINE>try {<NEW_LINE>vm.dispose();<NEW_LINE>} catch (com.sun.jdi.VMDisconnectedException vmdex) {<NEW_LINE>}<NEW_LINE>}<NEW_LINE>throw new org.netbeans.modules.debugger.jpda.jdi.VMDisconnectedExceptionWrapper(ex);<NEW_LINE>} catch (Error err) {<NEW_LINE>retValue = err;<NEW_LINE>throw err;<NEW_LINE>} catch (RuntimeException rex) {<NEW_LINE>retValue = rex;<NEW_LINE>throw rex;<NEW_LINE>} finally {<NEW_LINE>if (org.netbeans.modules.debugger.jpda.JDIExceptionReporter.isLoggable()) {<NEW_LINE>org.netbeans.modules.debugger.jpda.JDIExceptionReporter.logCallEnd("com.sun.jdi.event.ClassPrepareEvent", "thread", retValue);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | jpda.JDIExceptionReporter.report(ex); |
531,422 | public void apply() throws ConfigurationException {<NEW_LINE>// Bazel workspaces do not specify a sdk path so we do not need to update the sdk path if using<NEW_LINE>// a bazel workspace.<NEW_LINE>if (!workspaceCache.isBazel()) {<NEW_LINE>final String errorMessage = <MASK><NEW_LINE>if (errorMessage != null) {<NEW_LINE>throw new ConfigurationException(errorMessage);<NEW_LINE>}<NEW_LINE>final String sdkHomePath = getSdkPathText();<NEW_LINE>if (FlutterSdkUtil.isFlutterSdkHome(sdkHomePath)) {<NEW_LINE>ApplicationManager.getApplication().runWriteAction(() -> {<NEW_LINE>FlutterSdkUtil.setFlutterSdkPath(myProject, sdkHomePath);<NEW_LINE>FlutterSdkUtil.enableDartSdk(myProject);<NEW_LINE>ApplicationManager.getApplication().executeOnPooledThread(() -> {<NEW_LINE>final FlutterSdk sdk = FlutterSdk.forPath(sdkHomePath);<NEW_LINE>if (sdk != null) {<NEW_LINE>try {<NEW_LINE>lock.acquire();<NEW_LINE>sdk.queryFlutterChannel(false);<NEW_LINE>lock.release();<NEW_LINE>} catch (InterruptedException e) {<NEW_LINE>// do nothing<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>});<NEW_LINE>}<NEW_LINE>}<NEW_LINE>FlutterInitializer.setCanReportAnalytics(myReportUsageInformationCheckBox.isSelected());<NEW_LINE>final FlutterSettings settings = FlutterSettings.getInstance();<NEW_LINE>final String oldFontPackages = settings.getFontPackages();<NEW_LINE>settings.setReloadOnSave(myHotReloadOnSaveCheckBox.isSelected());<NEW_LINE>settings.setFormatCodeOnSave(myFormatCodeOnSaveCheckBox.isSelected());<NEW_LINE>settings.setOrganizeImportsOnSave(myOrganizeImportsOnSaveCheckBox.isSelected());<NEW_LINE>settings.setShowBuildMethodGuides(myShowBuildMethodGuides.isSelected());<NEW_LINE>settings.setShowClosingLabels(myShowClosingLabels.isSelected());<NEW_LINE>settings.setShowStructuredErrors(myShowStructuredErrors.isSelected());<NEW_LINE>settings.setIncludeAllStackTraces(myIncludeAllStackTraces.isSelected());<NEW_LINE>settings.setOpenInspectorOnAppLaunch(myOpenInspectorOnAppLaunchCheckBox.isSelected());<NEW_LINE>settings.setVerboseLogging(myEnableVerboseLoggingCheckBox.isSelected());<NEW_LINE>settings.setSyncingAndroidLibraries(mySyncAndroidLibrariesCheckBox.isSelected());<NEW_LINE>settings.setEnableHotUi(myEnableHotUiCheckBox.isSelected());<NEW_LINE>settings.setEnableEmbeddedBrowsers(myEnableEmbeddedBrowsersCheckBox.isSelected());<NEW_LINE>settings.setEnableBazelHotRestart(myEnableBazelHotRestartCheckBox.isSelected());<NEW_LINE>settings.setAllowTestsInSourcesRoot(myAllowTestsInSourcesRoot.isSelected());<NEW_LINE>settings.setShowAllRunConfigurationsInContext(myShowAllRunConfigurationsInContextCheckBox.isSelected());<NEW_LINE>settings.setFontPackages(myFontPackagesTextArea.getText());<NEW_LINE>// because we rely on remembering initial state<NEW_LINE>reset();<NEW_LINE>checkFontPackages(settings.getFontPackages(), oldFontPackages);<NEW_LINE>} | FlutterSdkUtil.getErrorMessageIfWrongSdkRootPath(getSdkPathText()); |
1,634,547 | public void beforeRequest(Request<?> request) {<NEW_LINE>request.addHeader("x-amz-glacier-version", "2012-06-01");<NEW_LINE>// "x-amz-content-sha256" header is required for sig v4 for some streaming operations<NEW_LINE>request.addHeader("x-amz-content-sha256", "required");<NEW_LINE>if (request.getOriginalRequest() instanceof UploadArchiveRequest) {<NEW_LINE>String contentLength = request.getHeaders().remove("x-amz-content-length");<NEW_LINE>if (contentLength != null) {<NEW_LINE>request.getHeaders(<MASK><NEW_LINE>}<NEW_LINE>} else if (request.getOriginalRequest() instanceof UploadMultipartPartRequest) {<NEW_LINE>String range = request.getHeaders().get("Content-Range");<NEW_LINE>if (range.startsWith("bytes="))<NEW_LINE>range = range.substring(6);<NEW_LINE>if (range.startsWith("bytes "))<NEW_LINE>range = range.substring(6);<NEW_LINE>if (range != null) {<NEW_LINE>String start = range.substring(0, range.indexOf('-'));<NEW_LINE>String end = range.substring(range.indexOf('-') + 1);<NEW_LINE>if (end.contains("/")) {<NEW_LINE>end = end.substring(0, end.indexOf("/"));<NEW_LINE>}<NEW_LINE>long contentLength = Long.parseLong(end) - Long.parseLong(start) + 1;<NEW_LINE>request.getHeaders().put("Content-Length", Long.toString(contentLength));<NEW_LINE>}<NEW_LINE>} else if (request.getOriginalRequest() instanceof GetJobOutputRequest || request.getOriginalRequest() instanceof DescribeJobRequest) {<NEW_LINE>String resourcePath = request.getResourcePath();<NEW_LINE>if (resourcePath != null) {<NEW_LINE>String newResourcePath = resourcePath.replace("{jobType}", "archive-retrievals");<NEW_LINE>request.setResourcePath(newResourcePath);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | ).put("Content-Length", contentLength); |
1,312,201 | public SegmentCompletionProtocol.Response segmentCommitEnd(SegmentCompletionProtocol.Request.Params reqParams, boolean success, boolean isSplitCommit, CommittingSegmentDescriptor committingSegmentDescriptor) {<NEW_LINE>final String segmentNameStr = reqParams.getSegmentName();<NEW_LINE>final LLCSegmentName segmentName = new LLCSegmentName(segmentNameStr);<NEW_LINE>final String tableName = segmentName.getTableName();<NEW_LINE>if (!isLeader(tableName) || !_helixManager.isConnected()) {<NEW_LINE>return SegmentCompletionProtocol.RESP_NOT_LEADER;<NEW_LINE>}<NEW_LINE>SegmentCompletionFSM fsm = null;<NEW_LINE>SegmentCompletionProtocol.Response response = SegmentCompletionProtocol.RESP_FAILED;<NEW_LINE>try {<NEW_LINE>fsm = lookupOrCreateFsm(segmentName, SegmentCompletionProtocol.MSG_TYPE_COMMIT);<NEW_LINE>response = fsm.segmentCommitEnd(<MASK><NEW_LINE>} catch (Exception e) {<NEW_LINE>LOGGER.error("Caught exception in segmentCommitEnd for segment {}", segmentNameStr, e);<NEW_LINE>}<NEW_LINE>if (fsm != null && fsm.isDone()) {<NEW_LINE>LOGGER.info("Removing FSM (if present):{}", fsm.toString());<NEW_LINE>_fsmMap.remove(segmentNameStr);<NEW_LINE>}<NEW_LINE>return response;<NEW_LINE>} | reqParams, success, isSplitCommit, committingSegmentDescriptor); |
673,707 | static Status[] fromWmiPrinterStatus(int bitwiseCode, String printer) {<NEW_LINE>int[] rawCodes = ByteUtilities.unwind(bitwiseCode);<NEW_LINE>// WmiPrinterStatusMap has an explicit 0x00000000 = OK, so we'll need to shim that<NEW_LINE>if (rawCodes.length == 0) {<NEW_LINE>rawCodes = new int[] { (Integer) <MASK><NEW_LINE>}<NEW_LINE>NativePrinterStatus[] parentCodes = new NativePrinterStatus[rawCodes.length];<NEW_LINE>for (int i = 0; i < rawCodes.length; i++) {<NEW_LINE>parentCodes[i] = WmiPrinterStatusMap.match(rawCodes[i]);<NEW_LINE>}<NEW_LINE>Status[] statusArray = new Status[rawCodes.length];<NEW_LINE>for (int i = 0; i < rawCodes.length; i++) {<NEW_LINE>statusArray[i] = new Status(parentCodes[i], printer, rawCodes[i]);<NEW_LINE>}<NEW_LINE>return statusArray;<NEW_LINE>} | WmiPrinterStatusMap.OK.getRawCode() }; |
474,924 | public String[] listFiles(URI fileUri, boolean recursive) throws IOException {<NEW_LINE>try {<NEW_LINE>ImmutableList.Builder<String> builder = ImmutableList.builder();<NEW_LINE>String continuationToken = null;<NEW_LINE>boolean isDone = false;<NEW_LINE>String prefix = normalizeToDirectoryPrefix(fileUri);<NEW_LINE>while (!isDone) {<NEW_LINE>ListObjectsV2Request.Builder listObjectsV2RequestBuilder = ListObjectsV2Request.builder().bucket(fileUri.getHost());<NEW_LINE>if (!prefix.equals(DELIMITER)) {<NEW_LINE>listObjectsV2RequestBuilder = listObjectsV2RequestBuilder.prefix(prefix);<NEW_LINE>}<NEW_LINE>if (!recursive) {<NEW_LINE>listObjectsV2RequestBuilder = listObjectsV2RequestBuilder.delimiter(DELIMITER);<NEW_LINE>}<NEW_LINE>if (continuationToken != null) {<NEW_LINE>listObjectsV2RequestBuilder.continuationToken(continuationToken);<NEW_LINE>}<NEW_LINE>ListObjectsV2Request listObjectsV2Request = listObjectsV2RequestBuilder.build();<NEW_LINE>LOGGER.debug("Trying to send ListObjectsV2Request {}", listObjectsV2Request);<NEW_LINE>ListObjectsV2Response listObjectsV2Response = _s3Client.listObjectsV2(listObjectsV2Request);<NEW_LINE>LOGGER.debug("Getting ListObjectsV2Response: {}", listObjectsV2Response);<NEW_LINE>List<S3Object> filesReturned = listObjectsV2Response.contents();<NEW_LINE>filesReturned.stream().forEach(object -> {<NEW_LINE>// Only add files and not directories<NEW_LINE>if (!object.key().equals(fileUri.getPath()) && !object.key().endsWith(DELIMITER)) {<NEW_LINE>String fileKey = object.key();<NEW_LINE>if (fileKey.startsWith(DELIMITER)) {<NEW_LINE>fileKey = fileKey.substring(1);<NEW_LINE>}<NEW_LINE>builder.add(S3_SCHEME + fileUri.getHost() + DELIMITER + fileKey);<NEW_LINE>}<NEW_LINE>});<NEW_LINE><MASK><NEW_LINE>continuationToken = listObjectsV2Response.nextContinuationToken();<NEW_LINE>}<NEW_LINE>String[] listedFiles = builder.build().toArray(new String[0]);<NEW_LINE>LOGGER.info("Listed {} files from URI: {}, is recursive: {}", listedFiles.length, fileUri, recursive);<NEW_LINE>return listedFiles;<NEW_LINE>} catch (Throwable t) {<NEW_LINE>throw new IOException(t);<NEW_LINE>}<NEW_LINE>} | isDone = !listObjectsV2Response.isTruncated(); |
1,446,069 | public void triggerNewExtendedData(DatabaseSession session, NotificationsManager notificationsManager, final BimServer bimServer, String siteAddress, Project project, final long roid, Trigger trigger, final Service service) throws UserException, ServerException {<NEW_LINE>if (service.getTrigger() == trigger) {<NEW_LINE>Channel channel = null;<NEW_LINE>try {<NEW_LINE>channel = notificationsManager.getChannel(service);<NEW_LINE>final RemoteServiceInterface remoteServiceInterface = channel.get(RemoteServiceInterface.class);<NEW_LINE>long writeProjectPoid = service.getWriteRevision() == null ? -1 : service.getWriteRevision().getOid();<NEW_LINE>long writeExtendedDataRoid = service.getWriteExtendedData() != null ? roid : -1;<NEW_LINE>long readRevisionRoid = service.isReadRevision() ? roid : -1;<NEW_LINE>long readExtendedDataRoid = service.getReadExtendedData(<MASK><NEW_LINE>final ExplicitRightsAuthorization authorization = new ExplicitRightsAuthorization(bimServer, service.getUser().getOid(), service.getOid(), new long[] { readRevisionRoid }, writeProjectPoid, readExtendedDataRoid, writeExtendedDataRoid);<NEW_LINE>ServiceInterface newService = bimServer.getServiceFactory().get(authorization, AccessMethod.INTERNAL).get(ServiceInterface.class);<NEW_LINE>// TODO redundant?<NEW_LINE>((org.bimserver.webservices.impl.ServiceImpl) newService).setAuthorization(authorization);<NEW_LINE>AsyncRemoteServiceInterface asyncRemoteServiceInterface = new AsyncRemoteServiceInterface(remoteServiceInterface, bimServer.getExecutorService());<NEW_LINE>asyncRemoteServiceInterface.newExtendedDataOnRevision(poid, roid, edid, soid, service.getServiceIdentifier(), service.getProfileIdentifier(), service.getToken(), authorization.asHexToken(bimServer.getEncryptionKey()), bimServer.getServerSettingsCache().getServerSettings().getSiteAddress(), new NewExtendedDataOnRevisionCallback() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void success() {<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void error(Throwable e) {<NEW_LINE>LOGGER.error("", e);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>asyncRemoteServiceInterface.newRevision(poid, roid, service.getOid(), service.getServiceIdentifier(), service.getProfileIdentifier(), service.getToken(), authorization.asHexToken(bimServer.getEncryptionKey()), bimServer.getServerSettingsCache().getServerSettings().getSiteAddress(), new NewRevisionCallback() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void success() {<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void error(Throwable e) {<NEW_LINE>LOGGER.error("", e);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} catch (ChannelConnectionException e) {<NEW_LINE>LOGGER.error("", e);<NEW_LINE>} catch (PublicInterfaceNotFoundException e) {<NEW_LINE>LOGGER.error("", e);<NEW_LINE>} finally {<NEW_LINE>if (channel != null) {<NEW_LINE>// TODO This is interesting, when sending async, is this not going to break?<NEW_LINE>channel.disconnect();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | ) != null ? roid : -1; |
1,403,932 | private void updateExportsPropertyAssignment(Node getpropNode, NodeTraversal t) {<NEW_LINE>if (!currentScript.isModule) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>Node parent = getpropNode.getParent();<NEW_LINE>checkState(parent.isAssign() || parent.isExprResult(), parent);<NEW_LINE>// Update "exports.foo = Foo" to "module$exports$pkg$Foo.foo = Foo";<NEW_LINE>Node exportsNameNode = getpropNode.getFirstChild();<NEW_LINE>checkState(exportsNameNode.getString().equals("exports"));<NEW_LINE>String exportedNamespace = currentScript.getExportedNamespace();<NEW_LINE>safeSetMaybeQualifiedString(exportsNameNode, exportedNamespace, /* isModuleNamespace= */<NEW_LINE>false);<NEW_LINE>Node jsdocNode = parent.isAssign() ? parent : getpropNode;<NEW_LINE>markConstAndCopyJsDoc(jsdocNode, jsdocNode);<NEW_LINE>// When seeing the first "exports.foo = ..." line put a "var module$exports$pkg$Foo = {};"<NEW_LINE>// before it.<NEW_LINE>if (!currentScript.hasCreatedExportObject) {<NEW_LINE>exportTheEmptyBinaryNamespaceAt(NodeUtil.getEnclosingStatement(parent<MASK><NEW_LINE>}<NEW_LINE>} | ), AddAt.BEFORE, t); |
648,473 | public static double[][] covariance(double[][] x, double[] meanVector, boolean isAlongRows, int[] indicesOfX) {<NEW_LINE>int numObservations;<NEW_LINE>int dimension;<NEW_LINE>int i;<NEW_LINE>double[][] cov = null;<NEW_LINE>double[][] tmpMatrix = null;<NEW_LINE>double[][] zeroMean = null;<NEW_LINE>double[][] zeroMeanTranspoze = null;<NEW_LINE>if (x != null && meanVector != null) {<NEW_LINE>if (isAlongRows) {<NEW_LINE>for (i = 0; i < indicesOfX.length; i++) assert meanVector.length == x[indicesOfX[i]].length;<NEW_LINE>numObservations = indicesOfX.length;<NEW_LINE>dimension = x[indicesOfX[0]].length;<NEW_LINE>cov = new double[dimension][dimension];<NEW_LINE>tmpMatrix = new double[dimension][dimension];<NEW_LINE>zeroMean = new double[dimension][1];<NEW_LINE>double[] tmpVector;<NEW_LINE>for (i = 0; i < dimension; i++) Arrays.fill<MASK><NEW_LINE>for (i = 0; i < numObservations; i++) {<NEW_LINE>tmpVector = subtract(x[indicesOfX[i]], meanVector);<NEW_LINE>zeroMean = transpoze(tmpVector);<NEW_LINE>zeroMeanTranspoze = transpoze(zeroMean);<NEW_LINE>tmpMatrix = matrixProduct(zeroMean, zeroMeanTranspoze);<NEW_LINE>cov = add(cov, tmpMatrix);<NEW_LINE>}<NEW_LINE>cov = divide(cov, numObservations - 1);<NEW_LINE>} else {<NEW_LINE>assert meanVector.length == x.length;<NEW_LINE>numObservations = indicesOfX.length;<NEW_LINE>for (i = 1; i < indicesOfX.length; i++) assert x[indicesOfX[i]].length == x[indicesOfX[0]].length;<NEW_LINE>dimension = x.length;<NEW_LINE>cov = transpoze(covariance(transpoze(x), meanVector, true, indicesOfX));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return cov;<NEW_LINE>} | (cov[i], 0.0); |
1,310,075 | private void doDelete(HttpEntity<String> entity) {<NEW_LINE>AgentResponse rsp = null;<NEW_LINE>DeleteCmd cmd = JSONObjectUtil.toObject(entity.getBody(), DeleteCmd.class);<NEW_LINE>if (!config.deleteSuccess) {<NEW_LINE>rsp = new AgentResponse();<NEW_LINE>rsp.setError("Fail delete on purpose");<NEW_LINE>rsp.setSuccess(false);<NEW_LINE>} else {<NEW_LINE><MASK><NEW_LINE>logger.debug(String.format("Deleted %s", cmd.getInstallUrl()));<NEW_LINE>rsp = (AgentResponse) (new DeleteResponse());<NEW_LINE>}<NEW_LINE>String taskUuid = entity.getHeaders().getFirst(RESTConstant.TASK_UUID);<NEW_LINE>String callbackUrl = entity.getHeaders().getFirst(RESTConstant.CALLBACK_URL);<NEW_LINE>String rspBody = JSONObjectUtil.toJsonString(rsp);<NEW_LINE>HttpHeaders headers = new HttpHeaders();<NEW_LINE>headers.setContentType(MediaType.APPLICATION_JSON);<NEW_LINE>headers.setContentLength(rspBody.length());<NEW_LINE>headers.set(RESTConstant.TASK_UUID, taskUuid);<NEW_LINE>HttpEntity<String> rreq = new HttpEntity<String>(rspBody, headers);<NEW_LINE>restf.getRESTTemplate().exchange(callbackUrl, HttpMethod.POST, rreq, String.class);<NEW_LINE>} | config.deleteCmds.add(cmd); |
1,249,721 | public GetRuleGroupResult unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>GetRuleGroupResult getRuleGroupResult = new GetRuleGroupResult();<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 getRuleGroupResult;<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("RuleGroup", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>getRuleGroupResult.setRuleGroup(RuleGroupJsonUnmarshaller.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 getRuleGroupResult;<NEW_LINE>} | ().unmarshall(context)); |
1,021,428 | public static void runMain(IFindBugsEngine findBugs, TextUICommandLine commandLine) throws IOException {<NEW_LINE>boolean verbose = !commandLine.quiet();<NEW_LINE>try {<NEW_LINE>findBugs.execute();<NEW_LINE>} catch (InterruptedException e) {<NEW_LINE>// should not occur<NEW_LINE>assert false;<NEW_LINE>checkExitCodeFail(commandLine, e);<NEW_LINE>throw new RuntimeException(e);<NEW_LINE>} catch (RuntimeException | IOException e) {<NEW_LINE>checkExitCodeFail(commandLine, e);<NEW_LINE>throw e;<NEW_LINE>}<NEW_LINE>int bugCount = findBugs.getBugCount();<NEW_LINE>int missingClassCount = findBugs.getMissingClassCount();<NEW_LINE>int errorCount = findBugs.getErrorCount();<NEW_LINE>if (verbose || commandLine.setExitCode()) {<NEW_LINE>LOG.<MASK><NEW_LINE>LOG.log(FINE, "Missing classes: {0}", missingClassCount);<NEW_LINE>LOG.log(FINE, "Analysis errors: {0}", errorCount);<NEW_LINE>}<NEW_LINE>if (commandLine.setExitCode()) {<NEW_LINE>int exitCode = ExitCodes.from(errorCount, missingClassCount, bugCount);<NEW_LINE>System.exit(exitCode);<NEW_LINE>}<NEW_LINE>} | log(FINE, "Warnings generated: {0}", bugCount); |
436,499 | private void createEndpointExplorerButton() {<NEW_LINE>endpointExplorerButtonPanel = new JPanel(new BorderLayout());<NEW_LINE>endpointExplorerButtonPanel.setPreferredSize(new Dimension(130, 32));<NEW_LINE>endpointExplorerButtonPanel.setMaximumSize(new Dimension(130, 32));<NEW_LINE>endpointExplorerButton = new RoundButton(6);<NEW_LINE>endpointExplorerButton.setForeground(Color.WHITE);<NEW_LINE>endpointExplorerButton.setBackground(new Color<MASK><NEW_LINE>endpointExplorerButton.setText("Endpoint Explorer");<NEW_LINE>if (UISupport.isMac()) {<NEW_LINE>endpointExplorerButton.setOpaque(false);<NEW_LINE>}<NEW_LINE>EndpointExplorerAction action = new EndpointExplorerAction();<NEW_LINE>endpointExplorerButton.addActionListener(action);<NEW_LINE>endpointExplorerButton.addMouseListener(new MouseListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void mouseEntered(MouseEvent e) {<NEW_LINE>endpointExplorerButton.setBackground(new Color(39, 104, 158));<NEW_LINE>endpointExplorerButton.repaint();<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void mouseExited(MouseEvent e) {<NEW_LINE>endpointExplorerButton.setBackground(new Color(52, 137, 209));<NEW_LINE>endpointExplorerButton.repaint();<NEW_LINE>}<NEW_LINE><NEW_LINE>public void mouseClicked(MouseEvent e) {<NEW_LINE>}<NEW_LINE><NEW_LINE>public void mousePressed(MouseEvent e) {<NEW_LINE>}<NEW_LINE><NEW_LINE>public void mouseReleased(MouseEvent e) {<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} | (52, 137, 209)); |
1,797,285 | /* We're searching for something a bit too fiddly to use wildcards on,<NEW_LINE>* so lots of test casting :(<NEW_LINE>*/<NEW_LINE>private static boolean replacePreChangeAssignment(Op03SimpleStatement statement) {<NEW_LINE>AssignmentSimple assignmentSimple = (AssignmentSimple) statement.getStatement();<NEW_LINE>LValue lValue = assignmentSimple.getCreatedLValue();<NEW_LINE>// Is it an arithop<NEW_LINE>Expression rValue = assignmentSimple.getRValue();<NEW_LINE>if (!(rValue instanceof ArithmeticOperation))<NEW_LINE>return false;<NEW_LINE>// Which is a mutation<NEW_LINE>ArithmeticOperation arithmeticOperation = (ArithmeticOperation) rValue;<NEW_LINE>if (!arithmeticOperation.isMutationOf(lValue))<NEW_LINE>return false;<NEW_LINE>// Create an assignment prechange with the mutation<NEW_LINE>AbstractMutatingAssignmentExpression mutationOperation = arithmeticOperation.getMutationOf(lValue);<NEW_LINE>AssignmentPreMutation res = new AssignmentPreMutation(assignmentSimple.<MASK><NEW_LINE>statement.replaceStatement(res);<NEW_LINE>return true;<NEW_LINE>} | getLoc(), lValue, mutationOperation); |
1,764,202 | private void syncInstancesIfTimestampDiffers(String appName, String id, InstanceInfo info, InstanceInfo infoFromPeer) {<NEW_LINE>try {<NEW_LINE>if (infoFromPeer != null) {<NEW_LINE>logger.warn("Peer wants us to take the instance information from it, since the timestamp differs," + "Id : {} My Timestamp : {}, Peer's timestamp: {}", id, info.getLastDirtyTimestamp(), infoFromPeer.getLastDirtyTimestamp());<NEW_LINE>if (infoFromPeer.getOverriddenStatus() != null && !InstanceStatus.UNKNOWN.equals(infoFromPeer.getOverriddenStatus())) {<NEW_LINE>logger.warn("Overridden Status info -id {}, mine {}, peer's {}", id, info.getOverriddenStatus(), infoFromPeer.getOverriddenStatus());<NEW_LINE>registry.storeOverriddenStatusIfRequired(appName, <MASK><NEW_LINE>}<NEW_LINE>registry.register(infoFromPeer, true);<NEW_LINE>}<NEW_LINE>} catch (Throwable e) {<NEW_LINE>logger.warn("Exception when trying to set information from peer :", e);<NEW_LINE>}<NEW_LINE>} | id, infoFromPeer.getOverriddenStatus()); |
1,755,701 | public boolean convert() throws Exception {<NEW_LINE>String segmentName = _originalSegmentMetadata.getName();<NEW_LINE>LOGGER.info("Start converting segment: {} in table: {}", segmentName, _rawTableName);<NEW_LINE>List<FieldSpec> columnsToConvert = new ArrayList<>();<NEW_LINE>Schema schema = _originalSegmentMetadata.getSchema();<NEW_LINE>if (_columnsToConvert == null) {<NEW_LINE>LOGGER.info("Columns to convert are not specified, check each metric column");<NEW_LINE>for (MetricFieldSpec metricFieldSpec : schema.getMetricFieldSpecs()) {<NEW_LINE>if (_originalSegmentMetadata.getColumnMetadataFor(metricFieldSpec.getName()).hasDictionary() && shouldConvertColumn(metricFieldSpec)) {<NEW_LINE>columnsToConvert.add(metricFieldSpec);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE><MASK><NEW_LINE>for (String columnToConvert : StringUtils.split(_columnsToConvert, ',')) {<NEW_LINE>FieldSpec fieldSpec = schema.getFieldSpecFor(columnToConvert);<NEW_LINE>if (fieldSpec == null) {<NEW_LINE>LOGGER.warn("Skip converting column: {} because is does not exist in the schema", columnsToConvert);<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (!fieldSpec.isSingleValueField()) {<NEW_LINE>LOGGER.warn("Skip converting column: {} because it's a multi-value column", columnsToConvert);<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (!_originalSegmentMetadata.getColumnMetadataFor(columnToConvert).hasDictionary()) {<NEW_LINE>LOGGER.warn("Skip converting column: {} because its index is not dictionary-based", columnsToConvert);<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>columnsToConvert.add(fieldSpec);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (columnsToConvert.isEmpty()) {<NEW_LINE>LOGGER.info("No column converted for segment: {} in table: {}", segmentName, _rawTableName);<NEW_LINE>return false;<NEW_LINE>} else {<NEW_LINE>// Convert columns<NEW_LINE>for (FieldSpec columnToConvert : columnsToConvert) {<NEW_LINE>convertColumn(columnToConvert);<NEW_LINE>}<NEW_LINE>_convertedProperties.save();<NEW_LINE>// Update creation metadata with new computed CRC and original segment creation time<NEW_LINE>SegmentIndexCreationDriverImpl.persistCreationMeta(_convertedIndexDir, CrcUtils.forAllFilesInFolder(_convertedIndexDir).computeCrc(), _originalSegmentMetadata.getIndexCreationTime());<NEW_LINE>LOGGER.info("{} columns converted for segment: {} in table: {}", columnsToConvert.size(), segmentName, _rawTableName);<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>} | LOGGER.info("Columns to convert: {}", _columnsToConvert); |
306,722 | public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {<NEW_LINE>View root = inflater.inflate(R.layout.simple_list_fragment, container, false);<NEW_LINE>Toolbar toolbar = root.findViewById(R.id.toolbar);<NEW_LINE>toolbar.setVisibility(View.GONE);<NEW_LINE>recyclerView = root.findViewById(R.id.recyclerView);<NEW_LINE>recyclerView.setRecycledViewPool(((MainActivity) getActivity()).getRecycledViewPool());<NEW_LINE>adapter = new CompletedDownloadsListAdapter((MainActivity) getActivity());<NEW_LINE>adapter.setOnSelectModeListener(this);<NEW_LINE>recyclerView.setAdapter(adapter);<NEW_LINE>progressBar = root.findViewById(R.id.progLoading);<NEW_LINE>speedDialView = root.findViewById(R.id.fabSD);<NEW_LINE>speedDialView.setOverlayLayout(root.findViewById<MASK><NEW_LINE>speedDialView.inflate(R.menu.episodes_apply_action_speeddial);<NEW_LINE>speedDialView.removeActionItemById(R.id.download_batch);<NEW_LINE>speedDialView.removeActionItemById(R.id.mark_read_batch);<NEW_LINE>speedDialView.removeActionItemById(R.id.mark_unread_batch);<NEW_LINE>speedDialView.removeActionItemById(R.id.remove_from_queue_batch);<NEW_LINE>speedDialView.setOnChangeListener(new SpeedDialView.OnChangeListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public boolean onMainActionSelected() {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onToggleChanged(boolean open) {<NEW_LINE>if (open && adapter.getSelectedCount() == 0) {<NEW_LINE>((MainActivity) getActivity()).showSnackbarAbovePlayer(R.string.no_items_selected, Snackbar.LENGTH_SHORT);<NEW_LINE>speedDialView.close();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>speedDialView.setOnActionSelectedListener(actionItem -> {<NEW_LINE>new EpisodeMultiSelectActionHandler(((MainActivity) getActivity()), adapter.getSelectedItems()).handleAction(actionItem.getId());<NEW_LINE>adapter.endSelectMode();<NEW_LINE>return true;<NEW_LINE>});<NEW_LINE>addEmptyView();<NEW_LINE>EventBus.getDefault().register(this);<NEW_LINE>return root;<NEW_LINE>} | (R.id.fabSDOverlay)); |
473,269 | final CreateThingTypeResult executeCreateThingType(CreateThingTypeRequest createThingTypeRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(createThingTypeRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<CreateThingTypeRequest> request = null;<NEW_LINE>Response<CreateThingTypeResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new CreateThingTypeRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(createThingTypeRequest));<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");<NEW_LINE>request.<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<CreateThingTypeResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new CreateThingTypeResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | addHandlerContext(HandlerContextKey.OPERATION_NAME, "CreateThingType"); |
1,709,289 | public static void showAbout(Shell shell, Analytics analytics, Widgets widgets) {<NEW_LINE>analytics.postInteraction(View.About, ClientAction.Show);<NEW_LINE>new DialogBase(shell, widgets.theme) {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public String getTitle() {<NEW_LINE>return Messages.ABOUT_TITLE;<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>protected Control createDialogArea(Composite parent) {<NEW_LINE>Composite area = (Composite) super.createDialogArea(parent);<NEW_LINE>Composite container = createComposite(area, withMargin(new GridLayout(2, false), 20, 5));<NEW_LINE>container.setLayoutData(new GridData(SWT.CENTER, SWT.FILL, true, false));<NEW_LINE>Label logo = createLabel(container, "", theme.dialogLogo());<NEW_LINE>logo.setLayoutData(new GridData(SWT.CENTER, SWT.FILL, true<MASK><NEW_LINE>StyledText title = createSelectableLabel(container, Messages.WINDOW_TITLE);<NEW_LINE>title.setFont(theme.bigBoldFont());<NEW_LINE>title.setLayoutData(new GridData(SWT.CENTER, SWT.FILL, true, false, 2, 1));<NEW_LINE>createLabel(container, "").setLayoutData(new GridData(SWT.CENTER, SWT.FILL, true, true, 2, 1));<NEW_LINE>Button clipboard = Widgets.createButton(container, "", e -> {<NEW_LINE>String textData = "Version " + GAPID_VERSION.toStringWithYear(true);<NEW_LINE>widgets.copypaste.setContents(textData);<NEW_LINE>});<NEW_LINE>clipboard.setImage(theme.clipboard());<NEW_LINE>clipboard.setLayoutData(new GridData(SWT.CENTER, SWT.BEGINNING, true, true, 1, 3));<NEW_LINE>createSelectableLabel(container, "Version " + GAPID_VERSION.toStringWithYear(true));<NEW_LINE>createSelectableLabel(container, "Server: " + Info.getServerName() + ", Version: " + Info.getServerVersion());<NEW_LINE>createSelectableLabel(container, Messages.ABOUT_COPY);<NEW_LINE>return area;<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>protected void createButtonsForButtonBar(Composite parent) {<NEW_LINE>createButton(parent, IDialogConstants.OK_ID, IDialogConstants.OK_LABEL, true);<NEW_LINE>}<NEW_LINE>}.open();<NEW_LINE>} | , false, 2, 1)); |
1,170,102 | public void initialise(double[] lowerCutOffsInHzIn, double[] upperCutOffsInHzIn, double overlapAround1000HzIn) {<NEW_LINE>normalizationFilterTransformedIR = null;<NEW_LINE>if (lowerCutOffsInHzIn != null && upperCutOffsInHzIn != null) {<NEW_LINE>assert lowerCutOffsInHzIn.length == upperCutOffsInHzIn.length;<NEW_LINE>lowerCutOffsInHz = new double[lowerCutOffsInHzIn.length];<NEW_LINE>upperCutOffsInHz = new double[upperCutOffsInHzIn.length];<NEW_LINE>System.arraycopy(lowerCutOffsInHzIn, 0, lowerCutOffsInHz, 0, lowerCutOffsInHzIn.length);<NEW_LINE>System.arraycopy(upperCutOffsInHzIn, 0, upperCutOffsInHz, 0, upperCutOffsInHzIn.length);<NEW_LINE>int i;<NEW_LINE>filters = new FIRFilter[lowerCutOffsInHz.length];<NEW_LINE>int filterOrder = SignalProcUtils.getFIRFilterOrder(samplingRateInHz);<NEW_LINE>double normalizedLowerCutoff;<NEW_LINE>double normalizedUpperCutoff;<NEW_LINE>overlapAround1000Hz = overlapAround1000HzIn;<NEW_LINE>for (i = 0; i < lowerCutOffsInHz.length; i++) assert lowerCutOffsInHz[i] < upperCutOffsInHz[i];<NEW_LINE>for (i = 0; i < lowerCutOffsInHz.length; i++) {<NEW_LINE>if (lowerCutOffsInHz[i] <= 0.0) {<NEW_LINE>normalizedUpperCutoff = Math.min(upperCutOffsInHz[i] / samplingRateInHz, 0.5);<NEW_LINE>normalizedUpperCutoff = Math.max(normalizedUpperCutoff, 0.0);<NEW_LINE>filters[i] = new LowPassFilter(normalizedUpperCutoff, filterOrder);<NEW_LINE>} else if (upperCutOffsInHz[i] >= 0.5 * samplingRateInHz) {<NEW_LINE>normalizedLowerCutoff = Math.max(lowerCutOffsInHz[i] / samplingRateInHz, 0.0);<NEW_LINE>normalizedLowerCutoff = Math.min(normalizedLowerCutoff, 0.5);<NEW_LINE>filters[i] = new HighPassFilter(normalizedLowerCutoff, filterOrder);<NEW_LINE>} else {<NEW_LINE>normalizedLowerCutoff = Math.max(lowerCutOffsInHz[i] / samplingRateInHz, 0.0);<NEW_LINE>normalizedLowerCutoff = Math.min(normalizedLowerCutoff, 0.5);<NEW_LINE>normalizedUpperCutoff = Math.min(upperCutOffsInHz[i] / samplingRateInHz, 0.5);<NEW_LINE>normalizedUpperCutoff = Math.max(normalizedUpperCutoff, 0.0);<NEW_LINE>assert normalizedLowerCutoff < normalizedUpperCutoff;<NEW_LINE>filters[i] = new BandPassFilter(normalizedLowerCutoff, normalizedUpperCutoff, filterOrder);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>int maxFreq = filters[0].transformedIR.length / 2 + 1;<NEW_LINE>// Estimate a smooth gain normalization filter<NEW_LINE>normalizationFilterTransformedIR = new double[maxFreq];<NEW_LINE><MASK><NEW_LINE>int j;<NEW_LINE>for (i = 0; i < filters.length; i++) {<NEW_LINE>normalizationFilterTransformedIR[0] += Math.abs(filters[i].transformedIR[0]);<NEW_LINE>normalizationFilterTransformedIR[maxFreq - 1] += Math.abs(filters[i].transformedIR[1]);<NEW_LINE>for (j = 1; j < maxFreq - 1; j++) normalizationFilterTransformedIR[j] += Math.sqrt(filters[i].transformedIR[2 * j] * filters[i].transformedIR[2 * j] + filters[i].transformedIR[2 * j + 1] * filters[i].transformedIR[2 * j + 1]);<NEW_LINE>}<NEW_LINE>for (j = 0; j < maxFreq; j++) normalizationFilterTransformedIR[j] = 1.0 / normalizationFilterTransformedIR[j];<NEW_LINE>// MaryUtils.plot(normalizationFilterTransformedIR, "Normalization filter");<NEW_LINE>//<NEW_LINE>}<NEW_LINE>} | Arrays.fill(normalizationFilterTransformedIR, 0.0); |
1,090,648 | public void jdwpProcessOccurred(ADBDevice device, Set<String> id) {<NEW_LINE>List<ADB.Process> procs;<NEW_LINE>try {<NEW_LINE>Thread.sleep(40);<NEW_LINE>procs = device.getProcessList();<NEW_LINE>} catch (Exception e) {<NEW_LINE>LOG.error("Failed to get device process list", e);<NEW_LINE>procs = Collections.emptyList();<NEW_LINE>}<NEW_LINE>List<String> procList = new ArrayList<>(id.size());<NEW_LINE>if (procs.size() == 0) {<NEW_LINE>procList.addAll(id);<NEW_LINE>} else {<NEW_LINE>for (ADB.Process proc : procs) {<NEW_LINE>if (id.contains(proc.pid)) {<NEW_LINE>procList.add(String.format("[pid: %-6s] %s", proc.pid, proc.name));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>Collections.reverse(procList);<NEW_LINE>DeviceNode node;<NEW_LINE>try {<NEW_LINE>node = getDeviceNode(device);<NEW_LINE>} catch (Exception e) {<NEW_LINE>LOG.error("Failed to find device", e);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>node.tNode.removeAllChildren();<NEW_LINE>DefaultMutableTreeNode tempNode = null;<NEW_LINE>for (String s : procList) {<NEW_LINE><MASK><NEW_LINE>node.tNode.add(pnode);<NEW_LINE>if (!debugSetter.expectPkg.isEmpty() && s.endsWith(debugSetter.expectPkg)) {<NEW_LINE>if (debugSetter.autoAttachPkg && debugSetter.device.equals(node.device)) {<NEW_LINE>debugSetter.set(node.device, debugSetter.ver, getPid(s), s);<NEW_LINE>if (attachProcess(mainWindow)) {<NEW_LINE>dispose();<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>tempNode = pnode;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>DefaultMutableTreeNode theNode = tempNode;<NEW_LINE>SwingUtilities.invokeLater(() -> {<NEW_LINE>procTreeModel.reload(node.tNode);<NEW_LINE>procTree.expandPath(new TreePath(node.tNode.getPath()));<NEW_LINE>if (theNode != null) {<NEW_LINE>TreePath thePath = new TreePath(theNode.getPath());<NEW_LINE>procTree.scrollPathToVisible(thePath);<NEW_LINE>procTree.setSelectionPath(thePath);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} | DefaultMutableTreeNode pnode = new DefaultMutableTreeNode(s); |
1,016,707 | public void testNoCustomContext() throws Exception {<NEW_LINE>// for issue<NEW_LINE>Log.info(c, "testNoCustomContext", "Entering test testNoCustomContext");<NEW_LINE>// Checking that these are correctly logged in the trace<NEW_LINE>// We were setting the wrong defaults -- bad maxpool and preferred pool size<NEW_LINE>String tr = "InitPoolSize: 1";<NEW_LINE>List<String> errMsgs = server.findStringsInLogsAndTrace(tr);<NEW_LINE>assertFalse("Should have found, " + tr, errMsgs.isEmpty());<NEW_LINE>tr = "MaxPoolSize: 0";<NEW_LINE>errMsgs = server.findStringsInLogsAndTrace(tr);<NEW_LINE>assertFalse("Should have found, " + tr, errMsgs.isEmpty());<NEW_LINE>tr = "PrefPoolSize: 3";<NEW_LINE><MASK><NEW_LINE>assertFalse("Should have found, " + tr, errMsgs.isEmpty());<NEW_LINE>tr = "PoolTimeOut: 0";<NEW_LINE>errMsgs = server.findStringsInLogsAndTrace(tr);<NEW_LINE>assertFalse("Should have found, " + tr, errMsgs.isEmpty());<NEW_LINE>tr = "PoolWaitTime: 3000";<NEW_LINE>errMsgs = server.findStringsInLogsAndTrace(tr);<NEW_LINE>assertFalse("Should have found, " + tr, errMsgs.isEmpty());<NEW_LINE>Log.info(c, "testCustomContextNoConfig", "Check cache config timeouts");<NEW_LINE>tr = "CacheTimeOut: 1200000";<NEW_LINE>errMsgs = server.findStringsInLogsAndTrace(tr);<NEW_LINE>assertFalse("Should have found, " + tr, errMsgs.isEmpty());<NEW_LINE>assertEquals("Should have found 2 entries -- attributes and search cache, " + tr, 2, errMsgs.size());<NEW_LINE>tr = "CacheSize: 4000";<NEW_LINE>errMsgs = server.findStringsInLogsAndTrace(tr);<NEW_LINE>assertFalse("Should have found, " + tr, errMsgs.isEmpty());<NEW_LINE>tr = "CacheSizeLimit: 2000";<NEW_LINE>errMsgs = server.findStringsInLogsAndTrace(tr);<NEW_LINE>assertFalse("Should have found, " + tr, errMsgs.isEmpty());<NEW_LINE>tr = "CacheSize: 2000";<NEW_LINE>errMsgs = server.findStringsInLogsAndTrace(tr);<NEW_LINE>assertFalse("Should have found, " + tr, errMsgs.isEmpty());<NEW_LINE>tr = "CacheResultSizeLimit: 2000";<NEW_LINE>errMsgs = server.findStringsInLogsAndTrace(tr);<NEW_LINE>assertFalse("Should have found, " + tr, errMsgs.isEmpty());<NEW_LINE>} | errMsgs = server.findStringsInLogsAndTrace(tr); |
1,425,352 | public void testParkNonDissociatableSharableHandle() throws Exception {<NEW_LINE>// creates sharable connections<NEW_LINE>DataSource ds = (DataSource) InitialContext.doLookup("eis/ds5");<NEW_LINE>// On another thread, use a sharable connection in a transaction, commit the transaction and wait<NEW_LINE>CountDownLatch transactionCommitted = new CountDownLatch(1);<NEW_LINE>CountDownLatch servletThreadDoneWithConnection = new CountDownLatch(1);<NEW_LINE>ExecutorService executor = InitialContext.doLookup("java:comp/DefaultManagedExecutorService");<NEW_LINE>Future<?> future = executor.submit(() -> {<NEW_LINE>UserTransaction tx = InitialContext.doLookup("java:comp/UserTransaction");<NEW_LINE>tx.begin();<NEW_LINE>Connection con1 = ds.getConnection();<NEW_LINE>con1.createStatement().executeQuery("VALUES (51)").getStatement().close();<NEW_LINE>tx.commit();<NEW_LINE>transactionCommitted.countDown();<NEW_LINE>// Connection handle remains open, but should now be associated to the parking ManagedConnection.<NEW_LINE>// Remain in this state until allowed to continue.<NEW_LINE>assertTrue(servletThreadDoneWithConnection.await(TIMEOUT_NS, TimeUnit.NANOSECONDS));<NEW_LINE>// It would be possible to use the connection handle again here, if it weren't closed during the cleanup.<NEW_LINE>return null;<NEW_LINE>});<NEW_LINE>assertTrue(transactionCommitted.await(TIMEOUT_NS, TimeUnit.NANOSECONDS));<NEW_LINE>// At this point, the pool's single connection has been used on another thread, and hopefully freed up by<NEW_LINE>// parking the handle to the parking ManagedConnection. During this time, it should be possible to obtain<NEW_LINE>// the connection for use by the current thread:<NEW_LINE>UserTransaction tx = InitialContext.doLookup("java:comp/UserTransaction");<NEW_LINE>tx.begin();<NEW_LINE>try {<NEW_LINE>Connection con2 = ds.getConnection();<NEW_LINE>con2.createStatement().executeQuery("VALUES (52)")<MASK><NEW_LINE>con2.close();<NEW_LINE>} finally {<NEW_LINE>tx.commit();<NEW_LINE>}<NEW_LINE>servletThreadDoneWithConnection.countDown();<NEW_LINE>// Surface any errors that occurred on the other thread<NEW_LINE>future.get(TIMEOUT_NS, TimeUnit.NANOSECONDS);<NEW_LINE>} | .getStatement().close(); |
951,973 | public List<CaptionInfo> listCaptions(MediaFile video, String basePath, String externalUser, Instant externalExpiration) {<NEW_LINE>MetaData metaData = getVideoMetaData(video);<NEW_LINE>Stream<CaptionInfo> internalCaptions;<NEW_LINE>if (metaData == null || metaData.getSubtitleTracks().isEmpty()) {<NEW_LINE>internalCaptions = Stream.empty();<NEW_LINE>} else {<NEW_LINE>internalCaptions = metaData.getSubtitleTracks().stream().map(c -> new CaptionInfo(String.valueOf(c.getId()), CaptionInfo.Location.internal, getDisplayFormat(c.getCodec()), c.getLanguage(), getUrl(basePath, externalUser, externalExpiration, video.getId(), String.valueOf(c<MASK><NEW_LINE>}<NEW_LINE>Stream<CaptionInfo> externalCaptions = findExternalCaptionsForVideo(video).stream().map(c -> new // leaks internal structure for now<NEW_LINE>// leaks internal structure for now<NEW_LINE>CaptionInfo(c.toString(), CaptionInfo.Location.external, MoreFiles.getFileExtension(c), c.getFileName().toString(), getUrl(basePath, externalUser, externalExpiration, video.getId(), URLEncoder.encode(c.toString(), StandardCharsets.UTF_8))));<NEW_LINE>return Stream.concat(internalCaptions, externalCaptions).collect(Collectors.toList());<NEW_LINE>} | .getId())))); |
1,546,467 | public DataType toDataType() throws DuplicateNameException, IOException {<NEW_LINE>String nameEnd = rec_len + "_" + (extra == null ? "0" : extra.length);<NEW_LINE>Structure structure = new StructureDataType("ext4_dir_entry2_" + nameEnd, 0);<NEW_LINE>structure.add(DWORD, "inode", null);<NEW_LINE>structure.<MASK><NEW_LINE>structure.add(BYTE, "name_len", null);<NEW_LINE>structure.add(BYTE, "file_type", null);<NEW_LINE>if ((name_len & 0xff) > 0) {<NEW_LINE>structure.add(STRING, (name_len & 0xff), "name", null);<NEW_LINE>}<NEW_LINE>if (extra != null) {<NEW_LINE>structure.add(new ArrayDataType(BYTE, extra.length, BYTE.getLength()), "extra", null);<NEW_LINE>}<NEW_LINE>// if ( structure.getLength() != ( rec_len & 0xffff ) ) {<NEW_LINE>// System.out.println( "incorrect size!!" );<NEW_LINE>// }<NEW_LINE>return structure;<NEW_LINE>} | add(WORD, "rec_len", null); |
876,952 | private void checkQemuImgVersionInOtherClusters(KVMHostConnectedContext context, List<PrimaryStorageInventory> invs) {<NEW_LINE>String mine = KVMSystemTags.QEMU_IMG_VERSION.getTokenByResourceUuid(context.getInventory().getUuid(), KVMSystemTags.QEMU_IMG_VERSION_TOKEN);<NEW_LINE>final List<String> psUuids = CollectionUtils.transformToList(invs, new Function<String, PrimaryStorageInventory>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public String call(PrimaryStorageInventory arg) {<NEW_LINE>return arg.getUuid();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>List<String> otherHostUuids = new Callable<List<String>>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>@Transactional(readOnly = true)<NEW_LINE>public List<String> call() {<NEW_LINE>String sql = "select host.uuid from HostVO host, PrimaryStorageClusterRefVO ref where host.clusterUuid = ref.clusterUuid and ref.primaryStorageUuid in (:psUuids)";<NEW_LINE>TypedQuery<String> q = dbf.getEntityManager().<MASK><NEW_LINE>q.setParameter("psUuids", psUuids);<NEW_LINE>return q.getResultList();<NEW_LINE>}<NEW_LINE>}.call();<NEW_LINE>Map<String, List<String>> qemuTags = KVMSystemTags.QEMU_IMG_VERSION.getTags(otherHostUuids);<NEW_LINE>for (Entry<String, List<String>> e : qemuTags.entrySet()) {<NEW_LINE>String version = KVMSystemTags.QEMU_IMG_VERSION.getTokenByTag(e.getValue().get(0), KVMSystemTags.QEMU_IMG_VERSION_TOKEN);<NEW_LINE>if ((version.compareTo(QCOW3_QEMU_IMG_VERSION) >= 0 && mine.compareTo(QCOW3_QEMU_IMG_VERSION) < 0) || (version.compareTo(QCOW3_QEMU_IMG_VERSION) < 0 && mine.compareTo(QCOW3_QEMU_IMG_VERSION) >= 0)) {<NEW_LINE>ErrorCode err = operr("unable to attach a primary storage to cluster. Kvm host[uuid:%s, name:%s] in cluster has qemu-img " + "with version[%s]; but the primary storage has attached to a cluster that has kvm host[uuid:%s], which has qemu-img with " + "version[%s]. qemu-img version greater than %s is incompatible with versions less than %s, this will causes volume snapshot operation " + "to fail. Please avoid attaching a primary storage to clusters that have different Linux distributions, in order to prevent qemu-img version mismatch", context.getInventory().getUuid(), context.getInventory().getName(), mine, e.getKey(), version, QCOW3_QEMU_IMG_VERSION, QCOW3_QEMU_IMG_VERSION);<NEW_LINE>throw new OperationFailureException(err);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | createQuery(sql, String.class); |
932,173 | protected void renderHtmltoRet(String defaultTemplate, Map<String, Object> paras, Ret toRet) {<NEW_LINE>String render = getPara("render", "default");<NEW_LINE>Engine engine = RenderManager.me().getEngine();<NEW_LINE>Template template = TemplateManager.me().getCurrentTemplate();<NEW_LINE>if (paras != null && template != null) {<NEW_LINE>paras.put("TPATH", template.getRelativePath());<NEW_LINE>}<NEW_LINE>if ("default".equals(render)) {<NEW_LINE>String html = engine.getTemplate(defaultTemplate).renderToString(paras);<NEW_LINE>toRet.set("html", html);<NEW_LINE>} else {<NEW_LINE>if (template != null) {<NEW_LINE>String matchedHtml = template.matchView(render + ".html", isMobileBrowser());<NEW_LINE>if (matchedHtml != null) {<NEW_LINE>String html = engine.getTemplate(template.buildRelativePath(matchedHtml)).renderToString(paras);<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | toRet.set("html", html); |
1,642,087 | public void startRecording() throws Exception {<NEW_LINE>startAudioRecorder();<NEW_LINE>final short[] buffer = new short[mNumSamplesPerRead];<NEW_LINE>int numSamplesRead;<NEW_LINE>final AudioSourceListener listener = getAudioSourceListener();<NEW_LINE>final AudioEncoder pcmEncoder = new L16PcmEncoder();<NEW_LINE>try {<NEW_LINE>Log.v(TAG, "Starting record loop");<NEW_LINE>while (isInValidStateToContinueRecording()) {<NEW_LINE>// Make sure recorder is not null before recording.<NEW_LINE>if (mRecord == null) {<NEW_LINE>Log.e(TAG, "Recorder is null.");<NEW_LINE>throw new AudioSourceException("Recorder null");<NEW_LINE>}<NEW_LINE>// Buffer bytes to be sent to callback.<NEW_LINE>synchronized (mRecord) {<NEW_LINE>numSamplesRead = mRecord.read(buffer, 0, mNumSamplesPerRead);<NEW_LINE>}<NEW_LINE>final int invalidOperation = AudioRecord.ERROR_INVALID_OPERATION;<NEW_LINE>if (invalidOperation != numSamplesRead) {<NEW_LINE>setPostRecordingFields();<NEW_LINE>if (numSamplesRead > 0) {<NEW_LINE>// Prepare samples for the callback.<NEW_LINE>final byte[] callbackBuffer = <MASK><NEW_LINE>listener.onBufferReceived(callbackBuffer);<NEW_LINE>updateSumSamplesForRMSCalculations(numSamplesRead, buffer);<NEW_LINE>}<NEW_LINE>postAudioRecordingProcessing(numSamplesRead, buffer, listener);<NEW_LINE>} else {<NEW_LINE>Log.v(TAG, "AudioRecord - Invalid Operation");<NEW_LINE>throw new AudioSourceException("AudioRecord - Invalid Operation");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>Log.v(TAG, "Finished record loop");<NEW_LINE>} finally {<NEW_LINE>cleanUpAfterRecording();<NEW_LINE>}<NEW_LINE>} | pcmEncoder.encode(buffer, numSamplesRead); |
464,109 | private void linearAssignToBins(List<Datum> data) {<NEW_LINE>this.bins = new double[metricsDimensions][numBins];<NEW_LINE>this.minimums = new double[metricsDimensions];<NEW_LINE>this.maximums = new double[metricsDimensions];<NEW_LINE>for (int d = 0; d < this.metricsDimensions; ++d) {<NEW_LINE><MASK><NEW_LINE>double[] dataIn1D = new double[size];<NEW_LINE>for (int i = 0; i < size; i++) {<NEW_LINE>dataIn1D[i] = data.get(i).metrics().getEntry(d);<NEW_LINE>}<NEW_LINE>Arrays.sort(dataIn1D);<NEW_LINE>this.minimums[d] = dataIn1D[0];<NEW_LINE>this.maximums[d] = dataIn1D[size - 1];<NEW_LINE>this.delta = (this.maximums[d] - this.minimums[d]) / numIntervals;<NEW_LINE>for (int i = 0; i < size; i++) {<NEW_LINE>double pointValue = data.get(i).metrics().getEntry(d);<NEW_LINE>double binDouble = (pointValue - this.minimums[d]) / delta;<NEW_LINE>int lowerBin = (int) binDouble;<NEW_LINE>// Assign weights to lower and upper bins linearly proportional to distances<NEW_LINE>this.bins[d][lowerBin] += binDouble - lowerBin;<NEW_LINE>this.bins[d][Math.min(lowerBin + 1, numBins - 1)] += 1 - (binDouble - lowerBin);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | int size = data.size(); |
1,370,784 | public void finished(TaskEvent taskEvent) {<NEW_LINE>if (taskEvent.getKind() != Kind.ANALYZE) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (JavaCompiler.instance(context).errorCount() > 0) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>ClassTree tree = JavacTrees.instance(context).getTree(taskEvent.getTypeElement());<NEW_LINE>if (tree == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>List<CodeTransformer> rules = new ArrayList<>();<NEW_LINE>new TreeScanner<Void, Context>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public Void visitClass(ClassTree node, Context context) {<NEW_LINE>rules.addAll(RefasterRuleBuilderScanner.extractRules(node, context));<NEW_LINE>return <MASK><NEW_LINE>}<NEW_LINE>}.scan(tree, context);<NEW_LINE>if (rules.isEmpty()) {<NEW_LINE>throw new IllegalArgumentException("Did not find any Refaster templates");<NEW_LINE>}<NEW_LINE>try (ObjectOutputStream output = new ObjectOutputStream(Files.newOutputStream(destinationPath))) {<NEW_LINE>output.writeObject(CompositeCodeTransformer.compose(rules));<NEW_LINE>} catch (IOException e) {<NEW_LINE>throw new RuntimeException(e);<NEW_LINE>}<NEW_LINE>} | super.visitClass(node, context); |
658,461 | public Status delete(String table, String key) {<NEW_LINE>try {<NEW_LINE>PreparedStatement stmt = DELETE_STMT.get();<NEW_LINE>// Prepare statement on demand<NEW_LINE>if (stmt == null) {<NEW_LINE>Delete s = QueryBuilder.delete().from(table);<NEW_LINE>s.where(QueryBuilder.eq(YCSB_KEY, QueryBuilder.bindMarker()));<NEW_LINE>if (lwt) {<NEW_LINE>s.ifExists();<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>stmt.setConsistencyLevel(writeConsistencyLevel);<NEW_LINE>if (trace) {<NEW_LINE>stmt.enableTracing();<NEW_LINE>}<NEW_LINE>PreparedStatement prevStmt = DELETE_STMT.getAndSet(stmt);<NEW_LINE>if (prevStmt != null) {<NEW_LINE>stmt = prevStmt;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>LOGGER.debug(stmt.getQueryString());<NEW_LINE>LOGGER.debug("key = {}", key);<NEW_LINE>session.execute(stmt.bind(key));<NEW_LINE>return Status.OK;<NEW_LINE>} catch (Exception e) {<NEW_LINE>LOGGER.error(MessageFormatter.format("Error deleting key: {}", key).getMessage(), e);<NEW_LINE>}<NEW_LINE>return Status.ERROR;<NEW_LINE>} | stmt = session.prepare(s); |
1,550,639 | public void interceptOrDelegate(@NotNull final ChannelHandlerContext ctx, @NotNull final SUBSCRIBE subscribe) {<NEW_LINE>final Channel channel = ctx.channel();<NEW_LINE>final ClientConnection clientConnection = channel.attr(ChannelAttributes.CLIENT_CONNECTION).get();<NEW_LINE>final String clientId = clientConnection.getClientId();<NEW_LINE>if (clientId == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final ClientContextImpl clientContext = clientConnection.getExtensionClientContext();<NEW_LINE>if (clientContext == null) {<NEW_LINE>authorizerService.authorizeSubscriptions(ctx, subscribe);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final List<SubscribeInboundInterceptor> interceptors = clientContext.getSubscribeInboundInterceptors();<NEW_LINE>if (interceptors.isEmpty()) {<NEW_LINE>authorizerService.authorizeSubscriptions(ctx, subscribe);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final ClientInformation clientInfo = ExtensionInformationUtil.getAndSetClientInformation(channel, clientId);<NEW_LINE>final ConnectionInformation connectionInfo = ExtensionInformationUtil.getAndSetConnectionInformation(channel);<NEW_LINE>final SubscribePacketImpl packet = new SubscribePacketImpl(subscribe);<NEW_LINE>final SubscribeInboundInputImpl input = new SubscribeInboundInputImpl(clientInfo, connectionInfo, packet);<NEW_LINE>final ExtensionParameterHolder<SubscribeInboundInputImpl> inputHolder = new ExtensionParameterHolder<>(input);<NEW_LINE>final ModifiableSubscribePacketImpl modifiablePacket = new ModifiableSubscribePacketImpl(packet, configurationService);<NEW_LINE>final SubscribeInboundOutputImpl output = new SubscribeInboundOutputImpl(asyncer, modifiablePacket);<NEW_LINE>final ExtensionParameterHolder<SubscribeInboundOutputImpl> outputHolder = new ExtensionParameterHolder<>(output);<NEW_LINE>final SubscribeInboundInterceptorContext context = new SubscribeInboundInterceptorContext(clientId, interceptors.size(), ctx, inputHolder, outputHolder);<NEW_LINE>for (final SubscribeInboundInterceptor interceptor : interceptors) {<NEW_LINE>final HiveMQExtension extension = hiveMQExtensions.getExtensionForClassloader(interceptor.getClass().getClassLoader());<NEW_LINE>if (extension == null) {<NEW_LINE>// disabled extension would be null<NEW_LINE>context.finishInterceptor();<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>final SubscribeInboundInterceptorTask task = new SubscribeInboundInterceptorTask(<MASK><NEW_LINE>executorService.handlePluginInOutTaskExecution(context, inputHolder, outputHolder, task);<NEW_LINE>}<NEW_LINE>} | interceptor, extension.getId()); |
1,794,495 | public CommandResult process(CommandInvocation commandInvocation) throws CommandException, InterruptedException {<NEW_LINE>if (args != null && args.size() > 0) {<NEW_LINE>throw new IllegalArgumentException("Invalid option: " + args.get(0));<NEW_LINE>}<NEW_LINE>if (userid == null && username == null) {<NEW_LINE>throw new IllegalArgumentException("No user specified. Use --username or --userid to specify user");<NEW_LINE>}<NEW_LINE>if (userid != null && username != null) {<NEW_LINE>throw new IllegalArgumentException("Options --userid and --username are mutually exclusive");<NEW_LINE>}<NEW_LINE>if (pass == null) {<NEW_LINE>pass = readSecret("Enter password: ", commandInvocation);<NEW_LINE>}<NEW_LINE>ConfigData config = loadConfig();<NEW_LINE>config = copyWithServerInfo(config);<NEW_LINE>setupTruststore(config, commandInvocation);<NEW_LINE>String auth = null;<NEW_LINE>config = ensureAuthInfo(config, commandInvocation);<NEW_LINE>config = copyWithServerInfo(config);<NEW_LINE>if (credentialsAvailable(config)) {<NEW_LINE>auth = ensureToken(config);<NEW_LINE>}<NEW_LINE>auth = auth != null ? "Bearer " + auth : null;<NEW_LINE>final <MASK><NEW_LINE>final String realm = getTargetRealm(config);<NEW_LINE>final String adminRoot = adminRestRoot != null ? adminRestRoot : composeAdminRoot(server);<NEW_LINE>// if username is specified resolve id<NEW_LINE>if (username != null) {<NEW_LINE>userid = getIdFromUsername(adminRoot, realm, auth, username);<NEW_LINE>}<NEW_LINE>resetUserPassword(adminRoot, realm, auth, userid, pass, temporary);<NEW_LINE>return CommandResult.SUCCESS;<NEW_LINE>} | String server = config.getServerUrl(); |
516,037 | public final void scheduleSync(Context context, boolean replace) {<NEW_LINE>long flag = getSyncFlag(context);<NEW_LINE>if (flag == 0)<NEW_LINE>return;<NEW_LINE>if (BuildConfig.DEBUG)<NEW_LINE>Log.v(TAG, "Scheduling " + getWorkName() + ", replace=" + replace);<NEW_LINE>ExistingWorkPolicy policy = replace ? ExistingWorkPolicy.REPLACE : ExistingWorkPolicy.KEEP;<NEW_LINE>OneTimeWorkRequest localRequest = (new OneTimeWorkRequest.Builder(DataSyncWorker.class)).addTag(DataManager.WORK_TAG).setInputData(setWorkInput(new androidx.work.Data.Builder()).build()).build();<NEW_LINE>WorkContinuation cont = WorkManager.getInstance().beginUniqueWork(getWorkName(), policy, localRequest);<NEW_LINE>if (flag == SyncFlags.NETWORK) {<NEW_LINE>cont = cont.then((new OneTimeWorkRequest.Builder(ConfirmNetworkDataWorker.class)).addTag(DataManager<MASK><NEW_LINE>cont = cont.then((new OneTimeWorkRequest.Builder(NetworkDataSyncWorker.class)).addTag(DataManager.WORK_TAG).setConstraints((new Constraints.Builder()).setRequiredNetworkType(getNetworkTypeSetting(context)).build()).build());<NEW_LINE>}<NEW_LINE>cont.enqueue();<NEW_LINE>} | .WORK_TAG).build()); |
288,800 | protected void updateAttribBuffer(String name, int offset, int size) {<NEW_LINE>VertexAttribute attrib = polyAttribs.get(name);<NEW_LINE>if (attrib.type == PGL.FLOAT) {<NEW_LINE>FloatBuffer buffer = (FloatBuffer) polyAttribBuffers.get(name);<NEW_LINE>float[] array = fpolyAttribs.get(name);<NEW_LINE>PGL.updateFloatBuffer(buffer, array, attrib.tessSize * offset, attrib.tessSize * size);<NEW_LINE>} else if (attrib.type == PGL.INT) {<NEW_LINE>IntBuffer buffer = (IntBuffer) polyAttribBuffers.get(name);<NEW_LINE>int[] array = ipolyAttribs.get(name);<NEW_LINE>PGL.updateIntBuffer(buffer, array, attrib.tessSize * offset, attrib.tessSize * size);<NEW_LINE>} else if (attrib.type == PGL.BOOL) {<NEW_LINE>ByteBuffer buffer = (ByteBuffer) polyAttribBuffers.get(name);<NEW_LINE>byte[] <MASK><NEW_LINE>PGL.updateByteBuffer(buffer, array, attrib.tessSize * offset, attrib.tessSize * size);<NEW_LINE>}<NEW_LINE>} | array = bpolyAttribs.get(name); |
1,806,014 | public boolean rowTypeCoercion(SqlValidatorScope scope, SqlNode query, int columnIndex, RelDataType targetType) {<NEW_LINE>switch(query.getKind()) {<NEW_LINE>case SELECT:<NEW_LINE>SqlSelect selectNode = (SqlSelect) query;<NEW_LINE>SqlValidatorScope <MASK><NEW_LINE>if (!rowTypeElementCoercion(selectScope, selectNode.getSelectList().get(columnIndex), targetType, newNode -> selectNode.getSelectList().set(columnIndex, newNode))) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>updateInferredColumnType(selectScope, query, columnIndex, targetType);<NEW_LINE>return true;<NEW_LINE>case VALUES:<NEW_LINE>for (SqlNode rowConstructor : ((SqlCall) query).getOperandList()) {<NEW_LINE>if (!rowTypeElementCoercion(scope, ((SqlCall) rowConstructor).operand(columnIndex), targetType, newNode -> ((SqlCall) rowConstructor).setOperand(columnIndex, newNode))) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>updateInferredColumnType(scope, query, columnIndex, targetType);<NEW_LINE>return true;<NEW_LINE>default:<NEW_LINE>throw new UnsupportedOperationException("unexpected: " + query.getKind());<NEW_LINE>}<NEW_LINE>} | selectScope = validator.getSelectScope(selectNode); |
319,607 | public void write(JsonWriter out, Banana value) throws IOException {<NEW_LINE>JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();<NEW_LINE>obj.remove("additionalProperties");<NEW_LINE>// serialize additonal properties<NEW_LINE>if (value.getAdditionalProperties() != null) {<NEW_LINE>for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) {<NEW_LINE>if (entry.getValue() instanceof String)<NEW_LINE>obj.addProperty(entry.getKey(), (String) entry.getValue());<NEW_LINE>else if (entry.getValue() instanceof Number)<NEW_LINE>obj.addProperty(entry.getKey(), (Number) entry.getValue());<NEW_LINE>else if (entry.getValue() instanceof Boolean)<NEW_LINE>obj.addProperty(entry.getKey(), (Boolean) entry.getValue());<NEW_LINE>else if (entry.getValue() instanceof Character)<NEW_LINE>obj.addProperty(entry.getKey(), (Character) entry.getValue());<NEW_LINE>else {<NEW_LINE>obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>} | elementAdapter.write(out, obj); |
529,963 | public boolean apply(Game game, Ability source) {<NEW_LINE>Player controller = game.getPlayer(source.getControllerId());<NEW_LINE>MageObject <MASK><NEW_LINE>if (controller != null && sourceObject != null) {<NEW_LINE>SubType subType = ChooseCreatureTypeEffect.getChosenCreatureType(source.getSourceId(), game);<NEW_LINE>if (subType != null) {<NEW_LINE>FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent("creature you control of the chosen type");<NEW_LINE>filter.add(subType.getPredicate());<NEW_LINE>for (Permanent permanent : game.getBattlefield().getAllActivePermanents(filter, controller.getId(), game)) {<NEW_LINE>if (permanent != null) {<NEW_LINE>CreateTokenCopyTargetEffect effect = new CreateTokenCopyTargetEffect(source.getControllerId(), null, true);<NEW_LINE>effect.setTargetPointer(new FixedTarget(permanent, game));<NEW_LINE>effect.apply(game, source);<NEW_LINE>for (Permanent addedToken : effect.getAddedPermanents()) {<NEW_LINE>Effect exileEffect = new ExileTargetEffect();<NEW_LINE>exileEffect.setTargetPointer(new FixedTarget(addedToken, game));<NEW_LINE>game.addDelayedTriggeredAbility(new AtTheBeginOfNextEndStepDelayedTriggeredAbility(exileEffect), source);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>} | sourceObject = game.getObject(source); |
798,400 | public void startUp() {<NEW_LINE>keyManager.registerKeyListener(chatKeyboardListener);<NEW_LINE>chatCommandManager.registerCommandAsync(TOTAL_LEVEL_COMMAND_STRING, this::playerSkillLookup);<NEW_LINE>chatCommandManager.registerCommandAsync(CMB_COMMAND_STRING, this::combatLevelLookup);<NEW_LINE>chatCommandManager.registerCommand(PRICE_COMMAND_STRING, this::itemPriceLookup);<NEW_LINE>chatCommandManager.registerCommandAsync(LEVEL_COMMAND_STRING, this::playerSkillLookup);<NEW_LINE>chatCommandManager.registerCommandAsync(BOUNTY_HUNTER_HUNTER_COMMAND, this::bountyHunterHunterLookup);<NEW_LINE>chatCommandManager.<MASK><NEW_LINE>chatCommandManager.registerCommandAsync(CLUES_COMMAND_STRING, this::clueLookup);<NEW_LINE>chatCommandManager.registerCommandAsync(LAST_MAN_STANDING_COMMAND, this::lastManStandingLookup);<NEW_LINE>chatCommandManager.registerCommandAsync(LEAGUE_POINTS_COMMAND, this::leaguePointsLookup);<NEW_LINE>chatCommandManager.registerCommandAsync(KILLCOUNT_COMMAND_STRING, this::killCountLookup, this::killCountSubmit);<NEW_LINE>chatCommandManager.registerCommandAsync(QP_COMMAND_STRING, this::questPointsLookup, this::questPointsSubmit);<NEW_LINE>chatCommandManager.registerCommandAsync(PB_COMMAND, this::personalBestLookup, this::personalBestSubmit);<NEW_LINE>chatCommandManager.registerCommandAsync(GC_COMMAND_STRING, this::gambleCountLookup, this::gambleCountSubmit);<NEW_LINE>chatCommandManager.registerCommandAsync(DUEL_ARENA_COMMAND, this::duelArenaLookup, this::duelArenaSubmit);<NEW_LINE>chatCommandManager.registerCommandAsync(SOUL_WARS_ZEAL_COMMAND, this::soulWarsZealLookup);<NEW_LINE>chatCommandManager.registerCommandAsync(PET_LIST_COMMAND, this::petListLookup, this::petListSubmit);<NEW_LINE>clientThread.invoke(this::loadPetIcons);<NEW_LINE>} | registerCommandAsync(BOUNTY_HUNTER_ROGUE_COMMAND, this::bountyHunterRogueLookup); |
609,309 | private void addRange(int[] starts, int[] ends) {<NEW_LINE>List<FoldedBlock> result = new ArrayList<FoldedBlock>(3);<NEW_LINE>int[] rangeStarts = new int[myCount];<NEW_LINE>int[] rangeEnds = new int[myCount];<NEW_LINE>for (int number = 0; ; number++) {<NEW_LINE>int shift = getRangeShift(mySettings.range, number);<NEW_LINE>if (shift == -1)<NEW_LINE>break;<NEW_LINE>for (int i = 0; i < myCount; i++) {<NEW_LINE>rangeStarts[i] = bound(starts<MASK><NEW_LINE>rangeEnds[i] = bound(ends[i] - shift, i);<NEW_LINE>}<NEW_LINE>ContainerUtil.addAllNotNull(result, createRange(rangeStarts, rangeEnds, myExpandSuggester.isExpanded(rangeStarts, rangeEnds)));<NEW_LINE>}<NEW_LINE>if (result.size() > 0) {<NEW_LINE>FoldedBlock[] block = ContainerUtil.toArray(result, new FoldedBlock[result.size()]);<NEW_LINE>for (FoldedBlock folding : block) {<NEW_LINE>folding.installHighlighter(block);<NEW_LINE>}<NEW_LINE>myFoldings.add(block);<NEW_LINE>}<NEW_LINE>} | [i] + shift, i); |
469,848 | void lock() {<NEW_LINE>long remainingNanos = WARN_AFTER_LOCK_WAIT_NANOS;<NEW_LINE>long end <MASK><NEW_LINE>boolean interrupted = false;<NEW_LINE>try {<NEW_LINE>for (; ; ) {<NEW_LINE>try {<NEW_LINE>if (evictionLock.tryLock(remainingNanos, TimeUnit.NANOSECONDS)) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>logger.log(Level.WARNING, "The cache is experiencing excessive wait times for acquiring " + "the eviction lock. This may indicate that a long-running computation has halted " + "eviction when trying to remove the victim entry. Consider using AsyncCache to " + "decouple the computation from the map operation.", new TimeoutException());<NEW_LINE>evictionLock.lock();<NEW_LINE>return;<NEW_LINE>} catch (InterruptedException e) {<NEW_LINE>remainingNanos = end - System.nanoTime();<NEW_LINE>interrupted = true;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} finally {<NEW_LINE>if (interrupted) {<NEW_LINE>Thread.currentThread().interrupt();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | = System.nanoTime() + remainingNanos; |
1,728,947 | public static void main(String[] args) {<NEW_LINE>Jsonb jsonb = JsonbBuilder.create();<NEW_LINE>Model instance = new Model();<NEW_LINE>instance.string = "Hello World!";<NEW_LINE>instance.number = 42;<NEW_LINE>instance.integers = Arrays.asList(1, 2, 3);<NEW_LINE>instance.decimals = new HashSet<>(Arrays.asList(BigDecimal<MASK><NEW_LINE>instance.uuids = new UUID[] { new UUID(1L, 2L), new UUID(3L, 4L) };<NEW_LINE>instance.longs = new Vector<>(Arrays.asList(1L, 2L));<NEW_LINE>instance.nested = Arrays.asList(new Model.Nested(), null);<NEW_LINE>instance.inheritance = new Model.ParentClass();<NEW_LINE>instance.inheritance.a = 5;<NEW_LINE>instance.inheritance.b = 6;<NEW_LINE>instance.iface = new Model.WithCustomCtor(5, 6);<NEW_LINE>instance.person = new ImmutablePerson("first name", "last name", 35);<NEW_LINE>instance.states = Arrays.asList(Model.State.HI, Model.State.LOW);<NEW_LINE>instance.intList = new ArrayList<>(Arrays.asList(123, 456));<NEW_LINE>instance.map = new HashMap<>();<NEW_LINE>instance.map.put("abc", 678);<NEW_LINE>instance.map.put("array", new int[] { 2, 4, 8 });<NEW_LINE>instance.factories = Arrays.asList(null, Model.ViaFactory.create("me", 2), Model.ViaFactory.create("you", 3), null);<NEW_LINE>instance.builder = PersonBuilder.builder().firstName("first").lastName("last").age(42).build();<NEW_LINE>// TODO while string API is supported, it should be avoided in favor of stream API<NEW_LINE>String result = jsonb.toJson(instance);<NEW_LINE>System.out.println(result);<NEW_LINE>// TODO while string API is supported, it should be avoided in favor of stream API<NEW_LINE>Model deser = jsonb.fromJson(result, Model.class);<NEW_LINE>System.out.println(deser.string);<NEW_LINE>} | .ONE, BigDecimal.ZERO)); |
169,163 | public static void main(String[] args) {<NEW_LINE>System.out.println("#define POW5_INV_BITCOUNT " + POW5_INV_BITCOUNT);<NEW_LINE>System.out.println("static uint64_t FLOAT_POW5_INV_SPLIT[" + INV_TABLE_SIZE + "] = {");<NEW_LINE>for (int i = 0; i < INV_TABLE_SIZE; i++) {<NEW_LINE>BigInteger pow = BigInteger.valueOf(5).pow(i);<NEW_LINE>int pow5len = pow.bitLength();<NEW_LINE>int j = pow5len - 1 + POW5_INV_BITCOUNT;<NEW_LINE>BigInteger pow5inv = BigInteger.ONE.shiftLeft(j).divide(pow).add(BigInteger.ONE);<NEW_LINE>long v = pow5inv.longValueExact();<NEW_LINE>System.out.printf(" %19su", Long.toUnsignedString(v));<NEW_LINE>if (i < INV_TABLE_SIZE - 1) {<NEW_LINE>System.out.print(",");<NEW_LINE>}<NEW_LINE>if (i % 4 == 3) {<NEW_LINE>System.out.println();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>System.out.println();<NEW_LINE>System.out.println("};");<NEW_LINE>System.out.println("#define POW5_BITCOUNT " + POW5_BITCOUNT);<NEW_LINE>System.out.println("static uint64_t FLOAT_POW5_SPLIT[" + POS_TABLE_SIZE + "] = {");<NEW_LINE>for (int i = 0; i < POS_TABLE_SIZE; i++) {<NEW_LINE>BigInteger pow = BigInteger.valueOf(5).pow(i);<NEW_LINE>int pow5len = pow.bitLength();<NEW_LINE>BigInteger pow5 = pow.shiftRight(pow5len - POW5_BITCOUNT);<NEW_LINE><MASK><NEW_LINE>System.out.printf(" %19su", Long.toUnsignedString(v));<NEW_LINE>if (i < POS_TABLE_SIZE - 1) {<NEW_LINE>System.out.print(",");<NEW_LINE>}<NEW_LINE>if (i % 4 == 3) {<NEW_LINE>System.out.println();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>System.out.println();<NEW_LINE>System.out.println("};");<NEW_LINE>} | long v = pow5.longValueExact(); |
608,218 | public void displayErrorMessage() {<NEW_LINE>if (error == null)<NEW_LINE>return;<NEW_LINE>if (errorAnnotation == null)<NEW_LINE>errorAnnotation = new org.openide.text.Annotation() {<NEW_LINE><NEW_LINE>public String getAnnotationType() {<NEW_LINE>// NOI18N<NEW_LINE>return "xml-j2ee-annotation";<NEW_LINE>}<NEW_LINE><NEW_LINE>public String getShortDescription() {<NEW_LINE>return NbBundle.getMessage(XMLJ2eeDataObject.class, "HINT_XMLErrorDescription");<NEW_LINE>}<NEW_LINE>};<NEW_LINE>if (inOut == null)<NEW_LINE>inOut = org.openide.windows.IOProvider.getDefault().getIO(NbBundle.getMessage(XMLJ2eeDataObject.class, "TXT_parser"), false);<NEW_LINE>inOut.setFocusTaken(false);<NEW_LINE>OutputWriter outputWriter = inOut.getOut();<NEW_LINE>int line = Math.max(<MASK><NEW_LINE>LineCookie cookie = getCookie(LineCookie.class);<NEW_LINE>// getting Line object<NEW_LINE>Line xline = cookie.getLineSet().getCurrent(line == 0 ? 0 : line - 1);<NEW_LINE>// attaching Annotation<NEW_LINE>errorAnnotation.attach(xline);<NEW_LINE>try {<NEW_LINE>outputWriter.reset();<NEW_LINE>// defining of new OutputListener<NEW_LINE>IOCtl outList = new IOCtl(xline);<NEW_LINE>outputWriter.println(this.getOutputStringForInvalidDocument(error), outList);<NEW_LINE>} catch (IOException e) {<NEW_LINE>// NOI18N<NEW_LINE>Logger.getLogger("XMLJ2eeDataObject").log(Level.FINE, "ignored exception", e);<NEW_LINE>}<NEW_LINE>} | 0, error.getErrorLine()); |
870,651 | private static void uncompressHybridFlavor(final CpcSketch target, final CompressedState source) {<NEW_LINE>assert (source.cwStream == null);<NEW_LINE>assert (source.csvStream != null);<NEW_LINE>// fail path 3<NEW_LINE>final int<MASK><NEW_LINE>final int numPairs = source.numCsv;<NEW_LINE>// In the hybrid flavor, some of these pairs actually<NEW_LINE>// belong in the window, so we will separate them out,<NEW_LINE>// moving the "true" pairs to the bottom of the array.<NEW_LINE>final int srcLgK = source.lgK;<NEW_LINE>final int k = 1 << srcLgK;<NEW_LINE>final byte[] window = new byte[k];<NEW_LINE>int nextTruePair = 0;<NEW_LINE>for (int i = 0; i < numPairs; i++) {<NEW_LINE>final int rowCol = pairs[i];<NEW_LINE>assert (rowCol != -1);<NEW_LINE>final int col = rowCol & 63;<NEW_LINE>if (col < 8) {<NEW_LINE>final int row = rowCol >>> 6;<NEW_LINE>// set the window bit<NEW_LINE>window[row] |= (1 << col);<NEW_LINE>} else {<NEW_LINE>// move true pair down<NEW_LINE>pairs[nextTruePair++] = rowCol;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>assert (source.getWindowOffset() == 0);<NEW_LINE>target.windowOffset = 0;<NEW_LINE>final PairTable table = PairTable.newInstanceFromPairsArray(pairs, nextTruePair, srcLgK);<NEW_LINE>target.pairTable = table;<NEW_LINE>target.slidingWindow = window;<NEW_LINE>} | [] pairs = uncompressTheSurprisingValues(source); |
754,471 | public MPInstancePara createParameter(int sequence, String parameterName, Object value) {<NEW_LINE>MProcess process = MProcess.get(getCtx(), getAD_Process_ID());<NEW_LINE>MProcessPara parameter = process.getParameter(parameterName);<NEW_LINE>MPInstancePara instanceParameter = null;<NEW_LINE>if (parameter == null && parameterName.endsWith("_To")) {<NEW_LINE>String originalParameterName = parameterName.replaceAll("_To", "");<NEW_LINE>Optional<MPInstancePara> optionalSavedParameter = Arrays.asList(getParameters()).stream().filter(savedParameter -> savedParameter.getParameterName().equals(originalParameterName)).findFirst();<NEW_LINE>if (optionalSavedParameter.isPresent()) {<NEW_LINE>instanceParameter = optionalSavedParameter.get();<NEW_LINE>} else {<NEW_LINE>// Instance It<NEW_LINE>instanceParameter = new MPInstancePara(this, sequence);<NEW_LINE>}<NEW_LINE>if (value == null) {<NEW_LINE>instanceParameter.setParameter(originalParameterName<MASK><NEW_LINE>} else if (value instanceof BigDecimal) {<NEW_LINE>instanceParameter.setParameter(originalParameterName, (BigDecimal) value, true);<NEW_LINE>} else if (value instanceof Integer) {<NEW_LINE>instanceParameter.setParameter(originalParameterName, (Integer) value, true);<NEW_LINE>} else if (value instanceof Timestamp) {<NEW_LINE>instanceParameter.setParameter(originalParameterName, (Timestamp) value, true);<NEW_LINE>} else if (value instanceof Boolean) {<NEW_LINE>instanceParameter.setParameter(originalParameterName, (Boolean) value, true);<NEW_LINE>} else {<NEW_LINE>instanceParameter.setParameter(originalParameterName, value.toString(), true);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>instanceParameter = new MPInstancePara(this, sequence);<NEW_LINE>if (value == null) {<NEW_LINE>instanceParameter.setParameter(parameterName, (String) null);<NEW_LINE>} else if (value instanceof BigDecimal) {<NEW_LINE>instanceParameter.setParameter(parameterName, (BigDecimal) value);<NEW_LINE>} else if (value instanceof Integer) {<NEW_LINE>instanceParameter.setParameter(parameterName, (Integer) value);<NEW_LINE>} else if (value instanceof Timestamp) {<NEW_LINE>instanceParameter.setParameter(parameterName, (Timestamp) value);<NEW_LINE>} else if (value instanceof Boolean) {<NEW_LINE>instanceParameter.setParameter(parameterName, (Boolean) value);<NEW_LINE>} else {<NEW_LINE>instanceParameter.setParameter(parameterName, value.toString());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>//<NEW_LINE>instanceParameter.saveEx();<NEW_LINE>return instanceParameter;<NEW_LINE>} | , (String) null, true); |
1,711,011 | void computeLCP() {<NEW_LINE>int i, L;<NEW_LINE>// default value<NEW_LINE>Phi[<MASK><NEW_LINE>for (// compute Phi in O(n)<NEW_LINE>// compute Phi in O(n)<NEW_LINE>i = 1; // compute Phi in O(n)<NEW_LINE>i < n; // remember which suffix is behind this suffix<NEW_LINE>i++) Phi[SA[i]] = SA[i - 1];<NEW_LINE>for (i = L = 0; i < n; i++) {<NEW_LINE>// compute Permuted LCP in O(n)<NEW_LINE>// special case<NEW_LINE>if (Phi[i] == -1) {<NEW_LINE>PLCP[i] = 0;<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>// L will be increased max n times<NEW_LINE>while (i + L < T.length && Phi[i] + L < T.length && T[i + L] == T[Phi[i] + L]) L++;<NEW_LINE>PLCP[i] = L;<NEW_LINE>// L will be decreased max n times<NEW_LINE>L = Math.max(L - 1, 0);<NEW_LINE>}<NEW_LINE>for (// compute LCP in O(n)<NEW_LINE>// compute LCP in O(n)<NEW_LINE>i = 1; // compute LCP in O(n)<NEW_LINE>i < n; // put the permuted LCP back to the correct position<NEW_LINE>i++) LCP[i] = PLCP[SA[i]];<NEW_LINE>} | SA[0]] = -1; |
1,851,648 | public ContentSigner build(PrivateKey privateKey) throws OperatorCreationException {<NEW_LINE>if (privateKey instanceof CompositePrivateKey) {<NEW_LINE>return buildComposite((CompositePrivateKey) privateKey);<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>final Signature sig = helper.createSignature(sigAlgId);<NEW_LINE>if (sigAlgId.getAlgorithm().on(BCObjectIdentifiers.sphincsPlus)) {<NEW_LINE>sigAlgId = PrivateKeyInfo.getInstance(privateKey.<MASK><NEW_LINE>}<NEW_LINE>final AlgorithmIdentifier signatureAlgId = sigAlgId;<NEW_LINE>if (random != null) {<NEW_LINE>sig.initSign(privateKey, random);<NEW_LINE>} else {<NEW_LINE>sig.initSign(privateKey);<NEW_LINE>}<NEW_LINE>return new ContentSigner() {<NEW_LINE><NEW_LINE>private OutputStream stream = OutputStreamFactory.createStream(sig);<NEW_LINE><NEW_LINE>public AlgorithmIdentifier getAlgorithmIdentifier() {<NEW_LINE>return signatureAlgId;<NEW_LINE>}<NEW_LINE><NEW_LINE>public OutputStream getOutputStream() {<NEW_LINE>return stream;<NEW_LINE>}<NEW_LINE><NEW_LINE>public byte[] getSignature() {<NEW_LINE>try {<NEW_LINE>return sig.sign();<NEW_LINE>} catch (SignatureException e) {<NEW_LINE>throw new RuntimeOperatorException("exception obtaining signature: " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>};<NEW_LINE>} catch (GeneralSecurityException e) {<NEW_LINE>throw new OperatorCreationException("cannot create signer: " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>} | getEncoded()).getPrivateKeyAlgorithm(); |
1,399,305 | private void dump(PrintWriter out, Predicate<String> keyFilter) {<NEW_LINE>Class<?> lookAndFeelClass = lookAndFeel instanceof MyBasicLookAndFeel ? BasicLookAndFeel.class : lookAndFeel.getClass();<NEW_LINE>out.printf("Class %s%n", lookAndFeelClass.getName());<NEW_LINE>out.printf("ID %s%n", lookAndFeel.getID());<NEW_LINE>out.printf(<MASK><NEW_LINE>out.printf("Java %s%n", System.getProperty("java.version"));<NEW_LINE>out.printf("OS %s%n", System.getProperty("os.name"));<NEW_LINE>defaults.entrySet().stream().sorted((key1, key2) -> {<NEW_LINE>return String.valueOf(key1).compareTo(String.valueOf(key2));<NEW_LINE>}).forEach(entry -> {<NEW_LINE>Object key = entry.getKey();<NEW_LINE>Object value = entry.getValue();<NEW_LINE>String strKey = String.valueOf(key);<NEW_LINE>if (!keyFilter.test(strKey) || strKey.startsWith("FlatLaf.internal."))<NEW_LINE>return;<NEW_LINE>String prefix = keyPrefix(strKey);<NEW_LINE>if (!prefix.equals(lastPrefix)) {<NEW_LINE>lastPrefix = prefix;<NEW_LINE>out.printf("%n%n#---- %s ----%n%n", prefix);<NEW_LINE>}<NEW_LINE>out.printf("%-30s ", strKey);<NEW_LINE>dumpValue(out, strKey, value);<NEW_LINE>out.println();<NEW_LINE>});<NEW_LINE>} | "Name %s%n", lookAndFeel.getName()); |
70,054 | public Object apply(final ActionContext ctx, final Object caller, final Object[] sources) throws FrameworkException {<NEW_LINE>try {<NEW_LINE>assertArrayHasMinLengthAndAllElementsNotNull(sources, 2);<NEW_LINE>final List<Map<String, Object>> data = new LinkedList<>();<NEW_LINE>final String url = (String) sources[0];<NEW_LINE>final String sql = (String) sources[1];<NEW_LINE>try {<NEW_LINE>try (final Connection connection = DriverManager.getConnection(url)) {<NEW_LINE>final Statement statement = connection.createStatement();<NEW_LINE>if (statement.execute(sql)) {<NEW_LINE>try (final ResultSet resultSet = statement.getResultSet()) {<NEW_LINE>final ResultSetMetaData metaData = resultSet.getMetaData();<NEW_LINE>final int count = metaData.getColumnCount();<NEW_LINE>while (resultSet.next()) {<NEW_LINE>final Map<String, Object> row = new LinkedHashMap<>();<NEW_LINE>for (int i = 1; i <= count; i++) {<NEW_LINE>final String key = metaData.getColumnName(i);<NEW_LINE>final Object value = resultSet.getObject(i);<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>data.add(row);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (Throwable t) {<NEW_LINE>if (t instanceof ClassNotFoundException) {<NEW_LINE>logException(t, "JDBC driver not found. Make sure the driver's JAR is located in the lib directory.", new Object[] { t.getMessage() });<NEW_LINE>throw new FrameworkException(422, "JDBC driver not found. Make sure the driver's JAR is located in the lib directory.");<NEW_LINE>} else {<NEW_LINE>logException(t, t.getMessage(), sources);<NEW_LINE>throw new FrameworkException(422, t.getMessage());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return data;<NEW_LINE>} catch (ArgumentNullException pe) {<NEW_LINE>// silently ignore null arguments<NEW_LINE>return null;<NEW_LINE>} catch (ArgumentCountException pe) {<NEW_LINE>logParameterError(caller, sources, pe.getMessage(), ctx.isJavaScriptContext());<NEW_LINE>return usage(ctx.isJavaScriptContext());<NEW_LINE>}<NEW_LINE>} | row.put(key, value); |
1,238,593 | private AzureCommunicationCallingServerServiceImpl createServiceImpl() {<NEW_LINE>boolean isConnectionStringSet = connectionString != null && !connectionString.trim().isEmpty();<NEW_LINE>boolean isEndpointSet = endpoint != null && !endpoint.trim().isEmpty();<NEW_LINE>boolean isAzureKeyCredentialSet = azureKeyCredential != null;<NEW_LINE>boolean isTokenCredentialSet = tokenCredential != null;<NEW_LINE>if (isConnectionStringSet && isEndpointSet) {<NEW_LINE>throw logger.logExceptionAsError(new IllegalArgumentException("Both 'connectionString' and 'endpoint' are set. Just one may be used."));<NEW_LINE>}<NEW_LINE>if (isConnectionStringSet && isAzureKeyCredentialSet) {<NEW_LINE>throw logger.logExceptionAsError(new IllegalArgumentException("Both 'connectionString' and 'keyCredential' are set. Just one may be used."));<NEW_LINE>}<NEW_LINE>if (isConnectionStringSet && isTokenCredentialSet) {<NEW_LINE>throw logger.logExceptionAsError(new IllegalArgumentException("Both 'connectionString' and 'tokenCredential' are set. Just one may be used."));<NEW_LINE>}<NEW_LINE>if (isAzureKeyCredentialSet && isTokenCredentialSet) {<NEW_LINE>throw logger.logExceptionAsError(new IllegalArgumentException("Both 'tokenCredential' and 'keyCredential' are set. Just one may be used."));<NEW_LINE>}<NEW_LINE>if (isConnectionStringSet) {<NEW_LINE>CommunicationConnectionString connectionStringObject = new CommunicationConnectionString(connectionString);<NEW_LINE>String endpoint = connectionStringObject.getEndpoint();<NEW_LINE><MASK><NEW_LINE>endpoint(endpoint).credential(new AzureKeyCredential(accessKey));<NEW_LINE>}<NEW_LINE>Objects.requireNonNull(endpoint);<NEW_LINE>if (isTokenCredentialSet) {<NEW_LINE>try {<NEW_LINE>hostName = getHostNameFromEndpoint();<NEW_LINE>} catch (MalformedURLException e) {<NEW_LINE>throw logger.logExceptionAsError(new RuntimeException(e.getMessage()));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (pipeline == null) {<NEW_LINE>Objects.requireNonNull(httpClient);<NEW_LINE>}<NEW_LINE>HttpPipeline builderPipeline = pipeline;<NEW_LINE>if (pipeline == null) {<NEW_LINE>builderPipeline = createHttpPipeline(httpClient);<NEW_LINE>}<NEW_LINE>AzureCommunicationCallingServerServiceImplBuilder clientBuilder = new AzureCommunicationCallingServerServiceImplBuilder();<NEW_LINE>clientBuilder.endpoint(endpoint).pipeline(builderPipeline);<NEW_LINE>return clientBuilder.buildClient();<NEW_LINE>} | String accessKey = connectionStringObject.getAccessKey(); |
495,782 | public ImportAssetsFromRedshiftDataSharesResponseDetails unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>ImportAssetsFromRedshiftDataSharesResponseDetails importAssetsFromRedshiftDataSharesResponseDetails = new ImportAssetsFromRedshiftDataSharesResponseDetails();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE><MASK><NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>if (context.testExpression("AssetSources", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>importAssetsFromRedshiftDataSharesResponseDetails.setAssetSources(new ListUnmarshaller<RedshiftDataShareAssetSourceEntry>(RedshiftDataShareAssetSourceEntryJsonUnmarshaller.getInstance()).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("DataSetId", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>importAssetsFromRedshiftDataSharesResponseDetails.setDataSetId(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("RevisionId", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>importAssetsFromRedshiftDataSharesResponseDetails.setRevisionId(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return importAssetsFromRedshiftDataSharesResponseDetails;<NEW_LINE>} | String currentParentElement = context.getCurrentParentElement(); |
1,837,573 | private static FilterSpecPlanForge planFilterParametersInternal(List<ExprNode> validatedNodes, FilterSpecCompilerArgs args) throws ExprValidationException {<NEW_LINE>if (validatedNodes.isEmpty()) {<NEW_LINE>return FilterSpecPlanForge.EMPTY;<NEW_LINE>}<NEW_LINE>if (args.compileTimeServices.getConfiguration().getCompiler().getExecution().getFilterIndexPlanning() == ConfigurationCompilerExecution.FilterIndexPlanning.NONE) {<NEW_LINE>decomposeCheckAggregation(validatedNodes);<NEW_LINE>return buildNoPlan(validatedNodes, args);<NEW_LINE>}<NEW_LINE>boolean performConditionPlanning = hasLevelOrHint(FilterSpecCompilerIndexPlannerHint.CONDITIONS, args.statementRawInfo, args.compileTimeServices);<NEW_LINE>FilterSpecParaForgeMap filterParamExprMap = new FilterSpecParaForgeMap();<NEW_LINE>// Make filter parameter for each expression node, if it can be optimized.<NEW_LINE>// Optionally receive a top-level control condition that negates<NEW_LINE>ExprNode topLevelNegation = decomposePopulateConsolidate(filterParamExprMap, performConditionPlanning, validatedNodes, args);<NEW_LINE>// Use all filter parameter and unassigned expressions<NEW_LINE>int countUnassigned = filterParamExprMap.countUnassignedExpressions();<NEW_LINE>// we are done if there are no remaining nodes<NEW_LINE>if (countUnassigned == 0) {<NEW_LINE>return makePlanFromTriplets(filterParamExprMap.getTriplets(), topLevelNegation, args);<NEW_LINE>}<NEW_LINE>// determine max-width<NEW_LINE>int filterServiceMaxFilterWidth = args.compileTimeServices.getConfiguration().getCompiler().getExecution().getFilterServiceMaxFilterWidth();<NEW_LINE>Hint hint = HintEnum.MAX_FILTER_WIDTH.getHint(args.statementRawInfo.getAnnotations());<NEW_LINE>if (hint != null) {<NEW_LINE>String hintValue = HintEnum.MAX_FILTER_WIDTH.getHintAssignedValue(hint);<NEW_LINE>filterServiceMaxFilterWidth = Integer.parseInt(hintValue);<NEW_LINE>}<NEW_LINE>FilterSpecPlanForge plan = null;<NEW_LINE>if (filterServiceMaxFilterWidth > 0) {<NEW_LINE>if (performConditionPlanning) {<NEW_LINE>plan = planRemainingNodesWithConditions(filterParamExprMap, args, filterServiceMaxFilterWidth, topLevelNegation);<NEW_LINE>} else {<NEW_LINE>plan = <MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (plan != null) {<NEW_LINE>return plan;<NEW_LINE>}<NEW_LINE>// handle no-plan<NEW_LINE>List<FilterSpecPlanPathTripletForge> triplets = new ArrayList<>(filterParamExprMap.getTriplets());<NEW_LINE>List<ExprNode> unassignedExpressions = filterParamExprMap.getUnassignedExpressions();<NEW_LINE>FilterSpecPlanPathTripletForge triplet = makeRemainingNode(unassignedExpressions, args);<NEW_LINE>triplets.add(triplet);<NEW_LINE>return makePlanFromTriplets(triplets, topLevelNegation, args);<NEW_LINE>} | planRemainingNodesBasic(filterParamExprMap, args, filterServiceMaxFilterWidth); |
1,599,553 | void writeValue(Value v) {<NEW_LINE>if (v == null) {<NEW_LINE>_stream.writeSize(0);<NEW_LINE>} else if (_current != null && _encaps.format == FormatType.SlicedFormat) {<NEW_LINE>if (// Lazy initialization<NEW_LINE>_current.indirectionTable == null) {<NEW_LINE>_current.indirectionTable = new java.util.ArrayList<>();<NEW_LINE>_current.indirectionMap = new java.util.IdentityHashMap<>();<NEW_LINE>}<NEW_LINE>//<NEW_LINE>// If writing an instance within a slice and using the sliced<NEW_LINE>// format, write an index from the instance indirection<NEW_LINE>// table. The indirect instance table is encoded at the end of<NEW_LINE>// each slice and is always read (even if the Slice is<NEW_LINE>// unknown).<NEW_LINE>//<NEW_LINE>Integer index = <MASK><NEW_LINE>if (index == null) {<NEW_LINE>_current.indirectionTable.add(v);<NEW_LINE>// Position + 1 (0 is reserved for nil)<NEW_LINE>final int idx = _current.indirectionTable.size();<NEW_LINE>_current.indirectionMap.put(v, idx);<NEW_LINE>_stream.writeSize(idx);<NEW_LINE>} else {<NEW_LINE>_stream.writeSize(index.intValue());<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>// Write the instance or a reference if already marshaled.<NEW_LINE>writeInstance(v);<NEW_LINE>}<NEW_LINE>} | _current.indirectionMap.get(v); |
1,690,332 | public void onLoad() {<NEW_LINE>this.skillDepot = GenshinData.getAvatarSkillDepotDataMap().get(this.SkillDepotId);<NEW_LINE>// Get fetters from GenshinData<NEW_LINE>this.fetters = GenshinData.getFetterDataEntries().get(this.Id);<NEW_LINE>int size = GenshinData.getAvatarCurveDataMap().size();<NEW_LINE>this.hpGrowthCurve = new float[size];<NEW_LINE>this.attackGrowthCurve = new float[size];<NEW_LINE>this.defenseGrowthCurve = new float[size];<NEW_LINE>for (AvatarCurveData curveData : GenshinData.getAvatarCurveDataMap().values()) {<NEW_LINE>int level = curveData.getLevel() - 1;<NEW_LINE>for (PropGrowCurve growCurve : this.PropGrowCurves) {<NEW_LINE>FightProperty prop = FightProperty.getPropByName(growCurve.getType());<NEW_LINE>switch(prop) {<NEW_LINE>case FIGHT_PROP_BASE_HP:<NEW_LINE>this.hpGrowthCurve[level] = curveData.getCurveInfos().<MASK><NEW_LINE>break;<NEW_LINE>case FIGHT_PROP_BASE_ATTACK:<NEW_LINE>this.attackGrowthCurve[level] = curveData.getCurveInfos().get(growCurve.getGrowCurve());<NEW_LINE>break;<NEW_LINE>case FIGHT_PROP_BASE_DEFENSE:<NEW_LINE>this.defenseGrowthCurve[level] = curveData.getCurveInfos().get(growCurve.getGrowCurve());<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Cache abilities<NEW_LINE>String[] split = this.IconName.split("_");<NEW_LINE>if (split.length > 0) {<NEW_LINE>this.name = split[split.length - 1];<NEW_LINE>AbilityEmbryoEntry info = GenshinData.getAbilityEmbryoInfo().get(this.name);<NEW_LINE>if (info != null) {<NEW_LINE>this.abilities = new IntArrayList(info.getAbilities().length);<NEW_LINE>for (String ability : info.getAbilities()) {<NEW_LINE>this.abilities.add(Utils.abilityHash(ability));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | get(growCurve.getGrowCurve()); |
1,732,364 | public List<OptExpression> transform(OptExpression input, OptimizerContext context) {<NEW_LINE>LogicalApplyOperator apply = (LogicalApplyOperator) input.getOp();<NEW_LINE>// IN/NOT IN<NEW_LINE>InPredicateOperator ipo = (InPredicateOperator) apply.getSubqueryOperator();<NEW_LINE>BinaryPredicateOperator bpo = new BinaryPredicateOperator(BinaryPredicateOperator.BinaryType.<MASK><NEW_LINE>// IN to SEMI-JOIN<NEW_LINE>// NOT IN to ANTI-JOIN or NULL_AWARE_LEFT_ANTI_JOIN<NEW_LINE>OptExpression joinExpression;<NEW_LINE>if (ipo.isNotIn()) {<NEW_LINE>// @TODO: if will can filter null, use left-anti-join<NEW_LINE>joinExpression = new OptExpression(new LogicalJoinOperator(JoinOperator.NULL_AWARE_LEFT_ANTI_JOIN, Utils.compoundAnd(bpo, Utils.compoundAnd(apply.getCorrelationConjuncts(), apply.getPredicate()))));<NEW_LINE>} else {<NEW_LINE>joinExpression = new OptExpression(new LogicalJoinOperator(JoinOperator.LEFT_SEMI_JOIN, Utils.compoundAnd(bpo, Utils.compoundAnd(apply.getCorrelationConjuncts(), apply.getPredicate()))));<NEW_LINE>}<NEW_LINE>joinExpression.getInputs().addAll(input.getInputs());<NEW_LINE>Map<ColumnRefOperator, ScalarOperator> outputColumns = input.getOutputColumns().getStream().mapToObj(id -> context.getColumnRefFactory().getColumnRef(id)).collect(Collectors.toMap(Function.identity(), Function.identity()));<NEW_LINE>return Lists.newArrayList(OptExpression.create(new LogicalProjectOperator(outputColumns), Lists.newArrayList(joinExpression)));<NEW_LINE>} | EQ, ipo.getChildren()); |
566,062 | public Long countOfferCodeUses(Order order, Long offerCodeId) {<NEW_LINE>CriteriaBuilder builder = em.getCriteriaBuilder();<NEW_LINE>CriteriaQuery<Long> criteria = builder.createQuery(Long.class);<NEW_LINE>Root<OfferAuditImpl> root = criteria.from(OfferAuditImpl.class);<NEW_LINE>Root<OrderImpl> orderRoot = criteria.from(OrderImpl.class);<NEW_LINE>Join<Object, Object> parentOrder = null;<NEW_LINE>if (ModulePresentUtil.isPresent(BroadleafModuleRegistration.BroadleafModuleEnum.OMS)) {<NEW_LINE>parentOrder = orderRoot.join("embeddedOmsOrder", JoinType.LEFT).join("parentOrder", JoinType.LEFT);<NEW_LINE>}<NEW_LINE>criteria.select(builder.count(root));<NEW_LINE>List<Predicate> restrictions = new ArrayList<>();<NEW_LINE>restrictions.add(builder.and(builder.or(builder.notEqual(root.get("orderId"), getOrderId(order)), builder.isNull(root.get("orderId"))), builder.equal(root.get("offerCodeId"), offerCodeId), builder.or(builder.isNull(root.get("orderId")), builder.and(builder.notEqual(orderRoot.get("status"), OrderStatus.CANCELLED.getType()), builder.equal(orderRoot.get("id"), root.get("orderId")))), getOmsOrderPredicate(builder, orderRoot, parentOrder)));<NEW_LINE>criteria.where(restrictions.toArray(new Predicate[<MASK><NEW_LINE>try {<NEW_LINE>return em.createQuery(criteria).getSingleResult();<NEW_LINE>} catch (Exception e) {<NEW_LINE>LOG.error("Error counting offer code uses.", e);<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>} | restrictions.size()])); |
1,389,882 | public final void addWallet(Wallet wallet) {<NEW_LINE><MASK><NEW_LINE>addReorganizeListener(Threading.SAME_THREAD, wallet);<NEW_LINE>addTransactionReceivedListener(Threading.SAME_THREAD, wallet);<NEW_LINE>int walletHeight = wallet.getLastBlockSeenHeight();<NEW_LINE>int chainHeight = getBestChainHeight();<NEW_LINE>if (walletHeight != chainHeight && walletHeight > 0) {<NEW_LINE>log.warn("Wallet/chain height mismatch: {} vs {}", walletHeight, chainHeight);<NEW_LINE>log.warn("Hashes: {} vs {}", wallet.getLastBlockSeenHash(), getChainHead().getHeader().getHash());<NEW_LINE>// This special case happens when the VM crashes because of a transaction received. It causes the updated<NEW_LINE>// block store to persist, but not the wallet. In order to fix the issue, we roll back the block store to<NEW_LINE>// the wallet height to make it look like as if the block has never been received.<NEW_LINE>if (walletHeight < chainHeight) {<NEW_LINE>try {<NEW_LINE>rollbackBlockStore(walletHeight);<NEW_LINE>log.info("Rolled back block store to height {}.", walletHeight);<NEW_LINE>} catch (BlockStoreException x) {<NEW_LINE>log.warn("Rollback of block store failed, continuing with mismatched heights. This can happen due to a replay.");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | addNewBestBlockListener(Threading.SAME_THREAD, wallet); |
174,074 | public static DetectPedestrianIntrusionResponse unmarshall(DetectPedestrianIntrusionResponse detectPedestrianIntrusionResponse, UnmarshallerContext _ctx) {<NEW_LINE>detectPedestrianIntrusionResponse.setRequestId(_ctx.stringValue("DetectPedestrianIntrusionResponse.RequestId"));<NEW_LINE>detectPedestrianIntrusionResponse.setCode<MASK><NEW_LINE>detectPedestrianIntrusionResponse.setMessage(_ctx.stringValue("DetectPedestrianIntrusionResponse.Message"));<NEW_LINE>Data data = new Data();<NEW_LINE>data.setImageWidth(_ctx.longValue("DetectPedestrianIntrusionResponse.Data.ImageWidth"));<NEW_LINE>data.setImageHeight(_ctx.longValue("DetectPedestrianIntrusionResponse.Data.ImageHeight"));<NEW_LINE>List<ElementsItem> elements = new ArrayList<ElementsItem>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("DetectPedestrianIntrusionResponse.Data.Elements.Length"); i++) {<NEW_LINE>ElementsItem elementsItem = new ElementsItem();<NEW_LINE>elementsItem.setScore(_ctx.longValue("DetectPedestrianIntrusionResponse.Data.Elements[" + i + "].Score"));<NEW_LINE>elementsItem.setType(_ctx.stringValue("DetectPedestrianIntrusionResponse.Data.Elements[" + i + "].Type"));<NEW_LINE>elementsItem.setIsIntrude(_ctx.booleanValue("DetectPedestrianIntrusionResponse.Data.Elements[" + i + "].IsIntrude"));<NEW_LINE>elementsItem.setBoxId(_ctx.longValue("DetectPedestrianIntrusionResponse.Data.Elements[" + i + "].BoxId"));<NEW_LINE>Box box = new Box();<NEW_LINE>box.setLeft(_ctx.longValue("DetectPedestrianIntrusionResponse.Data.Elements[" + i + "].Box.Left"));<NEW_LINE>box.setTop(_ctx.longValue("DetectPedestrianIntrusionResponse.Data.Elements[" + i + "].Box.Top"));<NEW_LINE>box.setRight(_ctx.longValue("DetectPedestrianIntrusionResponse.Data.Elements[" + i + "].Box.Right"));<NEW_LINE>box.setBottom(_ctx.longValue("DetectPedestrianIntrusionResponse.Data.Elements[" + i + "].Box.Bottom"));<NEW_LINE>elementsItem.setBox(box);<NEW_LINE>elements.add(elementsItem);<NEW_LINE>}<NEW_LINE>data.setElements(elements);<NEW_LINE>detectPedestrianIntrusionResponse.setData(data);<NEW_LINE>return detectPedestrianIntrusionResponse;<NEW_LINE>} | (_ctx.stringValue("DetectPedestrianIntrusionResponse.Code")); |
1,050,549 | // as per [#368]<NEW_LINE>// removed when fix [#528]<NEW_LINE>// private IllegalArgumentException _noExisting() {<NEW_LINE>// return new IllegalArgumentException("Inclusion type "+_includeAs+" not yet supported");<NEW_LINE>// }<NEW_LINE>@Override<NEW_LINE>public TypeDeserializer buildTypeDeserializer(DeserializationConfig config, JavaType baseType, Collection<NamedType> subtypes) {<NEW_LINE>if (_idType == JsonTypeInfo.Id.NONE) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>// 03-Oct-2016, tatu: As per [databind#1395] better prevent use for primitives,<NEW_LINE>// regardless of setting<NEW_LINE>if (baseType.isPrimitive()) {<NEW_LINE>// 19-Jun-2020, tatu: But for [databind#2753], allow overriding<NEW_LINE>if (!allowPrimitiveTypes(config, baseType)) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// 27-Apr-2019, tatu: Part of [databind#2195]; must first check whether any subtypes<NEW_LINE>// of basetypes might be denied or allowed<NEW_LINE>final PolymorphicTypeValidator subTypeValidator = verifyBaseTypeValidity(config, baseType);<NEW_LINE>TypeIdResolver idRes = idResolver(config, baseType, subTypeValidator, subtypes, false, true);<NEW_LINE>JavaType defaultImpl = defineDefaultImpl(config, baseType);<NEW_LINE>if (_idType == JsonTypeInfo.Id.DEDUCTION) {<NEW_LINE>// Deduction doesn't require an includeAs property<NEW_LINE>return new AsDeductionTypeDeserializer(baseType, idRes, defaultImpl, config, subtypes);<NEW_LINE>}<NEW_LINE>// First, method for converting type info to type id:<NEW_LINE>switch(_includeAs) {<NEW_LINE>case WRAPPER_ARRAY:<NEW_LINE>return new AsArrayTypeDeserializer(baseType, idRes, _typeProperty, _typeIdVisible, defaultImpl);<NEW_LINE>case PROPERTY:<NEW_LINE>case // as per [#528] same class as PROPERTY<NEW_LINE>EXISTING_PROPERTY:<NEW_LINE>return new AsPropertyTypeDeserializer(baseType, idRes, _typeProperty, _typeIdVisible, defaultImpl, _includeAs);<NEW_LINE>case WRAPPER_OBJECT:<NEW_LINE>return new AsWrapperTypeDeserializer(baseType, idRes, _typeProperty, _typeIdVisible, defaultImpl);<NEW_LINE>case EXTERNAL_PROPERTY:<NEW_LINE>return new AsExternalTypeDeserializer(baseType, idRes, _typeProperty, _typeIdVisible, defaultImpl);<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>} | throw new IllegalStateException("Do not know how to construct standard type serializer for inclusion type: " + _includeAs); |
774,024 | private static FontConfig[] readFamiliesJellyBean(XmlPullParser parser) throws XmlPullParserException, IOException {<NEW_LINE>ArrayList<FontConfig> <MASK><NEW_LINE>parser.require(XmlPullParser.START_TAG, null, "familyset");<NEW_LINE>while (parser.next() != XmlPullParser.END_TAG) {<NEW_LINE>if (parser.getEventType() != XmlPullParser.START_TAG) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>String tag = parser.getName();<NEW_LINE>if (tag.equals("family")) {<NEW_LINE>while (parser.next() != XmlPullParser.END_TAG) {<NEW_LINE>if (parser.getEventType() != XmlPullParser.START_TAG) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>tag = parser.getName();<NEW_LINE>if (tag.equals("fileset")) {<NEW_LINE>readFileset(parser, fallbackList);<NEW_LINE>} else {<NEW_LINE>skip(parser);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>skip(parser);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>FontConfig[] list = new FontConfig[fallbackList.size()];<NEW_LINE>fallbackList.toArray(list);<NEW_LINE>return list;<NEW_LINE>} | fallbackList = new ArrayList<>(); |
495,531 | final CreateEndpointResult executeCreateEndpoint(CreateEndpointRequest createEndpointRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(createEndpointRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<CreateEndpointRequest> request = null;<NEW_LINE>Response<CreateEndpointResult> response = null;<NEW_LINE>try {<NEW_LINE><MASK><NEW_LINE>try {<NEW_LINE>request = new CreateEndpointRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(createEndpointRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "SageMaker");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "CreateEndpoint");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<CreateEndpointResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new CreateEndpointResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | awsRequestMetrics.startEvent(Field.RequestMarshallTime); |
1,025,681 | public Concrete.Expression visitArgumentAppExpr(ArgumentAppExprContext ctx) {<NEW_LINE>Concrete.Expression expr = visitAtomFieldsAcc(ctx.atomFieldsAcc());<NEW_LINE>List<OnlyLevelAtomContext> onlyLevelAtoms = ctx.onlyLevelAtom();<NEW_LINE>if (!onlyLevelAtoms.isEmpty()) {<NEW_LINE>if (expr instanceof Concrete.ReferenceExpression) {<NEW_LINE>Object obj1 = visit(onlyLevelAtoms.get(0));<NEW_LINE>Object obj2 = onlyLevelAtoms.size() < 2 ? null : visit(onlyLevelAtoms.get(1));<NEW_LINE>if (onlyLevelAtoms.size() > 2 || obj1 instanceof Pair && obj2 != null || obj2 instanceof Pair) {<NEW_LINE>myErrorReporter.report(new ParserError(tokenPosition(onlyLevelAtoms.get(0).start), "too many level specifications"));<NEW_LINE>}<NEW_LINE>List<Concrete.LevelExpression> levels1;<NEW_LINE>List<Concrete.LevelExpression> levels2;<NEW_LINE>if (obj1 instanceof Pair) {<NEW_LINE>levels1 = (List<Concrete.LevelExpression>) ((Pair) obj1).proj1;<NEW_LINE>levels2 = (List<Concrete.LevelExpression>) ((Pair) obj1).proj2;<NEW_LINE>} else {<NEW_LINE>levels1 = new SingletonList<>((Concrete.LevelExpression) obj1);<NEW_LINE>levels2 = obj2 instanceof Concrete.LevelExpression ? new SingletonList<>((Concrete.LevelExpression) obj2) : null;<NEW_LINE>}<NEW_LINE>expr = new Concrete.ReferenceExpression(expr.getData(), ((Concrete.ReferenceExpression) expr).getReferent(), levels1, levels2);<NEW_LINE>} else {<NEW_LINE>myErrorReporter.report(new ParserError(tokenPosition(onlyLevelAtoms.get(0).start), "Level annotations are allowed only after a reference"));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>List<ArgumentContext> argumentCtxs = ctx.argument();<NEW_LINE>if (argumentCtxs.isEmpty()) {<NEW_LINE>return expr;<NEW_LINE>}<NEW_LINE>List<Concrete.BinOpSequenceElem> sequence = new ArrayList<>(argumentCtxs.size());<NEW_LINE>sequence.add(new Concrete.BinOpSequenceElem(expr));<NEW_LINE>for (ArgumentContext argumentCtx : argumentCtxs) {<NEW_LINE>sequence.add(visitArgument(argumentCtx));<NEW_LINE>}<NEW_LINE>return new Concrete.BinOpSequenceExpression(expr.<MASK><NEW_LINE>} | getData(), sequence, null); |
102,841 | public void nodeStructureChanged(final TreeNode node) {<NEW_LINE>final Set<ICriterium> criteriumSet = new HashSet<ICriterium>();<NEW_LINE>final Enumeration<TreePath> expandedPaths = m_jtree.getExpandedDescendants(new TreePath(getRoot()));<NEW_LINE>if (expandedPaths != null) {<NEW_LINE>while (expandedPaths.hasMoreElements()) {<NEW_LINE>final TreePath path = expandedPaths.nextElement();<NEW_LINE>final JCriteriumTreeNode expandedNode = (JCriteriumTreeNode) path.getLastPathComponent();<NEW_LINE>criteriumSet.add(expandedNode.getCriterium());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>super.nodeStructureChanged(node);<NEW_LINE>final Enumeration<?> nodes = ((JCriteriumTreeNode) getRoot()).breadthFirstEnumeration();<NEW_LINE>while (nodes.hasMoreElements()) {<NEW_LINE>final JCriteriumTreeNode nextNode = <MASK><NEW_LINE>if (criteriumSet.contains(nextNode.getCriterium())) {<NEW_LINE>m_jtree.expandPath(new TreePath(nextNode.getPath()));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | (JCriteriumTreeNode) nodes.nextElement(); |
970,347 | private void filter(Mat src) {<NEW_LINE>Mat dst = src.clone();<NEW_LINE>// New line added.<NEW_LINE>dst.convertTo(dst, CvType.CV_64FC3);<NEW_LINE>int size = (int) (dst.total(<MASK><NEW_LINE>// use double[] instead of byte[]<NEW_LINE>double[] pixel = new double[size];<NEW_LINE>dst.get(0, 0, pixel);<NEW_LINE>for (int i = 0; i < size; i += src.channels()) {<NEW_LINE>double s = pixel[i + 0] + pixel[i + 1] + pixel[i + 2];<NEW_LINE>if (s != 0.0) {<NEW_LINE>pixel[i + 0] = (pixel[i + 0] / s) * 255;<NEW_LINE>pixel[i + 1] = (pixel[i + 1] / s) * 255;<NEW_LINE>pixel[i + 2] = (pixel[i + 2] / s) * 255;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>src.put(0, 0, pixel);<NEW_LINE>dst.release();<NEW_LINE>} | ) * dst.channels()); |
1,787,425 | protected void onCreate(Bundle savedInstanceState) {<NEW_LINE>if (HostInfo.isInHostProcess()) {<NEW_LINE>// we have to set the theme before super.onCreate()<NEW_LINE>setTheme(getCurrentV2Theme() == 3 ? R.style.Theme_MaiTungTMDesign_Light_Blue : R.style.Theme_MaiTungTMDesign_DayNight);<NEW_LINE>} else {<NEW_LINE>// we is in module process<NEW_LINE>applyV2Theme(getCurrentV2Theme(), false);<NEW_LINE>}<NEW_LINE>// if in host process, it should already be done by last activity<NEW_LINE>super.onCreate(savedInstanceState);<NEW_LINE>if (R.string.res_inject_success >>> 24 == 0x7f) {<NEW_LINE>throw new AssertionError("package id must NOT be 0x7f");<NEW_LINE>}<NEW_LINE>String cmd = getIntent().getStringExtra(SEND_TO_IPAD_CMD);<NEW_LINE>if (ENABLE_SEND_TO_IPAD.equals(cmd)) {<NEW_LINE>boolean enabled = getIntent().getBooleanExtra(ENABLE_SEND_TO_IPAD_STATUS, false);<NEW_LINE>ComponentName componentName = new ComponentName(this, QFileShareToIpadActivity.class);<NEW_LINE>ComponentUtilKt.setEnable(componentName, this, enabled);<NEW_LINE>finish();<NEW_LINE>}<NEW_LINE>HookStatus.init(this);<NEW_LINE>if (getCurrentV2Theme() == 3) {<NEW_LINE>// MaiTung light blue<NEW_LINE>ViewGroup root = (ViewGroup) LayoutInflater.from(this).inflate(R.layout.main_v2_light_blue, null);<NEW_LINE>mainV2Binding = MainV2NormalBinding.bind(root);<NEW_LINE>} else {<NEW_LINE>mainV2Binding = MainV2NormalBinding.inflate<MASK><NEW_LINE>}<NEW_LINE>setContentView(mainV2Binding.getRoot());<NEW_LINE>setSupportActionBar(mainV2Binding.topAppBar);<NEW_LINE>requestTranslucentStatusBar();<NEW_LINE>HolidayHelper.setup(this);<NEW_LINE>updateActivationStatus();<NEW_LINE>SyncUtils.postDelayed(3000, this::updateActivationStatus);<NEW_LINE>} | (LayoutInflater.from(this)); |
226,287 | private void processSyncMessageChunk(CommsByteBuffer buffer, Conversation conversation, boolean connectionMessage) {<NEW_LINE>if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())<NEW_LINE>SibTr.entry(this, tc, "processSyncMessageChunk", new Object[] { buffer, conversation, connectionMessage });<NEW_LINE>// First get the ConnectionProxy for this conversation<NEW_LINE>ClientConversationState convState = <MASK><NEW_LINE>ConnectionProxy connProxy = (ConnectionProxy) convState.getSICoreConnection();<NEW_LINE>if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())<NEW_LINE>SibTr.debug(this, tc, "Found connection: ", connProxy);<NEW_LINE>// Now read the connection object Id<NEW_LINE>// BIT16 ConnectionObjId<NEW_LINE>buffer.getShort();<NEW_LINE>if (connectionMessage) {<NEW_LINE>if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())<NEW_LINE>SibTr.debug(this, tc, "Adding message part directly to connection");<NEW_LINE>connProxy.addMessagePart(buffer);<NEW_LINE>} else {<NEW_LINE>// BIT16 ConsumerSessionId<NEW_LINE>short consumerSessionId = buffer.getShort();<NEW_LINE>if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())<NEW_LINE>SibTr.debug(this, tc, "Consumer Session Id:", "" + consumerSessionId);<NEW_LINE>// Now simply pass the message buffer off to the consumer<NEW_LINE>ConsumerSessionProxy consumer = connProxy.getConsumerSessionProxy(consumerSessionId);<NEW_LINE>if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())<NEW_LINE>SibTr.debug(this, tc, "Found consumer:", consumer);<NEW_LINE>consumer.addMessagePart(buffer);<NEW_LINE>}<NEW_LINE>if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())<NEW_LINE>SibTr.exit(this, tc, "processSyncMessageChunk");<NEW_LINE>} | (ClientConversationState) conversation.getAttachment(); |
949,217 | // json send<NEW_LINE>@Override<NEW_LINE>public void doReportStat(SofaTracerSpan sofaTracerSpan) {<NEW_LINE>Map<String, String> tagsWithStr = sofaTracerSpan.getTagsWithStr();<NEW_LINE>Map<String, Number<MASK><NEW_LINE>StatMapKey statKey = new StatMapKey();<NEW_LINE>statKey.addKey(CommonSpanTags.LOCAL_APP, tagsWithStr.get(CommonSpanTags.LOCAL_APP));<NEW_LINE>statKey.addKey(CommonSpanTags.KAFKA_TOPIC, tagsWithStr.get(CommonSpanTags.KAFKA_TOPIC));<NEW_LINE>statKey.addKey(CommonSpanTags.KAFKA_PARTITION, String.valueOf(tagsWithNumber.get(CommonSpanTags.KAFKA_PARTITION)));<NEW_LINE>// result code<NEW_LINE>String resultCode = tagsWithStr.get(CommonSpanTags.RESULT_CODE);<NEW_LINE>boolean success = isMQSimpleSuccess(resultCode);<NEW_LINE>statKey.setResult(success ? SofaTracerConstant.STAT_FLAG_SUCCESS : SofaTracerConstant.STAT_FLAG_FAILS);<NEW_LINE>// pressure mark<NEW_LINE>statKey.setLoadTest(TracerUtils.isLoadTest(sofaTracerSpan));<NEW_LINE>// end<NEW_LINE>statKey.setEnd(TracerUtils.getLoadTestMark(sofaTracerSpan));<NEW_LINE>// value the count and duration<NEW_LINE>long duration = sofaTracerSpan.getEndTime() - sofaTracerSpan.getStartTime();<NEW_LINE>long[] values = new long[] { 1, duration };<NEW_LINE>// reserve<NEW_LINE>this.addStat(statKey, values);<NEW_LINE>} | > tagsWithNumber = sofaTracerSpan.getTagsWithNumber(); |
1,141,089 | private void initData(JSONObject data) {<NEW_LINE>if (data == null)<NEW_LINE>return;<NEW_LINE>JSONObject info = data.optJSONObject("game_info");<NEW_LINE>int size = info.optInt("boardSize", 19);<NEW_LINE>boardSize = size;<NEW_LINE>Lizzie.board.reopen(boardSize, boardSize);<NEW_LINE>// TODO boardSize<NEW_LINE>history = new BoardHistoryList(BoardData.empty(size, size));<NEW_LINE>blackPlayer = info.optString("blackName");<NEW_LINE>whitePlayer = info.optString("whiteName");<NEW_LINE>boolean isEnd = !Utils.isBlank(info.optString("resultDesc"));<NEW_LINE>history = SGFParser.parseSgf(info.optString("sgf"));<NEW_LINE>if (history != null) {<NEW_LINE>double komi = info.optDouble("komi", history.getGameInfo().getKomi());<NEW_LINE>int handicap = info.optInt("handicap", history.getGameInfo().getHandicap());<NEW_LINE>Lizzie.board.getHistory().getGameInfo().setKomi(komi);<NEW_LINE>Lizzie.board.getHistory().getGameInfo().setHandicap(handicap);<NEW_LINE>Lizzie.leelaz.komi(komi);<NEW_LINE>int diffMove = Lizzie.board.getHistory().sync(history);<NEW_LINE>if (diffMove >= 0) {<NEW_LINE>Lizzie.board.goToMoveNumberBeyondBranch(diffMove > 0 ? diffMove - 1 : 0);<NEW_LINE>while (Lizzie.board.nextMove()) ;<NEW_LINE>}<NEW_LINE>if ("3".equals(info.optString("status"))) {<NEW_LINE>sio.close();<NEW_LINE>String <MASK><NEW_LINE>if (!Utils.isBlank(result)) {<NEW_LINE>Lizzie.board.getHistory().getData().comment = result + "\n" + Lizzie.board.getHistory().getData().comment;<NEW_LINE>Lizzie.board.previousMove();<NEW_LINE>Lizzie.board.nextMove();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (history == null || isEnd) {<NEW_LINE>// error(true);<NEW_LINE>sio.close();<NEW_LINE>if (isEnd && type == 1) {<NEW_LINE>try {<NEW_LINE>refresh("(?s).*?(\\\"Content\\\":\\\")(.+)(\\\",\\\")(?s).*", 2, false, false);<NEW_LINE>} catch (IOException e) {<NEW_LINE>e.printStackTrace();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>Lizzie.frame.setPlayers(whitePlayer, blackPlayer);<NEW_LINE>Lizzie.board.getHistory().getGameInfo().setPlayerBlack(blackPlayer);<NEW_LINE>Lizzie.board.getHistory().getGameInfo().setPlayerWhite(whitePlayer);<NEW_LINE>} | result = info.optString("resultDesc"); |
1,607,673 | private Mono<Response<Flux<ByteBuffer>>> deleteWithResponseAsync(String resourceGroupName, String applicationSecurityGroupName, Context context) {<NEW_LINE>if (this.client.getEndpoint() == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (resourceGroupName == null) {<NEW_LINE>return Mono.<MASK><NEW_LINE>}<NEW_LINE>if (applicationSecurityGroupName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter applicationSecurityGroupName is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (this.client.getSubscriptionId() == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."));<NEW_LINE>}<NEW_LINE>final String apiVersion = "2018-11-01";<NEW_LINE>context = this.client.mergeContext(context);<NEW_LINE>return service.delete(this.client.getEndpoint(), resourceGroupName, applicationSecurityGroupName, apiVersion, this.client.getSubscriptionId(), context);<NEW_LINE>} | error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); |
1,178,426 | public void updateAutoLogin(Tab tab, boolean animate) {<NEW_LINE>DeviceAccountLogin login = tab.getDeviceAccountLogin();<NEW_LINE>if (login != null) {<NEW_LINE>mAutoLoginHandler = login;<NEW_LINE>// TODO: modified, mContext replaced with getContext()<NEW_LINE>ContextThemeWrapper wrapper = new ContextThemeWrapper(getContext(), android.R.style.Theme_Holo_Light);<NEW_LINE>mAccountsAdapter = new ArrayAdapter<String>(wrapper, android.R.layout.simple_spinner_item, login.getAccountNames());<NEW_LINE>mAccountsAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);<NEW_LINE>mAutoLoginAccount.setAdapter(mAccountsAdapter);<NEW_LINE>mAutoLoginAccount.setSelection(0);<NEW_LINE>mAutoLoginAccount.setEnabled(true);<NEW_LINE>mAutoLoginLogin.setEnabled(true);<NEW_LINE><MASK><NEW_LINE>mAutoLoginError.setVisibility(View.GONE);<NEW_LINE>switch(login.getState()) {<NEW_LINE>case DeviceAccountLogin.PROCESSING:<NEW_LINE>mAutoLoginAccount.setEnabled(false);<NEW_LINE>mAutoLoginLogin.setEnabled(false);<NEW_LINE>mAutoLoginProgress.setVisibility(View.VISIBLE);<NEW_LINE>break;<NEW_LINE>case DeviceAccountLogin.FAILED:<NEW_LINE>mAutoLoginProgress.setVisibility(View.INVISIBLE);<NEW_LINE>mAutoLoginError.setVisibility(View.VISIBLE);<NEW_LINE>break;<NEW_LINE>case DeviceAccountLogin.INITIAL:<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>throw new IllegalStateException();<NEW_LINE>}<NEW_LINE>showAutoLogin(animate);<NEW_LINE>} else {<NEW_LINE>hideAutoLogin(animate);<NEW_LINE>}<NEW_LINE>} | mAutoLoginProgress.setVisibility(View.INVISIBLE); |
1,544,954 | public static byte[] jsonToAvro(String json, Schema avroSchema) throws AvroTypeException, IOException {<NEW_LINE>// Prepare reader an input stream from Json string.<NEW_LINE>GenericDatumReader<Object> reader = new GenericDatumReader<>(avroSchema);<NEW_LINE>InputStream input = new ByteArrayInputStream<MASK><NEW_LINE>JsonDecoder jsonDecoder = DecoderFactory.get().jsonDecoder(avroSchema, input);<NEW_LINE>// Prepare write and output stream to produce binary encoding.<NEW_LINE>ByteArrayOutputStream baos = new ByteArrayOutputStream();<NEW_LINE>GenericDatumWriter<Object> writer = new GenericDatumWriter<>(avroSchema);<NEW_LINE>Encoder e = EncoderFactory.get().binaryEncoder(baos, null);<NEW_LINE>// Fill a datum object from jsonDecoder.<NEW_LINE>Object datum = null;<NEW_LINE>try {<NEW_LINE>while (true) {<NEW_LINE>datum = reader.read(datum, jsonDecoder);<NEW_LINE>writer.write(datum, e);<NEW_LINE>e.flush();<NEW_LINE>}<NEW_LINE>} catch (EOFException eofException) {<NEW_LINE>// Nothing to do here, we just exited the loop.<NEW_LINE>}<NEW_LINE>return baos.toByteArray();<NEW_LINE>} | (json.getBytes("UTF-8")); |
1,239,824 | public okhttp3.Call apisApiIdEnvironmentsEnvIdKeysPutCall(String apiId, String envId, Map<String, String> requestBody, final ApiCallback _callback) throws ApiException {<NEW_LINE>Object localVarPostBody = requestBody;<NEW_LINE>// create path and map variables<NEW_LINE>String localVarPath = "/apis/{apiId}/environments/{envId}/keys".replaceAll("\\{" + "apiId" + "\\}", localVarApiClient.escapeString(apiId.toString())).replaceAll("\\{" + "envId" + "\\}", localVarApiClient.escapeString(envId.toString()));<NEW_LINE>List<Pair> localVarQueryParams = new ArrayList<Pair>();<NEW_LINE>List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();<NEW_LINE>Map<String, String> localVarHeaderParams = new HashMap<String, String>();<NEW_LINE>Map<String, String> localVarCookieParams = new HashMap<String, String>();<NEW_LINE>Map<String, Object> localVarFormParams = new HashMap<String, Object>();<NEW_LINE>final String[] localVarAccepts = { "application/json" };<NEW_LINE>final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);<NEW_LINE>if (localVarAccept != null) {<NEW_LINE>localVarHeaderParams.put("Accept", localVarAccept);<NEW_LINE>}<NEW_LINE>final String[] localVarContentTypes = { "application/json" };<NEW_LINE>final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);<NEW_LINE>localVarHeaderParams.put("Content-Type", localVarContentType);<NEW_LINE>String[] localVarAuthNames = new String[] { "OAuth2Security" };<NEW_LINE>return localVarApiClient.buildCall(localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, <MASK><NEW_LINE>} | localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); |
1,606,090 | private void refresh() {<NEW_LINE>String sql = m_sql;<NEW_LINE>int <MASK><NEW_LINE>if (!showAll.isSelected()) {<NEW_LINE>sql = m_sql.substring(0, pos) + s_sqlWhereSameWarehouse + s_sqlNonZero;<NEW_LINE>if (s_sqlMinLife.length() > 0)<NEW_LINE>sql += s_sqlMinLife;<NEW_LINE>sql += m_sql.substring(pos);<NEW_LINE>}<NEW_LINE>//<NEW_LINE>log.finest(sql);<NEW_LINE>PreparedStatement pstmt = null;<NEW_LINE>ResultSet rs = null;<NEW_LINE>try {<NEW_LINE>pstmt = DB.prepareStatement(sql, null);<NEW_LINE>pstmt.setInt(1, m_M_Product_ID);<NEW_LINE>if (!showAll.isSelected()) {<NEW_LINE>pstmt.setInt(2, m_M_Warehouse_ID);<NEW_LINE>pstmt.setInt(3, m_M_Warehouse_ID);<NEW_LINE>}<NEW_LINE>rs = pstmt.executeQuery();<NEW_LINE>m_table.loadTable(rs);<NEW_LINE>} catch (Exception e) {<NEW_LINE>log.log(Level.SEVERE, sql, e);<NEW_LINE>} finally {<NEW_LINE>DB.close(rs, pstmt);<NEW_LINE>rs = null;<NEW_LINE>pstmt = null;<NEW_LINE>}<NEW_LINE>enableButtons();<NEW_LINE>} | pos = m_sql.lastIndexOf(" ORDER BY "); |
408,145 | public static void main(String[] args) {<NEW_LINE>OkHttpClient http = new OkHttpClient();<NEW_LINE>PokemonGo api = new PokemonGo(http);<NEW_LINE>try {<NEW_LINE>HashProvider hasher = ExampleConstants.getHashProvider();<NEW_LINE>api.login(new PtcCredentialProvider(http, ExampleConstants.LOGIN, ExampleConstants.PASSWORD), hasher);<NEW_LINE>api.setLocation(ExampleConstants.LATITUDE, ExampleConstants.LONGITUDE, ExampleConstants.ALTITUDE);<NEW_LINE>Set<Pokestop> pokestops = api.getMap().mapObjects.pokestops;<NEW_LINE>System.out.println("Found " + pokestops.size() + " pokestops in the current area.");<NEW_LINE>Pokestop destinationPokestop = null;<NEW_LINE>for (Pokestop pokestop : pokestops) {<NEW_LINE>// Check if not in range and if it is not on cooldown<NEW_LINE>if (!pokestop.inRange() && pokestop.canLoot(true)) {<NEW_LINE>destinationPokestop = pokestop;<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (destinationPokestop != null) {<NEW_LINE>Point destination = new Point(destinationPokestop.getLatitude(), destinationPokestop.getLongitude());<NEW_LINE>// Use the current player position as the source and the pokestop position as the destination<NEW_LINE>// Travel to Pokestop at 20KMPH<NEW_LINE>Path path = new Path(api.getPoint(), destination, 20.0);<NEW_LINE>System.out.println("Traveling to " + destination + " at 20KMPH!");<NEW_LINE>path.start(api);<NEW_LINE>try {<NEW_LINE>while (!path.complete) {<NEW_LINE>// Calculate the desired intermediate point for the current time<NEW_LINE>Point point = path.calculateIntermediate(api);<NEW_LINE>// Set the API location to that point<NEW_LINE>api.setLatitude(point.getLatitude());<NEW_LINE>api.setLongitude(point.getLongitude());<NEW_LINE>System.out.println("Time left: " + (int) (path.getTimeLeft(api) / 1000) + " seconds.");<NEW_LINE>// Sleep for 2 seconds before setting the location again<NEW_LINE>Thread.sleep(2000);<NEW_LINE>}<NEW_LINE>} catch (InterruptedException e) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>System.out.println("Finished traveling to pokestop!");<NEW_LINE>if (destinationPokestop.inRange()) {<NEW_LINE>System.out.println("Looting pokestop...");<NEW_LINE><MASK><NEW_LINE>System.out.println("Pokestop loot returned result: " + result.getResult());<NEW_LINE>} else {<NEW_LINE>System.out.println("Something went wrong! We're still not in range of the destination pokestop!");<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>System.out.println("Couldn't find out of range pokestop to travel to!");<NEW_LINE>}<NEW_LINE>} catch (RequestFailedException e) {<NEW_LINE>Log.e("Main", "Failed to login, captcha or server issue: ", e);<NEW_LINE>}<NEW_LINE>} | PokestopLootResult result = destinationPokestop.loot(); |
39,642 | protected Object[] doForeignObject(Object obj, @CachedLibrary("obj") InteropLibrary interop, @Cached("create()") BranchProfile hasPropertiesBranch, @Cached("create()") ImportValueNode foreignConvertNode) {<NEW_LINE>try {<NEW_LINE>if (!interop.hasArrayElements(obj)) {<NEW_LINE>errorBranch.enter();<NEW_LINE>throw Errors.createTypeError("foreign Object reports not to have a SIZE");<NEW_LINE>}<NEW_LINE>long <MASK><NEW_LINE>if (len > context.getContextOptions().getMaxApplyArgumentLength()) {<NEW_LINE>errorBranch.enter();<NEW_LINE>throw Errors.createRangeErrorTooManyArguments();<NEW_LINE>}<NEW_LINE>int iLen = (int) len;<NEW_LINE>Object[] arr = new Object[iLen];<NEW_LINE>if (len > 0) {<NEW_LINE>hasPropertiesBranch.enter();<NEW_LINE>for (int i = 0; i < iLen; i++) {<NEW_LINE>arr[i] = foreignConvertNode.executeWithTarget(interop.readArrayElement(obj, i));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return arr;<NEW_LINE>} catch (InvalidArrayIndexException | UnsupportedMessageException e) {<NEW_LINE>errorBranch.enter();<NEW_LINE>throw Errors.createTypeErrorNotAnObject(obj);<NEW_LINE>}<NEW_LINE>} | len = interop.getArraySize(obj); |
291,482 | private static PaddedCell check(Formatter formatter, File file, String original, int maxLength) {<NEW_LINE>if (maxLength < 2) {<NEW_LINE>throw new IllegalArgumentException("maxLength must be at least 2");<NEW_LINE>}<NEW_LINE>String appliedOnce = formatter.compute(original, file);<NEW_LINE>if (appliedOnce.equals(original)) {<NEW_LINE>return Type.CONVERGE.create(file<MASK><NEW_LINE>}<NEW_LINE>String appliedTwice = formatter.compute(appliedOnce, file);<NEW_LINE>if (appliedOnce.equals(appliedTwice)) {<NEW_LINE>return Type.CONVERGE.create(file, Collections.singletonList(appliedOnce));<NEW_LINE>}<NEW_LINE>List<String> appliedN = new ArrayList<>();<NEW_LINE>appliedN.add(appliedOnce);<NEW_LINE>appliedN.add(appliedTwice);<NEW_LINE>String input = appliedTwice;<NEW_LINE>while (appliedN.size() < maxLength) {<NEW_LINE>String output = formatter.compute(input, file);<NEW_LINE>if (output.equals(input)) {<NEW_LINE>return Type.CONVERGE.create(file, appliedN);<NEW_LINE>} else {<NEW_LINE>int idx = appliedN.indexOf(output);<NEW_LINE>if (idx >= 0) {<NEW_LINE>return Type.CYCLE.create(file, appliedN.subList(idx, appliedN.size()));<NEW_LINE>} else {<NEW_LINE>appliedN.add(output);<NEW_LINE>input = output;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return Type.DIVERGE.create(file, appliedN);<NEW_LINE>} | , Collections.singletonList(appliedOnce)); |
6,346 | public void visitFunctionCallExpression(@NotNull ErlangFunctionCallExpression call) {<NEW_LINE>PsiReference reference = call.getReference();<NEW_LINE>PsiElement parent = call.getParent();<NEW_LINE>ErlangModuleRef moduleRef = parent instanceof ErlangGlobalFunctionCallExpression ? ((ErlangGlobalFunctionCallExpression) parent).getModuleRef() : null;<NEW_LINE>if (call.getQAtom().getMacros() != null || moduleRef != null && moduleRef.getQAtom().getMacros() != null || !(reference instanceof ErlangFunctionReference) || reference.resolve() != null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>int arity = call.getArgumentList().getExpressionList().size();<NEW_LINE>String presentation = ErlangPsiImplUtil.createFunctionPresentation(name, arity);<NEW_LINE>String fixMessage = "Create Function " + (moduleRef != null ? moduleRef.getText() + ":" : "") + presentation;<NEW_LINE>LocalQuickFix[] fixes = parent instanceof ErlangGenericFunctionCallExpression || parent instanceof ErlangGlobalFunctionCallExpression ? new LocalQuickFix[0] : new LocalQuickFix[] { createFix(call, fixMessage) };<NEW_LINE>registerProblem(holder, call.getNameIdentifier(), "Unresolved function " + presentation, fixes);<NEW_LINE>} | String name = call.getName(); |
697,564 | public TraceReader readFiles(List<String> filePaths) {<NEW_LINE>return new TraceReader() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public ImmutableSet<Characteristic> characteristics() {<NEW_LINE>return readers().stream().flatMap(reader -> reader.characteristics().stream()).collect(toImmutableEnumSet());<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public Stream<AccessEvent> events() {<NEW_LINE>return readers().stream().flatMap(TraceReader::events);<NEW_LINE>}<NEW_LINE><NEW_LINE>private List<TraceReader> readers() {<NEW_LINE>return filePaths.stream().map(path -> {<NEW_LINE>List<String> parts = Splitter.on(':').limit(2).splitToList(path);<NEW_LINE>TraceFormat format = (parts.size() == 1) ? TraceFormat.this : named(parts.get(0));<NEW_LINE>return format.factory.apply(Iterables.getLast(parts));<NEW_LINE>}<MASK><NEW_LINE>}<NEW_LINE>};<NEW_LINE>} | ).collect(toList()); |
1,673,583 | final SearchDashboardsResult executeSearchDashboards(SearchDashboardsRequest searchDashboardsRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(searchDashboardsRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<SearchDashboardsRequest> request = null;<NEW_LINE>Response<SearchDashboardsResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new SearchDashboardsRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(searchDashboardsRequest));<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(<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "QuickSight");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "SearchDashboards");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<SearchDashboardsResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new SearchDashboardsResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | HandlerContextKey.SIGNING_REGION, getSigningRegion()); |
397,620 | protected long[] readMV4x4(int miCol, int miRow, int blSz, VPXBooleanDecoder decoder, DecodingContext c, int packedRefFrames) {<NEW_LINE>int subMode0 = readInterMode(miCol, miRow, blSz, decoder, c);<NEW_LINE>long mvl0 = readSub0(miCol, miRow, blSz, decoder, c, subMode0, packedRefFrames);<NEW_LINE>int subMode1 = readInterMode(miCol, <MASK><NEW_LINE>long mvl1 = readSub12(miCol, miRow, blSz, decoder, c, mvl0, subMode1, 1, packedRefFrames);<NEW_LINE>int subMode2 = readInterMode(miCol, miRow, blSz, decoder, c);<NEW_LINE>long mvl2 = readSub12(miCol, miRow, blSz, decoder, c, mvl0, subMode2, 2, packedRefFrames);<NEW_LINE>int subMode3 = readInterMode(miCol, miRow, blSz, decoder, c);<NEW_LINE>long mvl3 = readMvSub3(miCol, miRow, blSz, decoder, c, mvl0, mvl1, mvl2, subMode3, packedRefFrames);<NEW_LINE>updateMVLineBuffers(miCol, miRow, blSz, c, mvl3);<NEW_LINE>updateMVLineBuffers4x4(miCol, miRow, blSz, c, mvl1, mvl2);<NEW_LINE>// int subModes = (subMode0 << 24) | (subMode1 << 16) | (subMode2 << 8) | subMode3;<NEW_LINE>return new long[] { mvl0, mvl1, mvl2, mvl3 };<NEW_LINE>} | miRow, blSz, decoder, c); |
1,670,890 | public void checkFilesForChanges(IncrementalTaskInputs inputs) {<NEW_LINE>getLogger().lifecycle("Checking idl and snapshot files for changes...");<NEW_LINE>getLogger().info("idlFiles: " + _idlFiles.getAsPath());<NEW_LINE>getLogger().info("snapshotFiles: " + _snapshotFiles.getAsPath());<NEW_LINE>Set<String> filesRemoved = new HashSet<>();<NEW_LINE>Set<String> filesAdded = new HashSet<>();<NEW_LINE>Set<String> <MASK><NEW_LINE>if (inputs.isIncremental()) {<NEW_LINE>inputs.outOfDate(inputFileDetails -> {<NEW_LINE>if (inputFileDetails.isAdded()) {<NEW_LINE>filesAdded.add(inputFileDetails.getFile().getAbsolutePath());<NEW_LINE>}<NEW_LINE>if (inputFileDetails.isRemoved()) {<NEW_LINE>filesRemoved.add(inputFileDetails.getFile().getAbsolutePath());<NEW_LINE>}<NEW_LINE>if (inputFileDetails.isModified()) {<NEW_LINE>filesChanged.add(inputFileDetails.getFile().getAbsolutePath());<NEW_LINE>}<NEW_LINE>});<NEW_LINE>inputs.removed(inputFileDetails -> filesRemoved.add(inputFileDetails.getFile().getAbsolutePath()));<NEW_LINE>if (!filesRemoved.isEmpty()) {<NEW_LINE>String files = joinByComma(filesRemoved);<NEW_LINE>_needCheckinFiles.add(files);<NEW_LINE>getLogger().lifecycle("The following files have been removed, be sure to remove them from source control: {}", files);<NEW_LINE>}<NEW_LINE>if (!filesAdded.isEmpty()) {<NEW_LINE>String files = joinByComma(filesAdded);<NEW_LINE>_needCheckinFiles.add(files);<NEW_LINE>getLogger().lifecycle("The following files have been added, be sure to add them to source control: {}", files);<NEW_LINE>}<NEW_LINE>if (!filesChanged.isEmpty()) {<NEW_LINE>String files = joinByComma(filesChanged);<NEW_LINE>_needCheckinFiles.add(files);<NEW_LINE>getLogger().lifecycle("The following files have been changed, be sure to commit the changes to source control: {}", files);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | filesChanged = new HashSet<>(); |
1,667,570 | public static String multiplication(String input) {<NEW_LINE>double num1 = 0, num2 = 0, ans = 0;<NEW_LINE>int b = 0, t1 = 0, t2 = 0;<NEW_LINE>String anstring = "";<NEW_LINE>String temp = "";<NEW_LINE>int count = 0;<NEW_LINE>while (b < input.length()) {<NEW_LINE>if (input.charAt(b) == '*') {<NEW_LINE>num1 = getbacknumber(input, (b - 1));<NEW_LINE>num2 = getfrontnumber(input, (b + 1));<NEW_LINE>ans = num1 * num2;<NEW_LINE>t1 = getendex(input, (b - 1));<NEW_LINE>t2 = getfrontex(input, (b + 1));<NEW_LINE>if (ans >= 0) {<NEW_LINE>anstring = "+" + String.valueOf(ans);<NEW_LINE>temp = input.substring(0, t1) + anstring + input.substring(t2 + 1);<NEW_LINE>} else {<NEW_LINE><MASK><NEW_LINE>temp = input.substring(0, t1) + anstring + input.substring(t2 + 1);<NEW_LINE>}<NEW_LINE>count++;<NEW_LINE>b = 1;<NEW_LINE>}<NEW_LINE>if ((count > 0) && (input != temp)) {<NEW_LINE>input = simplification1(temp);<NEW_LINE>}<NEW_LINE>b++;<NEW_LINE>}<NEW_LINE>return input;<NEW_LINE>} | anstring = String.valueOf(ans); |
1,434,546 | public Iterable<Map<String, Object>> run(final String statement, final Map<String, Object> map) {<NEW_LINE>try {<NEW_LINE>logQuery(statement, map);<NEW_LINE>final ResultCursor cursor = resolveImmediately(tx<MASK><NEW_LINE>final List<Record> records = resolveImmediately(cursor.listAsync());<NEW_LINE>return Iterables.map(new RecordMapMapper(db), records);<NEW_LINE>} catch (TransientException tex) {<NEW_LINE>closed = true;<NEW_LINE>throw new RetryException(tex);<NEW_LINE>} catch (NoSuchRecordException nex) {<NEW_LINE>throw new NotFoundException(nex);<NEW_LINE>} catch (ServiceUnavailableException ex) {<NEW_LINE>throw new NetworkException(ex.getMessage(), ex);<NEW_LINE>} catch (DatabaseException dex) {<NEW_LINE>throw AsyncSessionTransaction.translateDatabaseException(dex);<NEW_LINE>} catch (ClientException cex) {<NEW_LINE>throw AsyncSessionTransaction.translateClientException(cex);<NEW_LINE>}<NEW_LINE>} | .runAsync(statement, map)); |
1,138,006 | public void onViewCreated(final View view, @Nullable Bundle savedInstanceState) {<NEW_LINE>setupImageFormatEntries(sampleUris());<NEW_LINE>mButton = (Button) view.findViewById(R.id.button);<NEW_LINE>mDraweeMain = (SimpleDraweeView) view.findViewById(R.id.drawee_view);<NEW_LINE>mSizeSpinner = (Spinner) view.findViewById(R.id.spinner_size);<NEW_LINE>mFormatSpinner = (Spinner) view.findViewById(R.id.spinner_format);<NEW_LINE>mSizeSpinner<MASK><NEW_LINE>mSizeSpinner.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {<NEW_LINE>reloadImage();<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onNothingSelected(AdapterView<?> parent) {<NEW_LINE>}<NEW_LINE>});<NEW_LINE>mSizeSpinner.setSelection(0);<NEW_LINE>mFormatSpinner.setAdapter(new SimpleImageFormatAdapter(mImageFormatEntries));<NEW_LINE>mFormatSpinner.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {<NEW_LINE>reloadImage();<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onNothingSelected(AdapterView<?> parent) {<NEW_LINE>}<NEW_LINE>});<NEW_LINE>mFormatSpinner.setSelection(0);<NEW_LINE>mDraweeMain.setOnClickListener(new View.OnClickListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onClick(View v) {<NEW_LINE>reloadImage();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>view.getViewTreeObserver().addOnGlobalLayoutListener(new ViewTreeObserver.OnGlobalLayoutListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onGlobalLayout() {<NEW_LINE>ResizableFrameLayout mainImageFrameLayout = (ResizableFrameLayout) view.findViewById(R.id.frame_main);<NEW_LINE>mainImageFrameLayout.init(view.findViewById(R.id.btn_resize));<NEW_LINE>if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) {<NEW_LINE>view.getViewTreeObserver().removeOnGlobalLayoutListener(this);<NEW_LINE>} else {<NEW_LINE>view.getViewTreeObserver().removeGlobalOnLayoutListener(this);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} | .setAdapter(new SimpleResizeOptionsAdapter()); |
373,408 | public void marshall(CreateKeyRequest createKeyRequest, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (createKeyRequest == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(createKeyRequest.getPolicy(), POLICY_BINDING);<NEW_LINE>protocolMarshaller.marshall(createKeyRequest.getDescription(), DESCRIPTION_BINDING);<NEW_LINE>protocolMarshaller.marshall(<MASK><NEW_LINE>protocolMarshaller.marshall(createKeyRequest.getCustomerMasterKeySpec(), CUSTOMERMASTERKEYSPEC_BINDING);<NEW_LINE>protocolMarshaller.marshall(createKeyRequest.getKeySpec(), KEYSPEC_BINDING);<NEW_LINE>protocolMarshaller.marshall(createKeyRequest.getOrigin(), ORIGIN_BINDING);<NEW_LINE>protocolMarshaller.marshall(createKeyRequest.getCustomKeyStoreId(), CUSTOMKEYSTOREID_BINDING);<NEW_LINE>protocolMarshaller.marshall(createKeyRequest.getBypassPolicyLockoutSafetyCheck(), BYPASSPOLICYLOCKOUTSAFETYCHECK_BINDING);<NEW_LINE>protocolMarshaller.marshall(createKeyRequest.getTags(), TAGS_BINDING);<NEW_LINE>protocolMarshaller.marshall(createKeyRequest.getMultiRegion(), MULTIREGION_BINDING);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>} | createKeyRequest.getKeyUsage(), KEYUSAGE_BINDING); |
655,848 | synchronized void connectionError(final SibRaMessagingEngineConnection connection, final SIException exception) {<NEW_LINE>final String methodName = "connectionError";<NEW_LINE>if (TraceComponent.isAnyTracingEnabled() && TRACE.isEntryEnabled()) {<NEW_LINE>SibTr.entry(this, TRACE, methodName, new Object[] { connection, exception });<NEW_LINE>}<NEW_LINE>if (_remoteMessagingEngine) {<NEW_LINE>if (connection.equals(_remoteConnection)) {<NEW_LINE>SibTr.warning(TRACE, "CONNECTION_ERROR_CWSIV0776", new Object[] { connection.getConnection().getMeName(), _endpointConfiguration.getBusName<MASK><NEW_LINE>_remoteConnection.close();<NEW_LINE>_remoteConnection = null;<NEW_LINE>scheduleCreateRemoteListener();<NEW_LINE>} else {<NEW_LINE>if (TraceComponent.isAnyTracingEnabled() && TRACE.isDebugEnabled()) {<NEW_LINE>SibTr.debug(this, TRACE, "Connection " + connection + " not equal to current remote connection " + _remoteConnection);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>SibTr.error(TRACE, "CONNECTION_ERROR_CWSIV0767", new Object[] { exception, connection.getConnection().getMeName(), this });<NEW_LINE>deactivate();<NEW_LINE>}<NEW_LINE>if (TraceComponent.isAnyTracingEnabled() && TRACE.isEntryEnabled()) {<NEW_LINE>SibTr.exit(this, TRACE, methodName);<NEW_LINE>}<NEW_LINE>} | (), this, exception }); |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.