idx int32 46 1.86M | input stringlengths 321 6.6k | target stringlengths 9 1.24k |
|---|---|---|
1,189,163 | public static RestActionReporter runCommand(String commandName, ParameterMap parameters, Subject subject, boolean managedJob) {<NEW_LINE>AsadminRecorderService asadminRecorderService = Globals.get(AsadminRecorderService.class);<NEW_LINE>if (asadminRecorderService != null && asadminRecorderService.isEnabled()) {<NEW_LINE>asadminRecorderService.recordAsadminCommand(commandName, parameters);<NEW_LINE>}<NEW_LINE>AdminAuditService auditService = Globals.getDefaultHabitat().getService(AdminAuditService.class);<NEW_LINE>if (auditService != null && auditService.isEnabled()) {<NEW_LINE>auditService.recordAsadminCommand(commandName, parameters, subject);<NEW_LINE>}<NEW_LINE>CommandRunner cr = Globals.getDefaultHabitat(<MASK><NEW_LINE>RestActionReporter ar = new RestActionReporter();<NEW_LINE>final CommandInvocation commandInvocation = cr.getCommandInvocation(commandName, ar, subject);<NEW_LINE>if (managedJob) {<NEW_LINE>commandInvocation.managedJob();<NEW_LINE>}<NEW_LINE>commandInvocation.parameters(parameters).execute();<NEW_LINE>addCommandLog(ar, commandName, parameters);<NEW_LINE>return ar;<NEW_LINE>} | ).getService(CommandRunner.class); |
123,509 | private void login() throws RepositoryException {<NEW_LINE>try {<NEW_LINE>// Try default login<NEW_LINE>session = repository.login(new SimpleCredentials("admin", "admin".toCharArray()));<NEW_LINE>} catch (Exception e) {<NEW_LINE>// If default fails check oldpassword property<NEW_LINE>if (oldpassword == null) {<NEW_LINE>// If no old password try login with new password<NEW_LINE>session = repository.login(new SimpleCredentials("admin", password.toCharArray()));<NEW_LINE>} else {<NEW_LINE>// If old password is set<NEW_LINE>try {<NEW_LINE>// Try logging in with the new password<NEW_LINE>session = repository.login(new SimpleCredentials("admin", password.toCharArray()));<NEW_LINE>} catch (Exception e2) {<NEW_LINE>// Login with the old password<NEW_LINE>session = repository.login(new SimpleCredentials("admin", oldpassword.toCharArray()));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Make sure new password is set to repo default<NEW_LINE>if (password != null && !password.equals("")) {<NEW_LINE>UserManager userManager = ((JackrabbitSession) session).getUserManager();<NEW_LINE>Authorizable authorizable = userManager.getAuthorizable("admin");<NEW_LINE>((User<MASK><NEW_LINE>}<NEW_LINE>} | ) authorizable).changePassword(password); |
1,589,576 | private ONNXNode writeDecisionFunction(ONNXNode svmOutputName) {<NEW_LINE>final ONNXContext onnx = svmOutputName.onnxContext();<NEW_LINE>ONNXInitializer one = onnx.constant("one", 1.0f);<NEW_LINE>ONNXInitializer zero = onnx.constant("zero", 0.0f);<NEW_LINE>ONNXNode prediction = svmOutputName.apply(ONNXOperators.LESS, zero).cast(float.class);<NEW_LINE>svm_model model = models.get(0);<NEW_LINE>TreeMap<Integer, List<ONNXNode>> votes = new TreeMap<>();<NEW_LINE>int k = 0;<NEW_LINE>for (int i = 0; i < model.nr_class; i++) {<NEW_LINE>for (int j = i + 1; j < model.nr_class; j++) {<NEW_LINE>ONNXInitializer index = onnx.constant("Vind_" + k, (long) k);<NEW_LINE>ONNXNode extractedFeature = prediction.apply(ONNXOperators.ARRAY_FEATURE_EXTRACTOR, index, "Vsvcv_" + k);<NEW_LINE>votes.computeIfAbsent(j, x -> new ArrayList<>()).add(extractedFeature);<NEW_LINE>ONNXNode addNeg = extractedFeature.apply(ONNXOperators.NEG, "Vnegv_" + k).apply(ONNXOperators.ADD, one, "Vnegv1_" + k);<NEW_LINE>votes.computeIfAbsent(i, x -> new ArrayList<>()).add(addNeg);<NEW_LINE>k += 1;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>List<ONNXNode> oneVOneVotes = votes.values().stream().map(nodes -> onnx.operation(ONNXOperators.SUM, nodes, "svm_votes")).collect(Collectors.toList());<NEW_LINE>return onnx.operation(ONNXOperators.CONCAT, oneVOneVotes, "svm_output", Collections<MASK><NEW_LINE>} | .singletonMap("axis", 1)); |
736,483 | public static VerifySentenceResponse unmarshall(VerifySentenceResponse verifySentenceResponse, UnmarshallerContext _ctx) {<NEW_LINE>verifySentenceResponse.setRequestId<MASK><NEW_LINE>verifySentenceResponse.setSuccess(_ctx.booleanValue("VerifySentenceResponse.Success"));<NEW_LINE>verifySentenceResponse.setIncorrectWords(_ctx.integerValue("VerifySentenceResponse.IncorrectWords"));<NEW_LINE>verifySentenceResponse.setTargetRole(_ctx.integerValue("VerifySentenceResponse.TargetRole"));<NEW_LINE>verifySentenceResponse.setCode(_ctx.stringValue("VerifySentenceResponse.Code"));<NEW_LINE>verifySentenceResponse.setMessage(_ctx.stringValue("VerifySentenceResponse.Message"));<NEW_LINE>verifySentenceResponse.setSourceRole(_ctx.integerValue("VerifySentenceResponse.SourceRole"));<NEW_LINE>List<Delta> data = new ArrayList<Delta>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("VerifySentenceResponse.Data.Length"); i++) {<NEW_LINE>Delta delta = new Delta();<NEW_LINE>delta.setType(_ctx.stringValue("VerifySentenceResponse.Data[" + i + "].Type"));<NEW_LINE>Source source = new Source();<NEW_LINE>source.setPosition(_ctx.integerValue("VerifySentenceResponse.Data[" + i + "].Source.Position"));<NEW_LINE>List<String> line = new ArrayList<String>();<NEW_LINE>for (int j = 0; j < _ctx.lengthValue("VerifySentenceResponse.Data[" + i + "].Source.Line.Length"); j++) {<NEW_LINE>line.add(_ctx.stringValue("VerifySentenceResponse.Data[" + i + "].Source.Line[" + j + "]"));<NEW_LINE>}<NEW_LINE>source.setLine(line);<NEW_LINE>delta.setSource(source);<NEW_LINE>Target target = new Target();<NEW_LINE>target.setPosition(_ctx.integerValue("VerifySentenceResponse.Data[" + i + "].Target.Position"));<NEW_LINE>List<String> line1 = new ArrayList<String>();<NEW_LINE>for (int j = 0; j < _ctx.lengthValue("VerifySentenceResponse.Data[" + i + "].Target.Line.Length"); j++) {<NEW_LINE>line1.add(_ctx.stringValue("VerifySentenceResponse.Data[" + i + "].Target.Line[" + j + "]"));<NEW_LINE>}<NEW_LINE>target.setLine1(line1);<NEW_LINE>delta.setTarget(target);<NEW_LINE>data.add(delta);<NEW_LINE>}<NEW_LINE>verifySentenceResponse.setData(data);<NEW_LINE>return verifySentenceResponse;<NEW_LINE>} | (_ctx.stringValue("VerifySentenceResponse.RequestId")); |
1,370,440 | public List<VtFileReport> fetchReports(@NonNull String[] hashes) throws IOException {<NEW_LINE>URL url = new URL(URL_FILE_REPORT);<NEW_LINE>HttpURLConnection connection = (HttpURLConnection) url.openConnection();<NEW_LINE>connection.setUseCaches(false);<NEW_LINE>connection.setDoOutput(true);<NEW_LINE>connection.setRequestMethod("POST");<NEW_LINE>connection.setDoInput(true);<NEW_LINE>connection.setRequestProperty("Content-Type", "multipart/form-data; boundary=" + FORM_DATA_BOUNDARY);<NEW_LINE>// Set headers, form data<NEW_LINE>OutputStream outputStream = connection.getOutputStream();<NEW_LINE>addHeader(outputStream, "Transfer-Encoding", "chunked");<NEW_LINE>addMultipartFormData(outputStream, "apikey", mApiKey);<NEW_LINE>addMultipartFormData(outputStream, "resource", TextUtils.join(",", hashes));<NEW_LINE>addMultipartFormData(outputStream, "allinfo", "false");<NEW_LINE>outputStream.write("\r\n".getBytes(StandardCharsets.UTF_8));<NEW_LINE>outputStream.write(("--" + FORM_DATA_BOUNDARY + "--\r\n").getBytes(StandardCharsets.UTF_8));<NEW_LINE>outputStream.flush();<NEW_LINE>// Response<NEW_LINE>String response = getResponse(connection);<NEW_LINE>if (hashes.length > 1) {<NEW_LINE>return Arrays.asList(mGson.fromJson(response<MASK><NEW_LINE>}<NEW_LINE>return Collections.singletonList(mGson.fromJson(response, VtFileReport.class));<NEW_LINE>} | , VtFileReport[].class)); |
1,725,801 | private Object negate(Document arg) {<NEW_LINE>List<Object> list = new ArrayList<Object>();<NEW_LINE>for (Map.Entry<String, Object> entry : arg.entrySet()) {<NEW_LINE>if (entry.getKey().equals("$or")) {<NEW_LINE>list.add(asDocument("$nor"<MASK><NEW_LINE>} else if (entry.getKey().equals("$and")) {<NEW_LINE>List<Object> list2 = new ArrayList<Object>();<NEW_LINE>for (Object o : ((Collection) entry.getValue())) {<NEW_LINE>list2.add(negate((Document) o));<NEW_LINE>}<NEW_LINE>list.add(asDocument("$or", list2));<NEW_LINE>} else if (entry.getValue() instanceof Pattern || entry.getValue() instanceof BsonRegularExpression) {<NEW_LINE>list.add(asDocument(entry.getKey(), asDocument("$not", entry.getValue())));<NEW_LINE>} else if (entry.getValue() instanceof Document) {<NEW_LINE>list.add(negate(entry.getKey(), (Document) entry.getValue()));<NEW_LINE>} else {<NEW_LINE>list.add(asDocument(entry.getKey(), asDocument("$ne", entry.getValue())));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return list.size() == 1 ? list.get(0) : asDocument("$or", list);<NEW_LINE>} | , entry.getValue())); |
338,150 | private static void genTags() throws Exception {<NEW_LINE>final BeanManager beanManager = BeanManager.getInstance();<NEW_LINE>final TagQueryService tagQueryService = beanManager.getReference(TagQueryService.class);<NEW_LINE>final List<JSONObject> tags = tagQueryService.getTags();<NEW_LINE>final OptionQueryService optionQueryService = beanManager.getReference(OptionQueryService.class);<NEW_LINE>final JSONObject preference = optionQueryService.getPreference();<NEW_LINE>final int pageSize = preference.getInt(Option.ID_C_ARTICLE_LIST_DISPLAY_COUNT);<NEW_LINE>tags.parallelStream().forEach(tag -> {<NEW_LINE>final String tagTitle = tag.optString(Tag.TAG_TITLE);<NEW_LINE>try {<NEW_LINE>final int articleCount = tagQueryService.getArticleCount(tag.optString(Keys.OBJECT_ID));<NEW_LINE>final int pageCount = (int) Math.ceil((double) articleCount / pageSize);<NEW_LINE>int count = 0;<NEW_LINE>while (count++ < pageCount) {<NEW_LINE>genPage("/tags/" + tagTitle);<NEW_LINE>genPage("/tags/" + tagTitle + "?p=" + count);<NEW_LINE>}<NEW_LINE>} catch (final Exception e) {<NEW_LINE>LOGGER.log(Level.ERROR, <MASK><NEW_LINE>}<NEW_LINE>});<NEW_LINE>} | "Generates a tag [title=" + tagTitle + "] failed", e); |
761,981 | public void unparse(SqlWriter writer, int leftPrec, int rightPrec) {<NEW_LINE>final SqlWriter.Frame selectFrame = writer.startList(SqlWriter.FrameTypeEnum.SELECT);<NEW_LINE>writer.sep("CREATE CCL_RULE");<NEW_LINE>if (ifNotExists) {<NEW_LINE>writer.sep("IF NOT EXISTS");<NEW_LINE>}<NEW_LINE>ruleName.unparse(writer, leftPrec, rightPrec);<NEW_LINE>writer.keyword("ON");<NEW_LINE>dbName.unparse(writer, leftPrec, 0);<NEW_LINE>writer.keyword(".");<NEW_LINE>tableName.unparse(writer, 0, 0);<NEW_LINE>if (userName != null) {<NEW_LINE>writer.keyword("TO");<NEW_LINE>userName.unparse(writer, leftPrec, rightPrec);<NEW_LINE>}<NEW_LINE>writer.keyword("FOR");<NEW_LINE>FOR.unparse(writer, leftPrec, rightPrec);<NEW_LINE>if (keywords != null) {<NEW_LINE>writer.sep("FILTER BY KEYWORD");<NEW_LINE>keywords.unparse(writer, leftPrec, rightPrec);<NEW_LINE>}<NEW_LINE>if (templateId != null) {<NEW_LINE>writer.sep("FILTER BY TEMPLATE");<NEW_LINE>templateId.unparse(writer, leftPrec, rightPrec);<NEW_LINE>}<NEW_LINE>if (query != null) {<NEW_LINE>writer.sep("FILTER BY QUERY");<NEW_LINE>query.<MASK><NEW_LINE>}<NEW_LINE>writer.sep("WITH");<NEW_LINE>if (with != null) {<NEW_LINE>if (!with.isEmpty()) {<NEW_LINE>Pair<SqlNode, SqlNode> firstPair = with.get(0);<NEW_LINE>firstPair.left.unparse(writer, leftPrec, rightPrec);<NEW_LINE>writer.print("=");<NEW_LINE>firstPair.right.unparse(writer, leftPrec, rightPrec);<NEW_LINE>}<NEW_LINE>for (int i = 1; i < with.size(); ++i) {<NEW_LINE>writer.print(", ");<NEW_LINE>Pair<SqlNode, SqlNode> pair = with.get(i);<NEW_LINE>pair.left.unparse(writer, leftPrec, rightPrec);<NEW_LINE>writer.print("=");<NEW_LINE>pair.right.unparse(writer, leftPrec, rightPrec);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>writer.endList(selectFrame);<NEW_LINE>} | unparse(writer, leftPrec, rightPrec); |
222,040 | private void appendMapStringify(Writer writer, HollowDataAccess dataAccess, HollowMapTypeDataAccess typeDataAccess, int ordinal, int indentation) throws IOException {<NEW_LINE>HollowMapSchema schema = typeDataAccess.getSchema();<NEW_LINE>if (showTypes)<NEW_LINE>writer.append("(").append(schema.getName()).append(")");<NEW_LINE>if (showOrdinals)<NEW_LINE>writer.append(" (ordinal ").append(Integer.toString(ordinal)).append(")");<NEW_LINE>indentation++;<NEW_LINE>String keyType = schema.getKeyType();<NEW_LINE>String valueType = schema.getValueType();<NEW_LINE>HollowMapEntryOrdinalIterator iter = typeDataAccess.ordinalIterator(ordinal);<NEW_LINE>while (iter.next()) {<NEW_LINE>writer.append(NEWLINE);<NEW_LINE>appendIndentation(writer, indentation);<NEW_LINE>writer.append("k: ");<NEW_LINE>appendStringify(writer, dataAccess, keyType, <MASK><NEW_LINE>writer.append(NEWLINE);<NEW_LINE>appendIndentation(writer, indentation);<NEW_LINE>writer.append("v: ");<NEW_LINE>appendStringify(writer, dataAccess, valueType, iter.getValue(), indentation);<NEW_LINE>}<NEW_LINE>} | iter.getKey(), indentation); |
1,080,971 | public boolean doTimeoutChecks() {<NEW_LINE>// Timeouts for states PEPeerTransport.CONNECTION_PENDING and<NEW_LINE>// PEPeerTransport.CONNECTION_CONNECTING are handled by the ConnectDisconnectManager<NEW_LINE>// so we don't need to deal with them here.<NEW_LINE>if (connection != null) {<NEW_LINE>connection.getOutgoingMessageQueue().setPriorityBoost(upload_priority_auto > 0 || manager.getUploadPriority() > 0 || (enable_upload_bias && !manager.isSeeding()));<NEW_LINE>}<NEW_LINE>if (fast_extension_enabled) {<NEW_LINE>checkAllowedFast();<NEW_LINE>}<NEW_LINE>final long now = SystemTime.getCurrentTime();<NEW_LINE>// make sure we time out stalled connections<NEW_LINE>if (connection_state == PEPeerTransport.CONNECTION_FULLY_ESTABLISHED) {<NEW_LINE>if (last_message_received_time > now)<NEW_LINE>last_message_received_time = now;<NEW_LINE>if (last_data_message_received_time > now)<NEW_LINE>last_data_message_received_time = now;<NEW_LINE>if (now - last_message_received_time > 5 * 60 * 1000 && now - last_data_message_received_time > 5 * 60 * 1000) {<NEW_LINE>// 5min timeout<NEW_LINE>// assume this is due to a network failure<NEW_LINE>// e.g. something that didn't close the TCP socket properly<NEW_LINE>// will attempt reconnect<NEW_LINE><MASK><NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>} else // ensure we dont get stuck in the handshaking phases<NEW_LINE>if (connection_state == PEPeerTransport.CONNECTION_WAITING_FOR_HANDSHAKE) {<NEW_LINE>if (connection_established_time > now)<NEW_LINE>connection_established_time = now;<NEW_LINE>else if (now - connection_established_time > 3 * 60 * 1000) {<NEW_LINE>// 3min timeout<NEW_LINE>closeConnectionInternally("timed out while waiting for handshake");<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>} | closeConnectionInternally("timed out while waiting for messages", false, true); |
906,465 | private Boolean synchronizeSingleFileInternal(final ImmutablePair<ContentStorage.FileInformation, String> sourceFile, final File targetRootDir, final Set<String> targetSyncPropsToUpdate, final Map<String, Properties> targetSyncProps) {<NEW_LINE>final String dirPath = getParentPath(sourceFile.right);<NEW_LINE>Properties dirProps = targetSyncProps.get(dirPath);<NEW_LINE>if (dirProps == null) {<NEW_LINE>dirProps = new Properties();<NEW_LINE>targetSyncProps.put(dirPath, dirProps);<NEW_LINE>}<NEW_LINE>final File targetFile = new File(targetRootDir, sourceFile.right);<NEW_LINE>final boolean needsSync = !targetFile.exists() || !getFileSyncToken(sourceFile.left).equals(dirProps.getProperty(sourceFile.left.name));<NEW_LINE>if (needsSync) {<NEW_LINE>if (targetFile.exists() && !targetFile.delete()) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>final Uri targetUri = ContentStorage.get().copy(sourceFile.left.uri, Folder.fromFile(targetFile.getParentFile()), FileNameCreator.forName(targetFile.getName()), false);<NEW_LINE>if (targetUri == null) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>dirProps.setProperty(sourceFile.left.name<MASK><NEW_LINE>targetSyncPropsToUpdate.add(dirPath);<NEW_LINE>}<NEW_LINE>return needsSync;<NEW_LINE>} | , getFileSyncToken(sourceFile.left)); |
32,313 | private synchronized void makeHierarchyMap() {<NEW_LINE>Map<String, ServerObject> tempRootMap = new TreeMap<String, ServerObject>();<NEW_LINE>Enumeration<Integer> sIds = ServerManager.getInstance().getAllServerList();<NEW_LINE>while (sIds.hasMoreElements()) {<NEW_LINE>int serverId = sIds.nextElement();<NEW_LINE>Server server = ServerManager.getInstance().getServer(serverId);<NEW_LINE>ServerObject serverObj = new ServerObject(serverId, server.getName());<NEW_LINE>if (server.isOpen()) {<NEW_LINE>serverObj.setTotalMemory(server.getTotalMemory());<NEW_LINE>serverObj.setUsedMemory(server.getUsedMemory());<NEW_LINE>}<NEW_LINE>tempRootMap.put(server.getName(), serverObj);<NEW_LINE>}<NEW_LINE>getObjectList();<NEW_LINE>for (AgentObject agent : objectList) {<NEW_LINE>if (agent.getObjType().startsWith("z$")) {<NEW_LINE>System.out.println("agent: " + agent);<NEW_LINE>}<NEW_LINE>int serverId = agent.getServerId();<NEW_LINE>Server server = ServerManager.getInstance().getServer(serverId);<NEW_LINE>if (server == null) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>ServerObject serverObj = tempRootMap.get(server.getName());<NEW_LINE>if (serverObj == null) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>String objName = agent.getObjName();<NEW_LINE>HierarchyObject parent = serverObj;<NEW_LINE>int inx = objName.indexOf("/", 1);<NEW_LINE>while (inx != -1) {<NEW_LINE>String childName = objName.substring(0, inx);<NEW_LINE>HierarchyObject child = parent.getChild(childName);<NEW_LINE>if (child == null) {<NEW_LINE>child = new DummyObject(childName);<NEW_LINE>child.setParent(parent);<NEW_LINE>parent.putChild(childName, child);<NEW_LINE>}<NEW_LINE>parent = child;<NEW_LINE>inx = objName.indexOf("/", (inx + 1));<NEW_LINE>}<NEW_LINE>HierarchyObject beforeDummyObj = parent.putChild(objName, agent);<NEW_LINE>if (beforeDummyObj != null && beforeDummyObj instanceof DummyObject) {<NEW_LINE>agent.setChildMap(((DummyObject<MASK><NEW_LINE>}<NEW_LINE>agent.setParent(parent);<NEW_LINE>}<NEW_LINE>root.clear();<NEW_LINE>root.putAll(tempRootMap);<NEW_LINE>} | ) beforeDummyObj).getChildMap()); |
585,639 | public void run() {<NEW_LINE>String appType = _analyticJob.getAppType().getName();<NEW_LINE>String analysisName = String.format("%s %s", appType, _analyticJob.getAppId());<NEW_LINE>long analysisStartTimeMillis = System.currentTimeMillis();<NEW_LINE>logger.info(String.format("Analyzing %s", analysisName));<NEW_LINE>long applicableFinishTime = -1;<NEW_LINE>long jobFinishTime = -1;<NEW_LINE>FinishTimeInfo finishTimeInfo = null;<NEW_LINE>try {<NEW_LINE>final AppResult result = _analyticJob.getAnalysis();<NEW_LINE>applicableFinishTime = getApplicableFinishTime(_analyticJob);<NEW_LINE>synchronized (_appsLock) {<NEW_LINE>finishTimeInfo = _appTypeToFinishTimeInfo.get(appType);<NEW_LINE>final BackfillInfo backfillInfo = getBackfillInfoForSave(finishTimeInfo, appType, applicableFinishTime);<NEW_LINE>jobFinishTime = result.finishTime;<NEW_LINE>// Execute as a transaction.<NEW_LINE>Ebean.execute(new TxRunnable() {<NEW_LINE><NEW_LINE>public void run() {<NEW_LINE>result.save();<NEW_LINE>if (backfillInfo != null) {<NEW_LINE>backfillInfo.save();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>_appToAnalyticJobMap.remove(_analyticJob.getAppId());<NEW_LINE>if (finishTimeInfo != null) {<NEW_LINE>updateFinishTimeInfo(finishTimeInfo, backfillInfo, result.finishTime);<NEW_LINE>removeFromFinishTimesMap(finishTimeInfo._appFinishTimesMap, applicableFinishTime);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>long processingTime = System.currentTimeMillis() - analysisStartTimeMillis;<NEW_LINE>logger.info(String.format<MASK><NEW_LINE>MetricsController.setJobProcessingTime(processingTime);<NEW_LINE>MetricsController.markProcessedJobs();<NEW_LINE>} catch (InterruptedException e) {<NEW_LINE>logger.info("Thread interrupted");<NEW_LINE>logger.info(e.getMessage());<NEW_LINE>logger.info(ExceptionUtils.getStackTrace(e));<NEW_LINE>Thread.currentThread().interrupt();<NEW_LINE>} catch (TimeoutException e) {<NEW_LINE>logger.warn("Timed out while fetching data. Exception message is: " + e.getMessage());<NEW_LINE>jobFate(finishTimeInfo, appType, applicableFinishTime, jobFinishTime);<NEW_LINE>} catch (Exception e) {<NEW_LINE>logger.error(String.format("Failed to analyze %s", analysisName), e);<NEW_LINE>jobFate(finishTimeInfo, appType, applicableFinishTime, jobFinishTime);<NEW_LINE>}<NEW_LINE>} | ("Analysis of %s took %sms", analysisName, processingTime)); |
936,535 | public void run(OpcUaClient client, CompletableFuture<OpcUaClient> future) throws Exception {<NEW_LINE>// synchronous connect<NEW_LINE>client.connect().get();<NEW_LINE>registerCustomCodec(client);<NEW_LINE>// synchronous read request via VariableNode<NEW_LINE>UaVariableNode node = client.getAddressSpace().getVariableNode(new NodeId(2, "HelloWorld/CustomStructTypeVariable"));<NEW_LINE>logger.info("DataType={}", node.getDataType());<NEW_LINE>// Read the current value<NEW_LINE>DataValue value = node.readValue();<NEW_LINE>logger.info("Value={}", value);<NEW_LINE>Variant variant = value.getValue();<NEW_LINE>ExtensionObject xo = (ExtensionObject) variant.getValue();<NEW_LINE>CustomStructType decoded = (CustomStructType) xo.decode(client.getStaticSerializationContext());<NEW_LINE>logger.info("Decoded={}", decoded);<NEW_LINE>// Write a modified value<NEW_LINE>CustomStructType modified = new CustomStructType(decoded.getFoo() + "bar", uint(decoded.getBar().intValue() + 1), !decoded.isBaz());<NEW_LINE>ExtensionObject modifiedXo = ExtensionObject.encode(client.getStaticSerializationContext(), modified, xo.getEncodingId(), OpcUaDefaultBinaryEncoding.getInstance());<NEW_LINE>node.writeValue(new DataValue(new Variant(modifiedXo)));<NEW_LINE>// Read the modified value back<NEW_LINE>value = node.readValue();<NEW_LINE>logger.info("Value={}", value);<NEW_LINE>variant = value.getValue();<NEW_LINE>xo = (ExtensionObject) variant.getValue();<NEW_LINE>decoded = (CustomStructType) xo.decode(client.getStaticSerializationContext());<NEW_LINE><MASK><NEW_LINE>future.complete(client);<NEW_LINE>} | logger.info("Decoded={}", decoded); |
1,490,304 | private Object performCardinalityAdjustment(String inputKey, Object input, WalkedPath walkedPath, Map parentContainer, MatchedElement thisLevel) {<NEW_LINE>// Add our the LiteralPathElement for this level, so that write path References can use it as &(0,0)<NEW_LINE>walkedPath.add(input, thisLevel);<NEW_LINE>Object returnValue = null;<NEW_LINE>if (cardinalityRelationship == CardinalityRelationship.MANY) {<NEW_LINE>if (input instanceof List) {<NEW_LINE>returnValue = input;<NEW_LINE>} else if (input instanceof Object[]) {<NEW_LINE>returnValue = Arrays.asList(((Object[]) input));<NEW_LINE>} else if (input instanceof Map || input instanceof String || input instanceof Number || input instanceof Boolean) {<NEW_LINE>Object <MASK><NEW_LINE>List<Object> tempList = new ArrayList<>();<NEW_LINE>tempList.add(one);<NEW_LINE>returnValue = tempList;<NEW_LINE>} else if (input == null) {<NEW_LINE>returnValue = Collections.emptyList();<NEW_LINE>}<NEW_LINE>parentContainer.put(inputKey, returnValue);<NEW_LINE>} else if (cardinalityRelationship == CardinalityRelationship.ONE) {<NEW_LINE>if (input instanceof List) {<NEW_LINE>if (!((List) input).isEmpty()) {<NEW_LINE>returnValue = ((List) input).get(0);<NEW_LINE>}<NEW_LINE>parentContainer.put(inputKey, returnValue);<NEW_LINE>} else if (input instanceof Object[]) {<NEW_LINE>returnValue = ((Object[]) input)[0];<NEW_LINE>parentContainer.put(inputKey, returnValue);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>walkedPath.removeLast();<NEW_LINE>return returnValue;<NEW_LINE>} | one = parentContainer.remove(inputKey); |
772,881 | final InitiateLayerUploadResult executeInitiateLayerUpload(InitiateLayerUploadRequest initiateLayerUploadRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(initiateLayerUploadRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<InitiateLayerUploadRequest> request = null;<NEW_LINE>Response<InitiateLayerUploadResult> response = null;<NEW_LINE>try {<NEW_LINE><MASK><NEW_LINE>try {<NEW_LINE>request = new InitiateLayerUploadRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(initiateLayerUploadRequest));<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, "ECR PUBLIC");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "InitiateLayerUpload");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<InitiateLayerUploadResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new InitiateLayerUploadResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | awsRequestMetrics.startEvent(Field.RequestMarshallTime); |
330,256 | private <REQ extends Request, RES extends Response> void disruptResponse(RES res, RequestContext requestContext, Map<String, String> wireAttrs, NextFilter<REQ, RES> nextFilter) {<NEW_LINE>final DisruptContext context = (DisruptContext) requestContext.getLocalAttr(DisruptContext.DISRUPT_CONTEXT_KEY);<NEW_LINE>if (context == null) {<NEW_LINE>nextFilter.onResponse(res, requestContext, wireAttrs);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>switch(context.mode()) {<NEW_LINE>case MINIMUM_DELAY:<NEW_LINE>DisruptContexts.MinimumDelayDisruptContext minimumDelayContext = (DisruptContexts.MinimumDelayDisruptContext) context;<NEW_LINE>final long startTime = minimumDelayContext.requestStartTime();<NEW_LINE>final long totalDelay = _clock.currentTimeMillis() - startTime;<NEW_LINE>long remainingDelay = minimumDelayContext.delay() - totalDelay;<NEW_LINE>if (startTime == 0) {<NEW_LINE>LOG.error("Failed to get request start time. Unable to apply {}.", context.mode());<NEW_LINE>remainingDelay = 0;<NEW_LINE>} else if (remainingDelay < 0) {<NEW_LINE>LOG.debug("Total delay of {}ms is more than requested delay of {}ms. Skipping disruption.", totalDelay, minimumDelayContext.delay());<NEW_LINE>remainingDelay = 0;<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>_scheduler.schedule(() -> {<NEW_LINE>_executor.execute(() -> nextFilter.onResponse(res, requestContext, wireAttrs));<NEW_LINE>}, remainingDelay, TimeUnit.MILLISECONDS);<NEW_LINE>} catch (RejectedExecutionException e) {<NEW_LINE>LOG.warn("Unable to perform {} disrupt", context.mode(), e);<NEW_LINE>nextFilter.onResponse(res, requestContext, wireAttrs);<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>case DELAY:<NEW_LINE>case ERROR:<NEW_LINE>case TIMEOUT:<NEW_LINE>// intentional fall-through.<NEW_LINE>// no action required for the above disrupt modes.<NEW_LINE>nextFilter.onResponse(res, requestContext, wireAttrs);<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>LOG.warn("Unrecognized disrupt mode {}", context.mode());<NEW_LINE>nextFilter.<MASK><NEW_LINE>break;<NEW_LINE>}<NEW_LINE>} | onResponse(res, requestContext, wireAttrs); |
1,328,813 | public void startWarmUpThread() {<NEW_LINE>new Thread() {<NEW_LINE><NEW_LINE>public void run() {<NEW_LINE>try {<NEW_LINE>Thread.sleep(500);<NEW_LINE>String internalName = FindBox.class.getName();<NEW_LINE>TypeReference type = metadataSystem.lookupType(internalName);<NEW_LINE>TypeDefinition resolvedType = null;<NEW_LINE>if ((type == null) || ((resolvedType = type.resolve()) == null)) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>StringWriter stringwriter = new StringWriter();<NEW_LINE>PlainTextOutput plainTextOutput = new PlainTextOutput(stringwriter);<NEW_LINE>plainTextOutput.setUnicodeOutputEnabled(decompilationOptions.getSettings().isUnicodeOutputEnabled());<NEW_LINE>settings.getLanguage().decompileType(resolvedType, plainTextOutput, decompilationOptions);<NEW_LINE>String decompiledSource = stringwriter.toString();<NEW_LINE>OpenFile open = new OpenFile(internalName, "*/" + internalName, getTheme(), mainWindow);<NEW_LINE>open.setContent(decompiledSource);<NEW_LINE>JTabbedPane pane = new JTabbedPane();<NEW_LINE>pane.setTabLayoutPolicy(JTabbedPane.SCROLL_TAB_LAYOUT);<NEW_LINE>pane.addTab("title", open.scrollPane);<NEW_LINE>pane.setSelectedIndex<MASK><NEW_LINE>} catch (Exception e) {<NEW_LINE>Luyten.showExceptionDialog("Exception!", e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}.start();<NEW_LINE>} | (pane.indexOfTab("title")); |
1,730,250 | public void deleteByIdWithResponse(String id, Context context) {<NEW_LINE>String resourceGroupName = <MASK><NEW_LINE>if (resourceGroupName == null) {<NEW_LINE>throw logger.logExceptionAsError(new IllegalArgumentException(String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id)));<NEW_LINE>}<NEW_LINE>String accountName = Utils.getValueFromIdByName(id, "accounts");<NEW_LINE>if (accountName == null) {<NEW_LINE>throw logger.logExceptionAsError(new IllegalArgumentException(String.format("The resource ID '%s' is not valid. Missing path segment 'accounts'.", id)));<NEW_LINE>}<NEW_LINE>String privateEndpointConnectionName = Utils.getValueFromIdByName(id, "privateEndpointConnections");<NEW_LINE>if (privateEndpointConnectionName == null) {<NEW_LINE>throw logger.logExceptionAsError(new IllegalArgumentException(String.format("The resource ID '%s' is not valid. Missing path segment 'privateEndpointConnections'.", id)));<NEW_LINE>}<NEW_LINE>this.delete(resourceGroupName, accountName, privateEndpointConnectionName, context);<NEW_LINE>} | Utils.getValueFromIdByName(id, "resourceGroups"); |
182,385 | public void read(org.apache.thrift.protocol.TProtocol prot, setTableProperty_result struct) throws org.apache.thrift.TException {<NEW_LINE>org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot;<NEW_LINE>java.util.BitSet incoming = iprot.readBitSet(3);<NEW_LINE>if (incoming.get(0)) {<NEW_LINE>struct.sec = new org.apache.accumulo.core.clientImpl.thrift.ThriftSecurityException();<NEW_LINE>struct.sec.read(iprot);<NEW_LINE>struct.setSecIsSet(true);<NEW_LINE>}<NEW_LINE>if (incoming.get(1)) {<NEW_LINE>struct.tope = new org.apache.accumulo.core.clientImpl.thrift.ThriftTableOperationException();<NEW_LINE>struct.tope.read(iprot);<NEW_LINE>struct.setTopeIsSet(true);<NEW_LINE>}<NEW_LINE>if (incoming.get(2)) {<NEW_LINE>struct.tnase = new org.apache.accumulo.core<MASK><NEW_LINE>struct.tnase.read(iprot);<NEW_LINE>struct.setTnaseIsSet(true);<NEW_LINE>}<NEW_LINE>} | .clientImpl.thrift.ThriftNotActiveServiceException(); |
639,997 | public com.amazonaws.services.datapipeline.model.InvalidRequestException unmarshallFromContext(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>com.amazonaws.services.datapipeline.model.InvalidRequestException invalidRequestException = new com.amazonaws.services.datapipeline.model.InvalidRequestException(null);<NEW_LINE><MASK><NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return invalidRequestException;<NEW_LINE>} | int originalDepth = context.getCurrentDepth(); |
1,229,212 | public void init() throws Exception {<NEW_LINE>super.init();<NEW_LINE>List<String> lines = new ArrayList<>();<NEW_LINE>try {<NEW_LINE>Parameters parameters = getParameters();<NEW_LINE>List<String> unnamedParameters = parameters.getUnnamed();<NEW_LINE>filename = unnamedParameters.get(0);<NEW_LINE>lines = Files.readAllLines(Paths.get(filename), StandardCharsets.UTF_8);<NEW_LINE>Map<String, String> namedParameters = parameters.getNamed();<NEW_LINE>if (namedParameters.containsKey(PARAM_SCREENSHOT)) {<NEW_LINE>screenshotFilename = namedParameters.get(PARAM_SCREENSHOT);<NEW_LINE>}<NEW_LINE>if (namedParameters.containsKey(PARAM_LIMIT)) {<NEW_LINE>limit = Integer.parseInt(namedParameters.get(PARAM_LIMIT));<NEW_LINE>}<NEW_LINE>} catch (IOException e) {<NEW_LINE>e.printStackTrace();<NEW_LINE>}<NEW_LINE>int maxSize = 0;<NEW_LINE>for (String line : lines) {<NEW_LINE>String[] parts = line.split(",");<NEW_LINE>if (parts.length == 2) {<NEW_LINE>Number xValue = Integer.parseInt(parts[0]);<NEW_LINE>Number yValue = Integer<MASK><NEW_LINE>maxSize = Math.max(maxSize, xValue.intValue());<NEW_LINE>XYChart.Data<Number, Number> point = new XYChart.Data<>(xValue, yValue);<NEW_LINE>values.add(point);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (limit == -1) {<NEW_LINE>limit = maxSize;<NEW_LINE>}<NEW_LINE>} | .parseInt(parts[1]); |
1,771,453 | public static DAOSet fromServices(ServiceSet services, FutureJdbi jdbi, Executor executor, MDBConfig mdbConfig) {<NEW_LINE>var set = new DAOSet();<NEW_LINE>set.uacApisUtil = new UACApisUtil(executor, services.uac);<NEW_LINE>set.metadataDAO = new MetadataDAORdbImpl();<NEW_LINE>set.commitDAO = new CommitDAORdbImpl(services.authService, services.mdbRoleService);<NEW_LINE>set.repositoryDAO = new RepositoryDAORdbImpl(services.authService, services.mdbRoleService, set.commitDAO, set.metadataDAO);<NEW_LINE>set.blobDAO = new BlobDAORdbImpl(services.authService, services.mdbRoleService);<NEW_LINE>set.experimentRunDAO = new ExperimentRunDAORdbImpl(mdbConfig, services.authService, services.mdbRoleService, set.repositoryDAO, set.commitDAO, set.blobDAO, set.metadataDAO);<NEW_LINE>if (services.artifactStoreService != null) {<NEW_LINE>set.artifactStoreDAO = new ArtifactStoreDAORdbImpl(services.artifactStoreService, mdbConfig);<NEW_LINE>} else {<NEW_LINE>set.artifactStoreDAO = new ArtifactStoreDAODisabled();<NEW_LINE>}<NEW_LINE>set.commentDAO = new CommentDAORdbImpl(services.authService);<NEW_LINE>set.datasetDAO = new DatasetDAORdbImpl(services.authService, services.mdbRoleService);<NEW_LINE>set.lineageDAO = new LineageDAORdbImpl();<NEW_LINE>set.datasetVersionDAO = new DatasetVersionDAORdbImpl(<MASK><NEW_LINE>set.futureExperimentRunDAO = new FutureExperimentRunDAO(executor, jdbi, mdbConfig, services.uac, set.artifactStoreDAO, set.datasetVersionDAO, set.repositoryDAO, set.commitDAO, set.blobDAO, set.uacApisUtil);<NEW_LINE>set.futureProjectDAO = new FutureProjectDAO(executor, jdbi, services.uac, set.artifactStoreDAO, set.datasetVersionDAO, mdbConfig, set.futureExperimentRunDAO, set.uacApisUtil);<NEW_LINE>set.futureEventDAO = new FutureEventDAO(executor, jdbi, mdbConfig, ServiceEnum.Service.MODELDB_SERVICE.name());<NEW_LINE>set.futureExperimentDAO = new FutureExperimentDAO(executor, jdbi, services.uac, mdbConfig, set);<NEW_LINE>return set;<NEW_LINE>} | services.authService, services.mdbRoleService); |
390,603 | public void eventHandler(PipeEventFluid.FindDest event) {<NEW_LINE>Set<EnumFacing> machineDirs = new HashSet<>();<NEW_LINE>Set<EnumFacing> <MASK><NEW_LINE>for (EnumFacing dir : event.destinations) {<NEW_LINE>if (container.isPipeConnected(dir)) {<NEW_LINE>TileEntity e = container.getTile(dir);<NEW_LINE>if (e instanceof IFluidHandler) {<NEW_LINE>IFluidHandler h = (IFluidHandler) e;<NEW_LINE>if (h.fill(dir.getOpposite(), event.fluidStack, false) > 0) {<NEW_LINE>if (e instanceof IPipeTile) {<NEW_LINE>pipeDirs.add(dir);<NEW_LINE>} else {<NEW_LINE>machineDirs.add(dir);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>event.destinations.clear();<NEW_LINE>event.destinations.addAll(machineDirs.size() > 0 ? machineDirs : pipeDirs);<NEW_LINE>} | pipeDirs = new HashSet<>(); |
257,432 | private void createHeader(Composite container) {<NEW_LINE>Composite composite = new Composite(container, SWT.NONE);<NEW_LINE>composite.setBackground(container.getBackground());<NEW_LINE>composite.setLayout(new FormLayout());<NEW_LINE>// logo<NEW_LINE>Label image = new Label(composite, SWT.NONE);<NEW_LINE>image.setBackground(composite.getBackground());<NEW_LINE>image.setImage(Images.LOGO_128.image());<NEW_LINE>// name<NEW_LINE>Label title = new Label(composite, SWT.NONE);<NEW_LINE>title.setText(Messages.LabelPortfolioPerformance);<NEW_LINE>title.setData(UIConstants.CSS.<MASK><NEW_LINE>// version<NEW_LINE>Label version = new Label(composite, SWT.NONE);<NEW_LINE>// $NON-NLS-1$<NEW_LINE>version.// $NON-NLS-1$<NEW_LINE>setText(// $NON-NLS-1$<NEW_LINE>PortfolioPlugin.getDefault().getBundle().getVersion().toString() + " (" + // $NON-NLS-1$<NEW_LINE>DateTimeFormatter.ofPattern("MMM yyyy").format(BuildInfo.INSTANCE.getBuildTime()) + ")");<NEW_LINE>//<NEW_LINE>//<NEW_LINE>FormDataFactory.startingWith(image).thenRight(title, 30).//<NEW_LINE>top(new FormAttachment(image, 0, SWT.TOP)).thenBelow(version);<NEW_LINE>} | CLASS_NAME, UIConstants.CSS.HEADING1); |
129,294 | public Response<Void> deleteByIdWithResponse(String id, String ifMatch, Context context) {<NEW_LINE>String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups");<NEW_LINE>if (resourceGroupName == null) {<NEW_LINE>throw LOGGER.logExceptionAsError(new IllegalArgumentException(String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id)));<NEW_LINE>}<NEW_LINE>String serviceName = Utils.getValueFromIdByName(id, "service");<NEW_LINE>if (serviceName == null) {<NEW_LINE>throw LOGGER.logExceptionAsError(new IllegalArgumentException(String.format("The resource ID '%s' is not valid. Missing path segment 'service'.", id)));<NEW_LINE>}<NEW_LINE>String certificateId = Utils.getValueFromIdByName(id, "certificates");<NEW_LINE>if (certificateId == null) {<NEW_LINE>throw LOGGER.logExceptionAsError(new IllegalArgumentException(String.format("The resource ID '%s' is not valid. Missing path segment 'certificates'.", id)));<NEW_LINE>}<NEW_LINE>return this.deleteWithResponse(resourceGroupName, <MASK><NEW_LINE>} | serviceName, certificateId, ifMatch, context); |
1,131,851 | public static void main(String[] args) {<NEW_LINE>System.out.println("Scripting APIs:");<NEW_LINE>ScriptEngineManager manager = new ScriptEngineManager();<NEW_LINE>for (ScriptEngineFactory factory : manager.getEngineFactories()) {<NEW_LINE>System.out.println(" engineName=" + factory.getEngineName() + " engineVersion=" + factory.getEngineVersion() + " languageName=" + factory.getLanguageName() + " languageVersion=" + factory.getLanguageVersion() + " names=" + factory.getNames() + " mimeTypes=" + factory.getMimeTypes() + " extensions=" + factory.getExtensions());<NEW_LINE>}<NEW_LINE>System.out.println();<NEW_LINE>System.out.println("RSyntaxTextArea supported syntax languages:");<NEW_LINE>TokenMakerFactory f = TokenMakerFactory.getDefaultInstance();<NEW_LINE>List<String> list = new ArrayList<String>(f.keySet());<NEW_LINE>Collections.sort(list);<NEW_LINE>for (String type : list) {<NEW_LINE>System.<MASK><NEW_LINE>}<NEW_LINE>System.out.println();<NEW_LINE>} | out.println(" " + type); |
88,925 | final ListMembersResult executeListMembers(ListMembersRequest listMembersRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(listMembersRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE><MASK><NEW_LINE>Request<ListMembersRequest> request = null;<NEW_LINE>Response<ListMembersResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new ListMembersRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(listMembersRequest));<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, "Detective");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ListMembers");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<ListMembersResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new ListMembersResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | awsRequestMetrics.startEvent(Field.ClientExecuteTime); |
1,130,976 | protected static Map<String, List<String>> resolvePaths(String sourceDirectory) {<NEW_LINE>File endpointsDir = new File(sourceDirectory + "/paths");<NEW_LINE>int endpointStartAt = endpointsDir.getAbsolutePath().length();<NEW_LINE>Collection<File> endpointsFiles = FileUtils.listFiles(endpointsDir, new RegexFileFilter<MASK><NEW_LINE>Map<String, List<String>> endpoints = new TreeMap<>();<NEW_LINE>for (File file : endpointsFiles) {<NEW_LINE>String endpointMethod = FilenameUtils.removeExtension(file.getName());<NEW_LINE>String filePath = file.getAbsolutePath();<NEW_LINE>String endpointPath = filePath.substring(endpointStartAt, filePath.lastIndexOf(File.separator)).replace(File.separator, "/");<NEW_LINE>List<String> operations;<NEW_LINE>if (endpoints.containsKey(endpointPath)) {<NEW_LINE>operations = endpoints.get(endpointPath);<NEW_LINE>operations.add(endpointMethod);<NEW_LINE>} else {<NEW_LINE>operations = new ArrayList<>();<NEW_LINE>operations.add(endpointMethod);<NEW_LINE>endpoints.put(endpointPath, operations);<NEW_LINE>}<NEW_LINE>if (operations.size() > 1) {<NEW_LINE>Collections.sort(operations);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return endpoints;<NEW_LINE>} | ("^(.*?)"), DirectoryFileFilter.DIRECTORY); |
251,067 | public Map<String, String> updateSensorProperties(OwBaseBridgeHandler bridgeHandler) throws OwException {<NEW_LINE>Map<String, String> properties = new HashMap<String, String>();<NEW_LINE>OwPageBuffer pages = bridgeHandler.readPages(sensorId);<NEW_LINE>OwSensorType sensorType = OwSensorType.UNKNOWN;<NEW_LINE>try {<NEW_LINE>sensorType = OwSensorType.valueOf(new String(pages.getPage(0), 0, 7, StandardCharsets.US_ASCII));<NEW_LINE>} catch (IllegalArgumentException e) {<NEW_LINE>}<NEW_LINE>if (!SUPPORTED_SENSOR_TYPES.contains(sensorType)) {<NEW_LINE>throw new OwException("sensorType not supported for EDSSensorThing");<NEW_LINE>}<NEW_LINE>int fwRevisionLow = pages.getByte(3, 3);<NEW_LINE>int fwRevisionHigh = pages.getByte(3, 4);<NEW_LINE>String fwRevision = String.<MASK><NEW_LINE>properties.put(PROPERTY_MODELID, sensorType.name());<NEW_LINE>properties.put(PROPERTY_VENDOR, "Embedded Data Systems");<NEW_LINE>properties.put(PROPERTY_HW_REVISION, String.valueOf(fwRevision));<NEW_LINE>return properties;<NEW_LINE>} | format("%d.%d", fwRevisionHigh, fwRevisionLow); |
1,140,464 | public Mono<Response<Flux<ByteBuffer>>> deleteWithResponseAsync(String resourceGroupName, String publicIpPrefixName) {<NEW_LINE>if (this.client.getEndpoint() == null) {<NEW_LINE>return Mono.<MASK><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 (publicIpPrefixName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter publicIpPrefixName is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (this.client.getSubscriptionId() == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."));<NEW_LINE>}<NEW_LINE>final String apiVersion = "2018-11-01";<NEW_LINE>return FluxUtil.withContext(context -> service.delete(this.client.getEndpoint(), resourceGroupName, publicIpPrefixName, apiVersion, this.client.getSubscriptionId(), context)).contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));<NEW_LINE>} | error(new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); |
665,725 | public // 118073_10_1 Return the priority of messages that are sent using this JMSProducer<NEW_LINE>void testSetPriority_B_SecOff(HttpServletRequest request, HttpServletResponse response) throws Throwable {<NEW_LINE>JMSContext jmsContextQCFBindings = qcfBindings.createContext();<NEW_LINE>emptyQueue(qcfBindings, queue1);<NEW_LINE>JMSConsumer jmsConsumer = jmsContextQCFBindings.createConsumer(queue1);<NEW_LINE>JMSProducer jmsProducer = jmsContextQCFBindings.createProducer();<NEW_LINE>for (int msgNo = 0; msgNo < 10; msgNo++) {<NEW_LINE>TextMessage tmsg = jmsContextQCFBindings.createTextMessage();<NEW_LINE>jmsProducer.setPriority(msgNo);<NEW_LINE>jmsProducer.send(queue1, tmsg);<NEW_LINE>System.out.println("Sent message [ " + msgNo + " ]");<NEW_LINE>}<NEW_LINE>boolean testFailed = false;<NEW_LINE>QueueBrowser qb = jmsContextQCFBindings.createBrowser(queue1);<NEW_LINE>Enumeration e = qb.getEnumeration();<NEW_LINE>int numMsgs = 0;<NEW_LINE>while (e.hasMoreElements() && (numMsgs < 10)) {<NEW_LINE>TextMessage msgR = (<MASK><NEW_LINE>if ((msgR.getJMSPriority() + numMsgs) == 9) {<NEW_LINE>System.out.print("Message received in correct order. Priority [ " + msgR.getJMSPriority() + " ]");<NEW_LINE>} else {<NEW_LINE>System.out.print("Message received in wrong order. Priority [ " + msgR.getJMSPriority() + " ]");<NEW_LINE>testFailed = true;<NEW_LINE>}<NEW_LINE>numMsgs++;<NEW_LINE>}<NEW_LINE>jmsConsumer.close();<NEW_LINE>jmsContextQCFBindings.close();<NEW_LINE>if (testFailed) {<NEW_LINE>throw new Exception("testSetPriority_B_SecOff failed");<NEW_LINE>}<NEW_LINE>} | TextMessage) jmsConsumer.receive(30000); |
1,219,710 | public BlazeCommandResult exec(CommandEnvironment env, OptionsParsingResult options) {<NEW_LINE>env.getEventBus().post(new NoBuildEvent());<NEW_LINE>BlazeRuntime runtime = env.getRuntime();<NEW_LINE>OutErr outErr = env.getReporter().getOutErr();<NEW_LINE>Options helpOptions = options.getOptions(Options.class);<NEW_LINE>if (options.getResidue().isEmpty()) {<NEW_LINE>emitBlazeVersionInfo(<MASK><NEW_LINE>emitGenericHelp(outErr, runtime);<NEW_LINE>return BlazeCommandResult.success();<NEW_LINE>}<NEW_LINE>if (options.getResidue().size() != 1) {<NEW_LINE>String message = "You must specify exactly one command";<NEW_LINE>env.getReporter().handle(Event.error(message));<NEW_LINE>return createFailureResult(message, Code.MISSING_ARGUMENT);<NEW_LINE>}<NEW_LINE>String helpSubject = options.getResidue().get(0);<NEW_LINE>String productName = runtime.getProductName();<NEW_LINE>// Go through the custom subjects before going through Bazel commands.<NEW_LINE>switch(helpSubject) {<NEW_LINE>case "startup_options":<NEW_LINE>emitBlazeVersionInfo(outErr, runtime.getProductName());<NEW_LINE>emitStartupOptions(outErr, helpOptions.helpVerbosity, runtime);<NEW_LINE>return BlazeCommandResult.success();<NEW_LINE>case "target-syntax":<NEW_LINE>emitBlazeVersionInfo(outErr, runtime.getProductName());<NEW_LINE>emitTargetSyntaxHelp(outErr, productName);<NEW_LINE>return BlazeCommandResult.success();<NEW_LINE>case "info-keys":<NEW_LINE>emitInfoKeysHelp(env, outErr);<NEW_LINE>return BlazeCommandResult.success();<NEW_LINE>case "completion":<NEW_LINE>emitCompletionHelp(runtime, outErr);<NEW_LINE>return BlazeCommandResult.success();<NEW_LINE>case "flags-as-proto":<NEW_LINE>emitFlagsAsProtoHelp(runtime, outErr);<NEW_LINE>return BlazeCommandResult.success();<NEW_LINE>case "everything-as-html":<NEW_LINE>new HtmlEmitter(runtime).emit(outErr);<NEW_LINE>return BlazeCommandResult.success();<NEW_LINE>// fall out<NEW_LINE>default:<NEW_LINE>}<NEW_LINE>BlazeCommand command = runtime.getCommandMap().get(helpSubject);<NEW_LINE>if (command == null) {<NEW_LINE>String message = "'" + helpSubject + "' is not a known command";<NEW_LINE>env.getReporter().handle(Event.error(null, message));<NEW_LINE>return createFailureResult(message, Code.COMMAND_NOT_FOUND);<NEW_LINE>}<NEW_LINE>emitBlazeVersionInfo(outErr, productName);<NEW_LINE>outErr.printOut(BlazeCommandUtils.getUsage(command.getClass(), helpOptions.helpVerbosity, runtime.getBlazeModules(), runtime.getRuleClassProvider(), productName));<NEW_LINE>return BlazeCommandResult.success();<NEW_LINE>} | outErr, runtime.getProductName()); |
1,453,056 | public static String addLimits(String query, long offSet, long limit) {<NEW_LINE>if (offSet == 0 && limit == -1) {<NEW_LINE>// Nothing to do...<NEW_LINE>return query;<NEW_LINE>}<NEW_LINE>StringBuffer queryString = new StringBuffer();<NEW_LINE>int count = 0;<NEW_LINE>if (query != null) {<NEW_LINE>query = query.toLowerCase();<NEW_LINE>count = StringUtil.count(query, "select");<NEW_LINE>}<NEW_LINE>if (!UtilMethods.isSet(query) || !query.trim().contains("select") || count > 1) {<NEW_LINE>return query;<NEW_LINE>} else {<NEW_LINE>if (DbConnectionFactory.isPostgres() || DbConnectionFactory.isMySql()) {<NEW_LINE>query = query + " LIMIT " + limit + " OFFSET " + offSet;<NEW_LINE>queryString.append(query);<NEW_LINE>} else if (DbConnectionFactory.isMsSql()) {<NEW_LINE>String str = "";<NEW_LINE>if (query.startsWith("select")) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>if (query.contains("order by")) {<NEW_LINE>str = query.substring(query.indexOf("order by"), query.length());<NEW_LINE>query = query.replace(str, "").trim();<NEW_LINE>}<NEW_LINE>query = " SELECT TOP " + limit + " * FROM (SELECT ROW_NUMBER() " + " OVER (" + str + ") AS RowNumber," + query + ") temp " + " WHERE RowNumber >" + offSet;<NEW_LINE>queryString.append(query);<NEW_LINE>} else if (DbConnectionFactory.isOracle()) {<NEW_LINE>limit = limit + offSet;<NEW_LINE>query = "select * from ( select temp.*, ROWNUM rnum from ( " + query + " ) temp where ROWNUM <= " + limit + " ) where rnum > " + offSet;<NEW_LINE>queryString.append(query);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return queryString.toString();<NEW_LINE>} | query = query.substring(6); |
974,149 | public int onStartCommand(Intent intent, int flags, int startId) {<NEW_LINE>String cmd = intent != null ? intent.getStringExtra("cmd") : null;<NEW_LINE>CrashTracking.log("MainService.onStartCommand(), cmd:" + cmd);<NEW_LINE>MainController mainController = MainController.get();<NEW_LINE>if (mainController == null || intent == null || cmd == null) {<NEW_LINE>stopSelf();<NEW_LINE>return START_NOT_STICKY;<NEW_LINE>}<NEW_LINE>long urlLoadStartTime = intent.getLongExtra("start_time", System.currentTimeMillis());<NEW_LINE>if (cmd.compareTo("open") == 0) {<NEW_LINE>String url = intent.getStringExtra("url");<NEW_LINE>if (url != null) {<NEW_LINE>String openedFromAppName = intent.getStringExtra("openedFromAppName");<NEW_LINE>mainController.openUrl(url, urlLoadStartTime, true, openedFromAppName);<NEW_LINE>}<NEW_LINE>} else if (cmd.compareTo("restore") == 0) {<NEW_LINE>if (!mRestoreComplete) {<NEW_LINE>String[] urls = intent.getStringArrayExtra("urls");<NEW_LINE>if (urls != null) {<NEW_LINE>int startOpenTabCount = mainController.getActiveTabCount();<NEW_LINE>for (int i = 0; i < urls.length; i++) {<NEW_LINE>String urlAsString = urls[i];<NEW_LINE>if (urlAsString != null && !urlAsString.equals(Constant.WELCOME_MESSAGE_URL)) {<NEW_LINE>boolean setAsCurrentTab = false;<NEW_LINE>if (startOpenTabCount == 0) {<NEW_LINE>setAsCurrentTab = i == urls.length - 1;<NEW_LINE>}<NEW_LINE>mainController.openUrl(urlAsString, <MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>mRestoreComplete = true;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return START_STICKY;<NEW_LINE>} | urlLoadStartTime, setAsCurrentTab, Analytics.OPENED_URL_FROM_RESTORE); |
480,244 | public void marshall(AwsEc2EipDetails awsEc2EipDetails, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (awsEc2EipDetails == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(awsEc2EipDetails.getInstanceId(), INSTANCEID_BINDING);<NEW_LINE>protocolMarshaller.marshall(awsEc2EipDetails.getPublicIp(), PUBLICIP_BINDING);<NEW_LINE>protocolMarshaller.marshall(awsEc2EipDetails.getAllocationId(), ALLOCATIONID_BINDING);<NEW_LINE>protocolMarshaller.marshall(awsEc2EipDetails.getAssociationId(), ASSOCIATIONID_BINDING);<NEW_LINE>protocolMarshaller.marshall(awsEc2EipDetails.getDomain(), DOMAIN_BINDING);<NEW_LINE>protocolMarshaller.marshall(awsEc2EipDetails.getPublicIpv4Pool(), PUBLICIPV4POOL_BINDING);<NEW_LINE>protocolMarshaller.marshall(awsEc2EipDetails.getNetworkBorderGroup(), NETWORKBORDERGROUP_BINDING);<NEW_LINE>protocolMarshaller.marshall(<MASK><NEW_LINE>protocolMarshaller.marshall(awsEc2EipDetails.getNetworkInterfaceOwnerId(), NETWORKINTERFACEOWNERID_BINDING);<NEW_LINE>protocolMarshaller.marshall(awsEc2EipDetails.getPrivateIpAddress(), PRIVATEIPADDRESS_BINDING);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>} | awsEc2EipDetails.getNetworkInterfaceId(), NETWORKINTERFACEID_BINDING); |
1,743,076 | public void windowStateChanged(WindowEvent evt) {<NEW_LINE>if (!Constants.AUTO_ICONIFY) {<NEW_LINE>modeView.getController().userChangedFrameStateMode(modeView, evt.getNewState());<NEW_LINE>} else {<NEW_LINE>// All the timestamping is a a workaround beause of buggy GNOME<NEW_LINE>// and of its kind who iconify the windows on leaving the desktop.<NEW_LINE>Component comp = modeView.getComponent();<NEW_LINE>if (comp instanceof Frame) /*&& comp.isVisible() */<NEW_LINE>{<NEW_LINE>long currentStamp = System.currentTimeMillis();<NEW_LINE>if (currentStamp > (modeView.getUserStamp() + 500) && currentStamp > (modeView.getMainWindowStamp() + 1000)) {<NEW_LINE>modeView.getController().userChangedFrameStateMode(<MASK><NEW_LINE>} else {<NEW_LINE>modeView.setUserStamp(0);<NEW_LINE>modeView.setMainWindowStamp(0);<NEW_LINE>modeView.updateFrameState();<NEW_LINE>}<NEW_LINE>long stamp = System.currentTimeMillis();<NEW_LINE>modeView.setUserStamp(stamp);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | modeView, evt.getNewState()); |
1,463,193 | final AcceptResourceShareInvitationResult executeAcceptResourceShareInvitation(AcceptResourceShareInvitationRequest acceptResourceShareInvitationRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(acceptResourceShareInvitationRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<AcceptResourceShareInvitationRequest> request = null;<NEW_LINE>Response<AcceptResourceShareInvitationResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new AcceptResourceShareInvitationRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(acceptResourceShareInvitationRequest));<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, "RAM");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "AcceptResourceShareInvitation");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<AcceptResourceShareInvitationResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new AcceptResourceShareInvitationResultJsonUnmarshaller());<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()); |
173,444 | public float score() throws IOException {<NEW_LINE>TermStatSupplier tsq = new TermStatSupplier();<NEW_LINE>// Refresh the term stats<NEW_LINE>tsq.setPosAggr(posAggr);<NEW_LINE>tsq.bump(searcher, context, docID(), terms, scoreMode, termContexts);<NEW_LINE>// Prepare computed statistics<NEW_LINE>StatisticsHelper computed = new StatisticsHelper();<NEW_LINE>HashMap<String, Float> termStatDict = new HashMap<>();<NEW_LINE>Bindings bindings = new Bindings() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public DoubleValuesSource getDoubleValuesSource(String name) {<NEW_LINE>return DoubleValuesSource.constant(termStatDict.get(name));<NEW_LINE>}<NEW_LINE>};<NEW_LINE>// If no values found return 0<NEW_LINE>if (tsq.size() == 0) {<NEW_LINE>return 0.0f;<NEW_LINE>}<NEW_LINE>for (int i = 0; i < tsq.size(); i++) {<NEW_LINE>// Update the term stat dictionary for the current term<NEW_LINE>termStatDict.put("df", tsq.get("df").get(i));<NEW_LINE>termStatDict.put("idf", tsq.get("idf").get(i));<NEW_LINE>termStatDict.put("tf", tsq.get("tf").get(i));<NEW_LINE>termStatDict.put("tp", tsq.get("tp").get(i));<NEW_LINE>termStatDict.put("ttf", tsq.get("ttf").get(i));<NEW_LINE>termStatDict.put("matches", (float) tsq.getMatchedTermCount());<NEW_LINE>termStatDict.put("unique", (float) terms.size());<NEW_LINE>// Run the expression and store the result in computed<NEW_LINE>DoubleValuesSource <MASK><NEW_LINE>DoubleValues values = dvSrc.getValues(context, null);<NEW_LINE>values.advanceExact(docID());<NEW_LINE>computed.add((float) values.doubleValue());<NEW_LINE>}<NEW_LINE>return computed.getAggr(aggr);<NEW_LINE>} | dvSrc = compiledExpression.getDoubleValuesSource(bindings); |
1,040,627 | protected Void deleteSnapshotCallback(AsyncCallbackDispatcher<SnapshotServiceImpl, CommandResult> callback, DeleteSnapshotContext<CommandResult> context) {<NEW_LINE>CommandResult result = callback.getResult();<NEW_LINE>AsyncCallFuture<SnapshotResult> future = context.future;<NEW_LINE>SnapshotInfo snapshot = context.snapshot;<NEW_LINE>SnapshotResult res = null;<NEW_LINE>try {<NEW_LINE>if (result.isFailed()) {<NEW_LINE>s_logger.debug("delete snapshot failed" + result.getResult());<NEW_LINE>snapshot.processEvent(ObjectInDataStoreStateMachine.Event.OperationFailed);<NEW_LINE>res = new SnapshotResult(context.snapshot, null);<NEW_LINE>res.setResult(result.getResult());<NEW_LINE>} else {<NEW_LINE>snapshot.<MASK><NEW_LINE>res = new SnapshotResult(context.snapshot, null);<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>s_logger.debug("Failed to in deleteSnapshotCallback", e);<NEW_LINE>res.setResult(e.toString());<NEW_LINE>}<NEW_LINE>future.complete(res);<NEW_LINE>return null;<NEW_LINE>} | processEvent(ObjectInDataStoreStateMachine.Event.OperationSuccessed); |
457,601 | public static JBPopup createPopup(final List<? extends GotoRelatedItem> items, final String title) {<NEW_LINE>Object[] elements = new Object[items.size()];<NEW_LINE>// todo[nik] move presentation logic to GotoRelatedItem class<NEW_LINE>final Map<PsiElement, GotoRelatedItem> itemsMap = new HashMap<PsiElement, GotoRelatedItem>();<NEW_LINE>for (int i = 0; i < items.size(); i++) {<NEW_LINE>GotoRelatedItem item = items.get(i);<NEW_LINE>elements[i] = item.getElement() != null ? item.getElement() : item;<NEW_LINE>itemsMap.put(<MASK><NEW_LINE>}<NEW_LINE>return getPsiElementPopup(elements, itemsMap, title, new Processor<Object>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public boolean process(Object element) {<NEW_LINE>if (element instanceof PsiElement) {<NEW_LINE>// noinspection SuspiciousMethodCalls<NEW_LINE>itemsMap.get(element).navigate();<NEW_LINE>} else {<NEW_LINE>((GotoRelatedItem) element).navigate();<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} | item.getElement(), item); |
471,975 | private void createPoiFiltersItems(MapActivity mapActivity, Set<PoiUIFilter> poiFilters, LinearLayout optionsContainer) {<NEW_LINE>LinearLayout item = createToolbarOptionView(false, null, <MASK><NEW_LINE>if (item != null) {<NEW_LINE>item.findViewById(R.id.route_option_container).setVisibility(View.GONE);<NEW_LINE>Iterator<PoiUIFilter> it = poiFilters.iterator();<NEW_LINE>while (it.hasNext()) {<NEW_LINE>final PoiUIFilter poiUIFilter = it.next();<NEW_LINE>final View container = createToolbarSubOptionView(true, poiUIFilter.getName(), R.drawable.ic_action_remove_dark, !it.hasNext(), v -> {<NEW_LINE>MapActivity mapActivity1 = getMapActivity();<NEW_LINE>if (mapActivity1 != null) {<NEW_LINE>mapActivity1.getMyApplication().getPoiFilters().removeSelectedPoiFilter(poiUIFilter);<NEW_LINE>mapActivity1.refreshMap();<NEW_LINE>updateOptionsButtons();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>if (container != null) {<NEW_LINE>item.addView(container, getContainerButtonLayoutParams(mapActivity, false));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>optionsContainer.addView(item, getContainerButtonLayoutParams(mapActivity, true));<NEW_LINE>}<NEW_LINE>} | -1, -1, null); |
1,174,426 | private DataSet<Factors> initFactors(DataSet<Ratings> graph, final int numFactors) {<NEW_LINE>return graph.map(new RichMapFunction<Ratings, Factors>() {<NEW_LINE><NEW_LINE>private static final long serialVersionUID = -6242580857177532093L;<NEW_LINE><NEW_LINE>transient Random random;<NEW_LINE><NEW_LINE>transient Factors reusedFactors;<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void open(Configuration parameters) {<NEW_LINE>random = new Random(getRuntimeContext().getIndexOfThisSubtask());<NEW_LINE>reusedFactors = new Factors();<NEW_LINE>reusedFactors.factors = new float[numFactors];<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public Factors map(Ratings value) {<NEW_LINE>reusedFactors.identity = value.identity;<NEW_LINE>reusedFactors.nodeId = value.nodeId;<NEW_LINE>for (int i = 0; i < numFactors; i++) {<NEW_LINE>reusedFactors.factors[<MASK><NEW_LINE>}<NEW_LINE>return reusedFactors;<NEW_LINE>}<NEW_LINE>}).name("InitFactors");<NEW_LINE>} | i] = random.nextFloat(); |
498,067 | public void deleteById(String id) {<NEW_LINE>String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups");<NEW_LINE>if (resourceGroupName == null) {<NEW_LINE>throw logger.logExceptionAsError(new IllegalArgumentException(String.<MASK><NEW_LINE>}<NEW_LINE>String clusterName = Utils.getValueFromIdByName(id, "clusters");<NEW_LINE>if (clusterName == null) {<NEW_LINE>throw logger.logExceptionAsError(new IllegalArgumentException(String.format("The resource ID '%s' is not valid. Missing path segment 'clusters'.", id)));<NEW_LINE>}<NEW_LINE>String attachedDatabaseConfigurationName = Utils.getValueFromIdByName(id, "attachedDatabaseConfigurations");<NEW_LINE>if (attachedDatabaseConfigurationName == null) {<NEW_LINE>throw logger.logExceptionAsError(new IllegalArgumentException(String.format("The resource ID '%s' is not valid. Missing path segment" + " 'attachedDatabaseConfigurations'.", id)));<NEW_LINE>}<NEW_LINE>this.delete(resourceGroupName, clusterName, attachedDatabaseConfigurationName, Context.NONE);<NEW_LINE>} | format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); |
1,734,928 | public void record(Tunnel tunnel) {<NEW_LINE>StringBuilder sb = new StringBuilder(tunnel.identity().toString());<NEW_LINE>sb.append(RedisProtocol.CRLF);<NEW_LINE>sb.append(tunnel.getTunnelMonitor().getTunnelStats().getTunnelStatsResult().toString()).append(RedisProtocol.CRLF);<NEW_LINE>sb.append(SESSION_TYPE.FRONTEND.name()).append(RedisProtocol.CRLF);<NEW_LINE>sb.append("outbound buffer: ").append(tunnel.getTunnelMonitor().getFrontendSessionMonitor().getOutboundBufferMonitor().getOutboundBufferCumulation()).append(RedisProtocol.CRLF);<NEW_LINE>sb.append(tunnel.getTunnelMonitor().getFrontendSessionMonitor().getSocketStats().getSocketStatsResult().toString()<MASK><NEW_LINE>sb.append(tunnel.getTunnelMonitor().getFrontendSessionMonitor().getSessionStats().toString()).append(RedisProtocol.CRLF);<NEW_LINE>sb.append(SESSION_TYPE.BACKEND.name()).append(RedisProtocol.CRLF);<NEW_LINE>sb.append("outbound buffer: ").append(tunnel.getTunnelMonitor().getBackendSessionMonitor().getOutboundBufferMonitor().getOutboundBufferCumulation()).append(RedisProtocol.CRLF);<NEW_LINE>sb.append(tunnel.getTunnelMonitor().getBackendSessionMonitor().getSocketStats().getSocketStatsResult().toString()).append(RedisProtocol.CRLF);<NEW_LINE>sb.append(tunnel.getTunnelMonitor().getBackendSessionMonitor().getSessionStats().toString()).append(RedisProtocol.CRLF);<NEW_LINE>sb.append(LINE_SPLITTER).append(RedisProtocol.CRLF);<NEW_LINE>logger.info("{}", sb.toString());<NEW_LINE>} | ).append(RedisProtocol.CRLF); |
1,167,203 | private void initialiseJavaTimeTypes(DatabaseConfig config) {<NEW_LINE>ZoneId zoneId = getZoneId(config);<NEW_LINE>typeMap.put(java.nio.file.Path.class, new ScalarTypePath());<NEW_LINE>addType(java.time.Period.class, new ScalarTypePeriod());<NEW_LINE>if (config.getDatabasePlatform().supportsNativeJavaTime()) {<NEW_LINE>addType(java.time.LocalDate.class, new ScalarTypeLocalDateNative(jsonDate));<NEW_LINE>} else {<NEW_LINE>addType(java.time.LocalDate.class, new ScalarTypeLocalDate(jsonDate));<NEW_LINE>}<NEW_LINE>addType(java.time.LocalDateTime.<MASK><NEW_LINE>addType(OffsetDateTime.class, new ScalarTypeOffsetDateTime(jsonDateTime, zoneId));<NEW_LINE>addType(ZonedDateTime.class, new ScalarTypeZonedDateTime(jsonDateTime, zoneId));<NEW_LINE>addType(Instant.class, new ScalarTypeInstant(jsonDateTime));<NEW_LINE>addType(DayOfWeek.class, new ScalarTypeDayOfWeek());<NEW_LINE>addType(Month.class, new ScalarTypeMonth());<NEW_LINE>addType(Year.class, new ScalarTypeYear());<NEW_LINE>addType(YearMonth.class, new ScalarTypeYearMonthDate(jsonDate));<NEW_LINE>addType(MonthDay.class, new ScalarTypeMonthDay());<NEW_LINE>addType(OffsetTime.class, new ScalarTypeOffsetTime());<NEW_LINE>addType(ZoneId.class, new ScalarTypeZoneId());<NEW_LINE>addType(ZoneOffset.class, new ScalarTypeZoneOffset());<NEW_LINE>boolean localTimeNanos = config.isLocalTimeWithNanos();<NEW_LINE>addType(java.time.LocalTime.class, (localTimeNanos) ? new ScalarTypeLocalTimeWithNanos() : new ScalarTypeLocalTime());<NEW_LINE>boolean durationNanos = config.isDurationWithNanos();<NEW_LINE>addType(Duration.class, (durationNanos) ? new ScalarTypeDurationWithNanos() : new ScalarTypeDuration());<NEW_LINE>} | class, new ScalarTypeLocalDateTime(jsonDateTime)); |
1,793,632 | private static void transactionCompensatedDemo(StateMachineEngine stateMachineEngine) {<NEW_LINE>Map<String, Object> startParams <MASK><NEW_LINE>String businessKey = String.valueOf(System.currentTimeMillis());<NEW_LINE>startParams.put("businessKey", businessKey);<NEW_LINE>startParams.put("count", 10);<NEW_LINE>startParams.put("amount", new BigDecimal("100"));<NEW_LINE>startParams.put("mockReduceBalanceFail", "true");<NEW_LINE>// sync test<NEW_LINE>StateMachineInstance inst = stateMachineEngine.startWithBusinessKey("reduceInventoryAndBalance", null, businessKey, startParams);<NEW_LINE>// async test<NEW_LINE>businessKey = String.valueOf(System.currentTimeMillis());<NEW_LINE>inst = stateMachineEngine.startWithBusinessKeyAsync("reduceInventoryAndBalance", null, businessKey, startParams, CALL_BACK);<NEW_LINE>waittingForFinish(inst);<NEW_LINE>Assert.isTrue(ExecutionStatus.SU.equals(inst.getCompensationStatus()), "saga transaction compensate failed. XID: " + inst.getId());<NEW_LINE>System.out.println("saga transaction compensate succeed. XID: " + inst.getId());<NEW_LINE>} | = new HashMap<>(4); |
667,108 | private void wrapInGroupNode() {<NEW_LINE>// What's our parent? What's the corresponding node we're wrapping?<NEW_LINE>ParseNode parent = (ParseNode) getCurrentNode();<NEW_LINE>int nodeToWrapIndex = parent.getChildCount() - 1;<NEW_LINE>IParseNode nodeToWrap = parent.getChild(nodeToWrapIndex);<NEW_LINE>JSGroupNode groupNode = generateGroupNode(nodeToWrap.getEndingOffset() + 1);<NEW_LINE>if (groupNode == null) {<NEW_LINE>// if invalid location, stop and do nothing<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// Fix the start/end positions of parent node! They may be incorrect and group node extends beyond it!<NEW_LINE>fixOffsets(parent, groupNode.getStartingOffset(), groupNode.getEndingOffset());<NEW_LINE>// wrap the node in the group node<NEW_LINE>groupNode.setChildren(<MASK><NEW_LINE>// Now replace the corresponding node with a group node that wraps it!<NEW_LINE>parent.replaceChild(nodeToWrapIndex, groupNode);<NEW_LINE>} | new IParseNode[] { nodeToWrap }); |
1,518,531 | private void processRefLink(Link subRef, String externalFile) {<NEW_LINE>RefFormat format = computeRefFormat(subRef.get$ref());<NEW_LINE>if (!isAnExternalRefFormat(format)) {<NEW_LINE>subRef.set$ref(RefType.SCHEMAS.getInternalPrefix() + processRefToExternalSchema(externalFile + subRef.get$ref(), RefFormat.RELATIVE));<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>String $ref = subRef.get$ref();<NEW_LINE>String subRefExternalPath = getExternalPath(subRef.get$ref()).orElse(null);<NEW_LINE>if (format.equals(RefFormat.RELATIVE) && !Objects.equals(subRefExternalPath, externalFile)) {<NEW_LINE>$ref = join(<MASK><NEW_LINE>subRef.set$ref($ref);<NEW_LINE>} else {<NEW_LINE>processRefToExternalLink($ref, format);<NEW_LINE>}<NEW_LINE>} | externalFile, subRef.get$ref()); |
1,680,146 | public KernelCapabilities unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>KernelCapabilities kernelCapabilities = new KernelCapabilities();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE><MASK><NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>if (context.testExpression("add", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>kernelCapabilities.setAdd(new ListUnmarshaller<String>(context.getUnmarshaller(String.class)).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("drop", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>kernelCapabilities.setDrop(new ListUnmarshaller<String>(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 kernelCapabilities;<NEW_LINE>} | JsonToken token = context.getCurrentToken(); |
1,283,087 | public void handle(Map data) {<NEW_LINE>markSnapshotTreeCompleted(VolumeSnapshotInventory.valueOf(vo));<NEW_LINE>VolumeSnapshotVO svo = dbf.findByUuid(vo.getUuid(), VolumeSnapshotVO.class);<NEW_LINE>if (svo.getPrimaryStorageInstallPath() == null) {<NEW_LINE>svo.setPrimaryStorageInstallPath(vol.getInstallPath());<NEW_LINE>}<NEW_LINE>svo.setStatus(VolumeSnapshotStatus.Ready);<NEW_LINE>if (vol.getFormat() != null) {<NEW_LINE>svo.setFormat(vol.getFormat());<NEW_LINE>}<NEW_LINE>svo = dbf.updateAndRefresh(svo);<NEW_LINE>tagMgr.createNonInherentSystemTag(svo.getUuid(), VolumeSnapshotSystemTags.VOLUMESNAPSHOT_CREATED_BY_SYSTEM.getTagFormat(), VolumeSnapshotVO.class.getSimpleName());<NEW_LINE>new FireSnapShotCanonicalEvent().fireSnapShotStatusChangedEvent(svo.getStatus(), VolumeSnapshotInventory.valueOf(svo));<NEW_LINE>ret.setInventory(VolumeSnapshotInventory.valueOf(svo));<NEW_LINE><MASK><NEW_LINE>} | bus.reply(msg, ret); |
502,904 | public void createOrUpdateRealmLocalizationTexts(String locale, Map<String, String> localizationTexts) {<NEW_LINE>Map<String, RealmLocalizationTextsEntity> currentLocalizationTexts = realm.getRealmLocalizationTexts();<NEW_LINE>if (currentLocalizationTexts.containsKey(locale)) {<NEW_LINE>RealmLocalizationTextsEntity localizationTextsEntity = currentLocalizationTexts.get(locale);<NEW_LINE>Map<String, String> updatedTexts = new HashMap<>(localizationTextsEntity.getTexts());<NEW_LINE>updatedTexts.putAll(localizationTexts);<NEW_LINE>localizationTextsEntity.setTexts(updatedTexts);<NEW_LINE>em.persist(localizationTextsEntity);<NEW_LINE>} else {<NEW_LINE>RealmLocalizationTextsEntity realmLocalizationTextsEntity = new RealmLocalizationTextsEntity();<NEW_LINE>realmLocalizationTextsEntity.<MASK><NEW_LINE>realmLocalizationTextsEntity.setLocale(locale);<NEW_LINE>realmLocalizationTextsEntity.setTexts(localizationTexts);<NEW_LINE>em.persist(realmLocalizationTextsEntity);<NEW_LINE>}<NEW_LINE>} | setRealmId(realm.getId()); |
1,818,114 | private MessageTree readMessage(String messageId, Date date, Transaction t, List<String> paths) {<NEW_LINE>for (String dataFile : paths) {<NEW_LINE>try {<NEW_LINE>String type = t.getName();<NEW_LINE>StringBuilder sb = new StringBuilder();<NEW_LINE>sb.append(type).append("-").append(date.toString()).append("-").append(dataFile);<NEW_LINE><MASK><NEW_LINE>Cat.logEvent(type, bKey);<NEW_LINE>MessageBucket bucket = m_buckets.get(bKey);<NEW_LINE>if (bucket == null) {<NEW_LINE>bucket = lookup(MessageBucket.class, type);<NEW_LINE>bucket.initialize(dataFile, date);<NEW_LINE>m_buckets.put(bKey, bucket);<NEW_LINE>}<NEW_LINE>MessageTree tree = bucket.findById(messageId);<NEW_LINE>if (tree != null && tree.getMessageId().equals(messageId)) {<NEW_LINE>t.addData("path", dataFile);<NEW_LINE>return tree;<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>t.setStatus(e);<NEW_LINE>Cat.logError(e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>} | String bKey = sb.toString(); |
289,211 | public static void raw(BinanceExchange exchange, BinanceMarketDataService marketDataService) throws IOException {<NEW_LINE>List<BinanceTicker24h> <MASK><NEW_LINE>for (CurrencyPair cp : exchange.getExchangeMetaData().getCurrencyPairs().keySet()) {<NEW_LINE>if (cp.counter == Currency.USDT) {<NEW_LINE>tickers.add(marketDataService.ticker24h(cp));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>Collections.sort(tickers, new Comparator<BinanceTicker24h>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public int compare(BinanceTicker24h t1, BinanceTicker24h t2) {<NEW_LINE>return t2.getPriceChangePercent().compareTo(t1.getPriceChangePercent());<NEW_LINE>}<NEW_LINE>});<NEW_LINE>tickers.stream().forEach(t -> {<NEW_LINE>System.out.println(t.getCurrencyPair() + " => " + String.format("%+.2f%%", t.getPriceChangePercent()));<NEW_LINE>});<NEW_LINE>System.out.println("raw out end");<NEW_LINE>} | tickers = new ArrayList<>(); |
1,487,675 | public void serialize(RntbdPollChannelEvent event, JsonGenerator writer, SerializerProvider serializerProvider) throws IOException {<NEW_LINE>writer.writeStartObject();<NEW_LINE>writer.writeStringField(event.getEventType().toString(), event.getCreatedTime().toString());<NEW_LINE>if (event.availableChannels > 0) {<NEW_LINE>writer.writeNumberField("availableChannels", event.availableChannels);<NEW_LINE>}<NEW_LINE>if (event.acquiredChannels > 0) {<NEW_LINE>writer.writeNumberField("acquiredChannels", event.acquiredChannels);<NEW_LINE>}<NEW_LINE>if (event.getCompleteTime() != null) {<NEW_LINE>writer.writeNumberField("durationInMicroSec", Duration.between(event.getCompleteTime(), event.getCompleteTime()<MASK><NEW_LINE>}<NEW_LINE>if (event.details != null && event.details.size() > 0) {<NEW_LINE>writer.writeObjectField("details", event.details);<NEW_LINE>}<NEW_LINE>writer.writeEndObject();<NEW_LINE>} | ).toNanos() / 1000L); |
146,333 | public static void horizontal7(Kernel1D_F32 kernel, GrayF32 image, GrayF32 dest) {<NEW_LINE>final float[] dataSrc = image.data;<NEW_LINE>final float[] dataDst = dest.data;<NEW_LINE>final float k1 = kernel.data[0];<NEW_LINE>final float k2 = kernel.data[1];<NEW_LINE>final float k3 = kernel.data[2];<NEW_LINE>final float k4 = kernel.data[3];<NEW_LINE>final float <MASK><NEW_LINE>final float k6 = kernel.data[5];<NEW_LINE>final float k7 = kernel.data[6];<NEW_LINE>final int radius = kernel.getRadius();<NEW_LINE>final int width = image.getWidth();<NEW_LINE>// CONCURRENT_BELOW BoofConcurrency.loopFor(0, image.height, i -> {<NEW_LINE>for (int i = 0; i < image.height; i++) {<NEW_LINE>int indexDst = dest.startIndex + i * dest.stride + radius;<NEW_LINE>int j = image.startIndex + i * image.stride - radius;<NEW_LINE>final int jEnd = j + width - radius;<NEW_LINE>for (j += radius; j < jEnd; j++) {<NEW_LINE>int indexSrc = j;<NEW_LINE>float total = (dataSrc[indexSrc++]) * k1;<NEW_LINE>total += (dataSrc[indexSrc++]) * k2;<NEW_LINE>total += (dataSrc[indexSrc++]) * k3;<NEW_LINE>total += (dataSrc[indexSrc++]) * k4;<NEW_LINE>total += (dataSrc[indexSrc++]) * k5;<NEW_LINE>total += (dataSrc[indexSrc++]) * k6;<NEW_LINE>total += (dataSrc[indexSrc]) * k7;<NEW_LINE>dataDst[indexDst++] = total;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// CONCURRENT_ABOVE });<NEW_LINE>} | k5 = kernel.data[4]; |
1,199,427 | public GridBoundsChange performAction(GridManager gridManager, DesignerContext context) {<NEW_LINE>GridInfoProvider gridInfo = gridManager.getGridInfo();<NEW_LINE>boolean gapSupport = gridInfo.hasGaps();<NEW_LINE>int[] originalColumnBounds = gridInfo.getColumnBounds();<NEW_LINE>int[] originalRowBounds = gridInfo.getRowBounds();<NEW_LINE>int column = context.getFocusedColumn();<NEW_LINE>GridUtils.removePaddingComponents(gridManager);<NEW_LINE>gridManager.deleteColumn(column);<NEW_LINE>GridUtils.addPaddingComponents(gridManager, originalColumnBounds.length - 1 - (gapSupport ? 2 : 1), originalRowBounds.length - 1);<NEW_LINE>GridUtils.revalidateGrid(gridManager);<NEW_LINE>int[] newColumnBounds = gridInfo.getColumnBounds();<NEW_LINE>int[] newRowBounds = gridInfo.getRowBounds();<NEW_LINE>int[] columnBounds;<NEW_LINE>if (column == originalColumnBounds.length - 2) {<NEW_LINE>// The last column deleted<NEW_LINE>columnBounds = newColumnBounds;<NEW_LINE>} else {<NEW_LINE>columnBounds = new int[newColumnBounds.length + (gapSupport ? 2 : 1)];<NEW_LINE>if (gapSupport) {<NEW_LINE>System.arraycopy(newColumnBounds, 0, <MASK><NEW_LINE>columnBounds[column + 1] = columnBounds[column];<NEW_LINE>columnBounds[column + 2] = columnBounds[column];<NEW_LINE>System.arraycopy(newColumnBounds, column + 1, columnBounds, column + 3, newColumnBounds.length - column - 1);<NEW_LINE>} else {<NEW_LINE>System.arraycopy(newColumnBounds, 0, columnBounds, 0, column + 1);<NEW_LINE>columnBounds[column + 1] = columnBounds[column];<NEW_LINE>System.arraycopy(newColumnBounds, column + 1, columnBounds, column + 2, newColumnBounds.length - column - 1);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return new GridBoundsChange(originalColumnBounds, originalRowBounds, columnBounds, newRowBounds);<NEW_LINE>} | columnBounds, 0, column + 1); |
1,517,158 | public void read(JmeImporter im) throws IOException {<NEW_LINE>InputCapsule ic = im.getCapsule(this);<NEW_LINE>name = ic.readString("name", null);<NEW_LINE>shaderNames.put(Shader.ShaderType.Vertex, ic<MASK><NEW_LINE>shaderNames.put(Shader.ShaderType.Fragment, ic.readString("fragName", null));<NEW_LINE>shaderNames.put(Shader.ShaderType.Geometry, ic.readString("geomName", null));<NEW_LINE>shaderNames.put(Shader.ShaderType.TessellationControl, ic.readString("tsctrlName", null));<NEW_LINE>shaderNames.put(Shader.ShaderType.TessellationEvaluation, ic.readString("tsevalName", null));<NEW_LINE>shaderPrologue = ic.readString("shaderPrologue", null);<NEW_LINE>lightMode = ic.readEnum("lightMode", LightMode.class, LightMode.Disable);<NEW_LINE>shadowMode = ic.readEnum("shadowMode", ShadowMode.class, ShadowMode.Disable);<NEW_LINE>renderState = (RenderState) ic.readSavable("renderState", null);<NEW_LINE>noRender = ic.readBoolean("noRender", false);<NEW_LINE>if (ic.getSavableVersion(TechniqueDef.class) == 0) {<NEW_LINE>// Old version<NEW_LINE>shaderLanguages.put(Shader.ShaderType.Vertex, ic.readString("shaderLang", null));<NEW_LINE>shaderLanguages.put(Shader.ShaderType.Fragment, shaderLanguages.get(Shader.ShaderType.Vertex));<NEW_LINE>} else {<NEW_LINE>// New version<NEW_LINE>shaderLanguages.put(Shader.ShaderType.Vertex, ic.readString("vertLanguage", null));<NEW_LINE>shaderLanguages.put(Shader.ShaderType.Fragment, ic.readString("fragLanguage", null));<NEW_LINE>shaderLanguages.put(Shader.ShaderType.Geometry, ic.readString("geomLanguage", null));<NEW_LINE>shaderLanguages.put(Shader.ShaderType.TessellationControl, ic.readString("tsctrlLanguage", null));<NEW_LINE>shaderLanguages.put(Shader.ShaderType.TessellationEvaluation, ic.readString("tsevalLanguage", null));<NEW_LINE>}<NEW_LINE>usesNodes = ic.readBoolean("usesNodes", false);<NEW_LINE>shaderNodes = ic.readSavableArrayList("shaderNodes", null);<NEW_LINE>shaderGenerationInfo = (ShaderGenerationInfo) ic.readSavable("shaderGenerationInfo", null);<NEW_LINE>} | .readString("vertName", null)); |
461,573 | private int findMatch() {<NEW_LINE>int matched = 0;<NEW_LINE>int bankId = 0;<NEW_LINE>if (account != null) {<NEW_LINE>bankId = account.getC_Bank_ID();<NEW_LINE>}<NEW_LINE>List<MBankStatementMatcher> matchersList = MBankStatementMatcher.getMatchersList(Env.getCtx(), bankId);<NEW_LINE>if (matchersList == null) {<NEW_LINE>return 0;<NEW_LINE>}<NEW_LINE>//<NEW_LINE>for (Map.Entry<Integer, X_I_BankStatement> entry : importedPaymentHashMap.entrySet()) {<NEW_LINE>X_I_BankStatement currentBankStatementImport = entry.getValue();<NEW_LINE>if (currentBankStatementImport.getC_Payment_ID() != 0 || currentBankStatementImport.getC_BPartner_ID() != 0 || currentBankStatementImport.getC_Invoice_ID() != 0) {<NEW_LINE>// put on hash<NEW_LINE>matchedPaymentHashMap.put(entry.getValue().getC_Payment_ID(), currentBankStatementImport);<NEW_LINE>matched++;<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>for (MBankStatementMatcher matcher : matchersList) {<NEW_LINE>if (matcher.isMatcherValid()) {<NEW_LINE>BankStatementMatchInfo info = matcher.getMatcher().findMatch(currentBankStatementImport, currentPaymentHashMap.keySet().stream().collect(Collectors.toList()), matchedPaymentHashMap.keySet().stream().collect(Collectors.toList()));<NEW_LINE>if (info != null && info.isMatched()) {<NEW_LINE>// Duplicate match<NEW_LINE>if (matchedPaymentHashMap.containsKey(info.getC_Payment_ID())) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (info.getC_Payment_ID() > 0) {<NEW_LINE>currentBankStatementImport.setC_Payment_ID(info.getC_Payment_ID());<NEW_LINE>}<NEW_LINE>if (info.getC_Invoice_ID() > 0) {<NEW_LINE>currentBankStatementImport.<MASK><NEW_LINE>}<NEW_LINE>if (info.getC_BPartner_ID() > 0) {<NEW_LINE>currentBankStatementImport.setC_BPartner_ID(info.getC_BPartner_ID());<NEW_LINE>}<NEW_LINE>// put on hash<NEW_LINE>matchedPaymentHashMap.put(entry.getValue().getC_Payment_ID(), currentBankStatementImport);<NEW_LINE>matched++;<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// for all matchers<NEW_LINE>}<NEW_LINE>// Return<NEW_LINE>return matched;<NEW_LINE>} | setC_Invoice_ID(info.getC_Invoice_ID()); |
682,516 | private JavaRDD<Rating> parsedToRatingRDD(JavaRDD<String[]> parsedRDD, Broadcast<? extends Map<String, Integer>> bUserIDToIndex, Broadcast<? extends Map<String, Integer>> bItemIDToIndex) {<NEW_LINE>JavaPairRDD<Long, Rating> timestampRatingRDD = parsedRDD.mapToPair(tokens -> {<NEW_LINE>try {<NEW_LINE>return new Tuple2<>(Long.valueOf(tokens[3]), new // Empty value means 'delete'; propagate as NaN<NEW_LINE>Rating(// Empty value means 'delete'; propagate as NaN<NEW_LINE>bUserIDToIndex.value().get(tokens[0]), // Empty value means 'delete'; propagate as NaN<NEW_LINE>bItemIDToIndex.value().get(tokens[1]), tokens[2].isEmpty() ? Double.NaN : Double.parseDouble(tokens[2])));<NEW_LINE>} catch (NumberFormatException | ArrayIndexOutOfBoundsException e) {<NEW_LINE>log.warn("Bad input: {}", Arrays.toString(tokens));<NEW_LINE>throw e;<NEW_LINE>}<NEW_LINE>});<NEW_LINE>if (decayFactor < 1.0) {<NEW_LINE>double factor = decayFactor;<NEW_LINE>long now = System.currentTimeMillis();<NEW_LINE>timestampRatingRDD = timestampRatingRDD.mapToPair(timestampRating -> {<NEW_LINE><MASK><NEW_LINE>return new Tuple2<>(timestamp, decayRating(timestampRating._2(), timestamp, now, factor));<NEW_LINE>});<NEW_LINE>}<NEW_LINE>if (decayZeroThreshold > 0.0) {<NEW_LINE>double theThreshold = decayZeroThreshold;<NEW_LINE>timestampRatingRDD = timestampRatingRDD.filter(timestampRating -> timestampRating._2().rating() > theThreshold);<NEW_LINE>}<NEW_LINE>return timestampRatingRDD.sortByKey().values();<NEW_LINE>} | long timestamp = timestampRating._1(); |
454,782 | public Vector max(int axis) {<NEW_LINE>// axis = 0: on rows<NEW_LINE>// axis = 1: on cols<NEW_LINE>assert (axis == 0 || axis == 1);<NEW_LINE>float[] rdVec = null;<NEW_LINE>switch(axis) {<NEW_LINE>case // on row<NEW_LINE>0:<NEW_LINE>rdVec = new float[numCols];<NEW_LINE>for (int j = 0; j < numCols; j++) {<NEW_LINE>rdVec[j] = Float.MIN_VALUE;<NEW_LINE>}<NEW_LINE>for (int i = 0; i < numRows; i++) {<NEW_LINE>for (int j = 0; j < numCols; j++) {<NEW_LINE>if (data[i * numCols + j] > rdVec[j]) {<NEW_LINE>rdVec[j] = data[i * numCols + j];<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>case 1:<NEW_LINE>rdVec = new float[numRows];<NEW_LINE>for (int i = 0; i < numRows; i++) {<NEW_LINE>rdVec[i] = Float.MIN_VALUE;<NEW_LINE>}<NEW_LINE>for (int i = 0; i < numRows; i++) {<NEW_LINE>for (int j = 0; j < numCols; j++) {<NEW_LINE>if (data[i * numCols + j] > rdVec[i]) {<NEW_LINE>rdVec[i] = data[i * numCols + j];<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>return VFactory.denseFloatVector(<MASK><NEW_LINE>} | matrixId, 0, clock, rdVec); |
715,273 | public OResult serialize() {<NEW_LINE>OResultInternal result = (OResultInternal) super.serialize();<NEW_LINE>if (target != null) {<NEW_LINE>result.setProperty("target", target.serialize());<NEW_LINE>}<NEW_LINE>if (projection != null) {<NEW_LINE>result.setProperty("projection", projection.serialize());<NEW_LINE>}<NEW_LINE>if (whereClause != null) {<NEW_LINE>result.setProperty("whereClause", whereClause.serialize());<NEW_LINE>}<NEW_LINE>if (groupBy != null) {<NEW_LINE>result.setProperty("groupBy", groupBy.serialize());<NEW_LINE>}<NEW_LINE>if (orderBy != null) {<NEW_LINE>result.setProperty("orderBy", orderBy.serialize());<NEW_LINE>}<NEW_LINE>if (unwind != null) {<NEW_LINE>result.setProperty("unwind", unwind.serialize());<NEW_LINE>}<NEW_LINE>if (skip != null) {<NEW_LINE>result.setProperty("skip", skip.serialize());<NEW_LINE>}<NEW_LINE>if (limit != null) {<NEW_LINE>result.setProperty("limit", limit.serialize());<NEW_LINE>}<NEW_LINE>if (lockRecord != null) {<NEW_LINE>result.setProperty("lockRecord", lockRecord.toString());<NEW_LINE>}<NEW_LINE>if (fetchPlan != null) {<NEW_LINE>result.setProperty("fetchPlan", fetchPlan.serialize());<NEW_LINE>}<NEW_LINE>if (letClause != null) {<NEW_LINE>result.setProperty("letClause", letClause.serialize());<NEW_LINE>}<NEW_LINE>if (timeout != null) {<NEW_LINE>result.setProperty("timeout", timeout.serialize());<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>result.setProperty("noCache", noCache);<NEW_LINE>return result;<NEW_LINE>} | result.setProperty("parallel", parallel); |
628,987 | public void scrutinize(TermedStatementEntityEdit update) {<NEW_LINE>Map<PropertyIdValue, Set<Value>> propertyIdValueValueMap = new HashMap<>();<NEW_LINE>for (Statement statement : update.getAddedStatements()) {<NEW_LINE>PropertyIdValue pid = statement.getClaim()<MASK><NEW_LINE>Value value = null;<NEW_LINE>Snak mainSnak = statement.getClaim().getMainSnak();<NEW_LINE>if (mainSnak instanceof ValueSnak) {<NEW_LINE>value = ((ValueSnak) mainSnak).getValue();<NEW_LINE>}<NEW_LINE>Set<Value> values;<NEW_LINE>if (value != null) {<NEW_LINE>if (propertyIdValueValueMap.containsKey(pid)) {<NEW_LINE>values = propertyIdValueValueMap.get(pid);<NEW_LINE>} else {<NEW_LINE>values = new HashSet<>();<NEW_LINE>}<NEW_LINE>values.add(value);<NEW_LINE>propertyIdValueValueMap.put(pid, values);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>for (PropertyIdValue propertyId : propertyIdValueValueMap.keySet()) {<NEW_LINE>List<Statement> statementList = _fetcher.getConstraintsByType(propertyId, conflictsWithConstraintQid);<NEW_LINE>for (Statement statement : statementList) {<NEW_LINE>ConflictsWithConstraint constraint = new ConflictsWithConstraint(statement);<NEW_LINE>PropertyIdValue conflictingPid = constraint.conflictingPid;<NEW_LINE>List<Value> itemList = constraint.itemList;<NEW_LINE>if (propertyIdValueValueMap.containsKey(conflictingPid) && raiseWarning(propertyIdValueValueMap, conflictingPid, itemList)) {<NEW_LINE>QAWarning issue = new QAWarning(type, propertyId.getId() + conflictingPid.getId(), QAWarning.Severity.WARNING, 1);<NEW_LINE>issue.setProperty("property_entity", propertyId);<NEW_LINE>issue.setProperty("added_property_entity", conflictingPid);<NEW_LINE>issue.setProperty("example_entity", update.getEntityId());<NEW_LINE>addIssue(issue);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | .getMainSnak().getPropertyId(); |
1,076,775 | public static void main(String[] args) {<NEW_LINE>// Collector shortcut methods (toList, toSet, groupingBy, joining, etc.)<NEW_LINE>List<User> users = Arrays.asList(new User("name"), new User(), new User());<NEW_LINE>users.stream().map(User::getName).collect(Collectors.toList());<NEW_LINE>List<String> userNames = StreamEx.of(users).map(User::getName).toList();<NEW_LINE>Map<Role, List<User>> role2users = StreamEx.of(users).groupingBy(User::getRole);<NEW_LINE>// "1; 2; 3"<NEW_LINE>StreamEx.of(1, 2, 3).joining("; ");<NEW_LINE>// Selecting stream elements of specific type<NEW_LINE>List usersAndRoles = Arrays.asList(new User(), new Role());<NEW_LINE>List<Role> roles = IntStreamEx.range(usersAndRoles.size()).mapToObj(usersAndRoles::get).select(Role.class).toList();<NEW_LINE>System.out.println(roles);<NEW_LINE>// adding elements to Stream<NEW_LINE>List<String> appendedUsers = StreamEx.of(users).map(User::getName).prepend("(none)").append("LAST").toList();<NEW_LINE>System.out.println(appendedUsers);<NEW_LINE>// Removing unwanted elements and using the stream as Iterable:<NEW_LINE>for (String line : StreamEx.of(users).map(User::getName).nonNull()) {<NEW_LINE>System.out.println(line);<NEW_LINE>}<NEW_LINE>// Selecting map keys by value predicate:<NEW_LINE>Map<String, Role> nameToRole = new HashMap<>();<NEW_LINE>nameToRole.put("first", new Role());<NEW_LINE>nameToRole.put("second", null);<NEW_LINE>Set<String> nonNullRoles = StreamEx.ofKeys(nameToRole, Objects::nonNull).toSet();<NEW_LINE>System.out.println(nonNullRoles);<NEW_LINE>// Operating on key-value pairs:<NEW_LINE>Map<User, List<Role>> users2roles = transformMap(role2users);<NEW_LINE>Map<String, String> mapToString = EntryStream.of(users2roles).mapKeys(String::valueOf).mapValues(String::valueOf).toMap();<NEW_LINE>// Support of byte/char/short/float types:<NEW_LINE>short[] src = { 1, 2, 3 };<NEW_LINE>char[] output = IntStreamEx.of(src).map(x -> <MASK><NEW_LINE>} | x * 5).toCharArray(); |
1,430,685 | public void internalOpen(String user, String password, OrientDBConfig config) {<NEW_LINE>this.config = config;<NEW_LINE>applyAttributes(config);<NEW_LINE>applyListeners(config);<NEW_LINE>try {<NEW_LINE>storage.open(user, password, config.getConfigurations());<NEW_LINE>status = STATUS.OPEN;<NEW_LINE>initAtFirstOpen();<NEW_LINE>this.user = new // .addRole(new ORole("passthrough", null,<NEW_LINE>OImmutableUser(// .addRole(new ORole("passthrough", null,<NEW_LINE>-1, new OUser(user, password));<NEW_LINE>// ORole.ALLOW_MODES.ALLOW_ALL_BUT)));<NEW_LINE>// WAKE UP LISTENERS<NEW_LINE>callOnOpenListeners();<NEW_LINE>} catch (OException e) {<NEW_LINE>close();<NEW_LINE>ODatabaseRecordThreadLocal.instance().remove();<NEW_LINE>throw e;<NEW_LINE>} catch (Exception e) {<NEW_LINE>close();<NEW_LINE>ODatabaseRecordThreadLocal<MASK><NEW_LINE>throw OException.wrapException(new ODatabaseException("Cannot open database url=" + getURL()), e);<NEW_LINE>}<NEW_LINE>} | .instance().remove(); |
450,879 | public boolean matchesCIDR(InetAddress address) {<NEW_LINE>if (bgp_prefix == null || bgp_prefix.length() == 0) {<NEW_LINE>return (false);<NEW_LINE>}<NEW_LINE>boolean isv4 = address instanceof Inet4Address;<NEW_LINE>if (isv4 != ipv4) {<NEW_LINE>return (false);<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>int pos = bgp_prefix.indexOf('/');<NEW_LINE>InetAddress start = InetAddress.getByName(bgp_prefix.substring(0, pos));<NEW_LINE>int cidr_mask = Integer.parseInt(bgp_prefix.substring(pos + 1));<NEW_LINE>byte[] prefix = start.getAddress();<NEW_LINE>byte[] bytes = address.getAddress();<NEW_LINE>for (int i = 0; i < cidr_mask; i++) {<NEW_LINE>byte mask = (byte) (1 << (7 - (i % 8)));<NEW_LINE>int b1 = prefix[i / 8] & mask;<NEW_LINE>int b2 = <MASK><NEW_LINE>if (b1 != b2) {<NEW_LINE>return (false);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return (true);<NEW_LINE>} catch (Throwable e) {<NEW_LINE>Debug.printStackTrace(e);<NEW_LINE>return (false);<NEW_LINE>}<NEW_LINE>} | bytes[i / 8] & mask; |
1,665,000 | private static EnumMap<Shape, Rational> buildShapeDurations() {<NEW_LINE>EnumMap<Shape, Rational> map = new EnumMap<>(Shape.class);<NEW_LINE>// 4 measures<NEW_LINE>map.put(Shape.LONG_REST, new Rational(4, 1));<NEW_LINE>// 2 measures<NEW_LINE>map.put(Shape.BREVE_REST, new Rational(2, 1));<NEW_LINE>map.put(Shape.BREVE, new Rational(2, 1));<NEW_LINE>// 1 measure, unless partialWholeRests is on<NEW_LINE>map.put(Shape.WHOLE_REST, Rational.ONE);<NEW_LINE>map.put(Shape.WHOLE_NOTE, Rational.ONE);<NEW_LINE>map.put(Shape.HALF_REST, <MASK><NEW_LINE>map.put(Shape.NOTEHEAD_VOID, new Rational(1, 2));<NEW_LINE>map.put(Shape.NOTEHEAD_VOID_SMALL, new Rational(1, 2));<NEW_LINE>map.put(Shape.QUARTER_REST, QUARTER_DURATION);<NEW_LINE>map.put(Shape.NOTEHEAD_CROSS, QUARTER_DURATION);<NEW_LINE>map.put(Shape.NOTEHEAD_BLACK, QUARTER_DURATION);<NEW_LINE>map.put(Shape.NOTEHEAD_BLACK_SMALL, QUARTER_DURATION);<NEW_LINE>map.put(Shape.EIGHTH_REST, new Rational(1, 8));<NEW_LINE>map.put(Shape.ONE_16TH_REST, new Rational(1, 16));<NEW_LINE>map.put(Shape.ONE_32ND_REST, new Rational(1, 32));<NEW_LINE>map.put(Shape.ONE_64TH_REST, new Rational(1, 64));<NEW_LINE>map.put(Shape.ONE_128TH_REST, new Rational(1, 128));<NEW_LINE>return map;<NEW_LINE>} | new Rational(1, 2)); |
1,200,767 | protected void encodeControls(FacesContext context, OrderList ol) throws IOException {<NEW_LINE>ResponseWriter writer = context.getResponseWriter();<NEW_LINE>writer.startElement("div", null);<NEW_LINE>writer.writeAttribute("class", OrderList.CONTROLS_CLASS, null);<NEW_LINE>encodeButton(context, ol.getMoveUpLabel(), <MASK><NEW_LINE>encodeButton(context, ol.getMoveTopLabel(), OrderList.MOVE_TOP_BUTTON_CLASS, OrderList.MOVE_TOP_BUTTON_ICON_CLASS);<NEW_LINE>encodeButton(context, ol.getMoveDownLabel(), OrderList.MOVE_DOWN_BUTTON_CLASS, OrderList.MOVE_DOWN_BUTTON_ICON_CLASS);<NEW_LINE>encodeButton(context, ol.getMoveBottomLabel(), OrderList.MOVE_BOTTOM_BUTTON_CLASS, OrderList.MOVE_BOTTOM_BUTTON_ICON_CLASS);<NEW_LINE>writer.endElement("div");<NEW_LINE>} | OrderList.MOVE_UP_BUTTON_CLASS, OrderList.MOVE_UP_BUTTON_ICON_CLASS); |
499,634 | public boolean addDef(String sec, String key, String value) {<NEW_LINE>Assertion ast = new Assertion();<NEW_LINE>ast.key = key;<NEW_LINE>ast.value = value;<NEW_LINE>ast.initPriorityIndex();<NEW_LINE>if (ast.value.equals("")) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>if (sec.equals("r") || sec.equals("p")) {<NEW_LINE>ast.tokens = splitCommaDelimited(ast.value);<NEW_LINE>for (int i = 0; i < ast.tokens.length; i++) {<NEW_LINE>ast.tokens[i] = key + "_" + ast.tokens[i];<NEW_LINE>if ("p_priority".equals(ast.tokens[i])) {<NEW_LINE>ast.priorityIndex = i;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>ast.value = Util.removeComments(Util<MASK><NEW_LINE>}<NEW_LINE>if (!model.containsKey(sec)) {<NEW_LINE>model.put(sec, new HashMap<>());<NEW_LINE>}<NEW_LINE>model.get(sec).put(key, ast);<NEW_LINE>modCount++;<NEW_LINE>return true;<NEW_LINE>} | .escapeAssertion(ast.value)); |
1,613,065 | final CreateCachediSCSIVolumeResult executeCreateCachediSCSIVolume(CreateCachediSCSIVolumeRequest createCachediSCSIVolumeRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(createCachediSCSIVolumeRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<CreateCachediSCSIVolumeRequest> request = null;<NEW_LINE>Response<CreateCachediSCSIVolumeResult> response = null;<NEW_LINE>try {<NEW_LINE><MASK><NEW_LINE>try {<NEW_LINE>request = new CreateCachediSCSIVolumeRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(createCachediSCSIVolumeRequest));<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, "Storage Gateway");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "CreateCachediSCSIVolume");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<CreateCachediSCSIVolumeResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new CreateCachediSCSIVolumeResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | awsRequestMetrics.startEvent(Field.RequestMarshallTime); |
1,163,170 | public void show(boolean restoreBounds) {<NEW_LINE>myFocusedCallback = AsyncResult.undefined();<NEW_LINE>if (myProject != null) {<NEW_LINE>IdeFocusManager.getInstance(myProject).typeAheadUntil(myFocusedCallback);<NEW_LINE>}<NEW_LINE>final Window frame = getFrame();<NEW_LINE>if (myStatusBar != null) {<NEW_LINE>consulo.ui.Window uiWindow = TargetAWT.from(frame);<NEW_LINE>IdeFrame ideFrame = uiWindow.getUserData(IdeFrame.KEY);<NEW_LINE>myStatusBar.install(ideFrame);<NEW_LINE>}<NEW_LINE>if (frame instanceof JFrame) {<NEW_LINE>((JFrame) frame).setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);<NEW_LINE>} else {<NEW_LINE>((JDialog) frame).setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);<NEW_LINE>}<NEW_LINE>SwingUIDecorator.apply(SwingUIDecorator::decorateWindowTitle, ((RootPaneContainer) frame).getRootPane());<NEW_LINE>final WindowAdapter focusListener = new WindowAdapter() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void windowOpened(WindowEvent e) {<NEW_LINE>IdeFocusManager fm = IdeFocusManager.getInstance(myProject);<NEW_LINE>JComponent toFocus = getPreferredFocusedComponent();<NEW_LINE>if (toFocus == null) {<NEW_LINE>toFocus = fm.getFocusTargetFor(myComponent);<NEW_LINE>}<NEW_LINE>if (toFocus != null) {<NEW_LINE>fm.requestFocus(toFocus, true).notify(myFocusedCallback);<NEW_LINE>} else {<NEW_LINE>myFocusedCallback.setRejected();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>};<NEW_LINE>frame.addWindowListener(focusListener);<NEW_LINE>if (ModalityPerProjectEAPDescriptor.is()) {<NEW_LINE>frame.setAlwaysOnTop(true);<NEW_LINE>}<NEW_LINE>Disposer.register(this, () -> frame.removeWindowListener(focusListener));<NEW_LINE>if (myCloseOnEsc)<NEW_LINE>addCloseOnEsc((RootPaneContainer) frame);<NEW_LINE>((RootPaneContainer) frame).getContentPane().add(myComponent, BorderLayout.CENTER);<NEW_LINE>if (frame instanceof JFrame) {<NEW_LINE>((JFrame<MASK><NEW_LINE>} else {<NEW_LINE>((JDialog) frame).setTitle(myTitle);<NEW_LINE>}<NEW_LINE>if (myImages != null) {<NEW_LINE>// unwrap the image before setting as frame's icon<NEW_LINE>frame.setIconImages(ContainerUtil.map(myImages, ImageUtil::toBufferedImage));<NEW_LINE>} else {<NEW_LINE>AppUIUtil.updateWindowIcon(myFrame);<NEW_LINE>}<NEW_LINE>WindowState state = myDimensionKey == null ? null : getWindowStateService(myProject).getState(myDimensionKey, frame);<NEW_LINE>if (restoreBounds) {<NEW_LINE>loadFrameState(state);<NEW_LINE>}<NEW_LINE>myFocusWatcher = new FocusWatcher();<NEW_LINE>myFocusWatcher.install(myComponent);<NEW_LINE>myShown = true;<NEW_LINE>frame.setVisible(true);<NEW_LINE>} | ) frame).setTitle(myTitle); |
1,849,291 | public Node call() {<NEW_LINE>// throws AnyException<NEW_LINE>Node node;<NEW_LINE>Map<String, Object> <MASK><NEW_LINE>String cypher = buildCypher(st.getObject().stringValue(), st.getContext() != null ? st.getContext().stringValue() : null, params);<NEW_LINE>Result result = txInThread.execute(cypher, params);<NEW_LINE>if (result.hasNext()) {<NEW_LINE>node = (Node) result.next().get("n");<NEW_LINE>if (result.hasNext()) {<NEW_LINE>String props = "{uri: " + st.getObject().stringValue() + (st.getContext() == null ? "}" : ", graphUri: " + st.getContext().stringValue() + "}");<NEW_LINE>throw new IllegalStateException("There are multiple matching nodes for the given properties " + props);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>throw new NoSuchElementException("There exists no node with \"uri\": " + st.getSubject().stringValue() + " and \"graphUri\": " + st.getContext().stringValue());<NEW_LINE>}<NEW_LINE>return node;<NEW_LINE>} | params = new HashMap<>(); |
1,510,734 | public void run() throws Exception {<NEW_LINE>listing = currentProgram.getListing();<NEW_LINE>memory = currentProgram.getMemory();<NEW_LINE>symbolTable = currentProgram.getSymbolTable();<NEW_LINE>int size = currentProgram.getMinAddress().getSize();<NEW_LINE>if (size != 32) {<NEW_LINE>popup("This script only works on 32-bit programs");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>monitor.setMessage("Labeling direct references to functions");<NEW_LINE>List<Function> funcSet = new ArrayList<>();<NEW_LINE>List<Address> resultSet = new ArrayList<>();<NEW_LINE>List<Address> refs = new ArrayList<>();<NEW_LINE>FunctionIterator <MASK><NEW_LINE>while (funcIter.hasNext() && !monitor.isCancelled()) {<NEW_LINE>funcSet.add(funcIter.next());<NEW_LINE>}<NEW_LINE>if (funcSet.size() == 0) {<NEW_LINE>popup("No functions found. Try analyzing code first.");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>for (int i = 0; i < funcSet.size(); i++) {<NEW_LINE>Function func = funcSet.get(i);<NEW_LINE>refs = findRefs(func.getEntryPoint(), monitor);<NEW_LINE>for (int j = 0; j < refs.size(); j++) {<NEW_LINE>Data data = getDataAt(refs.get(j));<NEW_LINE>// if((data != null) && data.isDefined() && ((data.getBaseDataType().getName() == "dword") || (data.getBaseDataType().getName() == "pointer32"))){<NEW_LINE>if ((data != null) && data.isDefined() && (("dword".equals(data.getBaseDataType().getName())) || (data.isPointer()))) {<NEW_LINE>resultSet.add(refs.get(j));<NEW_LINE>String newLabel = "ptr_" + func.getName(false) + "_" + refs.get(j).toString();<NEW_LINE>println(newLabel);<NEW_LINE>Symbol sym = symbolTable.createLabel(refs.get(j), newLabel, SourceType.ANALYSIS);<NEW_LINE>if (!sym.isPrimary()) {<NEW_LINE>sym.setPrimary();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | funcIter = listing.getFunctions(true); |
949,219 | public void applyInline(double[] data, int pos, int len) {<NEW_LINE>int k;<NEW_LINE>assert pos == 0;<NEW_LINE>assert len == data.length;<NEW_LINE>tmpCount++;<NEW_LINE>if (len > fftSize)<NEW_LINE>len = fftSize;<NEW_LINE>if (len < fftSize) {<NEW_LINE>double[] data2 = new double[fftSize];<NEW_LINE>System.arraycopy(data, 0, data2, 0, data.length);<NEW_LINE>Arrays.fill(data2, data.length, data2.length - 1, 0);<NEW_LINE>data = new double[data2.length];<NEW_LINE>System.arraycopy(data2, 0, data, 0, data2.length);<NEW_LINE>}<NEW_LINE>double origAvgEnergy = SignalProcUtils.getAverageSampleEnergy(data);<NEW_LINE>// Compute LPC coefficients<NEW_LINE>LpCoeffs coeffs = LpcAnalyser.calcLPC(data, p);<NEW_LINE>double sqrtGain = coeffs.getGain();<NEW_LINE>System.arraycopy(data, 0, h.real, 0, Math.min(len, h.real.length));<NEW_LINE>if (h.real.length > len)<NEW_LINE>Arrays.fill(h.real, h.real.length - len, h.real.length - 1, 0);<NEW_LINE>Arrays.fill(h.imag, 0, h.imag.length - 1, 0);<NEW_LINE>// Convert to polar coordinates in frequency domain<NEW_LINE>// h = FFTMixedRadix.fftComplexArray(h);<NEW_LINE>FFT.transform(h.real, h.imag, false);<NEW_LINE>vtSpectrum = LpcAnalyser.calcSpecLinear(coeffs.getA(), p, fftSize, expTerm);<NEW_LINE>for (k = 0; k < maxFreq; k++) vtSpectrum[k] *= sqrtGain;<NEW_LINE>// Filter out vocal tract to obtain residual spectrum<NEW_LINE>for (k = 0; k < maxFreq; k++) {<NEW_LINE>h.real[k] /= vtSpectrum[k];<NEW_LINE>h.imag[k] /= vtSpectrum[k];<NEW_LINE>}<NEW_LINE>if (!bAnalysisOnly) {<NEW_LINE>// Process vocal tract spectrum<NEW_LINE>processSpectrum(vtSpectrum);<NEW_LINE>// Apply modified vocal tract filter on the residual spectrum<NEW_LINE>for (k = 0; k < maxFreq; k++) {<NEW_LINE>h.real[k] *= vtSpectrum[k];<NEW_LINE>h.imag<MASK><NEW_LINE>}<NEW_LINE>// Generate the complex conjugate part to make the output the DFT of a real-valued signal<NEW_LINE>for (k = maxFreq; k < fftSize; k++) {<NEW_LINE>h.real[k] = h.real[2 * maxFreq - k];<NEW_LINE>h.imag[k] = -1 * h.imag[2 * maxFreq - k];<NEW_LINE>}<NEW_LINE>//<NEW_LINE>// h = FFTMixedRadix.ifft(h);<NEW_LINE>FFT.transform(h.real, h.imag, true);<NEW_LINE>double newAvgEnergy = SignalProcUtils.getAverageSampleEnergy(h.real, len);<NEW_LINE>double scale = origAvgEnergy / newAvgEnergy;<NEW_LINE>for (k = 0; k < len; k++) h.real[k] *= scale;<NEW_LINE>System.arraycopy(h.real, 0, data, 0, len);<NEW_LINE>}<NEW_LINE>} | [k] *= vtSpectrum[k]; |
710,896 | final DeleteTableResult executeDeleteTable(DeleteTableRequest deleteTableRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(deleteTableRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DeleteTableRequest> request = null;<NEW_LINE>Response<DeleteTableResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DeleteTableRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(deleteTableRequest));<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, "DynamoDB");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DeleteTable");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>URI cachedEndpoint = null;<NEW_LINE>if (endpointDiscoveryEnabled) {<NEW_LINE>cachedEndpoint = cache.get(awsCredentialsProvider.getCredentials().getAWSAccessKeyId(), false, endpoint);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DeleteTableResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DeleteTableResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext, cachedEndpoint, null);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>} | endClientExecution(awsRequestMetrics, request, response); |
698,483 | public KrollPromise<TiResultSetProxy> executeAsync(final String query, final Object... parameterObjects) {<NEW_LINE>// Validate `query` parameter.<NEW_LINE>if (query == null) {<NEW_LINE>throw new InvalidParameterException("'query' parameter is required");<NEW_LINE>}<NEW_LINE>KrollFunction possibleCallback = null;<NEW_LINE>Object[] possibleParameters = parameterObjects;<NEW_LINE>if (parameterObjects != null && parameterObjects.length > 0) {<NEW_LINE>// check for callback<NEW_LINE>// Last parameter MUST be the callback function.<NEW_LINE>final Object lastParameter = parameterObjects[parameterObjects.length - 1];<NEW_LINE>if (lastParameter instanceof KrollFunction) {<NEW_LINE>possibleCallback = (KrollFunction) lastParameter;<NEW_LINE>// Reconstruct parameters array without `callback` element.<NEW_LINE>possibleParameters = new Object[parameterObjects.length - 1];<NEW_LINE>System.arraycopy(parameterObjects, 0, possibleParameters, <MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>final KrollFunction callback = possibleCallback;<NEW_LINE>final Object[] parameters = possibleParameters;<NEW_LINE>final KrollObject callbackThisObject = getKrollObject();<NEW_LINE>return KrollPromise.create((promise) -> {<NEW_LINE>executingQueue.set(true);<NEW_LINE>try {<NEW_LINE>queue.put(new Runnable() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void run() {<NEW_LINE>TiResultSetProxy result = null;<NEW_LINE>try {<NEW_LINE>result = executeSQL(query, parameters);<NEW_LINE>} catch (Throwable t) {<NEW_LINE>if (callback != null) {<NEW_LINE>callback.callAsync(callbackThisObject, new Object[] { t });<NEW_LINE>}<NEW_LINE>promise.reject(t);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (callback != null) {<NEW_LINE>callback.callAsync(callbackThisObject, new Object[] { null, result });<NEW_LINE>}<NEW_LINE>promise.resolve(result);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} catch (InterruptedException e) {<NEW_LINE>promise.reject(e);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} | 0, parameterObjects.length - 1); |
469,482 | private void chooseDirectory() {<NEW_LINE>FileChooserDescriptor descriptor = new FileChooserDescriptor(false, true, false, false, false, false) {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public boolean isFileSelectable(VirtualFile file) {<NEW_LINE>// Default implementation doesn't filter directories,<NEW_LINE>// we want to make sure only workspace roots are selectable<NEW_LINE>return super.isFileSelectable(file) && isWorkspaceRoot(file);<NEW_LINE>}<NEW_LINE>}.withHideIgnored(false).withTitle("Select Workspace Root").withDescription("Select the directory of the workspace you want to use.").withFileFilter(UseExistingBazelWorkspaceOption::isWorkspaceRoot);<NEW_LINE>// File filters are broken for the native Mac file chooser.<NEW_LINE>descriptor.setForcedToUseIdeaFileChooser(true);<NEW_LINE>FileChooserDialog chooser = FileChooserFactory.getInstance().<MASK><NEW_LINE>final VirtualFile[] files;<NEW_LINE>File existingLocation = new File(getDirectory());<NEW_LINE>if (existingLocation.exists()) {<NEW_LINE>VirtualFile toSelect = LocalFileSystem.getInstance().refreshAndFindFileByPath(existingLocation.getPath());<NEW_LINE>files = chooser.choose(null, toSelect);<NEW_LINE>} else {<NEW_LINE>files = chooser.choose(null);<NEW_LINE>}<NEW_LINE>if (files.length == 0) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>VirtualFile file = files[0];<NEW_LINE>directoryField.setText(file.getPath());<NEW_LINE>} | createFileChooser(descriptor, null, null); |
144,900 | private void writeNamespacesToZip(Stream<ConfigBO> configBOStream, ZipOutputStream zipOutputStream) {<NEW_LINE>final Consumer<ConfigBO> configBOConsumer = configBO -> {<NEW_LINE>try {<NEW_LINE>synchronized (zipOutputStream) {<NEW_LINE>String appId = configBO.getAppId();<NEW_LINE>String clusterName = configBO.getClusterName();<NEW_LINE>String namespace = configBO.getNamespace();<NEW_LINE><MASK><NEW_LINE>ConfigFileFormat configFileFormat = configBO.getFormat();<NEW_LINE>String configFileName = ConfigFileUtils.toFilename(appId, clusterName, namespace, configFileFormat);<NEW_LINE>String filePath = ConfigFileUtils.genNamespacePath(configBO.getOwnerName(), appId, configBO.getEnv(), configFileName);<NEW_LINE>writeToZip(filePath, configFileContent, zipOutputStream);<NEW_LINE>}<NEW_LINE>} catch (IOException e) {<NEW_LINE>logger.error("Write error. {}", configBO);<NEW_LINE>throw new ServiceException("Write namespace error. {}", e);<NEW_LINE>}<NEW_LINE>};<NEW_LINE>configBOStream.forEach(configBOConsumer);<NEW_LINE>} | String configFileContent = configBO.getConfigFileContent(); |
1,729,461 | protected RequestBody finalizeData() {<NEW_LINE>final Member self = guild.getSelfMember();<NEW_LINE>final boolean isOwner = self.isOwner();<NEW_LINE>if (!isOwner) {<NEW_LINE>if (self.getRoles().isEmpty())<NEW_LINE>throw new IllegalStateException("Cannot move roles above your highest role unless you are the guild owner");<NEW_LINE>if (!self.hasPermission(Permission.MANAGE_ROLES))<NEW_LINE>throw new InsufficientPermissionException(guild, Permission.MANAGE_ROLES);<NEW_LINE>}<NEW_LINE>DataArray array = DataArray.empty();<NEW_LINE>List<Role> ordering <MASK><NEW_LINE>// If not in normal discord order, reverse.<NEW_LINE>// Normal order is descending, not ascending.<NEW_LINE>if (ascendingOrder)<NEW_LINE>Collections.reverse(ordering);<NEW_LINE>for (int i = 0; i < ordering.size(); i++) {<NEW_LINE>Role role = ordering.get(i);<NEW_LINE>final int initialPos = role.getPosition();<NEW_LINE>if (initialPos != i && !isOwner && !self.canInteract(role))<NEW_LINE>// If the current role was moved, we are not owner and we can't interact with the role then throw a PermissionException<NEW_LINE>throw new IllegalStateException("Cannot change order: One of the roles could not be moved due to hierarchical power!");<NEW_LINE>array.add(// plus 1 because position 0 is the @everyone position.<NEW_LINE>DataObject.empty().put("id", role.getId()).// plus 1 because position 0 is the @everyone position.<NEW_LINE>put(// plus 1 because position 0 is the @everyone position.<NEW_LINE>"position", i + 1));<NEW_LINE>}<NEW_LINE>return getRequestBody(array);<NEW_LINE>} | = new ArrayList<>(orderList); |
893,677 | private static void printCodePoints(Appendable out, CharSequence text, EscapeMode mode) throws IOException {<NEW_LINE>int len = text.length();<NEW_LINE>for (int i = 0; i < len; i++) {<NEW_LINE>int c = text.charAt(i);<NEW_LINE>if (isHighSurrogate(c)) {<NEW_LINE>i++;<NEW_LINE>char c2;<NEW_LINE>// I apologize for the embedded assignment, but the alternative<NEW_LINE>// was worse.<NEW_LINE>if (i >= len || !isLowSurrogate(c2 = text.charAt(i))) {<NEW_LINE>String message = "text is invalid UTF-16. It contains an unmatched " + "high surrogate 0x" + Integer.<MASK><NEW_LINE>throw new IllegalArgumentException(message);<NEW_LINE>}<NEW_LINE>c = makeUnicodeScalar(c, c2);<NEW_LINE>} else if (isLowSurrogate(c)) {<NEW_LINE>String message = "text is invalid UTF-16. It contains an unmatched " + "low surrogate 0x" + Integer.toHexString(c) + " at index " + i;<NEW_LINE>throw new IllegalArgumentException(message);<NEW_LINE>}<NEW_LINE>printCodePoint(out, c, mode);<NEW_LINE>}<NEW_LINE>} | toHexString(c) + " at index " + i; |
632,989 | private void onRefreshButton() {<NEW_LINE>if (context == null || context.getRoots().isEmpty()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (executeStatusSupport != null) {<NEW_LINE>executeStatusSupport.cancel();<NEW_LINE>executeStatusSupport = null;<NEW_LINE>}<NEW_LINE>if (refreshSetupsSupport != null) {<NEW_LINE>refreshSetupsSupport.cancel();<NEW_LINE>}<NEW_LINE>LifecycleManager.getDefault().saveAll();<NEW_LINE>RequestProcessor rp = Subversion.getInstance().getRequestProcessor();<NEW_LINE>final <MASK><NEW_LINE>SvnProgressSupport supp = new SvnProgressSupport() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void perform() {<NEW_LINE>if (currentType != -1) {<NEW_LINE>StatusAction.executeStatus(context, this, contactServer);<NEW_LINE>}<NEW_LINE>if (!isCanceled()) {<NEW_LINE>refreshSetups();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>};<NEW_LINE>SVNUrl url;<NEW_LINE>try {<NEW_LINE>url = ContextAction.getSvnUrl(context);<NEW_LINE>} catch (SVNClientException ex) {<NEW_LINE>SvnClientExceptionHandler.notifyException(ex, true, true);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>supp.start(rp, url, NbBundle.getMessage(MultiDiffPanel.class, "MSG_Refresh_Progress"));<NEW_LINE>executeStatusSupport = supp;<NEW_LINE>} | boolean contactServer = currentType != Setup.DIFFTYPE_LOCAL; |
1,840,054 | protected String bindToFields(final OHttpRequest iRequest, final Map<String, String> iFields, final ORecordId iRid) throws Exception {<NEW_LINE>if (iRequest.getContent() == null)<NEW_LINE>throw new IllegalArgumentException("HTTP Request content is empty");<NEW_LINE>final String req = iRequest.getContent();<NEW_LINE>// PARSE PARAMETERS<NEW_LINE>String className = null;<NEW_LINE>final String[] <MASK><NEW_LINE>String value;<NEW_LINE>for (String p : params) {<NEW_LINE>if (OStringSerializerHelper.contains(p, '=')) {<NEW_LINE>String[] pairs = p.split("=");<NEW_LINE>value = pairs.length == 1 ? null : pairs[1];<NEW_LINE>if ("0".equals(pairs[0]) && iRid != null)<NEW_LINE>iRid.fromString(value);<NEW_LINE>else if ("1".equals(pairs[0]))<NEW_LINE>className = value;<NEW_LINE>else if (pairs[0].startsWith("_") || pairs[0].equals("id"))<NEW_LINE>continue;<NEW_LINE>else if (iFields != null) {<NEW_LINE>iFields.put(pairs[0], value);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return className;<NEW_LINE>} | params = req.split("&"); |
1,601,217 | private static void initRocksDbSettings(Config config) {<NEW_LINE>String prefix = Constant.STORAGE_DB_SETTING;<NEW_LINE>int levelNumber = config.hasPath(prefix + "levelNumber") ? config.getInt(prefix + "levelNumber") : 7;<NEW_LINE>int compactThreads = config.hasPath(prefix + "compactThreads") ? config.getInt(prefix + "compactThreads") : max(Runtime.getRuntime().availableProcessors(), 1);<NEW_LINE>int blocksize = config.hasPath(prefix + "blocksize") ? config.getInt(prefix + "blocksize") : 16;<NEW_LINE>long maxBytesForLevelBase = config.hasPath(prefix + "maxBytesForLevelBase") ? config.getInt(prefix + "maxBytesForLevelBase") : 256;<NEW_LINE>double maxBytesForLevelMultiplier = config.hasPath(prefix + "maxBytesForLevelMultiplier") ? config.getDouble(prefix + "maxBytesForLevelMultiplier") : 10;<NEW_LINE>int level0FileNumCompactionTrigger = config.hasPath(prefix + "level0FileNumCompactionTrigger") ? config.getInt(prefix + "level0FileNumCompactionTrigger") : 2;<NEW_LINE>long targetFileSizeBase = config.hasPath(prefix + "targetFileSizeBase") ? config.<MASK><NEW_LINE>int targetFileSizeMultiplier = config.hasPath(prefix + "targetFileSizeMultiplier") ? config.getInt(prefix + "targetFileSizeMultiplier") : 1;<NEW_LINE>PARAMETER.rocksDBCustomSettings = RocksDbSettings.initCustomSettings(levelNumber, compactThreads, blocksize, maxBytesForLevelBase, maxBytesForLevelMultiplier, level0FileNumCompactionTrigger, targetFileSizeBase, targetFileSizeMultiplier);<NEW_LINE>RocksDbSettings.loggingSettings();<NEW_LINE>} | getLong(prefix + "targetFileSizeBase") : 64; |
1,819,727 | public static ListRdsDBInstancesResponse unmarshall(ListRdsDBInstancesResponse listRdsDBInstancesResponse, UnmarshallerContext _ctx) {<NEW_LINE>listRdsDBInstancesResponse.setRequestId(_ctx.stringValue("ListRdsDBInstancesResponse.RequestId"));<NEW_LINE>listRdsDBInstancesResponse.setTotalCount(_ctx.integerValue("ListRdsDBInstancesResponse.TotalCount"));<NEW_LINE>listRdsDBInstancesResponse.setSuccess(_ctx.stringValue("ListRdsDBInstancesResponse.Success"));<NEW_LINE>List<DBInstance> rdsInstances = new ArrayList<DBInstance>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("ListRdsDBInstancesResponse.RdsInstances.Length"); i++) {<NEW_LINE>DBInstance dBInstance = new DBInstance();<NEW_LINE>dBInstance.setDBInstanceId(_ctx.stringValue("ListRdsDBInstancesResponse.RdsInstances[" + i + "].DBInstanceId"));<NEW_LINE>dBInstance.setDBInstanceDescription(_ctx.stringValue<MASK><NEW_LINE>dBInstance.setRegionId(_ctx.stringValue("ListRdsDBInstancesResponse.RdsInstances[" + i + "].RegionId"));<NEW_LINE>dBInstance.setDBInstanceType(_ctx.stringValue("ListRdsDBInstancesResponse.RdsInstances[" + i + "].DBInstanceType"));<NEW_LINE>dBInstance.setDBInstanceStatus(_ctx.stringValue("ListRdsDBInstancesResponse.RdsInstances[" + i + "].DBInstanceStatus"));<NEW_LINE>dBInstance.setEngine(_ctx.stringValue("ListRdsDBInstancesResponse.RdsInstances[" + i + "].Engine"));<NEW_LINE>dBInstance.setEngineVersion(_ctx.stringValue("ListRdsDBInstancesResponse.RdsInstances[" + i + "].EngineVersion"));<NEW_LINE>dBInstance.setDBInstanceNetType(_ctx.stringValue("ListRdsDBInstancesResponse.RdsInstances[" + i + "].DBInstanceNetType"));<NEW_LINE>dBInstance.setLockMode(_ctx.stringValue("ListRdsDBInstancesResponse.RdsInstances[" + i + "].LockMode"));<NEW_LINE>dBInstance.setInstanceNetworkType(_ctx.stringValue("ListRdsDBInstancesResponse.RdsInstances[" + i + "].InstanceNetworkType"));<NEW_LINE>dBInstance.setVpcCloudInstanceId(_ctx.stringValue("ListRdsDBInstancesResponse.RdsInstances[" + i + "].VpcCloudInstanceId"));<NEW_LINE>dBInstance.setVpcId(_ctx.stringValue("ListRdsDBInstancesResponse.RdsInstances[" + i + "].VpcId"));<NEW_LINE>dBInstance.setVSwitchId(_ctx.stringValue("ListRdsDBInstancesResponse.RdsInstances[" + i + "].VSwitchId"));<NEW_LINE>dBInstance.setZoneId(_ctx.stringValue("ListRdsDBInstancesResponse.RdsInstances[" + i + "].ZoneId"));<NEW_LINE>dBInstance.setMutriORsignle(_ctx.booleanValue("ListRdsDBInstancesResponse.RdsInstances[" + i + "].MutriORsignle"));<NEW_LINE>dBInstance.setResourceGroupId(_ctx.stringValue("ListRdsDBInstancesResponse.RdsInstances[" + i + "].ResourceGroupId"));<NEW_LINE>rdsInstances.add(dBInstance);<NEW_LINE>}<NEW_LINE>listRdsDBInstancesResponse.setRdsInstances(rdsInstances);<NEW_LINE>return listRdsDBInstancesResponse;<NEW_LINE>} | ("ListRdsDBInstancesResponse.RdsInstances[" + i + "].DBInstanceDescription")); |
688,913 | public void actionPerformed(ActionEvent e) {<NEW_LINE>SwingUtilities.invokeLater(() -> {<NEW_LINE>if (r.frame == null) {<NEW_LINE>JFrame top = (JFrame) SwingUtilities.getWindowAncestor((Component) PMS.get().getFrame());<NEW_LINE>// We're using JFrame instead of JDialog here so as to<NEW_LINE>// have a minimize button. Since the player panel<NEW_LINE>// is intrinsically a freestanding module this approach<NEW_LINE>// seems valid to me but some frown on it: see<NEW_LINE>// http://stackoverflow.com/questions/9554636/the-use-of-multiple-jframes-good-bad-practice<NEW_LINE>r.frame = new JFrame();<NEW_LINE>r.rendererPanel = new RendererPanel(renderer);<NEW_LINE>r.frame.add(r.rendererPanel);<NEW_LINE>r.rendererPanel.update();<NEW_LINE>r.frame.setResizable(false);<NEW_LINE>r.frame.setIconImage(((JFrame) PMS.get().getFrame()).getIconImage());<NEW_LINE><MASK><NEW_LINE>r.frame.setVisible(true);<NEW_LINE>} else {<NEW_LINE>r.frame.setExtendedState(JFrame.NORMAL);<NEW_LINE>r.frame.setVisible(true);<NEW_LINE>r.frame.toFront();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} | r.frame.setLocationRelativeTo(top); |
833,202 | protected VirtualFile findLocalFile(@NotNull final String uri) {<NEW_LINE>// Get the workspace directory name provided by the test harness.<NEW_LINE>final String workspaceDirName = connector.getWorkspaceDirName();<NEW_LINE>// Verify the returned workspace directory name, we weren't passed a workspace name or if the valid workspace name does not start the<NEW_LINE>// uri then return the super invocation of this method. This prevents the unknown URI type from being passed to the analysis server.<NEW_LINE>if (StringUtils.isEmpty(workspaceDirName) || !uri.startsWith(workspaceDirName + ":/"))<NEW_LINE>return super.findLocalFile(uri);<NEW_LINE>final String pathFromWorkspace = uri.substring(workspaceDirName.length() + 1);<NEW_LINE>// For each root in each module, look for a bazel workspace path, if found attempt to compute the VirtualFile, return when found.<NEW_LINE>return ApplicationManager.getApplication().runReadAction((Computable<VirtualFile>) () -> {<NEW_LINE>for (Module module : DartSdkLibUtil.getModulesWithDartSdkEnabled(getProject())) {<NEW_LINE>for (ContentEntry contentEntry : ModuleRootManager.getInstance(module).getContentEntries()) {<NEW_LINE>final VirtualFile includedRoot = contentEntry.getFile();<NEW_LINE>if (includedRoot == null)<NEW_LINE>continue;<NEW_LINE>final String includedRootPath = includedRoot.getPath();<NEW_LINE>final int workspaceOffset = includedRootPath.indexOf(workspaceDirName);<NEW_LINE>if (workspaceOffset == -1)<NEW_LINE>continue;<NEW_LINE>final String pathToWorkspace = includedRootPath.substring(0, <MASK><NEW_LINE>final VirtualFile virtualFile = LocalFileSystem.getInstance().findFileByPath(pathToWorkspace + pathFromWorkspace);<NEW_LINE>if (virtualFile != null) {<NEW_LINE>return virtualFile;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return super.findLocalFile(uri);<NEW_LINE>});<NEW_LINE>} | workspaceOffset + workspaceDirName.length()); |
1,777,019 | private void loadNode927() {<NEW_LINE>BaseDataVariableTypeNode node = new BaseDataVariableTypeNode(this.context, Identifiers.ServerDiagnosticsType_ServerDiagnosticsSummary_SecurityRejectedSessionCount, new QualifiedName(0, "SecurityRejectedSessionCount"), new LocalizedText("en", "SecurityRejectedSessionCount"), LocalizedText.NULL_VALUE, UInteger.valueOf(0), UInteger.valueOf(0), new DataValue(Variant.NULL_VALUE), Identifiers.UInt32, -1, new UInteger[] {}, UByte.valueOf(1), UByte.valueOf(1), 0.0, false);<NEW_LINE>node.addReference(new Reference(Identifiers.ServerDiagnosticsType_ServerDiagnosticsSummary_SecurityRejectedSessionCount, Identifiers.HasTypeDefinition, Identifiers.BaseDataVariableType<MASK><NEW_LINE>node.addReference(new Reference(Identifiers.ServerDiagnosticsType_ServerDiagnosticsSummary_SecurityRejectedSessionCount, Identifiers.HasModellingRule, Identifiers.ModellingRule_Mandatory.expanded(), true));<NEW_LINE>node.addReference(new Reference(Identifiers.ServerDiagnosticsType_ServerDiagnosticsSummary_SecurityRejectedSessionCount, Identifiers.HasComponent, Identifiers.ServerDiagnosticsType_ServerDiagnosticsSummary.expanded(), false));<NEW_LINE>this.nodeManager.addNode(node);<NEW_LINE>} | .expanded(), true)); |
980,091 | public void processResponse(APIResponse response) {<NEW_LINE>if (response.getRef() != null) {<NEW_LINE>processReferenceResponse(response);<NEW_LINE>}<NEW_LINE>Schema schema = null;<NEW_LINE>if (response.getContent() != null) {<NEW_LINE>Map<String, MediaType> content = response.getContent();<NEW_LINE>for (String mediaName : content.keySet()) {<NEW_LINE>MediaType mediaType = content.get(mediaName);<NEW_LINE>if (mediaType.getSchema() != null) {<NEW_LINE>schema = mediaType.getSchema();<NEW_LINE>if (schema != null) {<NEW_LINE>schemaProcessor.processSchema(schema);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (response.getHeaders() != null) {<NEW_LINE>Map<String, Header> headers = response.getHeaders();<NEW_LINE>for (String headerName : headers.keySet()) {<NEW_LINE>Header header = headers.get(headerName);<NEW_LINE>headerProcessor.processHeader(header);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (response.getLinks() != null) {<NEW_LINE>Map<String, Link<MASK><NEW_LINE>for (String linkName : links.keySet()) {<NEW_LINE>Link link = links.get(linkName);<NEW_LINE>linkProcessor.processLink(link);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | > links = response.getLinks(); |
341,114 | public void findDepsForTargetFromConstructorArgs(BuildTarget buildTarget, CellNameResolver cellRoots, AbstractAndroidBinaryDescriptionArg constructorArg, ImmutableCollection.Builder<BuildTarget> extraDepsBuilder, ImmutableCollection.Builder<BuildTarget> targetGraphOnlyDepsBuilder) {<NEW_LINE>javacFactory.addParseTimeDeps(targetGraphOnlyDepsBuilder, null, buildTarget.getTargetConfiguration());<NEW_LINE>TargetConfiguration targetConfiguration = buildTarget.getTargetConfiguration();<NEW_LINE>javaOptions.apply(targetConfiguration).addParseTimeDeps(targetGraphOnlyDepsBuilder, targetConfiguration);<NEW_LINE>Optionals.addIfPresent(proGuardConfig.getProguardTarget(targetConfiguration), extraDepsBuilder);<NEW_LINE>if (constructorArg.getRedex()) {<NEW_LINE>// If specified, this option may point to either a BuildTarget or a file.<NEW_LINE>Optional<BuildTarget> redexTarget = androidBuckConfig.getRedexTarget(targetConfiguration);<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>// TODO(cjhopman): we could filter this by the abis that this binary supports.<NEW_LINE>toolchainProvider.getByNameIfPresent(NdkCxxPlatformsProvider.DEFAULT_NAME, buildTarget.getTargetConfiguration(), NdkCxxPlatformsProvider.class).map(NdkCxxPlatformsProvider::getNdkCxxPlatforms).map(Map::values).orElse(ImmutableList.of()).stream().map(platform -> platform.getParseTimeDeps(targetConfiguration)).forEach(extraDepsBuilder::addAll);<NEW_LINE>AndroidTools.addParseTimeDepsToAndroidTools(toolchainProvider, buildTarget, targetGraphOnlyDepsBuilder);<NEW_LINE>} | redexTarget.ifPresent(extraDepsBuilder::add); |
792,037 | public Object visitar(NoDeclaracaoFuncao declaracaoFuncao) throws ExcecaoVisitaASA {<NEW_LINE>PortugolTreeNode node = new PortugolTreeNode(declaracaoFuncao);<NEW_LINE>List<NoDeclaracaoParametro> parametros = declaracaoFuncao.getParametros();<NEW_LINE>if (parametros != null) {<NEW_LINE>for (NoDeclaracaoParametro parametro : parametros) {<NEW_LINE>if (filter.accepts(parametro)) {<NEW_LINE>node.add((PortugolTreeNode) parametro.aceitar(this));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>List<NoBloco> body = declaracaoFuncao.getBlocos();<NEW_LINE>if (body != null) {<NEW_LINE>for (int i = 0; i < body.size(); i++) {<NEW_LINE>Object no = body.get(i).aceitar(this);<NEW_LINE>if (no != null) {<NEW_LINE>node<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (filter.accepts(declaracaoFuncao) || node.getChildCount() > 0) {<NEW_LINE>return node;<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>} | .add((PortugolTreeNode) no); |
1,473,097 | public RestResponseContainer executeRequest(RestRequestContainer request, Templater templater, AsyncControl asyncControl) {<NEW_LINE>HttpRequest <MASK><NEW_LINE>asyncControl.triggerReqeuestStarted();<NEW_LINE>AtomicLong startTime = new AtomicLong(System.currentTimeMillis());<NEW_LINE>var chReq = new ChunkedRequest(buildClient(), httpRequest);<NEW_LINE>chReq.executeRequest(asyncControl.onCancellationRequested);<NEW_LINE>// we block until we get the headers:<NEW_LINE>// TODO: timeout<NEW_LINE>var responseInfo = chReq.getResponseInfo().get();<NEW_LINE>AtomicReference<ChunkedRequest> responseHolder = new AtomicReference<>(chReq);<NEW_LINE>if (responseInfo.statusCode() == 407 && HttpOptionsPluginProvider.options().isAskForProxyAuth()) {<NEW_LINE>CountDownLatch latch = new CountDownLatch(1);<NEW_LINE>Platform.runLater(() -> {<NEW_LINE>CredentialsInputDialog dialog = new CredentialsInputDialog();<NEW_LINE>dialog.showAndWait("Proxy Authentication" + getRealmInfo(responseInfo));<NEW_LINE>if (!dialog.isCancelled()) {<NEW_LINE>proxyCredentials = new PasswordAuthentication(dialog.getUsername(), dialog.getPassword().toCharArray());<NEW_LINE>try {<NEW_LINE>var newRequest = toHttpRequest(request, templater);<NEW_LINE>startTime.set(System.currentTimeMillis());<NEW_LINE>// TODO i actually need a new flux here, no?<NEW_LINE>var proxyReq = new ChunkedRequest(buildClient(), newRequest);<NEW_LINE>proxyReq.executeRequest(asyncControl.onCancellationRequested);<NEW_LINE>responseHolder.set(proxyReq);<NEW_LINE>} catch (Exception e) {<NEW_LINE>e.printStackTrace();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>latch.countDown();<NEW_LINE>});<NEW_LINE>try {<NEW_LINE>latch.await();<NEW_LINE>} catch (InterruptedException e) {<NEW_LINE>e.printStackTrace();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>chReq = responseHolder.get();<NEW_LINE>chReq.getRequestDone().handle((res, e) -> {<NEW_LINE>// System.out.println("triggers");<NEW_LINE>if (e != null) {<NEW_LINE>asyncControl.triggerRequestFailed(e);<NEW_LINE>} else {<NEW_LINE>asyncControl.triggerRequestSucceeded();<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>});<NEW_LINE>return toResponseContainer(httpRequest, chReq.getEmitterProcessor(), chReq.getResponseInfo(), startTime);<NEW_LINE>} | httpRequest = toHttpRequest(request, templater); |
1,648,989 | public void markResults(String[] result_ids, boolean[] reads) {<NEW_LINE>ByteArrayHashMap rid_map = new ByteArrayHashMap();<NEW_LINE>for (int i = 0; i < result_ids.length; i++) {<NEW_LINE>rid_map.put(Base32.decode(result_ids[i]), Boolean.valueOf(reads[i]));<NEW_LINE>}<NEW_LINE>boolean changed = false;<NEW_LINE>List newly_unread = new ArrayList();<NEW_LINE>synchronized (this) {<NEW_LINE>LinkedHashMap<String, SubscriptionResultImpl> results_map = manager.loadResults(subs);<NEW_LINE>SubscriptionResultImpl[] results = results_map.values().toArray(new SubscriptionResultImpl[results_map.size()]);<NEW_LINE>for (int i = 0; i < results.length; i++) {<NEW_LINE>SubscriptionResultImpl result = results[i];<NEW_LINE>if (result.isDeleted()) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>Boolean b_read = (Boolean) rid_map.<MASK><NEW_LINE>if (b_read != null) {<NEW_LINE>boolean read = b_read.booleanValue();<NEW_LINE>if (result.getRead() != read) {<NEW_LINE>changed = true;<NEW_LINE>result.setReadInternal(read);<NEW_LINE>if (!read) {<NEW_LINE>newly_unread.add(result);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (changed) {<NEW_LINE>updateReadUnread(results);<NEW_LINE>manager.saveResults(subs, results);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (changed) {<NEW_LINE>saveConfig(SubscriptionListener.CR_RESULTS);<NEW_LINE>}<NEW_LINE>if (isAutoDownload()) {<NEW_LINE>for (int i = 0; i < newly_unread.size(); i++) {<NEW_LINE>manager.getScheduler().download(subs, (SubscriptionResult) newly_unread.get(i));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | get(result.getKey1()); |
1,832,554 | public Request<ListConfigurationSetsRequest> marshall(ListConfigurationSetsRequest listConfigurationSetsRequest) {<NEW_LINE>if (listConfigurationSetsRequest == null) {<NEW_LINE>throw new AmazonClientException("Invalid argument passed to marshall(ListConfigurationSetsRequest)");<NEW_LINE>}<NEW_LINE>Request<ListConfigurationSetsRequest> request = new DefaultRequest<ListConfigurationSetsRequest>(listConfigurationSetsRequest, "AmazonSimpleEmailService");<NEW_LINE>request.addParameter("Action", "ListConfigurationSets");<NEW_LINE>request.addParameter("Version", "2010-12-01");<NEW_LINE>String prefix;<NEW_LINE>if (listConfigurationSetsRequest.getNextToken() != null) {<NEW_LINE>prefix = "NextToken";<NEW_LINE>String nextToken = listConfigurationSetsRequest.getNextToken();<NEW_LINE>request.addParameter(prefix, StringUtils.fromString(nextToken));<NEW_LINE>}<NEW_LINE>if (listConfigurationSetsRequest.getMaxItems() != null) {<NEW_LINE>prefix = "MaxItems";<NEW_LINE><MASK><NEW_LINE>request.addParameter(prefix, StringUtils.fromInteger(maxItems));<NEW_LINE>}<NEW_LINE>return request;<NEW_LINE>} | Integer maxItems = listConfigurationSetsRequest.getMaxItems(); |
260,777 | private void printPreamble() throws FileNotFoundException {<NEW_LINE>setOutputFile(className);<NEW_LINE>out.print("import boofcv.alg.interpolate.PolynomialPixel;\n" + <MASK><NEW_LINE>out.println();<NEW_LINE>out.print("/**\n" + " * <p>\n" + " * Implementation of {@link PolynomialPixel}.\n" + " * </p>\n" + " * <p>\n" + " * NOTE: This code was automatically generated using {@link " + getClass().getSimpleName() + "}.\n" + " * </p>\n" + " * \n" + " * @author Peter Abeles\n" + " */\n" + "public class " + className + " extends PolynomialPixel<" + image.getSingleBandName() + "> {\n" + "\n" + "\tpublic " + className + "(int maxDegree, float min, float max) {\n" + "\t\tsuper(maxDegree, min, max);\n" + "\t}\n\n");<NEW_LINE>} | "import boofcv.struct.image.*;\n" + "import boofcv.core.image.border.ImageBorder_" + borderType + ";\n"); |
338,721 | private Method resolveMethodInternalCheckOverloads(Class clazz, String methodName, MethodModifiers methodModifiers) throws ClasspathImportException {<NEW_LINE>Method[] methods = clazz.getMethods();<NEW_LINE>Set<Method> overloadeds = null;<NEW_LINE>Method methodByName = null;<NEW_LINE>// check each method by name, add to overloads when multiple methods for the same name<NEW_LINE>for (Method method : methods) {<NEW_LINE>if (method.getName().equals(methodName)) {<NEW_LINE>int modifiers = method.getModifiers();<NEW_LINE>boolean isPublic = Modifier.isPublic(modifiers);<NEW_LINE>boolean isStatic = Modifier.isStatic(modifiers);<NEW_LINE>if (methodModifiers.acceptsPublicFlag(isPublic) && methodModifiers.acceptsStaticFlag(isStatic)) {<NEW_LINE>if (methodByName != null) {<NEW_LINE>if (overloadeds == null) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>overloadeds.add(method);<NEW_LINE>} else {<NEW_LINE>methodByName = method;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (methodByName == null) {<NEW_LINE>throw new ClasspathImportException("Could not find " + methodModifiers.getText() + " method named '" + methodName + "' in class '" + clazz.getName() + "'");<NEW_LINE>}<NEW_LINE>if (overloadeds == null) {<NEW_LINE>return methodByName;<NEW_LINE>}<NEW_LINE>// determine that all overloads have the same result type<NEW_LINE>for (Method overloaded : overloadeds) {<NEW_LINE>if (!overloaded.getReturnType().equals(methodByName.getReturnType())) {<NEW_LINE>throw new ClasspathImportException("Method by name '" + methodName + "' is overloaded in class '" + clazz.getName() + "' and overloaded methods do not return the same type");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return methodByName;<NEW_LINE>} | overloadeds = new HashSet<>(); |
1,238,690 | public void actionPerformed(ActionEvent e) {<NEW_LINE>String state = e.getActionCommand();<NEW_LINE>if (state.equals(JFileChooser.APPROVE_SELECTION)) {<NEW_LINE>File destination = chooser.getSelectedFile();<NEW_LINE>destination = getTargetFile(destination);<NEW_LINE>if (destination.exists()) {<NEW_LINE>NotifyDescriptor nd = new NotifyDescriptor.Confirmation(NbBundle.getMessage(ExportDiffSupport.class, "BK3005", destination.getAbsolutePath()));<NEW_LINE><MASK><NEW_LINE>DialogDisplayer.getDefault().notify(nd);<NEW_LINE>if (nd.getValue().equals(NotifyDescriptor.OK_OPTION) == false) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// NOI18N<NEW_LINE>preferences.put("ExportDiff.saveFolder", destination.getParent());<NEW_LINE>panel.setOutputFileText(destination.getAbsolutePath());<NEW_LINE>} else {<NEW_LINE>dd.setValue(null);<NEW_LINE>}<NEW_LINE>if (dialog != null) {<NEW_LINE>dialog.dispose();<NEW_LINE>}<NEW_LINE>} | nd.setOptionType(NotifyDescriptor.YES_NO_OPTION); |
548,561 | private void initActions(String folder, String category) {<NEW_LINE>if (loadedFromFolders != null) {<NEW_LINE>for (FileObject f : loadedFromFolders) {<NEW_LINE>f.removeFileChangeListener(weakFolderL);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>FileObject fo = FileUtil.getConfigFile(folder);<NEW_LINE>if (fo == null)<NEW_LINE>return;<NEW_LINE>DataFolder root = DataFolder.findFolder(fo);<NEW_LINE>if (loadedFromFolders == null) {<NEW_LINE>// the root must exist all the time, attach just once:<NEW_LINE>root.getPrimaryFile().addFileChangeListener(weakFolderL);<NEW_LINE>}<NEW_LINE>Enumeration<DataObject> en = root.children();<NEW_LINE>Collection<FileObject> newFolders = new ArrayList<>(7);<NEW_LINE>while (en.hasMoreElements()) {<NEW_LINE>DataObject dataObject = en.nextElement();<NEW_LINE>if (dataObject instanceof DataFolder) {<NEW_LINE>initActions((DataFolder) <MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>this.loadedFromFolders = newFolders;<NEW_LINE>} | dataObject, null, category, newFolders); |
631,588 | protected Texture toJmeObject() {<NEW_LINE>Image image = null;<NEW_LINE>TextureKey key = null;<NEW_LINE>if (media != null) {<NEW_LINE>image = (Image) media.getJmeObject();<NEW_LINE>key = media.getTextureKey();<NEW_LINE>}<NEW_LINE>if (image == null) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>Texture2D tex = new Texture2D(image);<NEW_LINE>if (key != null) {<NEW_LINE>tex.setKey(key);<NEW_LINE>tex.setName(key.getName());<NEW_LINE>tex.setAnisotropicFilter(key.getAnisotropy());<NEW_LINE>}<NEW_LINE>tex.setMinFilter(MinFilter.Trilinear);<NEW_LINE>tex.setMagFilter(MagFilter.Bilinear);<NEW_LINE>if (wrapModeU == 0) {<NEW_LINE>tex.setWrap(WrapAxis.S, WrapMode.Repeat);<NEW_LINE>}<NEW_LINE>if (wrapModeV == 0) {<NEW_LINE>tex.setWrap(WrapAxis.T, WrapMode.Repeat);<NEW_LINE>}<NEW_LINE>return tex;<NEW_LINE>} | image = PlaceholderAssets.getPlaceholderImage(assetManager); |
1,512,801 | public RuleGroupSourceStatelessRulesAndCustomActionsDetails unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>RuleGroupSourceStatelessRulesAndCustomActionsDetails ruleGroupSourceStatelessRulesAndCustomActionsDetails = new RuleGroupSourceStatelessRulesAndCustomActionsDetails();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE><MASK><NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>if (context.testExpression("CustomActions", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>ruleGroupSourceStatelessRulesAndCustomActionsDetails.setCustomActions(new ListUnmarshaller<RuleGroupSourceCustomActionsDetails>(RuleGroupSourceCustomActionsDetailsJsonUnmarshaller.getInstance()).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("StatelessRules", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>ruleGroupSourceStatelessRulesAndCustomActionsDetails.setStatelessRules(new ListUnmarshaller<RuleGroupSourceStatelessRulesDetails>(RuleGroupSourceStatelessRulesDetailsJsonUnmarshaller.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 ruleGroupSourceStatelessRulesAndCustomActionsDetails;<NEW_LINE>} | JsonToken token = context.getCurrentToken(); |
1,646,650 | private void initHeap(ObjectHeap<CASHInterval> heap, Relation<ParameterizationFunction> relation, int dim, DBIDs ids) {<NEW_LINE>CASHIntervalSplit split = new CASHIntervalSplit(relation, minPts);<NEW_LINE>// determine minimum and maximum function value of all functions<NEW_LINE>double[] <MASK><NEW_LINE>double d_min = minMax[0], d_max = minMax[1];<NEW_LINE>double dIntervalLength = d_max - d_min;<NEW_LINE>int numDIntervals = (int) FastMath.ceil(dIntervalLength / jitter);<NEW_LINE>double dIntervalSize = dIntervalLength / numDIntervals;<NEW_LINE>double[] d_mins = new double[numDIntervals], d_maxs = new double[numDIntervals];<NEW_LINE>if (LOG.isVerbose()) {<NEW_LINE>//<NEW_LINE>LOG.//<NEW_LINE>verbose(//<NEW_LINE>new StringBuilder().append("d_min ").append(d_min).append("\nd_max ").//<NEW_LINE>append(d_max).append(//<NEW_LINE>"\nnumDIntervals ").//<NEW_LINE>append(numDIntervals).append("\ndIntervalSize ").append(dIntervalSize).toString());<NEW_LINE>}<NEW_LINE>// alpha intervals<NEW_LINE>double[] alphaMin = new double[dim - 1], alphaMax = new double[dim - 1];<NEW_LINE>Arrays.fill(alphaMax, Math.PI);<NEW_LINE>for (int i = 0; i < numDIntervals; i++) {<NEW_LINE>d_mins[i] = (i == 0) ? d_min : d_maxs[i - 1];<NEW_LINE>d_maxs[i] = (i < numDIntervals - 1) ? d_mins[i] + dIntervalSize : d_max - d_mins[i];<NEW_LINE>HyperBoundingBox alphaInterval = new HyperBoundingBox(alphaMin, alphaMax);<NEW_LINE>ModifiableDBIDs intervalIDs = split.determineIDs(ids, alphaInterval, d_mins[i], d_maxs[i]);<NEW_LINE>if (intervalIDs != null && intervalIDs.size() >= minPts) {<NEW_LINE>heap.add(new CASHInterval(alphaMin, alphaMax, split, intervalIDs, -1, 0, d_mins[i], d_maxs[i]));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (LOG.isDebuggingFiner()) {<NEW_LINE>LOG.debugFiner(new StringBuilder().append("heap.size: ").append(heap.size()).toString());<NEW_LINE>}<NEW_LINE>} | minMax = determineMinMaxDistance(relation, dim); |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.