idx int32 46 1.86M | input stringlengths 321 6.6k | target stringlengths 9 1.24k |
|---|---|---|
38,322 | public DeleteEndpointResult deleteEndpoint(DeleteEndpointRequest deleteEndpointRequest) throws AmazonServiceException, AmazonClientException {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(deleteEndpointRequest);<NEW_LINE><MASK><NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DeleteEndpointRequest> request = null;<NEW_LINE>Response<DeleteEndpointResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DeleteEndpointRequestMarshaller().marshall(deleteEndpointRequest);<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>Unmarshaller<DeleteEndpointResult, JsonUnmarshallerContext> unmarshaller = new DeleteEndpointResultJsonUnmarshaller();<NEW_LINE>JsonResponseHandler<DeleteEndpointResult> responseHandler = new JsonResponseHandler<DeleteEndpointResult>(unmarshaller);<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.ClientExecuteTime);<NEW_LINE>endClientExecution(awsRequestMetrics, request, response, LOGGING_AWS_REQUEST_METRIC);<NEW_LINE>}<NEW_LINE>} | AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); |
908,958 | private void compactIfNecessary() {<NEW_LINE>// Byte size check is needed. Otherwise, if size * 3 is small, BlockBuilder can be reallocate too often.<NEW_LINE>// Position count is needed. Otherwise, for large elements, heap will be compacted every time.<NEW_LINE>// Size instead of retained size is needed because default allocation size can be huge for some block builders. And the first check will become useless in such case.<NEW_LINE>if (heapBlockBuilder.getSizeInBytes() < COMPACT_THRESHOLD_BYTES || heapBlockBuilder.getPositionCount() / positionCount < COMPACT_THRESHOLD_RATIO) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>BlockBuilder newHeapBlockBuilder = type.createBlockBuilder(<MASK><NEW_LINE>for (int i = 0; i < positionCount; i++) {<NEW_LINE>type.appendTo(heapBlockBuilder, heapIndex[i], newHeapBlockBuilder);<NEW_LINE>heapIndex[i] = i;<NEW_LINE>}<NEW_LINE>heapBlockBuilder = newHeapBlockBuilder;<NEW_LINE>} | null, heapBlockBuilder.getPositionCount()); |
691,660 | public CexIOOpenOrders deserialize(JsonParser jp, DeserializationContext ctxt) throws IOException, JsonProcessingException {<NEW_LINE>final ObjectCodec oc = jp.getCodec();<NEW_LINE>final JsonNode openOrdersNode = oc.readTree(jp);<NEW_LINE>final JsonNode errorNode = openOrdersNode.path("error");<NEW_LINE>if (!errorNode.isMissingNode()) {<NEW_LINE>final String errorText = errorNode.asText();<NEW_LINE>if (errorText.equals("Invalid symbols pair")) {<NEW_LINE>return new CexIOOpenOrders();<NEW_LINE>} else {<NEW_LINE>throw new ExchangeException("Unable to retrieve open orders because " + errorText);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>final List<CexIOOrder> openOrders = new ArrayList<>();<NEW_LINE>if (openOrdersNode.isArray()) {<NEW_LINE>for (JsonNode openOrderNode : openOrdersNode) {<NEW_LINE>final long id = openOrderNode.<MASK><NEW_LINE>final long time = openOrderNode.path("time").asLong();<NEW_LINE>final Type type = Type.valueOf(openOrderNode.path("type").asText());<NEW_LINE>final BigDecimal price = new BigDecimal(openOrderNode.path("price").asText());<NEW_LINE>final BigDecimal amount = new BigDecimal(openOrderNode.path("amount").asText());<NEW_LINE>final BigDecimal pending = new BigDecimal(openOrderNode.path("pending").asText());<NEW_LINE>final String symbol1 = openOrderNode.path("symbol1").asText();<NEW_LINE>final String symbol2 = openOrderNode.path("symbol2").asText();<NEW_LINE>openOrders.add(new CexIOOrder(id, time, type, price, amount, pending, symbol1, symbol2, null));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return new CexIOOpenOrders(openOrders);<NEW_LINE>} | path("id").asLong(); |
1,423,458 | public GetEventResult unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>GetEventResult getEventResult = new GetEventResult();<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 getEventResult;<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("event", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>getEventResult.setEvent(EventJsonUnmarshaller.getInstance<MASK><NEW_LINE>}<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return getEventResult;<NEW_LINE>} | ().unmarshall(context)); |
215,795 | public boolean store(int spaceID, Varnode offsetValue, Varnode storedValue, int size) {<NEW_LINE>if (locked) {<NEW_LINE>throw new IllegalStateException("State is locked");<NEW_LINE>}<NEW_LINE>AddressSpace addressSpace = addrFactory.getAddressSpace(spaceID);<NEW_LINE>if (addressSpace == null) {<NEW_LINE>throw new IllegalArgumentException("Unknown spaceID");<NEW_LINE>}<NEW_LINE>if (storedValue.isConstant() && storedValue.getSize() == 0) {<NEW_LINE>// Morph unsized constant<NEW_LINE>storedValue = new Varnode(addrFactory.getConstantAddress(storedValue.getOffset()), size);<NEW_LINE>} else if (size != storedValue.getSize()) {<NEW_LINE>throw new IllegalArgumentException("storeValue size mismatch");<NEW_LINE>}<NEW_LINE>cachedLocation = null;<NEW_LINE>cachedValue = null;<NEW_LINE>if (offsetValue.isConstant()) {<NEW_LINE>try {<NEW_LINE>Address addr = addressSpace.getAddress(offsetValue.getOffset(), true);<NEW_LINE>store(new Varnode(addr, size), storedValue);<NEW_LINE>return true;<NEW_LINE>} catch (AddressOutOfBoundsException e) {<NEW_LINE>}<NEW_LINE>// TODO: what should we invalidate ?<NEW_LINE>if (DEBUG)<NEW_LINE>Msg.debug(this, " Store failed: spaceID=" + spaceID + ", offsetValue: " + offsetValue.getOffset());<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>// Handle relative offsets (limited support)<NEW_LINE>FrameNode <MASK><NEW_LINE>if (frameNode == null) {<NEW_LINE>// TODO: what should we invalidate ?<NEW_LINE>if (DEBUG)<NEW_LINE>Msg.debug(this, " Store failed: spaceID=" + spaceID + ", offsetValue: " + offsetValue.toString(language));<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>if (debugVarnode == null || frameNode.framePointer.equals(debugVarnode)) {<NEW_LINE>if (DEBUG)<NEW_LINE>Msg.debug(this, " Store: " + frameNode + " <- " + storedValue.toString(language));<NEW_LINE>}<NEW_LINE>// TODO: Frame reference callback (write) ??<NEW_LINE>String frameMapName = getFrameMapName(addressSpace.getName(), frameNode.framePointer);<NEW_LINE>HashMap<Long, Varnode> frameMap = getFrameMap(frameMapName, true);<NEW_LINE>if (size == 1) {<NEW_LINE>frameMap.put(frameNode.frameOffset, storedValue);<NEW_LINE>} else {<NEW_LINE>long baseOffset = frameNode.frameOffset;<NEW_LINE>for (int i = 0; i < size; i++) {<NEW_LINE>Varnode byteValue = getVarnodeByte(storedValue, i);<NEW_LINE>long byteOffset = language.isBigEndian() ? (size - i - 1) : i;<NEW_LINE>frameMap.put(baseOffset + byteOffset, byteValue);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>} | frameNode = getFrameNode(offsetValue, language); |
1,309,772 | public AuditMitigationActionsTaskMetadata unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>AuditMitigationActionsTaskMetadata auditMitigationActionsTaskMetadata = new AuditMitigationActionsTaskMetadata();<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("taskId", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>auditMitigationActionsTaskMetadata.setTaskId(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("startTime", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>auditMitigationActionsTaskMetadata.setStartTime(DateJsonUnmarshallerFactory.getInstance("unixTimestamp").unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("taskStatus", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>auditMitigationActionsTaskMetadata.setTaskStatus(context.getUnmarshaller(String.<MASK><NEW_LINE>}<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return auditMitigationActionsTaskMetadata;<NEW_LINE>} | class).unmarshall(context)); |
833,359 | public void deletePartition(ImmutableMappingInfo.ImmutableIndexInfo indexInfo, IndexShard indexShard) throws IOException {<NEW_LINE>if (logger.isTraceEnabled())<NEW_LINE>logger.trace("deleting documents where _routing={} from index.type={}.{}", this.partitionKey, indexShard.shardId().getIndexName(), typeName);<NEW_LINE>Query termQuery;<NEW_LINE>if (baseCfs.metadata.partitionKeyColumns().size() == 1) {<NEW_LINE>String ptName = baseCfs.metadata.partitionKeyColumns().get(0).name.toString();<NEW_LINE>int mapperIdx = indexInfo.indexOf(ptName);<NEW_LINE>FieldMapper ptMapper = (<MASK><NEW_LINE>termQuery = ptMapper.fieldType().termQuery(this.pkCols[0], null);<NEW_LINE>} else {<NEW_LINE>termQuery = new TermQuery(new Term(RoutingFieldMapper.NAME, this.partitionKey));<NEW_LINE>}<NEW_LINE>DeleteByQuery deleteByQuery = buildDeleteByQuery(indexShard.indexService(), termQuery);<NEW_LINE>indexShard.getEngine().delete(deleteByQuery);<NEW_LINE>} | FieldMapper) indexInfo.mappers[mapperIdx]; |
1,335,912 | public void visitUnary(JCTree.JCUnary tree) {<NEW_LINE>super.visitUnary(tree);<NEW_LINE>if (_tp.isGenerate() && !shouldProcessForGeneration()) {<NEW_LINE>// Don't process tree during GENERATE, unless the tree was generated e.g., a bridge method<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>Symbol op = IDynamicJdk.instance().getOperator(tree);<NEW_LINE>boolean isOverload = op instanceof OverloadOperatorSymbol;<NEW_LINE>TreeMaker make = _tp.getTreeMaker();<NEW_LINE>if (!(op instanceof Symbol.MethodSymbol)) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// Handle operator overload expressions<NEW_LINE>Symbol.MethodSymbol operatorMethod = (Symbol.MethodSymbol) op;<NEW_LINE>while (operatorMethod instanceof OverloadOperatorSymbol) {<NEW_LINE>operatorMethod = ((OverloadOperatorSymbol) operatorMethod).getMethod();<NEW_LINE>}<NEW_LINE>if (isOverload && operatorMethod != null && tree.getTag() == JCTree.Tag.NEG) {<NEW_LINE>genUnaryMinus(tree, make, operatorMethod);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if ((isOverload && operatorMethod != null) || (tree.arg instanceof JCTree.JCArrayAccess && !_tp.getTypes().isArray(((JCTree.JCArrayAccess) tree.arg).indexed.type))) {<NEW_LINE>switch(tree.getTag()) {<NEW_LINE>case PREINC:<NEW_LINE>case PREDEC:<NEW_LINE>case POSTINC:<NEW_LINE>case POSTDEC:<NEW_LINE>genUnaryIncDec(tree, make, isOverload ? operatorMethod : null);<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>throw new IllegalStateException();<NEW_LINE>}<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (isJailbreakReceiver(tree)) {<NEW_LINE>Tree.Kind kind = tree.getKind();<NEW_LINE>if (kind == Tree.Kind.POSTFIX_INCREMENT || kind == Tree.Kind.POSTFIX_DECREMENT || kind == Tree.Kind.PREFIX_INCREMENT || kind == Tree.Kind.PREFIX_DECREMENT) {<NEW_LINE>// ++, -- operators not supported with jailbreak access to fields, only direct assignment<NEW_LINE>_tp.report(tree, Diagnostic.Kind.ERROR, <MASK><NEW_LINE>Types types = Types.instance(((BasicJavacTask) _tp.getJavacTask()).getContext());<NEW_LINE>tree.type = types.createErrorType(tree.type);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>result = tree;<NEW_LINE>} | ExtIssueMsg.MSG_INCREMENT_OP_NOT_ALLOWED_REFLECTION.get()); |
1,606,184 | public ApiResponse<Void> usersChangeSubUserPasswordWithHttpInfo(String id, String password) throws ApiException {<NEW_LINE>Object localVarPostBody = password;<NEW_LINE>// verify the required parameter 'id' is set<NEW_LINE>if (id == null) {<NEW_LINE>throw new ApiException(400, "Missing the required parameter 'id' when calling usersChangeSubUserPassword");<NEW_LINE>}<NEW_LINE>// verify the required parameter 'password' is set<NEW_LINE>if (password == null) {<NEW_LINE>throw new ApiException(400, "Missing the required parameter 'password' when calling usersChangeSubUserPassword");<NEW_LINE>}<NEW_LINE>// create path and map variables<NEW_LINE>String localVarPath = "/v4/users/{id}/password".replaceAll("\\{" + "id" + "\\}", apiClient.escapeString(id.toString()));<NEW_LINE>// query params<NEW_LINE>List<Pair> localVarQueryParams <MASK><NEW_LINE>Map<String, String> localVarHeaderParams = new HashMap<String, String>();<NEW_LINE>Map<String, Object> localVarFormParams = new HashMap<String, Object>();<NEW_LINE>final String[] localVarAccepts = {};<NEW_LINE>final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);<NEW_LINE>final String[] localVarContentTypes = { "application/json", "text/json" };<NEW_LINE>final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);<NEW_LINE>String[] localVarAuthNames = new String[] { "oauth2" };<NEW_LINE>return apiClient.invokeAPI(localVarPath, "PUT", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, null);<NEW_LINE>} | = new ArrayList<Pair>(); |
1,331,107 | private ExperimentRun filteredDatasetsBasedOnPrivileges(Set<String> accessibleDatasetVersionIdsSet, Set<String> notAccessibleDatasetVersionIdsSet, ExperimentRun experimentRun) {<NEW_LINE>List<Artifact> accessibleDatasetVersions = new ArrayList<>();<NEW_LINE>for (Artifact dataset : experimentRun.getDatasetsList()) {<NEW_LINE>if (!dataset.getLinkedArtifactId().isEmpty()) {<NEW_LINE>if (accessibleDatasetVersionIdsSet.contains(dataset.getLinkedArtifactId())) {<NEW_LINE>accessibleDatasetVersions.add(dataset);<NEW_LINE>} else if (notAccessibleDatasetVersionIdsSet.contains(dataset.getLinkedArtifactId())) {<NEW_LINE>notAccessibleDatasetVersionIdsSet.add(dataset.getLinkedArtifactId());<NEW_LINE>} else {<NEW_LINE>try {<NEW_LINE>commitDAO.getDatasetVersionById(repositoryDAO, blobDAO, metadataDAO, dataset.getLinkedArtifactId());<NEW_LINE>accessibleDatasetVersionIdsSet.<MASK><NEW_LINE>accessibleDatasetVersions.add(dataset);<NEW_LINE>} catch (Exception ex) {<NEW_LINE>LOGGER.debug(ex.getMessage());<NEW_LINE>notAccessibleDatasetVersionIdsSet.add(dataset.getLinkedArtifactId());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>accessibleDatasetVersions.add(dataset);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>experimentRun = experimentRun.toBuilder().clearDatasets().addAllDatasets(accessibleDatasetVersions).build();<NEW_LINE>return experimentRun;<NEW_LINE>} | add(dataset.getLinkedArtifactId()); |
836,106 | private static SQLTableSource unwrapAlias(SchemaResolveVisitor.Context ctx, SQLTableSource tableSource, long identHash) {<NEW_LINE>if (ctx == null) {<NEW_LINE>return tableSource;<NEW_LINE>}<NEW_LINE>if (ctx.object instanceof SQLDeleteStatement && (ctx.getTableSource() == null || tableSource == ctx.getTableSource()) && ctx.getFrom() != null) {<NEW_LINE>SQLTableSource found = ctx.getFrom().findTableSource(identHash);<NEW_LINE>if (found != null) {<NEW_LINE>return found;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>for (SchemaResolveVisitor.Context parentCtx = ctx; parentCtx != null; parentCtx = parentCtx.parent) {<NEW_LINE>SQLWithSubqueryClause with = null;<NEW_LINE>if (parentCtx.object instanceof SQLSelect) {<NEW_LINE>SQLSelect select = (SQLSelect) parentCtx.object;<NEW_LINE>with = select.getWithSubQuery();<NEW_LINE>} else if (parentCtx.object instanceof SQLDeleteStatement) {<NEW_LINE>SQLDeleteStatement delete = (SQLDeleteStatement) parentCtx.object;<NEW_LINE>with = delete.getWith();<NEW_LINE>} else if (parentCtx.object instanceof SQLInsertStatement) {<NEW_LINE>SQLInsertStatement <MASK><NEW_LINE>with = insertStmt.getWith();<NEW_LINE>} else if (parentCtx.object instanceof SQLUpdateStatement) {<NEW_LINE>SQLUpdateStatement updateStmt = (SQLUpdateStatement) parentCtx.object;<NEW_LINE>with = updateStmt.getWith();<NEW_LINE>}<NEW_LINE>if (with != null) {<NEW_LINE>SQLWithSubqueryClause.Entry entry = with.findEntry(identHash);<NEW_LINE>if (entry != null) {<NEW_LINE>return entry;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return tableSource;<NEW_LINE>} | insertStmt = (SQLInsertStatement) parentCtx.object; |
830,723 | public Void execute(CommandContext commandContext) {<NEW_LINE>ensureNotNull(<MASK><NEW_LINE>JobDefinitionEntity jobDefinition = commandContext.getJobDefinitionManager().findById(jobDefinitionId);<NEW_LINE>ensureNotNull(NotFoundException.class, "Job definition with id '" + jobDefinitionId + "' does not exist", "jobDefinition", jobDefinition);<NEW_LINE>checkUpdateProcess(commandContext, jobDefinition);<NEW_LINE>Long currentPriority = jobDefinition.getOverridingJobPriority();<NEW_LINE>jobDefinition.setJobPriority(priority);<NEW_LINE>UserOperationLogContext opLogContext = new UserOperationLogContext();<NEW_LINE>createJobDefinitionOperationLogEntry(opLogContext, currentPriority, jobDefinition);<NEW_LINE>if (cascade && priority != null) {<NEW_LINE>commandContext.getJobManager().updateJobPriorityByDefinitionId(jobDefinitionId, priority);<NEW_LINE>createCascadeJobsOperationLogEntry(opLogContext, jobDefinition);<NEW_LINE>}<NEW_LINE>commandContext.getOperationLogManager().logUserOperations(opLogContext);<NEW_LINE>return null;<NEW_LINE>} | NotValidException.class, "jobDefinitionId", jobDefinitionId); |
1,182,871 | public static ComplexNumber divide(ComplexNumber z1, ComplexNumber z2) {<NEW_LINE>ArgChecker.notNull(z1, "z1");<NEW_LINE>ArgChecker.notNull(z2, "z2");<NEW_LINE><MASK><NEW_LINE>double b = z1.getImaginary();<NEW_LINE>double c = z2.getReal();<NEW_LINE>double d = z2.getImaginary();<NEW_LINE>if (Math.abs(c) > Math.abs(d)) {<NEW_LINE>double dOverC = d / c;<NEW_LINE>double denom = c + d * dOverC;<NEW_LINE>return new ComplexNumber((a + b * dOverC) / denom, (b - a * dOverC) / denom);<NEW_LINE>}<NEW_LINE>double cOverD = c / d;<NEW_LINE>double denom = c * cOverD + d;<NEW_LINE>return new ComplexNumber((a * cOverD + b) / denom, (b * cOverD - a) / denom);<NEW_LINE>} | double a = z1.getReal(); |
867,948 | public void handle(GameEvent event) {<NEW_LINE>DebugCommandEvent e = (DebugCommandEvent) event;<NEW_LINE>if (e.getName().equals("objInfo")) {<NEW_LINE>World world = GameServer.INSTANCE.getGameUniverse().getWorld(e.getInt("worldX"), e.getInt("worldY"), false, e.getString("dimension"));<NEW_LINE>try {<NEW_LINE>Collection<GameObject> objs = world.getGameObjects();<NEW_LINE>String str = objs.size() + "\n";<NEW_LINE>for (GameObject obj : objs) {<NEW_LINE>if (obj.isAt(e.getInt("x"), e.getInt("y")) || (obj.getX() == e.getInt("x") && obj.getY() == e.getInt("y"))) {<NEW_LINE>str += "Mongo:" + obj.mongoSerialise() + "\n";<NEW_LINE>str += "JSON :" + obj.jsonSerialise().toJSONString() + "\n\n";<NEW_LINE>}<NEW_LINE>}<NEW_LINE>e.reply(str);<NEW_LINE>} catch (Exception ex) {<NEW_LINE><MASK><NEW_LINE>message += "\n " + Arrays.toString(ex.getStackTrace()).replaceAll(", ", "\n");<NEW_LINE>e.reply(message);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | String message = ex.getMessage(); |
1,025,547 | public static void generateTargetGroupFiles(Map<String, List<TargetGroupVH>> targetGrpMap) throws IOException {<NEW_LINE>String fieldNames;<NEW_LINE>String keys;<NEW_LINE>fieldNames = "trgtGrp.TargetGroupArn`trgtGrp.TargetGroupName`trgtGrp.vpcid`trgtGrp.protocol`trgtGrp.port`trgtGrp.HealthyThresholdCount`trgtGrp.UnhealthyThresholdCount`trgtGrp.HealthCheckIntervalSeconds`trgtGrp.HealthCheckTimeoutSeconds`trgtGrp.LoadBalancerArns";<NEW_LINE>keys = "discoverydate`accountid`accountname`region`targetgrouparn`targetgroupname`vpcid`protocol`port`healthythresholdcount`unhealthythresholdcount`healthcheckintervalseconds`healthchecktimeoutseconds`loadbalancerarns";<NEW_LINE>FileGenerator.generateJson(targetGrpMap, fieldNames, "aws-targetgroup.data", keys);<NEW_LINE>fieldNames = "trgtGrp.TargetGroupName`targets.target.id";<NEW_LINE>keys = "discoverydate`accountid`accountname`region`targetgrouparn`targetgroupid";<NEW_LINE>FileGenerator.generateJson(targetGrpMap, fieldNames, "aws-targetgroup-instances.data", keys);<NEW_LINE>Map<String, List<LoadBalancerVH>> appElbInstanceMap = new HashMap<>();<NEW_LINE>Iterator<Entry<String, List<TargetGroupVH>>> it = targetGrpMap<MASK><NEW_LINE>while (it.hasNext()) {<NEW_LINE>Entry<String, List<TargetGroupVH>> entry = it.next();<NEW_LINE>String accntId = entry.getKey();<NEW_LINE>List<TargetGroupVH> trgtList = entry.getValue();<NEW_LINE>appElbInstanceMap.putIfAbsent(accntId, new ArrayList<LoadBalancerVH>());<NEW_LINE>for (TargetGroupVH trgtGrp : trgtList) {<NEW_LINE>List<String> elbList = trgtGrp.getTrgtGrp().getLoadBalancerArns();<NEW_LINE>for (String elbarn : elbList) {<NEW_LINE>LoadBalancer elb = new LoadBalancer();<NEW_LINE>elb.setLoadBalancerArn(elbarn);<NEW_LINE>Matcher appMatcher = Pattern.compile("(?<=loadbalancer/(app|net)/)(.*)(?=/)").matcher(elbarn);<NEW_LINE>if (appMatcher.find()) {<NEW_LINE>elb.setLoadBalancerName(appMatcher.group());<NEW_LINE>LoadBalancerVH elbVH = new LoadBalancerVH(elb);<NEW_LINE>List<com.amazonaws.services.elasticloadbalancing.model.Instance> instances = new ArrayList<>();<NEW_LINE>elbVH.setInstances(instances);<NEW_LINE>trgtGrp.getTargets().forEach(trgtHealth -> {<NEW_LINE>instances.add(new com.amazonaws.services.elasticloadbalancing.model.Instance(trgtHealth.getTarget().getId()));<NEW_LINE>});<NEW_LINE>appElbInstanceMap.get(accntId).add(elbVH);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>fieldNames = "lb.LoadBalancerName`Instances.InstanceId";<NEW_LINE>keys = "discoverydate`accountid`accountname`region`loadbalancername`instanceid";<NEW_LINE>FileGenerator.generateJson(appElbInstanceMap, fieldNames, "aws-appelb-instances.data", keys);<NEW_LINE>} | .entrySet().iterator(); |
1,042,591 | public String extractParameter(ServletRequestImpl request) {<NEW_LINE>String queryString = request.getQueryString();<NEW_LINE>final <MASK><NEW_LINE>try {<NEW_LINE>final Map<String, String> queryPairs = splitQuery(queryString);<NEW_LINE>for (Map.Entry<String, String> attrs : queryPairs.entrySet()) {<NEW_LINE>if (params.length() != 0) {<NEW_LINE>params.append('&');<NEW_LINE>}<NEW_LINE>// skip appending parameters if parameter size is bigger than<NEW_LINE>// totalLimit<NEW_LINE>if (params.length() > totalLimit) {<NEW_LINE>params.append("...");<NEW_LINE>return params.toString();<NEW_LINE>}<NEW_LINE>final String key = attrs.getKey();<NEW_LINE>params.append(StringUtils.abbreviate(key, eachLimit));<NEW_LINE>params.append('=');<NEW_LINE>final String value = attrs.getValue();<NEW_LINE>if (value != null) {<NEW_LINE>params.append(StringUtils.abbreviate(StringUtils.toString(value), eachLimit));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (UnsupportedEncodingException ignore) {<NEW_LINE>// ignore<NEW_LINE>}<NEW_LINE>return params.toString();<NEW_LINE>} | StringBuilder params = new StringBuilder(64); |
631,183 | public void deserialize(ByteBuf buf) {<NEW_LINE>super.deserialize(buf);<NEW_LINE>int elemNum = buf.readInt();<NEW_LINE>if (rowType == RowType.T_FLOAT_DENSE_COMPONENT) {<NEW_LINE>float[] values = new float[elemNum];<NEW_LINE>for (int i = 0; i < elemNum; i++) {<NEW_LINE>values[i] = buf.readFloat();<NEW_LINE>}<NEW_LINE>vector = VFactory.denseFloatVector(values);<NEW_LINE>} else if (rowType == RowType.T_FLOAT_SPARSE_COMPONENT) {<NEW_LINE>vector = VFactory.sparseFloatVector((int) (splitContext.getPartKey().getEndCol() - splitContext.getPartKey().getStartCol()), elemNum);<NEW_LINE>for (int i = 0; i < elemNum; i++) {<NEW_LINE>((IntFloatVector) vector).set(buf.readInt(), buf.readFloat());<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>} | throw new UnsupportedOperationException("Unsupport rowtype " + rowType); |
1,388,207 | public void start() {<NEW_LINE>if (current != null) {<NEW_LINE>current.show();<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>Form hi = new Form("Hi World", new BorderLayout());<NEW_LINE>Tabs tabs = new Tabs();<NEW_LINE>Container tab1Contents = new Container();<NEW_LINE>tab1Contents.setLayout(BoxLayout.y());<NEW_LINE>tab1Contents.setScrollableY(true);<NEW_LINE>Button openDialog = new Button("Open Dialog");<NEW_LINE>openDialog.addActionListener(evt -> {<NEW_LINE>Dialog.show("Test Dialog", "Test", "OK", null);<NEW_LINE>});<NEW_LINE>tab1Contents.add(openDialog);<NEW_LINE>tab1Contents.setSafeArea(true);<NEW_LINE>String[] names = new String[] { "John", "Mary", "Joseph", "Solomon", "Jan", "Judy", "Patricia", "Ron", "Harry" };<NEW_LINE>String[] positions = new String[<MASK><NEW_LINE>int len = names.length;<NEW_LINE>for (int i = 0; i < len; i++) {<NEW_LINE>MultiButton btn = new MultiButton(names[i]);<NEW_LINE>btn.setTextLine2(positions[i % positions.length]);<NEW_LINE>tab1Contents.add(btn);<NEW_LINE>}<NEW_LINE>Container tab2Contents = new Container();<NEW_LINE>tab2Contents.setLayout(BoxLayout.y());<NEW_LINE>tab2Contents.setScrollableY(true);<NEW_LINE>for (int i = 0; i < len; i++) {<NEW_LINE>MultiButton btn = new MultiButton(names[i]);<NEW_LINE>btn.setTextLine2(positions[i % positions.length]);<NEW_LINE>tab2Contents.add(btn);<NEW_LINE>}<NEW_LINE>String description = "This Demo shows the use of safeArea to ensure that a container's children are not covered by the notch on iPhone X. You should run this demo using the iPhone X skin or iPhone X device to see the difference.\n\n" + "The Safe tab uses setSafeArea(true) to ensure that the children are not affected by the notch. The unsafe tab is not. \n\n" + "You'll need to use landscape mode to see the difference because the notch will be on the left or right in that case.";<NEW_LINE>SpanLabel spanLabel = new SpanLabel(description);<NEW_LINE>spanLabel.setSafeArea(true);<NEW_LINE>tabs.addTab("Description", spanLabel);<NEW_LINE>tabs.addTab("Safe Tab", tab1Contents);<NEW_LINE>tabs.addTab("Unsafe Tab", tab2Contents);<NEW_LINE>hi.add(BorderLayout.CENTER, tabs);<NEW_LINE>hi.show();<NEW_LINE>} | ] { "Wizard", "Judge", "Doctor" }; |
591,326 | protected MQTT_IOClient doCreateIoClient() throws Exception {<NEW_LINE>String host = agent.getHost().orElse(null);<NEW_LINE>int port = agent.getPort().orElseGet(() -> {<NEW_LINE>if (agent.isSecureMode().orElse(false)) {<NEW_LINE>return agent.isWebsocketMode().orElse(false) ? 443 : 8883;<NEW_LINE>} else {<NEW_LINE>return agent.isWebsocketMode().orElse(false) ? 80 : 1883;<NEW_LINE>}<NEW_LINE>});<NEW_LINE>URI websocketURI = null;<NEW_LINE>if (agent.isWebsocketMode().orElse(false)) {<NEW_LINE>URIBuilder builder = new URIBuilder().setHost(host).setPort(port);<NEW_LINE>agent.getWebsocketPath(<MASK><NEW_LINE>agent.getWebsocketQuery().map(query -> query.startsWith("?") ? query.substring(1) : query).ifPresent(builder::setCustomQuery);<NEW_LINE>websocketURI = builder.build();<NEW_LINE>}<NEW_LINE>return new MQTT_IOClient(agent.getClientId().orElseGet(UniqueIdentifierGenerator::generateId), host, port, agent.isSecureMode().orElse(false), !agent.isResumeSession().orElse(false), agent.getUsernamePassword().orElse(null), websocketURI);<NEW_LINE>} | ).ifPresent(builder::setPath); |
1,550,560 | private void loadFlags() throws SQLException {<NEW_LINE>Closer closer = Closer.create();<NEW_LINE>try {<NEW_LINE>PreparedStatement stmt = closer.register(conn.prepareStatement("SELECT region_id, flag, value " + "FROM " + config.getTablePrefix() + "region_flag " + "WHERE world_id = " + worldId + " AND region_id IN " + "(SELECT id FROM " + config.getTablePrefix() + "region " <MASK><NEW_LINE>ResultSet rs = closer.register(stmt.executeQuery());<NEW_LINE>Table<String, String, Object> data = HashBasedTable.create();<NEW_LINE>while (rs.next()) {<NEW_LINE>data.put(rs.getString("region_id"), rs.getString("flag"), unmarshalFlagValue(rs.getString("value")));<NEW_LINE>}<NEW_LINE>for (Entry<String, Map<String, Object>> entry : data.rowMap().entrySet()) {<NEW_LINE>ProtectedRegion region = loaded.get(entry.getKey());<NEW_LINE>region.setFlags(flagRegistry.unmarshal(entry.getValue(), true));<NEW_LINE>}<NEW_LINE>} finally {<NEW_LINE>closer.closeQuietly();<NEW_LINE>}<NEW_LINE>} | + "WHERE world_id = " + worldId + ")")); |
1,718,046 | public Object indexValueStrProp(List<Object> parameters, String lastParam, String props, Map<String, String> map, List<String> oldKeys, List<String> oldKeysNormalized) throws ParserException {<NEW_LINE>String value = "";<NEW_LINE>Object retval = null;<NEW_LINE>String delim = ";";<NEW_LINE>int minParams = 2;<NEW_LINE>int maxParams = minParams + 1;<NEW_LINE>checkVaryingParameters("indexValueStrProp()", minParams, maxParams, parameters, new Class[] { String<MASK><NEW_LINE>if (parameters.size() == maxParams)<NEW_LINE>delim = lastParam;<NEW_LINE>parse(props, map, oldKeys, oldKeysNormalized, delim);<NEW_LINE>int index = ((BigDecimal) parameters.get(1)).intValue();<NEW_LINE>if (index < 0 || index >= oldKeys.size()) {<NEW_LINE>value = "";<NEW_LINE>} else {<NEW_LINE>value = map.get(oldKeys.get(index).toUpperCase());<NEW_LINE>}<NEW_LINE>if (value != null) {<NEW_LINE>try {<NEW_LINE>// convert to numeric value if possible<NEW_LINE>Integer intval = Integer.decode(value);<NEW_LINE>retval = new BigDecimal(intval);<NEW_LINE>} catch (Exception e) {<NEW_LINE>retval = value;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return retval;<NEW_LINE>} | .class, BigDecimal.class }); |
575,908 | public void extend(Value v, long duration) {<NEW_LINE>if (v.getWidth() != info.getWidth())<NEW_LINE>System.out.printf("*** notice: value width mismatch for %s: width=%d bits, newVal=%s (%d bits)\n", info, info.getWidth(), v, v.getWidth());<NEW_LINE>if (last != null && last.equals(v)) {<NEW_LINE>final var i = (firstIndex + curSize - 1) % curSize;<NEW_LINE>dur[i / CHUNK][i % CHUNK] += duration;<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>last = v;<NEW_LINE>final var c = val.length;<NEW_LINE>final var cap = CHUNK * (c - 1) + val[c - 1].length;<NEW_LINE>if (curSize < cap) {<NEW_LINE>// fits in an existing chunk<NEW_LINE>val[curSize / CHUNK<MASK><NEW_LINE>dur[curSize / CHUNK][curSize % CHUNK] = duration;<NEW_LINE>curSize++;<NEW_LINE>} else if (curSize < maxSize || maxSize <= 0) {<NEW_LINE>// allocate another chunk<NEW_LINE>final var val2 = new Value[c + 1][];<NEW_LINE>final var dur2 = new long[c + 1][];<NEW_LINE>System.arraycopy(val, 0, val2, 0, c);<NEW_LINE>System.arraycopy(dur, 0, dur2, 0, c);<NEW_LINE>val2[c + 1] = new Value[maxSize == 0 || (maxSize - cap) > CHUNK ? CHUNK : (maxSize - cap)];<NEW_LINE>dur2[c + 1] = new long[maxSize == 0 || (maxSize - cap) > CHUNK ? CHUNK : (maxSize - cap)];<NEW_LINE>val = val2;<NEW_LINE>dur = dur2;<NEW_LINE>val[curSize / CHUNK][curSize % CHUNK] = v;<NEW_LINE>dur[curSize / CHUNK][curSize % CHUNK] = duration;<NEW_LINE>curSize++;<NEW_LINE>} else {<NEW_LINE>// limited size is filled, wrap around, and adjust start offset<NEW_LINE>timeStart += dur[firstIndex / CHUNK][firstIndex % CHUNK];<NEW_LINE>val[firstIndex / CHUNK][firstIndex % CHUNK] = v;<NEW_LINE>dur[firstIndex / CHUNK][firstIndex % CHUNK] = duration;<NEW_LINE>firstIndex++;<NEW_LINE>if (firstIndex >= maxSize)<NEW_LINE>firstIndex = 0;<NEW_LINE>}<NEW_LINE>} | ][curSize % CHUNK] = v; |
890,934 | private void addDerivedTypes() {<NEW_LINE>Iterator<DefinedType> typeIter = schema.getTypes().iterator();<NEW_LINE>while (typeIter.hasNext()) {<NEW_LINE>DefinedType type = typeIter.next();<NEW_LINE>// debug (type.getName()+":"+type.getDomain(true).toString());<NEW_LINE>// if ((type.getDomain() instanceof SimpleType)==false &&<NEW_LINE>// (type instanceof EnumerationType)==false &&<NEW_LINE>// (type instanceof SelectType)==false){<NEW_LINE>if (type.getName().equalsIgnoreCase("IfcCompoundPlaneAngleMeasure")) {<NEW_LINE>EClass testType = getOrCreateEClass(type.getName());<NEW_LINE>DefinedType type2 = new DefinedType("Integer");<NEW_LINE>type2.setDomain(new IntegerType());<NEW_LINE>modifySimpleType(type2, testType);<NEW_LINE>testType.getEAnnotations().add(createWrappedAnnotation());<NEW_LINE>} else if (type.getDomain() instanceof DefinedType) {<NEW_LINE>if (schemaPack.getEClassifier(type.getName()) != null) {<NEW_LINE>EClass testType = (EClass) schemaPack.<MASK><NEW_LINE>DefinedType domain = (DefinedType) type.getDomain();<NEW_LINE>EClassifier classifier = schemaPack.getEClassifier(domain.getName());<NEW_LINE>testType.getESuperTypes().add((EClass) classifier);<NEW_LINE>testType.setInstanceClass(classifier.getInstanceClass());<NEW_LINE>} else {<NEW_LINE>EClass testType = getOrCreateEClass(type.getName());<NEW_LINE>DefinedType domain = (DefinedType) type.getDomain();<NEW_LINE>if (simpleTypeReplacementMap.containsKey(domain.getName())) {<NEW_LINE>// We can't subclass because it's a 'primitive' type<NEW_LINE>simpleTypeReplacementMap.put(type.getName(), simpleTypeReplacementMap.get(domain.getName()));<NEW_LINE>} else {<NEW_LINE>EClass classifier = getOrCreateEClass(domain.getName());<NEW_LINE>testType.getESuperTypes().add((EClass) classifier);<NEW_LINE>if (classifier.getEAnnotation("wrapped") != null) {<NEW_LINE>testType.getEAnnotations().add(createWrappedAnnotation());<NEW_LINE>}<NEW_LINE>testType.setInstanceClass(classifier.getInstanceClass());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | getEClassifier(type.getName()); |
949,436 | public Void call() throws Exception {<NEW_LINE>AlluxioURI toPersist = mFilesToPersist.poll();<NEW_LINE>while (toPersist != null) {<NEW_LINE>try {<NEW_LINE>FileSystemUtils.persistAndWait(mFileSystem, toPersist, mPersistenceWaitTime, mTimeoutMs);<NEW_LINE>synchronized (mProgressLock) {<NEW_LINE>// Prevents out of order progress tracking.<NEW_LINE>String progress = "(" + mCompletedFiles.incrementAndGet() + "/" + mTotalFiles + ")";<NEW_LINE>System.out.println(progress + " Successfully persisted file: " + toPersist);<NEW_LINE>}<NEW_LINE>} catch (InterruptedException e) {<NEW_LINE>Thread.currentThread().interrupt();<NEW_LINE>LOG.warn("Interrupted while waiting for persistence ", e);<NEW_LINE>throw e;<NEW_LINE>} catch (TimeoutException e) {<NEW_LINE>String timeoutMsg = String.format("Timed out waiting for file to be persisted: %s", toPersist);<NEW_LINE>System.out.println(timeoutMsg);<NEW_LINE>LOG.error(timeoutMsg, e);<NEW_LINE>} catch (Exception e) {<NEW_LINE>System.<MASK><NEW_LINE>LOG.error("Failed to persist file {}", toPersist, e);<NEW_LINE>}<NEW_LINE>toPersist = mFilesToPersist.poll();<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>} | out.println("Failed to persist file " + toPersist); |
955,854 | public void testJSAD_Receive_Message_P2PTest(HttpServletRequest request, HttpServletResponse response) throws Exception {<NEW_LINE>boolean testFailed = false;<NEW_LINE>QueueConnectionFactory cf1 = (QueueConnectionFactory) new InitialContext().lookup("java:comp/env/jndi_JMS_BASE_QCF");<NEW_LINE>QueueConnection con = cf1.createQueueConnection();<NEW_LINE>con.start();<NEW_LINE>QueueSession sessionSender = con.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);<NEW_LINE>Queue <MASK><NEW_LINE>emptyQueue(cf1, queue);<NEW_LINE>QueueSender send = sessionSender.createSender(queue);<NEW_LINE>String outbound = "Hello World from testJSAD_Receive_Message_P2PTest";<NEW_LINE>send.setDeliveryDelay(1000);<NEW_LINE>send.send(sessionSender.createTextMessage(outbound));<NEW_LINE>Queue queue1 = sessionSender.createQueue("alias2Q1");<NEW_LINE>QueueReceiver rec = sessionSender.createReceiver(queue1);<NEW_LINE>TextMessage receiveMsg = (TextMessage) rec.receive(30000);<NEW_LINE>String inbound = receiveMsg.getText();<NEW_LINE>if (!outbound.equals(inbound)) {<NEW_LINE>testFailed = true;<NEW_LINE>}<NEW_LINE>sessionSender.close();<NEW_LINE>con.close();<NEW_LINE>if (testFailed) {<NEW_LINE>throw new Exception("testJSAD_Receive_Message_P2PTest failed");<NEW_LINE>}<NEW_LINE>} | queue = sessionSender.createQueue("QUEUE1"); |
41,723 | public void unlockResourcesOfServer(final ODatabaseDocumentInternal database, final String serverName) {<NEW_LINE>final int nodeLeftId = manager.getNodeIdByName(serverName);<NEW_LINE>final Iterator<ODistributedTxContext> pendingReqIterator = activeTxContexts<MASK><NEW_LINE>while (pendingReqIterator.hasNext()) {<NEW_LINE>final ODistributedTxContext pReq = pendingReqIterator.next();<NEW_LINE>if (pReq != null && pReq.getReqId().getNodeId() == nodeLeftId) {<NEW_LINE>ODistributedServerLog.debug(this, manager.getLocalNodeName(), null, DIRECTION.NONE, "Distributed transaction: rolling back transaction (req=%s)", pReq.getReqId());<NEW_LINE>try {<NEW_LINE>pReq.rollback(database);<NEW_LINE>pReq.destroy();<NEW_LINE>} catch (Exception | Error t) {<NEW_LINE>// IGNORE IT<NEW_LINE>ODistributedServerLog.error(this, manager.getLocalNodeName(), null, DIRECTION.NONE, "Distributed transaction: error on rolling back transaction (req=%s)", pReq.getReqId());<NEW_LINE>}<NEW_LINE>pendingReqIterator.remove();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | .values().iterator(); |
1,843,841 | protected void makeActions() {<NEW_LINE>fClipboard = new Clipboard(fShell.getDisplay());<NEW_LINE>ISharedImages images = PlatformUI.getWorkbench().getSharedImages();<NEW_LINE>fPasteAction = new FileSystemPasteAction(fShell, fClipboard);<NEW_LINE>fPasteAction.setDisabledImageDescriptor(images.getImageDescriptor(ISharedImages.IMG_TOOL_PASTE_DISABLED));<NEW_LINE>fPasteAction.setImageDescriptor(images.getImageDescriptor(ISharedImages.IMG_TOOL_PASTE));<NEW_LINE>fPasteAction.setActionDefinitionId(IWorkbenchCommandConstants.EDIT_PASTE);<NEW_LINE>fCopyAction = new FileSystemCopyAction(fShell, fClipboard, fPasteAction);<NEW_LINE>fCopyAction.setDisabledImageDescriptor(images.getImageDescriptor(ISharedImages.IMG_TOOL_COPY_DISABLED));<NEW_LINE>fCopyAction.setImageDescriptor(images<MASK><NEW_LINE>fCopyAction.setActionDefinitionId(IWorkbenchCommandConstants.EDIT_COPY);<NEW_LINE>fDeleteAction = createDeleteAction(fShell);<NEW_LINE>fDeleteAction.setDisabledImageDescriptor(images.getImageDescriptor(ISharedImages.IMG_TOOL_DELETE_DISABLED));<NEW_LINE>fDeleteAction.setImageDescriptor(images.getImageDescriptor(ISharedImages.IMG_TOOL_DELETE));<NEW_LINE>fDeleteAction.setActionDefinitionId(IWorkbenchCommandConstants.EDIT_DELETE);<NEW_LINE>} | .getImageDescriptor(ISharedImages.IMG_TOOL_COPY)); |
789,050 | final AddThingToBillingGroupResult executeAddThingToBillingGroup(AddThingToBillingGroupRequest addThingToBillingGroupRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(addThingToBillingGroupRequest);<NEW_LINE><MASK><NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<AddThingToBillingGroupRequest> request = null;<NEW_LINE>Response<AddThingToBillingGroupResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new AddThingToBillingGroupRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(addThingToBillingGroupRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "IoT");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "AddThingToBillingGroup");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<AddThingToBillingGroupResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new AddThingToBillingGroupResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); |
555,823 | public Request<UpdateGroupRequest> marshall(UpdateGroupRequest updateGroupRequest) {<NEW_LINE>if (updateGroupRequest == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>Request<UpdateGroupRequest> request = new DefaultRequest<UpdateGroupRequest>(updateGroupRequest, "AmazonIdentityManagement");<NEW_LINE>request.addParameter("Action", "UpdateGroup");<NEW_LINE>request.addParameter("Version", "2010-05-08");<NEW_LINE><MASK><NEW_LINE>if (updateGroupRequest.getGroupName() != null) {<NEW_LINE>request.addParameter("GroupName", StringUtils.fromString(updateGroupRequest.getGroupName()));<NEW_LINE>}<NEW_LINE>if (updateGroupRequest.getNewPath() != null) {<NEW_LINE>request.addParameter("NewPath", StringUtils.fromString(updateGroupRequest.getNewPath()));<NEW_LINE>}<NEW_LINE>if (updateGroupRequest.getNewGroupName() != null) {<NEW_LINE>request.addParameter("NewGroupName", StringUtils.fromString(updateGroupRequest.getNewGroupName()));<NEW_LINE>}<NEW_LINE>return request;<NEW_LINE>} | request.setHttpMethod(HttpMethodName.POST); |
1,046,489 | public void pwrite(TBrokerFD fd, long offset, byte[] data) {<NEW_LINE>FSDataOutputStream <MASK><NEW_LINE>synchronized (fsDataOutputStream) {<NEW_LINE>long currentStreamOffset;<NEW_LINE>try {<NEW_LINE>currentStreamOffset = fsDataOutputStream.getPos();<NEW_LINE>} catch (IOException e) {<NEW_LINE>logger.error("errors while get file pos from output stream", e);<NEW_LINE>throw new BrokerException(TBrokerOperationStatusCode.TARGET_STORAGE_SERVICE_ERROR, "errors while get file pos from output stream");<NEW_LINE>}<NEW_LINE>if (currentStreamOffset != offset) {<NEW_LINE>throw new BrokerException(TBrokerOperationStatusCode.INVALID_INPUT_OFFSET, "current outputstream offset is {} not equal to request {}", currentStreamOffset, offset);<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>fsDataOutputStream.write(data);<NEW_LINE>} catch (IOException e) {<NEW_LINE>logger.error("errors while write data to output stream", e);<NEW_LINE>throw new BrokerException(TBrokerOperationStatusCode.TARGET_STORAGE_SERVICE_ERROR, e, "errors while write data to output stream");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | fsDataOutputStream = clientContextManager.getFsDataOutputStream(fd); |
1,004,428 | public List<OCRResult> createDocumentsWithResults(BufferedImage[] bis, String[] filenames, String[] outputbases, List<ITesseract.RenderedFormat> formats, int pageIteratorLevel) throws TesseractException {<NEW_LINE>if (bis.length != filenames.length || bis.length != outputbases.length) {<NEW_LINE>throw new RuntimeException("The three arrays must match in length.");<NEW_LINE>}<NEW_LINE>init();<NEW_LINE>setVariables();<NEW_LINE>List<OCRResult> results = new ArrayList<OCRResult>();<NEW_LINE>try {<NEW_LINE>for (int i = 0; i < bis.length; i++) {<NEW_LINE>try {<NEW_LINE>TessResultRenderer renderer = createRenderers(outputbases[i], formats);<NEW_LINE>int meanTextConfidence = createDocuments(bis[i], filenames[i], renderer);<NEW_LINE>List<Word> words = meanTextConfidence > 0 ? getRecognizedWords(pageIteratorLevel) <MASK><NEW_LINE>results.add(new OCRResult(meanTextConfidence, words));<NEW_LINE>api.TessDeleteResultRenderer(renderer);<NEW_LINE>} catch (Exception e) {<NEW_LINE>// skip the problematic image file<NEW_LINE>logger.warn(e.getMessage(), e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} finally {<NEW_LINE>dispose();<NEW_LINE>}<NEW_LINE>return results;<NEW_LINE>} | : new ArrayList<Word>(); |
1,633,607 | public void drawU(UGraphic ug) {<NEW_LINE>final StringBounder stringBounder = ug.getStringBounder();<NEW_LINE>final FtileGeometry geo = getFtile1().calculateDimension(stringBounder);<NEW_LINE>if (geo.hasPointOut() == false)<NEW_LINE>return;<NEW_LINE>final Point2D p1 = getP1(stringBounder);<NEW_LINE>final double x1 = p1.getX();<NEW_LINE>final double y1 = p1.getY();<NEW_LINE>final FtileGeometry dimDiamond2 = diamond2.calculateDimension(stringBounder);<NEW_LINE>final Point2D ptA = getTranslateDiamond2(stringBounder).getTranslated(dimDiamond2.getPointA());<NEW_LINE>final Point2D ptB = getTranslateDiamond2(stringBounder).getTranslated(dimDiamond2.getPointB());<NEW_LINE>final Point2D ptD = getTranslateDiamond2(stringBounder).getTranslated(dimDiamond2.getPointD());<NEW_LINE>final Point2D p2;<NEW_LINE>final UPolygon arrow;<NEW_LINE>final Direction direction;<NEW_LINE>if (x1 < ptD.getX()) {<NEW_LINE>p2 = ptD;<NEW_LINE>arrow = Arrows.asToRight();<NEW_LINE>direction = Direction.RIGHT;<NEW_LINE>} else if (x1 > ptB.getX()) {<NEW_LINE>p2 = ptB;<NEW_LINE>arrow = Arrows.asToLeft();<NEW_LINE>direction = Direction.LEFT;<NEW_LINE>} else {<NEW_LINE>p2 = ptA;<NEW_LINE>arrow = Arrows.asToDown();<NEW_LINE>direction = Direction.DOWN;<NEW_LINE>}<NEW_LINE>final double x2 = p2.getX();<NEW_LINE>final double y2 = p2.getY();<NEW_LINE>final Snake snake = Snake.create(skinParam(), arrowColor, arrow).withLabel(outLabel, VerticalAlignment.CENTER);<NEW_LINE>snake.addPoint(x1, y1);<NEW_LINE>if (direction == Direction.LEFT && x2 > x1 - 10) {<NEW_LINE>snake.addPoint(x1, y2 - 8);<NEW_LINE>snake.addPoint(x1 + 12, y2 - 8);<NEW_LINE>snake.addPoint(x1 + 12, y2);<NEW_LINE>} else {<NEW_LINE>snake.addPoint(x1, y2);<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>ug.draw(snake);<NEW_LINE>} | snake.addPoint(x2, y2); |
1,781,878 | public static void populateForBLS12(final PrecompileContractRegistry registry, final GasCalculator gasCalculator) {<NEW_LINE>populateForIstanbul(registry, gasCalculator);<NEW_LINE>registry.put(Address.BLS12_G1ADD, new BLS12G1AddPrecompiledContract());<NEW_LINE>registry.put(Address.BLS12_G1MUL, new BLS12G1MulPrecompiledContract());<NEW_LINE>registry.put(Address.BLS12_G1MULTIEXP, new BLS12G1MultiExpPrecompiledContract());<NEW_LINE>registry.put(Address<MASK><NEW_LINE>registry.put(Address.BLS12_G2MUL, new BLS12G2MulPrecompiledContract());<NEW_LINE>registry.put(Address.BLS12_G2MULTIEXP, new BLS12G2MultiExpPrecompiledContract());<NEW_LINE>registry.put(Address.BLS12_PAIRING, new BLS12PairingPrecompiledContract());<NEW_LINE>registry.put(Address.BLS12_MAP_FP_TO_G1, new BLS12MapFpToG1PrecompiledContract());<NEW_LINE>registry.put(Address.BLS12_MAP_FP2_TO_G2, new BLS12MapFp2ToG2PrecompiledContract());<NEW_LINE>} | .BLS12_G2ADD, new BLS12G2AddPrecompiledContract()); |
728,695 | public static I_C_Order extend(@NonNull final I_C_Order existentOrder) {<NEW_LINE>if (I_C_Order.CONTRACTSTATUS_Extended.equals(existentOrder.getContractStatus())) {<NEW_LINE>throw new AdempiereException(Services.get(IMsgBL.class).getTranslatableMsgText(MSG_EXTEND_CONTRACT_ALREADY_PROLONGED));<NEW_LINE>} else {<NEW_LINE>final I_C_Order newOrder = InterfaceWrapperHelper.newInstance(I_C_Order.class, existentOrder);<NEW_LINE>final PO to = InterfaceWrapperHelper.getPO(newOrder);<NEW_LINE>final PO from = InterfaceWrapperHelper.getPO(existentOrder);<NEW_LINE>PO.copyValues(from, to, true);<NEW_LINE>InterfaceWrapperHelper.save(newOrder);<NEW_LINE>final CopyRecordSupport childCRS = CopyRecordFactory.getCopyRecordSupport(I_C_Order.Table_Name);<NEW_LINE>childCRS.setParentPO(to);<NEW_LINE>childCRS.setBase(true);<NEW_LINE>childCRS.copyRecord(from, InterfaceWrapperHelper.getTrxName(existentOrder));<NEW_LINE>newOrder.setDocStatus(<MASK><NEW_LINE>newOrder.setDocAction(X_C_Order.DOCACTION_Complete);<NEW_LINE>final I_C_Flatrate_Term lastTerm = Services.get(ISubscriptionBL.class).retrieveLastFlatrateTermFromOrder(existentOrder);<NEW_LINE>if (lastTerm != null) {<NEW_LINE>final Timestamp addDays = TimeUtil.addDays(lastTerm.getEndDate(), 1);<NEW_LINE>newOrder.setDatePromised(addDays);<NEW_LINE>newOrder.setPreparationDate(addDays);<NEW_LINE>}<NEW_LINE>InterfaceWrapperHelper.save(newOrder);<NEW_LINE>// link the existent order to the new one<NEW_LINE>existentOrder.setRef_FollowupOrder_ID(newOrder.getC_Order_ID());<NEW_LINE>InterfaceWrapperHelper.save(existentOrder);<NEW_LINE>return newOrder;<NEW_LINE>}<NEW_LINE>} | DocStatus.Drafted.getCode()); |
1,475,356 | private void push(Vector3ic pos, byte value) {<NEW_LINE>byte regenValue = value;<NEW_LINE>Block block = regenWorld.getBlockAt(pos);<NEW_LINE>Vector3i position = new Vector3i(pos);<NEW_LINE>while (regenRules.canSpreadOutOf(block, Side.BOTTOM)) {<NEW_LINE>regenValue = regenRules.propagateValue(regenValue, Side.BOTTOM, block, 1);<NEW_LINE>position.y -= 1;<NEW_LINE>byte adjValue = regenWorld.getValueAt(position);<NEW_LINE>if (adjValue < regenValue && adjValue != PropagatorWorldView.UNAVAILABLE) {<NEW_LINE>block = regenWorld.getBlockAt(position);<NEW_LINE>if (regenRules.canSpreadInto(block, Side.TOP)) {<NEW_LINE>regenWorld.setValueAt(position, regenValue);<NEW_LINE>reduceQueues[adjValue].remove(position);<NEW_LINE>byte sunlightValue = (byte) (regenValue - Chunks.SUNLIGHT_REGEN_THRESHOLD);<NEW_LINE>if (sunlightValue > 0) {<NEW_LINE>byte prevValue = sunlightWorld.getValueAt(position);<NEW_LINE>if (prevValue < sunlightValue) {<NEW_LINE>sunlightWorld.setValueAt(position, sunlightValue);<NEW_LINE>sunlightPropagator.propagateFrom(<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | new Vector3i(position), sunlightValue); |
170,625 | public void paint(Graphics g) {<NEW_LINE>Graphics2D g2 = (Graphics2D) g.create();<NEW_LINE>Rectangle r = new Rectangle(getSize());<NEW_LINE>JBInsets.removeFrom(r, JBUI.insets(1<MASK><NEW_LINE>try {<NEW_LINE>g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);<NEW_LINE>g2.setRenderingHint(RenderingHints.KEY_STROKE_CONTROL, RenderingHints.VALUE_STROKE_NORMALIZE);<NEW_LINE>g2.translate(r.x, r.y);<NEW_LINE>if (myPaintArrowButton) {<NEW_LINE>float bw = BW.getFloat();<NEW_LINE>float lw = LW.getFloat();<NEW_LINE>float arc = myArc;<NEW_LINE>arc = arc > bw + lw ? arc - bw - lw : 0.0f;<NEW_LINE>Path2D innerShape = new Path2D.Float();<NEW_LINE>innerShape.moveTo(lw, bw + lw);<NEW_LINE>innerShape.lineTo(r.width - bw - lw - arc, bw + lw);<NEW_LINE>innerShape.quadTo(r.width - bw - lw, bw + lw, r.width - bw - lw, bw + lw + arc);<NEW_LINE>innerShape.lineTo(r.width - bw - lw, r.height - bw - lw - arc);<NEW_LINE>innerShape.quadTo(r.width - bw - lw, r.height - bw - lw, r.width - bw - lw - arc, r.height - bw - lw);<NEW_LINE>innerShape.lineTo(lw, r.height - bw - lw);<NEW_LINE>innerShape.closePath();<NEW_LINE>g2.setColor(JBUI.CurrentTheme.Arrow.backgroundColor(comboBox.isEnabled(), comboBox.isEditable()));<NEW_LINE>g2.fill(innerShape);<NEW_LINE>// Paint vertical line<NEW_LINE>if (comboBox.isEditable()) {<NEW_LINE>g2.setColor(getOutlineColor(comboBox.isEnabled(), false));<NEW_LINE>g2.fill(new Rectangle2D.Float(0, bw + lw, LW.getFloat(), r.height - (bw + lw) * 2));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>paintArrow(g2, this);<NEW_LINE>} finally {<NEW_LINE>g2.dispose();<NEW_LINE>}<NEW_LINE>} | , 0, 1, 1)); |
1,072,778 | boolean checkIfRemote(SibRaMessagingEngineConnection conn) {<NEW_LINE>final String methodName = "checkIfRemote";<NEW_LINE>if (TraceComponent.isAnyTracingEnabled() && TRACE.isEntryEnabled()) {<NEW_LINE>SibTr.entry(this, TRACE, methodName, new Object[] { conn });<NEW_LINE>}<NEW_LINE>String meName = conn.getConnection().getMeName();<NEW_LINE>if (TraceComponent.isAnyTracingEnabled() && TRACE.isDebugEnabled()) {<NEW_LINE>SibTr.debug(TRACE, "Connections's ME name " + meName);<NEW_LINE>}<NEW_LINE>boolean remote = true;<NEW_LINE>JsMessagingEngine[] localMEs = SibRaEngineComponent.getActiveMessagingEngines(_endpointConfiguration.getBusName());<NEW_LINE>for (int i = 0; i < localMEs.length; i++) {<NEW_LINE>JsMessagingEngine me = localMEs[i];<NEW_LINE><MASK><NEW_LINE>if (TraceComponent.isAnyTracingEnabled() && TRACE.isDebugEnabled()) {<NEW_LINE>SibTr.debug(TRACE, "Checking ME name " + localName);<NEW_LINE>}<NEW_LINE>if (localName.equals(meName)) {<NEW_LINE>if (TraceComponent.isAnyTracingEnabled() && TRACE.isDebugEnabled()) {<NEW_LINE>SibTr.debug(TRACE, "Me name matched, the connection is local");<NEW_LINE>}<NEW_LINE>remote = false;<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (TraceComponent.isAnyTracingEnabled() && TRACE.isEntryEnabled()) {<NEW_LINE>SibTr.exit(TRACE, methodName, remote);<NEW_LINE>}<NEW_LINE>return remote;<NEW_LINE>} | String localName = me.getName(); |
81,444 | private static void inlineMembers(Type from, Type to) {<NEW_LINE>// Move all the members to base class except the java.lang.Object methods.<NEW_LINE>// We could also have moved members from all subclasses however @Memoized methods are<NEW_LINE>// overridden hence requires more complicated re-writing.<NEW_LINE>// Validate our assumption that AutoValue only generates single non-default constructor.<NEW_LINE>checkState(!to.getDeclaration().isAnnotatedWithAutoValue() || (from.getConstructors().size() == 1 && from.getDefaultConstructor() == null));<NEW_LINE>// We need to make sure inlined constructors explicitly call this() otherwise they would<NEW_LINE>// implicitly call super() and change the behavior from the original code (since existing<NEW_LINE>// implicit super() call was targeting the parent default constructor).<NEW_LINE>addThisCallToInlinedConstructors(from, to);<NEW_LINE>// Note that the collection here will error out in duplicate keys so if any our<NEW_LINE>// assumptions incorrect (e.g. no multiple static initializer), we should fail-fast.<NEW_LINE>ImmutableMap<String, Member> movedMembers = Maps.uniqueIndex(from.getMembers(), Member::getMangledName);<NEW_LINE>to.getMembers().removeIf(m -> {<NEW_LINE>if (movedMembers.containsKey(m.getMangledName())) {<NEW_LINE>// We should never end up replacing a non-empty method.<NEW_LINE>checkState(!m.isMethod() || ((Method) m<MASK><NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>});<NEW_LINE>// Note that the adding to end here matters since later preserveFields will assume last<NEW_LINE>// constructor is the one that is coming from AutoValue implementation class.<NEW_LINE>to.addMembers(movedMembers.values());<NEW_LINE>} | ).isEmpty(), m); |
1,049,064 | private void select(final int index) {<NEW_LINE>unhighlightSelected();<NEW_LINE>final String message;<NEW_LINE>if (index >= 0) {<NEW_LINE>JLabel newSelected = iconLabels.get(index);<NEW_LINE>this.selected = newSelected;<NEW_LINE>highlightSelected();<NEW_LINE>final IconDescription iconInformation = icons.get(index);<NEW_LINE>KeyStroke accelerator = getKeyStroke(iconInformation.getShortcutKey());<NEW_LINE>if (accelerator != null) {<NEW_LINE>String accText = "";<NEW_LINE>if (accelerator != null) {<NEW_LINE>int modifiers = accelerator.getModifiers() | ((Compat.isMacOsX() ? KeyEvent<MASK><NEW_LINE>if (modifiers > 0) {<NEW_LINE>accText = InputEvent.getModifiersExText(modifiers);<NEW_LINE>accText += "+";<NEW_LINE>}<NEW_LINE>int keyCode = accelerator.getKeyCode();<NEW_LINE>if (keyCode != 0) {<NEW_LINE>accText += KeyEvent.getKeyText(keyCode);<NEW_LINE>} else {<NEW_LINE>accText += accelerator.getKeyChar();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>message = iconInformation.getTranslatedDescription() + ", " + accText;<NEW_LINE>} else {<NEW_LINE>message = iconInformation.getTranslatedDescription();<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>this.selected = null;<NEW_LINE>message = "";<NEW_LINE>}<NEW_LINE>descriptionLabel.setText(message);<NEW_LINE>} | .META_DOWN_MASK : KeyEvent.CTRL_DOWN_MASK)); |
1,133,785 | private void readTables(Schema schema, ResultSet rsTable) throws SQLException {<NEW_LINE>if (SHOW_METADATA) {<NEW_LINE>final <MASK><NEW_LINE>int numberOfColumns = rsmd.getColumnCount();<NEW_LINE>for (int x = 1; x <= numberOfColumns; x++) {<NEW_LINE>LOGGER.debug(rsmd.getColumnName(x) + ", " + rsmd.getColumnClassName(x) + ", " + rsmd.getColumnType(x));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>while (rsTable.next()) {<NEW_LINE>if (SHOW_METADATA) {<NEW_LINE>final ResultSetMetaData rsmd = rsTable.getMetaData();<NEW_LINE>int numberOfColumns = rsmd.getColumnCount();<NEW_LINE>for (int x = 1; x <= numberOfColumns; x++) {<NEW_LINE>LOGGER.debug(rsmd.getColumnName(x) + ":'" + rsTable.getObject(x) + "'");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>final Table table = schema.mutator().addNewTable();<NEW_LINE>final String tableName = rsTable.getString("TABLE_NAME");<NEW_LINE>final String tableType = rsTable.getString("TABLE_TYPE");<NEW_LINE>table.mutator().setId(tableName);<NEW_LINE>table.mutator().setName(tableName);<NEW_LINE>table.mutator().setView("VIEW".equals(tableType));<NEW_LINE>extraInfo("readTables(%s, ...) read %s", schema.getId(), table);<NEW_LINE>}<NEW_LINE>} | ResultSetMetaData rsmd = rsTable.getMetaData(); |
785,393 | private Letter createLetter(final char pCharacter) throws FontException {<NEW_LINE>final String characterAsString = String.valueOf(pCharacter);<NEW_LINE>final float textureWidth = this.mTextureWidth;<NEW_LINE>final float textureHeight = this.mTextureHeight;<NEW_LINE>this.updateTextBounds(characterAsString);<NEW_LINE>final int letterLeft = this.mTextBounds.left;<NEW_LINE>final int letterTop = this.mTextBounds.top;<NEW_LINE>final int letterWidth = this.mTextBounds.width();<NEW_LINE>final int letterHeight = this.mTextBounds.height();<NEW_LINE>final Letter letter;<NEW_LINE>final float advance = this.getLetterAdvance(characterAsString);<NEW_LINE>final boolean whitespace = Character.isWhitespace(pCharacter) || (letterWidth == 0) || (letterHeight == 0);<NEW_LINE>if (whitespace) {<NEW_LINE>letter = new Letter(pCharacter, advance);<NEW_LINE>} else {<NEW_LINE>if ((this.mCurrentTextureX + Font.LETTER_TEXTURE_PADDING + letterWidth) >= textureWidth) {<NEW_LINE>this.mCurrentTextureX = 0;<NEW_LINE>this.mCurrentTextureY += this.mCurrentTextureYHeightMax + (2 * Font.LETTER_TEXTURE_PADDING);<NEW_LINE>this.mCurrentTextureYHeightMax = 0;<NEW_LINE>}<NEW_LINE>if ((this.mCurrentTextureY + letterHeight) >= textureHeight) {<NEW_LINE>throw new FontException("Not enough space for " + Letter.class.getSimpleName() + ": '" + pCharacter + "' on the " + this.mTexture.getClass().getSimpleName() + ". Existing Letters: " + SparseArrayUtils.toString(this.mManagedCharacterToLetterMap));<NEW_LINE>}<NEW_LINE>this.mCurrentTextureYHeightMax = Math.max(letterHeight, this.mCurrentTextureYHeightMax);<NEW_LINE>this.mCurrentTextureX += Font.LETTER_TEXTURE_PADDING;<NEW_LINE>final float u = this.mCurrentTextureX / textureWidth;<NEW_LINE>final float v = this.mCurrentTextureY / textureHeight;<NEW_LINE>final float u2 = (this.mCurrentTextureX + letterWidth) / textureWidth;<NEW_LINE>final float v2 = (<MASK><NEW_LINE>letter = new Letter(pCharacter, this.mCurrentTextureX - Font.LETTER_TEXTURE_PADDING, this.mCurrentTextureY - Font.LETTER_TEXTURE_PADDING, letterWidth, letterHeight, letterLeft, letterTop - this.getAscent(), advance, u, v, u2, v2);<NEW_LINE>this.mCurrentTextureX += letterWidth + Font.LETTER_TEXTURE_PADDING;<NEW_LINE>}<NEW_LINE>return letter;<NEW_LINE>} | this.mCurrentTextureY + letterHeight) / textureHeight; |
1,354,039 | final DescribeMountTargetsResult executeDescribeMountTargets(DescribeMountTargetsRequest describeMountTargetsRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(describeMountTargetsRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE><MASK><NEW_LINE>Request<DescribeMountTargetsRequest> request = null;<NEW_LINE>Response<DescribeMountTargetsResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DescribeMountTargetsRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(describeMountTargetsRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "EFS");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DescribeMountTargets");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DescribeMountTargetsResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DescribeMountTargetsResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | awsRequestMetrics.startEvent(Field.ClientExecuteTime); |
1,256,439 | public void testComms_Send_Message_P2PTest_Default(HttpServletRequest request, HttpServletResponse response) throws Exception {<NEW_LINE>boolean testFailed = false;<NEW_LINE>QueueConnectionFactory cf1 = (QueueConnectionFactory) new <MASK><NEW_LINE>Queue queue = (Queue) new InitialContext().lookup("java:comp/env/jndi_INPUT_Q");<NEW_LINE>QueueConnection con = cf1.createQueueConnection();<NEW_LINE>con.start();<NEW_LINE>emptyQueue(cf1, jmsQueue);<NEW_LINE>QueueSession sessionSender = con.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);<NEW_LINE>QueueSender send = sessionSender.createSender(jmsQueue);<NEW_LINE>QueueReceiver rec = sessionSender.createReceiver(jmsQueue);<NEW_LINE>String outbound = "testComms_Send_Message_P2PTest_Default";<NEW_LINE>send.setDeliveryDelay(1000);<NEW_LINE>send.send(jmsQueue, sessionSender.createTextMessage(outbound));<NEW_LINE>TextMessage receiveMsg = (TextMessage) rec.receive(30000);<NEW_LINE>String inbound = receiveMsg.getText();<NEW_LINE>if (!outbound.equals(inbound)) {<NEW_LINE>testFailed = true;<NEW_LINE>}<NEW_LINE>con.close();<NEW_LINE>if (testFailed) {<NEW_LINE>throw new Exception("testComms_Send_Message_P2PTest_Default failed");<NEW_LINE>}<NEW_LINE>} | InitialContext().lookup("java:comp/env/jndi_JMS_BASE_QCF"); |
1,668,078 | public AvailabilityZone unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>AvailabilityZone availabilityZone = new AvailabilityZone();<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("ZoneName", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>availabilityZone.setZoneName(context.getUnmarshaller(String.<MASK><NEW_LINE>}<NEW_LINE>if (context.testExpression("SubnetId", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>availabilityZone.setSubnetId(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 availabilityZone;<NEW_LINE>} | class).unmarshall(context)); |
239,859 | final ListFindingsFiltersResult executeListFindingsFilters(ListFindingsFiltersRequest listFindingsFiltersRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(listFindingsFiltersRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<ListFindingsFiltersRequest> request = null;<NEW_LINE>Response<ListFindingsFiltersResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new ListFindingsFiltersRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(listFindingsFiltersRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "Macie2");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ListFindingsFilters");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<ListFindingsFiltersResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new ListFindingsFiltersResultJsonUnmarshaller());<NEW_LINE>response = <MASK><NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | invoke(request, responseHandler, executionContext); |
655,024 | public void eventExpiryNotification(Transaction transaction) throws SevereMessageStoreException {<NEW_LINE>if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())<NEW_LINE>SibTr.entry(tc, "eventExpiryNotification", new Object[] { transaction, key.getTick() });<NEW_LINE>super.eventExpiryNotification(transaction);<NEW_LINE>setRejectTransactionID(transaction.getPersistentTranId());<NEW_LINE>if (TraceComponent.isAnyTracingEnabled() && UserTrace.tc_mt.isDebugEnabled())<NEW_LINE>SibTr.debug(UserTrace.tc_mt, nls_mt.getFormattedMessage("REMOTE_MESSAGE_EXPIRED_CWSJU0034", new Object[] { getMessage(), key.getTick(), aih.getDestName(), aih.getMessageProcessor().getMessagingEngineUuid(), aih.getLocalisationUuid(), aih.getGatheringTargetDestUuid() }, null));<NEW_LINE>if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())<NEW_LINE><MASK><NEW_LINE>} | SibTr.exit(tc, "eventExpiryNotification"); |
1,699,530 | public boolean loadExisting() {<NEW_LINE>if (!nodes.loadExisting() || !edges.loadExisting())<NEW_LINE>return false;<NEW_LINE>// now load some properties from stored data<NEW_LINE>final int nodesVersion = nodes.getHeader(0 * 4);<NEW_LINE>GHUtility.checkDAVersion("nodes", Constants.VERSION_NODE, nodesVersion);<NEW_LINE>nodeEntryBytes = nodes.getHeader(1 * 4);<NEW_LINE>nodeCount = nodes.getHeader(2 * 4);<NEW_LINE>bounds.minLon = Helper.intToDegree(nodes.getHeader(3 * 4));<NEW_LINE>bounds.maxLon = Helper.intToDegree(nodes.getHeader(4 * 4));<NEW_LINE>bounds.minLat = Helper.intToDegree(nodes<MASK><NEW_LINE>bounds.maxLat = Helper.intToDegree(nodes.getHeader(6 * 4));<NEW_LINE>boolean hasElevation = nodes.getHeader(7 * 4) == 1;<NEW_LINE>if (hasElevation != withElevation)<NEW_LINE>// :( we should load data from disk to create objects, not the other way around!<NEW_LINE>throw new IllegalStateException("Configured dimension elevation=" + withElevation + " is not equal " + "to dimension of loaded graph elevation =" + hasElevation);<NEW_LINE>if (withElevation) {<NEW_LINE>bounds.minEle = Helper.intToEle(nodes.getHeader(8 * 4));<NEW_LINE>bounds.maxEle = Helper.intToEle(nodes.getHeader(9 * 4));<NEW_LINE>}<NEW_LINE>frozen = nodes.getHeader(10 * 4) == 1;<NEW_LINE>final int edgesVersion = edges.getHeader(0 * 4);<NEW_LINE>GHUtility.checkDAVersion("edges", Constants.VERSION_EDGE, edgesVersion);<NEW_LINE>edgeEntryBytes = edges.getHeader(1 * 4);<NEW_LINE>edgeCount = edges.getHeader(2 * 4);<NEW_LINE>return true;<NEW_LINE>} | .getHeader(5 * 4)); |
476,549 | void printJVMs(List<String> args) {<NEW_LINE>final Map<String, List<<MASK><NEW_LINE>if (jres == null)<NEW_LINE>println("No detected Java installations");<NEW_LINE>else {<NEW_LINE>STDOUT.println(LOG_PREFIX + "Detected Java installations:");<NEW_LINE>for (Map.Entry<String, List<Path>> j : jres.entrySet()) {<NEW_LINE>for (Path home : j.getValue()) STDOUT.println(j.getKey() + (isJDK(home) ? " (JDK)" : "") + (j.getKey().length() < 8 ? "\t\t" : "\t") + home);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>final Path jhome = getJavaHome();<NEW_LINE>STDOUT.println(LOG_PREFIX + "selected " + (jhome != null ? jhome : (getProperty(PROP_JAVA_HOME) + " (current)")));<NEW_LINE>} | Path>> jres = getJavaHomes(); |
184,451 | public void onCreate(Bundle savedInstanceState) {<NEW_LINE>SharedPreferences themePrefs = getSharedPreferences("THEME", 0);<NEW_LINE>Boolean isDark = themePrefs.getBoolean("isDark", false);<NEW_LINE>if (isDark)<NEW_LINE>setTheme(R.style.DarkTheme);<NEW_LINE>else<NEW_LINE>setTheme(R.style.AppTheme);<NEW_LINE>super.onCreate(savedInstanceState);<NEW_LINE>UIThread = this;<NEW_LINE>if (System.getMsfRpc() == null) {<NEW_LINE>new FinishDialog(getString(R.string.error), "MSF RPC not connected", Sessions.this).show();<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>mResults = System.getCurrentTarget().getSessions();<NEW_LINE>mListView = (ListView) findViewById(android.R.id.list);<NEW_LINE>mAdapter = new ArrayAdapter<>(this, android.R.layout.simple_list_item_1, mResults);<NEW_LINE>mListView.setAdapter(mAdapter);<NEW_LINE>mListView.setOnItemClickListener(clickListener);<NEW_LINE>mListView.setOnItemLongClickListener(longClickListener);<NEW_LINE>new Thread(new Runnable() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void run() {<NEW_LINE>System<MASK><NEW_LINE>runOnUiThread(new Runnable() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void run() {<NEW_LINE>if (mResults.isEmpty()) {<NEW_LINE>new FinishDialog(getString(R.string.warning), getString(R.string.no_opened_sessions), Sessions.this).show();<NEW_LINE>} else {<NEW_LINE>mAdapter.notifyDataSetChanged();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}<NEW_LINE>}).start();<NEW_LINE>} | .getMsfRpc().updateSessions(); |
1,380,451 | public void onClick(View v) {<NEW_LINE>Activity activity = getActivity();<NEW_LINE>if (activity != null) {<NEW_LINE>Context themedContext = UiUtilities.getThemedContext(activity, nightMode);<NEW_LINE>AlertDialog.Builder b = new AlertDialog.Builder(themedContext);<NEW_LINE>b.setTitle(R.string.favorite_category_name);<NEW_LINE>final EditText nameEditText = new EditText(themedContext);<NEW_LINE>nameEditText.setLayoutParams(new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT));<NEW_LINE>nameEditText.setText(group.getName());<NEW_LINE>LinearLayout container = new LinearLayout(themedContext);<NEW_LINE>int sidePadding = AndroidUtils.dpToPx(activity, 24f);<NEW_LINE>int topPadding = <MASK><NEW_LINE>container.setPadding(sidePadding, topPadding, sidePadding, topPadding);<NEW_LINE>container.addView(nameEditText);<NEW_LINE>b.setView(container);<NEW_LINE>b.setNegativeButton(R.string.shared_string_cancel, null);<NEW_LINE>b.setPositiveButton(R.string.shared_string_save, new DialogInterface.OnClickListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onClick(DialogInterface dialog, int which) {<NEW_LINE>String name = nameEditText.getText().toString();<NEW_LINE>boolean nameChanged = !Algorithms.objectEquals(group.getName(), name);<NEW_LINE>if (nameChanged) {<NEW_LINE>app.getFavoritesHelper().editFavouriteGroup(group, name, group.getColor(), group.isVisible());<NEW_LINE>updateParentFragment();<NEW_LINE>}<NEW_LINE>dismiss();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>b.show();<NEW_LINE>}<NEW_LINE>} | AndroidUtils.dpToPx(activity, 4f); |
54,786 | public RexNode visitOver(RexOver over) {<NEW_LINE>// Look up the aggCall which this expr was translated to.<NEW_LINE>final Window.RexWinAggCall aggCall = aggMap.get(origToNewOver.get(over));<NEW_LINE>assert aggCall != null;<NEW_LINE>assert RelOptUtil.eq("over", over.getType(), "aggCall", aggCall.<MASK><NEW_LINE>// Find the index of the aggCall among all partitions of all<NEW_LINE>// groups.<NEW_LINE>final int aggCallIndex = flattenedAggCallList.indexOf(aggCall);<NEW_LINE>assert aggCallIndex >= 0;<NEW_LINE>// Replace expression with a reference to the window slot.<NEW_LINE>final int index = inputFieldCount + aggCallIndex;<NEW_LINE>assert RelOptUtil.eq("over", over.getType(), "intermed", intermediateRowType.getFieldList().get(index).getType(), Litmus.THROW);<NEW_LINE>return new RexInputRef(index, over.getType());<NEW_LINE>} | getType(), Litmus.THROW); |
904,974 | // Defect 268176.1<NEW_LINE>public boolean isAvailable() {<NEW_LINE>boolean available = false;<NEW_LINE>String relativeURL = inputSource.getRelativeURL();<NEW_LINE>Container container = tcontext.getServletContext().getModuleContainer();<NEW_LINE>if (container != null) {<NEW_LINE>if (options.isDisableJspRuntimeCompilation() == false) {<NEW_LINE>Entry entry = container.getEntry(relativeURL);<NEW_LINE>if (entry != null) {<NEW_LINE>available = true;<NEW_LINE>} else {<NEW_LINE>available = inputSource.getLastModified() != 0;<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>available = true;<NEW_LINE>}<NEW_LINE>if (com.ibm.ejs.ras.TraceComponent.isAnyTracingEnabled() && logger.isLoggable(Level.FINER)) {<NEW_LINE>logger.logp(Level.FINER, CLASS_NAME, "isAvailable", "Container's relativeURL [" + relativeURL + "] " + "is available [" + available + "]");<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>String realPath = tcontext.getRealPath(relativeURL);<NEW_LINE>if (options.isDisableJspRuntimeCompilation() == false) {<NEW_LINE>available = new <MASK><NEW_LINE>} else {<NEW_LINE>available = true;<NEW_LINE>}<NEW_LINE>if (com.ibm.ejs.ras.TraceComponent.isAnyTracingEnabled() && logger.isLoggable(Level.FINER)) {<NEW_LINE>logger.logp(Level.FINER, CLASS_NAME, "isAvailable", "relativeURL [" + relativeURL + "] " + "realPath [" + realPath + "] is available [" + available + "]");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return available;<NEW_LINE>} | File(realPath).exists(); |
1,103,452 | protected void invalidated() {<NEW_LINE>Timeline t = get();<NEW_LINE>if (old != null) {<NEW_LINE>old.currentRateProperty().removeListener(rateListener);<NEW_LINE>}<NEW_LINE>if (t == null) {<NEW_LINE>startBtn.setDisable(true);<NEW_LINE>rwBtn.setDisable(true);<NEW_LINE>playBtn.setDisable(true);<NEW_LINE>ffBtn.setDisable(true);<NEW_LINE>endBtn.setDisable(true);<NEW_LINE>loopBtn.setDisable(true);<NEW_LINE>} else {<NEW_LINE>startBtn.setDisable(false);<NEW_LINE>rwBtn.setDisable(false);<NEW_LINE>playBtn.setDisable(false);<NEW_LINE>ffBtn.setDisable(false);<NEW_LINE>endBtn.setDisable(false);<NEW_LINE>loopBtn.setDisable(false);<NEW_LINE>playBtn.setSelected(t.getCurrentRate() != 0);<NEW_LINE>loopBtn.setSelected(t.getCycleDuration().equals(Timeline.INDEFINITE));<NEW_LINE>t.<MASK><NEW_LINE>}<NEW_LINE>old = t;<NEW_LINE>} | currentRateProperty().addListener(rateListener); |
1,331,290 | private static Set<InjectableBean<?>> resolve(List<InjectableBean<?>> matching) {<NEW_LINE>if (matching.isEmpty()) {<NEW_LINE>return Collections.emptySet();<NEW_LINE>} else if (matching.size() == 1) {<NEW_LINE>return Set.of(matching.get(0));<NEW_LINE>}<NEW_LINE>// Try to resolve the ambiguity and return the set of disambiguated beans<NEW_LINE>// First remove the default beans<NEW_LINE>List<InjectableBean<?>> nonDefault = new ArrayList<>(matching);<NEW_LINE>nonDefault.removeIf(InjectableBean::isDefaultBean);<NEW_LINE>if (nonDefault.isEmpty()) {<NEW_LINE>// All the matching beans were default<NEW_LINE>return Set.copyOf(matching);<NEW_LINE>} else if (nonDefault.size() == 1) {<NEW_LINE>return Set.of(nonDefault.get(0));<NEW_LINE>}<NEW_LINE>// More than one non-default bean remains - eliminate beans that don't have a priority<NEW_LINE>List<InjectableBean<?>> priorityBeans = new ArrayList<>(nonDefault);<NEW_LINE>priorityBeans.removeIf(not(ArcContainerImpl::isAlternativeOrDeclaredOnAlternative));<NEW_LINE>if (priorityBeans.isEmpty()) {<NEW_LINE>// No alternative/priority beans are present<NEW_LINE>return Set.copyOf(nonDefault);<NEW_LINE>} else if (priorityBeans.size() == 1) {<NEW_LINE>return Set.of<MASK><NEW_LINE>} else {<NEW_LINE>// Keep only the highest priorities<NEW_LINE>priorityBeans.sort(ArcContainerImpl::compareAlternativeBeans);<NEW_LINE>Integer highest = getAlternativePriority(priorityBeans.get(0));<NEW_LINE>priorityBeans.removeIf(bean -> !highest.equals(getAlternativePriority(bean)));<NEW_LINE>if (priorityBeans.size() == 1) {<NEW_LINE>return Set.of(priorityBeans.get(0));<NEW_LINE>}<NEW_LINE>return Set.copyOf(priorityBeans);<NEW_LINE>}<NEW_LINE>} | (priorityBeans.get(0)); |
1,164,498 | public void fload(int iArg) {<NEW_LINE>this.countLabels = 0;<NEW_LINE>this.stackDepth++;<NEW_LINE>if (this.maxLocals <= iArg) {<NEW_LINE>this.maxLocals = iArg + 1;<NEW_LINE>}<NEW_LINE>if (this.stackDepth > this.stackMax)<NEW_LINE>this.stackMax = this.stackDepth;<NEW_LINE>if (iArg > 255) {<NEW_LINE>// Widen<NEW_LINE>if (this.classFileOffset + 3 >= this.bCodeStream.length) {<NEW_LINE>resizeByteArray();<NEW_LINE>}<NEW_LINE>this.position += 2;<NEW_LINE>this.bCodeStream[this<MASK><NEW_LINE>this.bCodeStream[this.classFileOffset++] = Opcodes.OPC_fload;<NEW_LINE>writeUnsignedShort(iArg);<NEW_LINE>} else {<NEW_LINE>if (this.classFileOffset + 1 >= this.bCodeStream.length) {<NEW_LINE>resizeByteArray();<NEW_LINE>}<NEW_LINE>this.position += 2;<NEW_LINE>this.bCodeStream[this.classFileOffset++] = Opcodes.OPC_fload;<NEW_LINE>this.bCodeStream[this.classFileOffset++] = (byte) iArg;<NEW_LINE>}<NEW_LINE>} | .classFileOffset++] = Opcodes.OPC_wide; |
760,845 | private void testHelper(boolean bindToJavaGlobal) throws Exception {<NEW_LINE>// Local short<NEW_LINE>ConfigTestsLocalEJB bean = lookupShort();<NEW_LINE>assertNotNull("1 ---> ConfigTestsLocalEJB short default lookup did not succeed.", bean);<NEW_LINE>String str = bean.getString();<NEW_LINE>assertEquals("2 ---> getString() returned unexpected value", "Success", str);<NEW_LINE>// Remote Short<NEW_LINE>ConfigTestsRemoteEJB rbean = lookupRemoteShort();<NEW_LINE>assertNotNull("3 ---> ConfigTestsRemoteEJB short default lookup did not succeed.", rbean);<NEW_LINE>String rstr = rbean.getString();<NEW_LINE><MASK><NEW_LINE>// Local Long<NEW_LINE>ConfigTestsLocalEJB longBean = lookupLong();<NEW_LINE>assertNotNull("5 ---> ConfigTestsLocalEJB long default lookup did not succeed.", longBean);<NEW_LINE>String lstr = longBean.getString();<NEW_LINE>assertEquals("6 ---> getString() returned unexpected value", "Success", lstr);<NEW_LINE>// Remote Long<NEW_LINE>ConfigTestsRemoteEJB rlongBean = lookupRemoteLong();<NEW_LINE>assertNotNull("7 ---> ConfigTestsRemoteEJB long default lookup did not succeed.", rlongBean);<NEW_LINE>String rlstr = rlongBean.getString();<NEW_LINE>assertEquals("8 ---> getString() returned unexpected value", "Success", rlstr);<NEW_LINE>// use helper bean to lookup java namespaces because of java:module<NEW_LINE>JavaColonLookupLocalHome home = (JavaColonLookupLocalHome) ctx.lookup("ejblocal:ConfigTestsTestApp/ConfigTestsEJB.jar/JavaColonLookupBean#com.ibm.ws.ejbcontainer.bindings.configtests.ejb.JavaColonLookupLocalHome");<NEW_LINE>JavaColonLookupLocalEJB jclbean = home.create();<NEW_LINE>jclbean.lookupJavaNamespaces(bindToJavaGlobal);<NEW_LINE>} | assertEquals("4 ---> getString() returned unexpected value", "Success", rstr); |
1,670,738 | public String resolveProperty(PropertyExpansionContext context, String propertyName, boolean globalOverride) {<NEW_LINE>Object property = null;<NEW_LINE>String xpath = null;<NEW_LINE>int sepIx = <MASK><NEW_LINE>if (sepIx == 0) {<NEW_LINE>propertyName = propertyName.substring(1);<NEW_LINE>sepIx = propertyName.indexOf(PropertyExpansion.PROPERTY_SEPARATOR);<NEW_LINE>}<NEW_LINE>if (sepIx > 0) {<NEW_LINE>xpath = propertyName.substring(sepIx + 1);<NEW_LINE>propertyName = propertyName.substring(0, sepIx);<NEW_LINE>}<NEW_LINE>if (globalOverride) {<NEW_LINE>property = PropertyExpansionUtils.getGlobalProperty(propertyName);<NEW_LINE>}<NEW_LINE>if (property == null) {<NEW_LINE>property = context.getProperty(propertyName);<NEW_LINE>}<NEW_LINE>if (property != null && xpath != null) {<NEW_LINE>property = ResolverUtils.extractXPathPropertyValue(property, PropertyExpander.expandProperties(context, xpath));<NEW_LINE>}<NEW_LINE>return property == null ? null : property.toString();<NEW_LINE>} | propertyName.indexOf(PropertyExpansion.PROPERTY_SEPARATOR); |
1,462,026 | default void emitValue(@Nullable T value, Sinks.EmitFailureHandler failureHandler) {<NEW_LINE>if (value == null) {<NEW_LINE>emitEmpty(failureHandler);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>for (; ; ) {<NEW_LINE>Sinks.EmitResult emitResult = tryEmitValue(value);<NEW_LINE>if (emitResult.isSuccess()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>boolean shouldRetry = failureHandler.onEmitFailure(SignalType.ON_NEXT, emitResult);<NEW_LINE>if (shouldRetry) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>switch(emitResult) {<NEW_LINE>case FAIL_ZERO_SUBSCRIBER:<NEW_LINE>// we want to "discard" without rendering the sink terminated.<NEW_LINE>// effectively NO-OP cause there's no subscriber, so no context :(<NEW_LINE>return;<NEW_LINE>case FAIL_OVERFLOW:<NEW_LINE>Operators.<MASK><NEW_LINE>// the emitError will onErrorDropped if already terminated<NEW_LINE>emitError(Exceptions.failWithOverflow("Backpressure overflow during Sinks.One#emitValue"), failureHandler);<NEW_LINE>return;<NEW_LINE>case FAIL_CANCELLED:<NEW_LINE>Operators.onDiscard(value, currentContext());<NEW_LINE>return;<NEW_LINE>case FAIL_TERMINATED:<NEW_LINE>Operators.onNextDropped(value, currentContext());<NEW_LINE>return;<NEW_LINE>case FAIL_NON_SERIALIZED:<NEW_LINE>throw new EmissionException(emitResult, "Spec. Rule 1.3 - onSubscribe, onNext, onError and onComplete signaled to a Subscriber MUST be signaled serially.");<NEW_LINE>default:<NEW_LINE>throw new EmissionException(emitResult, "Unknown emitResult value");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | onDiscard(value, currentContext()); |
946,606 | // GEN-LAST:event_createNewPlatform<NEW_LINE>private void librariesBrowseActionPerformed(java.awt.event.ActionEvent evt) {<NEW_LINE>// GEN-FIRST:event_librariesBrowseActionPerformed<NEW_LINE>if (!isSharable) {<NEW_LINE>boolean result = makeSharable(uiProperties);<NEW_LINE>if (result) {<NEW_LINE>isSharable = true;<NEW_LINE>sharedLibrariesLabel.setEnabled(true);<NEW_LINE>librariesLocation.setEnabled(true);<NEW_LINE>librariesLocation.setText(uiProperties.getProject().<MASK><NEW_LINE>// NOI18N<NEW_LINE>Mnemonics.setLocalizedText(librariesBrowse, NbBundle.getMessage(CustomizerLibraries.class, "LBL_CustomizerLibraries_Browse_JButton"));<NEW_LINE>updateJars(uiProperties.JAVAC_CLASSPATH_MODEL.getDefaultListModel());<NEW_LINE>updateJars(uiProperties.JAVAC_PROCESSORPATH_MODEL);<NEW_LINE>updateJars(uiProperties.JAVAC_TEST_CLASSPATH_MODEL);<NEW_LINE>updateJars(uiProperties.ENDORSED_CLASSPATH_MODEL);<NEW_LINE>updateJars(uiProperties.RUN_TEST_CLASSPATH_MODEL);<NEW_LINE>switchLibrary();<NEW_LINE>cleanupOldLibraryReferences();<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>File prjLoc = FileUtil.toFile(uiProperties.getProject().getProjectDirectory());<NEW_LINE>String[] s = splitPath(librariesLocation.getText().trim());<NEW_LINE>String loc = SharableLibrariesUtils.browseForLibraryLocation(s[0], this, prjLoc);<NEW_LINE>if (loc != null) {<NEW_LINE>librariesLocation.setText(s[1] != null ? loc + File.separator + s[1] : loc + File.separator + SharableLibrariesUtils.DEFAULT_LIBRARIES_FILENAME);<NEW_LINE>switchLibrary();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | getAntProjectHelper().getLibrariesLocation()); |
183,878 | public void collapseGraph(CallGraphNode node) {<NEW_LINE>// need to undo (remove in and out nodes<NEW_LINE>// who are not in center list)<NEW_LINE>ArrayList inputsToRemove = new ArrayList();<NEW_LINE>ArrayList outputsToRemove = new ArrayList();<NEW_LINE>ArrayList nodesToRemove = new ArrayList();<NEW_LINE>if (node.getInputs() != null) {<NEW_LINE>Iterator inIt = node.getInputs().iterator();<NEW_LINE>while (inIt.hasNext()) {<NEW_LINE>Edge next = (Edge) inIt.next();<NEW_LINE>CallGraphNode src = (CallGraphNode) next.getSrc();<NEW_LINE>if (src.isLeaf()) {<NEW_LINE>inputsToRemove.add(next);<NEW_LINE>nodesToRemove.add(src);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (node.getOutputs() != null) {<NEW_LINE>Iterator outIt = node.getOutputs().iterator();<NEW_LINE>while (outIt.hasNext()) {<NEW_LINE>Edge next = (Edge) outIt.next();<NEW_LINE>CallGraphNode tgt = (CallGraphNode) next.getTgt();<NEW_LINE>if (tgt.isLeaf()) {<NEW_LINE>outputsToRemove.add(next);<NEW_LINE>nodesToRemove.add(tgt);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>Iterator inRIt = inputsToRemove.iterator();<NEW_LINE>while (inRIt.hasNext()) {<NEW_LINE>Edge temp = <MASK><NEW_LINE>node.removeInput(temp);<NEW_LINE>}<NEW_LINE>Iterator outRIt = outputsToRemove.iterator();<NEW_LINE>while (outRIt.hasNext()) {<NEW_LINE>Edge temp = (Edge) outRIt.next();<NEW_LINE>node.removeInput(temp);<NEW_LINE>}<NEW_LINE>Iterator nodeRIt = nodesToRemove.iterator();<NEW_LINE>while (nodeRIt.hasNext()) {<NEW_LINE>CallGraphNode temp = (CallGraphNode) nodeRIt.next();<NEW_LINE>temp.removeAllInputs();<NEW_LINE>temp.removeAllOutputs();<NEW_LINE>getGraph().removeChild(temp);<NEW_LINE>}<NEW_LINE>node.setExpand(true);<NEW_LINE>} | (Edge) inRIt.next(); |
948,954 | public synchronized void shutdown() {<NEW_LINE>if (running.get()) {<NEW_LINE>// Make sure all dependent bean instances obtained via CDI.current() are destroyed correctly<NEW_LINE>CDI<?> cdi = CDI.current();<NEW_LINE>if (cdi instanceof ArcCDI) {<NEW_LINE>ArcCDI arcCdi = (ArcCDI) cdi;<NEW_LINE>arcCdi.destroy();<NEW_LINE>}<NEW_LINE>// Terminate request context if for any reason is still active<NEW_LINE>requestContext.terminate();<NEW_LINE>// Fire an event with qualifier @BeforeDestroyed(ApplicationScoped.class)<NEW_LINE>Set<Annotation> beforeDestroyQualifiers = new HashSet<>(4);<NEW_LINE>beforeDestroyQualifiers.add(BeforeDestroyed.Literal.APPLICATION);<NEW_LINE>beforeDestroyQualifiers.add(Any.Literal.INSTANCE);<NEW_LINE>try {<NEW_LINE>EventImpl.createNotifier(Object.class, Object.class, beforeDestroyQualifiers, this, false).notify(toString());<NEW_LINE>} catch (Exception e) {<NEW_LINE>LOGGER.warn("An error occurred during delivery of the @BeforeDestroyed(ApplicationScoped.class) event", e);<NEW_LINE>}<NEW_LINE>// Destroy contexts<NEW_LINE>applicationContext.destroy();<NEW_LINE>// Fire an event with qualifier @Destroyed(ApplicationScoped.class)<NEW_LINE>Set<Annotation> destroyQualifiers = new HashSet<>(4);<NEW_LINE>destroyQualifiers.add(Destroyed.Literal.APPLICATION);<NEW_LINE>destroyQualifiers.add(Any.Literal.INSTANCE);<NEW_LINE>try {<NEW_LINE>EventImpl.createNotifier(Object.class, Object.class, destroyQualifiers, this, false<MASK><NEW_LINE>} catch (Exception e) {<NEW_LINE>LOGGER.warn("An error occurred during delivery of the @Destroyed(ApplicationScoped.class) event", e);<NEW_LINE>}<NEW_LINE>singletonContext.destroy();<NEW_LINE>// Clear caches<NEW_LINE>Reflections.clearCaches();<NEW_LINE>contexts.clear();<NEW_LINE>resolved.clear();<NEW_LINE>running.set(false);<NEW_LINE>InterceptedStaticMethods.clear();<NEW_LINE>LOGGER.debugf("ArC DI container shut down");<NEW_LINE>}<NEW_LINE>} | ).notify(toString()); |
496,078 | private Mono<Response<Flux<ByteBuffer>>> swapPublicIpAddressesWithResponseAsync(String location, LoadBalancerVipSwapRequest parameters, Context context) {<NEW_LINE>if (this.client.getEndpoint() == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (location == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (this.client.getSubscriptionId() == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (parameters == null) {<NEW_LINE>return Mono.<MASK><NEW_LINE>} else {<NEW_LINE>parameters.validate();<NEW_LINE>}<NEW_LINE>final String apiVersion = "2021-05-01";<NEW_LINE>final String accept = "application/json";<NEW_LINE>context = this.client.mergeContext(context);<NEW_LINE>return service.swapPublicIpAddresses(this.client.getEndpoint(), location, apiVersion, this.client.getSubscriptionId(), parameters, accept, context);<NEW_LINE>} | error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); |
989,691 | public static Operation createInstance(AnnotationModel annotation, ApiContext context) {<NEW_LINE>OperationImpl from = new OperationImpl();<NEW_LINE>from.setSummary(annotation.getValue("summary", String.class));<NEW_LINE>from.setDescription(annotation.getValue<MASK><NEW_LINE>AnnotationModel externalDocs = annotation.getValue("externalDocs", AnnotationModel.class);<NEW_LINE>if (externalDocs != null) {<NEW_LINE>from.setExternalDocs(ExternalDocumentationImpl.createInstance(externalDocs));<NEW_LINE>}<NEW_LINE>from.setOperationId(annotation.getValue("operationId", String.class));<NEW_LINE>extractAnnotations(annotation, context, "parameters", ParameterImpl::createInstance, from::addParameter);<NEW_LINE>AnnotationModel requestBody = annotation.getValue("requestBody", AnnotationModel.class);<NEW_LINE>if (requestBody != null) {<NEW_LINE>from.setRequestBody(RequestBodyImpl.createInstance(requestBody, context));<NEW_LINE>}<NEW_LINE>extractAnnotations(annotation, context, "responses", "responseCode", APIResponseImpl::createInstance, from.responses::addAPIResponse);<NEW_LINE>extractAnnotations(annotation, context, "callbacks", "name", CallbackImpl::createInstance, from::addCallback);<NEW_LINE>from.setDeprecated(annotation.getValue("deprecated", Boolean.class));<NEW_LINE>extractAnnotations(annotation, context, "security", SecurityRequirementImpl::createInstance, from::addSecurityRequirement);<NEW_LINE>extractAnnotations(annotation, context, "servers", ServerImpl::createInstance, from::addServer);<NEW_LINE>from.setMethod(annotation.getValue("method", String.class));<NEW_LINE>return from;<NEW_LINE>} | ("description", String.class)); |
238,535 | private void executeAggregation(OCommandContext ctx, int nRecords) {<NEW_LINE>long timeoutBegin = System.currentTimeMillis();<NEW_LINE>if (!prev.isPresent()) {<NEW_LINE>throw new OCommandExecutionException("Cannot execute an aggregation or a GROUP BY without a previous result");<NEW_LINE>}<NEW_LINE>OExecutionStepInternal prevStep = prev.get();<NEW_LINE>OResultSet lastRs = prevStep.syncPull(ctx, nRecords);<NEW_LINE>while (lastRs.hasNext()) {<NEW_LINE>if (timeoutMillis > 0 && timeoutBegin + timeoutMillis < System.currentTimeMillis()) {<NEW_LINE>sendTimeout();<NEW_LINE>}<NEW_LINE>aggregate(lastRs.next(), ctx);<NEW_LINE>if (!lastRs.hasNext()) {<NEW_LINE>lastRs = prevStep.syncPull(ctx, nRecords);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>finalResults = new ArrayList<>();<NEW_LINE>finalResults.<MASK><NEW_LINE>aggregateResults.clear();<NEW_LINE>for (OResultInternal item : finalResults) {<NEW_LINE>if (timeoutMillis > 0 && timeoutBegin + timeoutMillis < System.currentTimeMillis()) {<NEW_LINE>sendTimeout();<NEW_LINE>}<NEW_LINE>for (String name : item.getTemporaryProperties()) {<NEW_LINE>Object prevVal = item.getTemporaryProperty(name);<NEW_LINE>if (prevVal instanceof AggregationContext) {<NEW_LINE>item.setTemporaryProperty(name, ((AggregationContext) prevVal).getFinalValue());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | addAll(aggregateResults.values()); |
1,093,815 | static void purgeFinishedDir(FileSystem fs, Path finishedDir, LocalDate cutOffDate) throws IOException {<NEW_LINE>FileStatus[] yearDirs = fs.listStatus(finishedDir, path -> path.getName().matches("\\d{4}"));<NEW_LINE>for (FileStatus yearDir : yearDirs) {<NEW_LINE>int year = Integer.parseInt(yearDir.getPath().getName());<NEW_LINE>LocalDate pathDate = LocalDate.ofYearDay(year, 1).with(TemporalAdjusters.lastDayOfYear());<NEW_LINE>if (pathDate.isBefore(cutOffDate)) {<NEW_LINE>fs.delete(yearDir.getPath(), true);<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>FileStatus[] monthDirs = fs.listStatus(yearDir.getPath(), path -> path.getName().matches("\\d{2}"));<NEW_LINE>for (FileStatus monthDir : monthDirs) {<NEW_LINE>int month = Integer.parseInt(monthDir.getPath().getName());<NEW_LINE>pathDate = LocalDate.of(year, month, 1).<MASK><NEW_LINE>if (pathDate.isBefore(cutOffDate)) {<NEW_LINE>fs.delete(monthDir.getPath(), true);<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>FileStatus[] dayDirs = fs.listStatus(monthDir.getPath(), path -> path.getName().matches("\\d{2}"));<NEW_LINE>for (FileStatus dayDir : dayDirs) {<NEW_LINE>int day = Integer.parseInt(dayDir.getPath().getName());<NEW_LINE>pathDate = LocalDate.of(year, month, day);<NEW_LINE>if (pathDate.isBefore(cutOffDate)) {<NEW_LINE>fs.delete(dayDir.getPath(), true);<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | with(TemporalAdjusters.lastDayOfMonth()); |
1,215,077 | static long readLongFast(final ByteBuf buffer) {<NEW_LINE>int b = buffer.readByte();<NEW_LINE>long result = b & 0x7F;<NEW_LINE>if ((b & 0x80) != 0) {<NEW_LINE>b = buffer.readByte();<NEW_LINE>result |= (b & 0x7F) << 7;<NEW_LINE>if ((b & 0x80) != 0) {<NEW_LINE>b = buffer.readByte();<NEW_LINE>result |= (b & 0x7F) << 14;<NEW_LINE>if ((b & 0x80) != 0) {<NEW_LINE>b = buffer.readByte();<NEW_LINE>result |= (b & 0x7F) << 21;<NEW_LINE>if ((b & 0x80) != 0) {<NEW_LINE>b = buffer.readByte();<NEW_LINE>result |= (long) (b & 0x7F) << 28;<NEW_LINE>if ((b & 0x80) != 0) {<NEW_LINE>b = buffer.readByte();<NEW_LINE>result |= (long) (b & 0x7F) << 35;<NEW_LINE>if ((b & 0x80) != 0) {<NEW_LINE>b = buffer.readByte();<NEW_LINE>result |= (long<MASK><NEW_LINE>if ((b & 0x80) != 0) {<NEW_LINE>b = buffer.readByte();<NEW_LINE>result |= (long) (b & 0x7F) << 49;<NEW_LINE>if ((b & 0x80) != 0) {<NEW_LINE>b = buffer.readByte();<NEW_LINE>result |= (long) b << 56;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>} | ) (b & 0x7F) << 42; |
1,025,627 | public void render(@Nonnull RevolvershotEntity entity, float entityYaw, float partialTicks, PoseStack matrixStackIn, MultiBufferSource bufferIn, int packedLightIn) {<NEW_LINE>matrixStackIn.pushPose();<NEW_LINE>VertexConsumer builder = bufferIn.getBuffer(IERenderTypes.getPositionTex(getTextureLocation(entity)));<NEW_LINE>matrixStackIn.mulPose(new Quaternion(0, entity.yRotO + (entity.yRot - entity.yRotO) * partialTicks - 90.0F, 0, true));<NEW_LINE>matrixStackIn.mulPose(new Quaternion(0.0F, 0.0F, entity.xRotO + (entity.xRot - entity.xRotO) * partialTicks, true));<NEW_LINE>matrixStackIn.<MASK><NEW_LINE>Matrix4f mat = matrixStackIn.last().pose();<NEW_LINE>builder.vertex(mat, 0, 0, -.25f).uv(5 / 32f, 10 / 32f).endVertex();<NEW_LINE>builder.vertex(mat, 0, 0, .25f).uv(0 / 32f, 10 / 32f).endVertex();<NEW_LINE>builder.vertex(mat, 0, .5f, .25f).uv(0 / 32f, 5 / 32f).endVertex();<NEW_LINE>builder.vertex(mat, 0, .5f, -.25f).uv(5 / 32f, 5 / 32f).endVertex();<NEW_LINE>builder.vertex(mat, .375f, .125f, 0).uv(8 / 32f, 5 / 32f).endVertex();<NEW_LINE>builder.vertex(mat, 0, .125f, 0).uv(0 / 32f, 5 / 32f).endVertex();<NEW_LINE>builder.vertex(mat, 0, .375f, 0).uv(0 / 32f, 0 / 32f).endVertex();<NEW_LINE>builder.vertex(mat, .375f, .375f, 0).uv(8 / 32f, 0 / 32f).endVertex();<NEW_LINE>builder.vertex(mat, .375f, .25f, -.25f).uv(8 / 32f, 5 / 32f).endVertex();<NEW_LINE>builder.vertex(mat, 0, .25f, -.25f).uv(0 / 32f, 5 / 32f).endVertex();<NEW_LINE>builder.vertex(mat, 0, .25f, .25f).uv(0 / 32f, 0 / 32f).endVertex();<NEW_LINE>builder.vertex(mat, .375f, .25f, .25f).uv(8 / 32f, 0 / 32f).endVertex();<NEW_LINE>matrixStackIn.popPose();<NEW_LINE>} | scale(0.25F, 0.25F, 0.25F); |
1,554,511 | public static void removeLegacyNonScopesFromMapping(Map<ScopeImpl, PvmExecutionImpl> mapping) {<NEW_LINE>Map<PvmExecutionImpl, List<ScopeImpl>> scopesForExecutions = new HashMap<PvmExecutionImpl, List<ScopeImpl>>();<NEW_LINE>for (Map.Entry<ScopeImpl, PvmExecutionImpl> mappingEntry : mapping.entrySet()) {<NEW_LINE>List<ScopeImpl> scopesForExecution = scopesForExecutions.get(mappingEntry.getValue());<NEW_LINE>if (scopesForExecution == null) {<NEW_LINE>scopesForExecution = new ArrayList<ScopeImpl>();<NEW_LINE>scopesForExecutions.put(mappingEntry.getValue(), scopesForExecution);<NEW_LINE>}<NEW_LINE>scopesForExecution.add(mappingEntry.getKey());<NEW_LINE>}<NEW_LINE>for (Map.Entry<PvmExecutionImpl, List<ScopeImpl>> scopesForExecution : scopesForExecutions.entrySet()) {<NEW_LINE>List<ScopeImpl<MASK><NEW_LINE>if (scopes.size() > 1) {<NEW_LINE>ScopeImpl topMostScope = getTopMostScope(scopes);<NEW_LINE>for (ScopeImpl scope : scopes) {<NEW_LINE>if (scope != scope.getProcessDefinition() && scope != topMostScope) {<NEW_LINE>mapping.remove(scope);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | > scopes = scopesForExecution.getValue(); |
1,250,130 | public int handleParseException(ParameterException ex, String[] args) {<NEW_LINE><MASK><NEW_LINE>CommandSpec spec = cmd.getCommandSpec();<NEW_LINE>// bold red<NEW_LINE>output.error(ex.getMessage());<NEW_LINE>output.printStackTrace(ex);<NEW_LINE>UnmatchedArgumentException.printSuggestions(ex, output.err());<NEW_LINE>// normal text to error stream<NEW_LINE>output.err().println(cmd.getHelp().fullSynopsis());<NEW_LINE>if (spec.equals(spec.root())) {<NEW_LINE>// normal text to error stream<NEW_LINE>output.err().println(cmd.getHelp().commandList());<NEW_LINE>}<NEW_LINE>output.err().printf("See '%s --help' for more information.%n", spec.qualifiedName());<NEW_LINE>output.err().flush();<NEW_LINE>return cmd.getExitCodeExceptionMapper() != null ? cmd.getExitCodeExceptionMapper().getExitCode(ex) : spec.exitCodeOnInvalidInput();<NEW_LINE>} | CommandLine cmd = ex.getCommandLine(); |
129,786 | public VpnStaticRoute unmarshall(StaxUnmarshallerContext context) throws Exception {<NEW_LINE>VpnStaticRoute vpnStaticRoute = new VpnStaticRoute();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>if (context.isStartOfDocument())<NEW_LINE>targetDepth += 1;<NEW_LINE>while (true) {<NEW_LINE>int xmlEvent = context.nextEvent();<NEW_LINE>if (xmlEvent == XmlPullParser.END_DOCUMENT)<NEW_LINE>return vpnStaticRoute;<NEW_LINE>if (xmlEvent == XmlPullParser.START_TAG) {<NEW_LINE>if (context.testExpression("destinationCidrBlock", targetDepth)) {<NEW_LINE>vpnStaticRoute.setDestinationCidrBlock(StringStaxUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (context.testExpression("source", targetDepth)) {<NEW_LINE>vpnStaticRoute.setSource(StringStaxUnmarshaller.getInstance<MASK><NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (context.testExpression("state", targetDepth)) {<NEW_LINE>vpnStaticRoute.setState(StringStaxUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>} else if (xmlEvent == XmlPullParser.END_TAG) {<NEW_LINE>if (context.getCurrentDepth() < originalDepth) {<NEW_LINE>return vpnStaticRoute;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | ().unmarshall(context)); |
1,568,772 | public static void readJson(List<ConsumerJsonRecord> jsonRecords, Iterator recordIterator, ConsumerLocalConfigs consumerLocalConfig) throws IOException {<NEW_LINE>while (recordIterator.hasNext()) {<NEW_LINE>ConsumerRecord thisRecord = (ConsumerRecord) recordIterator.next();<NEW_LINE>Object key = thisRecord.key();<NEW_LINE>Object valueObj = thisRecord.value();<NEW_LINE>Headers headers = thisRecord.headers();<NEW_LINE>String keyStr = thisRecord.key() != null ? thisRecord.key().toString() : "";<NEW_LINE>String valueStr = consumerLocalConfig != null && KafkaConstants.PROTO.equalsIgnoreCase(consumerLocalConfig.getRecordType()) ? convertProtobufToJson(thisRecord, consumerLocalConfig) : valueObj.toString();<NEW_LINE>LOGGER.info("\nRecord Key - {} , Record value - {}, Record partition - {}, Record offset - {}, Headers - {}", key, valueStr, thisRecord.partition(), thisRecord.offset(), headers);<NEW_LINE>JsonNode keyNode = objectMapper.readTree(keyStr);<NEW_LINE>JsonNode <MASK><NEW_LINE>Map<String, String> headersMap = null;<NEW_LINE>if (headers != null) {<NEW_LINE>headersMap = new HashMap<>();<NEW_LINE>for (Header header : headers) {<NEW_LINE>headersMap.put(header.key(), new String(header.value()));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>ConsumerJsonRecord jsonRecord = new ConsumerJsonRecord(keyNode, valueNode, headersMap);<NEW_LINE>jsonRecords.add(jsonRecord);<NEW_LINE>}<NEW_LINE>} | valueNode = objectMapper.readTree(valueStr); |
264,021 | public void trimAllThreads(int length, long trimBeforeDate) {<NEW_LINE>if (length == NO_TRIM_MESSAGE_COUNT_SET && trimBeforeDate == NO_TRIM_BEFORE_DATE_SET) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>SQLiteDatabase db = databaseHelper.getSignalWritableDatabase();<NEW_LINE>AttachmentDatabase attachmentDatabase = SignalDatabase.attachments();<NEW_LINE>GroupReceiptDatabase groupReceiptDatabase = SignalDatabase.groupReceipts();<NEW_LINE>MmsSmsDatabase mmsSmsDatabase = SignalDatabase.mmsSms();<NEW_LINE><MASK><NEW_LINE>int deletes = 0;<NEW_LINE>try (Cursor cursor = databaseHelper.getSignalReadableDatabase().query(TABLE_NAME, new String[] { ID }, null, null, null, null, null)) {<NEW_LINE>while (cursor != null && cursor.moveToNext()) {<NEW_LINE>trimThreadInternal(CursorUtil.requireLong(cursor, ID), length, trimBeforeDate);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>db.beginTransaction();<NEW_LINE>try {<NEW_LINE>mmsSmsDatabase.deleteAbandonedMessages();<NEW_LINE>attachmentDatabase.trimAllAbandonedAttachments();<NEW_LINE>groupReceiptDatabase.deleteAbandonedRows();<NEW_LINE>mentionDatabase.deleteAbandonedMentions();<NEW_LINE>deletes = attachmentDatabase.deleteAbandonedAttachmentFiles();<NEW_LINE>db.setTransactionSuccessful();<NEW_LINE>} finally {<NEW_LINE>db.endTransaction();<NEW_LINE>}<NEW_LINE>if (deletes > 0) {<NEW_LINE>Log.i(TAG, "Trim all threads caused " + deletes + " attachments to be deleted.");<NEW_LINE>}<NEW_LINE>notifyAttachmentListeners();<NEW_LINE>notifyStickerPackListeners();<NEW_LINE>} | MentionDatabase mentionDatabase = SignalDatabase.mentions(); |
778,050 | public void initChannel(Channel ch) {<NEW_LINE>ChannelPipeline pipeline = ch.pipeline();<NEW_LINE><MASK><NEW_LINE>HttpRequestHandlerChain invalidRequestHandler = new InvalidRequestHandler();<NEW_LINE>int maxRequestSize = ConfigManager.getInstance().getMaxRequestSize();<NEW_LINE>if (sslCtx != null) {<NEW_LINE>pipeline.addLast("ssl", sslCtx.newHandler(ch.alloc()));<NEW_LINE>}<NEW_LINE>pipeline.addLast("http", new HttpServerCodec());<NEW_LINE>pipeline.addLast("aggregator", new HttpObjectAggregator(maxRequestSize));<NEW_LINE>HttpRequestHandlerChain httpRequestHandlerChain = apiDescriptionRequestHandler;<NEW_LINE>if (ConnectorType.BOTH.equals(connectorType) || ConnectorType.INFERENCE_CONNECTOR.equals(connectorType)) {<NEW_LINE>httpRequestHandlerChain = httpRequestHandlerChain.setNextHandler(new InferenceRequestHandler(PluginsManager.getInstance().getInferenceEndpoints()));<NEW_LINE>}<NEW_LINE>if (ConnectorType.BOTH.equals(connectorType) || ConnectorType.MANAGEMENT_CONNECTOR.equals(connectorType)) {<NEW_LINE>httpRequestHandlerChain = httpRequestHandlerChain.setNextHandler(new ManagementRequestHandler(PluginsManager.getInstance().getManagementEndpoints()));<NEW_LINE>}<NEW_LINE>httpRequestHandlerChain.setNextHandler(invalidRequestHandler);<NEW_LINE>pipeline.addLast("handler", new HttpRequestHandler(apiDescriptionRequestHandler));<NEW_LINE>} | HttpRequestHandlerChain apiDescriptionRequestHandler = new ApiDescriptionRequestHandler(connectorType); |
1,109,119 | private static SQLResponse executeAndConvertResult(PreparedStatement preparedStatement) throws SQLException {<NEW_LINE>if (preparedStatement.execute()) {<NEW_LINE>ResultSetMetaData metadata = preparedStatement.getMetaData();<NEW_LINE>ResultSet resultSet = preparedStatement.getResultSet();<NEW_LINE>List<Object[]> rows = new ArrayList<>();<NEW_LINE>List<String> columnNames = new ArrayList<>(metadata.getColumnCount());<NEW_LINE>DataType[] dataTypes = new DataType[metadata.getColumnCount()];<NEW_LINE>for (int i = 0; i < metadata.getColumnCount(); i++) {<NEW_LINE>columnNames.add(metadata.getColumnName(i + 1));<NEW_LINE>}<NEW_LINE>while (resultSet.next()) {<NEW_LINE>Object[] row = new Object[metadata.getColumnCount()];<NEW_LINE>for (int i = 0; i < row.length; i++) {<NEW_LINE>Object value;<NEW_LINE>String typeName = metadata.getColumnTypeName(i + 1);<NEW_LINE>value = getObject(resultSet, i, typeName);<NEW_LINE>row[i] = value;<NEW_LINE>}<NEW_LINE>rows.add(row);<NEW_LINE>}<NEW_LINE>return new SQLResponse(columnNames.toArray(new String[0]), rows.toArray(new Object[0][]), <MASK><NEW_LINE>} else {<NEW_LINE>int updateCount = preparedStatement.getUpdateCount();<NEW_LINE>if (updateCount < 0) {<NEW_LINE>updateCount += 1;<NEW_LINE>}<NEW_LINE>return new SQLResponse(new String[0], new Object[0][], new DataType[0], updateCount);<NEW_LINE>}<NEW_LINE>} | dataTypes, rows.size()); |
666,159 | public Request<CreateBackupRequest> marshall(CreateBackupRequest createBackupRequest) {<NEW_LINE>if (createBackupRequest == null) {<NEW_LINE>throw new AmazonClientException("Invalid argument passed to marshall(CreateBackupRequest)");<NEW_LINE>}<NEW_LINE>Request<CreateBackupRequest> request = new DefaultRequest<CreateBackupRequest>(createBackupRequest, "AmazonDynamoDB");<NEW_LINE>String target = "DynamoDB_20120810.CreateBackup";<NEW_LINE>request.addHeader("X-Amz-Target", target);<NEW_LINE>request.setHttpMethod(HttpMethodName.POST);<NEW_LINE>String uriResourcePath = "/";<NEW_LINE>request.setResourcePath(uriResourcePath);<NEW_LINE>try {<NEW_LINE>StringWriter stringWriter = new StringWriter();<NEW_LINE>AwsJsonWriter <MASK><NEW_LINE>jsonWriter.beginObject();<NEW_LINE>if (createBackupRequest.getTableName() != null) {<NEW_LINE>String tableName = createBackupRequest.getTableName();<NEW_LINE>jsonWriter.name("TableName");<NEW_LINE>jsonWriter.value(tableName);<NEW_LINE>}<NEW_LINE>if (createBackupRequest.getBackupName() != null) {<NEW_LINE>String backupName = createBackupRequest.getBackupName();<NEW_LINE>jsonWriter.name("BackupName");<NEW_LINE>jsonWriter.value(backupName);<NEW_LINE>}<NEW_LINE>jsonWriter.endObject();<NEW_LINE>jsonWriter.close();<NEW_LINE>String snippet = stringWriter.toString();<NEW_LINE>byte[] content = snippet.getBytes(UTF8);<NEW_LINE>request.setContent(new StringInputStream(snippet));<NEW_LINE>request.addHeader("Content-Length", Integer.toString(content.length));<NEW_LINE>} catch (Throwable t) {<NEW_LINE>throw new AmazonClientException("Unable to marshall request to JSON: " + t.getMessage(), t);<NEW_LINE>}<NEW_LINE>if (!request.getHeaders().containsKey("Content-Type")) {<NEW_LINE>request.addHeader("Content-Type", "application/x-amz-json-1.0");<NEW_LINE>}<NEW_LINE>return request;<NEW_LINE>} | jsonWriter = JsonUtils.getJsonWriter(stringWriter); |
1,538,633 | private void addSMAMarkerLines(ChartInterval chartInterval, String smaSeries, String smaDaysWording, int smaDays, Color smaColor) {<NEW_LINE>ChartLineSeriesAxes smaLines = new SimpleMovingAverage(smaDays, this.<MASK><NEW_LINE>if (smaLines == null || smaLines.getValues() == null || smaLines.getDates() == null)<NEW_LINE>return;<NEW_LINE>@SuppressWarnings("nls")<NEW_LINE>String lineID = smaSeries + " (" + smaDaysWording + ")";<NEW_LINE>ILineSeries lineSeriesSMA = (ILineSeries) chart.getSeriesSet().createSeries(SeriesType.LINE, lineID);<NEW_LINE>lineSeriesSMA.setXDateSeries(smaLines.getDates());<NEW_LINE>lineSeriesSMA.setLineWidth(2);<NEW_LINE>lineSeriesSMA.enableArea(false);<NEW_LINE>lineSeriesSMA.setSymbolType(PlotSymbolType.NONE);<NEW_LINE>lineSeriesSMA.setYSeries(smaLines.getValues());<NEW_LINE>lineSeriesSMA.setAntialias(swtAntialias);<NEW_LINE>lineSeriesSMA.setLineColor(smaColor);<NEW_LINE>lineSeriesSMA.setYAxisId(0);<NEW_LINE>lineSeriesSMA.setVisibleInLegend(true);<NEW_LINE>} | security, chartInterval).getSMA(); |
1,033,888 | public void drop(DropTargetDropEvent dtde) {<NEW_LINE>if ((dtde.getDropAction() & DnDConstants.ACTION_COPY_OR_MOVE) == 0) {<NEW_LINE>dtde.rejectDrop();<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>dtde.acceptDrop(DnDConstants.ACTION_COPY);<NEW_LINE>Transferable transferable = dtde.getTransferable();<NEW_LINE>try {<NEW_LINE>// Transferable is not generic, so the cast can only be unchecked.<NEW_LINE>@SuppressWarnings("unchecked")<NEW_LINE>List<File> filelist = (List<File>) transferable.getTransferData(DataFlavor.javaFileListFlavor);<NEW_LINE>for (File f : filelist) {<NEW_LINE>filevector.add(new RowContainer(f));<NEW_LINE>model.fireTableDataChanged();<NEW_LINE>System.out.println(f.toString());<NEW_LINE>}<NEW_LINE>} catch (IOException | UnsupportedFlavorException ex) {<NEW_LINE>ex.printStackTrace();<NEW_LINE>}<NEW_LINE>dtde.dropComplete(true);<NEW_LINE>File[] filar = new File[filevector.size()];<NEW_LINE>for (int i = 0; i < filevector.size(); i++) {<NEW_LINE>filar[i] = filevector.<MASK><NEW_LINE>}<NEW_LINE>super.firePropertyChange("filevector", null, filar);<NEW_LINE>} | get(i).getFile(); |
1,352,672 | public ListOutgoingTypedLinksResult unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>ListOutgoingTypedLinksResult listOutgoingTypedLinksResult = new ListOutgoingTypedLinksResult();<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 listOutgoingTypedLinksResult;<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("TypedLinkSpecifiers", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>listOutgoingTypedLinksResult.setTypedLinkSpecifiers(new ListUnmarshaller<TypedLinkSpecifier>(TypedLinkSpecifierJsonUnmarshaller.getInstance()).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("NextToken", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>listOutgoingTypedLinksResult.setNextToken(context.getUnmarshaller(String.<MASK><NEW_LINE>}<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return listOutgoingTypedLinksResult;<NEW_LINE>} | class).unmarshall(context)); |
481,813 | private void openCommPort(String portName) throws Exception {<NEW_LINE>if (log.isDebugEnabled()) {<NEW_LINE>Enumeration portIdentifiers = CommPortIdentifier.getPortIdentifiers();<NEW_LINE>while (portIdentifiers.hasMoreElements()) {<NEW_LINE>CommPortIdentifier id = (CommPortIdentifier) portIdentifiers.nextElement();<NEW_LINE>log.debug("Found port: {} x {}", id.getName(), id.getCurrentOwner());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>CommPortIdentifier portIdentifier = null;<NEW_LINE>try {<NEW_LINE><MASK><NEW_LINE>} catch (NoSuchPortException e) {<NEW_LINE>log.debug("Port not found during first attempt : {}", e.getMessage());<NEW_LINE>}<NEW_LINE>if (portIdentifier == null) {<NEW_LINE>try {<NEW_LINE>System.setProperty(SERIAL_PORT_PROPERTY_NAME, portName);<NEW_LINE>portIdentifier = CommPortIdentifier.getPortIdentifier(portName);<NEW_LINE>} catch (Exception e) {<NEW_LINE>log.debug("Port not found during second attempt : {}", e.getMessage());<NEW_LINE>System.clearProperty(SERIAL_PORT_PROPERTY_NAME);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (portIdentifier == null) {<NEW_LINE>throw new Exception("Serial port '" + portName + "' not found.");<NEW_LINE>}<NEW_LINE>if (portIdentifier.isCurrentlyOwned()) {<NEW_LINE>throw new Exception("Serial port '" + portName + "' is in use.");<NEW_LINE>}<NEW_LINE>// open port<NEW_LINE>port = portIdentifier.open(this.getClass().getSimpleName(), CONNECT_TIMEOUT);<NEW_LINE>log.info("Connected to serial port '{}'", portIdentifier.getName());<NEW_LINE>// configure<NEW_LINE>port.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE);<NEW_LINE>port.notifyOnDataAvailable(true);<NEW_LINE>port.addEventListener(this);<NEW_LINE>} | portIdentifier = CommPortIdentifier.getPortIdentifier(portName); |
1,526,420 | public static void main(String[] args) {<NEW_LINE>// as in Figure in HLD section, not yet rooted<NEW_LINE>int N = 19;<NEW_LINE>AL = new ArrayList<>();<NEW_LINE>for (int i = 0; i < N; ++i) AL.add(new ArrayList<>());<NEW_LINE>AL.get(0).add(1);<NEW_LINE>AL.get(0).add(2);<NEW_LINE>AL.get(0).add(3);<NEW_LINE>AL.get(1).add(0);<NEW_LINE>AL.get(1).add(4);<NEW_LINE>AL.get(2).add(0);<NEW_LINE>AL.get(2).add(5);<NEW_LINE>AL.get(2).add(6);<NEW_LINE>AL.get(2).add(7);<NEW_LINE>AL.get(3).add(0);<NEW_LINE>AL.get(3).add(8);<NEW_LINE>AL.get(4).add(1);<NEW_LINE>AL.get(4).add(9);<NEW_LINE>AL.get(4).add(10);<NEW_LINE>AL.get(5).add(2);<NEW_LINE>AL.get(6).add(2);<NEW_LINE>AL.get(7).add(2);<NEW_LINE>AL.get(7).add(11);<NEW_LINE>AL.get(7).add(12);<NEW_LINE>AL.get(8).add(3);<NEW_LINE>AL.get(9).add(4);<NEW_LINE>AL.get(10).add(4);<NEW_LINE>AL.get(10).add(13);<NEW_LINE>AL.get<MASK><NEW_LINE>AL.get(11).add(14);<NEW_LINE>AL.get(12).add(7);<NEW_LINE>AL.get(12).add(15);<NEW_LINE>AL.get(13).add(10);<NEW_LINE>AL.get(14).add(11);<NEW_LINE>AL.get(14).add(16);<NEW_LINE>AL.get(15).add(12);<NEW_LINE>AL.get(15).add(17);<NEW_LINE>AL.get(15).add(18);<NEW_LINE>AL.get(16).add(14);<NEW_LINE>AL.get(17).add(15);<NEW_LINE>AL.get(18).add(15);<NEW_LINE>par = new ArrayList<>(Collections.nCopies(N, -1));<NEW_LINE>heavy = new ArrayList<>(Collections.nCopies(N, -1));<NEW_LINE>// start modified DFS from root 0<NEW_LINE>heavy_light(0);<NEW_LINE>group = new ArrayList<>(Collections.nCopies(N, -1));<NEW_LINE>// start labeling paths<NEW_LINE>decompose(0, 0);<NEW_LINE>for (int i = 0; i < N; ++i) System.out.println(i + ", parent = " + par.get(i) + ", heaviest child = " + heavy.get(i) + ", belong to heavy-paths group = " + group.get(i));<NEW_LINE>} | (11).add(7); |
1,626,831 | public static void main(String[] args) throws Exception {<NEW_LINE>Options options = new Options();<NEW_LINE>options.addRequiredOption(null, "input", true, "Plain text input file");<NEW_LINE>options.addRequiredOption(null, "lang", true, "Language code, e.g. en-US");<NEW_LINE>options.addRequiredOption(null, "threads", true, "Number of threads (NOTE: changing this will change output due to the way input is split)");<NEW_LINE>options.addRequiredOption(null, "output", true, "Output file");<NEW_LINE>options.addOption(null, "token", true, "Secret token to skip server's limits");<NEW_LINE>options.addOption(null, "url", true, "Base URL, defaults to https://api.languagetool.org");<NEW_LINE>options.addOption(null, "user", true, "User name for authentication (Basic Auth)");<NEW_LINE>// TODO: read from file instead of command line<NEW_LINE>options.addOption(null, "password", true, "Password for authentication (Basic Auth)");<NEW_LINE>CommandLine cmd = new DefaultParser().parse(options, args);<NEW_LINE>HttpApiSentenceChecker checker = new HttpApiSentenceChecker(cmd);<NEW_LINE>checker.run(new File(cmd.getOptionValue("input")), new File(<MASK><NEW_LINE>} | cmd.getOptionValue("output"))); |
64,807 | private <T> T loadSettingInstance(String settingName, Object settingValue, Class<T> clazz) {<NEW_LINE>T instance = null;<NEW_LINE>Class<? extends T> instanceClass = null;<NEW_LINE>if (clazz.isAssignableFrom(settingValue.getClass())) {<NEW_LINE>instance = (T) settingValue;<NEW_LINE>} else if (settingValue instanceof Class) {<NEW_LINE>instanceClass = (Class<? extends T>) settingValue;<NEW_LINE>} else if (settingValue instanceof String) {<NEW_LINE>String settingStringValue = (String) settingValue;<NEW_LINE>if (standardServiceRegistry != null) {<NEW_LINE>final ClassLoaderService classLoaderService = <MASK><NEW_LINE>instanceClass = classLoaderService.classForName(settingStringValue);<NEW_LINE>} else {<NEW_LINE>try {<NEW_LINE>instanceClass = (Class<? extends T>) Class.forName(settingStringValue);<NEW_LINE>} catch (ClassNotFoundException e) {<NEW_LINE>throw new IllegalArgumentException("Can't load class: " + settingStringValue, e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>throw new IllegalArgumentException("The provided " + settingName + " setting value [" + settingValue + "] is not supported!");<NEW_LINE>}<NEW_LINE>if (instanceClass != null) {<NEW_LINE>try {<NEW_LINE>instance = instanceClass.getConstructor().newInstance();<NEW_LINE>} catch (InstantiationException | IllegalAccessException | NoSuchMethodException | InvocationTargetException e) {<NEW_LINE>throw new IllegalArgumentException("The " + clazz.getSimpleName() + " class [" + instanceClass + "] could not be instantiated!", e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return instance;<NEW_LINE>} | standardServiceRegistry.getService(ClassLoaderService.class); |
878,212 | protected void writeCacheFile(final FileChannel fc, final long start, final long end, final Consumer<Long> progressUpdater) throws IOException {<NEW_LINE>assert assertFileChannelOpen(fc);<NEW_LINE>assert assertCurrentThreadMayWriteCacheFile();<NEW_LINE>final long length = end - start;<NEW_LINE>final byte[] copyBuffer = new byte[toIntBytes(Math.min(COPY_BUFFER_SIZE, length))];<NEW_LINE>logger.trace(() -> new ParameterizedMessage("writing range [{}-{}] to cache file [{}]", start, end, cacheFileReference));<NEW_LINE>long bytesCopied = 0L;<NEW_LINE>long remaining = end - start;<NEW_LINE>final <MASK><NEW_LINE>try (InputStream input = openInputStreamFromBlobStore(start, length)) {<NEW_LINE>while (remaining > 0L) {<NEW_LINE>final int bytesRead = readSafe(input, copyBuffer, start, end, remaining, cacheFileReference);<NEW_LINE>positionalWrite(fc, start + bytesCopied, ByteBuffer.wrap(copyBuffer, 0, bytesRead));<NEW_LINE>bytesCopied += bytesRead;<NEW_LINE>remaining -= bytesRead;<NEW_LINE>progressUpdater.accept(start + bytesCopied);<NEW_LINE>}<NEW_LINE>final long endTimeNanos = stats.currentTimeNanos();<NEW_LINE>stats.addCachedBytesWritten(bytesCopied, endTimeNanos - startTimeNanos);<NEW_LINE>}<NEW_LINE>} | long startTimeNanos = stats.currentTimeNanos(); |
864,322 | private void writeBytes(byte[] value, boolean invert) {<NEW_LINE>// Determine the length of the encoded array<NEW_LINE>// for separator<NEW_LINE>int encodedLength = 2;<NEW_LINE>for (byte b : value) {<NEW_LINE>if ((b == ESCAPE1) || (b == ESCAPE2)) {<NEW_LINE>encodedLength += 2;<NEW_LINE>} else {<NEW_LINE>encodedLength++;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>byte[] encodedArray = new byte[encodedLength];<NEW_LINE>int copyStart = 0;<NEW_LINE>int outIndex = 0;<NEW_LINE>for (int i = 0; i < value.length; i++) {<NEW_LINE>byte b = value[i];<NEW_LINE>if (b == ESCAPE1) {<NEW_LINE>arraycopy(invert, value, copyStart, encodedArray, outIndex, i - copyStart);<NEW_LINE>outIndex += i - copyStart;<NEW_LINE>encodedArray[outIndex++] = convert(invert, ESCAPE1);<NEW_LINE>encodedArray[outIndex++] = convert(invert, NULL_CHARACTER);<NEW_LINE>copyStart = i + 1;<NEW_LINE>} else if (b == ESCAPE2) {<NEW_LINE>arraycopy(invert, value, copyStart, encodedArray, outIndex, i - copyStart);<NEW_LINE>outIndex += i - copyStart;<NEW_LINE>encodedArray[outIndex++] = convert(invert, ESCAPE2);<NEW_LINE>encodedArray[outIndex++] = convert(invert, FF_CHARACTER);<NEW_LINE>copyStart = i + 1;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (copyStart < value.length) {<NEW_LINE>arraycopy(invert, value, copyStart, encodedArray, <MASK><NEW_LINE>outIndex += value.length - copyStart;<NEW_LINE>}<NEW_LINE>encodedArray[outIndex++] = convert(invert, ESCAPE1);<NEW_LINE>encodedArray[outIndex] = convert(invert, SEPARATOR);<NEW_LINE>encodedArrays.add(encodedArray);<NEW_LINE>} | outIndex, value.length - copyStart); |
1,396,602 | private Map<String, Object> parseActionCodeResult(@NonNull ActionCodeResult actionCodeResult) {<NEW_LINE>Map<String, Object> output = new HashMap<>();<NEW_LINE>Map<String, Object> data = new HashMap<>();<NEW_LINE>int operation = actionCodeResult.getOperation();<NEW_LINE>switch(operation) {<NEW_LINE>case ActionCodeResult.PASSWORD_RESET:<NEW_LINE>output.put("operation", 1);<NEW_LINE>break;<NEW_LINE>case ActionCodeResult.VERIFY_EMAIL:<NEW_LINE>output.put("operation", 2);<NEW_LINE>break;<NEW_LINE>case ActionCodeResult.RECOVER_EMAIL:<NEW_LINE>output.put("operation", 3);<NEW_LINE>break;<NEW_LINE>case ActionCodeResult.SIGN_IN_WITH_EMAIL_LINK:<NEW_LINE>output.put("operation", 4);<NEW_LINE>break;<NEW_LINE>case ActionCodeResult.VERIFY_BEFORE_CHANGE_EMAIL:<NEW_LINE>output.put("operation", 5);<NEW_LINE>break;<NEW_LINE>case ActionCodeResult.REVERT_SECOND_FACTOR_ADDITION:<NEW_LINE>output.put("operation", 6);<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>// Unknown / Error.<NEW_LINE>output.put("operation", 0);<NEW_LINE>}<NEW_LINE>ActionCodeInfo actionCodeInfo = actionCodeResult.getInfo();<NEW_LINE>if (actionCodeInfo != null && operation == ActionCodeResult.VERIFY_EMAIL || operation == ActionCodeResult.PASSWORD_RESET) {<NEW_LINE>data.put(Constants.EMAIL, actionCodeInfo.getEmail());<NEW_LINE>data.put(Constants.PREVIOUS_EMAIL, null);<NEW_LINE>} else if (operation == ActionCodeResult.REVERT_SECOND_FACTOR_ADDITION) {<NEW_LINE>data.put(Constants.EMAIL, null);<NEW_LINE>data.put(Constants.PREVIOUS_EMAIL, null);<NEW_LINE>} else if (operation == ActionCodeResult.RECOVER_EMAIL || operation == ActionCodeResult.VERIFY_BEFORE_CHANGE_EMAIL) {<NEW_LINE>ActionCodeEmailInfo actionCodeEmailInfo = (ActionCodeEmailInfo) Objects.requireNonNull(actionCodeInfo);<NEW_LINE>data.put(Constants.EMAIL, actionCodeEmailInfo.getEmail());<NEW_LINE>data.put(Constants.<MASK><NEW_LINE>}<NEW_LINE>output.put("data", data);<NEW_LINE>return output;<NEW_LINE>} | PREVIOUS_EMAIL, actionCodeEmailInfo.getPreviousEmail()); |
1,472,919 | final TerminateProvisionedProductResult executeTerminateProvisionedProduct(TerminateProvisionedProductRequest terminateProvisionedProductRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(terminateProvisionedProductRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<TerminateProvisionedProductRequest> request = null;<NEW_LINE>Response<TerminateProvisionedProductResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new TerminateProvisionedProductRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(terminateProvisionedProductRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "Service Catalog");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "TerminateProvisionedProduct");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<TerminateProvisionedProductResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new TerminateProvisionedProductResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden()); |
521,064 | public void actionPerformed(ActionEvent arg0) {<NEW_LINE>UiUtils.submitUiMachineTask(() -> {<NEW_LINE>// Need to keep current focus owner so that the space bar can be<NEW_LINE>// used after the initial click. Otherwise, button focus is lost<NEW_LINE>// when table is updated<NEW_LINE>Component comp = MainFrame.get().getFocusOwner();<NEW_LINE>Helpers.selectNextTableRow(table);<NEW_LINE>comp.requestFocus();<NEW_LINE>HeadMountable tool = MainFrame.get().getMachineControls().getSelectedTool();<NEW_LINE>Camera camera = tool.getHead().getDefaultCamera();<NEW_LINE>Location location = getSelection().getLocation();<NEW_LINE>MovableUtils.moveToLocationAtSafeZ(camera, location);<NEW_LINE>MovableUtils.fireTargetedUserAction(camera);<NEW_LINE>Map<String, Object> globals = new HashMap<>();<NEW_LINE><MASK><NEW_LINE>Configuration.get().getScripting().on("Camera.AfterPosition", globals);<NEW_LINE>});<NEW_LINE>} | globals.put("camera", camera); |
973,635 | public boolean relativePan(float dX, float dY) {<NEW_LINE>android.util.Log.d(TAG, <MASK><NEW_LINE>// We only pan if the current scaling is able to pan.<NEW_LINE>if (canvasZoomer != null && !canvasZoomer.isAbleToPan())<NEW_LINE>return false;<NEW_LINE>double scale = getZoomFactor();<NEW_LINE>double sX = (double) dX / scale;<NEW_LINE>double sY = (double) dY / scale;<NEW_LINE>int buttonAndCurveOffset = getBottomMargin(scale);<NEW_LINE>int curveOffset = 0;<NEW_LINE>if (userPanned) {<NEW_LINE>curveOffset = getTopMargin(scale);<NEW_LINE>}<NEW_LINE>userPanned = dX != 0.0 || dY != 0.0;<NEW_LINE>// Prevent panning above the desktop image except for provision for curved screens.<NEW_LINE>if (absoluteXPosition + sX < 0)<NEW_LINE>// dX = diff to 0<NEW_LINE>sX = -absoluteXPosition;<NEW_LINE>if (absoluteYPosition + sY < 0 - curveOffset)<NEW_LINE>sY = -absoluteYPosition - curveOffset;<NEW_LINE>// Prevent panning right or below desktop image except for provision for on-screen<NEW_LINE>// buttons and curved screens<NEW_LINE>if (absoluteXPosition + getVisibleDesktopWidth() + sX > getImageWidth())<NEW_LINE>sX = getImageWidth() - getVisibleDesktopWidth() - absoluteXPosition;<NEW_LINE>if (absoluteYPosition + getVisibleDesktopHeight() + sY > getImageHeight() + buttonAndCurveOffset)<NEW_LINE>sY = getImageHeight() - getVisibleDesktopHeight() - absoluteYPosition + buttonAndCurveOffset;<NEW_LINE>absoluteXPosition += sX;<NEW_LINE>absoluteYPosition += sY;<NEW_LINE>if (sX != 0.0 || sY != 0.0) {<NEW_LINE>// scrollBy((int)sX, (int)sY);<NEW_LINE>resetScroll();<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>} | "relativePan: " + dX + ", " + dY); |
807,963 | protected void onCreate(@Nullable Bundle bundle) {<NEW_LINE>if (shouldSetUpContainerTransform()) {<NEW_LINE>String transitionName = getIntent().getStringExtra(EXTRA_TRANSITION_NAME);<NEW_LINE>findViewById(android.R.id.content).setTransitionName(transitionName);<NEW_LINE>setEnterSharedElementCallback(new MaterialContainerTransformSharedElementCallback());<NEW_LINE>getWindow().setSharedElementEnterTransition(buildContainerTransform(/* entering= */<NEW_LINE>true));<NEW_LINE>getWindow().setSharedElementReturnTransition(buildContainerTransform(/* entering= */<NEW_LINE>false));<NEW_LINE>}<NEW_LINE>safeInject();<NEW_LINE>super.onCreate(bundle);<NEW_LINE>if (shouldApplyEdgeToEdgePreference()) {<NEW_LINE>WindowPreferencesManager windowPreferencesManager = new WindowPreferencesManager(this);<NEW_LINE>windowPreferencesManager.applyEdgeToEdgePreference(getWindow());<NEW_LINE>}<NEW_LINE>setContentView(R.layout.cat_demo_activity);<NEW_LINE>toolbar = findViewById(R.id.toolbar);<NEW_LINE>demoContainer = findViewById(R.id.cat_demo_activity_container);<NEW_LINE>initDemoActionBar();<NEW_LINE>demoContainer.addView(onCreateDemoView(LayoutInflater.from(<MASK><NEW_LINE>} | this), demoContainer, bundle)); |
490,567 | final GetDevicePositionHistoryResult executeGetDevicePositionHistory(GetDevicePositionHistoryRequest getDevicePositionHistoryRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(getDevicePositionHistoryRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<GetDevicePositionHistoryRequest> request = null;<NEW_LINE>Response<GetDevicePositionHistoryResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new GetDevicePositionHistoryRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(getDevicePositionHistoryRequest));<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, "Location");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "GetDevicePositionHistory");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>URI endpointTraitHost = null;<NEW_LINE>if (!clientConfiguration.isDisableHostPrefixInjection()) {<NEW_LINE>String hostPrefix = "tracking.";<NEW_LINE>String resolvedHostPrefix = String.format("tracking.");<NEW_LINE>endpointTraitHost = UriResourcePathUtils.updateUriHost(endpoint, resolvedHostPrefix);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<GetDevicePositionHistoryResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new GetDevicePositionHistoryResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext, null, endpointTraitHost);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | HandlerContextKey.SIGNING_REGION, getSigningRegion()); |
1,038,900 | private OptimizableQueryType analyzeSubSteps(List<Step> steps) {<NEW_LINE>if (steps.size() != 2) {<NEW_LINE>return OptimizableQueryType.NONE;<NEW_LINE>}<NEW_LINE>boolean validFirstStep = (steps.get(0) instanceof EdgeVertexStep);<NEW_LINE>validFirstStep = validFirstStep || (steps.get(0) instanceof EdgeOtherVertexStep);<NEW_LINE>if (!validFirstStep) {<NEW_LINE>return OptimizableQueryType.NONE;<NEW_LINE>}<NEW_LINE>if (steps.get(1) instanceof IsStep) {<NEW_LINE>// Check if this filter traversal matches the pattern: _.inV/outV/otherV.is(x)<NEW_LINE>return OptimizableQueryType.IS;<NEW_LINE>} else if (steps.get(1) instanceof HasStep) {<NEW_LINE>// Check if this filter traversal matches the pattern: _.inV/outV/otherV.hasId(x)<NEW_LINE>HasStep<?> hasStep = (HasStep<?<MASK><NEW_LINE>List<HasContainer> hasContainers = hasStep.getHasContainers();<NEW_LINE>if (hasContainers.size() != 1) {<NEW_LINE>// TODO does it make sense to allow steps with > 1 containers here?<NEW_LINE>return OptimizableQueryType.NONE;<NEW_LINE>}<NEW_LINE>HasContainer has = hasContainers.get(0);<NEW_LINE>if (has.getKey().equals(T.id.getAccessor())) {<NEW_LINE>return OptimizableQueryType.HASID;<NEW_LINE>} else {<NEW_LINE>return OptimizableQueryType.NONE;<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>return OptimizableQueryType.NONE;<NEW_LINE>}<NEW_LINE>} | >) steps.get(1); |
86,535 | public Map<String, INDArray> init(NeuralNetConfiguration conf, INDArray paramsView, boolean initializeParams) {<NEW_LINE>Deconvolution3D layer = (Deconvolution3D) conf.getLayer();<NEW_LINE>if (layer.getKernelSize().length != 3)<NEW_LINE>throw new IllegalArgumentException("Filter size must be == 3");<NEW_LINE>Map<String, INDArray> params = Collections.synchronizedMap(new LinkedHashMap<String, INDArray>());<NEW_LINE>Deconvolution3D layerConf = (Deconvolution3D) conf.getLayer();<NEW_LINE>val nOut = layerConf.getNOut();<NEW_LINE>INDArray paramsViewReshape = paramsView.reshape(paramsView.length());<NEW_LINE>if (layer.hasBias()) {<NEW_LINE>INDArray biasView = paramsViewReshape.get(NDArrayIndex.interval(0, nOut));<NEW_LINE>INDArray weightView = paramsViewReshape.get(NDArrayIndex.interval(nOut, numParams(conf)));<NEW_LINE>params.put(BIAS_KEY, createBias(conf, biasView, initializeParams));<NEW_LINE>params.put(WEIGHT_KEY, createWeightMatrix(conf, weightView, initializeParams));<NEW_LINE>conf.addVariable(WEIGHT_KEY);<NEW_LINE>conf.addVariable(BIAS_KEY);<NEW_LINE>} else {<NEW_LINE>INDArray weightView = paramsView;<NEW_LINE>params.put(WEIGHT_KEY, createWeightMatrix<MASK><NEW_LINE>conf.addVariable(WEIGHT_KEY);<NEW_LINE>}<NEW_LINE>return params;<NEW_LINE>} | (conf, weightView, initializeParams)); |
609,470 | public static byte[] encrypt(byte[] clearTextbytes, int offset, int length, byte[] cipherKey) throws Exception {<NEW_LINE>final byte[] nonce = new byte[GCM_NONCE_LENGTH];<NEW_LINE>random.nextBytes(nonce);<NEW_LINE>GCMParameterSpec spec = new <MASK><NEW_LINE>SecretKeySpec keySpec = new SecretKeySpec(cipherKey, "AES");<NEW_LINE>Cipher AES_cipherInstance = Cipher.getInstance("AES/GCM/NoPadding");<NEW_LINE>AES_cipherInstance.init(Cipher.ENCRYPT_MODE, keySpec, spec);<NEW_LINE>byte[] encryptedText = AES_cipherInstance.doFinal(clearTextbytes, offset, length);<NEW_LINE>byte[] iv = AES_cipherInstance.getIV();<NEW_LINE>byte[] message = new byte[GCM_NONCE_LENGTH + length + GCM_TAG_LENGTH];<NEW_LINE>System.arraycopy(iv, 0, message, 0, GCM_NONCE_LENGTH);<NEW_LINE>System.arraycopy(encryptedText, 0, message, GCM_NONCE_LENGTH, encryptedText.length);<NEW_LINE>return message;<NEW_LINE>} | GCMParameterSpec(GCM_TAG_LENGTH * 8, nonce); |
1,349,872 | public void marshall(TransferData transferData, AwsJsonWriter jsonWriter) throws Exception {<NEW_LINE>jsonWriter.beginObject();<NEW_LINE>if (transferData.getTransferMessage() != null) {<NEW_LINE>String transferMessage = transferData.getTransferMessage();<NEW_LINE>jsonWriter.name("transferMessage");<NEW_LINE>jsonWriter.value(transferMessage);<NEW_LINE>}<NEW_LINE>if (transferData.getRejectReason() != null) {<NEW_LINE>String rejectReason = transferData.getRejectReason();<NEW_LINE>jsonWriter.name("rejectReason");<NEW_LINE>jsonWriter.value(rejectReason);<NEW_LINE>}<NEW_LINE>if (transferData.getTransferDate() != null) {<NEW_LINE>java.util.Date transferDate = transferData.getTransferDate();<NEW_LINE>jsonWriter.name("transferDate");<NEW_LINE>jsonWriter.value(transferDate);<NEW_LINE>}<NEW_LINE>if (transferData.getAcceptDate() != null) {<NEW_LINE>java.util.<MASK><NEW_LINE>jsonWriter.name("acceptDate");<NEW_LINE>jsonWriter.value(acceptDate);<NEW_LINE>}<NEW_LINE>if (transferData.getRejectDate() != null) {<NEW_LINE>java.util.Date rejectDate = transferData.getRejectDate();<NEW_LINE>jsonWriter.name("rejectDate");<NEW_LINE>jsonWriter.value(rejectDate);<NEW_LINE>}<NEW_LINE>jsonWriter.endObject();<NEW_LINE>} | Date acceptDate = transferData.getAcceptDate(); |
882,411 | public GetSystemTemplateResult unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>GetSystemTemplateResult getSystemTemplateResult = new GetSystemTemplateResult();<NEW_LINE><MASK><NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return getSystemTemplateResult;<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("description", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>getSystemTemplateResult.setDescription(SystemTemplateDescriptionJsonUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>}<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return getSystemTemplateResult;<NEW_LINE>} | int originalDepth = context.getCurrentDepth(); |
414,979 | public OriginShield unmarshall(StaxUnmarshallerContext context) throws Exception {<NEW_LINE>OriginShield originShield = new OriginShield();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>if (context.isStartOfDocument())<NEW_LINE>targetDepth += 1;<NEW_LINE>while (true) {<NEW_LINE><MASK><NEW_LINE>if (xmlEvent.isEndDocument())<NEW_LINE>return originShield;<NEW_LINE>if (xmlEvent.isAttribute() || xmlEvent.isStartElement()) {<NEW_LINE>if (context.testExpression("Enabled", targetDepth)) {<NEW_LINE>originShield.setEnabled(BooleanStaxUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (context.testExpression("OriginShieldRegion", targetDepth)) {<NEW_LINE>originShield.setOriginShieldRegion(StringStaxUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>} else if (xmlEvent.isEndElement()) {<NEW_LINE>if (context.getCurrentDepth() < originalDepth) {<NEW_LINE>return originShield;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | XMLEvent xmlEvent = context.nextEvent(); |
985,134 | public void updatePhis(Program program, Variable[] parameters) {<NEW_LINE>if (program.basicBlockCount() == 0) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>frontierVariableCache = new int[program.basicBlockCount()][][];<NEW_LINE>this.program = program;<NEW_LINE>phisByReceiver.clear();<NEW_LINE><MASK><NEW_LINE>domTree = GraphUtils.buildDominatorTree(cfg);<NEW_LINE>domFrontiers = new int[cfg.size()][];<NEW_LINE>domGraph = GraphUtils.buildDominatorGraph(domTree, program.basicBlockCount());<NEW_LINE>variableMap = new Variable[program.variableCount()];<NEW_LINE>usedDefinitions = new boolean[program.variableCount()];<NEW_LINE>for (int i = 0; i < parameters.length; ++i) {<NEW_LINE>variableMap[i] = parameters[i];<NEW_LINE>usedDefinitions[i] = true;<NEW_LINE>}<NEW_LINE>for (int i = 0; i < program.variableCount(); ++i) {<NEW_LINE>variableToSourceMap.add(-1);<NEW_LINE>}<NEW_LINE>definedVersions.addAll(Collections.nCopies(program.variableCount(), null));<NEW_LINE>phiMap = new Phi[program.basicBlockCount()][];<NEW_LINE>phiIndexMap = new int[program.basicBlockCount()][];<NEW_LINE>for (int i = 0; i < phiMap.length; ++i) {<NEW_LINE>phiMap[i] = new Phi[program.variableCount()];<NEW_LINE>phiIndexMap[i] = new int[program.variableCount()];<NEW_LINE>}<NEW_LINE>domFrontiers = GraphUtils.findDominanceFrontiers(cfg, domTree);<NEW_LINE>synthesizedPhisByBlock.clear();<NEW_LINE>for (int i = 0; i < program.basicBlockCount(); ++i) {<NEW_LINE>synthesizedPhisByBlock.add(new ArrayList<>());<NEW_LINE>}<NEW_LINE>estimateSigmas();<NEW_LINE>estimatePhis();<NEW_LINE>renameVariables();<NEW_LINE>propagatePhiUsageInformation();<NEW_LINE>addSynthesizedPhis();<NEW_LINE>} | cfg = ProgramUtils.buildControlFlowGraph(program); |
610,602 | private final I_M_HU_Trx_Line createTrxLine(final I_M_HU_Trx_Hdr trxHdr, final IHUTransactionCandidate trxLineCandidate) {<NEW_LINE>Check.assumeNotNull(trxLineCandidate.getCounterpart(), "TrxLine shall have a parent set: {}", trxLineCandidate);<NEW_LINE>Check.assume(trxLineCandidate != trxLineCandidate.getCounterpart(), "TrxLine shall not self reference: {}", trxLineCandidate);<NEW_LINE>final I_M_HU_Trx_Line trxLine = InterfaceWrapperHelper.newInstance(I_M_HU_Trx_Line.class, trxHdr);<NEW_LINE>if (trxLineCandidate.isSkipProcessing()) {<NEW_LINE>trxLine.setProcessed(true);<NEW_LINE>}<NEW_LINE>final I_M_HU_Item huItem = trxLineCandidate.getM_HU_Item();<NEW_LINE>final I_M_HU hu = huItem == null ? null : huItem.getM_HU();<NEW_LINE>trxLine.setAD_Org_ID(trxHdr.getAD_Org_ID());<NEW_LINE>trxLine.setM_HU_Trx_Hdr(trxHdr);<NEW_LINE>trxLine.setDateTrx(TimeUtil.asTimestamp(trxLineCandidate.getDate()));<NEW_LINE>trxLine.setM_Product_ID(trxLineCandidate.<MASK><NEW_LINE>trxLine.setQty(trxLineCandidate.getQuantity().toBigDecimal());<NEW_LINE>trxLine.setC_UOM_ID(trxLineCandidate.getQuantity().getUOMId());<NEW_LINE>trxLine.setM_HU(hu);<NEW_LINE>trxLine.setM_HU_Item(huItem);<NEW_LINE>final I_M_HU_Item vhuItem = trxLineCandidate.getVHU_Item();<NEW_LINE>trxLine.setVHU_Item(vhuItem);<NEW_LINE>//<NEW_LINE>// 07827: Track HU movement locator and status<NEW_LINE>trxLine.setM_Locator_ID(LocatorId.toRepoId(trxLineCandidate.getLocatorId()));<NEW_LINE>trxLine.setHUStatus(trxLineCandidate.getHUStatus());<NEW_LINE>huTrxBL.setReferencedObject(trxLine, trxLineCandidate.getReferencedModel());<NEW_LINE>saveTrxLine(trxLine);<NEW_LINE>return trxLine;<NEW_LINE>} | getProductId().getRepoId()); |
329,613 | public GetSuiteResult unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>GetSuiteResult getSuiteResult = new GetSuiteResult();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE><MASK><NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return getSuiteResult;<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("suite", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>getSuiteResult.setSuite(SuiteJsonUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>}<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return getSuiteResult;<NEW_LINE>} | String currentParentElement = context.getCurrentParentElement(); |
1,469,457 | public void write_scope_int(IndentFileWriter p_file, IdentifierType p_identifier_type) throws java.io.IOException {<NEW_LINE>p_file.start_scope();<NEW_LINE>p_file.write("path ");<NEW_LINE>p_identifier_type.write(this.layer.name, p_file);<NEW_LINE>p_file.write(" ");<NEW_LINE>p_file.write((Double.valueOf(this.width)).toString());<NEW_LINE><MASK><NEW_LINE>for (int i = 0; i < corner_count; ++i) {<NEW_LINE>p_file.new_line();<NEW_LINE>Integer curr_coor = (int) Math.round(coordinate_arr[2 * i]);<NEW_LINE>p_file.write(curr_coor.toString());<NEW_LINE>p_file.write(" ");<NEW_LINE>curr_coor = (int) Math.round(coordinate_arr[2 * i + 1]);<NEW_LINE>p_file.write(curr_coor.toString());<NEW_LINE>}<NEW_LINE>p_file.end_scope();<NEW_LINE>} | int corner_count = coordinate_arr.length / 2; |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.