idx int32 46 1.86M | input stringlengths 321 6.6k | target stringlengths 9 1.24k |
|---|---|---|
1,214,748 | public JavaThread addJavaThread(ImageThread imageThread, String name, long tid, long j9thread_t, long javaObjID, long jniEnv, String state, int priority, long blockingObject, String blockingObjectClass) throws BuilderFailureException {<NEW_LINE>try {<NEW_LINE>if (j9thread_t != IBuilderData.NOT_AVAILABLE && jniEnv != IBuilderData.NOT_AVAILABLE) {<NEW_LINE>// Save the JNIEnv for later<NEW_LINE>ImagePointer pointer = fAddressSpace.getPointer(jniEnv);<NEW_LINE>j9ThreadToJNIEnv.put(Long.valueOf(j9thread_t), pointer);<NEW_LINE>}<NEW_LINE>if (!fAddressSpace.isValidAddressID(tid)) {<NEW_LINE>throw new JCInvalidArgumentsException("Must pass a valid thread id");<NEW_LINE>}<NEW_LINE>JCJavaThread javaThread = getJavaRuntime().findJavaThread(tid);<NEW_LINE>if (javaThread == null) {<NEW_LINE>ImagePointer pointer = fAddressSpace.getPointer(tid);<NEW_LINE>javaThread = new JCJavaThread(getJavaRuntime(), pointer);<NEW_LINE>}<NEW_LINE>javaThread.setName(name);<NEW_LINE>javaThread.setPriority(priority);<NEW_LINE>javaThread.setState(state);<NEW_LINE>javaThread.setImageThread((JCImageThread) imageThread);<NEW_LINE>if (jniEnv == IBuilderData.NOT_AVAILABLE) {<NEW_LINE>// Retrieve the JNIEnv<NEW_LINE>ImagePointer pointer = (ImagePointer) j9ThreadToJNIEnv.get(Long.valueOf(j9thread_t));<NEW_LINE>if (pointer != null) {<NEW_LINE>// Set it for 1.4.2<NEW_LINE>javaThread.setJNIEnv(pointer);<NEW_LINE>} else {<NEW_LINE>// Else TID for J9 seems to be JNIEnv<NEW_LINE>javaThread.setJNIEnv(javaThread.getThreadID());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (fAddressSpace.isValidAddressID(javaObjID)) {<NEW_LINE>// Make the type just java.lang.Thread - later we can do better if there is a stack trace.<NEW_LINE>JCJavaClass jClass = generateJavaClass(getJavaRuntime(), "java/lang/Thread", IBuilderData.NOT_AVAILABLE);<NEW_LINE>ImagePointer pointerObjectID = fAddressSpace.getPointer(javaObjID);<NEW_LINE>JCJavaObject jobject <MASK><NEW_LINE>javaThread.setObject(jobject);<NEW_LINE>}<NEW_LINE>if (fAddressSpace.isValidAddressID(blockingObject)) {<NEW_LINE>JCJavaClass jClass = generateJavaClass(getJavaRuntime(), blockingObjectClass, IBuilderData.NOT_AVAILABLE);<NEW_LINE>ImagePointer pointerObjectID = fAddressSpace.getPointer(javaObjID);<NEW_LINE>JCJavaObject jobject = new JCJavaObject(pointerObjectID, jClass);<NEW_LINE>javaThread.setBlockingObject(jobject);<NEW_LINE>}<NEW_LINE>return javaThread;<NEW_LINE>} catch (JCInvalidArgumentsException e) {<NEW_LINE>throw new BuilderFailureException(e);<NEW_LINE>}<NEW_LINE>} | = new JCJavaObject(pointerObjectID, jClass); |
985,083 | public ShortestPathDeltaStepping compute(long startNode) {<NEW_LINE>// reset<NEW_LINE>for (int i = 0; i < nodeCount; i++) {<NEW_LINE>distance.set(i, Integer.MAX_VALUE);<NEW_LINE>}<NEW_LINE>buckets.reset();<NEW_LINE>// basically assign start node to bucket 0<NEW_LINE>relax(graph<MASK><NEW_LINE>// as long as the bucket contains any value<NEW_LINE>while (!buckets.isEmpty() && running()) {<NEW_LINE>// reset temporary arrays<NEW_LINE>light.clear();<NEW_LINE>heavy.clear();<NEW_LINE>// get next bucket index<NEW_LINE>final int phase = buckets.nextNonEmptyBucket();<NEW_LINE>// for each node in bucket<NEW_LINE>buckets.forEachInBucket(phase, node -> {<NEW_LINE>// relax each outgoing light edge<NEW_LINE>graph.forEachRelationship(node, direction, (sourceNodeId, targetNodeId, relationId, cost) -> {<NEW_LINE>final int iCost = (int) (cost * multiplier + distance.get(sourceNodeId));<NEW_LINE>if (cost <= delta) {<NEW_LINE>// determine if light or heavy edge<NEW_LINE>light.add(() -> relax(targetNodeId, iCost));<NEW_LINE>} else {<NEW_LINE>heavy.add(() -> relax(targetNodeId, iCost));<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>});<NEW_LINE>return true;<NEW_LINE>});<NEW_LINE>ParallelUtil.run(light, executorService, futures);<NEW_LINE>ParallelUtil.run(heavy, executorService, futures);<NEW_LINE>}<NEW_LINE>return this;<NEW_LINE>} | .toMappedNodeId(startNode), 0); |
97,052 | public List<Config> listConfigs(final Config.Criteria criteria) throws DockerException, InterruptedException {<NEW_LINE>assertApiVersionIsAbove("1.30");<NEW_LINE>final Map<String, List<String>> filters = new HashMap<>();<NEW_LINE>if (criteria.configId() != null) {<NEW_LINE>filters.put("id", Collections.singletonList(criteria.configId()));<NEW_LINE>}<NEW_LINE>if (criteria.label() != null) {<NEW_LINE>filters.put("label", Collections.singletonList(criteria.label()));<NEW_LINE>}<NEW_LINE>if (criteria.name() != null) {<NEW_LINE>filters.put("name", Collections.singletonList(criteria.name()));<NEW_LINE>}<NEW_LINE>final WebTarget resource = resource().path("configs").queryParam<MASK><NEW_LINE>try {<NEW_LINE>return request(GET, CONFIG_LIST, resource, resource.request(APPLICATION_JSON_TYPE));<NEW_LINE>} catch (DockerRequestException e) {<NEW_LINE>switch(e.status()) {<NEW_LINE>case 503:<NEW_LINE>throw new NonSwarmNodeException("node is not part of a swarm", e);<NEW_LINE>default:<NEW_LINE>throw e;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | ("filters", urlEncodeFilters(filters)); |
954,265 | private void addContact(SourceUIContact contact) {<NEW_LINE>SourceContact sourceContact = (SourceContact) contact.getDescriptor();<NEW_LINE>List<ContactDetail> details = sourceContact.getContactDetails(OperationSetPersistentPresence.class);<NEW_LINE>int detailsCount = details.size();<NEW_LINE>if (detailsCount > 1) {<NEW_LINE>JMenuItem addContactMenu = TreeContactList.createAddContactMenu((SourceContact) contact.getDescriptor());<NEW_LINE>JPopupMenu popupMenu = ((JMenu) addContactMenu).getPopupMenu();<NEW_LINE>// Add a title label.<NEW_LINE>JLabel infoLabel = new JLabel();<NEW_LINE>infoLabel.setText("<html><b>" + GuiActivator.getResources().getI18NString("service.gui.ADD_CONTACT") + "</b></html>");<NEW_LINE>popupMenu.insert(infoLabel, 0);<NEW_LINE>popupMenu.insert<MASK><NEW_LINE>popupMenu.setFocusable(true);<NEW_LINE>popupMenu.setInvoker(treeContactList);<NEW_LINE>Point location = new Point(addContactButton.getX(), addContactButton.getY() + addContactButton.getHeight());<NEW_LINE>SwingUtilities.convertPointToScreen(location, treeContactList);<NEW_LINE>location.y = location.y + treeContactList.getPathBounds(treeContactList.getSelectionPath()).y;<NEW_LINE>popupMenu.setLocation(location.x + 8, location.y - 8);<NEW_LINE>popupMenu.setVisible(true);<NEW_LINE>} else if (details.size() == 1) {<NEW_LINE>TreeContactList.showAddContactDialog(details.get(0), sourceContact.getDisplayName());<NEW_LINE>}<NEW_LINE>} | (new Separator(), 1); |
852,156 | private static int parseDotsConstraints(List<SmPLLexer.Token> tokens, int pos, StringBuilder output) {<NEW_LINE>int end = tokens.size();<NEW_LINE>int finalPos = pos;<NEW_LINE>String comma = "";<NEW_LINE>pos += 1;<NEW_LINE>while (pos < end) {<NEW_LINE>SmPLLexer.Token token = tokens.get(pos);<NEW_LINE>SmPLLexer.TokenType tpe = token.getType();<NEW_LINE>if (tpe == SmPLLexer.TokenType.Newline) {<NEW_LINE>pos += 1;<NEW_LINE>} else if (tpe == SmPLLexer.TokenType.WhenAny || tpe == SmPLLexer.TokenType.WhenExists || tpe == SmPLLexer.TokenType.WhenNotEqual) {<NEW_LINE>if (tpe == SmPLLexer.TokenType.WhenAny) {<NEW_LINE>output.append(comma).append(SmPLJavaDSL.getDotsWhenAnyName<MASK><NEW_LINE>} else if (tpe == SmPLLexer.TokenType.WhenExists) {<NEW_LINE>output.append(comma).append(SmPLJavaDSL.getDotsWhenExistsName()).append("()");<NEW_LINE>} else {<NEW_LINE>String exprMatch = getExpressionMatch(tokens.get(pos).getText().strip());<NEW_LINE>if (exprMatch != null) {<NEW_LINE>output.append(comma).append(SmPLJavaDSL.getDotsWhenNotEqualName()).append("(").append(SmPLJavaDSL.getExpressionMatchWrapperName()).append("(").append(tokens.get(pos).getText().strip()).append(")").append(")");<NEW_LINE>} else {<NEW_LINE>output.append(comma).append(SmPLJavaDSL.getDotsWhenNotEqualName()).append("(").append(tokens.get(pos).getText().strip()).append(")");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>finalPos = ++pos;<NEW_LINE>comma = ",";<NEW_LINE>} else {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return finalPos;<NEW_LINE>} | ()).append("()"); |
1,840,781 | private String importSinglePhoto(PhotoModel photo, UUID jobId, IdempotentImportExecutor idempotentImportExecutor, KoofrClient koofrClient) throws IOException, InvalidTokenException, DestinationMemoryFullException {<NEW_LINE>monitor.debug(() -> String.format("Import single photo %s", photo.getTitle()));<NEW_LINE>BufferedInputStream inputStream = null;<NEW_LINE>try {<NEW_LINE>if (photo.isInTempStore()) {<NEW_LINE>inputStream = new BufferedInputStream(jobStore.getStream(jobId, photo.getFetchableUrl()).getStream());<NEW_LINE>} else if (photo.getFetchableUrl() != null) {<NEW_LINE>HttpURLConnection conn = imageStreamProvider.<MASK><NEW_LINE>inputStream = new BufferedInputStream(conn.getInputStream());<NEW_LINE>} else {<NEW_LINE>throw new IllegalStateException("Don't know how to get the inputStream for " + photo.getTitle());<NEW_LINE>}<NEW_LINE>final byte[] bytes = IOUtils.toByteArray(inputStream);<NEW_LINE>Date dateCreated = getDateCreated(photo, bytes);<NEW_LINE>String title = buildPhotoTitle(jobId, photo.getTitle(), dateCreated);<NEW_LINE>String description = KoofrClient.trimDescription(photo.getDescription());<NEW_LINE>String parentPath = idempotentImportExecutor.getCachedValue(photo.getAlbumId());<NEW_LINE>String fullPath = parentPath + "/" + title;<NEW_LINE>if (koofrClient.fileExists(fullPath)) {<NEW_LINE>monitor.debug(() -> String.format("Photo already exists %s", photo.getTitle()));<NEW_LINE>return fullPath;<NEW_LINE>}<NEW_LINE>final ByteArrayInputStream inMemoryInputStream = new ByteArrayInputStream(bytes);<NEW_LINE>String response = koofrClient.uploadFile(parentPath, title, inMemoryInputStream, photo.getMediaType(), dateCreated, description);<NEW_LINE>try {<NEW_LINE>if (photo.isInTempStore()) {<NEW_LINE>jobStore.removeData(jobId, photo.getFetchableUrl());<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>// Swallow the exception caused by Remove data so that existing flows continue<NEW_LINE>monitor.info(() -> format("Exception swallowed while removing data for jobId %s, localPath %s", jobId, photo.getFetchableUrl()), e);<NEW_LINE>}<NEW_LINE>return response;<NEW_LINE>} finally {<NEW_LINE>if (inputStream != null) {<NEW_LINE>inputStream.close();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | getConnection(photo.getFetchableUrl()); |
460,367 | private void updateJailsToNewJailsConfig() {<NEW_LINE>if (doneFile.getBoolean("updateJailsToNewJailsConfig", false)) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final File configFile = new File(ess.getDataFolder(), "jail.yml");<NEW_LINE>if (configFile.exists()) {<NEW_LINE>final EssentialsConfiguration config = new EssentialsConfiguration(configFile);<NEW_LINE>try {<NEW_LINE>config.load();<NEW_LINE>if (!config.hasProperty("jails")) {<NEW_LINE>for (final Map.Entry<String, CommentedConfigurationNode> entry : config.getMap().entrySet()) {<NEW_LINE>final Location loc = getFakeLocation(entry.getValue(), entry.getKey());<NEW_LINE>config.setProperty(entry.getKey(), loc);<NEW_LINE>}<NEW_LINE>if (!configFile.renameTo(new File(ess.getDataFolder(), "jail.yml.old"))) {<NEW_LINE>throw new Exception(tl("fileRenameError", "jail.yml"));<NEW_LINE>}<NEW_LINE>config.blockingSave();<NEW_LINE>}<NEW_LINE>} catch (final Exception ex) {<NEW_LINE>Bukkit.getLogger().log(Level.SEVERE, <MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>doneFile.setProperty("updateJailsToNewJailsConfig", true);<NEW_LINE>doneFile.save();<NEW_LINE>} | ex.getMessage(), ex); |
570,354 | public JSONObject serviceImpl(Query post, HttpServletResponse response, Authorization rights, final JSONObjectWithDefault permissions) throws APIException {<NEW_LINE>JSONObject result = new JSONObject();<NEW_LINE>switch(post.get("show", "")) {<NEW_LINE>case "user-list":<NEW_LINE>if (permissions.getBoolean("list_users", false)) {<NEW_LINE>result.put("user-list", DAO.authorization.getPersistent());<NEW_LINE>} else<NEW_LINE>throw new APIException(403, "Forbidden");<NEW_LINE>break;<NEW_LINE>case "user-roles":<NEW_LINE>JSONObject userRolesObj = new JSONObject();<NEW_LINE>Map<String, UserRole> userRoles = DAO.userRoles.getUserRoles();<NEW_LINE>for (String key : userRoles.keySet()) {<NEW_LINE>UserRole userRole = userRoles.get(key);<NEW_LINE>JSONObject obj = new JSONObject();<NEW_LINE>obj.put("display-name", userRole.getDisplayName());<NEW_LINE>obj.put("base-user-role", userRole.getBaseUserRole().name());<NEW_LINE>obj.put("permission-overrides", userRole.getPermissionOverrides());<NEW_LINE>userRolesObj.put(key, obj);<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>throw new APIException(400, "No 'show' parameter specified");<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>} | result.put("user-roles", userRolesObj); |
36,585 | public static BatchGetPluginConfigInfoResponse unmarshall(BatchGetPluginConfigInfoResponse batchGetPluginConfigInfoResponse, UnmarshallerContext context) {<NEW_LINE>batchGetPluginConfigInfoResponse.setRequestId(context.stringValue("BatchGetPluginConfigInfoResponse.RequestId"));<NEW_LINE>batchGetPluginConfigInfoResponse.setCode<MASK><NEW_LINE>batchGetPluginConfigInfoResponse.setMessage(context.stringValue("BatchGetPluginConfigInfoResponse.Message"));<NEW_LINE>List<Plugin> data = new ArrayList<Plugin>();<NEW_LINE>for (int i = 0; i < context.lengthValue("BatchGetPluginConfigInfoResponse.Data.Length"); i++) {<NEW_LINE>Plugin plugin = new Plugin();<NEW_LINE>plugin.setPluginProperties(context.stringValue("BatchGetPluginConfigInfoResponse.Data[" + i + "].PluginProperties"));<NEW_LINE>plugin.setPluginUniqKey(context.stringValue("BatchGetPluginConfigInfoResponse.Data[" + i + "].PluginUniqKey"));<NEW_LINE>data.add(plugin);<NEW_LINE>}<NEW_LINE>batchGetPluginConfigInfoResponse.setData(data);<NEW_LINE>return batchGetPluginConfigInfoResponse;<NEW_LINE>} | (context.integerValue("BatchGetPluginConfigInfoResponse.Code")); |
918,607 | private void handleServiceRequest(String path, ServiceRequest serviceRequest) {<NEW_LINE>UaRequestMessage request = serviceRequest.getRequest();<NEW_LINE>if (logger.isTraceEnabled()) {<NEW_LINE>logger.trace("ServiceRequest received path={}, requestHandle={} request={}", path, request.getRequestHeader().getRequestHandle(), request.getClass().getSimpleName());<NEW_LINE>serviceRequest.getFuture().whenComplete((response, ex) -> {<NEW_LINE>if (response != null) {<NEW_LINE>logger.trace("ServiceRequest completed path={}, requestHandle={} response={}", path, response.getResponseHeader().getRequestHandle(), response.getClass().getSimpleName());<NEW_LINE>} else {<NEW_LINE>logger.trace("ServiceRequest completed exceptionally path={}, requestHandle={}", path, request.getRequestHeader().getRequestHandle(), ex);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}<NEW_LINE>ServiceRequestHandler serviceHandler = getServiceHandler(<MASK><NEW_LINE>try {<NEW_LINE>if (serviceHandler != null) {<NEW_LINE>serviceHandler.handle(serviceRequest);<NEW_LINE>} else {<NEW_LINE>serviceRequest.setServiceFault(StatusCodes.Bad_ServiceUnsupported);<NEW_LINE>}<NEW_LINE>} catch (UaException e) {<NEW_LINE>serviceRequest.setServiceFault(e);<NEW_LINE>} catch (Throwable t) {<NEW_LINE>logger.error("Uncaught Throwable executing handler: {}", serviceHandler, t);<NEW_LINE>serviceRequest.setServiceFault(StatusCodes.Bad_InternalError);<NEW_LINE>}<NEW_LINE>} | path, request.getTypeId()); |
102,718 | GroupConfig addGroup(String groupName) {<NEW_LINE>synchronized (SAVING_LOCK) {<NEW_LINE>if (DEBUG)<NEW_LINE>Debug.log(WindowManagerParser.<MASK><NEW_LINE>GroupParser groupParser = (GroupParser) groupParserMap.get(groupName);<NEW_LINE>if (groupParser != null) {<NEW_LINE>// NOI18N<NEW_LINE>PersistenceManager.LOG.// NOI18N<NEW_LINE>log(// NOI18N<NEW_LINE>Level.INFO, // NOI18N<NEW_LINE>"[WinSys.WindowManagerParser.addGroup]" + " Warning: GroupParser " + // NOI18N<NEW_LINE>groupName + " exists but it should not.");<NEW_LINE>groupParserMap.remove(groupName);<NEW_LINE>}<NEW_LINE>groupParser = new GroupParser(groupName);<NEW_LINE>FileObject groupsModuleFolder = null;<NEW_LINE>try {<NEW_LINE>groupsModuleFolder = pm.getGroupsModuleFolder();<NEW_LINE>} catch (IOException exc) {<NEW_LINE>// NOI18N<NEW_LINE>PersistenceManager.LOG.// NOI18N<NEW_LINE>log(// NOI18N<NEW_LINE>Level.INFO, // NOI18N<NEW_LINE>"[WinSys.WindowManagerParser.addGroup]" + " Cannot get groups folder", exc);<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>groupParser.setModuleParentFolder(groupsModuleFolder);<NEW_LINE>groupParser.setInModuleFolder(true);<NEW_LINE>// FileObject setsLocalFolder = pm.getGroupsLocalFolder();<NEW_LINE>// groupParser.setLocalParentFolder(groupsLocalFolder);<NEW_LINE>groupParserMap.put(groupName, groupParser);<NEW_LINE>GroupConfig groupConfig = null;<NEW_LINE>try {<NEW_LINE>groupConfig = groupParser.load();<NEW_LINE>} catch (IOException exc) {<NEW_LINE>// NOI18N<NEW_LINE>PersistenceManager.LOG.// NOI18N<NEW_LINE>log(// NOI18N<NEW_LINE>Level.INFO, // NOI18N<NEW_LINE>"[WinSys.WindowManagerParser.addGroup]" + " Warning: Cannot load group " + groupName, exc);<NEW_LINE>}<NEW_LINE>return groupConfig;<NEW_LINE>}<NEW_LINE>} | class, "WMParser.addGroup ENTER" + " group:" + groupName); |
1,101,297 | public CorrelateJoinPlan convertCorrelate(Correlate correlate) {<NEW_LINE>PhysicalPlan left = convert(correlate.getLeft());<NEW_LINE>PhysicalPlan right = convert(correlate.getRight());<NEW_LINE><MASK><NEW_LINE>List<Integer> requireList = correlate.getRequiredColumns().asList();<NEW_LINE>Map<CorrelationKey, List<VariableParameterFunction>> map = rexConverter.getVariableParameterFunctionMap();<NEW_LINE>List<Map.Entry<CorrelationKey, List<VariableParameterFunction>>> entryList = map.entrySet().stream().filter(i -> i.getKey().correlationId.getId() == correlationId.getId()).collect(Collectors.toList());<NEW_LINE>HashMap<Integer, List<VariableParameterFunction>> targetMap = new HashMap<>();<NEW_LINE>for (Map.Entry<CorrelationKey, List<VariableParameterFunction>> e : entryList) {<NEW_LINE>int index = e.getKey().index;<NEW_LINE>Integer integer = requireList.get(index);<NEW_LINE>for (VariableParameterFunction variableParameterFunction : e.getValue()) {<NEW_LINE>targetMap.compute(integer, (integer1, variableParameterFunctions) -> new ArrayList<>()).add(variableParameterFunction);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return new CorrelateJoinPlan(left, right, JoinType.valueOf(correlate.getJoinType().name()), targetMap);<NEW_LINE>} | CorrelationId correlationId = correlate.getCorrelationId(); |
1,190,785 | private void applyRequiredPolicies(List<HttpPipelinePolicy> policies, HttpPipelinePolicy authorizationPolicy) {<NEW_LINE>String clientName = properties.getOrDefault(SDK_NAME, "UnknownName");<NEW_LINE>String clientVersion = <MASK><NEW_LINE>ClientOptions buildClientOptions = (clientOptions == null) ? new ClientOptions() : clientOptions;<NEW_LINE>HttpLogOptions buildLogOptions = (httpLogOptions == null) ? new HttpLogOptions() : httpLogOptions;<NEW_LINE>String applicationId = null;<NEW_LINE>if (!CoreUtils.isNullOrEmpty(buildClientOptions.getApplicationId())) {<NEW_LINE>applicationId = buildClientOptions.getApplicationId();<NEW_LINE>} else if (!CoreUtils.isNullOrEmpty(buildLogOptions.getApplicationId())) {<NEW_LINE>applicationId = buildLogOptions.getApplicationId();<NEW_LINE>}<NEW_LINE>policies.add(new UserAgentPolicy(applicationId, clientName, clientVersion, configuration));<NEW_LINE>policies.add(new RequestIdPolicy());<NEW_LINE>policies.add(ClientBuilderUtil.validateAndGetRetryPolicy(retryPolicy, retryOptions));<NEW_LINE>policies.add(new CookiePolicy());<NEW_LINE>// auth policy is per request, should be after retry<NEW_LINE>policies.add(authorizationPolicy);<NEW_LINE>policies.add(new HttpLoggingPolicy(httpLogOptions));<NEW_LINE>} | properties.getOrDefault(SDK_VERSION, "UnknownVersion"); |
946,682 | public void endVisit(UnaryExpression x, BlockScope scope) {<NEW_LINE>try {<NEW_LINE>SourceInfo info = makeSourceInfo(x);<NEW_LINE>JUnaryOperator op;<NEW_LINE>int operator = ((x.bits & ASTNode.<MASK><NEW_LINE>switch(operator) {<NEW_LINE>case OperatorIds.MINUS:<NEW_LINE>op = JUnaryOperator.NEG;<NEW_LINE>break;<NEW_LINE>case OperatorIds.NOT:<NEW_LINE>op = JUnaryOperator.NOT;<NEW_LINE>break;<NEW_LINE>case OperatorIds.PLUS:<NEW_LINE>// Odd case.. useless + operator; just leave the operand on the<NEW_LINE>// stack.<NEW_LINE>return;<NEW_LINE>case OperatorIds.TWIDDLE:<NEW_LINE>op = JUnaryOperator.BIT_NOT;<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>throw new InternalCompilerException("Unexpected operator for unary expression");<NEW_LINE>}<NEW_LINE>JExpression expression = pop(x.expression);<NEW_LINE>push(new JPrefixOperation(info, op, expression));<NEW_LINE>} catch (Throwable e) {<NEW_LINE>throw translateException(x, e);<NEW_LINE>}<NEW_LINE>} | OperatorMASK) >> ASTNode.OperatorSHIFT); |
678,871 | final SearchAddressBooksResult executeSearchAddressBooks(SearchAddressBooksRequest searchAddressBooksRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(searchAddressBooksRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<SearchAddressBooksRequest> request = null;<NEW_LINE>Response<SearchAddressBooksResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new SearchAddressBooksRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(searchAddressBooksRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "Alexa For Business");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "SearchAddressBooks");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<SearchAddressBooksResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new SearchAddressBooksResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint); |
487,739 | public static Cluster swapRandomPartitionsWithinZone(final Cluster nextCandidateCluster, final int zoneId) {<NEW_LINE>Cluster returnCluster = Cluster.cloneCluster(nextCandidateCluster);<NEW_LINE>Random r = new Random();<NEW_LINE>List<Integer> nodeIdsInZone = new ArrayList<Integer>(nextCandidateCluster.getNodeIdsInZone(zoneId));<NEW_LINE>if (nodeIdsInZone.size() == 0) {<NEW_LINE>return returnCluster;<NEW_LINE>}<NEW_LINE>// Select random stealer node<NEW_LINE>int stealerNodeOffset = r.<MASK><NEW_LINE>Integer stealerNodeId = nodeIdsInZone.get(stealerNodeOffset);<NEW_LINE>// Select random stealer partition<NEW_LINE>List<Integer> stealerPartitions = returnCluster.getNodeById(stealerNodeId).getPartitionIds();<NEW_LINE>if (stealerPartitions.size() == 0) {<NEW_LINE>return nextCandidateCluster;<NEW_LINE>}<NEW_LINE>int stealerPartitionOffset = r.nextInt(stealerPartitions.size());<NEW_LINE>int stealerPartitionId = stealerPartitions.get(stealerPartitionOffset);<NEW_LINE>// Select random donor node<NEW_LINE>List<Integer> donorNodeIds = new ArrayList<Integer>();<NEW_LINE>donorNodeIds.addAll(nodeIdsInZone);<NEW_LINE>donorNodeIds.remove(stealerNodeId);<NEW_LINE>if (donorNodeIds.isEmpty()) {<NEW_LINE>// No donor nodes!<NEW_LINE>return returnCluster;<NEW_LINE>}<NEW_LINE>int donorIdOffset = r.nextInt(donorNodeIds.size());<NEW_LINE>Integer donorNodeId = donorNodeIds.get(donorIdOffset);<NEW_LINE>// Select random donor partition<NEW_LINE>List<Integer> donorPartitions = returnCluster.getNodeById(donorNodeId).getPartitionIds();<NEW_LINE>int donorPartitionOffset = r.nextInt(donorPartitions.size());<NEW_LINE>int donorPartitionId = donorPartitions.get(donorPartitionOffset);<NEW_LINE>return swapPartitions(returnCluster, stealerNodeId, stealerPartitionId, donorNodeId, donorPartitionId);<NEW_LINE>} | nextInt(nodeIdsInZone.size()); |
1,762,997 | final CreateLayerResult executeCreateLayer(CreateLayerRequest createLayerRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(createLayerRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<CreateLayerRequest> request = null;<NEW_LINE>Response<CreateLayerResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new CreateLayerRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(createLayerRequest));<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, "OpsWorks");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "CreateLayer");<NEW_LINE>request.<MASK><NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<CreateLayerResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new CreateLayerResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig); |
1,316,941 | public PagePosition renderIntoArea(int x, int y, int width, int height, PagePosition current, int index) {<NEW_LINE>if (current.pixel + PIXEL_HEIGHT > height) {<NEW_LINE>current = current.newPage();<NEW_LINE>}<NEW_LINE>x += OFFSET.x;<NEW_LINE>y += OFFSET.y + current.pixel;<NEW_LINE>if (current.page == index) {<NEW_LINE>CRAFTING_GRID.drawAt(x, y);<NEW_LINE>// Render the item<NEW_LINE>GlStateManager.enableRescaleNormal();<NEW_LINE>RenderHelper.enableGUIStandardItemLighting();<NEW_LINE>for (int itemX = 0; itemX < input.length; itemX++) {<NEW_LINE>for (int itemY = 0; itemY < input[itemX].length; itemY++) {<NEW_LINE>GuiRectangle rect = ITEM_POSITION[itemX][itemY];<NEW_LINE>drawItemStack(input[itemX][itemY].get(), x + (int) rect.x, y + (int) rect.y);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>drawItemStack(output.get(), x + (int) OUT_POSITION.x, y <MASK><NEW_LINE>RenderHelper.disableStandardItemLighting();<NEW_LINE>GlStateManager.disableRescaleNormal();<NEW_LINE>}<NEW_LINE>current = current.nextLine(PIXEL_HEIGHT, height);<NEW_LINE>return current;<NEW_LINE>} | + (int) OUT_POSITION.y); |
226,736 | protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3) {<NEW_LINE>GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);<NEW_LINE>bindGuiTexture(isSimple ? 1 : 0);<NEW_LINE>int sx = (width - xSize) / 2;<NEW_LINE>int sy = (height - ySize) / 2;<NEW_LINE>drawTexturedModalRect(sx, sy, 0, 0, <MASK><NEW_LINE>int scaled;<NEW_LINE>if (shouldRenderProgress()) {<NEW_LINE>scaled = getProgressScaled(12);<NEW_LINE>drawTexturedModalRect(sx + 80, sy + 64 - scaled, 176, 12 - scaled, 14, scaled + 2);<NEW_LINE>}<NEW_LINE>FontRenderer fr = getFontRenderer();<NEW_LINE>int y = guiTop + fr.FONT_HEIGHT / 2 + 3;<NEW_LINE>int output = 0;<NEW_LINE>if (getTileEntity().isActive()) {<NEW_LINE>output = getTileEntity().getPowerUsePerTick();<NEW_LINE>}<NEW_LINE>String txt = Lang.GUI_STIRGEN_OUTPUT.get(LangPower.RFt(output));<NEW_LINE>int sw = fr.getStringWidth(txt);<NEW_LINE>fr.drawStringWithShadow(txt, guiLeft + xSize / 2 - sw / 2, y, ColorUtil.getRGB(Color.WHITE));<NEW_LINE>txt = Lang.GUI_STIRGEN_EFFICIENCY.get(Math.round(getTileEntity().getBurnEfficiency() * 100));<NEW_LINE>sw = fr.getStringWidth(txt);<NEW_LINE>y += fr.FONT_HEIGHT + 3;<NEW_LINE>fr.drawStringWithShadow(txt, guiLeft + xSize / 2 - sw / 2, y, ColorUtil.getRGB(Color.WHITE));<NEW_LINE>GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);<NEW_LINE>super.drawGuiContainerBackgroundLayer(par1, par2, par3);<NEW_LINE>} | this.xSize, this.ySize); |
1,196,789 | protected List<String> verifyKeyExists(List<MyNameValuePair> map, String type, String key, boolean ignoreKeyCase, boolean exists) throws WebBrowserException {<NEW_LINE>String methodName = "verifyKeyExists";<NEW_LINE>List<String> actualValue = this.getValue(map, key, ignoreKeyCase);<NEW_LINE>String keyName = this.getKeyName(type, key, ignoreKeyCase);<NEW_LINE>if (exists) {<NEW_LINE>LOG.logp(Level.INFO, CLASS_NAME, methodName, "Verifying that " + this.toString() + " has a " + keyName);<NEW_LINE>if (actualValue == null) {<NEW_LINE>throw new WebBrowserException(this.<MASK><NEW_LINE>}<NEW_LINE>LOG.logp(Level.INFO, CLASS_NAME, methodName, "Yep!");<NEW_LINE>} else {<NEW_LINE>LOG.logp(Level.INFO, CLASS_NAME, methodName, "Verifying that " + this.toString() + " does not have a " + keyName);<NEW_LINE>if (actualValue == null) {<NEW_LINE>LOG.logp(Level.INFO, CLASS_NAME, methodName, "Yep!");<NEW_LINE>} else {<NEW_LINE>throw new WebBrowserException(this.toString() + " should not have a " + keyName);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return actualValue;<NEW_LINE>} | toString() + " should have a " + keyName); |
1,718,419 | final GetHomeRegionResult executeGetHomeRegion(GetHomeRegionRequest getHomeRegionRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(getHomeRegionRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<GetHomeRegionRequest> request = null;<NEW_LINE>Response<GetHomeRegionResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new GetHomeRegionRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(getHomeRegionRequest));<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.<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "GetHomeRegion");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<GetHomeRegionResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new GetHomeRegionResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | addHandlerContext(HandlerContextKey.SERVICE_ID, "MigrationHub Config"); |
840,766 | final DescribeCanariesLastRunResult executeDescribeCanariesLastRun(DescribeCanariesLastRunRequest describeCanariesLastRunRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(describeCanariesLastRunRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DescribeCanariesLastRunRequest> request = null;<NEW_LINE>Response<DescribeCanariesLastRunResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DescribeCanariesLastRunRequestProtocolMarshaller(protocolFactory).marshall<MASK><NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "synthetics");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DescribeCanariesLastRun");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DescribeCanariesLastRunResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DescribeCanariesLastRunResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | (super.beforeMarshalling(describeCanariesLastRunRequest)); |
1,614,458 | public static BufferedImage resizeWithRatio(BufferedImage image, int destinationWidth, int destinationHeight) {<NEW_LINE>int type = image.getType() == 0 ? BufferedImage.TYPE_INT_ARGB : image.getType();<NEW_LINE>// *Special* if the width or height is 0 use image src dimensions<NEW_LINE>if (destinationWidth == 0) {<NEW_LINE>destinationWidth = image.getWidth();<NEW_LINE>}<NEW_LINE>if (destinationHeight == 0) {<NEW_LINE>destinationHeight = image.getHeight();<NEW_LINE>}<NEW_LINE>int fHeight = destinationHeight;<NEW_LINE>int fWidth = destinationWidth;<NEW_LINE>// Work out the resized width/height<NEW_LINE>if (image.getHeight() > destinationHeight || image.getWidth() > destinationWidth) {<NEW_LINE>if (image.getHeight() > image.getWidth()) {<NEW_LINE>fHeight = destinationHeight;<NEW_LINE>float sum = (float) image.getWidth() / (float) image.getHeight();<NEW_LINE>fWidth = Math.round(destinationWidth * sum);<NEW_LINE>} else if (image.getWidth() > image.getHeight()) {<NEW_LINE>fWidth = destinationWidth;<NEW_LINE>float sum = (float) image.getHeight() / (float) image.getWidth();<NEW_LINE>fHeight = <MASK><NEW_LINE>}<NEW_LINE>// else sides are equal and is set to destination size at initialization of<NEW_LINE>}<NEW_LINE>BufferedImage resizedImage = new BufferedImage(fWidth, fHeight, type);<NEW_LINE>Graphics2D g = resizedImage.createGraphics();<NEW_LINE>g.setComposite(AlphaComposite.Src);<NEW_LINE>g.setRenderingHint(RenderingHints.KEY_INTERPOLATION, RenderingHints.VALUE_INTERPOLATION_BILINEAR);<NEW_LINE>g.setRenderingHint(RenderingHints.KEY_RENDERING, RenderingHints.VALUE_RENDER_QUALITY);<NEW_LINE>g.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);<NEW_LINE>g.drawImage(image, 0, 0, fWidth, fHeight, null);<NEW_LINE>g.dispose();<NEW_LINE>return resizedImage;<NEW_LINE>} | Math.round(destinationHeight * sum); |
1,744,419 | public View onCreateView(@NonNull LayoutInflater inflater, @NonNull ViewGroup parent) {<NEW_LINE>final View view = inflater.inflate(R.<MASK><NEW_LINE>okHttpCacheMaxSizeView = view.findViewById(R.id.dd_debug_okhttp_cache_max_size);<NEW_LINE>okHttpCacheWriteErrorView = view.findViewById(R.id.dd_debug_okhttp_cache_write_error);<NEW_LINE>okHttpCacheRequestCountView = view.findViewById(R.id.dd_debug_okhttp_cache_request_count);<NEW_LINE>okHttpCacheNetworkCountView = view.findViewById(R.id.dd_debug_okhttp_cache_network_count);<NEW_LINE>okHttpCacheHitCountView = view.findViewById(R.id.dd_debug_okhttp_cache_hit_count);<NEW_LINE>okHttpCacheMaxSizeView.setText(sizeString(maxSize()));<NEW_LINE>refresh();<NEW_LINE>return view;<NEW_LINE>} | layout.dd_debug_drawer_module_okhttp, parent, false); |
139,049 | public static String formatDateTime19(Instant instant, ZoneId zoneId) {<NEW_LINE>ZonedDateTime zt = ZonedDateTime.ofInstant(instant, zoneId);<NEW_LINE>int year = zt.get(ChronoField.YEAR);<NEW_LINE>;<NEW_LINE>int month = zt.get(ChronoField.MONTH_OF_YEAR);<NEW_LINE>;<NEW_LINE>int dayOfMonth = zt.get(ChronoField.DAY_OF_MONTH);<NEW_LINE>;<NEW_LINE>int hour = zt.get(ChronoField.HOUR_OF_DAY);<NEW_LINE>;<NEW_LINE>int minute = zt.get(ChronoField.MINUTE_OF_HOUR);<NEW_LINE>;<NEW_LINE>int second = zt.get(ChronoField.SECOND_OF_MINUTE);<NEW_LINE>;<NEW_LINE>char[] chars = new char[19];<NEW_LINE>chars[0] = (char<MASK><NEW_LINE>chars[1] = (char) ((year / 100) % 10 + '0');<NEW_LINE>chars[2] = (char) ((year / 10) % 10 + '0');<NEW_LINE>chars[3] = (char) (year % 10 + '0');<NEW_LINE>chars[4] = '-';<NEW_LINE>chars[5] = (char) (month / 10 + '0');<NEW_LINE>chars[6] = (char) (month % 10 + '0');<NEW_LINE>chars[7] = '-';<NEW_LINE>chars[8] = (char) (dayOfMonth / 10 + '0');<NEW_LINE>chars[9] = (char) (dayOfMonth % 10 + '0');<NEW_LINE>chars[10] = ' ';<NEW_LINE>chars[11] = (char) (hour / 10 + '0');<NEW_LINE>chars[12] = (char) (hour % 10 + '0');<NEW_LINE>chars[13] = ':';<NEW_LINE>chars[14] = (char) (minute / 10 + '0');<NEW_LINE>chars[15] = (char) (minute % 10 + '0');<NEW_LINE>chars[16] = ':';<NEW_LINE>chars[17] = (char) (second / 10 + '0');<NEW_LINE>chars[18] = (char) (second % 10 + '0');<NEW_LINE>return new String(chars);<NEW_LINE>} | ) (year / 1000 + '0'); |
706,569 | public void testSLLFutureGetTimesOutXml() throws Exception {<NEW_LINE>long currentThreadId = 0;<NEW_LINE>ResultsStatelessLocal bean = lookupSLLBean();<NEW_LINE>assertNotNull("Async Stateless Bean created successfully", bean);<NEW_LINE>// initialize latches<NEW_LINE>ResultsStatelessLocalFutureBean.svBeanLatch = new CountDownLatch(1);<NEW_LINE>ResultsStatelessLocalFutureBean.svTestLatch = new CountDownLatch(1);<NEW_LINE>// call bean asynchronous method using Future<V> object to receive results<NEW_LINE>Future<String> future = bean.test_fireAndReturnResults_await();<NEW_LINE>svLogger.info("Retrieving results");<NEW_LINE>try {<NEW_LINE>// get without wait<NEW_LINE>future.get(0, TimeUnit.MILLISECONDS);<NEW_LINE>fail("Expected TimeoutException did not occur");<NEW_LINE>} catch (TimeoutException te) {<NEW_LINE>// timeout exceeded as expected<NEW_LINE>svLogger.info("caught expected TimeoutException");<NEW_LINE>} finally {<NEW_LINE>// allow async method to run<NEW_LINE>ResultsStatelessLocalFutureBean.svTestLatch.countDown();<NEW_LINE>// wait to ensure async method has completed<NEW_LINE>ResultsStatelessLocalFutureBean.svBeanLatch.await(ResultsStatelessLocalFutureBean.MAX_ASYNC_WAIT, TimeUnit.MILLISECONDS);<NEW_LINE>}<NEW_LINE>// get current thread Id for comparison to bean method thread id<NEW_LINE>currentThreadId = Thread<MASK><NEW_LINE>svLogger.info("Test threadId = " + currentThreadId);<NEW_LINE>svLogger.info("Bean threadId = " + ResultsStatelessLocalFutureBean.beanThreadId);<NEW_LINE>assertFalse("Async Stateless Bean method executed on separate thread", (ResultsStatelessLocalFutureBean.beanThreadId == currentThreadId));<NEW_LINE>} | .currentThread().getId(); |
552,821 | public void apply(Project project) {<NEW_LINE>this.project = project;<NEW_LINE>project.getPlugins().apply(JavaPlugin.class);<NEW_LINE>ContractVerifierExtension extension = project.getExtensions().create(EXTENSION_NAME, ContractVerifierExtension.class);<NEW_LINE>JavaPluginConvention javaConvention = project.getConvention().getPlugin(JavaPluginConvention.class);<NEW_LINE>SourceSet <MASK><NEW_LINE>configureConfigurations();<NEW_LINE>registerContractTestTask(contractTestSourceSet);<NEW_LINE>TaskProvider<ContractsCopyTask> copyContracts = createAndConfigureCopyContractsTask(extension);<NEW_LINE>TaskProvider<GenerateClientStubsFromDslTask> generateClientStubs = createAndConfigureGenerateClientStubs(extension, copyContracts);<NEW_LINE>createAndConfigureStubsJarTasks(extension, generateClientStubs);<NEW_LINE>createGenerateTestsTask(extension, contractTestSourceSet, copyContracts);<NEW_LINE>createAndConfigurePublishStubsToScmTask(extension, generateClientStubs);<NEW_LINE>project.getDependencies().add(CONTRACT_TEST_GENERATOR_RUNTIME_CLASSPATH_CONFIGURATION_NAME, "org.springframework.cloud:spring-cloud-contract-converters:" + SPRING_CLOUD_VERSION);<NEW_LINE>project.afterEvaluate(inner -> {<NEW_LINE>DirectoryProperty generatedTestSourcesDir = extension.getGeneratedTestSourcesDir();<NEW_LINE>if (generatedTestSourcesDir.isPresent()) {<NEW_LINE>if (extension.getTestFramework().get() == TestFramework.SPOCK) {<NEW_LINE>project.getPlugins().withType(GroovyPlugin.class, groovyPlugin -> {<NEW_LINE>GroovySourceSet groovy = ((HasConvention) contractTestSourceSet).getConvention().getPlugin(GroovySourceSet.class);<NEW_LINE>groovy.getGroovy().srcDirs(generatedTestSourcesDir);<NEW_LINE>});<NEW_LINE>} else {<NEW_LINE>contractTestSourceSet.getJava().srcDirs(generatedTestSourcesDir);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} | contractTestSourceSet = configureSourceSets(extension, javaConvention); |
814,060 | private JComponent init() {<NEW_LINE>final JPanel result = new JPanel(new BorderLayout());<NEW_LINE>myLogModel = new DefaultListModel();<NEW_LINE>myLog = new JBList(myLogModel);<NEW_LINE>myLog.setCellRenderer(new FocusElementRenderer());<NEW_LINE>myAllocation = new JEditorPane();<NEW_LINE>final DefaultCaret caret = new DefaultCaret();<NEW_LINE>myAllocation.setCaret(caret);<NEW_LINE>caret.setUpdatePolicy(DefaultCaret.NEVER_UPDATE);<NEW_LINE>myAllocation.setEditable(false);<NEW_LINE>final Splitter splitter = new Splitter(true);<NEW_LINE>splitter.setFirstComponent(ScrollPaneFactory.createScrollPane(myLog));<NEW_LINE>splitter.setSecondComponent(ScrollPaneFactory.createScrollPane(myAllocation));<NEW_LINE>myLog.addListSelectionListener(this);<NEW_LINE>KeyboardFocusManager.getCurrentKeyboardFocusManager().addPropertyChangeListener(this);<NEW_LINE>result.add(splitter, BorderLayout.CENTER);<NEW_LINE>final DefaultActionGroup group = new DefaultActionGroup();<NEW_LINE>group.add(new ClearAction());<NEW_LINE>result.add(ActionManager.getInstance().createActionToolbar(ActionPlaces.UNKNOWN, group, true).<MASK><NEW_LINE>return result;<NEW_LINE>} | getComponent(), BorderLayout.NORTH); |
667,798 | ResourceElem addChild(String name, ResourceElem child) {<NEW_LINE>if (!isFolder) {<NEW_LINE>children = new ArrayList<ResourceElem>();<NEW_LINE>names = new ArrayList<String>();<NEW_LINE>content = null;<NEW_LINE>isFolder = true;<NEW_LINE>}<NEW_LINE>// NOI18N<NEW_LINE>assert name != null && name.indexOf("/") == -1 : (child.isFolder ? "<folder name=" : "<file name=") + name + " ...";<NEW_LINE>ResourceElem retVal = child;<NEW_LINE>int idx = names.indexOf(name);<NEW_LINE>if (idx == -1) {<NEW_LINE>names.add(name);<NEW_LINE>children.add(child);<NEW_LINE>} else {<NEW_LINE>// already exists<NEW_LINE>retVal = children.get(idx);<NEW_LINE>Set<URL> mergedContext <MASK><NEW_LINE>mergedContext.addAll(Arrays.asList(retVal.getUrlContext()));<NEW_LINE>mergedContext.addAll(Arrays.asList(child.getUrlContext()));<NEW_LINE>retVal.setUrlContext(mergedContext);<NEW_LINE>}<NEW_LINE>return retVal;<NEW_LINE>} | = new HashSet<URL>(); |
677,878 | public RegisterAppInstanceUserEndpointResult registerAppInstanceUserEndpoint(RegisterAppInstanceUserEndpointRequest registerAppInstanceUserEndpointRequest) throws AmazonServiceException, AmazonClientException {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(registerAppInstanceUserEndpointRequest);<NEW_LINE><MASK><NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<RegisterAppInstanceUserEndpointRequest> request = null;<NEW_LINE>Response<RegisterAppInstanceUserEndpointResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new RegisterAppInstanceUserEndpointRequestMarshaller().marshall(registerAppInstanceUserEndpointRequest);<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>Unmarshaller<RegisterAppInstanceUserEndpointResult, JsonUnmarshallerContext> unmarshaller = new RegisterAppInstanceUserEndpointResultJsonUnmarshaller();<NEW_LINE>JsonResponseHandler<RegisterAppInstanceUserEndpointResult> responseHandler = new JsonResponseHandler<RegisterAppInstanceUserEndpointResult>(unmarshaller);<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.ClientExecuteTime);<NEW_LINE>endClientExecution(awsRequestMetrics, request, response, LOGGING_AWS_REQUEST_METRIC);<NEW_LINE>}<NEW_LINE>} | AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); |
442,993 | public boolean apply(Game game, Ability source) {<NEW_LINE>Player player = game.getPlayer(source.getControllerId());<NEW_LINE>if (player == null) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>Cards allCards = new CardsImpl(player.getLibrary().getTopCards(game, 3));<NEW_LINE>player.revealCards(source, allCards, game);<NEW_LINE>Set<UUID> opponents = game.getOpponents(source.getControllerId());<NEW_LINE>if (!opponents.isEmpty()) {<NEW_LINE>Player opponent = null;<NEW_LINE>if (opponents.size() > 1) {<NEW_LINE>TargetOpponent targetOpponent = new TargetOpponent();<NEW_LINE>if (player.chooseTarget(Outcome.Neutral, targetOpponent, source, game)) {<NEW_LINE>opponent = game.getPlayer(targetOpponent.getFirstTarget());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (opponent == null) {<NEW_LINE>opponent = game.getPlayer(opponents.iterator().next());<NEW_LINE>}<NEW_LINE>TargetCard target = new TargetCard(0, allCards.size(), Zone.LIBRARY, new FilterCard("cards to put in the first pile"));<NEW_LINE>target.setNotTarget(true);<NEW_LINE>opponent.choose(Outcome.Neutral, allCards, target, game);<NEW_LINE>Cards pile1 = new CardsImpl(target.getTargets());<NEW_LINE>Cards pile2 = new CardsImpl(allCards);<NEW_LINE>pile2.removeAll(pile1);<NEW_LINE>player.revealCards(source, "Pile 1", pile1, game);<NEW_LINE>player.revealCards(source, "Pile 2", pile2, game);<NEW_LINE>postPileToLog("Pile 1", pile1<MASK><NEW_LINE>postPileToLog("Pile 2", pile2.getCards(game), game);<NEW_LINE>boolean pileChoice = player.choosePile(Outcome.Neutral, "Choose a pile to to put into your hand.", new ArrayList<>(pile1.getCards(game)), new ArrayList<>(pile2.getCards(game)), game);<NEW_LINE>game.informPlayers(player.getLogName() + " chose pile" + (pileChoice ? "1" : "2"));<NEW_LINE>player.moveCards(pileChoice ? pile1 : pile2, Zone.HAND, source, game);<NEW_LINE>player.putCardsOnBottomOfLibrary(pileChoice ? pile2 : pile1, game, source, true);<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>} | .getCards(game), game); |
1,175,591 | public Optional<RequestContainer> findRequestByIdish(String idish) {<NEW_LINE>Stack<String> splits = new Stack<String>();<NEW_LINE>splits.addAll(Arrays.asList(idish.split("/")));<NEW_LINE>if (splits.isEmpty()) {<NEW_LINE>throw new IllegalArgumentException("No id given");<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>Optional<String> colName = Optional.empty();<NEW_LINE>Optional<String> wsName = Optional.empty();<NEW_LINE>if (!splits.isEmpty()) {<NEW_LINE>colName = Optional.ofNullable(splits.pop());<NEW_LINE>}<NEW_LINE>if (!splits.isEmpty()) {<NEW_LINE>wsName = Optional.ofNullable(splits.pop());<NEW_LINE>}<NEW_LINE>Workspace ws = wsName.flatMap(this::findWorkspaceByIdish).orElse(currentWorkspace);<NEW_LINE>if (ws == null) {<NEW_LINE>throw new IllegalArgumentException("No workspace given");<NEW_LINE>}<NEW_LINE>Collection col = colName.flatMap(cn -> findCollectionByIdish(cn, ws)).orElse(currentCollection);<NEW_LINE>if (col == null) {<NEW_LINE>throw new IllegalArgumentException("No collection given");<NEW_LINE>}<NEW_LINE>return findMatching(reqName, col.getRequests(), RequestContainer::getName);<NEW_LINE>} | String reqName = splits.pop(); |
938,356 | public void userConfirm(String token, final Response.Listener<AccessToken> responseListener, final Response.ErrorListener errorListener) {<NEW_LINE>Object postBody = null;<NEW_LINE>// verify the required parameter 'token' is set<NEW_LINE>if (token == null) {<NEW_LINE>VolleyError error = new VolleyError("Missing the required parameter 'token' when calling userConfirm", new ApiException(400, "Missing the required parameter 'token' when calling userConfirm"));<NEW_LINE>}<NEW_LINE>// create path and map variables<NEW_LINE>String path = "/user/confirmEmail".replaceAll("\\{format\\}", "json");<NEW_LINE>// query params<NEW_LINE>List<Pair> queryParams = new ArrayList<Pair>();<NEW_LINE>// header params<NEW_LINE>Map<String, String> headerParams = new <MASK><NEW_LINE>// form params<NEW_LINE>Map<String, String> formParams = new HashMap<String, String>();<NEW_LINE>String[] contentTypes = { "application/json", "application/x-www-form-urlencoded" };<NEW_LINE>String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json";<NEW_LINE>if (contentType.startsWith("multipart/form-data")) {<NEW_LINE>// file uploading<NEW_LINE>MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create();<NEW_LINE>if (token != null) {<NEW_LINE>localVarBuilder.addTextBody("token", ApiInvoker.parameterToString(token), ApiInvoker.TEXT_PLAIN_UTF8);<NEW_LINE>}<NEW_LINE>HttpEntity httpEntity = localVarBuilder.build();<NEW_LINE>postBody = httpEntity;<NEW_LINE>} else {<NEW_LINE>// normal form params<NEW_LINE>formParams.put("token", ApiInvoker.parameterToString(token));<NEW_LINE>}<NEW_LINE>String[] authNames = new String[] {};<NEW_LINE>try {<NEW_LINE>apiInvoker.invokeAPI(basePath, path, "POST", queryParams, postBody, headerParams, formParams, contentType, authNames, new Response.Listener<String>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onResponse(String localVarResponse) {<NEW_LINE>try {<NEW_LINE>responseListener.onResponse((AccessToken) ApiInvoker.deserialize(localVarResponse, "", AccessToken.class));<NEW_LINE>} catch (ApiException exception) {<NEW_LINE>errorListener.onErrorResponse(new VolleyError(exception));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}, new Response.ErrorListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onErrorResponse(VolleyError error) {<NEW_LINE>errorListener.onErrorResponse(error);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} catch (ApiException ex) {<NEW_LINE>errorListener.onErrorResponse(new VolleyError(ex));<NEW_LINE>}<NEW_LINE>} | HashMap<String, String>(); |
140,506 | public CreateDatasetResult unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>CreateDatasetResult createDatasetResult = new CreateDatasetResult();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return createDatasetResult;<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("DatasetName", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>createDatasetResult.setDatasetName(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("DatasetArn", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>createDatasetResult.setDatasetArn(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("Status", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>createDatasetResult.setStatus(context.getUnmarshaller(String.<MASK><NEW_LINE>}<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return createDatasetResult;<NEW_LINE>} | class).unmarshall(context)); |
574,660 | public SetDefaultAuthorizerResult unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>SetDefaultAuthorizerResult setDefaultAuthorizerResult = new SetDefaultAuthorizerResult();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return setDefaultAuthorizerResult;<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("authorizerName", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>setDefaultAuthorizerResult.setAuthorizerName(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("authorizerArn", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>setDefaultAuthorizerResult.setAuthorizerArn(context.getUnmarshaller(String.<MASK><NEW_LINE>}<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return setDefaultAuthorizerResult;<NEW_LINE>} | class).unmarshall(context)); |
1,501,239 | public void visit(VisitableBuilder builder) {<NEW_LINE>Optional<String> resourceKind = Metadata.getKind(builder);<NEW_LINE>Optional<ObjectMeta> <MASK><NEW_LINE>if (!resourceKind.isPresent() || !objectMeta.isPresent()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (Utils.isNullOrEmpty(kind)) {<NEW_LINE>if (Utils.isNullOrEmpty(name)) {<NEW_LINE>builder.accept(visitor.withKind(resourceKind.get()).withMetadata(objectMeta.get()));<NEW_LINE>} else if (objectMeta.map(ObjectMeta::getName).filter(s -> s.equals(name)).isPresent()) {<NEW_LINE>builder.accept(visitor.withKind(resourceKind.get()).withMetadata(objectMeta.get()));<NEW_LINE>}<NEW_LINE>} else if (resourceKind.filter(k -> k.equals(kind)).isPresent()) {<NEW_LINE>if (Utils.isNullOrEmpty(name)) {<NEW_LINE>builder.accept(visitor.withKind(resourceKind.get()).withMetadata(objectMeta.get()));<NEW_LINE>} else if (objectMeta.map(ObjectMeta::getName).filter(s -> s.equals(name)).isPresent()) {<NEW_LINE>builder.accept(visitor.withKind(resourceKind.get()).withMetadata(objectMeta.get()));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | objectMeta = Metadata.getMetadata(builder); |
1,843,931 | protected ExecutionResult handleNonNullException(ExecutionContext executionContext, CompletableFuture<ExecutionResult> result, Throwable e) {<NEW_LINE>ExecutionResult executionResult = null;<NEW_LINE>List<GraphQLError> errors = ImmutableList.copyOf(executionContext.getErrors());<NEW_LINE>Throwable underlyingException = e;<NEW_LINE>if (e instanceof CompletionException) {<NEW_LINE>underlyingException = e.getCause();<NEW_LINE>}<NEW_LINE>if (underlyingException instanceof NonNullableFieldWasNullException) {<NEW_LINE>assertNonNullFieldPrecondition((NonNullableFieldWasNullException) underlyingException, result);<NEW_LINE>if (!result.isDone()) {<NEW_LINE>executionResult <MASK><NEW_LINE>result.complete(executionResult);<NEW_LINE>}<NEW_LINE>} else if (underlyingException instanceof AbortExecutionException) {<NEW_LINE>AbortExecutionException abortException = (AbortExecutionException) underlyingException;<NEW_LINE>executionResult = abortException.toExecutionResult();<NEW_LINE>result.complete(executionResult);<NEW_LINE>} else {<NEW_LINE>result.completeExceptionally(e);<NEW_LINE>}<NEW_LINE>return executionResult;<NEW_LINE>} | = new ExecutionResultImpl(null, errors); |
1,132,291 | public void initialize() {<NEW_LINE>this.viewModel = new GeneralPropertiesViewModel(databaseContext, dialogService, preferencesService, undoManager);<NEW_LINE>new ViewModelListCellFactory<Charset>().withText(Charset<MASK><NEW_LINE>encoding.disableProperty().bind(viewModel.encodingDisableProperty());<NEW_LINE>encoding.itemsProperty().bind(viewModel.encodingsProperty());<NEW_LINE>encoding.valueProperty().bindBidirectional(viewModel.selectedEncodingProperty());<NEW_LINE>new ViewModelListCellFactory<BibDatabaseMode>().withText(BibDatabaseMode::getFormattedName).install(databaseMode);<NEW_LINE>databaseMode.itemsProperty().bind(viewModel.databaseModesProperty());<NEW_LINE>databaseMode.valueProperty().bindBidirectional(viewModel.selectedDatabaseModeProperty());<NEW_LINE>generalFileDirectory.textProperty().bindBidirectional(viewModel.generalFileDirectoryPropertyProperty());<NEW_LINE>userSpecificFileDirectory.textProperty().bindBidirectional(viewModel.userSpecificFileDirectoryProperty());<NEW_LINE>laTexFileDirectory.textProperty().bindBidirectional(viewModel.laTexFileDirectoryProperty());<NEW_LINE>preamble.textProperty().bindBidirectional(viewModel.preambleProperty());<NEW_LINE>} | ::displayName).install(encoding); |
564,219 | final DeleteMembersResult executeDeleteMembers(DeleteMembersRequest deleteMembersRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(deleteMembersRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DeleteMembersRequest> request = null;<NEW_LINE>Response<DeleteMembersResult> response = null;<NEW_LINE>try {<NEW_LINE><MASK><NEW_LINE>try {<NEW_LINE>request = new DeleteMembersRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(deleteMembersRequest));<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, "DeleteMembers");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DeleteMembersResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DeleteMembersResultJsonUnmarshaller());<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,211,221 | public void onBindViewHolder(ViewHolderFileStorage holder, int position) {<NEW_LINE>FileDocument document = currentFiles.get(position);<NEW_LINE>holder.textViewFileName.setText(document.getName());<NEW_LINE>if (document.isFolder()) {<NEW_LINE>String items = getNumberItemChildren(document.getFile());<NEW_LINE>holder.textViewFileSize.setText(items);<NEW_LINE>} else {<NEW_LINE>long documentSize = document.getSize();<NEW_LINE>holder.textViewFileSize.setText(getSizeString(documentSize));<NEW_LINE>}<NEW_LINE>resetImageView(holder.imageView);<NEW_LINE>switch(mode) {<NEW_LINE>case PICK_FOLDER:<NEW_LINE>holder.itemLayout.setEnabled(isEnabled(position));<NEW_LINE>if (document.isFolder()) {<NEW_LINE>holder.imageView.setImageResource(R.drawable.ic_folder_list);<NEW_LINE>} else {<NEW_LINE>holder.imageView.setImageResource(MimeTypeList.typeForName(document.getName()).getIconResourceId());<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>case BROWSE_FILES:<NEW_LINE>if (document.isFolder()) {<NEW_LINE>holder.imageView.setImageResource(R.drawable.ic_folder_list);<NEW_LINE>} else {<NEW_LINE>holder.imageView.setImageResource(MimeTypeList.typeForName(document.getName()).getIconResourceId());<NEW_LINE>ThumbnailUtils.createThumbnailExplorer(context, document, holder, <MASK><NEW_LINE>}<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>} | this.megaApi, this, position); |
75,326 | public void copySystemTag(String srcResourceUuid, String srcResourceType, String dstResourceUuid, String dstResourceType, boolean inherent) {<NEW_LINE>String sql = "select stag" <MASK><NEW_LINE>TypedQuery<SystemTagVO> srcq = dbf.getEntityManager().createQuery(sql, SystemTagVO.class);<NEW_LINE>srcq.setParameter("ruuid", srcResourceUuid);<NEW_LINE>srcq.setParameter("rtype", srcResourceType);<NEW_LINE>srcq.setParameter("ih", inherent);<NEW_LINE>List<SystemTagVO> srctags = srcq.getResultList();<NEW_LINE>if (srctags.isEmpty()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>for (SystemTagVO stag : srctags) {<NEW_LINE>SystemTagVO ntag = new SystemTagVO(stag);<NEW_LINE>ntag.setUuid(Platform.getUuid());<NEW_LINE>ntag.setResourceType(dstResourceType);<NEW_LINE>ntag.setResourceUuid(dstResourceUuid);<NEW_LINE>dbf.getEntityManager().persist(ntag);<NEW_LINE>}<NEW_LINE>} | + " from SystemTagVO stag" + " where stag.resourceUuid = :ruuid" + " and stag.resourceType = :rtype" + " and stag.inherent = :ih"; |
1,820,256 | private void calcTickPath(@NonNull RectF bounds) {<NEW_LINE>final float left = bounds.left;<NEW_LINE>final float right = bounds.right;<NEW_LINE>final float top = bounds.top;<NEW_LINE>final float bottom = bounds.bottom;<NEW_LINE>// #117 Leaving 2px gap from bottom<NEW_LINE>float extraBottomInset = 2;<NEW_LINE>float width = right - left;<NEW_LINE>// choose a box at the left bottom corner which defines the width of the tick<NEW_LINE>float baseSize = width / 3f;<NEW_LINE>float tickBottomY = bottom - this.inset - extraBottomInset;<NEW_LINE>float tickWidth = (float) ((baseSize - this.inset - extraBottomInset) <MASK><NEW_LINE>float a = (float) (tickWidth / Math.sqrt(2));<NEW_LINE>float x0 = left + inset;<NEW_LINE>float y0 = tickBottomY - (baseSize - inset);<NEW_LINE>tickPath = new Path();<NEW_LINE>tickPath.setFillType(Path.FillType.INVERSE_EVEN_ODD);<NEW_LINE>tickPath.moveTo(x0, y0);<NEW_LINE>tickPath.lineTo(x0 + a, y0 - a);<NEW_LINE>tickPath.lineTo(baseSize, bottom - baseSize);<NEW_LINE>tickPath.lineTo(right - a - inset, top + a + inset);<NEW_LINE>tickPath.lineTo(right - inset, top + 2 * a + inset);<NEW_LINE>tickPath.lineTo(baseSize, tickBottomY);<NEW_LINE>tickPath.close();<NEW_LINE>// the remain parts outside the tick<NEW_LINE>tickBoundsPath = new Path();<NEW_LINE>tickBoundsPath.addRect(0, 0, inset, bottom, Path.Direction.CW);<NEW_LINE>tickBoundsPath.addRect(right - inset, 0, right, bottom, Path.Direction.CW);<NEW_LINE>tickBoundsPath.addRect(inset, 0, right - inset, top + a + inset, Path.Direction.CW);<NEW_LINE>tickBoundsPath.addRect(inset, tickBottomY, right - inset, bottom, Path.Direction.CW);<NEW_LINE>} | / Math.sqrt(2)); |
1,638,469 | public void openTorrent(String fileName, String save_path) {<NEW_LINE>String uc_filename = fileName.toUpperCase(Locale.US);<NEW_LINE>boolean is_remote = uc_filename.startsWith("HTTP://") || uc_filename.startsWith("HTTPS://") || uc_filename.startsWith("MAGNET:");<NEW_LINE>if (console != null) {<NEW_LINE>// System.out.println("NOT NULL CONSOLE. CAN PASS STRAIGHT TO IT!");<NEW_LINE>if (is_remote) {<NEW_LINE>console.out.println("Downloading torrent from url: " + fileName);<NEW_LINE>if (save_path == null) {<NEW_LINE>console.downloadRemoteTorrent(fileName);<NEW_LINE>} else {<NEW_LINE>console.downloadRemoteTorrent(fileName, save_path);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>console.out.println("Open Torrent " + fileName);<NEW_LINE>if (save_path == null) {<NEW_LINE>console.downloadTorrent(fileName);<NEW_LINE>} else {<NEW_LINE>console.downloadTorrent(fileName, save_path);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return;<NEW_LINE>} else {<NEW_LINE>// System.out.println("NULL CONSOLE");<NEW_LINE>}<NEW_LINE>if (is_remote) {<NEW_LINE>if (console != null) {<NEW_LINE>console.out.println("Downloading torrent from url: " + fileName);<NEW_LINE>}<NEW_LINE>if (save_path == null) {<NEW_LINE>TorrentDownloaderFactory.downloadManaged(fileName);<NEW_LINE>} else {<NEW_LINE>TorrentDownloaderFactory.downloadToLocationManaged(fileName, save_path);<NEW_LINE>}<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>if (!TorrentUtils.isTorrentFile(fileName)) {<NEW_LINE>// $NON-NLS-1$<NEW_LINE>System.err.println(fileName + " doesn't seem to be a torrent file. Not added.");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>System.err.println("Something is wrong with " + fileName + ". Not added. (Reason: " + e.getMessage() + ")");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (core.getGlobalManager() != null) {<NEW_LINE>try {<NEW_LINE>String downloadDir = save_path != null ? <MASK><NEW_LINE>if (console != null) {<NEW_LINE>console.out.println("Adding torrent: " + fileName + " and saving to " + downloadDir);<NEW_LINE>}<NEW_LINE>core.getGlobalManager().addDownloadManager(fileName, downloadDir);<NEW_LINE>} catch (Exception e) {<NEW_LINE>System.err.println("The torrent " + fileName + " could not be added. " + e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | save_path : COConfigurationManager.getDirectoryParameter("Default save path"); |
1,610,344 | public boolean process(ToOtaPackageStateServiceMsg msg) {<NEW_LINE>boolean isSuccess = false;<NEW_LINE>OtaPackageId targetOtaPackageId = new OtaPackageId(new UUID(msg.getOtaPackageIdMSB(), msg.getOtaPackageIdLSB()));<NEW_LINE>DeviceId deviceId = new DeviceId(new UUID(msg.getDeviceIdMSB(), msg.getDeviceIdLSB()));<NEW_LINE>TenantId tenantId = TenantId.fromUUID(new UUID(msg.getTenantIdMSB(), msg.getTenantIdLSB()));<NEW_LINE>OtaPackageType firmwareType = OtaPackageType.<MASK><NEW_LINE>long ts = msg.getTs();<NEW_LINE>Device device = deviceService.findDeviceById(tenantId, deviceId);<NEW_LINE>if (device == null) {<NEW_LINE>log.warn("[{}] [{}] Device was removed during firmware update msg was queued!", tenantId, deviceId);<NEW_LINE>} else {<NEW_LINE>OtaPackageId currentOtaPackageId = OtaPackageUtil.getOtaPackageId(device, firmwareType);<NEW_LINE>if (currentOtaPackageId == null) {<NEW_LINE>DeviceProfile deviceProfile = deviceProfileService.findDeviceProfileById(tenantId, device.getDeviceProfileId());<NEW_LINE>currentOtaPackageId = OtaPackageUtil.getOtaPackageId(deviceProfile, firmwareType);<NEW_LINE>}<NEW_LINE>if (targetOtaPackageId.equals(currentOtaPackageId)) {<NEW_LINE>update(device, otaPackageService.findOtaPackageInfoById(device.getTenantId(), targetOtaPackageId), ts);<NEW_LINE>isSuccess = true;<NEW_LINE>} else {<NEW_LINE>log.warn("[{}] [{}] Can`t update firmware for the device, target firmwareId: [{}], current firmwareId: [{}]!", tenantId, deviceId, targetOtaPackageId, currentOtaPackageId);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return isSuccess;<NEW_LINE>} | valueOf(msg.getType()); |
622,619 | public boolean doesOperationExistForCeilingEntity(PermissionType permissionType, String ceilingEntityFullyQualifiedName) {<NEW_LINE>// the ceiling may be an impl, which will fail because entity permission is normally specified for the interface<NEW_LINE>// try the passed in ceiling first, but also try an interfaces implemented<NEW_LINE>List<String> testClasses = new ArrayList<String>();<NEW_LINE>testClasses.add(ceilingEntityFullyQualifiedName);<NEW_LINE>try {<NEW_LINE>for (Object interfaze : ClassUtils.getAllInterfaces(Class.forName(ceilingEntityFullyQualifiedName))) {<NEW_LINE>testClasses.add(((Class<?><MASK><NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new RuntimeException(e);<NEW_LINE>}<NEW_LINE>for (String testClass : testClasses) {<NEW_LINE>Query query = em.createNamedQuery("BC_COUNT_PERMISSIONS_BY_TYPE_AND_CEILING_ENTITY");<NEW_LINE>query.setParameter("type", permissionType.getType());<NEW_LINE>query.setParameter("ceilingEntity", testClass);<NEW_LINE>query.setHint(QueryHints.HINT_CACHEABLE, true);<NEW_LINE>query.setHint(QueryHints.HINT_CACHE_REGION, "blAdminSecurityQuery");<NEW_LINE>Long count = (Long) query.getSingleResult();<NEW_LINE>if (count > 0) {<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>} | ) interfaze).getName()); |
1,478,928 | /* (non-Javadoc)<NEW_LINE>* @see org.eclipse.ui.dialogs.FilteredItemsSelectionDialog#fillContentProvider(org.eclipse.ui.dialogs.FilteredItemsSelectionDialog.AbstractContentProvider, org.eclipse.ui.dialogs.FilteredItemsSelectionDialog.ItemsFilter, org.eclipse.core.runtime.IProgressMonitor)<NEW_LINE>*/<NEW_LINE>protected void fillContentProvider(final AbstractContentProvider contentProvider, final ItemsFilter itemsFilter, final IProgressMonitor progressMonitor) throws CoreException {<NEW_LINE>final Spec spec = Activator.getSpecManager().getSpecLoaded();<NEW_LINE>// On the initial/welcome page, no spec is open.<NEW_LINE>if (spec != null) {<NEW_LINE>// Models<NEW_LINE>final Collection<Model> models = spec.getAdapter(TLCSpec.class).getModels().values();<NEW_LINE>for (final Model model : models) {<NEW_LINE>if (itemsFilter.isConsistentItem(model)) {<NEW_LINE>contentProvider.add(model, itemsFilter);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Modules<NEW_LINE>final List<Module> modules = spec.getModules();<NEW_LINE>if (modules.size() > 0) {<NEW_LINE>contentProvider.add(modulesSep, itemsFilter);<NEW_LINE>for (Module module : modules) {<NEW_LINE>if (itemsFilter.isConsistentItem(module)) {<NEW_LINE>contentProvider.add(module, itemsFilter);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// All closed specs<NEW_LINE>if (toggleShowSpecAction.isChecked()) {<NEW_LINE>final Spec[] specs = Activator<MASK><NEW_LINE>if (specs.length > 0) {<NEW_LINE>contentProvider.add(specsSep, itemsFilter);<NEW_LINE>for (int i = 0; i < specs.length; i++) {<NEW_LINE>final Spec aSpec = specs[i];<NEW_LINE>if (!aSpec.equals(spec) && itemsFilter.isConsistentItem(aSpec)) {<NEW_LINE>contentProvider.add(aSpec, itemsFilter);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | .getSpecManager().getRecentlyOpened(); |
1,718,094 | final RemoveTagsResult executeRemoveTags(RemoveTagsRequest removeTagsRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(removeTagsRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<RemoveTagsRequest> request = null;<NEW_LINE>Response<RemoveTagsResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new RemoveTagsRequestMarshaller().marshall(super.beforeMarshalling(removeTagsRequest));<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, "Elastic Load Balancing");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "RemoveTags");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>StaxResponseHandler<RemoveTagsResult> responseHandler = new StaxResponseHandler<RemoveTagsResult>(new RemoveTagsResultStaxUnmarshaller());<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()); |
277,807 | private void ajaxChangePermissions(final Project project, final HashMap<String, Object> ret, final HttpServletRequest req, final User user) throws ServletException {<NEW_LINE>final boolean admin = Boolean.parseBoolean(getParam(req, "permissions[admin]"));<NEW_LINE>final boolean read = Boolean.parseBoolean(getParam(req, "permissions[read]"));<NEW_LINE>final boolean write = Boolean.parseBoolean(getParam(req, "permissions[write]"));<NEW_LINE>final boolean execute = Boolean.parseBoolean(getParam(req, "permissions[execute]"));<NEW_LINE>final boolean schedule = Boolean.parseBoolean<MASK><NEW_LINE>final boolean group = Boolean.parseBoolean(getParam(req, "group"));<NEW_LINE>final String name = getParam(req, "name");<NEW_LINE>final Permission perm;<NEW_LINE>if (group) {<NEW_LINE>perm = project.getGroupPermission(name);<NEW_LINE>} else {<NEW_LINE>perm = project.getUserPermission(name);<NEW_LINE>}<NEW_LINE>if (perm == null) {<NEW_LINE>ret.put(ERROR_PARAM, "Permissions for " + name + " cannot be found.");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (admin || read || write || execute || schedule) {<NEW_LINE>if (admin) {<NEW_LINE>perm.setPermission(Type.ADMIN, true);<NEW_LINE>perm.setPermission(Type.READ, false);<NEW_LINE>perm.setPermission(Type.WRITE, false);<NEW_LINE>perm.setPermission(Type.EXECUTE, false);<NEW_LINE>perm.setPermission(Type.SCHEDULE, false);<NEW_LINE>} else {<NEW_LINE>perm.setPermission(Type.ADMIN, false);<NEW_LINE>perm.setPermission(Type.READ, read);<NEW_LINE>perm.setPermission(Type.WRITE, write);<NEW_LINE>perm.setPermission(Type.EXECUTE, execute);<NEW_LINE>perm.setPermission(Type.SCHEDULE, schedule);<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>this.projectManager.updateProjectPermission(project, name, perm, group, user);<NEW_LINE>} catch (final ProjectManagerException e) {<NEW_LINE>ret.put(ERROR_PARAM, e.getMessage());<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>try {<NEW_LINE>this.projectManager.removeProjectPermission(project, name, group, user);<NEW_LINE>} catch (final ProjectManagerException e) {<NEW_LINE>ret.put(ERROR_PARAM, e.getMessage());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | (getParam(req, "permissions[schedule]")); |
1,612,969 | // find_among_b is for backwards processing. Same comments apply<NEW_LINE>protected int find_among_b(Among[] v) {<NEW_LINE>int i = 0;<NEW_LINE>int j = v.length;<NEW_LINE>int c = cursor;<NEW_LINE>int lb = limit_backward;<NEW_LINE>int common_i = 0;<NEW_LINE>int common_j = 0;<NEW_LINE>boolean first_key_inspected = false;<NEW_LINE>while (true) {<NEW_LINE>int k = i + ((j - i) >> 1);<NEW_LINE>int diff = 0;<NEW_LINE>int common <MASK><NEW_LINE>Among w = v[k];<NEW_LINE>int i2;<NEW_LINE>for (i2 = w.s.length - 1 - common; i2 >= 0; i2--) {<NEW_LINE>if (c - common == lb) {<NEW_LINE>diff = -1;<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>diff = current[c - 1 - common] - w.s[i2];<NEW_LINE>if (diff != 0)<NEW_LINE>break;<NEW_LINE>common++;<NEW_LINE>}<NEW_LINE>if (diff < 0) {<NEW_LINE>j = k;<NEW_LINE>common_j = common;<NEW_LINE>} else {<NEW_LINE>i = k;<NEW_LINE>common_i = common;<NEW_LINE>}<NEW_LINE>if (j - i <= 1) {<NEW_LINE>if (i > 0)<NEW_LINE>break;<NEW_LINE>if (j == i)<NEW_LINE>break;<NEW_LINE>if (first_key_inspected)<NEW_LINE>break;<NEW_LINE>first_key_inspected = true;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>Among w = v[i];<NEW_LINE>if (common_i >= w.s.length) {<NEW_LINE>cursor = c - w.s.length;<NEW_LINE>if (w.method == null)<NEW_LINE>return w.result;<NEW_LINE>boolean res = false;<NEW_LINE>try {<NEW_LINE>res = (boolean) w.method.invokeExact(this);<NEW_LINE>} catch (Error | RuntimeException e) {<NEW_LINE>throw e;<NEW_LINE>} catch (Throwable e) {<NEW_LINE>throw new UndeclaredThrowableException(e);<NEW_LINE>}<NEW_LINE>cursor = c - w.s.length;<NEW_LINE>if (res)<NEW_LINE>return w.result;<NEW_LINE>}<NEW_LINE>i = w.substring_i;<NEW_LINE>if (i < 0)<NEW_LINE>return 0;<NEW_LINE>}<NEW_LINE>} | = common_i < common_j ? common_i : common_j; |
1,396,145 | final DeleteFileShareResult executeDeleteFileShare(DeleteFileShareRequest deleteFileShareRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(deleteFileShareRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DeleteFileShareRequest> request = null;<NEW_LINE>Response<DeleteFileShareResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DeleteFileShareRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(deleteFileShareRequest));<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, "DeleteFileShare");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DeleteFileShareResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DeleteFileShareResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>} | endClientExecution(awsRequestMetrics, request, response); |
138,368 | public void prepare(PreparedStatement statement) throws SQLException {<NEW_LINE>// Found for all providers<NEW_LINE>statement.setString(1, info.getName());<NEW_LINE>statement.setString(2, info.getText());<NEW_LINE>Sql.setStringOrNull(statement, 3, info.getDescription().orElse(null));<NEW_LINE>statement.setInt(4, info.getPriority());<NEW_LINE>Sql.setStringOrNull(statement, 5, info.getCondition().orElse(null));<NEW_LINE>statement.setBoolean(6, info.isShownInPlayersTable());<NEW_LINE>// Specific provider cases<NEW_LINE>statement.setBoolean(7, info.isHidden());<NEW_LINE>Sql.setStringOrNull(statement, 8, info.getProvidedCondition());<NEW_LINE>Sql.setStringOrNull(statement, 9, info.getFormatType().map(FormatType::name).orElse(null));<NEW_LINE>statement.setBoolean(10, info.isPlayerName());<NEW_LINE>// Found for all providers<NEW_LINE>ExtensionTabTable.set3TabValuesToStatement(statement, 11, info.getTab().orElse(null), info.getPluginName(), serverUUID);<NEW_LINE>ExtensionIconTable.set3IconValuesToStatement(statement, 14, info.getIcon());<NEW_LINE>ExtensionPluginTable.set2PluginValuesToStatement(statement, 17, <MASK><NEW_LINE>} | info.getPluginName(), serverUUID); |
824,426 | private boolean sameScalar(ScalarValue want, JsonObject parent, String name) throws Exception {<NEW_LINE>trace("comparing object scalar property " + name);<NEW_LINE><MASK><NEW_LINE>if (want instanceof StringValue) {<NEW_LINE>return sameString(((StringValue) want).getValue(), regexp, parent.getString(name));<NEW_LINE>}<NEW_LINE>if (want instanceof LongValue) {<NEW_LINE>return sameString(longToString(((LongValue) want).getValue()), regexp, longToString(parent.getJsonNumber(name).longValue()));<NEW_LINE>}<NEW_LINE>if (want instanceof IntValue) {<NEW_LINE>return sameString(intToString(((IntValue) want).getValue()), regexp, intToString(parent.getInt(name)));<NEW_LINE>}<NEW_LINE>if (want instanceof DoubleValue) {<NEW_LINE>return sameString(doubleToString(((DoubleValue) want).getValue()), regexp, doubleToString(parent.getJsonNumber(name).doubleValue()));<NEW_LINE>}<NEW_LINE>if (want instanceof BooleanValue) {<NEW_LINE>return sameString(booleanToString(((BooleanValue) want).getValue()), regexp, booleanToString(parent.getBoolean(name)));<NEW_LINE>}<NEW_LINE>throw new AssertionError(want + " is not a valid scalar type. Valid types are string, long, int, double, boolean");<NEW_LINE>} | String regexp = want.getRegexp(); |
1,223,865 | public void marshall(RegionDescription regionDescription, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (regionDescription == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(regionDescription.getDirectoryId(), DIRECTORYID_BINDING);<NEW_LINE>protocolMarshaller.marshall(regionDescription.getRegionName(), REGIONNAME_BINDING);<NEW_LINE>protocolMarshaller.marshall(regionDescription.getRegionType(), REGIONTYPE_BINDING);<NEW_LINE>protocolMarshaller.marshall(regionDescription.getStatus(), STATUS_BINDING);<NEW_LINE>protocolMarshaller.marshall(regionDescription.getVpcSettings(), VPCSETTINGS_BINDING);<NEW_LINE>protocolMarshaller.marshall(<MASK><NEW_LINE>protocolMarshaller.marshall(regionDescription.getLaunchTime(), LAUNCHTIME_BINDING);<NEW_LINE>protocolMarshaller.marshall(regionDescription.getStatusLastUpdatedDateTime(), STATUSLASTUPDATEDDATETIME_BINDING);<NEW_LINE>protocolMarshaller.marshall(regionDescription.getLastUpdatedDateTime(), LASTUPDATEDDATETIME_BINDING);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>} | regionDescription.getDesiredNumberOfDomainControllers(), DESIREDNUMBEROFDOMAINCONTROLLERS_BINDING); |
1,056,924 | final DescribeScalingActivitiesResult executeDescribeScalingActivities(DescribeScalingActivitiesRequest describeScalingActivitiesRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(describeScalingActivitiesRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DescribeScalingActivitiesRequest> request = null;<NEW_LINE>Response<DescribeScalingActivitiesResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DescribeScalingActivitiesRequestMarshaller().marshall(super.beforeMarshalling(describeScalingActivitiesRequest));<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, "Auto Scaling");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DescribeScalingActivities");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>StaxResponseHandler<DescribeScalingActivitiesResult> responseHandler = new StaxResponseHandler<DescribeScalingActivitiesResult>(new DescribeScalingActivitiesResultStaxUnmarshaller());<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()); |
158,022 | protected Control createDialogArea(Composite parent) {<NEW_LINE>Composite area = (Composite) super.createDialogArea(parent);<NEW_LINE>Composite editArea = new <MASK><NEW_LINE>FormLayout layout = new FormLayout();<NEW_LINE>layout.marginWidth = 5;<NEW_LINE>layout.marginHeight = 5;<NEW_LINE>editArea.setLayout(layout);<NEW_LINE>createFormElements(editArea);<NEW_LINE>// $NON-NLS-1$<NEW_LINE>IObservableValue<IStatus> // $NON-NLS-1$<NEW_LINE>calculationStatus = BeanProperties.value("calculationStatus", IStatus.class).observe(model);<NEW_LINE>this.context.addValidationStatusProvider(new MultiValidator() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>protected IStatus validate() {<NEW_LINE>return calculationStatus.getValue();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>// $NON-NLS-1$<NEW_LINE>IObservableValue<?> observable = PojoProperties.value("status").observe(status);<NEW_LINE>context.bindValue(observable, new AggregateValidationStatus(context, AggregateValidationStatus.MAX_SEVERITY));<NEW_LINE>return editArea;<NEW_LINE>} | Composite(area, SWT.NONE); |
653,502 | private RemittanceAdviceLineInvoiceDetails buildInvoiceDetailsForRemittanceLine(@NonNull final I_C_Invoice invoice, @NonNull final RemittanceAdvice remittanceAdvice, @NonNull final RemittanceAdviceLine remittanceAdviceLine) {<NEW_LINE>final CurrencyCode remittanceAdviceCurrencyCode = remittanceAdviceLine.getRemittedAmount().getCurrencyCode();<NEW_LINE>final CurrencyCode invoiceCurrencyCode = moneyService.getCurrencyCodeByCurrencyId(CurrencyId.ofRepoId(invoice.getC_Currency_ID()));<NEW_LINE>final Amount invoiceAmtInREMADVCurrency = remittanceAdviceCurrencyCode.equals(invoiceCurrencyCode) ? Amount.of(invoice.getGrandTotal(), remittanceAdviceCurrencyCode) : getInvoiceAmountInRemAdvCurrency(remittanceAdvice.getRemittedAmountCurrencyId(), invoice);<NEW_LINE>Amount overUnderAmt = remittanceAdviceLine.getRemittedAmount();<NEW_LINE>final Amount serviceFeeInREMADVCurrency = getServiceFeeInREMADVCurrency(remittanceAdviceLine).orElse<MASK><NEW_LINE>overUnderAmt = overUnderAmt.add(serviceFeeInREMADVCurrency);<NEW_LINE>if (remittanceAdviceLine.getPaymentDiscountAmount() != null) {<NEW_LINE>overUnderAmt = overUnderAmt.add(remittanceAdviceLine.getPaymentDiscountAmount());<NEW_LINE>}<NEW_LINE>overUnderAmt = overUnderAmt.subtract(invoiceAmtInREMADVCurrency);<NEW_LINE>final I_C_DocType invoiceDocType = docTypeDAO.getById(invoice.getC_DocTypeTarget_ID());<NEW_LINE>return RemittanceAdviceLineInvoiceDetails.builder().invoiceId(InvoiceId.ofRepoId(invoice.getC_Invoice_ID())).billBPartnerId(BPartnerId.ofRepoId(invoice.getC_BPartner_ID())).invoiceAmt(invoice.getGrandTotal()).invoiceCurrencyId(CurrencyId.ofRepoId(invoice.getC_Currency_ID())).invoiceAmtInREMADVCurrency(invoiceAmtInREMADVCurrency).overUnderAmtInREMADVCurrency(overUnderAmt).invoiceDocType(invoiceDocType.getDocBaseType()).invoiceDate(TimeUtil.asInstant(invoice.getDateInvoiced())).build();<NEW_LINE>} | (Amount.zero(remittanceAdviceCurrencyCode)); |
1,162,146 | private static void writeInspectionDiff(final String oldPath, final String newPath, final String outPath) {<NEW_LINE>try {<NEW_LINE>InputStream oldStream = oldPath != null ? new BufferedInputStream(new FileInputStream(oldPath)) : null;<NEW_LINE>InputStream newStream = new <MASK><NEW_LINE>Document oldDoc = oldStream != null ? JDOMUtil.loadDocument(oldStream) : null;<NEW_LINE>Document newDoc = JDOMUtil.loadDocument(newStream);<NEW_LINE>OutputStream outStream = System.out;<NEW_LINE>if (outPath != null) {<NEW_LINE>outStream = new BufferedOutputStream(new FileOutputStream(outPath + File.separator + new File(newPath).getName()));<NEW_LINE>}<NEW_LINE>Document delta = createDelta(oldDoc, newDoc);<NEW_LINE>JDOMUtil.writeDocument(delta, outStream, "\n");<NEW_LINE>if (outStream != System.out) {<NEW_LINE>outStream.close();<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>e.printStackTrace();<NEW_LINE>}<NEW_LINE>} | BufferedInputStream(new FileInputStream(newPath)); |
1,347,589 | private void doSearch(ActionEvent e) {<NEW_LINE>boolean expand = e.getSource() == searchAndExpandButton;<NEW_LINE><MASK><NEW_LINE>if (StringUtils.isEmpty(wordToSearch)) {<NEW_LINE>this.lastSearchConditions = null;<NEW_LINE>return;<NEW_LINE>} else {<NEW_LINE>this.lastSearchConditions = Triple.of(wordToSearch, isCaseSensitiveCB.isSelected(), isRegexpCB.isSelected());<NEW_LINE>}<NEW_LINE>// reset previous result<NEW_LINE>ActionRouter.getInstance().doActionNow(new ActionEvent(e.getSource(), e.getID(), ActionNames.SEARCH_RESET));<NEW_LINE>// do search<NEW_LINE>Searcher searcher = createSearcher(wordToSearch);<NEW_LINE>GuiPackage guiPackage = GuiPackage.getInstance();<NEW_LINE>guiPackage.beginUndoTransaction();<NEW_LINE>int numberOfMatches = 0;<NEW_LINE>try {<NEW_LINE>Pair<Integer, Set<JMeterTreeNode>> result = searchInTree(guiPackage, searcher, wordToSearch);<NEW_LINE>numberOfMatches = result.getLeft();<NEW_LINE>markConcernedNodes(expand, result.getRight());<NEW_LINE>} finally {<NEW_LINE>guiPackage.endUndoTransaction();<NEW_LINE>}<NEW_LINE>GuiPackage.getInstance().getMainFrame().repaint();<NEW_LINE>searchTF.requestFocusInWindow();<NEW_LINE>statusLabel.setText(MessageFormat.format(JMeterUtils.getResString("search_tree_matches"), numberOfMatches));<NEW_LINE>} | String wordToSearch = searchTF.getText(); |
1,593,557 | protected void encodeLabel(FacesContext context, CascadeSelect cascadeSelect, List<SelectItem> itemList, String valueToRender) throws IOException {<NEW_LINE>ResponseWriter writer = context.getResponseWriter();<NEW_LINE>Converter converter = ComponentUtils.getConverter(context, cascadeSelect);<NEW_LINE>String itemLabel = valueToRender;<NEW_LINE>SelectItem foundItem = findSelectItemByValue(context, cascadeSelect, converter, itemList, valueToRender);<NEW_LINE>if (foundItem != null) {<NEW_LINE>itemLabel = foundItem.getLabel();<NEW_LINE>}<NEW_LINE>String placeholder = LangUtils.isNotBlank(itemLabel) ? itemLabel : cascadeSelect.getPlaceholder();<NEW_LINE>String styleClass = getStyleClassBuilder(context).add(placeholder != null, CascadeSelect.LABEL_CLASS).add(placeholder == null, CascadeSelect.LABEL_EMPTY_CLASS).build();<NEW_LINE>writer.startElement("span", null);<NEW_LINE>writer.<MASK><NEW_LINE>if (LangUtils.isNotBlank(placeholder)) {<NEW_LINE>writer.writeText(placeholder, null);<NEW_LINE>}<NEW_LINE>writer.endElement("span");<NEW_LINE>} | writeAttribute("class", styleClass, null); |
914,542 | static int encodeUTF8(CharSequence text, boolean nullTerminated, long target) {<NEW_LINE>int i = 0, len = text.length(), p = 0;<NEW_LINE>char c;<NEW_LINE>// ASCII fast path<NEW_LINE>while (i < len && (c = text.charAt(i)) < 0x80) {<NEW_LINE>UNSAFE.putByte(target + p++, (byte) c);<NEW_LINE>i++;<NEW_LINE>}<NEW_LINE>// Slow path<NEW_LINE>while (i < len) {<NEW_LINE>c = text.charAt(i++);<NEW_LINE>if (c < 0x80) {<NEW_LINE>UNSAFE.putByte(target + p++, (byte) c);<NEW_LINE>} else {<NEW_LINE>int cp = c;<NEW_LINE>if (c < 0x800) {<NEW_LINE>UNSAFE.putByte(target + p++, (byte) (0xC0 | cp >> 6));<NEW_LINE>} else {<NEW_LINE>if (!isHighSurrogate(c)) {<NEW_LINE>UNSAFE.putByte(target + p++, (byte) (0xE0 | cp >> 12));<NEW_LINE>} else {<NEW_LINE>cp = toCodePoint(c, <MASK><NEW_LINE>UNSAFE.putByte(target + p++, (byte) (0xF0 | cp >> 18));<NEW_LINE>UNSAFE.putByte(target + p++, (byte) (0x80 | cp >> 12 & 0x3F));<NEW_LINE>}<NEW_LINE>UNSAFE.putByte(target + p++, (byte) (0x80 | cp >> 6 & 0x3F));<NEW_LINE>}<NEW_LINE>UNSAFE.putByte(target + p++, (byte) (0x80 | cp & 0x3F));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (nullTerminated) {<NEW_LINE>// TODO: did we have a bug here?<NEW_LINE>UNSAFE.putByte(target + p++, (byte) 0);<NEW_LINE>}<NEW_LINE>return p;<NEW_LINE>} | text.charAt(i++)); |
666,821 | public void configure(Map conf) {<NEW_LINE>this.stormConf = conf;<NEW_LINE>topic = getConfig("kafka.topic", "jstorm");<NEW_LINE>zkRoot = getConfig("storm.zookeeper.root", "/jstorm");<NEW_LINE>String zkHosts = getConfig("kafka.zookeeper.hosts", "127.0.0.1:2181");<NEW_LINE>zkServers = convertHosts(zkHosts, 2181);<NEW_LINE>String brokerHosts = getConfig("kafka.broker.hosts", "127.0.0.1:9092");<NEW_LINE>brokers = convertHosts(brokerHosts, 9092);<NEW_LINE>numPartitions = JStormUtils.parseInt(getConfig("kafka.broker.partitions"), 1);<NEW_LINE>fetchMaxBytes = JStormUtils.parseInt(getConfig("kafka.fetch.max.bytes"), 256 * 1024);<NEW_LINE>fetchWaitMaxMs = JStormUtils.parseInt(getConfig("kafka.fetch.wait.max.ms"), 10000);<NEW_LINE>socketTimeoutMs = JStormUtils.parseInt(getConfig("kafka.socket.timeout.ms"), 30 * 1000);<NEW_LINE>socketReceiveBufferBytes = JStormUtils.parseInt(getConfig<MASK><NEW_LINE>fromBeginning = JStormUtils.parseBoolean(getConfig("kafka.fetch.from.beginning"), false);<NEW_LINE>startOffsetTime = JStormUtils.parseInt(getConfig("kafka.start.offset.time"), -1);<NEW_LINE>offsetUpdateIntervalMs = JStormUtils.parseInt(getConfig("kafka.offset.update.interval.ms"), 2000);<NEW_LINE>clientId = getConfig("kafka.client.id", "jstorm");<NEW_LINE>batchSendCount = JStormUtils.parseInt(getConfig("kafka.spout.batch.send.count"), 1);<NEW_LINE>} | ("kafka.socket.receive.buffer.bytes"), 64 * 1024); |
1,502,074 | public StartupCommand[] initialize() {<NEW_LINE>Map<String, MockVMVO> vmsMaps = _simMgr.getVms(this.hostGuid);<NEW_LINE>totalCpu = agentHost.getCpuCount() * agentHost.getCpuSpeed();<NEW_LINE>totalMem = agentHost.getMemorySize();<NEW_LINE>for (Map.Entry<String, MockVMVO> entry : vmsMaps.entrySet()) {<NEW_LINE>MockVMVO vm = entry.getValue();<NEW_LINE>usedCpu += vm.getCpu();<NEW_LINE>usedMem += vm.getMemory();<NEW_LINE>_runningVms.put(entry.getKey(), new Pair<Long, Long>(Long.valueOf(vm.getCpu()), vm.getMemory()));<NEW_LINE>}<NEW_LINE>List<Object> info = getHostInfo();<NEW_LINE>StartupRoutingCommand cmd = new StartupRoutingCommand((Integer) info.get(0), (Long) info.get(1), (Long) info.get(2), (Long) info.get(4), (String) info.get(3), <MASK><NEW_LINE>Map<String, String> hostDetails = new HashMap<String, String>();<NEW_LINE>hostDetails.put(RouterPrivateIpStrategy.class.getCanonicalName(), RouterPrivateIpStrategy.DcGlobal.toString());<NEW_LINE>cmd.setHostDetails(hostDetails);<NEW_LINE>cmd.setAgentTag("agent-simulator");<NEW_LINE>cmd.setPrivateIpAddress(agentHost.getPrivateIpAddress());<NEW_LINE>cmd.setPrivateNetmask(agentHost.getPrivateNetMask());<NEW_LINE>cmd.setPrivateMacAddress(agentHost.getPrivateMacAddress());<NEW_LINE>cmd.setStorageIpAddress(agentHost.getStorageIpAddress());<NEW_LINE>cmd.setStorageNetmask(agentHost.getStorageNetMask());<NEW_LINE>cmd.setStorageMacAddress(agentHost.getStorageMacAddress());<NEW_LINE>cmd.setStorageIpAddressDeux(agentHost.getStorageIpAddress());<NEW_LINE>cmd.setStorageNetmaskDeux(agentHost.getStorageNetMask());<NEW_LINE>cmd.setStorageMacAddressDeux(agentHost.getStorageIpAddress());<NEW_LINE>cmd.setName(agentHost.getName());<NEW_LINE>cmd.setGuid(agentHost.getGuid());<NEW_LINE>cmd.setVersion(agentHost.getVersion());<NEW_LINE>cmd.setHypervisorVersion(agentHost.getVersion());<NEW_LINE>cmd.setAgentTag("agent-simulator");<NEW_LINE>cmd.setDataCenter(String.valueOf(agentHost.getDataCenterId()));<NEW_LINE>cmd.setPod(String.valueOf(agentHost.getPodId()));<NEW_LINE>cmd.setCluster(String.valueOf(agentHost.getClusterId()));<NEW_LINE>StartupStorageCommand ssCmd = initializeLocalSR();<NEW_LINE>return new StartupCommand[] { cmd, ssCmd };<NEW_LINE>} | HypervisorType.Simulator, RouterPrivateIpStrategy.HostLocal); |
245,435 | private void processExternalSystemRequest(@NonNull final Exchange exchange) {<NEW_LINE>final var request = exchange.getIn().getBody(JsonExternalSystemRequest.class);<NEW_LINE>exchange.getIn().setHeader(HEADER_TARGET_ROUTE, request.getExternalSystemName().getName() + <MASK><NEW_LINE>exchange.getIn().setHeader(HEADER_TRACE_ID, request.getTraceId());<NEW_LINE>if (request.getAdPInstanceId() != null) {<NEW_LINE>exchange.getIn().setHeader(HEADER_PINSTANCE_ID, request.getAdPInstanceId().getValue());<NEW_LINE>}<NEW_LINE>if (EmptyUtil.isNotBlank(request.getWriteAuditEndpoint())) {<NEW_LINE>exchange.getIn().setHeader(HEADER_AUDIT_TRAIL, request.getWriteAuditEndpoint());<NEW_LINE>}<NEW_LINE>if (request.getParameters() != null && Check.isNotBlank(request.getParameters().get(PARAM_CHILD_CONFIG_VALUE))) {<NEW_LINE>exchange.getIn().setHeader(HEADER_EXTERNAL_SYSTEM_VALUE, request.getParameters().get(PARAM_CHILD_CONFIG_VALUE));<NEW_LINE>}<NEW_LINE>} | "-" + request.getCommand()); |
340,466 | private CharSequence generateCCharPointerBinaryOutputInit(CodeBuilder builder, CharSequence marshalledParametersOutputVar, MethodData methodData, List<Integer> customParameters, CharSequence staticBufferVar, int staticBufferSize) {<NEW_LINE>CharSequence sizeVar = "marshalledParametersSizeEstimate";<NEW_LINE>List<? extends VariableElement> parameters = methodData.element.getParameters();<NEW_LINE>List<Map.Entry<MarshallerData, CharSequence>> marshallers = new ArrayList<>();<NEW_LINE>for (int index : customParameters) {<NEW_LINE>marshallers.add(new SimpleImmutableEntry<>(methodData.getParameterMarshaller(index), parameters.get(<MASK><NEW_LINE>}<NEW_LINE>generateSizeEstimate(builder, sizeVar, marshallers);<NEW_LINE>return new CodeBuilder(builder).write(typeCache.cCharPointerBinaryOutput).space().write(marshalledParametersOutputVar).write(" = ").write(sizeVar).write(" > ").write(Integer.toString(staticBufferSize)).write(" ? ").invokeStatic(typeCache.cCharPointerBinaryOutput, "create", sizeVar).write(" : ").invokeStatic(typeCache.binaryOutput, "create", staticBufferVar, Integer.toString(staticBufferSize), "false").build();<NEW_LINE>} | index).getSimpleName())); |
858,764 | public IAllocationResult unload(final IAllocationRequest request) {<NEW_LINE>//<NEW_LINE>// If there are no sources, we have nothing to unload<NEW_LINE>if (sources.isEmpty()) {<NEW_LINE>return AllocationUtils.nullResult();<NEW_LINE>}<NEW_LINE>//<NEW_LINE>// Create the inial result: we are starting from how much we need to allocate<NEW_LINE>final IMutableAllocationResult resultFinal = AllocationUtils.<MASK><NEW_LINE>//<NEW_LINE>// Iterate sources and try to unload from each of them.<NEW_LINE>// But don't use ForceQtyAllocation because we want to unload from those sources which have something to be unloaded,<NEW_LINE>// with one exception: if we have only one source and we were requested to do force qty allocation,<NEW_LINE>// because there is no point to later do the same thing again.<NEW_LINE>final boolean forceQtyAllocationOnFirstTry = request.isForceQtyAllocation() && sources.size() == 1;<NEW_LINE>final Iterator<IAllocationSource> sourceIterator = sources.iterator();<NEW_LINE>while (sourceIterator.hasNext()) {<NEW_LINE>// If we allocated everything, stop here<NEW_LINE>if (resultFinal.isCompleted()) {<NEW_LINE>return resultFinal;<NEW_LINE>}<NEW_LINE>// Get next allocation source<NEW_LINE>final IAllocationSource source = sourceIterator.next();<NEW_LINE>// Create the actual request<NEW_LINE>final IAllocationRequest requestActual = AllocationUtils.deriveAsQtyRequestForRemaining(request, resultFinal).setForceQtyAllocation(forceQtyAllocationOnFirstTry).create();<NEW_LINE>// Ask the source to unload<NEW_LINE>final IAllocationResult result = source.unload(requestActual);<NEW_LINE>// Merge current result to our final result<NEW_LINE>AllocationUtils.mergeAllocationResult(resultFinal, result);<NEW_LINE>}<NEW_LINE>// If we allocated everything, stop here<NEW_LINE>if (resultFinal.isCompleted()) {<NEW_LINE>return resultFinal;<NEW_LINE>}<NEW_LINE>//<NEW_LINE>// We still haven't unloaded all quantity, but our request has force allocation<NEW_LINE>// => force allocation on last source (that our source for remaining)<NEW_LINE>if (request.isForceQtyAllocation() && !forceQtyAllocationOnFirstTry) {<NEW_LINE>final IAllocationSource source = sources.get(sources.size() - 1);<NEW_LINE>final IAllocationRequest requestActual = AllocationUtils.createQtyRequestForRemaining(request, resultFinal);<NEW_LINE>// Ask the source to unload<NEW_LINE>final IAllocationResult result = source.unload(requestActual);<NEW_LINE>// Merge current result to our final result<NEW_LINE>AllocationUtils.mergeAllocationResult(resultFinal, result);<NEW_LINE>}<NEW_LINE>return resultFinal;<NEW_LINE>} | createMutableAllocationResult(request.getQty()); |
813,344 | final EnableSecurityHubResult executeEnableSecurityHub(EnableSecurityHubRequest enableSecurityHubRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(enableSecurityHubRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<EnableSecurityHubRequest> request = null;<NEW_LINE>Response<EnableSecurityHubResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new EnableSecurityHubRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(enableSecurityHubRequest));<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, "SecurityHub");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "EnableSecurityHub");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<EnableSecurityHubResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new EnableSecurityHubResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>} | endClientExecution(awsRequestMetrics, request, response); |
405,508 | public void decorate(T webComponent, WebModule wm) {<NEW_LINE>if (wm.getWebBundleDescriptor().hasExtensionProperty(WeldDeployer.WELD_EXTENSION)) {<NEW_LINE>DeploymentContext deploymentContext = wm.getWebModuleConfig().getDeploymentContext();<NEW_LINE>WeldBootstrap weldBootstrap = deploymentContext.getTransientAppMetaData(WeldDeployer.WELD_BOOTSTRAP, org.jboss.weld.bootstrap.WeldBootstrap.class);<NEW_LINE>DeploymentImpl deploymentImpl = deploymentContext.getTransientAppMetaData(<MASK><NEW_LINE>Collection<BeanDeploymentArchive> deployments = deploymentImpl.getBeanDeploymentArchives();<NEW_LINE>BeanDeploymentArchive beanDeploymentArchive = deployments.iterator().next();<NEW_LINE>BeanManager beanManager = weldBootstrap.getManager(beanDeploymentArchive);<NEW_LINE>// PENDING : Not available in this Web Beans Release<NEW_LINE>CreationalContext<T> ccontext = beanManager.createCreationalContext(null);<NEW_LINE>@SuppressWarnings("rawtypes")<NEW_LINE>Class<T> clazz = (Class<T>) webComponent.getClass();<NEW_LINE>AnnotatedType<T> annotatedType = beanManager.createAnnotatedType(clazz);<NEW_LINE>InjectionTarget<T> injectionTarget = beanManager.createInjectionTarget(annotatedType);<NEW_LINE>injectionTarget.inject(webComponent, ccontext);<NEW_LINE>}<NEW_LINE>} | WeldDeployer.WELD_DEPLOYMENT, DeploymentImpl.class); |
167,621 | private static void runAssertion(RegressionEnvironment env, String eventTypeName, RegressionPath path) {<NEW_LINE>String stmtText = "@name('s0') select type?,dyn[1]?,nested.nes2?,map('a')? from " + eventTypeName;<NEW_LINE>env.compileDeploy(stmtText, path).addListener("s0");<NEW_LINE>env.assertStatement("s0", statement -> {<NEW_LINE>SupportEventPropUtil.assertPropsEquals(statement.getEventType().getPropertyDescriptors(), new SupportEventPropDesc("type?", Node.class), new SupportEventPropDesc("dyn[1]?", Node.class), new SupportEventPropDesc("nested.nes2?", Node.class), new SupportEventPropDesc<MASK><NEW_LINE>SupportEventTypeAssertionUtil.assertConsistency(statement.getEventType());<NEW_LINE>});<NEW_LINE>Document root = SupportXML.sendXMLEvent(env, NOSCHEMA_XML, eventTypeName);<NEW_LINE>env.assertEventNew("s0", theEvent -> {<NEW_LINE>assertSame(root.getDocumentElement().getChildNodes().item(1), theEvent.get("type?"));<NEW_LINE>assertSame(root.getDocumentElement().getChildNodes().item(5), theEvent.get("dyn[1]?"));<NEW_LINE>assertSame(root.getDocumentElement().getChildNodes().item(7).getChildNodes().item(1), theEvent.get("nested.nes2?"));<NEW_LINE>assertSame(root.getDocumentElement().getChildNodes().item(9), theEvent.get("map('a')?"));<NEW_LINE>SupportEventTypeAssertionUtil.assertConsistency(theEvent);<NEW_LINE>});<NEW_LINE>env.undeployAll();<NEW_LINE>} | ("map('a')?", Node.class)); |
1,584,544 | public List<SipURI> locate(SipURI sipUri) throws SipURIResolveException {<NEW_LINE>if (c_logger.isTraceEntryExitEnabled()) {<NEW_LINE>c_logger.traceEntry(this, "locate", sipUri);<NEW_LINE>}<NEW_LINE>if (!_initialized) {<NEW_LINE>throw new SipURIResolveException("Resolver service not initialized.");<NEW_LINE>}<NEW_LINE>SipURILookupCallbackImpl callback = ThreadLocalStorage.getURILookupCallback();<NEW_LINE>SIPUri sipUrlToSend = convertURI(sipUri);<NEW_LINE>boolean fix = fixNonStandardURI(sipUrlToSend);<NEW_LINE>callback.init(sipUri, fix);<NEW_LINE>List<SipURI> results = null;<NEW_LINE>try {<NEW_LINE>lookupDestination(sipUrlToSend, callback);<NEW_LINE>callback.waitForResults();<NEW_LINE>if (!callback.isErrorResponse()) {<NEW_LINE>results = callback.getResults();<NEW_LINE>if (c_logger.isTraceDebugEnabled()) {<NEW_LINE>int num = (results != null) ? results.size() : 0;<NEW_LINE>c_logger.traceDebug(this, "locate", "Retrieved " + num + " results.");<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>throw new SipURIResolveException("Failed to retrieve DNS result");<NEW_LINE>}<NEW_LINE>return results;<NEW_LINE>} catch (InterruptedException e) {<NEW_LINE><MASK><NEW_LINE>} catch (IllegalArgumentException e) {<NEW_LINE>throw new SipURIResolveException("Failed to retrieve DNS result", e);<NEW_LINE>} finally {<NEW_LINE>callback.reset();<NEW_LINE>}<NEW_LINE>} | throw new SipURIResolveException("Failed to retrieve DNS result", e); |
276,877 | final UpdateSecurityGroupRuleDescriptionsEgressResult executeUpdateSecurityGroupRuleDescriptionsEgress(UpdateSecurityGroupRuleDescriptionsEgressRequest updateSecurityGroupRuleDescriptionsEgressRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(updateSecurityGroupRuleDescriptionsEgressRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<UpdateSecurityGroupRuleDescriptionsEgressRequest> request = null;<NEW_LINE>Response<UpdateSecurityGroupRuleDescriptionsEgressResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new UpdateSecurityGroupRuleDescriptionsEgressRequestMarshaller().marshall(super.beforeMarshalling(updateSecurityGroupRuleDescriptionsEgressRequest));<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, "EC2");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "UpdateSecurityGroupRuleDescriptionsEgress");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>StaxResponseHandler<UpdateSecurityGroupRuleDescriptionsEgressResult> responseHandler = new StaxResponseHandler<UpdateSecurityGroupRuleDescriptionsEgressResult>(new UpdateSecurityGroupRuleDescriptionsEgressResultStaxUnmarshaller());<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()); |
721,474 | private void startOperation(int op, @Nullable String[] backupNames) {<NEW_LINE>if (actionBeginInterface != null)<NEW_LINE>actionBeginInterface.onActionBegin(mode);<NEW_LINE>activity.registerReceiver(mBatchOpsBroadCastReceiver, new IntentFilter(BatchOpsService.ACTION_BATCH_OPS_COMPLETED));<NEW_LINE>// Start batch ops service<NEW_LINE>Intent intent = new Intent(activity, BatchOpsService.class);<NEW_LINE>BatchOpsManager.Result input = new BatchOpsManager.Result(targetPackages);<NEW_LINE>intent.putStringArrayListExtra(BatchOpsService.EXTRA_OP_PKG, input.getFailedPackages());<NEW_LINE>intent.putIntegerArrayListExtra(BatchOpsService.EXTRA_OP_USERS, input.getAssociatedUserHandles());<NEW_LINE>intent.putExtra(BatchOpsService.EXTRA_OP, op);<NEW_LINE>Bundle args = new Bundle();<NEW_LINE>args.putInt(BatchOpsManager.<MASK><NEW_LINE>args.putStringArray(BatchOpsManager.ARG_BACKUP_NAMES, backupNames);<NEW_LINE>intent.putExtra(BatchOpsService.EXTRA_OP_EXTRA_ARGS, args);<NEW_LINE>ContextCompat.startForegroundService(activity, intent);<NEW_LINE>dismiss();<NEW_LINE>} | ARG_FLAGS, flags.getFlags()); |
760,826 | public void sealAndInitialize(FhirContext theContext, Map<Class<? extends IBase>, BaseRuntimeElementDefinition<?>> theClassToElementDefinitions) {<NEW_LINE>super.sealAndInitialize(theContext, theClassToElementDefinitions);<NEW_LINE>myNameToSearchParam = Collections.unmodifiableMap(myNameToSearchParam);<NEW_LINE>ArrayList<RuntimeSearchParam> searchParams = new ArrayList<RuntimeSearchParam>(myNameToSearchParam.values());<NEW_LINE>Collections.sort(searchParams, new Comparator<RuntimeSearchParam>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public int compare(RuntimeSearchParam theArg0, RuntimeSearchParam theArg1) {<NEW_LINE>return theArg0.getName().compareTo(theArg1.getName());<NEW_LINE>}<NEW_LINE>});<NEW_LINE>mySearchParams = Collections.unmodifiableList(searchParams);<NEW_LINE>Map<String, List<RuntimeSearchParam>> compartmentNameToSearchParams = new HashMap<>();<NEW_LINE>for (RuntimeSearchParam next : searchParams) {<NEW_LINE>if (next.getProvidesMembershipInCompartments() != null) {<NEW_LINE>for (String nextCompartment : next.getProvidesMembershipInCompartments()) {<NEW_LINE>if (nextCompartment.startsWith("Base FHIR compartment definition for ")) {<NEW_LINE>nextCompartment = nextCompartment.substring("Base FHIR compartment definition for ".length());<NEW_LINE>}<NEW_LINE>if (!compartmentNameToSearchParams.containsKey(nextCompartment)) {<NEW_LINE>compartmentNameToSearchParams.put(nextCompartment<MASK><NEW_LINE>}<NEW_LINE>List<RuntimeSearchParam> searchParamsForCompartment = compartmentNameToSearchParams.get(nextCompartment);<NEW_LINE>searchParamsForCompartment.add(next);<NEW_LINE>String nextPath = massagePathForCompartmentSimilarity(next.getPath());<NEW_LINE>for (RuntimeSearchParam nextAlternate : searchParams) {<NEW_LINE>String nextAlternatePath = massagePathForCompartmentSimilarity(nextAlternate.getPath());<NEW_LINE>if (nextAlternatePath.equals(nextPath)) {<NEW_LINE>if (!nextAlternate.getName().equals(next.getName())) {<NEW_LINE>searchParamsForCompartment.add(nextAlternate);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>myCompartmentNameToSearchParams = Collections.unmodifiableMap(compartmentNameToSearchParams);<NEW_LINE>Class<?> target = getImplementingClass();<NEW_LINE>myBaseType = (Class<? extends IBaseResource>) target;<NEW_LINE>do {<NEW_LINE>target = target.getSuperclass();<NEW_LINE>if (IBaseResource.class.isAssignableFrom(target) && target.getAnnotation(ResourceDef.class) != null) {<NEW_LINE>myBaseType = (Class<? extends IBaseResource>) target;<NEW_LINE>}<NEW_LINE>} while (target.equals(Object.class) == false);<NEW_LINE>if (hasExtensions()) {<NEW_LINE>if (IAnyResource.class.isAssignableFrom(getImplementingClass())) {<NEW_LINE>if (!IDomainResource.class.isAssignableFrom(getImplementingClass())) {<NEW_LINE>throw new ConfigurationException(Msg.code(1733) + "Class \"" + getImplementingClass() + "\" is invalid. This resource type is not a DomainResource, it must not have extensions");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | , new ArrayList<>()); |
1,090,381 | public static void main(String[] args) throws PcapNativeException, NotOpenException {<NEW_LINE>String filter = args.length != 0 ? args[0] : "";<NEW_LINE>System.out.println(COUNT_KEY + ": " + COUNT);<NEW_LINE>System.out.println(READ_TIMEOUT_KEY + ": " + READ_TIMEOUT);<NEW_LINE>System.out.println(SNAPLEN_KEY + ": " + SNAPLEN);<NEW_LINE>System.out.println(TIMESTAMP_PRECISION_NANO_KEY + ": " + TIMESTAMP_PRECISION_NANO);<NEW_LINE>System.out.println("\n");<NEW_LINE>PcapNetworkInterface nif;<NEW_LINE>try {<NEW_LINE>nif = new NifSelector().selectNetworkInterface();<NEW_LINE>} catch (IOException e) {<NEW_LINE>e.printStackTrace();<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (nif == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>System.out.println(nif.getName() + "(" + nif.getDescription() + ")");<NEW_LINE>PcapHandle.Builder phb = new PcapHandle.Builder(nif.getName()).snaplen(SNAPLEN).promiscuousMode(PromiscuousMode.PROMISCUOUS).timeoutMillis(READ_TIMEOUT);<NEW_LINE>if (TIMESTAMP_PRECISION_NANO) {<NEW_LINE>phb.timestampPrecision(TimestampPrecision.NANO);<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>handle.setFilter(filter, BpfCompileMode.OPTIMIZE);<NEW_LINE>int num = 0;<NEW_LINE>PcapDumper dumper = handle.dumpOpen(PCAP_FILE);<NEW_LINE>while (true) {<NEW_LINE>Packet packet = handle.getNextPacket();<NEW_LINE>if (packet == null) {<NEW_LINE>continue;<NEW_LINE>} else {<NEW_LINE>dumper.dump(packet, handle.getTimestamp());<NEW_LINE>num++;<NEW_LINE>if (num >= COUNT) {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>dumper.close();<NEW_LINE>handle.close();<NEW_LINE>} | PcapHandle handle = phb.build(); |
311,395 | private void scanFile(MediaFile file, MusicFolder musicFolder, MediaLibraryStatistics statistics, Map<String, AtomicInteger> albumCount, Map<String, Artist> artists, Map<String, Album> albums, Map<Integer, Album> albumsInDb, Genres genres, Map<Integer, Set<String>> encountered) {<NEW_LINE>if (scanCount.incrementAndGet() % 250 == 0) {<NEW_LINE>broadcastScanStatus();<NEW_LINE>LOG.info("Scanned media library with {} entries.", scanCount.get());<NEW_LINE>}<NEW_LINE>LOG.trace("Scanning file {} in folder {} ({})", file.getPath(), musicFolder.getId(), musicFolder.getName());<NEW_LINE>// Update the root folder if it has changed<NEW_LINE>if (!musicFolder.getId().equals(file.getFolderId())) {<NEW_LINE>file.setFolderId(musicFolder.getId());<NEW_LINE>mediaFileService.updateMediaFile(file);<NEW_LINE>}<NEW_LINE>indexManager.index(file, musicFolder);<NEW_LINE>if (file.isDirectory()) {<NEW_LINE>mediaFileService.getChildrenOf(file, true, true, false, false).parallelStream().forEach(child -> scanFile(child, musicFolder, statistics, albumCount, artists, albums, albumsInDb, genres, encountered));<NEW_LINE>} else {<NEW_LINE>if (musicFolder.getType() == MusicFolder.Type.MEDIA) {<NEW_LINE>updateAlbum(file, musicFolder, statistics.getScanDate(), albumCount, albums, albumsInDb);<NEW_LINE>updateArtist(file, musicFolder, statistics.getScanDate(), albumCount, artists);<NEW_LINE>}<NEW_LINE>statistics.incrementSongs(1);<NEW_LINE>}<NEW_LINE>updateGenres(file, genres);<NEW_LINE>encountered.computeIfAbsent(file.getFolderId(), k -> ConcurrentHashMap.newKeySet()).add(file.getPath());<NEW_LINE>if (file.getDuration() != null) {<NEW_LINE>statistics.incrementTotalDurationInSeconds(file.getDuration());<NEW_LINE>}<NEW_LINE>if (file.getFileSize() != null) {<NEW_LINE>statistics.<MASK><NEW_LINE>}<NEW_LINE>} | incrementTotalLengthInBytes(file.getFileSize()); |
965,106 | private void printFillBorder2() {<NEW_LINE>String typeCast = imageType.getTypeCastFromSum();<NEW_LINE>out.print("\tpublic static void fillBorder( " + imageName + " input, " + imageType.getSumType() + " value, int borderX0, int borderY0, int borderX1, int borderY1 ) {\n" + "\t\t// top and bottom\n" + "\t\tfor (int y = 0; y < borderY0; y++) {\n" + "\t\t\tint srcIdx = input.startIndex + y*input.stride;\n" + "\t\t\tfor (int x = 0; x < input.width; x++) {\n" + "\t\t\t\tinput.data[srcIdx++] = " + typeCast + "value;\n" + "\t\t\t}\n" + "\t\t}\n" + "\t\tfor (int y = input.height - borderY1; y < input.height; y++) {\n" + "\t\t\tint srcIdx = input.startIndex + y*input.stride;\n" + "\t\t\tfor (int x = 0; x < input.width; x++) {\n" + "\t\t\t\tinput.data[srcIdx++] = " + typeCast + "value;\n" + "\t\t\t}\n" + "\t\t}\n" + "\n" + "\t\t// left and right\n" + "\t\tint h = input.height - borderY1;\n" + "\t\tfor (int x = 0; x < borderX0; x++) {\n" + "\t\t\tint srcIdx = input.startIndex + borderY0*input.stride + x;\n" + "\t\t\tfor (int y = borderY0; y < h; y++) {\n" + "\t\t\t\tinput.data[srcIdx] = " + typeCast + "value;\n" + "\t\t\t\tsrcIdx += input.stride;\n" + "\t\t\t}\n" + "\t\t}\n" + "\t\tfor (int x = input.width - borderX1; x < input.width; x++) {\n" + "\t\t\tint srcIdx = input.startIndex + borderY0*input.stride + x;\n" + "\t\t\tfor (int y = borderY0; y < h; y++) {\n" + "\t\t\t\tinput.data[srcIdx] = " + typeCast + "value;\n" + <MASK><NEW_LINE>} | "\t\t\t\tsrcIdx += input.stride;\n" + "\t\t\t}\n" + "\t\t}\n" + "\t}\n\n"); |
263 | public Optional<ListMultimapProperty> create(Config config) {<NEW_LINE>Property property = config.getProperty();<NEW_LINE>DeclaredType type = maybeDeclared(property.getType()).orElse(null);<NEW_LINE>if (!erasesToAnyOf(type, Multimap.class, ImmutableMultimap.class, ListMultimap.class, ImmutableListMultimap.class)) {<NEW_LINE>return Optional.empty();<NEW_LINE>}<NEW_LINE>TypeMirror keyType = upperBound(config.getElements(), type.getTypeArguments().get(0));<NEW_LINE>TypeMirror valueType = upperBound(config.getElements(), type.getTypeArguments().get(1));<NEW_LINE>Optional<TypeMirror> unboxedKeyType = maybeUnbox(keyType, config.getTypes());<NEW_LINE>Optional<TypeMirror> unboxedValueType = maybeUnbox(<MASK><NEW_LINE>boolean overridesPutMethod = hasPutMethodOverride(config, unboxedKeyType.orElse(keyType), unboxedValueType.orElse(valueType));<NEW_LINE>FunctionalType mutatorType = functionalTypeAcceptedByMethod(config.getBuilder(), mutator(property), consumer(listMultimap(keyType, valueType, config.getElements(), config.getTypes())), config.getElements(), config.getTypes());<NEW_LINE>return Optional.of(new ListMultimapProperty(config.getDatatype(), property, overridesPutMethod, keyType, unboxedKeyType, valueType, unboxedValueType, mutatorType));<NEW_LINE>} | valueType, config.getTypes()); |
352,657 | public PropertyNamingStrategy create() {<NEW_LINE>if (String.class.isInstance(value)) {<NEW_LINE>final String val = value.toString();<NEW_LINE>switch(val) {<NEW_LINE>case PropertyNamingStrategy.IDENTITY:<NEW_LINE>return propertyName -> propertyName;<NEW_LINE>case PropertyNamingStrategy.LOWER_CASE_WITH_DASHES:<NEW_LINE>return new ConfigurableNamingStrategy(Character::toLowerCase, '-');<NEW_LINE>case PropertyNamingStrategy.LOWER_CASE_WITH_UNDERSCORES:<NEW_LINE>return new ConfigurableNamingStrategy(Character::toLowerCase, '_');<NEW_LINE>case PropertyNamingStrategy.UPPER_CAMEL_CASE:<NEW_LINE>return camelCaseStrategy();<NEW_LINE>case PropertyNamingStrategy.UPPER_CAMEL_CASE_WITH_SPACES:<NEW_LINE>final PropertyNamingStrategy camelCase = camelCaseStrategy();<NEW_LINE>final PropertyNamingStrategy space = new ConfigurableNamingStrategy(Function.identity(), ' ');<NEW_LINE>return propertyName -> camelCase.translateName<MASK><NEW_LINE>case PropertyNamingStrategy.CASE_INSENSITIVE:<NEW_LINE>return propertyName -> propertyName;<NEW_LINE>default:<NEW_LINE>throw new IllegalArgumentException(val + " unknown as PropertyNamingStrategy");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (PropertyNamingStrategy.class.isInstance(value)) {<NEW_LINE>return PropertyNamingStrategy.class.cast(value);<NEW_LINE>}<NEW_LINE>throw new IllegalArgumentException(value + " not supported as PropertyNamingStrategy");<NEW_LINE>} | (space.translateName(propertyName)); |
1,049,857 | public static void main(String[] args) {<NEW_LINE>assert 1 + 2 == 3;<NEW_LINE>try {<NEW_LINE>assert 2 == 3;<NEW_LINE>throw new RuntimeException("Failed to throw assert!");<NEW_LINE>} catch (AssertionError expected) {<NEW_LINE>// Success<NEW_LINE>assert expected.getMessage() == null;<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>assert 2 == 3 : getDescription();<NEW_LINE>throw new RuntimeException("Failed to throw assert!");<NEW_LINE>} catch (AssertionError expected) {<NEW_LINE>// Success<NEW_LINE>assert expected.getMessage().equals("custom message");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>assert 2 <MASK><NEW_LINE>throw new RuntimeException("Failed to throw assert!");<NEW_LINE>} catch (AssertionError expected) {<NEW_LINE>// Success<NEW_LINE>assert expected.getCause().getMessage().equals("42");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>assert 2 == 3 : 42;<NEW_LINE>throw new RuntimeException("Failed to throw assert!");<NEW_LINE>} catch (AssertionError expected) {<NEW_LINE>// Success<NEW_LINE>assert expected.getMessage().equals("42");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>assert 2 == 3 : 42L;<NEW_LINE>throw new RuntimeException("Failed to throw assert!");<NEW_LINE>} catch (AssertionError expected) {<NEW_LINE>// Success<NEW_LINE>assert expected.getMessage().equals("42");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>assert 2 == 3 : true;<NEW_LINE>throw new RuntimeException("Failed to throw assert!");<NEW_LINE>} catch (AssertionError expected) {<NEW_LINE>// Success<NEW_LINE>assert expected.getMessage().equals("true");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>assert 2 == 3 : null;<NEW_LINE>throw new RuntimeException("Failed to throw assert!");<NEW_LINE>} catch (AssertionError expected) {<NEW_LINE>// Success<NEW_LINE>assert expected.getMessage().equals("null");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>assert 2 == 3 : 'g';<NEW_LINE>throw new RuntimeException("Failed to throw assert!");<NEW_LINE>} catch (AssertionError expected) {<NEW_LINE>// Success<NEW_LINE>assert expected.getMessage().equals("g");<NEW_LINE>}<NEW_LINE>} | == 3 : new RuntimeException("42"); |
654,557 | private void insertChar(final char c) {<NEW_LINE>checkSize(size + 3);<NEW_LINE>System.arraycopy(tree, idx, tree, idx + 3, size - idx);<NEW_LINE>tree[idx] = c;<NEW_LINE>tree[idx + 1] = 0;<NEW_LINE>tree[idx + 2] = 0;<NEW_LINE>size += 3;<NEW_LINE>for (int i = 0; i < size; ) {<NEW_LINE>if (tree[i] == LAST_CHAR) {<NEW_LINE>i++;<NEW_LINE>} else {<NEW_LINE>int index = (tree[i + 1] << 16) + tree[i + 2];<NEW_LINE>final int indexValue = index & 0x7fffffff;<NEW_LINE>if (indexValue > idx) {<NEW_LINE>index += 3;<NEW_LINE>tree[i + 1] = (<MASK><NEW_LINE>tree[i + 2] = (char) (index);<NEW_LINE>}<NEW_LINE>i += 3;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | char) (index >> 16); |
1,617,091 | public int calculateMinBroadcastConnections(List<BtcNodes.BtcNode> nodes) {<NEW_LINE>BtcNodes.BitcoinNodesOption nodesOption = BtcNodes.BitcoinNodesOption.values()[preferences.getBitcoinNodesOptionOrdinal()];<NEW_LINE>int result;<NEW_LINE>switch(nodesOption) {<NEW_LINE>case CUSTOM:<NEW_LINE>// We have set the nodes already above<NEW_LINE>result = (int) Math.ceil(<MASK><NEW_LINE>// If Tor is set we usually only use onion nodes,<NEW_LINE>// but if user provides mixed clear net and onion nodes we want to use both<NEW_LINE>break;<NEW_LINE>case PUBLIC:<NEW_LINE>// We keep the empty nodes<NEW_LINE>result = (int) Math.floor(numConnectionsForBtc * 0.8);<NEW_LINE>break;<NEW_LINE>case PROVIDED:<NEW_LINE>default:<NEW_LINE>// We require only 4 nodes instead of 7 (for 9 max connections) because our provided nodes<NEW_LINE>// are more reliable than random public nodes.<NEW_LINE>result = 4;<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>} | nodes.size() * 0.5); |
949,051 | public Vector filterUp(double threshold) {<NEW_LINE>IntIntSparseVectorStorage newStorage = new IntIntSparseVectorStorage(size());<NEW_LINE>if (storage.isDense()) {<NEW_LINE>int[] values = ((IntIntVectorStorage) storage).getValues();<NEW_LINE>for (int i = 0; i < values.length; i++) {<NEW_LINE>if (values[i] >= threshold) {<NEW_LINE>newStorage.set(i, values[i]);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else if (storage.isSparse()) {<NEW_LINE>ObjectIterator<Int2IntMap.Entry> iter = ((IntIntVectorStorage) storage).entryIterator();<NEW_LINE>while (iter.hasNext()) {<NEW_LINE>Int2IntMap.Entry entry = iter.next();<NEW_LINE><MASK><NEW_LINE>if (value >= threshold) {<NEW_LINE>newStorage.set(entry.getIntKey(), value);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>int[] indices = ((IntIntVectorStorage) storage).getIndices();<NEW_LINE>int[] values = ((IntIntVectorStorage) storage).getValues();<NEW_LINE>int size = ((IntIntVectorStorage) storage).size();<NEW_LINE>for (int k = 0; k < size; k++) {<NEW_LINE>if (values[k] >= threshold) {<NEW_LINE>newStorage.set(indices[k], values[k]);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return new IntIntVector(matrixId, rowId, clock, getDim(), newStorage);<NEW_LINE>} | int value = entry.getIntValue(); |
1,118,292 | public <T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11> Record11<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11> fetchSingle(SelectField<T1> field1, SelectField<T2> field2, SelectField<T3> field3, SelectField<T4> field4, SelectField<T5> field5, SelectField<T6> field6, SelectField<T7> field7, SelectField<T8> field8, SelectField<T9> field9, SelectField<T10> field10, SelectField<T11> field11) throws DataAccessException {<NEW_LINE>return context.fetchSingle(field1, field2, field3, field4, field5, field6, field7, <MASK><NEW_LINE>} | field8, field9, field10, field11); |
1,159,731 | public Observable<ServiceResponseWithHeaders<Page<JobPreparationAndReleaseTaskExecutionInformation>, JobListPreparationAndReleaseTaskStatusHeaders>> listPreparationAndReleaseTaskStatusNextSinglePageAsync(final String nextPageLink) {<NEW_LINE>if (nextPageLink == null) {<NEW_LINE>throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null.");<NEW_LINE>}<NEW_LINE>final JobListPreparationAndReleaseTaskStatusNextOptions jobListPreparationAndReleaseTaskStatusNextOptions = null;<NEW_LINE>UUID clientRequestId = null;<NEW_LINE>Boolean returnClientRequestId = null;<NEW_LINE>DateTime ocpDate = null;<NEW_LINE>DateTimeRfc1123 ocpDateConverted = null;<NEW_LINE>if (ocpDate != null) {<NEW_LINE>ocpDateConverted = new DateTimeRfc1123(ocpDate);<NEW_LINE>}<NEW_LINE>String nextUrl = <MASK><NEW_LINE>return service.listPreparationAndReleaseTaskStatusNext(nextUrl, this.client.acceptLanguage(), clientRequestId, returnClientRequestId, ocpDateConverted, this.client.userAgent()).flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponseWithHeaders<Page<JobPreparationAndReleaseTaskExecutionInformation>, JobListPreparationAndReleaseTaskStatusHeaders>>>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public Observable<ServiceResponseWithHeaders<Page<JobPreparationAndReleaseTaskExecutionInformation>, JobListPreparationAndReleaseTaskStatusHeaders>> call(Response<ResponseBody> response) {<NEW_LINE>try {<NEW_LINE>ServiceResponseWithHeaders<PageImpl<JobPreparationAndReleaseTaskExecutionInformation>, JobListPreparationAndReleaseTaskStatusHeaders> result = listPreparationAndReleaseTaskStatusNextDelegate(response);<NEW_LINE>return Observable.just(new ServiceResponseWithHeaders<Page<JobPreparationAndReleaseTaskExecutionInformation>, JobListPreparationAndReleaseTaskStatusHeaders>(result.body(), result.headers(), result.response()));<NEW_LINE>} catch (Throwable t) {<NEW_LINE>return Observable.error(t);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} | String.format("%s", nextPageLink); |
1,083,346 | public void run() throws CLIException {<NEW_LINE>File launch = new File(getCwd(), ".vscode/launch.json");<NEW_LINE>if (!launch.exists()) {<NEW_LINE>final File vscode = new File(getCwd(), ".vscode");<NEW_LINE>if (!vscode.exists() && !vscode.mkdirs()) {<NEW_LINE>fatal("Failed to mkdir .vscode");<NEW_LINE>}<NEW_LINE>try (InputStream in = VscodeCommand.class.getClassLoader().getResourceAsStream("META-INF/es4x-commands/vscode-launcher.json")) {<NEW_LINE>if (in == null) {<NEW_LINE>fatal("Cannot load vscode launcher.json template.");<NEW_LINE>} else {<NEW_LINE>Files.copy(in, launch.toPath());<NEW_LINE>}<NEW_LINE>} catch (IOException e) {<NEW_LINE>fatal(e.getMessage());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>processLauncher(launch);<NEW_LINE>} catch (IOException e) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>} | fatal(e.getMessage()); |
52,181 | public Client client() {<NEW_LINE>String serverAddr = <MASK><NEW_LINE>if (StringUtils.isBlank(serverAddr)) {<NEW_LINE>throw new DiscoveryException(EtcdConstant.ETCD_SERVER_ADDR + " can't be null or empty");<NEW_LINE>}<NEW_LINE>ClientBuilder clientBuilder = Client.builder().endpoints(serverAddr);<NEW_LINE>String username = environment.getProperty(EtcdConstant.ETCD_USERNAME);<NEW_LINE>if (StringUtils.isNotBlank(username)) {<NEW_LINE>clientBuilder.user(ByteSequence.from(username, StandardCharsets.UTF_8));<NEW_LINE>}<NEW_LINE>String password = environment.getProperty(EtcdConstant.ETCD_PASSWORD);<NEW_LINE>if (StringUtils.isNotBlank(password)) {<NEW_LINE>clientBuilder.password(ByteSequence.from(password, StandardCharsets.UTF_8));<NEW_LINE>}<NEW_LINE>clientBuilder.loadBalancerPolicy(EtcdConstant.ETCD_CLIENT_ROUND_ROBIN);<NEW_LINE>return clientBuilder.build();<NEW_LINE>} | environment.getProperty(EtcdConstant.ETCD_SERVER_ADDR); |
1,206,744 | protected static String handleMenu(String menuPrefix, Map<String, Object> submenus, List<String> items, Map<String, String> uuidToName) {<NEW_LINE>if (items == null) {<NEW_LINE>return "";<NEW_LINE>}<NEW_LINE>// Calculate indent from our current one<NEW_LINE>int spaces = menuPrefix.length() - menuPrefix.trim().length();<NEW_LINE>String indent = "";<NEW_LINE>for (int i = 0; i < spaces; i++) {<NEW_LINE>indent += " ";<NEW_LINE>}<NEW_LINE>StringBuilder buffer = new StringBuilder();<NEW_LINE>for (String uuid : items) {<NEW_LINE>if (uuid.contains("-------")) {<NEW_LINE>buffer.append<MASK><NEW_LINE>} else {<NEW_LINE>Map<String, Object> props = (Map<String, Object>) submenus.get(uuid);<NEW_LINE>if (props != null) {<NEW_LINE>// it's a submenu<NEW_LINE>String subMenuName = (String) props.get("name");<NEW_LINE>buffer.append(menuPrefix).append(".menu '").append(subMenuName).append("' do |submenu|\n");<NEW_LINE>buffer.append(handleMenu(indent + " submenu", submenus, (List<String>) props.get("items"), uuidToName));<NEW_LINE>buffer.append(indent).append("end\n");<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>// Not a sub-menu, must be an item<NEW_LINE>String commandName = uuidToName.get(uuid);<NEW_LINE>if (commandName == null) {<NEW_LINE>buffer.append("#").append(menuPrefix).append(".command '").append(uuid).append("'\n");<NEW_LINE>} else {<NEW_LINE>buffer.append(menuPrefix).append(".command '").append(commandName).append("'\n");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return buffer.toString();<NEW_LINE>} | (menuPrefix).append(".separator\n"); |
375,411 | private static synchronized File createFallbackPOM(String groupId, String artifactId, String version) throws IOException {<NEW_LINE>String k = groupId + ':' + artifactId + ':' + version;<NEW_LINE>File fallbackPOM = fallbackPOMs.get(k);<NEW_LINE>if (fallbackPOM == null) {<NEW_LINE>fallbackPOM = File.createTempFile("fallback", ".netbeans.pom");<NEW_LINE>fallbackPOM.deleteOnExit();<NEW_LINE>PrintWriter w = new PrintWriter(fallbackPOM);<NEW_LINE>try {<NEW_LINE>w.println("<project>");<NEW_LINE>w.println("<modelVersion>4.0.0</modelVersion>");<NEW_LINE>w.println("<groupId>" + groupId + "</groupId>");<NEW_LINE>w.println("<artifactId>" + artifactId + "</artifactId>");<NEW_LINE>w.println("<packaging>pom</packaging>");<NEW_LINE>w.<MASK><NEW_LINE>w.println("<name>" + FALLBACK_NAME + "</name>");<NEW_LINE>w.println("</project>");<NEW_LINE>w.flush();<NEW_LINE>} finally {<NEW_LINE>w.close();<NEW_LINE>}<NEW_LINE>fallbackPOMs.put(k, fallbackPOM);<NEW_LINE>}<NEW_LINE>return fallbackPOM;<NEW_LINE>} | println("<version>" + version + "</version>"); |
1,541,267 | final DeleteStreamResult executeDeleteStream(DeleteStreamRequest deleteStreamRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(deleteStreamRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DeleteStreamRequest> request = null;<NEW_LINE>Response<DeleteStreamResult> response = null;<NEW_LINE>try {<NEW_LINE><MASK><NEW_LINE>try {<NEW_LINE>request = new DeleteStreamRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(deleteStreamRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "IoT");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DeleteStream");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DeleteStreamResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DeleteStreamResultJsonUnmarshaller());<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,763,445 | public void readFields(DataInput in) throws IOException {<NEW_LINE>super.readFields(in);<NEW_LINE>int size = in.readInt();<NEW_LINE>for (int i = 0; i < size; i++) {<NEW_LINE>long partitionId = in.readLong();<NEW_LINE>int size2 = in.readInt();<NEW_LINE>Map<Long, Long> tabletIdMap = partitionIdToBaseRollupTabletIdMap.computeIfAbsent(partitionId, k -> Maps.newHashMap());<NEW_LINE>for (int j = 0; j < size2; j++) {<NEW_LINE>long rollupTabletId = in.readLong();<NEW_LINE>long baseTabletId = in.readLong();<NEW_LINE>tabletIdMap.put(rollupTabletId, baseTabletId);<NEW_LINE>}<NEW_LINE>partitionIdToRollupIndex.put(partitionId, MaterializedIndex.read(in));<NEW_LINE>}<NEW_LINE>baseIndexId = in.readLong();<NEW_LINE>rollupIndexId = in.readLong();<NEW_LINE>baseIndexName = Text.readString(in);<NEW_LINE>rollupIndexName = Text.readString(in);<NEW_LINE>size = in.readInt();<NEW_LINE>for (int i = 0; i < size; i++) {<NEW_LINE>Column <MASK><NEW_LINE>rollupSchema.add(column);<NEW_LINE>}<NEW_LINE>baseSchemaHash = in.readInt();<NEW_LINE>rollupSchemaHash = in.readInt();<NEW_LINE>rollupKeysType = KeysType.valueOf(Text.readString(in));<NEW_LINE>rollupShortKeyColumnCount = in.readShort();<NEW_LINE>watershedTxnId = in.readLong();<NEW_LINE>if (Catalog.getCurrentCatalogJournalVersion() >= FeMetaVersion.VERSION_85) {<NEW_LINE>storageFormat = TStorageFormat.valueOf(Text.readString(in));<NEW_LINE>}<NEW_LINE>} | column = Column.read(in); |
627,681 | private void rewriteTransactionTypeTablePart2() throws Exception {<NEW_LINE>if (!tableExists("transaction_type_temp")) {<NEW_LINE>// previously failed mid-upgrade prior to updating schema version<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>dropTableIfExists("transaction_type");<NEW_LINE>Map<String, V09AgentRollup> v09AgentRollups = getV09AgentRollupsFromAgentRollupTable();<NEW_LINE>session.createTableWithLCS("create table if not exists transaction_type (one int," + " agent_rollup varchar, transaction_type varchar, primary key (one, agent_rollup," + " transaction_type))");<NEW_LINE>PreparedStatement insertPS = session.prepare("insert into transaction_type (one," + " agent_rollup, transaction_type) values (1, ?, ?) using ttl ?");<NEW_LINE>int ttl = getCentralStorageConfig(session).getMaxRollupTTL();<NEW_LINE>ResultSet results = session.read("select agent_rollup, transaction_type from transaction_type_temp where one = 1");<NEW_LINE>for (Row row : results) {<NEW_LINE>String v09AgentRollupId = row.getString(0);<NEW_LINE>V09AgentRollup v09AgentRollup = v09AgentRollups.get(v09AgentRollupId);<NEW_LINE>if (v09AgentRollup == null) {<NEW_LINE>// v09AgentRollupId was manually deleted (via the UI) from the agent_rollup<NEW_LINE>// table in which case its parent is no longer known and best to ignore<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>BoundStatement boundStatement = insertPS.bind();<NEW_LINE>boundStatement.setString(<MASK><NEW_LINE>boundStatement.setString(1, row.getString(1));<NEW_LINE>boundStatement.setInt(2, ttl);<NEW_LINE>session.write(boundStatement);<NEW_LINE>}<NEW_LINE>dropTableIfExists("transaction_type_temp");<NEW_LINE>} | 0, v09AgentRollup.agentRollupId()); |
1,356,579 | private void processFile(File file, String license) {<NEW_LINE>try {<NEW_LINE>String <MASK><NEW_LINE>int indexOfPackageStart = content.indexOf("package ");<NEW_LINE>if (indexOfPackageStart != -1) {<NEW_LINE>int indexOfPackageEnd = content.indexOf(";", indexOfPackageStart + 1);<NEW_LINE>int indexOfFirstImport = content.indexOf("import ", indexOfPackageEnd);<NEW_LINE>if (indexOfFirstImport != -1) {<NEW_LINE>if (content.substring(indexOfFirstImport - 2, indexOfFirstImport).equals("//")) {<NEW_LINE>indexOfFirstImport = indexOfFirstImport - 2;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (indexOfFirstImport == -1) {<NEW_LINE>int indexOfFirstPublic = content.indexOf("public ", indexOfPackageEnd);<NEW_LINE>int indexOfFirstPrivate = content.indexOf("private ", indexOfPackageEnd);<NEW_LINE>if (indexOfFirstPublic != -1 && indexOfFirstPrivate != -1) {<NEW_LINE>if (indexOfFirstPublic < indexOfFirstPrivate) {<NEW_LINE>indexOfFirstImport = indexOfFirstPublic;<NEW_LINE>} else {<NEW_LINE>indexOfFirstImport = indexOfFirstPrivate;<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>if (indexOfFirstPrivate != -1) {<NEW_LINE>indexOfFirstImport = indexOfFirstPrivate;<NEW_LINE>} else if (indexOfFirstPublic != -1) {<NEW_LINE>indexOfFirstImport = indexOfFirstPublic;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (indexOfFirstImport != -1) {<NEW_LINE>String first = content.substring(0, indexOfPackageEnd + 1);<NEW_LINE>String second = content.substring(indexOfFirstImport);<NEW_LINE>String total = first + "\n\n" + license + "\n\n" + second;<NEW_LINE>if (total.equals(content)) {<NEW_LINE>same++;<NEW_LINE>} else {<NEW_LINE>changed++;<NEW_LINE>}<NEW_LINE>FileUtils.writeStringToFile(file, total);<NEW_LINE>} else {<NEW_LINE>skipped++;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (IOException e) {<NEW_LINE>LOGGER.error("", e);<NEW_LINE>}<NEW_LINE>} | content = FileUtils.readFileToString(file); |
1,034,907 | public JSONObject installAllPackages(String kubeconfig, JSONObject jsonEnvMap) throws IOException, InterruptedException, TimeoutException {<NEW_LINE>JSONObject result = new JSONObject();<NEW_LINE>for (String clientName : this.clientPackageService.getNames()) {<NEW_LINE>JSONObject clientInfo = this.clientPackageService.getValue(clientName);<NEW_LINE>JSONObject resultInfo = new JSONObject();<NEW_LINE>String deployCommand = clientInfo.getString("deployCommand");<NEW_LINE>if (StringUtils.isBlank(deployCommand)) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>resultInfo.put("deployCommand", deployCommand);<NEW_LINE>String kubeconfigPath = "/tmp/" + System.currentTimeMillis() + ".kubeconfig";<NEW_LINE>FileUtils.writeStringToFile(new File(kubeconfigPath), kubeconfig, "utf-8");<NEW_LINE>String runCommand = deployCommand.replace("helm ", "cd /app/client-deploy-packages/" + clientName + "/; /app/helm --kubeconfig=" + kubeconfigPath + " ");<NEW_LINE>log.<MASK><NEW_LINE>Map<String, String> envMap;<NEW_LINE>if (jsonEnvMap != null) {<NEW_LINE>envMap = JSONObject.toJavaObject(jsonEnvMap, Map.class);<NEW_LINE>} else {<NEW_LINE>envMap = new HashMap<>();<NEW_LINE>}<NEW_LINE>ProcessResult commandResult = CommandUtil.runLocalCommand(runCommand, envMap);<NEW_LINE>resultInfo.put("output", commandResult.outputUTF8());<NEW_LINE>resultInfo.put("retCode", commandResult.getExitValue());<NEW_LINE>resultInfo.put("clientName", clientName);<NEW_LINE>result.put(clientName, resultInfo);<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>} | info("{},deployCommand={}", clientName, runCommand); |
637,487 | // figure out name for the connection - to be used in mbean<NEW_LINE>private String composeName(String id) {<NEW_LINE>StringBuilder shortSourcesListBuilder = new StringBuilder();<NEW_LINE>String separatorChar = "[";<NEW_LINE>for (DatabusSubscription sub : getSubscriptions()) {<NEW_LINE>shortSourcesListBuilder.append(separatorChar);<NEW_LINE>PhysicalPartition p = sub.getPhysicalPartition();<NEW_LINE>String sourceName = "AnySource";<NEW_LINE>LogicalSource source = sub.getLogicalPartition().getSource();<NEW_LINE>if (!source.isAllSourcesWildcard()) {<NEW_LINE>sourceName = source.getName();<NEW_LINE>int lastDotIdx = sourceName.lastIndexOf('.');<NEW_LINE>if (lastDotIdx >= 0)<NEW_LINE>sourceName = sourceName.substring(lastDotIdx + 1);<NEW_LINE>}<NEW_LINE>String partString = "AnyPPart_";<NEW_LINE>if (!p.isAnyPartitionWildcard()) {<NEW_LINE>partString = p.getId() + "_";<NEW_LINE>}<NEW_LINE>shortSourcesListBuilder.append(partString + sourceName);<NEW_LINE>separatorChar = "_";<NEW_LINE>}<NEW_LINE>shortSourcesListBuilder.append(']');<NEW_LINE>String shortSourcesList = shortSourcesListBuilder.toString();<NEW_LINE>return "conn" + shortSourcesList + (id == <MASK><NEW_LINE>} | null ? "" : "_" + id); |
202,571 | public Config createConfig(Config config) {<NEW_LINE>super.createConfig(config);<NEW_LINE>if (ciphersuiteDelegate.getCipherSuites() == null) {<NEW_LINE>List<CipherSuite> <MASK><NEW_LINE>cipherSuites.add(CipherSuite.TLS_RSA_WITH_AES_128_CBC_SHA);<NEW_LINE>cipherSuites.add(CipherSuite.TLS_RSA_WITH_AES_256_CBC_SHA);<NEW_LINE>cipherSuites.add(CipherSuite.TLS_RSA_WITH_AES_128_CBC_SHA256);<NEW_LINE>cipherSuites.add(CipherSuite.TLS_RSA_WITH_AES_256_CBC_SHA256);<NEW_LINE>config.setDefaultClientSupportedCipherSuites(cipherSuites);<NEW_LINE>}<NEW_LINE>for (CipherSuite suite : config.getDefaultClientSupportedCipherSuites()) {<NEW_LINE>if (!suite.isCBC()) {<NEW_LINE>throw new ConfigurationException("This attack only works with CBC Cipher suites");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>config.setQuickReceive(true);<NEW_LINE>config.setAddRenegotiationInfoExtension(true);<NEW_LINE>config.setAddServerNameIndicationExtension(true);<NEW_LINE>config.setAddSignatureAndHashAlgorithmsExtension(true);<NEW_LINE>config.setStopActionsAfterIOException(true);<NEW_LINE>config.setStopActionsAfterFatal(false);<NEW_LINE>config.setStopReceivingAfterFatal(false);<NEW_LINE>config.setEarlyStop(true);<NEW_LINE>config.setWorkflowExecutorShouldClose(false);<NEW_LINE>boolean containsEc = false;<NEW_LINE>for (CipherSuite suite : config.getDefaultClientSupportedCipherSuites()) {<NEW_LINE>KeyExchangeAlgorithm keyExchangeAlgorithm = AlgorithmResolver.getKeyExchangeAlgorithm(suite);<NEW_LINE>if (keyExchangeAlgorithm != null && keyExchangeAlgorithm.name().toUpperCase().contains("EC")) {<NEW_LINE>containsEc = true;<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>config.setAddECPointFormatExtension(containsEc);<NEW_LINE>config.setAddEllipticCurveExtension(containsEc);<NEW_LINE>return config;<NEW_LINE>} | cipherSuites = new LinkedList<>(); |
1,798,754 | public void refreshUserSubstitutions() {<NEW_LINE>component.removeAllComponents();<NEW_LINE>UserSessionSource uss = <MASK><NEW_LINE>List<UserSubstitution> substitutions = getUserSubstitutions();<NEW_LINE>AppUI ui = AppUI.getCurrent();<NEW_LINE>User currentOrSubstitutedUser = uss.getUserSession().getCurrentOrSubstitutedUser();<NEW_LINE>if (substitutions.isEmpty()) {<NEW_LINE>String substitutedUserCaption = getSubstitutedUserCaption(currentOrSubstitutedUser);<NEW_LINE>userComboBox = null;<NEW_LINE>userNameLabel = new Label(substitutedUserCaption);<NEW_LINE>userNameLabel.setStyleName("c-user-select-label");<NEW_LINE>userNameLabel.setSizeUndefined();<NEW_LINE>if (ui != null && ui.isTestMode()) {<NEW_LINE>userNameLabel.setCubaId("currentUserLabel");<NEW_LINE>}<NEW_LINE>component.addComponent(userNameLabel);<NEW_LINE>component.setDescription(substitutedUserCaption);<NEW_LINE>} else {<NEW_LINE>userNameLabel = null;<NEW_LINE>userComboBox = new CubaComboBox<>();<NEW_LINE>userComboBox.setEmptySelectionAllowed(false);<NEW_LINE>userComboBox.setItemCaptionGenerator(this::getSubstitutedUserCaption);<NEW_LINE>userComboBox.setStyleName("c-user-select-combobox");<NEW_LINE>if (ui != null) {<NEW_LINE>if (ui.isTestMode()) {<NEW_LINE>userComboBox.setCubaId("substitutedUserSelect");<NEW_LINE>}<NEW_LINE>if (ui.isPerformanceTestMode()) {<NEW_LINE>userComboBox.setId(ui.getTestIdManager().getTestId("substitutedUserSelect"));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>List<User> options = new ArrayList<>();<NEW_LINE>User sessionUser = uss.getUserSession().getUser();<NEW_LINE>options.add(sessionUser);<NEW_LINE>for (UserSubstitution substitution : substitutions) {<NEW_LINE>User substitutedUser = substitution.getSubstitutedUser();<NEW_LINE>options.add(substitutedUser);<NEW_LINE>}<NEW_LINE>userComboBox.setItems(options);<NEW_LINE>userComboBox.setValue(currentOrSubstitutedUser);<NEW_LINE>userComboBox.addValueChangeListener(this::substitutedUserChanged);<NEW_LINE>component.addComponent(userComboBox);<NEW_LINE>component.setDescription(null);<NEW_LINE>}<NEW_LINE>adjustWidth();<NEW_LINE>adjustHeight();<NEW_LINE>} | beanLocator.get(UserSessionSource.NAME); |
552,593 | // region Methods for converting native to Kroll values<NEW_LINE>private void fillFrequencyFields() {<NEW_LINE>// reused variables in different cases<NEW_LINE>String days;<NEW_LINE>String byDay;<NEW_LINE>if (this.frequency != null) {<NEW_LINE>switch(this.frequency) {<NEW_LINE>case YEARLY:<NEW_LINE>Calendar cal = Calendar.getInstance();<NEW_LINE>cal.setTime(this.eventBegin);<NEW_LINE>// weeksOfTheYear<NEW_LINE>this.weeksOfTheYear = new int[] { cal.get(Calendar.WEEK_OF_YEAR) };<NEW_LINE>// monthsOfTheYear<NEW_LINE>this.monthsOfTheYear = new int[] { cal.get(Calendar.MONTH) };<NEW_LINE>days = matchExpression(".*(BYYEARDAY=[0-9]*).*", 10);<NEW_LINE>if (days != null) {<NEW_LINE>// daysOfTheYear<NEW_LINE>this.daysOfTheYear = new int[] { Integer.valueOf(days) };<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>case MONTHLY:<NEW_LINE>// daysOfTheMonth<NEW_LINE>days = matchExpression(".*(BYMONTHDAY=(-)*[0-9]*).*", 11);<NEW_LINE>if (days != null) {<NEW_LINE>this.daysOfTheMonth = new int[] { Integer.valueOf(days) };<NEW_LINE>}<NEW_LINE>// daysOfTheWeek<NEW_LINE>byDay = matchExpression(".*(BYDAY=[,0-9A-Z]*).*", 6);<NEW_LINE>if (byDay != null) {<NEW_LINE>KrollDict daysOfTheWeekDictionary = new KrollDict();<NEW_LINE>daysOfTheWeekDictionary.put(this.dayOfWeekKey, RecurrenceRuleProxy.weekdaysMap.get(byDay.substring(byDay.length() - 2)));<NEW_LINE>daysOfTheWeekDictionary.put(this.weekNumberKey, byDay.substring(0, byDay.length() - 2));<NEW_LINE>this.daysOfTheWeek = new KrollDict[] { daysOfTheWeekDictionary };<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>case WEEKLY:<NEW_LINE>// daysOfTheWeek<NEW_LINE><MASK><NEW_LINE>if (byDay != null) {<NEW_LINE>// Split the days from result.<NEW_LINE>String[] daysArray = byDay.split(",");<NEW_LINE>this.daysOfTheWeek = new KrollDict[daysArray.length];<NEW_LINE>for (int i = 0; i < this.daysOfTheWeek.length; i++) {<NEW_LINE>KrollDict daysOfTheWeekDictionary = new KrollDict();<NEW_LINE>daysOfTheWeekDictionary.put(this.dayOfWeekKey, weekdaysMap.get(daysArray[i]));<NEW_LINE>// In the context of a weekly recurrence week number is irrelevant.<NEW_LINE>daysOfTheWeekDictionary.put(this.weekNumberKey, 0);<NEW_LINE>this.daysOfTheWeek[i] = daysOfTheWeekDictionary;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | byDay = matchExpression(".*(BYDAY=[,0-9A-Z]*).*", 6); |
1,160,047 | void recordPanacheEntityPersistenceUnits(PanacheHibernateOrmRecorder recorder, Optional<JpaModelPersistenceUnitMappingBuildItem> jpaModelPersistenceUnitMapping, Set<String> panacheEntityClasses) {<NEW_LINE>Map<String, String> panacheEntityToPersistenceUnit = new HashMap<>();<NEW_LINE>if (jpaModelPersistenceUnitMapping.isPresent()) {<NEW_LINE>Map<String, Set<String>> collectedEntityToPersistenceUnits = jpaModelPersistenceUnitMapping.get().getEntityToPersistenceUnits();<NEW_LINE>Map<String, Set<String>> violatingPanacheEntities = new TreeMap<>();<NEW_LINE>for (Map.Entry<String, Set<String>> entry : collectedEntityToPersistenceUnits.entrySet()) {<NEW_LINE>String entityName = entry.getKey();<NEW_LINE>Set<String> selectedPersistenceUnits = entry.getValue();<NEW_LINE>boolean isPanacheEntity = panacheEntityClasses.contains(entityName);<NEW_LINE>if (!isPanacheEntity) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (selectedPersistenceUnits.size() == 1) {<NEW_LINE>panacheEntityToPersistenceUnit.put(entityName, selectedPersistenceUnits.<MASK><NEW_LINE>} else {<NEW_LINE>violatingPanacheEntities.put(entityName, selectedPersistenceUnits);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (violatingPanacheEntities.size() > 0) {<NEW_LINE>StringBuilder message = new StringBuilder("Panache entities do not support being attached to several persistence units:\n");<NEW_LINE>for (Entry<String, Set<String>> violatingEntityEntry : violatingPanacheEntities.entrySet()) {<NEW_LINE>message.append("\t- ").append(violatingEntityEntry.getKey()).append(" is attached to: ").append(String.join(",", violatingEntityEntry.getValue()));<NEW_LINE>throw new IllegalStateException(message.toString());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>recorder.setEntityToPersistenceUnit(panacheEntityToPersistenceUnit);<NEW_LINE>} | iterator().next()); |
1,577,801 | public Message processRequest0(final RaftServerService service, final AppendEntriesRequest request, final RpcRequestClosure done) {<NEW_LINE>final Node node = (Node) service;<NEW_LINE>if (node.getRaftOptions().isReplicatorPipeline()) {<NEW_LINE>final String groupId = request.getGroupId();<NEW_LINE>final PeerPair pair = pairOf(request.getPeerId(), request.getServerId());<NEW_LINE>boolean isHeartbeat = isHeartbeatRequest(request);<NEW_LINE>int reqSequence = -1;<NEW_LINE>if (!isHeartbeat) {<NEW_LINE>reqSequence = getAndIncrementSequence(groupId, pair, done.getRpcCtx().getConnection());<NEW_LINE>}<NEW_LINE>final Message response = service.handleAppendEntriesRequest(request, new SequenceRpcRequestClosure(done, defaultResp(), groupId, pair, reqSequence, isHeartbeat));<NEW_LINE>if (response != null) {<NEW_LINE>if (isHeartbeat) {<NEW_LINE>done.getRpcCtx().sendResponse(response);<NEW_LINE>} else {<NEW_LINE>sendSequenceResponse(groupId, pair, reqSequence, <MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>} else {<NEW_LINE>return service.handleAppendEntriesRequest(request, done);<NEW_LINE>}<NEW_LINE>} | done.getRpcCtx(), response); |
1,370,647 | protected void onCreate(Bundle savedInstanceState) {<NEW_LINE>TiApplication tiApp = getTiApp();<NEW_LINE>// If this is a TiJSActivity derived class created via "tiapp.xml" <activity/> tags,<NEW_LINE>// then destroy it now and launch the root activity instead with the JSActivity's intent.<NEW_LINE>// Note: This feature used to bypass loading of "ti.main.js" and "app.js" which was problematic.<NEW_LINE>// Titanium 8 resolved all "newintent" resume handling, making this feature obsolete.<NEW_LINE>if (isJSActivity()) {<NEW_LINE>// First, store the JSActivity class' script URL to hash table.<NEW_LINE>// To be retrieved later by root activity so that it knows which script to load when resumed.<NEW_LINE>TiLaunchActivity.jsActivityClassScriptMap.put(getClass().getName(), getUrl());<NEW_LINE>// Call this instance's Activity.onCreate() method, bypassing TiBaseActivity.onCreate() method.<NEW_LINE>activityOnCreate(savedInstanceState);<NEW_LINE>// Destroy this activity and launch/resume the root activity.<NEW_LINE>boolean isActivityForResult = (getCallingActivity() != null);<NEW_LINE>TiRootActivity rootActivity = tiApp.getRootActivity();<NEW_LINE>if (!isActivityForResult && (rootActivity != null)) {<NEW_LINE>// Copy the JSActivity's intent to the existing root activity and resume it.<NEW_LINE>rootActivity.onNewIntent(getIntent());<NEW_LINE>Intent resumeIntent = rootActivity.getLaunchIntent();<NEW_LINE>if (resumeIntent == null) {<NEW_LINE>resumeIntent = Intent.makeMainActivity(rootActivity.getComponentName());<NEW_LINE>resumeIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);<NEW_LINE>resumeIntent.addFlags(Intent.FLAG_ACTIVITY_RESET_TASK_IF_NEEDED);<NEW_LINE>}<NEW_LINE>startActivity(resumeIntent);<NEW_LINE>finish();<NEW_LINE>overridePendingTransition(android.R.anim.fade_in, 0);<NEW_LINE>} else {<NEW_LINE>// Launch a new root activity instance with JSActivity's intent embedded within launch intent.<NEW_LINE>Intent mainIntent = getPackageManager().getLaunchIntentForPackage(getPackageName());<NEW_LINE>mainIntent.setPackage(null);<NEW_LINE>if (isActivityForResult) {<NEW_LINE><MASK><NEW_LINE>} else {<NEW_LINE>mainIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);<NEW_LINE>mainIntent.addFlags(Intent.FLAG_ACTIVITY_RESET_TASK_IF_NEEDED);<NEW_LINE>}<NEW_LINE>if (getIntent() != null) {<NEW_LINE>mainIntent.putExtra(TiC.EXTRA_TI_NEW_INTENT, getIntent());<NEW_LINE>}<NEW_LINE>finish();<NEW_LINE>overridePendingTransition(android.R.anim.fade_in, 0);<NEW_LINE>startActivity(mainIntent);<NEW_LINE>}<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>this.url = TiUrl.normalizeWindowUrl(getUrl());<NEW_LINE>// we only want to set the current activity for good in the resume state but we need it right now.<NEW_LINE>// save off the existing current activity, set ourselves to be the new current activity temporarily<NEW_LINE>// so we don't run into problems when we bind the current activity<NEW_LINE>Activity tempCurrentActivity = tiApp.getCurrentActivity();<NEW_LINE>tiApp.setCurrentActivity(this, this);<NEW_LINE>// set the current activity back to what it was originally<NEW_LINE>tiApp.setCurrentActivity(this, tempCurrentActivity);<NEW_LINE>contextCreated();<NEW_LINE>super.onCreate(savedInstanceState);<NEW_LINE>} | mainIntent.addFlags(Intent.FLAG_ACTIVITY_FORWARD_RESULT); |
1,085,174 | public void process(MarvinImage a_imageIn, MarvinImage a_imageOut, MarvinAttributes a_attributesOut, MarvinImageMask a_mask, boolean a_previewMode) {<NEW_LINE>width = a_imageIn.getWidth();<NEW_LINE>height = a_imageIn.getHeight();<NEW_LINE>mat1 = new double[width][height];<NEW_LINE>mat2 = new double[width][height];<NEW_LINE>mat4 = new double[width][height];<NEW_LINE>mata = new double[width][height];<NEW_LINE>img_x = new double[width][height];<NEW_LINE>img_y = <MASK><NEW_LINE>img_xx = new double[width][height];<NEW_LINE>img_yy = new double[width][height];<NEW_LINE>img_xy = new double[width][height];<NEW_LINE>matr = new double[width][height];<NEW_LINE>matg = new double[width][height];<NEW_LINE>matb = new double[width][height];<NEW_LINE>// no of iterations<NEW_LINE>int iter = 20;<NEW_LINE>// Put the color values in double array<NEW_LINE>for (int x = 0; x < width; x++) {<NEW_LINE>for (int y = 0; y < height; y++) {<NEW_LINE>matr[x][y] = a_imageIn.getIntComponent0(x, y);<NEW_LINE>matg[x][y] = a_imageIn.getIntComponent1(x, y);<NEW_LINE>matb[x][y] = a_imageIn.getIntComponent2(x, y);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Call denoise function<NEW_LINE>matr = denoise(matr, iter);<NEW_LINE>matg = denoise(matg, iter);<NEW_LINE>matb = denoise(matb, iter);<NEW_LINE>for (int x = 0; x < width; x++) {<NEW_LINE>for (int y = 0; y < height; y++) {<NEW_LINE>a_imageOut.setIntColor(x, y, (int) truncate(matr[x][y]), (int) truncate(matg[x][y]), (int) truncate(matb[x][y]));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | new double[width][height]; |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.