idx int32 46 1.86M | input stringlengths 321 6.6k | target stringlengths 9 1.24k |
|---|---|---|
1,023,207 | protected void handleJavaScriptException(ScriptException scriptException, boolean triggerOnError) {<NEW_LINE>// XXX(tbroyer): copied from JavaScriptEngine to call below triggerOnError<NEW_LINE>// instead of Window's triggerOnError.<NEW_LINE>// Trigger window.onerror, if it has been set.<NEW_LINE>final InteractivePage page = scriptException.getPage();<NEW_LINE>if (triggerOnError && page != null) {<NEW_LINE>final WebWindow window = page.getEnclosingWindow();<NEW_LINE>if (window != null) {<NEW_LINE>final Window w = (Window) window.getScriptableObject();<NEW_LINE>if (w != null) {<NEW_LINE>try {<NEW_LINE>triggerOnError(w, scriptException);<NEW_LINE>} catch (final Exception e) {<NEW_LINE>handleJavaScriptException(new ScriptException(page, e, null), false);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>final JavaScriptErrorListener javaScriptErrorListener = getWebClient().getJavaScriptErrorListener();<NEW_LINE>if (javaScriptErrorListener != null) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>// Throw a Java exception if the user wants us to.<NEW_LINE>if (getWebClient().getOptions().isThrowExceptionOnScriptError()) {<NEW_LINE>throw scriptException;<NEW_LINE>}<NEW_LINE>// Log the error; ScriptException instances provide good debug info.<NEW_LINE>LOG.info("Caught script exception", scriptException);<NEW_LINE>} | javaScriptErrorListener.scriptException(page, scriptException); |
64,133 | private ReuseSet generateReuseSet(ReuseKey key) {<NEW_LINE>long start = System.nanoTime();<NEW_LINE>ReuseSet reuseSet = new ReuseSet();<NEW_LINE>try (DatabaseSession databaseSession = bimServer.getDatabase().createSession(OperationType.READ_ONLY)) {<NEW_LINE>// Assuming all given roids are of projects that all have the same schema<NEW_LINE>Revision revision = databaseSession.get(key.getRoids().iterator().next(), OldQuery.getDefault());<NEW_LINE>PackageMetaData packageMetaData = bimServer.getMetaDataManager().getPackageMetaData(revision.getProject().getSchema());<NEW_LINE>Query query = new Query(packageMetaData);<NEW_LINE>Set<EClass> excluded = new HashSet<>();<NEW_LINE>for (String exclude : key.getExcludedClasses()) {<NEW_LINE>excluded.add(packageMetaData.getEClass(exclude));<NEW_LINE>}<NEW_LINE>QueryPart queryPart = query.createQueryPart();<NEW_LINE>queryPart.addType(packageMetaData.getEClass("IfcProduct"), true, excluded);<NEW_LINE>Include product = queryPart.createInclude();<NEW_LINE>product.addType(packageMetaData.getEClass("IfcProduct"), true);<NEW_LINE>product.addFieldDirect("geometry");<NEW_LINE>Include geometryInfo = product.createInclude();<NEW_LINE>geometryInfo.addType(GeometryPackage.eINSTANCE.getGeometryInfo(), false);<NEW_LINE>Map<Long, ReuseObject> map = new HashMap<>();<NEW_LINE>QueryObjectProvider queryObjectProvider = new QueryObjectProvider(databaseSession, bimServer, query, key.getRoids(), packageMetaData);<NEW_LINE>HashMapVirtualObject next = queryObjectProvider.next();<NEW_LINE>while (next != null) {<NEW_LINE>AbstractHashMapVirtualObject geometry = next.getDirectFeature(packageMetaData.getEReference("IfcProduct", "geometry"));<NEW_LINE>if (geometry != null) {<NEW_LINE>Long dataId = (Long) geometry.get("data");<NEW_LINE>ReuseObject reuseObject = map.get(dataId);<NEW_LINE>if (reuseObject == null) {<NEW_LINE>reuseObject = new ReuseObject(dataId, 1, (int<MASK><NEW_LINE>map.put(dataId, reuseObject);<NEW_LINE>} else {<NEW_LINE>reuseObject.inc();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>next = queryObjectProvider.next();<NEW_LINE>}<NEW_LINE>for (long dataId : map.keySet()) {<NEW_LINE>reuseSet.add(map.get(dataId));<NEW_LINE>}<NEW_LINE>long end = System.nanoTime();<NEW_LINE>LOGGER.info("ReuseSets generated in " + ((end - start) / 1000000) + " ms");<NEW_LINE>} catch (BimserverDatabaseException e) {<NEW_LINE>LOGGER.error("", e);<NEW_LINE>} catch (QueryException e) {<NEW_LINE>LOGGER.error("", e);<NEW_LINE>} catch (IOException e) {<NEW_LINE>LOGGER.error("", e);<NEW_LINE>}<NEW_LINE>return reuseSet;<NEW_LINE>} | ) geometry.get("primitiveCount")); |
737,834 | protected StockMove _createToProduceStockMove(ManufOrder manufOrder, Company company) throws AxelorException {<NEW_LINE>StockConfigProductionService stockConfigService = Beans.get(StockConfigProductionService.class);<NEW_LINE>StockConfig stockConfig = stockConfigService.getStockConfig(company);<NEW_LINE>StockLocation virtualStockLocation = stockConfigService.getProductionVirtualStockLocation(stockConfig, manufOrder.getProdProcess().getOutsourcing());<NEW_LINE>LocalDateTime plannedEndDateT = manufOrder.getPlannedEndDateT();<NEW_LINE>LocalDate plannedEndDate = plannedEndDateT != null ? plannedEndDateT.toLocalDate() : null;<NEW_LINE>StockLocation producedProductStockLocation = manufOrder<MASK><NEW_LINE>if (producedProductStockLocation == null) {<NEW_LINE>producedProductStockLocation = stockConfigService.getFinishedProductsDefaultStockLocation(stockConfig);<NEW_LINE>}<NEW_LINE>StockMove stockMove = stockMoveService.createStockMove(null, null, company, virtualStockLocation, producedProductStockLocation, null, plannedEndDate, null, StockMoveRepository.TYPE_INTERNAL);<NEW_LINE>stockMove.setOriginId(manufOrder.getId());<NEW_LINE>stockMove.setOriginTypeSelect(StockMoveRepository.ORIGIN_MANUF_ORDER);<NEW_LINE>stockMove.setOrigin(manufOrder.getManufOrderSeq());<NEW_LINE>return stockMove;<NEW_LINE>} | .getProdProcess().getProducedProductStockLocation(); |
901,438 | private static Op[] createOps(int encFlags1) {<NEW_LINE>int op0 = (encFlags1 >>> EncFlags1.EVEX_OP0_SHIFT) & EncFlags1.EVEX_OP_MASK;<NEW_LINE>int op1 = (encFlags1 >>> EncFlags1.EVEX_OP1_SHIFT) & EncFlags1.EVEX_OP_MASK;<NEW_LINE>int op2 = (encFlags1 >>> EncFlags1.EVEX_OP2_SHIFT) & EncFlags1.EVEX_OP_MASK;<NEW_LINE>int op3 = (encFlags1 >>> EncFlags1.EVEX_OP3_SHIFT) & EncFlags1.EVEX_OP_MASK;<NEW_LINE>if (op3 != 0) {<NEW_LINE>assert op0 != 0 && op1 != 0 && op2 != 0;<NEW_LINE>return new Op[] { OpTables.evexOps[op0 - 1], OpTables.evexOps[op1 - 1], OpTables.evexOps[op2 - 1], OpTables.evexOps[op3 - 1] };<NEW_LINE>}<NEW_LINE>if (op2 != 0) {<NEW_LINE>assert op0 != 0 && op1 != 0;<NEW_LINE>return new Op[] { OpTables.evexOps[op0 - 1], OpTables.evexOps[op1 - 1], OpTables.evexOps[op2 - 1] };<NEW_LINE>}<NEW_LINE>if (op1 != 0) {<NEW_LINE>assert op0 != 0;<NEW_LINE>return new Op[] { OpTables.evexOps[op0 - 1], OpTables.evexOps[op1 - 1] };<NEW_LINE>}<NEW_LINE>if (op0 != 0)<NEW_LINE>return new Op[] { OpTables<MASK><NEW_LINE>return new Op[0];<NEW_LINE>} | .evexOps[op0 - 1] }; |
1,563,583 | public AnomalyReportedTimeRange unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>AnomalyReportedTimeRange anomalyReportedTimeRange = new AnomalyReportedTimeRange();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>if (context.testExpression("OpenTime", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>anomalyReportedTimeRange.setOpenTime(DateJsonUnmarshallerFactory.getInstance(<MASK><NEW_LINE>}<NEW_LINE>if (context.testExpression("CloseTime", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>anomalyReportedTimeRange.setCloseTime(DateJsonUnmarshallerFactory.getInstance("unixTimestamp").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 anomalyReportedTimeRange;<NEW_LINE>} | "unixTimestamp").unmarshall(context)); |
1,318,192 | private static void addPathSetMapToBundle(Map<String, Map<String, String>> pathSetMap, Map<String, Object> bundle) {<NEW_LINE>// We previously built a mapping from path to path ID and regular<NEW_LINE>// expression - see fromOperation for details. Sort it and add an<NEW_LINE>// index, and then add it to the objects that we're about to pass to<NEW_LINE>// the templates to process.<NEW_LINE>List<Map.Entry<String, Map<String, String>>> pathSetEntryList = new ArrayList(pathSetMap.entrySet());<NEW_LINE>Collections.sort(pathSetEntryList, new Comparator<Map.Entry<String, Map<String, String>>>() {<NEW_LINE><NEW_LINE>public int compare(Map.Entry<String, Map<String, String>> a, Map.Entry<String, Map<String, String>> b) {<NEW_LINE>return a.getValue().get("path").compareTo(b.getValue().get("path"));<NEW_LINE>}<NEW_LINE>});<NEW_LINE>List pathSet = new ArrayList<Map<String, String>>();<NEW_LINE>int index = 0;<NEW_LINE>for (Map.Entry<String, Map<String, String>> pathSetEntry : pathSetEntryList) {<NEW_LINE>Map<String, String> pathSetEntryValue = pathSetEntry.getValue();<NEW_LINE>pathSetEntryValue.put("index", Integer.toString(index));<NEW_LINE>index++;<NEW_LINE>pathSet.add(pathSetEntryValue);<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>} | bundle.put("pathSet", pathSet); |
111,201 | final ListAssessmentFrameworksResult executeListAssessmentFrameworks(ListAssessmentFrameworksRequest listAssessmentFrameworksRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(listAssessmentFrameworksRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<ListAssessmentFrameworksRequest> request = null;<NEW_LINE>Response<ListAssessmentFrameworksResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new ListAssessmentFrameworksRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(listAssessmentFrameworksRequest));<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, "AuditManager");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ListAssessmentFrameworks");<NEW_LINE>request.<MASK><NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<ListAssessmentFrameworksResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new ListAssessmentFrameworksResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig); |
1,269,807 | private JSONObject stdPeopleMessage(String actionType, Object properties) throws JSONException {<NEW_LINE>final JSONObject dataObj = new JSONObject();<NEW_LINE>// TODO ensure getDistinctId is thread safe<NEW_LINE>final String distinctId = getDistinctId();<NEW_LINE>final String anonymousId = getAnonymousId();<NEW_LINE>dataObj.put(actionType, properties);<NEW_LINE><MASK><NEW_LINE>dataObj.put("$time", System.currentTimeMillis());<NEW_LINE>dataObj.put("$had_persisted_distinct_id", mPersistentIdentity.getHadPersistedDistinctId());<NEW_LINE>if (null != anonymousId) {<NEW_LINE>dataObj.put("$device_id", anonymousId);<NEW_LINE>}<NEW_LINE>if (null != distinctId) {<NEW_LINE>dataObj.put("$distinct_id", distinctId);<NEW_LINE>dataObj.put("$user_id", distinctId);<NEW_LINE>}<NEW_LINE>dataObj.put("$mp_metadata", mSessionMetadata.getMetadataForPeople());<NEW_LINE>return dataObj;<NEW_LINE>} | dataObj.put("$token", mToken); |
1,010,560 | void pruneNearlyIdenticalAngles() {<NEW_LINE>for (int i = 0; i < listInfo.size(); i++) {<NEW_LINE>NodeInfo infoN = listInfo.get(i);<NEW_LINE>for (int j = 0; j < infoN.edges.size(); ) {<NEW_LINE>int k = (j + 1) % infoN.edges.size;<NEW_LINE>double angularDiff = UtilAngle.dist(infoN.edges.get(j).angle, infoN.edges.get(k).angle);<NEW_LINE>if (angularDiff < UtilAngle.radian(5)) {<NEW_LINE>NodeInfo infoJ = infoN.edges.get(j).target;<NEW_LINE>NodeInfo infoK = infoN.edges.get(k).target;<NEW_LINE>double distJ = infoN.ellipse.center.<MASK><NEW_LINE>double distK = infoN.ellipse.center.distance(infoK.ellipse.center);<NEW_LINE>if (distJ < distK) {<NEW_LINE>infoN.edges.remove(k);<NEW_LINE>} else {<NEW_LINE>infoN.edges.remove(j);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>j++;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | distance(infoJ.ellipse.center); |
640,223 | private Map<String, FileResource> makeCustomFileBundle(final SessionLabel sessionLabel, final DomainConfig domainConfig) {<NEW_LINE>final Map<String, FileResource> customFileBundle = new HashMap<>();<NEW_LINE>final Map<FileValue.FileInformation, FileValue.FileContent> files = domainConfig.readSettingAsFile(PwmSetting.DISPLAY_CUSTOM_RESOURCE_BUNDLE);<NEW_LINE>if (!CollectionUtil.isEmpty(files)) {<NEW_LINE>final Map.Entry<FileValue.FileInformation, FileValue.FileContent> entry = files.entrySet().iterator().next();<NEW_LINE>final FileValue.FileInformation fileInformation = entry.getKey();<NEW_LINE>final FileValue.FileContent fileContent = entry.getValue();<NEW_LINE>LOGGER.debug(sessionLabel, () -> "examining configured zip file resource for items name=" + fileInformation.getFilename() + ", size=" + fileContent.size());<NEW_LINE>try {<NEW_LINE>final byte[] bytes = entry.getValue()<MASK><NEW_LINE>final String path = "/tmp/" + domainConfig.getDomainID().stringValue();<NEW_LINE>FileUtils.writeByteArrayToFile(new File(path), bytes);<NEW_LINE>final Map<String, FileResource> customFiles = makeMemoryFileMapFromZipInput(sessionLabel, fileContent.getContents());<NEW_LINE>customFileBundle.putAll(customFiles);<NEW_LINE>} catch (final IOException e) {<NEW_LINE>LOGGER.error(sessionLabel, () -> "error assembling memory file map zip bundle: " + e.getMessage());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return Collections.unmodifiableMap(customFileBundle);<NEW_LINE>} | .getContents().copyOf(); |
1,372,915 | public void addJvmMData(MNode mNode, List<MData> mDatas) {<NEW_LINE><MASK><NEW_LINE>List<JVMGCDataPo> jvmGCDataPos = new ArrayList<JVMGCDataPo>(size);<NEW_LINE>List<JVMMemoryDataPo> jvmMemoryDataPos = new ArrayList<JVMMemoryDataPo>(size);<NEW_LINE>List<JVMThreadDataPo> jvmThreadDataPos = new ArrayList<JVMThreadDataPo>(size);<NEW_LINE>for (MData mData : mDatas) {<NEW_LINE>JvmMData JVMMData = mData.getJvmMData();<NEW_LINE>Long timestamp = mData.getTimestamp();<NEW_LINE>// gc<NEW_LINE>JVMGCDataPo jvmgcDataPo = getDataPo(JVMMData.getGcMap(), JVMGCDataPo.class, mNode, timestamp);<NEW_LINE>jvmGCDataPos.add(jvmgcDataPo);<NEW_LINE>// memory<NEW_LINE>JVMMemoryDataPo jvmMemoryDataPo = getDataPo(JVMMData.getMemoryMap(), JVMMemoryDataPo.class, mNode, timestamp);<NEW_LINE>jvmMemoryDataPos.add(jvmMemoryDataPo);<NEW_LINE>// thread<NEW_LINE>JVMThreadDataPo jvmThreadDataPo = getDataPo(JVMMData.getThreadMap(), JVMThreadDataPo.class, mNode, timestamp);<NEW_LINE>jvmThreadDataPos.add(jvmThreadDataPo);<NEW_LINE>}<NEW_LINE>appContext.getJvmGCAccess().insert(jvmGCDataPos);<NEW_LINE>appContext.getJvmMemoryAccess().insert(jvmMemoryDataPos);<NEW_LINE>appContext.getJvmThreadAccess().insert(jvmThreadDataPos);<NEW_LINE>} | int size = mDatas.size(); |
1,088,725 | void saveStateOnApplicationClose(TreeViewer viewer, IMemento memento) {<NEW_LINE>Hashtable<File, String> map = new Hashtable<File, String>();<NEW_LINE>IMemento expandedMem = memento.createChild(MEMENTO_EXPANDED);<NEW_LINE>for (Object element : viewer.getVisibleExpandedElements()) {<NEW_LINE>if (element instanceof IIdentifier && element instanceof IArchimateModelObject) {<NEW_LINE>// Only store if saved in a file<NEW_LINE>File file = ((IArchimateModelObject) element).getArchimateModel().getFile();<NEW_LINE>if (file != null) {<NEW_LINE>String id = ((<MASK><NEW_LINE>String string = map.get(file);<NEW_LINE>if (string == null) {<NEW_LINE>string = id;<NEW_LINE>} else {<NEW_LINE>string += ELEMENT_SEP_CHAR + id;<NEW_LINE>}<NEW_LINE>map.put(file, string);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>for (File file : map.keySet()) {<NEW_LINE>IMemento elementMem = expandedMem.createChild(MEMENTO_MODEL);<NEW_LINE>elementMem.putString(MEMENTO_FILE, file.getAbsolutePath());<NEW_LINE>elementMem.putString(MEMENTO_ELEMENTS, map.get(file));<NEW_LINE>}<NEW_LINE>} | IIdentifier) element).getId(); |
116,721 | private TaskInfo createTaskInfo(TaskHolder taskHolder) {<NEW_LINE>TaskStats taskStats = getTaskStats(taskHolder);<NEW_LINE>Set<<MASK><NEW_LINE>TaskStatus taskStatus = createTaskStatus(taskHolder, isMPPMetricEnabled ? Optional.of(taskStats) : Optional.empty());<NEW_LINE>if (isMPPMetricEnabled) {<NEW_LINE>return new TaskInfo(taskStatus, lastHeartbeat.get(), outputBuffer.getInfo(), noMoreSplits, taskStats, needsPlan.get(), taskStatus.getState().isDone(), taskStats.getCompletedPipelineExecs(), taskStats.getTotalPipelineExecs(), taskStats.getCumulativeMemory(), taskStats.getMemoryReservation(), System.currentTimeMillis() - createTime, 0, taskStats.getElapsedTime(), taskStats.getTotalScheduledTime(), taskStateMachine.getPullDataTime(), taskStats.getDeliveryTime());<NEW_LINE>} else {<NEW_LINE>return new TaskInfo(taskStatus, lastHeartbeat.get(), outputBuffer.getInfo(), noMoreSplits, taskStats, needsPlan.get(), taskStatus.getState().isDone(), taskStats.getCompletedPipelineExecs(), taskStats.getTotalPipelineExecs(), taskStats.getCumulativeMemory(), taskStats.getMemoryReservation(), System.currentTimeMillis() - createTime, taskStateMachine.getDriverEndTime(), taskStats.getElapsedTime(), taskStats.getTotalScheduledTime(), taskStateMachine.getPullDataTime(), taskStats.getDeliveryTime());<NEW_LINE>}<NEW_LINE>} | Integer> noMoreSplits = getNoMoreSplits(taskHolder); |
658,460 | private boolean isMetaFileOlderThenMMappedFiles(String sessionId) {<NEW_LINE>if (sessionId == null)<NEW_LINE>// valid case, no session is ok<NEW_LINE>return false;<NEW_LINE>// one extra check is to verify that the session directory that contains the actual buffers<NEW_LINE>// was not modified after the file was saved<NEW_LINE><MASK><NEW_LINE>LOG.debug(_file + " mod time: " + metaFileModTime);<NEW_LINE>// check the directory first<NEW_LINE>File sessionDir = new File(_file.getParent(), sessionId);<NEW_LINE>long sessionDirModTime = sessionDir.lastModified();<NEW_LINE>if (sessionDirModTime > metaFileModTime) {<NEW_LINE>LOG.error("Session dir " + sessionDir + " seemed to be modified AFTER metaFile " + _file + " dirModTime=" + sessionDirModTime + "; metaFileModTime=" + metaFileModTime);<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>// check each file in the directory<NEW_LINE>String[] mmappedFiles = sessionDir.list();<NEW_LINE>if (mmappedFiles == null) {<NEW_LINE>LOG.error("There are no mmaped files in the session directory: " + sessionDir);<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>for (String fName : mmappedFiles) {<NEW_LINE>File f = new File(sessionDir, fName);<NEW_LINE>long modTime = f.lastModified();<NEW_LINE>LOG.debug(f + " mod time: " + modTime);<NEW_LINE>if (modTime > metaFileModTime) {<NEW_LINE>LOG.error("MMapped file " + f + "(" + modTime + ") seemed to be modified AFTER metaFile " + _file + "(" + metaFileModTime + ")");<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// valid file - go ahead and use it<NEW_LINE>return false;<NEW_LINE>} | long metaFileModTime = _file.lastModified(); |
301,025 | public BulkWriteResult writeMapBulk(final String indexName, final List<BulkWriteEntry> jsonMapList) {<NEW_LINE>long start = System.currentTimeMillis();<NEW_LINE>ListenableActionFuture<BulkResponse> future = writeMapBulkInternal(indexName, jsonMapList);<NEW_LINE>BulkResponse bulkResponse = future.actionGet();<NEW_LINE>BulkWriteResult result = new BulkWriteResult();<NEW_LINE>for (BulkItemResponse r : bulkResponse.getItems()) {<NEW_LINE>String id = r.getId();<NEW_LINE>ActionWriteResponse response = r.getResponse();<NEW_LINE>if (response instanceof IndexResponse) {<NEW_LINE>if (((IndexResponse) response).isCreated())<NEW_LINE>result.getCreated().add(id);<NEW_LINE>}<NEW_LINE>String err = r.getFailureMessage();<NEW_LINE>if (err != null) {<NEW_LINE>result.getErrors().put(id, err);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>long duration = Math.max(1, System.currentTimeMillis() - start);<NEW_LINE>long regulator = 0;<NEW_LINE>// this is the number of updates per second<NEW_LINE>long ops = result.getCreated().size() * 1000 / duration;<NEW_LINE>if (duration > throttling_time_threshold && ops < throttling_ops_threshold) {<NEW_LINE>regulator = (long) (throttling_factor * duration);<NEW_LINE>try {<NEW_LINE>Thread.sleep(regulator);<NEW_LINE>} catch (InterruptedException e) {<NEW_LINE>}<NEW_LINE>}<NEW_LINE>DAO.log("elastic write bulk to index " + indexName + ": " + jsonMapList.size() + " entries, " + result.getCreated().size() + " created, " + result.getErrors().size() + " errors, " + duration + " ms" + (regulator == 0 ? "" : ", throttled with " + regulator + " ms"<MASK><NEW_LINE>if (result.getErrors().size() > 0) {<NEW_LINE>DAO.severe("Errors faced while indexing:");<NEW_LINE>for (String key : result.getErrors().keySet()) {<NEW_LINE>DAO.severe(result.getErrors().get(key));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>} | ) + ", " + ops + " objects/second"); |
1,646,655 | public void deploy(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {<NEW_LINE>String loadPath = OSGIUtil.getInstance().getFelixDeployPath();<NEW_LINE>String undeployedPath = OSGIUtil.getInstance().getFelixUndeployPath();<NEW_LINE>String jar = request.getParameter("jar");<NEW_LINE>File from = new File(undeployedPath + File.separator + jar);<NEW_LINE>File to = new File(loadPath + File.separator + jar);<NEW_LINE>Boolean success = from.renameTo(to);<NEW_LINE>if (success) {<NEW_LINE>Logger.info(OSGIAJAX.class, "OSGI Bundle " + jar + " Loaded");<NEW_LINE>writeSuccess(response, "OSGI Bundle " + jar + " Loaded");<NEW_LINE>} else {<NEW_LINE>Logger.error(<MASK><NEW_LINE>writeError(response, "Error Loading OSGI Bundle" + jar);<NEW_LINE>}<NEW_LINE>} | OSGIAJAX.class, "Error Loading OSGI Bundle " + jar); |
53,571 | public void build(BuildProducer<ReflectiveClassBuildItem> reflectiveClass) {<NEW_LINE>for (AnnotationInstance i : combinedIndexBuildItem.getIndex().getAnnotations(DotName.createSimple(RegisterForReflection.class.getName()))) {<NEW_LINE>boolean methods = getBooleanValue(i, "methods");<NEW_LINE>boolean fields = getBooleanValue(i, "fields");<NEW_LINE>boolean ignoreNested = getBooleanValue(i, "ignoreNested");<NEW_LINE>boolean serialization = i.value("serialization") != null && i.value("serialization").asBoolean();<NEW_LINE>AnnotationValue targetsValue = i.value("targets");<NEW_LINE>AnnotationValue classNamesValue = i.value("classNames");<NEW_LINE>ClassLoader classLoader = Thread.currentThread().getContextClassLoader();<NEW_LINE>if (targetsValue == null && classNamesValue == null) {<NEW_LINE>ClassInfo classInfo = i.target().asClass();<NEW_LINE>registerClass(classLoader, classInfo.name().toString(), methods, <MASK><NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (targetsValue != null) {<NEW_LINE>Type[] targets = targetsValue.asClassArray();<NEW_LINE>for (Type type : targets) {<NEW_LINE>registerClass(classLoader, type.name().toString(), methods, fields, ignoreNested, serialization, reflectiveClass);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (classNamesValue != null) {<NEW_LINE>String[] classNames = classNamesValue.asStringArray();<NEW_LINE>for (String className : classNames) {<NEW_LINE>registerClass(classLoader, className, methods, fields, ignoreNested, serialization, reflectiveClass);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | fields, ignoreNested, serialization, reflectiveClass); |
1,151,756 | public int runInteractive(String[] scriptArgs) {<NEW_LINE>fillSysArgv(null, scriptArgs);<NEW_LINE>String[] args = null;<NEW_LINE>String[] iargs = { /*"-i", "-c",*/<NEW_LINE>"require 'irb'\n" + "ScriptRunner.runningInteractive();\n" + "print \"Hello, this is your interactive Sikuli (rules for interactive Ruby apply)\\n" + "use the UP/DOWN arrow keys to walk through the input history\\n" + "help()<enter> will output some basic Ruby information\\n" + "... use ctrl-d to end the session\"\n" + "IRB.start(__FILE__)\n" };<NEW_LINE>if (scriptArgs != null && scriptArgs.length > 0) {<NEW_LINE>args = new String[<MASK><NEW_LINE>System.arraycopy(iargs, 0, args, 0, iargs.length);<NEW_LINE>System.arraycopy(scriptArgs, 0, args, iargs.length, scriptArgs.length);<NEW_LINE>} else {<NEW_LINE>args = iargs;<NEW_LINE>}<NEW_LINE>StringBuilder buffer = new StringBuilder();<NEW_LINE>for (String e : args) {<NEW_LINE>buffer.append(e);<NEW_LINE>}<NEW_LINE>createScriptingContainer();<NEW_LINE>executeScriptHeader(new String[0]);<NEW_LINE>interpreter.runScriptlet(buffer.toString());<NEW_LINE>return 0;<NEW_LINE>} | scriptArgs.length + iargs.length]; |
1,472,107 | public static Map<String, ?> toServiceConfig(String serviceName, RetryPolicy retryPolicy) {<NEW_LINE>List<Double> retryableStatusCodes = RetryUtil.retryableGrpcStatusCodes().stream().map(Double::parseDouble).collect(toList());<NEW_LINE>Map<String, Object> retryConfig = new HashMap<>();<NEW_LINE>retryConfig.put("retryableStatusCodes", retryableStatusCodes);<NEW_LINE>retryConfig.put("maxAttempts", (<MASK><NEW_LINE>retryConfig.put("initialBackoff", retryPolicy.getInitialBackoff().toMillis() / 1000.0 + "s");<NEW_LINE>retryConfig.put("maxBackoff", retryPolicy.getMaxBackoff().toMillis() / 1000.0 + "s");<NEW_LINE>retryConfig.put("backoffMultiplier", retryPolicy.getBackoffMultiplier());<NEW_LINE>Map<String, Object> methodConfig = new HashMap<>();<NEW_LINE>methodConfig.put("name", Collections.singletonList(Collections.singletonMap("service", serviceName)));<NEW_LINE>methodConfig.put("retryPolicy", retryConfig);<NEW_LINE>return Collections.singletonMap("methodConfig", Collections.singletonList(methodConfig));<NEW_LINE>} | double) retryPolicy.getMaxAttempts()); |
458,479 | public okhttp3.Call readNamespacedStatefulSetStatusCall(String name, String namespace, String pretty, final ApiCallback _callback) throws ApiException {<NEW_LINE>Object localVarPostBody = null;<NEW_LINE>// create path and map variables<NEW_LINE>String localVarPath = "/apis/apps/v1/namespaces/{namespace}/statefulsets/{name}/status".replaceAll("\\{" + "name" + "\\}", localVarApiClient.escapeString(name.toString())).replaceAll("\\{" + "namespace" + "\\}", localVarApiClient.escapeString(namespace.toString()));<NEW_LINE>List<Pair> localVarQueryParams = new ArrayList<Pair>();<NEW_LINE>List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();<NEW_LINE>if (pretty != null) {<NEW_LINE>localVarQueryParams.addAll(localVarApiClient.parameterToPair("pretty", pretty));<NEW_LINE>}<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 <MASK><NEW_LINE>final String[] localVarAccepts = { "application/json", "application/yaml", "application/vnd.kubernetes.protobuf" };<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 = {};<NEW_LINE>final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);<NEW_LINE>localVarHeaderParams.put("Content-Type", localVarContentType);<NEW_LINE>String[] localVarAuthNames = new String[] { "BearerToken" };<NEW_LINE>return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);<NEW_LINE>} | HashMap<String, Object>(); |
1,724,642 | public Pair<Gradient, INDArray> backpropGradient(INDArray epsilon, LayerWorkspaceMgr workspaceMgr) {<NEW_LINE>assertInputSet(true);<NEW_LINE>boolean ncdhw = layerConf().getDataFormat() == org.deeplearning4j.nn.conf.layers.Convolution3D.DataFormat.NCDHW;<NEW_LINE>// Assumes NCDHW order<NEW_LINE>long miniBatch = input.size(0);<NEW_LINE>long inChannels, inD, inH, inW;<NEW_LINE>int[] intArgs;<NEW_LINE>if (ncdhw) {<NEW_LINE>inChannels = input.size(1);<NEW_LINE>inD = input.size(2);<NEW_LINE>inH = input.size(3);<NEW_LINE><MASK><NEW_LINE>// 1 is channels first<NEW_LINE>intArgs = new int[] { 1 };<NEW_LINE>} else {<NEW_LINE>inD = input.size(1);<NEW_LINE>inH = input.size(2);<NEW_LINE>inW = input.size(3);<NEW_LINE>inChannels = input.size(4);<NEW_LINE>// 0 is channels last<NEW_LINE>intArgs = new int[] { 0 };<NEW_LINE>}<NEW_LINE>INDArray epsOut;<NEW_LINE>if (ncdhw) {<NEW_LINE>epsOut = workspaceMgr.createUninitialized(ArrayType.ACTIVATION_GRAD, epsilon.dataType(), new long[] { miniBatch, inChannels, inD, inH, inW }, 'c');<NEW_LINE>} else {<NEW_LINE>epsOut = workspaceMgr.createUninitialized(ArrayType.ACTIVATION_GRAD, epsilon.dataType(), new long[] { miniBatch, inD, inH, inW, inChannels }, 'c');<NEW_LINE>}<NEW_LINE>Gradient gradient = new DefaultGradient();<NEW_LINE>CustomOp op = DynamicCustomOp.builder("upsampling3d_bp").addIntegerArguments(intArgs).addInputs(input, epsilon).addOutputs(epsOut).callInplace(false).build();<NEW_LINE>Nd4j.getExecutioner().exec(op);<NEW_LINE>epsOut = backpropDropOutIfPresent(epsOut);<NEW_LINE>return new Pair<>(gradient, epsOut);<NEW_LINE>} | inW = input.size(4); |
1,821,726 | public void printHorizontal() {<NEW_LINE>String typeCast = imageOut.getTypeCastFromSum();<NEW_LINE>String sumType = imageIn.getSumType();<NEW_LINE><MASK><NEW_LINE>out.print("\tpublic static void horizontal( " + imageIn.getSingleBandName() + " input , " + imageOut.getSingleBandName() + " output , int radius ) {\n" + "\t\tfinal int kernelWidth = radius*2 + 1;\n");<NEW_LINE>String body = "";<NEW_LINE>body += "\t\t\tint indexIn = input.startIndex + input.stride*y;\n" + "\t\t\tint indexOut = output.startIndex + output.stride*y + radius;\n" + "\n" + "\t\t\t" + sumType + " total = 0;\n" + "\n" + "\t\t\tint indexEnd = indexIn + kernelWidth;\n" + "\t\t\t\n" + "\t\t\tfor( ; indexIn < indexEnd; indexIn++ ) {\n" + "\t\t\t\ttotal += input.data[indexIn] " + bitWise + ";\n" + "\t\t\t}\n" + "\t\t\toutput.data[indexOut++] = " + typeCast + "total;\n" + "\n" + "\t\t\tindexEnd = indexIn + input.width - kernelWidth;\n" + "\t\t\tfor( ; indexIn < indexEnd; indexIn++ ) {\n" + "\t\t\t\ttotal -= input.data[ indexIn - kernelWidth ] " + bitWise + ";\n" + "\t\t\t\ttotal += input.data[ indexIn ] " + bitWise + ";\n" + "\n" + "\t\t\t\toutput.data[indexOut++] = " + typeCast + "total;\n" + "\t\t\t}\n";<NEW_LINE>printParallel("y", "0", "input.height", body);<NEW_LINE>out.print("\t}\n\n");<NEW_LINE>} | String bitWise = imageIn.getBitWise(); |
254,285 | public void run(MessageReply reply) {<NEW_LINE>if (!reply.isSuccess()) {<NEW_LINE>completion.fail(reply.getError());<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>KVMHostAsyncHttpCallReply ar = reply.castReply();<NEW_LINE>AgentRsp rsp = <MASK><NEW_LINE>if (!rsp.success) {<NEW_LINE>completion.fail(operr("operation error, because:%s", rsp.error));<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>List<String> vipUuids = CollectionUtils.transformToList(eips, new Function<String, EipTO>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public String call(EipTO arg) {<NEW_LINE>return arg.vipUuid;<NEW_LINE>}<NEW_LINE>});<NEW_LINE>for (AfterApplyFlatEipExtensionPoint ext : pluginRgty.getExtensionList(AfterApplyFlatEipExtensionPoint.class)) {<NEW_LINE>ext.AfterApplyFlatEip(vipUuids, hostUuid);<NEW_LINE>}<NEW_LINE>completion.success();<NEW_LINE>} | ar.toResponse(AgentRsp.class); |
355,616 | final ListChannelModeratorsResult executeListChannelModerators(ListChannelModeratorsRequest listChannelModeratorsRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(listChannelModeratorsRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<ListChannelModeratorsRequest> request = null;<NEW_LINE>Response<ListChannelModeratorsResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new ListChannelModeratorsRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(listChannelModeratorsRequest));<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, "Chime SDK Messaging");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ListChannelModerators");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<ListChannelModeratorsResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new ListChannelModeratorsResultJsonUnmarshaller());<NEW_LINE>response = <MASK><NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | invoke(request, responseHandler, executionContext); |
527,329 | public void testBasicBlockExampleCode() {<NEW_LINE>env.showTool();<NEW_LINE>removeField(BytesFieldFactory.FIELD_NAME);<NEW_LINE>removeField(EolCommentFieldFactory.FIELD_NAME);<NEW_LINE>removeField(XRefFieldFactory.FIELD_NAME);<NEW_LINE>removeField(XRefHeaderFieldFactory.XREF_FIELD_NAME);<NEW_LINE>removeFlowArrows();<NEW_LINE>setToolSize(1000, 1200);<NEW_LINE>captureListingRange(0x004010e0, 0x00401126, 650);<NEW_LINE>int imageHeight = image.getHeight(null);<NEW_LINE>lineHeight = imageHeight / NUM_LINES;<NEW_LINE>drawBlockLines(0, 5, "Block 1");<NEW_LINE>drawBlockLines(5, 7, "Block 2");<NEW_LINE>drawBlockLines(7, 16, "Block 3");<NEW_LINE><MASK><NEW_LINE>drawBlockLines(18, 24, "Block 5");<NEW_LINE>drawBlockLines(24, 28, "Block 6");<NEW_LINE>drawBlockLines(28, 31, "Block 7");<NEW_LINE>crop(new Rectangle(20, 0, 580, imageHeight));<NEW_LINE>} | drawBlockLines(16, 18, "Block 4"); |
437,529 | public OResultSet syncPull(OCommandContext ctx, int nRecords) throws OTimeoutException {<NEW_LINE>getPrev().ifPresent(x -> x.syncPull(ctx, nRecords));<NEW_LINE>return new OResultSet() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public boolean hasNext() {<NEW_LINE>return !executed;<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public OResult next() {<NEW_LINE>if (executed) {<NEW_LINE>throw new IllegalStateException();<NEW_LINE>}<NEW_LINE>long begin = profilingEnabled ? System.nanoTime() : 0;<NEW_LINE>try {<NEW_LINE>OIndex idx = ctx.getDatabase().getMetadata().getIndexManager().getIndex(target.getIndexName());<NEW_LINE>Object val = idx.getDefinition().createValue(keyValue.execute(new OResultInternal(), ctx));<NEW_LINE>long size = idx.getInternal().getRids(val).distinct().count();<NEW_LINE>executed = true;<NEW_LINE>OResultInternal result = new OResultInternal();<NEW_LINE>result.setProperty(alias, size);<NEW_LINE>return result;<NEW_LINE>} finally {<NEW_LINE>count += (<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void close() {<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public Optional<OExecutionPlan> getExecutionPlan() {<NEW_LINE>return Optional.empty();<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public Map<String, Long> getQueryStats() {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void reset() {<NEW_LINE>CountFromIndexWithKeyStep.this.reset();<NEW_LINE>}<NEW_LINE>};<NEW_LINE>} | System.nanoTime() - begin); |
909,194 | public com.amazonaws.services.acmpca.model.InvalidArnException unmarshallFromContext(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>com.amazonaws.services.acmpca.model.InvalidArnException invalidArnException = new com.amazonaws.services.acmpca.model.InvalidArnException(null);<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE><MASK><NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return invalidArnException;<NEW_LINE>} | String currentParentElement = context.getCurrentParentElement(); |
1,661,682 | public static void onReceive(TermuxApiReceiver apiReceiver, final Context context, Intent intent) {<NEW_LINE>Logger.logDebug(LOG_TAG, "onReceive");<NEW_LINE>final String[] filePaths = intent.getStringArrayExtra("paths");<NEW_LINE>final boolean recursive = intent.getBooleanExtra("recursive", false);<NEW_LINE>final Integer[] totalScanned = { 0 };<NEW_LINE>final boolean verbose = intent.getBooleanExtra("verbose", false);<NEW_LINE>for (int i = 0; i < filePaths.length; i++) {<NEW_LINE>filePaths[i] = filePaths[i].replace("\\,", ",");<NEW_LINE>}<NEW_LINE>ResultReturner.returnData(apiReceiver, intent, out -> {<NEW_LINE>scanFiles(out, context, filePaths, totalScanned, verbose);<NEW_LINE>if (recursive)<NEW_LINE>scanFilesRecursively(out, <MASK><NEW_LINE>out.println(String.format(Locale.ENGLISH, "Finished scanning %d file(s)", totalScanned[0]));<NEW_LINE>});<NEW_LINE>} | context, filePaths, totalScanned, verbose); |
402,375 | public static void main(final String[] args) {<NEW_LINE>final PluginServices plugins = PluginServices.makeForContextLoader();<NEW_LINE>final OptionsParser parser = new OptionsParser(new PluginFilter(plugins));<NEW_LINE>final ParseResult pr = parser.parse(args);<NEW_LINE>if (!pr.isOk()) {<NEW_LINE>parser.printHelp();<NEW_LINE>System.out.println(">>>> " + pr.getErrorMessage().get());<NEW_LINE>} else {<NEW_LINE>final <MASK><NEW_LINE>final CombinedStatistics stats = runReport(data, plugins);<NEW_LINE>throwErrorIfScoreBelowCoverageThreshold(stats.getCoverageSummary(), data.getCoverageThreshold());<NEW_LINE>throwErrorIfScoreBelowTestStrengthThreshold(stats.getMutationStatistics(), data.getTestStrengthThreshold());<NEW_LINE>throwErrorIfScoreBelowMutationThreshold(stats.getMutationStatistics(), data.getMutationThreshold());<NEW_LINE>throwErrorIfMoreThanMaxSurvivingMutants(stats.getMutationStatistics(), data.getMaximumAllowedSurvivors());<NEW_LINE>}<NEW_LINE>} | ReportOptions data = pr.getOptions(); |
1,240,128 | public static DescribeRegionsResponse unmarshall(DescribeRegionsResponse describeRegionsResponse, UnmarshallerContext context) {<NEW_LINE>describeRegionsResponse.setRequestId(context.stringValue("DescribeRegionsResponse.RequestId"));<NEW_LINE>List<Region> regions = new ArrayList<Region>();<NEW_LINE>for (int i = 0; i < context.lengthValue("DescribeRegionsResponse.Regions.Length"); i++) {<NEW_LINE>List<String> recommendZones = new ArrayList<String>();<NEW_LINE>for (int j = 0; j < context.lengthValue("DescribeRegionsResponse.Regions[" + i + "].RecommendZones.Length"); j++) {<NEW_LINE>recommendZones.add(context.stringValue("DescribeRegionsResponse.Regions[" + i + "].RecommendZones[" + j + "]"));<NEW_LINE>}<NEW_LINE>Region region = new Region();<NEW_LINE>region.setRegionId(context.stringValue("DescribeRegionsResponse.Regions[" + i + "].RegionId"));<NEW_LINE>region.setRegionEndpoint(context.stringValue<MASK><NEW_LINE>List<String> zones = new ArrayList<String>();<NEW_LINE>for (int j = 0; j < context.lengthValue("DescribeRegionsResponse.Regions[" + i + "].Zones.Length"); j++) {<NEW_LINE>zones.add(context.stringValue("DescribeRegionsResponse.Regions[" + i + "].Zones[" + j + "]"));<NEW_LINE>}<NEW_LINE>region.setZones(zones);<NEW_LINE>region.setRecommendZones(recommendZones);<NEW_LINE>regions.add(region);<NEW_LINE>}<NEW_LINE>describeRegionsResponse.setRegions(regions);<NEW_LINE>return describeRegionsResponse;<NEW_LINE>} | ("DescribeRegionsResponse.Regions[" + i + "].RegionEndpoint")); |
123,180 | public void insertHyperlink() {<NEW_LINE>// retrieve caret position<NEW_LINE>int caret = jTextAreaEntry.getCaretPosition();<NEW_LINE>// the button for editing the spellchecking-words was pressed,<NEW_LINE>// so open the window for edting them...<NEW_LINE>if (null == hyperlinkEditDlg) {<NEW_LINE>// get parent und init window<NEW_LINE>hyperlinkEditDlg = new CInsertHyperlink(this, jTextAreaEntry.getSelectedText(), settingsObj);<NEW_LINE>// center window<NEW_LINE>hyperlinkEditDlg.setLocationRelativeTo(this);<NEW_LINE>}<NEW_LINE>ZettelkastenApp.<MASK><NEW_LINE>// retrieve return value<NEW_LINE>String hyperlink = hyperlinkEditDlg.getHyperlink();<NEW_LINE>// if we have any changes, insert table<NEW_LINE>if (hyperlink != null && !hyperlink.isEmpty()) {<NEW_LINE>jTextAreaEntry.replaceSelection(hyperlink);<NEW_LINE>} else // else set caret to old position and "de-select" the text<NEW_LINE>{<NEW_LINE>jTextAreaEntry.setCaretPosition(caret);<NEW_LINE>}<NEW_LINE>// dispose window<NEW_LINE>hyperlinkEditDlg.dispose();<NEW_LINE>hyperlinkEditDlg = null;<NEW_LINE>} | getApplication().show(hyperlinkEditDlg); |
1,272,608 | private void startlientStreaming(HttpServletRequest req, HttpServletResponse resp) throws Exception {<NEW_LINE>String m = "startlientStreaming";<NEW_LINE>// before coming here, code in ProducerGrpcServiceClient will have made the GRPC calls<NEW_LINE>// to ManagedChannelBuilder.forAddress and newStub to setup the RPC code for client side usage<NEW_LINE>ProducerServiceRestClient service = builder.build(ProducerServiceRestClient.class);<NEW_LINE>LOG.info("testClientStreamApp: service = " + service.toString());<NEW_LINE>try {<NEW_LINE>// call Remote REST service<NEW_LINE>// tell the rest client to send data to the gRPC client. gRPC client will then make<NEW_LINE>// gRPC calls to the gRPC server.<NEW_LINE>LOG.info(m + " ------------------------------------------------------------");<NEW_LINE>LOG.info(m + " ----- invoking producer REST client to perform clientStream test: clientStreamApp()");<NEW_LINE>Response r = service.clientStreamApp();<NEW_LINE>// check response<NEW_LINE>String result = r.readEntity(String.class);<NEW_LINE>LOG.info(m + ": client stream entity/result: " + result);<NEW_LINE>boolean <MASK><NEW_LINE>assertTrue(isValidResponse);<NEW_LINE>} catch (Exception e) {<NEW_LINE>e.getMessage();<NEW_LINE>e.printStackTrace();<NEW_LINE>}<NEW_LINE>} | isValidResponse = result.contains("success"); |
292,890 | public DescribeSubnetGroupsResult unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>DescribeSubnetGroupsResult describeSubnetGroupsResult = new DescribeSubnetGroupsResult();<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 describeSubnetGroupsResult;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>if (context.testExpression("NextToken", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>describeSubnetGroupsResult.setNextToken(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("SubnetGroups", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>describeSubnetGroupsResult.setSubnetGroups(new ListUnmarshaller<SubnetGroup>(SubnetGroupJsonUnmarshaller.getInstance()).unmarshall(context));<NEW_LINE>}<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return describeSubnetGroupsResult;<NEW_LINE>} | String currentParentElement = context.getCurrentParentElement(); |
1,423,292 | public static boolean showOn(@NonNull FragmentActivity activity, @Nullable BaseNewsFragment.NewsDialogListener doneListener) {<NEW_LINE>final FragmentManager fm = activity.getSupportFragmentManager();<NEW_LINE>if (fm.isDestroyed())<NEW_LINE>return false;<NEW_LINE>final UpdateInfo info = MapManager.nativeGetUpdateInfo(CountryItem.getRootId());<NEW_LINE>if (info == null)<NEW_LINE>return false;<NEW_LINE>@Framework.DoAfterUpdate<NEW_LINE>final int result;<NEW_LINE>Fragment f = fm.findFragmentByTag(UpdaterDialogFragment.class.getName());<NEW_LINE>if (f != null) {<NEW_LINE>((UpdaterDialogFragment) f).mDoneListener = doneListener;<NEW_LINE>return true;<NEW_LINE>} else {<NEW_LINE>result = Framework.nativeToDoAfterUpdate();<NEW_LINE>if (result == Framework.DO_AFTER_UPDATE_NOTHING)<NEW_LINE>return false;<NEW_LINE>Statistics.INSTANCE.trackDownloaderDialogEvent(DOWNLOADER_DIALOG_SHOW, info.totalSize / Constants.MB);<NEW_LINE>}<NEW_LINE>final Bundle args = new Bundle();<NEW_LINE>args.putBoolean(ARG_UPDATE_IMMEDIATELY, result == Framework.DO_AFTER_UPDATE_AUTO_UPDATE);<NEW_LINE>args.putString(ARG_TOTAL_SIZE, StringUtils.getFileSizeString(activity.getApplicationContext(), info.totalSize));<NEW_LINE>args.putLong(ARG_TOTAL_SIZE_BYTES, info.totalSize);<NEW_LINE>args.putStringArray(ARG_OUTDATED_MAPS, Framework.nativeGetOutdatedCountries());<NEW_LINE><MASK><NEW_LINE>fragment.setArguments(args);<NEW_LINE>fragment.mDoneListener = doneListener;<NEW_LINE>FragmentTransaction transaction = fm.beginTransaction().setCustomAnimations(android.R.anim.fade_in, android.R.anim.fade_out);<NEW_LINE>fragment.show(transaction, UpdaterDialogFragment.class.getName());<NEW_LINE>return true;<NEW_LINE>} | final UpdaterDialogFragment fragment = new UpdaterDialogFragment(); |
887,025 | public void createDragImage(com.google.gwt.user.client.Element element, boolean alignImageToEvent) {<NEW_LINE>Element cloneNode = (Element) element.cloneNode(true);<NEW_LINE>// Set size explicitly for cloned node to avoid stretching #14617.<NEW_LINE>cloneNode.getStyle().setWidth(element.getOffsetWidth(), Unit.PX);<NEW_LINE>cloneNode.getStyle().setHeight(element.getOffsetHeight(), Unit.PX);<NEW_LINE>syncContent(element, cloneNode);<NEW_LINE>if (BrowserInfo.get().isIE()) {<NEW_LINE>if (cloneNode.getTagName().toLowerCase(Locale.ROOT).equals("tr")) {<NEW_LINE>TableElement table = Document.get().createTableElement();<NEW_LINE>TableSectionElement tbody = Document.get().createTBodyElement();<NEW_LINE>table.appendChild(tbody);<NEW_LINE>tbody.appendChild(cloneNode);<NEW_LINE>cloneNode = table.cast();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (alignImageToEvent) {<NEW_LINE>int absoluteTop = element.getAbsoluteTop();<NEW_LINE><MASK><NEW_LINE>int clientX = WidgetUtil.getTouchOrMouseClientX(startEvent);<NEW_LINE>int clientY = WidgetUtil.getTouchOrMouseClientY(startEvent);<NEW_LINE>int offsetX = absoluteLeft - clientX;<NEW_LINE>int offsetY = absoluteTop - clientY;<NEW_LINE>setDragImage(cloneNode, offsetX, offsetY);<NEW_LINE>} else {<NEW_LINE>setDragImage(cloneNode);<NEW_LINE>}<NEW_LINE>} | int absoluteLeft = element.getAbsoluteLeft(); |
1,324,869 | public void printExpectations(Expectations expectations, String[] actions) throws Exception {<NEW_LINE>String thisMethod = "printExpectations";<NEW_LINE>if (actions != null) {<NEW_LINE>Log.info(thisClass, thisMethod, "Actions: " + Arrays.toString(actions));<NEW_LINE>}<NEW_LINE>if (expectations == null) {<NEW_LINE>Log.info(thisClass, thisMethod, "Expectations are null - we should never have a test case that has null expectations - that would mean we're NOT validating any results - that's bad, very bad");<NEW_LINE>throw new Exception("NO expectations were specified - every test MUST validate it's results!!!");<NEW_LINE>}<NEW_LINE>for (Expectation expected : expectations.getExpectations()) {<NEW_LINE>Log.info(thisClass, "printExpectations", "Expectations for test: ");<NEW_LINE>if (Constants.RESPONSE_STATUS.equals(expected.getSearchLocation()) && expected.getValidationValue().equals("200")) {<NEW_LINE>Log.info(thisClass, "printExpectations", " Action: " + <MASK><NEW_LINE>} else {<NEW_LINE>if (actions != null && !Arrays.asList(actions).contains(expected.getAction())) {<NEW_LINE>Log.info(thisClass, thisMethod, "*************************************************************");<NEW_LINE>Log.info(thisClass, thisMethod, "* This expectation will never be processed as it's action *");<NEW_LINE>Log.info(thisClass, thisMethod, "* is NOT in the list of actions to be performed *");<NEW_LINE>Log.info(thisClass, thisMethod, "*************************************************************");<NEW_LINE>Log.info(thisClass, thisMethod, " ***Action: " + expected.getAction());<NEW_LINE>} else {<NEW_LINE>Log.info(thisClass, thisMethod, " Action: " + expected.getAction());<NEW_LINE>}<NEW_LINE>Log.info(thisClass, thisMethod, " Validate against: " + expected.getSearchLocation());<NEW_LINE>Log.info(thisClass, thisMethod, " How to perform check: " + expected.getCheckType());<NEW_LINE>Log.info(thisClass, thisMethod, " Key to validate: " + expected.getValidationKey());<NEW_LINE>Log.info(thisClass, thisMethod, " Value to validate: " + expected.getValidationValue());<NEW_LINE>Log.info(thisClass, thisMethod, " Print message: " + expected.getFailureMsg());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | expected.getAction() + " (expect 200 response)"); |
1,131,927 | public void cellHover(TableCell cell) {<NEW_LINE>super.cellHover(cell);<NEW_LINE>long lConnectedPeers = 0;<NEW_LINE>DownloadManager dm = (DownloadManager) cell.getDataSource();<NEW_LINE>if (dm != null) {<NEW_LINE>lConnectedPeers = dm.getNbPeers();<NEW_LINE>String sToolTip = lConnectedPeers + " " + <MASK><NEW_LINE>if (lTotalPeers != -1) {<NEW_LINE>sToolTip += lTotalPeers + " " + MessageText.getString("GeneralView.label.in_swarm");<NEW_LINE>} else {<NEW_LINE>Download d = getDownload();<NEW_LINE>if (d != null) {<NEW_LINE>DownloadScrapeResult response = d.getAggregatedScrapeResult(true);<NEW_LINE>sToolTip += "?? " + MessageText.getString("GeneralView.label.in_swarm");<NEW_LINE>if (response != null)<NEW_LINE>sToolTip += "(" + response.getStatus() + ")";<NEW_LINE>}<NEW_LINE>}<NEW_LINE>int activationCount = dm.getActivationCount();<NEW_LINE>if (activationCount > 0) {<NEW_LINE>sToolTip += "\n" + MessageText.getString("PeerColumn.activationCount", new String[] { "" + activationCount });<NEW_LINE>}<NEW_LINE>long cache = dm.getDownloadState().getLongAttribute(DownloadManagerState.AT_SCRAPE_CACHE);<NEW_LINE>if (cache != -1) {<NEW_LINE>int leechers = (int) (cache & 0x00ffffff);<NEW_LINE>if (leechers != lTotalPeers) {<NEW_LINE>sToolTip += "\n" + leechers + " " + MessageText.getString("Scrape.status.cached").toLowerCase(Locale.US);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>int[] i2p_info = (int[]) dm.getUserData(DHTTrackerPlugin.DOWNLOAD_USER_DATA_I2P_SCRAPE_KEY);<NEW_LINE>if (i2p_info != null) {<NEW_LINE>int totalI2PPeers = i2p_info[1];<NEW_LINE>if (totalI2PPeers > 0) {<NEW_LINE>sToolTip += "\n" + MessageText.getString("TableColumn.header.peers.i2p", new String[] { String.valueOf(totalI2PPeers) });<NEW_LINE>}<NEW_LINE>}<NEW_LINE>cell.setToolTip(sToolTip);<NEW_LINE>} else {<NEW_LINE>cell.setToolTip("");<NEW_LINE>}<NEW_LINE>} | MessageText.getString("GeneralView.label.connected") + "\n"; |
772,273 | private String _getRenderFlashMapTokenFromPreviousRequest(FacesContext facesContext) {<NEW_LINE>ExternalContext externalContext = facesContext.getExternalContext();<NEW_LINE>String tokenValue = null;<NEW_LINE>ClientWindow clientWindow = externalContext.getClientWindow();<NEW_LINE>if (clientWindow != null) {<NEW_LINE>if (facesContext.getApplication().getStateManager().isSavingStateInClient(facesContext)) {<NEW_LINE>Map<String, Object> sessionMap = externalContext.getSessionMap();<NEW_LINE>tokenValue = (String) sessionMap.get(FLASH_RENDER_MAP_TOKEN + SEPARATOR_CHAR + clientWindow.getId());<NEW_LINE>} else {<NEW_LINE>FlashClientWindowTokenCollection lruMap = getFlashClientWindowTokenCollection(externalContext, false);<NEW_LINE>if (lruMap != null) {<NEW_LINE>tokenValue = (String) lruMap.get(clientWindow.getId());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>HttpServletResponse <MASK><NEW_LINE>if (httpResponse != null) {<NEW_LINE>// Use a cookie<NEW_LINE>Cookie cookie = (Cookie) externalContext.getRequestCookieMap().get(FLASH_RENDER_MAP_TOKEN);<NEW_LINE>if (cookie != null) {<NEW_LINE>tokenValue = cookie.getValue();<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>// Use HttpSession or PortletSession object<NEW_LINE>Map<String, Object> sessionMap = externalContext.getSessionMap();<NEW_LINE>tokenValue = (String) sessionMap.get(FLASH_RENDER_MAP_TOKEN);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return tokenValue;<NEW_LINE>} | httpResponse = ExternalContextUtils.getHttpServletResponse(externalContext); |
249,962 | protected TransitionInstanceImpl createTransitionInstance(PvmExecutionImpl execution, Map<String, List<Incident>> incidentsByExecution) {<NEW_LINE>TransitionInstanceImpl transitionInstance = new TransitionInstanceImpl();<NEW_LINE>// can use execution id as persistent ID for transition as an execution<NEW_LINE>// can execute as most one transition at a time.<NEW_LINE>transitionInstance.setId(execution.getId());<NEW_LINE>transitionInstance.setParentActivityInstanceId(execution.getParentActivityInstanceId());<NEW_LINE>transitionInstance.setProcessInstanceId(execution.getProcessInstanceId());<NEW_LINE>transitionInstance.setProcessDefinitionId(execution.getProcessDefinitionId());<NEW_LINE>transitionInstance.setExecutionId(execution.getId());<NEW_LINE>transitionInstance.setActivityId(execution.getActivityId());<NEW_LINE>ActivityImpl activity = execution.getActivity();<NEW_LINE>if (activity != null) {<NEW_LINE>String name = activity.getName();<NEW_LINE>if (name == null) {<NEW_LINE>name = (String) activity.getProperty("name");<NEW_LINE>}<NEW_LINE>transitionInstance.setActivityName(name);<NEW_LINE>transitionInstance.setActivityType((String<MASK><NEW_LINE>}<NEW_LINE>List<String> incidentIdList = getIncidentIds(incidentsByExecution, execution);<NEW_LINE>List<Incident> incidents = getIncidents(incidentsByExecution, execution);<NEW_LINE>transitionInstance.setIncidentIds(incidentIdList.toArray(new String[0]));<NEW_LINE>transitionInstance.setIncidents(incidents.toArray(new Incident[0]));<NEW_LINE>return transitionInstance;<NEW_LINE>} | ) activity.getProperty("type")); |
1,276,451 | public void listen(ConnectionLostEvent connectionLostEvent) {<NEW_LINE>ButtonType reconnect = new ButtonType(Localization.lang("Reconnect"), ButtonData.YES);<NEW_LINE>ButtonType workOffline = new ButtonType(Localization.lang("Work offline"), ButtonData.NO);<NEW_LINE>ButtonType closeLibrary = new ButtonType(Localization.lang("Close library"), ButtonData.CANCEL_CLOSE);<NEW_LINE>Optional<ButtonType> answer = dialogService.showCustomButtonDialogAndWait(AlertType.WARNING, Localization.lang("Connection lost"), Localization.lang("The connection to the server has been terminated."), reconnect, workOffline, closeLibrary);<NEW_LINE>if (answer.isPresent()) {<NEW_LINE>if (answer.get().equals(reconnect)) {<NEW_LINE>jabRefFrame.closeCurrentTab();<NEW_LINE>dialogService.showCustomDialogAndWait(new SharedDatabaseLoginDialogView(jabRefFrame));<NEW_LINE>} else if (answer.get().equals(workOffline)) {<NEW_LINE>connectionLostEvent.getBibDatabaseContext().convertToLocalDatabase();<NEW_LINE>jabRefFrame.getLibraryTabs().forEach(tab -> tab.updateTabTitle(tab.isModified()));<NEW_LINE>jabRefFrame.getDialogService().notify<MASK><NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>jabRefFrame.closeCurrentTab();<NEW_LINE>}<NEW_LINE>} | (Localization.lang("Working offline.")); |
1,403,628 | private void initBasicScreens() {<NEW_LINE>// TODO read this from settings!!<NEW_LINE>screens.clear();<NEW_LINE>screenSizes.clear();<NEW_LINE>{<NEW_LINE>ArrayList<Pair<Pair<Scope, Dimension>, Formatter.Format>> screen = new ArrayList<>();<NEW_LINE>screen.add(new Pair<>(new Pair<>(Scope.ACTIVITY, Dimension.TIME), Formatter.Format.TXT_SHORT));<NEW_LINE>screen.add(new Pair<>(new Pair<>(Scope.ACTIVITY, Dimension.DISTANCE)<MASK><NEW_LINE>screen.add(new Pair<>(new Pair<>(Scope.LAP, Dimension.PACE), Formatter.Format.TXT_SHORT));<NEW_LINE>screens.add(screen);<NEW_LINE>}<NEW_LINE>{<NEW_LINE>ArrayList<Pair<Pair<Scope, Dimension>, Formatter.Format>> screen = new ArrayList<>();<NEW_LINE>// I.e time of day<NEW_LINE>screen.add(new Pair<>(new Pair<>(Scope.CURRENT, Dimension.TIME), Formatter.Format.TXT_TIMESTAMP));<NEW_LINE>screens.add(screen);<NEW_LINE>}<NEW_LINE>for (List<Pair<Pair<Scope, Dimension>, Formatter.Format>> screen : screens) {<NEW_LINE>screenSizes.add(screen.size());<NEW_LINE>}<NEW_LINE>} | , Formatter.Format.TXT_SHORT)); |
729,175 | public void onClick(View v) {<NEW_LINE>new QMUIDialog.CheckableDialogBuilder(mContext).setCheckedIndex(PixivSearchParamUtil.getSortTypeIndex(Shaft.sSettings.getSearchDefaultSortType())).setSkinManager(QMUISkinManager.defaultInstance(mContext)).addItems(PixivSearchParamUtil.SORT_TYPE_NAME, new DialogInterface.OnClickListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onClick(DialogInterface dialog, int which) {<NEW_LINE>Shaft.sSettings.setSearchDefaultSortType(PixivSearchParamUtil.SORT_TYPE_VALUE[which]);<NEW_LINE>Common.showToast(getString(R.string.string_428), 2);<NEW_LINE>Local.setSettings(Shaft.sSettings);<NEW_LINE>baseBind.searchDefaultSortType.setText<MASK><NEW_LINE>dialog.dismiss();<NEW_LINE>}<NEW_LINE>}).create().show();<NEW_LINE>} | (PixivSearchParamUtil.SORT_TYPE_NAME[which]); |
1,328,634 | public void handleRequest(final HttpServerExchange exchange) throws Exception {<NEW_LINE>HeaderValues serviceUrlHeader = exchange.getRequestHeaders().get(HttpStringConstants.SERVICE_URL);<NEW_LINE>String serviceUrl = serviceUrlHeader != null ? serviceUrlHeader.peekFirst() : null;<NEW_LINE>if (serviceUrl == null) {<NEW_LINE>// if service URL is in the header, we don't need to do the service discovery with serviceId.<NEW_LINE>HeaderValues serviceIdHeader = exchange.getRequestHeaders(<MASK><NEW_LINE>String serviceId = serviceIdHeader != null ? serviceIdHeader.peekFirst() : null;<NEW_LINE>if (serviceId == null) {<NEW_LINE>String requestPath = exchange.getRequestURI();<NEW_LINE>serviceId = HandlerUtils.findServiceId(HandlerUtils.normalisePath(requestPath), mapping);<NEW_LINE>if (serviceId == null) {<NEW_LINE>setExchangeStatus(exchange, STATUS_INVALID_REQUEST_PATH, requestPath);<NEW_LINE>return;<NEW_LINE>} else {<NEW_LINE>exchange.getRequestHeaders().put(HttpStringConstants.SERVICE_ID, serviceId);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>Handler.next(exchange, next);<NEW_LINE>} | ).get(HttpStringConstants.SERVICE_ID); |
329,382 | public List<PanelShareDto> queryTree(BaseGridRequest request) {<NEW_LINE>CurrentUserDto user = AuthUtils.getUser();<NEW_LINE><MASK><NEW_LINE>Long deptId = user.getDeptId();<NEW_LINE>List<Long> roleIds = user.getRoles().stream().map(CurrentRoleDto::getId).collect(Collectors.toList());<NEW_LINE>Map<String, Object> param = new HashMap<>();<NEW_LINE>param.put("userId", userId);<NEW_LINE>param.put("deptId", deptId);<NEW_LINE>param.put("roleIds", roleIds);<NEW_LINE>List<PanelSharePo> datas = extPanelShareMapper.query(param);<NEW_LINE>List<PanelShareDto> dtoLists = datas.stream().map(po -> BeanUtils.copyBean(new PanelShareDto(), po)).collect(Collectors.toList());<NEW_LINE>return convertTree(dtoLists);<NEW_LINE>} | Long userId = user.getUserId(); |
1,723,144 | public void applyNewConfig(RuntimeConfig oldConfig) {<NEW_LINE>LOG.info("Applying runtime client config");<NEW_LINE>if (null == oldConfig || !getContainer().equals(oldConfig.getContainer())) {<NEW_LINE>getContainer().applyNewConfig(null != oldConfig ? oldConfig.getContainer() : null);<NEW_LINE>}<NEW_LINE>if (getCheckpointPersistence() != null) {<NEW_LINE>if (null == oldConfig || !getCheckpointPersistence().equals(oldConfig.getCheckpointPersistence())) {<NEW_LINE>getCheckpointPersistence().applyNewConfig(null != oldConfig ? <MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (null == oldConfig || !getRelays().equals(oldConfig.getRelays())) {<NEW_LINE>if (null != oldConfig) {<NEW_LINE>for (ServerInfo serverInfo : oldConfig.getRelays()) {<NEW_LINE>if (!getRelays().contains(serverInfo)) {<NEW_LINE>doUnregisterRelay(serverInfo);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>for (ServerInfo serverInfo : getRelays()) {<NEW_LINE>if (null == oldConfig || !oldConfig.getRelays().contains(serverInfo)) {<NEW_LINE>doRegisterRelay(serverInfo);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (null == oldConfig || !getBootstrapServices().equals(oldConfig.getBootstrap().getServices())) {<NEW_LINE>if (null != oldConfig) {<NEW_LINE>for (ServerInfo serverInfo : oldConfig.getBootstrap().getServices()) {<NEW_LINE>if (!getBootstrapServices().contains(serverInfo)) {<NEW_LINE>doUnregisterBootstrapService(serverInfo);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>for (ServerInfo serverInfo : getBootstrap().getServices()) {<NEW_LINE>if (null == oldConfig || !oldConfig.getBootstrap().getServices().contains(serverInfo)) {<NEW_LINE>doRegisterBootstrapService(serverInfo);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | oldConfig.getCheckpointPersistence() : null); |
1,667,822 | protected void formBackingObject(Model model) {<NEW_LINE>GeneralSettingsCommand command = new GeneralSettingsCommand();<NEW_LINE>command.setCoverArtFileTypes(settingsService.getCoverArtFileTypes());<NEW_LINE>command.setCoverArtSource(settingsService.getCoverArtSource());<NEW_LINE>command.setCoverArtConcurrency(settingsService.getCoverArtConcurrency());<NEW_LINE>command.setCoverArtQuality(settingsService.getCoverArtQuality());<NEW_LINE>command.setIgnoredArticles(settingsService.getIgnoredArticles());<NEW_LINE>command.setGenreSeparators(settingsService.getGenreSeparators());<NEW_LINE>command.setShortcuts(settingsService.getShortcuts());<NEW_LINE>command.<MASK><NEW_LINE>command.setPlaylistFolder(settingsService.getPlaylistFolder());<NEW_LINE>command.setMusicFileTypes(settingsService.getMusicFileTypes());<NEW_LINE>command.setVideoFileTypes(settingsService.getVideoFileTypes());<NEW_LINE>command.setSortAlbumsByYear(settingsService.isSortAlbumsByYear());<NEW_LINE>command.setGettingStartedEnabled(settingsService.isGettingStartedEnabled());<NEW_LINE>command.setWelcomeTitle(settingsService.getWelcomeTitle());<NEW_LINE>command.setWelcomeSubtitle(settingsService.getWelcomeSubtitle());<NEW_LINE>command.setWelcomeMessage(settingsService.getWelcomeMessage());<NEW_LINE>command.setLoginMessage(settingsService.getLoginMessage());<NEW_LINE>command.setSessionDuration(settingsService.getSessionDuration());<NEW_LINE>Theme[] themes = settingsService.getAvailableThemes();<NEW_LINE>command.setThemes(themes);<NEW_LINE>String currentThemeId = settingsService.getThemeId();<NEW_LINE>for (int i = 0; i < themes.length; i++) {<NEW_LINE>if (currentThemeId.equals(themes[i].getId())) {<NEW_LINE>command.setThemeIndex(String.valueOf(i));<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>Locale currentLocale = settingsService.getLocale();<NEW_LINE>Locale[] locales = settingsService.getAvailableLocales();<NEW_LINE>String[] localeStrings = new String[locales.length];<NEW_LINE>for (int i = 0; i < locales.length; i++) {<NEW_LINE>localeStrings[i] = locales[i].getDisplayName(locales[i]);<NEW_LINE>if (currentLocale.equals(locales[i])) {<NEW_LINE>command.setLocaleIndex(String.valueOf(i));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>command.setLocales(localeStrings);<NEW_LINE>model.addAttribute("command", command);<NEW_LINE>} | setIndex(settingsService.getIndexString()); |
780,829 | public void onCreate(Bundle savedInstanceState) {<NEW_LINE>super.onCreate(savedInstanceState);<NEW_LINE>mSurfaceView = new VRSurfaceView(this);<NEW_LINE>addContentView(mSurfaceView, new ActionBar.LayoutParams<MASK><NEW_LINE>int uiFlags = // hide nav bar<NEW_LINE>View.SYSTEM_UI_FLAG_LAYOUT_STABLE | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN | // hide status bar<NEW_LINE>View.SYSTEM_UI_FLAG_HIDE_NAVIGATION | View.SYSTEM_UI_FLAG_FULLSCREEN;<NEW_LINE>if (VERSION.SDK_INT >= VERSION_CODES.KITKAT) {<NEW_LINE>uiFlags |= View.SYSTEM_UI_FLAG_IMMERSIVE;<NEW_LINE>}<NEW_LINE>mSurfaceView.setSystemUiVisibility(uiFlags);<NEW_LINE>setCardboardView(mSurfaceView);<NEW_LINE>} | (ViewGroup.LayoutParams.MATCH_PARENT)); |
1,723,417 | public CompletableFuture<Boolean> prepare(TransactionLog<MapUpdate<K, byte[]>> transactionLog) {<NEW_LINE>Map<PartitionId, List<MapUpdate<K, byte[]>>> updatesGroupedByMap = Maps.newIdentityHashMap();<NEW_LINE>transactionLog.records().forEach(update -> {<NEW_LINE>updatesGroupedByMap.computeIfAbsent(getPartition(update.key()), k -> Lists.newLinkedList()).add(update);<NEW_LINE>});<NEW_LINE>Map<PartitionId, TransactionLog<MapUpdate<K, byte[]>>> transactionsByMap = Maps.transformValues(updatesGroupedByMap, list -> new TransactionLog<>(transactionLog.transactionId(), transactionLog<MASK><NEW_LINE>return Futures.allOf(transactionsByMap.entrySet().stream().map(e -> getProxyClient().applyOn(e.getKey(), service -> service.prepare(e.getValue())).thenApply(v -> v == PrepareResult.OK || v == PrepareResult.PARTIAL_FAILURE)).collect(Collectors.toList())).thenApply(list -> list.stream().reduce(Boolean::logicalAnd).orElse(true));<NEW_LINE>} | .version(), list)); |
477,773 | static // / @brief Print the solution.<NEW_LINE>void printSolution(DataModel data, RoutingModel routing, RoutingIndexManager manager, Assignment solution) {<NEW_LINE>// Solution cost.<NEW_LINE>logger.info("Objective: " + solution.objectiveValue());<NEW_LINE>// Inspect solution.<NEW_LINE>long totalDistance = 0;<NEW_LINE>long totalLoad = 0;<NEW_LINE>for (int i = 0; i < data.vehicleNumber; ++i) {<NEW_LINE>long index = routing.start(i);<NEW_LINE>logger.info("Route for Vehicle " + i + ":");<NEW_LINE>long routeDistance = 0;<NEW_LINE>long routeLoad = 0;<NEW_LINE>String route = "";<NEW_LINE>while (!routing.isEnd(index)) {<NEW_LINE>long nodeIndex = manager.indexToNode(index);<NEW_LINE>routeLoad += data.demands[(int) nodeIndex];<NEW_LINE>route <MASK><NEW_LINE>long previousIndex = index;<NEW_LINE>index = solution.value(routing.nextVar(index));<NEW_LINE>routeDistance += routing.getArcCostForVehicle(previousIndex, index, i);<NEW_LINE>}<NEW_LINE>route += manager.indexToNode(routing.end(i));<NEW_LINE>logger.info(route);<NEW_LINE>logger.info("Distance of the route: " + routeDistance + "m");<NEW_LINE>totalDistance += routeDistance;<NEW_LINE>totalLoad += routeLoad;<NEW_LINE>}<NEW_LINE>logger.info("Total distance of all routes: " + totalDistance + "m");<NEW_LINE>logger.info("Total load of all routes: " + totalLoad);<NEW_LINE>} | += nodeIndex + " Load(" + routeLoad + ") -> "; |
738,712 | private static int run(com.zeroc.Ice.Communicator communicator, java.util.List<String> argSeq) {<NEW_LINE>final String prefix = "IceBox.Service.";<NEW_LINE>com.zeroc.Ice.Properties properties = communicator.getProperties();<NEW_LINE>java.util.Map<String, String> <MASK><NEW_LINE>java.util.List<String> iceBoxArgs = new java.util.ArrayList<String>(argSeq);<NEW_LINE>for (String key : services.keySet()) {<NEW_LINE>String name = key.substring(prefix.length());<NEW_LINE>iceBoxArgs.removeIf(v -> v.startsWith("--" + name));<NEW_LINE>}<NEW_LINE>for (String arg : iceBoxArgs) {<NEW_LINE>if (arg.equals("-h") || arg.equals("--help")) {<NEW_LINE>usage();<NEW_LINE>return 0;<NEW_LINE>} else if (arg.equals("-v") || arg.equals("--version")) {<NEW_LINE>System.out.println(com.zeroc.Ice.Util.stringVersion());<NEW_LINE>return 0;<NEW_LINE>} else {<NEW_LINE>System.err.println("IceBox.Server: unknown option `" + arg + "'");<NEW_LINE>usage();<NEW_LINE>return 1;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>ServiceManagerI serviceManagerImpl = new ServiceManagerI(communicator, argSeq.toArray(new String[0]));<NEW_LINE>return serviceManagerImpl.run();<NEW_LINE>} | services = properties.getPropertiesForPrefix(prefix); |
617,567 | public final InputStream openNonAsset(int cookie, String fileName, int accessMode) throws IOException {<NEW_LINE>final ResName resName = qualifyFromNonAssetFileName(fileName);<NEW_LINE>final FileTypedResource typedResource = (FileTypedResource) getResourceTable(<MASK><NEW_LINE>if (typedResource == null) {<NEW_LINE>throw new IOException("Unable to find resource for " + fileName);<NEW_LINE>}<NEW_LINE>InputStream stream;<NEW_LINE>if (accessMode == AssetManager.ACCESS_STREAMING) {<NEW_LINE>stream = Fs.getInputStream(typedResource.getPath());<NEW_LINE>} else {<NEW_LINE>stream = new ByteArrayInputStream(Fs.getBytes(typedResource.getPath()));<NEW_LINE>}<NEW_LINE>if (RuntimeEnvironment.getApiLevel() >= P) {<NEW_LINE>Asset asset = Asset.newFileAsset(typedResource);<NEW_LINE>long assetPtr = Registries.NATIVE_ASSET_REGISTRY.register(asset);<NEW_LINE>// Camouflage the InputStream as an AssetInputStream so subsequent instanceof checks pass.<NEW_LINE>stream = ShadowAssetInputStream.createAssetInputStream(stream, assetPtr, realObject);<NEW_LINE>}<NEW_LINE>return stream;<NEW_LINE>} | ).getValue(resName, config); |
578,012 | public void chooseBackgroundColor() {<NEW_LINE>// first, show an color-chooser-dialog and let the user choose the color<NEW_LINE>Color color = JColorChooser.showDialog(this, resourceMap.getString("chooseColorMsg"), getBackgroundColor());<NEW_LINE>// if the user chose a color, proceed<NEW_LINE>if (color != null) {<NEW_LINE>// set color to jLabel<NEW_LINE>jLabelTableColor.setBackground(color);<NEW_LINE>// convert the color-rgb-values into a hexa-decimal-string<NEW_LINE>StringBuilder output = new StringBuilder("");<NEW_LINE>// we need the format option to keep the leeding zero of hex-values<NEW_LINE>// from 00 to 0F.<NEW_LINE>output.append(String.format("%02x", color.getRed()));<NEW_LINE>output.append(String.format("%02x", color.getGreen()));<NEW_LINE>output.append(String.format("%02x"<MASK><NEW_LINE>// setFontColor(Integer.toHexString(color.getRed())+Integer.toHexString(color.getGreen())+Integer.toHexString(color.getBlue()));<NEW_LINE>// convert the color-rgb-values into a hexa-decimal-string and save the new font color<NEW_LINE>setBackgroundColor(output.toString());<NEW_LINE>}<NEW_LINE>} | , color.getBlue())); |
841,523 | public static long clCreateImage2D(@NativeType("cl_context") long context, @NativeType("cl_mem_flags") long flags, @NativeType("cl_image_format const *") CLImageFormat image_format, @NativeType("size_t") long image_width, @NativeType("size_t") long image_height, @NativeType("size_t") long image_row_pitch, @Nullable @NativeType("void *") short[] host_ptr, @Nullable @NativeType("cl_int *") int[] errcode_ret) {<NEW_LINE>long __functionAddress = CL.getICD().clCreateImage2D;<NEW_LINE>if (CHECKS) {<NEW_LINE>check(context);<NEW_LINE>checkSafe(errcode_ret, 1);<NEW_LINE>}<NEW_LINE>return callPJPPPPPPP(context, flags, image_format.address(), image_width, image_height, <MASK><NEW_LINE>} | image_row_pitch, host_ptr, errcode_ret, __functionAddress); |
1,718,224 | public void writePSMeta(ParameterServerManager psManager) throws IOException {<NEW_LINE>try {<NEW_LINE>psMetaLock.lock();<NEW_LINE>// generate a temporary file<NEW_LINE>String psMetaFile = getPsMetaFile();<NEW_LINE>String tmpFile = getPSMetaTmpeFile(psMetaFile);<NEW_LINE>Path tmpPath = new Path(writeDir, tmpFile);<NEW_LINE>FSDataOutputStream outputStream = fs.create(tmpPath);<NEW_LINE>// write ps meta to the temporary file first.<NEW_LINE>Map<ParameterServerId, AMParameterServer> psMap = psManager.getParameterServerMap();<NEW_LINE>outputStream.writeInt(psMap.size());<NEW_LINE>PSAttemptId attemptId = null;<NEW_LINE>int nextAttemptIndex = 0;<NEW_LINE>for (Entry<ParameterServerId, AMParameterServer> entry : psMap.entrySet()) {<NEW_LINE>outputStream.writeInt(entry.getKey().getIndex());<NEW_LINE>attemptId = entry.getValue().getRunningAttemptId();<NEW_LINE>nextAttemptIndex = entry.getValue().getNextAttemptNumber();<NEW_LINE>if (attemptId != null) {<NEW_LINE>nextAttemptIndex = attemptId.getIndex();<NEW_LINE>}<NEW_LINE>outputStream.writeInt(nextAttemptIndex);<NEW_LINE>}<NEW_LINE>outputStream.close();<NEW_LINE>// rename the temporary file to the final file<NEW_LINE>Path psMetaFilePath = new Path(writeDir, psMetaFile);<NEW_LINE>HdfsUtil.rename(tmpPath, psMetaFilePath, fs);<NEW_LINE>// if the old final file exist, just remove it<NEW_LINE>if (lastPsMetaFilePath != null) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>lastPsMetaFilePath = psMetaFilePath;<NEW_LINE>} finally {<NEW_LINE>psMetaLock.unlock();<NEW_LINE>}<NEW_LINE>} | fs.delete(lastPsMetaFilePath, false); |
856,019 | private BLangXMLElementFilter createXMLElementFilter(Node node) {<NEW_LINE>String ns = "";<NEW_LINE>String elementName = "*";<NEW_LINE>Location nsPos = null;<NEW_LINE>Location elemNamePos = null;<NEW_LINE>SyntaxKind kind = node.kind();<NEW_LINE>switch(kind) {<NEW_LINE>case SIMPLE_NAME_REFERENCE:<NEW_LINE>SimpleNameReferenceNode simpleNameReferenceNode = (SimpleNameReferenceNode) node;<NEW_LINE>elementName = simpleNameReferenceNode<MASK><NEW_LINE>elemNamePos = getPosition(simpleNameReferenceNode);<NEW_LINE>break;<NEW_LINE>case QUALIFIED_NAME_REFERENCE:<NEW_LINE>QualifiedNameReferenceNode qualifiedNameReferenceNode = (QualifiedNameReferenceNode) node;<NEW_LINE>elementName = qualifiedNameReferenceNode.identifier().text();<NEW_LINE>elemNamePos = getPosition(qualifiedNameReferenceNode.identifier());<NEW_LINE>ns = qualifiedNameReferenceNode.modulePrefix().text();<NEW_LINE>nsPos = getPosition(qualifiedNameReferenceNode.modulePrefix());<NEW_LINE>break;<NEW_LINE>case XML_ATOMIC_NAME_PATTERN:<NEW_LINE>XMLAtomicNamePatternNode atomicNamePatternNode = (XMLAtomicNamePatternNode) node;<NEW_LINE>elementName = atomicNamePatternNode.name().text();<NEW_LINE>elemNamePos = getPosition(atomicNamePatternNode.name());<NEW_LINE>ns = atomicNamePatternNode.prefix().text();<NEW_LINE>nsPos = getPosition(atomicNamePatternNode.prefix());<NEW_LINE>break;<NEW_LINE>case ASTERISK_TOKEN:<NEW_LINE>elemNamePos = getPosition(node);<NEW_LINE>}<NEW_LINE>// Escape names starting with '.<NEW_LINE>if (stringStartsWithSingleQuote(ns)) {<NEW_LINE>ns = ns.substring(1);<NEW_LINE>}<NEW_LINE>if (stringStartsWithSingleQuote(elementName)) {<NEW_LINE>elementName = elementName.substring(1);<NEW_LINE>}<NEW_LINE>return new BLangXMLElementFilter(getPosition(node), ns, nsPos, elementName, elemNamePos);<NEW_LINE>} | .name().text(); |
849,770 | protected ClientProxyImpl createClientProxy(ClassResourceInfo cri, boolean isRoot, ClientState actualState, Object[] varValues) {<NEW_LINE>// Liberty change start<NEW_LINE>MicroProfileClientProxyImpl clientProxy;<NEW_LINE>CDIInterceptorWrapper interceptorWrapper = CDIInterceptorWrapper.createWrapper(getServiceClass());<NEW_LINE>if (actualState == null) {<NEW_LINE>clientProxy = new MicroProfileClientProxyImpl(URI.create(getAddress()), proxyLoader, cri, isRoot, inheritHeaders, executorService, configuration, interceptorWrapper, secConfig, varValues);<NEW_LINE>} else {<NEW_LINE>clientProxy = new MicroProfileClientProxyImpl(actualState, proxyLoader, cri, isRoot, inheritHeaders, executorService, <MASK><NEW_LINE>}<NEW_LINE>RestClientNotifier notifier = RestClientNotifier.getInstance();<NEW_LINE>if (notifier != null) {<NEW_LINE>notifier.newRestClientProxy(clientProxy);<NEW_LINE>}<NEW_LINE>return clientProxy;<NEW_LINE>// Liberty change end<NEW_LINE>} | configuration, interceptorWrapper, secConfig, varValues); |
451,893 | public static PDPageXYZDestination createBoxDestination(RenderingContext c, PDDocument writer, PdfBoxFastOutputDevice od, float dotsPerPoint, Box root, Box box) {<NEW_LINE>List<PageBox> pages = root.getLayer().getPages();<NEW_LINE>Rectangle bounds = PagedBoxCollector.findAdjustedBoundsForBorderBox(c, box, pages);<NEW_LINE>int pageBoxIndex = PagedBoxCollector.findPageForY(c, bounds.getMinY(), pages);<NEW_LINE>PageBox page = pages.get(pageBoxIndex);<NEW_LINE>int distanceFromTop = page.getMarginBorderPadding(c, CalculatedStyle.TOP);<NEW_LINE>distanceFromTop += bounds.getMinY() - page.getTop();<NEW_LINE>int shadowPage = PagedBoxCollector.getShadowPageForBounds(c, bounds, page);<NEW_LINE>int pdfPageIndex = shadowPage == -1 ? page.getBasePagePdfPageIndex() : shadowPage <MASK><NEW_LINE>PDPageXYZDestination target = new PDPageXYZDestination();<NEW_LINE>target.setTop((int) (od.normalizeY(distanceFromTop, page.getHeight(c)) / dotsPerPoint));<NEW_LINE>target.setPage(writer.getPage(pdfPageIndex));<NEW_LINE>return target;<NEW_LINE>} | + 1 + page.getBasePagePdfPageIndex(); |
749,011 | private UpdatedState applyRenameActions(ClusterState state, SwapRelationsRequest swapRelationsRequest) {<NEW_LINE>HashSet<String> newIndexNames = new HashSet<>();<NEW_LINE>Metadata metadata = state.getMetadata();<NEW_LINE>Metadata.Builder updatedMetadata = Metadata.builder(state.getMetadata());<NEW_LINE>RoutingTable.Builder routingBuilder = RoutingTable.builder(state.routingTable());<NEW_LINE>ClusterBlocks.Builder blocksBuilder = ClusterBlocks.builder().blocks(state.blocks());<NEW_LINE>// Remove all involved indices first so that rename operations are independent of each other<NEW_LINE>for (RelationNameSwap swapAction : swapRelationsRequest.swapActions()) {<NEW_LINE>removeOccurrences(state, blocksBuilder, routingBuilder, updatedMetadata, swapAction.source());<NEW_LINE>removeOccurrences(state, blocksBuilder, routingBuilder, updatedMetadata, swapAction.target());<NEW_LINE>}<NEW_LINE>for (RelationNameSwap relationNameSwap : swapRelationsRequest.swapActions()) {<NEW_LINE>RelationName source = relationNameSwap.source();<NEW_LINE><MASK><NEW_LINE>addSourceIndicesRenamedToTargetName(state, metadata, updatedMetadata, blocksBuilder, routingBuilder, source, target, newIndexNames::add);<NEW_LINE>addSourceIndicesRenamedToTargetName(state, metadata, updatedMetadata, blocksBuilder, routingBuilder, target, source, newIndexNames::add);<NEW_LINE>}<NEW_LINE>ClusterState stateAfterSwap = ClusterState.builder(state).metadata(updatedMetadata).routingTable(routingBuilder.build()).blocks(blocksBuilder).build();<NEW_LINE>ClusterState reroutedState = allocationService.reroute(applyClusterStateModifiers(stateAfterSwap, swapRelationsRequest.swapActions()), "indices name switch");<NEW_LINE>return new UpdatedState(reroutedState, newIndexNames);<NEW_LINE>} | RelationName target = relationNameSwap.target(); |
592,919 | protected void applyEnterTableKey(EventBean[] eventsPerStream, Object tableKey, ExprEvaluatorContext exprEvaluatorContext) {<NEW_LINE>ObjectArrayBackedEventBean bean = <MASK><NEW_LINE>currentAggregationRow = (AggregationRow) bean.getProperties()[0];<NEW_LINE>InstrumentationCommon instrumentationCommon = exprEvaluatorContext.getInstrumentationProvider();<NEW_LINE>instrumentationCommon.qAggregationGroupedApplyEnterLeave(true, methodPairs.length, accessAgents.length, tableKey);<NEW_LINE>for (int i = 0; i < methodPairs.length; i++) {<NEW_LINE>TableColumnMethodPairEval methodPair = methodPairs[i];<NEW_LINE>instrumentationCommon.qAggNoAccessEnterLeave(true, i, null, null);<NEW_LINE>Object columnResult = methodPair.getEvaluator().evaluate(eventsPerStream, true, exprEvaluatorContext);<NEW_LINE>currentAggregationRow.enterAgg(methodPair.getColumn(), columnResult);<NEW_LINE>instrumentationCommon.aAggNoAccessEnterLeave(true, i, null);<NEW_LINE>}<NEW_LINE>for (int i = 0; i < accessAgents.length; i++) {<NEW_LINE>instrumentationCommon.qAggAccessEnterLeave(true, i, null);<NEW_LINE>accessAgents[i].applyEnter(eventsPerStream, exprEvaluatorContext, currentAggregationRow, accessColumnsZeroOffset[i]);<NEW_LINE>instrumentationCommon.aAggAccessEnterLeave(true, i);<NEW_LINE>}<NEW_LINE>tableInstance.handleRowUpdated(bean);<NEW_LINE>instrumentationCommon.aAggregationGroupedApplyEnterLeave(true);<NEW_LINE>} | tableInstance.getCreateRowIntoTable(tableKey, exprEvaluatorContext); |
680,710 | public TraversalControl visitArgument(Argument argument, TraverserContext<Node> context) {<NEW_LINE>GraphQLArgument graphQLArgumentDefinition;<NEW_LINE>// An argument is either from a applied query directive or from a field<NEW_LINE>if (context.getVarFromParents(GraphQLDirective.class) != null) {<NEW_LINE>GraphQLDirective directiveDefinition = context.getVarFromParents(GraphQLDirective.class);<NEW_LINE>graphQLArgumentDefinition = directiveDefinition.getArgument(argument.getName());<NEW_LINE>} else {<NEW_LINE>GraphQLFieldDefinition graphQLFieldDefinition = assertNotNull(context.getVarFromParents(GraphQLFieldDefinition.class));<NEW_LINE>graphQLArgumentDefinition = graphQLFieldDefinition.<MASK><NEW_LINE>}<NEW_LINE>GraphQLInputType argumentType = graphQLArgumentDefinition.getType();<NEW_LINE>String newName = assertNotNull(astNodeToNewName.get(argument));<NEW_LINE>Value newValue = replaceValue(argument.getValue(), argumentType, newNames, defaultStringValueCounter, defaultIntValueCounter);<NEW_LINE>return changeNode(context, argument.transform(builder -> builder.name(newName).value(newValue)));<NEW_LINE>} | getArgument(argument.getName()); |
174,531 | public List<List<Integer>> verticalTraversal(TreeNode root) {<NEW_LINE>List<int[]> list = new ArrayList<>();<NEW_LINE>dfs(root, 0, 0, list);<NEW_LINE>list.sort(new Comparator<int[]>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public int compare(int[] o1, int[] o2) {<NEW_LINE>if (o1[0] != o2[0])<NEW_LINE>return Integer.compare(o1[0], o2[0]);<NEW_LINE>if (o1[1] != o2[1])<NEW_LINE>return Integer.compare(o2[1], o1[1]);<NEW_LINE>return Integer.compare(o1[2], o2[2]);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>List<List<Integer>> res = new ArrayList<>();<NEW_LINE>int preX = 1;<NEW_LINE>for (int[] cur : list) {<NEW_LINE>if (preX != cur[0]) {<NEW_LINE>res.add<MASK><NEW_LINE>preX = cur[0];<NEW_LINE>}<NEW_LINE>res.get(res.size() - 1).add(cur[2]);<NEW_LINE>}<NEW_LINE>return res;<NEW_LINE>} | (new ArrayList<>()); |
1,180,046 | public Expression read(Decoder decoder) throws Exception {<NEW_LINE>byte tag = decoder.readByte();<NEW_LINE>if (tag == SIMPLE) {<NEW_LINE><MASK><NEW_LINE>IncludeType expressionType = enumSerializer.read(decoder);<NEW_LINE>return new SimpleExpression(expressionValue, expressionType);<NEW_LINE>} else if (tag == EMPTY_TOKENS) {<NEW_LINE>return SimpleExpression.EMPTY_EXPRESSIONS;<NEW_LINE>} else if (tag == EMPTY_ARGS) {<NEW_LINE>return SimpleExpression.EMPTY_ARGS;<NEW_LINE>} else if (tag == COMMA) {<NEW_LINE>return SimpleExpression.COMMA;<NEW_LINE>} else if (tag == LEFT_PAREN) {<NEW_LINE>return SimpleExpression.LEFT_PAREN;<NEW_LINE>} else if (tag == RIGHT_PAREN) {<NEW_LINE>return SimpleExpression.RIGHT_PAREN;<NEW_LINE>} else if (tag == COMPLEX_ONE_ARG) {<NEW_LINE>String expressionValue = decoder.readNullableString();<NEW_LINE>IncludeType type = enumSerializer.read(decoder);<NEW_LINE>List<Expression> args = ImmutableList.of(read(decoder));<NEW_LINE>return new ComplexExpression(type, expressionValue, args);<NEW_LINE>} else if (tag == COMPLEX_MULTIPLE_ARGS) {<NEW_LINE>String expressionValue = decoder.readNullableString();<NEW_LINE>IncludeType type = enumSerializer.read(decoder);<NEW_LINE>List<Expression> args = ImmutableList.copyOf(argsSerializer.read(decoder));<NEW_LINE>return new ComplexExpression(type, expressionValue, args);<NEW_LINE>} else {<NEW_LINE>throw new IllegalArgumentException();<NEW_LINE>}<NEW_LINE>} | String expressionValue = decoder.readNullableString(); |
1,415,522 | public void paint(@NotNull final Graphics2D g2d, @NotNull final Rectangle bounds, @NotNull final C c, @NotNull final D d, @NotNull final Shape shape) {<NEW_LINE>final int width = getWidth();<NEW_LINE>final float opacity = getOpacity();<NEW_LINE>if (width > 0 && opacity > 0f) {<NEW_LINE>final ShadowType type = getType();<NEW_LINE>if (type == ShadowType.outer) {<NEW_LINE>final Rectangle b = shape.getBounds();<NEW_LINE>final Rectangle sb = new Rectangle(b.x - width, b.y - width, b.width + width * 2, <MASK><NEW_LINE>getShadow(width, opacity).paintIcon(g2d, sb.x, sb.y, sb.width, sb.height);<NEW_LINE>} else {<NEW_LINE>throw new DecorationException("Inner shadow type is not supported by this shadow");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | b.height + width * 2); |
1,769,362 | private void prepareGui() {<NEW_LINE>setContentView(R.layout.programmer);<NEW_LINE>setTitle(R.string.programmer_title);<NEW_LINE>programmerStatusTextView_ = findViewById(R.id.programmerStatusTextView);<NEW_LINE>imageStatusTextView_ = findViewById(R.id.imageStatusTextView);<NEW_LINE>selectedImageTextView_ = findViewById(R.id.selectedImage);<NEW_LINE>if (selectedImage_ != null) {<NEW_LINE>selectedImageTextView_.<MASK><NEW_LINE>selectedImageTextView_.setTextColor(Color.WHITE);<NEW_LINE>}<NEW_LINE>Button selectButton_ = findViewById(R.id.selectButton);<NEW_LINE>selectButton_.setOnClickListener(new OnClickListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onClick(View v) {<NEW_LINE>startActivityForResult(new Intent(BootImageLibraryActivity.ACTION_SELECT, null, ProgrammerActivity.this, BootImageLibraryActivity.class), REQUEST_IMAGE_SELECT);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>eraseButton_ = findViewById(R.id.eraseButton);<NEW_LINE>eraseButton_.setOnClickListener(new OnClickListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onClick(View v) {<NEW_LINE>desiredState_ = ProgrammerState.STATE_ERASE_START;<NEW_LINE>}<NEW_LINE>});<NEW_LINE>programButton_ = findViewById(R.id.programButton);<NEW_LINE>programButton_.setOnClickListener(new OnClickListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onClick(View v) {<NEW_LINE>desiredState_ = ProgrammerState.STATE_PROGRAM_START;<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} | setText(selectedBundleName_ + " / " + selectedBoardName_); |
1,091,032 | private FastBuildState updateBuild(BlazeContext context, Label label, FastBuildParameters buildParameters, @Nullable FastBuildState existingBuildState) {<NEW_LINE>context.output(FastBuildLogOutput.keyValue("label", label.toString()));<NEW_LINE>if (existingBuildState != null && !existingBuildState.newBuildOutput().isDone()) {<NEW_LINE>// Don't start a new build if an existing one is still running.<NEW_LINE>context.output(FastBuildLogOutput.keyValue("reused_existing_build_future", "true"));<NEW_LINE>return existingBuildState;<NEW_LINE>}<NEW_LINE>BuildOutput completedBuildOutput = getCompletedBuild(existingBuildState);<NEW_LINE>ChangedSources changedSources = ChangedSources.fullCompile();<NEW_LINE>if (completedBuildOutput != null) {<NEW_LINE>changedSources = changedFilesManager.getAndResetChangedSources(label);<NEW_LINE>}<NEW_LINE>if (changedSources.needsFullCompile()) {<NEW_LINE>File compileDirectory = getCompilerOutputDirectory(existingBuildState);<NEW_LINE>ListenableFuture<BuildOutput> newBuildOutput = buildDeployJarAsync(context, label, buildParameters);<NEW_LINE><MASK><NEW_LINE>return FastBuildState.create(newBuildOutput, compileDirectory, buildParameters);<NEW_LINE>} else {<NEW_LINE>existingBuildState = existingBuildState.withCompletedBuildOutput(completedBuildOutput);<NEW_LINE>return performIncrementalCompilation(context, label, existingBuildState, changedSources.changedSources());<NEW_LINE>}<NEW_LINE>} | changedFilesManager.newBuild(label, newBuildOutput); |
1,078,366 | private JComponent createGainPanel() {<NEW_LINE>final JSlider gainSlider;<NEW_LINE>gainSlider = new JSlider(0, 200);<NEW_LINE>gainSlider.setValue(100);<NEW_LINE>gainSlider.setPaintLabels(true);<NEW_LINE>gainSlider.setPaintTicks(true);<NEW_LINE>final JLabel label = new JLabel("Gain: 100%");<NEW_LINE>gainSlider.addChangeListener(new ChangeListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void stateChanged(ChangeEvent arg0) {<NEW_LINE>double gainValue = gainSlider.getValue() / 100.0;<NEW_LINE>label.setText(String.format("Gain: %3d", gainSlider<MASK><NEW_LINE>if (gain != null)<NEW_LINE>gain.setGain(gainValue);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>JPanel gainPanel = new JPanel(new BorderLayout());<NEW_LINE>label.setToolTipText("Volume in % (100 is no change).");<NEW_LINE>gainPanel.add(label, BorderLayout.NORTH);<NEW_LINE>gainPanel.add(gainSlider, BorderLayout.CENTER);<NEW_LINE>gainPanel.setBorder(new TitledBorder("Volume control"));<NEW_LINE>return gainPanel;<NEW_LINE>} | .getValue()) + "%"); |
1,259,466 | private void updateDialogForCurrentKey() {<NEW_LINE>int flags = _currentKeyBean.getMetaFlags();<NEW_LINE>_checkAlt.setChecked(0 != (flags & (RemoteKeyboard.ALT_MASK | RemoteKeyboard.RALT_MASK)));<NEW_LINE>_checkShift.setChecked(0 != (flags & (RemoteKeyboard.SHIFT_MASK | RemoteKeyboard.RSHIFT_MASK)));<NEW_LINE>_checkCtrl.setChecked(0 != (flags & (RemoteKeyboard.<MASK><NEW_LINE>_checkSuper.setChecked(0 != (flags & (RemoteKeyboard.SUPER_MASK | RemoteKeyboard.RSUPER_MASK)));<NEW_LINE>MetaKeyBase base = null;<NEW_LINE>if (_currentKeyBean.isMouseClick()) {<NEW_LINE>base = MetaKeyBean.keysByMouseButton.get(_currentKeyBean.getMouseButtons());<NEW_LINE>} else {<NEW_LINE>base = MetaKeyBean.keysByKeySym.get(_currentKeyBean.getKeySym());<NEW_LINE>}<NEW_LINE>if (base != null) {<NEW_LINE>int index = Collections.binarySearch(MetaKeyBean.allKeys, base);<NEW_LINE>if (index >= 0) {<NEW_LINE>_spinnerKeySelect.setSelection(index);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>_textKeyDesc.setText(_currentKeyBean.getKeyDesc());<NEW_LINE>} | CTRL_MASK | RemoteKeyboard.RCTRL_MASK))); |
715,785 | public void initialize() throws IOException {<NEW_LINE>super.initialize();<NEW_LINE>boolean setDockIcon = true;<NEW_LINE>boolean setDockName = true;<NEW_LINE>for (String s : jvmArguments) {<NEW_LINE>if (s.contains(XDOCK_NAME_PROPERTY_NAME)) {<NEW_LINE>setDockName = false;<NEW_LINE>}<NEW_LINE>if (s.contains(XDOCK_ICON_PROPERTY_NAME)) {<NEW_LINE>setDockIcon = false;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (setDockIcon && !Boolean.getBoolean(NOTSET_DOCK_ICON_PROPERTY)) {<NEW_LINE>File iconFile = null;<NEW_LINE>String uri = System.getProperty(JAVA_APPLICATION_ICON_PROPERTY);<NEW_LINE>if (uri == null) {<NEW_LINE>uri = JAVA_APPLICATION_ICON_DEFAULT_URI;<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>iconFile = FileProxy.getInstance().getFile(uri, true);<NEW_LINE>LauncherResource iconResource = new LauncherResource(iconFile);<NEW_LINE>jvmArguments.add(XDOCK_ICON_PROPERTY_NAME + StringUtils.EQUAL + iconResource.getAbsolutePath());<NEW_LINE>otherResources.add(iconResource);<NEW_LINE>} catch (DownloadException e) {<NEW_LINE>ErrorManager.notify(ResourceUtils.getString(CommandLauncher.class<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (setDockName && !Boolean.getBoolean(NOTSET_DOCK_NAME_PROPERTY)) {<NEW_LINE>jvmArguments.add(XDOCK_NAME_PROPERTY_NAME + StringUtils.EQUAL + "$P{" + JAVA_APPLICATION_NAME_LAUNCHER_PROPERTY + "}");<NEW_LINE>}<NEW_LINE>} | , ERROR_CANNOT_GET_ICON_KEY, uri), e); |
1,425,206 | public void processTokenRequest(OAuth20Provider provider, HttpServletRequest request, HttpServletResponse response) throws ServletException, OidcServerException {<NEW_LINE>String clientId = (String) request.getAttribute("authenticatedClient");<NEW_LINE>try {<NEW_LINE>// checking resource<NEW_LINE>OidcBaseClient client = OAuth20ProviderUtils.getOidcOAuth20Client(provider, clientId);<NEW_LINE>if (client == null || !client.isEnabled()) {<NEW_LINE>throw new OidcServerException("security.oauth20.error.invalid.client", <MASK><NEW_LINE>}<NEW_LINE>OAuth20ProviderUtils.validateResource(request, null, client);<NEW_LINE>} catch (OAuth20BadParameterException e) {<NEW_LINE>// some exceptions need to handled separately<NEW_LINE>WebUtils.throwOidcServerException(request, e);<NEW_LINE>} catch (OAuth20Exception e) {<NEW_LINE>WebUtils.throwOidcServerException(request, e);<NEW_LINE>}<NEW_LINE>OAuthResult result = clientAuthorization.validateAndHandle2LegsScope(provider, request, response, clientId);<NEW_LINE>if (result.getStatus() == OAuthResult.STATUS_OK) {<NEW_LINE>result = provider.processTokenRequest(clientId, request, response);<NEW_LINE>}<NEW_LINE>if (result.getStatus() != OAuthResult.STATUS_OK) {<NEW_LINE>OAuth20TokenRequestExceptionHandler handler = new OAuth20TokenRequestExceptionHandler();<NEW_LINE>handler.handleResultException(request, response, result);<NEW_LINE>}<NEW_LINE>} | OIDCConstants.ERROR_INVALID_CLIENT_METADATA, HttpServletResponse.SC_BAD_REQUEST); |
1,764,831 | public RecipeAction unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>RecipeAction recipeAction = new RecipeAction();<NEW_LINE><MASK><NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>if (context.testExpression("Operation", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>recipeAction.setOperation(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("Parameters", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>recipeAction.setParameters(new MapUnmarshaller<String, String>(context.getUnmarshaller(String.class), 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 recipeAction;<NEW_LINE>} | int originalDepth = context.getCurrentDepth(); |
358,379 | String generateFinderSelectorParamCheck(Method m, String[] parameterEjbNames) {<NEW_LINE>StringBuilder checkBody = new StringBuilder();<NEW_LINE>Class[] paramTypes = m.getParameterTypes();<NEW_LINE>int paramLength = paramTypes.length;<NEW_LINE>String paramClassName = null;<NEW_LINE>for (int i = 0; i < paramLength; i++) {<NEW_LINE>if (parameterEjbNames[i] != null) {<NEW_LINE>paramClassName = paramTypes[i].getName();<NEW_LINE>String concreteImplName = nameMapper.getConcreteBeanClassForEjbName(parameterEjbNames[i]);<NEW_LINE>twoParams[0] = concreteImplName;<NEW_LINE>twoParams[<MASK><NEW_LINE>if (nameMapper.isLocalInterface(paramClassName)) {<NEW_LINE>checkBody.append(CMP20TemplateFormatter.finderselectorchecklocalformatter.format(twoParams));<NEW_LINE>} else {<NEW_LINE>// Remote<NEW_LINE>checkBody.append(CMP20TemplateFormatter.finderselectorcheckremoteformatter.format(twoParams));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return checkBody.toString();<NEW_LINE>} | 1] = CMP20TemplateFormatter.param_ + i; |
1,345,952 | public static DescribePriceResponse unmarshall(DescribePriceResponse describePriceResponse, UnmarshallerContext _ctx) {<NEW_LINE>describePriceResponse.setRequestId(_ctx.stringValue("DescribePriceResponse.RequestId"));<NEW_LINE>describePriceResponse.setTraceId(_ctx.stringValue("DescribePriceResponse.TraceId"));<NEW_LINE>describePriceResponse.setOrderParams(_ctx.stringValue("DescribePriceResponse.OrderParams"));<NEW_LINE>Order order = new Order();<NEW_LINE>order.setOriginalAmount(_ctx.stringValue("DescribePriceResponse.Order.OriginalAmount"));<NEW_LINE>order.setDiscountAmount(_ctx.stringValue("DescribePriceResponse.Order.DiscountAmount"));<NEW_LINE>order.setTradeAmount(_ctx.stringValue("DescribePriceResponse.Order.TradeAmount"));<NEW_LINE>order.setCurrency(_ctx.stringValue("DescribePriceResponse.Order.Currency"));<NEW_LINE>List<String> ruleIds1 = new ArrayList<String>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("DescribePriceResponse.Order.RuleIds.Length"); i++) {<NEW_LINE>ruleIds1.add(_ctx.stringValue("DescribePriceResponse.Order.RuleIds[" + i + "]"));<NEW_LINE>}<NEW_LINE>order.setRuleIds1(ruleIds1);<NEW_LINE>List<Coupon> coupons = new ArrayList<Coupon>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("DescribePriceResponse.Order.Coupons.Length"); i++) {<NEW_LINE>Coupon coupon = new Coupon();<NEW_LINE>coupon.setDescription(_ctx.stringValue("DescribePriceResponse.Order.Coupons[" + i + "].Description"));<NEW_LINE>coupon.setIsSelected(_ctx.stringValue("DescribePriceResponse.Order.Coupons[" + i + "].IsSelected"));<NEW_LINE>coupon.setCouponNo(_ctx.stringValue("DescribePriceResponse.Order.Coupons[" + i + "].CouponNo"));<NEW_LINE>coupon.setName(_ctx.stringValue<MASK><NEW_LINE>coupons.add(coupon);<NEW_LINE>}<NEW_LINE>order.setCoupons(coupons);<NEW_LINE>describePriceResponse.setOrder(order);<NEW_LINE>List<SubOrder> subOrders = new ArrayList<SubOrder>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("DescribePriceResponse.SubOrders.Length"); i++) {<NEW_LINE>SubOrder subOrder = new SubOrder();<NEW_LINE>subOrder.setOriginalAmount(_ctx.stringValue("DescribePriceResponse.SubOrders[" + i + "].OriginalAmount"));<NEW_LINE>subOrder.setDiscountAmount(_ctx.stringValue("DescribePriceResponse.SubOrders[" + i + "].DiscountAmount"));<NEW_LINE>subOrder.setTradeAmount(_ctx.stringValue("DescribePriceResponse.SubOrders[" + i + "].TradeAmount"));<NEW_LINE>subOrder.setInstanceId(_ctx.stringValue("DescribePriceResponse.SubOrders[" + i + "].InstanceId"));<NEW_LINE>List<String> ruleIds = new ArrayList<String>();<NEW_LINE>for (int j = 0; j < _ctx.lengthValue("DescribePriceResponse.SubOrders[" + i + "].RuleIds.Length"); j++) {<NEW_LINE>ruleIds.add(_ctx.stringValue("DescribePriceResponse.SubOrders[" + i + "].RuleIds[" + j + "]"));<NEW_LINE>}<NEW_LINE>subOrder.setRuleIds(ruleIds);<NEW_LINE>subOrders.add(subOrder);<NEW_LINE>}<NEW_LINE>describePriceResponse.setSubOrders(subOrders);<NEW_LINE>List<Rule> rules = new ArrayList<Rule>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("DescribePriceResponse.Rules.Length"); i++) {<NEW_LINE>Rule rule = new Rule();<NEW_LINE>rule.setRuleDescId(_ctx.longValue("DescribePriceResponse.Rules[" + i + "].RuleDescId"));<NEW_LINE>rule.setTitle(_ctx.stringValue("DescribePriceResponse.Rules[" + i + "].Title"));<NEW_LINE>rule.setName(_ctx.stringValue("DescribePriceResponse.Rules[" + i + "].Name"));<NEW_LINE>rules.add(rule);<NEW_LINE>}<NEW_LINE>describePriceResponse.setRules(rules);<NEW_LINE>return describePriceResponse;<NEW_LINE>} | ("DescribePriceResponse.Order.Coupons[" + i + "].Name")); |
115,134 | public AddPrefixListEntry unmarshall(StaxUnmarshallerContext context) throws Exception {<NEW_LINE>AddPrefixListEntry addPrefixListEntry = new AddPrefixListEntry();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>if (context.isStartOfDocument())<NEW_LINE>targetDepth += 1;<NEW_LINE>while (true) {<NEW_LINE><MASK><NEW_LINE>if (xmlEvent.isEndDocument())<NEW_LINE>return addPrefixListEntry;<NEW_LINE>if (xmlEvent.isAttribute() || xmlEvent.isStartElement()) {<NEW_LINE>if (context.testExpression("Cidr", targetDepth)) {<NEW_LINE>addPrefixListEntry.setCidr(StringStaxUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (context.testExpression("Description", targetDepth)) {<NEW_LINE>addPrefixListEntry.setDescription(StringStaxUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>} else if (xmlEvent.isEndElement()) {<NEW_LINE>if (context.getCurrentDepth() < originalDepth) {<NEW_LINE>return addPrefixListEntry;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | XMLEvent xmlEvent = context.nextEvent(); |
1,106,093 | final DeleteBlueprintResult executeDeleteBlueprint(DeleteBlueprintRequest deleteBlueprintRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(deleteBlueprintRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DeleteBlueprintRequest> request = null;<NEW_LINE>Response<DeleteBlueprintResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DeleteBlueprintRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(deleteBlueprintRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "Glue");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DeleteBlueprint");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DeleteBlueprintResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DeleteBlueprintResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden()); |
195,817 | private CodecMeta toSampleEntry(GenericDescriptor d) {<NEW_LINE>if (track.isVideo()) {<NEW_LINE>GenericPictureEssenceDescriptor ped = (GenericPictureEssenceDescriptor) d;<NEW_LINE>Rational ar = ped.getAspectRatio();<NEW_LINE>VideoCodecMeta se = VideoCodecMeta.createVideoCodecMeta(MP4Util.getFourcc(track.getCodec().getCodec()), null, new Size(ped.getDisplayWidth(), ped.getDisplayHeight()), new Rational((int) ((1000 * ar.getNum() * ped.getDisplayHeight()) / (ar.getDen() * ped.getDisplayWidth<MASK><NEW_LINE>return se;<NEW_LINE>} else if (track.isAudio()) {<NEW_LINE>GenericSoundEssenceDescriptor sed = (GenericSoundEssenceDescriptor) d;<NEW_LINE>int sampleSize = sed.getQuantizationBits() >> 3;<NEW_LINE>MXFCodec codec = track.getCodec();<NEW_LINE>Label[] labels = new Label[sed.getChannelCount()];<NEW_LINE>Arrays.fill(labels, Label.Mono);<NEW_LINE>return AudioCodecMeta.createAudioCodecMeta(sampleSize == 3 ? "in24" : "sowt", sampleSize, sed.getChannelCount(), (int) sed.getAudioSamplingRate().scalar(), codec == MXFCodec.PCM_S16BE ? ByteOrder.BIG_ENDIAN : ByteOrder.LITTLE_ENDIAN, true, labels, null);<NEW_LINE>}<NEW_LINE>throw new RuntimeException("Can't get sample entry");<NEW_LINE>} | ())), 1000)); |
894,000 | public TemporaryCredential unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>TemporaryCredential temporaryCredential = new TemporaryCredential();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>if (context.testExpression("Username", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>temporaryCredential.setUsername(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("Password", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>temporaryCredential.setPassword(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("ValidForInMinutes", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>temporaryCredential.setValidForInMinutes(context.getUnmarshaller(Integer.<MASK><NEW_LINE>}<NEW_LINE>if (context.testExpression("InstanceId", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>temporaryCredential.setInstanceId(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 temporaryCredential;<NEW_LINE>} | class).unmarshall(context)); |
900,145 | public boolean compile() throws IOException {<NEW_LINE>if (getJaxbJarFile() != null) {<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>FileObject jaxbBaseDir = getOrCreateJaxbFolder();<NEW_LINE>FileObject userBuildFile = SaasServicesModel.getWebServiceHome().getParent().<MASK><NEW_LINE>File jaxbBasePath = FileUtil.normalizeFile(FileUtil.toFile(jaxbBaseDir));<NEW_LINE>File xsdFilePath = FileUtil.normalizeFile(FileUtil.toFile(xsdFile));<NEW_LINE>File userBuildPath = FileUtil.normalizeFile(FileUtil.toFile(userBuildFile));<NEW_LINE>Properties p = new Properties();<NEW_LINE>p.setProperty(PROP_XSD_FILE, xsdFilePath.getPath());<NEW_LINE>p.setProperty(PROP_PACKAGE_NAME, packageName);<NEW_LINE>p.setProperty(PROP_JAXB_BASE, jaxbBasePath.getPath());<NEW_LINE>p.setProperty(PROP_JAXB_JAR, jaxbJarPath);<NEW_LINE>p.setProperty(PROP_JAXB_SRC_JAR, jaxbSourceJarPath);<NEW_LINE>p.setProperty(PROP_USER_BUILD_PROPERTIES, userBuildPath.getPath());<NEW_LINE>return createJaxBJar(p);<NEW_LINE>} | getParent().getFileObject("build.properties"); |
1,159,567 | public void updatePosition(PlaybackPositionEvent event) {<NEW_LINE>if (controller == null || txtvPosition == null || txtvLength == null || sbPosition == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>TimeSpeedConverter converter = new TimeSpeedConverter(controller.getCurrentPlaybackSpeedMultiplier());<NEW_LINE>int currentPosition = converter.<MASK><NEW_LINE>int duration = converter.convert(event.getDuration());<NEW_LINE>int remainingTime = converter.convert(Math.max(event.getDuration() - event.getPosition(), 0));<NEW_LINE>currentChapterIndex = ChapterUtils.getCurrentChapterIndex(controller.getMedia(), currentPosition);<NEW_LINE>Log.d(TAG, "currentPosition " + Converter.getDurationStringLong(currentPosition));<NEW_LINE>if (currentPosition == PlaybackService.INVALID_TIME || duration == PlaybackService.INVALID_TIME) {<NEW_LINE>Log.w(TAG, "Could not react to position observer update because of invalid time");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>txtvPosition.setText(Converter.getDurationStringLong(currentPosition));<NEW_LINE>showTimeLeft = UserPreferences.shouldShowRemainingTime();<NEW_LINE>if (showTimeLeft) {<NEW_LINE>txtvLength.setText(((remainingTime > 0) ? "-" : "") + Converter.getDurationStringLong(remainingTime));<NEW_LINE>} else {<NEW_LINE>txtvLength.setText(Converter.getDurationStringLong(duration));<NEW_LINE>}<NEW_LINE>if (!sbPosition.isPressed()) {<NEW_LINE>float progress = ((float) event.getPosition()) / event.getDuration();<NEW_LINE>sbPosition.setProgress((int) (progress * sbPosition.getMax()));<NEW_LINE>}<NEW_LINE>} | convert(event.getPosition()); |
1,409,938 | private void populateView() {<NEW_LINE>_grid = getActivity().findViewById(R.id.app_grid);<NEW_LINE>assert _grid != null;<NEW_LINE>_grid.setFastScrollEnabled(true);<NEW_LINE>_grid.setFastScrollAlwaysVisible(false);<NEW_LINE>_appInfoAdapter = new <MASK><NEW_LINE>_grid.setAdapter(_appInfoAdapter);<NEW_LINE>_grid.setOnItemClickListener(new AdapterView.OnItemClickListener() {<NEW_LINE><NEW_LINE>public void onItemClick(AdapterView<?> AdapterView, View view, int position, long row) {<NEW_LINE>App appInfo = (App) AdapterView.getItemAtPosition(position);<NEW_LINE>CheckBox checker = view.findViewById(R.id.checkbox);<NEW_LINE>ViewSwitcher icon = view.findViewById(R.id.viewSwitcherChecked);<NEW_LINE>checker.toggle();<NEW_LINE>if (checker.isChecked()) {<NEW_LINE>_listActivitiesHidden.add(appInfo.getComponentName());<NEW_LINE>if (DEBUG)<NEW_LINE>Log.v(TAG, "Selected App: " + appInfo.getLabel());<NEW_LINE>if (icon.getDisplayedChild() == 0) {<NEW_LINE>icon.showNext();<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>_listActivitiesHidden.remove(appInfo.getComponentName());<NEW_LINE>if (DEBUG)<NEW_LINE>Log.v(TAG, "Deselected App: " + appInfo.getLabel());<NEW_LINE>if (icon.getDisplayedChild() == 1) {<NEW_LINE>icon.showPrevious();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} | HideAppsAdapter(getActivity(), _listActivitiesAll); |
1,716,087 | public void resizeStitchImage(int widthStitch, int heightStitch, IT newToOldStitch) {<NEW_LINE>// copy the old image into the new one<NEW_LINE>workImage.reshape(widthStitch, heightStitch);<NEW_LINE>GImageMiscOps.fill(workImage, 0);<NEW_LINE>if (newToOldStitch != null) {<NEW_LINE>PixelTransform<Point2D_F32> newToOld = converter.convertPixel(newToOldStitch, null);<NEW_LINE>distorter.setModel(newToOld);<NEW_LINE>distorter.apply(stitchedImage, workImage);<NEW_LINE>// update the transforms<NEW_LINE>IT tmp = (IT) worldToCurr.createInstance();<NEW_LINE>newToOldStitch.concat(worldToInit, tmp);<NEW_LINE>worldToInit.setTo(tmp);<NEW_LINE>computeCurrToInit_PixelTran();<NEW_LINE>} else {<NEW_LINE>int overlapWidth = Math.min(widthStitch, stitchedImage.width);<NEW_LINE>int overlapHeight = Math.min(heightStitch, stitchedImage.height);<NEW_LINE>GImageMiscOps.copy(0, 0, 0, 0, <MASK><NEW_LINE>}<NEW_LINE>stitchedImage.reshape(widthStitch, heightStitch);<NEW_LINE>I tmp = stitchedImage;<NEW_LINE>stitchedImage = workImage;<NEW_LINE>workImage = tmp;<NEW_LINE>this.widthStitch = widthStitch;<NEW_LINE>this.heightStitch = heightStitch;<NEW_LINE>} | overlapWidth, overlapHeight, stitchedImage, workImage); |
1,442,994 | public Object doQuery(Object[] objs) {<NEW_LINE>int count = 1000;<NEW_LINE>if (objs.length >= 3 && objs[2] instanceof Integer) {<NEW_LINE>count = Integer.parseInt(objs[2].toString());<NEW_LINE>}<NEW_LINE>ScanOptions options = new ScanOptions.ScanOptionsBuilder().match(objs[1].toString()).count(count).build();<NEW_LINE>m_colNames = new String[] { "Value", "Score" };<NEW_LINE>List<Object[]> ls = new ArrayList<Object[]>();<NEW_LINE>Cursor<TypedTuple<String>> cursor = m_jedisTool.zScan(objs[0<MASK><NEW_LINE>while (cursor.hasNext()) {<NEW_LINE>TypedTuple<String> tp = cursor.next();<NEW_LINE>Object[] os = new Object[] { tp.getValue(), tp.getScore() };<NEW_LINE>ls.add(os);<NEW_LINE>}<NEW_LINE>return toTable(ls);<NEW_LINE>} | ].toString(), options); |
285,531 | private Document ticketToDoc(TicketModel ticket) {<NEW_LINE>Document doc = new Document();<NEW_LINE>// repository and document ids for Lucene querying<NEW_LINE>toDocField(doc, Lucene.rid, StringUtils.getSHA1(ticket.repository));<NEW_LINE>toDocField(doc, Lucene.did, StringUtils.getSHA1(ticket.repository + ticket.number));<NEW_LINE>toDocField(doc, Lucene.project, ticket.project);<NEW_LINE>toDocField(doc, Lucene.repository, ticket.repository);<NEW_LINE>toDocField(doc, Lucene.number, ticket.number);<NEW_LINE>toDocField(doc, Lucene.title, ticket.title);<NEW_LINE>toDocField(doc, Lucene.body, ticket.body);<NEW_LINE>toDocField(doc, <MASK><NEW_LINE>toDocField(doc, Lucene.createdby, ticket.createdBy);<NEW_LINE>toDocField(doc, Lucene.updated, ticket.updated);<NEW_LINE>toDocField(doc, Lucene.updatedby, ticket.updatedBy);<NEW_LINE>toDocField(doc, Lucene.responsible, ticket.responsible);<NEW_LINE>toDocField(doc, Lucene.milestone, ticket.milestone);<NEW_LINE>toDocField(doc, Lucene.topic, ticket.topic);<NEW_LINE>toDocField(doc, Lucene.status, ticket.status.name());<NEW_LINE>toDocField(doc, Lucene.comments, ticket.getComments().size());<NEW_LINE>toDocField(doc, Lucene.type, ticket.type == null ? null : ticket.type.name());<NEW_LINE>toDocField(doc, Lucene.mergesha, ticket.mergeSha);<NEW_LINE>toDocField(doc, Lucene.mergeto, ticket.mergeTo);<NEW_LINE>toDocField(doc, Lucene.labels, StringUtils.flattenStrings(ticket.getLabels(), ";").toLowerCase());<NEW_LINE>toDocField(doc, Lucene.participants, StringUtils.flattenStrings(ticket.getParticipants(), ";").toLowerCase());<NEW_LINE>toDocField(doc, Lucene.watchedby, StringUtils.flattenStrings(ticket.getWatchers(), ";").toLowerCase());<NEW_LINE>toDocField(doc, Lucene.mentions, StringUtils.flattenStrings(ticket.getMentions(), ";").toLowerCase());<NEW_LINE>toDocField(doc, Lucene.votes, ticket.getVoters().size());<NEW_LINE>toDocField(doc, Lucene.priority, ticket.priority.getValue());<NEW_LINE>toDocField(doc, Lucene.severity, ticket.severity.getValue());<NEW_LINE>List<String> attachments = new ArrayList<String>();<NEW_LINE>for (Attachment attachment : ticket.getAttachments()) {<NEW_LINE>attachments.add(attachment.name.toLowerCase());<NEW_LINE>}<NEW_LINE>toDocField(doc, Lucene.attachments, StringUtils.flattenStrings(attachments, ";"));<NEW_LINE>List<Patchset> patches = ticket.getPatchsets();<NEW_LINE>if (!patches.isEmpty()) {<NEW_LINE>toDocField(doc, Lucene.patchsets, patches.size());<NEW_LINE>Patchset patchset = patches.get(patches.size() - 1);<NEW_LINE>String flat = patchset.number + ":" + patchset.rev + ":" + patchset.tip + ":" + patchset.base + ":" + patchset.commits;<NEW_LINE>doc.add(new org.apache.lucene.document.Field(Lucene.patchset.name(), flat, TextField.TYPE_STORED));<NEW_LINE>}<NEW_LINE>doc.add(new TextField(Lucene.content.name(), ticket.toIndexableString(), Store.NO));<NEW_LINE>return doc;<NEW_LINE>} | Lucene.created, ticket.created); |
239,503 | private static void writeJson(DynamoDBEntry entry, JsonWriter writer) throws IOException {<NEW_LINE>if (entry instanceof Document) {<NEW_LINE>writer.beginObject();<NEW_LINE>final Document doc = (Document) entry;<NEW_LINE>for (final Entry<String, DynamoDBEntry> docEntry : doc.entrySet()) {<NEW_LINE>final String key = docEntry.getKey();<NEW_LINE>final DynamoDBEntry value = docEntry.getValue();<NEW_LINE>writer.name(key);<NEW_LINE>writeJson(value, writer);<NEW_LINE>}<NEW_LINE>writer.endObject();<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (entry instanceof Primitive) {<NEW_LINE>final Primitive p = (Primitive) entry;<NEW_LINE>writePrimitive(p.getType(), writer, p);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (entry instanceof PrimitiveList) {<NEW_LINE>final PrimitiveList pl = (PrimitiveList) entry;<NEW_LINE>writer.beginArray();<NEW_LINE>for (final DynamoDBEntry e : pl.getEntries()) {<NEW_LINE>writePrimitive(pl.getType(), writer, e);<NEW_LINE>}<NEW_LINE>writer.endArray();<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (entry instanceof DynamoDBList) {<NEW_LINE>final DynamoDBList pl = (DynamoDBList) entry;<NEW_LINE>writer.beginArray();<NEW_LINE>for (final DynamoDBEntry e : pl.getEntries()) {<NEW_LINE>writeJson(e, writer);<NEW_LINE>}<NEW_LINE>writer.endArray();<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (entry instanceof DynamoDBBool) {<NEW_LINE>writer.value(((DynamoDBBool) entry).asBoolean());<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (entry instanceof DynamoDBNull) {<NEW_LINE>writer.nullValue();<NEW_LINE>return;<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>} | throw new JsonParseException("unable to convert to json " + entry); |
1,234,979 | public CompletableFuture<InetSocketAddress> resolveAddr() {<NEW_LINE>if (resolvedAddrFuture.get() != null) {<NEW_LINE>return resolvedAddrFuture.get();<NEW_LINE>}<NEW_LINE>CompletableFuture<InetSocketAddress> promise = new CompletableFuture<>();<NEW_LINE>if (!resolvedAddrFuture.compareAndSet(null, promise)) {<NEW_LINE>return resolvedAddrFuture.get();<NEW_LINE>}<NEW_LINE>byte[] addr = NetUtil.createByteArrayFromIpAddressString(uri.getHost());<NEW_LINE>if (addr != null) {<NEW_LINE>try {<NEW_LINE>resolvedAddr = new InetSocketAddress(InetAddress.getByAddress(uri.getHost(), addr), uri.getPort());<NEW_LINE>} catch (UnknownHostException e) {<NEW_LINE>// skip<NEW_LINE>}<NEW_LINE>promise.complete(resolvedAddr);<NEW_LINE>return promise;<NEW_LINE>}<NEW_LINE>AddressResolver<InetSocketAddress> resolver = (AddressResolver<InetSocketAddress>) bootstrap.config().resolver().getResolver(bootstrap.config().group().next());<NEW_LINE>Future<InetSocketAddress> resolveFuture = resolver.resolve(InetSocketAddress.createUnresolved(uri.getHost(), uri.getPort()));<NEW_LINE>resolveFuture.addListener((FutureListener<InetSocketAddress>) future -> {<NEW_LINE>if (!future.isSuccess()) {<NEW_LINE>promise.completeExceptionally(future.cause());<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>InetSocketAddress resolved = future.getNow();<NEW_LINE>byte[] addr1 = resolved<MASK><NEW_LINE>resolvedAddr = new InetSocketAddress(InetAddress.getByAddress(uri.getHost(), addr1), resolved.getPort());<NEW_LINE>promise.complete(resolvedAddr);<NEW_LINE>});<NEW_LINE>return promise;<NEW_LINE>} | .getAddress().getAddress(); |
76,879 | public MethodHandle unreflect(Method m) throws IllegalAccessException {<NEW_LINE>if (m.getDeclaringClass() == MethodHandle.class) {<NEW_LINE>MethodHandle mh = unreflectForMH(m);<NEW_LINE>if (mh != null)<NEW_LINE>return mh;<NEW_LINE>}<NEW_LINE>if (m.getDeclaringClass() == VarHandle.class) {<NEW_LINE>MethodHandle mh = unreflectForVH(m);<NEW_LINE>if (mh != null)<NEW_LINE>return mh;<NEW_LINE>}<NEW_LINE>MemberName method = new MemberName(m);<NEW_LINE>byte refKind = method.getReferenceKind();<NEW_LINE>if (refKind == REF_invokeSpecial)<NEW_LINE>refKind = REF_invokeVirtual;<NEW_LINE><MASK><NEW_LINE>@SuppressWarnings("deprecation")<NEW_LINE>Lookup lookup = m.isAccessible() ? IMPL_LOOKUP : this;<NEW_LINE>return lookup.getDirectMethodNoSecurityManager(refKind, method.getDeclaringClass(), method, findBoundCallerLookup(method));<NEW_LINE>} | assert (method.isMethod()); |
114,906 | private Mono<Response<ManagedEnvironmentStoragesCollectionInner>> listWithResponseAsync(String resourceGroupName, String envName) {<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 (this.client.getSubscriptionId() == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (resourceGroupName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (envName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter envName is required and cannot be null."));<NEW_LINE>}<NEW_LINE>final String accept = "application/json";<NEW_LINE>return FluxUtil.withContext(context -> service.list(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, envName, this.client.getApiVersion(), accept, context)).contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext(<MASK><NEW_LINE>} | )).readOnly())); |
57,701 | public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {<NEW_LINE>View root = inflater.inflate(R.layout.fragment_wallet, container, false);<NEW_LINE>loadingRecentContainer = root.findViewById(R.id.wallet_loading_recent_container);<NEW_LINE>layoutAccountRecommended = root.findViewById(R.id.wallet_account_recommended_container);<NEW_LINE>layoutSdkInitializing = root.findViewById(R.id.container_sdk_initializing);<NEW_LINE>linkSkipAccount = root.findViewById(R.id.wallet_skip_account_link);<NEW_LINE>buttonSignUp = root.<MASK><NEW_LINE>inlineBalanceContainer = root.findViewById(R.id.wallet_inline_balance_container);<NEW_LINE>textWalletInlineBalance = root.findViewById(R.id.wallet_inline_balance_value);<NEW_LINE>walletSendProgress = root.findViewById(R.id.wallet_send_progress);<NEW_LINE>walletTotalBalanceView = root.findViewById(R.id.wallet_total_balance);<NEW_LINE>walletSpendableBalanceView = root.findViewById(R.id.wallet_spendable_balance);<NEW_LINE>walletSupportingBalanceView = root.findViewById(R.id.wallet_supporting_balance);<NEW_LINE>textWalletBalanceUSD = root.findViewById(R.id.wallet_balance_usd_value);<NEW_LINE>textWalletBalanceDesc = root.findViewById(R.id.total_balance_desc);<NEW_LINE>textWalletHintSyncStatus = root.findViewById(R.id.wallet_hint_sync_status);<NEW_LINE>buttonViewMore = root.findViewById(R.id.view_more_button);<NEW_LINE>detailListView = root.findViewById(R.id.balance_detail_listview);<NEW_LINE>recentTransactionsList = root.findViewById(R.id.wallet_recent_transactions_list);<NEW_LINE>linkViewAll = root.findViewById(R.id.wallet_link_view_all);<NEW_LINE>textNoRecentTransactions = root.findViewById(R.id.wallet_no_recent_transactions);<NEW_LINE>buttonBuyLBC = root.findViewById(R.id.wallet_buy_lbc_button);<NEW_LINE>textConvertCredits = root.findViewById(R.id.wallet_hint_convert_credits);<NEW_LINE>textConvertCreditsBittrex = root.findViewById(R.id.wallet_hint_convert_credits_bittrex);<NEW_LINE>textWhatSyncMeans = root.findViewById(R.id.wallet_hint_what_sync_means);<NEW_LINE>textWalletReceiveAddress = root.findViewById(R.id.wallet_receive_address);<NEW_LINE>buttonCopyReceiveAddress = root.findViewById(R.id.wallet_copy_receive_address);<NEW_LINE>buttonGetNewAddress = root.findViewById(R.id.wallet_get_new_address);<NEW_LINE>inputSendAddress = root.findViewById(R.id.wallet_input_send_address);<NEW_LINE>buttonQRScanAddress = root.findViewById(R.id.wallet_qr_scan_address);<NEW_LINE>inputSendAmount = root.findViewById(R.id.wallet_input_amount);<NEW_LINE>buttonSend = root.findViewById(R.id.wallet_send);<NEW_LINE>textConnectedEmail = root.findViewById(R.id.wallet_connected_email);<NEW_LINE>switchSyncStatus = root.findViewById(R.id.wallet_switch_sync_status);<NEW_LINE>linkManualBackup = root.findViewById(R.id.wallet_link_manual_backup);<NEW_LINE>linkSyncFAQ = root.findViewById(R.id.wallet_link_sync_faq);<NEW_LINE>initUi();<NEW_LINE>return root;<NEW_LINE>} | findViewById(R.id.wallet_sign_up_button); |
1,533,446 | private void readGenValue(GeneratedValue gen, Id id, DeployBeanProperty prop) {<NEW_LINE>if (id == null) {<NEW_LINE>if (UUID.class.equals(prop.getPropertyType())) {<NEW_LINE>generatedPropFactory.setUuid(prop);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>descriptor.setIdGeneratedValue();<NEW_LINE>SequenceGenerator seq = get(prop, SequenceGenerator.class);<NEW_LINE>if (seq != null) {<NEW_LINE>String seqName = seq.sequenceName();<NEW_LINE>if (seqName.isEmpty()) {<NEW_LINE>seqName = namingConvention.getSequenceName(descriptor.getBaseTable(<MASK><NEW_LINE>}<NEW_LINE>descriptor.setIdentitySequence(seq.initialValue(), seq.allocationSize(), seqName);<NEW_LINE>}<NEW_LINE>GenerationType strategy = gen.strategy();<NEW_LINE>if (strategy == GenerationType.IDENTITY) {<NEW_LINE>descriptor.setIdentityType(IdType.IDENTITY);<NEW_LINE>} else if (strategy == GenerationType.SEQUENCE) {<NEW_LINE>descriptor.setIdentityType(IdType.SEQUENCE);<NEW_LINE>if (!gen.generator().isEmpty()) {<NEW_LINE>descriptor.setIdentitySequenceGenerator(gen.generator());<NEW_LINE>}<NEW_LINE>} else if (strategy == GenerationType.AUTO) {<NEW_LINE>if (!gen.generator().isEmpty()) {<NEW_LINE>// use a custom IdGenerator<NEW_LINE>PlatformIdGenerator idGenerator = generatedPropFactory.getIdGenerator(gen.generator());<NEW_LINE>if (idGenerator == null) {<NEW_LINE>throw new IllegalStateException("No custom IdGenerator registered with name " + gen.generator());<NEW_LINE>}<NEW_LINE>descriptor.setCustomIdGenerator(idGenerator);<NEW_LINE>} else if (prop.getPropertyType().equals(UUID.class)) {<NEW_LINE>descriptor.setUuidGenerator();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | ), prop.getDbColumn()); |
1,518,392 | private <T extends Node.Cookie> T lookupCookie(Class<T> clazz) {<NEW_LINE>Node.Cookie ret = null;<NEW_LINE><MASK><NEW_LINE>synchronized (this) {<NEW_LINE>R r = findR(clazz);<NEW_LINE>if (r == null) {<NEW_LINE>if (queryMode == null || ic == null) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>ret = r.cookie();<NEW_LINE>if (queryMode instanceof Set) {<NEW_LINE>@SuppressWarnings("unchecked")<NEW_LINE>Set<Class> keys = (Set<Class>) queryMode;<NEW_LINE>keys.addAll(map.keySet());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (ret instanceof CookieEntry) {<NEW_LINE>if (clazz == queryMode) {<NEW_LINE>// we expected to be asked for this class<NEW_LINE>// set cookie entry as a result<NEW_LINE>QUERY_MODE.set(ret);<NEW_LINE>ret = null;<NEW_LINE>} else {<NEW_LINE>// unwrap the cookie<NEW_LINE>ret = ((CookieEntry) ret).getCookie(true);<NEW_LINE>}<NEW_LINE>} else if (ret == null) {<NEW_LINE>if (ic != null && (!Node.Cookie.class.isAssignableFrom(clazz) || clazz == Node.Cookie.class)) {<NEW_LINE>enhancedQueryMode(lookup, clazz);<NEW_LINE>ret = null;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return clazz.cast(ret);<NEW_LINE>} | Object queryMode = QUERY_MODE.get(); |
709,091 | protected LibSVMModel<Regressor> createModel(ModelProvenance provenance, ImmutableFeatureMap featureIDMap, ImmutableOutputInfo<Regressor> outputIDInfo, List<svm_model> models) {<NEW_LINE>if (models.get(0) instanceof ModelWithMeanVar) {<NEW_LINE>// models have been standardized, unpick and use standardized constructor<NEW_LINE>double[] means = new double[models.size()];<NEW_LINE>double[] variances = new <MASK><NEW_LINE>List<svm_model> unpickedModels = new ArrayList<>(models.size());<NEW_LINE>for (int i = 0; i < models.size(); i++) {<NEW_LINE>ModelWithMeanVar curModel = (ModelWithMeanVar) models.get(i);<NEW_LINE>means[i] = curModel.mean;<NEW_LINE>variances[i] = curModel.variance;<NEW_LINE>unpickedModels.add(curModel.innerModel);<NEW_LINE>}<NEW_LINE>return new LibSVMRegressionModel("svm-regression-model", provenance, featureIDMap, outputIDInfo, unpickedModels, means, variances);<NEW_LINE>} else {<NEW_LINE>return new LibSVMRegressionModel("svm-regression-model", provenance, featureIDMap, outputIDInfo, models);<NEW_LINE>}<NEW_LINE>} | double[models.size()]; |
417,552 | public synchronized void updateCurrentServingInstance() {<NEW_LINE>synchronized (_currentServingInstance) {<NEW_LINE>Map<String, InstanceTopicPartitionHolder> instanceMap = new HashMap<>();<NEW_LINE>Map<String, Set<TopicPartition>> instanceToTopicPartitionsMap = HelixUtils.getInstanceToTopicPartitionsMap(_helixZkManager);<NEW_LINE>List<String> <MASK><NEW_LINE>Set<String> blacklistedInstances = new HashSet<>(getBlacklistedInstances());<NEW_LINE>for (String instanceName : liveInstances) {<NEW_LINE>if (!blacklistedInstances.contains(instanceName)) {<NEW_LINE>InstanceTopicPartitionHolder instance = new InstanceTopicPartitionHolder(instanceName);<NEW_LINE>instanceMap.put(instanceName, instance);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>for (String instanceName : instanceToTopicPartitionsMap.keySet()) {<NEW_LINE>if (instanceMap.containsKey(instanceName)) {<NEW_LINE>instanceMap.get(instanceName).addTopicPartitions(instanceToTopicPartitionsMap.get(instanceName));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>_currentServingInstance.clear();<NEW_LINE>int maxStandbyHosts = (_controllerConf.getMaxWorkingInstances() <= 0) ? 0 : instanceMap.size() - _controllerConf.getMaxWorkingInstances();<NEW_LINE>int standbyHosts = 0;<NEW_LINE>for (InstanceTopicPartitionHolder itph : instanceMap.values()) {<NEW_LINE>if (standbyHosts >= maxStandbyHosts || itph.getNumServingTopicPartitions() > 0) {<NEW_LINE>_currentServingInstance.add(itph);<NEW_LINE>} else {<NEW_LINE>// exclude it as a standby host<NEW_LINE>standbyHosts++;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | liveInstances = HelixUtils.liveInstances(_helixZkManager); |
365,739 | private void restoreMemoryTags(String tagName, XmlPullParser parser, AddressSet addrSet) throws XmlParseException {<NEW_LINE>parser.start(tagName);<NEW_LINE>while (parser.peek().isStart()) {<NEW_LINE>XmlElement subel = parser.start();<NEW_LINE>String name = subel.getName();<NEW_LINE>if (name.equals("range") || name.equals("register")) {<NEW_LINE>String spcName = subel.getAttribute("space");<NEW_LINE>if (spcName != null && spaceBases != null && spaceBases.containsKey(spcName)) {<NEW_LINE>readExtraRange(subel, spcName, tagName);<NEW_LINE>} else {<NEW_LINE>AddressXML range = AddressXML.restoreRangeXml(subel, this);<NEW_LINE>Address firstAddress = range.getFirstAddress();<NEW_LINE>Address lastAddress = range.getLastAddress();<NEW_LINE>AddressRange addrRange = new AddressRangeImpl(firstAddress, lastAddress);<NEW_LINE>addrSet.add(addrRange);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>throw new XmlParseException(<MASK><NEW_LINE>}<NEW_LINE>parser.end(subel);<NEW_LINE>}<NEW_LINE>parser.end();<NEW_LINE>} | "Unexpected <" + tagName + "> sub-tag: " + name); |
180,542 | private void initComponents() {<NEW_LINE>// GEN-BEGIN:initComponents<NEW_LINE>java.awt.GridBagConstraints gridBagConstraints;<NEW_LINE>jLabel1 = <MASK><NEW_LINE>jScrollPane1 = new javax.swing.JScrollPane();<NEW_LINE>jPanel1 = new MainClassChooser(sourcesRoots, org.openide.util.NbBundle.getBundle(MainClassWarning.class).getString("CTL_SelectAvaialableMainClasses"));<NEW_LINE>setLayout(new java.awt.GridBagLayout());<NEW_LINE>getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getBundle(MainClassWarning.class).getString("AD_MainClassWarning"));<NEW_LINE>org.openide.awt.Mnemonics.setLocalizedText(jLabel1, this.message);<NEW_LINE>gridBagConstraints = new java.awt.GridBagConstraints();<NEW_LINE>gridBagConstraints.gridx = 0;<NEW_LINE>gridBagConstraints.gridy = 0;<NEW_LINE>gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER;<NEW_LINE>gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;<NEW_LINE>gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;<NEW_LINE>gridBagConstraints.weightx = 1.0;<NEW_LINE>gridBagConstraints.insets = new java.awt.Insets(12, 12, 6, 12);<NEW_LINE>add(jLabel1, gridBagConstraints);<NEW_LINE>jScrollPane1.setBorder(null);<NEW_LINE>jScrollPane1.setViewportView(jPanel1);<NEW_LINE>gridBagConstraints = new java.awt.GridBagConstraints();<NEW_LINE>gridBagConstraints.gridx = 1;<NEW_LINE>gridBagConstraints.gridy = 1;<NEW_LINE>gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER;<NEW_LINE>gridBagConstraints.gridheight = java.awt.GridBagConstraints.REMAINDER;<NEW_LINE>gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;<NEW_LINE>gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;<NEW_LINE>gridBagConstraints.weightx = 1.0;<NEW_LINE>gridBagConstraints.weighty = 1.0;<NEW_LINE>add(jScrollPane1, gridBagConstraints);<NEW_LINE>} | new javax.swing.JLabel(); |
911,508 | private void copyColumns(Cursor cursor, MatrixCursor result, int count) {<NEW_LINE>try {<NEW_LINE>Object[] columns = new Object[count];<NEW_LINE>for (int i = 0; i < count; i++) switch(cursor.getType(i)) {<NEW_LINE>case Cursor.FIELD_TYPE_NULL:<NEW_LINE>columns[i] = null;<NEW_LINE>break;<NEW_LINE>case Cursor.FIELD_TYPE_INTEGER:<NEW_LINE>columns[i] = cursor.getInt(i);<NEW_LINE>break;<NEW_LINE>case Cursor.FIELD_TYPE_FLOAT:<NEW_LINE>columns[i] = cursor.getFloat(i);<NEW_LINE>break;<NEW_LINE>case Cursor.FIELD_TYPE_STRING:<NEW_LINE>columns[i] = cursor.getString(i);<NEW_LINE>break;<NEW_LINE>case Cursor.FIELD_TYPE_BLOB:<NEW_LINE>columns[i<MASK><NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>Util.log(this, Log.WARN, "Unknown cursor data type=" + cursor.getType(i));<NEW_LINE>}<NEW_LINE>result.addRow(columns);<NEW_LINE>} catch (Throwable ex) {<NEW_LINE>Util.bug(this, ex);<NEW_LINE>}<NEW_LINE>} | ] = cursor.getBlob(i); |
1,061,543 | public void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory) {<NEW_LINE>final BindResult<WebEndpointProperties> result = Binder.get(environment).bind(MANAGEMENT_ENDPOINTS_WEB, WebEndpointProperties.class);<NEW_LINE>if (result.isBound()) {<NEW_LINE>WebEndpointProperties webEndpointProperties = result.get();<NEW_LINE>List<GroupedOpenApi> <MASK><NEW_LINE>ActuatorOpenApiCustomizer actuatorOpenApiCustomiser = new ActuatorOpenApiCustomizer(webEndpointProperties);<NEW_LINE>beanFactory.registerSingleton("actuatorOpenApiCustomiser", actuatorOpenApiCustomiser);<NEW_LINE>ActuatorOperationCustomizer actuatorCustomizer = new ActuatorOperationCustomizer();<NEW_LINE>beanFactory.registerSingleton("actuatorCustomizer", actuatorCustomizer);<NEW_LINE>GroupedOpenApi actuatorGroup = GroupedOpenApi.builder().group(ACTUATOR_DEFAULT_GROUP).pathsToMatch(webEndpointProperties.getBasePath() + ALL_PATTERN).pathsToExclude(webEndpointProperties.getBasePath() + HEALTH_PATTERN).addOperationCustomizer(actuatorCustomizer).addOpenApiCustomiser(actuatorOpenApiCustomiser).build();<NEW_LINE>// Add the actuator group<NEW_LINE>newGroups.add(actuatorGroup);<NEW_LINE>if (CollectionUtils.isEmpty(groupedOpenApis)) {<NEW_LINE>GroupedOpenApi defaultGroup = GroupedOpenApi.builder().group(DEFAULT_GROUP_NAME).pathsToMatch(ALL_PATTERN).pathsToExclude(webEndpointProperties.getBasePath() + ALL_PATTERN).build();<NEW_LINE>// Register the default group<NEW_LINE>newGroups.add(defaultGroup);<NEW_LINE>}<NEW_LINE>newGroups.forEach(elt -> beanFactory.registerSingleton(elt.getGroup(), elt));<NEW_LINE>}<NEW_LINE>initBeanFactoryPostProcessor(beanFactory);<NEW_LINE>} | newGroups = new ArrayList<>(); |
410,795 | final ListIAMPolicyAssignmentsResult executeListIAMPolicyAssignments(ListIAMPolicyAssignmentsRequest listIAMPolicyAssignmentsRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(listIAMPolicyAssignmentsRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<ListIAMPolicyAssignmentsRequest> request = null;<NEW_LINE>Response<ListIAMPolicyAssignmentsResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new ListIAMPolicyAssignmentsRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(listIAMPolicyAssignmentsRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "QuickSight");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ListIAMPolicyAssignments");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<ListIAMPolicyAssignmentsResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new ListIAMPolicyAssignmentsResultJsonUnmarshaller());<NEW_LINE>response = <MASK><NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | invoke(request, responseHandler, executionContext); |
1,311,988 | private static List<KeyValuePair<String, Object>> flattenParamsValue(Object value, String keyPrefix) {<NEW_LINE>List<KeyValuePair<String, Object>> flatParams = null;<NEW_LINE>// I wish Java had pattern matching :(<NEW_LINE>if (value == null) {<NEW_LINE>flatParams = singleParam(keyPrefix, "");<NEW_LINE>} else if (value instanceof Map<?, ?>) {<NEW_LINE>flatParams = flattenParamsMap((Map<?, ?>) value, keyPrefix);<NEW_LINE>} else if (value instanceof String) {<NEW_LINE>flatParams = singleParam(keyPrefix, value);<NEW_LINE>} else if (value instanceof File) {<NEW_LINE>flatParams = singleParam(keyPrefix, value);<NEW_LINE>} else if (value instanceof InputStream) {<NEW_LINE>flatParams = singleParam(keyPrefix, value);<NEW_LINE>} else if (value instanceof Collection<?>) {<NEW_LINE>flatParams = flattenParamsCollection((Collection<MASK><NEW_LINE>} else if (value.getClass().isArray()) {<NEW_LINE>Object[] array = getArrayForObject(value);<NEW_LINE>Collection<?> collection = Arrays.stream(array).collect(Collectors.toList());<NEW_LINE>flatParams = flattenParamsCollection(collection, keyPrefix);<NEW_LINE>} else if (value.getClass().isEnum()) {<NEW_LINE>flatParams = singleParam(keyPrefix, ApiResource.GSON.toJson(value).replaceAll("\"", ""));<NEW_LINE>} else {<NEW_LINE>flatParams = singleParam(keyPrefix, value.toString());<NEW_LINE>}<NEW_LINE>return flatParams;<NEW_LINE>} | <?>) value, keyPrefix); |
146,292 | public /*<NEW_LINE>* Most of this code copied from JList.java because there are<NEW_LINE>* some problems with scrolling on big completion lists, ex. full<NEW_LINE>* PHP completion list contains about 6000 elements. Scrolling<NEW_LINE>* just removed from code.<NEW_LINE>*/<NEW_LINE>Object clickOnItem(final String item, final Operator.StringComparator comp, final int clickCount) {<NEW_LINE>return runMapping(new MapAction("clickOnItem( String, Comparator )") {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public Object map() throws Exception {<NEW_LINE>final int itemIndex = CompletionJListOperator.super.findItemIndex(item, comp, 0);<NEW_LINE>if (itemIndex < 0 || itemIndex >= getModel().getSize())<NEW_LINE><MASK><NEW_LINE>return (getQueueTool().invokeSmoothly(new QueueTool.QueueAction("Path selecting") {<NEW_LINE><NEW_LINE>public Object launch() {<NEW_LINE>if (((JList) getSource()).getAutoscrolls())<NEW_LINE>((JList) getSource()).ensureIndexIsVisible(itemIndex);<NEW_LINE>Rectangle rect = getCellBounds(itemIndex, itemIndex);<NEW_LINE>if (rect == null)<NEW_LINE>return (null);<NEW_LINE>Point point = new Point((int) (rect.getX() + rect.getWidth() / 2), (int) (rect.getY() + rect.getHeight() / 2));<NEW_LINE>Object result = getModel().getElementAt(itemIndex);<NEW_LINE>clickMouse(point.x, point.y, clickCount);<NEW_LINE>return (result);<NEW_LINE>}<NEW_LINE>}));<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} | throw (new NoSuchItemException(itemIndex)); |
1,471,704 | public String showProposals(final boolean autoActivated) {<NEW_LINE>if (fKeyListener == null) {<NEW_LINE>fKeyListener = new ProposalSelectionListener();<NEW_LINE>}<NEW_LINE>final Control control = fContentAssistSubjectControlAdapter.getControl();<NEW_LINE>if (control != null && !control.isDisposed()) {<NEW_LINE>// add the listener before computing the proposals so we don't move the caret<NEW_LINE>// when the user types fast.<NEW_LINE>fContentAssistSubjectControlAdapter.addKeyListener(fKeyListener);<NEW_LINE>BusyIndicator.showWhile(control.getDisplay(), new Runnable() {<NEW_LINE><NEW_LINE>public void run() {<NEW_LINE>fInvocationOffset = fContentAssistSubjectControlAdapter.getSelectedRange().x;<NEW_LINE>fFilterOffset = fInvocationOffset;<NEW_LINE>fComputedProposals = computeProposals(fInvocationOffset, autoActivated);<NEW_LINE>IDocument doc = fContentAssistSubjectControlAdapter.getDocument();<NEW_LINE>DocumentEvent initial = new DocumentEvent(doc, fInvocationOffset, 0, StringUtil.EMPTY);<NEW_LINE>fComputedProposals = filterProposals(fComputedProposals, doc, fInvocationOffset, initial);<NEW_LINE>int count = (fComputedProposals == <MASK><NEW_LINE>// If we don't have any proposals, and we've manually asked for proposals, show "no proposals"<NEW_LINE>if (!autoActivated && count == 0) {<NEW_LINE>fComputedProposals = createNoProposal();<NEW_LINE>count = fComputedProposals.length;<NEW_LINE>}<NEW_LINE>if (count == 0) {<NEW_LINE>hide();<NEW_LINE>} else if (count == 1 && !autoActivated && canAutoInsert(fComputedProposals[0])) {<NEW_LINE>insertProposal(fComputedProposals[0], (char) 0, 0, fInvocationOffset);<NEW_LINE>hide();<NEW_LINE>} else {<NEW_LINE>createPopup();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}<NEW_LINE>return getErrorMessage();<NEW_LINE>} | null ? 0 : fComputedProposals.length); |
1,080,474 | protected void calcAsync() {<NEW_LINE>ExUtil.asyncRun(new Runnable() {<NEW_LINE><NEW_LINE>public void run() {<NEW_LINE>Map<Integer, UserAgentSummary> summaryMap = new HashMap<Integer, UserAgentSummary>();<NEW_LINE>Map<Integer, List<Integer>> loadTextMap = new HashMap<Integer, List<Integer>>();<NEW_LINE>LongEnumer longEnumer = dataMap.keys();<NEW_LINE>while (longEnumer.hasMoreElements()) {<NEW_LINE>XLogData d = dataMap.get(longEnumer.nextLong());<NEW_LINE>long time = d.p.endTime;<NEW_LINE>if (d.filter_ok && time >= stime && time <= etime && !ObjectSelectManager.getInstance().isUnselectedObject(d.p.objHash)) {<NEW_LINE>UserAgentSummary summary = summaryMap.<MASK><NEW_LINE>if (summary == null) {<NEW_LINE>summary = new UserAgentSummary(d.p.userAgent);<NEW_LINE>summaryMap.put(d.p.userAgent, summary);<NEW_LINE>List<Integer> loadTextList = loadTextMap.get(d.serverId);<NEW_LINE>if (loadTextList == null) {<NEW_LINE>loadTextList = new ArrayList<Integer>();<NEW_LINE>loadTextMap.put(d.serverId, loadTextList);<NEW_LINE>}<NEW_LINE>loadTextList.add(d.p.userAgent);<NEW_LINE>}<NEW_LINE>summary.count++;<NEW_LINE>summary.sumTime += d.p.elapsed;<NEW_LINE>if (d.p.elapsed > summary.maxTime) {<NEW_LINE>summary.maxTime = d.p.elapsed;<NEW_LINE>}<NEW_LINE>if (d.p.error != 0) {<NEW_LINE>summary.error++;<NEW_LINE>}<NEW_LINE>summary.cpu += d.p.cpu;<NEW_LINE>summary.memory += d.p.kbytes;<NEW_LINE>summary.sqltime += d.p.sqlTime;<NEW_LINE>summary.apicalltime += d.p.apicallTime;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>for (Integer serverId : loadTextMap.keySet()) {<NEW_LINE>TextProxy.userAgent.load(DateUtil.yyyymmdd(etime), loadTextMap.get(serverId), serverId);<NEW_LINE>}<NEW_LINE>final TopN<UserAgentSummary> stn = new TopN<UserAgentSummary>(10000, DIRECTION.DESC);<NEW_LINE>for (UserAgentSummary so : summaryMap.values()) {<NEW_LINE>stn.add(so);<NEW_LINE>}<NEW_LINE>ExUtil.exec(viewer.getTable(), new Runnable() {<NEW_LINE><NEW_LINE>public void run() {<NEW_LINE>rangeLabel.setText(DateUtil.format(stime, "yyyy-MM-dd HH:mm:ss") + " ~ " + DateUtil.format(etime, "HH:mm:ss") + " (" + stn.size() + ")");<NEW_LINE>viewer.setInput(stn.getList());<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} | get(d.p.userAgent); |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.