idx int32 46 1.86M | input stringlengths 321 6.6k | target stringlengths 9 1.24k |
|---|---|---|
494,891 | protected String arrayToString(Object o) {<NEW_LINE>int len = Array.getLength(o);<NEW_LINE>Class c = o.getClass().getComponentType();<NEW_LINE>String res = "[ ";<NEW_LINE>for (int i = 0; i < len; i++) {<NEW_LINE>if (c == byte.class)<NEW_LINE>res += Array.getByte(o, i);<NEW_LINE>if (c == boolean.class)<NEW_LINE>res += <MASK><NEW_LINE>if (c == char.class)<NEW_LINE>res += Array.getChar(o, i);<NEW_LINE>if (c == short.class)<NEW_LINE>res += Array.getShort(o, i);<NEW_LINE>if (c == int.class)<NEW_LINE>res += Array.getInt(o, i);<NEW_LINE>if (c == long.class)<NEW_LINE>res += Array.getLong(o, i);<NEW_LINE>if (c == float.class)<NEW_LINE>res += Array.getFloat(o, i);<NEW_LINE>if (c == double.class)<NEW_LINE>res += Array.getDouble(o, i);<NEW_LINE>if (i < len - 1)<NEW_LINE>res += ",";<NEW_LINE>}<NEW_LINE>res += " ]";<NEW_LINE>return res;<NEW_LINE>} | Array.getBoolean(o, i); |
1,221,645 | public void onBindViewHolder(@NonNull final RecyclerView.ViewHolder holder, int position) {<NEW_LINE>if (holder instanceof HeaderViewHolder) {<NEW_LINE>Integer dateHeader = (Integer) getItem(position);<NEW_LINE>bindHeaderItem((HeaderViewHolder) holder, dateHeader, position);<NEW_LINE>} else if (holder instanceof TrackViewHolder) {<NEW_LINE>SearchResult searchResult = (SearchResult) getItem(position);<NEW_LINE>bindTrackItem((TrackViewHolder) holder, searchResult, position);<NEW_LINE>} else if (holder instanceof HistoryItemViewHolder) {<NEW_LINE>Object item = getItem(position);<NEW_LINE>HistoryItemViewHolder viewHolder = (HistoryItemViewHolder) holder;<NEW_LINE>boolean selected = selectedItems.contains(item);<NEW_LINE>viewHolder.compoundButton.setChecked(selected);<NEW_LINE>viewHolder.itemView.setOnClickListener(v -> {<NEW_LINE>boolean checked = <MASK><NEW_LINE>if (listener != null) {<NEW_LINE>listener.onItemSelected(item, checked);<NEW_LINE>}<NEW_LINE>notifyDataSetChanged();<NEW_LINE>});<NEW_LINE>if (holder instanceof SearchItemViewHolder) {<NEW_LINE>SearchResult searchResult = (SearchResult) getItem(position);<NEW_LINE>QuickSearchListItem listItem = new QuickSearchListItem(app, searchResult);<NEW_LINE>QuickSearchListAdapter.bindSearchResult((LinearLayout) viewHolder.itemView, listItem);<NEW_LINE>int iconColor = ContextCompat.getColor(app, selected ? activeColorId : defaultColorId);<NEW_LINE>viewHolder.icon.setImageDrawable(UiUtilities.tintDrawable(listItem.getIcon(), iconColor));<NEW_LINE>updateCompassVisibility(viewHolder.compassView, searchResult.location);<NEW_LINE>} else if (holder instanceof TargetPointViewHolder) {<NEW_LINE>TargetPoint targetPoint = (TargetPoint) getItem(position);<NEW_LINE>int colorId = selected ? activeColorId : defaultColorId;<NEW_LINE>viewHolder.title.setText(PreviousRouteCard.getPointName(app, targetPoint));<NEW_LINE>viewHolder.icon.setImageDrawable(uiUtilities.getIcon(R.drawable.ic_action_marker_dark, colorId));<NEW_LINE>updateCompassVisibility(viewHolder.compassView, targetPoint.point);<NEW_LINE>} else if (holder instanceof MarkerViewHolder) {<NEW_LINE>MapMarker mapMarker = (MapMarker) getItem(position);<NEW_LINE>int colorId = selected ? MapMarker.getColorId(mapMarker.colorIndex) : defaultColorId;<NEW_LINE>viewHolder.title.setText(mapMarker.getName(app));<NEW_LINE>viewHolder.icon.setImageDrawable(uiUtilities.getIcon(R.drawable.ic_action_flag, colorId));<NEW_LINE>updateCompassVisibility(viewHolder.compassView, mapMarker.point);<NEW_LINE>}<NEW_LINE>boolean lastItem = position == getItemCount() - 1;<NEW_LINE>AndroidUiHelper.updateVisibility(viewHolder.divider, lastItem);<NEW_LINE>UiUtilities.setupCompoundButton(nightMode, ContextCompat.getColor(app, activeColorId), viewHolder.compoundButton);<NEW_LINE>}<NEW_LINE>} | !viewHolder.compoundButton.isChecked(); |
296,094 | public static void waitForRPDiscoveryToBeReady(TestSettings testSettings) throws Exception {<NEW_LINE>String thisMethod = "waitForRPDiscoveryToBeReady";<NEW_LINE>int maxAttempts = 5;<NEW_LINE>int tryNum = 1;<NEW_LINE>while (tryNum <= maxAttempts) {<NEW_LINE>WebConversation wc = new WebConversation();<NEW_LINE>WebRequest request = new GetMethodWebRequest(testSettings.getTestURL());<NEW_LINE>WebResponse <MASK><NEW_LINE>msgUtils.printResponseParts(response, thisMethod, "Response when trying to use Discovered Server settings: ");<NEW_LINE>int status = AutomationTools.getResponseStatusCode(response);<NEW_LINE>if (status == Constants.OK_STATUS) {<NEW_LINE>Log.info(thisClass, thisMethod, "Was able to to use one of the OpenidConnect clients discovery data");<NEW_LINE>break;<NEW_LINE>} else {<NEW_LINE>Log.info(thisClass, thisMethod, "Discovery does not appear to be ready yet - try #" + tryNum);<NEW_LINE>// sleep 5 seconds before the next attempt<NEW_LINE>helpers.testSleep(5);<NEW_LINE>tryNum++;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | response = wc.getResponse(request); |
1,688,570 | public int robotSim(int[] commands, int[][] obstacles) {<NEW_LINE>Set<String> set = new HashSet<String>();<NEW_LINE>for (int[] o : obstacles) set.add(o[0] + " " + o[1]);<NEW_LINE>int max = 0, x = 0, y = 0, dir = 0, dirs[][] = { { 0, 1 }, { 1, 0 }, { 0, -1 }, { -1, 0 } };<NEW_LINE>for (int c : commands) {<NEW_LINE>if (c == -2)<NEW_LINE>dir = dir <MASK><NEW_LINE>else if (c == -1)<NEW_LINE>dir = dir == 3 ? 0 : dir + 1;<NEW_LINE>else {<NEW_LINE>int[] xy = dirs[dir];<NEW_LINE>while (c-- > 0 && !set.contains((x + xy[0]) + " " + (y + xy[1]))) {<NEW_LINE>x += xy[0];<NEW_LINE>y += xy[1];<NEW_LINE>}<NEW_LINE>}<NEW_LINE>max = Math.max(max, x * x + y * y);<NEW_LINE>}<NEW_LINE>return max;<NEW_LINE>} | == 0 ? 3 : dir - 1; |
619,663 | private void sendOnSnapshotError(String appName, int listenerId, Exception exception) {<NEW_LINE>WritableMap body = Arguments.createMap();<NEW_LINE>WritableMap error = Arguments.createMap();<NEW_LINE>if (exception instanceof FirebaseFirestoreException) {<NEW_LINE>UniversalFirebaseFirestoreException firestoreException = new UniversalFirebaseFirestoreException((FirebaseFirestoreException) exception, exception.getCause());<NEW_LINE>error.putString("code", firestoreException.getCode());<NEW_LINE>error.putString(<MASK><NEW_LINE>} else {<NEW_LINE>error.putString("code", "unknown");<NEW_LINE>error.putString("message", "An unknown error occurred");<NEW_LINE>}<NEW_LINE>body.putMap("error", error);<NEW_LINE>ReactNativeFirebaseEventEmitter emitter = ReactNativeFirebaseEventEmitter.getSharedInstance();<NEW_LINE>emitter.sendEvent(new ReactNativeFirebaseFirestoreEvent(ReactNativeFirebaseFirestoreEvent.DOCUMENT_EVENT_SYNC, body, appName, listenerId));<NEW_LINE>} | "message", firestoreException.getMessage()); |
461,573 | private int findMatch() {<NEW_LINE>int matched = 0;<NEW_LINE>int bankId = 0;<NEW_LINE>if (account != null) {<NEW_LINE>bankId = account.getC_Bank_ID();<NEW_LINE>}<NEW_LINE>List<MBankStatementMatcher> matchersList = MBankStatementMatcher.getMatchersList(Env.getCtx(), bankId);<NEW_LINE>if (matchersList == null) {<NEW_LINE>return 0;<NEW_LINE>}<NEW_LINE>//<NEW_LINE>for (Map.Entry<Integer, X_I_BankStatement> entry : importedPaymentHashMap.entrySet()) {<NEW_LINE>X_I_BankStatement currentBankStatementImport = entry.getValue();<NEW_LINE>if (currentBankStatementImport.getC_Payment_ID() != 0 || currentBankStatementImport.getC_BPartner_ID() != 0 || currentBankStatementImport.getC_Invoice_ID() != 0) {<NEW_LINE>// put on hash<NEW_LINE>matchedPaymentHashMap.put(entry.getValue().getC_Payment_ID(), currentBankStatementImport);<NEW_LINE>matched++;<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>for (MBankStatementMatcher matcher : matchersList) {<NEW_LINE>if (matcher.isMatcherValid()) {<NEW_LINE>BankStatementMatchInfo info = matcher.getMatcher().findMatch(currentBankStatementImport, currentPaymentHashMap.keySet().stream().collect(Collectors.toList()), matchedPaymentHashMap.keySet().stream().collect(Collectors.toList()));<NEW_LINE>if (info != null && info.isMatched()) {<NEW_LINE>// Duplicate match<NEW_LINE>if (matchedPaymentHashMap.containsKey(info.getC_Payment_ID())) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (info.getC_Payment_ID() > 0) {<NEW_LINE>currentBankStatementImport.setC_Payment_ID(info.getC_Payment_ID());<NEW_LINE>}<NEW_LINE>if (info.getC_Invoice_ID() > 0) {<NEW_LINE>currentBankStatementImport.setC_Invoice_ID(info.getC_Invoice_ID());<NEW_LINE>}<NEW_LINE>if (info.getC_BPartner_ID() > 0) {<NEW_LINE>currentBankStatementImport.<MASK><NEW_LINE>}<NEW_LINE>// put on hash<NEW_LINE>matchedPaymentHashMap.put(entry.getValue().getC_Payment_ID(), currentBankStatementImport);<NEW_LINE>matched++;<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// for all matchers<NEW_LINE>}<NEW_LINE>// Return<NEW_LINE>return matched;<NEW_LINE>} | setC_BPartner_ID(info.getC_BPartner_ID()); |
281,699 | void registerSingleType(DataType type) {<NEW_LINE>// built-in dynamic: Created on the fly<NEW_LINE>if (type instanceof TensorDataType)<NEW_LINE>return;<NEW_LINE>if (type instanceof TemporaryDataType) {<NEW_LINE>throw new IllegalArgumentException("TemporaryDataType no longer supported: " + type);<NEW_LINE>}<NEW_LINE>if (type instanceof TemporaryStructuredDataType) {<NEW_LINE>throw new IllegalArgumentException("TemporaryStructuredDataType no longer supported: " + type);<NEW_LINE>}<NEW_LINE>if (dataTypes.containsKey(type.getId())) {<NEW_LINE>DataType existingType = dataTypes.<MASK><NEW_LINE>if ((existingType == type) || existingType.equals(type)) {<NEW_LINE>// Oki. Already registered.<NEW_LINE>return;<NEW_LINE>} else {<NEW_LINE>throw new IllegalStateException("Datatype " + existingType + " is not equal to datatype attempted registered " + type + ", but already uses id " + type.getId());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (type instanceof DocumentType) {<NEW_LINE>DocumentType docType = (DocumentType) type;<NEW_LINE>if (docType.getInheritedTypes().size() == 0) {<NEW_LINE>docType.inherit(documentTypes.get(new DataTypeName("document")));<NEW_LINE>}<NEW_LINE>documentTypes.put(docType.getDataTypeName(), docType);<NEW_LINE>}<NEW_LINE>dataTypes.put(type.getId(), type);<NEW_LINE>type.setRegistered();<NEW_LINE>} | get(type.getId()); |
1,456,366 | protected void postProcess(BeanDefinitionBuilder builder, Element element, ParserContext parserContext) {<NEW_LINE>List<Element> mappingElements = DomUtils.getChildElementsByTagName(element, "mapping");<NEW_LINE>if (!CollectionUtils.isEmpty(mappingElements)) {<NEW_LINE>ManagedMap<String, String> channelMappings = new ManagedMap<String, String>();<NEW_LINE>for (Element mappingElement : mappingElements) {<NEW_LINE>channelMappings.put(mappingElement.getAttribute("value")<MASK><NEW_LINE>}<NEW_LINE>builder.addPropertyValue("channelMappings", channelMappings);<NEW_LINE>}<NEW_LINE>IntegrationNamespaceUtils.setReferenceIfAttributeDefined(builder, element, "default-output-channel");<NEW_LINE>IntegrationNamespaceUtils.setValueIfAttributeDefined(builder, element, "timeout");<NEW_LINE>IntegrationNamespaceUtils.setValueIfAttributeDefined(builder, element, "resolution-required");<NEW_LINE>IntegrationNamespaceUtils.setValueIfAttributeDefined(builder, element, "apply-sequence");<NEW_LINE>IntegrationNamespaceUtils.setValueIfAttributeDefined(builder, element, "ignore-send-failures");<NEW_LINE>} | , mappingElement.getAttribute("channel")); |
772,881 | final InitiateLayerUploadResult executeInitiateLayerUpload(InitiateLayerUploadRequest initiateLayerUploadRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(initiateLayerUploadRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<InitiateLayerUploadRequest> request = null;<NEW_LINE>Response<InitiateLayerUploadResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new InitiateLayerUploadRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(initiateLayerUploadRequest));<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, "ECR PUBLIC");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "InitiateLayerUpload");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<InitiateLayerUploadResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new InitiateLayerUploadResultJsonUnmarshaller());<NEW_LINE>response = <MASK><NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | invoke(request, responseHandler, executionContext); |
31,271 | protected SrtpCryptoAttribute selectSdesCryptoSuite(boolean isInitiator, SDesControl sDesControl, MediaDescription mediaDescription) {<NEW_LINE>@SuppressWarnings("unchecked")<NEW_LINE>Vector<Attribute> attrs = mediaDescription.getAttributes(true);<NEW_LINE>Vector<SrtpCryptoAttribute> peerAttributes = new Vector<SrtpCryptoAttribute>(attrs.size());<NEW_LINE>Attribute a;<NEW_LINE>for (int i = 0; i < attrs.size(); ++i) {<NEW_LINE>try {<NEW_LINE><MASK><NEW_LINE>if (a.getName().equals("crypto")) {<NEW_LINE>peerAttributes.add(SrtpCryptoAttribute.create(a.getValue()));<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>logger.error("received an unparsable sdp attribute", e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (isInitiator) {<NEW_LINE>return sDesControl.initiatorSelectAttribute(peerAttributes);<NEW_LINE>} else {<NEW_LINE>return sDesControl.responderSelectAttribute(peerAttributes);<NEW_LINE>}<NEW_LINE>} | a = attrs.get(i); |
1,624,165 | private static Properties loadProperties() {<NEW_LINE>Properties saffronProperties = new Properties();<NEW_LINE>// Read properties from the file "saffron.properties", if it exists in classpath<NEW_LINE>try (InputStream stream = CalciteSystemProperty.class.getClassLoader().getResourceAsStream("saffron.properties")) {<NEW_LINE>if (stream != null) {<NEW_LINE>saffronProperties.load(stream);<NEW_LINE>}<NEW_LINE>} catch (IOException e) {<NEW_LINE><MASK><NEW_LINE>} catch (AccessControlException e) {<NEW_LINE>// we're in a sandbox<NEW_LINE>}<NEW_LINE>// Merge system and saffron properties, mapping deprecated saffron<NEW_LINE>// namespaces to calcite<NEW_LINE>final Properties allProperties = new Properties();<NEW_LINE>Stream.concat(saffronProperties.entrySet().stream(), System.getProperties().entrySet().stream()).forEach(prop -> {<NEW_LINE>String deprecatedKey = (String) prop.getKey();<NEW_LINE>String newKey = deprecatedKey.replace("net.sf.saffron.", "calcite.").replace("saffron.", "calcite.");<NEW_LINE>if (newKey.startsWith("calcite.")) {<NEW_LINE>allProperties.setProperty(newKey, (String) prop.getValue());<NEW_LINE>}<NEW_LINE>});<NEW_LINE>return allProperties;<NEW_LINE>} | throw new RuntimeException("while reading from saffron.properties file", e); |
1,055,835 | public PluginDescriptor find(Path pluginPath) {<NEW_LINE>for (PluginDescriptorFinder finder : finders) {<NEW_LINE>if (finder.isApplicable(pluginPath)) {<NEW_LINE>log.debug("'{}' is applicable for plugin '{}'", finder, pluginPath);<NEW_LINE>try {<NEW_LINE>PluginDescriptor pluginDescriptor = finder.find(pluginPath);<NEW_LINE>if (pluginDescriptor != null) {<NEW_LINE>return pluginDescriptor;<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>if (finders.indexOf(finder) == finders.size() - 1) {<NEW_LINE>// it's the last finder<NEW_LINE>log.error(e.getMessage(), e);<NEW_LINE>} else {<NEW_LINE>// log the exception and continue with the next finder<NEW_LINE>log.<MASK><NEW_LINE>log.debug("Try to continue with the next finder");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>log.debug("'{}' is not applicable for plugin '{}'", finder, pluginPath);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>throw new PluginRuntimeException("No PluginDescriptorFinder for plugin '{}'", pluginPath);<NEW_LINE>} | debug(e.getMessage()); |
1,041,835 | public void writeValue(int ex) {<NEW_LINE>double x = xyGraph.primaryXAxis.getPositionValue(ex, false);<NEW_LINE>int index = (int) x;<NEW_LINE>if (index < 0) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>Sample sample = (Sample) trace.getDataProvider().getSample(index);<NEW_LINE>if (sample != null) {<NEW_LINE>double y = sample.getYValue();<NEW_LINE>int height = xyGraph.primaryYAxis.getValuePosition(y, false);<NEW_LINE>int startX = xyGraph.primaryXAxis.getValuePosition((int) x, false);<NEW_LINE>GC gc = new GC(canvas);<NEW_LINE>Font font = new Font(null, <MASK><NEW_LINE>gc.setFont(font);<NEW_LINE>String value = FormatUtil.print(y, "#,###");<NEW_LINE>Point textSize = gc.textExtent(value);<NEW_LINE>gc.drawText(value, startX + (xAxisUnitWidth - textSize.x) / 2, height - 20, true);<NEW_LINE>int ground = xyGraph.primaryYAxis.getValuePosition(0, false);<NEW_LINE>gc.setForeground(Display.getCurrent().getSystemColor(SWT.COLOR_BLACK));<NEW_LINE>gc.setBackground(Display.getCurrent().getSystemColor(SWT.COLOR_DARK_MAGENTA));<NEW_LINE>gc.drawRectangle(startX + (xAxisUnitWidth - lineWidth) / 2, height, lineWidth, ground - height);<NEW_LINE>gc.fillRectangle(startX + (xAxisUnitWidth - lineWidth) / 2, height, lineWidth, ground - height);<NEW_LINE>gc.dispose();<NEW_LINE>}<NEW_LINE>} | "Verdana", 10, SWT.BOLD); |
840,805 | public final // F49213<NEW_LINE>void formatTo(IncidentStream is) {<NEW_LINE>// -----------------------------------------------------------------------<NEW_LINE>// Indicate the start of the dump, and include the identity<NEW_LINE>// of InjectionProcessor, so this can easily be matched to a trace.<NEW_LINE>// -----------------------------------------------------------------------<NEW_LINE>is.writeLine("", ">--- Start InjectionProcessor Dump ---> " + Util.identity(this));<NEW_LINE>is.writeLine("", "Annotation = " + ivAnnotationClass);<NEW_LINE>is.writeLine("", "Annotations = " + ivAnnotationsClass);<NEW_LINE>is.writeLine("", "");<NEW_LINE>is.writeLine("", ivContext != null ? ivContext.toString() : "ivContext = null");<NEW_LINE>is.writeLine("", "");<NEW_LINE>is.writeLine("", ivNameSpaceConfig != null ? ivNameSpaceConfig.toString() : "ivNameSpaceConfig = null");<NEW_LINE>is.writeLine("", "");<NEW_LINE>is.writeLine("", "Override Processor : " + ivOverrideProcessor);<NEW_LINE>is.writeLine("", "");<NEW_LINE>is.writeLine("", "Object Factory Map : ");<NEW_LINE>for (Class<?> key : ivObjectFactoryMap.keySet()) {<NEW_LINE>is.writeLine("", " " + key.getName() + " : " + Util.identity(ivObjectFactoryMap.get(key)));<NEW_LINE>}<NEW_LINE>is.writeLine("", "");<NEW_LINE>is.writeLine("", "No-Override Object Factory Map : ");<NEW_LINE>for (Class<?> key : ivNoOverrideObjectFactoryMap.keySet()) {<NEW_LINE>is.writeLine("", " " + key.getName() + " : " + Util.identity(ivNoOverrideObjectFactoryMap.get(key)));<NEW_LINE>}<NEW_LINE>is.writeLine("", "");<NEW_LINE>is.writeLine("", "Override Reference Factories : ");<NEW_LINE>for (OverrideReferenceFactory<A> factory : ivOverrideReferenceFactories) {<NEW_LINE>is.writeLine("", " " + Util.identity(factory));<NEW_LINE>}<NEW_LINE>is.writeLine("", "");<NEW_LINE><MASK><NEW_LINE>for (String key : ivAllAnnotationsCollection.keySet()) {<NEW_LINE>is.writeLine("", " " + key + " : " + Util.identity(ivAllAnnotationsCollection.get(key)));<NEW_LINE>}<NEW_LINE>is.writeLine("", "<--- InjectionProcessor Dump Complete---< ");<NEW_LINE>} | is.writeLine("", "All Bindings : "); |
917,290 | private Node withIpAssigned(Node node) {<NEW_LINE>if (!node.type().isHost()) {<NEW_LINE>return node.with(node.ipConfig().withPrimary(nameResolver.resolveAll(node.hostname())));<NEW_LINE>}<NEW_LINE>int hostIndex = Integer.parseInt(node.hostname().replaceAll("^[a-z]+|-\\d+$", ""));<NEW_LINE>Set<String> addresses = Set.of("::" + hostIndex + ":0");<NEW_LINE>Set<String> ipAddressPool = new HashSet<>();<NEW_LINE>if (!behaviours.contains(Behaviour.failDnsUpdate)) {<NEW_LINE>nameResolver.addRecord(node.hostname(), addresses.iterator().next());<NEW_LINE>for (int i = 1; i <= 2; i++) {<NEW_LINE>String ip = "::" + hostIndex + ":" + i;<NEW_LINE>ipAddressPool.add(ip);<NEW_LINE>nameResolver.addRecord(node.hostname() + "-" + i, ip);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>IP.Pool pool = node.ipConfig().<MASK><NEW_LINE>return node.with(node.ipConfig().withPrimary(addresses).withPool(pool));<NEW_LINE>} | pool().withIpAddresses(ipAddressPool); |
1,016,214 | void assign(TaskRequest request) {<NEW_LINE>final TaskRequest.AssignedResources assignedResources = request.getAssignedResources();<NEW_LINE>if (assignedResources != null) {<NEW_LINE>final List<ConsumeResult> consumedNamedResources = assignedResources.getConsumedNamedResources();<NEW_LINE>if (consumedNamedResources != null && !consumedNamedResources.isEmpty()) {<NEW_LINE>for (PreferentialNamedConsumableResourceSet.ConsumeResult consumeResult : consumedNamedResources) {<NEW_LINE>if (name.equals(consumeResult.getAttrName())) {<NEW_LINE>final <MASK><NEW_LINE>if (index < 0 || index > usageBy.size())<NEW_LINE>throw new IllegalStateException("Illegal assignment of namedResource " + name + ": has " + usageBy.size() + " resource sets, can't assign to index " + index);<NEW_LINE>usageBy.get(index).consume(consumeResult.getResName(), request);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | int index = consumeResult.getIndex(); |
1,697,903 | public void afterPropertiesSet() {<NEW_LINE>Configuration<?> configuration;<NEW_LINE>if (this.providerClass != null) {<NEW_LINE>ProviderSpecificBootstrap bootstrap = Validation.byProvider(this.providerClass);<NEW_LINE>if (this.validationProviderResolver != null) {<NEW_LINE>bootstrap = bootstrap.providerResolver(this.validationProviderResolver);<NEW_LINE>}<NEW_LINE>configuration = bootstrap.configure();<NEW_LINE>} else {<NEW_LINE>GenericBootstrap bootstrap = Validation.byDefaultProvider();<NEW_LINE>if (this.validationProviderResolver != null) {<NEW_LINE>bootstrap = bootstrap.providerResolver(this.validationProviderResolver);<NEW_LINE>}<NEW_LINE>configuration = bootstrap.configure();<NEW_LINE>}<NEW_LINE>// Try Hibernate Validator 5.2's externalClassLoader(ClassLoader) method<NEW_LINE>if (this.applicationContext != null) {<NEW_LINE>try {<NEW_LINE>Method eclMethod = configuration.getClass().getMethod("externalClassLoader", ClassLoader.class);<NEW_LINE>ReflectionUtils.invokeMethod(eclMethod, configuration, this.applicationContext.getClassLoader());<NEW_LINE>} catch (NoSuchMethodException ex) {<NEW_LINE>// Ignore - no Hibernate Validator 5.2+ or similar provider<NEW_LINE>}<NEW_LINE>}<NEW_LINE>MessageInterpolator targetInterpolator = this.messageInterpolator;<NEW_LINE>if (targetInterpolator == null) {<NEW_LINE>targetInterpolator = configuration.getDefaultMessageInterpolator();<NEW_LINE>}<NEW_LINE>configuration.messageInterpolator(new LocaleContextMessageInterpolator(targetInterpolator));<NEW_LINE>if (this.traversableResolver != null) {<NEW_LINE>configuration.traversableResolver(this.traversableResolver);<NEW_LINE>}<NEW_LINE>ConstraintValidatorFactory targetConstraintValidatorFactory = this.constraintValidatorFactory;<NEW_LINE>if (targetConstraintValidatorFactory == null && this.applicationContext != null) {<NEW_LINE>targetConstraintValidatorFactory = new SpringConstraintValidatorFactory(<MASK><NEW_LINE>}<NEW_LINE>if (targetConstraintValidatorFactory != null) {<NEW_LINE>configuration.constraintValidatorFactory(targetConstraintValidatorFactory);<NEW_LINE>}<NEW_LINE>if (this.parameterNameDiscoverer != null) {<NEW_LINE>configureParameterNameProvider(this.parameterNameDiscoverer, configuration);<NEW_LINE>}<NEW_LINE>List<InputStream> mappingStreams = null;<NEW_LINE>if (this.mappingLocations != null) {<NEW_LINE>mappingStreams = new ArrayList<>(this.mappingLocations.length);<NEW_LINE>for (Resource location : this.mappingLocations) {<NEW_LINE>try {<NEW_LINE>InputStream stream = location.getInputStream();<NEW_LINE>mappingStreams.add(stream);<NEW_LINE>configuration.addMapping(stream);<NEW_LINE>} catch (IOException ex) {<NEW_LINE>closeMappingStreams(mappingStreams);<NEW_LINE>throw new IllegalStateException("Cannot read mapping resource: " + location);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>this.validationPropertyMap.forEach(configuration::addProperty);<NEW_LINE>// Allow for custom post-processing before we actually build the ValidatorFactory.<NEW_LINE>if (this.configurationInitializer != null) {<NEW_LINE>this.configurationInitializer.accept(configuration);<NEW_LINE>}<NEW_LINE>postProcessConfiguration(configuration);<NEW_LINE>try {<NEW_LINE>this.validatorFactory = configuration.buildValidatorFactory();<NEW_LINE>setTargetValidator(this.validatorFactory.getValidator());<NEW_LINE>} finally {<NEW_LINE>closeMappingStreams(mappingStreams);<NEW_LINE>}<NEW_LINE>} | this.applicationContext.getAutowireCapableBeanFactory()); |
622,109 | protected JRFillCommonReturnValue addReturnValue(JRFillCommonReturnValue returnValue, List<JRFillCommonReturnValue> returnValueList, JRFillObjectFactory factory, BaseReportFiller filler) {<NEW_LINE>CalculationEnum calculation = returnValue.getCalculation();<NEW_LINE>switch(calculation) {<NEW_LINE>case AVERAGE:<NEW_LINE>case VARIANCE:<NEW_LINE>{<NEW_LINE>CommonReturnValue countVal = returnValue.createHelperReturnValue(returnValue, "_COUNT", CalculationEnum.COUNT);<NEW_LINE>returnValue.addDerivedReturnValue(countVal, returnValueList, factory, filler);<NEW_LINE>CommonReturnValue sumVal = returnValue.createHelperReturnValue(returnValue, "_SUM", CalculationEnum.SUM);<NEW_LINE>returnValue.addDerivedReturnValue(sumVal, returnValueList, factory, filler);<NEW_LINE>filler.addVariableCalculationReq(returnValue.getToVariable(), calculation);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>case STANDARD_DEVIATION:<NEW_LINE>{<NEW_LINE>CommonReturnValue varianceVal = returnValue.createHelperReturnValue(<MASK><NEW_LINE>returnValue.addDerivedReturnValue(varianceVal, returnValueList, factory, filler);<NEW_LINE>filler.addVariableCalculationReq(returnValue.getToVariable(), calculation);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>case DISTINCT_COUNT:<NEW_LINE>{<NEW_LINE>CommonReturnValue countVal = returnValue.createDistinctCountHelperReturnValue(returnValue);<NEW_LINE>returnValue.addDerivedReturnValue(countVal, returnValueList, factory, filler);<NEW_LINE>filler.addVariableCalculationReq(returnValue.getToVariable(), calculation);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>default:<NEW_LINE>}<NEW_LINE>returnValueList.add(returnValue);<NEW_LINE>return returnValue;<NEW_LINE>} | returnValue, "_VARIANCE", CalculationEnum.VARIANCE); |
415,429 | public IToken evaluate(ICharacterScanner scanner, boolean resume) {<NEW_LINE>// Should we try to match the first char first?<NEW_LINE>if (firstChar != Character.MIN_VALUE) {<NEW_LINE>int readChar = scanner.read();<NEW_LINE>scanner.unread();<NEW_LINE>if (readChar == ICharacterScanner.EOF) {<NEW_LINE>return Token.EOF;<NEW_LINE>}<NEW_LINE>if (firstChar != readChar) {<NEW_LINE>return Token.UNDEFINED;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>String line = readNextLine(scanner);<NEW_LINE>if (line == null)<NEW_LINE>return Token.EOF;<NEW_LINE>Matcher matcher = regexp.matcher(line);<NEW_LINE>if (matcher.find() && matcher.start() == 0) {<NEW_LINE>// Unread back to end of regexp match!<NEW_LINE>String match = matcher.group();<NEW_LINE>if (match.length() < line.length()) {<NEW_LINE>int toUnread = line.length<MASK><NEW_LINE>unread(scanner, toUnread);<NEW_LINE>}<NEW_LINE>return successToken;<NEW_LINE>}<NEW_LINE>unread(scanner, line.length());<NEW_LINE>return Token.UNDEFINED;<NEW_LINE>} | () - match.length(); |
1,812,886 | // Not public<NEW_LINE>Collection<LifecycleQueryInstalledChaincodesProposalResponse> lifecycleQueryInstalledChaincodes(LifecycleQueryInstalledChaincodesRequest lifecycleQueryInstalledChaincodesRequest, Collection<Peer> peers) throws InvalidArgumentException, ProposalException {<NEW_LINE>logger.trace("LifecycleQueryInstalledChaincodes");<NEW_LINE>if (null == lifecycleQueryInstalledChaincodesRequest) {<NEW_LINE>throw new InvalidArgumentException("The lifecycleQueryInstalledChaincodesRequest parameter can not be null.");<NEW_LINE>}<NEW_LINE>checkPeers(peers);<NEW_LINE>if (!isSystemChannel()) {<NEW_LINE>throw new InvalidArgumentException("LifecycleQueryInstalledChaincodes should only be invoked on system channel.");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>TransactionContext context = newTransactionContext(lifecycleQueryInstalledChaincodesRequest);<NEW_LINE>ProposalPackage.Proposal proposalBuilder = LifecycleQueryInstalledChaincodesBuilder.newBuilder().context(context).build();<NEW_LINE>ProposalPackage.SignedProposal qProposal = getSignedProposal(context, proposalBuilder);<NEW_LINE>return sendProposalToPeers(peers, <MASK><NEW_LINE>} catch (ProposalException e) {<NEW_LINE>throw e;<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new ProposalException(format("Query for peer %s channels failed. " + e.getMessage(), name), e);<NEW_LINE>}<NEW_LINE>} | qProposal, context, LifecycleQueryInstalledChaincodesProposalResponse.class); |
1,703,246 | public PutServiceQuotaIncreaseRequestIntoTemplateResult unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>PutServiceQuotaIncreaseRequestIntoTemplateResult putServiceQuotaIncreaseRequestIntoTemplateResult = new PutServiceQuotaIncreaseRequestIntoTemplateResult();<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 putServiceQuotaIncreaseRequestIntoTemplateResult;<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("ServiceQuotaIncreaseRequestInTemplate", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>putServiceQuotaIncreaseRequestIntoTemplateResult.setServiceQuotaIncreaseRequestInTemplate(ServiceQuotaIncreaseRequestInTemplateJsonUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>}<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return putServiceQuotaIncreaseRequestIntoTemplateResult;<NEW_LINE>} | String currentParentElement = context.getCurrentParentElement(); |
184,357 | protected void textCharImpl(char ch, float x, float y) {<NEW_LINE>// , float z) {<NEW_LINE>PFont.Glyph glyph = textFont.getGlyph(ch);<NEW_LINE>if (glyph != null) {<NEW_LINE>if (textMode == MODEL) {<NEW_LINE>float floatSize = textFont.getSize();<NEW_LINE>float high = glyph.height / floatSize;<NEW_LINE>float wide = glyph.width / floatSize;<NEW_LINE>float leftExtent = glyph.leftExtent / floatSize;<NEW_LINE>float topExtent = glyph.topExtent / floatSize;<NEW_LINE>float x1 = x + leftExtent * textSize;<NEW_LINE><MASK><NEW_LINE>float x2 = x1 + wide * textSize;<NEW_LINE>float y2 = y1 + high * textSize;<NEW_LINE>textCharModelImpl(glyph.image, x1, y1, x2, y2, glyph.width, glyph.height);<NEW_LINE>}<NEW_LINE>} else if (ch != ' ' && ch != 127) {<NEW_LINE>showWarning("No glyph found for the " + ch + " (\\u" + PApplet.hex(ch, 4) + ") character");<NEW_LINE>}<NEW_LINE>} | float y1 = y - topExtent * textSize; |
1,237,619 | public static void main(String[] args) throws FileNotFoundException, IOException {<NEW_LINE>if (args.length < 1) {<NEW_LINE>System.out.println("Syntax: <in.mkv>\n" + "\tWhere:\n" + "\t<in.mkv>\tThe file to decode");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>System.out.println("Read file: " + args[0]);<NEW_LINE>FileInputStream demInputStream = new FileInputStream(args[0]);<NEW_LINE>MKVDemuxer demuxer = new MKVDemuxer(new FileChannelWrapper(demInputStream.getChannel()));<NEW_LINE>System.out.println("Audio tracks: " + demuxer.getAudioTracks().size());<NEW_LINE>for (DemuxerTrack elem : demuxer.getAudioTracks()) {<NEW_LINE>AudioTrack elemAudio = (AudioTrack) elem;<NEW_LINE>if (elemAudio == null) {<NEW_LINE>System.out.println(" - null");<NEW_LINE>} else if (elemAudio.getMeta() == null) {<NEW_LINE><MASK><NEW_LINE>} else {<NEW_LINE>System.out.println(" - " + elemAudio.getLanguage() + " " + elemAudio.getMeta().getCodec() + " " + elemAudio.getMeta().getAudioCodecMeta().getChannelCount() + " " + elemAudio.getMeta().getAudioCodecMeta().getSampleRate());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>System.out.println("Video tracks: " + demuxer.getVideoTracks().size());<NEW_LINE>for (DemuxerTrack elem : demuxer.getVideoTracks()) {<NEW_LINE>VideoTrack elemVideo = (VideoTrack) elem;<NEW_LINE>System.out.println(" - " + elemVideo.getMeta().getType() + " " + elemVideo.getMeta().getCodec() + " " + elemVideo.getMeta().getVideoCodecMeta().getSize());<NEW_LINE>}<NEW_LINE>System.out.println("Video subtitle tracks: " + demuxer.getSubtitleTracks().size());<NEW_LINE>for (DemuxerTrack elem : demuxer.getSubtitleTracks()) {<NEW_LINE>SubtitlesTrack elemSubtitle = (SubtitlesTrack) elem;<NEW_LINE>if (elemSubtitle == null) {<NEW_LINE>System.out.println(" - null");<NEW_LINE>} else if (elemSubtitle.getMeta() == null) {<NEW_LINE>System.out.println(" - null (no metadata)");<NEW_LINE>} else {<NEW_LINE>System.out.println(" - " + elemSubtitle.getLanguage() + " " + elemSubtitle.getMeta().getType() + " " + elemSubtitle.getMeta().getCodec());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>closeQuietly(demInputStream);<NEW_LINE>} | System.out.println(" - null (no metadata)"); |
1,675,228 | public HtmlResponse create(final CreateForm form) {<NEW_LINE>verifyCrudMode(form.crudMode, CrudMode.CREATE);<NEW_LINE>validate(form, messages -> {<NEW_LINE>}, this::asEditHtml);<NEW_LINE>validateFields(form, v -> throwValidationError<MASK><NEW_LINE>verifyToken(this::asEditHtml);<NEW_LINE>getDoc(form).ifPresent(entity -> {<NEW_LINE>try {<NEW_LINE>entity.putAll(fessConfig.convertToStorableDoc(form.doc));<NEW_LINE>final String newId = ComponentUtil.getCrawlingInfoHelper().generateId(entity);<NEW_LINE>entity.put(fessConfig.getIndexFieldId(), newId);<NEW_LINE>final String index = fessConfig.getIndexDocumentUpdateIndex();<NEW_LINE>searchEngineClient.store(index, entity);<NEW_LINE>saveInfo(messages -> messages.addSuccessCrudCreateCrudTable(GLOBAL));<NEW_LINE>} catch (final Exception e) {<NEW_LINE>logger.error("Failed to add {}", entity, e);<NEW_LINE>throwValidationError(messages -> messages.addErrorsCrudFailedToCreateCrudTable(GLOBAL, buildThrowableMessage(e)), this::asEditHtml);<NEW_LINE>}<NEW_LINE>}).orElse(() -> {<NEW_LINE>throwValidationError(messages -> messages.addErrorsCrudFailedToCreateInstance(GLOBAL), this::asEditHtml);<NEW_LINE>});<NEW_LINE>return redirect(getClass());<NEW_LINE>} | (v, this::asEditHtml)); |
824,190 | public List<ArchiveYearVO> convertToYearArchives(List<Post> posts) {<NEW_LINE>Map<Integer, List<Post>> yearPostMap = new HashMap<>(8);<NEW_LINE>posts.forEach(post -> {<NEW_LINE>Calendar calendar = DateUtils.<MASK><NEW_LINE>yearPostMap.computeIfAbsent(calendar.get(Calendar.YEAR), year -> new LinkedList<>()).add(post);<NEW_LINE>});<NEW_LINE>List<ArchiveYearVO> archives = new LinkedList<>();<NEW_LINE>yearPostMap.forEach((year, postList) -> {<NEW_LINE>// Build archive<NEW_LINE>ArchiveYearVO archive = new ArchiveYearVO();<NEW_LINE>archive.setYear(year);<NEW_LINE>archive.setPosts(convertToListVo(postList));<NEW_LINE>// Add archive<NEW_LINE>archives.add(archive);<NEW_LINE>});<NEW_LINE>// Sort this list<NEW_LINE>archives.sort(new ArchiveYearVO.ArchiveComparator());<NEW_LINE>return archives;<NEW_LINE>} | convertTo(post.getCreateTime()); |
1,320,722 | public void configure() {<NEW_LINE>errorHandler(noErrorHandler());<NEW_LINE>from("{{" + ExternalSystemCamelConstants.MF_UPSERT_BPARTNER_LOCATION_V2_CAMEL_URI + "}}").routeId(ROUTE_ID).streamCaching().log("Route invoked!").process(exchange -> {<NEW_LINE>final var lookupRequest = exchange.getIn().getBody();<NEW_LINE>if (!(lookupRequest instanceof BPLocationCamelRequest)) {<NEW_LINE>throw new RuntimeCamelException("The route " + ROUTE_ID + " requires the body to be instanceof BPLocationCamelRequest V2." + " However, it is " + (lookupRequest == null ? "null" : lookupRequest.getClass<MASK><NEW_LINE>}<NEW_LINE>exchange.getIn().setHeader(HEADER_ORG_CODE, ((BPLocationCamelRequest) lookupRequest).getOrgCode());<NEW_LINE>exchange.getIn().setHeader(HEADER_BPARTNER_IDENTIFIER, ((BPLocationCamelRequest) lookupRequest).getBPartnerIdentifier());<NEW_LINE>final JsonRequestLocationUpsert jsonRequestLocationUpsert = ((BPLocationCamelRequest) lookupRequest).getJsonRequestLocationUpsert();<NEW_LINE>exchange.getIn().setBody(jsonRequestLocationUpsert);<NEW_LINE>}).marshal(CamelRouteHelper.setupJacksonDataFormatFor(getContext(), JsonRequestLocationUpsert.class)).removeHeaders("CamelHttp*").setHeader(CoreConstants.AUTHORIZATION, simple(CoreConstants.AUTHORIZATION_TOKEN)).setHeader(Exchange.HTTP_METHOD, constant(HttpEndpointBuilderFactory.HttpMethods.PUT)).toD("{{metasfresh.upsert-bpartner-v2.api.uri}}/${header." + HEADER_ORG_CODE + "}/${header." + HEADER_BPARTNER_IDENTIFIER + "}/location").to(direct(UNPACK_V2_API_RESPONSE));<NEW_LINE>} | ().getName())); |
714,775 | private void createBugDialog(@NonNull MapActivity mapActivity, final boolean offline, String text, int titleTextId, int posButtonTextId, final Action action, final OpenStreetNote bug, OsmNotesPoint point) {<NEW_LINE>if (mapActivity.isFinishing()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (offline) {<NEW_LINE>mapActivity.getContextMenu().close();<NEW_LINE>BugBottomSheetDialog.showInstance(mapActivity.getSupportFragmentManager(), getOsmBugsUtil(bug), local, text, titleTextId, posButtonTextId, action, bug, point, getHandleBugListener(mapActivity));<NEW_LINE>} else {<NEW_LINE>OsmNotesPoint notesPoint = new OsmNotesPoint();<NEW_LINE>notesPoint.setAction(action);<NEW_LINE>notesPoint.setId(bug.getId());<NEW_LINE>notesPoint.setLatitude(bug.getLatitude());<NEW_LINE>notesPoint.setLongitude(bug.getLongitude());<NEW_LINE>SendOsmNoteBottomSheetFragment.showInstance(mapActivity.getSupportFragmentManager(), <MASK><NEW_LINE>}<NEW_LINE>} | new OsmPoint[] { notesPoint }); |
1,724,816 | public void validate(final Processor<FullData, FullData> processor, final ProcessingReport report, final MessageBundle bundle, final FullData data) throws ProcessingException {<NEW_LINE>final JsonNode instance = data<MASK><NEW_LINE>final NodeType type = NodeType.getNodeType(instance);<NEW_LINE>if (types.contains(type)) {<NEW_LINE>report.error(newMsg(data, bundle, "err.draftv3.disallow.type").putArgument("found", type).putArgument("disallowed", toArrayNode(types)));<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final SchemaTree tree = data.getSchema();<NEW_LINE>final JsonPointer schemaPointer = tree.getPointer();<NEW_LINE>final ObjectNode fullReport = FACTORY.objectNode();<NEW_LINE>JsonPointer ptr;<NEW_LINE>ListProcessingReport subReport;<NEW_LINE>FullData newData;<NEW_LINE>int nrSuccess = 0;<NEW_LINE>for (final int index : schemas) {<NEW_LINE>subReport = new ListProcessingReport(report.getLogLevel(), LogLevel.FATAL);<NEW_LINE>ptr = schemaPointer.append(JsonPointer.of(keyword, index));<NEW_LINE>newData = data.withSchema(tree.setPointer(ptr));<NEW_LINE>processor.process(subReport, newData);<NEW_LINE>fullReport.set(ptr.toString(), subReport.asJson());<NEW_LINE>if (subReport.isSuccess())<NEW_LINE>nrSuccess++;<NEW_LINE>}<NEW_LINE>if (nrSuccess != 0)<NEW_LINE>report.error(newMsg(data, bundle, "err.draftv3.disallow.schema").putArgument("matched", nrSuccess).putArgument("nrSchemas", schemas.size()).put("reports", fullReport));<NEW_LINE>} | .getInstance().getNode(); |
1,267,053 | final GetFederationTokenResult executeGetFederationToken(GetFederationTokenRequest getFederationTokenRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(getFederationTokenRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<GetFederationTokenRequest> request = null;<NEW_LINE>Response<GetFederationTokenResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new GetFederationTokenRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(getFederationTokenRequest));<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, "Connect");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "GetFederationToken");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<GetFederationTokenResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new GetFederationTokenResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>} | endClientExecution(awsRequestMetrics, request, response); |
284,422 | public OStorage fullSync(String dbName, String backupPath, OrientDBConfig config) {<NEW_LINE>final ODatabaseDocumentEmbedded embedded;<NEW_LINE>OAbstractPaginatedStorage storage = null;<NEW_LINE>synchronized (this) {<NEW_LINE>try {<NEW_LINE>storage = storages.get(dbName);<NEW_LINE>if (storage != null) {<NEW_LINE>OCommandCacheSoftRefs.clearFiles(storage);<NEW_LINE>OSharedContext context = sharedContexts.remove(dbName);<NEW_LINE>context.close();<NEW_LINE>storage.delete();<NEW_LINE>storages.remove(dbName);<NEW_LINE>}<NEW_LINE>storage = (OAbstractPaginatedStorage) disk.createStorage(buildName(dbName), new HashMap<>(), maxWALSegmentSize, doubleWriteLogMaxSegSize, generateStorageId());<NEW_LINE>embedded = internalCreate(config, storage);<NEW_LINE>storages.put(dbName, storage);<NEW_LINE>} catch (Exception e) {<NEW_LINE>if (storage != null) {<NEW_LINE>storage.delete();<NEW_LINE>}<NEW_LINE>throw OException.wrapException(new ODatabaseException("Cannot restore database '" <MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>storage.restoreFromIncrementalBackup(backupPath);<NEW_LINE>// DROP AND CREATE THE SHARED CONTEXT SU HAS CORRECT INFORMATION.<NEW_LINE>synchronized (this) {<NEW_LINE>OSharedContext context = sharedContexts.remove(dbName);<NEW_LINE>context.close();<NEW_LINE>}<NEW_LINE>ODatabaseDocumentEmbedded instance = openNoAuthorization(dbName);<NEW_LINE>instance.close();<NEW_LINE>return storage;<NEW_LINE>} | + dbName + "'"), e); |
1,318,843 | public void marshall(ReplicaSettingsUpdate replicaSettingsUpdate, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (replicaSettingsUpdate == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(replicaSettingsUpdate.getRegionName(), REGIONNAME_BINDING);<NEW_LINE>protocolMarshaller.marshall(replicaSettingsUpdate.getReplicaProvisionedReadCapacityUnits(), REPLICAPROVISIONEDREADCAPACITYUNITS_BINDING);<NEW_LINE>protocolMarshaller.marshall(replicaSettingsUpdate.getReplicaProvisionedReadCapacityAutoScalingSettingsUpdate(), REPLICAPROVISIONEDREADCAPACITYAUTOSCALINGSETTINGSUPDATE_BINDING);<NEW_LINE>protocolMarshaller.marshall(<MASK><NEW_LINE>protocolMarshaller.marshall(replicaSettingsUpdate.getReplicaTableClass(), REPLICATABLECLASS_BINDING);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>} | replicaSettingsUpdate.getReplicaGlobalSecondaryIndexSettingsUpdate(), REPLICAGLOBALSECONDARYINDEXSETTINGSUPDATE_BINDING); |
1,007,546 | public Stream<LongResult> neighborsAtHopCount(@Name("node") Node node, @Name(value = "types", defaultValue = "") String types, @Name(value = "distance", defaultValue = "1") Long distance) {<NEW_LINE>if (distance < 1)<NEW_LINE>return Stream.empty();<NEW_LINE>if (types == null || types.isEmpty())<NEW_LINE>return Stream.empty();<NEW_LINE>// Initialize bitmaps for iteration<NEW_LINE>Roaring64NavigableMap[] seen = new Roaring64NavigableMap[distance.intValue()];<NEW_LINE>for (int i = 0; i < distance; i++) {<NEW_LINE>seen<MASK><NEW_LINE>}<NEW_LINE>long nodeId = node.getId();<NEW_LINE>Iterator<Long> iterator;<NEW_LINE>List<Pair<RelationshipType, Direction>> typesAndDirections = parse(types);<NEW_LINE>// First Hop<NEW_LINE>for (Pair<RelationshipType, Direction> pair : typesAndDirections) {<NEW_LINE>for (Relationship r : getRelationshipsByTypeAndDirection(node, pair)) {<NEW_LINE>seen[0].add(r.getOtherNodeId(nodeId));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>for (int i = 1; i < distance; i++) {<NEW_LINE>iterator = seen[i - 1].iterator();<NEW_LINE>while (iterator.hasNext()) {<NEW_LINE>node = tx.getNodeById(iterator.next());<NEW_LINE>for (Pair<RelationshipType, Direction> pair : typesAndDirections) {<NEW_LINE>for (Relationship r : getRelationshipsByTypeAndDirection(node, pair)) {<NEW_LINE>seen[i].add(r.getOtherNodeId(node.getId()));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>for (int j = 0; j < i; j++) {<NEW_LINE>seen[i].andNot(seen[j]);<NEW_LINE>seen[i].removeLong(nodeId);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return Stream.of(new LongResult(seen[distance.intValue() - 1].getLongCardinality()));<NEW_LINE>} | [i] = new Roaring64NavigableMap(); |
781,949 | private static void listenForRenderTreeActivations(@NotNull ToolWindow toolWindow) {<NEW_LINE>final ContentManager contentManager = toolWindow.getContentManager();<NEW_LINE>// TODO: Don't switch to ContentManagerListener until 2020.1.<NEW_LINE>contentManager.addContentManagerListener(new ContentManagerAdapter() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void selectionChanged(@NotNull ContentManagerEvent event) {<NEW_LINE>final ContentManagerEvent.ContentOperation operation = event.getOperation();<NEW_LINE>if (operation == ContentManagerEvent.ContentOperation.add) {<NEW_LINE>final String name = event<MASK><NEW_LINE>if (Objects.equals(name, RENDER_TAB_LABEL)) {<NEW_LINE>FlutterInitializer.getAnalytics().sendEvent("inspector", "renderTreeSelected");<NEW_LINE>} else if (Objects.equals(name, WIDGET_TAB_LABEL)) {<NEW_LINE>FlutterInitializer.getAnalytics().sendEvent("inspector", "widgetTreeSelected");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} | .getContent().getTabName(); |
1,578,742 | public void marshall(ReservationPurchaseRecommendationDetail reservationPurchaseRecommendationDetail, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (reservationPurchaseRecommendationDetail == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(reservationPurchaseRecommendationDetail.getAccountId(), ACCOUNTID_BINDING);<NEW_LINE>protocolMarshaller.marshall(reservationPurchaseRecommendationDetail.getInstanceDetails(), INSTANCEDETAILS_BINDING);<NEW_LINE>protocolMarshaller.marshall(reservationPurchaseRecommendationDetail.getRecommendedNumberOfInstancesToPurchase(), RECOMMENDEDNUMBEROFINSTANCESTOPURCHASE_BINDING);<NEW_LINE>protocolMarshaller.marshall(reservationPurchaseRecommendationDetail.getRecommendedNormalizedUnitsToPurchase(), RECOMMENDEDNORMALIZEDUNITSTOPURCHASE_BINDING);<NEW_LINE>protocolMarshaller.marshall(reservationPurchaseRecommendationDetail.getMinimumNumberOfInstancesUsedPerHour(), MINIMUMNUMBEROFINSTANCESUSEDPERHOUR_BINDING);<NEW_LINE>protocolMarshaller.marshall(reservationPurchaseRecommendationDetail.getMinimumNormalizedUnitsUsedPerHour(), MINIMUMNORMALIZEDUNITSUSEDPERHOUR_BINDING);<NEW_LINE>protocolMarshaller.marshall(reservationPurchaseRecommendationDetail.getMaximumNumberOfInstancesUsedPerHour(), MAXIMUMNUMBEROFINSTANCESUSEDPERHOUR_BINDING);<NEW_LINE>protocolMarshaller.marshall(reservationPurchaseRecommendationDetail.getMaximumNormalizedUnitsUsedPerHour(), MAXIMUMNORMALIZEDUNITSUSEDPERHOUR_BINDING);<NEW_LINE>protocolMarshaller.marshall(reservationPurchaseRecommendationDetail.getAverageNumberOfInstancesUsedPerHour(), AVERAGENUMBEROFINSTANCESUSEDPERHOUR_BINDING);<NEW_LINE>protocolMarshaller.marshall(reservationPurchaseRecommendationDetail.getAverageNormalizedUnitsUsedPerHour(), AVERAGENORMALIZEDUNITSUSEDPERHOUR_BINDING);<NEW_LINE>protocolMarshaller.marshall(reservationPurchaseRecommendationDetail.getAverageUtilization(), AVERAGEUTILIZATION_BINDING);<NEW_LINE>protocolMarshaller.marshall(<MASK><NEW_LINE>protocolMarshaller.marshall(reservationPurchaseRecommendationDetail.getCurrencyCode(), CURRENCYCODE_BINDING);<NEW_LINE>protocolMarshaller.marshall(reservationPurchaseRecommendationDetail.getEstimatedMonthlySavingsAmount(), ESTIMATEDMONTHLYSAVINGSAMOUNT_BINDING);<NEW_LINE>protocolMarshaller.marshall(reservationPurchaseRecommendationDetail.getEstimatedMonthlySavingsPercentage(), ESTIMATEDMONTHLYSAVINGSPERCENTAGE_BINDING);<NEW_LINE>protocolMarshaller.marshall(reservationPurchaseRecommendationDetail.getEstimatedMonthlyOnDemandCost(), ESTIMATEDMONTHLYONDEMANDCOST_BINDING);<NEW_LINE>protocolMarshaller.marshall(reservationPurchaseRecommendationDetail.getEstimatedReservationCostForLookbackPeriod(), ESTIMATEDRESERVATIONCOSTFORLOOKBACKPERIOD_BINDING);<NEW_LINE>protocolMarshaller.marshall(reservationPurchaseRecommendationDetail.getUpfrontCost(), UPFRONTCOST_BINDING);<NEW_LINE>protocolMarshaller.marshall(reservationPurchaseRecommendationDetail.getRecurringStandardMonthlyCost(), RECURRINGSTANDARDMONTHLYCOST_BINDING);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>} | reservationPurchaseRecommendationDetail.getEstimatedBreakEvenInMonths(), ESTIMATEDBREAKEVENINMONTHS_BINDING); |
233,677 | public void marshall(ApplicationSummary applicationSummary, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (applicationSummary == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(applicationSummary.getApplicationId(), APPLICATIONID_BINDING);<NEW_LINE>protocolMarshaller.marshall(applicationSummary.getAuthor(), AUTHOR_BINDING);<NEW_LINE>protocolMarshaller.marshall(applicationSummary.getCreationTime(), CREATIONTIME_BINDING);<NEW_LINE>protocolMarshaller.marshall(applicationSummary.getDescription(), DESCRIPTION_BINDING);<NEW_LINE>protocolMarshaller.marshall(applicationSummary.getHomePageUrl(), HOMEPAGEURL_BINDING);<NEW_LINE>protocolMarshaller.marshall(applicationSummary.getLabels(), LABELS_BINDING);<NEW_LINE>protocolMarshaller.marshall(applicationSummary.getName(), NAME_BINDING);<NEW_LINE>protocolMarshaller.marshall(<MASK><NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>} | applicationSummary.getSpdxLicenseId(), SPDXLICENSEID_BINDING); |
1,061,521 | final CreateBatchPredictionJobResult executeCreateBatchPredictionJob(CreateBatchPredictionJobRequest createBatchPredictionJobRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(createBatchPredictionJobRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<CreateBatchPredictionJobRequest> request = null;<NEW_LINE>Response<CreateBatchPredictionJobResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new CreateBatchPredictionJobRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(createBatchPredictionJobRequest));<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, "FraudDetector");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "CreateBatchPredictionJob");<NEW_LINE>request.<MASK><NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<CreateBatchPredictionJobResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new CreateBatchPredictionJobResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig); |
305,250 | private HttpHeaders toNettyHttpHeaders() {<NEW_LINE>HttpHeaders headers = new DefaultHttpHeaders(this.configuration.validateHeaders());<NEW_LINE>try {<NEW_LINE>Map<String, List<String>> cookieHeaders = this.configuration.cookieManager().get(finalUri, new HashMap<>());<NEW_LINE>List<String> cookies = new ArrayList<>(cookieHeaders.get(Http.Header.COOKIE));<NEW_LINE>cookies.addAll(this.headers.values(Http.Header.COOKIE));<NEW_LINE>if (!cookies.isEmpty()) {<NEW_LINE>headers.add(Http.Header.COOKIE, String<MASK><NEW_LINE>}<NEW_LINE>} catch (IOException e) {<NEW_LINE>throw new WebClientException("An error occurred while setting cookies.", e);<NEW_LINE>}<NEW_LINE>this.headers.toMap().forEach(headers::add);<NEW_LINE>addHeaderIfAbsent(headers, HttpHeaderNames.HOST, finalUri.getHost() + ":" + finalUri.getPort());<NEW_LINE>addHeaderIfAbsent(headers, HttpHeaderNames.CONNECTION, keepAlive ? HttpHeaderValues.KEEP_ALIVE : HttpHeaderValues.CLOSE);<NEW_LINE>addHeaderIfAbsent(headers, HttpHeaderNames.ACCEPT_ENCODING, HttpHeaderValues.GZIP);<NEW_LINE>addHeaderIfAbsent(headers, HttpHeaderNames.USER_AGENT, configuration.userAgent());<NEW_LINE>return headers;<NEW_LINE>} | .join("; ", cookies)); |
928,355 | public void validateOkToDeleteAndExpunge(Slice<Long> thePids) {<NEW_LINE>if (!myDaoConfig.isEnforceReferentialIntegrityOnDelete()) {<NEW_LINE>ourLog.info("Referential integrity on delete disabled. Skipping referential integrity check.");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>List<ResourceLink> conflictResourceLinks = Collections.synchronizedList(new ArrayList<>());<NEW_LINE>PartitionRunner partitionRunner = new PartitionRunner(PROCESS_NAME, THREAD_PREFIX, myDaoConfig.getExpungeBatchSize(<MASK><NEW_LINE>partitionRunner.runInPartitionedThreads(thePids, someTargetPids -> findResourceLinksWithTargetPidIn(thePids.getContent(), someTargetPids, conflictResourceLinks));<NEW_LINE>if (conflictResourceLinks.isEmpty()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>ResourceLink firstConflict = conflictResourceLinks.get(0);<NEW_LINE>// NB-GGG: We previously instantiated these ID values from firstConflict.getSourceResource().getIdDt(), but in a situation where we<NEW_LINE>// actually had to run delete conflict checks in multiple partitions, the executor service starts its own sessions on a per thread basis, and by the time<NEW_LINE>// we arrive here, those sessions are closed. So instead, we resolve them from PIDs, which are eagerly loaded.<NEW_LINE>String sourceResourceId = myIdHelper.resourceIdFromPidOrThrowException(firstConflict.getSourceResourcePid()).toVersionless().getValue();<NEW_LINE>String targetResourceId = myIdHelper.resourceIdFromPidOrThrowException(firstConflict.getTargetResourcePid()).toVersionless().getValue();<NEW_LINE>throw new InvalidRequestException(Msg.code(822) + "DELETE with _expunge=true failed. Unable to delete " + targetResourceId + " because " + sourceResourceId + " refers to it via the path " + firstConflict.getSourcePath());<NEW_LINE>} | ), myDaoConfig.getExpungeThreadCount()); |
301,617 | private boolean quickCheckin(CheckinHandler checkinHandler, TaskMonitor monitor) throws IOException, CancelledException {<NEW_LINE>if (!(versionedFolderItem instanceof DatabaseItem)) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>monitor.checkCanceled();<NEW_LINE>monitor.setMessage("Initiating Check In for " + name);<NEW_LINE>boolean success = false;<NEW_LINE>LocalManagedBufferFile srcFile = null;<NEW_LINE>ManagedBufferFile checkinFile = null;<NEW_LINE>try {<NEW_LINE>synchronized (fileSystem) {<NEW_LINE>// Make sure version does not change by opening for update before checking versions<NEW_LINE>checkinFile = ((DatabaseItem) versionedFolderItem).openForUpdate(folderItem.getCheckoutId());<NEW_LINE>if (versionedFolderItem.getCurrentVersion() != folderItem.getCheckoutVersion()) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>// TODO: assumes folderItem is local - should probably defer createNewVersion to folderItem if possible (requires refactor)<NEW_LINE>srcFile = (LocalManagedBufferFile) ((DatabaseItem) folderItem).open();<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>if (checkinHandler.createKeepFile()) {<NEW_LINE>DomainObject sourceObj = null;<NEW_LINE>try {<NEW_LINE>ContentHandler ch = DomainObjectAdapter.getContentHandler(folderItem.getContentType());<NEW_LINE>sourceObj = ch.getImmutableObject(folderItem, this, DomainFile.DEFAULT_VERSION, -1, monitor);<NEW_LINE>createKeepFile(sourceObj, monitor);<NEW_LINE>} catch (VersionException e) {<NEW_LINE>// ignore - unable to create keep file<NEW_LINE>} finally {<NEW_LINE>if (sourceObj != null) {<NEW_LINE>sourceObj.release(this);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>monitor.checkCanceled();<NEW_LINE>synchronized (fileSystem) {<NEW_LINE>srcFile.createNewVersion(checkinFile, comment, monitor);<NEW_LINE>success = true;<NEW_LINE>}<NEW_LINE>} finally {<NEW_LINE>if (checkinFile != null) {<NEW_LINE>checkinFile.close();<NEW_LINE>}<NEW_LINE>if (srcFile != null) {<NEW_LINE>srcFile.close();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return success;<NEW_LINE>} | String comment = checkinHandler.getComment(); |
817,731 | private void extractParamNamesWithIndexes() {<NEW_LINE>List<String> nameList = new ArrayList<String>();<NEW_LINE>List<Integer> idxList = new ArrayList<Integer>();<NEW_LINE>Annotation[][] params = method.getParameterAnnotations();<NEW_LINE>for (int i = 0; i < params.length; i++) {<NEW_LINE>for (Annotation a : params[i]) {<NEW_LINE>if (a.annotationType().equals(Var.class)) {<NEW_LINE>String name = ((Var) a).value();<NEW_LINE>nameList.add(name);<NEW_LINE>idxList.add(i);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>int size = nameList.size();<NEW_LINE>paramNames = new String[size];<NEW_LINE>valueIdxs = new int[size];<NEW_LINE>for (int i = 0; i < size; i++) {<NEW_LINE>paramNames[i] = nameList.get(i);<NEW_LINE>valueIdxs[i<MASK><NEW_LINE>}<NEW_LINE>} | ] = idxList.get(i); |
432,538 | private void doSwitchStatementsLineBreaks(List<Statement> statements) {<NEW_LINE>boolean arrowMode = statements.stream().anyMatch(s -> s instanceof SwitchCase && ((SwitchCase<MASK><NEW_LINE>Statement previous = null;<NEW_LINE>for (Statement statement : statements) {<NEW_LINE>// will add break in visit(Block) if necessary<NEW_LINE>boolean // will add break in visit(Block) if necessary<NEW_LINE>skip = statement instanceof Block || (arrowMode && !(statement instanceof SwitchCase)) || (statement instanceof EmptyStatement && !this.options.put_empty_statement_on_new_line);<NEW_LINE>if (!skip) {<NEW_LINE>boolean newGroup = !arrowMode && statement instanceof SwitchCase && isSwitchBreakingStatement(previous);<NEW_LINE>int blankLines = newGroup ? this.options.blank_lines_between_statement_groups_in_switch : 0;<NEW_LINE>putBlankLinesBefore(statement, blankLines);<NEW_LINE>}<NEW_LINE>previous = statement;<NEW_LINE>}<NEW_LINE>} | ) s).isSwitchLabeledRule()); |
1,677,011 | private final ExprNode processSetOfAll(TreeNode treeNode, TreeNode[] children, ModuleNode cm) throws AbortException {<NEW_LINE>ExprNode[<MASK><NEW_LINE>int length = (children.length - 3) / 2;<NEW_LINE>FormalParamNode[][] odna = new FormalParamNode[length][0];<NEW_LINE>boolean[] tuples = new boolean[length];<NEW_LINE>ExprNode[] exprs = new ExprNode[length];<NEW_LINE>symbolTable.pushContext(new Context(moduleTable, errors));<NEW_LINE>processQuantBoundArgs(children, 3, odna, tuples, exprs, cm);<NEW_LINE>pushFormalParams(flattenParams(odna));<NEW_LINE>ops[0] = generateExpression(children[1], cm);<NEW_LINE>popFormalParams();<NEW_LINE>symbolTable.popContext();<NEW_LINE>return new OpApplNode(OP_soa, null, ops, odna, tuples, exprs, treeNode, cm);<NEW_LINE>} | ] ops = new ExprNode[1]; |
351,063 | final AssignInstanceResult executeAssignInstance(AssignInstanceRequest assignInstanceRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(assignInstanceRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<AssignInstanceRequest> request = null;<NEW_LINE>Response<AssignInstanceResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new AssignInstanceRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(assignInstanceRequest));<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, "OpsWorks");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "AssignInstance");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<AssignInstanceResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new AssignInstanceResultJsonUnmarshaller());<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()); |
463,943 | final DescribeAcceleratorOfferingsResult executeDescribeAcceleratorOfferings(DescribeAcceleratorOfferingsRequest describeAcceleratorOfferingsRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(describeAcceleratorOfferingsRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DescribeAcceleratorOfferingsRequest> request = null;<NEW_LINE>Response<DescribeAcceleratorOfferingsResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DescribeAcceleratorOfferingsRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(describeAcceleratorOfferingsRequest));<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, "Elastic Inference");<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>HttpResponseHandler<AmazonWebServiceResponse<DescribeAcceleratorOfferingsResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DescribeAcceleratorOfferingsResultJsonUnmarshaller());<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, "DescribeAcceleratorOfferings"); |
1,045,462 | public CompletableFuture<TxnSegments> createTransaction(final Stream stream, final long lease) {<NEW_LINE>Exceptions.checkNotClosed(closed.get(), this);<NEW_LINE>Preconditions.checkNotNull(stream, "stream");<NEW_LINE>final long requestId = requestIdGenerator.get();<NEW_LINE>long traceId = LoggerHelpers.traceEnter(log, <MASK><NEW_LINE>final CompletableFuture<CreateTxnResponse> result = this.retryConfig.runAsync(() -> {<NEW_LINE>RPCAsyncCallback<CreateTxnResponse> callback = new RPCAsyncCallback<>(traceId, "createTransaction", stream, lease);<NEW_LINE>new ControllerClientTagger(client, timeoutMillis).withTag(requestId, CREATE_TRANSACTION, stream.getScope(), stream.getStreamName(), Long.toString(lease)).createTransaction(CreateTxnRequest.newBuilder().setStreamInfo(ModelHelper.createStreamInfo(stream.getScope(), stream.getStreamName())).setLease(lease).build(), callback);<NEW_LINE>return callback.getFuture();<NEW_LINE>}, this.executor);<NEW_LINE>return result.thenApplyAsync(this::convert, this.executor).whenComplete((x, e) -> {<NEW_LINE>if (e != null) {<NEW_LINE>log.warn(requestId, "createTransaction on stream {} failed: ", stream.getStreamName(), e);<NEW_LINE>}<NEW_LINE>LoggerHelpers.traceLeave(log, "createTransaction", traceId, requestId);<NEW_LINE>});<NEW_LINE>} | "createTransaction", stream, lease, requestId); |
307,905 | public void actionPerformed(final ActionEvent ae) {<NEW_LINE>SHTMLEditorPane editorPane = panel.getSHTMLEditorPane();<NEW_LINE>final Element linkElement = editorPane.getCurrentLinkElement();<NEW_LINE>final boolean foundLink = (linkElement != null);<NEW_LINE>final String linkAsString;<NEW_LINE>if (foundLink) {<NEW_LINE>final AttributeSet elemAttrs = linkElement.getAttributes();<NEW_LINE>final Object linkAttr = elemAttrs.getAttribute(HTML.Tag.A);<NEW_LINE>final Object href = ((AttributeSet) linkAttr).getAttribute(HTML.Attribute.HREF);<NEW_LINE>if (href != null) {<NEW_LINE>linkAsString = href.toString();<NEW_LINE>} else<NEW_LINE>linkAsString = "http://";<NEW_LINE>} else {<NEW_LINE>linkAsString = "http://";<NEW_LINE>}<NEW_LINE>final String inputValue = UITools.showInputDialog(Controller.getCurrentController().getSelection().getSelected(), TextUtils.getText("edit_link_manually"), linkAsString);<NEW_LINE>if (inputValue != null && !inputValue.matches("\\w+://")) {<NEW_LINE>SHTMLEditorPane editor = panel.getSHTMLEditorPane();<NEW_LINE>if (inputValue.equals("")) {<NEW_LINE>editor.setLink(null, null, null);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>final Hyperlink link = LinkController.createHyperlink(inputValue.trim());<NEW_LINE>editor.setLink(null, <MASK><NEW_LINE>} catch (final URISyntaxException e1) {<NEW_LINE>LogUtils.warn(e1);<NEW_LINE>UITools.errorMessage(TextUtils.format("invalid_uri", inputValue));<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>panel.updateActions();<NEW_LINE>} | link.toString(), null); |
1,740,707 | protected void drawFilter() {<NEW_LINE>if (shouldLoad) {<NEW_LINE>releaseTexture();<NEW_LINE>streamObjectTextureId = textureLoader.load(streamObject.getBitmaps());<NEW_LINE>shouldLoad = false;<NEW_LINE>}<NEW_LINE>GLES20.glUseProgram(program);<NEW_LINE>squareVertex.position(SQUARE_VERTEX_DATA_POS_OFFSET);<NEW_LINE>GLES20.glVertexAttribPointer(aPositionHandle, 3, GLES20.GL_FLOAT, false, SQUARE_VERTEX_DATA_STRIDE_BYTES, squareVertex);<NEW_LINE>GLES20.glEnableVertexAttribArray(aPositionHandle);<NEW_LINE>squareVertex.position(SQUARE_VERTEX_DATA_UV_OFFSET);<NEW_LINE>GLES20.glVertexAttribPointer(aTextureHandle, 2, GLES20.GL_FLOAT, false, SQUARE_VERTEX_DATA_STRIDE_BYTES, squareVertex);<NEW_LINE>GLES20.glEnableVertexAttribArray(aTextureHandle);<NEW_LINE>squareVertexObject.position(SQUARE_VERTEX_DATA_POS_OFFSET);<NEW_LINE>GLES20.glVertexAttribPointer(aTextureObjectHandle, 2, GLES20.GL_FLOAT, <MASK><NEW_LINE>GLES20.glEnableVertexAttribArray(aTextureObjectHandle);<NEW_LINE>GLES20.glUniformMatrix4fv(uMVPMatrixHandle, 1, false, MVPMatrix, 0);<NEW_LINE>GLES20.glUniformMatrix4fv(uSTMatrixHandle, 1, false, STMatrix, 0);<NEW_LINE>// Sampler<NEW_LINE>GLES20.glUniform1i(uSamplerHandle, 4);<NEW_LINE>GLES20.glActiveTexture(GLES20.GL_TEXTURE4);<NEW_LINE>GLES20.glBindTexture(GLES20.GL_TEXTURE_2D, previousTexId);<NEW_LINE>// Object<NEW_LINE>GLES20.glUniform1i(uObjectHandle, 0);<NEW_LINE>GLES20.glActiveTexture(GLES20.GL_TEXTURE0);<NEW_LINE>GLES20.glBindTexture(GLES20.GL_TEXTURE_2D, streamObjectTextureId[0]);<NEW_LINE>GLES20.glUniform1f(uSensitiveHandle, sensitive);<NEW_LINE>} | false, 2 * FLOAT_SIZE_BYTES, squareVertexObject); |
1,009,139 | public boolean apply(Game game, Ability source) {<NEW_LINE>// In the case that the enchantment is blinked<NEW_LINE>Permanent enchantment = (Permanent) game.getLastKnownInformation(source.getSourceId(), Zone.BATTLEFIELD);<NEW_LINE>if (enchantment == null) {<NEW_LINE>// It was not blinked, use the standard method<NEW_LINE>enchantment = game.getPermanentOrLKIBattlefield(source.getSourceId());<NEW_LINE>}<NEW_LINE>if (enchantment != null) {<NEW_LINE>Player enchantedPlayer = game.getPlayer(enchantment.getAttachedTo());<NEW_LINE>if (enchantedPlayer != null) {<NEW_LINE>Set<UUID> players = new HashSet<>();<NEW_LINE>for (UUID attacker : game.getCombat().getAttackers()) {<NEW_LINE>UUID defender = game.getCombat().getDefenderId(attacker);<NEW_LINE>if (defender.equals(enchantedPlayer.getId()) && game.getPlayer(source.getControllerId()).hasOpponent(game.getPermanent(attacker).getControllerId(), game)) {<NEW_LINE>players.add(game.getPermanent(attacker).getControllerId());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>players.<MASK><NEW_LINE>for (UUID player : players) {<NEW_LINE>game.getPlayer(player);<NEW_LINE>Effect effect = new DrawCardTargetEffect(1);<NEW_LINE>effect.setTargetPointer(new FixedTarget(player));<NEW_LINE>effect.apply(game, source);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>} | add(source.getControllerId()); |
387,219 | public void updateDataList() {<NEW_LINE>if (dataTable == null) {<NEW_LINE>if (tc.isDebugEnabled())<NEW_LINE>Tr.debug(tc, "PmiAbstractModule.updateDataList: module data is not initialized");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>dataList.clear();<NEW_LINE>Iterator members = dataTable.values().iterator();<NEW_LINE>while (members.hasNext()) {<NEW_LINE>SpdData data = <MASK><NEW_LINE>if (data.isEnabled()) {<NEW_LINE>StatisticImpl s = data.getStatistic();<NEW_LINE>if (s == null) {<NEW_LINE>Tr.warning(tc, "PMI9999E", "PmiAbstractModule.updateDataList: " + getModuleID() + ", " + getName());<NEW_LINE>Tr.warning(tc, "PMI9999E", new Exception().fillInStackTrace());<NEW_LINE>} else<NEW_LINE>dataList.add(s);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// flag to indicate if all counters are disabled<NEW_LINE>// the dataList is updated when the instrumentation level is changed<NEW_LINE>// CUSTOM PMI:statisticActionLsnr can be called here to indicate if all counters are disabled<NEW_LINE>if (dataList.size() > 0) {<NEW_LINE>if (// true -> false<NEW_LINE>bAllCountersDisabled) {<NEW_LINE>bAllCountersDisabled = false;<NEW_LINE>// 215921<NEW_LINE>counterStateChanged(false);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>if (// false -> true<NEW_LINE>!bAllCountersDisabled) {<NEW_LINE>bAllCountersDisabled = true;<NEW_LINE>// 215921<NEW_LINE>counterStateChanged(true);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | (SpdData) members.next(); |
536,006 | // ===================================================================================<NEW_LINE>// Basic Override<NEW_LINE>// ==============<NEW_LINE>@Override<NEW_LINE>protected String doBuildColumnString(String dm) {<NEW_LINE>StringBuilder sb = new StringBuilder();<NEW_LINE>sb.append(dm).append(accessType);<NEW_LINE>sb.append(dm).append(clientIp);<NEW_LINE>sb.append(dm).append(hitCount);<NEW_LINE>sb.append(dm).append(hitCountRelation);<NEW_LINE>sb.append(dm).append(languages);<NEW_LINE>sb.append(dm).append(queryId);<NEW_LINE>sb.append(dm).append(queryOffset);<NEW_LINE>sb.append(dm).append(queryPageSize);<NEW_LINE>sb.append(dm).append(queryTime);<NEW_LINE>sb.append(dm).append(referer);<NEW_LINE>sb.append(dm).append(requestedAt);<NEW_LINE>sb.append<MASK><NEW_LINE>sb.append(dm).append(roles);<NEW_LINE>sb.append(dm).append(searchWord);<NEW_LINE>sb.append(dm).append(user);<NEW_LINE>sb.append(dm).append(userAgent);<NEW_LINE>sb.append(dm).append(userInfoId);<NEW_LINE>sb.append(dm).append(userSessionId);<NEW_LINE>sb.append(dm).append(virtualHost);<NEW_LINE>if (sb.length() > dm.length()) {<NEW_LINE>sb.delete(0, dm.length());<NEW_LINE>}<NEW_LINE>sb.insert(0, "{").append("}");<NEW_LINE>return sb.toString();<NEW_LINE>} | (dm).append(responseTime); |
248,657 | public static void response(ShardingService shardingService, String stmt) {<NEW_LINE>ShowTablesStmtInfo info;<NEW_LINE>try {<NEW_LINE>info = new ShowTablesStmtInfo(stmt);<NEW_LINE>} catch (Exception e) {<NEW_LINE>shardingService.writeErrMessage(ErrorCode.ER_PARSE_ERROR, e.toString());<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (info.getLike() != null && info.getWhere() != null) {<NEW_LINE>shardingService.writeErrMessage("42000", "only allow LIKE or WHERE clause in statement", ErrorCode.ER_PARSE_ERROR);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>String showSchema = info.getSchema();<NEW_LINE>if (showSchema != null && DbleServer.getInstance().getSystemVariables().isLowerCaseTableNames()) {<NEW_LINE>showSchema = showSchema.toLowerCase();<NEW_LINE>}<NEW_LINE>String cSchema = showSchema == null ? shardingService.getSchema() : showSchema;<NEW_LINE>if (cSchema == null) {<NEW_LINE>shardingService.writeErrMessage("3D000", "No database selected", ErrorCode.ER_NO_DB_ERROR);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>SchemaConfig schema = DbleServer.getInstance().getConfig().getSchemas().get(cSchema);<NEW_LINE>if (schema == null) {<NEW_LINE>shardingService.writeErrMessage("42000", "Unknown database '" + cSchema + "'", ErrorCode.ER_BAD_DB_ERROR);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>ShardingUserConfig user = (ShardingUserConfig) (DbleServer.getInstance().getConfig().getUsers().get(shardingService.getUser()));<NEW_LINE>if (user == null || !user.getSchemas().contains(cSchema)) {<NEW_LINE>shardingService.writeErrMessage("42000", "Access denied for user '" + shardingService.getUser() + "' to database '" + cSchema + "'", ErrorCode.ER_DBACCESS_DENIED_ERROR);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// if sharding has default single node ,show tables will send to backend<NEW_LINE>if (schema.isDefaultSingleNode()) {<NEW_LINE>String node = schema.getDefaultSingleNode();<NEW_LINE>try {<NEW_LINE>parserAndExecuteShowTables(shardingService, stmt, node, info);<NEW_LINE>} catch (Exception e) {<NEW_LINE>shardingService.writeErrMessage(ErrorCode.ER_PARSE_ERROR, e.toString());<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>} | responseDirect(shardingService, cSchema, info); |
1,122,051 | private Mono<PagedResponse<GuestUsagesResourceInner>> listByResourceGroupSinglePageAsync(String resourceGroupName, 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.<MASK><NEW_LINE>}<NEW_LINE>final String accept = "application/json";<NEW_LINE>context = this.client.mergeContext(context);<NEW_LINE>return service.listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, accept, context).map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null));<NEW_LINE>} | error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); |
102,321 | private static FailedToBuildExtensionException wrap(ExtensionFactory extensionFactory, Throwable e) {<NEW_LINE>StringBuilder message = new StringBuilder("Failed to build kernel extension ").append(extensionFactory);<NEW_LINE>if (e instanceof LinkageError || e instanceof ReflectiveOperationException) {<NEW_LINE>if (e instanceof LinkageError) {<NEW_LINE>message.append(" because it is compiled with a reference to a class, method, or field, that is not in the class path: ");<NEW_LINE>} else {<NEW_LINE>message.append(" because it a reflective access to a class, method, or field, that is not in the class path: ");<NEW_LINE>}<NEW_LINE>message.append('\'').append(e.getMessage()).append('\'');<NEW_LINE>message.append(". The most common cause of this problem, is that Neo4j has been upgraded without also upgrading all");<NEW_LINE>message.append("installed extensions, such as APOC. ");<NEW_LINE>message.append("Make sure that all of your extensions are build against your specific version of Neo4j.");<NEW_LINE>} else {<NEW_LINE>message.append(" because of an unanticipated error: '").append(e.getMessage()).append("'.");<NEW_LINE>}<NEW_LINE>return new FailedToBuildExtensionException(<MASK><NEW_LINE>} | message.toString(), e); |
465,172 | private static void tryAssertion18(RegressionEnvironment env, String stmtText, String outputLimit, AtomicInteger milestone) {<NEW_LINE>sendTimer(env, 0);<NEW_LINE>env.compileDeploy(stmtText).addListener("s0");<NEW_LINE>String[] fields = new String[] { "symbol", "sum(price)" };<NEW_LINE>ResultAssertTestResult expected = new ResultAssertTestResult(CATEGORY, outputLimit, fields);<NEW_LINE>expected.addResultInsert(1200, 0, new Object[][] { { "IBM", 25d }, { "MSFT", 9d } });<NEW_LINE>expected.addResultInsert(2200, 0, new Object[][] { { "IBM", 75d }, { "MSFT", 9d }, { "YAH", 1d } });<NEW_LINE>expected.addResultInsert(3200, 0, new Object[][] { { "IBM", 75d }, { "MSFT", 9d }, { "YAH", 1d } });<NEW_LINE>expected.addResultInsert(4200, 0, new Object[][] { { "IBM", 75d }, { "MSFT", 9d }, { "YAH", 3d } });<NEW_LINE>expected.addResultInsert(5200, 0, new Object[][] { { "IBM", 97d }, { "MSFT", 9d }<MASK><NEW_LINE>expected.addResultInsert(6200, 0, new Object[][] { { "IBM", 72d }, { "MSFT", 9d }, { "YAH", 7d } });<NEW_LINE>expected.addResultInsert(7200, 0, new Object[][] { { "IBM", 48d }, { "YAH", 6d } });<NEW_LINE>ResultAssertExecution execution = new ResultAssertExecution(stmtText, env, expected);<NEW_LINE>execution.execute(false, milestone);<NEW_LINE>} | , { "YAH", 6d } }); |
1,394,933 | public File runFilter(final File file, Map<String, String[]> parameters) {<NEW_LINE>final String[] widthParam = parameters.get(getPrefix() + "w");<NEW_LINE>int width = widthParam != null ? Integer.parseInt(widthParam[0]) : 0;<NEW_LINE>final String[] heightParam = parameters.<MASK><NEW_LINE>int height = heightParam != null ? Integer.parseInt(heightParam[0]) : 0;<NEW_LINE>File resultFile = getResultsFile(file, parameters, "png");<NEW_LINE>if (!overwrite(resultFile, parameters)) {<NEW_LINE>return resultFile;<NEW_LINE>}<NEW_LINE>resultFile.delete();<NEW_LINE>// subsample from stream<NEW_LINE>BufferedImage srcImage = ImageFilterAPI.apiInstance.get().subsampleImage(file, width, height);<NEW_LINE>File tempResultFile = new File(resultFile.getAbsoluteFile() + "_" + System.currentTimeMillis() + ".tmp");<NEW_LINE>try {<NEW_LINE>ImageIO.write(srcImage, "png", tempResultFile);<NEW_LINE>tempResultFile.renameTo(resultFile);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new DotRuntimeException("unable to convert file:" + file + " : " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>return resultFile;<NEW_LINE>} | get(getPrefix() + "h"); |
213,499 | public static ListProductQuotaDimensionsResponse unmarshall(ListProductQuotaDimensionsResponse listProductQuotaDimensionsResponse, UnmarshallerContext _ctx) {<NEW_LINE>listProductQuotaDimensionsResponse.setRequestId(_ctx.stringValue("ListProductQuotaDimensionsResponse.RequestId"));<NEW_LINE>listProductQuotaDimensionsResponse.setTotalCount(_ctx.integerValue("ListProductQuotaDimensionsResponse.TotalCount"));<NEW_LINE>listProductQuotaDimensionsResponse.setNextToken(_ctx.stringValue("ListProductQuotaDimensionsResponse.NextToken"));<NEW_LINE>listProductQuotaDimensionsResponse.setMaxResults(_ctx.integerValue("ListProductQuotaDimensionsResponse.MaxResults"));<NEW_LINE>List<QuotaDimensionsItem> quotaDimensions = new ArrayList<QuotaDimensionsItem>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("ListProductQuotaDimensionsResponse.QuotaDimensions.Length"); i++) {<NEW_LINE>QuotaDimensionsItem quotaDimensionsItem = new QuotaDimensionsItem();<NEW_LINE>quotaDimensionsItem.setDimensionKey(_ctx.stringValue("ListProductQuotaDimensionsResponse.QuotaDimensions[" + i + "].DimensionKey"));<NEW_LINE>quotaDimensionsItem.setName(_ctx.stringValue("ListProductQuotaDimensionsResponse.QuotaDimensions[" + i + "].Name"));<NEW_LINE>quotaDimensionsItem.setRequisite(_ctx.booleanValue("ListProductQuotaDimensionsResponse.QuotaDimensions[" + i + "].Requisite"));<NEW_LINE>List<String> dimensionValues = new ArrayList<String>();<NEW_LINE>for (int j = 0; j < _ctx.lengthValue("ListProductQuotaDimensionsResponse.QuotaDimensions[" + i + "].DimensionValues.Length"); j++) {<NEW_LINE>dimensionValues.add(_ctx.stringValue("ListProductQuotaDimensionsResponse.QuotaDimensions[" + i + "].DimensionValues[" + j + "]"));<NEW_LINE>}<NEW_LINE>quotaDimensionsItem.setDimensionValues(dimensionValues);<NEW_LINE>List<String> dependentDimensions = new ArrayList<String>();<NEW_LINE>for (int j = 0; j < _ctx.lengthValue("ListProductQuotaDimensionsResponse.QuotaDimensions[" + i + "].DependentDimensions.Length"); j++) {<NEW_LINE>dependentDimensions.add(_ctx.stringValue("ListProductQuotaDimensionsResponse.QuotaDimensions[" + i + "].DependentDimensions[" + j + "]"));<NEW_LINE>}<NEW_LINE>quotaDimensionsItem.setDependentDimensions(dependentDimensions);<NEW_LINE>List<DimensionValueDetailItem> dimensionValueDetail <MASK><NEW_LINE>for (int j = 0; j < _ctx.lengthValue("ListProductQuotaDimensionsResponse.QuotaDimensions[" + i + "].DimensionValueDetail.Length"); j++) {<NEW_LINE>DimensionValueDetailItem dimensionValueDetailItem = new DimensionValueDetailItem();<NEW_LINE>dimensionValueDetailItem.setValue(_ctx.stringValue("ListProductQuotaDimensionsResponse.QuotaDimensions[" + i + "].DimensionValueDetail[" + j + "].Value"));<NEW_LINE>dimensionValueDetailItem.setName(_ctx.stringValue("ListProductQuotaDimensionsResponse.QuotaDimensions[" + i + "].DimensionValueDetail[" + j + "].Name"));<NEW_LINE>dimensionValueDetail.add(dimensionValueDetailItem);<NEW_LINE>}<NEW_LINE>quotaDimensionsItem.setDimensionValueDetail(dimensionValueDetail);<NEW_LINE>quotaDimensions.add(quotaDimensionsItem);<NEW_LINE>}<NEW_LINE>listProductQuotaDimensionsResponse.setQuotaDimensions(quotaDimensions);<NEW_LINE>return listProductQuotaDimensionsResponse;<NEW_LINE>} | = new ArrayList<DimensionValueDetailItem>(); |
121,051 | final StopReplicationTaskResult executeStopReplicationTask(StopReplicationTaskRequest stopReplicationTaskRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(stopReplicationTaskRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<StopReplicationTaskRequest> request = null;<NEW_LINE>Response<StopReplicationTaskResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new StopReplicationTaskRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(stopReplicationTaskRequest));<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, "Database Migration Service");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "StopReplicationTask");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<StopReplicationTaskResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(<MASK><NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | false), new StopReplicationTaskResultJsonUnmarshaller()); |
367,976 | private void applyOptions() {<NEW_LINE>Lines lines = getDocumentLines();<NEW_LINE>if (lines != null) {<NEW_LINE><MASK><NEW_LINE>lines.setDefColor(IOColors.OutputType.OUTPUT, opts.getColorStandard());<NEW_LINE>lines.setDefColor(IOColors.OutputType.ERROR, opts.getColorError());<NEW_LINE>lines.setDefColor(IOColors.OutputType.INPUT, opts.getColorInput());<NEW_LINE>lines.setDefColor(IOColors.OutputType.HYPERLINK, opts.getColorLink());<NEW_LINE>lines.setDefColor(IOColors.OutputType.HYPERLINK_IMPORTANT, opts.getColorLinkImportant());<NEW_LINE>Color bg = io.getOptions().getColorBackground();<NEW_LINE>getOutputPane().getFoldingSideBar().setForeground(opts.getColorStandard());<NEW_LINE>setTextViewBackground(getOutputPane().getTextView(), bg);<NEW_LINE>getOutputPane().setViewFont(io.getOptions().getFont(getOutputPane().isWrapped()));<NEW_LINE>}<NEW_LINE>} | OutputOptions opts = io.getOptions(); |
866,129 | public void handleEvent(Event event) {<NEW_LINE>try {<NEW_LINE>String url_str = feedUrl.getText();<NEW_LINE>URL url = new URL(url_str);<NEW_LINE>Map user_data = new HashMap();<NEW_LINE>user_data.put(SubscriptionManagerUI.SUB_EDIT_MODE_KEY, Boolean.TRUE);<NEW_LINE><MASK><NEW_LINE>String subs_name = subsName.getText().trim();<NEW_LINE>if (subs_name.length() == 0) {<NEW_LINE>subs_name = url_str;<NEW_LINE>}<NEW_LINE>Subscription subRSS = SubscriptionManagerFactory.getSingleton().createRSS(subs_name, url, SubscriptionHistory.DEFAULT_CHECK_INTERVAL_MINS, anonymous, user_data);<NEW_LINE>if (anonymous) {<NEW_LINE>subRSS.getHistory().setDownloadNetworks(new String[] { AENetworkClassifier.AT_I2P });<NEW_LINE>}<NEW_LINE>if (frequency != 0) {<NEW_LINE>subRSS.getHistory().setCheckFrequencyMins(frequency);<NEW_LINE>}<NEW_LINE>shell.close();<NEW_LINE>final String key = "Subscription_" + ByteFormatter.encodeString(subRSS.getPublicKey());<NEW_LINE>MultipleDocumentInterface mdi = UIFunctionsManager.getUIFunctions().getMDI();<NEW_LINE>mdi.showEntryByID(key);<NEW_LINE>} catch (Throwable e) {<NEW_LINE>Utils.reportError(e);<NEW_LINE>}<NEW_LINE>} | boolean anonymous = anonCheck.getSelection(); |
1,305,387 | public static <T> Class<T> classForName(String name, ClassLoader... loaders) throws ClassNotFoundException {<NEW_LINE>try {<NEW_LINE>if (Thread.currentThread().getContextClassLoader() != null) {<NEW_LINE>return (Class<T>) Class.forName(name, true, Thread.currentThread().getContextClassLoader());<NEW_LINE>} else {<NEW_LINE>return (Class<T<MASK><NEW_LINE>}<NEW_LINE>} catch (ClassNotFoundException e) {<NEW_LINE>for (ClassLoader l : loaders) {<NEW_LINE>try {<NEW_LINE>return (Class<T>) Class.forName(name, true, l);<NEW_LINE>} catch (ClassNotFoundException ex) {<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (Thread.currentThread().getContextClassLoader() != null) {<NEW_LINE>throw new ClassNotFoundException("Could not load class " + name + " with the context class loader " + Thread.currentThread().getContextClassLoader().toString() + " or any of the additional ClassLoaders: " + Arrays.toString(loaders));<NEW_LINE>} else {<NEW_LINE>throw new ClassNotFoundException("Could not load class " + name + " using Class.forName or using any of the additional ClassLoaders: " + Arrays.toString(loaders));<NEW_LINE>}<NEW_LINE>} | >) Class.forName(name); |
284,643 | private KeyNamePair[] retrieveChangedPeriods() {<NEW_LINE>final String sql = // standard period<NEW_LINE>"SELECT DISTINCT p.C_Period_ID, p.Name FROM C_Period p " + "INNER JOIN C_Year y ON (y.C_Year_ID=p.C_Year_ID) " + "INNER JOIN PA_ReportCube c ON (c.C_Calendar_ID = y.C_Calendar_ID) " + "INNER JOIN Fact_Acct fact ON (fact.dateacct between p.startdate and p.enddate " + " and fact.ad_client_id = c.ad_client_id) " + "WHERE c.PA_ReportCube_ID = ? " + "AND fact.updated > c.LastRecalculated " + "AND p.periodtype='S' ";<NEW_LINE>log.debug(sql);<NEW_LINE>final int paReportCubeId = getPA_ReportCube_ID();<NEW_LINE>final long startMillis = System.currentTimeMillis();<NEW_LINE>final KeyNamePair[] changedPeriods = DB.getKeyNamePairs(sql, false, paReportCubeId);<NEW_LINE>final long elapsedSec = (System.<MASK><NEW_LINE>log.debug("Selecting changed periods took:" + elapsedSec + "s");<NEW_LINE>return changedPeriods;<NEW_LINE>} | currentTimeMillis() - startMillis) / 1000; |
743,844 | int newPath_(int geom) {<NEW_LINE>if (m_path_index_list == null) {<NEW_LINE>m_path_index_list = new StridedIndexTypeCollection(8);<NEW_LINE>m_vertex_index_list = new StridedIndexTypeCollection(5);<NEW_LINE>m_path_areas = new AttributeStreamOfDbl(0);<NEW_LINE>m_path_lengths = new AttributeStreamOfDbl(0);<NEW_LINE>}<NEW_LINE>int index = m_path_index_list.newElement();<NEW_LINE>int <MASK><NEW_LINE>// size<NEW_LINE>m_path_index_list.setField(index, 0, pindex);<NEW_LINE>// m_path_index_list.set(index + 1, -1);//prev<NEW_LINE>// m_path_index_list.set(index + 2, -1);//next<NEW_LINE>// size<NEW_LINE>m_path_index_list.setField(index, 3, 0);<NEW_LINE>// m_path_index_list.set(index + 4, -1);//first vertex handle<NEW_LINE>// m_path_index_list.set(index + 5, -1);//last vertex handle<NEW_LINE>// path flags<NEW_LINE>m_path_index_list.setField(index, 6, 0);<NEW_LINE>setPathGeometry_(index, geom);<NEW_LINE>if (pindex >= m_path_areas.size()) {<NEW_LINE>int sz = pindex < 16 ? 16 : (pindex * 3) / 2;<NEW_LINE>m_path_areas.resize(sz);<NEW_LINE>m_path_lengths.resize(sz);<NEW_LINE>// if (m_path_envelopes)<NEW_LINE>// m_path_envelopes.resize(sz);<NEW_LINE>}<NEW_LINE>m_path_areas.set(pindex, 0);<NEW_LINE>m_path_lengths.set(pindex, 0);<NEW_LINE>// if (m_path_envelopes)<NEW_LINE>// m_path_envelopes.set(pindex, nullptr);<NEW_LINE>m_path_count++;<NEW_LINE>return index;<NEW_LINE>} | pindex = m_path_index_list.elementToIndex(index); |
613,947 | public Request<ReportInstanceStatusRequest> marshall(ReportInstanceStatusRequest reportInstanceStatusRequest) {<NEW_LINE>if (reportInstanceStatusRequest == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>Request<ReportInstanceStatusRequest> request = new DefaultRequest<ReportInstanceStatusRequest>(reportInstanceStatusRequest, "AmazonEC2");<NEW_LINE>request.addParameter("Action", "ReportInstanceStatus");<NEW_LINE>request.addParameter("Version", "2016-11-15");<NEW_LINE>request.setHttpMethod(HttpMethodName.POST);<NEW_LINE>if (reportInstanceStatusRequest.getDescription() != null) {<NEW_LINE>request.addParameter("Description", StringUtils.fromString(reportInstanceStatusRequest.getDescription()));<NEW_LINE>}<NEW_LINE>if (reportInstanceStatusRequest.getEndTime() != null) {<NEW_LINE>request.addParameter("EndTime", StringUtils.fromDate(reportInstanceStatusRequest.getEndTime()));<NEW_LINE>}<NEW_LINE>com.amazonaws.internal.SdkInternalList<String> reportInstanceStatusRequestInstancesList = (com.amazonaws.internal.SdkInternalList<String>) reportInstanceStatusRequest.getInstances();<NEW_LINE>if (!reportInstanceStatusRequestInstancesList.isEmpty() || !reportInstanceStatusRequestInstancesList.isAutoConstruct()) {<NEW_LINE>int instancesListIndex = 1;<NEW_LINE>for (String reportInstanceStatusRequestInstancesListValue : reportInstanceStatusRequestInstancesList) {<NEW_LINE>if (reportInstanceStatusRequestInstancesListValue != null) {<NEW_LINE>request.addParameter("InstanceId." + instancesListIndex<MASK><NEW_LINE>}<NEW_LINE>instancesListIndex++;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>com.amazonaws.internal.SdkInternalList<String> reportInstanceStatusRequestReasonCodesList = (com.amazonaws.internal.SdkInternalList<String>) reportInstanceStatusRequest.getReasonCodes();<NEW_LINE>if (!reportInstanceStatusRequestReasonCodesList.isEmpty() || !reportInstanceStatusRequestReasonCodesList.isAutoConstruct()) {<NEW_LINE>int reasonCodesListIndex = 1;<NEW_LINE>for (String reportInstanceStatusRequestReasonCodesListValue : reportInstanceStatusRequestReasonCodesList) {<NEW_LINE>if (reportInstanceStatusRequestReasonCodesListValue != null) {<NEW_LINE>request.addParameter("ReasonCode." + reasonCodesListIndex, StringUtils.fromString(reportInstanceStatusRequestReasonCodesListValue));<NEW_LINE>}<NEW_LINE>reasonCodesListIndex++;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (reportInstanceStatusRequest.getStartTime() != null) {<NEW_LINE>request.addParameter("StartTime", StringUtils.fromDate(reportInstanceStatusRequest.getStartTime()));<NEW_LINE>}<NEW_LINE>if (reportInstanceStatusRequest.getStatus() != null) {<NEW_LINE>request.addParameter("Status", StringUtils.fromString(reportInstanceStatusRequest.getStatus()));<NEW_LINE>}<NEW_LINE>return request;<NEW_LINE>} | , StringUtils.fromString(reportInstanceStatusRequestInstancesListValue)); |
1,398,341 | public Object apply(final ActionContext ctx, final Object caller, final Object[] sources) throws FrameworkException {<NEW_LINE>// use String here because the actual type of the query is not known yet<NEW_LINE>String sortKey = "name";<NEW_LINE>boolean sortDescending = false;<NEW_LINE>try {<NEW_LINE>assertArrayHasMinLengthAndAllElementsNotNull(sources, 1);<NEW_LINE>switch(sources.length) {<NEW_LINE>// no break here<NEW_LINE>case 2:<NEW_LINE>sortDescending = "true".equals(sources[1].toString().toLowerCase());<NEW_LINE>case 1:<NEW_LINE>sortKey = sources[0].toString();<NEW_LINE>}<NEW_LINE>if (sortKey.contains(".")) {<NEW_LINE>return new SortPathPredicate(sortKey, sortDescending);<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>} catch (final IllegalArgumentException e) {<NEW_LINE>logParameterError(caller, sources, ctx.isJavaScriptContext());<NEW_LINE>return usage(ctx.isJavaScriptContext());<NEW_LINE>}<NEW_LINE>} | return new SortPredicate(sortKey, sortDescending); |
1,284,967 | public static RowBaseIterator showInstances() {<NEW_LINE>MycatRouterConfig routerConfig = MetaClusterCurrent.wrapper(MycatRouterConfig.class);<NEW_LINE>ReplicaSelectorManager replicaSelectorRuntime = MetaClusterCurrent.wrapper(ReplicaSelectorManager.class);<NEW_LINE>ResultSetBuilder resultSetBuilder = ResultSetBuilder.create();<NEW_LINE>resultSetBuilder.addColumnInfo("NAME", JDBCType.VARCHAR);<NEW_LINE>resultSetBuilder.addColumnInfo("ALIVE", JDBCType.VARCHAR);<NEW_LINE>resultSetBuilder.addColumnInfo("READABLE", JDBCType.VARCHAR);<NEW_LINE>resultSetBuilder.addColumnInfo("TYPE", JDBCType.VARCHAR);<NEW_LINE>resultSetBuilder.addColumnInfo("SESSION_COUNT", JDBCType.BIGINT);<NEW_LINE>resultSetBuilder.addColumnInfo("WEIGHT", JDBCType.BIGINT);<NEW_LINE>resultSetBuilder.addColumnInfo("MASTER", JDBCType.VARCHAR);<NEW_LINE>resultSetBuilder.addColumnInfo("LIMIT_SESSION_COUNT", JDBCType.BIGINT);<NEW_LINE>resultSetBuilder.addColumnInfo("REPLICA", JDBCType.VARCHAR);<NEW_LINE>Collection<PhysicsInstance> values = replicaSelectorRuntime.getPhysicsInstances();<NEW_LINE>Map<String, DatasourceConfig> dataSourceConfig = routerConfig.getDatasources().stream().collect(Collectors.toMap(k -> k.getName(), v -> v));<NEW_LINE>for (PhysicsInstance instance : values) {<NEW_LINE>String NAME = instance.getName();<NEW_LINE>String TYPE = instance.getType().name();<NEW_LINE>boolean READABLE = instance.asSelectRead();<NEW_LINE><MASK><NEW_LINE>int WEIGHT = instance.getWeight();<NEW_LINE>boolean ALIVE = instance.isAlive();<NEW_LINE>boolean MASTER = instance.isMaster();<NEW_LINE>Optional<DatasourceConfig> e = Optional.ofNullable(dataSourceConfig.get(NAME));<NEW_LINE>String replicaDataSourceSelectorList = String.join(",", replicaSelectorRuntime.getReplicaNameListByInstanceName(NAME));<NEW_LINE>resultSetBuilder.addObjectRowPayload(Arrays.asList(NAME, ALIVE, READABLE, TYPE, SESSION_COUNT, WEIGHT, MASTER, e.map(i -> i.getMaxCon()).orElse(-1), replicaDataSourceSelectorList));<NEW_LINE>}<NEW_LINE>RowBaseIterator rowBaseIterator = resultSetBuilder.build();<NEW_LINE>return rowBaseIterator;<NEW_LINE>} | int SESSION_COUNT = instance.getSessionCounter(); |
1,568,243 | private void residualInter(MBlock mBlock, Frame[][] refs, boolean leftAvailable, boolean topAvailable, int mbX, int mbY, int mbAddr) {<NEW_LINE>if (mBlock.cbpLuma() > 0 || mBlock.cbpChroma() > 0) {<NEW_LINE>s.qp = (s.qp + mBlock.mbQPDelta + 52) % 52;<NEW_LINE>}<NEW_LINE>di.mbQps[0][mbAddr] = s.qp;<NEW_LINE>residualLuma(mBlock, leftAvailable, topAvailable, mbX, mbY);<NEW_LINE>if (s.chromaFormat != MONO) {<NEW_LINE>int qp1 = calcQpChroma(s.qp, s.chromaQpOffset[0]);<NEW_LINE>int qp2 = calcQpChroma(s.qp, s.chromaQpOffset[1]);<NEW_LINE>decodeChromaResidual(mBlock, leftAvailable, topAvailable, mbX, mbY, qp1, qp2);<NEW_LINE>di.mbQps[1][mbAddr] = qp1;<NEW_LINE>di.mbQps[2][mbAddr] = qp2;<NEW_LINE>}<NEW_LINE>di.<MASK><NEW_LINE>} | tr8x8Used[mbAddr] = mBlock.transform8x8Used; |
1,592,283 | final DescribeDomainChangeProgressResult executeDescribeDomainChangeProgress(DescribeDomainChangeProgressRequest describeDomainChangeProgressRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(describeDomainChangeProgressRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DescribeDomainChangeProgressRequest> request = null;<NEW_LINE>Response<DescribeDomainChangeProgressResult> response = null;<NEW_LINE>try {<NEW_LINE><MASK><NEW_LINE>try {<NEW_LINE>request = new DescribeDomainChangeProgressRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(describeDomainChangeProgressRequest));<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, "Elasticsearch Service");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DescribeDomainChangeProgress");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DescribeDomainChangeProgressResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DescribeDomainChangeProgressResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | awsRequestMetrics.startEvent(Field.RequestMarshallTime); |
934,349 | private void copyAndFloatView() {<NEW_LINE>Dimension size = getSize();<NEW_LINE>Point loc = getLocation();<NEW_LINE><MASK><NEW_LINE>final View view = createView(plugin);<NEW_LINE>final JDialog dlg;<NEW_LINE>Preferences appPrefs = PreferencesManager.getInstance().getApplicationPreferences(ProtegeApplication.ID);<NEW_LINE>if (appPrefs.getBoolean(DETACHED_WINDOWS_FLOAT, true)) {<NEW_LINE>dlg = new JDialog(ProtegeManager.getInstance().getFrame(workspace));<NEW_LINE>} else {<NEW_LINE>dlg = new JDialog();<NEW_LINE>}<NEW_LINE>view.setBorder(BorderFactory.createEmptyBorder(2, 2, 2, 2));<NEW_LINE>viewBarComponent.setEnabled(false);<NEW_LINE>JPanel holder = new JPanel(new BorderLayout(3, 3));<NEW_LINE>holder.add(view);<NEW_LINE>final JCheckBox cb = new JCheckBox();<NEW_LINE>JPanel checkBoxHolder = new JPanel(new BorderLayout());<NEW_LINE>checkBoxHolder.add(cb, BorderLayout.SOUTH);<NEW_LINE>checkBoxHolder.setBorder(BorderFactory.createEmptyBorder(1, 4, 4, 2));<NEW_LINE>holder.add(checkBoxHolder, BorderLayout.SOUTH);<NEW_LINE>cb.setAction(new AbstractAction("Synchronising") {<NEW_LINE><NEW_LINE>private static final long serialVersionUID = -4131922452059512538L;<NEW_LINE><NEW_LINE>public void actionPerformed(ActionEvent e) {<NEW_LINE>view.setSyncronizing(cb.isSelected());<NEW_LINE>view.setPinned(!cb.isSelected());<NEW_LINE>}<NEW_LINE>});<NEW_LINE>dlg.setContentPane(holder);<NEW_LINE>dlg.setSize(size);<NEW_LINE>dlg.setLocation(loc);<NEW_LINE>dlg.setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE);<NEW_LINE>dlg.addWindowListener(new WindowAdapter() {<NEW_LINE><NEW_LINE>public void windowClosing(WindowEvent e) {<NEW_LINE>try {<NEW_LINE>view.dispose();<NEW_LINE>view.getViewComponent().dispose();<NEW_LINE>} catch (Exception e1) {<NEW_LINE>logger.warn("BAD VIEW: (" + view.getViewComponent().getClass().getSimpleName() + ") - exception on dispose: " + e1.getMessage());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>dlg.validate();<NEW_LINE>dlg.setVisible(true);<NEW_LINE>view.syncronizing = false;<NEW_LINE>} | SwingUtilities.convertPointToScreen(loc, this); |
603,711 | public static void main(String[] args) throws UnsupportedAudioFileException, IOException {<NEW_LINE>AudioInputStream inputAudio = AudioSystem.getAudioInputStream(new File(args[0]));<NEW_LINE>int samplingRate = (int) inputAudio.getFormat().getSampleRate();<NEW_LINE><MASK><NEW_LINE>double[] x = signal.getAllData();<NEW_LINE>double startFreqInHz = 0.0;<NEW_LINE>double endFreqInHz = 0.5 * samplingRate;<NEW_LINE>int windowType = Window.HAMMING;<NEW_LINE>boolean bRefinePeakEstimatesParabola = false;<NEW_LINE>boolean bRefinePeakEstimatesBias = false;<NEW_LINE>boolean bSpectralReassignment = true;<NEW_LINE>boolean bAdjustNeighFreqDependent = false;<NEW_LINE>SinusoidalAnalysisParams params = new SinusoidalAnalysisParams(samplingRate, startFreqInHz, endFreqInHz, windowType, bRefinePeakEstimatesParabola, bRefinePeakEstimatesBias, bSpectralReassignment, bAdjustNeighFreqDependent);<NEW_LINE>SinusoidalAnalyzer sa = new SinusoidalAnalyzer(params);<NEW_LINE>float winSizeInSeconds = 0.020f;<NEW_LINE>float skipSizeInSeconds = 0.010f;<NEW_LINE>float deltaInHz = 50.0f;<NEW_LINE>int spectralEnvelopeType = SinusoidalAnalysisParams.SEEVOC_SPEC;<NEW_LINE>String strPitchFile = args[0].substring(0, args[0].length() - 4) + ".ptc";<NEW_LINE>PitchReaderWriter f0 = new PitchReaderWriter(strPitchFile);<NEW_LINE>float ws_f0 = (float) f0.header.windowSizeInSeconds;<NEW_LINE>float ss_f0 = (float) f0.header.skipSizeInSeconds;<NEW_LINE>SinusoidalTracks st = sa.analyzeFixedRate(x, winSizeInSeconds, skipSizeInSeconds, deltaInHz, spectralEnvelopeType, f0.contour, ws_f0, ss_f0);<NEW_LINE>} | AudioDoubleDataSource signal = new AudioDoubleDataSource(inputAudio); |
1,212,890 | public static void main(String[] args) {<NEW_LINE>final ConfigBuilder configBuilder = new ConfigBuilder();<NEW_LINE>if (args.length > 0) {<NEW_LINE>configBuilder.withMasterUrl(args[0]);<NEW_LINE>logger.info("Using master with URL: {}", args[0]);<NEW_LINE>}<NEW_LINE>try (KubernetesClient client = new KubernetesClientBuilder().withConfig(configBuilder.build()).build()) {<NEW_LINE>final String secretName = UUID.randomUUID().toString();<NEW_LINE>final String namespace = "default";<NEW_LINE>logger.info("List of existent Secret:");<NEW_LINE>client.secrets().inNamespace(namespace).list().getItems().forEach(sc -> logger.info(" - {}", sc.getMetadata().getName()));<NEW_LINE>logger.info("Creating new Secret");<NEW_LINE>Map<String, String> data = new HashMap<>();<NEW_LINE>data.put("tls.crt", "YWFh");<NEW_LINE><MASK><NEW_LINE>final Secret secret = new SecretBuilder().withNewMetadata().withName(secretName).endMetadata().withType("kubernetes.io/tls").withImmutable(false).addToData(data).build();<NEW_LINE>Secret secretCreated = client.secrets().inNamespace(namespace).create(secret);<NEW_LINE>logger.info("Newly created Secret details:\n{}", secretCreated);<NEW_LINE>logger.info("Updated list of existent Secret:");<NEW_LINE>client.secrets().inNamespace(namespace).list().getItems().forEach(sc -> logger.info(" - {}", sc.getMetadata().getName()));<NEW_LINE>logger.info("Updating {} Secret to add new label", secretName);<NEW_LINE>final Secret updatedSecret = client.secrets().inNamespace(namespace).withName(secretName).edit(s -> new SecretBuilder(s).editMetadata().addToLabels("testLabel", "testLabelValue").endMetadata().build());<NEW_LINE>logger.info("Updated Secret details:\n{}", updatedSecret);<NEW_LINE>// delete Secret<NEW_LINE>boolean isDeleteSuccessful = client.secrets().inNamespace(namespace).delete(secret);<NEW_LINE>logger.info("Secret resource successfully deleted: {}", isDeleteSuccessful);<NEW_LINE>} catch (KubernetesClientException e) {<NEW_LINE>logger.error(e.getMessage(), e);<NEW_LINE>}<NEW_LINE>} | data.put("tls.key", "YmJi"); |
1,834,853 | public void process(String command, String[] args, PrintStream out) throws CommandException {<NEW_LINE>if (args.length == 0) {<NEW_LINE>out.println(USAGE);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>File file = new File(args[0]);<NEW_LINE>if (!file.exists() || !file.isFile()) {<NEW_LINE>out.println("The specified command file " + file.getAbsolutePath() + " does not exist or is not a file");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (file.length() > Integer.MAX_VALUE) {<NEW_LINE>out.println("The specified command file " + file.getAbsolutePath() + " is too large to be read");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>String charset = defaultCharset;<NEW_LINE>if (args.length == 2) {<NEW_LINE>charset = args[1];<NEW_LINE>} else if (args.length > 2) {<NEW_LINE>out.println(USAGE);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>List<String> <MASK><NEW_LINE>for (String cmd : commands) {<NEW_LINE>out.println(Session.prompt + cmd);<NEW_LINE>try {<NEW_LINE>ToolsRegistry.process(cmd, out);<NEW_LINE>} catch (CommandException e) {<NEW_LINE>out.println(e.getMessage());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (UnsupportedEncodingException e) {<NEW_LINE>out.println("The supplied charset " + charset + " for reading the command file is not supported");<NEW_LINE>} catch (IOException e) {<NEW_LINE>out.println("Error reading from command file " + file.getAbsolutePath());<NEW_LINE>}<NEW_LINE>} | commands = parseCmdFile(file, charset); |
962,324 | private void createActions() {<NEW_LINE>int subMenuGroup = 1;<NEW_LINE>DockingAction openAction = new ActionBuilder("Open File", getName()).menuPath(ToolConstants.MENU_FILE, "&Open...").menuGroup(OPEN_GROUP, Integer.toString(subMenuGroup++)).keyBinding("ctrl O").enabledWhen(c -> !locked).onAction(c -> open()).buildAndInstall(tool);<NEW_LINE>openAction.addToWindowWhen(ProgramActionContext.class);<NEW_LINE>tool.addAction(new CloseProgramAction(this, OPEN_GROUP, subMenuGroup++));<NEW_LINE>new ActionBuilder("Close Others", getName()).menuPath(ToolConstants.MENU_FILE, "Close &Others").menuGroup(OPEN_GROUP, Integer.toString(subMenuGroup++)).enabled(false).withContext(ProgramActionContext.class).inWindow(ActionBuilder.When.CONTEXT_MATCHES).enabledWhen(c -> programMgr.contains(c.getProgram())).onAction(c -> closeOtherPrograms(false)).buildAndInstall(tool);<NEW_LINE>DockingAction closeAllAction = new ActionBuilder("Close All", getName()).menuPath(ToolConstants.MENU_FILE, "Close &All").menuGroup(OPEN_GROUP, Integer.toString(subMenuGroup++)).enabledWhen(c -> !programMgr.isEmpty()).onAction(c -> closeAllPrograms(false)).buildAndInstall(tool);<NEW_LINE>closeAllAction.addToWindowWhen(ProgramActionContext.class);<NEW_LINE>tool.addAction(new SaveProgramAction(this, SAVE_GROUP, subMenuGroup));<NEW_LINE>tool.addAction(new SaveAsProgramAction(this, SAVE_GROUP, subMenuGroup));<NEW_LINE>DockingAction saveAllAction = new ActionBuilder("Save All Files", getName()).menuPath(ToolConstants.MENU_FILE, "Save All").description("Save All Programs").menuGroup(SAVE_GROUP, Integer.toString(subMenuGroup++)).enabledWhen(c -> programMgr.hasUnsavedPrograms()).onAction(c -> programSaveMgr.saveChangedPrograms()).buildAndInstall(tool);<NEW_LINE><MASK><NEW_LINE>tool.addAction(new ProgramOptionsAction(this));<NEW_LINE>undoAction = new UndoAction(this, tool);<NEW_LINE>redoAction = new RedoAction(this, tool);<NEW_LINE>tool.addAction(undoAction);<NEW_LINE>tool.addAction(redoAction);<NEW_LINE>} | saveAllAction.addToWindowWhen(ProgramActionContext.class); |
1,321,964 | public ListInstanceAttributesResult listInstanceAttributes(ListInstanceAttributesRequest listInstanceAttributesRequest) throws AmazonServiceException, AmazonClientException {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(listInstanceAttributesRequest);<NEW_LINE><MASK><NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<ListInstanceAttributesRequest> request = null;<NEW_LINE>Response<ListInstanceAttributesResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new ListInstanceAttributesRequestMarshaller().marshall(listInstanceAttributesRequest);<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>Unmarshaller<ListInstanceAttributesResult, JsonUnmarshallerContext> unmarshaller = new ListInstanceAttributesResultJsonUnmarshaller();<NEW_LINE>JsonResponseHandler<ListInstanceAttributesResult> responseHandler = new JsonResponseHandler<ListInstanceAttributesResult>(unmarshaller);<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.ClientExecuteTime);<NEW_LINE>endClientExecution(awsRequestMetrics, request, response, LOGGING_AWS_REQUEST_METRIC);<NEW_LINE>}<NEW_LINE>} | AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); |
3,162 | private void spawnRobot(double x, double y, boolean isReverse, boolean isLoop) {<NEW_LINE>var text = addText(isReverse ? "Reverse" : "Play", x + 120, y + 30);<NEW_LINE>text.fontProperty().unbind();<NEW_LINE>text.setFont(Font.font(18));<NEW_LINE>var animChannel = new AnimationChannel(image("robot_death.png"), 7, 275, 275, Duration.seconds(2.6), 0, 26);<NEW_LINE><MASK><NEW_LINE>if (isLoop) {<NEW_LINE>if (isReverse) {<NEW_LINE>animTexture.loopReverse();<NEW_LINE>} else {<NEW_LINE>animTexture.loop();<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>if (isReverse) {<NEW_LINE>animTexture.playReverse();<NEW_LINE>} else {<NEW_LINE>animTexture.play();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>entityBuilder().at(x, y).view(animTexture).buildAndAttach();<NEW_LINE>} | var animTexture = new AnimatedTexture(animChannel); |
1,064,736 | public void call(FullAccessIntArrPointer dst, int stride, ReadOnlyIntArrPointer above, ReadOnlyIntArrPointer left) {<NEW_LINE>PositionableIntArrPointer pLeft = PositionableIntArrPointer.makePositionable(left);<NEW_LINE>PositionableIntArrPointer pAbove = PositionableIntArrPointer.makePositionable(above);<NEW_LINE>final short I = pLeft.getAndInc();<NEW_LINE>final short J = pLeft.getAndInc();<NEW_LINE>final short K = pLeft.getAndInc();<NEW_LINE>final short L = pLeft.getAndInc();<NEW_LINE>final short X = pAbove.getRel(-1);<NEW_LINE>final short A = pAbove.getAndInc();<NEW_LINE>final short B = pAbove.getAndInc();<NEW_LINE>final short C = pAbove.getAndInc();<NEW_LINE>final short D = pAbove.getAndInc();<NEW_LINE>dst.setRel(3 * stride, avg3(J, K, L));<NEW_LINE>dst.setRel(1 + 3 * stride, dst.setRel(2 * stride, avg3(I, J, K)));<NEW_LINE>dst.setRel(2 + 3 * stride, dst.setRel(1 + 2 * stride, dst.setRel(stride, avg3(X, I, J))));<NEW_LINE>dst.setRel(3 + 3 * stride, dst.setRel(2 + 2 * stride, dst.setRel(1 + stride, dst.set(avg3(A, <MASK><NEW_LINE>dst.setRel(3 + 2 * stride, dst.setRel(2 + stride, dst.setRel(1, avg3(B, A, X))));<NEW_LINE>dst.setRel(3 + stride, dst.setRel(2, avg3(C, B, A)));<NEW_LINE>dst.setRel(3, avg3(D, C, B));<NEW_LINE>} | X, I))))); |
1,818,193 | private List<IInvoiceCandAggregate> createQualityDiscountAggregates(final IInvoiceCandAggregate invoiceCandAggregate) {<NEW_LINE>final List<IInvoiceCandAggregate> <MASK><NEW_LINE>//<NEW_LINE>// Check if we have to create quality discount aggregates.<NEW_LINE>// Create those aggregates if needed and add them to our final result<NEW_LINE>for (final I_C_Invoice_Candidate candidate : invoiceCandAggregate.getAllCands()) {<NEW_LINE>if (!candsSeen.add(candidate.getC_Invoice_Candidate_ID())) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (candidate.isFreightCost()) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (candidate.isSOTrx()) {<NEW_LINE>// we do the quality discount stuff *only* on the purchase side<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>//<NEW_LINE>// Calculate quality discount quantity<NEW_LINE>final BigDecimal qtyBeforeDiscount = candidate.getQtyToInvoiceBeforeDiscount();<NEW_LINE>final BigDecimal qtyInvoiced = candidate.getQtyToInvoice();<NEW_LINE>final BigDecimal qtyQualityDiscount = qtyBeforeDiscount.subtract(qtyInvoiced);<NEW_LINE>// If there is no quantity with issues, there will be no quality discount line<NEW_LINE>// FIXME: how shall we handle the case when qtyQualityDiscount is negative?<NEW_LINE>if (qtyQualityDiscount.signum() == 0) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>//<NEW_LINE>// Get the original invoice line<NEW_LINE>// Basically there shall be only one, but there is no harm if we just pick the first one if there are more.<NEW_LINE>final List<IInvoiceLineRW> originalInvoiceLineRWs = invoiceCandAggregate.getLinesFor(candidate);<NEW_LINE>final IInvoiceLineRW originalInvoiceLineRW = originalInvoiceLineRWs.get(0);<NEW_LINE>final StockQtyAndUOMQty qtysToInvoice = StockQtyAndUOMQtys.createWithUomQtyUsingConversion(qtyQualityDiscount, ProductId.ofRepoId(candidate.getM_Product_ID()), UomId.ofRepoId(candidate.getC_UOM_ID()));<NEW_LINE>//<NEW_LINE>// Adjust the original invoice line add let it include our qty with issues.<NEW_LINE>originalInvoiceLineRW.addQtysToInvoice(qtysToInvoice);<NEW_LINE>// We also need to update the invoice line's net amount<NEW_LINE>setNetLineAmt(originalInvoiceLineRW);<NEW_LINE>// Update aggregate's qtyAllocated<NEW_LINE>invoiceCandAggregate.addAllocatedQty(candidate, originalInvoiceLineRW, qtysToInvoice);<NEW_LINE>//<NEW_LINE>// Create quality discount invoice line with "minus qtyWithIssues".<NEW_LINE>// The quality discount invoice line shall have the same attributes as the original invoice line (08642)<NEW_LINE>final IInvoiceCandAggregate discountInvoiceCandidateAggregate = createQualityDiscountInvoiceLine(candidate, qtyQualityDiscount, originalInvoiceLineRW);<NEW_LINE>for (final I_C_InvoiceCandidate_InOutLine icIol : ic2IndisputeIcIols.get(candidate)) {<NEW_LINE>originalInvoiceLineRW.getC_InvoiceCandidate_InOutLine_IDs().add(icIol.getC_InvoiceCandidate_InOutLine_ID());<NEW_LINE>}<NEW_LINE>discountAggregates.add(discountInvoiceCandidateAggregate);<NEW_LINE>}<NEW_LINE>// for each invoice candidate<NEW_LINE>return discountAggregates;<NEW_LINE>} | discountAggregates = new ArrayList<>(); |
1,656,595 | public StreamObserver<UploadSnapshotPRequest> receiveSnapshotFromFollower(StreamObserver<UploadSnapshotPResponse> responseStreamObserver) {<NEW_LINE>String followerIp = ClientIpAddressInjector.getIpAddress();<NEW_LINE>LOG.info("Received upload snapshot request from follower {}", followerIp);<NEW_LINE>SnapshotDownloader<UploadSnapshotPResponse, UploadSnapshotPRequest> observer = SnapshotDownloader.forLeader(mStorage, responseStreamObserver, followerIp);<NEW_LINE>if (!transitionState(DownloadState.REQUEST_DATA, DownloadState.STREAM_DATA)) {<NEW_LINE>responseStreamObserver.onCompleted();<NEW_LINE>return observer;<NEW_LINE>}<NEW_LINE>observer.getFuture().thenApply(termIndex -> {<NEW_LINE>mDownloadedSnapshot = observer.getSnapshotToInstall();<NEW_LINE>transitionState(DownloadState.STREAM_DATA, DownloadState.DOWNLOADED);<NEW_LINE>return termIndex;<NEW_LINE>}).exceptionally(e -> {<NEW_LINE>LOG.<MASK><NEW_LINE>// this allows the leading master to request other followers for their snapshots. It<NEW_LINE>// previously collected information about other snapshots in requestInfo(). If no other<NEW_LINE>// snapshots are available requestData() will return false and mDownloadState will be IDLE<NEW_LINE>transitionState(DownloadState.STREAM_DATA, DownloadState.REQUEST_DATA);<NEW_LINE>CompletableFuture.runAsync(this::requestSnapshotFromFollowers);<NEW_LINE>return null;<NEW_LINE>});<NEW_LINE>return observer;<NEW_LINE>} | error("Unexpected exception downloading snapshot from follower {}.", followerIp, e); |
1,589,344 | private void createNavigationBar(Composite parent) {<NEW_LINE>toolBarManager = new ToolBarManager(SWT.FLAT);<NEW_LINE>toolBarManager.add(backAction);<NEW_LINE>toolBarManager.add(forwardAction);<NEW_LINE>toolBarManager.add(stopAction);<NEW_LINE>toolBarManager.add(refreshAction);<NEW_LINE>ToolBar toolbar = toolBarManager.createControl(parent);<NEW_LINE>toolbar.setLayoutData(GridDataFactory.fillDefaults().create());<NEW_LINE>urlCombo = new Combo(parent, SWT.DROP_DOWN);<NEW_LINE>urlCombo.setLayoutData(GridDataFactory.fillDefaults().grab(true<MASK><NEW_LINE>urlCombo.addListener(SWT.DefaultSelection, new Listener() {<NEW_LINE><NEW_LINE>public void handleEvent(Event e) {<NEW_LINE>setURL(urlCombo.getText());<NEW_LINE>}<NEW_LINE>});<NEW_LINE>ToolBarManager toolBarManager2 = new ToolBarManager(SWT.FLAT);<NEW_LINE>toolBarManager2.add(goAction);<NEW_LINE>toolbar = toolBarManager2.createControl(parent);<NEW_LINE>toolbar.setLayoutData(GridDataFactory.fillDefaults().create());<NEW_LINE>} | , false).create()); |
1,800,854 | final UpdateInputSecurityGroupResult executeUpdateInputSecurityGroup(UpdateInputSecurityGroupRequest updateInputSecurityGroupRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(updateInputSecurityGroupRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE><MASK><NEW_LINE>Request<UpdateInputSecurityGroupRequest> request = null;<NEW_LINE>Response<UpdateInputSecurityGroupResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new UpdateInputSecurityGroupRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(updateInputSecurityGroupRequest));<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, "MediaLive");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "UpdateInputSecurityGroup");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<UpdateInputSecurityGroupResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new UpdateInputSecurityGroupResultJsonUnmarshaller());<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); |
2,556 | public void urlVariableNamesExistInParameters(ExecutableElement element, Set<String> variableNames, ElementValidation valid) {<NEW_LINE>List<? extends VariableElement> parameters = element.getParameters();<NEW_LINE>Set<String> parametersName = new HashSet<>();<NEW_LINE>for (VariableElement parameter : parameters) {<NEW_LINE>if (parameter.getAnnotation(Path.class) == null) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>String nameToAdd = restAnnotationHelper.getUrlVariableCorrespondingTo(parameter);<NEW_LINE>if (parametersName.contains(nameToAdd)) {<NEW_LINE>valid.addError(element, "%s has multiple method parameters which correspond to the same url variable");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>parametersName.add(nameToAdd);<NEW_LINE>}<NEW_LINE>String[] cookiesToUrl = restAnnotationHelper.requiredUrlCookies(element);<NEW_LINE>if (cookiesToUrl != null) {<NEW_LINE>Collections.addAll(parametersName, cookiesToUrl);<NEW_LINE>}<NEW_LINE>for (String variableName : variableNames) {<NEW_LINE>if (!parametersName.contains(variableName)) {<NEW_LINE><MASK><NEW_LINE>return;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | valid.addError("%s annotated method has an url variable which name could not be found in the method parameters: " + variableName); |
1,475,207 | public boolean onCreateOptionsMenu(Menu menu) {<NEW_LINE>logDebug("onCreateOptionsMenu");<NEW_LINE>// Inflate the menu items for use in the action bar<NEW_LINE>MenuInflater inflater = getMenuInflater();<NEW_LINE>inflater.inflate(R.menu.file_explorer_action, menu);<NEW_LINE>searchMenuItem = menu.findItem(R.id.cab_menu_search);<NEW_LINE>createFolderMenuItem = menu.findItem(R.id.cab_menu_create_folder);<NEW_LINE>newChatMenuItem = menu.findItem(R.id.cab_menu_new_chat);<NEW_LINE>createFolderMenuItem.setVisible(false);<NEW_LINE>newChatMenuItem.setVisible(false);<NEW_LINE>searchView = (SearchView) searchMenuItem.getActionView();<NEW_LINE>SearchView.SearchAutoComplete searchAutoComplete = searchView.findViewById(androidx.appcompat.R.id.search_src_text);<NEW_LINE>searchAutoComplete.setHint(getString<MASK><NEW_LINE>View v = searchView.findViewById(androidx.appcompat.R.id.search_plate);<NEW_LINE>v.setBackgroundColor(ContextCompat.getColor(this, android.R.color.transparent));<NEW_LINE>if (searchView != null) {<NEW_LINE>searchView.setIconifiedByDefault(true);<NEW_LINE>}<NEW_LINE>searchMenuItem.setOnActionExpandListener(new MenuItem.OnActionExpandListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public boolean onMenuItemActionExpand(MenuItem item) {<NEW_LINE>isSearchExpanded = true;<NEW_LINE>chatExplorerFragment.enableSearch(true);<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public boolean onMenuItemActionCollapse(MenuItem item) {<NEW_LINE>isSearchExpanded = false;<NEW_LINE>chatExplorerFragment.enableSearch(false);<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>});<NEW_LINE>searchView.setMaxWidth(Integer.MAX_VALUE);<NEW_LINE>searchView.setOnQueryTextListener(new SearchView.OnQueryTextListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public boolean onQueryTextSubmit(String query) {<NEW_LINE>logDebug("Query: " + query);<NEW_LINE>hideKeyboard(chatExplorerActivity, 0);<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public boolean onQueryTextChange(String newText) {<NEW_LINE>querySearch = newText;<NEW_LINE>chatExplorerFragment.search(newText);<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>});<NEW_LINE>return super.onCreateOptionsMenu(menu);<NEW_LINE>} | (R.string.hint_action_search)); |
1,600,471 | public CodegenExpression codegen(EnumForgeCodegenParams premade, CodegenMethodScope codegenMethodScope, CodegenClassScope codegenClassScope) {<NEW_LINE>ExprForgeCodegenSymbol scope = new ExprForgeCodegenSymbol(false, null);<NEW_LINE>CodegenMethod methodNode = codegenMethodScope.makeChildWithScope(returnTypeOfMethod(), getClass(), scope, codegenClassScope).addParam(EnumForgeCodegenNames.PARAMSCOLLBEAN);<NEW_LINE>CodegenBlock block = methodNode.getBlock();<NEW_LINE>CodegenExpression returnEmpty = returnIfEmptyOptional();<NEW_LINE>if (returnEmpty != null) {<NEW_LINE>block.ifCondition(exprDotMethod(EnumForgeCodegenNames.REF_ENUMCOLL, "isEmpty")).blockReturn(returnEmpty);<NEW_LINE>}<NEW_LINE>initBlock(block, methodNode, scope, codegenClassScope);<NEW_LINE>if (hasForEachLoop()) {<NEW_LINE>CodegenBlock forEach = block.forEach(EventBean.EPTYPE, "next", EnumForgeCodegenNames.REF_ENUMCOLL).assignArrayElement(EnumForgeCodegenNames.REF_EPS, constant(getStreamNumLambda()), ref("next"));<NEW_LINE>forEachBlock(forEach, methodNode, scope, codegenClassScope);<NEW_LINE>}<NEW_LINE>returnResult(block);<NEW_LINE>return localMethod(methodNode, premade.getEps(), premade.getEnumcoll(), premade.getIsNewData(<MASK><NEW_LINE>} | ), premade.getExprCtx()); |
1,779,453 | @Produces(MediaType.APPLICATION_JSON)<NEW_LINE>@Operation(summary = "Return the reduced configuration", responses = { @ApiResponse(responseCode = "200", description = "OK") })<NEW_LINE>public Response putFullConfigApi(@Context UriInfo uri, @PathParam("username") @Parameter(description = "username") String username, String body) {<NEW_LINE>if (!userManagement.authorizeUser(username)) {<NEW_LINE>return NetworkUtils.singleError(cs.gson, uri, HueResponse.UNAUTHORIZED, "Not Authorized");<NEW_LINE>}<NEW_LINE>final HueChangeRequest changes;<NEW_LINE>changes = cs.gson.fromJson(body, HueChangeRequest.class);<NEW_LINE>String devicename = changes.devicename;<NEW_LINE>if (devicename != null) {<NEW_LINE>cs.ds.config.devicename = devicename;<NEW_LINE>}<NEW_LINE>Boolean dhcp = changes.dhcp;<NEW_LINE>if (dhcp != null) {<NEW_LINE>cs.ds.config.dhcp = dhcp;<NEW_LINE>}<NEW_LINE>Boolean linkbutton = changes.linkbutton;<NEW_LINE>if (linkbutton != null) {<NEW_LINE>cs.setLinkbutton(linkbutton, cs.getConfig().createNewUserOnEveryEndpoint, cs.getConfig().temporarilyEmulateV1bridge);<NEW_LINE>}<NEW_LINE>return Response.ok(cs.gson.toJson(cs.ds<MASK><NEW_LINE>} | .config)).build(); |
137,280 | // ------------------------------------------------------------------------<NEW_LINE>// XXX: QueryPart API<NEW_LINE>// ------------------------------------------------------------------------<NEW_LINE>@Override<NEW_LINE>public final void accept(Context<?> ctx) {<NEW_LINE>WithImpl w = with;<NEW_LINE>ctx.scopeStart().data(DATA_DML_TARGET_TABLE, table);<NEW_LINE>if (w != null)<NEW_LINE>ctx.visit(w);<NEW_LINE>else<NEW_LINE>markTopLevelCteAndAccept(ctx, c -> {<NEW_LINE>});<NEW_LINE>boolean previousDeclareFields = ctx.declareFields();<NEW_LINE>if (NATIVE_SUPPORT_DATA_CHANGE_DELTA_TABLE.contains(ctx.dialect()) && !returning.isEmpty() && !TRUE.equals(ctx.data(BooleanDataKey.DATA_RENDERING_DATA_CHANGE_DELTA_TABLE))) {<NEW_LINE>ctx.data(BooleanDataKey.DATA_RENDERING_DATA_CHANGE_DELTA_TABLE, true, c -> c.visit(select(returning).from(new DataChangeDeltaTable<>(this instanceof Delete ? ResultOption.OLD : ResultOption.FINAL, this).as(table().getUnqualifiedName()))));<NEW_LINE>} else<NEW_LINE>accept0(ctx);<NEW_LINE>ctx.<MASK><NEW_LINE>ctx.scopeEnd();<NEW_LINE>} | data().remove(DATA_DML_TARGET_TABLE); |
1,711,596 | public CommandLineRunner commandLineRunner(ServletContext servletContext) {<NEW_LINE>return (args) -> {<NEW_LINE>File temp = new File(System.getProperty("java.io.tmpdir"));<NEW_LINE>URL resourceUrl = servletContext.getResource("webjars/jquery/3.5.0/jquery.js");<NEW_LINE>JarURLConnection connection = (JarURLConnection) resourceUrl.openConnection();<NEW_LINE>String jarName = connection.getJarFile().getName();<NEW_LINE>System.<MASK><NEW_LINE>if (jarName.contains(temp.getAbsolutePath())) {<NEW_LINE>System.out.println(">>>>> jar written to temp");<NEW_LINE>}<NEW_LINE>byte[] resourceContent = FileCopyUtils.copyToByteArray(resourceUrl.openStream());<NEW_LINE>URL directUrl = new URL(resourceUrl.toExternalForm());<NEW_LINE>byte[] directContent = FileCopyUtils.copyToByteArray(directUrl.openStream());<NEW_LINE>String message = (!Arrays.equals(resourceContent, directContent)) ? "NO MATCH" : directContent.length + " BYTES";<NEW_LINE>System.out.println(">>>>> " + message + " from " + resourceUrl);<NEW_LINE>};<NEW_LINE>} | out.println(">>>>> jar file " + jarName); |
337,915 | public Page download(Request request, Task task) {<NEW_LINE>checkInit();<NEW_LINE>WebDriver webDriver;<NEW_LINE>try {<NEW_LINE>webDriver = webDriverPool.get();<NEW_LINE>} catch (InterruptedException e) {<NEW_LINE>logger.warn("interrupted", e);<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>logger.info("downloading page " + request.getUrl());<NEW_LINE>webDriver.get(request.getUrl());<NEW_LINE>try {<NEW_LINE>Thread.sleep(sleepTime);<NEW_LINE>} catch (InterruptedException e) {<NEW_LINE>e.printStackTrace();<NEW_LINE>}<NEW_LINE>WebDriver.Options manage = webDriver.manage();<NEW_LINE><MASK><NEW_LINE>if (site.getCookies() != null) {<NEW_LINE>for (Map.Entry<String, String> cookieEntry : site.getCookies().entrySet()) {<NEW_LINE>Cookie cookie = new Cookie(cookieEntry.getKey(), cookieEntry.getValue());<NEW_LINE>manage.addCookie(cookie);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>WebElement webElement = webDriver.findElement(By.xpath("/html"));<NEW_LINE>String content = webElement.getAttribute("outerHTML");<NEW_LINE>Page page = new Page();<NEW_LINE>page.setRawText(content);<NEW_LINE>page.setHtml(new Html(content, request.getUrl()));<NEW_LINE>page.setUrl(new PlainText(request.getUrl()));<NEW_LINE>page.setRequest(request);<NEW_LINE>webDriverPool.returnToPool(webDriver);<NEW_LINE>return page;<NEW_LINE>} | Site site = task.getSite(); |
903,473 | BodyInserters.FormInserter<String> populateTokenRequestBody(OAuth2AuthorizationCodeGrantRequest grantRequest, BodyInserters.FormInserter<String> body) {<NEW_LINE><MASK><NEW_LINE>OAuth2AuthorizationExchange authorizationExchange = grantRequest.getAuthorizationExchange();<NEW_LINE>OAuth2AuthorizationResponse authorizationResponse = authorizationExchange.getAuthorizationResponse();<NEW_LINE>body.with(OAuth2ParameterNames.CODE, authorizationResponse.getCode());<NEW_LINE>String redirectUri = authorizationExchange.getAuthorizationRequest().getRedirectUri();<NEW_LINE>if (redirectUri != null) {<NEW_LINE>body.with(OAuth2ParameterNames.REDIRECT_URI, redirectUri);<NEW_LINE>}<NEW_LINE>String codeVerifier = authorizationExchange.getAuthorizationRequest().getAttribute(PkceParameterNames.CODE_VERIFIER);<NEW_LINE>if (codeVerifier != null) {<NEW_LINE>body.with(PkceParameterNames.CODE_VERIFIER, codeVerifier);<NEW_LINE>}<NEW_LINE>return body;<NEW_LINE>} | super.populateTokenRequestBody(grantRequest, body); |
1,487,017 | void reload(ClusterState state, String reason) {<NEW_LINE>boolean hasValidWatcherTemplates = WatcherIndexTemplateRegistry.validate(state);<NEW_LINE>if (hasValidWatcherTemplates == false) {<NEW_LINE>logger.warn("missing watcher index templates");<NEW_LINE>}<NEW_LINE>// this method contains the only async code block, being called by the cluster state listener<NEW_LINE>// the reason for this is, that loading he watches is done in a sync manner and thus cannot be done on the cluster state listener<NEW_LINE>// thread<NEW_LINE>//<NEW_LINE>// this method itself is called by the cluster state listener, so will never be called in parallel<NEW_LINE>// setting the cluster state version allows us to know if the async method has been overtaken by another async method<NEW_LINE>// this is unlikely, but can happen, if the thread pool schedules two of those runnables at the same time<NEW_LINE>// by checking the cluster state version before and after loading the watches we can potentially just exit without applying the<NEW_LINE>// changes<NEW_LINE>processedClusterStateVersion.set(state.getVersion());<NEW_LINE>triggerService.pauseExecution();<NEW_LINE>int cancelledTaskCount = executionService.clearExecutionsAndQueue(() -> {<NEW_LINE>});<NEW_LINE>logger.<MASK><NEW_LINE>executor.execute(wrapWatcherService(() -> reloadInner(state, reason, false), e -> logger.error("error reloading watcher", e)));<NEW_LINE>} | info("reloading watcher, reason [{}], cancelled [{}] queued tasks", reason, cancelledTaskCount); |
327,303 | private void logProviderInfo(String providerName, ClassLoader loader) {<NEW_LINE>try {<NEW_LINE>if (PROVIDER_ECLIPSELINK.equals(providerName)) {<NEW_LINE>// org.eclipse.persistence.Version.getVersion(): 2.6.4.v20160829-44060b6<NEW_LINE>Class<?> Version = loadClass(loader, "org.eclipse.persistence.Version");<NEW_LINE>String version = (String) Version.getMethod("getVersionString").invoke(Version.newInstance());<NEW_LINE>Tr.info(tc, "JPA_THIRD_PARTY_PROV_INFO_CWWJP0053I", "EclipseLink", version);<NEW_LINE>} else if (PROVIDER_HIBERNATE.equals(providerName)) {<NEW_LINE>// org.hibernate.Version.getVersionString(): 5.2.6.Final<NEW_LINE>Class<?> Version = loadClass(loader, "org.hibernate.Version");<NEW_LINE>String version = (String) Version.getMethod("getVersionString").invoke(null);<NEW_LINE>Tr.info(<MASK><NEW_LINE>} else if (PROVIDER_OPENJPA.equals(providerName)) {<NEW_LINE>// OpenJPAVersion.appendOpenJPABanner(sb): OpenJPA #.#.#\n version id: openjpa-#.#.#-r# \n Apache svn revision: #<NEW_LINE>StringBuilder version = new StringBuilder();<NEW_LINE>Class<?> OpenJPAVersion = loadClass(loader, "org.apache.openjpa.conf.OpenJPAVersion");<NEW_LINE>OpenJPAVersion.getMethod("appendOpenJPABanner", StringBuilder.class).invoke(OpenJPAVersion.newInstance(), version);<NEW_LINE>Tr.info(tc, "JPA_THIRD_PARTY_PROV_INFO_CWWJP0053I", "OpenJPA", version);<NEW_LINE>} else {<NEW_LINE>Tr.info(tc, "JPA_THIRD_PARTY_PROV_NAME_CWWJP0052I", providerName);<NEW_LINE>}<NEW_LINE>} catch (Exception x) {<NEW_LINE>Tr.info(tc, "JPA_THIRD_PARTY_PROV_NAME_CWWJP0052I", providerName);<NEW_LINE>if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())<NEW_LINE>Tr.debug(this, tc, "unable to determine provider info", x);<NEW_LINE>}<NEW_LINE>} | tc, "JPA_THIRD_PARTY_PROV_INFO_CWWJP0053I", "Hibernate", version); |
1,237,833 | private static void processAppleRunTime(@NotNull final AppleRunTimeMakernoteDirectory directory, @NotNull final byte[] bplist) throws IOException {<NEW_LINE>final BplistReader.PropertyListResults results = BplistReader.parse(bplist);<NEW_LINE>final Set<Map.Entry<Byte, Byte>> entrySet = results.getEntrySet();<NEW_LINE>if (entrySet != null) {<NEW_LINE>HashMap<String, Object> values = new HashMap<String, Object>(entrySet.size());<NEW_LINE>for (Map.Entry<Byte, Byte> entry : entrySet) {<NEW_LINE>String key = (String) results.getObjects().get(entry.getKey());<NEW_LINE>Object value = results.getObjects().get(entry.getValue());<NEW_LINE>values.put(key, value);<NEW_LINE>}<NEW_LINE>// https://developer.apple.com/documentation/coremedia/cmtime-u58<NEW_LINE>byte flags = (Byte) values.get("flags");<NEW_LINE>if ((flags & 0x1) == 0x1) {<NEW_LINE>directory.setInt(AppleRunTimeMakernoteDirectory.CMTimeFlags, flags);<NEW_LINE>directory.setInt(AppleRunTimeMakernoteDirectory.CMTimeEpoch, (Byte) values.get("epoch"));<NEW_LINE>directory.setLong(AppleRunTimeMakernoteDirectory.CMTimeScale, (Long<MASK><NEW_LINE>directory.setLong(AppleRunTimeMakernoteDirectory.CMTimeValue, (Long) values.get("value"));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | ) values.get("timescale")); |
205,407 | void showProfileOrTrip(String data) {<NEW_LINE>Uri uri = Uri.parse(data);<NEW_LINE>String userId = uri.getQueryParameter(SHARE_PROFILE_USER_ID_QUERY);<NEW_LINE>String myId = mSharedPreferences.getString(USER_ID, null);<NEW_LINE>Log.v("user id", userId + " " + myId);<NEW_LINE>if (userId != null) {<NEW_LINE>int id = Integer.parseInt(userId);<NEW_LINE>if (!userId.equals(myId)) {<NEW_LINE>Intent intent = FriendsProfileActivity.getStartIntent(MainActivity.this, id);<NEW_LINE>startActivity(intent);<NEW_LINE>} else {<NEW_LINE>Intent intent = <MASK><NEW_LINE>startActivity(intent);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>String tripID = uri.getQueryParameter(SHARE_TRIP_TRIP_ID_QUERY);<NEW_LINE>if (tripID != null) {<NEW_LINE>Log.v("trip id", tripID + " ");<NEW_LINE>Trip trip = new Trip();<NEW_LINE>trip.setId(tripID);<NEW_LINE>Intent intent = MyTripInfoActivity.getStartIntent(MainActivity.this, trip, false);<NEW_LINE>startActivity(intent);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | ProfileActivity.getStartIntent(MainActivity.this); |
1,536,317 | protected static void generateCodeForArgument(MethodVisitor mv, CodeFlow cf, SpelNodeImpl argument, String paramDesc) {<NEW_LINE>cf.enterCompilationScope();<NEW_LINE>argument.generateCode(mv, cf);<NEW_LINE>String lastDesc = cf.lastDescriptor();<NEW_LINE>Assert.state(lastDesc != null, "No last descriptor");<NEW_LINE>boolean primitiveOnStack = CodeFlow.isPrimitive(lastDesc);<NEW_LINE>// Check if need to box it for the method reference?<NEW_LINE>if (primitiveOnStack && paramDesc.charAt(0) == 'L') {<NEW_LINE>CodeFlow.insertBoxIfNecessary(mv, lastDesc.charAt(0));<NEW_LINE>} else if (paramDesc.length() == 1 && !primitiveOnStack) {<NEW_LINE>CodeFlow.insertUnboxInsns(mv, paramDesc.charAt(0), lastDesc);<NEW_LINE>} else if (!paramDesc.equals(lastDesc)) {<NEW_LINE>// This would be unnecessary in the case of subtyping (e.g. method takes Number but Integer passed in)<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>cf.exitCompilationScope();<NEW_LINE>} | CodeFlow.insertCheckCast(mv, paramDesc); |
642,970 | public Map<String, Map<String, AttributeAdapter>> attributeAdaptersForFunction() {<NEW_LINE>Map<String, Map<String, AttributeAdapter>> ret = new HashMap<>();<NEW_LINE>Map<String, AttributeAdapter> tfMappings = new LinkedHashMap<>();<NEW_LINE>val fields = DifferentialFunctionClassHolder.getInstance().getFieldsForFunction(this);<NEW_LINE>// TF uses [kH, kW, inC, outC] always for weights<NEW_LINE>tfMappings.put("kH", new NDArrayShapeAdapter(0));<NEW_LINE>tfMappings.put("kW", new NDArrayShapeAdapter(1));<NEW_LINE>tfMappings.put("sH", new ConditionalFieldValueIntIndexArrayAdapter("NCHW", 2, 1, fields.get("dataFormat")));<NEW_LINE>tfMappings.put("sW", new ConditionalFieldValueIntIndexArrayAdapter("NCHW", 3, 2, fields.get("dataFormat")));<NEW_LINE>tfMappings.put("dH", new ConditionalFieldValueIntIndexArrayAdapter("NCHW", 2, 1, fields.get("dataFormat")));<NEW_LINE>tfMappings.put("dW", new ConditionalFieldValueIntIndexArrayAdapter("NCHW", 3, 2, <MASK><NEW_LINE>tfMappings.put("isSameMode", new StringEqualsAdapter("SAME"));<NEW_LINE>Map<String, AttributeAdapter> onnxMappings = new HashMap<>();<NEW_LINE>onnxMappings.put("kH", new SizeThresholdIntArrayIntIndexAdapter(0, 2, 0));<NEW_LINE>onnxMappings.put("kW", new SizeThresholdIntArrayIntIndexAdapter(1, 2, 0));<NEW_LINE>onnxMappings.put("dH", new SizeThresholdIntArrayIntIndexAdapter(0, 2, 0));<NEW_LINE>onnxMappings.put("dW", new SizeThresholdIntArrayIntIndexAdapter(1, 2, 0));<NEW_LINE>onnxMappings.put("sH", new SizeThresholdIntArrayIntIndexAdapter(0, 2, 0));<NEW_LINE>onnxMappings.put("sW", new SizeThresholdIntArrayIntIndexAdapter(1, 2, 0));<NEW_LINE>onnxMappings.put("isSameMode", new StringEqualsAdapter("SAME"));<NEW_LINE>try {<NEW_LINE>ret.put(tensorflowName(), tfMappings);<NEW_LINE>} catch (NoOpNameFoundException e) {<NEW_LINE>//<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>ret.put(onnxName(), onnxMappings);<NEW_LINE>} catch (NoOpNameFoundException e) {<NEW_LINE>//<NEW_LINE>}<NEW_LINE>return ret;<NEW_LINE>} | fields.get("dataFormat"))); |
345,836 | private void insertSessionAttributes(JdbcSession session, List<String> attributeNames) {<NEW_LINE>Assert.notEmpty(attributeNames, "attributeNames must not be null or empty");<NEW_LINE>try (LobCreator lobCreator = this.lobHandler.getLobCreator()) {<NEW_LINE>if (attributeNames.size() > 1) {<NEW_LINE>try {<NEW_LINE>this.jdbcOperations.batchUpdate(this.createSessionAttributeQuery, new BatchPreparedStatementSetter() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void setValues(PreparedStatement ps, int i) throws SQLException {<NEW_LINE>String attributeName = attributeNames.get(i);<NEW_LINE>ps.setString(1, session.primaryKey);<NEW_LINE><MASK><NEW_LINE>lobCreator.setBlobAsBytes(ps, 3, serialize(session.getAttribute(attributeName)));<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public int getBatchSize() {<NEW_LINE>return attributeNames.size();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} catch (DuplicateKeyException ex) {<NEW_LINE>throw ex;<NEW_LINE>} catch (DataIntegrityViolationException ex) {<NEW_LINE>// parent record not found - we are ignoring this error because we<NEW_LINE>// assume that a concurrent request has removed the session<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>try {<NEW_LINE>this.jdbcOperations.update(this.createSessionAttributeQuery, (ps) -> {<NEW_LINE>String attributeName = attributeNames.get(0);<NEW_LINE>ps.setString(1, session.primaryKey);<NEW_LINE>ps.setString(2, attributeName);<NEW_LINE>lobCreator.setBlobAsBytes(ps, 3, serialize(session.getAttribute(attributeName)));<NEW_LINE>});<NEW_LINE>} catch (DuplicateKeyException ex) {<NEW_LINE>throw ex;<NEW_LINE>} catch (DataIntegrityViolationException ex) {<NEW_LINE>// parent record not found - we are ignoring this error because we<NEW_LINE>// assume that a concurrent request has removed the session<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | ps.setString(2, attributeName); |
1,704,206 | private List<DalGroup> sortGroups(List<DalGroup> groups, String userNo) throws SQLException {<NEW_LINE>List<DalGroup> result = new ArrayList<DalGroup>(groups.size());<NEW_LINE>LoginUser user = BeanGetter.getDaoOfLoginUser().getUserByNo(userNo);<NEW_LINE>List<UserGroup> joinedGroups = BeanGetter.getDalUserGroupDao().getUserGroupByUserId(user.getId());<NEW_LINE>if (joinedGroups != null && joinedGroups.size() > 0) {<NEW_LINE>for (UserGroup joinedGroup : joinedGroups) {<NEW_LINE>Iterator<DalGroup> ite = groups.iterator();<NEW_LINE>while (ite.hasNext()) {<NEW_LINE><MASK><NEW_LINE>if (group.getId() == joinedGroup.getGroup_id()) {<NEW_LINE>result.add(group);<NEW_LINE>ite.remove();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>result.addAll(groups);<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>} | DalGroup group = ite.next(); |
281,539 | public static DynamicThreadPoolExecutor buildDynamicPool(ThreadPoolInitParam initParam) {<NEW_LINE>Assert.notNull(initParam);<NEW_LINE>DynamicThreadPoolExecutor dynamicThreadPoolExecutor;<NEW_LINE>try {<NEW_LINE>dynamicThreadPoolExecutor = new DynamicThreadPoolExecutor(initParam.getCorePoolNum(), initParam.getMaxPoolNum(), initParam.getKeepAliveTime(), initParam.getTimeUnit(), initParam.getExecuteTimeOut(), initParam.getWaitForTasksToCompleteOnShutdown(), initParam.getAwaitTerminationMillis(), initParam.getWorkQueue(), initParam.getThreadPoolId(), initParam.getThreadFactory(), initParam.getRejectedExecutionHandler());<NEW_LINE>} catch (IllegalArgumentException ex) {<NEW_LINE>throw new IllegalArgumentException(String.format("Error creating thread pool parameter. threadPool id :: %s", initParam<MASK><NEW_LINE>}<NEW_LINE>dynamicThreadPoolExecutor.setTaskDecorator(initParam.getTaskDecorator());<NEW_LINE>dynamicThreadPoolExecutor.allowCoreThreadTimeOut(initParam.allowCoreThreadTimeOut);<NEW_LINE>return dynamicThreadPoolExecutor;<NEW_LINE>} | .getThreadPoolId()), ex); |
1,622,655 | public void init(Connection conn, String schemaName, String triggerName, String tableName, boolean before, int type) throws SQLException {<NEW_LINE>// get the columns for the table<NEW_LINE>ResultSet rs = conn.getMetaData().getColumns(null, schemaName, tableName, null);<NEW_LINE>// build the insert into history table SQL<NEW_LINE>StringBuilder insertSql = new StringBuilder(150);<NEW_LINE>insertSql.append("insert into ").append(schemaName).append(".").append(tableName).append(HISTORY_SUFFIX).append(" (");<NEW_LINE>int count = 0;<NEW_LINE>while (rs.next()) {<NEW_LINE>if (++count > 1) {<NEW_LINE>insertSql.append(",");<NEW_LINE>}<NEW_LINE>String <MASK><NEW_LINE>if (columnName.equalsIgnoreCase(SYS_PERIOD_START)) {<NEW_LINE>this.effectStartPosition = count - 1;<NEW_LINE>} else if (columnName.equalsIgnoreCase(SYS_PERIOD_END)) {<NEW_LINE>this.effectEndPosition = count - 1;<NEW_LINE>}<NEW_LINE>insertSql.append(columnName);<NEW_LINE>}<NEW_LINE>insertSql.append(") values (");<NEW_LINE>for (int i = 0; i < count; i++) {<NEW_LINE>if (i > 0) {<NEW_LINE>insertSql.append(",");<NEW_LINE>}<NEW_LINE>insertSql.append("?");<NEW_LINE>}<NEW_LINE>insertSql.append(");");<NEW_LINE>this.insertHistorySql = insertSql.toString();<NEW_LINE>log.debug("History table insert sql: {}", insertHistorySql);<NEW_LINE>} | columnName = rs.getString("COLUMN_NAME"); |
1,286 | public void register(final SimpleCommandMap commandMap, final Map<String, Command> knownCommands, @Nullable final Set<String> aliases) {<NEW_LINE>synchronized (commandMap) {<NEW_LINE>overriddenAliases.clear();<NEW_LINE>overridden = knownCommands.put(label, bukkitCommand);<NEW_LINE>if (aliases != null)<NEW_LINE>aliases.remove(label);<NEW_LINE>final Iterator<String> as = activeAliases.iterator();<NEW_LINE>while (as.hasNext()) {<NEW_LINE>final String lowerAlias = as.next().toLowerCase();<NEW_LINE>if (knownCommands.containsKey(lowerAlias) && (aliases == null || !aliases.contains(lowerAlias))) {<NEW_LINE>as.remove();<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>overriddenAliases.put(lowerAlias, knownCommands.put(lowerAlias, bukkitCommand));<NEW_LINE>if (aliases != null)<NEW_LINE>aliases.add(lowerAlias);<NEW_LINE>}<NEW_LINE>bukkitCommand.setAliases(activeAliases);<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>} | commandMap.register("skript", bukkitCommand); |
653,716 | public EditorFont createFont() {<NEW_LINE>if (!completedConstruction) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>com.codename1.ui.Font systemFont = com.codename1.ui.Font.createSystemFont(FONT_FACE_VALUES[systemFontFace.getSelectedIndex()], FONT_STYLE_VALUES[systemFontStyle.getSelectedIndex()], FONT_SIZE_VALUES[systemFontSize.getSelectedIndex()]);<NEW_LINE>java.awt.Font aFont = preview.getFont();<NEW_LINE>String s = aFont.getFamily() + "-";<NEW_LINE>if (aFont.isBold()) {<NEW_LINE>s += aFont.isItalic() ? "bolditalic" : "bold";<NEW_LINE>} else {<NEW_LINE>s += aFont.isItalic() ? "italic" : "plain";<NEW_LINE>}<NEW_LINE>s += "-" + aFont.getSize();<NEW_LINE>int selIndex = fontMainType.getSelectedIndex();<NEW_LINE>EditorFont newFont = new EditorFont(systemFont, null, s + ";" + lookupString.getText(), selIndex == 1 || selIndex == 2, ANTI_ALIASING_VALUES[antiAliasing.getSelectedIndex()<MASK><NEW_LINE>if (!factoryCreation) {<NEW_LINE>resources.setFont(fontName, newFont);<NEW_LINE>}<NEW_LINE>return newFont;<NEW_LINE>} | ], charset.getText()); |
1,193,001 | public InternalAggregation doReduce(List<InternalAggregation> aggregations, ReduceContext reduceContext) {<NEW_LINE>long[] docCounts = new long[buckets.size()];<NEW_LINE>InternalAggregations[][] aggs = new InternalAggregations[buckets.size()][];<NEW_LINE>for (int i = 0; i < aggs.length; ++i) {<NEW_LINE>aggs[i] = new InternalAggregations[aggregations.size()];<NEW_LINE>}<NEW_LINE>for (int i = 0; i < aggregations.size(); ++i) {<NEW_LINE>InternalTokenRange range = (InternalTokenRange) aggregations.get(i);<NEW_LINE>if (range.buckets.size() != buckets.size()) {<NEW_LINE>throw new IllegalStateException("Expected [" + buckets.size() + "] buckets, but got [" + range.buckets.size() + "]");<NEW_LINE>}<NEW_LINE>for (int j = 0; j < buckets.size(); ++j) {<NEW_LINE>Bucket bucket = range.buckets.get(j);<NEW_LINE>docCounts[j] += bucket.docCount;<NEW_LINE>aggs[j<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>List<Bucket> buckets = new ArrayList<>(this.buckets.size());<NEW_LINE>for (int i = 0; i < this.buckets.size(); ++i) {<NEW_LINE>Bucket b = this.buckets.get(i);<NEW_LINE>buckets.add(new Bucket(format, keyed, b.key, b.from, b.to, docCounts[i], InternalAggregations.reduce(Arrays.asList(aggs[i]), reduceContext)));<NEW_LINE>}<NEW_LINE>return new InternalTokenRange(name, format, keyed, buckets, pipelineAggregators(), metaData);<NEW_LINE>} | ][i] = bucket.aggregations; |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.