idx int32 46 1.86M | input stringlengths 321 6.6k | target stringlengths 9 1.24k |
|---|---|---|
181,286 | /* (non-Javadoc)<NEW_LINE>* @see com.ibm.jvm.j9.dump.indexsupport.IParserNode#nodeToPushAfterStarting(java.lang.String, java.lang.String, java.lang.String, org.xml.sax.Attributes)<NEW_LINE>*/<NEW_LINE>public IParserNode nodeToPushAfterStarting(String uri, String localName, String qName, Attributes attributes) {<NEW_LINE>IParserNode child = null;<NEW_LINE>if (qName.equals("systemProperties")) {<NEW_LINE>child = new NodeSystemProperties(_runtime, attributes);<NEW_LINE>} else if (qName.equals("class")) {<NEW_LINE>child = new NodeClassInVM(_runtime, attributes);<NEW_LINE>} else if (qName.equals("arrayclass")) {<NEW_LINE>child <MASK><NEW_LINE>} else if (qName.equals("classloader")) {<NEW_LINE>child = new NodeClassLoader(_runtime, attributes);<NEW_LINE>} else if (qName.equals("monitor")) {<NEW_LINE>child = new NodeMonitor(_runtime, attributes);<NEW_LINE>} else if (qName.equals("vmthread")) {<NEW_LINE>child = new NodeVMThread(_runtime, attributes);<NEW_LINE>} else if (qName.equals("trace")) {<NEW_LINE>child = new NodeTrace(_runtime, attributes);<NEW_LINE>} else if (qName.equals("heap")) {<NEW_LINE>child = new NodeHeap(_runtime, attributes);<NEW_LINE>} else if (qName.equals("javavminitargs")) {<NEW_LINE>child = new NodeJavaVMInitArgs(_runtime, attributes);<NEW_LINE>} else if (qName.equals("rootobject")) {<NEW_LINE>child = new NodeRootObject(_runtime, attributes);<NEW_LINE>} else if (qName.equals("rootclass")) {<NEW_LINE>child = new NodeRootClass(_runtime, attributes);<NEW_LINE>} else {<NEW_LINE>child = super.nodeToPushAfterStarting(uri, localName, qName, attributes);<NEW_LINE>}<NEW_LINE>return child;<NEW_LINE>} | = new NodeArrayClass(_runtime, attributes); |
764,090 | // The complex case when we have to peek at the Truffle stacktrace to know whether this<NEW_LINE>// traceback segment is not empty<NEW_LINE>// This happens when:<NEW_LINE>// 1) On the top-level (we don't have the catching frame)<NEW_LINE>// 2) On the C boundary (we don't want to show the catching frame)<NEW_LINE>// 3) After raise without arguments or after implicit reraise at the end of finally, __exit__...<NEW_LINE>// (we don't want to show the reraise location)<NEW_LINE>@TruffleBoundary<NEW_LINE>@Specialization(guards = { "!tb.isMaterialized()", "mayBeEmpty(tb)" })<NEW_LINE>PTraceback traverse(LazyTraceback tb, @Shared("factory") @Cached PythonObjectFactory factory) {<NEW_LINE>// The logic of skipping and cutting off frames here and in MaterializeTruffleStacktraceNode<NEW_LINE>// must match<NEW_LINE>boolean skipFirst = tb<MASK><NEW_LINE>for (TruffleStackTraceElement element : tb.getException().getTruffleStackTrace()) {<NEW_LINE>if (tb.getException().shouldCutOffTraceback(element)) {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>if (skipFirst) {<NEW_LINE>skipFirst = false;<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (LazyTraceback.elementWantedForTraceback(element)) {<NEW_LINE>return createTraceback(tb, factory);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (tb.catchingFrameWantedForTraceback() && !skipFirst) {<NEW_LINE>return createTraceback(tb, factory);<NEW_LINE>}<NEW_LINE>PTraceback newTraceback = null;<NEW_LINE>if (tb.getNextChain() != null) {<NEW_LINE>newTraceback = execute(tb.getNextChain());<NEW_LINE>}<NEW_LINE>tb.setTraceback(newTraceback);<NEW_LINE>return newTraceback;<NEW_LINE>} | .getException().shouldHideLocation(); |
398,171 | private void flushStripe(FlushReason flushReason) throws IOException {<NEW_LINE>List<OrcDataOutput> <MASK><NEW_LINE>long stripeStartOffset = orcDataSink.size();<NEW_LINE>// add header to first stripe (this is not required but nice to have)<NEW_LINE>if (closedStripes.isEmpty()) {<NEW_LINE>outputData.add(createDataOutput(MAGIC));<NEW_LINE>stripeStartOffset += MAGIC.length();<NEW_LINE>}<NEW_LINE>// add stripe data<NEW_LINE>outputData.addAll(bufferStripeData(stripeStartOffset, flushReason));<NEW_LINE>// if the file is being closed, add the file footer<NEW_LINE>if (flushReason == CLOSED) {<NEW_LINE>outputData.addAll(bufferFileFooter());<NEW_LINE>}<NEW_LINE>// write all data<NEW_LINE>orcDataSink.write(outputData);<NEW_LINE>// open next stripe<NEW_LINE>columnWriters.forEach(ColumnWriter::reset);<NEW_LINE>dictionaryCompressionOptimizer.reset();<NEW_LINE>rowGroupRowCount = 0;<NEW_LINE>stripeRowCount = 0;<NEW_LINE>bufferedBytes = toIntExact(columnWriters.stream().mapToLong(ColumnWriter::getBufferedBytes).sum());<NEW_LINE>} | outputData = new ArrayList<>(); |
315,160 | public void finalizeMerge(CommandContext commandContext, String deploymentId, String newTenantId) {<NEW_LINE>List<ProcessDefinition> processDefinitions = new ProcessDefinitionQueryImpl().<MASK><NEW_LINE>ProcessDefinitionEntityManager processDefinitionEntityManager = CommandContextUtil.getProcessDefinitionEntityManager(commandContext);<NEW_LINE>for (ProcessDefinition processDefinition : processDefinitions) {<NEW_LINE>ProcessDefinitionQueryImpl processDefinitionQuery = new ProcessDefinitionQueryImpl();<NEW_LINE>if (StringUtils.isEmpty(newTenantId)) {<NEW_LINE>processDefinitionQuery.processDefinitionWithoutTenantId();<NEW_LINE>} else {<NEW_LINE>processDefinitionQuery.processDefinitionTenantId(newTenantId);<NEW_LINE>}<NEW_LINE>List<ProcessDefinition> allProcessDefinitionsWithKey = processDefinitionQuery.processDefinitionKey(processDefinition.getKey()).list();<NEW_LINE>List<ProcessDefinition> orderedProcessDefinitions = sortProcessDefinitionsByDeploymentTime(allProcessDefinitionsWithKey);<NEW_LINE>int versionNumber = allProcessDefinitionsWithKey.size();<NEW_LINE>for (ProcessDefinition alreadyExistingProcessDefinition : orderedProcessDefinitions) {<NEW_LINE>processDefinitionEntityManager.updateProcessDefinitionVersionForProcessDefinitionId(alreadyExistingProcessDefinition.getId(), versionNumber--);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | deploymentId(deploymentId).list(); |
1,212,249 | public CssConstruct build(final CssToken start, final CssTokenIterator iter, final Predicate<CssToken> limit, final Predicate<CssConstruct> permitted) {<NEW_LINE>CssConstruct.Type type = genericTypeMappings.get(start.type);<NEW_LINE>CssConstruct cc;<NEW_LINE>switch(type) {<NEW_LINE>case KEYWORD:<NEW_LINE>cc = new CssKeyword(start.getChars(), start.location);<NEW_LINE>break;<NEW_LINE>case URI:<NEW_LINE>cc = new CssURI(start.getChars(), start.location);<NEW_LINE>break;<NEW_LINE>case STRING:<NEW_LINE>cc = new CssString(start.getChars(), start.location);<NEW_LINE>break;<NEW_LINE>case URANGE:<NEW_LINE>cc = new CssUnicodeRange(start.getChars(), start.location);<NEW_LINE>break;<NEW_LINE>case HASHNAME:<NEW_LINE>cc = new CssHashName(start.getChars(), start.location);<NEW_LINE>break;<NEW_LINE>case CLASSNAME:<NEW_LINE>cc = new CssClassName(start.getChars(), start.location);<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>throw new IllegalStateException("CssTokenTransform BUILDER_ATOMIC");<NEW_LINE>}<NEW_LINE>return permitted.<MASK><NEW_LINE>} | apply(cc) ? cc : null; |
374,735 | public void onLoad() {<NEW_LINE>try {<NEW_LINE>ProtocolConstants.class.getField("MINECRAFT_1_18");<NEW_LINE>} catch (NoSuchFieldException e) {<NEW_LINE>getLogger().warning(" / \\");<NEW_LINE>getLogger().warning(" / \\");<NEW_LINE>getLogger().warning(" / | \\");<NEW_LINE>getLogger().warning(" / | \\ BUNGEECORD IS OUTDATED");<NEW_LINE>getLogger().warning(" / \\ VIAVERSION MAY NOT WORK AS INTENDED");<NEW_LINE>getLogger().warning(" / o \\");<NEW_LINE>getLogger().warning("/_____________\\");<NEW_LINE>}<NEW_LINE>api = new BungeeViaAPI();<NEW_LINE>config = new BungeeViaConfig(getDataFolder());<NEW_LINE>BungeeCommandHandler commandHandler = new BungeeCommandHandler();<NEW_LINE>ProxyServer.getInstance().getPluginManager().registerCommand(<MASK><NEW_LINE>// Init platform<NEW_LINE>Via.init(ViaManagerImpl.builder().platform(this).injector(new BungeeViaInjector()).loader(new BungeeViaLoader(this)).commandHandler(commandHandler).build());<NEW_LINE>} | this, new BungeeCommand(commandHandler)); |
894,518 | public XContentBuilder toXContent(final XContentBuilder builder, final Params params) throws IOException {<NEW_LINE>builder.startObject();<NEW_LINE>if (source != null) {<NEW_LINE>builder.field(TransformConfig.SOURCE.getPreferredName(), source);<NEW_LINE>}<NEW_LINE>if (dest != null) {<NEW_LINE>builder.field(TransformConfig.DEST.getPreferredName(), dest);<NEW_LINE>}<NEW_LINE>if (frequency != null) {<NEW_LINE>builder.field(TransformConfig.FREQUENCY.getPreferredName(), frequency.getStringRep());<NEW_LINE>}<NEW_LINE>if (syncConfig != null) {<NEW_LINE>builder.startObject(<MASK><NEW_LINE>builder.field(syncConfig.getName(), syncConfig);<NEW_LINE>builder.endObject();<NEW_LINE>}<NEW_LINE>if (description != null) {<NEW_LINE>builder.field(TransformConfig.DESCRIPTION.getPreferredName(), description);<NEW_LINE>}<NEW_LINE>if (settings != null) {<NEW_LINE>builder.field(TransformConfig.SETTINGS.getPreferredName(), settings);<NEW_LINE>}<NEW_LINE>if (metadata != null) {<NEW_LINE>builder.field(TransformConfig.METADATA.getPreferredName(), metadata);<NEW_LINE>}<NEW_LINE>builder.endObject();<NEW_LINE>return builder;<NEW_LINE>} | TransformConfig.SYNC.getPreferredName()); |
1,755,352 | final UpdateGroupResult executeUpdateGroup(UpdateGroupRequest updateGroupRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(updateGroupRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<UpdateGroupRequest> request = null;<NEW_LINE>Response<UpdateGroupResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new UpdateGroupRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(updateGroupRequest));<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, "Greengrass");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "UpdateGroup");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<UpdateGroupResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new UpdateGroupResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>} | endClientExecution(awsRequestMetrics, request, response); |
1,360,417 | private void checkMousePosition(int x, int y) {<NEW_LINE>if (MouseDevice.isNotUseable()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>PointerInfo mp = MouseInfo.getPointerInfo();<NEW_LINE>Point actualPos;<NEW_LINE>if (mp == null) {<NEW_LINE>Debug.error("RobotDesktop: checkMousePosition: MouseInfo.getPointerInfo invalid after move to (%d, %d)", x, y);<NEW_LINE>} else {<NEW_LINE>actualPos = mp.getLocation();<NEW_LINE>boolean xOff = actualPos.x < (x - 1) || actualPos.x > (x + 1);<NEW_LINE>boolean yOff = actualPos.y < (y - 1) || actualPos.y > (y + 1);<NEW_LINE>if (xOff || yOff) {<NEW_LINE>if (MouseDevice.isUsable()) {<NEW_LINE>if (Settings.checkMousePosition) {<NEW_LINE>Debug.error("RobotDesktop: checkMousePosition: should be %s - but is %s!", new Location(x, y<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | ), new Location(actualPos)); |
202,124 | public DynamicMessage parse(ByteBuffer bytes) {<NEW_LINE>// ignore first \0 byte<NEW_LINE>bytes.get();<NEW_LINE>// extract schema registry id<NEW_LINE>int id = bytes.getInt();<NEW_LINE>// ignore \0 byte before PB message<NEW_LINE>bytes.get();<NEW_LINE>int length = bytes.limit() - 2 - 4;<NEW_LINE>Descriptors.Descriptor descriptor;<NEW_LINE>try {<NEW_LINE>ProtobufSchema schema = (ProtobufSchema) registry.getSchemaById(id);<NEW_LINE>descriptor = schema.toDescriptor();<NEW_LINE>} catch (RestClientException e) {<NEW_LINE>LOGGER.error(e.getMessage());<NEW_LINE>throw new ParseException(null, e, "Fail to get protobuf schema because of can not connect to registry or failed http request!");<NEW_LINE>} catch (IOException e) {<NEW_LINE>LOGGER.error(e.getMessage());<NEW_LINE>throw new ParseException(null, e, "Fail to get protobuf schema because of invalid schema!");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>byte[] rawMessage = new byte[length];<NEW_LINE>bytes.<MASK><NEW_LINE>DynamicMessage message = DynamicMessage.parseFrom(descriptor, rawMessage);<NEW_LINE>return message;<NEW_LINE>} catch (Exception e) {<NEW_LINE>LOGGER.error(e.getMessage());<NEW_LINE>throw new ParseException(null, e, "Fail to decode protobuf message!");<NEW_LINE>}<NEW_LINE>} | get(rawMessage, 0, length); |
260,590 | public static DescribeCacheAnalysisReportListResponse unmarshall(DescribeCacheAnalysisReportListResponse describeCacheAnalysisReportListResponse, UnmarshallerContext _ctx) {<NEW_LINE>describeCacheAnalysisReportListResponse.setRequestId(_ctx.stringValue("DescribeCacheAnalysisReportListResponse.RequestId"));<NEW_LINE>describeCacheAnalysisReportListResponse.setInstanceId(_ctx.stringValue("DescribeCacheAnalysisReportListResponse.InstanceId"));<NEW_LINE>describeCacheAnalysisReportListResponse.setPageRecordCount(_ctx.integerValue("DescribeCacheAnalysisReportListResponse.PageRecordCount"));<NEW_LINE>describeCacheAnalysisReportListResponse.setPageNumbers(_ctx.integerValue("DescribeCacheAnalysisReportListResponse.PageNumbers"));<NEW_LINE>describeCacheAnalysisReportListResponse.setTotalRecordCount(_ctx.integerValue("DescribeCacheAnalysisReportListResponse.TotalRecordCount"));<NEW_LINE>List<DailyTask> dailyTasks = new ArrayList<DailyTask>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("DescribeCacheAnalysisReportListResponse.DailyTasks.Length"); i++) {<NEW_LINE>DailyTask dailyTask = new DailyTask();<NEW_LINE>dailyTask.setDate(_ctx.stringValue("DescribeCacheAnalysisReportListResponse.DailyTasks[" + i + "].Date"));<NEW_LINE>List<Task> tasks = new ArrayList<Task>();<NEW_LINE>for (int j = 0; j < _ctx.lengthValue("DescribeCacheAnalysisReportListResponse.DailyTasks[" + i + "].Tasks.Length"); j++) {<NEW_LINE>Task task = new Task();<NEW_LINE>task.setStatus(_ctx.stringValue("DescribeCacheAnalysisReportListResponse.DailyTasks[" + i <MASK><NEW_LINE>task.setStartTime(_ctx.stringValue("DescribeCacheAnalysisReportListResponse.DailyTasks[" + i + "].Tasks[" + j + "].StartTime"));<NEW_LINE>task.setTaskId(_ctx.stringValue("DescribeCacheAnalysisReportListResponse.DailyTasks[" + i + "].Tasks[" + j + "].TaskId"));<NEW_LINE>task.setNodeId(_ctx.stringValue("DescribeCacheAnalysisReportListResponse.DailyTasks[" + i + "].Tasks[" + j + "].NodeId"));<NEW_LINE>tasks.add(task);<NEW_LINE>}<NEW_LINE>dailyTask.setTasks(tasks);<NEW_LINE>dailyTasks.add(dailyTask);<NEW_LINE>}<NEW_LINE>describeCacheAnalysisReportListResponse.setDailyTasks(dailyTasks);<NEW_LINE>return describeCacheAnalysisReportListResponse;<NEW_LINE>} | + "].Tasks[" + j + "].Status")); |
21,220 | public ComponentSelector removeTags(String... tags) {<NEW_LINE>for (Component c : this) {<NEW_LINE>String existing = (String) c.getClientProperty(PROPERTY_TAG);<NEW_LINE>if (existing == null) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>Set<String> existingSet = new HashSet<String>();<NEW_LINE>String[] existingStrs = <MASK><NEW_LINE>for (String existingStr : existingStrs) {<NEW_LINE>existingStr = existingStr.trim();<NEW_LINE>if (existingStr.length() > 0) {<NEW_LINE>existingSet.add(existingStr);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>for (String tag : tags) {<NEW_LINE>existingSet.add(tag);<NEW_LINE>}<NEW_LINE>existing = "";<NEW_LINE>if (existingSet.isEmpty()) {<NEW_LINE>c.putClientProperty(PROPERTY_TAG, null);<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>for (String tag : existingSet) {<NEW_LINE>existing += " " + tag + " ";<NEW_LINE>}<NEW_LINE>c.putClientProperty(PROPERTY_TAG, existing);<NEW_LINE>}<NEW_LINE>return this;<NEW_LINE>} | Util.split(" ", existing); |
203,323 | public void drawSelection(Player player, LocalSession session, @Arg(desc = "The new draw selection state", def = "") Boolean drawSelection) throws WorldEditException {<NEW_LINE>if (!WorldEdit.getInstance().getConfiguration().serverSideCUI) {<NEW_LINE>throw new AuthorizationException(TranslatableComponent.of("worldedit.error.disabled"));<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>if (drawSelection != null && drawSelection == useServerCui) {<NEW_LINE>player.printError(TranslatableComponent.of("worldedit.drawsel." + (useServerCui ? "enabled" : "disabled") + ".already"));<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (useServerCui) {<NEW_LINE>session.setUseServerCUI(false);<NEW_LINE>session.updateServerCUI(player);<NEW_LINE>player.printInfo(TranslatableComponent.of("worldedit.drawsel.disabled"));<NEW_LINE>} else {<NEW_LINE>session.setUseServerCUI(true);<NEW_LINE>session.updateServerCUI(player);<NEW_LINE>int maxSize = ServerCUIHandler.getMaxServerCuiSize();<NEW_LINE>player.printInfo(TranslatableComponent.of("worldedit.drawsel.enabled", TextComponent.of(maxSize), TextComponent.of(maxSize), TextComponent.of(maxSize)));<NEW_LINE>}<NEW_LINE>} | boolean useServerCui = session.shouldUseServerCUI(); |
1,737,069 | private void addList(Collection<?> args) {<NEW_LINE>for (Object o : args) {<NEW_LINE>if (o.getClass() == String.class) {<NEW_LINE>addInt(3);<NEW_LINE>String s = (String) o;<NEW_LINE>addInt(s.length());<NEW_LINE>addString(s);<NEW_LINE>} else if (o.getClass() == Boolean.class) {<NEW_LINE>addInt(2);<NEW_LINE>addByte(((Boolean) o).booleanValue() ? (byte) 1 : (byte) 0);<NEW_LINE>} else if (o.getClass() == Integer.class) {<NEW_LINE>addInt(1);<NEW_LINE>addInt(((Integer) o).intValue());<NEW_LINE>} else if (o.getClass() == Double.class) {<NEW_LINE>addInt(4);<NEW_LINE>addDouble(((Double) o).doubleValue());<NEW_LINE>} else if (o.getClass() == BigInteger.class) {<NEW_LINE>addInt(4);<NEW_LINE>addDouble(((BigInteger) o).doubleValue());<NEW_LINE>} else if (o instanceof List<?>) {<NEW_LINE>Collection<?> l = (Collection<?>) o;<NEW_LINE>addInt(0x100);<NEW_LINE><MASK><NEW_LINE>addList(l);<NEW_LINE>} else if (o instanceof Map<?, ?>) {<NEW_LINE>Map<?, ?> l = (Map<?, ?>) o;<NEW_LINE>addInt(0x101);<NEW_LINE>addInt(l.size());<NEW_LINE>for (Map.Entry<?, ?> me : l.entrySet()) {<NEW_LINE>String key = (String) me.getKey();<NEW_LINE>addInt(key.length());<NEW_LINE>addString(key);<NEW_LINE>addList(Collections.singleton(me.getValue()));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | addInt(l.size()); |
1,672,892 | private static BlockStatement generateCopyRecordToVectorBatchBody(IntInnerType[] types) {<NEW_LINE>int size = types.length;<NEW_LINE>ArrayList<Statement> statements = new ArrayList<>(size);<NEW_LINE>for (int varIndex = 0; varIndex < size; varIndex++) {<NEW_LINE>IntInnerType intPair = types[varIndex];<NEW_LINE>int columnIndex = intPair.index;<NEW_LINE>InnerType type = intPair.type;<NEW_LINE>ConstantExpression index = Expressions.constant(columnIndex);<NEW_LINE>ParameterExpression vectorVariable = Expressions.parameter(type.getFieldVector());<NEW_LINE>statements.add(Expressions.declare(0, vectorVariable, Expressions.convert_(Expressions.call(input, "getVector", index), type.getFieldVector())));<NEW_LINE>ParameterExpression returnVariable = Expressions.parameter(type.getJavaClass());<NEW_LINE>statements.add(Expressions.declare(0, returnVariable, Expressions.call(from, "get" + type.name(), index)));<NEW_LINE>MethodCallExpression isNullCondition = Expressions.call(from, "isNull", index);<NEW_LINE>statements.add(Expressions.ifThenElse(isNullCondition, Expressions.statement(Expressions.call(RecordSinkFactoryImpl.class, "set" + type.getFieldVector().getSimpleName() + "Null", vectorVariable, index)), Expressions.statement(Expressions.call(RecordSinkFactoryImpl.class, "set" + type.getFieldVector().getSimpleName(), vectorVariable<MASK><NEW_LINE>}<NEW_LINE>return Expressions.block(statements);<NEW_LINE>} | , rowId, returnVariable)))); |
874,164 | public void writeCommonWords(File commonFile, int totalWords) throws IOException {<NEW_LINE>PrintWriter out = new PrintWriter(commonFile, Charset.<MASK><NEW_LINE>Alphabet currentAlphabet = getDataAlphabet();<NEW_LINE>IDSorter[] sortedWords = new IDSorter[currentAlphabet.size()];<NEW_LINE>for (int type = 0; type < currentAlphabet.size(); type++) {<NEW_LINE>sortedWords[type] = new IDSorter(type, counter.get(type));<NEW_LINE>}<NEW_LINE>java.util.Arrays.sort(sortedWords);<NEW_LINE>int max = totalWords;<NEW_LINE>if (currentAlphabet.size() < max) {<NEW_LINE>max = currentAlphabet.size();<NEW_LINE>}<NEW_LINE>for (int rank = 0; rank < max; rank++) {<NEW_LINE>int type = sortedWords[rank].getID();<NEW_LINE>out.println(currentAlphabet.lookupObject(type));<NEW_LINE>}<NEW_LINE>out.close();<NEW_LINE>} | defaultCharset().name()); |
265,157 | private Duration determineSyncCommitTimeout() {<NEW_LINE>Duration syncTimeout = this.containerProperties.getSyncCommitTimeout();<NEW_LINE>if (syncTimeout != null) {<NEW_LINE>return syncTimeout;<NEW_LINE>} else {<NEW_LINE>Object timeout = this.containerProperties.getKafkaConsumerProperties().get(ConsumerConfig.DEFAULT_API_TIMEOUT_MS_CONFIG);<NEW_LINE>if (timeout == null) {<NEW_LINE>timeout = KafkaMessageListenerContainer.this.consumerFactory.getConfigurationProperties().get(ConsumerConfig.DEFAULT_API_TIMEOUT_MS_CONFIG);<NEW_LINE>}<NEW_LINE>if (timeout instanceof Duration) {<NEW_LINE>return (Duration) timeout;<NEW_LINE>} else if (timeout instanceof Number) {<NEW_LINE>return Duration.ofMillis(((Number) timeout).longValue());<NEW_LINE>} else if (timeout instanceof String) {<NEW_LINE>return Duration.ofMillis(Long.<MASK><NEW_LINE>} else {<NEW_LINE>if (timeout != null) {<NEW_LINE>Object timeoutToLog = timeout;<NEW_LINE>this.logger.warn(() -> "Unexpected type: " + timeoutToLog.getClass().getName() + " in property '" + ConsumerConfig.DEFAULT_API_TIMEOUT_MS_CONFIG + "'; defaulting to Kafka default for sync commit timeouts");<NEW_LINE>}<NEW_LINE>return Duration.ofMillis((int) CONSUMER_CONFIG_DEFAULTS.get(ConsumerConfig.DEFAULT_API_TIMEOUT_MS_CONFIG));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | parseLong((String) timeout)); |
1,148,341 | protected boolean isIPv4(final char firstChar, final String s) {<NEW_LINE>// Quick check before using Regular Expression<NEW_LINE>// 1) At least 7 characters<NEW_LINE>// 2) 1st character must be a digit from '0' - '9'<NEW_LINE>// 3) Must contain at least 1 . (period)<NEW_LINE>if (s.length() < 7 || !isLatinDigit(firstChar) || s.indexOf('.') < 0) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>Matcher <MASK><NEW_LINE>if (matcher.matches()) {<NEW_LINE>// All octets in range [0, 255]<NEW_LINE>for (int i = 1; i <= matcher.groupCount(); i++) {<NEW_LINE>int octet = Integer.parseInt(matcher.group(i));<NEW_LINE>if (octet < 0 || octet > 255) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>} else {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>} | matcher = IPV4_PATTERN.matcher(s); |
1,169,964 | public void sendRequest(final Exchange exchange) {<NEW_LINE>// for observe request.<NEW_LINE><MASK><NEW_LINE>if (request.isObserve() && 0 == exchange.getFailedTransmissionCount()) {<NEW_LINE>if (exchangeStore.assignMessageId(request) != Message.NONE) {<NEW_LINE>registerObserve(request);<NEW_LINE>} else {<NEW_LINE>LOGGER.debug("message IDs exhausted, could not register outbound observe request for tracking");<NEW_LINE>request.setSendError(new IllegalStateException("automatic message IDs exhausted"));<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>if (exchangeStore.registerOutboundRequest(exchange)) {<NEW_LINE>exchange.setRemoveHandler(exchangeRemoveHandler);<NEW_LINE>LOGGER.debug("tracking open request [{}, {}]", exchange.getKeyMID(), exchange.getKeyToken());<NEW_LINE>} else {<NEW_LINE>LOGGER.debug("message IDs exhausted, could not register outbound request for tracking");<NEW_LINE>request.setSendError(new IllegalStateException("automatic message IDs exhausted"));<NEW_LINE>}<NEW_LINE>} catch (IllegalArgumentException ex) {<NEW_LINE>request.setSendError(ex);<NEW_LINE>}<NEW_LINE>} | Request request = exchange.getCurrentRequest(); |
39,175 | public static void executeCommand(String[] args) throws IOException {<NEW_LINE>OptionParser parser = getParser();<NEW_LINE>// declare parameters<NEW_LINE>List<String> jobIds = null;<NEW_LINE>Integer nodeId = null;<NEW_LINE>String url = null;<NEW_LINE>Boolean confirm = false;<NEW_LINE>// parse command-line input<NEW_LINE>args = AdminToolUtils.copyArrayAddFirst(args, "--" + OPT_HEAD_SCHEDULED_STOP);<NEW_LINE>OptionSet options = parser.parse(args);<NEW_LINE>if (options.has(AdminParserUtils.OPT_HELP)) {<NEW_LINE>printHelp(System.out);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// check required options and/or conflicting options<NEW_LINE>AdminParserUtils.checkRequired(options, OPT_HEAD_SCHEDULED_STOP);<NEW_LINE>AdminParserUtils.checkRequired(options, AdminParserUtils.OPT_NODE);<NEW_LINE>AdminParserUtils.checkRequired(options, AdminParserUtils.OPT_URL);<NEW_LINE>// load parameters<NEW_LINE>jobIds = (List<String>) options.valuesOf(OPT_HEAD_SCHEDULED_STOP);<NEW_LINE>if (jobIds.size() < 1) {<NEW_LINE>throw new VoldemortException("Please specify scheduled jobs to stop.");<NEW_LINE>}<NEW_LINE>nodeId = (Integer) <MASK><NEW_LINE>url = (String) options.valueOf(AdminParserUtils.OPT_URL);<NEW_LINE>if (options.has(AdminParserUtils.OPT_CONFIRM)) {<NEW_LINE>confirm = true;<NEW_LINE>}<NEW_LINE>// print summary<NEW_LINE>System.out.println("Stop scheduled jobs");<NEW_LINE>System.out.println("Location:");<NEW_LINE>System.out.println(" bootstrap url = " + url);<NEW_LINE>System.out.println(" node = " + nodeId);<NEW_LINE>System.out.println("Jobs to stop:");<NEW_LINE>System.out.println(" " + Joiner.on(", ").join(jobIds));<NEW_LINE>// execute command<NEW_LINE>if (!AdminToolUtils.askConfirm(confirm, "stop scheduled job")) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>AdminClient adminClient = AdminToolUtils.getAdminClient(url);<NEW_LINE>doStopScheduledJobs(adminClient, nodeId, jobIds);<NEW_LINE>} | options.valueOf(AdminParserUtils.OPT_NODE); |
10,015 | final AcceptTransitGatewayVpcAttachmentResult executeAcceptTransitGatewayVpcAttachment(AcceptTransitGatewayVpcAttachmentRequest acceptTransitGatewayVpcAttachmentRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(acceptTransitGatewayVpcAttachmentRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE><MASK><NEW_LINE>Request<AcceptTransitGatewayVpcAttachmentRequest> request = null;<NEW_LINE>Response<AcceptTransitGatewayVpcAttachmentResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new AcceptTransitGatewayVpcAttachmentRequestMarshaller().marshall(super.beforeMarshalling(acceptTransitGatewayVpcAttachmentRequest));<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, "EC2");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "AcceptTransitGatewayVpcAttachment");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>StaxResponseHandler<AcceptTransitGatewayVpcAttachmentResult> responseHandler = new StaxResponseHandler<AcceptTransitGatewayVpcAttachmentResult>(new AcceptTransitGatewayVpcAttachmentResultStaxUnmarshaller());<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); |
942,831 | public SupportAccess registerGrant(DeploymentId deployment, String by, X509Certificate certificate) {<NEW_LINE>try (Lock lock = controller.curator().lockSupportAccess(deployment)) {<NEW_LINE>var now = controller.clock().instant();<NEW_LINE>SupportAccess supportAccess = forDeployment(deployment);<NEW_LINE>if (certificate.getNotAfter().toInstant().isBefore(now)) {<NEW_LINE>throw new IllegalArgumentException("Support access certificate has already expired!");<NEW_LINE>}<NEW_LINE>if (certificate.getNotAfter().toInstant().isAfter(now.plus(MAX_SUPPORT_ACCESS_TIME))) {<NEW_LINE>throw new IllegalArgumentException("Support access certificate validity time is limited to " + MAX_SUPPORT_ACCESS_TIME);<NEW_LINE>}<NEW_LINE>if (supportAccess.currentStatus(now).state() == NOT_ALLOWED) {<NEW_LINE>throw new IllegalArgumentException(<MASK><NEW_LINE>}<NEW_LINE>SupportAccess granted = supportAccess.withGrant(new SupportAccessGrant(by, certificate));<NEW_LINE>controller.curator().writeSupportAccess(deployment, granted);<NEW_LINE>return granted;<NEW_LINE>}<NEW_LINE>} | "Support access is not currently allowed by " + deployment.toUserFriendlyString()); |
1,227,158 | public Node visit(final MethodCallExpr n, final A arg) {<NEW_LINE>if (n.getScope() != null) {<NEW_LINE>n.setScope((Expression) n.getScope().accept(this, arg));<NEW_LINE>}<NEW_LINE>final List<Type<MASK><NEW_LINE>if (typeArgs != null) {<NEW_LINE>for (int i = 0; i < typeArgs.size(); i++) {<NEW_LINE>typeArgs.set(i, (Type) typeArgs.get(i).accept(this, arg));<NEW_LINE>}<NEW_LINE>removeNulls(typeArgs);<NEW_LINE>}<NEW_LINE>final List<Expression> args = n.getArgs();<NEW_LINE>if (args != null) {<NEW_LINE>for (int i = 0; i < args.size(); i++) {<NEW_LINE>args.set(i, (Expression) args.get(i).accept(this, arg));<NEW_LINE>}<NEW_LINE>removeNulls(args);<NEW_LINE>}<NEW_LINE>return n;<NEW_LINE>} | > typeArgs = n.getTypeArgs(); |
893,973 | boolean updateCompactionProgress(String partitionPath, String fieldName, long progressTime) {<NEW_LINE>try {<NEW_LINE>// load existing progress checkpoint.<NEW_LINE>Map<String, Long> checkpoints = getCompactionProgress(partitionPath);<NEW_LINE>// Ensure we don't downgrade progress already recorded.<NEW_LINE>if (progressTime <= checkpoints.getOrDefault(fieldName, DEFAULT_TIME)) {<NEW_LINE>logger.info("Skipping update of compaction progress for {} because saved {} is more recent.", partitionPath, fieldName);<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>checkpoints.put(fieldName, Math.max(progressTime, checkpoints.get(fieldName)));<NEW_LINE>String <MASK><NEW_LINE>ByteArrayInputStream bais = new ByteArrayInputStream(json.getBytes());<NEW_LINE>requestAgent.doWithRetries(() -> {<NEW_LINE>azureBlobDataAccessor.uploadFile(AzureCloudDestination.CHECKPOINT_CONTAINER, partitionPath, bais);<NEW_LINE>return null;<NEW_LINE>}, "Update compaction progress", partitionPath);<NEW_LINE>logger.info("Marked compaction of partition {} complete up to {} {}", partitionPath, fieldName, new Date(progressTime));<NEW_LINE>return true;<NEW_LINE>} catch (CloudStorageException | IOException e) {<NEW_LINE>logger.error("Could not save compaction progress for {}", partitionPath, e);<NEW_LINE>azureMetrics.compactionProgressWriteErrorCount.inc();<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>} | json = objectMapper.writeValueAsString(checkpoints); |
1,011,966 | protected <T extends Broadcaster> T createBroadcaster(Class<T> c, Object id) throws BroadcasterCreationException {<NEW_LINE>try {<NEW_LINE>T b = config.framework(<MASK><NEW_LINE>b.initialize(id.toString(), legacyBroadcasterURI, config);<NEW_LINE>b.setSuspendPolicy(defaultPolicyInteger, defaultPolicy);<NEW_LINE>if (b.getBroadcasterConfig() == null) {<NEW_LINE>b.setBroadcasterConfig(new BroadcasterConfig(config.framework().broadcasterFilters, config, id.toString()).init());<NEW_LINE>}<NEW_LINE>b.setBroadcasterLifeCyclePolicy(policy);<NEW_LINE>if (DefaultBroadcaster.class.isAssignableFrom(clazz)) {<NEW_LINE>DefaultBroadcaster.class.cast(b).start();<NEW_LINE>}<NEW_LINE>for (BroadcasterListener l : broadcasterListeners) {<NEW_LINE>b.addBroadcasterListener(l);<NEW_LINE>}<NEW_LINE>logger.trace("Broadcaster {} was created {}", id, b);<NEW_LINE>notifyOnPostCreate(b);<NEW_LINE>return b;<NEW_LINE>} catch (Throwable t) {<NEW_LINE>throw new BroadcasterCreationException(t);<NEW_LINE>}<NEW_LINE>} | ).newClassInstance(c, c); |
969,782 | public String createNewPolicyForResourceSet(@PathVariable(value = "rsid") Long rsid, @RequestBody String jsonString, Model m, Authentication auth) {<NEW_LINE>ResourceSet rs = resourceSetService.getById(rsid);<NEW_LINE>if (rs == null) {<NEW_LINE>m.addAttribute(HttpCodeView.CODE, HttpStatus.NOT_FOUND);<NEW_LINE>return HttpCodeView.VIEWNAME;<NEW_LINE>}<NEW_LINE>if (!rs.getOwner().equals(auth.getName())) {<NEW_LINE>logger.warn("Unauthorized resource set request from bad user; expected " + rs.getOwner() + " got " + auth.getName());<NEW_LINE>// authenticated user didn't match the owner of the resource set<NEW_LINE>m.addAttribute(HttpCodeView.CODE, HttpStatus.FORBIDDEN);<NEW_LINE>return HttpCodeView.VIEWNAME;<NEW_LINE>}<NEW_LINE>Policy p = gson.fromJson(jsonString, Policy.class);<NEW_LINE>if (p.getId() != null) {<NEW_LINE>logger.warn("Tried to add a policy with a non-null ID: " + p.getId());<NEW_LINE>m.addAttribute(HttpCodeView.CODE, HttpStatus.BAD_REQUEST);<NEW_LINE>return HttpCodeView.VIEWNAME;<NEW_LINE>}<NEW_LINE>for (Claim claim : p.getClaimsRequired()) {<NEW_LINE>if (claim.getId() != null) {<NEW_LINE>logger.warn("Tried to add a policy with a non-null claim ID: " + claim.getId());<NEW_LINE>m.addAttribute(HttpCodeView.CODE, HttpStatus.BAD_REQUEST);<NEW_LINE>return HttpCodeView.VIEWNAME;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>rs.getPolicies().add(p);<NEW_LINE>ResourceSet saved = resourceSetService.update(rs, rs);<NEW_LINE>// find the new policy object<NEW_LINE>Collection<Policy> newPolicies = Sets.difference(new HashSet<>(saved.getPolicies()), new HashSet<>(rs.getPolicies()));<NEW_LINE>if (newPolicies.size() == 1) {<NEW_LINE>Policy newPolicy = newPolicies.iterator().next();<NEW_LINE>m.addAttribute(JsonEntityView.ENTITY, newPolicy);<NEW_LINE>return JsonEntityView.VIEWNAME;<NEW_LINE>} else {<NEW_LINE><MASK><NEW_LINE>m.addAttribute(HttpCodeView.CODE, HttpStatus.INTERNAL_SERVER_ERROR);<NEW_LINE>return HttpCodeView.VIEWNAME;<NEW_LINE>}<NEW_LINE>} | logger.warn("Unexpected result trying to add a new policy object: " + newPolicies); |
1,283,844 | public void testDefaultContextForAllContextTypes(String contextSvcName, PrintWriter out) throws Exception {<NEW_LINE>Callable<?> javaCompLookup = new Callable<Object>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public Object call() throws Exception {<NEW_LINE>InitialContext initialContext = new InitialContext();<NEW_LINE>tran.begin();<NEW_LINE>try {<NEW_LINE>return initialContext.lookup("java:comp/env/entry1");<NEW_LINE>} catch (NamingException x) {<NEW_LINE>// pass - java:comp lookup should not be allowed when thread context is cleared<NEW_LINE>return "EXPECTED_ERROR_OCCURRED";<NEW_LINE>} finally {<NEW_LINE>tran.commit();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>};<NEW_LINE>ContextService contextSvc = (ContextService) new InitialContext().lookup(contextSvcName);<NEW_LINE>Map<String, String> execProps = Collections.singletonMap(WSContextService.DEFAULT_CONTEXT, WSContextService.ALL_CONTEXT_TYPES);<NEW_LINE>javaCompLookup = contextSvc.createContextualProxy(javaCompLookup, execProps, Callable.class);<NEW_LINE>tran.begin();<NEW_LINE>try {<NEW_LINE><MASK><NEW_LINE>if (!"EXPECTED_ERROR_OCCURRED".equals(result))<NEW_LINE>throw new Exception("Thread context should have been cleared/defaulted. Should not be able to lookup from java:comp. Value: " + result);<NEW_LINE>} finally {<NEW_LINE>tran.commit();<NEW_LINE>}<NEW_LINE>} | Object result = javaCompLookup.call(); |
762,511 | public static int compareGeneric(Property prop, Object o1, Object o2) {<NEW_LINE>if (o1 == null && o2 == null)<NEW_LINE>return 0;<NEW_LINE>if (o1 == null)<NEW_LINE>return -1;<NEW_LINE>if (o2 == null)<NEW_LINE>return 1;<NEW_LINE>int type = prop.getElementType();<NEW_LINE>if (type == Property.TYPE_INTEGER)<NEW_LINE>return compareIntegers((Integer) o1, (Integer) o2);<NEW_LINE>if (type == Property.TYPE_BOOLEAN)<NEW_LINE>return compareBooleans((Boolean) o1, (Boolean) o2);<NEW_LINE>if (type == Property.TYPE_STRING)<NEW_LINE>return compareStrings((String) o1, (String) o2);<NEW_LINE>if (type == Property.TYPE_DOUBLE)<NEW_LINE>return compareDoubles((Double) o1, (Double) o2);<NEW_LINE>if (type == Property.TYPE_FLOAT)<NEW_LINE>return compareFloats((Float) o1, (Float) o2);<NEW_LINE>if (type == Property.TYPE_OBJECT)<NEW_LINE>return compareObjects((Object) o1, (Object) o2);<NEW_LINE>if (type == Property.TYPE_LONG)<NEW_LINE>return compareLongs((Long) o1, (Long) o2);<NEW_LINE>if (type == Property.TYPE_ENUM)<NEW_LINE>return compareObjects((Object<MASK><NEW_LINE>return 1;<NEW_LINE>} | ) o1, (Object) o2); |
75,286 | final ListManagedSchemaArnsResult executeListManagedSchemaArns(ListManagedSchemaArnsRequest listManagedSchemaArnsRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(listManagedSchemaArnsRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<ListManagedSchemaArnsRequest> request = null;<NEW_LINE>Response<ListManagedSchemaArnsResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new ListManagedSchemaArnsRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(listManagedSchemaArnsRequest));<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, "CloudDirectory");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ListManagedSchemaArns");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<ListManagedSchemaArnsResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(<MASK><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>} | false), new ListManagedSchemaArnsResultJsonUnmarshaller()); |
64,593 | private static void tryAssertionFromClauseBeginBodyEnd(RegressionEnvironment env, boolean soda) {<NEW_LINE>RegressionPath path = new RegressionPath();<NEW_LINE>String epl = "@name('split') @public on OrderBean " + "insert into BeginEvent select orderdetail.orderId as orderId " + "insert into OrderItem select * from [select orderdetail.orderId as orderId, * from orderdetail.items] " + "insert into EndEvent select orderdetail.orderId as orderId " + "output all";<NEW_LINE>env.compileDeploy(soda, epl, path);<NEW_LINE>env.assertStatement("split", statement -> assertEquals(StatementType.ON_SPLITSTREAM, statement.getProperty(StatementProperty.STATEMENTTYPE)));<NEW_LINE>env.compileDeploy("@name('s0') select * from BeginEvent", path).addListener("s0");<NEW_LINE>env.compileDeploy("@name('s1') select * from OrderItem", path).addListener("s1");<NEW_LINE>env.compileDeploy("@name('s2') select * from EndEvent", path).addListener("s2");<NEW_LINE>env.assertThat(() -> {<NEW_LINE>EventType orderItemType = env.runtime().getEventTypeService().getEventType(env.deploymentId("split"), "OrderItem");<NEW_LINE>assertEquals("[amount, itemId, price, productId, orderId]", Arrays.toString(orderItemType.getPropertyNames()));<NEW_LINE>});<NEW_LINE>env.sendEventBean(OrderBeanFactory.makeEventOne());<NEW_LINE>assertFromClauseWContained(env, "PO200901", new Object[][] { { "PO200901", "A001" }, { "PO200901", "A002" }, { "PO200901", "A003" } });<NEW_LINE>env.sendEventBean(OrderBeanFactory.makeEventTwo());<NEW_LINE>assertFromClauseWContained(env, "PO200902", new Object[][] <MASK><NEW_LINE>env.sendEventBean(OrderBeanFactory.makeEventFour());<NEW_LINE>assertFromClauseWContained(env, "PO200904", new Object[0][]);<NEW_LINE>env.undeployAll();<NEW_LINE>} | { { "PO200902", "B001" } }); |
333,072 | private void handler(final Object serviceBean) {<NEW_LINE>Class<?> clazz;<NEW_LINE>try {<NEW_LINE>clazz = serviceBean.getClass();<NEW_LINE>} catch (Exception e) {<NEW_LINE>LOG.error("failed to get grpc target class", e);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (AopUtils.isAopProxy(serviceBean)) {<NEW_LINE>clazz = AopUtils.getTargetClass(serviceBean);<NEW_LINE>}<NEW_LINE>Class<?> parent = clazz.getSuperclass();<NEW_LINE>Class<?> classes = parent.getDeclaringClass();<NEW_LINE>String packageName;<NEW_LINE>try {<NEW_LINE>String serviceName = ShenyuClientConstants.SERVICE_NAME;<NEW_LINE>Field field = classes.getField(serviceName);<NEW_LINE>field.setAccessible(true);<NEW_LINE>packageName = field.get(null).toString();<NEW_LINE>} catch (Exception e) {<NEW_LINE>LOG.error(String.format<MASK><NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (StringUtils.isEmpty(packageName)) {<NEW_LINE>LOG.error(String.format("grpc SERVICE_NAME can not found: %s", classes));<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>ShenyuGrpcClient beanShenyuClient = AnnotatedElementUtils.findMergedAnnotation(clazz, ShenyuGrpcClient.class);<NEW_LINE>String basePath = Optional.ofNullable(beanShenyuClient).map(annotation -> StringUtils.defaultIfBlank(beanShenyuClient.path(), "")).orElse("");<NEW_LINE>if (basePath.contains("*")) {<NEW_LINE>Method[] methods = ReflectionUtils.getDeclaredMethods(clazz);<NEW_LINE>for (Method method : methods) {<NEW_LINE>publisher.publishEvent(buildMetaDataDTO(packageName, beanShenyuClient, method, basePath));<NEW_LINE>}<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final Method[] methods = ReflectionUtils.getUniqueDeclaredMethods(clazz);<NEW_LINE>for (Method method : methods) {<NEW_LINE>ShenyuGrpcClient methodShenyuClient = AnnotatedElementUtils.findMergedAnnotation(method, ShenyuGrpcClient.class);<NEW_LINE>if (Objects.nonNull(methodShenyuClient)) {<NEW_LINE>publisher.publishEvent(buildMetaDataDTO(packageName, methodShenyuClient, method, basePath));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | ("SERVICE_NAME field not found: %s", classes), e); |
838,613 | void zookeeperStatefulSetDescription(StatefulSet sts) {<NEW_LINE>Storage oldStorage = getOldStorage(sts);<NEW_LINE>if (sts != null && sts.getSpec() != null) {<NEW_LINE>this.zkCurrentReplicas = sts.getSpec().getReplicas();<NEW_LINE>}<NEW_LINE>this.zkCluster = ZookeeperCluster.fromCrd(reconciliation, kafkaAssembly, versions, oldStorage, zkCurrentReplicas != null ? zkCurrentReplicas : 0);<NEW_LINE>// We are upgrading from previous Strimzi version which has a sidecars. The older sidecar<NEW_LINE>// configurations allowed only older versions of TLS to be used by default. But the Zookeeper<NEW_LINE>// native TLS support enabled by default only secure TLSv1.2. That is correct, but makes the<NEW_LINE>// upgrade hard since Kafka will be unable to connect. So in the first roll, we enable also<NEW_LINE>// older TLS versions in Zookeeper so that we can configure the Kafka sidecars to enable<NEW_LINE>// TLSv1.2 as well. This will be removed again in the next rolling update of Zookeeper -> done<NEW_LINE>// only when Kafka is ready for it.<NEW_LINE>if (sts != null && sts.getSpec() != null && sts.getSpec().getTemplate().getSpec().getContainers().size() > 1) {<NEW_LINE>zkCluster.getConfiguration(<MASK><NEW_LINE>zkCluster.getConfiguration().setConfigOption("ssl.enabledProtocols", "TLSv1.2,TLSv1.1,TLSv1");<NEW_LINE>}<NEW_LINE>} | ).setConfigOption("ssl.protocol", "TLS"); |
1,073,850 | protected JComponent buildContent() {<NEW_LINE>JPanel contentPanel = new JPanel(new MigLayout("fill, wrap 1"));<NEW_LINE>contentPanel.setBackground(COLOR_TAB_CONTENT_BACKGROUND);<NEW_LINE>contentPanel.add(getLabel(SECTION_HEADER_FONT, line1));<NEW_LINE>JPanel openPanel = new JPanel(new MigLayout("fill"));<NEW_LINE>openPanel.setBackground(COLOR_TAB_CONTENT_BACKGROUND2);<NEW_LINE>openPanel.add(getLabel(SECTION_HEADER_FONT, openLine), "al left");<NEW_LINE>openPanel.add(new JLabel(new ImageIcon(open)), "al right");<NEW_LINE>contentPanel.add(openPanel);<NEW_LINE>JPanel connectPanel = new JPanel(new MigLayout("fill, wrap 1"));<NEW_LINE>connectPanel.setBackground(COLOR_TAB_CONTENT_BACKGROUND);<NEW_LINE>connectPanel.add(new JLabel(new ImageIcon(connect)), "al left");<NEW_LINE>connectPanel.add(getLabel(SECTION_HEADER_FONT, connectLine1), "shrink, al left");<NEW_LINE>connectPanel.add(getLabel(SECTION_HEADER_FONT, connectLine2), "shrink, al left");<NEW_LINE>contentPanel.add(connectPanel);<NEW_LINE>JPanel runPanel = new <MASK><NEW_LINE>runPanel.setBackground(COLOR_TAB_CONTENT_BACKGROUND2);<NEW_LINE>runPanel.add(new JLabel(new ImageIcon(run)), "al right");<NEW_LINE>runPanel.add(getLabel(SECTION_HEADER_FONT, runLine), "al left");<NEW_LINE>contentPanel.add(runPanel);<NEW_LINE>return new ContentSection(contentPanel, false);<NEW_LINE>} | JPanel(new MigLayout("fill")); |
1,757,109 | private static ArithNode convertFieldArith(MethodNode mth, InsnNode insn) {<NEW_LINE>InsnArg arg = insn.getArg(0);<NEW_LINE>if (!arg.isInsnWrap()) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>InsnNode wrap = ((InsnWrapArg) arg).getWrapInsn();<NEW_LINE>InsnType wrapType = wrap.getType();<NEW_LINE>if (wrapType != InsnType.ARITH && wrapType != InsnType.STR_CONCAT || !wrap.getArg(0).isInsnWrap()) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>InsnArg getWrap = wrap.getArg(0);<NEW_LINE>InsnNode get = ((InsnWrapArg) getWrap).getWrapInsn();<NEW_LINE>InsnType getType = get.getType();<NEW_LINE>if (getType != InsnType.IGET && getType != InsnType.SGET) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>FieldInfo field = (FieldInfo) ((IndexInsnNode) insn).getIndex();<NEW_LINE>FieldInfo innerField = (FieldInfo) ((IndexInsnNode) get).getIndex();<NEW_LINE>if (!field.equals(innerField)) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>if (getType == InsnType.IGET && insn.getType() == InsnType.IPUT) {<NEW_LINE>InsnArg reg = get.getArg(0);<NEW_LINE>InsnArg putReg = insn.getArg(1);<NEW_LINE>if (!reg.equals(putReg)) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>InsnArg fArg = getWrap.duplicate();<NEW_LINE>InsnRemover.unbindInsn(mth, get);<NEW_LINE>if (insn.getType() == InsnType.IPUT) {<NEW_LINE>InsnRemover.unbindArgUsage(mth, insn.getArg(1));<NEW_LINE>}<NEW_LINE>if (wrapType == InsnType.ARITH) {<NEW_LINE>ArithNode ar = (ArithNode) wrap;<NEW_LINE>return ArithNode.oneArgOp(ar.getOp(), fArg, ar.getArg(1));<NEW_LINE>}<NEW_LINE>int argsCount = wrap.getArgsCount();<NEW_LINE>InsnNode concat = new InsnNode(InsnType.STR_CONCAT, argsCount - 1);<NEW_LINE>for (int i = 1; i < argsCount; i++) {<NEW_LINE>concat.addArg(wrap.getArg(i));<NEW_LINE>}<NEW_LINE>return ArithNode.oneArgOp(ArithOp.ADD, fArg<MASK><NEW_LINE>} catch (Exception e) {<NEW_LINE>LOG.debug("Can't convert field arith insn: {}, mth: {}", insn, mth, e);<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>} | , InsnArg.wrapArg(concat)); |
228,946 | private static void printDetails(String name, Node node, int level) {<NEW_LINE>FeatureDescriptor feat = node.descriptor;<NEW_LINE>if (feat == null) {<NEW_LINE>System.out.println(" "<MASK><NEW_LINE>} else {<NEW_LINE>String prefix = " ".repeat(level * 2);<NEW_LINE>// start on index 10 or a tab spaces after tree<NEW_LINE>int len = prefix.length() + name.length();<NEW_LINE>String suffix;<NEW_LINE>if (len <= 18) {<NEW_LINE>suffix = " ".repeat(20 - len);<NEW_LINE>} else {<NEW_LINE>suffix = "\t";<NEW_LINE>}<NEW_LINE>String experimental = feat.experimental() ? "Experimental - " : "";<NEW_LINE>String nativeDesc = "";<NEW_LINE>if (!feat.nativeSupported()) {<NEW_LINE>nativeDesc = " (NOT SUPPORTED in native image)";<NEW_LINE>} else {<NEW_LINE>if (!feat.nativeDescription().isBlank()) {<NEW_LINE>nativeDesc = " (Native image: " + feat.nativeDescription() + ")";<NEW_LINE>}<NEW_LINE>}<NEW_LINE>System.out.println(prefix + name + suffix + experimental + feat.description() + nativeDesc);<NEW_LINE>}<NEW_LINE>node.children.forEach((childName, childNode) -> {<NEW_LINE>FeatureDescriptor descriptor = childNode.descriptor;<NEW_LINE>String actualName;<NEW_LINE>if (descriptor == null) {<NEW_LINE>actualName = childName;<NEW_LINE>} else {<NEW_LINE>actualName = descriptor.name();<NEW_LINE>}<NEW_LINE>printDetails(actualName, childNode, level + 1);<NEW_LINE>});<NEW_LINE>} | .repeat(level) + name); |
364,912 | public SubjectAreaOMASAPIResponse<ProjectScope> createProjectScope(String serverName, String userId, ProjectScope projectScope) {<NEW_LINE>String restAPIName = "createProjectScope";<NEW_LINE>RESTCallToken token = restCallLogger.<MASK><NEW_LINE>SubjectAreaOMASAPIResponse<ProjectScope> response = new SubjectAreaOMASAPIResponse<>();<NEW_LINE>AuditLog auditLog = null;<NEW_LINE>// should not be called without a supplied relationship - the calling layer should not allow this.<NEW_LINE>try {<NEW_LINE>auditLog = instanceHandler.getAuditLog(userId, serverName, restAPIName);<NEW_LINE>RelationshipHandler handler = instanceHandler.getRelationshipHandler(serverName, userId, restAPIName);<NEW_LINE>ProjectScope createdProjectScope = handler.createProjectScopeRelationship(userId, projectScope);<NEW_LINE>response.addResult(createdProjectScope);<NEW_LINE>} catch (Exception exception) {<NEW_LINE>response = getResponseForException(exception, auditLog, className, restAPIName);<NEW_LINE>}<NEW_LINE>restCallLogger.logRESTCallReturn(token, response.toString());<NEW_LINE>return response;<NEW_LINE>} | logRESTCall(serverName, userId, restAPIName); |
931,263 | private Tuple2<Process, EBPFProcessDownstream> prepareReportHostProcess(EBPFHostProcessMetadata hostProcess, String agentId) {<NEW_LINE><MASK><NEW_LINE>// entity<NEW_LINE>process.setServiceName(namingControl.formatServiceName(hostProcess.getEntity().getServiceName()));<NEW_LINE>process.setServiceNormal(true);<NEW_LINE>process.setLayer(Layer.valueOf(hostProcess.getEntity().getLayer()));<NEW_LINE>process.setInstanceName(namingControl.formatInstanceName(hostProcess.getEntity().getInstanceName()));<NEW_LINE>process.setName(hostProcess.getEntity().getProcessName());<NEW_LINE>// metadata<NEW_LINE>process.setDetectType(ProcessDetectType.VM);<NEW_LINE>process.setAgentId(agentId);<NEW_LINE>final JsonObject properties = new JsonObject();<NEW_LINE>properties.addProperty(ProcessTraffic.PropertyUtil.HOST_IP, hostProcess.getHostIP());<NEW_LINE>properties.addProperty(ProcessTraffic.PropertyUtil.PID, hostProcess.getPid());<NEW_LINE>properties.addProperty(ProcessTraffic.PropertyUtil.COMMAND_LINE, hostProcess.getCmd());<NEW_LINE>process.setProperties(properties);<NEW_LINE>// timestamp<NEW_LINE>process.setTimeBucket(TimeBucket.getTimeBucket(System.currentTimeMillis(), DownSampling.Minute));<NEW_LINE>process.prepare();<NEW_LINE>final String processId = process.getEntityId();<NEW_LINE>final EBPFProcessDownstream downstream = EBPFProcessDownstream.newBuilder().setProcessId(processId).setHostProcess(EBPFHostProcessDownstream.newBuilder().setPid(hostProcess.getPid()).build()).build();<NEW_LINE>return Tuple.of(process, downstream);<NEW_LINE>} | final Process process = new Process(); |
1,587,349 | final CreateOutpostResult executeCreateOutpost(CreateOutpostRequest createOutpostRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(createOutpostRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<CreateOutpostRequest> request = null;<NEW_LINE>Response<CreateOutpostResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new CreateOutpostRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(createOutpostRequest));<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, "Outposts");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "CreateOutpost");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<CreateOutpostResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new CreateOutpostResultJsonUnmarshaller());<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()); |
1,754,571 | public static int mincross_(ST_Agraph_s g, int startpass, int endpass, boolean doBalance) {<NEW_LINE>ENTERING("7lrk2rxqnwwdau8cx85oqkpmv", "mincross_");<NEW_LINE>try {<NEW_LINE>int maxthispass = 0, iter, trying, pass;<NEW_LINE>int cur_cross, best_cross;<NEW_LINE>if (startpass > 1) {<NEW_LINE>cur_cross = best_cross = ncross(g);<NEW_LINE>save_best(g);<NEW_LINE>} else<NEW_LINE>cur_cross = best_cross = INT_MAX;<NEW_LINE>for (pass = startpass; pass <= endpass; pass++) {<NEW_LINE>if (pass <= 1) {<NEW_LINE>maxthispass = MIN(4, <MASK><NEW_LINE>if (EQ(g, dot_root(g)))<NEW_LINE>build_ranks(g, pass);<NEW_LINE>if (pass == 0)<NEW_LINE>flat_breakcycles(g);<NEW_LINE>flat_reorder(g);<NEW_LINE>if ((cur_cross = ncross(g)) <= best_cross) {<NEW_LINE>save_best(g);<NEW_LINE>best_cross = cur_cross;<NEW_LINE>}<NEW_LINE>trying = 0;<NEW_LINE>} else {<NEW_LINE>maxthispass = Z.z().MaxIter;<NEW_LINE>if (cur_cross > best_cross)<NEW_LINE>restore_best(g);<NEW_LINE>cur_cross = best_cross;<NEW_LINE>}<NEW_LINE>trying = 0;<NEW_LINE>for (iter = 0; iter < maxthispass; iter++) {<NEW_LINE>if (trying++ >= Z.z().MinQuit)<NEW_LINE>break;<NEW_LINE>if (cur_cross == 0)<NEW_LINE>break;<NEW_LINE>mincross_step(g, iter);<NEW_LINE>if ((cur_cross = ncross(g)) <= best_cross) {<NEW_LINE>save_best(g);<NEW_LINE>if (cur_cross < Z.z().Convergence * best_cross)<NEW_LINE>trying = 0;<NEW_LINE>best_cross = cur_cross;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (cur_cross == 0)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>if (cur_cross > best_cross)<NEW_LINE>restore_best(g);<NEW_LINE>if (best_cross > 0) {<NEW_LINE>transpose(g, false);<NEW_LINE>best_cross = ncross(g);<NEW_LINE>}<NEW_LINE>if (doBalance) {<NEW_LINE>for (iter = 0; iter < maxthispass; iter++) balance(g);<NEW_LINE>}<NEW_LINE>return best_cross;<NEW_LINE>} finally {<NEW_LINE>LEAVING("7lrk2rxqnwwdau8cx85oqkpmv", "mincross_");<NEW_LINE>}<NEW_LINE>} | Z.z().MaxIter); |
1,551,975 | public static void vertical9(Kernel1D_S32 kernel, GrayS16 src, GrayI16 dst) {<NEW_LINE>final short[] dataSrc = src.data;<NEW_LINE>final short[] dataDst = dst.data;<NEW_LINE>final int k1 = kernel.data[0];<NEW_LINE>final int k2 = kernel.data[1];<NEW_LINE>final int k3 = kernel.data[2];<NEW_LINE>final int k4 = kernel.data[3];<NEW_LINE>final int k5 = kernel.data[4];<NEW_LINE>final int k6 = kernel.data[5];<NEW_LINE>final int k7 = kernel.data[6];<NEW_LINE>final int k8 = kernel.data[7];<NEW_LINE>final int k9 = kernel.data[8];<NEW_LINE>final int radius = kernel.getRadius();<NEW_LINE>final int imgWidth = dst.getWidth();<NEW_LINE>final int imgHeight = dst.getHeight();<NEW_LINE>final int yEnd = imgHeight - radius;<NEW_LINE>// CONCURRENT_BELOW BoofConcurrency.loopFor(radius, yEnd, y -> {<NEW_LINE>for (int y = radius; y < yEnd; y++) {<NEW_LINE>int indexDst = dst.startIndex + y * dst.stride;<NEW_LINE>int i = src.startIndex + (y - radius) * src.stride;<NEW_LINE>final int iEnd = i + imgWidth;<NEW_LINE>for (; i < iEnd; i++) {<NEW_LINE>int indexSrc = i;<NEW_LINE>int total = (dataSrc[indexSrc]) * k1;<NEW_LINE>indexSrc += src.stride;<NEW_LINE>total += (dataSrc[indexSrc]) * k2;<NEW_LINE>indexSrc += src.stride;<NEW_LINE>total += (dataSrc[indexSrc]) * k3;<NEW_LINE>indexSrc += src.stride;<NEW_LINE>total += (dataSrc[indexSrc]) * k4;<NEW_LINE>indexSrc += src.stride;<NEW_LINE>total += (dataSrc[indexSrc]) * k5;<NEW_LINE>indexSrc += src.stride;<NEW_LINE>total += (dataSrc[indexSrc]) * k6;<NEW_LINE>indexSrc += src.stride;<NEW_LINE>total += <MASK><NEW_LINE>indexSrc += src.stride;<NEW_LINE>total += (dataSrc[indexSrc]) * k8;<NEW_LINE>indexSrc += src.stride;<NEW_LINE>total += (dataSrc[indexSrc]) * k9;<NEW_LINE>dataDst[indexDst++] = (short) total;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// CONCURRENT_ABOVE });<NEW_LINE>} | (dataSrc[indexSrc]) * k7; |
921,469 | private void inspectCloseChords(List<AbstractChordInter> stdChords) {<NEW_LINE>final int maxSlotDx = useWideSlots ? params.maxSlotDxHigh : params.maxSlotDxLow;<NEW_LINE>final MeasureStack stack = measure.getStack();<NEW_LINE>for (int i = 0; i < stdChords.size(); i++) {<NEW_LINE>final AbstractChordInter ch1 = stdChords.get(i);<NEW_LINE>final double x1 = stack.getXOffset(ch1.getCenter());<NEW_LINE>for (AbstractChordInter ch2 : stdChords.subList(i + 1, stdChords.size())) {<NEW_LINE>if (ch1.isVip() && ch2.isVip()) {<NEW_LINE>logger.info("VIP inspectCloseChords {} vs {}", ch1, ch2);<NEW_LINE>}<NEW_LINE>if (getRel(ch1, ch2) != null) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>// Check abscissa<NEW_LINE>final double x2 = stack.getXOffset(ch2.getCenter());<NEW_LINE>final double dx = <MASK><NEW_LINE>if (dx <= maxSlotDx) {<NEW_LINE>setRel(ch1, ch2, CLOSE);<NEW_LINE>setRel(ch2, ch1, CLOSE);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | Math.abs(x1 - x2); |
101,280 | private boolean validateFields() {<NEW_LINE>String tname = teamnameField.getText();<NEW_LINE>if (StringUtils.isEmpty(tname)) {<NEW_LINE>error("Please enter a team name!");<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>boolean rename = false;<NEW_LINE>// verify teamname uniqueness on create<NEW_LINE>if (isCreate) {<NEW_LINE>if (teamnames.contains(tname.toLowerCase())) {<NEW_LINE>error(MessageFormat.format("Team name ''{0}'' is unavailable.", tname));<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>// check rename collision<NEW_LINE>rename = !StringUtils.isEmpty(teamname) <MASK><NEW_LINE>if (rename) {<NEW_LINE>if (teamnames.contains(tname.toLowerCase())) {<NEW_LINE>error(MessageFormat.format("Failed to rename ''{0}'' because ''{1}'' already exists.", teamname, tname));<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>team.name = tname;<NEW_LINE>team.canAdmin = canAdminCheckbox.isSelected();<NEW_LINE>team.canFork = canForkCheckbox.isSelected();<NEW_LINE>team.canCreate = canCreateCheckbox.isSelected();<NEW_LINE>String ml = mailingListsField.getText();<NEW_LINE>if (!StringUtils.isEmpty(ml)) {<NEW_LINE>Set<String> list = new HashSet<String>();<NEW_LINE>for (String address : ml.split("(,|\\s)")) {<NEW_LINE>if (StringUtils.isEmpty(address)) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>list.add(address.toLowerCase());<NEW_LINE>}<NEW_LINE>team.mailingLists.clear();<NEW_LINE>team.mailingLists.addAll(list);<NEW_LINE>}<NEW_LINE>for (RegistrantAccessPermission rp : repositoryPalette.getPermissions()) {<NEW_LINE>team.setRepositoryPermission(rp.registrant, rp.permission);<NEW_LINE>}<NEW_LINE>team.users.clear();<NEW_LINE>team.users.addAll(userPalette.getSelections());<NEW_LINE>team.preReceiveScripts.clear();<NEW_LINE>team.preReceiveScripts.addAll(preReceivePalette.getSelections());<NEW_LINE>team.postReceiveScripts.clear();<NEW_LINE>team.postReceiveScripts.addAll(postReceivePalette.getSelections());<NEW_LINE>return true;<NEW_LINE>} | && !teamname.equalsIgnoreCase(tname); |
1,153,335 | public Version putVersionedWithCustomTimeout(CompositeVoldemortRequest<K, V> requestWrapper) throws ObsoleteVersionException {<NEW_LINE>validateTimeout(requestWrapper.getRoutingTimeoutInMs());<NEW_LINE>for (int attempts = 0; attempts < this.metadataRefreshAttempts; attempts++) {<NEW_LINE>try {<NEW_LINE>String keyHexString = "";<NEW_LINE>long startTimeInMs = System.currentTimeMillis();<NEW_LINE>if (logger.isDebugEnabled()) {<NEW_LINE>ByteArray key = (ByteArray) requestWrapper.getKey();<NEW_LINE>keyHexString = RestUtils.getKeyHexString(key);<NEW_LINE>debugLogStart("PUT_VERSION", requestWrapper.getRequestOriginTimeInMs(), startTimeInMs, keyHexString);<NEW_LINE>}<NEW_LINE>store.put(requestWrapper);<NEW_LINE>if (logger.isDebugEnabled()) {<NEW_LINE>debugLogEnd("PUT_VERSION", requestWrapper.getRequestOriginTimeInMs(), startTimeInMs, System.currentTimeMillis(), keyHexString, 0);<NEW_LINE>}<NEW_LINE>return requestWrapper<MASK><NEW_LINE>} catch (InvalidMetadataException e) {<NEW_LINE>logger.info("Received invalid metadata exception during put [ " + e.getMessage() + " ] on store '" + storeName + "'. Rebootstrapping");<NEW_LINE>bootStrap();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>throw new VoldemortException(this.metadataRefreshAttempts + " metadata refresh attempts failed.");<NEW_LINE>} | .getValue().getVersion(); |
1,824,695 | public void generateEnd(OptimizedTagContext context) {<NEW_LINE>// PK65013 - start<NEW_LINE>String pageContextVar = Constants.JSP_PAGE_CONTEXT_ORIG;<NEW_LINE>JspOptions jspOptions = context.getJspOptions();<NEW_LINE>if (jspOptions != null) {<NEW_LINE>if (context.isTagFile() && jspOptions.isModifyPageContextVariable()) {<NEW_LINE>pageContextVar = Constants.JSP_PAGE_CONTEXT_NEW;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// PK65013 - end<NEW_LINE><MASK><NEW_LINE>// PK65013 change pageContext variable to customizable one.<NEW_LINE>context.writeSource(" if (" + pageContextVar + ".findAttribute(\"TSXBreakRepeat\") != null){");<NEW_LINE>// begin 221381: need to remove the request scope attr for break repeat to allow multiple tsx:repeat tags.<NEW_LINE>// 221381: pop current out object when breaking out of loop.<NEW_LINE>context.writeSource(" out = " + pageContextVar + ".popBody();");<NEW_LINE>context.writeSource(" " + pageContextVar + ".removeAttribute(\"TSXBreakRepeat\", PageContext.REQUEST_SCOPE); // prepare for next repeat tag.");<NEW_LINE>// end 22381<NEW_LINE>context.writeSource(" break;");<NEW_LINE>context.writeSource(" }");<NEW_LINE>context.writeSource(" String " + bufferName + " = ((javax.servlet.jsp.tagext.BodyContent)out).getString();");<NEW_LINE>context.writeSource(" out = " + pageContextVar + ".popBody();");<NEW_LINE>context.writeSource(" out.write(" + bufferName + ");");<NEW_LINE>context.writeSource(" }");<NEW_LINE>context.writeSource(" catch(ArrayIndexOutOfBoundsException ae) {");<NEW_LINE>context.writeSource(" out = " + pageContextVar + ".popBody();");<NEW_LINE>context.writeSource(" break;");<NEW_LINE>context.writeSource(" }");<NEW_LINE>context.writeSource(" catch(Exception e) {");<NEW_LINE>context.writeSource(" out = " + pageContextVar + ".popBody();");<NEW_LINE>context.writeSource(" if (throwException()){");<NEW_LINE>context.writeSource(" throw e;");<NEW_LINE>context.writeSource(" } else {");<NEW_LINE>context.writeSource(" out.println(\"Exception: \" + e);");<NEW_LINE>context.writeSource(" }");<NEW_LINE>context.writeSource(" }");<NEW_LINE>context.writeSource("}");<NEW_LINE>context.writeSource("((java.util.Stack)" + pageContextVar + ".getAttribute(\"TSXRepeatStack\", PageContext.PAGE_SCOPE)).pop();");<NEW_LINE>context.writeSource("((com.ibm.ws.jsp.tsx.tag.DefinedIndexManager) " + pageContextVar + ".getAttribute(\"TSXDefinedIndexManager\", PageContext.PAGE_SCOPE)).removeIndex(\"" + index + "\");");<NEW_LINE>} | String bufferName = context.createTemporaryVariable(); |
399,232 | public static synchronized Note buildFromBase64EncodedData(String noteId, String base64FullNoteData) {<NEW_LINE>Note note = null;<NEW_LINE>if (base64FullNoteData == null) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>byte[] b64DecodedPayload = Base64.decode(base64FullNoteData, Base64.DEFAULT);<NEW_LINE>// Decompress the payload<NEW_LINE>Inflater decompresser = new Inflater();<NEW_LINE>decompresser.setInput(b64DecodedPayload, 0, b64DecodedPayload.length);<NEW_LINE>// max length an Android PN payload can have<NEW_LINE>byte[] result = new byte[4096];<NEW_LINE>int resultLength = 0;<NEW_LINE>try {<NEW_LINE><MASK><NEW_LINE>decompresser.end();<NEW_LINE>} catch (DataFormatException e) {<NEW_LINE>AppLog.e(AppLog.T.NOTIFS, "Can't decompress the PN BlockListPayload. It could be > 4K", e);<NEW_LINE>}<NEW_LINE>String out = null;<NEW_LINE>try {<NEW_LINE>out = new String(result, 0, resultLength, "UTF8");<NEW_LINE>} catch (UnsupportedEncodingException e) {<NEW_LINE>AppLog.e(AppLog.T.NOTIFS, "Notification data contains non UTF8 characters.", e);<NEW_LINE>}<NEW_LINE>if (out != null) {<NEW_LINE>try {<NEW_LINE>JSONObject jsonObject = new JSONObject(out);<NEW_LINE>if (jsonObject.has("notes")) {<NEW_LINE>JSONArray jsonArray = jsonObject.getJSONArray("notes");<NEW_LINE>if (jsonArray != null && jsonArray.length() == 1) {<NEW_LINE>jsonObject = jsonArray.getJSONObject(0);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>note = new Note(noteId, jsonObject);<NEW_LINE>} catch (JSONException e) {<NEW_LINE>AppLog.e(AppLog.T.NOTIFS, "Can't parse the Note JSON received in the PN", e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return note;<NEW_LINE>} | resultLength = decompresser.inflate(result); |
1,134,373 | public void run(RegressionEnvironment env) {<NEW_LINE>String epl = "@name('s0') select * from SupportBean#length(5) output every 5 events order by intPrimitive limit 2 offset 2";<NEW_LINE>env.compileDeploy<MASK><NEW_LINE>String[] fields = "theString".split(",");<NEW_LINE>env.assertPropsPerRowIterator("s0", fields, null);<NEW_LINE>sendEvent(env, "E1", 90);<NEW_LINE>env.assertPropsPerRowIterator("s0", fields, null);<NEW_LINE>sendEvent(env, "E2", 5);<NEW_LINE>env.assertPropsPerRowIterator("s0", fields, null);<NEW_LINE>sendEvent(env, "E3", 60);<NEW_LINE>env.assertPropsPerRowIterator("s0", fields, new Object[][] { { "E1" } });<NEW_LINE>sendEvent(env, "E4", 99);<NEW_LINE>env.assertPropsPerRowIterator("s0", fields, new Object[][] { { "E1" }, { "E4" } });<NEW_LINE>env.assertListenerNotInvoked("s0");<NEW_LINE>sendEvent(env, "E5", 6);<NEW_LINE>env.assertPropsPerRowIterator("s0", fields, new Object[][] { { "E3" }, { "E1" } });<NEW_LINE>env.assertPropsPerRowLastNew("s0", fields, new Object[][] { { "E3" }, { "E1" } });<NEW_LINE>env.undeployAll();<NEW_LINE>} | (epl).addListener("s0"); |
1,517,824 | public SpotFleetRequestConfig unmarshall(StaxUnmarshallerContext context) throws Exception {<NEW_LINE>SpotFleetRequestConfig spotFleetRequestConfig = new SpotFleetRequestConfig();<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 spotFleetRequestConfig;<NEW_LINE>if (xmlEvent == XmlPullParser.START_TAG) {<NEW_LINE>if (context.testExpression("spotFleetRequestId", targetDepth)) {<NEW_LINE>spotFleetRequestConfig.setSpotFleetRequestId(StringStaxUnmarshaller.getInstance<MASK><NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (context.testExpression("spotFleetRequestState", targetDepth)) {<NEW_LINE>spotFleetRequestConfig.setSpotFleetRequestState(StringStaxUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (context.testExpression("spotFleetRequestConfig", targetDepth)) {<NEW_LINE>spotFleetRequestConfig.setSpotFleetRequestConfig(SpotFleetRequestConfigDataStaxUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (context.testExpression("createTime", targetDepth)) {<NEW_LINE>spotFleetRequestConfig.setCreateTime(DateStaxUnmarshaller.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 spotFleetRequestConfig;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | ().unmarshall(context)); |
1,791,262 | private int doSend(BaseMessage message, BrokerGroupInfo brokerGroup) {<NEW_LINE>final SettableFuture<Integer> sendFuture = SettableFuture.create();<NEW_LINE>final SendMessageBack.Callback callback = new SendMessageBack.Callback() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void success() {<NEW_LINE>sendFuture.set(SEND_SUCCESS);<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void fail(Throwable e) {<NEW_LINE>if (e instanceof SendMessageBackException) {<NEW_LINE>LOGGER.warn("send delay message fail. exception: {}", e.getMessage());<NEW_LINE>} else {<NEW_LINE>LOGGER.warn("send delay message fail", e);<NEW_LINE>}<NEW_LINE>sendFuture.set(SEND_FAIL);<NEW_LINE>}<NEW_LINE>};<NEW_LINE>sendMessageBack.sendBack(brokerGroup, message, callback, ClientType.DELAY_PRODUCER);<NEW_LINE>try {<NEW_LINE>return sendFuture.get();<NEW_LINE>} catch (Exception e) {<NEW_LINE>brokerService.refresh(ClientType.<MASK><NEW_LINE>LOGGER.warn("send delay message fail. {}", e.getMessage());<NEW_LINE>return SEND_FAIL;<NEW_LINE>}<NEW_LINE>} | DELAY_PRODUCER, message.getSubject()); |
1,647,423 | private ResolvedType inferReturnType(EntityContext context, HandlerMethod handler) {<NEW_LINE>TypeResolver resolver = context.getTypeResolver();<NEW_LINE>HandlerMethodResolver methodResolver = new HandlerMethodResolver(resolver);<NEW_LINE>RepositoryMetadata repository = context.getRepositoryMetadata();<NEW_LINE>ResolvedType domainReturnType = resolver.resolve(repository.getReturnedDomainClass(handler.getMethod()));<NEW_LINE>ResolvedType methodReturnType = methodResolver.methodReturnType(handler);<NEW_LINE>if (isContainerType(methodReturnType)) {<NEW_LINE>return resolver.resolve(CollectionModel.class, collectionElementType(methodReturnType));<NEW_LINE>} else if (Iterable.class.isAssignableFrom(methodReturnType.getErasedType())) {<NEW_LINE>return resolver.resolve(CollectionModel.class, domainReturnType);<NEW_LINE>} else if (ScalarTypes.builtInScalarType(domainReturnType).isPresent()) {<NEW_LINE>return domainReturnType;<NEW_LINE>} else if (isVoid(domainReturnType)) {<NEW_LINE>return resolver.resolve(Void.TYPE);<NEW_LINE>}<NEW_LINE>return resolver.<MASK><NEW_LINE>} | resolve(EntityModel.class, domainReturnType); |
539,160 | private static void decodeOtherProperties(JmsDestination newDest, byte[] msgForm, int offset) throws JMSException {<NEW_LINE>if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())<NEW_LINE>SibTr.entry(tc, "decodeOtherProperties", new Object[] { newDest, msgForm, offset });<NEW_LINE>PropertyInputStream stream = new PropertyInputStream(msgForm, offset);<NEW_LINE>while (stream.hasMore()) {<NEW_LINE>String shortName = stream.readShortName();<NEW_LINE>String <MASK><NEW_LINE>if (longName != null) {<NEW_LINE>// This can't be null, as we just got the name from the reverseMap!<NEW_LINE>PropertyEntry propEntry = propertyMap.get(longName);<NEW_LINE>Object propValue = propEntry.getPropertyCoder().decodeProperty(stream);<NEW_LINE>setProperty(newDest, longName, propEntry.getIntValue(), propValue);<NEW_LINE>} else {<NEW_LINE>// If there is no mapping for the short name, then the property is not known.<NEW_LINE>// The most likely situation is that we have been sent a property for a newer release.<NEW_LINE>//<NEW_LINE>throw (JMSException) JmsErrorUtils.newThrowable(JMSException.class, "UNKNOWN_PROPERTY_CWSIA0363", new Object[] { shortName }, null, "MsgDestEncodingUtilsImpl.decodeOtherProperties#1", null, tc);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())<NEW_LINE>SibTr.exit(tc, "decodeOtherProperties");<NEW_LINE>} | longName = reverseMap.get(shortName); |
1,327,545 | protected void memberAdd(final UUID serviceId) {<NEW_LINE>if (serviceId == null)<NEW_LINE>throw new IllegalArgumentException();<NEW_LINE>lock.lock();<NEW_LINE>try {<NEW_LINE>if (members.add(serviceId)) {<NEW_LINE>// service was added as quorum member.<NEW_LINE>membersChange.signalAll();<NEW_LINE>final QuorumMember<S> client = getClientAsMember();<NEW_LINE>if (client != null) {<NEW_LINE>final UUID clientId = client.getServiceId();<NEW_LINE>if (serviceId.equals(clientId)) {<NEW_LINE>try {<NEW_LINE>client.memberAdd();<NEW_LINE>} catch (Throwable t) {<NEW_LINE>launderThrowable(t);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// queue client event.<NEW_LINE>sendEvent(new E(QuorumEventEnum.MEMBER_ADD, lastValidToken, token, serviceId));<NEW_LINE>if (log.isInfoEnabled())<NEW_LINE>log.info(<MASK><NEW_LINE>}<NEW_LINE>} finally {<NEW_LINE>lock.unlock();<NEW_LINE>}<NEW_LINE>} | "serviceId=" + serviceId.toString()); |
773,557 | // not used<NEW_LINE>@Deprecated<NEW_LINE>public void trimStackTrace(Member target) {<NEW_LINE>Throwable t = new Throwable();<NEW_LINE>StackTraceElement[] origStackTrace = cause.getStackTrace();<NEW_LINE>StackTraceElement[] currentStackTrace = t.getStackTrace();<NEW_LINE>int skip = 0;<NEW_LINE>for (int i = 1; i <= origStackTrace.length && i <= currentStackTrace.length; ++i) {<NEW_LINE>StackTraceElement a = origStackTrace[origStackTrace.length - i];<NEW_LINE>StackTraceElement b = currentStackTrace[currentStackTrace.length - i];<NEW_LINE>if (a.equals(b)) {<NEW_LINE>skip += 1;<NEW_LINE>} else {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// If we know what method was being called, strip everything<NEW_LINE>// before the call. This hides the JRuby and reflection internals.<NEW_LINE>if (target != null) {<NEW_LINE>String className = target.getDeclaringClass().getName();<NEW_LINE><MASK><NEW_LINE>for (int i = origStackTrace.length - skip - 1; i >= 0; --i) {<NEW_LINE>StackTraceElement frame = origStackTrace[i];<NEW_LINE>if (frame.getClassName().equals(className) && frame.getMethodName().equals(methodName)) {<NEW_LINE>skip = origStackTrace.length - i - 1;<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (skip > 0) {<NEW_LINE>final int len = origStackTrace.length - skip;<NEW_LINE>StackTraceElement[] newStackTrace = new StackTraceElement[len];<NEW_LINE>System.arraycopy(origStackTrace, 0, newStackTrace, 0, len);<NEW_LINE>cause.setStackTrace(newStackTrace);<NEW_LINE>}<NEW_LINE>} | String methodName = target.getName(); |
335,119 | private static void quickSort1(long[] x, int off, int len, LongComparator comp) {<NEW_LINE>// Insertion sort on smallest arrays<NEW_LINE>if (len < SMALL) {<NEW_LINE>for (int i = off; i < len + off; i++) for (int j = i; j > off && comp.compare(x[j - 1], x[j]) > 0; j--) swap(x, j, j - 1);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// Choose a partition element, v<NEW_LINE>// Small arrays, middle element<NEW_LINE>int m = off + len / 2;<NEW_LINE>if (len > SMALL) {<NEW_LINE>int l = off;<NEW_LINE>int n = off + len - 1;<NEW_LINE>if (len > MEDIUM) {<NEW_LINE>// Big arrays, pseudomedian of 9<NEW_LINE>int s = len / 8;<NEW_LINE>l = med3(x, l, l + s, l + 2 * s, comp);<NEW_LINE>m = med3(x, m - s, m, m + s, comp);<NEW_LINE>n = med3(x, n - 2 * s, n - s, n, comp);<NEW_LINE>}<NEW_LINE>// Mid-size, med of 3<NEW_LINE>m = med3(x, l, m, n, comp);<NEW_LINE>}<NEW_LINE>long v = x[m];<NEW_LINE>// Establish Invariant: v* (<v)* (>v)* v*<NEW_LINE>int a = off, b = a, c = off + len - 1, d = c;<NEW_LINE>while (true) {<NEW_LINE>int comparison;<NEW_LINE>while (b <= c && (comparison = comp.compare(x[b], v)) <= 0) {<NEW_LINE>if (comparison == 0)<NEW_LINE>swap(x, a++, b);<NEW_LINE>b++;<NEW_LINE>}<NEW_LINE>while (c >= b && (comparison = comp.compare(x[c], v)) >= 0) {<NEW_LINE>if (comparison == 0)<NEW_LINE>swap(x, c, d--);<NEW_LINE>c--;<NEW_LINE>}<NEW_LINE>if (b > c)<NEW_LINE>break;<NEW_LINE>swap(<MASK><NEW_LINE>}<NEW_LINE>// Swap partition elements back to middle<NEW_LINE>int s, n = off + len;<NEW_LINE>s = Math.min(a - off, b - a);<NEW_LINE>vecswap(x, off, b - s, s);<NEW_LINE>s = Math.min(d - c, n - d - 1);<NEW_LINE>vecswap(x, b, n - s, s);<NEW_LINE>// Recursively sort non-partition-elements<NEW_LINE>if ((s = b - a) > 1)<NEW_LINE>quickSort1(x, off, s, comp);<NEW_LINE>if ((s = d - c) > 1)<NEW_LINE>quickSort1(x, n - s, s, comp);<NEW_LINE>} | x, b++, c--); |
1,134,047 | protected void draw(final Canvas pCanvas, final Object pParameter) {<NEW_LINE><MASK><NEW_LINE>final int kilometers = (int) Math.round(meters / 1000);<NEW_LINE>final boolean checked = meters < mAnimatedMetersSoFar || (kilometers == 10 && mAnimationEnded);<NEW_LINE>final Paint textPaint = checked ? textPaint2 : textPaint1;<NEW_LINE>final Paint backgroundPaint = checked ? backgroundPaint2 : backgroundPaint1;<NEW_LINE>final String text = "" + kilometers + "K";<NEW_LINE>final Rect rect = new Rect();<NEW_LINE>textPaint1.getTextBounds(text, 0, text.length(), rect);<NEW_LINE>pCanvas.drawCircle(0, 0, backgroundRadius, backgroundPaint);<NEW_LINE>pCanvas.drawText(text, -rect.left - rect.width() / 2, rect.height() / 2 - rect.bottom, textPaint);<NEW_LINE>pCanvas.drawCircle(0, 0, backgroundRadius + 1, borderPaint);<NEW_LINE>} | final double meters = (double) pParameter; |
399,671 | public static Set<String> findDependencies(ComponentInfo start, boolean closure, Boolean inst, Set<ComponentInfo> result, ComponentQuery q) {<NEW_LINE>Set<String> missing = new HashSet<>();<NEW_LINE>Set<String> known = new HashSet<>();<NEW_LINE>Deque<ComponentInfo> buffer = new ArrayDeque<>();<NEW_LINE>buffer.add(start);<NEW_LINE>boolean localOnly = Boolean.TRUE.equals(inst);<NEW_LINE>while (!buffer.isEmpty()) {<NEW_LINE>ComponentInfo c = buffer.poll();<NEW_LINE>Version.Match vm = c.getVersion().match(<MASK><NEW_LINE>for (String d : c.getDependencies()) {<NEW_LINE>if (!known.add(d)) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>ComponentInfo res = q.findComponent(d, vm, localOnly, true);<NEW_LINE>if (res == null) {<NEW_LINE>missing.add(d);<NEW_LINE>} else {<NEW_LINE>if (closure) {<NEW_LINE>buffer.add(res);<NEW_LINE>}<NEW_LINE>if (inst == null || (inst == res.isInstalled())) {<NEW_LINE>result.add(res);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return missing.isEmpty() ? null : missing;<NEW_LINE>} | Version.Match.Type.COMPATIBLE); |
1,209,459 | public void prepareOperation(ExtractAskMode mode) throws SevenZipException {<NEW_LINE>final Date createTime = (Date) inArchive.getProperty(inArchiveItemIndex, PropID.CREATION_TIME);<NEW_LINE>final Date accessTime = (Date) inArchive.<MASK><NEW_LINE>final Date writeTime = (Date) inArchive.getProperty(inArchiveItemIndex, PropID.LAST_MODIFICATION_TIME);<NEW_LINE>createTimeInSeconds = createTime == null ? 0L : createTime.getTime() / 1000;<NEW_LINE>modTimeInSeconds = writeTime == null ? 0L : writeTime.getTime() / 1000;<NEW_LINE>accessTimeInSeconds = accessTime == null ? 0L : accessTime.getTime() / 1000;<NEW_LINE>progressHandle.progress(archiveFile.getName() + ": " + (String) inArchive.getProperty(inArchiveItemIndex, PropID.PATH), inArchiveItemIndex);<NEW_LINE>} | getProperty(inArchiveItemIndex, PropID.LAST_ACCESS_TIME); |
1,242,467 | /* (non-Javadoc)<NEW_LINE>* @see org.netbeans.modules.websvc.core.jaxws.policies.JaxWsPoliciesCodeGenerator#generatePolicyAccessCode(java.util.Set, org.netbeans.modules.websvc.api.jaxws.project.config.Client, java.lang.StringBuilder)<NEW_LINE>*/<NEW_LINE>@Override<NEW_LINE>public String generatePolicyAccessCode(Set<String> policyIds, Client client, StringBuilder code) {<NEW_LINE>if (policyIds.isEmpty()) {<NEW_LINE>return "";<NEW_LINE>}<NEW_LINE>Map<String, OWSMPolicyCodeGenerator> map = new HashMap<String, OWSMPolicyCodeGenerator>(GENERATORS);<NEW_LINE>Set<String> keySet = map.keySet();<NEW_LINE>keySet.retainAll(policyIds);<NEW_LINE>if (keySet.isEmpty()) {<NEW_LINE>String id = policyIds.iterator().next();<NEW_LINE>generateDefaultCode(id, client, code);<NEW_LINE>return id;<NEW_LINE>} else {<NEW_LINE>String mainId = null;<NEW_LINE>for (Entry<String, OWSMPolicyCodeGenerator> entry : map.entrySet()) {<NEW_LINE>String id = entry.getKey();<NEW_LINE>OWSMPolicyCodeGenerator generator = entry.getValue();<NEW_LINE>if (mainId == null) {<NEW_LINE>mainId = id;<NEW_LINE>generator.generatePolicyAccessCode(code, client);<NEW_LINE>} else {<NEW_LINE>StringBuilder builder = new StringBuilder();<NEW_LINE><MASK><NEW_LINE>// NOI18N<NEW_LINE>code.append("/* ");<NEW_LINE>code.append(builder.toString());<NEW_LINE>// NOI18N<NEW_LINE>code.append(" */");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return mainId;<NEW_LINE>}<NEW_LINE>} | generator.generatePolicyAccessCode(builder, client); |
1,436,416 | public boolean onPreferenceStartFragment(PreferenceFragmentCompat preferenceFragmentCompat, Preference preference) {<NEW_LINE>FragmentTransaction ft = getSupportFragmentManager().beginTransaction();<NEW_LINE>Bundle args = new Bundle();<NEW_LINE>args.putString(PreferenceFragmentCompat.ARG_PREFERENCE_ROOT, preference.getKey());<NEW_LINE>setToolbarTitle(preference.getTitle().toString());<NEW_LINE>if (preference.getKey().equals(GeneralSettingsFragment.GENERAL_SETTINGS_FRAGMENT_TAG)) {<NEW_LINE>GeneralSettingsFragment fragment = new GeneralSettingsFragment();<NEW_LINE>fragment.setArguments(args);<NEW_LINE>ft.replace(R.id.fragment_container, fragment, preference.getKey());<NEW_LINE>} else if (preference.getKey().equals(AutomationSettingsFragment.AUTOMATION_SETTINGS_FRAG)) {<NEW_LINE>AutomationSettingsFragment fragment = new AutomationSettingsFragment();<NEW_LINE>fragment.setArguments(args);<NEW_LINE>ft.replace(R.id.fragment_container, fragment, preference.getKey());<NEW_LINE>} else if (preference.getKey().equals(TaskSettingsFragment.TASK_SETTINGS_FRAGMENT)) {<NEW_LINE>TaskSettingsFragment fragment = new TaskSettingsFragment();<NEW_LINE>fragment.setArguments(args);<NEW_LINE>ft.replace(R.id.fragment_container, fragment, preference.getKey());<NEW_LINE>} else if (preference.getKey().equals(MessagesSettingsFragment.MESSAGES_FRAGMENT_SETTINGS)) {<NEW_LINE>MessagesSettingsFragment fragment = new MessagesSettingsFragment();<NEW_LINE>fragment.setArguments(args);<NEW_LINE>ft.replace(R.id.fragment_container, fragment, preference.getKey());<NEW_LINE>} else if (preference.getKey().equals(AboutSettingsFragment.ABOUT_SETTINGS_FRAGMENT)) {<NEW_LINE>AboutSettingsFragment fragment = new AboutSettingsFragment();<NEW_LINE>fragment.setArguments(args);<NEW_LINE>ft.replace(R.id.fragment_container, fragment, preference.getKey());<NEW_LINE>}<NEW_LINE>ft.<MASK><NEW_LINE>ft.commit();<NEW_LINE>return true;<NEW_LINE>} | addToBackStack(preference.getKey()); |
1,422,410 | private static Map<String, MetadataFieldMapper.TypeParser> initBuiltInMetadataMappers() {<NEW_LINE>Map<String, MetadataFieldMapper.TypeParser> builtInMetadataMappers;<NEW_LINE>// Use a LinkedHashMap for metadataMappers because iteration order matters<NEW_LINE>builtInMetadataMappers = new LinkedHashMap<>();<NEW_LINE>// _ignored first so that we always load it, even if only _id is requested<NEW_LINE>builtInMetadataMappers.put(IgnoredFieldMapper.NAME, new IgnoredFieldMapper.TypeParser());<NEW_LINE>// UID second so it will be the first (if no ignored fields) stored field to load<NEW_LINE>// (so will benefit from "fields: []" early termination<NEW_LINE>builtInMetadataMappers.put(UidFieldMapper.NAME, new UidFieldMapper.TypeParser());<NEW_LINE>builtInMetadataMappers.put(IdFieldMapper.NAME, new IdFieldMapper.TypeParser());<NEW_LINE>builtInMetadataMappers.put(RoutingFieldMapper.NAME, new RoutingFieldMapper.TypeParser());<NEW_LINE>builtInMetadataMappers.put(IndexFieldMapper.NAME, new IndexFieldMapper.TypeParser());<NEW_LINE>builtInMetadataMappers.put(SourceFieldMapper.NAME, new SourceFieldMapper.TypeParser());<NEW_LINE>builtInMetadataMappers.put(TypeFieldMapper.NAME, new TypeFieldMapper.TypeParser());<NEW_LINE>builtInMetadataMappers.put(AllFieldMapper.NAME, new AllFieldMapper.TypeParser());<NEW_LINE>builtInMetadataMappers.put(VersionFieldMapper.NAME, new VersionFieldMapper.TypeParser());<NEW_LINE>builtInMetadataMappers.put(ParentFieldMapper.NAME, new ParentFieldMapper.TypeParser());<NEW_LINE>builtInMetadataMappers.put(SeqNoFieldMapper.NAME, new SeqNoFieldMapper.TypeParser());<NEW_LINE>builtInMetadataMappers.put(TokenFieldMapper.NAME, new TokenFieldMapper.TypeParser());<NEW_LINE>builtInMetadataMappers.put(HostFieldMapper.NAME<MASK><NEW_LINE>// _field_names must be added last so that it has a chance to see all the other mappers<NEW_LINE>builtInMetadataMappers.put(FieldNamesFieldMapper.NAME, new FieldNamesFieldMapper.TypeParser());<NEW_LINE>return Collections.unmodifiableMap(builtInMetadataMappers);<NEW_LINE>} | , new HostFieldMapper.TypeParser()); |
1,056,551 | public void removeArgFromOp(String varName, DifferentialFunction function) {<NEW_LINE>val args = function.args();<NEW_LINE>for (int i = 0; i < args.length; i++) {<NEW_LINE>if (args[i].name().equals(varName)) {<NEW_LINE>List<String> reverseArgs = ops.get(function.<MASK><NEW_LINE>val newArgs = new ArrayList<String>(args.length - 1);<NEW_LINE>for (int arg = 0; arg < args.length; arg++) {<NEW_LINE>if (!reverseArgs.get(arg).equals(varName)) {<NEW_LINE>newArgs.add(reverseArgs.get(arg));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>ops.get(function.getOwnName()).setInputsToOp(newArgs);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>variables.get(varName).getInputsForOp().remove(function.getOwnName());<NEW_LINE>} | getOwnName()).getInputsToOp(); |
1,708,282 | void restartService(@NonNull final Intent intent, final boolean scanForBootloader) {<NEW_LINE>String newAddress = null;<NEW_LINE>if (scanForBootloader) {<NEW_LINE>mService.sendLogBroadcast(DfuBaseService.LOG_LEVEL_VERBOSE, "Scanning for the DFU Bootloader...");<NEW_LINE>newAddress = BootloaderScannerFactory.getScanner().searchFor(mGatt.getDevice().getAddress());<NEW_LINE>logi("Scanning for new address finished with: " + newAddress);<NEW_LINE>if (newAddress != null)<NEW_LINE>mService.sendLogBroadcast(<MASK><NEW_LINE>else {<NEW_LINE>mService.sendLogBroadcast(DfuBaseService.LOG_LEVEL_INFO, "DFU Bootloader not found. Trying the same address...");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (newAddress != null)<NEW_LINE>intent.putExtra(DfuBaseService.EXTRA_DEVICE_ADDRESS, newAddress);<NEW_LINE>// Reset the DFU attempt counter<NEW_LINE>intent.putExtra(DfuBaseService.EXTRA_DFU_ATTEMPT, 0);<NEW_LINE>mService.startService(intent);<NEW_LINE>} | DfuBaseService.LOG_LEVEL_INFO, "DFU Bootloader found with address " + newAddress); |
852,596 | public static <A, R1, R2, R3, R4, R5, R6, R7, R8, R9, R10, R11, R12> Arguments12Combining<A, R1, R2, R3, R4, R5, R6, R7, R8, R9, R10, R11, R12> combine(ValueValidator<? super A, ? extends R1> v1, ValueValidator<? super A, ? extends R2> v2, ValueValidator<? super A, ? extends R3> v3, ValueValidator<? super A, ? extends R4> v4, ValueValidator<? super A, ? extends R5> v5, ValueValidator<? super A, ? extends R6> v6, ValueValidator<? super A, ? extends R7> v7, ValueValidator<? super A, ? extends R8> v8, ValueValidator<? super A, ? extends R9> v9, ValueValidator<? super A, ? extends R10> v10, ValueValidator<? super A, ? extends R11> v11, ValueValidator<? super A, ? extends R12> v12) {<NEW_LINE>return new Arguments12Combining<>(v1, v2, v3, v4, v5, v6, v7, v8, <MASK><NEW_LINE>} | v9, v10, v11, v12); |
1,347,981 | final ListVirtualMFADevicesResult executeListVirtualMFADevices(ListVirtualMFADevicesRequest listVirtualMFADevicesRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(listVirtualMFADevicesRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<ListVirtualMFADevicesRequest> request = null;<NEW_LINE>Response<ListVirtualMFADevicesResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new ListVirtualMFADevicesRequestMarshaller().marshall(super.beforeMarshalling(listVirtualMFADevicesRequest));<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, "IAM");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ListVirtualMFADevices");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>StaxResponseHandler<ListVirtualMFADevicesResult> responseHandler = new StaxResponseHandler<ListVirtualMFADevicesResult>(new ListVirtualMFADevicesResultStaxUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | HandlerContextKey.SIGNING_REGION, getSigningRegion()); |
1,246,488 | public void change(Event e, @Nullable Object[] delta, ChangeMode mode) {<NEW_LINE>assert delta != null;<NEW_LINE>final Vector v = getExpr().getSingle(e);<NEW_LINE>if (v == null)<NEW_LINE>return;<NEW_LINE>double n = ((Number) delta[0]).doubleValue();<NEW_LINE>switch(mode) {<NEW_LINE>case REMOVE:<NEW_LINE>n = -n;<NEW_LINE>// $FALL-THROUGH$<NEW_LINE>case ADD:<NEW_LINE>if (axis == 0)<NEW_LINE>v.setX(v.getX() + n);<NEW_LINE>else if (axis == 1)<NEW_LINE>v.setY(<MASK><NEW_LINE>else<NEW_LINE>v.setZ(v.getZ() + n);<NEW_LINE>getExpr().change(e, new Vector[] { v }, ChangeMode.SET);<NEW_LINE>break;<NEW_LINE>case SET:<NEW_LINE>if (axis == 0)<NEW_LINE>v.setX(n);<NEW_LINE>else if (axis == 1)<NEW_LINE>v.setY(n);<NEW_LINE>else<NEW_LINE>v.setZ(n);<NEW_LINE>getExpr().change(e, new Vector[] { v }, ChangeMode.SET);<NEW_LINE>}<NEW_LINE>} | v.getY() + n); |
656,244 | public void paint(JComponent c, Graphics g, PaintContext context, Rectangle clip, FieldBackgroundColorManager map, RowColLocation cursorLoc, int rowHeight) {<NEW_LINE>g.setColor(Color.LIGHT_GRAY);<NEW_LINE>// draw the vertical lines to the left of the data (these are shown when there are vertical<NEW_LINE>// bars drawn for inset data)<NEW_LINE>int fieldTopY = -heightAbove;<NEW_LINE>int fieldBottomY = getHeightBelow();<NEW_LINE>int toggleHandleHalfLength = toggleHandleSize / 2;<NEW_LINE>for (int i = 1; i < indentLevel; i++) {<NEW_LINE>int fieldOffset = i * fieldWidth;<NEW_LINE>int previousButtonStartX = startX + fieldOffset + insetSpace;<NEW_LINE>int midpointX = previousButtonStartX + toggleHandleHalfLength;<NEW_LINE>g.drawLine(midpointX, fieldTopY, midpointX, fieldBottomY);<NEW_LINE>}<NEW_LINE>int toggleHandleStartX = startX <MASK><NEW_LINE>int midPointX = toggleHandleStartX + toggleHandleHalfLength;<NEW_LINE>int midPointY = fieldTopY / 2;<NEW_LINE>// horizontal pointer line (that points from vertical bar to inset data)<NEW_LINE>g.drawLine(midPointX, midPointY, startX + (indentLevel + 1) * fieldWidth, midPointY);<NEW_LINE>// vertical line above the horizontal pointer line<NEW_LINE>g.drawLine(midPointX, fieldTopY, midPointX, midPointY);<NEW_LINE>if (!isLast) {<NEW_LINE>// vertical line below the horizontal pointer line<NEW_LINE>g.drawLine(midPointX, midPointY, midPointX, fieldBottomY);<NEW_LINE>}<NEW_LINE>paintCursor(g, context.getCursorColor(), cursorLoc);<NEW_LINE>} | + (indentLevel * fieldWidth) + insetSpace; |
1,597,673 | private void applyToEnvironment(ConfigDataEnvironmentContributors contributors, ConfigDataActivationContext activationContext, Set<ConfigDataLocation> loadedLocations, Set<ConfigDataLocation> optionalLocations) {<NEW_LINE>checkForInvalidProperties(contributors);<NEW_LINE>checkMandatoryLocations(contributors, activationContext, loadedLocations, optionalLocations);<NEW_LINE>MutablePropertySources propertySources = this.environment.getPropertySources();<NEW_LINE>applyContributor(contributors, activationContext, propertySources);<NEW_LINE>DefaultPropertiesPropertySource.moveToEnd(propertySources);<NEW_LINE>Profiles profiles = activationContext.getProfiles();<NEW_LINE>this.logger.trace(LogMessage.format("Setting default profiles: %s"<MASK><NEW_LINE>this.environment.setDefaultProfiles(StringUtils.toStringArray(profiles.getDefault()));<NEW_LINE>this.logger.trace(LogMessage.format("Setting active profiles: %s", profiles.getActive()));<NEW_LINE>this.environment.setActiveProfiles(StringUtils.toStringArray(profiles.getActive()));<NEW_LINE>this.environmentUpdateListener.onSetProfiles(profiles);<NEW_LINE>} | , profiles.getDefault())); |
140,645 | private static void test() {<NEW_LINE>// mwpm is expected to be between nodes: 0 & 5, 1 & 2, 3 & 4<NEW_LINE>Double[][] costMatrix = { { 0.0, 9.0, 9.0, 9.0, 9.0, 1.0 }, { 9.0, 0.0, 1.0, 9.0, 9.0, 9.0 }, { 9.0, 1.0, 0.0, 9.0, 9.0, 9.0 }, { 9.0, 9.0, 9.0, 0.0, 1.0, 9.0 }, { 9.0, 9.0, 9.0, 1.0, 0.0, 9.0 }, { 1.0, 9.0, 9.0, 9.0, 9.0, 0.0 } };<NEW_LINE>WeightedMaximumCardinalityMatchingRecursive mwpm = new WeightedMaximumCardinalityMatchingRecursive(costMatrix);<NEW_LINE>// Print minimum weight perfect matching cost<NEW_LINE>double cost = mwpm.getMinWeightCost();<NEW_LINE>if (cost != 3.0) {<NEW_LINE>System.out.println("error cost not 3");<NEW_LINE>} else {<NEW_LINE>System.<MASK><NEW_LINE>}<NEW_LINE>// Print matching<NEW_LINE>int[] matching = mwpm.getMatching();<NEW_LINE>for (int i = 0; i < matching.length / 2; i++) {<NEW_LINE>int node1 = matching[2 * i];<NEW_LINE>int node2 = matching[2 * i + 1];<NEW_LINE>System.out.printf("Matched node %d with node %d\n", node1, node2);<NEW_LINE>}<NEW_LINE>// Prints:<NEW_LINE>// Found MWPM of: 3.000<NEW_LINE>// Matched node 0 with node 5<NEW_LINE>// Matched node 1 with node 2<NEW_LINE>// Matched node 3 with node 4<NEW_LINE>} | out.printf("Found MWPM of: %.3f\n", cost); |
1,546,855 | protected void paintComponent(Graphics g) {<NEW_LINE>Graphics2D g2d = (Graphics2D) g;<NEW_LINE>int width = getWidth();<NEW_LINE>int height = getHeight();<NEW_LINE>g2d.setColor(new Color(162, 162, 162));<NEW_LINE>g2d.drawRect(0, 0, width, 12);<NEW_LINE>g2d.setPaint(new GradientPaint(0, 0, COL_GRADIENT_START, 0, 12, COL_GRADIENT_END));<NEW_LINE>g2d.fillRect(1, 0, width - 2, 12);<NEW_LINE>int imgWidth = IMG_BANNER.getWidth(this);<NEW_LINE>int imgX = (width - imgWidth) / 2;<NEW_LINE>g2d.drawImage(IMG_BANNER, imgX, 13, <MASK><NEW_LINE>if (imgX > 0) {<NEW_LINE>g2d.setPaint(COL_BANNER_LEFT);<NEW_LINE>g2d.fillRect(0, 13, imgX, height - 13);<NEW_LINE>g2d.setPaint(COL_BANNER_RIGHT);<NEW_LINE>g2d.fillRect(width - imgX - 1, 13, imgX + 1, height - 13);<NEW_LINE>}<NEW_LINE>} | imgWidth, height - 13, this); |
1,296,884 | public void doUpdateVisitedHistory(WebView view, String url, boolean isReload) {<NEW_LINE>WebView.HitTestResult hitResult = null;<NEW_LINE>if (null != mWebView) {<NEW_LINE>hitResult = mWebView.getHitTestResult();<NEW_LINE>}<NEW_LINE>String extraRes = null;<NEW_LINE>if (null != mWebView && null != hitResult) {<NEW_LINE>extraRes = hitResult.getExtra();<NEW_LINE>if (null != extraRes) {<NEW_LINE>try {<NEW_LINE><MASK><NEW_LINE>extraRes = extraRes.substring(extraURL.getProtocol().length() + ("://").length());<NEW_LINE>} catch (MalformedURLException exc) {<NEW_LINE>exc.printStackTrace();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>int webViewHitResultType = WebView.HitTestResult.UNKNOWN_TYPE;<NEW_LINE>if (null != hitResult) {<NEW_LINE>webViewHitResultType = hitResult.getType();<NEW_LINE>}<NEW_LINE>if (null == extraRes || WebView.HitTestResult.SRC_IMAGE_ANCHOR_TYPE == webViewHitResultType || (null != extraRes && url.endsWith(extraRes))) {<NEW_LINE>mController.doUpdateVisitedHistory(url, isReload, WebView.HitTestResult.UNKNOWN_TYPE == webViewHitResultType || WebView.HitTestResult.SRC_IMAGE_ANCHOR_TYPE == webViewHitResultType);<NEW_LINE>}<NEW_LINE>} | URL extraURL = new URL(extraRes); |
1,661,863 | Stream<SimilaritySummaryResult> writeAndAggregateResults(Stream<SimilarityResult> stream, int length, int sourceIdsLength, int targetIdsLength, ProcedureConfiguration configuration, boolean write, String writeRelationshipType, String writeProperty, Computations computations) {<NEW_LINE>long writeBatchSize = getWriteBatchSize(configuration);<NEW_LINE>AtomicLong similarityPairs = new AtomicLong();<NEW_LINE><MASK><NEW_LINE>Consumer<SimilarityResult> recorder = result -> {<NEW_LINE>result.record(histogram);<NEW_LINE>similarityPairs.getAndIncrement();<NEW_LINE>};<NEW_LINE>if (write) {<NEW_LINE>SimilarityExporter similarityExporter = new SimilarityExporter(api, writeRelationshipType, writeProperty);<NEW_LINE>similarityExporter.export(stream.peek(recorder), writeBatchSize);<NEW_LINE>} else {<NEW_LINE>stream.forEach(recorder);<NEW_LINE>}<NEW_LINE>return Stream.of(SimilaritySummaryResult.from(length, sourceIdsLength, targetIdsLength, similarityPairs, computations.count(), writeRelationshipType, writeProperty, write, histogram));<NEW_LINE>} | DoubleHistogram histogram = new DoubleHistogram(5); |
1,726,073 | public Status insert(String table, String key, Map<String, ByteIterator> values) {<NEW_LINE>try {<NEW_LINE>Object rowKey = makeRowKey(key);<NEW_LINE>String containerKey = makeContainerKey(key);<NEW_LINE>final Container<Object, Row> container = store.getContainer(containerKey);<NEW_LINE>if (container == null) {<NEW_LINE>LOGGER.severe("[ERROR]getCollection " + containerKey + " in insert()");<NEW_LINE>}<NEW_LINE>Row row = container.createRow();<NEW_LINE>row.setValue(ROW_KEY_COLUMN_POS, rowKey);<NEW_LINE>for (int i = 1; i < containerInfo.getColumnCount(); i++) {<NEW_LINE>ByteIterator byteIterator = values.get(containerInfo.getColumnInfo(i).getName());<NEW_LINE>Object value = makeValue(byteIterator);<NEW_LINE>row.setValue(i, value);<NEW_LINE>}<NEW_LINE>container.put(row);<NEW_LINE>} catch (GSException e) {<NEW_LINE>LOGGER.severe(<MASK><NEW_LINE>return Status.ERROR;<NEW_LINE>}<NEW_LINE>return Status.OK;<NEW_LINE>} | "Exception: " + e.getMessage()); |
161,791 | private void updateStatistics() {<NEW_LINE>ProjectMetrics projectMetrics = new ProjectMetrics(getModelItem());<NEW_LINE>metrics.setMetric("File Path", getModelItem().getPath());<NEW_LINE>Set<String> newNames = new HashSet<String>();<NEW_LINE>boolean rebuilt = false;<NEW_LINE>for (Interface iface : getModelItem().getInterfaceList()) {<NEW_LINE>if (!metrics.hasMetric(iface.getName())) {<NEW_LINE>MetricsSection section = metrics.getSection("Interface Summary");<NEW_LINE>buildInterfaceSummary(section.clear());<NEW_LINE>rebuilt = true;<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>newNames.add(iface.getName());<NEW_LINE>interfaceNameSet.remove(iface.getName());<NEW_LINE>}<NEW_LINE>if (!rebuilt) {<NEW_LINE>if (!interfaceNameSet.isEmpty()) {<NEW_LINE>MetricsSection section = metrics.getSection("Interface Summary");<NEW_LINE>buildInterfaceSummary(section.clear());<NEW_LINE>}<NEW_LINE>interfaceNameSet = newNames;<NEW_LINE>}<NEW_LINE>metrics.setMetric(TESTSUITES_STATISTICS, <MASK><NEW_LINE>metrics.setMetric(TESTCASES_STATISTICS, projectMetrics.getTestCaseCount());<NEW_LINE>metrics.setMetric(TESTSTEPS_STATISTICS, projectMetrics.getTestStepCount());<NEW_LINE>metrics.setMetric(ASSERTIONS_STATISTICS, projectMetrics.getAssertionCount());<NEW_LINE>metrics.setMetric(LOADTESTS_STATISTICS, projectMetrics.getLoadTestCount());<NEW_LINE>metrics.setMetric(MOCKSERVICES_STATISTICS, getModelItem().getMockServiceCount());<NEW_LINE>metrics.setMetric(MOCKOPERATIONS_STATISTICS, projectMetrics.getMockOperationCount());<NEW_LINE>metrics.setMetric(MOCKRESPONSES_STATISTICS, projectMetrics.getMockResponseCount());<NEW_LINE>metrics.setMetric(REST_MOCKSERVICES_STATISTICS, getModelItem().getRestMockServiceCount());<NEW_LINE>metrics.setMetric(REST_MOCKACTIONS_STATISTICS, projectMetrics.getRestMockActionCount());<NEW_LINE>metrics.setMetric(REST_MOCKRESPONSES_STATISTICS, projectMetrics.getRestMockResponseCount());<NEW_LINE>} | getModelItem().getTestSuiteCount()); |
1,313,454 | private List<TaskGroup> buildTaskGroups() {<NEW_LINE>Map<TaskId, TaskGroup.Builder> taskGroups = new HashMap<>();<NEW_LINE>List<TaskGroup.Builder> topLevelTasks = new ArrayList<>();<NEW_LINE>// First populate all tasks<NEW_LINE>for (TaskInfo taskInfo : this.tasks) {<NEW_LINE>taskGroups.put(taskInfo.getTaskId()<MASK><NEW_LINE>}<NEW_LINE>// Now go through all task group builders and add children to their parents<NEW_LINE>for (TaskGroup.Builder taskGroup : taskGroups.values()) {<NEW_LINE>TaskId parentTaskId = taskGroup.getTaskInfo().getParentTaskId();<NEW_LINE>if (parentTaskId != null) {<NEW_LINE>TaskGroup.Builder parentTask = taskGroups.get(parentTaskId);<NEW_LINE>if (parentTask != null) {<NEW_LINE>// we found parent in the list of tasks - add it to the parent list<NEW_LINE>parentTask.addGroup(taskGroup);<NEW_LINE>} else {<NEW_LINE>// we got zombie or the parent was filtered out - add it to the top task list<NEW_LINE>topLevelTasks.add(taskGroup);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>// top level task - add it to the top task list<NEW_LINE>topLevelTasks.add(taskGroup);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return Collections.unmodifiableList(topLevelTasks.stream().map(TaskGroup.Builder::build).collect(Collectors.toList()));<NEW_LINE>} | , TaskGroup.builder(taskInfo)); |
1,725,272 | public Router socketHandler(Handler<SockJSSocket> sockHandler) {<NEW_LINE>router.route("/").useNormalizedPath(false).handler(rc -> {<NEW_LINE>if (LOG.isTraceEnabled())<NEW_LINE>LOG.trace("Returning welcome response");<NEW_LINE>rc.response().putHeader(HttpHeaders.CONTENT_TYPE, "text/plain; charset=UTF-8").end("Welcome to SockJS!\n");<NEW_LINE>});<NEW_LINE>// Iframe handlers<NEW_LINE>String iframeHTML = IFRAME_TEMPLATE.replace("{{ sockjs_url }}", options.getLibraryURL());<NEW_LINE>Handler<RoutingContext> iframeHandler = createIFrameHandler(iframeHTML);<NEW_LINE>// Request exactly for iframe.html<NEW_LINE>router.get("/iframe.html").handler(iframeHandler);<NEW_LINE>// Versioned<NEW_LINE>router.getWithRegex("\\/iframe-[^\\/]*\\.html").handler(iframeHandler);<NEW_LINE>// Chunking test<NEW_LINE>router.post("/chunking_test").handler(createChunkingTestHandler());<NEW_LINE>router.options("/chunking_test").handler(BaseTransport.createCORSOptionsHandler(options, "OPTIONS, POST"));<NEW_LINE>// Info<NEW_LINE>router.get("/info").handler(BaseTransport.createInfoHandler(options, VertxContextPRNG.current(vertx)));<NEW_LINE>router.options("/info").handler(BaseTransport.createCORSOptionsHandler(options, "OPTIONS, GET"));<NEW_LINE>// Transports<NEW_LINE>Set<String> <MASK><NEW_LINE>enabledTransports.add(Transport.EVENT_SOURCE.toString());<NEW_LINE>enabledTransports.add(Transport.HTML_FILE.toString());<NEW_LINE>enabledTransports.add(Transport.JSON_P.toString());<NEW_LINE>enabledTransports.add(Transport.WEBSOCKET.toString());<NEW_LINE>enabledTransports.add(Transport.XHR.toString());<NEW_LINE>Set<String> disabledTransports = options.getDisabledTransports();<NEW_LINE>if (disabledTransports == null) {<NEW_LINE>disabledTransports = new HashSet<>();<NEW_LINE>}<NEW_LINE>enabledTransports.removeAll(disabledTransports);<NEW_LINE>if (enabledTransports.contains(Transport.XHR.toString())) {<NEW_LINE>new XhrTransport(vertx, router, sessions, options, sockHandler);<NEW_LINE>}<NEW_LINE>if (enabledTransports.contains(Transport.EVENT_SOURCE.toString())) {<NEW_LINE>new EventSourceTransport(vertx, router, sessions, options, sockHandler);<NEW_LINE>}<NEW_LINE>if (enabledTransports.contains(Transport.HTML_FILE.toString())) {<NEW_LINE>new HtmlFileTransport(vertx, router, sessions, options, sockHandler);<NEW_LINE>}<NEW_LINE>if (enabledTransports.contains(Transport.JSON_P.toString())) {<NEW_LINE>new JsonPTransport(vertx, router, sessions, options, sockHandler);<NEW_LINE>}<NEW_LINE>if (enabledTransports.contains(Transport.WEBSOCKET.toString())) {<NEW_LINE>new WebSocketTransport(vertx, router, sessions, options, sockHandler);<NEW_LINE>new RawWebSocketTransport(vertx, router, options, sockHandler);<NEW_LINE>}<NEW_LINE>return router;<NEW_LINE>} | enabledTransports = new HashSet<>(); |
1,557,543 | public void bindView(View view, Context context, Cursor cursor) {<NEW_LINE>int id = cursor.getInt(cursor.getColumnIndex<MASK><NEW_LINE>final String where = OnionServiceContentProvider.OnionService._ID + "=" + id;<NEW_LINE>TextView localPort = view.findViewById(R.id.hs_port);<NEW_LINE>localPort.setText(String.format("%s\n%s", context.getString(R.string.local_port), cursor.getString(cursor.getColumnIndex(OnionServiceContentProvider.OnionService.PORT))));<NEW_LINE>TextView onionPort = view.findViewById(R.id.onion_port);<NEW_LINE>onionPort.setText(String.format("%s\n%s", context.getString(R.string.onion_port), cursor.getString(cursor.getColumnIndex(OnionServiceContentProvider.OnionService.ONION_PORT))));<NEW_LINE>TextView name = view.findViewById(R.id.hs_name);<NEW_LINE>name.setText(cursor.getString(cursor.getColumnIndex(OnionServiceContentProvider.OnionService.NAME)));<NEW_LINE>TextView domain = view.findViewById(R.id.hs_onion);<NEW_LINE>domain.setText(cursor.getString(cursor.getColumnIndex(OnionServiceContentProvider.OnionService.DOMAIN)));<NEW_LINE>SwitchCompat enabled = view.findViewById(R.id.hs_switch);<NEW_LINE>enabled.setChecked(cursor.getInt(cursor.getColumnIndex(OnionServiceContentProvider.OnionService.ENABLED)) == 1);<NEW_LINE>enabled.setOnCheckedChangeListener((buttonView, isChecked) -> {<NEW_LINE>ContentResolver resolver = context.getContentResolver();<NEW_LINE>ContentValues fields = new ContentValues();<NEW_LINE>fields.put(OnionServiceContentProvider.OnionService.ENABLED, isChecked);<NEW_LINE>resolver.update(OnionServiceContentProvider.CONTENT_URI, fields, where, null);<NEW_LINE>Toast.makeText(context, R.string.please_restart_Orbot_to_enable_the_changes, Toast.LENGTH_SHORT).show();<NEW_LINE>});<NEW_LINE>} | (OnionServiceContentProvider.OnionService._ID)); |
1,552,684 | private void processProvideCall(NodeTraversal t, Node call, Node parent) {<NEW_LINE>checkState(call.isCall());<NEW_LINE>if (!verifyOnlyArgumentIsString(call)) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>Node left = call.getFirstChild();<NEW_LINE>Node arg = left.getNext();<NEW_LINE><MASK><NEW_LINE>JSDocInfo info = NodeUtil.getBestJSDocInfo(call);<NEW_LINE>boolean isImplicitlyInitialized = info != null && info.isProvideAlreadyProvided();<NEW_LINE>if (providedNames.containsKey(ns)) {<NEW_LINE>ProvidedName previouslyProvided = providedNames.get(ns);<NEW_LINE>if (!previouslyProvided.isExplicitlyProvided()) {<NEW_LINE>previouslyProvided.addProvide(parent, t.getChunk(), true);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>registerAnyProvidedPrefixes(ns, parent, t.getChunk());<NEW_LINE>providedNames.put(ns, new ProvidedNameBuilder().setNamespace(ns).setNode(parent).setChunk(t.getChunk()).setExplicit(true).setHasImplicitInitialization(isImplicitlyInitialized).build());<NEW_LINE>}<NEW_LINE>} | String ns = arg.getString(); |
1,722,346 | public DataBuffer create(ByteBuffer underlyingBuffer, DataType dataType, long length, long offset) {<NEW_LINE>switch(dataType) {<NEW_LINE>case DOUBLE:<NEW_LINE>return new DoubleBuffer(underlyingBuffer, dataType, length, offset);<NEW_LINE>case FLOAT:<NEW_LINE>return new FloatBuffer(underlyingBuffer, dataType, length, offset);<NEW_LINE>case LONG:<NEW_LINE>return new LongBuffer(underlyingBuffer, dataType, length, offset);<NEW_LINE>case INT:<NEW_LINE>return new IntBuffer(underlyingBuffer, dataType, length, offset);<NEW_LINE>case UINT32:<NEW_LINE>return new UInt32Buffer(underlyingBuffer, dataType, length, offset);<NEW_LINE>case UINT64:<NEW_LINE>return new UInt64Buffer(underlyingBuffer, dataType, length, offset);<NEW_LINE>case BOOL:<NEW_LINE>return new BoolBuffer(<MASK><NEW_LINE>case UTF8:<NEW_LINE>return new Utf8Buffer(underlyingBuffer, dataType, length, offset);<NEW_LINE>default:<NEW_LINE>throw new IllegalStateException("Unknown datatype used: [" + dataType + "]");<NEW_LINE>}<NEW_LINE>} | underlyingBuffer, dataType, length, offset); |
1,259,989 | static Object newAdapterInstance(HostContext hostContext, Class<?> clazz, Object obj) throws IllegalArgumentException {<NEW_LINE>if (TruffleOptions.AOT) {<NEW_LINE>throw HostEngineException.unsupported(hostContext.access, "Unsupported target type.");<NEW_LINE>}<NEW_LINE>HostClassDesc classDesc = HostClassDesc.forClass(hostContext, clazz);<NEW_LINE>AdapterResult adapter = classDesc.getAdapter(hostContext);<NEW_LINE>if (!adapter.isAutoConvertible()) {<NEW_LINE>throw HostEngineException.illegalArgument(hostContext.access, "Cannot convert to " + clazz);<NEW_LINE>}<NEW_LINE>HostMethodDesc.SingleMethod adapterConstructor = adapter.getValueConstructor();<NEW_LINE>Object[] arguments <MASK><NEW_LINE>try {<NEW_LINE>return ((HostObject) HostExecuteNodeGen.getUncached().execute(adapterConstructor, null, arguments, hostContext)).obj;<NEW_LINE>} catch (UnsupportedTypeException e) {<NEW_LINE>throw HostInteropErrors.invalidExecuteArgumentType(hostContext, null, e.getSuppliedValues());<NEW_LINE>} catch (ArityException e) {<NEW_LINE>throw HostInteropErrors.invalidExecuteArity(hostContext, null, arguments, e.getExpectedMinArity(), e.getExpectedMaxArity(), e.getActualArity());<NEW_LINE>}<NEW_LINE>} | = new Object[] { obj }; |
117,474 | public void marshall(GameSessionPlacement gameSessionPlacement, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (gameSessionPlacement == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(gameSessionPlacement.getPlacementId(), PLACEMENTID_BINDING);<NEW_LINE>protocolMarshaller.marshall(gameSessionPlacement.getGameSessionQueueName(), GAMESESSIONQUEUENAME_BINDING);<NEW_LINE>protocolMarshaller.marshall(gameSessionPlacement.getStatus(), STATUS_BINDING);<NEW_LINE>protocolMarshaller.marshall(gameSessionPlacement.getGameProperties(), GAMEPROPERTIES_BINDING);<NEW_LINE>protocolMarshaller.marshall(gameSessionPlacement.getMaximumPlayerSessionCount(), MAXIMUMPLAYERSESSIONCOUNT_BINDING);<NEW_LINE>protocolMarshaller.marshall(gameSessionPlacement.getGameSessionName(), GAMESESSIONNAME_BINDING);<NEW_LINE>protocolMarshaller.marshall(gameSessionPlacement.getGameSessionId(), GAMESESSIONID_BINDING);<NEW_LINE>protocolMarshaller.marshall(gameSessionPlacement.getGameSessionArn(), GAMESESSIONARN_BINDING);<NEW_LINE>protocolMarshaller.marshall(<MASK><NEW_LINE>protocolMarshaller.marshall(gameSessionPlacement.getPlayerLatencies(), PLAYERLATENCIES_BINDING);<NEW_LINE>protocolMarshaller.marshall(gameSessionPlacement.getStartTime(), STARTTIME_BINDING);<NEW_LINE>protocolMarshaller.marshall(gameSessionPlacement.getEndTime(), ENDTIME_BINDING);<NEW_LINE>protocolMarshaller.marshall(gameSessionPlacement.getIpAddress(), IPADDRESS_BINDING);<NEW_LINE>protocolMarshaller.marshall(gameSessionPlacement.getDnsName(), DNSNAME_BINDING);<NEW_LINE>protocolMarshaller.marshall(gameSessionPlacement.getPort(), PORT_BINDING);<NEW_LINE>protocolMarshaller.marshall(gameSessionPlacement.getPlacedPlayerSessions(), PLACEDPLAYERSESSIONS_BINDING);<NEW_LINE>protocolMarshaller.marshall(gameSessionPlacement.getGameSessionData(), GAMESESSIONDATA_BINDING);<NEW_LINE>protocolMarshaller.marshall(gameSessionPlacement.getMatchmakerData(), MATCHMAKERDATA_BINDING);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>} | gameSessionPlacement.getGameSessionRegion(), GAMESESSIONREGION_BINDING); |
804,004 | public static AddMediaResponse unmarshall(AddMediaResponse addMediaResponse, UnmarshallerContext _ctx) {<NEW_LINE>addMediaResponse.setRequestId(_ctx.stringValue("AddMediaResponse.RequestId"));<NEW_LINE>Media media = new Media();<NEW_LINE>media.setCreationTime(_ctx.stringValue("AddMediaResponse.Media.CreationTime"));<NEW_LINE>media.setCateId(_ctx.longValue("AddMediaResponse.Media.CateId"));<NEW_LINE>media.setHeight(_ctx.stringValue("AddMediaResponse.Media.Height"));<NEW_LINE>media.setCensorState(_ctx.stringValue("AddMediaResponse.Media.CensorState"));<NEW_LINE>media.setBitrate(_ctx.stringValue("AddMediaResponse.Media.Bitrate"));<NEW_LINE>media.setMediaId(_ctx.stringValue("AddMediaResponse.Media.MediaId"));<NEW_LINE>media.setPublishState(_ctx.stringValue("AddMediaResponse.Media.PublishState"));<NEW_LINE>media.setDescription(_ctx.stringValue("AddMediaResponse.Media.Description"));<NEW_LINE>media.setWidth(_ctx.stringValue("AddMediaResponse.Media.Width"));<NEW_LINE>media.setSize(_ctx.stringValue("AddMediaResponse.Media.Size"));<NEW_LINE>media.setCoverURL(_ctx.stringValue("AddMediaResponse.Media.CoverURL"));<NEW_LINE>media.setDuration<MASK><NEW_LINE>media.setFps(_ctx.stringValue("AddMediaResponse.Media.Fps"));<NEW_LINE>media.setTitle(_ctx.stringValue("AddMediaResponse.Media.Title"));<NEW_LINE>media.setFormat(_ctx.stringValue("AddMediaResponse.Media.Format"));<NEW_LINE>List<String> tags = new ArrayList<String>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("AddMediaResponse.Media.Tags.Length"); i++) {<NEW_LINE>tags.add(_ctx.stringValue("AddMediaResponse.Media.Tags[" + i + "]"));<NEW_LINE>}<NEW_LINE>media.setTags(tags);<NEW_LINE>List<String> runIdList = new ArrayList<String>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("AddMediaResponse.Media.RunIdList.Length"); i++) {<NEW_LINE>runIdList.add(_ctx.stringValue("AddMediaResponse.Media.RunIdList[" + i + "]"));<NEW_LINE>}<NEW_LINE>media.setRunIdList(runIdList);<NEW_LINE>File file = new File();<NEW_LINE>file.setState(_ctx.stringValue("AddMediaResponse.Media.File.State"));<NEW_LINE>file.setURL(_ctx.stringValue("AddMediaResponse.Media.File.URL"));<NEW_LINE>media.setFile(file);<NEW_LINE>addMediaResponse.setMedia(media);<NEW_LINE>return addMediaResponse;<NEW_LINE>} | (_ctx.stringValue("AddMediaResponse.Media.Duration")); |
351,877 | public void markUnreadNews() {<NEW_LINE>if (currentNews == null || currentNews.getNewsArticlesCount() <= 0) {<NEW_LINE>// do nothing<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// Stored enabled and un-read article<NEW_LINE>List<String> unReadNewsList = new ArrayList<>();<NEW_LINE>for (NewsArticle newsArticle : currentNews.getNewsArticlesList()) {<NEW_LINE>if (newsArticle.getEnabled() && !newsArticle.getArticleRead())<NEW_LINE>unReadNewsList.<MASK><NEW_LINE>}<NEW_LINE>Log.i(TAG, "markUnreadNews total Article count:" + unReadNewsList.size());<NEW_LINE>if (unReadNewsList.size() > 0) {<NEW_LINE>MarkReadNewsArticleMessage msg = MarkReadNewsArticleMessage.newBuilder().addAllNewsIds(unReadNewsList).build();<NEW_LINE>ServerRequest request = new ServerRequest(RequestTypeOuterClass.RequestType.MARK_READ_NEWS_ARTICLE, msg);<NEW_LINE>ServerRequestEnvelope envelope = ServerRequestEnvelope.create(request);<NEW_LINE>try {<NEW_LINE>api.requestHandler.sendServerRequests(envelope);<NEW_LINE>MarkReadNewsArticleResponse response = MarkReadNewsArticleResponse.parseFrom(request.getData());<NEW_LINE>if (response.getResult() == MarkReadNewsArticleResponse.Result.SUCCESS) {<NEW_LINE>Log.i(TAG, "Mark News Article -> success");<NEW_LINE>} else {<NEW_LINE>Log.w(TAG, "Mark News Article -> !success");<NEW_LINE>}<NEW_LINE>} catch (RequestFailedException e) {<NEW_LINE>e.printStackTrace();<NEW_LINE>Log.e(TAG, "RequestFailedException: cause:" + e.getCause() + " message:" + e.getMessage());<NEW_LINE>} catch (InvalidProtocolBufferException e) {<NEW_LINE>e.printStackTrace();<NEW_LINE>Log.e(TAG, "InvalidProtocolBufferException: cause:" + e.getCause() + " message:" + e.getMessage());<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>Log.i(TAG, "no unmarked news found -> skipped");<NEW_LINE>}<NEW_LINE>} | add(newsArticle.getId()); |
1,641,617 | final CreateRegexMatchSetResult executeCreateRegexMatchSet(CreateRegexMatchSetRequest createRegexMatchSetRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(createRegexMatchSetRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<CreateRegexMatchSetRequest> request = null;<NEW_LINE>Response<CreateRegexMatchSetResult> response = null;<NEW_LINE>try {<NEW_LINE><MASK><NEW_LINE>try {<NEW_LINE>request = new CreateRegexMatchSetRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(createRegexMatchSetRequest));<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, "WAF");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "CreateRegexMatchSet");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<CreateRegexMatchSetResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new CreateRegexMatchSetResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | awsRequestMetrics.startEvent(Field.RequestMarshallTime); |
1,039,493 | public static void main(String[] args) throws Exception {<NEW_LINE>if (args.length != 1) {<NEW_LINE>throw new RuntimeException("Specify topology name");<NEW_LINE>}<NEW_LINE>TopologyBuilder builder = new TopologyBuilder();<NEW_LINE>builder.setSpout("word", new AckingTestWordSpout(), 2);<NEW_LINE>builder.setBolt("count", new CountBolt(), 2).shuffleGrouping("word");<NEW_LINE>Config conf = new Config();<NEW_LINE>conf.setDebug(true);<NEW_LINE>// Put an arbitrary large number here if you don't want to slow the topology down<NEW_LINE>conf.setMaxSpoutPending(1000 * 1000 * 1000);<NEW_LINE>// To enable acking, we need to setEnableAcking true<NEW_LINE>conf.setNumAckers(1);<NEW_LINE>conf.put(Config.TOPOLOGY_WORKER_CHILDOPTS, "-XX:+HeapDumpOnOutOfMemoryError");<NEW_LINE>// Set the task hook<NEW_LINE>List<String> taskHooks = new LinkedList<>();<NEW_LINE>taskHooks.add("org.apache.heron.examples.TaskHookTopology$TestTaskHook");<NEW_LINE>org.apache.heron.api.Config.setAutoTaskHooks(conf, taskHooks);<NEW_LINE>// component resource configuration<NEW_LINE>org.apache.heron.api.Config.setComponentRam(conf, "word"<MASK><NEW_LINE>org.apache.heron.api.Config.setComponentRam(conf, "count", ByteAmount.fromMegabytes(512));<NEW_LINE>// container resource configuration<NEW_LINE>org.apache.heron.api.Config.setContainerDiskRequested(conf, ByteAmount.fromGigabytes(2));<NEW_LINE>org.apache.heron.api.Config.setContainerRamRequested(conf, ByteAmount.fromGigabytes(2));<NEW_LINE>org.apache.heron.api.Config.setContainerCpuRequested(conf, 2);<NEW_LINE>conf.setNumWorkers(2);<NEW_LINE>StormSubmitter.submitTopology(args[0], conf, builder.createTopology());<NEW_LINE>} | , ByteAmount.fromMegabytes(512)); |
319,885 | private void process(Tile tile) {<NEW_LINE><MASK><NEW_LINE>// only process entity changes with centered tiles<NEW_LINE>if (tile.isCenter() && tile.build != null) {<NEW_LINE>var data = team.data();<NEW_LINE>if (tile.block().flags.size > 0 && tile.isCenter()) {<NEW_LINE>TileArray[] map = getFlagged(team);<NEW_LINE>for (BlockFlag flag : tile.block().flags.array) {<NEW_LINE>TileArray arr = map[flag.ordinal()];<NEW_LINE>arr.add(tile);<NEW_LINE>map[flag.ordinal()] = arr;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// update the unit cap when new tile is registered<NEW_LINE>data.unitCap += tile.block().unitCapModifier;<NEW_LINE>if (!activeTeams.contains(team)) {<NEW_LINE>activeTeams.add(team);<NEW_LINE>}<NEW_LINE>// insert the new tile into the quadtree for targeting<NEW_LINE>if (data.buildings == null) {<NEW_LINE>data.buildings = new QuadTree<>(new Rect(0, 0, world.unitWidth(), world.unitHeight()));<NEW_LINE>}<NEW_LINE>data.buildings.insert(tile.build);<NEW_LINE>notifyBuildDamaged(tile.build);<NEW_LINE>}<NEW_LINE>if (!tile.block().isStatic()) {<NEW_LINE>blocksPresent[tile.floorID()] = true;<NEW_LINE>blocksPresent[tile.overlayID()] = true;<NEW_LINE>}<NEW_LINE>// bounds checks only needed in very specific scenarios<NEW_LINE>if (tile.blockID() < blocksPresent.length)<NEW_LINE>blocksPresent[tile.blockID()] = true;<NEW_LINE>} | var team = tile.team(); |
410,129 | protected FTPClient connect(final Proxy proxy, final HostKeyCallback callback, final LoginCallback prompt, final CancelCallback cancel) throws BackgroundException {<NEW_LINE>try {<NEW_LINE>final CustomTrustSSLProtocolSocketFactory f = new CustomTrustSSLProtocolSocketFactory(trust, key, preferences.getProperty(<MASK><NEW_LINE>final LoggingProtocolCommandListener listener = new LoggingProtocolCommandListener(this);<NEW_LINE>final FTPClient client = new FTPClient(host.getProtocol(), f, f.getSSLContext()) {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void disconnect() throws IOException {<NEW_LINE>try {<NEW_LINE>super.disconnect();<NEW_LINE>} finally {<NEW_LINE>this.removeProtocolCommandListener(listener);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>};<NEW_LINE>client.addProtocolCommandListener(listener);<NEW_LINE>this.configure(client);<NEW_LINE>client.connect(new PunycodeConverter().convert(host.getHostname()), host.getPort());<NEW_LINE>client.setTcpNoDelay(false);<NEW_LINE>return client;<NEW_LINE>} catch (IOException e) {<NEW_LINE>throw new FTPExceptionMappingService().map(e);<NEW_LINE>}<NEW_LINE>} | "connection.ssl.protocols.ftp").split(",")); |
1,738,779 | /*<NEW_LINE>* (non-Javadoc)<NEW_LINE>*<NEW_LINE>* @see<NEW_LINE>* io.antmedia.datastore.db.IDataStore#save(io.antmedia.datastore.db.types.<NEW_LINE>* Broadcast)<NEW_LINE>*/<NEW_LINE>@Override<NEW_LINE>public String save(Broadcast broadcast) {<NEW_LINE>if (broadcast == null) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>String streamId = null;<NEW_LINE>if (broadcast.getStreamId() == null || broadcast.getStreamId().isEmpty()) {<NEW_LINE>streamId = RandomStringUtils.randomAlphanumeric(12) + System.currentTimeMillis();<NEW_LINE>broadcast.setStreamId(streamId);<NEW_LINE>}<NEW_LINE>streamId = broadcast.getStreamId();<NEW_LINE>String rtmpURL = broadcast.getRtmpURL();<NEW_LINE>if (rtmpURL != null) {<NEW_LINE>rtmpURL += streamId;<NEW_LINE>}<NEW_LINE>broadcast.setRtmpURL(rtmpURL);<NEW_LINE>if (broadcast.getStatus() == null) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>synchronized (this) {<NEW_LINE>datastore.save(broadcast);<NEW_LINE>}<NEW_LINE>return streamId;<NEW_LINE>} catch (Exception e) {<NEW_LINE>logger.error(ExceptionUtils.getStackTrace(e));<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>} | broadcast.setStatus(IAntMediaStreamHandler.BROADCAST_STATUS_CREATED); |
1,411,330 | public List<Integer> findAnagrams(String s, String p) {<NEW_LINE>List<Integer> ans = new ArrayList<>();<NEW_LINE>int m = s.length(), n = p.length();<NEW_LINE>if (n > m) {<NEW_LINE>return ans;<NEW_LINE>}<NEW_LINE>int[] window = new int[26];<NEW_LINE>for (int i = 0; i < n; i++) {<NEW_LINE>window[p.charAt(i) - 'a']++;<NEW_LINE>window[s.charAt(i) - 'a']--;<NEW_LINE>}<NEW_LINE>if (check(window)) {<NEW_LINE>ans.add(0);<NEW_LINE>}<NEW_LINE>for (int i = n; i < m; i++) {<NEW_LINE>window[s.charAt(i) - 'a']--;<NEW_LINE>window[s.charAt(<MASK><NEW_LINE>if (check(window)) {<NEW_LINE>ans.add(i - n + 1);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return ans;<NEW_LINE>} | i - n) - 'a']++; |
1,186,067 | public int nextAbsentValue(char fromValue) {<NEW_LINE>int index = Util.advanceUntil(content, -1, cardinality, fromValue);<NEW_LINE>if (index >= cardinality) {<NEW_LINE>return (int) (fromValue);<NEW_LINE>}<NEW_LINE>if (index == cardinality - 1) {<NEW_LINE>return fromValue == content[cardinality - 1] ? (int) (fromValue) + 1 : (int) (fromValue);<NEW_LINE>}<NEW_LINE>if (content[index] != fromValue) {<NEW_LINE>return (int) (fromValue);<NEW_LINE>}<NEW_LINE>if (content[index + 1] > fromValue + 1) {<NEW_LINE>return (int) (fromValue) + 1;<NEW_LINE>}<NEW_LINE>int low = index;<NEW_LINE>int high = cardinality;<NEW_LINE>while (low + 1 < high) {<NEW_LINE>int mid = (<MASK><NEW_LINE>if (mid - index < (content[mid]) - (int) (fromValue)) {<NEW_LINE>high = mid;<NEW_LINE>} else {<NEW_LINE>low = mid;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (low == cardinality - 1) {<NEW_LINE>return (content[cardinality - 1]) + 1;<NEW_LINE>}<NEW_LINE>assert (content[low]) + 1 < (content[high]);<NEW_LINE>assert (content[low]) == (int) (fromValue) + (low - index);<NEW_LINE>return (content[low]) + 1;<NEW_LINE>} | high + low) >>> 1; |
1,041,546 | // TODO: currently, only the first matching combination is found:<NEW_LINE>private boolean checkListsWithMultistatementTrees(List<? extends Tree> real, int realOffset, List<? extends Tree> pattern, int patternOffset, TreePath p) {<NEW_LINE>while (realOffset < real.size() && patternOffset < pattern.size() && !isMultistatementWildcardTree(pattern.get(patternOffset))) {<NEW_LINE>if (!scan(real.get(realOffset), pattern.get(patternOffset), p)) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>realOffset++;<NEW_LINE>patternOffset++;<NEW_LINE>}<NEW_LINE>if (realOffset == real.size() && patternOffset == pattern.size()) {<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>if (patternOffset >= pattern.size()) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>if (isMultistatementWildcardTree(pattern.get(patternOffset))) {<NEW_LINE>if (patternOffset + 1 == pattern.size()) {<NEW_LINE>List<TreePath> tps <MASK><NEW_LINE>for (Tree t : real.subList(realOffset, real.size())) {<NEW_LINE>tps.add(new TreePath(getCurrentPath(), t));<NEW_LINE>}<NEW_LINE>return validateMultiVariable(pattern.get(patternOffset), tps);<NEW_LINE>}<NEW_LINE>List<TreePath> tps = new LinkedList<TreePath>();<NEW_LINE>while (realOffset < real.size()) {<NEW_LINE>State backup = State.copyOf(bindState);<NEW_LINE>if (checkListsWithMultistatementTrees(real, realOffset, pattern, patternOffset + 1, p)) {<NEW_LINE>return validateMultiVariable(pattern.get(patternOffset), tps);<NEW_LINE>}<NEW_LINE>bindState = backup;<NEW_LINE>tps.add(new TreePath(getCurrentPath(), real.get(realOffset)));<NEW_LINE>realOffset++;<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>} | = new LinkedList<TreePath>(); |
1,250,407 | public InferenceResult ask(FOLKnowledgeBase kb, Sentence query) {<NEW_LINE>Literal l = new Literal(((AtomicSentence) query));<NEW_LINE>List<HashMap<Variable, Term>> substitutes = this.folBcAsk(kb, l);<NEW_LINE>this.finalList = substitutes;<NEW_LINE>if (l.getAtomicSentence().getArgs().get(0) instanceof Variable) {<NEW_LINE>Variable x = (Variable) l.getAtomicSentence().getArgs().get(0);<NEW_LINE>for (HashMap<Variable, Term> subs : substitutes) {<NEW_LINE>HashMap<Variable, Term> toadd = new HashMap<>();<NEW_LINE>toadd.put(new Variable(x.getValue()), subs.get(x));<NEW_LINE>Proof proof = new BCProof();<NEW_LINE>proof.replaceAnswerBindings(new HashMap<>(toadd));<NEW_LINE>((BCProof) proof).proofSteps = new ArrayList<>(this.bcaskHandler.proofs.get<MASK><NEW_LINE>this.bcaskHandler.proofs.add(proof);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (this.bcaskHandler.proofs.size() > 1)<NEW_LINE>this.bcaskHandler.proofs.remove(0);<NEW_LINE>return this.bcaskHandler;<NEW_LINE>} | (0).getSteps()); |
1,065,067 | public YAtomicType yGlobEnum(String name, SchemaContextAware<BiFunction<String, Collection<String>, String>> errorMessageFormatter, SchemaContextAware<Collection<String>> values) {<NEW_LINE>YAtomicType t = yatomic(name);<NEW_LINE>t.setHintProvider((dc) -> {<NEW_LINE>return PartialCollection.compute(() -> values.withContext(dc)).map(BasicYValueHint::new);<NEW_LINE>});<NEW_LINE>t.parseWith((DynamicSchemaContext dc) -> {<NEW_LINE>EnumValueParser enumParser = new EnumValueParser(name, values.withContext(dc)) {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>protected String createErrorMessage(String parseString, Collection<String> values) {<NEW_LINE>try {<NEW_LINE>return errorMessageFormatter.withContext(dc).apply(parseString, values);<NEW_LINE>} catch (Exception e) {<NEW_LINE>return <MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE><NEW_LINE>protected boolean hasMatchingValue(String stringOrGlob, Collection<String> values) {<NEW_LINE>SimpleGlob glob = SimpleGlob.create(stringOrGlob);<NEW_LINE>// Note we accept 'Match.UNKNOWN' as if it is a proper match. This is the conservative thing to do<NEW_LINE>// in this situation to avoid false positives (i.e. we only report an error if we are *sure* that no<NEW_LINE>// value matches.<NEW_LINE>return values.stream().anyMatch(s -> glob.match(s) != Match.FAIL);<NEW_LINE>}<NEW_LINE>};<NEW_LINE>return enumParser;<NEW_LINE>});<NEW_LINE>return t;<NEW_LINE>} | super.createErrorMessage(parseString, values); |
795,351 | public static Class<?>[] loadFromFile(String[] paths) {<NEW_LINE>Class<?>[] handleObject = new Class<?>[paths.length];<NEW_LINE>for (int i = 0; i < paths.length; i++) {<NEW_LINE>try {<NEW_LINE>for (String curExecPath : executionPath) {<NEW_LINE>JavaCompiler compiler = ToolProvider.getSystemJavaCompiler();<NEW_LINE>DiagnosticCollector<JavaFileObject> ds = new DiagnosticCollector<>();<NEW_LINE>StandardJavaFileManager mgr = compiler.getStandardFileManager(ds, null, null);<NEW_LINE>Iterable<String> classOutputPath = Arrays.asList(new String[] { "-d", curExecPath });<NEW_LINE>File pathFile = new File(curExecPath, paths[i]);<NEW_LINE>Iterable<? extends JavaFileObject> sources = mgr.getJavaFileObjectsFromFiles(Arrays.asList(pathFile));<NEW_LINE>JavaCompiler.CompilationTask task = compiler.getTask(null, mgr, ds, classOutputPath, null, sources);<NEW_LINE>// main method to compile the file into class<NEW_LINE><MASK><NEW_LINE>if (call) {<NEW_LINE>System.out.println("Compilation Successful");<NEW_LINE>Path path = Paths.get(pathFile.getCanonicalPath());<NEW_LINE>String classname = path.getFileName().toString().split(".java")[0];<NEW_LINE>File execPathFile = new File(curExecPath);<NEW_LINE>URLClassLoader clsLoader = new URLClassLoader(new URL[] { execPathFile.toURI().toURL() });<NEW_LINE>handleObject[i] = clsLoader.loadClass(classname);<NEW_LINE>clsLoader.close();<NEW_LINE>System.out.println(classname + " Class Loading Successful");<NEW_LINE>break;<NEW_LINE>} else {<NEW_LINE>System.out.println("Compilation Failed");<NEW_LINE>}<NEW_LINE>for (Diagnostic<? extends JavaFileObject> d : ds.getDiagnostics()) {<NEW_LINE>// diagnostic error printing<NEW_LINE>System.out.format("DIAGNOSTIC Line: %d, %s in %s\n", d.getLineNumber(), d.getMessage(null), d.getSource().getName());<NEW_LINE>}<NEW_LINE>mgr.close();<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>System.err.println("Load Function" + e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return handleObject;<NEW_LINE>} | Boolean call = task.call(); |
490,251 | public Object construct() throws Exception {<NEW_LINE>try {<NEW_LINE>// prevents potential infinite loop during errors<NEW_LINE>if (this.skipFiring)<NEW_LINE>return null;<NEW_LINE>spellChecker.setLocale(locale);<NEW_LINE>return locale;<NEW_LINE>} catch (Exception exc) {<NEW_LINE>logger.warn("Unable to retrieve dictionary for " + locale, exc);<NEW_LINE>// warns that it didn't work<NEW_LINE>PopupDialog dialog = SpellCheckActivator.getUIService().getPopupDialog();<NEW_LINE>String message = Resources.getString("plugin.spellcheck.DICT_ERROR");<NEW_LINE>if (exc instanceof IOException) {<NEW_LINE>message = Resources.getString("plugin.spellcheck.DICT_RETRIEVE_ERROR") + ":\n" + locale.getDictUrl();<NEW_LINE>} else if (exc instanceof IllegalArgumentException) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>dialog.showMessagePopupDialog(message, Resources.getString("plugin.spellcheck.DICT_ERROR_TITLE"), PopupDialog.WARNING_MESSAGE);<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>} | message = Resources.getString("plugin.spellcheck.DICT_PROCESS_ERROR"); |
407,169 | public void run() {<NEW_LINE>if (label_comp.isDisposed()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>ticks++;<NEW_LINE>image_index++;<NEW_LINE>if (image_index == vitality_images.length) {<NEW_LINE>image_index = 0;<NEW_LINE>}<NEW_LINE>boolean do_results = ticks % 5 == 0;<NEW_LINE>boolean all_done = do_results;<NEW_LINE>for (int i = 0; i < engines.length; i++) {<NEW_LINE>Object[] status = search.getEngineStatus(engines[i]);<NEW_LINE>int state = (Integer) status[0];<NEW_LINE>ImageLabel indicator = indicators.get(i);<NEW_LINE>if (state == 0) {<NEW_LINE>indicator.setImage(vitality_images[image_index]);<NEW_LINE>} else if (state == 1) {<NEW_LINE>indicator.setImage(ok_image);<NEW_LINE>} else if (state == 2) {<NEW_LINE>indicator.setImage(fail_image);<NEW_LINE>String msg = (String) status[2];<NEW_LINE>if (msg != null) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>indicator.setImage(auth_image);<NEW_LINE>}<NEW_LINE>if (do_results) {<NEW_LINE>if (state == 0) {<NEW_LINE>all_done = false;<NEW_LINE>}<NEW_LINE>String str = "(" + status[1] + ")";<NEW_LINE>Label rc = result_counts.get(i);<NEW_LINE>if (!str.equals(rc.getText())) {<NEW_LINE>rc.setText(str);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (all_done) {<NEW_LINE>running = false;<NEW_LINE>}<NEW_LINE>} | Utils.setTT(indicator, msg); |
249,119 | public final long incCol(final int column, final long c) {<NEW_LINE>final int encoder = Row.this.row[column].encoder;<NEW_LINE>final int colstrt = Row.this.colstart[column];<NEW_LINE>final int cellwidth = Row.this.row[column].cellwidth;<NEW_LINE>long l;<NEW_LINE>switch(encoder) {<NEW_LINE>case Column.encoder_b64e:<NEW_LINE>l = c + Base64Order.enhancedCoder.decodeLong(this.rowinstance, this.offset + colstrt, cellwidth);<NEW_LINE>Base64Order.enhancedCoder.encodeLong(l, this.rowinstance, this.offset + colstrt, cellwidth);<NEW_LINE>return l;<NEW_LINE>case Column.encoder_b256:<NEW_LINE>l = c + NaturalOrder.decodeLong(this.rowinstance, this.offset + colstrt, cellwidth);<NEW_LINE>NaturalOrder.encodeLong(l, this.rowinstance, <MASK><NEW_LINE>return l;<NEW_LINE>default:<NEW_LINE>throw new kelondroException("ROW", "addCol did not find appropriate encoding");<NEW_LINE>}<NEW_LINE>} | this.offset + colstrt, cellwidth); |
1,470,438 | private static String mkkos(CommandLine cl) throws Exception {<NEW_LINE>printNextStepMessage("Will now generate a Key Object for files in " + cl.getArgList());<NEW_LINE>final MkKOS mkkos = new MkKOS();<NEW_LINE>mkkos.setUIDSuffix(cl.getOptionValue("uid-suffix"));<NEW_LINE>mkkos.setCodes(CLIUtils.loadProperties(cl.getOptionValue("code-config", "resource:code.properties"), null));<NEW_LINE>mkkos.setDocumentTitle(mkkos.<MASK><NEW_LINE>mkkos.setKeyObjectDescription(cl.getOptionValue("desc"));<NEW_LINE>mkkos.setSeriesNumber(cl.getOptionValue("series-no", "999"));<NEW_LINE>mkkos.setInstanceNumber(cl.getOptionValue("inst-no", "1"));<NEW_LINE>mkkos.setOutputFile(MkKOS.outputFileOf(cl));<NEW_LINE>mkkos.setNoFileMetaInformation(cl.hasOption("F"));<NEW_LINE>mkkos.setTransferSyntax(cl.getOptionValue("t", UID.ExplicitVRLittleEndian));<NEW_LINE>mkkos.setEncodingOptions(CLIUtils.encodingOptionsOf(cl));<NEW_LINE>DicomFiles.scan(cl.getArgList(), new DicomFiles.Callback() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public boolean dicomFile(File f, Attributes fmi, long dsPos, Attributes ds) {<NEW_LINE>return mkkos.addInstance(ds);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>System.out.println();<NEW_LINE>mkkos.writeKOS();<NEW_LINE>System.out.println(MessageFormat.format(rb.getString("stored"), mkkos.getFname()));<NEW_LINE>return mkkos.getFname();<NEW_LINE>} | toCodeItem(documentTitleOf(cl))); |
706,831 | private static NodeId parse(String s, int namespaceIndex) throws UaRuntimeException {<NEW_LINE>if (s.length() < 2) {<NEW_LINE>throw new UaRuntimeException(StatusCodes.Bad_NodeIdInvalid);<NEW_LINE>}<NEW_LINE>String type = s.substring(0, 2);<NEW_LINE>String id = s.substring(2);<NEW_LINE>switch(type) {<NEW_LINE>case "i=":<NEW_LINE>try {<NEW_LINE>return new NodeId(namespaceIndex, uint(Long.parseLong(id)));<NEW_LINE>} catch (NumberFormatException e) {<NEW_LINE>throw new UaRuntimeException(StatusCodes.Bad_NodeIdInvalid, e);<NEW_LINE>}<NEW_LINE>case "s=":<NEW_LINE>return new NodeId(namespaceIndex, id);<NEW_LINE>case "g=":<NEW_LINE>try {<NEW_LINE>return new NodeId(namespaceIndex, UUID.fromString(id));<NEW_LINE>} catch (IllegalArgumentException e) {<NEW_LINE>throw new UaRuntimeException(StatusCodes.Bad_NodeIdInvalid, e);<NEW_LINE>}<NEW_LINE>case "b=":<NEW_LINE>try {<NEW_LINE>return new NodeId(namespaceIndex, ByteString.of(DatatypeConverter.parseBase64Binary(id)));<NEW_LINE>} catch (IllegalArgumentException e) {<NEW_LINE>throw new UaRuntimeException(StatusCodes.Bad_NodeIdInvalid, e);<NEW_LINE>}<NEW_LINE>default:<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>} | throw new UaRuntimeException(StatusCodes.Bad_NodeIdInvalid); |
1,640,733 | final DeleteGameResult executeDeleteGame(DeleteGameRequest deleteGameRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(deleteGameRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DeleteGameRequest> request = null;<NEW_LINE>Response<DeleteGameResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DeleteGameRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(deleteGameRequest));<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, "GameSparks");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DeleteGame");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DeleteGameResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DeleteGameResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | HandlerContextKey.SIGNING_REGION, getSigningRegion()); |
897,433 | public void benchmark(TornadoDevice device, boolean isProfilerEnabled) {<NEW_LINE>setUp();<NEW_LINE>validResult = (!VALIDATE) || validate(device);<NEW_LINE>int size = toIntExact(iterations);<NEW_LINE>timers = new double[size];<NEW_LINE>if (isProfilerEnabled) {<NEW_LINE>deviceKernelTimers = new ArrayList<>();<NEW_LINE>deviceCopyIn = new ArrayList<>();<NEW_LINE>deviceCopyOut = new ArrayList<>();<NEW_LINE>}<NEW_LINE>if (validResult) {<NEW_LINE>for (long i = 0; i < iterations; i++) {<NEW_LINE>if (!skipGC()) {<NEW_LINE>System.gc();<NEW_LINE>}<NEW_LINE>final long start = System.nanoTime();<NEW_LINE>benchmarkMethod(device);<NEW_LINE>final long end = System.nanoTime();<NEW_LINE>if (isProfilerEnabled) {<NEW_LINE>// Ensure the execution was correct, so we can count for general stats.<NEW_LINE>if (getTaskSchedule().getDeviceKernelTime() != 0) {<NEW_LINE>deviceKernelTimers.add(getTaskSchedule().getDeviceKernelTime());<NEW_LINE>}<NEW_LINE>if (getTaskSchedule().getDeviceWriteTime() != 0) {<NEW_LINE>deviceCopyIn.add(getTaskSchedule().getDeviceWriteTime());<NEW_LINE>}<NEW_LINE>if (getTaskSchedule().getDeviceReadTime() != 0) {<NEW_LINE>deviceCopyOut.add(getTaskSchedule().getDeviceReadTime());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>timers[toIntExact(i<MASK><NEW_LINE>}<NEW_LINE>barrier();<NEW_LINE>}<NEW_LINE>tearDown();<NEW_LINE>} | )] = (end - start); |
1,779,459 | void decode(Decoder decoder, Instruction instruction) {<NEW_LINE>instruction.setCode(code);<NEW_LINE>instruction.setOp0Register(decoder.<MASK><NEW_LINE>instruction.setOp1Register(decoder.state_vvvv + baseReg);<NEW_LINE>if (decoder.state_mod == 3) {<NEW_LINE>instruction.setOp2Register(decoder.state_rm + decoder.state_zs_extraBaseRegisterBase + baseReg);<NEW_LINE>} else {<NEW_LINE>instruction.setOp2Kind(OpKind.MEMORY);<NEW_LINE>decoder.readOpMem(instruction);<NEW_LINE>}<NEW_LINE>int ib = decoder.readByte();<NEW_LINE>instruction.setOp3Register(((ib >>> 4) & decoder.reg15Mask) + baseReg);<NEW_LINE>assert instruction.getOp4Kind() == OpKind.IMMEDIATE8 : instruction.getOp4Kind();<NEW_LINE>instruction.setImmediate8((byte) (ib & 0xF));<NEW_LINE>} | state_reg + decoder.state_zs_extraRegisterBase + baseReg); |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.