idx
int32
46
1.86M
input
stringlengths
321
6.6k
target
stringlengths
9
1.24k
1,267,653
private static void stopTabletServer(final ClientContext context, List<String> servers, final boolean force) throws AccumuloException, AccumuloSecurityException {<NEW_LINE>if (context.getManagerLocations().isEmpty()) {<NEW_LINE>log.info("No managers running. Not attempting safe unload of tserver.");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final String zTServerRoot = getTServersZkPath(context);<NEW_LINE>final <MASK><NEW_LINE>for (String server : servers) {<NEW_LINE>for (int port : context.getConfiguration().getPort(Property.TSERV_CLIENTPORT)) {<NEW_LINE>HostAndPort address = AddressUtil.parseAddress(server, port);<NEW_LINE>final String finalServer = qualifyWithZooKeeperSessionId(zTServerRoot, zc, address.toString());<NEW_LINE>log.info("Stopping server {}", finalServer);<NEW_LINE>ManagerClient.executeVoid(context, client -> client.shutdownTabletServer(TraceUtil.traceInfo(), context.rpcCreds(), finalServer, force));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
ZooCache zc = context.getZooCache();
703,860
public Route.Handler apply(@Nonnull Route.Handler next) {<NEW_LINE>long timestamp = System.currentTimeMillis();<NEW_LINE>return ctx -> {<NEW_LINE>// Take remote address here (less chances of loosing it on interrupted requests).<NEW_LINE>String remoteAddr = ctx.getRemoteAddress();<NEW_LINE>ctx.onComplete(context -> {<NEW_LINE>StringBuilder sb = new StringBuilder(MESSAGE_SIZE);<NEW_LINE>sb.append(remoteAddr);<NEW_LINE>sb.append(SP).append(DASH).append(SP);<NEW_LINE>sb.append(userId.apply(ctx));<NEW_LINE>sb.append(SP);<NEW_LINE>sb.append(BL).append(df.apply(<MASK><NEW_LINE>sb.append(SP);<NEW_LINE>sb.append(Q).append(ctx.getMethod());<NEW_LINE>sb.append(SP);<NEW_LINE>sb.append(ctx.getRequestPath());<NEW_LINE>sb.append(ctx.queryString());<NEW_LINE>sb.append(SP);<NEW_LINE>sb.append(ctx.getProtocol());<NEW_LINE>sb.append(Q).append(SP);<NEW_LINE>sb.append(ctx.getResponseCode().value());<NEW_LINE>sb.append(SP);<NEW_LINE>long responseLength = ctx.getResponseLength();<NEW_LINE>sb.append(responseLength >= 0 ? responseLength : DASH);<NEW_LINE>long now = System.currentTimeMillis();<NEW_LINE>sb.append(SP);<NEW_LINE>sb.append(now - timestamp);<NEW_LINE>appendHeaders(sb, requestHeaders, h -> ctx.header(h).valueOrNull());<NEW_LINE>appendHeaders(sb, responseHeaders, h -> ctx.getResponseHeader(h));<NEW_LINE>logRecord.accept(sb.toString());<NEW_LINE>});<NEW_LINE>return next.apply(ctx);<NEW_LINE>};<NEW_LINE>}
timestamp)).append(BR);
835,297
protected int[] createClusters(ODatabaseDocumentInternal database, String className, int minimumClusters) {<NEW_LINE>className = className.toLowerCase(Locale.ENGLISH);<NEW_LINE>int[] clusterIds;<NEW_LINE>if (internalClasses.contains(className.toLowerCase(Locale.ENGLISH))) {<NEW_LINE>// INTERNAL CLASS, SET TO 1<NEW_LINE>minimumClusters = 1;<NEW_LINE>}<NEW_LINE>clusterIds = new int[minimumClusters];<NEW_LINE>clusterIds[0] = database.getClusterIdByName(className);<NEW_LINE>if (clusterIds[0] > -1) {<NEW_LINE>// CHECK THE CLUSTER HAS NOT BEEN ALREADY ASSIGNED<NEW_LINE>final OClass cls = clustersToClasses<MASK><NEW_LINE>if (cls != null)<NEW_LINE>clusterIds[0] = database.addCluster(getNextAvailableClusterName(database, className));<NEW_LINE>} else<NEW_LINE>// JUST KEEP THE CLASS NAME. THIS IS FOR LEGACY REASONS<NEW_LINE>clusterIds[0] = database.addCluster(className);<NEW_LINE>for (int i = 1; i < minimumClusters; ++i) clusterIds[i] = database.addCluster(getNextAvailableClusterName(database, className));<NEW_LINE>return clusterIds;<NEW_LINE>}
.get(clusterIds[0]);
1,721,423
// GEN-LAST:event_moveUpHandler<NEW_LINE>private void moveDownHandler(java.awt.event.ActionEvent evt) {<NEW_LINE>// GEN-FIRST:event_moveDownHandler<NEW_LINE>int selectedRow = getSelectedRow();<NEW_LINE>if (selectedRow == -1) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>Integer type = (Integer) handlerTableModel.getValueAt(selectedRow, 1);<NEW_LINE>if (type == WSHandlerDialog.JAXWS_LOGICAL_HANDLER) {<NEW_LINE>if (selectedRow == protocolIndex) {<NEW_LINE>DialogDisplayer.getDefault().notify(new NotifyDescriptor.Message(NbBundle.getMessage(MessageHandlerPanel.class, "TXT_CannotMoveDown", NotifyDescriptor.WARNING_MESSAGE)));<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>int newSelectedRow = selectedRow + 1;<NEW_LINE>handlerTableModel.moveRow(selectedRow, selectedRow, newSelectedRow);<NEW_LINE>handlerTable.getSelectionModel(<MASK><NEW_LINE>isChanged = true;<NEW_LINE>}
).setSelectionInterval(newSelectedRow, newSelectedRow);
1,670,192
private void changeRole(PrimaryTerm term) {<NEW_LINE>threadContext.execute(() -> {<NEW_LINE>if (term.term() > currentTerm) {<NEW_LINE>log.debug("Term changed: {}", term);<NEW_LINE>currentTerm = term.term();<NEW_LINE>primary = term.primary() != null ? term.primary().memberId() : null;<NEW_LINE>backups = term.backups(descriptor.backups()).stream().map(GroupMember::memberId).<MASK><NEW_LINE>if (Objects.equals(primary, clusterMembershipService.getLocalMember().id())) {<NEW_LINE>if (this.role == null) {<NEW_LINE>this.role = new PrimaryRole(this);<NEW_LINE>log.debug("{} transitioning to {}", clusterMembershipService.getLocalMember().id(), Role.PRIMARY);<NEW_LINE>} else if (this.role.role() != Role.PRIMARY) {<NEW_LINE>this.role.close();<NEW_LINE>this.role = new PrimaryRole(this);<NEW_LINE>log.debug("{} transitioning to {}", clusterMembershipService.getLocalMember().id(), Role.PRIMARY);<NEW_LINE>}<NEW_LINE>} else if (backups.contains(clusterMembershipService.getLocalMember().id())) {<NEW_LINE>if (this.role == null) {<NEW_LINE>this.role = new BackupRole(this);<NEW_LINE>log.debug("{} transitioning to {}", clusterMembershipService.getLocalMember().id(), Role.BACKUP);<NEW_LINE>} else if (this.role.role() != Role.BACKUP) {<NEW_LINE>this.role.close();<NEW_LINE>this.role = new BackupRole(this);<NEW_LINE>log.debug("{} transitioning to {}", clusterMembershipService.getLocalMember().id(), Role.BACKUP);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>if (this.role == null) {<NEW_LINE>this.role = new NoneRole(this);<NEW_LINE>log.debug("{} transitioning to {}", clusterMembershipService.getLocalMember().id(), Role.NONE);<NEW_LINE>} else if (this.role.role() != Role.NONE) {<NEW_LINE>this.role.close();<NEW_LINE>this.role = new NoneRole(this);<NEW_LINE>log.debug("{} transitioning to {}", clusterMembershipService.getLocalMember().id(), Role.NONE);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}
collect(Collectors.toList());
255,644
ClusterState reassignTasks(final ClusterState currentState) {<NEW_LINE>ClusterState clusterState = currentState;<NEW_LINE>final PersistentTasksCustomMetadata tasks = currentState.getMetadata().custom(PersistentTasksCustomMetadata.TYPE);<NEW_LINE>if (tasks != null) {<NEW_LINE>logger.trace("reassigning {} persistent tasks", tasks.<MASK><NEW_LINE>final DiscoveryNodes nodes = currentState.nodes();<NEW_LINE>// We need to check if removed nodes were running any of the tasks and reassign them<NEW_LINE>for (PersistentTask<?> task : tasks.tasks()) {<NEW_LINE>if (needsReassignment(task.getAssignment(), nodes)) {<NEW_LINE>Assignment assignment = createAssignment(task.getTaskName(), task.getParams(), clusterState);<NEW_LINE>if (Objects.equals(assignment, task.getAssignment()) == false) {<NEW_LINE>logger.trace("reassigning task {} from node {} to node {}", task.getId(), task.getAssignment().getExecutorNode(), assignment.getExecutorNode());<NEW_LINE>clusterState = update(clusterState, builder(clusterState).reassignTask(task.getId(), assignment));<NEW_LINE>} else {<NEW_LINE>logger.trace("ignoring task {} because assignment is the same {}", task.getId(), assignment);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>logger.trace("ignoring task {} because it is still running", task.getId());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return clusterState;<NEW_LINE>}
tasks().size());
1,086,709
public void initSubAllocator() {<NEW_LINE>int i, k;<NEW_LINE>Arrays.fill(heap, freeListPos, freeListPos + sizeOfFreeList(), (byte) 0);<NEW_LINE>pText = heapStart;<NEW_LINE>int size2 = FIXED_UNIT_SIZE * (subAllocatorSize / 8 / FIXED_UNIT_SIZE * 7);<NEW_LINE>int realSize2 = size2 / FIXED_UNIT_SIZE * UNIT_SIZE;<NEW_LINE>int size1 = subAllocatorSize - size2;<NEW_LINE>int realSize1 = size1 <MASK><NEW_LINE>hiUnit = heapStart + subAllocatorSize;<NEW_LINE>loUnit = unitsStart = heapStart + realSize1;<NEW_LINE>fakeUnitsStart = heapStart + size1;<NEW_LINE>hiUnit = loUnit + realSize2;<NEW_LINE>for (i = 0, k = 1; i < N1; i++, k += 1) {<NEW_LINE>indx2Units[i] = k & 0xff;<NEW_LINE>}<NEW_LINE>for (k++; i < N1 + N2; i++, k += 2) {<NEW_LINE>indx2Units[i] = k & 0xff;<NEW_LINE>}<NEW_LINE>for (k++; i < N1 + N2 + N3; i++, k += 3) {<NEW_LINE>indx2Units[i] = k & 0xff;<NEW_LINE>}<NEW_LINE>for (k++; i < (N1 + N2 + N3 + N4); i++, k += 4) {<NEW_LINE>indx2Units[i] = k & 0xff;<NEW_LINE>}<NEW_LINE>for (glueCount = 0, k = 0, i = 0; k < 128; k++) {<NEW_LINE>i += ((indx2Units[i] < (k + 1)) ? 1 : 0);<NEW_LINE>units2Indx[k] = i & 0xff;<NEW_LINE>}<NEW_LINE>}
/ FIXED_UNIT_SIZE * UNIT_SIZE + size1 % FIXED_UNIT_SIZE;
680,827
final GetPortfolioPreferencesResult executeGetPortfolioPreferences(GetPortfolioPreferencesRequest getPortfolioPreferencesRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(getPortfolioPreferencesRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<GetPortfolioPreferencesRequest> request = null;<NEW_LINE>Response<GetPortfolioPreferencesResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new GetPortfolioPreferencesRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(getPortfolioPreferencesRequest));<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, "MigrationHubStrategy");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "GetPortfolioPreferences");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<GetPortfolioPreferencesResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new GetPortfolioPreferencesResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);
1,689,746
public void addUnion(AbstractQueryBuilder<?> subQuery) {<NEW_LINE>ElementUnion union = null;<NEW_LINE>ElementGroup clause = getClause();<NEW_LINE>// if the last element is a union make sure we add to it.<NEW_LINE>if (!clause.isEmpty()) {<NEW_LINE>Element lastElement = clause.getElements().get(clause.getElements().size() - 1);<NEW_LINE>if (lastElement instanceof ElementUnion) {<NEW_LINE>union = (ElementUnion) lastElement;<NEW_LINE>} else {<NEW_LINE>// clauses is not empty and is not a union so it is the left<NEW_LINE>// side of the union.<NEW_LINE>union = new ElementUnion();<NEW_LINE>union.addElement(clause);<NEW_LINE>whereClause = union;<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>// add the union as the first element in the clause.<NEW_LINE>union = new ElementUnion();<NEW_LINE>clause.addElement(union);<NEW_LINE>}<NEW_LINE>// if there are projected vars then do a full blown subquery<NEW_LINE>// otherwise just add the clause.<NEW_LINE>if (subQuery instanceof SelectClause && ((SelectClause<?>) subQuery).getVars().size() > 0) {<NEW_LINE>union.addElement(subQuery.asSubQuery());<NEW_LINE>} else {<NEW_LINE>prefixHandler.addPrefixes(subQuery.getPrologHandler().getPrefixes());<NEW_LINE>union.addElement(subQuery.<MASK><NEW_LINE>}<NEW_LINE>}
getWhereHandler().getClause());
223,410
public void renderForeground(PoseStack matrix, int mouseX, int mouseY) {<NEW_LINE>super.renderForeground(matrix, mouseX, mouseY);<NEW_LINE>int xAxis = mouseX - getGuiLeft()<MASK><NEW_LINE>int slotX = (xAxis - relativeX) / 18, slotY = (yAxis - relativeY) / 18;<NEW_LINE>if (slotX >= 0 && slotY >= 0 && slotX < xSlots && slotY < ySlots) {<NEW_LINE>int slotStartX = relativeX + slotX * 18 + 1, slotStartY = relativeY + slotY * 18 + 1;<NEW_LINE>if (xAxis >= slotStartX && xAxis < slotStartX + 16 && yAxis >= slotStartY && yAxis < slotStartY + 16) {<NEW_LINE>fill(matrix, slotStartX, slotStartY, slotStartX + 16, slotStartY + 16, GuiSlot.DEFAULT_HOVER_COLOR);<NEW_LINE>MekanismRenderer.resetColor();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
, yAxis = mouseY - getGuiTop();
302,851
public void marshall(GetMergeConflictsRequest getMergeConflictsRequest, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (getMergeConflictsRequest == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(getMergeConflictsRequest.getRepositoryName(), REPOSITORYNAME_BINDING);<NEW_LINE>protocolMarshaller.marshall(getMergeConflictsRequest.getDestinationCommitSpecifier(), DESTINATIONCOMMITSPECIFIER_BINDING);<NEW_LINE>protocolMarshaller.marshall(getMergeConflictsRequest.getSourceCommitSpecifier(), SOURCECOMMITSPECIFIER_BINDING);<NEW_LINE>protocolMarshaller.marshall(getMergeConflictsRequest.getMergeOption(), MERGEOPTION_BINDING);<NEW_LINE>protocolMarshaller.marshall(getMergeConflictsRequest.getConflictDetailLevel(), CONFLICTDETAILLEVEL_BINDING);<NEW_LINE>protocolMarshaller.marshall(getMergeConflictsRequest.getMaxConflictFiles(), MAXCONFLICTFILES_BINDING);<NEW_LINE>protocolMarshaller.marshall(<MASK><NEW_LINE>protocolMarshaller.marshall(getMergeConflictsRequest.getNextToken(), NEXTTOKEN_BINDING);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>}
getMergeConflictsRequest.getConflictResolutionStrategy(), CONFLICTRESOLUTIONSTRATEGY_BINDING);
1,392,641
public void assignLabels(LingoProcessingContext context, DoubleMatrix2D stemCos, IntIntHashMap filteredRowToStemIndex, DoubleMatrix2D phraseCos) {<NEW_LINE>final PreprocessingContext preprocessingContext = context.preprocessingContext;<NEW_LINE>final <MASK><NEW_LINE>final int[] labelsFeatureIndex = preprocessingContext.allLabels.featureIndex;<NEW_LINE>final int[] mostFrequentOriginalWordIndex = preprocessingContext.allStems.mostFrequentOriginalWordIndex;<NEW_LINE>final int desiredClusterCount = stemCos.columns();<NEW_LINE>int[] candidateStemIndices = new int[desiredClusterCount];<NEW_LINE>double[] candidateStemScores = new double[desiredClusterCount];<NEW_LINE>int[] candidatePhraseIndices = new int[desiredClusterCount];<NEW_LINE>Arrays.fill(candidatePhraseIndices, -1);<NEW_LINE>double[] candidatePhraseScores = new double[desiredClusterCount];<NEW_LINE>MatrixUtils.maxInColumns(stemCos, candidateStemIndices, candidateStemScores, Functions.ABS);<NEW_LINE>if (phraseCos != null) {<NEW_LINE>MatrixUtils.maxInColumns(phraseCos, candidatePhraseIndices, candidatePhraseScores, Functions.ABS);<NEW_LINE>}<NEW_LINE>// Choose between single words and phrases for each base vector<NEW_LINE>final int[] clusterLabelFeatureIndex = new int[desiredClusterCount];<NEW_LINE>double[] clusterLabelScore = new double[desiredClusterCount];<NEW_LINE>for (int i = 0; i < desiredClusterCount; i++) {<NEW_LINE>final int phraseFeatureIndex = candidatePhraseIndices[i];<NEW_LINE>final int stemIndex = filteredRowToStemIndex.get(candidateStemIndices[i]);<NEW_LINE>final double phraseScore = candidatePhraseScores[i];<NEW_LINE>if (phraseFeatureIndex >= 0 && phraseScore > candidateStemScores[i]) {<NEW_LINE>clusterLabelFeatureIndex[i] = labelsFeatureIndex[phraseFeatureIndex + firstPhraseIndex];<NEW_LINE>clusterLabelScore[i] = phraseScore;<NEW_LINE>} else {<NEW_LINE>clusterLabelFeatureIndex[i] = mostFrequentOriginalWordIndex[stemIndex];<NEW_LINE>clusterLabelScore[i] = candidateStemScores[i];<NEW_LINE>}<NEW_LINE>}<NEW_LINE>context.clusterLabelFeatureIndex = clusterLabelFeatureIndex;<NEW_LINE>context.clusterLabelScore = clusterLabelScore;<NEW_LINE>}
int firstPhraseIndex = preprocessingContext.allLabels.firstPhraseIndex;
1,205,749
private List<Source> buildEventSources(AlarmMessage msg) {<NEW_LINE>final List<Source> sources = new ArrayList<>(2);<NEW_LINE>final Source.SourceBuilder sourcePrototype = Source.builder();<NEW_LINE>switch(msg.getScopeId()) {<NEW_LINE>case DefaultScopeDefine.SERVICE_RELATION:<NEW_LINE>final IDManager.ServiceID.ServiceIDDefinition destServiceIdDef = IDManager.ServiceID.analysisId(msg.getId1());<NEW_LINE>sources.add(sourcePrototype.service(destServiceIdDef.getName()).build());<NEW_LINE>// fall through<NEW_LINE>case DefaultScopeDefine.SERVICE:<NEW_LINE>final IDManager.ServiceID.ServiceIDDefinition sourceServiceIdDef = IDManager.ServiceID.analysisId(msg.getId());<NEW_LINE>sources.add(sourcePrototype.service(sourceServiceIdDef.getName()).build());<NEW_LINE>break;<NEW_LINE>case DefaultScopeDefine.SERVICE_INSTANCE_RELATION:<NEW_LINE>final IDManager.ServiceInstanceID.InstanceIDDefinition destInstanceIdDef = IDManager.ServiceInstanceID.analysisId(msg.getId1());<NEW_LINE>final String destServiceName = IDManager.ServiceID.analysisId(destInstanceIdDef.getServiceId()).getName();<NEW_LINE>sources.add(sourcePrototype.service(destServiceName).serviceInstance(destInstanceIdDef.getName()).build());<NEW_LINE>// fall through<NEW_LINE>case DefaultScopeDefine.SERVICE_INSTANCE:<NEW_LINE>final IDManager.ServiceInstanceID.InstanceIDDefinition sourceInstanceIdDef = IDManager.ServiceInstanceID.analysisId(msg.getId());<NEW_LINE>final String serviceName = IDManager.ServiceID.analysisId(sourceInstanceIdDef.getServiceId()).getName();<NEW_LINE>sources.add(sourcePrototype.serviceInstance(sourceInstanceIdDef.getName()).service(serviceName).build());<NEW_LINE>break;<NEW_LINE>case DefaultScopeDefine.ENDPOINT_RELATION:<NEW_LINE>final IDManager.EndpointID.EndpointIDDefinition destEndpointIDDef = IDManager.EndpointID.analysisId(msg.getId1());<NEW_LINE>final String destEndpointServiceName = IDManager.ServiceID.analysisId(destEndpointIDDef.getServiceId()).getName();<NEW_LINE>sources.add(sourcePrototype.service(destEndpointServiceName).build());<NEW_LINE>// fall through<NEW_LINE>case DefaultScopeDefine.ENDPOINT:<NEW_LINE>final IDManager.EndpointID.EndpointIDDefinition endpointIDDef = IDManager.EndpointID.analysisId(msg.getId());<NEW_LINE>final String endpointServiceName = IDManager.ServiceID.analysisId(endpointIDDef.getServiceId()).getName();<NEW_LINE>sources.add(sourcePrototype.service<MASK><NEW_LINE>break;<NEW_LINE>}<NEW_LINE>return sources;<NEW_LINE>}
(endpointServiceName).build());
525,305
public static void addEngineLoggingData(String type, String message, String engineType, ObjectMapper objectMapper) {<NEW_LINE>ObjectNode loggingNode = objectMapper.createObjectNode();<NEW_LINE>loggingNode.put("message", message);<NEW_LINE>loggingNode.put("engineType", engineType);<NEW_LINE>LoggingSession loggingSession = Context.getCommandContext().getSession(LoggingSession.class);<NEW_LINE>List<ObjectNode> loggingData = loggingSession.getLoggingData();<NEW_LINE>if (loggingData != null) {<NEW_LINE>for (ObjectNode itemNode : loggingData) {<NEW_LINE>if (itemNode.has("scopeId") && itemNode.has("scopeDefinitionKey")) {<NEW_LINE>loggingNode.put("scopeId", itemNode.get("scopeId").asText());<NEW_LINE>loggingNode.put("scopeType", itemNode.get("scopeType").asText());<NEW_LINE>loggingNode.put("scopeDefinitionId", itemNode.get<MASK><NEW_LINE>loggingNode.put("scopeDefinitionKey", itemNode.get("scopeDefinitionKey").asText());<NEW_LINE>if (itemNode.has("scopeDefinitionName") && !itemNode.get("scopeDefinitionName").isNull()) {<NEW_LINE>loggingNode.put("scopeDefinitionName", itemNode.get("scopeDefinitionName").asText());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>addLoggingData(type, loggingNode, engineType);<NEW_LINE>}
("scopeDefinitionId").asText());
1,241,870
public static DescribeForwardTableEntriesResponse unmarshall(DescribeForwardTableEntriesResponse describeForwardTableEntriesResponse, UnmarshallerContext _ctx) {<NEW_LINE>describeForwardTableEntriesResponse.setRequestId(_ctx.stringValue("DescribeForwardTableEntriesResponse.RequestId"));<NEW_LINE>describeForwardTableEntriesResponse.setPageSize(_ctx.integerValue("DescribeForwardTableEntriesResponse.PageSize"));<NEW_LINE>describeForwardTableEntriesResponse.setPageNumber(_ctx.integerValue("DescribeForwardTableEntriesResponse.PageNumber"));<NEW_LINE>describeForwardTableEntriesResponse.setTotalCount(_ctx.integerValue("DescribeForwardTableEntriesResponse.TotalCount"));<NEW_LINE>List<ForwardTableEntry> forwardTableEntries = new ArrayList<ForwardTableEntry>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("DescribeForwardTableEntriesResponse.ForwardTableEntries.Length"); i++) {<NEW_LINE>ForwardTableEntry forwardTableEntry = new ForwardTableEntry();<NEW_LINE>forwardTableEntry.setStatus(_ctx.stringValue("DescribeForwardTableEntriesResponse.ForwardTableEntries[" + i + "].Status"));<NEW_LINE>forwardTableEntry.setForwardEntryId(_ctx.stringValue("DescribeForwardTableEntriesResponse.ForwardTableEntries[" + i + "].ForwardEntryId"));<NEW_LINE>forwardTableEntry.setInternalIp(_ctx.stringValue("DescribeForwardTableEntriesResponse.ForwardTableEntries[" + i + "].InternalIp"));<NEW_LINE>forwardTableEntry.setInternalPort(_ctx.stringValue("DescribeForwardTableEntriesResponse.ForwardTableEntries[" + i + "].InternalPort"));<NEW_LINE>forwardTableEntry.setForwardTableId(_ctx.stringValue("DescribeForwardTableEntriesResponse.ForwardTableEntries[" + i + "].ForwardTableId"));<NEW_LINE>forwardTableEntry.setExternalPort(_ctx.stringValue("DescribeForwardTableEntriesResponse.ForwardTableEntries[" + i + "].ExternalPort"));<NEW_LINE>forwardTableEntry.setIpProtocol(_ctx.stringValue<MASK><NEW_LINE>forwardTableEntry.setExternalIp(_ctx.stringValue("DescribeForwardTableEntriesResponse.ForwardTableEntries[" + i + "].ExternalIp"));<NEW_LINE>forwardTableEntries.add(forwardTableEntry);<NEW_LINE>}<NEW_LINE>describeForwardTableEntriesResponse.setForwardTableEntries(forwardTableEntries);<NEW_LINE>return describeForwardTableEntriesResponse;<NEW_LINE>}
("DescribeForwardTableEntriesResponse.ForwardTableEntries[" + i + "].IpProtocol"));
776,937
public Facet unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>Facet facet = new Facet();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>if (context.testExpression("Name", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>facet.setName(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("ObjectType", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>facet.setObjectType(context.getUnmarshaller(String.<MASK><NEW_LINE>}<NEW_LINE>if (context.testExpression("FacetStyle", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>facet.setFacetStyle(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return facet;<NEW_LINE>}
class).unmarshall(context));
88,450
public static Schema infer(List<Writable> record) {<NEW_LINE>Schema.Builder builder = new Schema.Builder();<NEW_LINE>for (int i = 0; i < record.size(); i++) {<NEW_LINE>if (record.get(i) instanceof DoubleWritable)<NEW_LINE>builder.addColumnDouble(String.valueOf(i));<NEW_LINE>else if (record.get(i) instanceof IntWritable)<NEW_LINE>builder.addColumnInteger(String.valueOf(i));<NEW_LINE>else if (record.get(i) instanceof LongWritable)<NEW_LINE>builder.addColumnLong<MASK><NEW_LINE>else if (record.get(i) instanceof FloatWritable)<NEW_LINE>builder.addColumnFloat(String.valueOf(i));<NEW_LINE>else if (record.get(i) instanceof Text) {<NEW_LINE>builder.addColumnString(String.valueOf(i));<NEW_LINE>} else<NEW_LINE>throw new IllegalStateException("Illegal writable for infering schema of type " + record.get(i).getClass().toString() + " with record " + record);<NEW_LINE>}<NEW_LINE>return builder.build();<NEW_LINE>}
(String.valueOf(i));
180,579
public com.amazonaws.services.fis.model.ServiceQuotaExceededException unmarshallFromContext(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>com.amazonaws.services.fis.model.ServiceQuotaExceededException serviceQuotaExceededException = new com.amazonaws.services.fis.model.ServiceQuotaExceededException(null);<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE><MASK><NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>} 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 serviceQuotaExceededException;<NEW_LINE>}
JsonToken token = context.getCurrentToken();
147,741
public static void main(String[] args) throws Exception {<NEW_LINE>Args searchSolrArgs = new Args();<NEW_LINE>CmdLineParser parser = new CmdLineParser(searchSolrArgs, ParserProperties.defaults().withUsageWidth(90));<NEW_LINE>try {<NEW_LINE>parser.parseArgument(args);<NEW_LINE>} catch (CmdLineException e) {<NEW_LINE>System.err.println(e.getMessage());<NEW_LINE><MASK><NEW_LINE>System.err.println("Example: SearchSolr" + parser.printExample(OptionHandlerFilter.REQUIRED));<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final long start = System.nanoTime();<NEW_LINE>SearchSolr searcher = new SearchSolr(searchSolrArgs);<NEW_LINE>searcher.runTopics();<NEW_LINE>searcher.close();<NEW_LINE>final long durationMillis = TimeUnit.MILLISECONDS.convert(System.nanoTime() - start, TimeUnit.NANOSECONDS);<NEW_LINE>LOG.info("Total run time: " + DurationFormatUtils.formatDuration(durationMillis, "HH:mm:ss"));<NEW_LINE>}
parser.printUsage(System.err);
1,437,819
public Future<?> submitTask() {<NEW_LINE>return executor.submit(new Callable<Void>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public Void call() throws Exception {<NEW_LINE>// Commented out lines below are only possible from an EJB.<NEW_LINE>// They are not possible for a task that was submitted from an EJB.<NEW_LINE>InitialContext initialContext = new InitialContext();<NEW_LINE>// tran.begin();<NEW_LINE>try {<NEW_LINE>Object value = initialContext.lookup("java:comp/env/entry1");<NEW_LINE>if (!"value1".equals(value))<NEW_LINE>throw new Exception("Unexpected value: " + value);<NEW_LINE>} finally {<NEW_LINE>// tran.commit();<NEW_LINE>}<NEW_LINE>ExecutorService executor1 = (ExecutorService) initialContext.lookup("java:comp/env/executor-bmt");<NEW_LINE>if (executor1 == null || executor1 instanceof ScheduledExecutorService)<NEW_LINE>throw new Exception(<MASK><NEW_LINE>// ensure that java:comp/UserTransaction is available<NEW_LINE>UserTransaction tran2 = (UserTransaction) initialContext.lookup("java:comp/UserTransaction");<NEW_LINE>tran2.begin();<NEW_LINE>tran2.commit();<NEW_LINE>UserTransaction tran3 = sessionContext.getUserTransaction();<NEW_LINE>// tran3.begin();<NEW_LINE>// tran3.commit();<NEW_LINE>// SessionContext sessionContext = (SessionContext) initialContext.lookup("java:comp/EJBContext");<NEW_LINE>// UserTransaction tran4 = sessionContext.getUserTransaction();<NEW_LINE>// tran4.begin();<NEW_LINE>// tran4.commit();<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}
"Unexpected resource ref result " + executor1 + " for " + executor);
371,194
final ListTagsResult executeListTags(ListTagsRequest listTagsRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(listTagsRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<ListTagsRequest> request = null;<NEW_LINE>Response<ListTagsResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new ListTagsRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(listTagsRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "Lambda");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ListTags");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<ListTagsResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new ListTagsResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
HandlerContextKey.SIGNING_REGION, getSigningRegion());
1,756,466
private Answer execute(ListTemplateCommand cmd) {<NEW_LINE>if (!_inSystemVM) {<NEW_LINE>return new ListTemplateAnswer(null, null);<NEW_LINE>}<NEW_LINE>DataStoreTO store = cmd.getDataStore();<NEW_LINE>if (store instanceof NfsTO) {<NEW_LINE>NfsTO nfs = (NfsTO) store;<NEW_LINE>String secUrl = nfs.getUrl();<NEW_LINE>String root = getRootDir(<MASK><NEW_LINE>Map<String, TemplateProp> templateInfos = _dlMgr.gatherTemplateInfo(root);<NEW_LINE>return new ListTemplateAnswer(secUrl, templateInfos);<NEW_LINE>} else if (store instanceof SwiftTO) {<NEW_LINE>SwiftTO swift = (SwiftTO) store;<NEW_LINE>Map<String, TemplateProp> templateInfos = swiftListTemplate(swift);<NEW_LINE>return new ListTemplateAnswer(swift.toString(), templateInfos);<NEW_LINE>} else if (store instanceof S3TO) {<NEW_LINE>S3TO s3 = (S3TO) store;<NEW_LINE>Map<String, TemplateProp> templateInfos = s3ListTemplate(s3);<NEW_LINE>return new ListTemplateAnswer(s3.getBucketName(), templateInfos);<NEW_LINE>} else {<NEW_LINE>return new Answer(cmd, false, "Unsupported image data store: " + store);<NEW_LINE>}<NEW_LINE>}
secUrl, cmd.getNfsVersion());
604,914
// computes all subtractions in input string: had to be called twice in gunnercal<NEW_LINE>public static String subtraction(String input) {<NEW_LINE>double num1 = 0, num2 = 0, ans = 0;<NEW_LINE>int b = 0, t1 = 0, t2 = 0;<NEW_LINE>String anstring = "";<NEW_LINE>String temp = "";<NEW_LINE>int count = 0;<NEW_LINE>while (b < input.length()) {<NEW_LINE>if ((input.charAt(b) == '-') && ((b > 0) && (input.charAt(b - 1) != 'E'))) {<NEW_LINE>num1 = getbacknumber(input, (b - 1));<NEW_LINE>num2 = getfrontnumber(input, (b + 1));<NEW_LINE>ans = num1 - num2;<NEW_LINE>t1 = getendex(input, (b - 1));<NEW_LINE>t2 = getfrontex(input, (b + 1));<NEW_LINE>if (ans >= 0) {<NEW_LINE>anstring = "+" + String.valueOf(ans);<NEW_LINE>temp = input.substring(0, t1) + anstring + input.substring(t2 + 1);<NEW_LINE>} else {<NEW_LINE>anstring = String.valueOf(ans);<NEW_LINE>temp = input.substring(0, t1) + anstring + <MASK><NEW_LINE>}<NEW_LINE>count++;<NEW_LINE>b = 1;<NEW_LINE>}<NEW_LINE>if ((count > 0) && (input != temp)) {<NEW_LINE>input = simplification1(temp);<NEW_LINE>// b=1;<NEW_LINE>}<NEW_LINE>b++;<NEW_LINE>}<NEW_LINE>return input;<NEW_LINE>}
input.substring(t2 + 1);
252,108
public MediaConfigurePayload location(Location loc) {<NEW_LINE>Location payloadLoc = new Location();<NEW_LINE>payloadLoc.setExternal_id(loc.getExternal_id());<NEW_LINE>payloadLoc.setName(loc.getName());<NEW_LINE>payloadLoc.setAddress(loc.getAddress());<NEW_LINE>payloadLoc.setLat(loc.getLat());<NEW_LINE>payloadLoc.<MASK><NEW_LINE>payloadLoc.setExternal_source(loc.getExternal_source());<NEW_LINE>payloadLoc.put(payloadLoc.getExternal_source() + "_id", payloadLoc.getExternal_id());<NEW_LINE>this.location = IGUtils.objectToJson(payloadLoc);<NEW_LINE>this.put("geotag_enabled", "1");<NEW_LINE>this.put("posting_latitude", payloadLoc.getLat().toString());<NEW_LINE>this.put("posting_longitude", payloadLoc.getLng().toString());<NEW_LINE>this.put("media_latitude", payloadLoc.getLat().toString());<NEW_LINE>this.put("media_longitude", payloadLoc.getLng().toString());<NEW_LINE>return this;<NEW_LINE>}
setLng(loc.getLng());
277,366
protected ActivityBehavior createCamelActivityBehavior(TaskWithFieldExtensions task, List<FieldExtension> fieldExtensions) {<NEW_LINE>try {<NEW_LINE>Class<?> theClass = null;<NEW_LINE>FieldExtension behaviorExtension = null;<NEW_LINE>for (FieldExtension fieldExtension : fieldExtensions) {<NEW_LINE>if ("camelBehaviorClass".equals(fieldExtension.getFieldName()) && StringUtils.isNotEmpty(fieldExtension.getStringValue())) {<NEW_LINE>theClass = Class.forName(fieldExtension.getStringValue());<NEW_LINE>behaviorExtension = fieldExtension;<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (behaviorExtension != null) {<NEW_LINE>fieldExtensions.remove(behaviorExtension);<NEW_LINE>}<NEW_LINE>if (theClass == null) {<NEW_LINE>// Default Camel behavior class<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>List<FieldDeclaration> fieldDeclarations = createFieldDeclarations(fieldExtensions);<NEW_LINE>addExceptionMapAsFieldDeclaration(fieldDeclarations, task.getMapExceptions());<NEW_LINE>return (ActivityBehavior) ClassDelegate.defaultInstantiateDelegate(theClass, fieldDeclarations);<NEW_LINE>} catch (ClassNotFoundException e) {<NEW_LINE>throw new ActivitiException("Could not find org.activiti.camel.CamelBehavior: ", e);<NEW_LINE>}<NEW_LINE>}
theClass = Class.forName("org.activiti.camel.impl.CamelBehaviorDefaultImpl");
1,207,883
private void emitRequiredSequence(TypeSpec.Builder intentBuilderTypeBuilder, List<ExtraInjection> requiredInjections) {<NEW_LINE>if (!target.hasRequiredFields) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final TypeName generic = getInitialStateGeneric(false);<NEW_LINE>TypeSpec.Builder requiredSequenceBuilder = TypeSpec.classBuilder(REQUIRED_SEQUENCE_CLASS).superclass(ParameterizedTypeName.get(get(RequiredStateSequence.class), generic)).addTypeVariable((TypeVariableName) generic).addModifiers(Modifier.PUBLIC).addModifiers(Modifier.STATIC);<NEW_LINE>MethodSpec.Builder constructorBuilder = MethodSpec.constructorBuilder().addModifiers(Modifier.PUBLIC).addParameter(Bundler.class, "bundler").addParameter(generic, "allRequiredSetState").addStatement("super(bundler, allRequiredSetState)");<NEW_LINE>requiredSequenceBuilder.<MASK><NEW_LINE>TypeSpec.Builder builderStateClass = requiredSequenceBuilder;<NEW_LINE>for (int i = 0; i < requiredInjections.size(); i++) {<NEW_LINE>final boolean isLast = i == requiredInjections.size() - 1;<NEW_LINE>final ExtraInjection binding = requiredInjections.get(i);<NEW_LINE>final String nextClass = emitRequiredSetter(builderStateClass, binding, generic, isLast);<NEW_LINE>builderStateClass = rotateBuilderState(requiredSequenceBuilder, builderStateClass, nextClass);<NEW_LINE>}<NEW_LINE>intentBuilderTypeBuilder.addType(requiredSequenceBuilder.build());<NEW_LINE>}
addMethod(constructorBuilder.build());
1,351,622
public Mono<Response<Void>> generalizeWithResponseAsync(String resourceGroupName, String vmName) {<NEW_LINE>if (this.client.getEndpoint() == null) {<NEW_LINE>return Mono.<MASK><NEW_LINE>}<NEW_LINE>if (resourceGroupName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (vmName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter vmName is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (this.client.getSubscriptionId() == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."));<NEW_LINE>}<NEW_LINE>final String apiVersion = "2020-06-01";<NEW_LINE>return FluxUtil.withContext(context -> service.generalize(this.client.getEndpoint(), resourceGroupName, vmName, apiVersion, this.client.getSubscriptionId(), context)).contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));<NEW_LINE>}
error(new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
1,421,031
protected void doLogin() {<NEW_LINE>String login = loginField.getValue();<NEW_LINE>String password = passwordField.getValue() != null ? passwordField.getValue() : "";<NEW_LINE>Map<String, Object> params = new HashMap<>(urlRouting.getState().getParams());<NEW_LINE>if (StringUtils.isEmpty(login) || StringUtils.isEmpty(password)) {<NEW_LINE>showNotification(messages.getMainMessage("loginWindow.emptyLoginOrPassword"), NotificationType.WARNING);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>try {<NEW_LINE><MASK><NEW_LINE>app.setLocale(selectedLocale);<NEW_LINE>doLogin(new LoginPasswordCredentials(login, password, selectedLocale, params));<NEW_LINE>// locale could be set on the server<NEW_LINE>if (connection.getSession() != null) {<NEW_LINE>Locale loggedInLocale = connection.getSession().getLocale();<NEW_LINE>if (globalConfig.getLocaleSelectVisible()) {<NEW_LINE>app.addCookie(App.COOKIE_LOCALE, loggedInLocale.toLanguageTag());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (InternalAuthenticationException e) {<NEW_LINE>log.error("Internal error during login", e);<NEW_LINE>showUnhandledExceptionOnLogin(e);<NEW_LINE>} catch (LoginException e) {<NEW_LINE>log.info("Login failed: {}", e.toString());<NEW_LINE>String message = StringUtils.abbreviate(e.getMessage(), 1000);<NEW_LINE>showLoginException(message);<NEW_LINE>} catch (Exception e) {<NEW_LINE>if (connection.isAuthenticated()) {<NEW_LINE>ExceptionHandlers handlers = app.getExceptionHandlers();<NEW_LINE>handlers.handle(new ErrorEvent(e));<NEW_LINE>} else {<NEW_LINE>log.warn("Unable to login", e);<NEW_LINE>showUnhandledExceptionOnLogin(e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
Locale selectedLocale = localesSelect.getValue();
1,340,611
private void logTask(long startTimeNanos, long duration, ProfilerTask type, String description) {<NEW_LINE>Preconditions.checkNotNull(description);<NEW_LINE>Preconditions.checkState(!"".equals(description), "No description -> not helpful");<NEW_LINE>if (duration < 0) {<NEW_LINE>// See note in Clock#nanoTime, which is used by Profiler#nanoTimeMaybe.<NEW_LINE>duration = 0;<NEW_LINE>}<NEW_LINE>StatRecorder statRecorder = <MASK><NEW_LINE>if (collectTaskHistograms && statRecorder != null) {<NEW_LINE>statRecorder.addStat((int) Duration.ofNanos(duration).toMillis(), description);<NEW_LINE>}<NEW_LINE>if (isActive() && startTimeNanos >= 0 && isProfiling(type)) {<NEW_LINE>// Store instance fields as local variables so they are not nulled out from under us by<NEW_LINE>// #clear.<NEW_LINE>FileWriter currentWriter = writerRef.get();<NEW_LINE>if (wasTaskSlowEnoughToRecord(type, duration)) {<NEW_LINE>TaskData data = new TaskData(taskId.incrementAndGet(), startTimeNanos, type, description);<NEW_LINE>data.duration = duration;<NEW_LINE>if (currentWriter != null) {<NEW_LINE>currentWriter.enqueue(data);<NEW_LINE>}<NEW_LINE>SlowestTaskAggregator aggregator = slowestTasks[type.ordinal()];<NEW_LINE>if (aggregator != null) {<NEW_LINE>aggregator.add(data);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
tasksHistograms[type.ordinal()];
1,378,126
public void eliminateSharedStreams() {<NEW_LINE>if (!sharedStreams)<NEW_LINE>return;<NEW_LINE>sharedStreams = false;<NEW_LINE>if (pageRefs.size() == 1)<NEW_LINE>return;<NEW_LINE>List<PdfObject> newRefs = new ArrayList<>();<NEW_LINE>List<PdfObject> newStreams = new ArrayList<>();<NEW_LINE>IntHashtable visited = new IntHashtable();<NEW_LINE>for (int k = 1; k <= pageRefs.size(); ++k) {<NEW_LINE>PdfDictionary page = pageRefs.getPageN(k);<NEW_LINE>if (page == null)<NEW_LINE>continue;<NEW_LINE>PdfObject contents = getPdfObject(page.get(PdfName.CONTENTS));<NEW_LINE>if (contents == null)<NEW_LINE>continue;<NEW_LINE>if (contents.isStream()) {<NEW_LINE>PRIndirectReference ref = (PRIndirectReference) page.get(PdfName.CONTENTS);<NEW_LINE>if (visited.containsKey(ref.getNumber())) {<NEW_LINE>// need to duplicate<NEW_LINE>newRefs.add(ref);<NEW_LINE>newStreams.add(new PRStream((PRStream) contents, null));<NEW_LINE>} else<NEW_LINE>visited.put(<MASK><NEW_LINE>} else if (contents.isArray()) {<NEW_LINE>PdfArray array = (PdfArray) contents;<NEW_LINE>for (int j = 0; j < array.size(); ++j) {<NEW_LINE>PRIndirectReference ref = (PRIndirectReference) array.getPdfObject(j);<NEW_LINE>if (visited.containsKey(ref.getNumber())) {<NEW_LINE>// need to duplicate<NEW_LINE>newRefs.add(ref);<NEW_LINE>newStreams.add(new PRStream((PRStream) getPdfObject(ref), null));<NEW_LINE>} else<NEW_LINE>visited.put(ref.getNumber(), 1);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (newStreams.isEmpty())<NEW_LINE>return;<NEW_LINE>for (int k = 0; k < newStreams.size(); ++k) {<NEW_LINE>xrefObj.add(newStreams.get(k));<NEW_LINE>PRIndirectReference ref = (PRIndirectReference) newRefs.get(k);<NEW_LINE>ref.setNumber(xrefObj.size() - 1, 0);<NEW_LINE>}<NEW_LINE>}
ref.getNumber(), 1);
197,831
public DigestSupport digest(OciVaultDigestConfig providerConfig) {<NEW_LINE>DigestFunction digestFunction = (data, preHashed) -> {<NEW_LINE>Sign.Request request = providerConfig.signRequest().message(Base64Value.create(data)).messageType(preHashed ? Sign.Request.MESSAGE_TYPE_DIGEST : Sign.Request.MESSAGE_TYPE_RAW);<NEW_LINE>return ociVault.sign(request).map(Sign.Response::signature).map(Base64Value::toBase64);<NEW_LINE>};<NEW_LINE>VerifyFunction verifyFunction = (data, preHashed, digest) -> {<NEW_LINE>Verify.Request verifyRequest = providerConfig.verifyRequest().message(Base64Value.create(data)).messageType(preHashed ? Sign.Request.MESSAGE_TYPE_DIGEST : Sign.Request.MESSAGE_TYPE_RAW).signature(Base64Value.createFromEncoded(digest));<NEW_LINE>return ociVault.verify(verifyRequest).<MASK><NEW_LINE>};<NEW_LINE>return DigestSupport.create(digestFunction, verifyFunction);<NEW_LINE>}
map(Verify.Response::isValid);
1,138,415
private void drawPoints(float[] verArray, byte[] colorArray) {<NEW_LINE>if (colorArray != null) {<NEW_LINE>ByteBuffer tex = ByteBuffer.allocateDirect(colorArray.length);<NEW_LINE>tex.order(ByteOrder.nativeOrder());<NEW_LINE>tex.put(colorArray);<NEW_LINE>tex.position(0);<NEW_LINE><MASK><NEW_LINE>GLES10.glColorPointer(4, GLES10.GL_UNSIGNED_BYTE, 0, tex);<NEW_LINE>}<NEW_LINE>ByteBuffer ver = ByteBuffer.allocateDirect(verArray.length * 4);<NEW_LINE>ver.order(ByteOrder.nativeOrder());<NEW_LINE>ver.asFloatBuffer().put(verArray);<NEW_LINE>GLES10.glEnableClientState(GLES10.GL_VERTEX_ARRAY);<NEW_LINE>GLES10.glVertexPointer(3, GLES10.GL_FLOAT, 0, ver);<NEW_LINE>GLES10.glDrawArrays(GLES10.GL_POINTS, 0, verArray.length / 3);<NEW_LINE>GLES10.glDisableClientState(GLES10.GL_VERTEX_ARRAY);<NEW_LINE>if (colorArray != null)<NEW_LINE>GLES10.glDisableClientState(GLES10.GL_COLOR_ARRAY);<NEW_LINE>}
GLES10.glEnableClientState(GLES10.GL_COLOR_ARRAY);
1,625,980
private String replaceOrAddFontFamilyInStyle(String style, String fontFamily) {<NEW_LINE>StringBuilder sb = new StringBuilder();<NEW_LINE>int fontFamilyStart = style.indexOf(SVG_ATTRIBUTE_fontFamily + ":");<NEW_LINE>if (fontFamilyStart >= 0) {<NEW_LINE>fontFamilyStart = fontFamilyStart + SVG_ATTRIBUTE_fontFamily.length() + 1;<NEW_LINE>sb.append(style.substring(0, fontFamilyStart));<NEW_LINE>// do not put single quotes around family name here because the value might already contain quotes,<NEW_LINE>// especially if it is coming from font extension export configuration<NEW_LINE>sb.append(fontFamily);<NEW_LINE>int fontFamilyEnd = <MASK><NEW_LINE>if (fontFamilyEnd >= 0) {<NEW_LINE>sb.append(style.substring(fontFamilyEnd));<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>sb.append(style);<NEW_LINE>if (!style.trim().endsWith(";")) {<NEW_LINE>sb.append(";");<NEW_LINE>}<NEW_LINE>// do not put single quotes around family name here because the value might already contain quotes,<NEW_LINE>// especially if it is coming from font extension export configuration<NEW_LINE>sb.append(SVG_ATTRIBUTE_fontFamily + ": " + fontFamily + ";");<NEW_LINE>}<NEW_LINE>return sb.toString();<NEW_LINE>}
style.indexOf(";", fontFamilyStart);
764,515
private void addLabelAndReference(Program program, Instruction switchInstruction, Address target, String label) {<NEW_LINE>program.getReferenceManager().addMemoryReference(switchInstruction.getMinAddress(), target, RefType.COMPUTED_JUMP, SourceType.ANALYSIS, CodeUnit.MNEMONIC);<NEW_LINE>// put switch table cases into namespace for the switch<NEW_LINE>// create namespace if necessary<NEW_LINE>Namespace space = null;<NEW_LINE>String switchName = switchInstruction.getMnemonicString() + "_" + switchInstruction.getAddress().toString();<NEW_LINE>try {<NEW_LINE>space = program.getSymbolTable().createNameSpace(null, switchName, SourceType.ANALYSIS);<NEW_LINE>} catch (DuplicateNameException e) {<NEW_LINE>space = program.getSymbolTable().getNamespace(switchName, null);<NEW_LINE>} catch (InvalidInputException e) {<NEW_LINE>// just go with default space<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>program.getSymbolTable().createLabel(target, label, space, SourceType.ANALYSIS);<NEW_LINE>} catch (InvalidInputException e1) {<NEW_LINE>Msg.error(<MASK><NEW_LINE>}<NEW_LINE>}
this, e1.getMessage());
1,203,456
public Void call(final OBaseWorkLoadContext context) {<NEW_LINE>final OWorkLoadContext graphContext = ((OWorkLoadContext) context);<NEW_LINE>final OrientBaseGraph graph = graphContext.graph;<NEW_LINE>for (int i = 0; i < startingVertices.size(); ++i) {<NEW_LINE>final Iterable<OrientVertex> commandResult = graph.command(new OCommandSQL("select shortestPath(?,?, 'both')")).execute(startingVertices.get(context.currentIdx), startingVertices.get(i));<NEW_LINE>for (OrientVertex v : commandResult) {<NEW_LINE>Collection depth = v.getRecord().field("shortestPath");<NEW_LINE>if (depth != null && !depth.isEmpty()) {<NEW_LINE>totalDepth.<MASK><NEW_LINE>long max = maxDepth.get();<NEW_LINE>while (depth.size() > max) {<NEW_LINE>if (maxDepth.compareAndSet(max, depth.size()))<NEW_LINE>break;<NEW_LINE>max = maxDepth.get();<NEW_LINE>}<NEW_LINE>} else<NEW_LINE>notConnected.incrementAndGet();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>result.current.incrementAndGet();<NEW_LINE>return null;<NEW_LINE>}
addAndGet(depth.size());
799,623
public JSType buildRecordTypeFromObject(ObjectType objType) {<NEW_LINE>RecordType recType = objType.toMaybeRecordType();<NEW_LINE>// If it can be casted to a record type then return<NEW_LINE>if (recType != null) {<NEW_LINE>return recType;<NEW_LINE>}<NEW_LINE>// TODO(lpino): Handle inherited properties<NEW_LINE>Set<String> propNames = objType.getOwnPropertyNames();<NEW_LINE>// If the type has no properties then return Object<NEW_LINE>if (propNames.isEmpty()) {<NEW_LINE>return getNativeType(JSTypeNative.OBJECT_TYPE);<NEW_LINE>}<NEW_LINE>ImmutableMap.Builder<String, JSType> props = <MASK><NEW_LINE>// Otherwise collect the properties and build a record type<NEW_LINE>for (String propName : propNames) {<NEW_LINE>props.put(propName, objType.getPropertyType(propName));<NEW_LINE>}<NEW_LINE>return createRecordType(props.buildOrThrow());<NEW_LINE>}
new ImmutableMap.Builder<>();
521,769
public OptionValues parse(String[] args) {<NEW_LINE>List<String> remainingArgs = new ArrayList<>();<NEW_LINE>Set<String> errors = new HashSet<>();<NEW_LINE>for (String arg : args) {<NEW_LINE>boolean isAnalysisOption = false;<NEW_LINE>isAnalysisOption |= parseOption(CommonOptionParser.HOSTED_OPTION_PREFIX, allAnalysisOptions, analysisValues, PLUS_MINUS, errors, arg, System.out);<NEW_LINE>if (!isAnalysisOption) {<NEW_LINE>remainingArgs.add(arg);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>optionValues = new OptionValues(analysisValues);<NEW_LINE>if (!remainingArgs.isEmpty()) {<NEW_LINE>AnalysisError.interruptAnalysis(String.format("Unknown options: %s", Arrays.toString(remainingArgs.toArray(new <MASK><NEW_LINE>}<NEW_LINE>if (!errors.isEmpty()) {<NEW_LINE>StringBuilder errMsg = new StringBuilder("Option format error:\n");<NEW_LINE>for (String err : errors) {<NEW_LINE>errMsg.append(err).append("\n");<NEW_LINE>}<NEW_LINE>AnalysisError.interruptAnalysis(errMsg.toString());<NEW_LINE>}<NEW_LINE>return optionValues;<NEW_LINE>}
String[0]))));
382,188
private void gwFieldValueBooleanV(MethodWriterContext mwc, FieldWriter fieldWriter, int OBJECT, int i, boolean jsonb) {<NEW_LINE>MethodWriter mw = mwc.mw;<NEW_LINE>String classNameType = mwc.classNameType;<NEW_LINE>int FIELD_VALUE = mwc.var(boolean.class);<NEW_LINE>int WRITE_DEFAULT_VALUE = mwc.var(NOT_WRITE_DEFAULT_VALUE);<NEW_LINE>Label notDefaultValue_ = new Label(), endWriteValue_ = new Label();<NEW_LINE><MASK><NEW_LINE>mw.visitInsn(Opcodes.DUP);<NEW_LINE>mw.visitVarInsn(Opcodes.ISTORE, FIELD_VALUE);<NEW_LINE>mw.visitJumpInsn(Opcodes.IFNE, notDefaultValue_);<NEW_LINE>mw.visitVarInsn(Opcodes.ILOAD, WRITE_DEFAULT_VALUE);<NEW_LINE>mw.visitJumpInsn(Opcodes.IFEQ, notDefaultValue_);<NEW_LINE>mw.visitJumpInsn(Opcodes.GOTO, endWriteValue_);<NEW_LINE>mw.visitLabel(notDefaultValue_);<NEW_LINE>mw.visitVarInsn(Opcodes.ALOAD, THIS);<NEW_LINE>mw.visitFieldInsn(Opcodes.GETFIELD, classNameType, fieldWriter(i), DESC_FIELD_WRITER);<NEW_LINE>mw.visitVarInsn(Opcodes.ALOAD, JSON_WRITER);<NEW_LINE>mw.visitVarInsn(Opcodes.ILOAD, FIELD_VALUE);<NEW_LINE>mw.visitMethodInsn(Opcodes.INVOKEINTERFACE, TYPE_FIELD_WRITER, "writeBool", METHOD_DESC_WRITE_Z, true);<NEW_LINE>mw.visitLabel(endWriteValue_);<NEW_LINE>}
genGetObject(mwc, fieldWriter, OBJECT);
442,658
public Node create3dContent() {<NEW_LINE>Cube c = new Cube(50, Color.RED, 1);<NEW_LINE>c.rx.setAngle(45);<NEW_LINE>c.ry.setAngle(45);<NEW_LINE>Cube c2 = new Cube(<MASK><NEW_LINE>c2.setTranslateX(100);<NEW_LINE>c2.rx.setAngle(45);<NEW_LINE>c2.ry.setAngle(45);<NEW_LINE>Cube c3 = new Cube(50, Color.ORANGE, 1);<NEW_LINE>c3.setTranslateX(-100);<NEW_LINE>c3.rx.setAngle(45);<NEW_LINE>c3.ry.setAngle(45);<NEW_LINE>animation = new Timeline();<NEW_LINE>animation.getKeyFrames().addAll(new KeyFrame(Duration.ZERO, new KeyValue(c.ry.angleProperty(), 0d), new KeyValue(c2.rx.angleProperty(), 0d), new KeyValue(c3.rz.angleProperty(), 0d)), new KeyFrame(Duration.seconds(1), new KeyValue(c.ry.angleProperty(), 360d), new KeyValue(c2.rx.angleProperty(), 360d), new KeyValue(c3.rz.angleProperty(), 360d)));<NEW_LINE>animation.setCycleCount(Animation.INDEFINITE);<NEW_LINE>return new Group(c, c2, c3);<NEW_LINE>}
50, Color.GREEN, 1);
1,084,314
public boolean apply(Game game, Ability source) {<NEW_LINE>Player you = game.getPlayer(source.getControllerId());<NEW_LINE>if (you != null) {<NEW_LINE>Spell spell = game.getStack().getSpell(this.getTargetPointer().getFirst(game, source));<NEW_LINE>if (spell != null) {<NEW_LINE>ObjectColor color1 = new ObjectColor((String) game.getState().getValue(source<MASK><NEW_LINE>ObjectColor color2 = new ObjectColor((String) game.getState().getValue(source.getSourceId() + "_color2"));<NEW_LINE>int amount = 0;<NEW_LINE>if (spell.getColor(game).contains(color1)) {<NEW_LINE>++amount;<NEW_LINE>}<NEW_LINE>if (spell.getColor(game).contains(color2)) {<NEW_LINE>++amount;<NEW_LINE>}<NEW_LINE>if (amount > 0) {<NEW_LINE>you.gainLife(amount, game, source);<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>}
.getSourceId() + "_color1"));
571,035
private byte[] processRequest(byte[] request, int offset, int length) {<NEW_LINE>try {<NEW_LINE>byte[] decrypted;<NEW_LINE>{<NEW_LINE>byte[] IV = new byte[16];<NEW_LINE>System.arraycopy(request, offset, IV, 0, IV.length);<NEW_LINE>Cipher decipher = Cipher.getInstance("AES/CBC/PKCS5Padding");<NEW_LINE>decipher.init(Cipher.DECRYPT_MODE, key, new IvParameterSpec(IV));<NEW_LINE>decrypted = decipher.doFinal(request, offset + 16, length - 16);<NEW_LINE>}<NEW_LINE>byte[] reply_bytes = request_handler.<MASK><NEW_LINE>{<NEW_LINE>Cipher encipher = Cipher.getInstance("AES/CBC/PKCS5Padding");<NEW_LINE>encipher.init(Cipher.ENCRYPT_MODE, key);<NEW_LINE>AlgorithmParameters params = encipher.getParameters();<NEW_LINE>byte[] IV = params.getParameterSpec(IvParameterSpec.class).getIV();<NEW_LINE>byte[] enc = encipher.doFinal(reply_bytes);<NEW_LINE>byte[] rep_bytes = new byte[IV.length + enc.length];<NEW_LINE>System.arraycopy(IV, 0, rep_bytes, 0, IV.length);<NEW_LINE>System.arraycopy(enc, 0, rep_bytes, IV.length, enc.length);<NEW_LINE>return (rep_bytes);<NEW_LINE>}<NEW_LINE>} catch (Throwable e) {<NEW_LINE>Debug.out(e);<NEW_LINE>return (new byte[0]);<NEW_LINE>}<NEW_LINE>}
handleRequest(originator, endpoint_url, decrypted);
86,047
private void dispatchOnSameActivity(PvmExecutionImpl targetScope, PvmExecutionImpl replacedBy, Map<PvmExecutionImpl, String> activityIds, Map<PvmExecutionImpl, String> activityInstanceIds, DelayedVariableEvent delayedVariableEvent) {<NEW_LINE>// check if the target scope has the same activity id and activity instance id<NEW_LINE>// since the dispatching was started<NEW_LINE>String currentActivityInstanceId = getActivityInstanceId(targetScope);<NEW_LINE><MASK><NEW_LINE>final String lastActivityInstanceId = activityInstanceIds.get(targetScope);<NEW_LINE>final String lastActivityId = activityIds.get(targetScope);<NEW_LINE>boolean onSameAct = isOnSameActivity(lastActivityInstanceId, lastActivityId, currentActivityInstanceId, currentActivityId);<NEW_LINE>// If not we have to check the replace pointer,<NEW_LINE>// which was set if a concurrent execution was created during the dispatching.<NEW_LINE>if (targetScope != replacedBy && !onSameAct) {<NEW_LINE>currentActivityInstanceId = getActivityInstanceId(replacedBy);<NEW_LINE>currentActivityId = replacedBy.getActivityId();<NEW_LINE>onSameAct = isOnSameActivity(lastActivityInstanceId, lastActivityId, currentActivityInstanceId, currentActivityId);<NEW_LINE>}<NEW_LINE>// dispatching<NEW_LINE>if (onSameAct && isOnDispatchableState(targetScope)) {<NEW_LINE>targetScope.dispatchEvent(delayedVariableEvent.getEvent());<NEW_LINE>}<NEW_LINE>}
String currentActivityId = targetScope.getActivityId();
1,440,969
public void gotData(String k, int flags, byte[] data) {<NEW_LINE>if (isWrongKeyReturned(key, k))<NEW_LINE>return;<NEW_LINE>if (log.isDebugEnabled() && client.getPool().getEVCacheClientPoolManager().shouldLog(appName))<NEW_LINE>log.debug("Read data : key " + key + "; flags : " + flags + "; data : " + data);<NEW_LINE>if (data != null) {<NEW_LINE>if (log.isDebugEnabled() && client.getPool().getEVCacheClientPoolManager().shouldLog(appName))<NEW_LINE>log.debug("Key : " + key + "; val size : " + data.length);<NEW_LINE>getDataSizeDistributionSummary(EVCacheMetricsFactory.GET_OPERATION, EVCacheMetricsFactory.READ, EVCacheMetricsFactory.IPC_SIZE_INBOUND).record(data.length);<NEW_LINE>if (tc == null) {<NEW_LINE>if (tcService == null) {<NEW_LINE>log.error("tcService is null, will not be able to decode");<NEW_LINE>throw new RuntimeException("TranscoderSevice is null. Not able to decode");<NEW_LINE>} else {<NEW_LINE>final Transcoder<T> t = (<MASK><NEW_LINE>val = tcService.decode(t, new CachedData(flags, data, t.getMaxSize()));<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>if (tcService == null) {<NEW_LINE>log.error("tcService is null, will not be able to decode");<NEW_LINE>throw new RuntimeException("TranscoderSevice is null. Not able to decode");<NEW_LINE>} else {<NEW_LINE>val = tcService.decode(tc, new CachedData(flags, data, tc.getMaxSize()));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>if (log.isDebugEnabled() && client.getPool().getEVCacheClientPoolManager().shouldLog(appName))<NEW_LINE>log.debug("Key : " + key + "; val is null");<NEW_LINE>}<NEW_LINE>}
Transcoder<T>) getTranscoder();
342,161
private void validateType(TypeElement type) {<NEW_LINE>ElementKind kind = type.getKind();<NEW_LINE>boolean kindOk = kind.equals(ElementKind.CLASS) || (appliesToInterfaces && kind.equals(ElementKind.INTERFACE));<NEW_LINE>if (!kindOk) {<NEW_LINE><MASK><NEW_LINE>errorReporter.abortWithError(type, "[%sWrongType] @%s only applies to %s", simpleAnnotationName, simpleAnnotationName, appliesTo);<NEW_LINE>}<NEW_LINE>checkModifiersIfNested(type);<NEW_LINE>if (!hasVisibleNoArgConstructor(type)) {<NEW_LINE>errorReporter.reportError(type, "[%sConstructor] @%s class must have a non-private no-arg constructor", simpleAnnotationName, simpleAnnotationName);<NEW_LINE>}<NEW_LINE>if (type.getModifiers().contains(Modifier.FINAL)) {<NEW_LINE>errorReporter.abortWithError(type, "[%sFinal] @%s class must not be final", simpleAnnotationName, simpleAnnotationName);<NEW_LINE>}<NEW_LINE>}
String appliesTo = appliesToInterfaces ? "classes and interfaces" : "classes";
955,888
public void keyTyped(KeyEvent evt) {<NEW_LINE><MASK><NEW_LINE>if (isCharForSearch(evt)) {<NEW_LINE>if (paths == null) {<NEW_LINE>paths = getVisiblePaths();<NEW_LINE>}<NEW_LINE>searchBuf.append(keyChar);<NEW_LINE>resetBufferTimer.restart();<NEW_LINE>TreePath activePath = tree.getSelectionPath();<NEW_LINE>for (int i = 0; i < 2; ++i) {<NEW_LINE>String searchedText = searchBuf.toString().toLowerCase();<NEW_LINE>String curFileName = null;<NEW_LINE>if (i == 0 && activePath != null && (curFileName = fileChooser.getName(((DirectoryNode) activePath.getLastPathComponent()).getFile())) != null && curFileName.toLowerCase().startsWith(searchedText)) {<NEW_LINE>// keep selection<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>for (TreePath path : paths) {<NEW_LINE>curFileName = fileChooser.getName(((DirectoryNode) path.getLastPathComponent()).getFile());<NEW_LINE>if (curFileName != null && curFileName.toLowerCase().startsWith(searchedText)) {<NEW_LINE>tree.makeVisible(path);<NEW_LINE>tree.scrollPathToVisible(path);<NEW_LINE>tree.setSelectionPath(path);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>searchBuf.delete(0, searchBuf.length() - 1);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>resetBuffer();<NEW_LINE>}<NEW_LINE>}
char keyChar = evt.getKeyChar();
591,281
private Map<String, float[]> deprecatedGetFeatureMap() {<NEW_LINE>status = Common.<MASK><NEW_LINE>if (status == FLClientStatus.FAILED) {<NEW_LINE>retCode = ResponseCode.RequestError;<NEW_LINE>throw new IllegalArgumentException();<NEW_LINE>}<NEW_LINE>Map<String, float[]> map = new HashMap<String, float[]>();<NEW_LINE>if (flParameter.getFlName().equals(ALBERT)) {<NEW_LINE>LOGGER.info(Common.addTag("[updateModel] serialize feature map for " + flParameter.getFlName()));<NEW_LINE>AlTrainBert alTrainBert = AlTrainBert.getInstance();<NEW_LINE>map = SessionUtil.convertTensorToFeatures(SessionUtil.getFeatures(alTrainBert.getTrainSession()));<NEW_LINE>if (map.isEmpty()) {<NEW_LINE>LOGGER.severe(Common.addTag("[updateModel] the return map is empty in <SessionUtil" + ".convertTensorToFeatures>"));<NEW_LINE>status = FLClientStatus.FAILED;<NEW_LINE>throw new IllegalArgumentException();<NEW_LINE>}<NEW_LINE>} else if (flParameter.getFlName().equals(LENET)) {<NEW_LINE>LOGGER.info(Common.addTag("[updateModel] serialize feature map for " + flParameter.getFlName()));<NEW_LINE>TrainLenet trainLenet = TrainLenet.getInstance();<NEW_LINE>map = SessionUtil.convertTensorToFeatures(SessionUtil.getFeatures(trainLenet.getTrainSession()));<NEW_LINE>if (map.isEmpty()) {<NEW_LINE>LOGGER.severe(Common.addTag("[updateModel] the return map is empty in <SessionUtil" + ".convertTensorToFeatures>"));<NEW_LINE>status = FLClientStatus.FAILED;<NEW_LINE>throw new IllegalArgumentException();<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>LOGGER.severe(Common.addTag("[updateModel] the flName is not valid"));<NEW_LINE>status = FLClientStatus.FAILED;<NEW_LINE>throw new IllegalArgumentException();<NEW_LINE>}<NEW_LINE>Common.freeSession();<NEW_LINE>return map;<NEW_LINE>}
initSession(flParameter.getTrainModelPath());
150,685
void onMouseMoveDragging(Point dragStart, int diffX, int diffY, GridElement draggedGridElement, boolean isShiftKeyDown, boolean isCtrlKeyDown, boolean firstDrag, boolean isMiddleMouseButton) {<NEW_LINE>if (diffX != 0 || diffY != 0) {<NEW_LINE>cursorWasMovedDuringDrag = true;<NEW_LINE>}<NEW_LINE>if (firstDrag && draggedGridElement != null && !isMiddleMouseButton) {<NEW_LINE>// if draggedGridElement == null the whole diagram is dragged and nothing has to be checked for sticking<NEW_LINE>stickablesToMove.put(draggedGridElement, getStickablesToMoveWhenElementsMove(draggedGridElement, Collections.<GridElement>emptyList()));<NEW_LINE>}<NEW_LINE>if (isCtrlKeyDown && !selector.isLassoActive() && !isMiddleMouseButton) {<NEW_LINE>selector.startSelection(dragStart);<NEW_LINE>}<NEW_LINE>if (selector.isLassoActive()) {<NEW_LINE>selector.updateLasso(diffX, diffY);<NEW_LINE>} else if (isMiddleMouseButton) {<NEW_LINE>moveElements(diffX, diffY, firstDrag<MASK><NEW_LINE>} else if (!resizeDirections.isEmpty()) {<NEW_LINE>draggedGridElement.drag(resizeDirections, diffX, diffY, getRelativePoint(dragStart, draggedGridElement), isShiftKeyDown, firstDrag, stickablesToMove.get(draggedGridElement), false);<NEW_LINE>} else // if a single element is selected, drag it (and pass the dragStart, because it's important for Relations)<NEW_LINE>if (selector.getSelectedElements().size() == 1) {<NEW_LINE>draggedGridElement.drag(Collections.<Direction>emptySet(), diffX, diffY, getRelativePoint(dragStart, draggedGridElement), isShiftKeyDown, firstDrag, stickablesToMove.get(draggedGridElement), false);<NEW_LINE>} else if (!selector.isLassoActive()) {<NEW_LINE>// if != 1 elements are selected, move them<NEW_LINE>moveElements(diffX, diffY, firstDrag, selector.getSelectedElements());<NEW_LINE>}<NEW_LINE>redraw(false);<NEW_LINE>}
, new ArrayList<>());
116,969
private void verifyParamsForKubernetesUpgrade(Universe universe) {<NEW_LINE>if (rootCA == null) {<NEW_LINE>throw new PlatformServiceException(Status.BAD_REQUEST, "rootCA is null. Cannot perform any upgrade.");<NEW_LINE>}<NEW_LINE>if (clientRootCA != null) {<NEW_LINE>throw new PlatformServiceException(Status.BAD_REQUEST, "clientRootCA not applicable for Kubernetes certificate rotation.");<NEW_LINE>}<NEW_LINE>if (rootAndClientRootCASame != null && !rootAndClientRootCASame) {<NEW_LINE>throw new PlatformServiceException(Status.BAD_REQUEST, "rootAndClientRootCASame cannot be false for Kubernetes universes.");<NEW_LINE>}<NEW_LINE>if (upgradeOption != UpgradeOption.ROLLING_UPGRADE) {<NEW_LINE>throw new PlatformServiceException(Status.BAD_REQUEST, "Certificate rotation for kubernetes universes cannot be Non-Rolling or Non-Restart.");<NEW_LINE>}<NEW_LINE>UserIntent userIntent = universe.getUniverseDetails().getPrimaryCluster().userIntent;<NEW_LINE>UUID currentRootCA <MASK><NEW_LINE>if (!(userIntent.enableNodeToNodeEncrypt || userIntent.enableClientToNodeEncrypt)) {<NEW_LINE>throw new PlatformServiceException(Status.BAD_REQUEST, "Encryption-in-Transit is disabled for this universe. " + "Cannot perform certificate rotation.");<NEW_LINE>}<NEW_LINE>if (currentRootCA.equals(rootCA)) {<NEW_LINE>throw new PlatformServiceException(Status.BAD_REQUEST, "Universe is already assigned to the provided rootCA: " + rootCA);<NEW_LINE>}<NEW_LINE>CertificateInfo rootCert = CertificateInfo.get(rootCA);<NEW_LINE>if (rootCert == null) {<NEW_LINE>throw new PlatformServiceException(Status.BAD_REQUEST, "Certificate not present: " + rootCA);<NEW_LINE>}<NEW_LINE>if (!(rootCert.certType == CertConfigType.SelfSigned || rootCert.certType == CertConfigType.HashicorpVault)) {<NEW_LINE>throw new PlatformServiceException(Status.BAD_REQUEST, "Kubernetes universes supports only SelfSigned or HashicorpVault certificates.");<NEW_LINE>}<NEW_LINE>}
= universe.getUniverseDetails().rootCA;
1,814,634
public synchronized void doOverrideIfNecessary() {<NEW_LINE>final Invoker<?> invoker;<NEW_LINE>if (originInvoker instanceof InvokerDelegate) {<NEW_LINE>invoker = ((InvokerDelegate<?>) originInvoker).getInvoker();<NEW_LINE>} else {<NEW_LINE>invoker = originInvoker;<NEW_LINE>}<NEW_LINE>// The origin invoker<NEW_LINE>URL originUrl = RegistryProtocol.this.getProviderUrl(invoker);<NEW_LINE>String key = getCacheKey(originInvoker);<NEW_LINE>ExporterChangeableWrapper<?> exporter = bounds.get(key);<NEW_LINE>if (exporter == null) {<NEW_LINE>logger.warn(new IllegalStateException("error state, exporter should not be null"));<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// The current, may have been merged many times<NEW_LINE>Invoker<?> exporterInvoker = exporter.getInvoker();<NEW_LINE>URL currentUrl = exporterInvoker == null ? null : exporterInvoker.getUrl();<NEW_LINE>// Merged with this configuration<NEW_LINE>URL newUrl = getConfiguredInvokerUrl(configurators, originUrl);<NEW_LINE>newUrl = getConfiguredInvokerUrl(getProviderConfigurationListener(originUrl).getConfigurators(), newUrl);<NEW_LINE>newUrl = getConfiguredInvokerUrl(serviceConfigurationListeners.get(originUrl.getServiceKey()<MASK><NEW_LINE>if (!newUrl.equals(currentUrl)) {<NEW_LINE>if (newUrl.getParameter(Constants.NEED_REEXPORT, true)) {<NEW_LINE>RegistryProtocol.this.reExport(originInvoker, newUrl);<NEW_LINE>}<NEW_LINE>logger.info("exported provider url changed, origin url: " + originUrl + ", old export url: " + currentUrl + ", new export url: " + newUrl);<NEW_LINE>}<NEW_LINE>}
).getConfigurators(), newUrl);
1,373,675
public void start(@Nonnull TemplateImpl template, @Nullable final PairProcessor<String, String> processor, @Nullable Map<String, String> predefinedVarValues) {<NEW_LINE>LOG.assertTrue(!myStarted, "Already started");<NEW_LINE>myStarted = true;<NEW_LINE>final PsiFile file = getPsiFile();<NEW_LINE>myTemplate = template;<NEW_LINE>myProcessor = processor;<NEW_LINE>DocumentReference[] refs = myDocument != null ? new DocumentReference[] { DocumentReferenceManager.getInstance().create(myDocument) } : null;<NEW_LINE>UndoManager.getInstance(myProject).undoableActionPerformed(new BasicUndoableAction(refs) {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void undo() {<NEW_LINE>if (myDocument != null) {<NEW_LINE>fireTemplateCancelled();<NEW_LINE>LookupManager.<MASK><NEW_LINE>int oldVar = myCurrentVariableNumber;<NEW_LINE>setCurrentVariableNumber(-1);<NEW_LINE>currentVariableChanged(oldVar);<NEW_LINE>}<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void redo() {<NEW_LINE>// TODO:<NEW_LINE>// throw new UnexpectedUndoException("Not implemented");<NEW_LINE>}<NEW_LINE>});<NEW_LINE>myTemplateIndented = false;<NEW_LINE>myCurrentVariableNumber = -1;<NEW_LINE>mySegments = new TemplateSegments(myEditor);<NEW_LINE>myPrevTemplate = myTemplate;<NEW_LINE>// myArgument = argument;<NEW_LINE>myPredefinedVariableValues = predefinedVarValues;<NEW_LINE>if (myTemplate.isInline()) {<NEW_LINE>int caretOffset = myEditor.getCaretModel().getOffset();<NEW_LINE>myTemplateRange = myDocument.createRangeMarker(caretOffset, caretOffset + myTemplate.getTemplateText().length());<NEW_LINE>} else {<NEW_LINE>preprocessTemplate(file, myEditor.getCaretModel().getOffset(), myTemplate.getTemplateText());<NEW_LINE>int caretOffset = myEditor.getCaretModel().getOffset();<NEW_LINE>myTemplateRange = myDocument.createRangeMarker(caretOffset, caretOffset);<NEW_LINE>}<NEW_LINE>myTemplateRange.setGreedyToLeft(true);<NEW_LINE>myTemplateRange.setGreedyToRight(true);<NEW_LINE>processAllExpressions(myTemplate);<NEW_LINE>}
getInstance(myProject).hideActiveLookup();
224,599
public AudioInputStream synthesizeUsingImposedF0(int sourceIndex, int targetIndex, AudioFileFormat aft) throws SynthesisException {<NEW_LINE>if (!f0ContourImposeSupport) {<NEW_LINE>throw new SynthesisException("Mary configuration of this voice doesn't support intonation contour imposition");<NEW_LINE>}<NEW_LINE>int numberOfUnits = vHNMFeaturesReader.getNumberOfUnits();<NEW_LINE>if (sourceIndex >= numberOfUnits || targetIndex >= numberOfUnits) {<NEW_LINE>throw new IllegalArgumentException("sourceIndex(" + sourceIndex + ") and targetIndex(" + targetIndex + ") are should be less than number of available units (" + numberOfUnits + ")");<NEW_LINE>}<NEW_LINE>double[] sourceF0 = this.vIntonationReader.getContour(sourceIndex);<NEW_LINE>double[] targetF0coeffs = <MASK><NEW_LINE>double[] sourceF0coeffs = this.vIntonationReader.getIntonationCoeffs(sourceIndex);<NEW_LINE>if (targetF0coeffs == null || sourceF0coeffs == null) {<NEW_LINE>return reSynthesize(sourceIndex, aft);<NEW_LINE>}<NEW_LINE>if (targetF0coeffs.length == 0 || sourceF0coeffs.length == 0) {<NEW_LINE>return reSynthesize(sourceIndex, aft);<NEW_LINE>}<NEW_LINE>double[] targetF0 = Polynomial.generatePolynomialValues(targetF0coeffs, sourceF0.length, 0, 1);<NEW_LINE>sourceF0 = Polynomial.generatePolynomialValues(sourceF0coeffs, sourceF0.length, 0, 1);<NEW_LINE>assert targetF0.length == sourceF0.length;<NEW_LINE>float[] tScalesArray = { 1.0f };<NEW_LINE>float[] tScalesTimes = { 1.0f };<NEW_LINE>float[] pScalesArray = new float[targetF0.length];<NEW_LINE>float[] pScalesTimes = new float[targetF0.length];<NEW_LINE>double skipSizeInSeconds = this.vIntonationReader.getSkipSizeInSeconds();<NEW_LINE>double windowSizeInSeconds = this.vIntonationReader.getWindowSizeInSeconds();<NEW_LINE>for (int i = 0; i < targetF0.length; i++) {<NEW_LINE>pScalesArray[i] = (float) (targetF0[i] / sourceF0[i]);<NEW_LINE>pScalesTimes[i] = (float) (i * skipSizeInSeconds + 0.5 * windowSizeInSeconds);<NEW_LINE>}<NEW_LINE>return synthesizeUsingF0Modification(sourceIndex, pScalesArray, pScalesTimes, tScalesArray, tScalesTimes, aft);<NEW_LINE>}
this.vIntonationReader.getIntonationCoeffs(targetIndex);
833,581
public RuntimeConfigurationProducer createProducer(final Location location, final ConfigurationContext context) {<NEW_LINE>final RuntimeConfigurationProducer result = clone();<NEW_LINE>result.myConfiguration = location != null ? result.createConfigurationByElement(location, context) : null;<NEW_LINE>if (result.myConfiguration != null) {<NEW_LINE>final PsiElement psiElement = result.getSourceElement();<NEW_LINE>final Location<PsiElement> _location = PsiLocation.fromPsiElement(psiElement, location != null ? location.getModule() : null);<NEW_LINE>if (_location != null) {<NEW_LINE>// replace with existing configuration if any<NEW_LINE>final RunManager runManager = RunManager.getInstance(context.getProject());<NEW_LINE>final ConfigurationType type = result.myConfiguration.getType();<NEW_LINE>final List<RunnerAndConfigurationSettings> configurations = runManager.getConfigurationSettingsList(type);<NEW_LINE>final RunnerAndConfigurationSettings configuration = result.findExistingByElement(_location, configurations, context);<NEW_LINE>if (configuration != null) {<NEW_LINE>result.myConfiguration = configuration;<NEW_LINE>} else {<NEW_LINE>final ArrayList<String> currentNames = new ArrayList<>();<NEW_LINE>for (RunnerAndConfigurationSettings configurationSettings : configurations) {<NEW_LINE>currentNames.add(configurationSettings.getName());<NEW_LINE>}<NEW_LINE>result.myConfiguration.setName(RunManager.suggestUniqueName(result.myConfiguration<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>}
.getName(), currentNames));
1,659,611
public void updateTaskStatus(CommandEntity command) {<NEW_LINE>Integer taskId = command.getTaskId();<NEW_LINE>StreamSourceEntity current = sourceMapper.selectByIdForUpdate(taskId);<NEW_LINE>if (current == null) {<NEW_LINE>LOGGER.warn("stream source not found by id={}, just return", taskId);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (!Objects.equals(command.getVersion(), current.getVersion())) {<NEW_LINE>LOGGER.warn("task result version [{}] not equals to current [{}] for id [{}], skip update", command.getVersion(), current.getVersion(), taskId);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>int result = command.getCommandResult();<NEW_LINE><MASK><NEW_LINE>int nextStatus = SourceState.SOURCE_NORMAL.getCode();<NEW_LINE>if (Constants.RESULT_FAIL == result) {<NEW_LINE>logFailedStreamSource(current);<NEW_LINE>nextStatus = SourceState.SOURCE_FAILED.getCode();<NEW_LINE>} else if (previousStatus / MODULUS_100 == ISSUED_STATUS) {<NEW_LINE>// Change the status from 30x to normal / disable / frozen<NEW_LINE>if (SourceState.TEMP_TO_NORMAL.contains(previousStatus)) {<NEW_LINE>nextStatus = SourceState.SOURCE_NORMAL.getCode();<NEW_LINE>} else if (SourceState.BEEN_ISSUED_DELETE.getCode() == previousStatus) {<NEW_LINE>nextStatus = SourceState.SOURCE_DISABLE.getCode();<NEW_LINE>} else if (SourceState.BEEN_ISSUED_FROZEN.getCode() == previousStatus) {<NEW_LINE>nextStatus = SourceState.SOURCE_FROZEN.getCode();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (nextStatus != previousStatus) {<NEW_LINE>sourceMapper.updateStatus(taskId, nextStatus, false);<NEW_LINE>LOGGER.info("task result=[{}], update source status to [{}] for id [{}]", result, nextStatus, taskId);<NEW_LINE>}<NEW_LINE>}
int previousStatus = current.getStatus();
194,743
private synchronized void unstageFiles(final Collection<ChangedFile> files) {<NEW_LINE>// TODO Add a listener to the repo on creation and have toggleStageStatus get invoked with diff!<NEW_LINE>// Temporarily disable the tables<NEW_LINE>stagedTable.setEnabled(false);<NEW_LINE>unstagedTable.setEnabled(false);<NEW_LINE>// make a copy so we can erase from original table correctly since their flags get changed by operation<NEW_LINE>final List<ChangedFile> copy = <MASK><NEW_LINE>Collections.copy(copy, new ArrayList<ChangedFile>(files));<NEW_LINE>IStatus status = gitRepository.index().unstageFiles(files);<NEW_LINE>if (status.isOK()) {<NEW_LINE>getParentShell().getDisplay().asyncExec(new Runnable() {<NEW_LINE><NEW_LINE>public void run() {<NEW_LINE>toggleStageStatus(copy, false);<NEW_LINE>stagedTable.setEnabled(true);<NEW_LINE>unstagedTable.setEnabled(true);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} else {<NEW_LINE>stagedTable.setEnabled(true);<NEW_LINE>unstagedTable.setEnabled(true);<NEW_LINE>}<NEW_LINE>}
new ArrayList<ChangedFile>(files);
1,641,135
private ArrayList<PointOfInterest> withinSphereChunkSectionSorted(Predicate<PointOfInterestType> predicate, BlockPos origin, int radius, PointOfInterestStorage.OccupationStatus status) {<NEW_LINE>double radiusSq = radius * radius;<NEW_LINE>int minChunkX = origin.getX(<MASK><NEW_LINE>int minChunkZ = origin.getZ() - radius - 1 >> 4;<NEW_LINE>int maxChunkX = origin.getX() + radius + 1 >> 4;<NEW_LINE>int maxChunkZ = origin.getZ() + radius + 1 >> 4;<NEW_LINE>// noinspection unchecked<NEW_LINE>RegionBasedStorageSectionExtended<PointOfInterestSet> storage = (RegionBasedStorageSectionExtended<PointOfInterestSet>) this;<NEW_LINE>ArrayList<PointOfInterest> points = new ArrayList<>();<NEW_LINE>Consumer<PointOfInterest> collector = point -> {<NEW_LINE>if (Distances.isWithinCircleRadius(origin, radiusSq, point.getPos())) {<NEW_LINE>points.add(point);<NEW_LINE>}<NEW_LINE>};<NEW_LINE>for (int x = minChunkX; x <= maxChunkX; x++) {<NEW_LINE>for (int z = minChunkZ; z <= maxChunkZ; z++) {<NEW_LINE>for (PointOfInterestSet set : storage.getInChunkColumn(x, z)) {<NEW_LINE>((PointOfInterestSetExtended) set).collectMatchingPoints(predicate, status, collector);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return points;<NEW_LINE>}
) - radius - 1 >> 4;
1,450,135
private void initializeTable() {<NEW_LINE>this.table = dynamoDB.getTable(this.tableName);<NEW_LINE>if (table == null) {<NEW_LINE>throw new RuntimeException("Couldn't create a state repository using the table name provided");<NEW_LINE>} else {<NEW_LINE>try {<NEW_LINE><MASK><NEW_LINE>log.info("Creating DynamoDBStateRepository with table named: {}", table.getTableName());<NEW_LINE>log.info("Table description: {}", tableDescription.toString());<NEW_LINE>} catch (ResourceNotFoundException e) {<NEW_LINE>if (tableName.equals(DEFAULT_TABLE_NAME)) {<NEW_LINE>log.error("The table with the default name '{}' could not be found. You must either create this table, or provide the name of an existing table to the builder to use as the state repository", DEFAULT_TABLE_NAME);<NEW_LINE>} else {<NEW_LINE>log.error("The table named '{}' can not be found. Please verify that the table is created in the region you are trying to run before using it to store the togglz state", tableName);<NEW_LINE>}<NEW_LINE>throw new RuntimeException("The table specified couldn't be found", e);<NEW_LINE>} catch (Exception e) {<NEW_LINE>log.error("Couldn't describe the table for an unknown reason. Please verify the table exists and you are able to access it", e);<NEW_LINE>throw new RuntimeException("Couldn't create a state repository using the supplied table", e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
TableDescription tableDescription = table.describe();
845,397
public void hook(ExtensionHook extensionHook) {<NEW_LINE>super.hook(extensionHook);<NEW_LINE>extensionHook.addOptionsParamSet(getOptionsParam());<NEW_LINE>extensionHook.addProxyListener(getProxyListenerBreak());<NEW_LINE>extensionHook.addSessionListener(this);<NEW_LINE>extensionHook.addOptionsChangedListener(this);<NEW_LINE>extensionHook.addApiImplementor(api);<NEW_LINE>if (getView() != null) {<NEW_LINE>breakPanel = new BreakPanel(this, getOptionsParam());<NEW_LINE>breakPanel.setName(Constant.messages.getString("tab.break"));<NEW_LINE>breakpointMessageHandler = new BreakpointMessageHandler2(breakPanel);<NEW_LINE>breakpointMessageHandler.setEnabledBreakpoints(<MASK><NEW_LINE>breakpointMessageHandler.setEnabledIgnoreRules(breakPanel.getIgnoreRulesEnableList());<NEW_LINE>breakpointManagementInterface = breakPanel;<NEW_LINE>ExtensionHookView pv = extensionHook.getHookView();<NEW_LINE>pv.addWorkPanel(breakPanel);<NEW_LINE>pv.addOptionPanel(getOptionsPanel());<NEW_LINE>extensionHook.getHookView().addStatusPanel(getBreakpointsPanel());<NEW_LINE>extensionHook.getHookMenu().addPopupMenuItem(getPopupMenuEdit());<NEW_LINE>extensionHook.getHookMenu().addPopupMenuItem(getPopupMenuDelete());<NEW_LINE>mapBreakpointUiManager = new HashMap<>();<NEW_LINE>mapMessageUiManager = new HashMap<>();<NEW_LINE>httpBreakpoints = new HttpBreakpointsUiManagerInterface(extensionHook.getHookMenu(), this);<NEW_LINE>addBreakpointsUiManager(httpBreakpoints);<NEW_LINE>extensionHook.getHookMenu().addToolsMenuItem(getMenuToggleBreakOnRequests());<NEW_LINE>extensionHook.getHookMenu().addToolsMenuItem(getMenuToggleBreakOnResponses());<NEW_LINE>extensionHook.getHookMenu().addToolsMenuItem(getMenuStep());<NEW_LINE>extensionHook.getHookMenu().addToolsMenuItem(getMenuContinue());<NEW_LINE>extensionHook.getHookMenu().addToolsMenuItem(getMenuDrop());<NEW_LINE>extensionHook.getHookMenu().addToolsMenuItem(getMenuAddHttpBreakpoint());<NEW_LINE>ExtensionHelp.enableHelpKey(breakPanel, "ui.tabs.break");<NEW_LINE>ExtensionHelp.enableHelpKey(getBreakpointsPanel(), "ui.tabs.breakpoints");<NEW_LINE>} else {<NEW_LINE>this.breakpointManagementInterface = new HttpBreakpointManagementDaemonImpl();<NEW_LINE>breakpointMessageHandler = new BreakpointMessageHandler2(breakpointManagementInterface);<NEW_LINE>breakpointMessageHandler.setEnabledBreakpoints(new ArrayList<>());<NEW_LINE>breakpointMessageHandler.setEnabledIgnoreRules(new ArrayList<>());<NEW_LINE>}<NEW_LINE>}
getBreakpointsModel().getBreakpointsEnabledList());
311,350
void addParallelWithSequence(LayoutInterval interval, LayoutInterval seq, int startIndex, int endIndex, int dimension) {<NEW_LINE>LayoutInterval group;<NEW_LINE>if (startIndex > 0 || endIndex < seq.getSubIntervalCount() - 1) {<NEW_LINE>group = new LayoutInterval(PARALLEL);<NEW_LINE>if (interval.getAlignment() != DEFAULT) {<NEW_LINE>group.setGroupAlignment(interval.getAlignment());<NEW_LINE>}<NEW_LINE>int startPos = LayoutUtils.getVisualPosition(seq.getSubInterval(startIndex), dimension, LEADING);<NEW_LINE>int endPos = LayoutUtils.getVisualPosition(seq.getSubInterval<MASK><NEW_LINE>group.getCurrentSpace().set(dimension, startPos, endPos);<NEW_LINE>if (startIndex != endIndex) {<NEW_LINE>LayoutInterval subSeq = new LayoutInterval(SEQUENTIAL);<NEW_LINE>// [was: seq.getAlignment()]<NEW_LINE>subSeq.setAlignment(interval.getAlignment());<NEW_LINE>for (int n = endIndex - startIndex + 1; n > 0; n--) {<NEW_LINE>layoutModel.addInterval(layoutModel.removeInterval(seq, startIndex), subSeq, -1);<NEW_LINE>}<NEW_LINE>layoutModel.addInterval(subSeq, group, 0);<NEW_LINE>} else {<NEW_LINE>layoutModel.addInterval(layoutModel.removeInterval(seq, startIndex), group, 0);<NEW_LINE>}<NEW_LINE>layoutModel.addInterval(group, seq, startIndex);<NEW_LINE>group.getCurrentSpace().expand(interval.getCurrentSpace(), dimension);<NEW_LINE>} else {<NEW_LINE>group = seq.getParent();<NEW_LINE>}<NEW_LINE>layoutModel.addInterval(interval, group, -1);<NEW_LINE>}
(endIndex), dimension, TRAILING);
365,337
protected Coordinate[] convertLocations(List<List<Double>> locations, int numberOfRoutes) throws ParameterValueException, ServerLimitExceededException {<NEW_LINE>if (locations == null || locations.size() < 2)<NEW_LINE>throw new ParameterValueException(MatrixErrorCodes.INVALID_PARAMETER_VALUE, MatrixRequest.PARAM_LOCATIONS);<NEW_LINE>int maximumNumberOfRoutes = MatrixServiceSettings.getMaximumRoutes(false);<NEW_LINE>if (numberOfRoutes > maximumNumberOfRoutes)<NEW_LINE>throw new ServerLimitExceededException(MatrixErrorCodes.PARAMETER_VALUE_EXCEEDS_MAXIMUM, "Only a total of " + maximumNumberOfRoutes + " routes are allowed.");<NEW_LINE>ArrayList<Coordinate> locationCoordinates = new ArrayList<>();<NEW_LINE>for (List<Double> coordinate : locations) {<NEW_LINE>locationCoordinates.add(convertSingleLocationCoordinate(coordinate));<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>return locationCoordinates.toArray(new Coordinate<MASK><NEW_LINE>} catch (NumberFormatException | ArrayStoreException | NullPointerException ex) {<NEW_LINE>throw new ParameterValueException(MatrixErrorCodes.INVALID_PARAMETER_VALUE, MatrixRequest.PARAM_LOCATIONS);<NEW_LINE>}<NEW_LINE>}
[locations.size()]);
1,090,997
public static DescribePodLogResponse unmarshall(DescribePodLogResponse describePodLogResponse, UnmarshallerContext _ctx) {<NEW_LINE>describePodLogResponse.setRequestId(_ctx.stringValue("DescribePodLogResponse.RequestId"));<NEW_LINE>describePodLogResponse.setCode(_ctx.integerValue("DescribePodLogResponse.Code"));<NEW_LINE>describePodLogResponse.setErrMsg(_ctx.stringValue("DescribePodLogResponse.ErrMsg"));<NEW_LINE>describePodLogResponse.setSuccess(_ctx.booleanValue("DescribePodLogResponse.Success"));<NEW_LINE>Result result = new Result();<NEW_LINE>result.setDeployOrderName<MASK><NEW_LINE>result.setEnvTypeName(_ctx.stringValue("DescribePodLogResponse.Result.EnvTypeName"));<NEW_LINE>List<DeployLogStepRC> deployStepList = new ArrayList<DeployLogStepRC>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("DescribePodLogResponse.Result.DeployStepList.Length"); i++) {<NEW_LINE>DeployLogStepRC deployLogStepRC = new DeployLogStepRC();<NEW_LINE>deployLogStepRC.setStatus(_ctx.stringValue("DescribePodLogResponse.Result.DeployStepList[" + i + "].Status"));<NEW_LINE>deployLogStepRC.setStepName(_ctx.stringValue("DescribePodLogResponse.Result.DeployStepList[" + i + "].StepName"));<NEW_LINE>deployLogStepRC.setStepCode(_ctx.stringValue("DescribePodLogResponse.Result.DeployStepList[" + i + "].StepCode"));<NEW_LINE>deployLogStepRC.setStepLog(_ctx.stringValue("DescribePodLogResponse.Result.DeployStepList[" + i + "].StepLog"));<NEW_LINE>deployStepList.add(deployLogStepRC);<NEW_LINE>}<NEW_LINE>result.setDeployStepList(deployStepList);<NEW_LINE>describePodLogResponse.setResult(result);<NEW_LINE>return describePodLogResponse;<NEW_LINE>}
(_ctx.stringValue("DescribePodLogResponse.Result.DeployOrderName"));
1,181,451
private IndexConstraintRelationshipInfo relationshipInfoFromIndexDescription(IndexDescriptor indexDescriptor, TokenNameLookup tokens, SchemaRead schemaRead) {<NEW_LINE>int[] relIds = indexDescriptor.schema().getEntityTokenIds();<NEW_LINE>int length = relIds.length;<NEW_LINE>// to handle LOOKUP indexes<NEW_LINE>final Object relName;<NEW_LINE>if (length == 0) {<NEW_LINE>relName = TOKEN_REL_TYPE;<NEW_LINE>} else {<NEW_LINE>final List<String> labels = IntStream.of(relIds).mapToObj(tokens::relationshipTypeGetName).sorted().collect(Collectors.toList());<NEW_LINE>relName = labels.size() > 1 ? labels : labels.get(0);<NEW_LINE>}<NEW_LINE>final List<String> properties = Arrays.stream(indexDescriptor.schema().getPropertyIds()).mapToObj(tokens::propertyKeyGetName).collect(Collectors.toList());<NEW_LINE>try {<NEW_LINE>return new IndexConstraintRelationshipInfo(getSchemaInfoName(relName, properties), relName, properties, schemaRead.indexGetState(indexDescriptor).toString());<NEW_LINE>} catch (IndexNotFoundKernelException e) {<NEW_LINE>return new // Pretty print for index name<NEW_LINE>IndexConstraintRelationshipInfo(getSchemaInfoName(relName, properties<MASK><NEW_LINE>}<NEW_LINE>}
), relName, properties, "NOT_FOUND");
1,680,254
private static String stackTraceStr(String prefix, StackTraceElement[] st, int strip, int numFrames, boolean printWarning) {<NEW_LINE>strip = strip > 0 ? strip + THRD_DUMP_FRAMES : 0;<NEW_LINE>numFrames = numFrames > 0 ? numFrames : st.length - strip;<NEW_LINE>int limit = strip + numFrames;<NEW_LINE>limit = Math.min(limit, st.length);<NEW_LINE>if (prefix == null) {<NEW_LINE>prefix = "";<NEW_LINE>}<NEW_LINE>StringBuilder buf = new StringBuilder();<NEW_LINE>for (int i = strip; i < limit; i++) {<NEW_LINE>buf.append(prefix);<NEW_LINE>buf<MASK><NEW_LINE>buf.append(LINE_SEPARATOR);<NEW_LINE>}<NEW_LINE>if (printWarning && limit < st.length) {<NEW_LINE>buf.append(prefix);<NEW_LINE>buf.append(st.length - limit);<NEW_LINE>buf.append(" more frame(s) ...");<NEW_LINE>buf.append(LINE_SEPARATOR);<NEW_LINE>}<NEW_LINE>return buf.toString();<NEW_LINE>}
.append(st[i]);
1,527,430
Collection<InferenceVariable> inputVariables(final InferenceContext18 context) {<NEW_LINE>// from 18.5.2.<NEW_LINE>if (this.left instanceof LambdaExpression) {<NEW_LINE>if (this.right instanceof InferenceVariable) {<NEW_LINE>return Collections.singletonList((InferenceVariable) this.right);<NEW_LINE>}<NEW_LINE>if (this.right.isFunctionalInterface(context.scope)) {<NEW_LINE>LambdaExpression <MASK><NEW_LINE>ReferenceBinding targetType = (ReferenceBinding) this.right;<NEW_LINE>ParameterizedTypeBinding withWildCards = InferenceContext18.parameterizedWithWildcard(targetType);<NEW_LINE>if (withWildCards != null) {<NEW_LINE>targetType = ConstraintExpressionFormula.findGroundTargetType(context, lambda.enclosingScope, lambda, withWildCards);<NEW_LINE>}<NEW_LINE>if (targetType == null) {<NEW_LINE>return EMPTY_VARIABLE_LIST;<NEW_LINE>}<NEW_LINE>MethodBinding sam = targetType.getSingleAbstractMethod(context.scope, true);<NEW_LINE>final Set<InferenceVariable> variables = new HashSet<>();<NEW_LINE>if (lambda.argumentsTypeElided()) {<NEW_LINE>// i)<NEW_LINE>int len = sam.parameters.length;<NEW_LINE>for (int i = 0; i < len; i++) {<NEW_LINE>sam.parameters[i].collectInferenceVariables(variables);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (sam.returnType != TypeBinding.VOID) {<NEW_LINE>// ii)<NEW_LINE>final TypeBinding r = sam.returnType;<NEW_LINE>LambdaExpression resolved = lambda.resolveExpressionExpecting(this.right, context.scope, context);<NEW_LINE>Expression[] resultExpressions = resolved != null ? resolved.resultExpressions() : null;<NEW_LINE>for (int i = 0, length = resultExpressions == null ? 0 : resultExpressions.length; i < length; i++) {<NEW_LINE>variables.addAll(new ConstraintExpressionFormula(resultExpressions[i], r, COMPATIBLE).inputVariables(context));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return variables;<NEW_LINE>}<NEW_LINE>} else if (this.left instanceof ReferenceExpression) {<NEW_LINE>if (this.right instanceof InferenceVariable) {<NEW_LINE>return Collections.singletonList((InferenceVariable) this.right);<NEW_LINE>}<NEW_LINE>if (this.right.isFunctionalInterface(context.scope) && !this.left.isExactMethodReference()) {<NEW_LINE>MethodBinding sam = this.right.getSingleAbstractMethod(context.scope, true);<NEW_LINE>final Set<InferenceVariable> variables = new HashSet<>();<NEW_LINE>int len = sam.parameters.length;<NEW_LINE>for (int i = 0; i < len; i++) {<NEW_LINE>sam.parameters[i].collectInferenceVariables(variables);<NEW_LINE>}<NEW_LINE>return variables;<NEW_LINE>}<NEW_LINE>} else if (this.left instanceof ConditionalExpression && this.left.isPolyExpression()) {<NEW_LINE>ConditionalExpression expr = (ConditionalExpression) this.left;<NEW_LINE>Set<InferenceVariable> variables = new HashSet<>();<NEW_LINE>variables.addAll(new ConstraintExpressionFormula(expr.valueIfTrue, this.right, COMPATIBLE).inputVariables(context));<NEW_LINE>variables.addAll(new ConstraintExpressionFormula(expr.valueIfFalse, this.right, COMPATIBLE).inputVariables(context));<NEW_LINE>return variables;<NEW_LINE>}<NEW_LINE>return EMPTY_VARIABLE_LIST;<NEW_LINE>}
lambda = (LambdaExpression) this.left;
1,679,285
public final static Comparator<NodeModel> comparator() {<NEW_LINE>return new Comparator<NodeModel>() {<NEW_LINE><NEW_LINE>private final HashMap<NodeModel, NodeAbsolutePath> paths = new HashMap<>();<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public int compare(NodeModel o1, NodeModel o2) {<NEW_LINE>if (o1 == o2)<NEW_LINE>return 0;<NEW_LINE>if (o1 == null)<NEW_LINE>return -1;<NEW_LINE>if (o2 == null)<NEW_LINE>return 1;<NEW_LINE>final NodeAbsolutePath absoluteBeginPath = getPath(o1);<NEW_LINE>final NodeAbsolutePath absoluteEndPath = getPath(o2);<NEW_LINE>return new NodeRelativePath(absoluteBeginPath, absoluteEndPath).compareNodePositions();<NEW_LINE>}<NEW_LINE><NEW_LINE>public NodeAbsolutePath getPath(NodeModel node) {<NEW_LINE>NodeAbsolutePath <MASK><NEW_LINE>if (path == null) {<NEW_LINE>path = new NodeAbsolutePath(node);<NEW_LINE>paths.put(node, path);<NEW_LINE>} else<NEW_LINE>path.reset();<NEW_LINE>return path;<NEW_LINE>}<NEW_LINE>};<NEW_LINE>}
path = paths.get(node);
239,936
public DeclarationLocation run(final EditorFeatureContext context) {<NEW_LINE>final AtomicReference<DeclarationLocation> result = new AtomicReference<>();<NEW_LINE>context.getDocument().render(new Runnable() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void run() {<NEW_LINE>final TokenSequence<CssTokenId> ts = LexerUtils.getJoinedTokenSequence(context.getDocument(), context.getCaretOffset(), CssTokenId.language());<NEW_LINE>if (ts == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>Token<CssTokenId> valueToken = ts.token();<NEW_LINE>String valueText = valueToken.text().toString();<NEW_LINE>// adjust the value if a part of an URI<NEW_LINE>if (valueToken.id() == CssTokenId.URI) {<NEW_LINE>Matcher m = Css3Utils.URI_PATTERN.matcher(valueToken.text());<NEW_LINE>if (m.matches()) {<NEW_LINE>int groupIndex = 1;<NEW_LINE>valueText = m.group(groupIndex);<NEW_LINE>}<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>FileObject resolved = WebUtils.resolve(context.getSource().getFileObject(), valueText);<NEW_LINE>result.set(resolved != null ? new DeclarationLocation(resolved, 0) : DeclarationLocation.NONE);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>return result.get();<NEW_LINE>}
valueText = WebUtils.unquotedValue(valueText);
60,625
void dump(Collection<BugPatternInstance> patterns, Writer w, Target target, Set<String> enabledChecks) throws IOException {<NEW_LINE>// (Default, Severity) -> [Pattern...]<NEW_LINE>SortedSetMultimap<IndexEntry, MiniDescription> sorted = TreeMultimap.create(comparing(IndexEntry::onByDefault, trueFirst()).thenComparing(IndexEntry::severity), Comparator.comparing(MiniDescription::name));<NEW_LINE>for (BugPatternInstance pattern : patterns) {<NEW_LINE>sorted.put(IndexEntry.create(enabledChecks.contains(pattern.name), pattern.severity), MiniDescription.create(pattern));<NEW_LINE>}<NEW_LINE>Map<String, Object> templateData = new HashMap<>();<NEW_LINE>ImmutableList<Map<String, Object>> bugpatternData = Multimaps.asMap(sorted).entrySet().stream().map(e -> ImmutableMap.of("category", e.getKey().asCategoryHeader(), "checks", e.getValue())<MASK><NEW_LINE>templateData.put("bugpatterns", bugpatternData);<NEW_LINE>if (target == Target.EXTERNAL) {<NEW_LINE>ImmutableMap<String, String> frontmatterData = ImmutableMap.<String, String>builder().put("title", "Bug Patterns").put("layout", "bugpatterns").buildOrThrow();<NEW_LINE>DumperOptions options = new DumperOptions();<NEW_LINE>options.setDefaultFlowStyle(DumperOptions.FlowStyle.BLOCK);<NEW_LINE>Yaml yaml = new Yaml(options);<NEW_LINE>Writer yamlWriter = new StringWriter();<NEW_LINE>yamlWriter.write("---\n");<NEW_LINE>yaml.dump(frontmatterData, yamlWriter);<NEW_LINE>yamlWriter.write("---\n");<NEW_LINE>templateData.put("frontmatter", yamlWriter.toString());<NEW_LINE>MustacheFactory mf = new DefaultMustacheFactory();<NEW_LINE>Mustache mustache = mf.compile("com/google/errorprone/resources/bugpatterns_external.mustache");<NEW_LINE>mustache.execute(w, templateData);<NEW_LINE>} else {<NEW_LINE>MustacheFactory mf = new DefaultMustacheFactory();<NEW_LINE>Mustache mustache = mf.compile("com/google/errorprone/resources/bugpatterns_internal.mustache");<NEW_LINE>mustache.execute(w, templateData);<NEW_LINE>}<NEW_LINE>}
).collect(toImmutableList());
1,298,095
private void decodeBin() {<NEW_LINE>int opcode = RV32imSupport.getOpcode(instruction);<NEW_LINE>switch(opcode) {<NEW_LINE>case LUI:<NEW_LINE>case AUIPC:<NEW_LINE>valid = true;<NEW_LINE>destination = RV32imSupport.getDestinationRegisterIndex(instruction);<NEW_LINE>immediate = RV32imSupport.getImmediateValue(instruction, RV32imSupport.U_TYPE);<NEW_LINE>operation = (opcode == LUI) ? INSTR_LUI : INSTR_AUIPC;<NEW_LINE>return;<NEW_LINE>case OP_IMM:<NEW_LINE>valid = true;<NEW_LINE>source = RV32imSupport.getSourceRegister1Index(instruction);<NEW_LINE>destination = RV32imSupport.getDestinationRegisterIndex(instruction);<NEW_LINE>immediate = RV32imSupport.getImmediateValue(instruction, RV32imSupport.I_TYPE);<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>valid = false;<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>int <MASK><NEW_LINE>if (funct7 == 0 || funct7 == 0x20) {<NEW_LINE>int bit30 = (instruction >> 30) & 1;<NEW_LINE>operation = op3 + bit30 * 3;<NEW_LINE>immediate = (instruction >> 20) & 0x1F;<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>valid = false;<NEW_LINE>}
funct7 = RV32imSupport.getFunct7(instruction);
1,067,306
public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {<NEW_LINE>// Get Session attributes<NEW_LINE>MobileSessionCtx wsc = MobileSessionCtx.get(request);<NEW_LINE>// Modified by Rob Klein 4/29/07<NEW_LINE>WWindowStatus ws = WWindowStatus.get(request);<NEW_LINE>if (wsc == null) {<NEW_LINE>MobileUtil.createTimeoutPage(request, response, this, null);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>MobileDoc doc = null;<NEW_LINE>// Get Parameter: Menu_ID<NEW_LINE>// Modified by Rob Klein 4/29/07<NEW_LINE>int AD_Menu_ID = MobileUtil.getParameterAsInt(request, "AD_Menu_ID");<NEW_LINE>String fileName = MobileUtil.getParameter(request, "File");<NEW_LINE>if (AD_Menu_ID > 0) {<NEW_LINE>doc = createParameterPage(wsc, AD_Menu_ID, 0, 0, <MASK><NEW_LINE>} else // else if (fileName!=null)<NEW_LINE>// {<NEW_LINE>// int AD_PInstance_ID = WebUtil.getParameterAsInt(request, "AD_PInstance_ID");<NEW_LINE>//<NEW_LINE>// String error = streamResult (request, response, AD_PInstance_ID, fileName);<NEW_LINE>// if (error == null)<NEW_LINE>// return;<NEW_LINE>// doc = WebDoc.createWindow(error);<NEW_LINE>// }<NEW_LINE>{<NEW_LINE>doPost(request, response);<NEW_LINE>}<NEW_LINE>if (doc == null)<NEW_LINE>doc = MobileDoc.createWindow("Process Not Found");<NEW_LINE>//<NEW_LINE>MobileUtil.createResponse(request, response, this, null, doc, false);<NEW_LINE>}
0, 0, null, null);
1,000,332
public static void onModification(final Image thisImage, final SecurityContext securityContext, final ErrorBuffer errorBuffer, final ModificationQueue modificationQueue) throws FrameworkException {<NEW_LINE>if (!thisImage.isThumbnail() && !thisImage.isTemplate()) {<NEW_LINE>if (modificationQueue.isPropertyModified(thisImage, name)) {<NEW_LINE>final String newImageName = thisImage.getName();<NEW_LINE>for (Image tn : thisImage.getThumbnails()) {<NEW_LINE>final String expectedThumbnailName = ImageHelper.getThumbnailName(newImageName, tn.getWidth(), tn.getHeight());<NEW_LINE>final String currentThumbnailName = tn.getName();<NEW_LINE>if (!expectedThumbnailName.equals(currentThumbnailName)) {<NEW_LINE>final Logger logger = LoggerFactory.getLogger(Image.class);<NEW_LINE>logger.debug("Auto-renaming Thumbnail({}) from '{}' to '{}'", tn.getUuid(), currentThumbnailName, expectedThumbnailName);<NEW_LINE>tn.<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
setProperty(AbstractNode.name, expectedThumbnailName);
1,718,256
public ProcessStatus restWriteSetting(final PwmRequest pwmRequest) throws PwmUnrecoverableException, IOException {<NEW_LINE>final String profileID = "default";<NEW_LINE>final String settingKey = pwmRequest.readParameterAsString("key");<NEW_LINE>final String bodyString = pwmRequest.readRequestBodyAsString();<NEW_LINE>final PwmSetting pwmSetting = PwmSetting.forKey(settingKey).orElseThrow(() -> new IllegalStateException("invalid setting parameter value"));<NEW_LINE>final ConfigGuideBean configGuideBean = getBean(pwmRequest);<NEW_LINE>final StoredConfiguration storedConfiguration = ConfigGuideForm.generateStoredConfig(configGuideBean);<NEW_LINE>final StoredConfigKey key = StoredConfigKey.forSetting(pwmSetting, profileID, DomainID.DOMAIN_ID_DEFAULT);<NEW_LINE>final LinkedHashMap<String, Object> returnMap = new LinkedHashMap<>();<NEW_LINE>try {<NEW_LINE>final StoredValue storedValue = ValueFactory.fromJson(pwmSetting, bodyString);<NEW_LINE>final List<String> errorMsgs = storedValue.validateValue(pwmSetting);<NEW_LINE>if (errorMsgs != null && !errorMsgs.isEmpty()) {<NEW_LINE>returnMap.put("errorMessage", pwmSetting.getLabel(pwmRequest.getLocale()) + ": " + errorMsgs.get(0));<NEW_LINE>}<NEW_LINE>if (pwmSetting == PwmSetting.CHALLENGE_RANDOM_CHALLENGES) {<NEW_LINE>configGuideBean.getFormData().put(ConfigGuideFormField.CHALLENGE_RESPONSE_DATA, JsonFactory.get().serialize((Serializable) storedValue.toNativeObject()));<NEW_LINE>}<NEW_LINE>} catch (final Exception e) {<NEW_LINE>final String errorMsg = "error writing default value for setting " + pwmSetting + ", error: " + e.getMessage();<NEW_LINE>LOGGER.error(() -> errorMsg, e);<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>returnMap.put("key", settingKey);<NEW_LINE>returnMap.put("category", pwmSetting.getCategory().toString());<NEW_LINE>returnMap.put("syntax", pwmSetting.getSyntax().toString());<NEW_LINE>returnMap.put("isDefault", StoredConfigurationUtil.isDefaultValue(storedConfiguration, key));<NEW_LINE>pwmRequest.outputJsonResult(RestResultBean.withData(returnMap, Map.class));<NEW_LINE>return ProcessStatus.Halt;<NEW_LINE>}
throw new IllegalStateException(errorMsg, e);
1,280,835
public BatchUpdateResult<ComplexResourceKey<TwoPartKey, TwoPartKey>, Message> batchUpdate(BatchPatchRequest<ComplexResourceKey<TwoPartKey, TwoPartKey>, Message> patches) {<NEW_LINE>final Map<ComplexResourceKey<TwoPartKey, TwoPartKey>, UpdateResponse> results = new HashMap<>();<NEW_LINE>for (Map.Entry<ComplexResourceKey<TwoPartKey, TwoPartKey>, PatchRequest<Message>> patch : patches.getData().entrySet()) {<NEW_LINE>try {<NEW_LINE>this.partialUpdate(patch.getKey(<MASK><NEW_LINE>results.put(patch.getKey(), new UpdateResponse(HttpStatus.S_204_NO_CONTENT));<NEW_LINE>} catch (DataProcessingException e) {<NEW_LINE>results.put(patch.getKey(), new UpdateResponse(HttpStatus.S_400_BAD_REQUEST));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return new BatchUpdateResult<>(results);<NEW_LINE>}
), patch.getValue());
532,856
static Command chooseCommand(@NotNull final Project project) {<NEW_LINE>if (!usesFlutter(project)) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>final String androidHome = IntelliJAndroidSdk.chooseAndroidHome(project, false);<NEW_LINE>// See if the Bazel workspace provides a script.<NEW_LINE>final Workspace workspace = WorkspaceCache.getInstance(project).get();<NEW_LINE>if (workspace != null) {<NEW_LINE>final String script = workspace.getDaemonScript();<NEW_LINE>if (script != null) {<NEW_LINE>return new Command(workspace.getRoot().getPath(), script, ImmutableList.of(), androidHome);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Otherwise, use the Flutter SDK.<NEW_LINE>final FlutterSdk <MASK><NEW_LINE>if (sdk == null) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>final String path = FlutterSdkUtil.pathToFlutterTool(sdk.getHomePath());<NEW_LINE>final ImmutableList<String> list;<NEW_LINE>if (FlutterUtils.isIntegrationTestingMode()) {<NEW_LINE>list = ImmutableList.of("--show-test-device", "daemon");<NEW_LINE>} else {<NEW_LINE>list = ImmutableList.of("daemon");<NEW_LINE>}<NEW_LINE>return new Command(sdk.getHomePath(), path, list, androidHome);<NEW_LINE>} catch (ExecutionException e) {<NEW_LINE>FlutterUtils.warn(LOG, "Unable to calculate command to watch Flutter devices", e);<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>}
sdk = FlutterSdk.getFlutterSdk(project);
139,516
public void apply(ParameterContext context) {<NEW_LINE>ResolvedMethodParameter methodParameter = context.resolvedMethodParameter();<NEW_LINE>ResolvedType parameterType = methodParameter.getParameterType();<NEW_LINE>parameterType = context.alternateFor(parameterType);<NEW_LINE>springfox.documentation.schema.ModelReference modelRef = null;<NEW_LINE>ModelContext modelContext = modelContext(context, methodParameter, parameterType);<NEW_LINE>ModelSpecification parameterModel = models.create(modelContext, parameterType);<NEW_LINE>if (methodParameter.hasParameterAnnotation(PathVariable.class) && treatAsAString(parameterType)) {<NEW_LINE>modelRef = new springfox.documentation.schema.ModelRef("string");<NEW_LINE>context.requestParameterBuilder().query(q -> q.model(m -> m.<MASK><NEW_LINE>} else if (methodParameter.hasParameterAnnotation(RequestParam.class) && isMapType(parameterType)) {<NEW_LINE>modelRef = new springfox.documentation.schema.ModelRef("", new springfox.documentation.schema.ModelRef("string"), true);<NEW_LINE>context.requestParameterBuilder().query(q -> q.model(m -> m.mapModel(map -> map.key(v -> v.scalarModel(ScalarType.STRING)).value(v -> v.scalarModel(ScalarType.STRING)))));<NEW_LINE>} else if (methodParameter.hasParameterAnnotation(RequestPart.class) || methodParameter.hasParameterAnnotation(RequestBody.class)) {<NEW_LINE>context.requestParameterBuilder().contentModel(parameterModel);<NEW_LINE>} else {<NEW_LINE>modelRef = handleFormParameter(context, parameterType, modelRef, parameterModel);<NEW_LINE>}<NEW_LINE>context.parameterBuilder().type(parameterType).modelRef(Optional.ofNullable(modelRef).orElse(modelRefFactory(modelContext, enumTypeDeterminer, nameExtractor).apply(parameterType)));<NEW_LINE>}
scalarModel(ScalarType.STRING)));
682,772
protected void onPostExecute(Map<String, Object> result) {<NEW_LINE>// TODO Auto-generated method stub<NEW_LINE>super.onPostExecute(result);<NEW_LINE>isShowPopupWindows = true;<NEW_LINE>mBasePageAdapter.Clear();<NEW_LINE>mViewPager.removeAllViews();<NEW_LINE>if (!result.isEmpty()) {<NEW_LINE>mBasePageAdapter.addFragment((List) result.get("tabs"), (List) result.get("list"));<NEW_LINE>imgRight.setVisibility(View.VISIBLE);<NEW_LINE><MASK><NEW_LINE>loadFaillayout.setVisibility(View.GONE);<NEW_LINE>} else {<NEW_LINE>mBasePageAdapter.addNullFragment();<NEW_LINE>loadLayout.setVisibility(View.GONE);<NEW_LINE>loadFaillayout.setVisibility(View.VISIBLE);<NEW_LINE>}<NEW_LINE>mViewPager.setVisibility(View.VISIBLE);<NEW_LINE>mBasePageAdapter.notifyDataSetChanged();<NEW_LINE>mViewPager.setCurrentItem(0);<NEW_LINE>mIndicator.notifyDataSetChanged();<NEW_LINE>}
loadLayout.setVisibility(View.GONE);
645,129
public void checkActivity() {<NEW_LINE>// Graceful time before the first afk check call.<NEW_LINE>if (System.currentTimeMillis() - lastActivity <= 10000) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final long autoafkkick = ess<MASK><NEW_LINE>if (autoafkkick > 0 && lastActivity > 0 && (lastActivity + (autoafkkick * 1000)) < System.currentTimeMillis() && !isAuthorized("essentials.kick.exempt") && !isAuthorized("essentials.afk.kickexempt")) {<NEW_LINE>final String kickReason = tl("autoAfkKickReason", autoafkkick / 60.0);<NEW_LINE>lastActivity = 0;<NEW_LINE>this.getBase().kickPlayer(kickReason);<NEW_LINE>for (final User user : ess.getOnlineUsers()) {<NEW_LINE>if (user.isAuthorized("essentials.kick.notify")) {<NEW_LINE>user.sendMessage(tl("playerKicked", Console.DISPLAY_NAME, getName(), kickReason));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>final long autoafk = ess.getSettings().getAutoAfk();<NEW_LINE>if (!isAfk() && autoafk > 0 && lastActivity + autoafk * 1000 < System.currentTimeMillis() && isAuthorized("essentials.afk.auto")) {<NEW_LINE>setAfk(true, AfkStatusChangeEvent.Cause.ACTIVITY);<NEW_LINE>if (isAfk() && !isHidden()) {<NEW_LINE>setDisplayNick();<NEW_LINE>final String msg = tl("userIsAway", getDisplayName());<NEW_LINE>final String selfmsg = tl("userIsAwaySelf", getDisplayName());<NEW_LINE>if (!msg.isEmpty() && ess.getSettings().broadcastAfkMessage()) {<NEW_LINE>// exclude user from receiving general AFK announcement in favor of personal message<NEW_LINE>ess.broadcastMessage(this, msg, u -> u == this);<NEW_LINE>}<NEW_LINE>if (!selfmsg.isEmpty()) {<NEW_LINE>this.sendMessage(selfmsg);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
.getSettings().getAutoAfkKick();
1,592,605
private void discoverShards() {<NEW_LINE>log.info("Discovering shards that need compaction...");<NEW_LINE>Set<ShardMetadata> allShards = shardManager.getNodeShards(currentNodeIdentifier);<NEW_LINE>ListMultimap<Long, ShardMetadata> tableShards = Multimaps.<MASK><NEW_LINE>for (Entry<Long, List<ShardMetadata>> entry : Multimaps.asMap(tableShards).entrySet()) {<NEW_LINE>long tableId = entry.getKey();<NEW_LINE>if (!metadataDao.isCompactionEligible(tableId)) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>List<ShardMetadata> shards = entry.getValue();<NEW_LINE>Collection<OrganizationSet> organizationSets = filterAndCreateCompactionSets(tableId, shards);<NEW_LINE>log.info("Created %s compaction set(s) from %s shards for table ID %s", organizationSets.size(), shards.size(), tableId);<NEW_LINE>for (OrganizationSet set : organizationSets) {<NEW_LINE>organizer.enqueue(set);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
index(allShards, ShardMetadata::getTableId);
992,443
public Flux<CommandResponse<GroupCommand, String>> xGroup(Publisher<GroupCommand> commands) {<NEW_LINE>return connection.execute(cmd -> Flux.from(commands).concatMap(command -> {<NEW_LINE>Assert.notNull(command.getKey(), "Key must not be null!");<NEW_LINE>Assert.notNull(<MASK><NEW_LINE>if (command.getAction().equals(GroupCommandAction.CREATE)) {<NEW_LINE>Assert.notNull(command.getReadOffset(), "ReadOffset must not be null!");<NEW_LINE>StreamOffset offset = StreamOffset.from(command.getKey(), command.getReadOffset().getOffset());<NEW_LINE>return cmd.xgroupCreate(offset, ByteUtils.getByteBuffer(command.getGroupName()), XGroupCreateArgs.Builder.mkstream(command.isMkStream())).map(it -> new CommandResponse<>(command, it));<NEW_LINE>}<NEW_LINE>if (command.getAction().equals(GroupCommandAction.DELETE_CONSUMER)) {<NEW_LINE>return cmd.xgroupDelconsumer(command.getKey(), io.lettuce.core.Consumer.from(ByteUtils.getByteBuffer(command.getGroupName()), ByteUtils.getByteBuffer(command.getConsumerName()))).map(it -> new CommandResponse<>(command, "OK"));<NEW_LINE>}<NEW_LINE>if (command.getAction().equals(GroupCommandAction.DESTROY)) {<NEW_LINE>return cmd.xgroupDestroy(command.getKey(), ByteUtils.getByteBuffer(command.getGroupName())).map(it -> new CommandResponse<>(command, Boolean.TRUE.equals(it) ? "OK" : "Error"));<NEW_LINE>}<NEW_LINE>throw new IllegalArgumentException("Unknown group command " + command.getAction());<NEW_LINE>}));<NEW_LINE>}
command.getGroupName(), "GroupName must not be null!");
674,341
public static void main(String[] args) {<NEW_LINE>try {<NEW_LINE>System.out.println("JAX-RS Type Injection Jersey Example App");<NEW_LINE>final HttpServer server = GrizzlyHttpServerFactory.createHttpServer(BASE_URI, create(), false);<NEW_LINE>Runtime.getRuntime().addShutdownHook(new Thread(new Runnable() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void run() {<NEW_LINE>server.shutdownNow();<NEW_LINE>}<NEW_LINE>}));<NEW_LINE>server.start();<NEW_LINE>System.out.println(String.format("Application started.%n" + "To test injection into a programmatic resource, try out:%n %s%s%s%n" + "To test instance injection into an annotated resource, try out:%n %s%s%s%n" + "To test method injection into an annotated resource, try out:%n %s%s%s%n" + "Stop the application using CTRL+C", BASE_URI, ROOT_PATH_PROGRAMMATIC, "?q1=<value_1>&q2=<value_2>&q2=<value_3>", BASE_URI, ROOT_PATH_ANNOTATED_INSTANCE, "?q1=<value_1>&q2=<value_2>&q2=<value_3>"<MASK><NEW_LINE>Thread.currentThread().join();<NEW_LINE>} catch (IOException | InterruptedException ex) {<NEW_LINE>Logger.getLogger(App.class.getName()).log(Level.SEVERE, null, ex);<NEW_LINE>}<NEW_LINE>}
, BASE_URI, ROOT_PATH_ANNOTATED_METHOD, "?q1=<value_1>&q2=<value_2>&q2=<value_3>"));
1,176,030
public static Throwable onOperatorError(@Nullable Subscription subscription, Throwable error, @Nullable Object dataSignal, Context context) {<NEW_LINE>Exceptions.throwIfFatal(error);<NEW_LINE>if (subscription != null) {<NEW_LINE>subscription.cancel();<NEW_LINE>}<NEW_LINE>Throwable <MASK><NEW_LINE>BiFunction<? super Throwable, Object, ? extends Throwable> hook = context.getOrDefault(Hooks.KEY_ON_OPERATOR_ERROR, null);<NEW_LINE>if (hook == null) {<NEW_LINE>hook = Hooks.onOperatorErrorHook;<NEW_LINE>}<NEW_LINE>if (hook == null) {<NEW_LINE>if (dataSignal != null) {<NEW_LINE>if (dataSignal != t && dataSignal instanceof Throwable) {<NEW_LINE>t = Exceptions.addSuppressed(t, (Throwable) dataSignal);<NEW_LINE>}<NEW_LINE>// do not wrap original value to avoid strong references<NEW_LINE>}<NEW_LINE>return t;<NEW_LINE>}<NEW_LINE>return hook.apply(error, dataSignal);<NEW_LINE>}
t = Exceptions.unwrap(error);
1,468,667
public void fireActionEvent(ActionEvent ev) {<NEW_LINE>if (listeners == null || listeners.size() == 0) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// minor optimization for a common use case to avoid allocation costs<NEW_LINE>boolean isEdt = Display.getInstance().isEdt();<NEW_LINE>if (isEdt && listeners.size() == 1) {<NEW_LINE>ActionListener a = (ActionListener) listeners.get(0);<NEW_LINE>a.actionPerformed(ev);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>ActionListener[] array;<NEW_LINE>synchronized (this) {<NEW_LINE>array = new ActionListener[listeners.size()];<NEW_LINE>int alen = array.length;<NEW_LINE>for (int iter = 0; iter < alen; iter++) {<NEW_LINE>array[iter] = (ActionListener) listeners.get(iter);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// if we already are on the EDT just fire the event<NEW_LINE>if (isEdt) {<NEW_LINE>fireActionSync(array, ev);<NEW_LINE>} else {<NEW_LINE>actionListenerArray = true;<NEW_LINE>Runnable cl <MASK><NEW_LINE>if (blocking) {<NEW_LINE>Display.getInstance().callSeriallyAndWait(cl);<NEW_LINE>} else {<NEW_LINE>Display.getInstance().callSerially(cl);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
= new CallbackClass(array, ev);
367,177
// Newly added to allow the EcoService to be added<NEW_LINE>public void init(Echo6Service echo6Service) {<NEW_LINE>_service = echo6Service;<NEW_LINE>_proxy = null;<NEW_LINE>_dispatch = null;<NEW_LINE>if (_service == null) {<NEW_LINE>try {<NEW_LINE>InitialContext ctx = new InitialContext();<NEW_LINE>_service = (com.ibm.was.wssample.sei.echo.Echo6Service) ctx.lookup("java:comp/env/service/Echo6Service");<NEW_LINE>} catch (NamingException e) {<NEW_LINE>if ("true".equalsIgnoreCase(System.getProperty("DEBUG_PROXY"))) {<NEW_LINE>System.out.println(<MASK><NEW_LINE>e.printStackTrace(System.out);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (_service == null && !_useJNDIOnly)<NEW_LINE>_service = new com.ibm.was.wssample.sei.echo.Echo6Service();<NEW_LINE>initCommon();<NEW_LINE>}
"JNDI lookup failure: javax.naming.NamingException: " + e.getMessage());
1,466,008
private void andNextIntoBits() {<NEW_LINE>int type = buffer.get(position);<NEW_LINE>position++;<NEW_LINE>int size = buffer.getChar(position) & 0xFFFF;<NEW_LINE>position += Character.BYTES;<NEW_LINE>switch(type) {<NEW_LINE>case ARRAY:<NEW_LINE>{<NEW_LINE>int skip = size << 1;<NEW_LINE>CharBuffer cb = (CharBuffer) ((ByteBuffer) buffer.position(position)).asCharBuffer().limit(skip >>> 1);<NEW_LINE>MappeableArrayContainer array = new MappeableArrayContainer(cb, size);<NEW_LINE>array.andInto(bits);<NEW_LINE>position += skip;<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>case BITMAP:<NEW_LINE>{<NEW_LINE>LongBuffer lb = (LongBuffer) ((ByteBuffer) buffer.position(position)).<MASK><NEW_LINE>MappeableBitmapContainer bitmap = new MappeableBitmapContainer(lb, size);<NEW_LINE>bitmap.andInto(bits);<NEW_LINE>position += BITMAP_SIZE;<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>case RUN:<NEW_LINE>{<NEW_LINE>int skip = size << 2;<NEW_LINE>CharBuffer cb = (CharBuffer) ((ByteBuffer) buffer.position(position)).asCharBuffer().limit(skip >>> 1);<NEW_LINE>MappeableRunContainer run = new MappeableRunContainer(cb, size);<NEW_LINE>run.andInto(bits);<NEW_LINE>position += skip;<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>throw new IllegalStateException("Unknown type " + type + " (this is a bug, please report it.)");<NEW_LINE>}<NEW_LINE>}
asLongBuffer().limit(1024);
1,296,215
private SecureStoreConfig handleJavaKeyStore(Node keyStoreRoot) {<NEW_LINE>File path = null;<NEW_LINE>String password = null;<NEW_LINE>String type = null;<NEW_LINE>String currentKeyAlias = null;<NEW_LINE>int pollingInterval = JavaKeyStoreSecureStoreConfig.DEFAULT_POLLING_INTERVAL;<NEW_LINE>for (Node n : childElements(keyStoreRoot)) {<NEW_LINE>String name = cleanNodeName(n);<NEW_LINE>if (matches("path", name)) {<NEW_LINE>path = new File(getTextContent<MASK><NEW_LINE>} else if (matches("type", name)) {<NEW_LINE>type = getTextContent(n);<NEW_LINE>} else if (matches("password", name)) {<NEW_LINE>password = getTextContent(n);<NEW_LINE>} else if (matches("current-key-alias", name)) {<NEW_LINE>currentKeyAlias = getTextContent(n);<NEW_LINE>} else if (matches("polling-interval", name)) {<NEW_LINE>pollingInterval = parseInt(getTextContent(n));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>JavaKeyStoreSecureStoreConfig keyStoreSecureStoreConfig = new JavaKeyStoreSecureStoreConfig(path).setPassword(password).setPollingInterval(pollingInterval).setCurrentKeyAlias(currentKeyAlias);<NEW_LINE>if (type != null) {<NEW_LINE>keyStoreSecureStoreConfig.setType(type);<NEW_LINE>}<NEW_LINE>return keyStoreSecureStoreConfig;<NEW_LINE>}
(n)).getAbsoluteFile();
1,617,673
public String generateFlameGraph(FlameGraph flameGraph) throws IOException {<NEW_LINE>List<FlameGraph> flameGraphList = this.baseMapper.getFlameGraph(flameGraph.getAppId(), flameGraph.getStart(<MASK><NEW_LINE>if (CommonUtils.notEmpty(flameGraphList)) {<NEW_LINE>StringBuffer jsonBuffer = new StringBuffer();<NEW_LINE>flameGraphList.forEach(x -> jsonBuffer.append(x.getUnzipContent()).append("\r\n"));<NEW_LINE>Application application = applicationService.getById(flameGraph.getAppId());<NEW_LINE>String jsonName = String.format("%d_%d_%d.json", flameGraph.getAppId(), flameGraph.getStart().getTime(), flameGraph.getEnd().getTime());<NEW_LINE>String jsonPath = new File(WebUtils.getAppTempDir(), jsonName).getAbsolutePath();<NEW_LINE>String foldedPath = jsonPath.replace(".json", ".folded");<NEW_LINE>String svgPath = jsonPath.replace(".json", ".svg");<NEW_LINE>File flameGraphPath = WebUtils.getAppDir("bin/flame-graph");<NEW_LINE>// write json<NEW_LINE>FileOutputStream fileOutputStream = new FileOutputStream(jsonPath);<NEW_LINE>IOUtils.write(jsonBuffer.toString().getBytes(), fileOutputStream);<NEW_LINE>String title = application.getJobName().concat(" ___ FlameGraph");<NEW_LINE>// generate...<NEW_LINE>List<String> commands = Arrays.asList(String.format("python ./stackcollapse.py -i %s > %s ", jsonPath, foldedPath), String.format("./flamegraph.pl --title=\"%s\" --width=%d --colors=java %s > %s ", title, flameGraph.getWidth(), foldedPath, svgPath));<NEW_LINE>CommandUtils.execute(flameGraphPath.getAbsolutePath(), commands, (line) -> log.info("flameGraph: {} ", line));<NEW_LINE>return svgPath;<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>}
), flameGraph.getEnd());
1,776,341
private String stripSource(String source) {<NEW_LINE>nodesToStrip.addAll(unusedImports.values());<NEW_LINE>nodesToStrip.<MASK><NEW_LINE>StringBuilder sb = new StringBuilder();<NEW_LINE>int currentIdx = 0;<NEW_LINE>for (Tree node : nodesToStrip) {<NEW_LINE>int startPos = startPosition(node);<NEW_LINE>if (startPos < currentIdx) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>int endPos = endPosition(node);<NEW_LINE>sb.append(source.substring(currentIdx, startPos));<NEW_LINE>// Preserve newlines from the stripped node so that we can add line<NEW_LINE>// directives consistent with the original source file.<NEW_LINE>for (int i = startPos; i < endPos; i++) {<NEW_LINE>if (source.charAt(i) == '\n') {<NEW_LINE>sb.append('\n');<NEW_LINE>}<NEW_LINE>}<NEW_LINE>currentIdx = endPos;<NEW_LINE>}<NEW_LINE>sb.append(source.substring(currentIdx));<NEW_LINE>return sb.toString();<NEW_LINE>}
addAll(unusedStaticImports.values());
1,507,102
protected Statement tryStatement(AST tryStatementNode) {<NEW_LINE>AST tryNode = tryStatementNode.getFirstChild();<NEW_LINE>Statement tryStatement = statement(tryNode);<NEW_LINE>Statement finallyStatement = EmptyStatement.INSTANCE;<NEW_LINE>AST node = tryNode.getNextSibling();<NEW_LINE>// let's do the catch nodes<NEW_LINE>List<CatchStatement> <MASK><NEW_LINE>for (; isType(LITERAL_catch, node); node = node.getNextSibling()) {<NEW_LINE>final List<CatchStatement> catchStatements = catchStatement(node);<NEW_LINE>catches.addAll(catchStatements);<NEW_LINE>}<NEW_LINE>if (isType(LITERAL_finally, node)) {<NEW_LINE>finallyStatement = statement(node);<NEW_LINE>node = node.getNextSibling();<NEW_LINE>}<NEW_LINE>if (finallyStatement instanceof EmptyStatement && catches.isEmpty()) {<NEW_LINE>throw new ASTRuntimeException(tryStatementNode, "A try statement must have at least one catch or finally block.");<NEW_LINE>}<NEW_LINE>TryCatchStatement tryCatchStatement = new TryCatchStatement(tryStatement, finallyStatement);<NEW_LINE>configureAST(tryCatchStatement, tryStatementNode);<NEW_LINE>for (CatchStatement statement : catches) {<NEW_LINE>tryCatchStatement.addCatch(statement);<NEW_LINE>}<NEW_LINE>return tryCatchStatement;<NEW_LINE>}
catches = new ArrayList<>();
1,714,858
public void resolveLink(String link, Promise promise) {<NEW_LINE>try {<NEW_LINE>FirebaseDynamicLinks.getInstance().getDynamicLink(Uri.parse(link)).addOnCompleteListener(task -> {<NEW_LINE>if (task.isSuccessful()) {<NEW_LINE>PendingDynamicLinkData linkData = task.getResult();<NEW_LINE>// Note: link == null if link invalid, isSuccessful is only false on processing<NEW_LINE>// error<NEW_LINE>if (linkData != null && linkData.getLink() != null && linkData.getLink().toString() != null) {<NEW_LINE>String linkUrl = linkData.getLink().toString();<NEW_LINE>int linkMinimumVersion = linkData.getMinimumAppVersion();<NEW_LINE>Bundle linkUtmParameters = linkData.getUtmParameters();<NEW_LINE>promise.resolve(dynamicLinkToWritableMap(linkUrl, linkMinimumVersion, Arguments.makeNativeMap(linkUtmParameters)));<NEW_LINE>} else {<NEW_LINE>rejectPromiseWithCodeAndMessage(promise, "not-found", "Dynamic link not found");<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>rejectPromiseWithCodeAndMessage(promise, "resolve-link-error", task.<MASK><NEW_LINE>}<NEW_LINE>});<NEW_LINE>} catch (Exception e) {<NEW_LINE>// This would be very unexpected, but crashing is even less expected<NEW_LINE>rejectPromiseWithCodeAndMessage(promise, "resolve-link-error", "Unknown resolve failure");<NEW_LINE>}<NEW_LINE>}
getException().getMessage());
1,818,876
public void run(final Server server, final User user, final String commandLabel, final String[] args) throws Exception {<NEW_LINE>final int topX = user.getLocation().getBlockX();<NEW_LINE>final int topZ = user.getLocation().getBlockZ();<NEW_LINE>final float pitch = user.getLocation().getPitch();<NEW_LINE>final float yaw = user.getLocation().getYaw();<NEW_LINE>final Location unsafe = new Location(user.getWorld(), topX, ess.getWorldInfoProvider().getMaxHeight(user.getWorld()), topZ, yaw, pitch);<NEW_LINE>final Location safe = LocationUtil.getSafeDestination(ess, unsafe);<NEW_LINE>final CompletableFuture<Boolean> <MASK><NEW_LINE>future.thenAccept(success -> {<NEW_LINE>if (success) {<NEW_LINE>user.sendMessage(tl("teleportTop", safe.getWorld().getName(), safe.getBlockX(), safe.getBlockY(), safe.getBlockZ()));<NEW_LINE>}<NEW_LINE>});<NEW_LINE>user.getAsyncTeleport().teleport(safe, new Trade(this.getName(), ess), TeleportCause.COMMAND, getNewExceptionFuture(user.getSource(), commandLabel));<NEW_LINE>}
future = new CompletableFuture<>();
1,313,607
public String doGet(Model model) {<NEW_LINE>Map<String, Object> map = new HashMap<>();<NEW_LINE>map.put("transcodings", transcodingService.getAllTranscodings());<NEW_LINE>map.put("transcodeDirectory", SettingsService.getTranscodeDirectory());<NEW_LINE>map.put("downsampleCommand", settingsService.getDownsamplingCommand());<NEW_LINE>map.put("hlsCommand", settingsService.getHlsCommand());<NEW_LINE>map.put("jukeboxCommand", settingsService.getJukeboxCommand());<NEW_LINE>map.put(<MASK><NEW_LINE>map.put("subtitlesExtractionCommand", settingsService.getSubtitlesExtractionCommand());<NEW_LINE>map.put("transcodeEstimateTimePadding", settingsService.getTranscodeEstimateTimePadding());<NEW_LINE>map.put("transcodeEstimateBytePadding", settingsService.getTranscodeEstimateBytePadding());<NEW_LINE>map.put("brand", settingsService.getBrand());<NEW_LINE>model.addAttribute("model", map);<NEW_LINE>return "transcodingSettings";<NEW_LINE>}
"videoImageCommand", settingsService.getVideoImageCommand());
253,975
protected boolean estimatePose(int which, List<Point2D3D> points, Se3_F64 fiducialToCamera) {<NEW_LINE>if (!estimatePnP.process(points, initialEstimate)) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>filtered.clear();<NEW_LINE>// Don't bother if there are hardly any points to work with<NEW_LINE>if (points.size() > 6) {<NEW_LINE>w2p.configure(Objects.requireNonNull(lensDistortion), initialEstimate);<NEW_LINE>// compute the error for each point in image pixels<NEW_LINE>errors.reset();<NEW_LINE>for (int idx = 0; idx < detectedPixels.size(); idx++) {<NEW_LINE>PointIndex2D_F64 dp = detectedPixels.get(idx);<NEW_LINE>w2p.transform(points.get(idx).location, predicted);<NEW_LINE>errors.add(predicted.distance2(dp.p));<NEW_LINE>}<NEW_LINE>// compute the prune threshold based on the standard deviation. well variance really<NEW_LINE>double stdev = 0;<NEW_LINE>for (int i = 0; i < errors.size; i++) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>// prune points 3 standard deviations away<NEW_LINE>// Don't prune if 3 standard deviations is less than 1.5 pixels since that's about what<NEW_LINE>// you would expect and you might make the solution worse<NEW_LINE>double sigma3 = Math.max(1.5, 4 * stdev);<NEW_LINE>for (int i = 0; i < points.size(); i++) {<NEW_LINE>if (errors.get(i) < sigma3) {<NEW_LINE>filtered.add(points.get(i));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// recompute pose esitmate without the outliers<NEW_LINE>if (filtered.size() != points.size()) {<NEW_LINE>if (!estimatePnP.process(filtered, initialEstimate)) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>filtered.addAll(points);<NEW_LINE>}<NEW_LINE>return refinePnP.fitModel(points, initialEstimate, fiducialToCamera);<NEW_LINE>}
stdev += errors.get(i);
411,431
public com.amazonaws.services.codecommit.model.NumberOfRulesExceededException unmarshallFromContext(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>com.amazonaws.services.codecommit.model.NumberOfRulesExceededException numberOfRulesExceededException = new com.amazonaws.services.<MASK><NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>} 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 numberOfRulesExceededException;<NEW_LINE>}
codecommit.model.NumberOfRulesExceededException(null);
818,340
private void init(String pomPath) {<NEW_LINE>String[] classpath = null;<NEW_LINE>if (pomPath != null) {<NEW_LINE>File srcPom = new File(pomPath);<NEW_LINE>if (!srcPom.exists() || !srcPom.isFile()) {<NEW_LINE>throw new SpoonException("Pom " + srcPom.getPath() + " not found.");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>pom = new File(decompiledRoot, "pom.xml");<NEW_LINE>Files.copy(srcPom.toPath(), pom.toPath(), REPLACE_EXISTING);<NEW_LINE>} catch (IOException e) {<NEW_LINE>throw new SpoonException("Unable to write " + pom.getPath());<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>SpoonPom pomModel = new SpoonPom(pom.getPath(), null, MavenLauncher.SOURCE_TYPE.APP_SOURCE, getEnvironment());<NEW_LINE>getEnvironment().setComplianceLevel(pomModel.getSourceVersion());<NEW_LINE>classpath = pomModel.buildClassPath(null, MavenLauncher.<MASK><NEW_LINE>// dependencies<NEW_LINE>this.getModelBuilder().setSourceClasspath(classpath);<NEW_LINE>} catch (IOException | XmlPullParserException e) {<NEW_LINE>throw new SpoonException("Failed to read classpath file.");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// We call the decompiler only if jar has changed since last decompilation.<NEW_LINE>if (decompile) {<NEW_LINE>decompiler.decompile(jar.getAbsolutePath(), decompiledSrc.getAbsolutePath(), classpath);<NEW_LINE>}<NEW_LINE>addInputResource(decompiledSrc.getAbsolutePath());<NEW_LINE>}
SOURCE_TYPE.APP_SOURCE, LOGGER, false);
1,392,828
public void shouldAddPipelineToTheTopOfConfigFile() throws Exception {<NEW_LINE>goConfigDao.load();<NEW_LINE>PipelineConfig pipelineConfig = PipelineMother.<MASK><NEW_LINE>PipelineConfig pipelineConfig2 = PipelineMother.twoBuildPlansWithResourcesAndSvnMaterialsAtUrl("addedSecond", "ut", "www.spring.com");<NEW_LINE>goConfigDao.addPipeline(pipelineConfig, DEFAULT_GROUP);<NEW_LINE>goConfigDao.addPipeline(pipelineConfig2, DEFAULT_GROUP);<NEW_LINE>goConfigDao.load();<NEW_LINE>final File configFile = new File(goConfigDao.fileLocation());<NEW_LINE>final String content = FileUtils.readFileToString(configFile, UTF_8);<NEW_LINE>final int indexOfSecond = content.indexOf("addedSecond");<NEW_LINE>final int indexOfFirst = content.indexOf("addedFirst");<NEW_LINE>assertThat(indexOfSecond, is(not(-1)));<NEW_LINE>assertThat(indexOfFirst, is(not(-1)));<NEW_LINE>assertTrue(indexOfSecond < indexOfFirst);<NEW_LINE>}
twoBuildPlansWithResourcesAndSvnMaterialsAtUrl("addedFirst", "ut", "www.spring.com");
60,284
public void run(MessageReply reply) {<NEW_LINE>if (!reply.isSuccess()) {<NEW_LINE>completion.fail(reply.getError());<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>CreateTemplateFromVolumeRsp rsp = ((KVMHostAsyncHttpCallReply) reply).toResponse(CreateTemplateFromVolumeRsp.class);<NEW_LINE>if (!rsp.isSuccess()) {<NEW_LINE>String sb = String.format("failed to create template from volume, because %s", rsp.getError()) + String.format("\ntemplate:%s", JSONObjectUtil.toJsonString(image)) + String.format("\nvolume resource:%s", volumeResourceInstallPath) + String.format("\nnfs primary storage uuid:%s", primaryStorage.getUuid()) + String.format("\nKVM host uuid:%s, management ip:%s", destHost.getUuid(), destHost.getManagementIp());<NEW_LINE>completion.fail(operr(sb));<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>StringBuilder sb = new StringBuilder();<NEW_LINE>sb.append(String.format("successfully created template from volumes"));<NEW_LINE>sb.append(String.format("\ntemplate:%s", JSONObjectUtil.toJsonString(image)));<NEW_LINE>sb.append(String.format("\nvolume resource:%s", volumeResourceInstallPath));<NEW_LINE>sb.append(String.format("\nnfs primary storage uuid:%s", primaryStorage.getUuid()));<NEW_LINE>sb.append(String.format("\nKVM host uuid:%s, management ip:%s", destHost.getUuid(), destHost.getManagementIp()));<NEW_LINE>logger.debug(sb.toString());<NEW_LINE>nfsMgr.reportCapacityIfNeeded(primaryStorage.getUuid(), rsp);<NEW_LINE>completion.success(new BitsInfo(installPath, rsp.getSize()<MASK><NEW_LINE>}
, rsp.getActualSize()));
1,055,037
protected // lots of keys - however, for a small DHT we need to be careful<NEW_LINE>void add(DHTDBValueImpl new_value) {<NEW_LINE>// don't replace a closer cache value with a further away one. in particular<NEW_LINE>// we have to avoid the case where the original publisher of a key happens to<NEW_LINE>// be close to it and be asked by another node to cache it!<NEW_LINE><MASK><NEW_LINE>DHTTransportContact sender = new_value.getSender();<NEW_LINE>HashWrapper originator_id = new HashWrapper(originator.getID());<NEW_LINE>boolean direct = Arrays.equals(originator.getID(), sender.getID());<NEW_LINE>if (direct) {<NEW_LINE>// direct contact from the originator is straight forward<NEW_LINE>addDirectValue(originator_id, new_value);<NEW_LINE>// remove any indirect values we might already have for this<NEW_LINE>Iterator<Map.Entry<HashWrapper, DHTDBValueImpl>> it = indirect_originator_value_map.entrySet().iterator();<NEW_LINE>List<HashWrapper> to_remove = new ArrayList<>();<NEW_LINE>while (it.hasNext()) {<NEW_LINE>Map.Entry<HashWrapper, DHTDBValueImpl> entry = it.next();<NEW_LINE>HashWrapper existing_key = entry.getKey();<NEW_LINE>DHTDBValueImpl existing_value = entry.getValue();<NEW_LINE>if (Arrays.equals(existing_value.getOriginator().getID(), originator.getID())) {<NEW_LINE>to_remove.add(existing_key);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>for (int i = 0; i < to_remove.size(); i++) {<NEW_LINE>removeIndirectValue((HashWrapper) to_remove.get(i));<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>// not direct. if we have a value already for this originator then<NEW_LINE>// we drop the value as the originator originated one takes precedence<NEW_LINE>if (direct_originator_map_may_be_null != null && direct_originator_map_may_be_null.get(originator_id) != null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// rule (b) - one entry per originator/value pair<NEW_LINE>HashWrapper originator_value_id = getOriginatorValueID(new_value);<NEW_LINE>DHTDBValueImpl existing_value = indirect_originator_value_map.get(originator_value_id);<NEW_LINE>if (existing_value != null) {<NEW_LINE>addIndirectValue(originator_value_id, new_value);<NEW_LINE>// System.out.println( " replacing existing" );<NEW_LINE>} else {<NEW_LINE>// only add new values if not diversified<NEW_LINE>if (diversification_state == DHT.DT_NONE) {<NEW_LINE>addIndirectValue(originator_value_id, new_value);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
DHTTransportContact originator = new_value.getOriginator();
709,983
protected void processFiltered(File file, FileText fileText) throws CheckstyleException {<NEW_LINE>// check if already checked and passed the file<NEW_LINE>if (!ordinaryChecks.isEmpty() || !commentChecks.isEmpty()) {<NEW_LINE>final FileContents contents = getFileContents();<NEW_LINE>final DetailAST rootAST = JavaParser.parse(contents);<NEW_LINE>if (!ordinaryChecks.isEmpty()) {<NEW_LINE>walk(rootAST, contents, AstState.ORDINARY);<NEW_LINE>}<NEW_LINE>if (!commentChecks.isEmpty()) {<NEW_LINE>final DetailAST <MASK><NEW_LINE>walk(astWithComments, contents, AstState.WITH_COMMENTS);<NEW_LINE>}<NEW_LINE>if (filters.isEmpty()) {<NEW_LINE>addViolations(violations);<NEW_LINE>} else {<NEW_LINE>final SortedSet<Violation> filteredViolations = getFilteredViolations(file.getAbsolutePath(), contents, rootAST);<NEW_LINE>addViolations(filteredViolations);<NEW_LINE>}<NEW_LINE>violations.clear();<NEW_LINE>}<NEW_LINE>}
astWithComments = JavaParser.appendHiddenCommentNodes(rootAST);
1,371,215
// JDBC operations. These are all blocking<NEW_LINE>private Void jdbcConnect(com.oracle.adbaoverjdbc.Operation<Void> op) {<NEW_LINE>try {<NEW_LINE>Properties info = (Properties) properties.get(JdbcConnectionProperties.JDBC_CONNECTION_PROPERTIES);<NEW_LINE>info = (Properties) (info == null ? JdbcConnectionProperties.JDBC_CONNECTION_PROPERTIES.defaultValue() : info.clone());<NEW_LINE>Properties sensitiveInfo = (Properties) properties.get(JdbcConnectionProperties.SENSITIVE_JDBC_CONNECTION_PROPERTIES);<NEW_LINE>if (sensitiveInfo != null)<NEW_LINE>info.putAll(sensitiveInfo);<NEW_LINE>String user = (String) properties.get(AdbaSessionProperty.USER);<NEW_LINE>if (user != null)<NEW_LINE>info.setProperty("user", user);<NEW_LINE>String password = (String) properties.get(AdbaSessionProperty.PASSWORD);<NEW_LINE>if (password != null)<NEW_LINE>info.setProperty("password", password);<NEW_LINE>String url = (String) properties.get(AdbaSessionProperty.URL);<NEW_LINE>Properties p = info;<NEW_LINE>group.logger.log(Level.FINE, () -> "DriverManager.getSession(\"" + url + "\", " + p + ")");<NEW_LINE>jdbcConnection = <MASK><NEW_LINE>jdbcConnection.setAutoCommit(false);<NEW_LINE>if (sessionLifecycle == Lifecycle.ABORTING)<NEW_LINE>closeImmediate();<NEW_LINE>else<NEW_LINE>setLifecycle(Session.Lifecycle.ATTACHED);<NEW_LINE>return null;<NEW_LINE>} catch (SQLException ex) {<NEW_LINE>setLifecycle(Session.Lifecycle.CLOSED);<NEW_LINE>throw new SqlException(ex.getMessage(), ex, ex.getSQLState(), ex.getErrorCode(), null, -1);<NEW_LINE>}<NEW_LINE>}
DriverManager.getConnection(url, info);
627,479
private void BZ2File___init__(PyString inFileName, String mode, int buffering, int compresslevel) {<NEW_LINE>try {<NEW_LINE>fileName = inFileName.asString();<NEW_LINE>this.buffering = buffering;<NEW_LINE>// check universal newline mode<NEW_LINE>if (mode.contains("U")) {<NEW_LINE>inUniversalNewlineMode = true;<NEW_LINE>}<NEW_LINE>if (mode.contains("w")) {<NEW_LINE>inWriteMode = true;<NEW_LINE>File f = new File(fileName);<NEW_LINE>if (!f.exists()) {<NEW_LINE>f.createNewFile();<NEW_LINE>}<NEW_LINE>BZip2CompressorOutputStream writeStream = new BZip2CompressorOutputStream(new FileOutputStream(fileName), compresslevel);<NEW_LINE>buffer = new BinaryIOWrapper(new BufferedWriter(new SkippableStreamIO(writeStream, true), buffering));<NEW_LINE>} else {<NEW_LINE><MASK><NEW_LINE>if (!f.exists()) {<NEW_LINE>throw new FileNotFoundException();<NEW_LINE>}<NEW_LINE>inReadMode = true;<NEW_LINE>needReadBufferInit = true;<NEW_LINE>}<NEW_LINE>} catch (IOException e) {<NEW_LINE>throw Py.IOError("File " + fileName + " not found,");<NEW_LINE>}<NEW_LINE>}
File f = new File(fileName);
1,476,266
protected void onDraw(Canvas canvas) {<NEW_LINE>final int height = getHeight();<NEW_LINE>final int childCount = getChildCount();<NEW_LINE>final SlidingTabLayout.TabColorizer tabColorizer = tabColorizerCustom != null ? tabColorizerCustom : tabColorizerDefault;<NEW_LINE>if (displayUnderline) {<NEW_LINE>// Colored underline below all tabs<NEW_LINE>canvas.drawRect(0, height - underlineThickness, getWidth(), height, underlinePaint);<NEW_LINE>}<NEW_LINE>// Colored underline below the current selection<NEW_LINE>if (childCount > 0) {<NEW_LINE>View selectedTitle = getChildAt(selectedPosition);<NEW_LINE><MASK><NEW_LINE>int right = selectedTitle.getRight();<NEW_LINE>int color = tabColorizer.getIndicatorColor(selectedPosition);<NEW_LINE>if (selectionOffset > 0f && selectedPosition < (getChildCount() - 1)) {<NEW_LINE>int nextColor = tabColorizer.getIndicatorColor(selectedPosition + 1);<NEW_LINE>if (color != nextColor) {<NEW_LINE>color = blendColors(nextColor, color, selectionOffset);<NEW_LINE>}<NEW_LINE>// Draw the selection partway between the tabs<NEW_LINE>View nextTitle = getChildAt(selectedPosition + 1);<NEW_LINE>left = (int) (selectionOffset * nextTitle.getLeft() + (1.0f - selectionOffset) * left);<NEW_LINE>right = (int) (selectionOffset * nextTitle.getRight() + (1.0f - selectionOffset) * right);<NEW_LINE>}<NEW_LINE>selectedIndicatorPaint.setColor(color);<NEW_LINE>if (displayUnderline) {<NEW_LINE>canvas.drawRect(left, height - selectedIndicatorThickness - underlineThickness, right, height - underlineThickness, selectedIndicatorPaint);<NEW_LINE>} else {<NEW_LINE>canvas.drawRect(left, height - selectedIndicatorThickness, right, height, selectedIndicatorPaint);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
int left = selectedTitle.getLeft();
557,101
public boolean init(final PriorityElectionNodeOptions opts) {<NEW_LINE>if (this.started) {<NEW_LINE>LOG.info(<MASK><NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>// node options<NEW_LINE>NodeOptions nodeOpts = opts.getNodeOptions();<NEW_LINE>if (nodeOpts == null) {<NEW_LINE>nodeOpts = new NodeOptions();<NEW_LINE>}<NEW_LINE>this.fsm = new PriorityElectionOnlyStateMachine(this.listeners);<NEW_LINE>// Set the initial PriorityElectionOnlyStateMachine<NEW_LINE>nodeOpts.setFsm(this.fsm);<NEW_LINE>final Configuration initialConf = new Configuration();<NEW_LINE>if (!initialConf.parse(opts.getInitialServerAddressList())) {<NEW_LINE>throw new IllegalArgumentException("Fail to parse initConf: " + opts.getInitialServerAddressList());<NEW_LINE>}<NEW_LINE>// Set the initial cluster configuration<NEW_LINE>nodeOpts.setInitialConf(initialConf);<NEW_LINE>final String dataPath = opts.getDataPath();<NEW_LINE>try {<NEW_LINE>FileUtils.forceMkdir(new File(dataPath));<NEW_LINE>} catch (final IOException e) {<NEW_LINE>LOG.error("Fail to make dir for dataPath {}.", dataPath);<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>// Set the data path<NEW_LINE>// Log, required<NEW_LINE>nodeOpts.setLogUri(Paths.get(dataPath, "log").toString());<NEW_LINE>// Metadata, required<NEW_LINE>nodeOpts.setRaftMetaUri(Paths.get(dataPath, "meta").toString());<NEW_LINE>// nodeOpts.setSnapshotUri(Paths.get(dataPath, "snapshot").toString());<NEW_LINE>final String groupId = opts.getGroupId();<NEW_LINE>final PeerId serverId = new PeerId();<NEW_LINE>if (!serverId.parse(opts.getServerAddress())) {<NEW_LINE>throw new IllegalArgumentException("Fail to parse serverId: " + opts.getServerAddress());<NEW_LINE>}<NEW_LINE>nodeOpts.setElectionPriority(serverId.getPriority());<NEW_LINE>final RpcServer rpcServer = RaftRpcServerFactory.createRaftRpcServer(serverId.getEndpoint());<NEW_LINE>this.raftGroupService = new RaftGroupService(groupId, serverId, nodeOpts, rpcServer);<NEW_LINE>this.node = this.raftGroupService.start();<NEW_LINE>if (this.node != null) {<NEW_LINE>this.started = true;<NEW_LINE>}<NEW_LINE>return this.started;<NEW_LINE>}
"[PriorityElectionNode: {}] already started.", opts.getServerAddress());