idx
int32
46
1.86M
input
stringlengths
321
6.6k
target
stringlengths
9
1.24k
328,442
public static boolean vertical(Kernel1D_S32 kernel, GrayS32 image, GrayS32 dest, int divisor, GrowArray<DogArray_I32> work) {<NEW_LINE>// Unrolled functions only exist for symmetric kernels with an odd width<NEW_LINE>if (kernel.offset != kernel.width / 2 || kernel.width % 2 == 0)<NEW_LINE>return false;<NEW_LINE>switch(kernel.width) {<NEW_LINE>case 3:<NEW_LINE>vertical3(kernel, image, dest, divisor, work);<NEW_LINE>break;<NEW_LINE>case 5:<NEW_LINE>vertical5(kernel, image, dest, divisor, work);<NEW_LINE>break;<NEW_LINE>case 7:<NEW_LINE>vertical7(kernel, image, dest, divisor, work);<NEW_LINE>break;<NEW_LINE>case 9:<NEW_LINE>vertical9(kernel, <MASK><NEW_LINE>break;<NEW_LINE>case 11:<NEW_LINE>vertical11(kernel, image, dest, divisor, work);<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>}
image, dest, divisor, work);
748,779
public void receiveCommand(Item item, Command command, ZWaveNode node, ZWaveDoorLockCommandClass commandClass, int endpointId, Map<String, String> arguments) {<NEW_LINE>ZWaveCommandConverter<?, ?> converter = this.getCommandConverter(command.getClass());<NEW_LINE>if (converter == null) {<NEW_LINE>logger.warn("NODE {}: No converter found for item = {}, endpoint = {}, ignoring command.", node.getNodeId(), item.getName(), endpointId);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>SerialMessage serialMessage = node.encapsulate(commandClass.setValueMessage((Integer) converter.convertFromCommandToValue(item, command)), commandClass, endpointId);<NEW_LINE>if (serialMessage == null) {<NEW_LINE>logger.warn("Generating message failed for command class = {}, node = {}, endpoint = {}", commandClass.getCommandClass().getLabel(), node.getNodeId(), endpointId);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>this.getController().sendData(serialMessage);<NEW_LINE>if (command instanceof State) {<NEW_LINE>this.getEventPublisher().postUpdate(item.getName(), (State) command);<NEW_LINE>}<NEW_LINE>// Queue a status message since we just sent a door lock command<NEW_LINE>serialMessage = node.encapsulate(commandClass.<MASK><NEW_LINE>this.getController().sendData(serialMessage);<NEW_LINE>}
getValueMessage(), commandClass, endpointId);
1,153,256
private static Tuple2<Boolean, Integer> chooseStatusFromError(ErrorMessage error) {<NEW_LINE>Tuple2<Boolean, Integer> webServiceStatus = chooseWebServiceStatus(error);<NEW_LINE>if (webServiceStatus.first) {<NEW_LINE>return webServiceStatus;<NEW_LINE>}<NEW_LINE>if (error.getCode() == NO_BACKENDS_IN_SERVICE.code)<NEW_LINE>return new Tuple2<>(true, Response.Status.SERVICE_UNAVAILABLE);<NEW_LINE>if (error.getCode() == TIMEOUT.code)<NEW_LINE>return new Tuple2<>(true, Response.Status.GATEWAY_TIMEOUT);<NEW_LINE>if (error.getCode() == BACKEND_COMMUNICATION_ERROR.code)<NEW_LINE>return new Tuple2<>(true, Response.Status.SERVICE_UNAVAILABLE);<NEW_LINE>if (error.getCode() == ILLEGAL_QUERY.code)<NEW_LINE>return new Tuple2<>(<MASK><NEW_LINE>if (error.getCode() == INVALID_QUERY_PARAMETER.code)<NEW_LINE>return new Tuple2<>(true, Response.Status.BAD_REQUEST);<NEW_LINE>return NO_MATCH;<NEW_LINE>}
true, Response.Status.BAD_REQUEST);
936,361
private ButtonToggleGroup createGroup(final LinearLayout ll, final StatusGeocacheFilter.StatusType statusType, final boolean isAdvanced) {<NEW_LINE>final View view = inflateLayout(R.layout.buttontogglegroup_labeled_item);<NEW_LINE>final ButtontogglegroupLabeledItemBinding <MASK><NEW_LINE>binding.itemText.setText(statusType.labelId);<NEW_LINE>if (statusType.icon != null) {<NEW_LINE>statusType.icon.apply(binding.itemIcon);<NEW_LINE>}<NEW_LINE>if (statusType.infoTextId != 0) {<NEW_LINE>binding.itemInfo.setVisibility(View.VISIBLE);<NEW_LINE>binding.itemInfo.setOnClickListener(v -> SimpleDialog.of(getActivity()).setMessage(statusType.infoTextId).show());<NEW_LINE>}<NEW_LINE>binding.itemTogglebuttongroup.addButtons(R.string.cache_filter_status_select_all, R.string.cache_filter_status_select_yes, R.string.cache_filter_status_select_no);<NEW_LINE>final LinearLayout.LayoutParams llp = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT);<NEW_LINE>ll.addView(view, llp);<NEW_LINE>if (isAdvanced) {<NEW_LINE>this.advancedGroups.add(binding.itemTogglebuttongroup);<NEW_LINE>this.advancedGroupViews.add(view);<NEW_LINE>}<NEW_LINE>return binding.itemTogglebuttongroup;<NEW_LINE>}
binding = ButtontogglegroupLabeledItemBinding.bind(view);
265,916
private Mono<Response<Flux<ByteBuffer>>> restartWithResponseAsync(String resourceGroupName, String serverName, ServerRestartParameter parameters, Context context) {<NEW_LINE>if (this.client.getEndpoint() == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (this.client.getSubscriptionId() == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (resourceGroupName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (serverName == null) {<NEW_LINE>return Mono.<MASK><NEW_LINE>}<NEW_LINE>if (parameters == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null."));<NEW_LINE>} else {<NEW_LINE>parameters.validate();<NEW_LINE>}<NEW_LINE>final String accept = "application/json";<NEW_LINE>context = this.client.mergeContext(context);<NEW_LINE>return service.restart(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, serverName, parameters, accept, context);<NEW_LINE>}
error(new IllegalArgumentException("Parameter serverName is required and cannot be null."));
1,115,051
public boolean hurt(DamageSource source, float amount) {<NEW_LINE>if (this.level.isClientSide || this.isRemoved()) {<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>if (this.isInvulnerableTo(source)) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>Vehicle vehicle = (Vehicle) this.getBukkitEntity();<NEW_LINE>org.bukkit.entity.Entity passenger = (source.getEntity() == null) ? null : ((EntityBridge) source.getEntity()).bridge$getBukkitEntity();<NEW_LINE>VehicleDamageEvent event = new VehicleDamageEvent(vehicle, passenger, amount);<NEW_LINE>Bukkit.getPluginManager().callEvent(event);<NEW_LINE>if (event.isCancelled()) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>amount = (float) event.getDamage();<NEW_LINE>this.setHurtDir(-this.getHurtDir());<NEW_LINE>this.setHurtTime(10);<NEW_LINE>this.markHurt();<NEW_LINE>this.setDamage(this.getDamage() + amount * 10.0f);<NEW_LINE>boolean flag = source.getEntity() instanceof Player && ((Player) source.getEntity()).getAbilities().instabuild;<NEW_LINE>if (flag || this.getDamage() > 40.0f) {<NEW_LINE>VehicleDestroyEvent destroyEvent = new VehicleDestroyEvent(vehicle, passenger);<NEW_LINE>Bukkit.<MASK><NEW_LINE>if (destroyEvent.isCancelled()) {<NEW_LINE>this.setDamage(40.0f);<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>this.ejectPassengers();<NEW_LINE>if (flag && !this.hasCustomName()) {<NEW_LINE>this.discard();<NEW_LINE>} else {<NEW_LINE>this.destroy(source);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>}
getPluginManager().callEvent(destroyEvent);
800,512
// Substitute for FormattingUtils if there is no dependency to core<NEW_LINE>public static String formatDurationAsWords(long durationMillis) {<NEW_LINE>String format = "";<NEW_LINE>String second = "second";<NEW_LINE>String minute = "minute";<NEW_LINE>String hour = "hour";<NEW_LINE>String day = "day";<NEW_LINE>String days = "days";<NEW_LINE>String hours = "hours";<NEW_LINE>String minutes = "minutes";<NEW_LINE>String seconds = "seconds";<NEW_LINE>if (durationMillis >= TimeUnit.DAYS.toMillis(1)) {<NEW_LINE>format = "d\' " + days + ", \'";<NEW_LINE>}<NEW_LINE>format += "H\' " + hours + ", \'m\' " + minutes + ", \'s\'.\'S\' " + seconds + "\'";<NEW_LINE>String duration = durationMillis > 0 ? DurationFormatUtils.formatDuration(durationMillis, format) : "";<NEW_LINE>duration = StringUtils.replacePattern(duration, "^1 " + seconds + "|\\b1 " + seconds, "1 " + second);<NEW_LINE>duration = StringUtils.replacePattern(duration, "^1 " + minutes + "|\\b1 " + minutes, "1 " + minute);<NEW_LINE>duration = StringUtils.replacePattern(duration, "^1 " + hours + "|\\b1 " + hours, "1 " + hour);<NEW_LINE>duration = StringUtils.replacePattern(duration, "^1 " + days + "|\\b1 " + days, "1 " + day);<NEW_LINE>duration = duration.replace(", 0 seconds", "");<NEW_LINE>duration = duration.replace(", 0 minutes", "");<NEW_LINE>duration = duration.replace(", 0 hours", "");<NEW_LINE>duration = StringUtils.<MASK><NEW_LINE>duration = StringUtils.replacePattern(duration, "^0 hours, ", "");<NEW_LINE>duration = StringUtils.replacePattern(duration, "^0 minutes, ", "");<NEW_LINE>duration = StringUtils.replacePattern(duration, "^0 seconds, ", "");<NEW_LINE>String result = duration.trim();<NEW_LINE>if (result.isEmpty()) {<NEW_LINE>result = "0.000 seconds";<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>}
replacePattern(duration, "^0 days, ", "");
989,173
public DatastorePartitions unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>DatastorePartitions datastorePartitions = new DatastorePartitions();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>if (context.testExpression("partitions", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>datastorePartitions.setPartitions(new ListUnmarshaller<DatastorePartition>(DatastorePartitionJsonUnmarshaller.getInstance(<MASK><NEW_LINE>}<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return datastorePartitions;<NEW_LINE>}
)).unmarshall(context));
1,357,463
public static DescribeSqlServerRestoresResponse unmarshall(DescribeSqlServerRestoresResponse describeSqlServerRestoresResponse, UnmarshallerContext _ctx) {<NEW_LINE>describeSqlServerRestoresResponse.setRequestId(_ctx.stringValue("DescribeSqlServerRestoresResponse.RequestId"));<NEW_LINE>describeSqlServerRestoresResponse.setSuccess(_ctx.booleanValue("DescribeSqlServerRestoresResponse.Success"));<NEW_LINE>describeSqlServerRestoresResponse.setCode(_ctx.stringValue("DescribeSqlServerRestoresResponse.Code"));<NEW_LINE>describeSqlServerRestoresResponse.setMessage(_ctx.stringValue("DescribeSqlServerRestoresResponse.Message"));<NEW_LINE>describeSqlServerRestoresResponse.setTotalCount(_ctx.integerValue("DescribeSqlServerRestoresResponse.TotalCount"));<NEW_LINE>describeSqlServerRestoresResponse.setPageSize(_ctx.integerValue("DescribeSqlServerRestoresResponse.PageSize"));<NEW_LINE>describeSqlServerRestoresResponse.setPageNumber(_ctx.integerValue("DescribeSqlServerRestoresResponse.PageNumber"));<NEW_LINE>List<SqlServerRestore> sqlServerRestores = new ArrayList<SqlServerRestore>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("DescribeSqlServerRestoresResponse.SqlServerRestores.Length"); i++) {<NEW_LINE>SqlServerRestore sqlServerRestore = new SqlServerRestore();<NEW_LINE>sqlServerRestore.setRestoreId(_ctx.stringValue("DescribeSqlServerRestoresResponse.SqlServerRestores[" + i + "].RestoreId"));<NEW_LINE>sqlServerRestore.setClusterId(_ctx.stringValue<MASK><NEW_LINE>sqlServerRestore.setVaultId(_ctx.stringValue("DescribeSqlServerRestoresResponse.SqlServerRestores[" + i + "].VaultId"));<NEW_LINE>sqlServerRestore.setSourceDatabaseId(_ctx.stringValue("DescribeSqlServerRestoresResponse.SqlServerRestores[" + i + "].SourceDatabaseId"));<NEW_LINE>sqlServerRestore.setTargetDatabaseName(_ctx.stringValue("DescribeSqlServerRestoresResponse.SqlServerRestores[" + i + "].TargetDatabaseName"));<NEW_LINE>sqlServerRestore.setFileDestination(_ctx.stringValue("DescribeSqlServerRestoresResponse.SqlServerRestores[" + i + "].FileDestination"));<NEW_LINE>sqlServerRestore.setPointInTime(_ctx.longValue("DescribeSqlServerRestoresResponse.SqlServerRestores[" + i + "].PointInTime"));<NEW_LINE>sqlServerRestore.setCreatedTime(_ctx.longValue("DescribeSqlServerRestoresResponse.SqlServerRestores[" + i + "].CreatedTime"));<NEW_LINE>sqlServerRestore.setCompleteTime(_ctx.longValue("DescribeSqlServerRestoresResponse.SqlServerRestores[" + i + "].CompleteTime"));<NEW_LINE>sqlServerRestore.setBytesTotal(_ctx.longValue("DescribeSqlServerRestoresResponse.SqlServerRestores[" + i + "].BytesTotal"));<NEW_LINE>sqlServerRestore.setPercentage(_ctx.integerValue("DescribeSqlServerRestoresResponse.SqlServerRestores[" + i + "].Percentage"));<NEW_LINE>sqlServerRestore.setErrorMessage(_ctx.stringValue("DescribeSqlServerRestoresResponse.SqlServerRestores[" + i + "].ErrorMessage"));<NEW_LINE>sqlServerRestore.setStatus(_ctx.stringValue("DescribeSqlServerRestoresResponse.SqlServerRestores[" + i + "].Status"));<NEW_LINE>sqlServerRestore.setSourceDatabaseName(_ctx.stringValue("DescribeSqlServerRestoresResponse.SqlServerRestores[" + i + "].SourceDatabaseName"));<NEW_LINE>sqlServerRestores.add(sqlServerRestore);<NEW_LINE>}<NEW_LINE>describeSqlServerRestoresResponse.setSqlServerRestores(sqlServerRestores);<NEW_LINE>return describeSqlServerRestoresResponse;<NEW_LINE>}
("DescribeSqlServerRestoresResponse.SqlServerRestores[" + i + "].ClusterId"));
619,732
public void onSaveInstanceState(Bundle savedInstanceState) {<NEW_LINE>super.onSaveInstanceState(savedInstanceState);<NEW_LINE>Log.d(TAG, "Saving selections in onSaveInstanceState: " + "position: " + currentPosition + ", " + "class: " + currentSelection + ", " + "mouseEvents: " + enableMouseEvents + ", " + "joystickEvents: " + enableJoystickEvents + ", " + "keyEvents: " + enableKeyEvents + <MASK><NEW_LINE>// Save current selections to the savedInstanceState.<NEW_LINE>// This bundle will be passed to onCreate if the process is<NEW_LINE>// killed and restarted.<NEW_LINE>savedInstanceState.putString(SELECTED_APP_CLASS, currentSelection);<NEW_LINE>savedInstanceState.putInt(SELECTED_LIST_POSITION, currentPosition);<NEW_LINE>savedInstanceState.putBoolean(ENABLE_MOUSE_EVENTS, enableMouseEvents);<NEW_LINE>savedInstanceState.putBoolean(ENABLE_JOYSTICK_EVENTS, enableJoystickEvents);<NEW_LINE>savedInstanceState.putBoolean(ENABLE_KEY_EVENTS, enableKeyEvents);<NEW_LINE>savedInstanceState.putBoolean(VERBOSE_LOGGING, verboseLogging);<NEW_LINE>}
", " + "VerboseLogging: " + verboseLogging + ", ");
137,350
public boolean processRequest(@Nullable CorsConfiguration config, HttpServletRequest request, HttpServletResponse response) throws IOException {<NEW_LINE>Collection<String> varyHeaders = response.getHeaders(HttpHeaders.VARY);<NEW_LINE>if (!varyHeaders.contains(HttpHeaders.ORIGIN)) {<NEW_LINE>response.addHeader(HttpHeaders.VARY, HttpHeaders.ORIGIN);<NEW_LINE>}<NEW_LINE>if (!varyHeaders.contains(HttpHeaders.ACCESS_CONTROL_REQUEST_METHOD)) {<NEW_LINE>response.addHeader(HttpHeaders.VARY, HttpHeaders.ACCESS_CONTROL_REQUEST_METHOD);<NEW_LINE>}<NEW_LINE>if (!varyHeaders.contains(HttpHeaders.ACCESS_CONTROL_REQUEST_HEADERS)) {<NEW_LINE>response.addHeader(<MASK><NEW_LINE>}<NEW_LINE>if (!CorsUtils.isCorsRequest(request)) {<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>if (response.getHeader(HttpHeaders.ACCESS_CONTROL_ALLOW_ORIGIN) != null) {<NEW_LINE>logger.trace("Skip: response already contains \"Access-Control-Allow-Origin\"");<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>boolean preFlightRequest = CorsUtils.isPreFlightRequest(request);<NEW_LINE>if (config == null) {<NEW_LINE>if (preFlightRequest) {<NEW_LINE>rejectRequest(new ServletServerHttpResponse(response));<NEW_LINE>return false;<NEW_LINE>} else {<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return handleInternal(new ServletServerHttpRequest(request), new ServletServerHttpResponse(response), config, preFlightRequest);<NEW_LINE>}
HttpHeaders.VARY, HttpHeaders.ACCESS_CONTROL_REQUEST_HEADERS);
1,670,805
public String buildClipboard() {<NEW_LINE>// Data collection<NEW_LINE>Map<String, Map<String, String>> data = new LinkedHashMap<>();<NEW_LINE>// Current section title/map<NEW_LINE>String currentSection = null;<NEW_LINE>Map<MASK><NEW_LINE>// Current section key<NEW_LINE>boolean labelIsKey = true;<NEW_LINE>String currentKey = null;<NEW_LINE>for (Node node : getChildren()) {<NEW_LINE>// header<NEW_LINE>if (node.getClass() == SubLabeled.class) {<NEW_LINE>if (currentMap != null) {<NEW_LINE>data.put(currentSection, currentMap);<NEW_LINE>}<NEW_LINE>SubLabeled header = (SubLabeled) node;<NEW_LINE>currentSection = header.getPrimaryText();<NEW_LINE>currentMap = new LinkedHashMap<>();<NEW_LINE>} else // items (key:value), one follows the other<NEW_LINE>if (node.getClass() == Label.class) {<NEW_LINE>String text = ((Label) node).getText();<NEW_LINE>if (labelIsKey) {<NEW_LINE>currentKey = text;<NEW_LINE>} else {<NEW_LINE>currentMap.put(currentKey, text);<NEW_LINE>}<NEW_LINE>// Swap since we do KEY -> VALUE, KEY -> VALUE<NEW_LINE>labelIsKey = !labelIsKey;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Put to string<NEW_LINE>StringBuilder sb = new StringBuilder();<NEW_LINE>data.forEach((section, map) -> {<NEW_LINE>sb.append("**").append(section).append("**\n").append("| ").append(String.join(" | ", map.keySet())).append(" |\n").append("| ").append(map.keySet().stream().map(s -> "--------").collect(Collectors.joining(" | "))).append(" |\n").append("| `").append(String.join("` | `", map.values())).append("` |\n\n");<NEW_LINE>});<NEW_LINE>return sb.toString();<NEW_LINE>}
<String, String> currentMap = null;
968,933
private static Map<TypeAlias, jnr.ffi.NativeType> buildTypeMap() {<NEW_LINE>Map<TypeAlias, jnr.ffi.NativeType> m = new EnumMap<TypeAlias, jnr.ffi.NativeType>(TypeAlias.class);<NEW_LINE>m.put(TypeAlias.int8_t, NativeType.SCHAR);<NEW_LINE>m.put(TypeAlias.u_int8_t, NativeType.UCHAR);<NEW_LINE>m.put(TypeAlias.int16_t, NativeType.SSHORT);<NEW_LINE>m.put(TypeAlias.u_int16_t, NativeType.USHORT);<NEW_LINE>m.put(TypeAlias.int32_t, NativeType.SINT);<NEW_LINE>m.put(TypeAlias.u_int32_t, NativeType.UINT);<NEW_LINE>m.put(TypeAlias.int64_t, NativeType.SLONGLONG);<NEW_LINE>m.put(TypeAlias.u_int64_t, NativeType.ULONGLONG);<NEW_LINE>m.put(TypeAlias.intptr_t, NativeType.SINT);<NEW_LINE>m.put(TypeAlias.uintptr_t, NativeType.ULONG);<NEW_LINE>m.put(TypeAlias.caddr_t, NativeType.ADDRESS);<NEW_LINE>m.put(TypeAlias.dev_t, NativeType.ULONGLONG);<NEW_LINE>m.put(TypeAlias.blkcnt_t, NativeType.SLONGLONG);<NEW_LINE>m.put(TypeAlias.blksize_t, NativeType.SLONG);<NEW_LINE>m.put(TypeAlias.gid_t, NativeType.UINT);<NEW_LINE>m.put(TypeAlias.in_addr_t, NativeType.UINT);<NEW_LINE>m.put(TypeAlias.in_port_t, NativeType.USHORT);<NEW_LINE>m.put(TypeAlias.ino_t, NativeType.ULONGLONG);<NEW_LINE>m.put(TypeAlias.ino64_t, NativeType.ULONGLONG);<NEW_LINE>m.put(TypeAlias.key_t, NativeType.SINT);<NEW_LINE>m.put(TypeAlias.mode_t, NativeType.UINT);<NEW_LINE>m.put(TypeAlias.nlink_t, NativeType.UINT);<NEW_LINE>m.put(TypeAlias.id_t, NativeType.UINT);<NEW_LINE>m.put(TypeAlias.pid_t, NativeType.SINT);<NEW_LINE>m.put(TypeAlias.off_t, NativeType.SLONGLONG);<NEW_LINE>m.put(TypeAlias.swblk_t, NativeType.SLONG);<NEW_LINE>m.put(TypeAlias.uid_t, NativeType.UINT);<NEW_LINE>m.put(TypeAlias.clock_t, NativeType.SLONG);<NEW_LINE>m.put(TypeAlias.size_t, NativeType.UINT);<NEW_LINE>m.put(TypeAlias.ssize_t, NativeType.SINT);<NEW_LINE>m.put(TypeAlias.time_t, NativeType.SLONG);<NEW_LINE>m.put(TypeAlias.fsblkcnt_t, NativeType.ULONGLONG);<NEW_LINE>m.put(TypeAlias.fsfilcnt_t, NativeType.ULONGLONG);<NEW_LINE>m.put(TypeAlias.sa_family_t, NativeType.USHORT);<NEW_LINE>m.put(TypeAlias.socklen_t, NativeType.UINT);<NEW_LINE>m.put(TypeAlias.rlim_t, NativeType.ULONGLONG);<NEW_LINE>m.put(<MASK><NEW_LINE>m.put(TypeAlias.speed_t, NativeType.UINT);<NEW_LINE>m.put(TypeAlias.tcflag_t, NativeType.UINT);<NEW_LINE>return m;<NEW_LINE>}
TypeAlias.cc_t, NativeType.UCHAR);
232,857
final DescribeAuditFindingResult executeDescribeAuditFinding(DescribeAuditFindingRequest describeAuditFindingRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(describeAuditFindingRequest);<NEW_LINE><MASK><NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DescribeAuditFindingRequest> request = null;<NEW_LINE>Response<DescribeAuditFindingResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DescribeAuditFindingRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(describeAuditFindingRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "IoT");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DescribeAuditFinding");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DescribeAuditFindingResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DescribeAuditFindingResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
79,617
public void run() throws Exception {<NEW_LINE>initializeOutputDir();<NEW_LINE>IOUtil.checkDirectoryArgument(modelRoot, "Model Root");<NEW_LINE>IOUtil.checkFileArgument(inputPath, "Input File");<NEW_LINE>Path out = outDir.resolve(inputPath.toFile().getName() + ".ne");<NEW_LINE>List<String> lines = Files.readAllLines(inputPath, StandardCharsets.UTF_8);<NEW_LINE>List<String> sentences = TurkishSentenceExtractor.DEFAULT.fromParagraphs(lines);<NEW_LINE>Log.info("There are %d lines and about %d sentences", lines.size(), sentences.size());<NEW_LINE>TurkishMorphology morphology = TurkishMorphology.createWithDefaults();<NEW_LINE>PerceptronNer ner = PerceptronNer.loadModel(modelRoot, morphology);<NEW_LINE>Stopwatch sw = Stopwatch.createStarted();<NEW_LINE>int tokenCount = 0;<NEW_LINE>try (PrintWriter pw = new PrintWriter(out.toFile(), "UTF-8")) {<NEW_LINE>for (String sentence : sentences) {<NEW_LINE>sentence = TextUtil.normalizeApostrophes(sentence);<NEW_LINE>sentence = TextUtil.normalizeQuotesHyphens(sentence);<NEW_LINE><MASK><NEW_LINE>List<String> words = TurkishTokenizer.DEFAULT.tokenizeToStrings(sentence);<NEW_LINE>tokenCount += words.size();<NEW_LINE>NerSentence result = ner.findNamedEntities(sentence, words);<NEW_LINE>pw.println(result.getAsTrainingSentence(annotationStyle));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>double secs = sw.elapsed(TimeUnit.MILLISECONDS) / 1000d;<NEW_LINE>Log.info("Token count = %s", tokenCount);<NEW_LINE>Log.info("File processed in %.4f seconds.", secs);<NEW_LINE>Log.info("Speed = %.2f tokens/sec", tokenCount / secs);<NEW_LINE>Log.info("Result is written in %s", out);<NEW_LINE>}
sentence = TextUtil.normalizeSpacesAndSoftHyphens(sentence);
162,678
public void handleLdsResponse(ServerInfo serverInfo, String versionInfo, List<Any> resources, String nonce) {<NEW_LINE>syncContext.throwIfNotInThisSynchronizationContext();<NEW_LINE>Map<String, ParsedResource> parsedResources = new HashMap<>(resources.size());<NEW_LINE>Set<String> unpackedResources = new HashSet<>(resources.size());<NEW_LINE>Set<String> invalidResources = new HashSet<>();<NEW_LINE>List<String> errors = new ArrayList<>();<NEW_LINE>Set<String> retainedRdsResources = new HashSet<>();<NEW_LINE>for (int i = 0; i < resources.size(); i++) {<NEW_LINE>Any resource = resources.get(i);<NEW_LINE>boolean isResourceV3;<NEW_LINE>Listener listener;<NEW_LINE>try {<NEW_LINE>resource = maybeUnwrapResources(resource);<NEW_LINE>// Unpack the Listener.<NEW_LINE>isResourceV3 = resource.getTypeUrl().equals(ResourceType.LDS.typeUrl());<NEW_LINE>listener = unpackCompatibleType(resource, Listener.class, ResourceType.LDS.typeUrl(), ResourceType.LDS.typeUrlV2());<NEW_LINE>} catch (InvalidProtocolBufferException e) {<NEW_LINE>errors.add("LDS response Resource index " + i + " - can't decode Listener: " + e);<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (!isResourceNameValid(listener.getName(), resource.getTypeUrl())) {<NEW_LINE>errors.add("Unsupported resource name: " + listener.getName() + " for type: " + ResourceType.LDS);<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>String listenerName = canonifyResourceName(listener.getName());<NEW_LINE>unpackedResources.add(listenerName);<NEW_LINE>// Process Listener into LdsUpdate.<NEW_LINE>LdsUpdate ldsUpdate;<NEW_LINE>try {<NEW_LINE>if (listener.hasApiListener()) {<NEW_LINE>ldsUpdate = processClientSideListener(listener, retainedRdsResources, enableFaultInjection && isResourceV3);<NEW_LINE>} else {<NEW_LINE>ldsUpdate = processServerSideListener(listener, retainedRdsResources, enableRbac && isResourceV3);<NEW_LINE>}<NEW_LINE>} catch (ResourceInvalidException e) {<NEW_LINE>errors.add("LDS response Listener '" + listenerName + "' validation error: " + e.getMessage());<NEW_LINE>invalidResources.add(listenerName);<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>// LdsUpdate parsed successfully.<NEW_LINE>parsedResources.put(listenerName, new ParsedResource(ldsUpdate, resource));<NEW_LINE>}<NEW_LINE>logger.log(XdsLogLevel.INFO, "Received LDS Response version {0} nonce {1}. Parsed resources: {2}", versionInfo, nonce, unpackedResources);<NEW_LINE>handleResourceUpdate(serverInfo, ResourceType.LDS, parsedResources, invalidResources, <MASK><NEW_LINE>}
retainedRdsResources, versionInfo, nonce, errors);
1,095,126
public final void closeChildWrappers() {<NEW_LINE>// Close any child wrappers in the child wrapper list.<NEW_LINE>if (childWrappers != null && !childWrappers.isEmpty()) {<NEW_LINE>JdbcObject wrapper = null;<NEW_LINE>// Children remove themselves from the childWrappers list as they<NEW_LINE>// are closed.<NEW_LINE>for (int i = childWrappers.size(); i > 0; ) try {<NEW_LINE>wrapper = (JdbcObject) childWrappers.get(--i);<NEW_LINE>wrapper.close();<NEW_LINE>} catch (// can't fail here, need to keep<NEW_LINE>// closing<NEW_LINE>SQLException closeX) {<NEW_LINE>if (tc.isDebugEnabled())<NEW_LINE>Tr.debug(getTracer(), "ERR_CLOSING_CHILD", new Object<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Close this object's single child wrapper, if one exists.<NEW_LINE>if (childWrapper != null)<NEW_LINE>try {<NEW_LINE>childWrapper.close();<NEW_LINE>} catch (SQLException closeX) {<NEW_LINE>if (tc.isDebugEnabled())<NEW_LINE>Tr.debug(getTracer(), "ERR_CLOSING_CHILD", new Object[] { childWrapper, closeX });<NEW_LINE>}<NEW_LINE>}
[] { wrapper, closeX });
1,386,152
private void adjustTargetLiveOffsetUs(long liveOffsetUs) {<NEW_LINE>// Stay in a safe distance (3 standard deviations = >99%) to the minimum possible live offset.<NEW_LINE>long safeOffsetUs = smoothedMinPossibleLiveOffsetUs + 3 * smoothedMinPossibleLiveOffsetDeviationUs;<NEW_LINE>if (currentTargetLiveOffsetUs > safeOffsetUs) {<NEW_LINE>// There is room for decreasing the target offset towards the ideal or safe offset (whichever<NEW_LINE>// is larger). We want to limit the decrease so that the playback speed delta we achieve is<NEW_LINE>// the same as the maximum delta when slowing down towards the target.<NEW_LINE>long minUpdateIntervalUs = Util.msToUs(minUpdateIntervalMs);<NEW_LINE>long decrementToOffsetCurrentSpeedUs = (long) ((adjustedPlaybackSpeed - 1f) * minUpdateIntervalUs);<NEW_LINE>long decrementToIncreaseSpeedUs = (long) (<MASK><NEW_LINE>long maxDecrementUs = decrementToOffsetCurrentSpeedUs + decrementToIncreaseSpeedUs;<NEW_LINE>currentTargetLiveOffsetUs = max(safeOffsetUs, idealTargetLiveOffsetUs, currentTargetLiveOffsetUs - maxDecrementUs);<NEW_LINE>} else {<NEW_LINE>// We'd like to reach a stable condition where the current live offset stays just below the<NEW_LINE>// safe offset. But don't increase the target offset to more than what would allow us to slow<NEW_LINE>// down gradually from the current offset.<NEW_LINE>long offsetWhenSlowingDownNowUs = liveOffsetUs - (long) (max(0f, adjustedPlaybackSpeed - 1f) / proportionalControlFactor);<NEW_LINE>currentTargetLiveOffsetUs = Util.constrainValue(offsetWhenSlowingDownNowUs, currentTargetLiveOffsetUs, safeOffsetUs);<NEW_LINE>if (maxTargetLiveOffsetUs != C.TIME_UNSET && currentTargetLiveOffsetUs > maxTargetLiveOffsetUs) {<NEW_LINE>currentTargetLiveOffsetUs = maxTargetLiveOffsetUs;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
(maxPlaybackSpeed - 1f) * minUpdateIntervalUs);
978,927
public static void main(String[] args) throws Exception {<NEW_LINE>TopologyBuilder builder = new TopologyBuilder();<NEW_LINE>int parallelism = 2;<NEW_LINE>int spouts = parallelism;<NEW_LINE>builder.setSpout("word", new TestWordSpout(Duration.ofMillis(0)), spouts);<NEW_LINE>int bolts = 2 * parallelism;<NEW_LINE>builder.setBolt("exclaim1", new ExclamationBolt(), bolts).shuffleGrouping("word");<NEW_LINE>Config conf = new Config();<NEW_LINE>conf.setDebug(true);<NEW_LINE>conf.setMaxSpoutPending(10);<NEW_LINE>conf.setMessageTimeoutSecs(600);<NEW_LINE>conf.<MASK><NEW_LINE>// resources configuration<NEW_LINE>conf.setComponentRam("word", ExampleResources.getComponentRam());<NEW_LINE>conf.setComponentRam("exclaim1", ExampleResources.getComponentRam());<NEW_LINE>conf.setContainerDiskRequested(ExampleResources.getContainerDisk(spouts + bolts, parallelism));<NEW_LINE>conf.setContainerRamRequested(ExampleResources.getContainerRam(spouts + bolts, parallelism));<NEW_LINE>conf.setContainerCpuRequested(ExampleResources.getContainerCpu(spouts + bolts, parallelism));<NEW_LINE>if (args != null && args.length > 0) {<NEW_LINE>conf.setNumStmgrs(parallelism);<NEW_LINE>HeronSubmitter.submitTopology(args[0], conf, builder.createTopology());<NEW_LINE>} else {<NEW_LINE>System.out.println("Topology name not provided as an argument, running in simulator mode.");<NEW_LINE>Simulator simulator = new Simulator();<NEW_LINE>simulator.submitTopology("test", conf, builder.createTopology());<NEW_LINE>Utils.sleep(10000);<NEW_LINE>simulator.killTopology("test");<NEW_LINE>simulator.shutdown();<NEW_LINE>}<NEW_LINE>}
put(Config.TOPOLOGY_WORKER_CHILDOPTS, "-XX:+HeapDumpOnOutOfMemoryError");
701,852
public void initComplete(Bus bus) {<NEW_LINE>if (bus == null) {<NEW_LINE>if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())<NEW_LINE>Tr.debug(tc, "initComplete", "bus == NULL");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>LibertyApplicationBus.Type busType = bus.getExtension(LibertyApplicationBus.Type.class);<NEW_LINE>if (busType == null) {<NEW_LINE>if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())<NEW_LINE>Tr.debug(tc, "initComplete", "Can not determine server type, not Liberty BUS?");<NEW_LINE>return;<NEW_LINE>} else {<NEW_LINE>busSet.add(bus);<NEW_LINE>}<NEW_LINE>AssertionBuilderRegistry reg = bus.getExtension(AssertionBuilderRegistry.class);<NEW_LINE>if (reg != null) {<NEW_LINE>reg.registerBuilder(new WSATAssertionBuilder());<NEW_LINE>}<NEW_LINE>PolicyInterceptorProviderRegistry regIPR = bus.getExtension(PolicyInterceptorProviderRegistry.class);<NEW_LINE>if (reg != null) {<NEW_LINE>WSATAssertionPolicyProvider _policyProvider = new WSATAssertionPolicyProvider();<NEW_LINE>regIPR.register(_policyProvider);<NEW_LINE>}<NEW_LINE>if (addGzipInterceptor) {<NEW_LINE>if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {<NEW_LINE>Tr.debug(tc, "Adding GZIPInInterceptor...");<NEW_LINE>}<NEW_LINE>final GZIPInInterceptor in1 = new GZIPInInterceptor();<NEW_LINE>bus.getInInterceptors().add(in1);<NEW_LINE>}<NEW_LINE>if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {<NEW_LINE>Tr.debug(tc, "initComplete", "If we've got here, then the interceptors should be inserted");<NEW_LINE>// Prettyprint the SOAP if we're debugging<NEW_LINE>final LibertyLoggingInInterceptor in = new LibertyLoggingInInterceptor();<NEW_LINE>in.setPrettyLogging(true);<NEW_LINE>bus.getInInterceptors().add(in);<NEW_LINE><MASK><NEW_LINE>out.setPrettyLogging(true);<NEW_LINE>bus.getOutInterceptors().add(out);<NEW_LINE>}<NEW_LINE>bus.getInInterceptors().add(new WSATPolicyAwareInterceptor(Phase.PRE_PROTOCOL, false));<NEW_LINE>bus.getInInterceptors().add(new WSATPolicyAwareInterceptor(Phase.RECEIVE, false));<NEW_LINE>bus.getOutInterceptors().add(new WSATPolicyAwareInterceptor(Phase.SETUP, true));<NEW_LINE>bus.getOutInterceptors().add(new WSATPolicyAwareInterceptor(Phase.WRITE, true));<NEW_LINE>}
final LibertyLoggingOutInterceptor out = new LibertyLoggingOutInterceptor();
846,119
public AviatorObject call(final Map<String, Object> env, final AviatorObject arg1, final AviatorObject arg2) {<NEW_LINE>Object coll = arg1.getValue(env);<NEW_LINE>Object key = arg2.getValue(env);<NEW_LINE>if (coll == null) {<NEW_LINE>throw new NullPointerException("the collection of seq.get is null, which the value of key/index is `" + key + "`");<NEW_LINE>}<NEW_LINE>Class<?> clazz = coll.getClass();<NEW_LINE>if (List.class.isAssignableFrom(clazz)) {<NEW_LINE>if (!(key instanceof Number)) {<NEW_LINE>throw new <MASK><NEW_LINE>}<NEW_LINE>Object value = ((List) coll).get(((Number) key).intValue());<NEW_LINE>return AviatorRuntimeJavaType.valueOf(value);<NEW_LINE>} else if (Set.class.isAssignableFrom(clazz)) {<NEW_LINE>if (((Set) coll).contains(key)) {<NEW_LINE>return AviatorRuntimeJavaType.valueOf(key);<NEW_LINE>} else {<NEW_LINE>return AviatorNil.NIL;<NEW_LINE>}<NEW_LINE>} else if (Map.class.isAssignableFrom(clazz)) {<NEW_LINE>Object value = ((Map) coll).get(key);<NEW_LINE>return AviatorRuntimeJavaType.valueOf(value);<NEW_LINE>} else if (clazz.isArray()) {<NEW_LINE>if (!(key instanceof Number)) {<NEW_LINE>throw new IllegalArgumentException("Invalid index `" + key + "` for list,it's not a number.");<NEW_LINE>}<NEW_LINE>return AviatorRuntimeJavaType.valueOf(Array.get(coll, ((Number) key).intValue()));<NEW_LINE>} else {<NEW_LINE>throw new IllegalArgumentException(arg1.desc(env) + " is not a collection.");<NEW_LINE>}<NEW_LINE>}
IllegalArgumentException("Invalid index `" + key + "` for list,it's not a number.");
927,961
public Collection<DeploymentTarget> execute(MBeanServerConnection connection) throws Exception {<NEW_LINE>List<DeploymentTarget> <MASK><NEW_LINE>ObjectName service = new // NOI18N<NEW_LINE>ObjectName(// NOI18N<NEW_LINE>"com.bea:Name=DomainRuntimeService," + "Type=weblogic.management.mbeanservers.domainruntime.DomainRuntimeServiceMBean");<NEW_LINE>// NOI18N<NEW_LINE>ObjectName domainPending = (ObjectName) connection.getAttribute(service, "DomainPending");<NEW_LINE>if (domainPending != null) {<NEW_LINE>// NOI18N<NEW_LINE>ObjectName[] domainTargets = (ObjectName[]) connection.getAttribute(domainPending, "Targets");<NEW_LINE>if (domainTargets != null) {<NEW_LINE>for (ObjectName singleTarget : domainTargets) {<NEW_LINE>// NOI18N<NEW_LINE>String strType = (String) connection.getAttribute(singleTarget, "Type");<NEW_LINE>DeploymentTarget.Type type = DeploymentTarget.Type.parse(strType);<NEW_LINE>if (type != null) {<NEW_LINE>// NOI18N<NEW_LINE>result.add(new DeploymentTarget((String) connection.getAttribute(singleTarget, "Name"), type));<NEW_LINE>} else {<NEW_LINE>LOGGER.log(Level.INFO, "Unknown target type {0}", strType);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>}
result = new ArrayList<>();
473,046
private boolean handleTopicAssignmentOnline(String topic, String srcCluster, String dstCluster) {<NEW_LINE>HelixMirrorMakerManager helixManager = _currentControllerInstance.getHelixResourceManager();<NEW_LINE>if (helixManager.isTopicExisted(topic)) {<NEW_LINE>LOGGER.warn(<MASK><NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>TopicPartition topicPartitionInfo = null;<NEW_LINE>KafkaBrokerTopicObserver topicObserver = _currentControllerInstance.getSourceKafkaTopicObserver();<NEW_LINE>if (topicObserver == null) {<NEW_LINE>// no source partition information, use partitions=1 and depend on auto-expanding later<NEW_LINE>topicPartitionInfo = new TopicPartition(topic, 1);<NEW_LINE>} else {<NEW_LINE>topicPartitionInfo = topicObserver.getTopicPartitionWithRefresh(topic);<NEW_LINE>if (topicPartitionInfo == null) {<NEW_LINE>String msg = String.format("Failed to whitelist topic %s on controller because topic does not exists in src cluster %s", topic, srcCluster);<NEW_LINE>LOGGER.error(msg);<NEW_LINE>throw new IllegalArgumentException(msg);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>helixManager.addTopicToMirrorMaker(topicPartitionInfo);<NEW_LINE>LOGGER.info("Whitelisted topic {} from cluster {} to {}", topic, srcCluster, dstCluster);<NEW_LINE>return true;<NEW_LINE>}
"Topic {} already exists from cluster {} to {}", topic, srcCluster, dstCluster);
1,280,287
protected List<GeneratorTask> createTasks() throws Exception {<NEW_LINE>List<GeneratorTask> generatorTasks = new ArrayList<>();<NEW_LINE>if (model.getEndpointOperation() != null) {<NEW_LINE>String cacheName = model.getMetadata().getSyncInterface() + "EndpointCache";<NEW_LINE>String cacheLoaderName = model.getMetadata().getSyncInterface() + "EndpointCacheLoader";<NEW_LINE>Map<String, Object> cachedataModel = ImmutableMapParameter.of("fileHeader", model.getFileHeader(), "className", cacheName, "endpointOperation", model.getEndpointOperation(), "metadata", model.getMetadata());<NEW_LINE>Map<String, Object> loaderDataModel = ImmutableMapParameter.of("fileHeader", model.getFileHeader(), "className", cacheLoaderName, "endpointOperation", model.getEndpointOperation(), "metadata", model.getMetadata());<NEW_LINE>if (model.getEndpointOperation().isEndpointCacheRequired()) {<NEW_LINE>generatorTasks.add(new FreemarkerGeneratorTask(endpointDiscoveryDir, cacheName, freemarker.getEndpointDiscoveryIdentifiersCacheTemplate(), cachedataModel));<NEW_LINE>generatorTasks.add(new FreemarkerGeneratorTask(endpointDiscoveryDir, cacheLoaderName, freemarker.getEndpointDiscoveryIdentifiersCacheLoaderTemplate(), loaderDataModel));<NEW_LINE>} else {<NEW_LINE>generatorTasks.add(new FreemarkerGeneratorTask(endpointDiscoveryDir, cacheName, freemarker.getEndpointDiscoveryCacheTemplate(), cachedataModel));<NEW_LINE>generatorTasks.add(new FreemarkerGeneratorTask(endpointDiscoveryDir, cacheLoaderName, freemarker<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>return generatorTasks;<NEW_LINE>}
.getEndpointDiscoveryCacheLoaderTemplate(), loaderDataModel));
678,630
private static void extendParentWithAnswer(List<SusiIntent> preceding_intents, SusiIntent child_intent) {<NEW_LINE>// check if the child is qualified - if it is actually a child or a parent on root level<NEW_LINE>int depth = child_intent.getDepth();<NEW_LINE>// not a child<NEW_LINE>if (depth <= 0)<NEW_LINE>return;<NEW_LINE>// find a parent which is on the previous depth level<NEW_LINE>SusiIntent parent_intent = lastIntentWithDepth(preceding_intents, depth - 1);<NEW_LINE>// no parent found<NEW_LINE>if (parent_intent == null)<NEW_LINE>return;<NEW_LINE>// TODO: add hierarchy linking here:<NEW_LINE>// - get ID of parent<NEW_LINE>int parent_id = parent_intent.hashCode();<NEW_LINE>// - set an invisible assignment in parent for linking variable to ID<NEW_LINE>// TODO: this SET is incomplete!<NEW_LINE>parent_intent.addInferences(new SusiInference("SET ", SusiInference.Type.memory, 0));<NEW_LINE>// - add a check rule in child so a child fires only if linking ID is set correctly<NEW_LINE>// get expressions from child utterances.<NEW_LINE>List<SusiUtterance> child_utterances = child_intent.getUtterances();<NEW_LINE>if (child_utterances == null || child_utterances.size() != 1)<NEW_LINE>return;<NEW_LINE>String child_expression = child_utterances.get(0)<MASK><NEW_LINE>// We cannot accept utterances with wildcard expressions here because cues are answers that are presented inside the chat<NEW_LINE>if (child_expression.indexOf('*') >= 0)<NEW_LINE>return;<NEW_LINE>parent_intent.addCues(child_expression);<NEW_LINE>}
.getPattern().pattern();
462,906
// GEN-LAST:event_nextPageButtonActionPerformed<NEW_LINE>@Messages({ "# {0} - selectedPage", "# {1} - maxPage", "ResultsPanel.invalidPageNumber.message=The selected page number {0} does not exist. Please select a value from 1 to {1}.", "ResultsPanel.invalidPageNumber.title=Invalid Page Number" })<NEW_LINE>private void gotoPageFieldActionPerformed(java.awt.event.ActionEvent evt) {<NEW_LINE>// GEN-FIRST:event_gotoPageFieldActionPerformed<NEW_LINE>int newPage;<NEW_LINE>try {<NEW_LINE>newPage = Integer.parseInt(gotoPageField.getText());<NEW_LINE>} catch (NumberFormatException e) {<NEW_LINE>// ignore input<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>int pageSize = pageSizeComboBox.<MASK><NEW_LINE>if ((newPage - 1) < 0 || groupSize <= ((newPage - 1) * pageSize)) {<NEW_LINE>JOptionPane.showMessageDialog(this, Bundle.ResultsPanel_invalidPageNumber_message(newPage, Math.ceil((double) groupSize / pageSize)), Bundle.ResultsPanel_invalidPageNumber_title(), JOptionPane.WARNING_MESSAGE);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>disablePagingControls();<NEW_LINE>setPage((newPage - 1) * pageSize);<NEW_LINE>}
getItemAt(pageSizeComboBox.getSelectedIndex());
1,253,684
private DataBase select(String logicDbName, DatabaseSet dbSet, DalHints hints, String shard, boolean isMaster, boolean isSelect) throws DalException {<NEW_LINE>if (dbSet instanceof ClusterDatabaseSet && !((ClusterDatabaseSet) dbSet).getCluster().getRouteStrategyConfig().multiMaster()) {<NEW_LINE>return clusterSelect(dbSet, hints, shard, isMaster, isSelect);<NEW_LINE>} else if (dbSet instanceof ClusterDatabaseSet && ((ClusterDatabaseSet) dbSet).getCluster().getRouteStrategyConfig().multiMaster()) {<NEW_LINE>return new ClusterDataBaseAdapter(((ClusterDatabaseSet) dbSet).getCluster());<NEW_LINE>}<NEW_LINE>SelectionContext context = new SelectionContext(logicDbName, hints, shard, isMaster, isSelect);<NEW_LINE>if (shard == null) {<NEW_LINE>context.setMasters(dbSet.getMasterDbs());<NEW_LINE>context.setSlaves(dbSet.getSlaveDbs());<NEW_LINE>} else {<NEW_LINE>context.setMasters(dbSet.getMasterDbs(shard));<NEW_LINE>context.setSlaves(dbSet.getSlaveDbs(shard));<NEW_LINE>}<NEW_LINE>return config.<MASK><NEW_LINE>}
getSelector().select(context);
1,319,278
public void changeOrder(final String pageId, final String direction) throws ServiceException {<NEW_LINE>final Transaction transaction = pageRepository.beginTransaction();<NEW_LINE>try {<NEW_LINE>final JSONObject srcPage = pageRepository.get(pageId);<NEW_LINE>final int srcPageOrder = srcPage.getInt(Page.PAGE_ORDER);<NEW_LINE>JSONObject targetPage;<NEW_LINE>if ("up".equals(direction)) {<NEW_LINE>targetPage = pageRepository.getUpper(pageId);<NEW_LINE>} else {<NEW_LINE>// Down<NEW_LINE>targetPage = pageRepository.getUnder(pageId);<NEW_LINE>}<NEW_LINE>if (null == targetPage) {<NEW_LINE>if (transaction.isActive()) {<NEW_LINE>transaction.rollback();<NEW_LINE>}<NEW_LINE>LOGGER.log(Level.WARN, "Cant not find the target page of source page[order={}]", srcPageOrder);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// Swaps<NEW_LINE>srcPage.put(Page.PAGE_ORDER, targetPage.getInt(Page.PAGE_ORDER));<NEW_LINE>targetPage.put(Page.PAGE_ORDER, srcPageOrder);<NEW_LINE>pageRepository.update(srcPage.getString(Keys.OBJECT_ID<MASK><NEW_LINE>pageRepository.update(targetPage.getString(Keys.OBJECT_ID), targetPage, Page.PAGE_ORDER);<NEW_LINE>transaction.commit();<NEW_LINE>Statics.clear();<NEW_LINE>} catch (final Exception e) {<NEW_LINE>if (transaction.isActive()) {<NEW_LINE>transaction.rollback();<NEW_LINE>}<NEW_LINE>LOGGER.log(Level.ERROR, "Changes page's order failed", e);<NEW_LINE>throw new ServiceException(e);<NEW_LINE>}<NEW_LINE>}
), srcPage, Page.PAGE_ORDER);
1,177,686
public static ListDistributedProductResponse unmarshall(ListDistributedProductResponse listDistributedProductResponse, UnmarshallerContext _ctx) {<NEW_LINE>listDistributedProductResponse.setRequestId(_ctx.stringValue("ListDistributedProductResponse.RequestId"));<NEW_LINE>listDistributedProductResponse.setSuccess(_ctx.booleanValue("ListDistributedProductResponse.Success"));<NEW_LINE>listDistributedProductResponse.setCode(_ctx.stringValue("ListDistributedProductResponse.Code"));<NEW_LINE>listDistributedProductResponse.setErrorMessage(_ctx.stringValue("ListDistributedProductResponse.ErrorMessage"));<NEW_LINE>Data data = new Data();<NEW_LINE>data.setTotal(_ctx.integerValue("ListDistributedProductResponse.Data.Total"));<NEW_LINE>List<Items> info <MASK><NEW_LINE>for (int i = 0; i < _ctx.lengthValue("ListDistributedProductResponse.Data.Info.Length"); i++) {<NEW_LINE>Items items = new Items();<NEW_LINE>items.setSourceUid(_ctx.stringValue("ListDistributedProductResponse.Data.Info[" + i + "].SourceUid"));<NEW_LINE>items.setTargetUid(_ctx.stringValue("ListDistributedProductResponse.Data.Info[" + i + "].TargetUid"));<NEW_LINE>items.setProductKey(_ctx.stringValue("ListDistributedProductResponse.Data.Info[" + i + "].ProductKey"));<NEW_LINE>items.setSourceInstanceId(_ctx.stringValue("ListDistributedProductResponse.Data.Info[" + i + "].SourceInstanceId"));<NEW_LINE>items.setTargetInstanceId(_ctx.stringValue("ListDistributedProductResponse.Data.Info[" + i + "].TargetInstanceId"));<NEW_LINE>items.setGmtCreate(_ctx.longValue("ListDistributedProductResponse.Data.Info[" + i + "].GmtCreate"));<NEW_LINE>items.setTargetAliyunId(_ctx.stringValue("ListDistributedProductResponse.Data.Info[" + i + "].TargetAliyunId"));<NEW_LINE>items.setSourceRegion(_ctx.stringValue("ListDistributedProductResponse.Data.Info[" + i + "].SourceRegion"));<NEW_LINE>items.setTargetRegion(_ctx.stringValue("ListDistributedProductResponse.Data.Info[" + i + "].TargetRegion"));<NEW_LINE>items.setSourceInstanceName(_ctx.stringValue("ListDistributedProductResponse.Data.Info[" + i + "].SourceInstanceName"));<NEW_LINE>items.setTargetInstanceName(_ctx.stringValue("ListDistributedProductResponse.Data.Info[" + i + "].TargetInstanceName"));<NEW_LINE>info.add(items);<NEW_LINE>}<NEW_LINE>data.setInfo(info);<NEW_LINE>listDistributedProductResponse.setData(data);<NEW_LINE>return listDistributedProductResponse;<NEW_LINE>}
= new ArrayList<Items>();
436,219
Data pollInternal(long timeout) {<NEW_LINE><MASK><NEW_LINE>long itemId = reservedOffer == null ? -1 : reservedOffer.getItemId();<NEW_LINE>TxnReservePollOperation operation = new TxnReservePollOperation(name, timeout, itemId, tx.getTxnId());<NEW_LINE>operation.setCallerUuid(tx.getOwnerUuid());<NEW_LINE>try {<NEW_LINE>Future<QueueItem> future = invoke(operation);<NEW_LINE>QueueItem item = future.get();<NEW_LINE>if (item != null) {<NEW_LINE>if (reservedOffer != null && item.getItemId() == reservedOffer.getItemId()) {<NEW_LINE>offeredQueue.poll();<NEW_LINE>removeFromRecord(reservedOffer.getItemId());<NEW_LINE>itemIdSet.remove(reservedOffer.getItemId());<NEW_LINE>return reservedOffer.getSerializedObject();<NEW_LINE>}<NEW_LINE>//<NEW_LINE>if (!itemIdSet.add(item.getItemId())) {<NEW_LINE>throw new TransactionException("Duplicate itemId: " + item.getItemId());<NEW_LINE>}<NEW_LINE>TxnPollOperation txnPollOperation = new TxnPollOperation(name, item.getItemId());<NEW_LINE>putToRecord(txnPollOperation);<NEW_LINE>return item.getSerializedObject();<NEW_LINE>}<NEW_LINE>} catch (Throwable t) {<NEW_LINE>throw ExceptionUtil.rethrow(t);<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>}
QueueItem reservedOffer = offeredQueue.peek();
1,144,299
public Future<Void> deleteResource(Reconciliation reconciliation, ResourceName resourceName) {<NEW_LINE>Promise<Void> handler = Promise.promise();<NEW_LINE>vertx.executeBlocking(future -> {<NEW_LINE>try {<NEW_LINE>// Delete the resource by the topic name, because neither ZK nor Kafka know the resource name<NEW_LINE>if (!Boolean.TRUE.equals(operation().inNamespace(namespace).withName(resourceName.toString()).withPropagationPolicy(DeletionPropagation.FOREGROUND).delete())) {<NEW_LINE>LOGGER.warn(<MASK><NEW_LINE>future.complete();<NEW_LINE>} else {<NEW_LINE>Util.waitFor(reconciliation, vertx, "sync resource deletion " + resourceName, "deleted", 1000, Long.MAX_VALUE, () -> {<NEW_LINE>KafkaTopic kafkaTopic = operation().inNamespace(namespace).withName(resourceName.toString()).get();<NEW_LINE>boolean notExists = kafkaTopic == null;<NEW_LINE>LOGGER.debug("KafkaTopic {} deleted {}", resourceName.toString(), notExists);<NEW_LINE>return notExists;<NEW_LINE>}).onComplete(future);<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>future.fail(e);<NEW_LINE>}<NEW_LINE>}, handler);<NEW_LINE>return handler.future();<NEW_LINE>}
"KafkaTopic {} could not be deleted, since it doesn't seem to exist", resourceName.toString());
1,276,222
private // returns true iff wraps<NEW_LINE>boolean putObject(Object o) {<NEW_LINE>if (5 * size / 4 > table.length)<NEW_LINE>rehash(3 * table.length / 2);<NEW_LINE>size++;<NEW_LINE>int sysID = System.identityHashCode(o);<NEW_LINE>int bucket = sysID % table.length;<NEW_LINE>boolean wrap = usedId(sysID);<NEW_LINE>int temp = 0;<NEW_LINE>// find an empty slot, look for friends with the same ID<NEW_LINE>while (table[bucket] != null) {<NEW_LINE>// if (System.identityHashCode(table[bucket]) == sysID) wrap = true;<NEW_LINE>temp++;<NEW_LINE>bucket = (bucket + 1) % table.length;<NEW_LINE>}<NEW_LINE>if (temp > maxDisplace)<NEW_LINE>maxDisplace = temp;<NEW_LINE>// fill the slot<NEW_LINE>table[bucket] = o;<NEW_LINE>// add the wrapping info<NEW_LINE>if (wrap)<NEW_LINE>wrappers.put(o, Integer<MASK><NEW_LINE>return wrap;<NEW_LINE>}
.valueOf(nextFreeId()));
226,763
void afterStatementClose(CON connectionKey, STMT statementKey) {<NEW_LINE>if (log.isTraceEnabled()) {<NEW_LINE>log.trace("After statement close");<NEW_LINE>}<NEW_LINE>ConnectionInfo connectionInfo = this.openConnections.get(connectionKey);<NEW_LINE>// ConnectionInfo may be null if Connection was closed before Statement<NEW_LINE>if (connectionInfo == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>StatementInfo statementInfo = connectionInfo.nestedStatements.remove(statementKey);<NEW_LINE>if (statementInfo != null) {<NEW_LINE>statementInfo.nestedResultSetSpans.forEach((resultSetKey, span) -> {<NEW_LINE><MASK><NEW_LINE>if (log.isTraceEnabled()) {<NEW_LINE>log.trace("Closing span after statement close [" + span.getSpan() + "] - current span is [" + tracer.currentSpan() + "]");<NEW_LINE>}<NEW_LINE>span.close();<NEW_LINE>if (log.isTraceEnabled()) {<NEW_LINE>log.trace("Current span [" + tracer.currentSpan() + "]");<NEW_LINE>}<NEW_LINE>});<NEW_LINE>statementInfo.nestedResultSetSpans.clear();<NEW_LINE>}<NEW_LINE>}
connectionInfo.nestedResultSetSpans.remove(resultSetKey);
1,456,522
private void showDebugCounters() {<NEW_LINE>AlertDialog.Builder builder = new AlertDialog.Builder(this);<NEW_LINE>builder.setTitle("Tile Source");<NEW_LINE>StringBuilder sb = new StringBuilder();<NEW_LINE>sb.append(Counters.class.getCanonicalName() + "\nPerformance and debug counters\n\n");<NEW_LINE>sb.append(<MASK><NEW_LINE>sb.append("File cache hit: " + Counters.fileCacheHit + "\n");<NEW_LINE>sb.append("File cache miss: " + Counters.fileCacheMiss + "\n");<NEW_LINE>sb.append("File cache oom: " + Counters.fileCacheOOM + "\n");<NEW_LINE>sb.append("File cache save errors: " + Counters.fileCacheSaveErrors + "\n");<NEW_LINE>sb.append("Tile download errors: " + Counters.tileDownloadErrors + "\n");<NEW_LINE>builder.setMessage(sb.toString());<NEW_LINE>show = builder.show();<NEW_LINE>}
"Out of memory errors: " + Counters.countOOM + "\n");
1,826,332
public static Query<Long> averagePlaytimePerRegularPlayer(long after, long before, Long threshold) {<NEW_LINE>return database -> {<NEW_LINE>// INNER JOIN limits the users to only those that are regular<NEW_LINE>String selectPlaytimePerPlayer = SELECT + "p." + SessionsTable.USER_UUID + "," + "SUM(p." + SessionsTable.SESSION_END + "-p." + SessionsTable.SESSION_START + ") as playtime" + FROM + SessionsTable.TABLE_NAME + " p" + INNER_JOIN + '(' + selectActivityIndexSQL() + ") q2 on q2." + SessionsTable.USER_UUID + "=p." + SessionsTable.USER_UUID + WHERE + "p." + SessionsTable.SESSION_END + "<=?" + AND + "p." + SessionsTable.SESSION_START + ">=?" + AND + "q2.activity_index>=?" + AND + "q2.activity_index<?" + GROUP_BY + "p." + SessionsTable.USER_UUID;<NEW_LINE>String selectAverage = SELECT + "AVG(playtime) as average" <MASK><NEW_LINE>return database.query(new QueryStatement<Long>(selectAverage, 100) {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void prepare(PreparedStatement statement) throws SQLException {<NEW_LINE>setSelectActivityIndexSQLParameters(statement, 1, threshold, before);<NEW_LINE>statement.setLong(9, before);<NEW_LINE>statement.setLong(10, after);<NEW_LINE>statement.setDouble(11, ActivityIndex.REGULAR);<NEW_LINE>statement.setDouble(12, 5.1);<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public Long processResults(ResultSet set) throws SQLException {<NEW_LINE>return set.next() ? (long) set.getDouble("average") : 0;<NEW_LINE>}<NEW_LINE>});<NEW_LINE>};<NEW_LINE>}
+ FROM + '(' + selectPlaytimePerPlayer + ") q1";
1,706,804
final DeleteConfigurationSetEventDestinationResult executeDeleteConfigurationSetEventDestination(DeleteConfigurationSetEventDestinationRequest deleteConfigurationSetEventDestinationRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(deleteConfigurationSetEventDestinationRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DeleteConfigurationSetEventDestinationRequest> request = null;<NEW_LINE>Response<DeleteConfigurationSetEventDestinationResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DeleteConfigurationSetEventDestinationRequestMarshaller().marshall(super.beforeMarshalling(deleteConfigurationSetEventDestinationRequest));<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, "SES");<NEW_LINE>request.<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>StaxResponseHandler<DeleteConfigurationSetEventDestinationResult> responseHandler = new StaxResponseHandler<DeleteConfigurationSetEventDestinationResult>(new DeleteConfigurationSetEventDestinationResultStaxUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
addHandlerContext(HandlerContextKey.OPERATION_NAME, "DeleteConfigurationSetEventDestination");
794,141
public void showMissingQuantityOfProduct(ActionRequest request, ActionResponse response) {<NEW_LINE>Map<String, Long> mapId = Beans.get(ProjectedStockService.class).getProductIdCompanyIdStockLocationIdFromContext(request.getContext());<NEW_LINE>if (mapId == null || mapId.get("productId") == 0L) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>Long <MASK><NEW_LINE>Long companyId = mapId.get("companyId");<NEW_LINE>Long stockLocationId = mapId.get("stockLocationId");<NEW_LINE>String domain = Beans.get(ManufOrderService.class).getConsumeAndMissingQtyForAProduct(productId, companyId, stockLocationId);<NEW_LINE>Product product = Beans.get(ProductRepository.class).find(mapId.get("productId"));<NEW_LINE>String title = I18n.get(VIEW_MISSING_QTY_TITLE);<NEW_LINE>title = String.format(title, product.getName());<NEW_LINE>response.setView(ActionView.define(title).model(StockMoveLine.class.getName()).add("grid", "stock-move-line-consumed-manuf-order-grid").add("form", "stock-move-line-form").domain(domain).param("popup", "true").param("popup-save", "false").map());<NEW_LINE>}
productId = mapId.get("productId");
779,145
public XContentBuilder doXContentBody(XContentBuilder builder, Params params) throws IOException {<NEW_LINE>if (keyed) {<NEW_LINE>builder.startObject(CommonFields.VALUES.getPreferredName());<NEW_LINE>for (int i = 0; i < keys.length; ++i) {<NEW_LINE>String key = String<MASK><NEW_LINE>double value = value(keys[i]);<NEW_LINE>builder.field(key, state.getTotalCount() == 0 ? null : value);<NEW_LINE>if (format != DocValueFormat.RAW && state.getTotalCount() > 0) {<NEW_LINE>builder.field(key + "_as_string", format.format(value).toString());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>builder.endObject();<NEW_LINE>} else {<NEW_LINE>builder.startArray(CommonFields.VALUES.getPreferredName());<NEW_LINE>for (int i = 0; i < keys.length; i++) {<NEW_LINE>double value = value(keys[i]);<NEW_LINE>builder.startObject();<NEW_LINE>builder.field(CommonFields.KEY.getPreferredName(), keys[i]);<NEW_LINE>builder.field(CommonFields.VALUE.getPreferredName(), state.getTotalCount() == 0 ? null : value);<NEW_LINE>if (format != DocValueFormat.RAW && state.getTotalCount() > 0) {<NEW_LINE>builder.field(CommonFields.VALUE_AS_STRING.getPreferredName(), format.format(value).toString());<NEW_LINE>}<NEW_LINE>builder.endObject();<NEW_LINE>}<NEW_LINE>builder.endArray();<NEW_LINE>}<NEW_LINE>return builder;<NEW_LINE>}
.valueOf(keys[i]);
365,927
public ListPoliciesGrantingServiceAccessEntry unmarshall(StaxUnmarshallerContext context) throws Exception {<NEW_LINE>ListPoliciesGrantingServiceAccessEntry listPoliciesGrantingServiceAccessEntry = new ListPoliciesGrantingServiceAccessEntry();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>if (context.isStartOfDocument())<NEW_LINE>targetDepth += 1;<NEW_LINE>while (true) {<NEW_LINE><MASK><NEW_LINE>if (xmlEvent.isEndDocument())<NEW_LINE>return listPoliciesGrantingServiceAccessEntry;<NEW_LINE>if (xmlEvent.isAttribute() || xmlEvent.isStartElement()) {<NEW_LINE>if (context.testExpression("ServiceNamespace", targetDepth)) {<NEW_LINE>listPoliciesGrantingServiceAccessEntry.setServiceNamespace(StringStaxUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (context.testExpression("Policies", targetDepth)) {<NEW_LINE>listPoliciesGrantingServiceAccessEntry.withPolicies(new ArrayList<PolicyGrantingServiceAccess>());<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (context.testExpression("Policies/member", targetDepth)) {<NEW_LINE>listPoliciesGrantingServiceAccessEntry.withPolicies(PolicyGrantingServiceAccessStaxUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>} else if (xmlEvent.isEndElement()) {<NEW_LINE>if (context.getCurrentDepth() < originalDepth) {<NEW_LINE>return listPoliciesGrantingServiceAccessEntry;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
XMLEvent xmlEvent = context.nextEvent();
1,238,975
private static ResponseInfo buildResponseInfo(okhttp3.Response response, String ip, long duration, final UpToken upToken, final long totalSize) {<NEW_LINE><MASK><NEW_LINE>String reqId = response.header("X-Reqid");<NEW_LINE>reqId = (reqId == null) ? null : reqId.trim().split(",")[0];<NEW_LINE>byte[] body = null;<NEW_LINE>String error = null;<NEW_LINE>try {<NEW_LINE>body = response.body().bytes();<NEW_LINE>} catch (IOException e) {<NEW_LINE>error = e.getMessage();<NEW_LINE>}<NEW_LINE>JSONObject json = null;<NEW_LINE>if (ctype(response).equals(Client.JsonMime) && body != null) {<NEW_LINE>try {<NEW_LINE>json = buildJsonResp(body);<NEW_LINE>if (response.code() != 200) {<NEW_LINE>String err = new String(body, Constants.UTF_8);<NEW_LINE>error = json.optString("error", err);<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>if (response.code() < 300) {<NEW_LINE>error = e.getMessage();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>error = body == null ? "null body" : new String(body);<NEW_LINE>}<NEW_LINE>HashMap<String, String> responseHeader = new HashMap<String, String>();<NEW_LINE>int headerCount = response.headers().size();<NEW_LINE>for (int i = 0; i < headerCount; i++) {<NEW_LINE>String name = response.headers().name(i).toLowerCase();<NEW_LINE>String value = response.headers().value(i);<NEW_LINE>responseHeader.put(name, value);<NEW_LINE>}<NEW_LINE>return ResponseInfo.create(null, code, responseHeader, json, error);<NEW_LINE>}
int code = response.code();
1,657,601
public static void main(String[] args) {<NEW_LINE>// Parse text to separate words<NEW_LINE>String INPUT_TEXT = "Hello World! Hello All! Hi World!";<NEW_LINE>// Create Multiset<NEW_LINE>Multiset<String> multiset = LinkedHashMultiset.create(Arrays.asList(INPUT_TEXT.split(" ")));<NEW_LINE>// Print count words<NEW_LINE>// print [Hello x 2, World! x 2, All!, Hi]- in predictable iteration order<NEW_LINE>System.out.println(multiset);<NEW_LINE>// Print all unique words<NEW_LINE>// print [Hello, World!, All!, Hi] - in predictable iteration order<NEW_LINE>System.out.<MASK><NEW_LINE>// Print count occurrences of words<NEW_LINE>// print 2<NEW_LINE>System.out.println("Hello = " + multiset.count("Hello"));<NEW_LINE>// print 2<NEW_LINE>System.out.println("World = " + multiset.count("World!"));<NEW_LINE>// print 1<NEW_LINE>System.out.println("All = " + multiset.count("All!"));<NEW_LINE>// print 1<NEW_LINE>System.out.println("Hi = " + multiset.count("Hi"));<NEW_LINE>// print 0<NEW_LINE>System.out.println("Empty = " + multiset.count("Empty"));<NEW_LINE>// Print count all words<NEW_LINE>// print 6<NEW_LINE>System.out.println(multiset.size());<NEW_LINE>// Print count unique words<NEW_LINE>// print 4<NEW_LINE>System.out.println(multiset.elementSet().size());<NEW_LINE>}
println(multiset.elementSet());
973,594
public void read(org.apache.thrift.protocol.TProtocol prot, TFJvmGcDetailed struct) throws org.apache.thrift.TException {<NEW_LINE>org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot;<NEW_LINE>java.util.BitSet incoming = iprot.readBitSet(8);<NEW_LINE>if (incoming.get(0)) {<NEW_LINE>struct.jvmGcNewCount = iprot.readI64();<NEW_LINE>struct.setJvmGcNewCountIsSet(true);<NEW_LINE>}<NEW_LINE>if (incoming.get(1)) {<NEW_LINE>struct.jvmGcNewTime = iprot.readI64();<NEW_LINE>struct.setJvmGcNewTimeIsSet(true);<NEW_LINE>}<NEW_LINE>if (incoming.get(2)) {<NEW_LINE>struct.jvmPoolCodeCacheUsed = iprot.readDouble();<NEW_LINE>struct.setJvmPoolCodeCacheUsedIsSet(true);<NEW_LINE>}<NEW_LINE>if (incoming.get(3)) {<NEW_LINE>struct.jvmPoolNewGenUsed = iprot.readDouble();<NEW_LINE>struct.setJvmPoolNewGenUsedIsSet(true);<NEW_LINE>}<NEW_LINE>if (incoming.get(4)) {<NEW_LINE>struct.jvmPoolOldGenUsed = iprot.readDouble();<NEW_LINE>struct.setJvmPoolOldGenUsedIsSet(true);<NEW_LINE>}<NEW_LINE>if (incoming.get(5)) {<NEW_LINE>struct<MASK><NEW_LINE>struct.setJvmPoolSurvivorSpaceUsedIsSet(true);<NEW_LINE>}<NEW_LINE>if (incoming.get(6)) {<NEW_LINE>struct.jvmPoolPermGenUsed = iprot.readDouble();<NEW_LINE>struct.setJvmPoolPermGenUsedIsSet(true);<NEW_LINE>}<NEW_LINE>if (incoming.get(7)) {<NEW_LINE>struct.jvmPoolMetaspaceUsed = iprot.readDouble();<NEW_LINE>struct.setJvmPoolMetaspaceUsedIsSet(true);<NEW_LINE>}<NEW_LINE>}
.jvmPoolSurvivorSpaceUsed = iprot.readDouble();
901,857
static HeapCompactDoublesSketch heapifyInstance(final Memory srcMem) {<NEW_LINE>final long memCapBytes = srcMem.getCapacity();<NEW_LINE>if (memCapBytes < Long.BYTES) {<NEW_LINE>throw new SketchesArgumentException("Source Memory too small: " + memCapBytes + " < 8");<NEW_LINE>}<NEW_LINE>final int preLongs = extractPreLongs(srcMem);<NEW_LINE>final int serVer = extractSerVer(srcMem);<NEW_LINE>final int familyID = extractFamilyID(srcMem);<NEW_LINE>final int flags = extractFlags(srcMem);<NEW_LINE>final int k = extractK(srcMem);<NEW_LINE>// Preamble flags empty state<NEW_LINE>final boolean empty = (flags & EMPTY_FLAG_MASK) > 0;<NEW_LINE>final long n = empty ? 0 : extractN(srcMem);<NEW_LINE>// VALIDITY CHECKS<NEW_LINE>DoublesUtil.checkDoublesSerVer(serVer, MIN_HEAP_DOUBLES_SER_VER);<NEW_LINE>Util.checkHeapFlags(flags);<NEW_LINE>HeapUpdateDoublesSketch.checkPreLongsFlagsSerVer(flags, serVer, preLongs);<NEW_LINE>Util.checkFamilyID(familyID);<NEW_LINE>// checks k<NEW_LINE>final <MASK><NEW_LINE>if (empty) {<NEW_LINE>hds.n_ = 0;<NEW_LINE>hds.combinedBuffer_ = null;<NEW_LINE>hds.baseBufferCount_ = 0;<NEW_LINE>hds.bitPattern_ = 0;<NEW_LINE>hds.minValue_ = Double.NaN;<NEW_LINE>hds.maxValue_ = Double.NaN;<NEW_LINE>return hds;<NEW_LINE>}<NEW_LINE>// Not empty, must have valid preamble + min, max, n.<NEW_LINE>// Forward compatibility from SerVer = 1 :<NEW_LINE>final boolean srcIsCompact = (serVer == 2) | ((flags & (COMPACT_FLAG_MASK | READ_ONLY_FLAG_MASK)) > 0);<NEW_LINE>HeapUpdateDoublesSketch.checkHeapMemCapacity(k, n, srcIsCompact, serVer, memCapBytes);<NEW_LINE>// set class members by computing them<NEW_LINE>hds.n_ = n;<NEW_LINE>hds.baseBufferCount_ = computeBaseBufferItems(k, n);<NEW_LINE>hds.bitPattern_ = computeBitPattern(k, n);<NEW_LINE>hds.minValue_ = srcMem.getDouble(MIN_DOUBLE);<NEW_LINE>hds.maxValue_ = srcMem.getDouble(MAX_DOUBLE);<NEW_LINE>final int totItems = Util.computeRetainedItems(k, n);<NEW_LINE>hds.srcMemoryToCombinedBuffer(srcMem, serVer, srcIsCompact, totItems);<NEW_LINE>return hds;<NEW_LINE>}
HeapCompactDoublesSketch hds = new HeapCompactDoublesSketch(k);
992,761
private void invokeSimpleImplProviderService(String msg, String warName, String serviceName, PrintWriter writer) {<NEW_LINE>StringBuilder sBuilder = new StringBuilder("http://").append(hostname).append(":").append(port).append("/").append(warName).append("/").append(serviceName).append("?wsdl");<NEW_LINE>// System.out.println(sBuilder.toString());<NEW_LINE>try {<NEW_LINE>QName qname = new QName(NAMESPACE, serviceName);<NEW_LINE>URL wsdlLocation = new URL(sBuilder.toString());<NEW_LINE>Service service = Service.create(wsdlLocation, qname);<NEW_LINE>QName portType = new QName(NAMESPACE, "SimpleImplProviderPort");<NEW_LINE>Dispatch<SOAPMessage> dispatch = service.createDispatch(portType, SOAPMessage.class, Service.Mode.MESSAGE);<NEW_LINE>MessageFactory messageFactory = MessageFactory.newInstance();<NEW_LINE><MASK><NEW_LINE>SOAPPart soappart = message.getSOAPPart();<NEW_LINE>// <soapenv:Body><NEW_LINE>// <tns2:invoke><NEW_LINE>// <arg0><NEW_LINE>// <contentDescription>strfgsdfg</contentDescription><NEW_LINE>// </arg0><NEW_LINE>// </tns2:invoke><NEW_LINE>// </soapenv:Body><NEW_LINE>SOAPEnvelope envelope = soappart.getEnvelope();<NEW_LINE>envelope.setAttribute("xmlns:tns", "http://impl.service.cdi.jaxws.ws.ibm.com/");<NEW_LINE>SOAPBody body = envelope.getBody();<NEW_LINE>SOAPElement element = body.addChildElement(body.createQName("invoke", "tns"));<NEW_LINE>element.addChildElement(new QName("arg0")).setTextContent(msg);<NEW_LINE>message.writeTo(System.out);<NEW_LINE>SOAPMessage msgRtn = dispatch.invoke(message);<NEW_LINE>msgRtn.writeTo(System.out);<NEW_LINE>String rtnStr = msgRtn.getSOAPBody().getTextContent();<NEW_LINE>writer.println(rtnStr);<NEW_LINE>} catch (Exception e) {<NEW_LINE>writer.println(e.getMessage());<NEW_LINE>} finally {<NEW_LINE>writer.flush();<NEW_LINE>writer.close();<NEW_LINE>}<NEW_LINE>}
SOAPMessage message = messageFactory.createMessage();
1,422,422
protected void createMethodParamsGrid(MethodInfo methodInfo) {<NEW_LINE>GridLayout methodParamsGrid = uiComponents.create(GridLayout.class);<NEW_LINE>methodParamsGrid.setWidth("100%");<NEW_LINE>methodParamsGrid.setSpacing(true);<NEW_LINE>methodParamsGrid.setColumns(2);<NEW_LINE>methodParamsGrid.setColumnExpandRatio(1, 1);<NEW_LINE>int rowsCount = 0;<NEW_LINE>for (MethodParameterInfo parameterInfo : methodInfo.getParameters()) {<NEW_LINE>Label<String> nameLabel = uiComponents.create(Label.NAME);<NEW_LINE>nameLabel.setValue(parameterInfo.getType().getSimpleName() + " " + parameterInfo.getName());<NEW_LINE>TextField<Object> valueTextField = uiComponents.create(TextField.NAME);<NEW_LINE>valueTextField.setWidth("100%");<NEW_LINE>valueTextField.setValue(parameterInfo.getValue());<NEW_LINE>valueTextField.addValueChangeListener(e -> {<NEW_LINE>parameterInfo.setValue(e.getValue());<NEW_LINE>MethodInfo selectedMethod = methodNameField.getValue();<NEW_LINE>taskDs.getItem().<MASK><NEW_LINE>});<NEW_LINE>methodParamsGrid.setRows(++rowsCount);<NEW_LINE>methodParamsGrid.add(nameLabel, 0, rowsCount - 1);<NEW_LINE>methodParamsGrid.add(valueTextField, 1, rowsCount - 1);<NEW_LINE>}<NEW_LINE>methodParamsBox.add(methodParamsGrid);<NEW_LINE>}
updateMethodParameters(selectedMethod.getParameters());
735,890
public static String streamFile(HttpServletResponse response, File file) {<NEW_LINE>if (file == null)<NEW_LINE>return "No File";<NEW_LINE>if (!file.exists())<NEW_LINE>return "File not found: " + file.getAbsolutePath();<NEW_LINE>MimeType mimeType = MimeType.get(file.getAbsolutePath());<NEW_LINE>// Stream File<NEW_LINE>try {<NEW_LINE>// 2k Buffer<NEW_LINE>int bufferSize = 2048;<NEW_LINE>int fileLength = (int) file.length();<NEW_LINE>//<NEW_LINE>response.setContentType(mimeType.getMimeType());<NEW_LINE>response.setBufferSize(bufferSize);<NEW_LINE>response.setContentLength(fileLength);<NEW_LINE>//<NEW_LINE>log.fine(file.toString());<NEW_LINE>// timer start<NEW_LINE>long time = System.currentTimeMillis();<NEW_LINE>// Get Data<NEW_LINE>FileInputStream in = new FileInputStream(file);<NEW_LINE>ServletOutputStream out = response.getOutputStream();<NEW_LINE>int c = 0;<NEW_LINE>while ((c = in.read()) != -1) out.write(c);<NEW_LINE>//<NEW_LINE>out.flush();<NEW_LINE>out.close();<NEW_LINE>in.close();<NEW_LINE>//<NEW_LINE>time <MASK><NEW_LINE>double speed = (fileLength / 1024) / ((double) time / 1000);<NEW_LINE>log.info("Length=" + fileLength + " - " + time + " ms - " + speed + " kB/sec - " + mimeType);<NEW_LINE>} catch (IOException ex) {<NEW_LINE>log.log(Level.SEVERE, ex.toString());<NEW_LINE>return "Streaming error - " + ex;<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>}
= System.currentTimeMillis() - time;
1,805,180
public <T extends Actor> Cell<T> add(@Null T actor) {<NEW_LINE>Cell<T> cell = obtainCell();<NEW_LINE>cell.actor = actor;<NEW_LINE>// The row was ended for layout, not by the user, so revert it.<NEW_LINE>if (implicitEndRow) {<NEW_LINE>implicitEndRow = false;<NEW_LINE>rows--;<NEW_LINE>cells.peek().endRow = false;<NEW_LINE>}<NEW_LINE>int cellCount = cells.size;<NEW_LINE>if (cellCount > 0) {<NEW_LINE>// Set cell column and row.<NEW_LINE>Cell lastCell = cells.peek();<NEW_LINE>if (!lastCell.endRow) {<NEW_LINE>cell.column <MASK><NEW_LINE>cell.row = lastCell.row;<NEW_LINE>} else {<NEW_LINE>cell.column = 0;<NEW_LINE>cell.row = lastCell.row + 1;<NEW_LINE>}<NEW_LINE>// Set the index of the cell above.<NEW_LINE>if (cell.row > 0) {<NEW_LINE>Object[] cells = this.cells.items;<NEW_LINE>outer: for (int i = cellCount - 1; i >= 0; i--) {<NEW_LINE>Cell other = (Cell) cells[i];<NEW_LINE>for (int column = other.column, nn = column + other.colspan; column < nn; column++) {<NEW_LINE>if (column == cell.column) {<NEW_LINE>cell.cellAboveIndex = i;<NEW_LINE>break outer;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>cell.column = 0;<NEW_LINE>cell.row = 0;<NEW_LINE>}<NEW_LINE>cells.add(cell);<NEW_LINE>cell.set(cellDefaults);<NEW_LINE>if (cell.column < columnDefaults.size)<NEW_LINE>cell.merge(columnDefaults.get(cell.column));<NEW_LINE>cell.merge(rowDefaults);<NEW_LINE>if (actor != null)<NEW_LINE>addActor(actor);<NEW_LINE>return cell;<NEW_LINE>}
= lastCell.column + lastCell.colspan;
733,351
public ListManagedEndpointsResult unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>ListManagedEndpointsResult listManagedEndpointsResult = new ListManagedEndpointsResult();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE><MASK><NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return listManagedEndpointsResult;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>if (context.testExpression("endpoints", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>listManagedEndpointsResult.setEndpoints(new ListUnmarshaller<Endpoint>(EndpointJsonUnmarshaller.getInstance()).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("nextToken", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>listManagedEndpointsResult.setNextToken(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return listManagedEndpointsResult;<NEW_LINE>}
String currentParentElement = context.getCurrentParentElement();
1,770,526
final DescribePrincipalMappingResult executeDescribePrincipalMapping(DescribePrincipalMappingRequest describePrincipalMappingRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(describePrincipalMappingRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DescribePrincipalMappingRequest> request = null;<NEW_LINE>Response<DescribePrincipalMappingResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DescribePrincipalMappingRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(describePrincipalMappingRequest));<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, "kendra");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DescribePrincipalMapping");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DescribePrincipalMappingResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DescribePrincipalMappingResultJsonUnmarshaller());<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.endEvent(Field.RequestMarshallTime);
243,418
public static void main(String[] args) {<NEW_LINE>LOGGER.info("---------------------");<NEW_LINE>LOGGER.info("KEY VAULT - SECRETS");<NEW_LINE>LOGGER.info("IDENTITY - CREDENTIAL");<NEW_LINE>LOGGER.info("---------------------");<NEW_LINE>// Configure authority host from AZURE_CLOUD<NEW_LINE>String azureCloud = System.getenv("AZURE_CLOUD");<NEW_LINE>String authorityHost = AUTHORITY_HOST_MAP.getOrDefault(azureCloud, AzureAuthorityHosts.AZURE_PUBLIC_CLOUD);<NEW_LINE>SecretServiceVersion serviceVersion = AUTHORITY_HOST_SERVICE_VERSION_MAP.getOrDefault(<MASK><NEW_LINE>secretClient = new SecretClientBuilder().vaultUrl(System.getenv("AZURE_PROJECT_URL")).credential(new DefaultAzureCredentialBuilder().authorityHost(authorityHost).build()).serviceVersion(serviceVersion).buildClient();<NEW_LINE>try {<NEW_LINE>setSecret();<NEW_LINE>getSecret();<NEW_LINE>} finally {<NEW_LINE>deleteSecret();<NEW_LINE>}<NEW_LINE>}
azureCloud, SecretServiceVersion.getLatest());
1,091,850
private List<List<Object>> genInfo() {<NEW_LINE>ArrayList<List<Object>> list = new ArrayList<>();<NEW_LINE>list.add(Arrays.asList(new Object[] { "Instances", String.valueOf(node4CalcPos.node.getCounter().getNumInst()), "" }));<NEW_LINE>list.add(Arrays.asList(new Object[] { "Weights", print(node4CalcPos.node.getCounter().getWeightSum()), "" }));<NEW_LINE>if (model.labels != null) {<NEW_LINE>if (!node4CalcPos.node.isLeaf()) {<NEW_LINE>for (int i = 0; i < model.labels.length; ++i) {<NEW_LINE>double distribution = node4CalcPos.node.getCounter().getDistributions()[i];<NEW_LINE>double weight = node4CalcPos.node.getCounter().getWeightSum();<NEW_LINE>list.add(Arrays.asList(new Object[] { String.valueOf(model.labels[i]), print(distribution), printOneDecimalWithSuffix(distribution <MASK><NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>for (int i = 0; i < model.labels.length; ++i) {<NEW_LINE>double distribution = node4CalcPos.node.getCounter().getDistributions()[i];<NEW_LINE>double weight = node4CalcPos.node.getCounter().getWeightSum();<NEW_LINE>list.add(Arrays.asList(new Object[] { String.valueOf(model.labels[i]), print(distribution * weight), printOneDecimalWithSuffix(distribution * 100) }));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>if (!node4CalcPos.node.isLeaf()) {<NEW_LINE>list.add(Arrays.asList(new Object[] { "Sum", print(node4CalcPos.node.getCounter().getDistributions()[0]) }));<NEW_LINE>} else {<NEW_LINE>list.add(Arrays.asList(new Object[] { "NormalizedSum", print(node4CalcPos.node.getCounter().getDistributions()[0]) }));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return list;<NEW_LINE>}
/ weight * 100) }));
1,378,990
private static void validateConditionConnections(ModuleTypeRegistry mtRegistry, @NonNull Condition condition, @NonNull List<? extends @NonNull Trigger> triggers) {<NEW_LINE>// get module type of the condition<NEW_LINE>ConditionType type = (ConditionType) mtRegistry.get(condition.getTypeUID());<NEW_LINE>if (type == null) {<NEW_LINE>// if module type not exists in the system - throws exception<NEW_LINE>throw new IllegalArgumentException("Condition Type \"" + condition.getTypeUID() + "\" does not exist!");<NEW_LINE>}<NEW_LINE>// get inputs of the condition according to module type definition<NEW_LINE>List<Input> inputs = type.getInputs();<NEW_LINE>// gets connected inputs from the condition module and put them into map<NEW_LINE>Set<Connection> cons = getConnections(condition.getInputs());<NEW_LINE>Map<String, Connection> connectionsMap = new HashMap<>();<NEW_LINE>Iterator<Connection> connectionsI = cons.iterator();<NEW_LINE>while (connectionsI.hasNext()) {<NEW_LINE>Connection connection = connectionsI.next();<NEW_LINE>String inputName = connection.getInputName();<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>// checks is there unconnected required inputs<NEW_LINE>if (inputs != null && !inputs.isEmpty()) {<NEW_LINE>for (Input input : inputs) {<NEW_LINE>String name = input.getName();<NEW_LINE>Connection connection = connectionsMap.get(name);<NEW_LINE>if (connection != null) {<NEW_LINE>checkConnection(mtRegistry, connection, input, triggers);<NEW_LINE>} else if (input.isRequired()) {<NEW_LINE>throw new IllegalArgumentException("Required input \"" + name + "\" of the condition \"" + condition.getId() + "\" not connected");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
connectionsMap.put(inputName, connection);
689,938
private JPanel buttonTab(final RailButton rbc) {<NEW_LINE>JPanel primary = new JPanel(new MigLayout("fill"));<NEW_LINE>JPanel panel = new JPanel(new MigLayout());<NEW_LINE>{<NEW_LINE>// // Outer Diameter<NEW_LINE>panel.add(new JLabel(trans.get("RailBtnCfg.lbl.OuterDiam")));<NEW_LINE>DoubleModel ODModel = new DoubleModel(component, "OuterDiameter", UnitGroup.UNITS_LENGTH, 0);<NEW_LINE>JSpinner ODSpinner = new JSpinner(ODModel.getSpinnerModel());<NEW_LINE>ODSpinner.setEditor(new SpinnerEditor(ODSpinner));<NEW_LINE>panel.add(ODSpinner, "growx");<NEW_LINE>panel.add(new UnitSelector(ODModel), "growx");<NEW_LINE>panel.add(new BasicSlider(ODModel.getSliderModel(0, 0.001, 0.02)), "w 100lp, wrap");<NEW_LINE>}<NEW_LINE>{<NEW_LINE>// // Height<NEW_LINE>panel.add(new JLabel(trans.get("RailBtnCfg.lbl.TotalHeight")));<NEW_LINE>DoubleModel heightModel = new DoubleModel(component, "TotalHeight", UnitGroup.UNITS_LENGTH, 0);<NEW_LINE>JSpinner heightSpinner = new JSpinner(heightModel.getSpinnerModel());<NEW_LINE>heightSpinner.setEditor(new SpinnerEditor(heightSpinner));<NEW_LINE>panel.add(heightSpinner, "growx");<NEW_LINE>panel.add(new UnitSelector(heightModel), "growx");<NEW_LINE>panel.add(new BasicSlider(heightModel.getSliderModel(0, 0.001, 0.02)), "w 100lp, wrap");<NEW_LINE>}<NEW_LINE>{<NEW_LINE>// // Angular Position:<NEW_LINE>panel.add(new JLabel(trans.get("RailBtnCfg.lbl.Angle")));<NEW_LINE>DoubleModel angleModel = new DoubleModel(component, "AngleOffset", UnitGroup.UNITS_ANGLE, -180, +180);<NEW_LINE>JSpinner angleSpinner = new JSpinner(angleModel.getSpinnerModel());<NEW_LINE>angleSpinner.setEditor(new SpinnerEditor(angleSpinner));<NEW_LINE>panel.add(angleSpinner, "growx");<NEW_LINE>panel.add(new UnitSelector(angleModel), "growx");<NEW_LINE>panel.add(new BasicSlider(angleModel.getSliderModel(-Math.PI, Math.PI)), "w 100lp, wrap");<NEW_LINE>}<NEW_LINE>{<NEW_LINE>// // Position relative to:<NEW_LINE>panel.add(new JLabel(trans.get("RailBtnCfg.lbl.PosRelativeTo")));<NEW_LINE>final EnumModel<AxialMethod> methodModel = new EnumModel<AxialMethod>(component, "AxialMethod", AxialMethod.axialOffsetMethods);<NEW_LINE>JComboBox<AxialMethod> relToCombo = new JComboBox<AxialMethod>(methodModel);<NEW_LINE>panel.add(relToCombo, "spanx, growx, wrap");<NEW_LINE>}<NEW_LINE>{<NEW_LINE>// // plus<NEW_LINE>panel.add(new JLabel(trans.get("RailBtnCfg.lbl.Plus")), "right");<NEW_LINE>DoubleModel offsetModel = new DoubleModel(component, "AxialOffset", UnitGroup.UNITS_LENGTH);<NEW_LINE>JSpinner offsetSpinner = new JSpinner(offsetModel.getSpinnerModel());<NEW_LINE>offsetSpinner.setEditor(new SpinnerEditor(offsetSpinner));<NEW_LINE>panel.add(offsetSpinner, "growx");<NEW_LINE>panel.add(new UnitSelector(offsetModel), "growx");<NEW_LINE>panel.add(new BasicSlider(offsetModel.getSliderModel(new DoubleModel(component.getParent(), "Length", -1.0, UnitGroup.UNITS_NONE), new DoubleModel(component.getParent(), "Length"))), "w 100lp, wrap para");<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>panel = new JPanel(new MigLayout("gap rel unrel", "[][65lp::][30lp::][]", ""));<NEW_LINE>// // Instance count<NEW_LINE>panel.add(instanceablePanel(rbc), "span, wrap");<NEW_LINE>// // Material<NEW_LINE>panel.add(materialPanel(Material.Type.BULK), "span, wrap");<NEW_LINE>primary.add(panel, "grow");<NEW_LINE>return primary;<NEW_LINE>}
primary.add(panel, "grow, gapright 201p");
1,359,061
protected String doInBackground(String... params) {<NEW_LINE>String host = params[0];<NEW_LINE>String message = params[1];<NEW_LINE>String portStr = params[2];<NEW_LINE>int port = TextUtils.isEmpty(portStr) ? 0 : Integer.valueOf(portStr);<NEW_LINE>try {<NEW_LINE>channel = OkHttpChannelBuilder.forAddress(host, port).transportExecutor(new NetworkTaggingExecutor(0xFDD))<MASK><NEW_LINE>GreeterGrpc.GreeterBlockingStub stub = GreeterGrpc.newBlockingStub(channel);<NEW_LINE>HelloRequest request = HelloRequest.newBuilder().setName(message).build();<NEW_LINE>HelloReply reply = stub.sayHello(request);<NEW_LINE>return reply.getMessage();<NEW_LINE>} catch (Exception e) {<NEW_LINE>StringWriter sw = new StringWriter();<NEW_LINE>PrintWriter pw = new PrintWriter(sw);<NEW_LINE>e.printStackTrace(pw);<NEW_LINE>pw.flush();<NEW_LINE>return String.format("Failed... : %n%s", sw);<NEW_LINE>}<NEW_LINE>}
.usePlaintext().build();
1,560,742
public static void run(JavaPlatform javaPlatform, FileObject js, boolean debug) throws IOException, UnsupportedOperationException {<NEW_LINE>LifecycleManager.getDefault().saveAll();<NEW_LINE>Map<String, Object> properties = new HashMap<>();<NEW_LINE>properties.put(JavaRunner.PROP_PLATFORM, javaPlatform);<NEW_LINE>final ClassPath path = getClassPath(js);<NEW_LINE>final Preferences p = Settings.getPreferences();<NEW_LINE>boolean preferNashorn = NashornPlatform.isNashornSupported(javaPlatform);<NEW_LINE>if (p.get(Settings.PREF_NASHORN, null) != null) {<NEW_LINE>preferNashorn = p.getBoolean(Settings.PREF_NASHORN, false);<NEW_LINE>} else {<NEW_LINE>if (NashornPlatform.isGraalJsSupported(javaPlatform)) {<NEW_LINE>if (NashornPlatform.isGraalJSPreferred(javaPlatform)) {<NEW_LINE>preferNashorn = false;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (preferNashorn) {<NEW_LINE>try {<NEW_LINE>javaPlatform.getBootstrapLibraries().getClassLoader(true).loadClass(NASHORN_SHELL);<NEW_LINE>properties.<MASK><NEW_LINE>} catch (ClassNotFoundException ex) {<NEW_LINE>properties.put(JavaRunner.PROP_CLASSNAME, JS_SHELL);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>properties.put(JavaRunner.PROP_CLASSNAME, JS_SHELL);<NEW_LINE>}<NEW_LINE>properties.put(JavaRunner.PROP_EXECUTE_CLASSPATH, path);<NEW_LINE>properties.put(JavaRunner.PROP_WORK_DIR, js.getParent());<NEW_LINE>// Collections.singletonList(js.getNameExt()));<NEW_LINE>properties.put(JavaRunner.PROP_APPLICATION_ARGS, getApplicationArgs(js));<NEW_LINE>if (debug) {<NEW_LINE>JavaRunner.execute(JavaRunner.QUICK_DEBUG, properties);<NEW_LINE>} else {<NEW_LINE>JavaRunner.execute(JavaRunner.QUICK_RUN, properties);<NEW_LINE>}<NEW_LINE>}
put(JavaRunner.PROP_CLASSNAME, NASHORN_SHELL);
855,263
public static void renderArrow(MatrixStack matrixStack, BlockPos start, BlockPos end) {<NEW_LINE>BufferBuilder bufferBuilder = Tessellator.getInstance().getBuffer();<NEW_LINE>bufferBuilder.begin(VertexFormat.DrawMode.DEBUG_LINES, VertexFormats.POSITION);<NEW_LINE>int startX = start.getX();<NEW_LINE>int startY = start.getY();<NEW_LINE>int startZ = start.getZ();<NEW_LINE>int endX = end.getX();<NEW_LINE>int endY = end.getY();<NEW_LINE>int endZ = end.getZ();<NEW_LINE>matrixStack.push();<NEW_LINE>Matrix4f matrix = matrixStack.peek().getPositionMatrix();<NEW_LINE>// main line<NEW_LINE>bufferBuilder.vertex(matrix, startX, startY, startZ).next();<NEW_LINE>bufferBuilder.vertex(matrix, endX, endY, endZ).next();<NEW_LINE>matrixStack.translate(endX, endY, endZ);<NEW_LINE>float scale = 1 / 16F;<NEW_LINE>matrixStack.scale(scale, scale, scale);<NEW_LINE>int xDiff = endX - startX;<NEW_LINE>int yDiff = endY - startY;<NEW_LINE>int zDiff = endZ - startZ;<NEW_LINE>float xAngle = (float) (Math.atan2(yDiff, -zDiff) + Math.toRadians(90));<NEW_LINE>matrixStack.multiply(Vec3f.POSITIVE_X.getRadialQuaternion(xAngle));<NEW_LINE>double yzDiff = Math.sqrt(yDiff * yDiff + zDiff * zDiff);<NEW_LINE>float zAngle = (float) Math.atan2(xDiff, yzDiff);<NEW_LINE>matrixStack.multiply(Vec3f.POSITIVE_Z.getRadialQuaternion(zAngle));<NEW_LINE>// arrow head<NEW_LINE>bufferBuilder.vertex(matrix, 0, <MASK><NEW_LINE>bufferBuilder.vertex(matrix, -1, 2, 0).next();<NEW_LINE>bufferBuilder.vertex(matrix, -1, 2, 0).next();<NEW_LINE>bufferBuilder.vertex(matrix, 0, 2, -1).next();<NEW_LINE>bufferBuilder.vertex(matrix, 0, 2, -1).next();<NEW_LINE>bufferBuilder.vertex(matrix, 1, 2, 0).next();<NEW_LINE>bufferBuilder.vertex(matrix, 1, 2, 0).next();<NEW_LINE>bufferBuilder.vertex(matrix, 0, 2, 1).next();<NEW_LINE>bufferBuilder.vertex(matrix, 1, 2, 0).next();<NEW_LINE>bufferBuilder.vertex(matrix, -1, 2, 0).next();<NEW_LINE>bufferBuilder.vertex(matrix, 0, 2, 1).next();<NEW_LINE>bufferBuilder.vertex(matrix, 0, 2, -1).next();<NEW_LINE>bufferBuilder.vertex(matrix, 0, 0, 0).next();<NEW_LINE>bufferBuilder.vertex(matrix, 1, 2, 0).next();<NEW_LINE>bufferBuilder.vertex(matrix, 0, 0, 0).next();<NEW_LINE>bufferBuilder.vertex(matrix, -1, 2, 0).next();<NEW_LINE>bufferBuilder.vertex(matrix, 0, 0, 0).next();<NEW_LINE>bufferBuilder.vertex(matrix, 0, 2, -1).next();<NEW_LINE>bufferBuilder.vertex(matrix, 0, 0, 0).next();<NEW_LINE>bufferBuilder.vertex(matrix, 0, 2, 1).next();<NEW_LINE>matrixStack.pop();<NEW_LINE>bufferBuilder.end();<NEW_LINE>BufferRenderer.draw(bufferBuilder);<NEW_LINE>}
2, 1).next();
1,505,151
// Calculate a rotation for the given time<NEW_LINE>Quaternion rotForTime(double sinceStart) {<NEW_LINE>double totalAng = (velocity + 0.5 * acceleration * sinceStart) * sinceStart;<NEW_LINE>AngleAxis angAxis = new AngleAxis(totalAng, axis);<NEW_LINE>Quaternion newRotQuat = startQuat.multiply(angAxis);<NEW_LINE>if (northUp) {<NEW_LINE>Point3d northPole = newRotQuat.multiply(new Point3d(0, 0, 1)).normalized();<NEW_LINE>if (northPole.getY() != 0.0) {<NEW_LINE>Point3d <MASK><NEW_LINE>// Then rotate it back on to the YZ axis<NEW_LINE>// This will keep it upward<NEW_LINE>double ang = Math.atan(northPole.getX() / northPole.getY());<NEW_LINE>// However, the pole might be down now<NEW_LINE>// If so, rotate it back up<NEW_LINE>if (northPole.getY() < 0.0)<NEW_LINE>ang += Math.PI;<NEW_LINE>AngleAxis upRot = new AngleAxis(ang, newUp);<NEW_LINE>newRotQuat = newRotQuat.multiply(upRot).normalized();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return newRotQuat;<NEW_LINE>}
newUp = globeView.prospectiveUp(newRotQuat);
1,110,022
public void dispatchFunction(HippyViewPager view, String functionName, HippyArray var) {<NEW_LINE>if (view == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>int curr = view.getCurrentItem();<NEW_LINE>switch(functionName) {<NEW_LINE>case FUNC_SET_PAGE:<NEW_LINE>if (var != null) {<NEW_LINE>Object selected = var.get(0);<NEW_LINE>if (selected instanceof Number) {<NEW_LINE>view.switchToPage(((Number) selected).intValue(), true);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>case FUNC_SET_PAGE_WITHOUT_ANIM:<NEW_LINE>if (var != null) {<NEW_LINE>Object selected = var.get(0);<NEW_LINE>if (selected instanceof Number) {<NEW_LINE>view.switchToPage(((Number) selected).intValue(), false);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>case FUNC_SET_INDEX:<NEW_LINE>if (var != null && var.size() > 0) {<NEW_LINE>HippyMap paramsMap = var.getMap(0);<NEW_LINE>if (paramsMap != null && paramsMap.size() > 0 && paramsMap.containsKey("index")) {<NEW_LINE>int index = paramsMap.getInt("index");<NEW_LINE>boolean animated = !paramsMap.containsKey("animated") || paramsMap.getBoolean("animated");<NEW_LINE>view.switchToPage(index, animated);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>case FUNC_NEXT_PAGE:<NEW_LINE>int total = view<MASK><NEW_LINE>if (curr < total - 1) {<NEW_LINE>view.switchToPage(curr + 1, true);<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>case FUNC_PREV_PAGE:<NEW_LINE>if (curr > 0) {<NEW_LINE>view.switchToPage(curr - 1, true);<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}
.getAdapter().getCount();
1,693,471
protected void init0() {<NEW_LINE>for (Parameter parameter : info.getParameters()) {<NEW_LINE>Name parameterRoutineName = name(parameter.getSpecificCatalog(), parameter.getSpecificSchema(), parameter.getSpecificPackage(), parameter.getSpecificName());<NEW_LINE>if (specificName.equals(parameterRoutineName)) {<NEW_LINE>DataTypeDefinition type = new DefaultDataTypeDefinition(getDatabase(), getSchema(), parameter.getDataType(), parameter.getCharacterMaximumLength(), parameter.getNumericPrecision(), parameter.getNumericScale(), null, parameter.getParameterDefault());<NEW_LINE>ParameterDefinition p = new DefaultParameterDefinition(this, parameter.getParameterName(), parameter.getOrdinalPosition(), type, !StringUtils.isBlank(parameter.getParameterDefault()), StringUtils.isBlank(parameter.getParameterName()), parameter.getComment());<NEW_LINE>switch(parameter.getParameterMode()) {<NEW_LINE>case IN:<NEW_LINE>addParameter(InOutDefinition.IN, p);<NEW_LINE>break;<NEW_LINE>case INOUT:<NEW_LINE><MASK><NEW_LINE>break;<NEW_LINE>case OUT:<NEW_LINE>addParameter(InOutDefinition.OUT, p);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
addParameter(InOutDefinition.INOUT, p);
317,727
private void showPopup() {<NEW_LINE>if (!isShown()) {<NEW_LINE>// set popup to be always on top to be in front of all<NEW_LINE>// floating separate windows<NEW_LINE>popup = new JWindow();<NEW_LINE>popup.setAlwaysOnTop(true);<NEW_LINE>popup.getContentPane().add(switcher);<NEW_LINE>Dimension popupDim = switcher.getPreferredSize();<NEW_LINE>Rectangle screen = Utilities.getUsableScreenBounds();<NEW_LINE>int x = screen.x + ((screen.width / 2) - (popupDim.width / 2));<NEW_LINE>int y = screen.y + ((screen.height / 2) - <MASK><NEW_LINE>popup.setLocation(x, y);<NEW_LINE>popup.pack();<NEW_LINE>MenuSelectionManager.defaultManager().addChangeListener(new ChangeListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void stateChanged(ChangeEvent e) {<NEW_LINE>MenuSelectionManager.defaultManager().removeChangeListener(this);<NEW_LINE>hidePopup();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>popup.setVisible(true);<NEW_LINE>// #82743 - on JDK 1.5 popup steals focus from main window for a millisecond,<NEW_LINE>// so we have to delay attaching of focus listener<NEW_LINE>SwingUtilities.invokeLater(new Runnable() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void run() {<NEW_LINE>WindowManager.getDefault().getMainWindow().addWindowFocusListener(KeyboardPopupSwitcher.this);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>shown = true;<NEW_LINE>}<NEW_LINE>}
(popupDim.height / 2));
1,693,222
public final PrimaryContext commandPrimary() throws RecognitionException {<NEW_LINE>PrimaryContext _localctx = new PrimaryContext(_ctx, getState());<NEW_LINE><MASK><NEW_LINE>try {<NEW_LINE>setState(1547);<NEW_LINE>_errHandler.sync(this);<NEW_LINE>switch(_input.LA(1)) {<NEW_LINE>case AS:<NEW_LINE>case IN:<NEW_LINE>case TRAIT:<NEW_LINE>case VAR:<NEW_LINE>case CapitalizedIdentifier:<NEW_LINE>case Identifier:<NEW_LINE>_localctx = new IdentifierPrmrAltContext(_localctx);<NEW_LINE>enterOuterAlt(_localctx, 1);<NEW_LINE>{<NEW_LINE>setState(1544);<NEW_LINE>identifier();<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>case StringLiteral:<NEW_LINE>case IntegerLiteral:<NEW_LINE>case FloatingPointLiteral:<NEW_LINE>case BooleanLiteral:<NEW_LINE>case NullLiteral:<NEW_LINE>_localctx = new LiteralPrmrAltContext(_localctx);<NEW_LINE>enterOuterAlt(_localctx, 2);<NEW_LINE>{<NEW_LINE>setState(1545);<NEW_LINE>literal();<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>case GStringBegin:<NEW_LINE>_localctx = new GstringPrmrAltContext(_localctx);<NEW_LINE>enterOuterAlt(_localctx, 3);<NEW_LINE>{<NEW_LINE>setState(1546);<NEW_LINE>gstring();<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>throw new NoViableAltException(this);<NEW_LINE>}<NEW_LINE>} catch (RecognitionException re) {<NEW_LINE>_localctx.exception = re;<NEW_LINE>_errHandler.reportError(this, re);<NEW_LINE>_errHandler.recover(this, re);<NEW_LINE>} finally {<NEW_LINE>exitRule();<NEW_LINE>}<NEW_LINE>return _localctx;<NEW_LINE>}
enterRule(_localctx, 256, RULE_commandPrimary);
1,480,924
public void run(final FlowTrigger trigger, final Map data) {<NEW_LINE>taskProgress("create cdRoms");<NEW_LINE>final VmInstanceSpec spec = (VmInstanceSpec) data.get(VmInstanceConstant.Params.VmInstanceSpec.toString());<NEW_LINE>List<CdRomSpec> cdRomSpecs = spec.getCdRomSpecs();<NEW_LINE>if (cdRomSpecs.isEmpty()) {<NEW_LINE>trigger.next();<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>List<Integer> deviceIds = cdRomSpecs.stream().map(CdRomSpec::getDeviceId).distinct().collect(Collectors.toList());<NEW_LINE>if (deviceIds.size() < cdRomSpecs.size()) {<NEW_LINE>trigger.fail(operr("vm[uuid:%s] cdRom deviceId repetition", spec.getVmInventory().getUuid()));<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>List<VmCdRomVO> cdRomVOS = new ArrayList<>();<NEW_LINE>for (CdRomSpec cdRomSpec : cdRomSpecs) {<NEW_LINE>VmCdRomVO vmCdRomVO = new VmCdRomVO();<NEW_LINE>String cdRomUuid = cdRomSpec.getUuid() != null ? cdRomSpec.getUuid<MASK><NEW_LINE>cdRomSpec.setUuid(cdRomUuid);<NEW_LINE>String acntUuid = Account.getAccountUuidOfResource(spec.getVmInventory().getUuid());<NEW_LINE>vmCdRomVO.setVmInstanceUuid(spec.getVmInventory().getUuid());<NEW_LINE>vmCdRomVO.setUuid(cdRomUuid);<NEW_LINE>vmCdRomVO.setDeviceId(cdRomSpec.getDeviceId());<NEW_LINE>vmCdRomVO.setName(String.format("vm-%s-cdRom", spec.getVmInventory().getUuid()));<NEW_LINE>vmCdRomVO.setAccountUuid(acntUuid);<NEW_LINE>vmCdRomVO.setIsoUuid(cdRomSpec.getImageUuid());<NEW_LINE>cdRomVOS.add(vmCdRomVO);<NEW_LINE>}<NEW_LINE>persistCdRomVOS(cdRomVOS);<NEW_LINE>new IsoOperator().syncVmIsoSystemTag(spec.getVmInventory().getUuid());<NEW_LINE>trigger.next();<NEW_LINE>}
() : Platform.getUuid();
981,499
private static Fix finishFix(SuggestedFix baseFix, Type exceptionType, List<String> newAsserts, List<StatementTree> throwingStatements, VisitorState state) {<NEW_LINE>if (throwingStatements.isEmpty()) {<NEW_LINE>return baseFix;<NEW_LINE>}<NEW_LINE>SuggestedFix.Builder fix = SuggestedFix.builder().merge(baseFix);<NEW_LINE>fix.addStaticImport("org.junit.Assert.assertThrows");<NEW_LINE>StringBuilder fixPrefix = new StringBuilder();<NEW_LINE>String exceptionTypeName = SuggestedFixes.qualifyType(state, fix, exceptionType);<NEW_LINE>if (!newAsserts.isEmpty()) {<NEW_LINE>fixPrefix.append(String.format("%s thrown = ", exceptionTypeName));<NEW_LINE>}<NEW_LINE>fixPrefix.append("assertThrows");<NEW_LINE>fixPrefix.append(String.format("(%s.class, () -> ", exceptionTypeName));<NEW_LINE>boolean useExpressionLambda = throwingStatements.size() == 1 && getOnlyElement(throwingStatements)<MASK><NEW_LINE>if (!useExpressionLambda) {<NEW_LINE>fixPrefix.append("{");<NEW_LINE>}<NEW_LINE>fix.prefixWith(throwingStatements.get(0), fixPrefix.toString());<NEW_LINE>if (useExpressionLambda) {<NEW_LINE>fix.postfixWith(((ExpressionStatementTree) throwingStatements.get(0)).getExpression(), ")");<NEW_LINE>fix.postfixWith(getLast(throwingStatements), '\n' + Joiner.on('\n').join(newAsserts));<NEW_LINE>} else {<NEW_LINE>fix.postfixWith(getLast(throwingStatements), "});\n" + Joiner.on('\n').join(newAsserts));<NEW_LINE>}<NEW_LINE>return fix.build();<NEW_LINE>}
.getKind() == Kind.EXPRESSION_STATEMENT;
1,326,035
public void onQuotaStatus(QuotaStatusEvent event) {<NEW_LINE>QuotaStatus quotaStatus = event.getQuotaStatus();<NEW_LINE>// always show warning if the user is over quota<NEW_LINE>if (quotaStatus.isOverQuota()) {<NEW_LINE>long over = quotaStatus.getUsed() - quotaStatus.getQuota();<NEW_LINE>StringBuilder msg = new StringBuilder();<NEW_LINE>msg.append(constants_.onQuotaMessage(StringUtil.formatFileSize(over), StringUtil.formatFileSize(<MASK><NEW_LINE>globalDisplay_.showWarningBar(false, msg.toString());<NEW_LINE>} else // show a warning if the user is near their quota (but no more<NEW_LINE>// than one time per instantiation of the application)<NEW_LINE>if (quotaStatus.isNearQuota() && !nearQuotaWarningShown_) {<NEW_LINE>StringBuilder msg = new StringBuilder();<NEW_LINE>msg.append(constants_.quotaStatusMessage(StringUtil.formatFileSize(quotaStatus.getQuota())));<NEW_LINE>globalDisplay_.showWarningBar(false, msg.toString());<NEW_LINE>nearQuotaWarningShown_ = true;<NEW_LINE>}<NEW_LINE>}
quotaStatus.getQuota())));
235,735
public Map<String, String> provideLicensesByName(Context context) {<NEW_LINE>Map<String, String> byName = new HashMap<>();<NEW_LINE>byName.put(context.getString(R.string.license_name_cc0), Prefs.Licenses.CC0);<NEW_LINE>byName.put(context.getString(R.string.license_name_cc_by<MASK><NEW_LINE>byName.put(context.getString(R.string.license_name_cc_by_sa), Prefs.Licenses.CC_BY_SA_3);<NEW_LINE>byName.put(context.getString(R.string.license_name_cc_by_four), Prefs.Licenses.CC_BY_4);<NEW_LINE>byName.put(context.getString(R.string.license_name_cc_by_sa_four), Prefs.Licenses.CC_BY_SA_4);<NEW_LINE>return byName;<NEW_LINE>}
), Prefs.Licenses.CC_BY_3);
1,785,009
private void showAnalysisNotification(@NotNull String title, @NotNull String content, boolean isError) {<NEW_LINE>final ToolWindow dartProblemsView = ToolWindowManager.getInstance(myProject).getToolWindow(DartProblemsView.TOOLWINDOW_ID);<NEW_LINE>if (dartProblemsView != null && !dartProblemsView.isVisible()) {<NEW_LINE>content += " (<a href='open.analysis.view'>view issues</a>)";<NEW_LINE>}<NEW_LINE>final NotificationGroup notificationGroup = getNotificationGroup(DartProblemsView.TOOLWINDOW_ID);<NEW_LINE>final Notification notification = notificationGroup.createNotification(title, content, isError ? NotificationType.ERROR : NotificationType.INFORMATION, new NotificationListener.Adapter() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>protected void hyperlinkActivated(@NotNull final Notification notification, @NotNull final HyperlinkEvent e) {<NEW_LINE>notification.expire();<NEW_LINE>final ToolWindow dartProblemsView = ToolWindowManager.getInstance(myProject).getToolWindow(DartProblemsView.TOOLWINDOW_ID);<NEW_LINE>if (dartProblemsView != null) {<NEW_LINE>dartProblemsView.activate(null);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE><MASK><NEW_LINE>notification.notify(myProject);<NEW_LINE>lastNotification = notification;<NEW_LINE>}
notification.setIcon(FlutterIcons.Flutter);
77,499
protected void createA(List<AssociatedPair> points, DMatrixRMaj A) {<NEW_LINE>A.reshape(points.size(), 9, false);<NEW_LINE>A.zero();<NEW_LINE>Point2D_F64 f_norm = new Point2D_F64();<NEW_LINE>Point2D_F64 s_norm = new Point2D_F64();<NEW_LINE>final int size = points.size();<NEW_LINE>for (int i = 0; i < size; i++) {<NEW_LINE>AssociatedPair p = points.get(i);<NEW_LINE>Point2D_F64 f = p.p1;<NEW_LINE>Point2D_F64 s = p.p2;<NEW_LINE>// normalize the points<NEW_LINE>N1.apply(f, f_norm);<NEW_LINE>N2.apply(s, s_norm);<NEW_LINE>// perform the Kronecker product with the two points being in<NEW_LINE>// homogeneous coordinates (z=1)<NEW_LINE>A.unsafe_set(i, 0, s_norm.x * f_norm.x);<NEW_LINE>A.unsafe_set(i, 1, s_norm.x * f_norm.y);<NEW_LINE>A.unsafe_set(i, 2, s_norm.x);<NEW_LINE>A.unsafe_set(i, 3, s_norm.y * f_norm.x);<NEW_LINE>A.unsafe_set(i, 4, s_norm.y * f_norm.y);<NEW_LINE>A.unsafe_set(i, 5, s_norm.y);<NEW_LINE>A.unsafe_set(i, 6, f_norm.x);<NEW_LINE>A.unsafe_set(i, 7, f_norm.y);<NEW_LINE>A.<MASK><NEW_LINE>}<NEW_LINE>}
unsafe_set(i, 8, 1);
1,458,246
public void visit(Node<E> expr) {<NEW_LINE>assert expr != null;<NEW_LINE>if (expr instanceof ColumnReferenceNode<?, ?>) {<NEW_LINE>sb.append(((ColumnReferenceNode<?, ?>) expr).getColumn().getFullQualifiedName());<NEW_LINE>} else if (expr instanceof NewUnaryPostfixOperatorNode<?>) {<NEW_LINE>visit((NewUnaryPostfixOperatorNode<E>) expr);<NEW_LINE>} else if (expr instanceof NewUnaryPrefixOperatorNode<?>) {<NEW_LINE>visit((NewUnaryPrefixOperatorNode<E>) expr);<NEW_LINE>} else if (expr instanceof NewBinaryOperatorNode<?>) {<NEW_LINE>visit((NewBinaryOperatorNode<E>) expr);<NEW_LINE>} else if (expr instanceof TableReferenceNode<?, ?>) {<NEW_LINE>visit((TableReferenceNode<E, ?>) expr);<NEW_LINE>} else if (expr instanceof NewFunctionNode<?, ?>) {<NEW_LINE>visit((NewFunctionNode<E, ?>) expr);<NEW_LINE>} else if (expr instanceof NewBetweenOperatorNode<?>) {<NEW_LINE>visit((NewBetweenOperatorNode<E>) expr);<NEW_LINE>} else if (expr instanceof NewInOperatorNode<?>) {<NEW_LINE>visit(<MASK><NEW_LINE>} else if (expr instanceof NewCaseOperatorNode<?>) {<NEW_LINE>visit((NewCaseOperatorNode<E>) expr);<NEW_LINE>} else if (expr instanceof NewOrderingTerm<?>) {<NEW_LINE>visit((NewOrderingTerm<E>) expr);<NEW_LINE>} else if (expr instanceof NewAliasNode<?>) {<NEW_LINE>visit((NewAliasNode<E>) expr);<NEW_LINE>} else if (expr instanceof NewPostfixTextNode<?>) {<NEW_LINE>visit((NewPostfixTextNode<E>) expr);<NEW_LINE>} else if (expr instanceof NewTernaryNode<?>) {<NEW_LINE>visit((NewTernaryNode<E>) expr);<NEW_LINE>} else {<NEW_LINE>visitSpecific(expr);<NEW_LINE>}<NEW_LINE>}
(NewInOperatorNode<E>) expr);
1,344,815
public Pair<Expression, Concrete.Expression> visitLet(Concrete.LetExpression expr, Expression coreExpr) {<NEW_LINE>if (matchesSubExpr(expr))<NEW_LINE>return new Pair<>(coreExpr, expr);<NEW_LINE>var coreLetExpr = <MASK><NEW_LINE>if (coreLetExpr == null)<NEW_LINE>return nullWithError(SubExprError.mismatch(coreExpr));<NEW_LINE>List<Concrete.LetClause> exprClauses = expr.getClauses();<NEW_LINE>List<HaveClause> coreClauses = coreLetExpr.getClauses();<NEW_LINE>for (int i = 0; i < exprClauses.size(); i++) {<NEW_LINE>var accepted = visitLetClause(coreClauses.get(i), exprClauses.get(i));<NEW_LINE>if (accepted != null)<NEW_LINE>return accepted;<NEW_LINE>}<NEW_LINE>return expr.getExpression().accept(this, coreLetExpr.getExpression());<NEW_LINE>}
coreExpr.cast(LetExpression.class);
699,588
public boolean shouldCauseReequipAnimation(ItemStack oldStack, ItemStack newStack, boolean slotChanged) {<NEW_LINE>if (oldStack == newStack) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>// basic changes<NEW_LINE>if (slotChanged || oldStack.getItem() != newStack.getItem()) {<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>// if the tool props changed,<NEW_LINE>ToolStack oldTool = ToolStack.from(oldStack);<NEW_LINE>ToolStack newTool = ToolStack.from(newStack);<NEW_LINE>// check if modifiers or materials changed<NEW_LINE>if (!oldTool.getMaterials().equals(newTool.getMaterials())) {<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>if (!oldTool.getModifierList().equals(newTool.getModifierList())) {<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>// if the attributes changed, reequip<NEW_LINE>Multimap<Attribute, AttributeModifier> attributesNew = newStack.getAttributeModifiers(EquipmentSlot.MAINHAND);<NEW_LINE>Multimap<Attribute, AttributeModifier> attributesOld = oldStack.getAttributeModifiers(EquipmentSlot.MAINHAND);<NEW_LINE>if (attributesNew.size() != attributesOld.size()) {<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>for (Attribute attribute : attributesOld.keySet()) {<NEW_LINE>if (!attributesNew.containsKey(attribute)) {<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>Iterator<AttributeModifier> iter1 = attributesNew.<MASK><NEW_LINE>Iterator<AttributeModifier> iter2 = attributesOld.get(attribute).iterator();<NEW_LINE>while (iter1.hasNext() && iter2.hasNext()) {<NEW_LINE>if (!iter1.next().equals(iter2.next())) {<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// no changes, no reequip<NEW_LINE>return false;<NEW_LINE>}
get(attribute).iterator();
1,569,952
private static int buildConverters(List<TypeConverter> converters, Class<?>[] parameters, Class<?>[] arguments) {<NEW_LINE>int cost = 0;<NEW_LINE>int tempCost = -1;<NEW_LINE>int size = arguments.length;<NEW_LINE>for (int i = 0; i < size; i++) {<NEW_LINE>if (arguments[i] == null) {<NEW_LINE>if (parameters[i].isPrimitive()) {<NEW_LINE>tempCost = -1;<NEW_LINE>} else {<NEW_LINE>int distance = TypeUtil.computeDistance(new Object().getClass(), parameters[i]);<NEW_LINE>tempCost = Math.abs(MAX_DISTANCE - distance);<NEW_LINE>converters.add(TypeConverter.NO_CONVERTER);<NEW_LINE>}<NEW_LINE>} else if (parameters[i].isAssignableFrom(arguments[i])) {<NEW_LINE>tempCost = TypeUtil.computeDistance(parameters[i], arguments[i]);<NEW_LINE>converters.add(TypeConverter.NO_CONVERTER);<NEW_LINE>} else if (TypeUtil.isNumeric(parameters[i]) && TypeUtil.isNumeric(arguments[i])) {<NEW_LINE>tempCost = TypeUtil.computeNumericConversion(parameters[i]<MASK><NEW_LINE>} else if (TypeUtil.isCharacter(parameters[i])) {<NEW_LINE>tempCost = TypeUtil.computeCharacterConversion(parameters[i], arguments[i], converters);<NEW_LINE>} else if (TypeUtil.isBoolean(parameters[i]) && TypeUtil.isBoolean(arguments[i])) {<NEW_LINE>tempCost = 0;<NEW_LINE>converters.add(TypeConverter.NO_CONVERTER);<NEW_LINE>}<NEW_LINE>if (tempCost != -1) {<NEW_LINE>cost += tempCost;<NEW_LINE>tempCost = -1;<NEW_LINE>} else {<NEW_LINE>cost = -1;<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return cost;<NEW_LINE>}
, arguments[i], converters);
1,786,261
final DeleteMitigationActionResult executeDeleteMitigationAction(DeleteMitigationActionRequest deleteMitigationActionRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(deleteMitigationActionRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DeleteMitigationActionRequest> request = null;<NEW_LINE>Response<DeleteMitigationActionResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DeleteMitigationActionRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(deleteMitigationActionRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "IoT");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DeleteMitigationAction");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DeleteMitigationActionResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DeleteMitigationActionResultJsonUnmarshaller());<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.endEvent(Field.RequestMarshallTime);
1,350,507
protected void processHandlerMethodException(HandlerMethod handlerMethod, Exception exception, Message<?> message) {<NEW_LINE>InvocableHandlerMethod invocable = getExceptionHandlerMethod(handlerMethod, exception);<NEW_LINE>if (invocable == null) {<NEW_LINE>logger.error("Unhandled exception from message handler method", exception);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>invocable.setMessageMethodArgumentResolvers(this.argumentResolvers);<NEW_LINE>if (logger.isDebugEnabled()) {<NEW_LINE>logger.debug("Invoking " + invocable.getShortLogMessage());<NEW_LINE>}<NEW_LINE>try {<NEW_LINE><MASK><NEW_LINE>Object returnValue = (cause != null ? invocable.invoke(message, exception, cause, handlerMethod) : invocable.invoke(message, exception, handlerMethod));<NEW_LINE>MethodParameter returnType = invocable.getReturnType();<NEW_LINE>if (void.class == returnType.getParameterType()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>this.returnValueHandlers.handleReturnValue(returnValue, returnType, message);<NEW_LINE>} catch (Throwable ex2) {<NEW_LINE>logger.error("Error while processing handler method exception", ex2);<NEW_LINE>}<NEW_LINE>}
Throwable cause = exception.getCause();
946,421
public void visit(int version, int access, String name, String signature, String superName, String[] interfaces) {<NEW_LINE>// make the class public otherwise we can't call its static init converters<NEW_LINE>access &= ~(Opcodes.ACC_PRIVATE | Opcodes.ACC_PROTECTED);<NEW_LINE>access |= Opcodes.ACC_PUBLIC;<NEW_LINE>// if our supertype is already injectable we don't have to implement it again<NEW_LINE>if (!superTypeIsInjectable) {<NEW_LINE>String[] newInterfaces = new <MASK><NEW_LINE>newInterfaces[0] = QUARKUS_REST_INJECTION_TARGET_BINARY_NAME;<NEW_LINE>System.arraycopy(interfaces, 0, newInterfaces, 1, interfaces.length);<NEW_LINE>super.visit(version, access, name, signature, superName, newInterfaces);<NEW_LINE>} else {<NEW_LINE>super.visit(version, access, name, signature, superName, interfaces);<NEW_LINE>}<NEW_LINE>superTypeName = superName;<NEW_LINE>thisName = name;<NEW_LINE>}
String[interfaces.length + 1];
806,101
final ListDomainsResult executeListDomains(ListDomainsRequest listDomainsRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(listDomainsRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE><MASK><NEW_LINE>Request<ListDomainsRequest> request = null;<NEW_LINE>Response<ListDomainsResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new ListDomainsRequestMarshaller().marshall(super.beforeMarshalling(listDomainsRequest));<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, "SimpleDB");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ListDomains");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>StaxResponseHandler<ListDomainsResult> responseHandler = new com.amazonaws.services.simpledb.internal.SimpleDBStaxResponseHandler<ListDomainsResult>(new ListDomainsResultStaxUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
1,527,515
protected int initialAssignToNearestCluster() {<NEW_LINE>assert k == means.length;<NEW_LINE>double[][] sep2 = new double[k][k];<NEW_LINE>computeSquaredSeparation(sep2);<NEW_LINE>for (DBIDIter it = relation.iterDBIDs(); it.valid(); it.advance()) {<NEW_LINE>NumberVector fv = relation.get(it);<NEW_LINE>// Find closest center, and distance to two closest centers<NEW_LINE>double min1 = distance(fv, means[0]), min2 = k > 1 ? distance(fv, means[1]) : min1;<NEW_LINE>int minIndex = 0, secIndex = 1;<NEW_LINE>if (min2 < min1) {<NEW_LINE>double tmp = min1;<NEW_LINE>min1 = min2;<NEW_LINE>min2 = tmp;<NEW_LINE>minIndex = 1;<NEW_LINE>secIndex = 0;<NEW_LINE>}<NEW_LINE>for (int i = 2; i < k; i++) {<NEW_LINE>if (min2 > sep2[minIndex][i]) {<NEW_LINE>double dist = distance(fv, means[i]);<NEW_LINE>if (dist < min1) {<NEW_LINE>secIndex = minIndex;<NEW_LINE>minIndex = i;<NEW_LINE>min2 = min1;<NEW_LINE>min1 = dist;<NEW_LINE>} else if (dist < min2) {<NEW_LINE>secIndex = i;<NEW_LINE>min2 = dist;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Assign to nearest cluster.<NEW_LINE>clusters.get(minIndex).add(it);<NEW_LINE>assignment.putInt(it, minIndex);<NEW_LINE>second.putInt(it, secIndex);<NEW_LINE>plusEquals(sums[minIndex], fv);<NEW_LINE>upper.putDouble(it, isSquared ? Math.sqrt(min1) : min1);<NEW_LINE>lower.putDouble(it, isSquared ? Math<MASK><NEW_LINE>}<NEW_LINE>return relation.size();<NEW_LINE>}
.sqrt(min2) : min2);
389,913
private void resize() {<NEW_LINE>final byte[] oldKeysArr = keysArr_;<NEW_LINE>final short[] oldCouponsArr = couponsArr_;<NEW_LINE>final byte[] oldStateArr = stateArr_;<NEW_LINE>final int oldTableEntries = tableEntries_;<NEW_LINE>tableEntries_ = nextPrime((int) (curCountEntries_ / COUPON_MAP_TARGET_FILL_FACTOR));<NEW_LINE>capacityEntries_ = <MASK><NEW_LINE>keysArr_ = new byte[tableEntries_ * keySizeBytes_];<NEW_LINE>couponsArr_ = new short[tableEntries_];<NEW_LINE>stateArr_ = new byte[(int) Math.ceil(tableEntries_ / 8.0)];<NEW_LINE>entrySizeBytes_ = updateEntrySizeBytes(tableEntries_, keySizeBytes_);<NEW_LINE>// move the data<NEW_LINE>for (int i = 0; i < oldTableEntries; i++) {<NEW_LINE>if (oldCouponsArr[i] != 0) {<NEW_LINE>final byte[] key = Arrays.copyOfRange(oldKeysArr, i * keySizeBytes_, i * keySizeBytes_ + keySizeBytes_);<NEW_LINE>insertEntry(key, oldCouponsArr[i], isBitSet(oldStateArr, i));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
(int) (tableEntries_ * COUPON_MAP_GROW_TRIGGER_FACTOR);
785,445
public void addParams(CommandArguments args) {<NEW_LINE>if (type != null) {<NEW_LINE>args.add(SearchKeyword.ON.name());<NEW_LINE>args.add(type.name());<NEW_LINE>}<NEW_LINE>if (async) {<NEW_LINE>args.add(SearchKeyword.ASYNC.name());<NEW_LINE>}<NEW_LINE>if (prefixes != null && prefixes.length > 0) {<NEW_LINE>args.add(SearchKeyword.PREFIX.name());<NEW_LINE>args.add(Integer<MASK><NEW_LINE>args.addObjects((Object[]) prefixes);<NEW_LINE>}<NEW_LINE>if (filter != null) {<NEW_LINE>args.add(SearchKeyword.FILTER.name());<NEW_LINE>args.add(filter);<NEW_LINE>}<NEW_LINE>if (languageField != null) {<NEW_LINE>args.add(SearchKeyword.LANGUAGE_FIELD.name());<NEW_LINE>args.add(languageField);<NEW_LINE>}<NEW_LINE>if (language != null) {<NEW_LINE>args.add(SearchKeyword.LANGUAGE.name());<NEW_LINE>args.add(language);<NEW_LINE>}<NEW_LINE>if (scoreFiled != null) {<NEW_LINE>args.add(SearchKeyword.SCORE_FIELD.name());<NEW_LINE>args.add(scoreFiled);<NEW_LINE>}<NEW_LINE>if (score != 1.0) {<NEW_LINE>args.add(SearchKeyword.SCORE.name());<NEW_LINE>args.add(Double.toString(score));<NEW_LINE>}<NEW_LINE>if (payloadField != null) {<NEW_LINE>args.add(SearchKeyword.PAYLOAD_FIELD.name());<NEW_LINE>args.add(payloadField);<NEW_LINE>}<NEW_LINE>}
.toString(prefixes.length));
785,410
private void uuidChanged(String fromUuid, String toUuid) {<NEW_LINE>if (ActFmInvoker.SYNC_DEBUG)<NEW_LINE>Log.e(ERROR_TAG, "Task UUID collision -- old uuid: " + fromUuid + ", new uuid: " + toUuid);<NEW_LINE>// Update reference from UserActivity to task uuid<NEW_LINE>UserActivityDao activityDao = PluginServices.getUserActivityDao();<NEW_LINE>UserActivity activityTemplate = new UserActivity();<NEW_LINE>activityTemplate.setValue(UserActivity.TARGET_ID, toUuid);<NEW_LINE>activityTemplate.putTransitory(SyncFlags.ACTFM_SUPPRESS_OUTSTANDING_ENTRIES, true);<NEW_LINE>activityDao.update(Criterion.and(UserActivity.ACTION.eq(UserActivity.ACTION_TASK_COMMENT), UserActivity.TARGET_ID.<MASK><NEW_LINE>// Update reference from task to tag metadata to task uuid<NEW_LINE>MetadataService metadataService = PluginServices.getMetadataService();<NEW_LINE>Metadata taskToTagTemplate = new Metadata();<NEW_LINE>taskToTagTemplate.setValue(TaskToTagMetadata.TASK_UUID, toUuid);<NEW_LINE>taskToTagTemplate.putTransitory(SyncFlags.ACTFM_SUPPRESS_OUTSTANDING_ENTRIES, true);<NEW_LINE>metadataService.update(Criterion.and(MetadataCriteria.withKey(TaskToTagMetadata.KEY), TaskToTagMetadata.TASK_UUID.eq(fromUuid)), taskToTagTemplate);<NEW_LINE>HistoryDao historyDao = PluginServices.getHistoryDao();<NEW_LINE>History histTemplate = new History();<NEW_LINE>histTemplate.setValue(History.TARGET_ID, toUuid);<NEW_LINE>historyDao.update(Criterion.and(History.TABLE_ID.eq(NameMaps.TABLE_ID_TAGS), History.TARGET_ID.eq(oldUuid)), histTemplate);<NEW_LINE>}
eq(fromUuid)), activityTemplate);
97,995
public void paint(Graphics2D g) {<NEW_LINE>if (!chart.getStyler().isLegendVisible()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (chart.getSeriesMap().isEmpty()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// if the area to draw a chart on is so small, don't even bother<NEW_LINE>if (chart.getPlot().getBounds().getWidth() < 30) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>Rectangle2D bounds = getBounds();<NEW_LINE>switch(chart.getStyler().getLegendPosition()) {<NEW_LINE>case OutsideE:<NEW_LINE>xOffset = chart.getWidth() - bounds.getWidth() - LEGEND_MARGIN;<NEW_LINE>yOffset = chart.getPlot().getBounds().getY() + (chart.getPlot().getBounds().getHeight() - <MASK><NEW_LINE>break;<NEW_LINE>case OutsideS:<NEW_LINE>xOffset = chart.getPlot().getBounds().getX() + (chart.getPlot().getBounds().getWidth() - bounds.getWidth()) / 2.0;<NEW_LINE>yOffset = chart.getHeight() - bounds.getHeight() - LEGEND_MARGIN;<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>// draw legend box background and border<NEW_LINE>Shape rect = new Rectangle2D.Double(xOffset, yOffset, bounds.getWidth(), bounds.getHeight());<NEW_LINE>g.setColor(chart.getStyler().getLegendBackgroundColor());<NEW_LINE>g.fill(rect);<NEW_LINE>g.setStroke(SOLID_STROKE);<NEW_LINE>g.setColor(chart.getStyler().getLegendBorderColor());<NEW_LINE>g.draw(rect);<NEW_LINE>doPaint(g);<NEW_LINE>}
bounds.getHeight()) / 2.0;
251,401
public void run() throws Exception {<NEW_LINE>Map<Function<MASK><NEW_LINE>DecompilerCallback<Void> callback = new DecompilerCallback<Void>(currentProgram, new SwitchAnalysisDecompileConfigurer(currentProgram)) {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public Void process(DecompileResults results, TaskMonitor m) throws Exception {<NEW_LINE>Function func = results.getFunction();<NEW_LINE>DecompilerSwitchAnalysisCmd cmd = new DecompilerSwitchAnalysisCmd(results);<NEW_LINE>cmd.applyTo(currentProgram);<NEW_LINE>Instruction instr = instructionsByFunction.get(func);<NEW_LINE>BookmarkEditCmd bmcmd = new BookmarkEditCmd(instr.getMinAddress(), BookmarkType.INFO, "FixSwitchStatementsWithDecompiler", "Fixed switch stmt");<NEW_LINE>bmcmd.applyTo(currentProgram);<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>};<NEW_LINE>Set<Function> functions = instructionsByFunction.keySet();<NEW_LINE>try {<NEW_LINE>ParallelDecompiler.decompileFunctions(callback, functions, monitor);<NEW_LINE>} finally {<NEW_LINE>callback.dispose();<NEW_LINE>}<NEW_LINE>}
, Instruction> instructionsByFunction = filterFunctions();
1,738,043
public Sequence list(VDB vdb, String opt) {<NEW_LINE>ArchiveDir[] subDirs = this.subDirs;<NEW_LINE>if (subDirs == null) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>int size = subDirs.length;<NEW_LINE>Sequence seq = new Sequence(size);<NEW_LINE>boolean listFiles = true, listDirs = false;<NEW_LINE>if (opt != null) {<NEW_LINE>if (opt.indexOf('w') != -1) {<NEW_LINE>listFiles = false;<NEW_LINE>} else if (opt.indexOf('d') != -1) {<NEW_LINE>listDirs = true;<NEW_LINE>listFiles = false;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>for (int i = 0; i < size; ++i) {<NEW_LINE>if (listFiles) {<NEW_LINE>if (subDirs[i].isFile()) {<NEW_LINE>ArchiveSection section = subDirs[i].getSection(vdb.getLibrary());<NEW_LINE>seq.add(new VS(vdb, section));<NEW_LINE>}<NEW_LINE>} else if (listDirs) {<NEW_LINE>if (subDirs[i].isDir()) {<NEW_LINE>ArchiveSection section = subDirs[i].getSection(vdb.getLibrary());<NEW_LINE>seq.add(<MASK><NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>ArchiveSection section = subDirs[i].getSection(vdb.getLibrary());<NEW_LINE>seq.add(new VS(vdb, section));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return seq;<NEW_LINE>}
new VS(vdb, section));
505,307
private void checkConsumedAndProducedValues(Instruction ins, ValueNumber[] consumedValueList, ValueNumber[] producedValueList) {<NEW_LINE>int numConsumed = <MASK><NEW_LINE>int numProduced = ins.produceStack(getCPG());<NEW_LINE>if (numConsumed == Constants.UNPREDICTABLE) {<NEW_LINE>throw new InvalidBytecodeException("Unpredictable stack consumption for " + ins);<NEW_LINE>}<NEW_LINE>if (numProduced == Constants.UNPREDICTABLE) {<NEW_LINE>throw new InvalidBytecodeException("Unpredictable stack production for " + ins);<NEW_LINE>}<NEW_LINE>if (consumedValueList.length != numConsumed) {<NEW_LINE>throw new IllegalStateException("Wrong number of values consumed for " + ins + ": expected " + numConsumed + ", got " + consumedValueList.length);<NEW_LINE>}<NEW_LINE>if (producedValueList.length != numProduced) {<NEW_LINE>throw new IllegalStateException("Wrong number of values produced for " + ins + ": expected " + numProduced + ", got " + producedValueList.length);<NEW_LINE>}<NEW_LINE>}
ins.consumeStack(getCPG());
1,218,110
public void processFrame(T image) {<NEW_LINE>if (detector.getRequiresGradient()) {<NEW_LINE>if (derivX == null) {<NEW_LINE>derivX = GeneralizedImageOps.createSingleBand(derivType, <MASK><NEW_LINE>derivY = GeneralizedImageOps.createSingleBand(derivType, image.width, image.height);<NEW_LINE>}<NEW_LINE>// compute the image gradient<NEW_LINE>GImageDerivativeOps.gradient(DerivativeType.SOBEL, image, derivX, derivY, BoofDefaults.DERIV_BORDER_TYPE);<NEW_LINE>}<NEW_LINE>if (detector.getRequiresHessian()) {<NEW_LINE>if (derivXX == null) {<NEW_LINE>derivXX = GeneralizedImageOps.createSingleBand(derivType, image.width, image.height);<NEW_LINE>derivYY = GeneralizedImageOps.createSingleBand(derivType, image.width, image.height);<NEW_LINE>derivXY = GeneralizedImageOps.createSingleBand(derivType, image.width, image.height);<NEW_LINE>}<NEW_LINE>// compute the image gradient<NEW_LINE>GImageDerivativeOps.hessian(DerivativeType.THREE, image, derivXX, derivYY, derivXY, BoofDefaults.DERIV_BORDER_TYPE);<NEW_LINE>}<NEW_LINE>detector.process(image, derivX, derivY, derivXX, derivYY, derivXY);<NEW_LINE>corners = detector.getMaximums();<NEW_LINE>}
image.width, image.height);
584,561
private static List<? extends TypeMirror> computeEnhancedForLoop(Set<ElementKind> types, CompilationInfo info, TreePath parent, Tree error, int offset) {<NEW_LINE>EnhancedForLoopTree efl = (EnhancedForLoopTree) parent.getLeaf();<NEW_LINE>if (efl.getExpression() != error) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>TypeMirror argument = info.getTrees().getTypeMirror(new TreePath(new TreePath(parent, efl.getVariable()), efl.getVariable().getType()));<NEW_LINE>if (argument == null)<NEW_LINE>return null;<NEW_LINE>if (argument.getKind().isPrimitive()) {<NEW_LINE>types.add(ElementKind.PARAMETER);<NEW_LINE>types.add(ElementKind.LOCAL_VARIABLE);<NEW_LINE>types.add(ElementKind.FIELD);<NEW_LINE>return Collections.singletonList(info.getTypes().getArrayType(argument));<NEW_LINE>}<NEW_LINE>// NOI18N<NEW_LINE>TypeElement iterable = info.getElements().getTypeElement("java.lang.Iterable");<NEW_LINE>if (iterable == null) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>types.add(ElementKind.PARAMETER);<NEW_LINE>types.add(ElementKind.LOCAL_VARIABLE);<NEW_LINE><MASK><NEW_LINE>return Collections.singletonList(info.getTypes().getDeclaredType(iterable, argument));<NEW_LINE>}
types.add(ElementKind.FIELD);
1,506,629
final CreateTableResult executeCreateTable(CreateTableRequest createTableRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(createTableRequest);<NEW_LINE><MASK><NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<CreateTableRequest> request = null;<NEW_LINE>Response<CreateTableResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new CreateTableRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(createTableRequest));<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, "Timestream Write");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "CreateTable");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>URI cachedEndpoint = null;<NEW_LINE>if (endpointDiscoveryEnabled) {<NEW_LINE>DescribeEndpointsRequest discoveryRequest = new DescribeEndpointsRequest();<NEW_LINE>cachedEndpoint = cache.get(awsCredentialsProvider.getCredentials().getAWSAccessKeyId(), discoveryRequest, true, endpoint);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<CreateTableResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new CreateTableResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext, cachedEndpoint, null);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
302,991
public void updateClientConfiguration(ClientConfiguration clientConfig, RemoteFile file) throws Exception {<NEW_LINE>// write contents to a temporary file<NEW_LINE>RemoteFile newClientFile = LibertyFileManager.createRemoteFile(machine, getClientConfigurationPath() + ".tmp");<NEW_LINE>OutputStream os = newClientFile.openForWriting(false);<NEW_LINE>ClientConfigurationFactory.getInstance().marshal(clientConfig, os);<NEW_LINE>if (newClientFile.length() == file.length()) {<NEW_LINE>clientConfig.setDescription(clientConfig.getDescription() + " (this is some random text to make the file size bigger)");<NEW_LINE>os = newClientFile.openForWriting(false);<NEW_LINE>ClientConfigurationFactory.getInstance(<MASK><NEW_LINE>}<NEW_LINE>// replace the file<NEW_LINE>// This logic does not need to be time protected (as we do in method<NEW_LINE>// replaceClientConfiguration) because of the "extra random text" logic<NEW_LINE>// above. Even if the timestamp would not be changed, the size out be.<NEW_LINE>LibertyFileManager.moveLibertyFile(newClientFile, file);<NEW_LINE>if (LOG.isLoggable(Level.INFO)) {<NEW_LINE>LOG.info("Client configuration updated:");<NEW_LINE>logClientConfiguration(Level.INFO, false);<NEW_LINE>}<NEW_LINE>}
).marshal(clientConfig, os);
997,091
private void writeBinding(JndiBinding binding) throws IOException {<NEW_LINE>write("<td>");<NEW_LINE>final String name = binding.getName();<NEW_LINE>final String className = binding.getClassName();<NEW_LINE>final String contextPath = binding.getContextPath();<NEW_LINE>final String value = binding.getValue();<NEW_LINE>if (contextPath != null) {<NEW_LINE>writeDirectly("<a href=\"?part=jndi&amp;path=" <MASK><NEW_LINE>writeDirectly("<img width='16' height='16' src='?resource=folder.png' alt='" + urlEncode(name) + "' />&nbsp;");<NEW_LINE>writeDirectly(htmlEncode(name));<NEW_LINE>writeDirectly("</a>");<NEW_LINE>} else {<NEW_LINE>writeDirectly(htmlEncode(name));<NEW_LINE>}<NEW_LINE>write("</td>");<NEW_LINE>write("<td>");<NEW_LINE>writeDirectly(className != null ? htmlEncode(className) : "&nbsp;");<NEW_LINE>write("</td>");<NEW_LINE>write("<td>");<NEW_LINE>writeDirectly(value != null ? htmlEncodeButNotSpace(value) : "&nbsp;");<NEW_LINE>write("</td>");<NEW_LINE>}
+ urlEncode(contextPath) + "\">");
1,522,421
public IRubyObject squeeze_bang(ThreadContext context, IRubyObject[] args) {<NEW_LINE>if (value.getRealSize() == 0) {<NEW_LINE>modifyCheck();<NEW_LINE>return context.nil;<NEW_LINE>}<NEW_LINE>final Ruby runtime = context.runtime;<NEW_LINE>RubyString otherStr = args[0].convertToString();<NEW_LINE>Encoding enc = checkEncoding(otherStr);<NEW_LINE>final boolean[] squeeze = new boolean[StringSupport.TRANS_SIZE + 1];<NEW_LINE>StringSupport.TrTables tables = StringSupport.trSetupTable(otherStr.value, runtime, <MASK><NEW_LINE>boolean singleByte = singleByteOptimizable() && otherStr.singleByteOptimizable();<NEW_LINE>for (int i = 1; i < args.length; i++) {<NEW_LINE>otherStr = args[i].convertToString();<NEW_LINE>enc = checkEncoding(otherStr);<NEW_LINE>singleByte = singleByte && otherStr.singleByteOptimizable();<NEW_LINE>tables = StringSupport.trSetupTable(otherStr.value, runtime, squeeze, tables, false, enc);<NEW_LINE>}<NEW_LINE>modifyAndKeepCodeRange();<NEW_LINE>if (singleByte) {<NEW_LINE>if (!StringSupport.singleByteSqueeze(value, squeeze)) {<NEW_LINE>return context.nil;<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>if (!StringSupport.multiByteSqueeze(runtime, value, squeeze, tables, enc, true)) {<NEW_LINE>return context.nil;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return this;<NEW_LINE>}
squeeze, null, true, enc);
908,639
private void restoreCurrentMap(boolean checkAlternatives) throws FileNotFoundException, IOException, URISyntaxException, XMLException {<NEW_LINE>final Controller controller = Controller.getCurrentController();<NEW_LINE>final MapModel map = controller.getMap();<NEW_LINE>final URL url = map.getURL();<NEW_LINE>if (url == null) {<NEW_LINE>UITools.errorMessage(TextUtils.getText("map_not_saved"));<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (map.containsExtension(DocuMapAttribute.class)) {<NEW_LINE>closeWithoutSaving(map);<NEW_LINE>openDocumentationMap(url);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final URL alternativeURL = checkAlternatives ? MFileManager.getController(getMModeController()).getAlternativeURL(<MASK><NEW_LINE>if (alternativeURL == null)<NEW_LINE>return;<NEW_LINE>controller.getViewController().setWaitingCursor(true);<NEW_LINE>try {<NEW_LINE>map.releaseResources();<NEW_LINE>final MMapModel newModel = new MMapModel(duplicator());<NEW_LINE>((MFileManager) MFileManager.getController()).loadAndLock(alternativeURL, newModel);<NEW_LINE>newModel.setURL(url);<NEW_LINE>newModel.setSaved(alternativeURL.equals(url));<NEW_LINE>fireMapCreated(newModel);<NEW_LINE>addLoadedMap(newModel);<NEW_LINE>closeWithoutSaving(map);<NEW_LINE>newModel.enableAutosave();<NEW_LINE>createMapView(newModel);<NEW_LINE>return;<NEW_LINE>} finally {<NEW_LINE>controller.getViewController().setWaitingCursor(false);<NEW_LINE>}<NEW_LINE>}
url, AlternativeFileMode.ALL) : url;
1,524,056
private void importApp(String appInfo, List<Env> importEnvs, String operator) {<NEW_LINE>App toImportApp = gson.fromJson(appInfo, App.class);<NEW_LINE>String appId = toImportApp.getAppId();<NEW_LINE>toImportApp.setDataChangeCreatedBy(operator);<NEW_LINE>toImportApp.setDataChangeLastModifiedBy(operator);<NEW_LINE>toImportApp.setDataChangeCreatedTime(new Date());<NEW_LINE>toImportApp<MASK><NEW_LINE>App managedApp = appService.load(appId);<NEW_LINE>if (managedApp == null) {<NEW_LINE>appService.importAppInLocal(toImportApp);<NEW_LINE>}<NEW_LINE>importEnvs.parallelStream().forEach(env -> {<NEW_LINE>try {<NEW_LINE>appService.load(env, appId);<NEW_LINE>} catch (Exception e) {<NEW_LINE>// not existed<NEW_LINE>appService.createAppInRemote(env, toImportApp);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}
.setDataChangeLastModifiedTime(new Date());
1,280,965
final DescribeQueryResult executeDescribeQuery(DescribeQueryRequest describeQueryRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(describeQueryRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DescribeQueryRequest> request = null;<NEW_LINE>Response<DescribeQueryResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DescribeQueryRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(describeQueryRequest));<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, "CloudTrail");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DescribeQuery");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DescribeQueryResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DescribeQueryResultJsonUnmarshaller());<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());
412,647
public static NcrackRun parse(InputStream stream) throws IOException {<NEW_LINE>BufferedReader reader = new BufferedReader(new InputStreamReader(stream, UTF_8));<NEW_LINE>ImmutableList.Builder<DiscoveredCredential<MASK><NEW_LINE>String line;<NEW_LINE>while ((line = reader.readLine()) != null) {<NEW_LINE>Matcher matcher = CREDENTIAL_LINE_PATTERN.matcher(line);<NEW_LINE>if (matcher.find()) {<NEW_LINE>String ip = matcher.group("ip");<NEW_LINE>int port = Integer.parseInt(matcher.group("port"));<NEW_LINE>String protocol = matcher.group("protocol");<NEW_LINE>String service = matcher.group("service");<NEW_LINE>Optional<String> username = Optional.ofNullable(matcher.group("username"));<NEW_LINE>Optional<String> password = Optional.ofNullable(matcher.group("password"));<NEW_LINE>logger.atInfo().log("Ncrack identified known credentials on '%s' port '%d' for '%s' service and '%s'" + " protocol, username = '%s', password = '%s'.", ip, port, service, protocol, username.orElse(""), password.orElse(""));<NEW_LINE>credentialBuilder.add(DiscoveredCredential.builder().setNetworkEndpoint(createNetworkEndpoint(ip, port)).setService(service).setUsername(username).setPassword(password).build());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return NcrackRun.create(credentialBuilder.build());<NEW_LINE>}
> credentialBuilder = ImmutableList.builder();
531,597
private static void notifyReplicatorStatusListener(final Replicator replicator, final ReplicatorEvent event, final Status status, final ReplicatorState newState) {<NEW_LINE>final ReplicatorOptions replicatorOpts = Requires.requireNonNull(replicator.getOpts(), "replicatorOptions");<NEW_LINE>final Node node = Requires.requireNonNull(replicatorOpts.getNode(), "node");<NEW_LINE>final PeerId peer = Requires.requireNonNull(replicatorOpts.getPeerId(), "peer");<NEW_LINE>final List<ReplicatorStateListener> listenerList = node.getReplicatorStatueListeners();<NEW_LINE>for (int i = 0; i < listenerList.size(); i++) {<NEW_LINE>final ReplicatorStateListener listener = listenerList.get(i);<NEW_LINE>if (listener != null) {<NEW_LINE>try {<NEW_LINE>switch(event) {<NEW_LINE>case CREATED:<NEW_LINE>RpcUtils.runInThread(() -> listener.onCreated(peer));<NEW_LINE>break;<NEW_LINE>case ERROR:<NEW_LINE>RpcUtils.runInThread(() -> listener.onError(peer, status));<NEW_LINE>break;<NEW_LINE>case DESTROYED:<NEW_LINE>RpcUtils.runInThread(() -> listener.onDestroyed(peer));<NEW_LINE>break;<NEW_LINE>case STATE_CHANGED:<NEW_LINE>RpcUtils.runInThread(() -> listener.stateChanged(peer, newState));<NEW_LINE>default:<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>} catch (final Exception e) {<NEW_LINE>LOG.<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
error("Fail to notify ReplicatorStatusListener, listener={}, event={}.", listener, event);
478,729
private void onStyleLoaded(final Style style) {<NEW_LINE>if (modifyLocationButton.getVisibility() == View.VISIBLE) {<NEW_LINE>initDroppedMarker(style);<NEW_LINE>adjustCameraBasedOnOptions();<NEW_LINE>enableLocationComponent(style);<NEW_LINE>if (style.getLayer(DROPPED_MARKER_LAYER_ID) != null) {<NEW_LINE>final GeoJsonSource source = style.getSourceAs("dropped-marker-source-id");<NEW_LINE>if (source != null) {<NEW_LINE>source.setGeoJson(Point.fromLngLat(cameraPosition.target.getLongitude(), cameraPosition.target.getLatitude()));<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>if (droppedMarkerLayer != null) {<NEW_LINE>droppedMarkerLayer.setProperties(visibility(VISIBLE));<NEW_LINE>markerImage.setVisibility(View.GONE);<NEW_LINE>shadow.setVisibility(View.GONE);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>adjustCameraBasedOnOptions();<NEW_LINE>enableLocationComponent(style);<NEW_LINE>bindListeners();<NEW_LINE>}<NEW_LINE>modifyLocationButton.setOnClickListener(v -> onClickModifyLocation());<NEW_LINE>showInMapButton.setOnClickListener(v -> showInMap());<NEW_LINE>}
droppedMarkerLayer = style.getLayer(DROPPED_MARKER_LAYER_ID);
1,646,566
public static QueryPackHistoriesResponse unmarshall(QueryPackHistoriesResponse queryPackHistoriesResponse, UnmarshallerContext _ctx) {<NEW_LINE>queryPackHistoriesResponse.setRequestId(_ctx.stringValue("QueryPackHistoriesResponse.RequestId"));<NEW_LINE>List<PackInfo> packInfos = new ArrayList<PackInfo>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("QueryPackHistoriesResponse.PackInfos.Length"); i++) {<NEW_LINE>PackInfo packInfo = new PackInfo();<NEW_LINE>packInfo.setOS(_ctx.stringValue("QueryPackHistoriesResponse.PackInfos[" + i + "].OS"));<NEW_LINE>packInfo.setStatus(_ctx.integerValue("QueryPackHistoriesResponse.PackInfos[" + i + "].Status"));<NEW_LINE>packInfo.setTaskId(_ctx.stringValue("QueryPackHistoriesResponse.PackInfos[" + i + "].TaskId"));<NEW_LINE>packInfo.setCreateTime(_ctx.stringValue<MASK><NEW_LINE>packInfo.setInfo(_ctx.stringValue("QueryPackHistoriesResponse.PackInfos[" + i + "].Info"));<NEW_LINE>packInfos.add(packInfo);<NEW_LINE>}<NEW_LINE>queryPackHistoriesResponse.setPackInfos(packInfos);<NEW_LINE>return queryPackHistoriesResponse;<NEW_LINE>}
("QueryPackHistoriesResponse.PackInfos[" + i + "].CreateTime"));
579,493
private Query<Integer> tableID() {<NEW_LINE>String sql = SELECT + ExtensionTableProviderTable.ID + FROM + ExtensionTableProviderTable.TABLE_NAME + WHERE + ExtensionTableProviderTable.PROVIDER_NAME + "=?" + AND + ExtensionTableProviderTable.PLUGIN_ID <MASK><NEW_LINE>return new QueryStatement<Integer>(sql) {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void prepare(PreparedStatement statement) throws SQLException {<NEW_LINE>ExtensionTableProviderTable.set3PluginValuesToStatement(statement, 1, providerName, pluginName, serverUUID);<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public Integer processResults(ResultSet set) throws SQLException {<NEW_LINE>if (set.next()) {<NEW_LINE>int id = set.getInt(ExtensionTableProviderTable.ID);<NEW_LINE>if (!set.wasNull()) {<NEW_LINE>return id;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>throw new DBOpException("Table Provider was not saved before storing results. Please report this issue. Extension method: " + pluginName + "#" + providerName);<NEW_LINE>}<NEW_LINE>};<NEW_LINE>}
+ "=" + ExtensionPluginTable.STATEMENT_SELECT_PLUGIN_ID + " LIMIT 1";
943,074
private JsonObject toJsonFromRequestObj(UserInfo ui, Set<String> scope, JsonObject authorizedClaims, JsonObject requestedClaims) {<NEW_LINE>// get the base object<NEW_LINE>JsonObject obj = ui.toJson();<NEW_LINE>Set<String> allowedByScope = translator.getClaimsForScopeSet(scope);<NEW_LINE>Set<<MASK><NEW_LINE>Set<String> requestedByClaims = extractUserInfoClaimsIntoSet(requestedClaims);<NEW_LINE>// Filter claims by performing a manual intersection of claims that are allowed by the given scope, requested, and authorized.<NEW_LINE>// We cannot use Sets.intersection() or similar because Entry<> objects will evaluate to being unequal if their values are<NEW_LINE>// different, whereas we are only interested in matching the Entry<>'s key values.<NEW_LINE>JsonObject result = new JsonObject();<NEW_LINE>for (Entry<String, JsonElement> entry : obj.entrySet()) {<NEW_LINE>if (allowedByScope.contains(entry.getKey()) || authorizedByClaims.contains(entry.getKey())) {<NEW_LINE>// it's allowed either by scope or by the authorized claims (either way is fine with us)<NEW_LINE>if (requestedByClaims.isEmpty() || requestedByClaims.contains(entry.getKey())) {<NEW_LINE>// the requested claims are empty (so we allow all), or they're not empty and this claim was specifically asked for<NEW_LINE>result.add(entry.getKey(), entry.getValue());<NEW_LINE>}<NEW_LINE>// otherwise there were specific claims requested and this wasn't one of them<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>}
String> authorizedByClaims = extractUserInfoClaimsIntoSet(authorizedClaims);
428,643
public static String makeBetterErrorString(String msg, SAXParseException ex) {<NEW_LINE>StringBuilder sb = new StringBuilder(msg);<NEW_LINE>sb.append(": ");<NEW_LINE>String str = ex.getMessage();<NEW_LINE>if (str.lastIndexOf('.') == str.length() - 1) {<NEW_LINE>str = str.substring(0, str.length() - 1);<NEW_LINE>}<NEW_LINE>sb.append(str);<NEW_LINE>sb.append(" at document line ").append(ex.getLineNumber());<NEW_LINE>sb.append(", column ").append(ex.getColumnNumber());<NEW_LINE>if (ex.getSystemId() != null) {<NEW_LINE>sb.append(" in entity from systemID ").<MASK><NEW_LINE>} else if (ex.getPublicId() != null) {<NEW_LINE>sb.append(" in entity from publicID ").append(ex.getPublicId());<NEW_LINE>}<NEW_LINE>sb.append('.');<NEW_LINE>return sb.toString();<NEW_LINE>}
append(ex.getSystemId());
1,426,036
private void addDrawerItems() {<NEW_LINE>String[] webmapTitles = { getString(R.string.webmap_geology_us), getString(R.string.webmap_terrestrial_ecosystems), getString(R.string.webmap_hurricanes_cyclones_typhoons) };<NEW_LINE>ArrayAdapter<String> mAdapter = new ArrayAdapter<>(this, android.R.layout.simple_list_item_1, webmapTitles);<NEW_LINE>mDrawerList.setAdapter(mAdapter);<NEW_LINE>mDrawerList.setOnItemClickListener((adapterView, view, position, id) -> {<NEW_LINE>if (position == 0) {<NEW_LINE>mPortalItem = new PortalItem(mPortal, "92ad152b9da94dee89b9e387dfe21acd");<NEW_LINE>// create a map from a PortalItem<NEW_LINE>mMap = new ArcGISMap(mPortalItem);<NEW_LINE>// set the map to be displayed in this view<NEW_LINE>mMapView.setMap(mMap);<NEW_LINE>// close the drawer<NEW_LINE>mDrawerLayout.closeDrawer(adapterView);<NEW_LINE>} else if (position == 1) {<NEW_LINE>mPortalItem <MASK><NEW_LINE>// create a map from a PortalItem<NEW_LINE>mMap = new ArcGISMap(mPortalItem);<NEW_LINE>// set the map to be displayed in this view<NEW_LINE>mMapView.setMap(mMap);<NEW_LINE>// close the drawer<NEW_LINE>mDrawerLayout.closeDrawer(adapterView);<NEW_LINE>} else if (position == 2) {<NEW_LINE>mPortalItem = new PortalItem(mPortal, "064f2e898b094a17b84e4a4cd5e5f549");<NEW_LINE>// create a map from a PortalItem<NEW_LINE>mMap = new ArcGISMap(mPortalItem);<NEW_LINE>// set the map to be displayed in this view<NEW_LINE>mMapView.setMap(mMap);<NEW_LINE>// close the drawer<NEW_LINE>mDrawerLayout.closeDrawer(adapterView);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}
= new PortalItem(mPortal, "5be0bc3ee36c4e058f7b3cebc21c74e6");