idx
int32
46
1.86M
input
stringlengths
321
6.6k
target
stringlengths
9
1.24k
69,880
public void loadUI() {<NEW_LINE>titleTxt.setText(dc.getTitle());<NEW_LINE>pannelBookTitle.setText(dc.getTitle());<NEW_LINE>createAdapter();<NEW_LINE>viewPager.addOnPageChangeListener(onViewPagerChangeListener);<NEW_LINE>viewPager.setCurrentItem(dc.getCurentPage(), false);<NEW_LINE>seekBar.setMax(dc.getPageCount() - 1);<NEW_LINE>seekBar.setProgress(dc.getCurentPage());<NEW_LINE>bottomIndicators.setOnTouchListener(new HorizontallSeekTouchEventListener(onSeek, dc.getPageCount(), false));<NEW_LINE>progressDraw.setOnTouchListener(new HorizontallSeekTouchEventListener(onSeek, dc.getPageCount(), false));<NEW_LINE>bottomIndicators.setOnClickListener(new OnClickListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onClick(View v) {<NEW_LINE>if (AppState.get().tapZoneBottom == AppState.TAP_DO_NOTHING) {<NEW_LINE>// do nothing<NEW_LINE>} else if (AppState.get().tapZoneBottom == AppState.TAP_NEXT_PAGE) {<NEW_LINE>nextPage();<NEW_LINE>} else if (AppState.get().tapZoneBottom == AppState.TAP_PREV_PAGE) {<NEW_LINE>prevPage();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>updateLockMode();<NEW_LINE>tinUI();<NEW_LINE>onViewPagerChangeListener.onPageSelected(dc.getCurentPage());<NEW_LINE>progressDraw.updatePageCount(dc.getPageCount());<NEW_LINE>dc.getOutline(new ResultResponse<List<OutlineLinkWrapper>>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public boolean onResultRecive(List<OutlineLinkWrapper> result) {<NEW_LINE>onClose.setVisibility(View.VISIBLE);<NEW_LINE>progressDraw.updateDivs(result);<NEW_LINE>updateUI(dc.getCurrentPage());<NEW_LINE>if (TxtUtils.isListEmpty(result)) {<NEW_LINE>TintUtil.<MASK><NEW_LINE>}<NEW_LINE>showPagesHelper();<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>}, false);<NEW_LINE>showHelp();<NEW_LINE>}
setTintImageWithAlpha(outline, Color.LTGRAY);
196,174
public void createPack(ReadableMap options, final Promise promise) throws JSONException {<NEW_LINE>final String name = ConvertUtils.getString("name", options, "");<NEW_LINE>final OfflineManager offlineManager = RCTMGLOfflineModule.getOfflineManager(mReactContext);<NEW_LINE>LatLngBounds latLngBounds = getBoundsFromOptions(options);<NEW_LINE>TilesetDescriptorOptions descriptorOptions = new TilesetDescriptorOptions.Builder().styleURI(options.getString("styleURL")).minZoom((byte) options.getInt("minZoom")).maxZoom((byte) options.getInt("maxZoom")).build();<NEW_LINE>TilesetDescriptor <MASK><NEW_LINE>ArrayList<TilesetDescriptor> descriptors = new ArrayList<>();<NEW_LINE>descriptors.add(tilesetDescriptor);<NEW_LINE>TileRegionLoadOptions loadOptions = new TileRegionLoadOptions.Builder().geometry(GeoJSONUtils.fromLatLngBoundsToPolygon(latLngBounds)).descriptors(descriptors).metadata(Value.valueOf(options.getString("metadata"))).acceptExpired(true).networkRestriction(NetworkRestriction.NONE).build();<NEW_LINE>String metadataStr = options.getString("metadata");<NEW_LINE>JSONObject metadata = new JSONObject(metadataStr);<NEW_LINE>String id = metadata.getString("name");<NEW_LINE>TileRegionPack pack = new TileRegionPack(id, null, TileRegionPack.INACTIVE);<NEW_LINE>pack.loadOptions = loadOptions;<NEW_LINE>tileRegionPacks.put(id, pack);<NEW_LINE>promise.resolve(fromOfflineRegion(latLngBounds, metadataStr));<NEW_LINE>startPackDownload(pack);<NEW_LINE>}
tilesetDescriptor = offlineManager.createTilesetDescriptor(descriptorOptions);
1,699,066
public static boolean drawImage(GC gc, Image image, Point srcStart, Rectangle dstRect, Rectangle clipping, int hOffset, int vOffset, boolean clearArea) {<NEW_LINE>Rectangle srcRect;<NEW_LINE>Point dstAdj;<NEW_LINE>if (clipping == null) {<NEW_LINE>dstAdj = new Point(0, 0);<NEW_LINE>srcRect = new Rectangle(srcStart.x, srcStart.y, dstRect.width, dstRect.height);<NEW_LINE>} else {<NEW_LINE>if (!dstRect.intersects(clipping)) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>dstAdj = new Point(Math.max(0, clipping.x - dstRect.x), Math.max(0, clipping.y - dstRect.y));<NEW_LINE>srcRect = new Rectangle(0, 0, 0, 0);<NEW_LINE>srcRect.x <MASK><NEW_LINE>srcRect.y = srcStart.y + dstAdj.y;<NEW_LINE>srcRect.width = Math.min(dstRect.width - dstAdj.x, clipping.x + clipping.width - dstRect.x);<NEW_LINE>srcRect.height = Math.min(dstRect.height - dstAdj.y, clipping.y + clipping.height - dstRect.y);<NEW_LINE>}<NEW_LINE>if (!srcRect.isEmpty()) {<NEW_LINE>try {<NEW_LINE>if (clearArea) {<NEW_LINE>gc.fillRectangle(dstRect.x + dstAdj.x + hOffset, dstRect.y + dstAdj.y + vOffset, srcRect.width, srcRect.height);<NEW_LINE>}<NEW_LINE>gc.drawImage(image, srcRect.x, srcRect.y, srcRect.width, srcRect.height, dstRect.x + dstAdj.x + hOffset, dstRect.y + dstAdj.y + vOffset, srcRect.width, srcRect.height);<NEW_LINE>} catch (Exception e) {<NEW_LINE>System.out.println("drawImage: " + e.getMessage() + ": " + image + ", " + srcRect + ", " + (dstRect.x + dstAdj.y + hOffset) + "," + (dstRect.y + dstAdj.y + vOffset) + "," + srcRect.width + "," + srcRect.height + "; imageBounds = " + image.getBounds());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>}
= srcStart.x + dstAdj.x;
646,346
private static void limitTotalMemory(final KsqlBoundedMemoryRocksDBConfig config, final LruCacheFactory cacheFactory, final WriteBufferManagerFactory bufferManagerFactory) {<NEW_LINE>final long blockCacheSize = config.getLong(KsqlBoundedMemoryRocksDBConfig.BLOCK_CACHE_SIZE);<NEW_LINE>final long totalMemtableMemory = config.getLong(KsqlBoundedMemoryRocksDBConfig.WRITE_BUFFER_LIMIT) == -1 ? blockCacheSize / 2 : config.getLong(KsqlBoundedMemoryRocksDBConfig.WRITE_BUFFER_LIMIT);<NEW_LINE>final boolean useCacheForMemtable = config.getBoolean(KsqlBoundedMemoryRocksDBConfig.ACCOUNT_WRITE_BUFFER_AGAINST_CACHE);<NEW_LINE>final boolean strictCacheLimit = config.getBoolean(KsqlBoundedMemoryRocksDBConfig.STRICT_CACHE_LIMIT);<NEW_LINE>final double indexFilterBlockRatio = <MASK><NEW_LINE>cache = cacheFactory.create(blockCacheSize, -1, strictCacheLimit, indexFilterBlockRatio);<NEW_LINE>final Cache cacheForWriteBuffer = useCacheForMemtable ? cache : cacheFactory.create(totalMemtableMemory, -1, false, 0);<NEW_LINE>writeBufferManager = bufferManagerFactory.create(totalMemtableMemory, cacheForWriteBuffer);<NEW_LINE>}
config.getDouble(KsqlBoundedMemoryRocksDBConfig.INDEX_FILTER_BLOCK_RATIO_CONFIG);
788,875
final DisassociateTransitGatewayRouteTableResult executeDisassociateTransitGatewayRouteTable(DisassociateTransitGatewayRouteTableRequest disassociateTransitGatewayRouteTableRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(disassociateTransitGatewayRouteTableRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DisassociateTransitGatewayRouteTableRequest> request = null;<NEW_LINE>Response<DisassociateTransitGatewayRouteTableResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DisassociateTransitGatewayRouteTableRequestMarshaller().marshall(super.beforeMarshalling(disassociateTransitGatewayRouteTableRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "EC2");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DisassociateTransitGatewayRouteTable");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>StaxResponseHandler<DisassociateTransitGatewayRouteTableResult> responseHandler = new StaxResponseHandler<DisassociateTransitGatewayRouteTableResult>(new DisassociateTransitGatewayRouteTableResultStaxUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);
815,077
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 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.set(dst.setRel(1 + 2 * stride, avg2(X, A)));<NEW_LINE>dst.setRel(1, dst.setRel(2 + 2 * stride, avg2(A, B)));<NEW_LINE>dst.setRel(2, dst.setRel(3 + 2 * stride, avg2(B, C)));<NEW_LINE>dst.setRel(3, avg2(C, D));<NEW_LINE>dst.setRel(3 * stride, avg3<MASK><NEW_LINE>dst.setRel(2 * stride, avg3(J, I, X));<NEW_LINE>dst.setRel(stride, dst.setRel(1 + 3 * stride, avg3(I, X, A)));<NEW_LINE>dst.setRel(1 + stride, dst.setRel(2 + 3 * stride, avg3(X, A, B)));<NEW_LINE>dst.setRel(2 + stride, dst.setRel(3 + 3 * stride, avg3(A, B, C)));<NEW_LINE>dst.setRel(3 + stride, avg3(B, C, D));<NEW_LINE>}
(K, J, I));
1,097,146
public boolean executeCommand(final String args) {<NEW_LINE>// get filenames<NEW_LINE>final String evalID = getProp().getPropertyString(ScriptProperties.ML_CONFIG_EVAL_FILE);<NEW_LINE>final String resourceID = getProp().getPropertyString(ScriptProperties.ML_CONFIG_MACHINE_LEARNING_FILE);<NEW_LINE>final String outputID = getProp().getPropertyString(ScriptProperties.ML_CONFIG_OUTPUT_FILE);<NEW_LINE>final String query = getProp().getPropertyString(ScriptProperties.ML_CONFIG_QUERY);<NEW_LINE>EncogLogging.log(EncogLogging.LEVEL_DEBUG, "Beginning evaluate");<NEW_LINE>EncogLogging.log(EncogLogging.LEVEL_DEBUG, "evaluate file:" + evalID);<NEW_LINE>EncogLogging.log(EncogLogging.LEVEL_DEBUG, "resource file:" + resourceID);<NEW_LINE>final File evalFile = <MASK><NEW_LINE>final File resourceFile = getScript().resolveFilename(resourceID);<NEW_LINE>final File outputFile = getAnalyst().getScript().resolveFilename(outputID);<NEW_LINE>final MLMethod method = (MLMethod) EncogDirectoryPersistence.loadObject(resourceFile);<NEW_LINE>getAnalyst().setMethod(method);<NEW_LINE>if (method instanceof BayesianNetwork) {<NEW_LINE>((BayesianNetwork) method).defineClassificationStructure(query);<NEW_LINE>}<NEW_LINE>final boolean headers = true;<NEW_LINE>final AnalystEvaluateCSV eval = new AnalystEvaluateCSV();<NEW_LINE>eval.setScript(getScript());<NEW_LINE>getAnalyst().setCurrentQuantTask(eval);<NEW_LINE>eval.setReport(new AnalystReportBridge(getAnalyst()));<NEW_LINE>eval.analyze(getAnalyst(), evalFile, headers, getProp().getPropertyCSVFormat(ScriptProperties.SETUP_CONFIG_CSV_FORMAT));<NEW_LINE>eval.process(outputFile, method);<NEW_LINE>getAnalyst().setCurrentQuantTask(null);<NEW_LINE>return eval.shouldStop();<NEW_LINE>}
getScript().resolveFilename(evalID);
672,723
public List<Route> generateExternalRoutes(int pod) {<NEW_LINE>List<GenericKafkaListener> routeListeners = ListenersUtils.routeListeners(listeners);<NEW_LINE>List<Route> routes = new ArrayList<<MASK><NEW_LINE>for (GenericKafkaListener listener : routeListeners) {<NEW_LINE>String routeName = ListenersUtils.backwardsCompatibleBrokerServiceName(cluster, pod, listener);<NEW_LINE>Route route = new RouteBuilder().withNewMetadata().withName(routeName).withLabels(getLabelsWithStrimziName(name, Util.mergeLabelsOrAnnotations(templatePerPodRouteLabels, ListenersUtils.brokerLabels(listener, pod))).toMap()).withAnnotations(Util.mergeLabelsOrAnnotations(templatePerPodRouteAnnotations, ListenersUtils.brokerAnnotations(listener, pod))).withNamespace(namespace).withOwnerReferences(createOwnerReference()).endMetadata().withNewSpec().withNewTo().withKind("Service").withName(routeName).endTo().withNewPort().withNewTargetPort(listener.getPort()).endPort().withNewTls().withTermination("passthrough").endTls().endSpec().build();<NEW_LINE>String host = ListenersUtils.brokerHost(listener, pod);<NEW_LINE>if (host != null) {<NEW_LINE>route.getSpec().setHost(host);<NEW_LINE>}<NEW_LINE>routes.add(route);<NEW_LINE>}<NEW_LINE>return routes;<NEW_LINE>}
>(routeListeners.size());
47,829
Object convertInputIfNecessary(Object input) {<NEW_LINE>List<Object> convertedResults = new ArrayList<Object>();<NEW_LINE>if (input instanceof Tuple2) {<NEW_LINE>convertedResults.add(this.doConvert(((Tuple2) input).getT1(<MASK><NEW_LINE>convertedResults.add(this.doConvert(((Tuple2) input).getT2(), getInputArgumentType(1)));<NEW_LINE>}<NEW_LINE>if (input instanceof Tuple3) {<NEW_LINE>convertedResults.add(this.doConvert(((Tuple3) input).getT3(), getInputArgumentType(2)));<NEW_LINE>}<NEW_LINE>if (input instanceof Tuple4) {<NEW_LINE>convertedResults.add(this.doConvert(((Tuple4) input).getT4(), getInputArgumentType(3)));<NEW_LINE>}<NEW_LINE>if (input instanceof Tuple5) {<NEW_LINE>convertedResults.add(this.doConvert(((Tuple5) input).getT5(), getInputArgumentType(4)));<NEW_LINE>}<NEW_LINE>if (input instanceof Tuple6) {<NEW_LINE>convertedResults.add(this.doConvert(((Tuple6) input).getT6(), getInputArgumentType(5)));<NEW_LINE>}<NEW_LINE>if (input instanceof Tuple7) {<NEW_LINE>convertedResults.add(this.doConvert(((Tuple7) input).getT7(), getInputArgumentType(6)));<NEW_LINE>}<NEW_LINE>if (input instanceof Tuple8) {<NEW_LINE>convertedResults.add(this.doConvert(((Tuple8) input).getT8(), getInputArgumentType(7)));<NEW_LINE>}<NEW_LINE>input = CollectionUtils.isEmpty(convertedResults) ? this.doConvert(input, getInputArgumentType(0)) : Tuples.fromArray(convertedResults.toArray());<NEW_LINE>return input;<NEW_LINE>}
), getInputArgumentType(0)));
1,437,342
private String prepareMessage() {<NEW_LINE>StringBuilder builder = new StringBuilder("<html>");<NEW_LINE><MASK><NEW_LINE>LOG.assertTrue(notifications != null);<NEW_LINE>if (notifications.isEmpty() && !myNoChangesDetected) {<NEW_LINE>if (myProcessChangesTextOnly) {<NEW_LINE>builder.append("No lines changed: changes since last revision are already properly formatted").append("<br>");<NEW_LINE>} else {<NEW_LINE>builder.append("No lines changed: code is already properly formatted").append("<br>");<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>if (notifications.hasReformatOrRearrangeNotification()) {<NEW_LINE>String reformatInfo = notifications.getReformatCodeNotification();<NEW_LINE>String rearrangeInfo = notifications.getRearrangeCodeNotification();<NEW_LINE>builder.append(joinWithCommaAndCapitalize(reformatInfo, rearrangeInfo));<NEW_LINE>if (myProcessChangesTextOnly) {<NEW_LINE>builder.append(" in changes since last revision");<NEW_LINE>}<NEW_LINE>builder.append("<br>");<NEW_LINE>} else if (myNoChangesDetected) {<NEW_LINE>builder.append("No lines changed: no changes since last revision").append("<br>");<NEW_LINE>}<NEW_LINE>String optimizeImportsNotification = notifications.getOptimizeImportsNotification();<NEW_LINE>if (optimizeImportsNotification != null) {<NEW_LINE>builder.append(StringUtil.capitalize(optimizeImportsNotification)).append("<br>");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>String shortcutText = KeymapUtil.getFirstKeyboardShortcutText(ActionManager.getInstance().getAction("ShowReformatFileDialog"));<NEW_LINE>String color = ColorUtil.toHex(JBColor.gray);<NEW_LINE>builder.append("<span style='color:#").append(color).append("'>").append("<a href=''>Show</a> reformat dialog: ").append(shortcutText).append("</span>").append("</html>");<NEW_LINE>return builder.toString();<NEW_LINE>}
LayoutCodeInfoCollector notifications = myProcessor.getInfoCollector();
1,049,013
public Map<String, Map<String, PropertyMapping>> mappingsForFunction() {<NEW_LINE>Map<String, Map<String, PropertyMapping>> <MASK><NEW_LINE>Map<String, PropertyMapping> map = new HashMap<>();<NEW_LINE>val strideMapping = PropertyMapping.builder().tfAttrName("strides").onnxAttrName("strides").build();<NEW_LINE>val kernelMapping = PropertyMapping.builder().propertyNames(new String[] { "kH", "kW" }).tfInputPosition(1).onnxAttrName("kernel_shape").build();<NEW_LINE>val dilationMapping = PropertyMapping.builder().onnxAttrName("dilations").propertyNames(new String[] { "dW", "dH" }).tfAttrName("rates").build();<NEW_LINE>val sameMode = PropertyMapping.builder().onnxAttrName("auto_pad").propertyNames(new String[] { "isSameMode" }).tfAttrName("padding").build();<NEW_LINE>val paddingWidthHeight = PropertyMapping.builder().onnxAttrName("padding").propertyNames(new String[] { "pH", "pW" }).build();<NEW_LINE>map.put("sW", strideMapping);<NEW_LINE>map.put("sH", strideMapping);<NEW_LINE>map.put("kH", kernelMapping);<NEW_LINE>map.put("kW", kernelMapping);<NEW_LINE>map.put("dW", dilationMapping);<NEW_LINE>map.put("dH", dilationMapping);<NEW_LINE>map.put("isSameMode", sameMode);<NEW_LINE>map.put("pH", paddingWidthHeight);<NEW_LINE>map.put("pW", paddingWidthHeight);<NEW_LINE>ret.put(onnxName(), map);<NEW_LINE>ret.put(tensorflowName(), map);<NEW_LINE>return ret;<NEW_LINE>}
ret = new HashMap<>();
1,550,601
protected void doHealthCheck(Health.Builder builder) throws Exception {<NEW_LINE>try {<NEW_LINE>this.lock.lock();<NEW_LINE>if (this.adminClient == null) {<NEW_LINE>this.adminClient = AdminClient.create(this.adminClientProperties);<NEW_LINE>}<NEW_LINE>final ListTopicsResult listTopicsResult = this.adminClient.listTopics();<NEW_LINE>listTopicsResult.listings().get(this.configurationProperties.getHealthTimeout(), TimeUnit.SECONDS);<NEW_LINE>if (this.kafkaStreamsBindingInformationCatalogue.getStreamsBuilderFactoryBeans().isEmpty()) {<NEW_LINE>builder.withDetail("No Kafka Streams bindings have been established", "Kafka Streams binder did not detect any processors");<NEW_LINE>builder.status(Status.UNKNOWN);<NEW_LINE>} else {<NEW_LINE>boolean up = true;<NEW_LINE>final Set<KafkaStreams> kafkaStreams = kafkaStreamsRegistry.getKafkaStreams();<NEW_LINE>Set<KafkaStreams> allKafkaStreams = new HashSet<>(kafkaStreams);<NEW_LINE>if (this.configurationProperties.isIncludeStoppedProcessorsForHealthCheck()) {<NEW_LINE>allKafkaStreams.addAll(kafkaStreamsBindingInformationCatalogue.getStoppedKafkaStreams().values());<NEW_LINE>}<NEW_LINE>for (KafkaStreams kStream : allKafkaStreams) {<NEW_LINE>if (isKafkaStreams25) {<NEW_LINE>up &= kStream.state().isRunningOrRebalancing();<NEW_LINE>} else {<NEW_LINE>// if Kafka client version is lower than 2.5, then call the method reflectively.<NEW_LINE>final boolean isRunningInvokedResult = (boolean) methodForIsRunning.invoke(kStream.state());<NEW_LINE>up &= isRunningInvokedResult;<NEW_LINE>}<NEW_LINE>builder<MASK><NEW_LINE>}<NEW_LINE>builder.status(up ? Status.UP : Status.DOWN);<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>builder.withDetail("No topic information available", "Kafka broker is not reachable");<NEW_LINE>builder.status(Status.DOWN);<NEW_LINE>builder.withException(e);<NEW_LINE>} finally {<NEW_LINE>this.lock.unlock();<NEW_LINE>}<NEW_LINE>}
.withDetails(buildDetails(kStream));
1,494,098
public void recordEntityLinkCreated(EntityLinkEntity entityLink) {<NEW_LINE>if (getHistoryConfigurationSettings().isHistoryEnabledForEntityLink(entityLink) && entityLink.getScopeId() != null) {<NEW_LINE>HistoricEntityLinkService historicEntityLinkService = cmmnEngineConfiguration.getEntityLinkServiceConfiguration().getHistoricEntityLinkService();<NEW_LINE>HistoricEntityLinkEntity historicEntityLinkEntity = (HistoricEntityLinkEntity) historicEntityLinkService.createHistoricEntityLink();<NEW_LINE>historicEntityLinkEntity.setId(entityLink.getId());<NEW_LINE>historicEntityLinkEntity.setLinkType(entityLink.getLinkType());<NEW_LINE>historicEntityLinkEntity.setCreateTime(entityLink.getCreateTime());<NEW_LINE>historicEntityLinkEntity.setScopeId(entityLink.getScopeId());<NEW_LINE>historicEntityLinkEntity.setSubScopeId(entityLink.getSubScopeId());<NEW_LINE>historicEntityLinkEntity.setScopeType(entityLink.getScopeType());<NEW_LINE>historicEntityLinkEntity.setScopeDefinitionId(entityLink.getScopeDefinitionId());<NEW_LINE>historicEntityLinkEntity.setParentElementId(entityLink.getParentElementId());<NEW_LINE>historicEntityLinkEntity.<MASK><NEW_LINE>historicEntityLinkEntity.setReferenceScopeType(entityLink.getReferenceScopeType());<NEW_LINE>historicEntityLinkEntity.setReferenceScopeDefinitionId(entityLink.getReferenceScopeDefinitionId());<NEW_LINE>historicEntityLinkEntity.setRootScopeId(entityLink.getRootScopeId());<NEW_LINE>historicEntityLinkEntity.setRootScopeType(entityLink.getRootScopeType());<NEW_LINE>historicEntityLinkEntity.setHierarchyType(entityLink.getHierarchyType());<NEW_LINE>historicEntityLinkService.insertHistoricEntityLink(historicEntityLinkEntity, false);<NEW_LINE>}<NEW_LINE>}
setReferenceScopeId(entityLink.getReferenceScopeId());
166,061
private void alignJoinClauses(QueryModel parent) {<NEW_LINE>ObjList<QueryModel> joinModels = parent.getJoinModels();<NEW_LINE>for (int i = 0, n = joinModels.size(); i < n; i++) {<NEW_LINE>JoinContext jc = joinModels.getQuick(i).getContext();<NEW_LINE>if (jc != null) {<NEW_LINE>int index = jc.slaveIndex;<NEW_LINE>for (int k = 0, kc = jc.aIndexes.size(); k < kc; k++) {<NEW_LINE>if (jc.aIndexes.getQuick(k) != index) {<NEW_LINE>int idx = <MASK><NEW_LINE>CharSequence name = jc.aNames.getQuick(k);<NEW_LINE>ExpressionNode node = jc.aNodes.getQuick(k);<NEW_LINE>jc.aIndexes.setQuick(k, jc.bIndexes.getQuick(k));<NEW_LINE>jc.aNames.setQuick(k, jc.bNames.getQuick(k));<NEW_LINE>jc.aNodes.setQuick(k, jc.bNodes.getQuick(k));<NEW_LINE>jc.bIndexes.setQuick(k, idx);<NEW_LINE>jc.bNames.setQuick(k, name);<NEW_LINE>jc.bNodes.setQuick(k, node);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
jc.aIndexes.getQuick(k);
618,541
public void handle(net.md_5.bungee.protocol.packet.Team team) throws Exception {<NEW_LINE><MASK><NEW_LINE>// Remove team and move on<NEW_LINE>if (team.getMode() == 1) {<NEW_LINE>serverScoreboard.removeTeam(team.getName());<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// Create or get old team<NEW_LINE>Team t;<NEW_LINE>if (team.getMode() == 0) {<NEW_LINE>t = new Team(team.getName());<NEW_LINE>serverScoreboard.addTeam(t);<NEW_LINE>} else {<NEW_LINE>t = serverScoreboard.getTeam(team.getName());<NEW_LINE>}<NEW_LINE>if (t != null) {<NEW_LINE>if (team.getMode() == 0 || team.getMode() == 2) {<NEW_LINE>t.setDisplayName(team.getDisplayName());<NEW_LINE>t.setPrefix(team.getPrefix());<NEW_LINE>t.setSuffix(team.getSuffix());<NEW_LINE>t.setFriendlyFire(team.getFriendlyFire());<NEW_LINE>t.setNameTagVisibility(team.getNameTagVisibility());<NEW_LINE>t.setCollisionRule(team.getCollisionRule());<NEW_LINE>t.setColor(team.getColor());<NEW_LINE>}<NEW_LINE>if (team.getPlayers() != null) {<NEW_LINE>for (String s : team.getPlayers()) {<NEW_LINE>if (team.getMode() == 0 || team.getMode() == 3) {<NEW_LINE>t.addPlayer(s);<NEW_LINE>} else if (team.getMode() == 4) {<NEW_LINE>t.removePlayer(s);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
Scoreboard serverScoreboard = con.getServerSentScoreboard();
1,236,491
private String cloneResource(long csCloneId, VolumeInfo volumeInfo, StoragePoolVO storagePoolVO) {<NEW_LINE>// get the cached template on this storage<NEW_LINE>VMTemplateStoragePoolVO tmplPoolRef = _vmTemplatePoolDao.findByPoolTemplate(storagePoolVO.getId(), csCloneId, null);<NEW_LINE>if (tmplPoolRef != null) {<NEW_LINE>final String cloneRes = LinstorUtil.RSC_PREFIX + tmplPoolRef.getLocalDownloadPath();<NEW_LINE>final String rscName = LinstorUtil.RSC_PREFIX + volumeInfo.getUuid();<NEW_LINE>final DevelopersApi linstorApi = LinstorUtil.getLinstorAPI(storagePoolVO.getHostAddress());<NEW_LINE>try {<NEW_LINE>s_logger.debug("Clone resource definition " + cloneRes + " to " + rscName);<NEW_LINE>ResourceDefinitionCloneRequest cloneRequest = new ResourceDefinitionCloneRequest();<NEW_LINE>cloneRequest.setName(rscName);<NEW_LINE>ResourceDefinitionCloneStarted cloneStarted = linstorApi.resourceDefinitionClone(cloneRes, cloneRequest);<NEW_LINE>checkLinstorAnswersThrow(cloneStarted.getMessages());<NEW_LINE>if (!CloneWaiter.waitFor(linstorApi, cloneStarted)) {<NEW_LINE>throw new <MASK><NEW_LINE>}<NEW_LINE>return getDeviceName(linstorApi, rscName);<NEW_LINE>} catch (ApiException apiEx) {<NEW_LINE>s_logger.error("Linstor: ApiEx - " + apiEx.getMessage());<NEW_LINE>throw new CloudRuntimeException(apiEx.getBestMessage(), apiEx);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>throw new CloudRuntimeException("Unable to find Linstor resource for the following template data-object ID: " + csCloneId);<NEW_LINE>}<NEW_LINE>}
CloudRuntimeException("Clone for resource " + rscName + " failed.");
1,382,624
private JPanel buildControlsPanel() {<NEW_LINE>JPanel jbase = new JPanel(new BorderLayout());<NEW_LINE>JPanel jLeftPanel = new JPanel();<NEW_LINE>jLeftPanel.setLayout(new BorderLayout());<NEW_LINE>jLeftPanel.setBorder(new EmptyBorder(0, 0, 25, 0));<NEW_LINE>JLabel arrowIcon = new JLabel(UISupport.createImageIcon("/big_arrow.png"));<NEW_LINE>jLeftPanel.add(arrowIcon, BorderLayout.SOUTH);<NEW_LINE>setBackgroundColor(jLeftPanel);<NEW_LINE>JPanel jControlsPanel = new JPanel(new BorderLayout());<NEW_LINE>jControlsPanel.setBorder(new EmptyBorder(5, 2, 10, 35));<NEW_LINE>setBackgroundColor(jControlsPanel);<NEW_LINE>jControlsPanel.add(buildButtonsPanel(), BorderLayout.SOUTH);<NEW_LINE><MASK><NEW_LINE>jbase.add(jLeftPanel, BorderLayout.WEST);<NEW_LINE>jbase.add(jControlsPanel);<NEW_LINE>return jbase;<NEW_LINE>}
jControlsPanel.add(buildUserInfoPanel());
1,744,365
public void updateICIOLAssociationFromIOL(@NonNull final I_C_InvoiceCandidate_InOutLine iciol, @NonNull final org.compiere.model.I_M_InOutLine inOutLine) {<NEW_LINE>iciol.setAD_Org_ID(inOutLine.getAD_Org_ID());<NEW_LINE>iciol.setM_InOutLine(inOutLine);<NEW_LINE>// iciol.setQtyInvoiced(QtyInvoiced); // will be set during invoicing to keep track of which movementQty is already invoiced in case of partial invoicing<NEW_LINE>iciol.setQtyDelivered(inOutLine.getMovementQty());<NEW_LINE>final InvoicableQtyBasedOn invoicableQtyBasedOn = InvoicableQtyBasedOn.fromRecordString(iciol.<MASK><NEW_LINE>if (inOutLine.getCatch_UOM_ID() > 0 && invoicableQtyBasedOn.isCatchWeight()) {<NEW_LINE>// only if the ic is about catch-weight, then we attempt to record it in the iciol.<NEW_LINE>// the inoutline may have a catch-weight, because the respective goods may have a weight.<NEW_LINE>iciol.setC_UOM_ID(inOutLine.getCatch_UOM_ID());<NEW_LINE>// if inOutLine.QtyDeliveredCatch is null, then iciol.QtyDeliveredInUOM_Catch must also be null and not zero.<NEW_LINE>final BigDecimal catchQtyOrNull = getValueOrNull(inOutLine, I_M_InOutLine.COLUMNNAME_QtyDeliveredCatch);<NEW_LINE>iciol.setQtyDeliveredInUOM_Catch(catchQtyOrNull);<NEW_LINE>// make sure that both quantities have the same UOM<NEW_LINE>final IUOMConversionBL uomConversionBL = Services.get(IUOMConversionBL.class);<NEW_LINE>final BigDecimal nominalQty = uomConversionBL.convertQty(UOMConversionContext.of(ProductId.ofRepoId(inOutLine.getM_Product_ID())), inOutLine.getQtyEntered(), UomId.ofRepoId(inOutLine.getC_UOM_ID()), /* uomFrom */<NEW_LINE>UomId.ofRepoId(inOutLine.getCatch_UOM_ID()));<NEW_LINE>iciol.setQtyDeliveredInUOM_Nominal(nominalQty);<NEW_LINE>} else {<NEW_LINE>iciol.setC_UOM_ID(assumeGreaterThanZero(inOutLine.getC_UOM_ID(), "inOutLine.getC_UOM_ID()"));<NEW_LINE>iciol.setQtyDeliveredInUOM_Nominal(inOutLine.getQtyEntered());<NEW_LINE>}<NEW_LINE>saveRecord(iciol);<NEW_LINE>}
getC_Invoice_Candidate().getInvoicableQtyBasedOn());
1,156,435
public Table display(@ShellOption(value = { "", "--id" }, help = "the task execution id") long id) {<NEW_LINE>TaskExecutionResource taskExecutionResource = taskOperations().taskExecutionStatus(id);<NEW_LINE>TableModelBuilder<Object> modelBuilder = new TableModelBuilder<>();<NEW_LINE>modelBuilder.addRow().addValue("Key ").addValue("Value ");<NEW_LINE>modelBuilder.addRow().addValue("Id ").addValue(taskExecutionResource.getExecutionId());<NEW_LINE>modelBuilder.addRow().addValue("Resource URL ").addValue(taskExecutionResource.getResourceUrl());<NEW_LINE>modelBuilder.addRow().addValue("Name ").addValue(taskExecutionResource.getTaskName());<NEW_LINE>modelBuilder.addRow().addValue("CLI Arguments ").addValue(taskExecutionResource.getArguments());<NEW_LINE>modelBuilder.addRow().addValue("App Arguments ").addValue(taskExecutionResource.getAppProperties());<NEW_LINE>modelBuilder.addRow().addValue("Deployment Properties ").addValue(taskExecutionResource.getDeploymentProperties());<NEW_LINE>modelBuilder.addRow().addValue("Job Execution Ids ").addValue(taskExecutionResource.getJobExecutionIds());<NEW_LINE>modelBuilder.addRow().addValue("Start Time ").addValue(taskExecutionResource.getStartTime());<NEW_LINE>modelBuilder.addRow().addValue("End Time ").addValue(taskExecutionResource.getEndTime());<NEW_LINE>modelBuilder.addRow().addValue("Exit Code ").addValue(taskExecutionResource.getExitCode());<NEW_LINE>modelBuilder.addRow().addValue("Exit Message ").addValue(taskExecutionResource.getExitMessage());<NEW_LINE>modelBuilder.addRow().addValue("Error Message ").<MASK><NEW_LINE>modelBuilder.addRow().addValue("External Execution Id ").addValue(taskExecutionResource.getExternalExecutionId());<NEW_LINE>TableBuilder builder = new TableBuilder(modelBuilder.build());<NEW_LINE>DataFlowTables.applyStyle(builder);<NEW_LINE>return builder.build();<NEW_LINE>}
addValue(taskExecutionResource.getErrorMessage());
534,183
public DetailedError unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>DetailedError detailedError = new DetailedError();<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 null;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>if (context.testExpression("code", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>detailedError.setCode(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("message", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>detailedError.setMessage(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return detailedError;<NEW_LINE>}
String currentParentElement = context.getCurrentParentElement();
1,457,011
public static int hash(byte[] data, int offset, int length, int seed) {<NEW_LINE>int m = 0x5bd1e995;<NEW_LINE>int r = 24;<NEW_LINE>int h = seed ^ length;<NEW_LINE>int len4 = length >> 2;<NEW_LINE>for (int i = 0; i < len4; i++) {<NEW_LINE>int i4 <MASK><NEW_LINE>int k = data[i4 + 3];<NEW_LINE>k = k << 8;<NEW_LINE>k = k | (data[i4 + 2] & 0xff);<NEW_LINE>k = k << 8;<NEW_LINE>k = k | (data[i4 + 1] & 0xff);<NEW_LINE>k = k << 8;<NEW_LINE>// noinspection PointlessArithmeticExpression<NEW_LINE>k = k | (data[i4 + 0] & 0xff);<NEW_LINE>k *= m;<NEW_LINE>k ^= k >>> r;<NEW_LINE>k *= m;<NEW_LINE>h *= m;<NEW_LINE>h ^= k;<NEW_LINE>}<NEW_LINE>// avoid calculating modulo<NEW_LINE>int lenM = len4 << 2;<NEW_LINE>int left = length - lenM;<NEW_LINE>int iM = lenM + offset;<NEW_LINE>if (left != 0) {<NEW_LINE>if (left >= 3) {<NEW_LINE>h ^= data[iM + 2] << 16;<NEW_LINE>}<NEW_LINE>if (left >= 2) {<NEW_LINE>h ^= data[iM + 1] << 8;<NEW_LINE>}<NEW_LINE>if (left >= 1) {<NEW_LINE>h ^= data[iM];<NEW_LINE>}<NEW_LINE>h *= m;<NEW_LINE>}<NEW_LINE>h ^= h >>> 13;<NEW_LINE>h *= m;<NEW_LINE>h ^= h >>> 15;<NEW_LINE>return h;<NEW_LINE>}
= (i << 2) + offset;
778,577
public boolean visit(SQLBetweenExpr x) {<NEW_LINE>String begin = null;<NEW_LINE>if (x.beginExpr instanceof SQLCharExpr) {<NEW_LINE>begin = (String) ((SQLCharExpr) x.beginExpr).getValue();<NEW_LINE>} else {<NEW_LINE>begin = x.beginExpr.toString();<NEW_LINE>}<NEW_LINE>String end = null;<NEW_LINE>if (x.endExpr instanceof SQLCharExpr) {<NEW_LINE>end = (String) ((SQLCharExpr) <MASK><NEW_LINE>} else {<NEW_LINE>end = x.endExpr.toString();<NEW_LINE>}<NEW_LINE>Column column = getColumn(x);<NEW_LINE>if (column == null) {<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>Condition condition = null;<NEW_LINE>for (Condition item : this.getConditions()) {<NEW_LINE>if (item.getColumn().equals(column) && item.getOperator().equals("between")) {<NEW_LINE>condition = item;<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (condition == null) {<NEW_LINE>condition = new Condition(column, "between");<NEW_LINE>this.conditions.add(condition);<NEW_LINE>}<NEW_LINE>condition.getValues().add(begin);<NEW_LINE>condition.getValues().add(end);<NEW_LINE>return true;<NEW_LINE>}
x.endExpr).getValue();
56,012
static PsiElement formatElement(@Nonnull PsiElement elementToFormat, @Nonnull TextRange range, boolean canChangeWhiteSpacesOnly) {<NEW_LINE>final PsiFile file = elementToFormat.getContainingFile();<NEW_LINE>final Document document = file.getViewProvider().getDocument();<NEW_LINE>if (document != null) {<NEW_LINE>final TextRange rangeAfterFormat = formatRangeInFile(file, range, canChangeWhiteSpacesOnly);<NEW_LINE>if (rangeAfterFormat != null) {<NEW_LINE>PsiDocumentManager.getInstance(file.getProject<MASK><NEW_LINE>if (!elementToFormat.isValid()) {<NEW_LINE>PsiElement elementAtStart = file.findElementAt(rangeAfterFormat.getStartOffset());<NEW_LINE>if (elementAtStart instanceof PsiWhiteSpace) {<NEW_LINE>elementAtStart = PsiTreeUtil.nextLeaf(elementAtStart);<NEW_LINE>}<NEW_LINE>if (elementAtStart != null) {<NEW_LINE>PsiElement parent = PsiTreeUtil.getParentOfType(elementAtStart, elementToFormat.getClass());<NEW_LINE>if (parent != null) {<NEW_LINE>return parent;<NEW_LINE>}<NEW_LINE>return elementAtStart;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return elementToFormat;<NEW_LINE>}
()).commitDocument(document);
1,533,399
public boolean encode(@NonNull Resource<Bitmap> resource, @NonNull File file, @NonNull Options options) {<NEW_LINE>final Bitmap bitmap = resource.get();<NEW_LINE>Bitmap.CompressFormat format = getFormat(bitmap, options);<NEW_LINE>GlideTrace.beginSectionFormat("encode: [%dx%d] %s", bitmap.getWidth(), bitmap.getHeight(), format);<NEW_LINE>try {<NEW_LINE>long start = LogTime.getLogTime();<NEW_LINE>int quality = options.get(COMPRESSION_QUALITY);<NEW_LINE>boolean success = false;<NEW_LINE>OutputStream os = null;<NEW_LINE>try {<NEW_LINE>os = new FileOutputStream(file);<NEW_LINE>if (arrayPool != null) {<NEW_LINE>os <MASK><NEW_LINE>}<NEW_LINE>bitmap.compress(format, quality, os);<NEW_LINE>os.close();<NEW_LINE>success = true;<NEW_LINE>} catch (IOException e) {<NEW_LINE>if (Log.isLoggable(TAG, Log.DEBUG)) {<NEW_LINE>Log.d(TAG, "Failed to encode Bitmap", e);<NEW_LINE>}<NEW_LINE>} finally {<NEW_LINE>if (os != null) {<NEW_LINE>try {<NEW_LINE>os.close();<NEW_LINE>} catch (IOException e) {<NEW_LINE>// Do nothing.<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (Log.isLoggable(TAG, Log.VERBOSE)) {<NEW_LINE>Log.v(TAG, "Compressed with type: " + format + " of size " + Util.getBitmapByteSize(bitmap) + " in " + LogTime.getElapsedMillis(start) + ", options format: " + options.get(COMPRESSION_FORMAT) + ", hasAlpha: " + bitmap.hasAlpha());<NEW_LINE>}<NEW_LINE>return success;<NEW_LINE>} finally {<NEW_LINE>GlideTrace.endSection();<NEW_LINE>}<NEW_LINE>}
= new BufferedOutputStream(os, arrayPool);
1,129,188
public static DescribeTasksResponse unmarshall(DescribeTasksResponse describeTasksResponse, UnmarshallerContext _ctx) {<NEW_LINE>describeTasksResponse.setRequestId(_ctx.stringValue("DescribeTasksResponse.RequestId"));<NEW_LINE>describeTasksResponse.setPageNumber(_ctx.integerValue("DescribeTasksResponse.PageNumber"));<NEW_LINE>describeTasksResponse.setPageSize(_ctx.integerValue("DescribeTasksResponse.PageSize"));<NEW_LINE>describeTasksResponse.setTotalRecordCount(_ctx.integerValue("DescribeTasksResponse.TotalRecordCount"));<NEW_LINE>List<TaskProgressInfo> items = new ArrayList<TaskProgressInfo>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("DescribeTasksResponse.Items.Length"); i++) {<NEW_LINE>TaskProgressInfo taskProgressInfo = new TaskProgressInfo();<NEW_LINE>taskProgressInfo.setStatus(_ctx.stringValue("DescribeTasksResponse.Items[" + i + "].Status"));<NEW_LINE>taskProgressInfo.setFinishTime(_ctx.stringValue("DescribeTasksResponse.Items[" + i + "].FinishTime"));<NEW_LINE>taskProgressInfo.setStepsInfo(_ctx.stringValue("DescribeTasksResponse.Items[" + i + "].StepsInfo"));<NEW_LINE>taskProgressInfo.setProgress(_ctx.floatValue<MASK><NEW_LINE>taskProgressInfo.setBeginTime(_ctx.stringValue("DescribeTasksResponse.Items[" + i + "].BeginTime"));<NEW_LINE>taskProgressInfo.setRemain(_ctx.integerValue("DescribeTasksResponse.Items[" + i + "].Remain"));<NEW_LINE>taskProgressInfo.setCurrentStepName(_ctx.stringValue("DescribeTasksResponse.Items[" + i + "].CurrentStepName"));<NEW_LINE>taskProgressInfo.setStepProgressInfo(_ctx.stringValue("DescribeTasksResponse.Items[" + i + "].StepProgressInfo"));<NEW_LINE>taskProgressInfo.setTaskId(_ctx.stringValue("DescribeTasksResponse.Items[" + i + "].TaskId"));<NEW_LINE>taskProgressInfo.setTaskAction(_ctx.stringValue("DescribeTasksResponse.Items[" + i + "].TaskAction"));<NEW_LINE>items.add(taskProgressInfo);<NEW_LINE>}<NEW_LINE>describeTasksResponse.setItems(items);<NEW_LINE>return describeTasksResponse;<NEW_LINE>}
("DescribeTasksResponse.Items[" + i + "].Progress"));
574,963
public void handle(Map data) {<NEW_LINE>String dstCacheInstallPath = srcImageCache.getInstallUrl().replace(srcPrimaryStorage.getMountPath(<MASK><NEW_LINE>ImageCacheVO cvo = new ImageCacheVO();<NEW_LINE>cvo.setImageUuid(srcImageCache.getImageUuid());<NEW_LINE>cvo.setInstallUrl(dstCacheInstallPath);<NEW_LINE>cvo.setMd5sum("no md5");<NEW_LINE>cvo.setPrimaryStorageUuid(dstPrimaryStorage.getUuid());<NEW_LINE>cvo.setSize(srcImageCache.getSize());<NEW_LINE>cvo.setMediaType(ImageMediaType.valueOf(srcImageCache.getMediaType()));<NEW_LINE>cvo = dbf.persistAndRefresh(cvo);<NEW_LINE>logger.debug(String.format("successfully copied cache of image[uuid:%s] to image cache[id:%s, path:%s]", srcImageCache.getImageUuid(), cvo.getId(), cvo.getInstallUrl()));<NEW_LINE>completion.success(ImageCacheInventory.valueOf(cvo));<NEW_LINE>}
), dstPrimaryStorage.getMountPath());
557,544
public static ListChatRecordDetailResponse unmarshall(ListChatRecordDetailResponse listChatRecordDetailResponse, UnmarshallerContext _ctx) {<NEW_LINE>listChatRecordDetailResponse.setRequestId(_ctx.stringValue("ListChatRecordDetailResponse.RequestId"));<NEW_LINE>listChatRecordDetailResponse.setMessage(_ctx.stringValue("ListChatRecordDetailResponse.Message"));<NEW_LINE>listChatRecordDetailResponse.setHttpStatusCode(_ctx.integerValue("ListChatRecordDetailResponse.HttpStatusCode"));<NEW_LINE>listChatRecordDetailResponse.setCode(_ctx.stringValue("ListChatRecordDetailResponse.Code"));<NEW_LINE>listChatRecordDetailResponse.setSuccess(_ctx.booleanValue("ListChatRecordDetailResponse.Success"));<NEW_LINE>ResultData resultData = new ResultData();<NEW_LINE>resultData.setCurrentPage(_ctx.longValue("ListChatRecordDetailResponse.ResultData.CurrentPage"));<NEW_LINE>resultData.setTotalResults(_ctx.longValue("ListChatRecordDetailResponse.ResultData.TotalResults"));<NEW_LINE>resultData.setTotalPage(_ctx.longValue("ListChatRecordDetailResponse.ResultData.TotalPage"));<NEW_LINE>resultData.setOnePageSize(_ctx.longValue("ListChatRecordDetailResponse.ResultData.OnePageSize"));<NEW_LINE>List<DataItem> data = new ArrayList<DataItem>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("ListChatRecordDetailResponse.ResultData.Data.Length"); i++) {<NEW_LINE>DataItem dataItem = new DataItem();<NEW_LINE>dataItem.setServicerName(_ctx.stringValue<MASK><NEW_LINE>dataItem.setStartTime(_ctx.longValue("ListChatRecordDetailResponse.ResultData.Data[" + i + "].StartTime"));<NEW_LINE>dataItem.setEndTime(_ctx.longValue("ListChatRecordDetailResponse.ResultData.Data[" + i + "].EndTime"));<NEW_LINE>List<MessageListItem> messageList = new ArrayList<MessageListItem>();<NEW_LINE>for (int j = 0; j < _ctx.lengthValue("ListChatRecordDetailResponse.ResultData.Data[" + i + "].MessageList.Length"); j++) {<NEW_LINE>MessageListItem messageListItem = new MessageListItem();<NEW_LINE>messageListItem.setSenderName(_ctx.stringValue("ListChatRecordDetailResponse.ResultData.Data[" + i + "].MessageList[" + j + "].SenderName"));<NEW_LINE>messageListItem.setContent(_ctx.stringValue("ListChatRecordDetailResponse.ResultData.Data[" + i + "].MessageList[" + j + "].Content"));<NEW_LINE>messageListItem.setSenderType(_ctx.longValue("ListChatRecordDetailResponse.ResultData.Data[" + i + "].MessageList[" + j + "].SenderType"));<NEW_LINE>messageListItem.setCreateTime(_ctx.longValue("ListChatRecordDetailResponse.ResultData.Data[" + i + "].MessageList[" + j + "].CreateTime"));<NEW_LINE>messageListItem.setMsgType(_ctx.stringValue("ListChatRecordDetailResponse.ResultData.Data[" + i + "].MessageList[" + j + "].MsgType"));<NEW_LINE>messageList.add(messageListItem);<NEW_LINE>}<NEW_LINE>dataItem.setMessageList(messageList);<NEW_LINE>data.add(dataItem);<NEW_LINE>}<NEW_LINE>resultData.setData(data);<NEW_LINE>listChatRecordDetailResponse.setResultData(resultData);<NEW_LINE>return listChatRecordDetailResponse;<NEW_LINE>}
("ListChatRecordDetailResponse.ResultData.Data[" + i + "].ServicerName"));
763,862
protected void onSaveInstanceState(@NonNull Bundle outState) {<NEW_LINE>// Log_OC.e(TAG, "onSaveInstanceState init" );<NEW_LINE>super.onSaveInstanceState(outState);<NEW_LINE>// / global state<NEW_LINE>outState.putLong(KEY_WAITING_FOR_OP_ID, mWaitingForOpId);<NEW_LINE>outState.putBoolean(KEY_IS_SSL_CONN, mServerInfo.mIsSslConn);<NEW_LINE>outState.<MASK><NEW_LINE>if (mServerInfo.mVersion != null) {<NEW_LINE>outState.putString(KEY_OC_VERSION, mServerInfo.mVersion.getVersion());<NEW_LINE>}<NEW_LINE>outState.putString(KEY_SERVER_AUTH_METHOD, mServerInfo.mAuthMethod.name());<NEW_LINE>// / authentication<NEW_LINE>outState.putBoolean(KEY_AUTH_IS_FIRST_ATTEMPT_TAG, mIsFirstAuthAttempt);<NEW_LINE>// / AsyncTask (User and password)<NEW_LINE>if (mAsyncTask != null) {<NEW_LINE>mAsyncTask.cancel(true);<NEW_LINE>outState.putBoolean(KEY_ASYNC_TASK_IN_PROGRESS, true);<NEW_LINE>} else {<NEW_LINE>outState.putBoolean(KEY_ASYNC_TASK_IN_PROGRESS, false);<NEW_LINE>}<NEW_LINE>mAsyncTask = null;<NEW_LINE>}
putString(KEY_HOST_URL_TEXT, mServerInfo.mBaseUrl);
825,050
private void puComboboxActionPerformed() {<NEW_LINE>if (puComboBox.getSelectedItem() != null) {<NEW_LINE>FileObject pXml = puObject.getPrimaryFile();<NEW_LINE>Project project = pXml != null ? FileOwnerQuery.getOwner(pXml) : null;<NEW_LINE>PersistenceEnvironment pe = project != null ? project.getLookup().lookup(PersistenceEnvironment.class) : null;<NEW_LINE>PersistenceUnit pu = (PersistenceUnit) puConfigMap.<MASK><NEW_LINE>dbconn = JPAEditorUtil.findDatabaseConnection(pu, pe.getProject());<NEW_LINE>if (dbconn != null) {<NEW_LINE>if (dbconn.getJDBCConnection() == null) {<NEW_LINE>Mutex.EVENT.readAccess(new Mutex.Action<DatabaseConnection>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public DatabaseConnection run() {<NEW_LINE>ConnectionManager.getDefault().showConnectionDialog(dbconn);<NEW_LINE>return dbconn;<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>//<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
get(puComboBox.getSelectedItem());
666,515
private boolean writeToUsb(byte[] message) {<NEW_LINE>// System.out.println(">");<NEW_LINE>// RainbowHexDump.hexDumpUTF16LE(message); // DEBUG<NEW_LINE>// writeBuffer.order() equals BIG_ENDIAN;<NEW_LINE>ByteBuffer writeBuffer = ByteBuffer.allocateDirect(message.length);<NEW_LINE>// Don't do writeBuffer.rewind();<NEW_LINE>writeBuffer.put(message);<NEW_LINE>IntBuffer writeBufTransferred = IntBuffer.allocate(1);<NEW_LINE>int result;<NEW_LINE>while (!task.isCancelled()) {<NEW_LINE>// last one is TIMEOUT. 0 stands for unlimited. Endpoint OUT = 0x01<NEW_LINE>result = LibUsb.bulkTransfer(handlerNS, (byte) 0x01, writeBuffer, writeBufTransferred, 1000);<NEW_LINE>switch(result) {<NEW_LINE>case LibUsb.SUCCESS:<NEW_LINE>if (writeBufTransferred.get() == message.length)<NEW_LINE>return false;<NEW_LINE>else {<NEW_LINE>print("GL Data transfer issue [write]\n Requested: " + message.length + "\n Transferred: " + writeBufTransferred.get(), EMsgType.FAIL);<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>case LibUsb.ERROR_TIMEOUT:<NEW_LINE>continue;<NEW_LINE>default:<NEW_LINE>print("GL Data transfer issue [write]\n Returned: " + UsbErrorCodes.getErrCode(result) + "\n GL Execution stopped", EMsgType.FAIL);<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>return true;<NEW_LINE>}
print("GL Execution interrupted", EMsgType.INFO);
721,887
final DeleteContactResult executeDeleteContact(DeleteContactRequest deleteContactRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(deleteContactRequest);<NEW_LINE><MASK><NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DeleteContactRequest> request = null;<NEW_LINE>Response<DeleteContactResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DeleteContactRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(deleteContactRequest));<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, "Alexa For Business");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DeleteContact");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DeleteContactResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DeleteContactResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
1,027,543
public Date parse(String source, ParsePosition pos) {<NEW_LINE>// if lenient ignore superfluous input..<NEW_LINE>if (patternEndsWithZ) {<NEW_LINE>if (source.length() > DATETIME_UTC_PATTERN.length() && !isLenient()) {<NEW_LINE>pos.setErrorIndex(DATETIME_UTC_PATTERN.length());<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>} else if (source.length() > DATETIME_PATTERN.length() && !isLenient()) {<NEW_LINE>pos.setErrorIndex(DATETIME_PATTERN.length());<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>if (source.charAt(8) != 'T') {<NEW_LINE>pos.setErrorIndex(8);<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>if (patternEndsWithZ && source.charAt(15) != 'Z') {<NEW_LINE>pos.setErrorIndex(15);<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>final int year = Integer.parseInt(source.substring(0, 4));<NEW_LINE>final int month = Integer.parseInt(source.substring(4, 6)) - 1;<NEW_LINE>final int day = Integer.parseInt(source<MASK><NEW_LINE>final int hour = Integer.parseInt(source.substring(9, 11));<NEW_LINE>final int minute = Integer.parseInt(source.substring(11, 13));<NEW_LINE>final int second = Integer.parseInt(source.substring(13, 15));<NEW_LINE>final Date d = makeCalendar(isLenient(), getTimeZone(), year, month, day, hour, minute, second).getTime();<NEW_LINE>pos.setIndex(15);<NEW_LINE>return d;<NEW_LINE>} catch (RuntimeException e) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>}
.substring(6, 8));
422,519
public ListSetsResult retrieveSets(int offset, int length) {<NEW_LINE>// Only database sets (virtual sets are added by lyncode common library)<NEW_LINE>log.debug("Querying sets. Offset: " + offset + " - Length: " + length);<NEW_LINE>List<Set> array = new ArrayList<Set>();<NEW_LINE>int communityCount = this.getCommunityCount();<NEW_LINE>log.debug("Communities: " + communityCount);<NEW_LINE><MASK><NEW_LINE>log.debug("Collections: " + collectionCount);<NEW_LINE>if (offset < communityCount) {<NEW_LINE>if (offset + length > communityCount) {<NEW_LINE>// Add some collections<NEW_LINE>List<Set> tmp = community(offset, length);<NEW_LINE>array.addAll(tmp);<NEW_LINE>array.addAll(collection(0, length - tmp.size()));<NEW_LINE>} else {<NEW_LINE>array.addAll(community(offset, length));<NEW_LINE>}<NEW_LINE>} else if (offset < communityCount + collectionCount) {<NEW_LINE>array.addAll(collection(offset - communityCount, length));<NEW_LINE>}<NEW_LINE>log.debug("Has More Results: " + ((offset + length < communityCount + collectionCount) ? "Yes" : "No"));<NEW_LINE>return new ListSetsResult(offset + length < communityCount + collectionCount, array, communityCount + collectionCount);<NEW_LINE>}
int collectionCount = this.getCollectionCount();
1,283,072
protected void handlePost(final HttpServletRequest req, final HttpServletResponse resp, final Session session) throws ServletException, IOException {<NEW_LINE>try {<NEW_LINE>final String jsonPayload = HttpRequestUtils.getBody(req);<NEW_LINE>// Convert to GenericImageType DTO to transfer the input request<NEW_LINE>final ImageTypeDTO genericImageType = this.converterUtils.convertToDTO(jsonPayload, ImageTypeDTO.class);<NEW_LINE>// Check for required permission to invoke the API<NEW_LINE>final <MASK><NEW_LINE>if (imageType == null) {<NEW_LINE>log.info("Required field imageType is null. Must provide valid imageType to " + "create/register image type.");<NEW_LINE>throw new ImageMgmtValidationException(ErrorCode.BAD_REQUEST, "Required field imageType is" + " null. Must provide valid imageType to create/register image type.");<NEW_LINE>}<NEW_LINE>final Integer imageTypeId;<NEW_LINE>genericImageType.setModifiedBy(session.getUser().getUserId());<NEW_LINE>genericImageType.setCreatedBy(session.getUser().getUserId());<NEW_LINE>if (!HttpRequestUtils.hasParam(req, "updateImageOwners")) {<NEW_LINE>if (!hasImageManagementPermission(imageType, session.getUser(), Type.CREATE)) {<NEW_LINE>log.debug(String.format("Invalid permission to create image type for " + "user: %s, image type: %s.", session.getUser().getUserId(), imageType));<NEW_LINE>throw new ImageMgmtInvalidPermissionException(ErrorCode.FORBIDDEN, "Invalid permission to " + "create image type");<NEW_LINE>}<NEW_LINE>// Create image type /Update and get image type id<NEW_LINE>imageTypeId = this.imageTypeService.createImageType(genericImageType);<NEW_LINE>} else {<NEW_LINE>if (!hasImageManagementPermission(imageType, session.getUser(), Type.UPDATE)) {<NEW_LINE>log.debug(String.format("Invalid permission to update image type for " + "user: %s, image type: %s.", session.getUser().getUserId(), imageType));<NEW_LINE>throw new ImageMgmtInvalidPermissionException(ErrorCode.FORBIDDEN, "Invalid permission to " + "create image type");<NEW_LINE>}<NEW_LINE>final String updateOp = req.getParameter("updateImageOwners");<NEW_LINE>imageTypeId = this.imageTypeService.updateImageType(genericImageType, updateOp);<NEW_LINE>}<NEW_LINE>// prepare to send response<NEW_LINE>resp.setStatus(HttpStatus.SC_CREATED);<NEW_LINE>resp.setHeader("Location", IMAGE_TYPE_WITH_ID_URI_TEMPLATE.createURI(imageTypeId.toString()));<NEW_LINE>sendResponse(resp, HttpServletResponse.SC_CREATED, new HashMap<>());<NEW_LINE>} catch (final ImageMgmtException e) {<NEW_LINE>log.error("Exception while creating / updating an image type", e);<NEW_LINE>sendErrorResponse(resp, e.getErrorCode().getCode(), e.getMessage());<NEW_LINE>} catch (final Exception e) {<NEW_LINE>log.error("Exception while creating / updating an image type", e);<NEW_LINE>sendErrorResponse(resp, HttpServletResponse.SC_INTERNAL_SERVER_ERROR, "Exception while creating / updating an image type. Reason: " + e.getMessage());<NEW_LINE>}<NEW_LINE>}
String imageType = genericImageType.getName();
1,699,967
public OResultSet execute(String language, String script, Map<String, ?> args) {<NEW_LINE>checkOpenness();<NEW_LINE>checkIfActive();<NEW_LINE>if (!"sql".equalsIgnoreCase(language)) {<NEW_LINE>checkSecurity(ORule.ResourceGeneric.COMMAND, ORole.PERMISSION_EXECUTE, language);<NEW_LINE>}<NEW_LINE>InterruptTimerTask commandInterruptTimer = null;<NEW_LINE>if (getConfiguration().getValueAsLong(OGlobalConfiguration.COMMAND_TIMEOUT) > 0) {<NEW_LINE>// commandInterruptTimer = new InterruptTimerTask(Thread.currentThread());<NEW_LINE>// getSharedContext()<NEW_LINE>// .getOrientDB()<NEW_LINE>// .scheduleOnce(<NEW_LINE>// commandInterruptTimer,<NEW_LINE>// getConfiguration().getValueAsLong(OGlobalConfiguration.COMMAND_TIMEOUT));<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>OScriptExecutor executor = sharedContext.getOrientDB().getScriptManager().<MASK><NEW_LINE>OResultSet original;<NEW_LINE>((OAbstractPaginatedStorage) this.storage).pauseConfigurationUpdateNotifications();<NEW_LINE>try {<NEW_LINE>original = executor.execute(this, script, args);<NEW_LINE>} finally {<NEW_LINE>((OAbstractPaginatedStorage) this.storage).fireConfigurationUpdateNotifications();<NEW_LINE>}<NEW_LINE>OLocalResultSetLifecycleDecorator result = new OLocalResultSetLifecycleDecorator(original);<NEW_LINE>this.queryStarted(result.getQueryId(), result);<NEW_LINE>result.addLifecycleListener(this);<NEW_LINE>return result;<NEW_LINE>} finally {<NEW_LINE>if (commandInterruptTimer != null) {<NEW_LINE>commandInterruptTimer.cancel();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
getCommandManager().getScriptExecutor(language);
614,817
private Builder addPutBlobHeaders(CreateBlobOptions options, Builder builder) {<NEW_LINE>builder = addOptionalHeader(builder, "Content-Type", options.getContentType());<NEW_LINE>if (options.getContentType() == null) {<NEW_LINE>// Note: Add content type here to enable proper HMAC signing<NEW_LINE>builder = builder.type("application/octet-stream");<NEW_LINE>}<NEW_LINE>builder = addOptionalHeader(builder, "Content-Encoding", options.getContentEncoding());<NEW_LINE>builder = addOptionalHeader(builder, "Content-Language", options.getContentLanguage());<NEW_LINE>builder = addOptionalHeader(builder, "Content-MD5", options.getContentMD5());<NEW_LINE>builder = addOptionalHeader(builder, "Cache-Control", options.getCacheControl());<NEW_LINE>builder = addOptionalHeader(builder, "x-ms-blob-content-type", options.getBlobContentType());<NEW_LINE>builder = addOptionalHeader(builder, "x-ms-blob-content-encoding", options.getBlobContentEncoding());<NEW_LINE>builder = addOptionalHeader(builder, <MASK><NEW_LINE>builder = addOptionalHeader(builder, "x-ms-blob-content-md5", options.getBlobContentMD5());<NEW_LINE>builder = addOptionalHeader(builder, "x-ms-blob-cache-control", options.getBlobCacheControl());<NEW_LINE>builder = addOptionalHeader(builder, "x-ms-lease-id", options.getLeaseId());<NEW_LINE>builder = addOptionalMetadataHeader(builder, options.getMetadata());<NEW_LINE>builder = addOptionalAccessConditionHeader(builder, options.getAccessCondition());<NEW_LINE>return builder;<NEW_LINE>}
"x-ms-blob-content-language", options.getBlobContentLanguage());
174,412
// GEN-LAST:event_editApplicationType<NEW_LINE>private void menuNewActionPerformed(java.awt.event.ActionEvent evt) {<NEW_LINE>// GEN-FIRST:event_menuNewActionPerformed<NEW_LINE>ApplicationType eat = ApplicationTypeManager.getDefault().newType("");<NEW_LINE>final ApplicationTypeForm form = new ApplicationTypeForm(eat);<NEW_LINE>final DialogDescriptor[] dd = new DialogDescriptor[1];<NEW_LINE>dd[0] = new DialogDescriptor(form, "New Application Type Details", true, new Object[] { form.getValidationSupport().getOkButton(), DialogDescriptor.CANCEL_OPTION }, form.getValidationSupport().getOkButton(), DialogDescriptor.DEFAULT_ALIGN, null, new ActionListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void actionPerformed(ActionEvent e) {<NEW_LINE>if (e.getSource().equals(form.getValidationSupport().getOkButton()) && form.storeData()) {<NEW_LINE>dd[0].setClosingOptions(new Object[] { form.getValidationSupport().getOkButton() });<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>dd[0].setClosingOptions(new Object[] { DialogDescriptor.CANCEL_OPTION });<NEW_LINE>Dialog dlg = DialogDisplayer.getDefault().createDialog(dd[0]);<NEW_LINE>dlg.setVisible(true);<NEW_LINE>if (dd[0].getValue() == form.getValidationSupport().getOkButton()) {<NEW_LINE>try {<NEW_LINE>ApplicationTypeManager.<MASK><NEW_LINE>} catch (IOException ex) {<NEW_LINE>ex.printStackTrace();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>tableModel.update();<NEW_LINE>}
getDefault().storeType(eat);
756,475
protected DefaultMutableTreeNode buildTree() {<NEW_LINE>// "Examples");<NEW_LINE>DefaultMutableTreeNode root = new DefaultMutableTreeNode();<NEW_LINE>try {<NEW_LINE>// Get the list of Mode-specific examples, in the order the Mode wants<NEW_LINE>// to present them (i.e. Basics, then Topics, then Demos...)<NEW_LINE>File[] examples = mode.getExampleCategoryFolders();<NEW_LINE>for (File subFolder : examples) {<NEW_LINE>DefaultMutableTreeNode subNode = new <MASK><NEW_LINE>if (base.addSketches(subNode, subFolder, true)) {<NEW_LINE>root.add(subNode);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>DefaultMutableTreeNode foundationLibraries = new DefaultMutableTreeNode(Language.text("examples.core_libraries"));<NEW_LINE>// Get examples for core libraries<NEW_LINE>for (Library lib : mode.coreLibraries) {<NEW_LINE>if (lib.hasExamples()) {<NEW_LINE>DefaultMutableTreeNode libNode = new DefaultMutableTreeNode(lib.getName());<NEW_LINE>if (base.addSketches(libNode, lib.getExamplesFolder(), true)) {<NEW_LINE>foundationLibraries.add(libNode);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (foundationLibraries.getChildCount() > 0) {<NEW_LINE>root.add(foundationLibraries);<NEW_LINE>}<NEW_LINE>// Get examples for third party libraries<NEW_LINE>DefaultMutableTreeNode contributedLibExamples = new DefaultMutableTreeNode(Language.text("examples.libraries"));<NEW_LINE>for (Library lib : mode.contribLibraries) {<NEW_LINE>if (lib.hasExamples()) {<NEW_LINE>DefaultMutableTreeNode libNode = new DefaultMutableTreeNode(lib.getName());<NEW_LINE>base.addSketches(libNode, lib.getExamplesFolder(), true);<NEW_LINE>contributedLibExamples.add(libNode);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (contributedLibExamples.getChildCount() > 0) {<NEW_LINE>root.add(contributedLibExamples);<NEW_LINE>}<NEW_LINE>} catch (IOException e) {<NEW_LINE>e.printStackTrace();<NEW_LINE>}<NEW_LINE>DefaultMutableTreeNode contributedExamplesNode = buildContribTree();<NEW_LINE>if (contributedExamplesNode.getChildCount() > 0) {<NEW_LINE>root.add(contributedExamplesNode);<NEW_LINE>}<NEW_LINE>return root;<NEW_LINE>}
DefaultMutableTreeNode(subFolder.getName());
1,693,436
public void mergeGraph(Graph to, Graph from) {<NEW_LINE>String toCount = to.getCount();<NEW_LINE>String fromCount = from.getCount();<NEW_LINE>long[] count = mergeLongValue(toCount, fromCount);<NEW_LINE>to.setCount(StringUtils.join(count, GraphTrendUtil.GRAPH_CHAR_SPLITTER));<NEW_LINE>String toSum = to.getSum();<NEW_LINE>String fromSum = from.getSum();<NEW_LINE>double[] sum = mergeDoubleValue(toSum, fromSum);<NEW_LINE>to.setSum(StringUtils.join(sum, GraphTrendUtil.GRAPH_CHAR_SPLITTER));<NEW_LINE>String toFails = to.getFails();<NEW_LINE><MASK><NEW_LINE>long[] fails = mergeLongValue(toFails, fromFails);<NEW_LINE>to.setFails(StringUtils.join(fails, GraphTrendUtil.GRAPH_CHAR_SPLITTER));<NEW_LINE>int length = count.length;<NEW_LINE>double[] avg = new double[length];<NEW_LINE>for (int i = 0; i < length; i++) {<NEW_LINE>try {<NEW_LINE>if (count[i] > 0) {<NEW_LINE>avg[i] = sum[i] / count[i];<NEW_LINE>} else {<NEW_LINE>avg[i] = 0.0;<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>Cat.logError(e);<NEW_LINE>avg[i] = 0.0;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>to.setAvg(StringUtils.join(avg, GraphTrendUtil.GRAPH_CHAR_SPLITTER));<NEW_LINE>}
String fromFails = from.getFails();
890,165
protected void onCreate(Bundle savedInstanceState) {<NEW_LINE>super.onCreate(savedInstanceState);<NEW_LINE>setTitle(R.string.settings_file_management_category);<NEW_LINE>if (savedInstanceState == null) {<NEW_LINE>sttFileManagement = new SettingsFileManagementFragment();<NEW_LINE>replaceFragment(sttFileManagement);<NEW_LINE>} else {<NEW_LINE>sttFileManagement = (SettingsFileManagementFragment) getSupportFragmentManager().findFragmentById(R.id.fragment_container);<NEW_LINE>}<NEW_LINE>registerReceiver(cacheSizeUpdateReceiver, new IntentFilter(ACTION_UPDATE_CACHE_SIZE_SETTING));<NEW_LINE>registerReceiver(offlineSizeUpdateReceiver, new IntentFilter(ACTION_UPDATE_OFFLINE_SIZE_SETTING));<NEW_LINE>registerReceiver(<MASK><NEW_LINE>registerReceiver(updateMyAccountReceiver, new IntentFilter(BROADCAST_ACTION_INTENT_UPDATE_ACCOUNT_DETAILS));<NEW_LINE>IntentFilter filterUpdateCUSettings = new IntentFilter(BROADCAST_ACTION_INTENT_SETTINGS_UPDATED);<NEW_LINE>filterUpdateCUSettings.addAction(ACTION_REFRESH_CLEAR_OFFLINE_SETTING);<NEW_LINE>registerReceiver(updateCUSettingsReceiver, filterUpdateCUSettings);<NEW_LINE>registerReceiver(resetVersionInfoReceiver, new IntentFilter(ACTION_RESET_VERSION_INFO_SETTING));<NEW_LINE>registerReceiver(updateRBSchedulerReceiver, new IntentFilter(ACTION_UPDATE_RB_SCHEDULER));<NEW_LINE>registerReceiver(updateFileVersionsReceiver, new IntentFilter(ACTION_UPDATE_FILE_VERSIONS));<NEW_LINE>if (savedInstanceState != null && savedInstanceState.getBoolean(CLEAR_OFFLINE_SHOWN, false)) {<NEW_LINE>showClearOfflineDialog();<NEW_LINE>}<NEW_LINE>}
networkReceiver, new IntentFilter(BROADCAST_ACTION_INTENT_CONNECTIVITY_CHANGE));
1,150,506
private KeyExchange receive_kexinit(Buffer buf) throws Exception {<NEW_LINE><MASK><NEW_LINE>if (j != buf.getLength()) {<NEW_LINE>// packet was compressed and<NEW_LINE>// j is the size of deflated packet.<NEW_LINE>buf.getByte();<NEW_LINE>I_S = new byte[buf.index - 5];<NEW_LINE>} else {<NEW_LINE>I_S = new byte[j - 1 - buf.getByte()];<NEW_LINE>}<NEW_LINE>System.arraycopy(buf.buffer, buf.s, I_S, 0, I_S.length);<NEW_LINE>if (!in_kex) {<NEW_LINE>// We are in rekeying activated by the remote!<NEW_LINE>send_kexinit();<NEW_LINE>}<NEW_LINE>guess = KeyExchange.guess(I_S, I_C);<NEW_LINE>if (guess == null) {<NEW_LINE>throw new JSchException("Algorithm negotiation fail");<NEW_LINE>}<NEW_LINE>if (!isAuthed && (guess[KeyExchange.PROPOSAL_ENC_ALGS_CTOS].equals("none") || (guess[KeyExchange.PROPOSAL_ENC_ALGS_STOC].equals("none")))) {<NEW_LINE>throw new JSchException("NONE Cipher should not be chosen before authentification is successed.");<NEW_LINE>}<NEW_LINE>KeyExchange kex = null;<NEW_LINE>try {<NEW_LINE>Class c = Class.forName(getConfig(guess[KeyExchange.PROPOSAL_KEX_ALGS]));<NEW_LINE>kex = (KeyExchange) (c.newInstance());<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new JSchException(e.toString(), e);<NEW_LINE>}<NEW_LINE>kex.init(this, V_S, V_C, I_S, I_C);<NEW_LINE>return kex;<NEW_LINE>}
int j = buf.getInt();
1,744,977
private void createLatencySlider() {<NEW_LINE>// Latency slider:<NEW_LINE>this.m_latencyTimeSlider = new JSlider(10, 210);<NEW_LINE>this.m_latencyTimeSlider.setBackground(Color.WHITE);<NEW_LINE>this.m_latencyTimeSlider.setValue((int) Showcase.this.getCollector().getLatency());<NEW_LINE>this.m_latencyTimeSlider.setMajorTickSpacing(50);<NEW_LINE><MASK><NEW_LINE>this.m_latencyTimeSlider.setSnapToTicks(true);<NEW_LINE>this.m_latencyTimeSlider.setPaintLabels(true);<NEW_LINE>this.m_latencyTimeSlider.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(), "Latency for adding points.", TitledBorder.LEFT, TitledBorder.BELOW_TOP));<NEW_LINE>this.m_latencyTimeSlider.setPaintTicks(true);<NEW_LINE>this.m_latencyTimeSlider.addChangeListener(new ChangeListener() {<NEW_LINE><NEW_LINE>public void stateChanged(final ChangeEvent e) {<NEW_LINE>JSlider source = (JSlider) e.getSource();<NEW_LINE>// Only if not currently dragged...<NEW_LINE>if (!source.getValueIsAdjusting()) {<NEW_LINE>int value = source.getValue();<NEW_LINE>Showcase.this.getCollector().setLatency(value);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}
this.m_latencyTimeSlider.setMinorTickSpacing(10);
1,127,416
public void run(RegressionEnvironment env) {<NEW_LINE>RegressionPath path = new RegressionPath();<NEW_LINE>String epl = "@public create window MyWindow#keepall as SupportBean_ST0;\n" + "on SupportBean_A delete from MyWindow;\n" + "insert into MyWindow select * from SupportBean_ST0;\n";<NEW_LINE>env.compileDeploy(epl, path);<NEW_LINE>env.compileDeploy("@name('s0') select MyWindow.allOf(x => x.p00 < 5) as allOfX from SupportBean#keepall", path);<NEW_LINE>env.addListener("s0");<NEW_LINE>env.assertStmtTypes("s0", "allOfX".split(","), new EPTypeClass[] { EPTypePremade.BOOLEANBOXED.getEPType() });<NEW_LINE>env.sendEventBean(new SupportBean("E1", 1));<NEW_LINE>env.assertEqualsNew("s0", "allOfX", null);<NEW_LINE>env.sendEventBean(new SupportBean_ST0("ST0", "1", 10));<NEW_LINE>env.sendEventBean(new SupportBean("E2", 10));<NEW_LINE>env.assertEqualsNew("s0", "allOfX", false);<NEW_LINE>env.undeployModuleContaining("s0");<NEW_LINE>env.sendEventBean(new SupportBean_A("A1"));<NEW_LINE>// test named window correlated<NEW_LINE>String eplNamedWindowCorrelated = "@name('s0') select MyWindow(key0 = sb.theString).allOf(x => x.p00 < 5) as allOfX from SupportBean#keepall sb";<NEW_LINE>env.compileDeploy(eplNamedWindowCorrelated, path).addListener("s0");<NEW_LINE>env.sendEventBean(<MASK><NEW_LINE>env.assertEqualsNew("s0", "allOfX", null);<NEW_LINE>env.sendEventBean(new SupportBean_ST0("E2", "KEY1", 1));<NEW_LINE>env.sendEventBean(new SupportBean("E2", 0));<NEW_LINE>env.assertEqualsNew("s0", "allOfX", null);<NEW_LINE>env.sendEventBean(new SupportBean("KEY1", 0));<NEW_LINE>env.assertEqualsNew("s0", "allOfX", true);<NEW_LINE>env.undeployAll();<NEW_LINE>}
new SupportBean("E1", 1));
1,264,343
public Jooby start(@Nonnull Server server) {<NEW_LINE>Path tmpdir = getTmpdir();<NEW_LINE>ensureTmpdir(tmpdir);<NEW_LINE>if (mode == null) {<NEW_LINE>mode = ExecutionMode.DEFAULT;<NEW_LINE>}<NEW_LINE>if (locales == null) {<NEW_LINE>String path = "application.lang";<NEW_LINE>locales = Optional.of(getConfig()).filter(c -> c.hasPath(path)).map(c -> c.getString(path)).map(v -> LocaleUtils.parseLocales(v).orElseThrow(() -> new RuntimeException(String.format("Invalid value for configuration property '%s'; check the documentation of %s#parse(): %s", path, Locale.LanguageRange.class.getName(), v)))).orElseGet(() -> singletonList<MASK><NEW_LINE>}<NEW_LINE>ServiceRegistry services = getServices();<NEW_LINE>services.put(Environment.class, getEnvironment());<NEW_LINE>services.put(Config.class, getConfig());<NEW_LINE>joobyRunHook(getClass().getClassLoader(), server);<NEW_LINE>for (Extension extension : lateExtensions) {<NEW_LINE>try {<NEW_LINE>extension.install(this);<NEW_LINE>} catch (Throwable e) {<NEW_LINE>throw SneakyThrows.propagate(e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>this.lateExtensions.clear();<NEW_LINE>this.lateExtensions = null;<NEW_LINE>this.startingCallbacks = fire(this.startingCallbacks);<NEW_LINE>router.start(this);<NEW_LINE>return this;<NEW_LINE>}
(Locale.getDefault()));
548,128
public void executeAction(final WorkflowProcessor processor, final Map<String, WorkflowActionClassParameter> params) throws WorkflowActionFailureException {<NEW_LINE>try {<NEW_LINE>final User currentUser = processor.getUser();<NEW_LINE>final HttpServletRequest request = null == HttpServletRequestThreadLocal.INSTANCE.getRequest() ? this.mockRequest(currentUser) : HttpServletRequestThreadLocal.INSTANCE.getRequest();<NEW_LINE>final HttpServletResponse response = null == HttpServletResponseThreadLocal.INSTANCE.getResponse() ? this.mockResponse() : HttpServletResponseThreadLocal.INSTANCE.getResponse();<NEW_LINE>final WorkflowActionClassParameter scriptParameter = params.get("script");<NEW_LINE>final WorkflowActionClassParameter keyParameter = params.get("resultKey");<NEW_LINE>final ScriptEngine engine = ScriptEngineFactory.getInstance().getEngine(ENGINE);<NEW_LINE>final String script = scriptParameter.getValue();<NEW_LINE>final <MASK><NEW_LINE>final Reader reader = new StringReader(script);<NEW_LINE>final Object result = engine.eval(request, response, reader, CollectionsUtils.map("workflow", processor, "user", processor.getUser(), "contentlet", processor.getContentlet(), "content", processor.getContentlet()));<NEW_LINE>this.stop = processor.abort();<NEW_LINE>if (null != result && null != resultKey) {<NEW_LINE>processor.getContentlet().setProperty(resultKey, result);<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>Logger.error(this, e.getMessage(), e);<NEW_LINE>throw new WorkflowActionFailureException(e.getMessage(), e);<NEW_LINE>}<NEW_LINE>}
String resultKey = keyParameter.getValue();
1,081,225
public void visit(TypeDefinitionNode typeDefinitionNode) {<NEW_LINE>int type = TokenTypes.TYPE.getId();<NEW_LINE>int modifiers = 0;<NEW_LINE>Node typeDescriptor = typeDefinitionNode.typeDescriptor();<NEW_LINE>switch(typeDescriptor.kind()) {<NEW_LINE>case OBJECT_TYPE_DESC:<NEW_LINE>type = TokenTypes.INTERFACE.getId();<NEW_LINE>modifiers = TokenTypeModifiers.DECLARATION.getId();<NEW_LINE>break;<NEW_LINE>case RECORD_TYPE_DESC:<NEW_LINE>type = TokenTypes.STRUCT.getId();<NEW_LINE>modifiers = TokenTypeModifiers.DECLARATION.getId();<NEW_LINE>break;<NEW_LINE>case INTERSECTION_TYPE_DESC:<NEW_LINE>if (typeDescriptor instanceof IntersectionTypeDescriptorNode) {<NEW_LINE>IntersectionTypeDescriptorNode intSecDescriptor = (IntersectionTypeDescriptorNode) typeDescriptor;<NEW_LINE>SyntaxKind left = intSecDescriptor.leftTypeDesc().kind();<NEW_LINE>SyntaxKind right = intSecDescriptor.rightTypeDesc().kind();<NEW_LINE>if (left == SyntaxKind.RECORD_TYPE_DESC || right == SyntaxKind.RECORD_TYPE_DESC) {<NEW_LINE>type = TokenTypes.STRUCT.getId();<NEW_LINE>}<NEW_LINE>if (left == SyntaxKind.READONLY_TYPE_DESC || right == SyntaxKind.READONLY_TYPE_DESC) {<NEW_LINE>modifiers = TokenTypeModifiers.DECLARATION.getId() <MASK><NEW_LINE>} else {<NEW_LINE>modifiers = TokenTypeModifiers.DECLARATION.getId();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>type = TokenTypes.TYPE.getId();<NEW_LINE>modifiers = TokenTypeModifiers.DECLARATION.getId();<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>this.addSemanticToken(typeDefinitionNode.typeName(), type, modifiers, true, type, 0);<NEW_LINE>visitSyntaxNode(typeDefinitionNode);<NEW_LINE>}
| TokenTypeModifiers.READONLY.getId();
1,337,894
ActionResult<Wo> execute(EffectivePerson effectivePerson, String id, JsonElement jsonElement) throws Exception {<NEW_LINE>try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) {<NEW_LINE>ActionResult<Wo> result = new ActionResult<>();<NEW_LINE>Wi wi = this.convertToWrapIn(jsonElement, Wi.class);<NEW_LINE>Business business = new Business(emc);<NEW_LINE>Reveal reveal = emc.<MASK><NEW_LINE>if (null == reveal) {<NEW_LINE>throw new ExceptionRevealNotExist(id);<NEW_LINE>}<NEW_LINE>Query query = emc.find(reveal.getQuery(), Query.class);<NEW_LINE>if (null == query) {<NEW_LINE>throw new ExceptionQueryNotExist(reveal.getQuery());<NEW_LINE>}<NEW_LINE>if (!business.editable(effectivePerson, query)) {<NEW_LINE>throw new ExceptionQueryAccessDenied(effectivePerson.getDistinguishedName(), query.getName());<NEW_LINE>}<NEW_LINE>emc.beginTransaction(Reveal.class);<NEW_LINE>Wi.copier.copy(wi, reveal);<NEW_LINE>reveal.setQuery(query.getId());<NEW_LINE>if (StringUtils.isNotEmpty(reveal.getName()) && (!this.idleName(business, reveal))) {<NEW_LINE>throw new ExceptionNameExist(reveal.getName());<NEW_LINE>}<NEW_LINE>if (StringUtils.isNotEmpty(reveal.getAlias()) && (!this.idleAlias(business, reveal))) {<NEW_LINE>throw new ExceptionAliasExist(reveal.getName());<NEW_LINE>}<NEW_LINE>emc.check(reveal, CheckPersistType.all);<NEW_LINE>emc.commit();<NEW_LINE>CacheManager.notify(Reveal.class);<NEW_LINE>Wo wo = new Wo();<NEW_LINE>wo.setId(reveal.getId());<NEW_LINE>result.setData(wo);<NEW_LINE>return result;<NEW_LINE>}<NEW_LINE>}
find(id, Reveal.class);
1,851,572
public void onDrawOver(Canvas c, RecyclerView parent, RecyclerView.State state) {<NEW_LINE>if (!mThreadIndicatorEnabled) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>for (int i = 0; i < parent.getChildCount(); i++) {<NEW_LINE>View child = parent.getChildAt(i);<NEW_LINE>int level = parent.<MASK><NEW_LINE>for (int j = 0; j < level; j++) {<NEW_LINE>int left = mHorizontalMargin + j * mLevelIndicatorWidth + mLevelIndicatorWidth / 2;<NEW_LINE>if (mColorCodeEnabled) {<NEW_LINE>mPaint.setColor(mColors.getColor(j % mColors.length(), 0));<NEW_LINE>// 12% alpha<NEW_LINE>mPaint.setAlpha(31);<NEW_LINE>} else {<NEW_LINE>mPaint.setColor(Color.GRAY);<NEW_LINE>mPaint.setAlpha(Math.max(0, 31 - 4 * j));<NEW_LINE>}<NEW_LINE>c.drawLine(left, child.getTop(), left, child.getBottom(), mPaint);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
getChildViewHolder(child).getItemViewType();
996,347
public List<Map<String, Object>> trimIntermediateResultsMap(Map<String, Object[]> intermediateResultsMap) {<NEW_LINE>int numAggregationFunctions = _aggregationFunctions.length;<NEW_LINE>Map<String, Object>[] trimmedResultMaps = new Map[numAggregationFunctions];<NEW_LINE>int numGroups = intermediateResultsMap.size();<NEW_LINE>if (numGroups > _trimThreshold) {<NEW_LINE>// Trim the result only if number of groups is larger than the threshold<NEW_LINE>Sorter[] sorters = new Sorter[numAggregationFunctions];<NEW_LINE>for (int i = 0; i < numAggregationFunctions; i++) {<NEW_LINE>AggregationFunction aggregationFunction = _aggregationFunctions[i];<NEW_LINE>// Assume the intermediate result may not be comparable.<NEW_LINE>sorters[i] = getSorter(_trimSize, aggregationFunction, false);<NEW_LINE>}<NEW_LINE>// Add results into sorters<NEW_LINE>for (Map.Entry<String, Object[]> entry : intermediateResultsMap.entrySet()) {<NEW_LINE>String groupKey = entry.getKey();<NEW_LINE>Object[] intermediateResults = entry.getValue();<NEW_LINE>for (int i = 0; i < numAggregationFunctions; i++) {<NEW_LINE>sorters[i].add(groupKey, intermediateResults[i]);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Dump trimmed results into maps<NEW_LINE>for (int i = 0; i < numAggregationFunctions; i++) {<NEW_LINE>Map<String, Object> trimmedResultMap <MASK><NEW_LINE>sorters[i].dumpToMap(trimmedResultMap);<NEW_LINE>trimmedResultMaps[i] = trimmedResultMap;<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>// Simply put results from intermediateResultsMap into trimmedResults<NEW_LINE>for (int i = 0; i < numAggregationFunctions; i++) {<NEW_LINE>trimmedResultMaps[i] = new HashMap<>(numGroups);<NEW_LINE>}<NEW_LINE>for (Map.Entry<String, Object[]> entry : intermediateResultsMap.entrySet()) {<NEW_LINE>String groupKey = entry.getKey();<NEW_LINE>Object[] intermediateResults = entry.getValue();<NEW_LINE>for (int i = 0; i < numAggregationFunctions; i++) {<NEW_LINE>trimmedResultMaps[i].put(groupKey, intermediateResults[i]);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return Arrays.asList(trimmedResultMaps);<NEW_LINE>}
= new HashMap<>(_trimSize);
810,571
private MethodSpec generateRequestOptionOverride(TypeName typeToOverrideIn, ExecutableElement methodToOverride) {<NEW_LINE>MethodSpec.Builder result = processorUtil.overriding(methodToOverride).returns(typeToOverrideIn);<NEW_LINE>result.addCode(CodeBlock.builder().add("return ($T) super.$N(", typeToOverrideIn, methodToOverride.getSimpleName()).add(FluentIterable.from(result.build().parameters).transform(new Function<ParameterSpec, String>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public String apply(ParameterSpec input) {<NEW_LINE>return input.name;<NEW_LINE>}<NEW_LINE>}).join(Joiner.on(", "))).add<MASK><NEW_LINE>if (methodToOverride.getSimpleName().toString().contains("transform") && methodToOverride.isVarArgs()) {<NEW_LINE>result.addModifiers(Modifier.FINAL).addAnnotation(SafeVarargs.class).addAnnotation(AnnotationSpec.builder(SuppressWarnings.class).addMember("value", "$S", "varargs").build());<NEW_LINE>}<NEW_LINE>for (AnnotationMirror mirror : methodToOverride.getAnnotationMirrors()) {<NEW_LINE>result.addAnnotation(AnnotationSpec.get(mirror));<NEW_LINE>}<NEW_LINE>return result.build();<NEW_LINE>}
(");\n").build());
426,319
final DeleteEventResult executeDeleteEvent(DeleteEventRequest deleteEventRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(deleteEventRequest);<NEW_LINE><MASK><NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DeleteEventRequest> request = null;<NEW_LINE>Response<DeleteEventResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DeleteEventRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(deleteEventRequest));<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, "DeleteEvent");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DeleteEventResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DeleteEventResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
1,343,001
private <K, V> CompletableFuture<StatefulRedisClusterConnection<K, V>> connectClusterAsync(RedisCodec<K, V> codec) {<NEW_LINE>if (partitions == null) {<NEW_LINE>return Futures.failed(new IllegalStateException("Partitions not initialized. Initialize via RedisClusterClient.getPartitions()."));<NEW_LINE>}<NEW_LINE>topologyRefreshScheduler.activateTopologyRefreshIfNeeded();<NEW_LINE>logger.debug("connectCluster(" + initialUris + ")");<NEW_LINE>DefaultEndpoint endpoint = new DefaultEndpoint(getClusterClientOptions(), getResources());<NEW_LINE>RedisChannelWriter writer = endpoint;<NEW_LINE>if (CommandExpiryWriter.isSupported(getClusterClientOptions())) {<NEW_LINE>writer = new CommandExpiryWriter(writer, getClusterClientOptions(), getResources());<NEW_LINE>}<NEW_LINE>if (CommandListenerWriter.isSupported(getCommandListeners())) {<NEW_LINE>writer = new <MASK><NEW_LINE>}<NEW_LINE>ClusterDistributionChannelWriter clusterWriter = new ClusterDistributionChannelWriter(writer, getClusterClientOptions(), topologyRefreshScheduler);<NEW_LINE>PooledClusterConnectionProvider<K, V> pooledClusterConnectionProvider = new PooledClusterConnectionProvider<>(this, clusterWriter, codec, topologyRefreshScheduler);<NEW_LINE>clusterWriter.setClusterConnectionProvider(pooledClusterConnectionProvider);<NEW_LINE>StatefulRedisClusterConnectionImpl<K, V> connection = newStatefulRedisClusterConnection(clusterWriter, pooledClusterConnectionProvider, codec, getFirstUri().getTimeout());<NEW_LINE>connection.setReadFrom(ReadFrom.UPSTREAM);<NEW_LINE>connection.setPartitions(partitions);<NEW_LINE>Supplier<CommandHandler> commandHandlerSupplier = () -> new CommandHandler(getClusterClientOptions(), getResources(), endpoint);<NEW_LINE>Mono<SocketAddress> socketAddressSupplier = getSocketAddressSupplier(connection::getPartitions, TopologyComparators::sortByClientCount);<NEW_LINE>Mono<StatefulRedisClusterConnectionImpl<K, V>> connectionMono = Mono.defer(() -> connect(socketAddressSupplier, endpoint, connection, commandHandlerSupplier));<NEW_LINE>for (int i = 1; i < getConnectionAttempts(); i++) {<NEW_LINE>connectionMono = connectionMono.onErrorResume(t -> connect(socketAddressSupplier, endpoint, connection, commandHandlerSupplier));<NEW_LINE>}<NEW_LINE>return connectionMono.doOnNext(c -> connection.registerCloseables(closeableResources, clusterWriter, pooledClusterConnectionProvider)).map(it -> (StatefulRedisClusterConnection<K, V>) it).toFuture();<NEW_LINE>}
CommandListenerWriter(writer, getCommandListeners());
1,327,397
/* Build call for applicationsGenerateKeysPost */<NEW_LINE>private com.squareup.okhttp.Call applicationsGenerateKeysPostCall(String applicationId, ApplicationKeyGenerateRequest body, String contentType, String ifMatch, String ifUnmodifiedSince, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException {<NEW_LINE>Object localVarPostBody = body;<NEW_LINE>// create path and map variables<NEW_LINE>String localVarPath = "/applications/generate-keys".replaceAll("\\{format\\}", "json");<NEW_LINE>List<Pair> localVarQueryParams = new ArrayList<Pair>();<NEW_LINE>if (applicationId != null)<NEW_LINE>localVarQueryParams.addAll(apiClient.parameterToPairs("", "applicationId", applicationId));<NEW_LINE>Map<String, String> localVarHeaderParams = new HashMap<String, String>();<NEW_LINE>if (contentType != null)<NEW_LINE>localVarHeaderParams.put("Content-Type", apiClient.parameterToString(contentType));<NEW_LINE>if (ifMatch != null)<NEW_LINE>localVarHeaderParams.put("If-Match", apiClient.parameterToString(ifMatch));<NEW_LINE>if (ifUnmodifiedSince != null)<NEW_LINE>localVarHeaderParams.put("If-Unmodified-Since", apiClient.parameterToString(ifUnmodifiedSince));<NEW_LINE>Map<String, Object> localVarFormParams = new HashMap<String, Object>();<NEW_LINE>final String[] localVarAccepts = { "application/json" };<NEW_LINE>final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);<NEW_LINE>if (localVarAccept != null)<NEW_LINE>localVarHeaderParams.put("Accept", localVarAccept);<NEW_LINE>final String[] localVarContentTypes = { "application/json" };<NEW_LINE>final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);<NEW_LINE><MASK><NEW_LINE>if (progressListener != null) {<NEW_LINE>apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException {<NEW_LINE>com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request());<NEW_LINE>return originalResponse.newBuilder().body(new ProgressResponseBody(originalResponse.body(), progressListener)).build();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}<NEW_LINE>String[] localVarAuthNames = new String[] {};<NEW_LINE>return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener);<NEW_LINE>}
localVarHeaderParams.put("Content-Type", localVarContentType);
530,415
public Optional<DocOutBoundRecipient> provideMailRecipient(@NonNull final DocOutboundLogMailRecipientRequest request) {<NEW_LINE>if (request.getRecordRef() == null) {<NEW_LINE>Loggables.addLog("provideMailRecipient - docOutboundLogRecord has no AD_Table_ID/Record_ID => return 'no recipient'; request={}", request);<NEW_LINE>return Optional.empty();<NEW_LINE>}<NEW_LINE>final Mailbox mailbox = findMailboxOrNull(request);<NEW_LINE>if (mailbox == null) {<NEW_LINE>Loggables.addLog("provideMailRecipient - return 'no recipient'; mailbox={}", mailbox);<NEW_LINE>return Optional.empty();<NEW_LINE>}<NEW_LINE>// check if the column for the user is specified<NEW_LINE>final String userToColumnName = mailbox.getUserToColumnName();<NEW_LINE>if (!Check.isEmpty(userToColumnName, true)) {<NEW_LINE>final IADTableDAO adTableDAO = Services.get(IADTableDAO.class);<NEW_LINE>final String tableName = request<MASK><NEW_LINE>final boolean existsColumn = tableName != null && adTableDAO.hasColumnName(tableName, userToColumnName);<NEW_LINE>Loggables.addLog("provideMailRecipient - Mail config has userToColumnName={}; column exists: {}; mailbox={}", userToColumnName, existsColumn, mailbox);<NEW_LINE>if (existsColumn) {<NEW_LINE>final IContextAware context = PlainContextAware.newWithThreadInheritedTrx();<NEW_LINE>final Object referencedModel = request.getRecordRef().getModel(context);<NEW_LINE>// load the column content<NEW_LINE>final Integer userRepoId = getValueOrNull(referencedModel, userToColumnName);<NEW_LINE>if (userRepoId == null || userRepoId < 0) {<NEW_LINE>Loggables.addLog("provideMailRecipient - Record model has {}={} => return 'no recipient'", userToColumnName, userRepoId);<NEW_LINE>return Optional.empty();<NEW_LINE>}<NEW_LINE>if (userRepoId == 0) {<NEW_LINE>Loggables.addLog("provideMailRecipient - Record model has {}={} (system-user) => return 'no recipient'", userToColumnName, userRepoId);<NEW_LINE>return Optional.empty();<NEW_LINE>}<NEW_LINE>final DocOutBoundRecipientId docOutBoundRecipientId = DocOutBoundRecipientId.ofRepoId(userRepoId);<NEW_LINE>final DocOutBoundRecipient user = docOutBoundRecipientRepository.getById(docOutBoundRecipientId);<NEW_LINE>if (Check.isEmpty(user.getEmailAddress(), true)) {<NEW_LINE>Loggables.addLog("provideMailRecipient - user-id {} has no/empty emailAddress => return 'no recipient'; user={}", user.getId(), user);<NEW_LINE>return Optional.empty();<NEW_LINE>}<NEW_LINE>return Optional.of(user);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>Loggables.addLog("provideMailRecipient - return 'no recipient'; mailbox={}", mailbox);<NEW_LINE>return Optional.empty();<NEW_LINE>}
.getRecordRef().getTableName();
1,251,722
public Request<DescribeDominantLanguageDetectionJobRequest> marshall(DescribeDominantLanguageDetectionJobRequest describeDominantLanguageDetectionJobRequest) {<NEW_LINE>if (describeDominantLanguageDetectionJobRequest == null) {<NEW_LINE>throw new AmazonClientException("Invalid argument passed to marshall(DescribeDominantLanguageDetectionJobRequest)");<NEW_LINE>}<NEW_LINE>Request<DescribeDominantLanguageDetectionJobRequest> request = new DefaultRequest<DescribeDominantLanguageDetectionJobRequest>(describeDominantLanguageDetectionJobRequest, "AmazonComprehend");<NEW_LINE>String target = "Comprehend_20171127.DescribeDominantLanguageDetectionJob";<NEW_LINE>request.addHeader("X-Amz-Target", target);<NEW_LINE>request.setHttpMethod(HttpMethodName.POST);<NEW_LINE>String uriResourcePath = "/";<NEW_LINE>request.setResourcePath(uriResourcePath);<NEW_LINE>try {<NEW_LINE>StringWriter stringWriter = new StringWriter();<NEW_LINE>AwsJsonWriter jsonWriter = JsonUtils.getJsonWriter(stringWriter);<NEW_LINE>jsonWriter.beginObject();<NEW_LINE>if (describeDominantLanguageDetectionJobRequest.getJobId() != null) {<NEW_LINE>String jobId = describeDominantLanguageDetectionJobRequest.getJobId();<NEW_LINE>jsonWriter.name("JobId");<NEW_LINE>jsonWriter.value(jobId);<NEW_LINE>}<NEW_LINE>jsonWriter.endObject();<NEW_LINE>jsonWriter.close();<NEW_LINE>String snippet = stringWriter.toString();<NEW_LINE>byte[] content = snippet.getBytes(UTF8);<NEW_LINE>request.setContent(new StringInputStream(snippet));<NEW_LINE>request.addHeader("Content-Length", Integer.toString(content.length));<NEW_LINE>} catch (Throwable t) {<NEW_LINE>throw new AmazonClientException("Unable to marshall request to JSON: " + <MASK><NEW_LINE>}<NEW_LINE>if (!request.getHeaders().containsKey("Content-Type")) {<NEW_LINE>request.addHeader("Content-Type", "application/x-amz-json-1.1");<NEW_LINE>}<NEW_LINE>return request;<NEW_LINE>}
t.getMessage(), t);
542,628
public void visit(Node<E> expressionNode) {<NEW_LINE>if (expressionNode instanceof ArangoDBSelect) {<NEW_LINE>visit((ArangoDBSelect<E>) expressionNode);<NEW_LINE>} else if (expressionNode instanceof ColumnReferenceNode<?, ?>) {<NEW_LINE>visit((ColumnReferenceNode<MASK><NEW_LINE>} else if (expressionNode instanceof ArangoDBConstant) {<NEW_LINE>visit((ArangoDBConstant) expressionNode);<NEW_LINE>} else if (expressionNode instanceof NewBinaryOperatorNode<?>) {<NEW_LINE>visit((NewBinaryOperatorNode<E>) expressionNode);<NEW_LINE>} else if (expressionNode instanceof NewUnaryPrefixOperatorNode<?>) {<NEW_LINE>visit((NewUnaryPrefixOperatorNode<E>) expressionNode);<NEW_LINE>} else if (expressionNode instanceof NewFunctionNode<?, ?>) {<NEW_LINE>visit((NewFunctionNode<E, ?>) expressionNode);<NEW_LINE>} else {<NEW_LINE>throw new AssertionError(expressionNode);<NEW_LINE>}<NEW_LINE>}
<E, ?>) expressionNode);
433,042
public int compareTo(setTableProperty_args other) {<NEW_LINE>if (!getClass().equals(other.getClass())) {<NEW_LINE>return getClass().getName().compareTo(other.getClass().getName());<NEW_LINE>}<NEW_LINE>int lastComparison = 0;<NEW_LINE>lastComparison = java.lang.Boolean.compare(isSetTinfo(), other.isSetTinfo());<NEW_LINE>if (lastComparison != 0) {<NEW_LINE>return lastComparison;<NEW_LINE>}<NEW_LINE>if (isSetTinfo()) {<NEW_LINE>lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.tinfo, other.tinfo);<NEW_LINE>if (lastComparison != 0) {<NEW_LINE>return lastComparison;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>lastComparison = java.lang.Boolean.compare(isSetCredentials(), other.isSetCredentials());<NEW_LINE>if (lastComparison != 0) {<NEW_LINE>return lastComparison;<NEW_LINE>}<NEW_LINE>if (isSetCredentials()) {<NEW_LINE>lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.credentials, other.credentials);<NEW_LINE>if (lastComparison != 0) {<NEW_LINE>return lastComparison;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>lastComparison = java.lang.Boolean.compare(isSetTableName(), other.isSetTableName());<NEW_LINE>if (lastComparison != 0) {<NEW_LINE>return lastComparison;<NEW_LINE>}<NEW_LINE>if (isSetTableName()) {<NEW_LINE>lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.tableName, other.tableName);<NEW_LINE>if (lastComparison != 0) {<NEW_LINE>return lastComparison;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>lastComparison = java.lang.Boolean.compare(isSetProperty(), other.isSetProperty());<NEW_LINE>if (lastComparison != 0) {<NEW_LINE>return lastComparison;<NEW_LINE>}<NEW_LINE>if (isSetProperty()) {<NEW_LINE>lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.property, other.property);<NEW_LINE>if (lastComparison != 0) {<NEW_LINE>return lastComparison;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>lastComparison = java.lang.Boolean.compare(isSetValue(), other.isSetValue());<NEW_LINE>if (lastComparison != 0) {<NEW_LINE>return lastComparison;<NEW_LINE>}<NEW_LINE>if (isSetValue()) {<NEW_LINE>lastComparison = org.apache.thrift.TBaseHelper.compareTo(<MASK><NEW_LINE>if (lastComparison != 0) {<NEW_LINE>return lastComparison;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return 0;<NEW_LINE>}
this.value, other.value);
211,259
protected SootMethod generateRedirectMethodForStartActivity(SootClass wrapper) {<NEW_LINE>SootMethod targetDummyMain = componentToEntryPoint.getEntryPoint(wrapper);<NEW_LINE>if (targetDummyMain == null) {<NEW_LINE>logger.warn("Destination component {} has no dummy main method", wrapper.getName());<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>String newSM_name = "redirector" + num++;<NEW_LINE>SootMethod newSM = Scene.v().makeSootMethod(newSM_name, Collections.<Type>singletonList(INTENT_TYPE), VoidType.v(), Modifier.STATIC | Modifier.PUBLIC);<NEW_LINE><MASK><NEW_LINE>dummyMainClass.addMethod(newSM);<NEW_LINE>JimpleBody b = Jimple.v().newBody(newSM);<NEW_LINE>newSM.setActiveBody(b);<NEW_LINE>LocalGenerator lg = Scene.v().createLocalGenerator(b);<NEW_LINE>// identity<NEW_LINE>Local intentParameterLocal = lg.generateLocal(INTENT_TYPE);<NEW_LINE>b.getUnits().add(Jimple.v().newIdentityStmt(intentParameterLocal, Jimple.v().newParameterRef(INTENT_TYPE, 0)));<NEW_LINE>// call dummyMainMethod<NEW_LINE>{<NEW_LINE>b.getUnits().add(Jimple.v().newInvokeStmt(Jimple.v().newStaticInvokeExpr(targetDummyMain.makeRef(), Collections.singletonList(intentParameterLocal))));<NEW_LINE>}<NEW_LINE>b.getUnits().add(Jimple.v().newReturnVoidStmt());<NEW_LINE>return newSM;<NEW_LINE>}
newSM.addTag(SimulatedCodeElementTag.TAG);
658,030
public void glVertexAttribPointer(int indx, int size, int type, boolean normalized, int stride, Buffer buffer) {<NEW_LINE>if (buffer instanceof ByteBuffer) {<NEW_LINE>if (type == GL_BYTE)<NEW_LINE>GLES20.glVertexAttribPointer(indx, size, type, normalized, stride, (ByteBuffer) buffer);<NEW_LINE>else if (type == GL_UNSIGNED_BYTE)<NEW_LINE>GLES20.glVertexAttribPointer(indx, size, type, normalized, stride, (ByteBuffer) buffer);<NEW_LINE>else if (type == GL_SHORT)<NEW_LINE>GLES20.glVertexAttribPointer(indx, size, type, normalized, stride, ((ByteBuffer) buffer).asShortBuffer());<NEW_LINE>else if (type == GL_UNSIGNED_SHORT)<NEW_LINE>GLES20.glVertexAttribPointer(indx, size, type, normalized, stride, ((ByteBuffer) buffer).asShortBuffer());<NEW_LINE>else if (type == GL_FLOAT)<NEW_LINE>GLES20.glVertexAttribPointer(indx, size, type, normalized, stride, ((ByteBuffer<MASK><NEW_LINE>else<NEW_LINE>throw new GdxRuntimeException("Can't use " + buffer.getClass().getName() + " with type " + type + " with this method. Use ByteBuffer and one of GL_BYTE, GL_UNSIGNED_BYTE, GL_SHORT, GL_UNSIGNED_SHORT or GL_FLOAT for type.");<NEW_LINE>} else if (buffer instanceof FloatBuffer) {<NEW_LINE>if (type == GL_FLOAT)<NEW_LINE>GLES20.glVertexAttribPointer(indx, size, type, normalized, stride, (FloatBuffer) buffer);<NEW_LINE>else<NEW_LINE>throw new GdxRuntimeException("Can't use " + buffer.getClass().getName() + " with type " + type + " with this method.");<NEW_LINE>} else<NEW_LINE>throw new GdxRuntimeException("Can't use " + buffer.getClass().getName() + " with this method. Use ByteBuffer instead.");<NEW_LINE>}
) buffer).asFloatBuffer());
580,821
final PublishFunctionResult executePublishFunction(PublishFunctionRequest publishFunctionRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(publishFunctionRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<PublishFunctionRequest> request = null;<NEW_LINE>Response<PublishFunctionResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new PublishFunctionRequestMarshaller().marshall<MASK><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, "CloudFront");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "PublishFunction");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>StaxResponseHandler<PublishFunctionResult> responseHandler = new StaxResponseHandler<PublishFunctionResult>(new PublishFunctionResultStaxUnmarshaller());<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>}
(super.beforeMarshalling(publishFunctionRequest));
592,731
public Result deleteYb(UUID customerUUID) {<NEW_LINE>Customer customer = Customer.getOrBadRequest(customerUUID);<NEW_LINE>DeleteBackupParams deleteBackupParams = parseJsonAndValidate(DeleteBackupParams.class);<NEW_LINE>List<YBPTask> taskList = new ArrayList<>();<NEW_LINE>for (DeleteBackupInfo deleteBackupInfo : deleteBackupParams.deleteBackupInfos) {<NEW_LINE>UUID backupUUID = deleteBackupInfo.backupUUID;<NEW_LINE>Backup backup = Backup.getOrBadRequest(customerUUID, backupUUID);<NEW_LINE>if (backup == null) {<NEW_LINE>LOG.debug("Can not delete {} backup as it is not present in the database.", backupUUID);<NEW_LINE>} else {<NEW_LINE>if (backup.state.equals(BackupState.InProgress)) {<NEW_LINE>LOG.debug("Can not delete {} backup as it is still in progress", backupUUID);<NEW_LINE>} else if (backup.state.equals(BackupState.DeleteInProgress) || backup.state.equals(BackupState.QueuedForDeletion)) {<NEW_LINE><MASK><NEW_LINE>} else {<NEW_LINE>UUID storageConfigUUID = deleteBackupInfo.storageConfigUUID;<NEW_LINE>if (storageConfigUUID == null) {<NEW_LINE>storageConfigUUID = backup.getBackupInfo().storageConfigUUID;<NEW_LINE>}<NEW_LINE>BackupTableParams params = backup.getBackupInfo();<NEW_LINE>params.storageConfigUUID = storageConfigUUID;<NEW_LINE>backup.updateBackupInfo(params);<NEW_LINE>DeleteBackupYb.Params taskParams = new DeleteBackupYb.Params();<NEW_LINE>taskParams.customerUUID = customerUUID;<NEW_LINE>taskParams.backupUUID = backupUUID;<NEW_LINE>UUID taskUUID = commissioner.submit(TaskType.DeleteBackupYb, taskParams);<NEW_LINE>LOG.info("Saved task uuid {} in customer tasks for backup {}.", taskUUID, backupUUID);<NEW_LINE>CustomerTask.create(customer, backup.backupUUID, taskUUID, CustomerTask.TargetType.Backup, CustomerTask.TaskType.Delete, "Backup");<NEW_LINE>taskList.add(new YBPTask(taskUUID, taskParams.backupUUID));<NEW_LINE>auditService().createAuditEntryWithReqBody(ctx(), Audit.TargetType.Backup, Objects.toString(backup.backupUUID, null), Audit.ActionType.Delete, request().body().asJson(), taskUUID);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return new YBPTasks(taskList).asResult();<NEW_LINE>}
LOG.debug("Backup {} is already in queue for deletion", backupUUID);
922,671
final DescribeRoleAliasResult executeDescribeRoleAlias(DescribeRoleAliasRequest describeRoleAliasRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(describeRoleAliasRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DescribeRoleAliasRequest> request = null;<NEW_LINE>Response<DescribeRoleAliasResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DescribeRoleAliasRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(describeRoleAliasRequest));<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.<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DescribeRoleAlias");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DescribeRoleAliasResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DescribeRoleAliasResultJsonUnmarshaller());<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.SERVICE_ID, "IoT");
49,283
public static void main(String[] args) throws IOException {<NEW_LINE>String imagePath = AddText.class.getClassLoader().<MASK><NEW_LINE>ImagePlus resultPlus = signImageImageProcessor("www.baeldung.com", imagePath);<NEW_LINE>resultPlus.show();<NEW_LINE>ImagePlus resultGraphics = new ImagePlus("", signImageGraphics("www.baeldung.com", imagePath));<NEW_LINE>resultGraphics.show();<NEW_LINE>ImagePlus resultGraphicsWithIterator = new ImagePlus("", signImageGraphicsWithIterator("www.baeldung.com", imagePath));<NEW_LINE>resultGraphicsWithIterator.show();<NEW_LINE>ImagePlus resultGraphicsCentered = new ImagePlus("", signImageCenter("www.baeldung.com", imagePath));<NEW_LINE>resultGraphicsCentered.show();<NEW_LINE>ImagePlus resultGraphicsBottomRight = new ImagePlus("", signImageBottomRight("www.baeldung.com", imagePath));<NEW_LINE>resultGraphicsBottomRight.show();<NEW_LINE>ImagePlus resultGraphicsTopLeft = new ImagePlus("", signImageTopLeft("www.baeldung.com", imagePath));<NEW_LINE>resultGraphicsTopLeft.show();<NEW_LINE>ImagePlus resultGraphicsAdaptBasedOnImage = new ImagePlus("", signImageAdaptBasedOnImage("www.baeldung.com", imagePath));<NEW_LINE>resultGraphicsAdaptBasedOnImage.show();<NEW_LINE>}
getResource("lena.jpg").getPath();
1,324,547
final DeleteApplicationInputProcessingConfigurationResult executeDeleteApplicationInputProcessingConfiguration(DeleteApplicationInputProcessingConfigurationRequest deleteApplicationInputProcessingConfigurationRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(deleteApplicationInputProcessingConfigurationRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DeleteApplicationInputProcessingConfigurationRequest> request = null;<NEW_LINE>Response<DeleteApplicationInputProcessingConfigurationResult> response = null;<NEW_LINE>try {<NEW_LINE><MASK><NEW_LINE>try {<NEW_LINE>request = new DeleteApplicationInputProcessingConfigurationRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(deleteApplicationInputProcessingConfigurationRequest));<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, "Kinesis Analytics");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DeleteApplicationInputProcessingConfiguration");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DeleteApplicationInputProcessingConfigurationResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DeleteApplicationInputProcessingConfigurationResultJsonUnmarshaller());<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);
909,297
private void updateDatabase() {<NEW_LINE>Queue<RLPElement> rlpElementQueue = decodeQueue(bootstrapDataProvider.getBootstrapData());<NEW_LINE><MASK><NEW_LINE>logger.debug("Inserting blocks...");<NEW_LINE>insertBlocks(blockStore, blockFactory, Objects.requireNonNull(rlpElementQueue.poll()));<NEW_LINE>logger.debug("Blocks have been inserted in {} mills", System.currentTimeMillis() - start);<NEW_LINE>HashMapDB hashMapDB = new HashMapDB();<NEW_LINE>Queue<byte[]> nodeDataQueue = new LinkedList<>();<NEW_LINE>Queue<byte[]> nodeValueQueue = new LinkedList<>();<NEW_LINE>Queue<Trie> trieQueue = new LinkedList<>();<NEW_LINE>start = System.currentTimeMillis();<NEW_LINE>logger.debug("Preparing state for insertion...");<NEW_LINE>fillUpRlpDataQueues(nodeDataQueue, nodeValueQueue, Objects.requireNonNull(rlpElementQueue.poll()));<NEW_LINE>fillUpTrieQueue(trieQueue, nodeDataQueue, nodeValueQueue, hashMapDB);<NEW_LINE>logger.debug("State has been prepared in {} mills", System.currentTimeMillis() - start);<NEW_LINE>start = System.currentTimeMillis();<NEW_LINE>logger.debug("Inserting state...");<NEW_LINE>insertState(trieStore, trieQueue);<NEW_LINE>logger.debug("State has been inserted in {} mills", System.currentTimeMillis() - start);<NEW_LINE>}
long start = System.currentTimeMillis();
1,056,584
public void invokeBeforeGroupsConfigurations(GroupConfigMethodArguments arguments) {<NEW_LINE>List<ITestNGMethod<MASK><NEW_LINE>String[] groups = arguments.getTestMethod().getGroups();<NEW_LINE>for (String group : groups) {<NEW_LINE>List<ITestNGMethod> methods = arguments.getGroupMethods().getBeforeGroupMethodsForGroup(group);<NEW_LINE>if (methods != null) {<NEW_LINE>filteredMethods.addAll(methods);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>ITestNGMethod[] beforeMethodsArray = filteredMethods.toArray(new ITestNGMethod[0]);<NEW_LINE>//<NEW_LINE>// Invoke the right groups methods<NEW_LINE>//<NEW_LINE>if (beforeMethodsArray.length > 0) {<NEW_LINE>ITestNGMethod[] filteredConfigurations = Arrays.stream(beforeMethodsArray).filter(ConfigInvoker::isGroupLevelConfigurationMethod).toArray(ITestNGMethod[]::new);<NEW_LINE>if (filteredConfigurations.length == 0) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// don't pass the IClass or the instance as the method may be external<NEW_LINE>// the invocation must be similar to @BeforeTest/@BeforeSuite<NEW_LINE>ConfigMethodArguments configMethodArguments = new Builder().usingConfigMethodsAs(filteredConfigurations).forSuite(arguments.getSuite()).usingParameters(arguments.getParameters()).usingInstance(arguments.getInstance()).forTestMethod(arguments.getTestMethod()).build();<NEW_LINE>invokeConfigurations(configMethodArguments);<NEW_LINE>}<NEW_LINE>//<NEW_LINE>// Remove them so they don't get run again<NEW_LINE>//<NEW_LINE>arguments.getGroupMethods().removeBeforeGroups(groups);<NEW_LINE>}
> filteredMethods = Lists.newArrayList();
811,086
public AbstractBlockProcessor.Result processBlock(final Blockchain blockchain, final MutableWorldState worldState, final BlockHeader blockHeader, final List<Transaction> transactions, final List<BlockHeader> ommers) {<NEW_LINE>long gasUsed = 0;<NEW_LINE>final List<TransactionReceipt> <MASK><NEW_LINE>for (final Transaction transaction : transactions) {<NEW_LINE>final long remainingGasBudget = blockHeader.getGasLimit() - gasUsed;<NEW_LINE>if (Long.compareUnsigned(transaction.getGasLimit(), remainingGasBudget) > 0) {<NEW_LINE>LOG.warn("Transaction processing error: transaction gas limit {} exceeds available block budget" + " remaining {}", transaction.getGasLimit(), remainingGasBudget);<NEW_LINE>return AbstractBlockProcessor.Result.failed();<NEW_LINE>}<NEW_LINE>final WorldUpdater worldStateUpdater = worldState.updater();<NEW_LINE>final BlockHashLookup blockHashLookup = new BlockHashLookup(blockHeader, blockchain);<NEW_LINE>final Address miningBeneficiary = miningBeneficiaryCalculator.calculateBeneficiary(blockHeader);<NEW_LINE>final TransactionProcessingResult result = transactionProcessor.processTransaction(blockchain, worldStateUpdater, blockHeader, transaction, miningBeneficiary, blockHashLookup, true, TransactionValidationParams.processingBlock());<NEW_LINE>if (result.isInvalid()) {<NEW_LINE>return AbstractBlockProcessor.Result.failed();<NEW_LINE>}<NEW_LINE>worldStateUpdater.commit();<NEW_LINE>gasUsed = transaction.getGasLimit() - result.getGasRemaining() + gasUsed;<NEW_LINE>final TransactionReceipt transactionReceipt = transactionReceiptFactory.create(transaction.getType(), result, worldState, gasUsed);<NEW_LINE>receipts.add(transactionReceipt);<NEW_LINE>}<NEW_LINE>if (!rewardCoinbase(worldState, blockHeader, ommers, skipZeroBlockRewards)) {<NEW_LINE>return AbstractBlockProcessor.Result.failed();<NEW_LINE>}<NEW_LINE>return AbstractBlockProcessor.Result.successful(receipts);<NEW_LINE>}
receipts = new ArrayList<>();
765,576
public void acceptLocalVariable(LocalVariableBinding binding, org.eclipse.jdt.internal.compiler.env.ICompilationUnit unit) {<NEW_LINE>LocalDeclaration local = binding.declaration;<NEW_LINE>IJavaElement parent = null;<NEW_LINE>if (binding.declaringScope.isLambdaSubscope() && unit instanceof ICompilationUnit) {<NEW_LINE>HashSet existingElements = new HashSet();<NEW_LINE>HashMap knownScopes = new HashMap();<NEW_LINE>parent = this.handleFactory.createElement(binding.declaringScope, local.sourceStart, (ICompilationUnit) unit, existingElements, knownScopes);<NEW_LINE>} else {<NEW_LINE>// findLocalElement() cannot find local variable<NEW_LINE>parent = findLocalElement(local.sourceStart, binding.declaringScope.methodScope());<NEW_LINE>}<NEW_LINE>LocalVariable localVar = null;<NEW_LINE>if (parent != null) {<NEW_LINE>String typeSig = null;<NEW_LINE>if (local.type == null || local.type.isTypeNameVar(binding.declaringScope)) {<NEW_LINE>if (local.initialization instanceof CastExpression) {<NEW_LINE>typeSig = Util.typeSignature(((CastExpression) local.initialization).type);<NEW_LINE>} else {<NEW_LINE>typeSig = Signature.createTypeSignature(binding.type.signableName(), true);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>typeSig = Util.typeSignature(local.type);<NEW_LINE>}<NEW_LINE>localVar = new LocalVariable((JavaElement) parent, new String(local.name), local.declarationSourceStart, local.declarationSourceEnd, local.sourceStart, local.sourceEnd, typeSig, local.annotations, local.modifiers, local.getKind() == AbstractVariableDeclaration.PARAMETER);<NEW_LINE>}<NEW_LINE>if (localVar != null) {<NEW_LINE>addElement(localVar);<NEW_LINE>if (SelectionEngine.DEBUG) {<NEW_LINE>// $NON-NLS-1$<NEW_LINE><MASK><NEW_LINE>System.out.print(localVar.toString());<NEW_LINE>// $NON-NLS-1$<NEW_LINE>System.out.println(")");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
System.out.print("SELECTION - accept local variable(");
485,179
public static void copyResourceAscii(final String resourceName, final File file) throws IOException {<NEW_LINE>try (final InputStreamReader reader = new InputStreamReader(ManagedFile.class.getResourceAsStream(resourceName))) {<NEW_LINE>final MessageDigest digest = getDigest();<NEW_LINE>try (final DigestOutputStream digestStream = new DigestOutputStream(new FileOutputStream(file), digest)) {<NEW_LINE>try (final OutputStreamWriter writer = new OutputStreamWriter(digestStream)) {<NEW_LINE>final char[] buffer = new char[BUFFERSIZE];<NEW_LINE>do {<NEW_LINE>final int length = reader.read(buffer);<NEW_LINE>if (length >= 0) {<NEW_LINE>writer.write(buffer, 0, length);<NEW_LINE>} else {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>} while (true);<NEW_LINE>writer.write("\n");<NEW_LINE>writer.flush();<NEW_LINE>final BigInteger hashInt = new BigInteger(<MASK><NEW_LINE>digestStream.on(false);<NEW_LINE>digestStream.write('#');<NEW_LINE>digestStream.write(hashInt.toString(16).getBytes());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
1, digest.digest());
621,375
protected static ParsedSchema lookupLatestVersion(SchemaRegistryClient schemaRegistry, String subject, ParsedSchema schema, Map<SubjectSchema, ParsedSchema> cache, boolean latestCompatStrict) throws IOException, RestClientException {<NEW_LINE>SubjectSchema ss = new SubjectSchema(subject, schema);<NEW_LINE>ParsedSchema latestVersion = null;<NEW_LINE>if (cache != null) {<NEW_LINE>latestVersion = cache.get(ss);<NEW_LINE>}<NEW_LINE>if (latestVersion == null) {<NEW_LINE>SchemaMetadata schemaMetadata = schemaRegistry.getLatestSchemaMetadata(subject);<NEW_LINE>Optional<ParsedSchema> optSchema = schemaRegistry.parseSchema(schemaMetadata.getSchemaType(), schemaMetadata.getSchema(), schemaMetadata.getReferences());<NEW_LINE>latestVersion = optSchema.orElseThrow(() -> new IOException("Invalid schema " + schemaMetadata.getSchema() + " with refs " + schemaMetadata.getReferences() + " of type " <MASK><NEW_LINE>// Sanity check by testing latest is backward compatibility with schema<NEW_LINE>// Don't test for forward compatibility so unions can be handled properly<NEW_LINE>if (latestCompatStrict && !latestVersion.isBackwardCompatible(schema).isEmpty()) {<NEW_LINE>throw new IOException("Incompatible schema " + schemaMetadata.getSchema() + " with refs " + schemaMetadata.getReferences() + " of type " + schemaMetadata.getSchemaType() + " for schema " + schema.canonicalString());<NEW_LINE>}<NEW_LINE>if (cache != null) {<NEW_LINE>cache.put(ss, latestVersion);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return latestVersion;<NEW_LINE>}
+ schemaMetadata.getSchemaType()));
839,692
public void highlightAyah(int surah, int ayah, int word, HighlightType type) {<NEW_LINE>final Set<AyahHighlight> highlights = currentHighlights.get(type);<NEW_LINE>final SingleAyahHighlight singleAyahHighlight = new SingleAyahHighlight(surah, ayah, word);<NEW_LINE>if (highlights == null) {<NEW_LINE>final Set<AyahHighlight> updatedHighlights = new HashSet<>();<NEW_LINE>updatedHighlights.add(singleAyahHighlight);<NEW_LINE>currentHighlights.put(type, updatedHighlights);<NEW_LINE>} else if (type.isSingle()) {<NEW_LINE>// If multiple highlighting not allowed (e.g. audio)<NEW_LINE>// clear all others of this type first<NEW_LINE>// only if highlight type is floatable<NEW_LINE>if (shouldFloatHighlight(highlights, type, surah, ayah)) {<NEW_LINE>highlightFloatableAyah(highlights, singleAyahHighlight, HighlightTypes<MASK><NEW_LINE>} else {<NEW_LINE>highlights.clear();<NEW_LINE>highlights.add(singleAyahHighlight);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>highlights.add(singleAyahHighlight);<NEW_LINE>currentHighlights.put(type, highlights);<NEW_LINE>}<NEW_LINE>}
.INSTANCE.getAnimationConfig(type));
226,371
public ICapabilityProvider initCapabilities(@Nonnull ItemStack stack, @Nullable NBTTagCompound nbt) {<NEW_LINE>ICapabilityProvider capProvider = new ICapabilityProvider() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public boolean hasCapability(@Nonnull Capability<?> capability, @Nullable EnumFacing facing) {<NEW_LINE>return capability == CapabilityCapacitorData.getCapNN();<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>@Nullable<NEW_LINE>public <T> T getCapability(@Nonnull Capability<T> capability, @Nullable EnumFacing facing) {<NEW_LINE>if (capability == CapabilityCapacitorData.getCapNN()) {<NEW_LINE>return CapabilityCapacitorData.getCapNN().cast(NullHelper.notnullJ(DefaultCapacitorData.values()[getMetadata<MASK><NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>};<NEW_LINE>return new CompoundCapabilityProvider(super.initCapabilities(stack, nbt), capProvider);<NEW_LINE>}
(stack)], "Enum.values() has a null"));
1,048,107
static List<InstalledXcode> findXcodes() {<NEW_LINE>List<InstalledXcode> xcodes = new ArrayList<>();<NEW_LINE>// On macOS, we assume co-located Xcode is installed into /opt/xcode<NEW_LINE>File rootXcodeInstall = new File("/opt/xcode");<NEW_LINE>List<File> xcodeCandidates = Lists.newArrayList(Arrays.asList(GUtil.getOrDefault(rootXcodeInstall.listFiles(File::isDirectory), () -> new File[0])));<NEW_LINE>// Default Xcode installation<NEW_LINE>xcodeCandidates.add(new File("/Applications/Xcode.app"));<NEW_LINE>xcodeCandidates.stream().filter(File::exists).forEach(xcodeInstall -> {<NEW_LINE>TestFile xcodebuild = new TestFile("/usr/bin/xcodebuild");<NEW_LINE>String output = xcodebuild.execute(Collections.singletonList("-version"), Collections.singletonList("DEVELOPER_DIR=" + xcodeInstall.getAbsolutePath<MASK><NEW_LINE>Pattern versionRegex = Pattern.compile("Xcode (\\d+\\.\\d+(\\.\\d+)?)");<NEW_LINE>Matcher matcher = versionRegex.matcher(output);<NEW_LINE>if (matcher.find()) {<NEW_LINE>VersionNumber version = VersionNumber.parse(matcher.group(1));<NEW_LINE>xcodes.add(new InstalledXcode(xcodeInstall, version));<NEW_LINE>}<NEW_LINE>});<NEW_LINE>return xcodes;<NEW_LINE>}
())).getOut();
697,686
private static void withinHtml(StringBuilder out, Spanned text) {<NEW_LINE>int len = text.length();<NEW_LINE>int next;<NEW_LINE>for (int i = 0; i < text.length(); i = next) {<NEW_LINE>next = text.nextSpanTransition(i, len, ParagraphStyle.class);<NEW_LINE>ParagraphStyle[] style = text.getSpans(i, next, ParagraphStyle.class);<NEW_LINE>String elements = " ";<NEW_LINE>boolean needDiv = false;<NEW_LINE>for (int j = 0; j < style.length; j++) {<NEW_LINE>if (style[j] instanceof AlignmentSpan) {<NEW_LINE>Layout.Alignment align = ((AlignmentSpan) style[j]).getAlignment();<NEW_LINE>needDiv = true;<NEW_LINE>if (align == Layout.Alignment.ALIGN_CENTER) {<NEW_LINE>elements = "align=\"center\" " + elements;<NEW_LINE>} else if (align == Layout.Alignment.ALIGN_OPPOSITE) {<NEW_LINE>elements = "align=\"right\" " + elements;<NEW_LINE>} else {<NEW_LINE>elements = "align=\"left\" " + elements;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (needDiv) {<NEW_LINE>out.append("<div ").append(elements).append(">");<NEW_LINE>}<NEW_LINE>withinDiv(<MASK><NEW_LINE>if (needDiv) {<NEW_LINE>out.append("</div>");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
out, text, i, next);
511,087
/*<NEW_LINE>* A record of default values that represent the value of the<NEW_LINE>* outputs if the route is filtered / dropped in the policy<NEW_LINE>*/<NEW_LINE>@VisibleForTesting<NEW_LINE>BDDRoute zeroedRecord() {<NEW_LINE>BDDRoute rec = new BDDRoute(_factory, _configAtomicPredicates.getCommunityAtomicPredicates().getNumAtomicPredicates(), _configAtomicPredicates.getAsPathRegexAtomicPredicates().getNumAtomicPredicates());<NEW_LINE>rec.getLocalPref().setValue(0);<NEW_LINE>rec.getAdminDist().setValue(0);<NEW_LINE>rec.getPrefixLength().setValue(0);<NEW_LINE>rec.getMed().setValue(0);<NEW_LINE>rec.getNextHop().setValue(0);<NEW_LINE>rec.setNextHopDiscarded(_factory.zero());<NEW_LINE>rec.setNextHopSet(_factory.zero());<NEW_LINE>rec.<MASK><NEW_LINE>rec.getPrefix().setValue(0);<NEW_LINE>for (int i = 0; i < rec.getCommunityAtomicPredicates().length; i++) {<NEW_LINE>rec.getCommunityAtomicPredicates()[i] = _factory.zero();<NEW_LINE>}<NEW_LINE>for (int i = 0; i < rec.getAsPathRegexAtomicPredicates().length; i++) {<NEW_LINE>rec.getAsPathRegexAtomicPredicates()[i] = _factory.zero();<NEW_LINE>}<NEW_LINE>rec.getProtocolHistory().getInteger().setValue(0);<NEW_LINE>return rec;<NEW_LINE>}
getTag().setValue(0);
1,030,636
private <T> void forAllSuperclasses(JApiClass jApiClass, Map<String, JApiClass> classMap, List<T> returnValues, OnSuperclassCallback<T> onSuperclassCallback) {<NEW_LINE>JApiSuperclass superclass = jApiClass.getSuperclass();<NEW_LINE>if (superclass.getNewSuperclassName().isPresent()) {<NEW_LINE>String newSuperclassName = superclass.getNewSuperclassName().get();<NEW_LINE>JApiClass foundClass = classMap.get(newSuperclassName);<NEW_LINE>if (foundClass == null) {<NEW_LINE>Optional<JApiClass<MASK><NEW_LINE>if (superclassJApiClassOptional.isPresent()) {<NEW_LINE>foundClass = superclassJApiClassOptional.get();<NEW_LINE>} else {<NEW_LINE>foundClass = loadClass(newSuperclassName, EnumSet.of(Classpath.NEW_CLASSPATH));<NEW_LINE>evaluate(Collections.singletonList(foundClass));<NEW_LINE>}<NEW_LINE>classMap.put(foundClass.getFullyQualifiedName(), foundClass);<NEW_LINE>}<NEW_LINE>T returnValue = onSuperclassCallback.callback(foundClass, classMap, superclass.getChangeStatus());<NEW_LINE>returnValues.add(returnValue);<NEW_LINE>forAllSuperclasses(foundClass, classMap, returnValues, onSuperclassCallback);<NEW_LINE>}<NEW_LINE>}
> superclassJApiClassOptional = superclass.getJApiClass();
1,066,214
public DescribeIdentityPoolUsageResult unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>DescribeIdentityPoolUsageResult describeIdentityPoolUsageResult = new DescribeIdentityPoolUsageResult();<NEW_LINE><MASK><NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return describeIdentityPoolUsageResult;<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("IdentityPoolUsage", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>describeIdentityPoolUsageResult.setIdentityPoolUsage(IdentityPoolUsageJsonUnmarshaller.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 describeIdentityPoolUsageResult;<NEW_LINE>}
int originalDepth = context.getCurrentDepth();
1,181,090
// we need to produce a correct DER encoding GeneralizedTime here as the BC ASN.1 library doesn't handle this properly yet.<NEW_LINE>private ASN1GeneralizedTime createGeneralizedTime(Date time) throws TSPException {<NEW_LINE>String format = "yyyyMMddHHmmss.SSS";<NEW_LINE>SimpleDateFormat dateF = (locale == null) ? new SimpleDateFormat(format) : new SimpleDateFormat(format, locale);<NEW_LINE>dateF.setTimeZone(new SimpleTimeZone(0, "Z"));<NEW_LINE>StringBuffer sBuild = new StringBuffer(dateF.format(time));<NEW_LINE>int dotIndex = 9;<NEW_LINE>while (dotIndex != sBuild.length() && sBuild.charAt(dotIndex) != '.') {<NEW_LINE>dotIndex++;<NEW_LINE>}<NEW_LINE>if (dotIndex == sBuild.length()) {<NEW_LINE>// came back in seconds only, just return<NEW_LINE>sBuild.append("Z");<NEW_LINE>return new ASN1GeneralizedTime(sBuild.toString());<NEW_LINE>}<NEW_LINE>// trim to resolution<NEW_LINE>switch(resolution) {<NEW_LINE>case R_TENTHS_OF_SECONDS:<NEW_LINE>if (sBuild.length() > dotIndex + 2) {<NEW_LINE>sBuild = new StringBuffer(sBuild.toString().substring<MASK><NEW_LINE>}<NEW_LINE>break;<NEW_LINE>case R_HUNDREDTHS_OF_SECONDS:<NEW_LINE>if (sBuild.length() > dotIndex + 3) {<NEW_LINE>sBuild = new StringBuffer(sBuild.toString().substring(0, dotIndex + 3));<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>case R_MILLISECONDS:<NEW_LINE>// do nothing<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>throw new TSPException("unknown time-stamp resolution: " + resolution);<NEW_LINE>}<NEW_LINE>// remove trailing zeros<NEW_LINE>while (sBuild.charAt(sBuild.length() - 1) == '0') {<NEW_LINE>sBuild = new StringBuffer(sBuild.toString().substring(0, sBuild.length() - 1));<NEW_LINE>}<NEW_LINE>if (sBuild.length() - 1 == dotIndex) {<NEW_LINE>sBuild = new StringBuffer(sBuild.toString().substring(0, sBuild.length() - 1));<NEW_LINE>}<NEW_LINE>sBuild.append("Z");<NEW_LINE>return new ASN1GeneralizedTime(sBuild.toString());<NEW_LINE>}
(0, dotIndex + 2));
460,725
private void initialize(int n) {<NEW_LINE>if (columnNames == null || columnNames.size() != n) {<NEW_LINE>columnNames = createDefaultColumnNames(n);<NEW_LINE>}<NEW_LINE>exampleCountPerColumn = Nd4j.zeros(DataType.DOUBLE, n);<NEW_LINE>labelsSumPerColumn = Nd4j.zeros(DataType.DOUBLE, n);<NEW_LINE>sumSquaredErrorsPerColumn = Nd4j.zeros(DataType.DOUBLE, n);<NEW_LINE>sumAbsErrorsPerColumn = Nd4j.zeros(DataType.DOUBLE, n);<NEW_LINE>currentMean = Nd4j.zeros(DataType.DOUBLE, n);<NEW_LINE>currentPredictionMean = Nd4j.zeros(DataType.DOUBLE, n);<NEW_LINE>sumOfProducts = Nd4j.<MASK><NEW_LINE>sumSquaredLabels = Nd4j.zeros(DataType.DOUBLE, n);<NEW_LINE>sumSquaredPredicted = Nd4j.zeros(DataType.DOUBLE, n);<NEW_LINE>sumLabels = Nd4j.zeros(DataType.DOUBLE, n);<NEW_LINE>initialized = true;<NEW_LINE>}
zeros(DataType.DOUBLE, n);
1,284,774
public int execute(final String fullCommand, final CommandLine cl, final Shell shellState) throws Exception {<NEW_LINE>List<String> tservers;<NEW_LINE>ManagerMonitorInfo stats;<NEW_LINE>ManagerClientService.Iface client = null;<NEW_LINE>ClientContext context = shellState.getContext();<NEW_LINE>while (true) {<NEW_LINE>try {<NEW_LINE>client = ManagerClient.getConnectionWithRetry(context);<NEW_LINE>stats = client.getManagerStats(TraceUtil.traceInfo(), context.rpcCreds());<NEW_LINE>break;<NEW_LINE>} catch (ThriftNotActiveServiceException e) {<NEW_LINE>// Let it loop, fetching a new location<NEW_LINE>sleepUninterruptibly(100, TimeUnit.MILLISECONDS);<NEW_LINE>} finally {<NEW_LINE>if (client != null)<NEW_LINE>ManagerClient.close(client, context);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>final boolean paginate = !cl.hasOption(disablePaginationOpt.getOpt());<NEW_LINE>if (cl.hasOption(tserverOption.getOpt())) {<NEW_LINE>tservers = new ArrayList<>();<NEW_LINE>tservers.add(cl.getOptionValue<MASK><NEW_LINE>} else {<NEW_LINE>tservers = Collections.emptyList();<NEW_LINE>}<NEW_LINE>shellState.printLines(new BulkImportListIterator(tservers, stats), paginate);<NEW_LINE>return 0;<NEW_LINE>}
(tserverOption.getOpt()));
1,679,885
public void onNestedScroll(@NonNull final CoordinatorLayout coordinatorLayout, @NonNull final FloatingActionButton fab, @NonNull final View target, final int dxConsumed, final int dyConsumed, final int dxUnconsumed, final int dyUnconsumed, final int type) {<NEW_LINE>super.onNestedScroll(coordinatorLayout, fab, target, dxConsumed, <MASK><NEW_LINE>if (!enabled)<NEW_LINE>return;<NEW_LINE>if (dyConsumed > 0 && fab.getVisibility() == View.VISIBLE) {<NEW_LINE>// User scrolled down and the FAB is currently visible -> hide the FAB<NEW_LINE>fab.hide();<NEW_LINE>} else if (dyConsumed < 0 && fab.getVisibility() != View.VISIBLE) {<NEW_LINE>// User scrolled up and the FAB is currently not visible -> show the FAB<NEW_LINE>fab.postDelayed(new Runnable() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void run() {<NEW_LINE>fab.show();<NEW_LINE>}<NEW_LINE>}, 200L);<NEW_LINE>}<NEW_LINE>}
dyConsumed, dxUnconsumed, dyUnconsumed, type);
818,151
private Storage32 clearSparse(int index) {<NEW_LINE>assert size > 0;<NEW_LINE>long unsignedIndex = toUnsignedLong(index);<NEW_LINE>int position = unsignedBinarySearch(indexes, size, unsignedIndex);<NEW_LINE>if (position < 0) {<NEW_LINE>return this;<NEW_LINE>}<NEW_LINE>--size;<NEW_LINE>if (size == 0) {<NEW_LINE>// Emptied: just null out the value and convert to dense<NEW_LINE>// representation by setting indexes to null.<NEW_LINE>values[position] = null;<NEW_LINE>indexes = null;<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>int delta = capacityDeltaInt(indexes.length);<NEW_LINE>int wasted = indexes.length - size;<NEW_LINE>int newCapacity = indexes.length - delta;<NEW_LINE>if (wasted >= delta && newCapacity >= MIN_CAPACITY) {<NEW_LINE>// We are wasting too much: shrink the arrays.<NEW_LINE>int[] newIndexes = new int[newCapacity];<NEW_LINE>arraycopy(indexes, 0, newIndexes, 0, position);<NEW_LINE>arraycopy(indexes, position + 1, newIndexes, position, size - position);<NEW_LINE>indexes = newIndexes;<NEW_LINE>Object[] newValues = new Object[newCapacity];<NEW_LINE>arraycopy(values, <MASK><NEW_LINE>arraycopy(values, position + 1, newValues, position, size - position);<NEW_LINE>values = newValues;<NEW_LINE>} else {<NEW_LINE>// shift left to fill the gap<NEW_LINE>arraycopy(indexes, position + 1, indexes, position, size - position);<NEW_LINE>arraycopy(values, position + 1, values, position, size - position);<NEW_LINE>values[size] = null;<NEW_LINE>}<NEW_LINE>return this;<NEW_LINE>}
0, newValues, 0, position);
1,571,140
private CompletableFuture<ContainerHandle> startContainerInternal(int containerId) {<NEW_LINE>ContainerWithHandle newContainer = new ContainerWithHandle(this.factory.createStreamSegmentContainer(containerId), new SegmentContainerHandle(containerId));<NEW_LINE>ContainerWithHandle existingContainer = this.containers.putIfAbsent(containerId, newContainer);<NEW_LINE>if (existingContainer != null) {<NEW_LINE>// We had multiple concurrent calls to start this Container and some other request beat us to it.<NEW_LINE>newContainer.container.close();<NEW_LINE>throw new IllegalArgumentException(String.format("Container %d is already registered.", containerId));<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>// Attempt to Start the container, but first, attach a shutdown listener so we know to unregister it when it's stopped.<NEW_LINE>Services.onStop(newContainer.container, () -> unregisterContainer(newContainer), ex -> handleContainerFailure(newContainer, ex), this.executor);<NEW_LINE>return Services.startAsync(newContainer.container, this.executor).thenApply(v -> newContainer.handle);<NEW_LINE>}
log.info("Registered SegmentContainer {}.", containerId);
884,190
public static void main(String[] args) {<NEW_LINE>final Scanner scanner = new Scanner(System.in);<NEW_LINE>System.out.println("\n=========================================================" + "\n " + "\n Welcome to the Spring Integration JMS Sample! " + "\n " + "\n For more information please visit: " + "\n https://www.springsource.org/spring-integration/ " + "\n " + "\n=========================================================");<NEW_LINE>ActiveMqTestUtils.prepare();<NEW_LINE>System.out.println("\n Which Demo would you like to run? <enter>:\n");<NEW_LINE>System.out.println("\t1. Channel Adapter Demo");<NEW_LINE><MASK><NEW_LINE>System.out.println("\t3. Aggregation Demo");<NEW_LINE>while (true) {<NEW_LINE>final String input = scanner.nextLine();<NEW_LINE>if ("1".equals(input.trim())) {<NEW_LINE>System.out.println(" Loading Channel Adapter Demo...");<NEW_LINE>new ClassPathXmlApplicationContext(configFilesChannelAdapterDemo, Main.class);<NEW_LINE>break;<NEW_LINE>} else if ("2".equals(input.trim())) {<NEW_LINE>System.out.println(" Loading Gateway Demo...");<NEW_LINE>new ClassPathXmlApplicationContext(configFilesGatewayDemo, Main.class);<NEW_LINE>break;<NEW_LINE>} else if ("3".equals(input.trim())) {<NEW_LINE>System.out.println(" Loading Aggregation Demo...");<NEW_LINE>new ClassPathXmlApplicationContext(configFilesAggregationDemo, Main.class);<NEW_LINE>break;<NEW_LINE>} else {<NEW_LINE>System.out.println("Invalid choice\n\n");<NEW_LINE>System.out.print("Enter you choice: ");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>System.out.println(" Please type something and hit <enter>\n");<NEW_LINE>scanner.close();<NEW_LINE>}
System.out.println("\t2. Gateway Demo");
1,703,804
public String generateKey(JobParameters source) {<NEW_LINE>Assert.notNull(source, "source must not be null");<NEW_LINE>Map<String, JobParameter<MASK><NEW_LINE>StringBuilder stringBuffer = new StringBuilder();<NEW_LINE>List<String> keys = new ArrayList<>(props.keySet());<NEW_LINE>Collections.sort(keys);<NEW_LINE>for (String key : keys) {<NEW_LINE>JobParameter jobParameter = props.get(key);<NEW_LINE>if (jobParameter.isIdentifying()) {<NEW_LINE>String value = jobParameter.getValue() == null ? "" : jobParameter.toString();<NEW_LINE>stringBuffer.append(key).append("=").append(value).append(";");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>return DigestUtils.md5DigestAsHex(stringBuffer.toString().getBytes("UTF-8"));<NEW_LINE>} catch (UnsupportedEncodingException e) {<NEW_LINE>throw new IllegalStateException("UTF-8 encoding not available. Fatal (should be in the JDK).");<NEW_LINE>}<NEW_LINE>}
> props = source.getParameters();
1,473,139
public static double ceilPowerOfTwo(double x) {<NEW_LINE>checkArgument(x > 0.0, "Input must be positive. Provided value: %s", x);<NEW_LINE>checkArgument(Double.isFinite(x), "Input must be finite. Provided value: %s", x);<NEW_LINE>checkArgument(!Double.isNaN(x), "Input must be a number. Provided value: NaN");<NEW_LINE>// The following bit masks are based on the bit layout of double values in Java, which according<NEW_LINE>// to the IEEE standard is defined as "1*s 11*e 52*m" where "s" is the sign bit, "e" are the<NEW_LINE>// exponent bits and "m" are the mantissa bits.<NEW_LINE>final long exponentMask = 0x7ff0000000000000L;<NEW_LINE>final long mantissaMask = 0x000fffffffffffffL;<NEW_LINE>long bits = Double.doubleToLongBits(x);<NEW_LINE>long mantissaBits = bits & mantissaMask;<NEW_LINE>// Since x is a finite positive number, x is a power of 2 if and only if it has a mantissa of 0.<NEW_LINE>if (mantissaBits == 0x0000000000000000L) {<NEW_LINE>return x;<NEW_LINE>}<NEW_LINE>long exponentBits = bits & exponentMask;<NEW_LINE>long maxExponentBits = Double.<MASK><NEW_LINE>checkArgument(exponentBits < maxExponentBits, "Input must not be greater than 2^1023. Provided value: %s", x);<NEW_LINE>// Increase the exponent bits by 1 to get the next power of 2. Note that this requires to add<NEW_LINE>// 0x0010000000000000L to the exponent bits in order to skip the mantissa.<NEW_LINE>return Double.longBitsToDouble(exponentBits + 0x0010000000000000L);<NEW_LINE>}
doubleToLongBits(Double.MAX_VALUE) & exponentMask;
1,462,694
char doForeign(StaticObject array, int index, @CachedLibrary(limit = "LIMIT") InteropLibrary arrayInterop, @CachedLibrary(limit = "LIMIT") InteropLibrary elemInterop, @Bind("getContext()") EspressoContext context, @Cached BranchProfile exceptionProfile) {<NEW_LINE><MASK><NEW_LINE>Meta meta = context.getMeta();<NEW_LINE>Object element = ForeignArrayUtils.readForeignArrayElement(array, index, arrayInterop, meta, exceptionProfile);<NEW_LINE>try {<NEW_LINE>String string1 = elemInterop.asString(element);<NEW_LINE>if (string1.length() == 1) {<NEW_LINE>return string1.charAt(0);<NEW_LINE>}<NEW_LINE>} catch (UnsupportedMessageException e) {<NEW_LINE>// fall-through<NEW_LINE>}<NEW_LINE>exceptionProfile.enter();<NEW_LINE>throw meta.throwExceptionWithMessage(meta.java_lang_ClassCastException, "Could not cast foreign array element to char");<NEW_LINE>}
assert !StaticObject.isNull(array);
1,816,892
public boolean checkAtInjectValidator() {<NEW_LINE>Set<ConstraintViolation<AValidationXMLTestBean2>> cvSet = injectedValidator.validate(this);<NEW_LINE>if (cvSet != null && !cvSet.isEmpty()) {<NEW_LINE>svLogger.log(Level.INFO, CLASS_NAME, "found " + cvSet.size() + " contstraints " <MASK><NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>setValidationToFail();<NEW_LINE>try {<NEW_LINE>cvSet = injectedValidator.validate(this);<NEW_LINE>if (cvSet != null && cvSet.size() != 2) {<NEW_LINE>svLogger.log(Level.INFO, CLASS_NAME, "found " + cvSet.size() + " contstraints " + "when there should have been 2: " + formatConstraintViolations(cvSet));<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>} finally {<NEW_LINE>resetValidation();<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>}
+ "when there shouldn't have been any: " + formatConstraintViolations(cvSet));
833,688
public GTreeNode findSymbolTreeNode(SymbolNode key, boolean loadChildren, TaskMonitor monitor) {<NEW_LINE>// if we don't have to loadChildren and we are not loaded get out.<NEW_LINE>if (!loadChildren && !isLoaded()) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>List<GTreeNode> children = getChildren();<NEW_LINE>int index = Collections.binarySearch(<MASK><NEW_LINE>if (index >= 0) {<NEW_LINE>GTreeNode node = children.get(index);<NEW_LINE>SymbolTreeNode symbolNode = (SymbolTreeNode) node;<NEW_LINE>Symbol searchSymbol = key.getSymbol();<NEW_LINE>if (symbolNode.getSymbol() == searchSymbol) {<NEW_LINE>return node;<NEW_LINE>}<NEW_LINE>// At this point we know that the given child is not itself a symbol node, but it<NEW_LINE>// may contain a child that contains the symbol node (some symbol nodes will<NEW_LINE>// themselves contain more symbol nodes).<NEW_LINE>// Ask that child to search. Leave this method regardless, as if this child does<NEW_LINE>// not have it, then none of the others will.<NEW_LINE>node = symbolNode.findSymbolTreeNode(key, loadChildren, monitor);<NEW_LINE>return node;<NEW_LINE>}<NEW_LINE>// Brute-force lookup in each child. This will not typically be called.<NEW_LINE>for (GTreeNode childNode : children) {<NEW_LINE>if (monitor.isCancelled()) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>if (!(childNode instanceof SymbolTreeNode)) {<NEW_LINE>// InProgressNode<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>SymbolTreeNode symbolNode = (SymbolTreeNode) childNode;<NEW_LINE>GTreeNode foundNode = symbolNode.findSymbolTreeNode(key, loadChildren, monitor);<NEW_LINE>if (foundNode != null) {<NEW_LINE>return foundNode;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>}
children, key, getChildrenComparator());
1,619,906
public void updateWorkerStatus(int workerId, WorkerStatus newStatus) {<NEW_LINE>try (LockWrapper ignore = lock.openWriteLock()) {<NEW_LINE>if (server2WorkerInfo.containsKey(workerId)) {<NEW_LINE>WorkerInfo originWorkerInfo = server2WorkerInfo.get(workerId);<NEW_LINE>WorkerInfo newWorkerInfo;<NEW_LINE>if (originWorkerInfo.roleType == RoleType.EXECUTOR && originWorkerInfo.dataStatus != null) {<NEW_LINE>newWorkerInfo = new WorkerInfo(originWorkerInfo.dataStatus, newStatus);<NEW_LINE>} else {<NEW_LINE>newWorkerInfo = new WorkerInfo(workerId, originWorkerInfo.endpoint, originWorkerInfo.roleType, newStatus, originWorkerInfo.logDir, originWorkerInfo.lastReportTime);<NEW_LINE>}<NEW_LINE>workerInfoMap.<MASK><NEW_LINE>workerInfoMap.put(originWorkerInfo.roleType, newWorkerInfo);<NEW_LINE>server2WorkerInfo.put(workerId, newWorkerInfo);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
remove(originWorkerInfo.roleType, originWorkerInfo);
757,553
private Attributes extract(Attributes emf, int frame, String cuid, boolean enhanced) {<NEW_LINE>Attributes dest = new Attributes(emf.size() * 2);<NEW_LINE>dest.addNotSelected(emf, EXCLUDE_TAGS);<NEW_LINE>if (enhanced) {<NEW_LINE>Attributes sfgs = emf.getNestedDataset(Tag.SharedFunctionalGroupsSequence);<NEW_LINE>if (sfgs == null)<NEW_LINE>throw new IllegalArgumentException("Missing (5200,9229) Shared Functional Groups Sequence");<NEW_LINE>Attributes fgs = emf.getNestedDataset(Tag.PerFrameFunctionalGroupsSequence, frame);<NEW_LINE>if (fgs == null)<NEW_LINE>throw new IllegalArgumentException("Missing (5200,9230) Per-frame Functional Groups Sequence Item for frame #" + (frame + 1));<NEW_LINE>addFunctionGroups(dest, sfgs);<NEW_LINE>addFunctionGroups(dest, fgs);<NEW_LINE>dest.setString(Tag.ImageType, VR.CS, dest.getStrings(Tag.FrameType));<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>addPixelData(dest, emf, frame);<NEW_LINE>dest.setString(Tag.SOPClassUID, VR.UI, cuid);<NEW_LINE>dest.setString(Tag.SOPInstanceUID, VR.UI, uidMapper.get(dest.getString(Tag.SOPInstanceUID)) + '.' + (frame + 1));<NEW_LINE>dest.setString(Tag.InstanceNumber, VR.IS, createInstanceNumber(dest.getString(Tag.InstanceNumber, ""), frame));<NEW_LINE>if (!preserveSeriesInstanceUID)<NEW_LINE>dest.setString(Tag.SeriesInstanceUID, VR.UI, uidMapper.get(dest.getString(Tag.SeriesInstanceUID)));<NEW_LINE>adjustReferencedImages(dest, Tag.ReferencedImageSequence);<NEW_LINE>adjustReferencedImages(dest, Tag.SourceImageSequence);<NEW_LINE>return dest;<NEW_LINE>}
dest.remove(Tag.FrameType);
90,476
protected Round createRoundRandom() {<NEW_LINE>Round round = new Round(rounds.<MASK><NEW_LINE>rounds.add(round);<NEW_LINE>List<TournamentPlayer> roundPlayers = getActivePlayers();<NEW_LINE>// search the player with a bye last round<NEW_LINE>List<TournamentPlayer> playerWithByes = getTournamentPlayersWithBye(roundPlayers);<NEW_LINE>while (roundPlayers.size() > 1) {<NEW_LINE>TournamentPlayer player1 = getNextAvailablePlayer(roundPlayers, playerWithByes);<NEW_LINE>TournamentPlayer player2 = getNextAvailablePlayer(roundPlayers, playerWithByes);<NEW_LINE>round.addPairing(new TournamentPairing(player1, player2));<NEW_LINE>}<NEW_LINE>if (!roundPlayers.isEmpty()) {<NEW_LINE>// player free round - add to bye players of this round<NEW_LINE>TournamentPlayer player1 = roundPlayers.get(0);<NEW_LINE>round.getPlayerByes().add(player1);<NEW_LINE>player1.setState(TournamentPlayerState.WAITING);<NEW_LINE>player1.setStateInfo("Round Bye");<NEW_LINE>updateResults();<NEW_LINE>}<NEW_LINE>return round;<NEW_LINE>}
size() + 1, this);
446,214
private void createPP_Order_Report_Lines(final IQualityInspectionOrder qiOrder) {<NEW_LINE>//<NEW_LINE>// Create Quality Inspection Lines<NEW_LINE>final IVendorReceipt<Object> receiptFromVendor = createVendorReceipt(qiOrder);<NEW_LINE>// the averaged values are only required when we invoice<NEW_LINE>final boolean buildWithAveragedValues = false;<NEW_LINE>final QualityInspectionLinesBuilder qualityInspectionLinesBuilder = new QualityInspectionLinesBuilder(qiOrder, buildWithAveragedValues);<NEW_LINE>qualityInspectionLinesBuilder.setReceiptFromVendor(receiptFromVendor);<NEW_LINE>qualityInspectionLinesBuilder.create();<NEW_LINE>//<NEW_LINE>// Save Report Lines<NEW_LINE>final IQualityBasedConfig config = qiOrder.getQualityBasedConfig();<NEW_LINE>final PPOrderReportWriter writer = new <MASK><NEW_LINE>writer.setLineTypes(config.getPPOrderReportLineTypes());<NEW_LINE>// discard old lines, if any<NEW_LINE>writer.deleteReportLines();<NEW_LINE>writer.save(qualityInspectionLinesBuilder.getCreatedQualityInspectionLines());<NEW_LINE>}
PPOrderReportWriter(qiOrder.getPP_Order());
1,677,227
public void executeQuery(KeyNamePair docTypeKNPair, IMiniTable miniTable) {<NEW_LINE>log.info("");<NEW_LINE>int AD_Client_ID = Env.getAD_Client_ID(Env.getCtx());<NEW_LINE>// Create SQL<NEW_LINE>String sql = "";<NEW_LINE>if (docTypeKNPair.getKey() == MOrder.Table_ID) {<NEW_LINE>sql = getOrderSQL();<NEW_LINE>} else {<NEW_LINE>sql = getRMASql();<NEW_LINE>}<NEW_LINE>// reset table<NEW_LINE>int row = 0;<NEW_LINE>miniTable.setRowCount(row);<NEW_LINE>// Execute<NEW_LINE>try {<NEW_LINE>PreparedStatement pstmt = DB.prepareStatement(sql.toString(), null);<NEW_LINE>pstmt.setInt(1, AD_Client_ID);<NEW_LINE>ResultSet rs = pstmt.executeQuery();<NEW_LINE>//<NEW_LINE>while (rs.next()) {<NEW_LINE>// extend table<NEW_LINE>miniTable.setRowCount(row + 1);<NEW_LINE>// set values<NEW_LINE>// C_Order_ID<NEW_LINE>miniTable.setValueAt(new IDColumn(rs.getInt(1)), row, 0);<NEW_LINE>// Org<NEW_LINE>miniTable.setValueAt(rs.getString(2), row, 1);<NEW_LINE>// DocType<NEW_LINE>miniTable.setValueAt(rs.getString(3), row, 2);<NEW_LINE>// Doc No<NEW_LINE>miniTable.setValueAt(rs.getString(4), row, 3);<NEW_LINE>// BPartner<NEW_LINE>miniTable.setValueAt(rs.getString<MASK><NEW_LINE>// DateOrdered<NEW_LINE>miniTable.setValueAt(rs.getTimestamp(6), row, 5);<NEW_LINE>// TotalLines<NEW_LINE>miniTable.setValueAt(rs.getBigDecimal(7), row, 6);<NEW_LINE>// prepare next<NEW_LINE>row++;<NEW_LINE>}<NEW_LINE>rs.close();<NEW_LINE>pstmt.close();<NEW_LINE>} catch (SQLException e) {<NEW_LINE>log.log(Level.SEVERE, sql.toString(), e);<NEW_LINE>}<NEW_LINE>//<NEW_LINE>miniTable.autoSize();<NEW_LINE>// statusBar.setStatusDB(String.valueOf(miniTable.getRowCount()));<NEW_LINE>}
(5), row, 4);
1,227,278
public static ClusterMember[] parse(final String value) {<NEW_LINE>if (null == value || value.length() == 0) {<NEW_LINE>return ClusterMember.EMPTY_MEMBERS;<NEW_LINE>}<NEW_LINE>final String[] <MASK><NEW_LINE>final int length = memberValues.length;<NEW_LINE>final ClusterMember[] members = new ClusterMember[length];<NEW_LINE>for (int i = 0; i < length; i++) {<NEW_LINE>final String idAndEndpoints = memberValues[i];<NEW_LINE>final String[] memberAttributes = idAndEndpoints.split(",");<NEW_LINE>if (memberAttributes.length != 6) {<NEW_LINE>throw new ClusterException("invalid member value: " + idAndEndpoints + " within: " + value);<NEW_LINE>}<NEW_LINE>final String endpoints = String.join(",", memberAttributes[1], memberAttributes[2], memberAttributes[3], memberAttributes[4], memberAttributes[5]);<NEW_LINE>members[i] = new ClusterMember(Integer.parseInt(memberAttributes[0]), memberAttributes[1], memberAttributes[2], memberAttributes[3], memberAttributes[4], memberAttributes[5], endpoints);<NEW_LINE>}<NEW_LINE>return members;<NEW_LINE>}
memberValues = value.split("\\|");
311,614
public void execute(LuckPermsPlugin plugin, Sender sender, PermissionHolder target, ArgumentList args, String label, CommandPermission permission) throws CommandException {<NEW_LINE>if (ArgumentPermissions.checkModifyPerms(plugin, sender, permission, target)) {<NEW_LINE>Message.COMMAND_NO_PERMISSION.send(sender);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>String key = args.get(0);<NEW_LINE>String value = args.get(1);<NEW_LINE>Duration duration = args.getDuration(2);<NEW_LINE>TemporaryNodeMergeStrategy modifier = args.getTemporaryModifierAndRemove(3).orElseGet(() -> plugin.getConfiguration().get(ConfigKeys.TEMPORARY_ADD_BEHAVIOUR));<NEW_LINE>MutableContextSet context = args.getContextOrDefault(3, plugin);<NEW_LINE>if (ArgumentPermissions.checkContext(plugin, sender, permission, context) || ArgumentPermissions.checkGroup(plugin, sender, target, context) || ArgumentPermissions.checkArguments(plugin, sender, permission, key)) {<NEW_LINE>Message.COMMAND_NO_PERMISSION.send(sender);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>Node node = Meta.builder(key, value).withContext(context).expiry(duration).build();<NEW_LINE>// remove temp meta nodes that have the same key and /different/ value (don't want to remove it if we are accumulating/replacing)<NEW_LINE>target.removeIf(DataType.NORMAL, context, NodeType.META.predicate(n -> n.hasExpiry() && n.getMetaKey().equalsIgnoreCase(key) && !n.getMetaValue().equals(value)), false);<NEW_LINE>DataMutateResult.WithMergedNode result = target.setNode(DataType.NORMAL, node, modifier);<NEW_LINE>if (result.getResult().wasSuccessful()) {<NEW_LINE>duration = result.getMergedNode().getExpiryDuration();<NEW_LINE>Message.SET_META_TEMP_SUCCESS.send(sender, key, value, target, duration, context);<NEW_LINE>LoggedAction.build().source(sender).target(target).description("meta", "settemp", key, value, duration, context).build(<MASK><NEW_LINE>StorageAssistant.save(target, sender, plugin);<NEW_LINE>} else {<NEW_LINE>Message.ALREADY_HAS_TEMP_META.send(sender, target, key, value, context);<NEW_LINE>}<NEW_LINE>}
).submit(plugin, sender);
76,301
public void run() {<NEW_LINE>if (auditLog != null) {<NEW_LINE>auditLog.logMessage(listenerThreadName, OMRSAuditCode.OPEN_METADATA_TOPIC_LISTENER_START.getMessageDefinition(topicName), this.getConnection().toString());<NEW_LINE>}<NEW_LINE>while (keepRunning) {<NEW_LINE>try {<NEW_LINE>try {<NEW_LINE>List<MASK><NEW_LINE>if ((receivedEvents != null) && (!receivedEvents.isEmpty())) {<NEW_LINE>for (IncomingEvent event : receivedEvents) {<NEW_LINE>if (event != null) {<NEW_LINE>this.distributeEvent(event);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (Throwable error) {<NEW_LINE>log.error("Bad exception from checkForEvents", error);<NEW_LINE>}<NEW_LINE>Thread.sleep(sleepTime);<NEW_LINE>} catch (InterruptedException wakeUp) {<NEW_LINE>log.info("Wake up for more events");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (auditLog != null) {<NEW_LINE>auditLog.logMessage(listenerThreadName, OMRSAuditCode.OPEN_METADATA_TOPIC_LISTENER_SHUTDOWN.getMessageDefinition(topicName), this.getConnection().toString());<NEW_LINE>}<NEW_LINE>}
<IncomingEvent> receivedEvents = checkForIncomingEvents();
745,394
public void compactionCompleted(TInfo tinfo, TCredentials credentials, String externalCompactionId, TKeyExtent textent, TCompactionStats stats) throws ThriftSecurityException {<NEW_LINE>// do not expect users to call this directly, expect other tservers to call this method<NEW_LINE>if (!security.canPerformSystemActions(credentials)) {<NEW_LINE>throw new AccumuloSecurityException(credentials.getPrincipal(), SecurityErrorCode.PERMISSION_DENIED).asThriftException();<NEW_LINE>}<NEW_LINE>var extent = KeyExtent.fromThrift(textent);<NEW_LINE>LOG.info("Compaction completed, id: {}, stats: {}, extent: {}", externalCompactionId, stats, extent);<NEW_LINE>final var ecid = ExternalCompactionId.of(externalCompactionId);<NEW_LINE>compactionFinalizer.commitCompaction(ecid, extent, stats.fileSize, stats.entriesWritten);<NEW_LINE>// It's possible that RUNNING might not have an entry for this ecid in the case<NEW_LINE>// of a coordinator restart when the Coordinator can't find the TServer for the<NEW_LINE>// corresponding external compaction.<NEW_LINE>final RunningCompaction rc = RUNNING.get(ecid);<NEW_LINE>if (null != rc) {<NEW_LINE>RUNNING.remove(ecid, rc);<NEW_LINE>COMPLETED.put(ecid, rc);<NEW_LINE>} else {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>}
LOG.warn("Compaction completed called by Compactor for {}, but no running compaction for that id.", externalCompactionId);
224,432
public static void showVoiceProviderDialog(final MapActivity activity, final ApplicationMode applicationMode, final boolean applyAllModes) {<NEW_LINE>OsmandApplication app = activity.getMyApplication();<NEW_LINE>final OsmandSettings settings = app.getSettings();<NEW_LINE>boolean nightMode = app.getDaynightHelper().isNightModeForMapControls();<NEW_LINE>final RoutingOptionsHelper routingOptionsHelper = app.getRoutingOptionsHelper();<NEW_LINE>final AlertDialog.Builder builder = new AlertDialog.Builder(UiUtilities.getThemedContext(activity, nightMode));<NEW_LINE>final String[] firstSelectedVoiceProvider = new String[1];<NEW_LINE>View view = UiUtilities.getInflater(activity, nightMode).inflate(R.layout.select_voice_first, null);<NEW_LINE>((ImageView) view.findViewById(R.id.icon)).setImageDrawable(app.getUIUtilities().getIcon(R.drawable.ic_action_volume_up, settings.isLightContent()));<NEW_LINE>view.findViewById(R.id.spinner).setOnClickListener(new View.OnClickListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onClick(final View v) {<NEW_LINE>routingOptionsHelper.selectVoiceGuidance(activity, new CallbackWithObject<String>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public boolean processResult(String result) {<NEW_LINE>boolean acceptableValue = !RoutePreferencesMenu.MORE_VALUE.equals(firstSelectedVoiceProvider[0]);<NEW_LINE>if (acceptableValue) {<NEW_LINE>((TextView) v.findViewById(R.id.selectText)).setText(routingOptionsHelper.getVoiceProviderName(v.getContext(), result));<NEW_LINE>firstSelectedVoiceProvider[0] = result;<NEW_LINE>}<NEW_LINE>return acceptableValue;<NEW_LINE>}<NEW_LINE>}, applicationMode);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>((ImageView) view.findViewById(R.id.dropDownIcon)).setImageDrawable(app.getUIUtilities().getIcon(R.drawable.ic_action_arrow_drop_down, settings.isLightContent()));<NEW_LINE>builder.setCancelable(true);<NEW_LINE>builder.setNegativeButton(R.string.shared_string_cancel, null);<NEW_LINE>builder.setPositiveButton(R.string.shared_string_apply, new DialogInterface.OnClickListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onClick(DialogInterface dialog, int which) {<NEW_LINE>if (!Algorithms.isEmpty(firstSelectedVoiceProvider[0])) {<NEW_LINE>routingOptionsHelper.applyVoiceProvider(activity, firstSelectedVoiceProvider[0], applyAllModes);<NEW_LINE>if (OsmandSettings.VOICE_PROVIDER_NOT_USE.equals(firstSelectedVoiceProvider[0])) {<NEW_LINE>settings.<MASK><NEW_LINE>} else {<NEW_LINE>settings.VOICE_MUTE.setModeValue(applicationMode, false);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>builder.setNeutralButton(R.string.shared_string_do_not_use, new DialogInterface.OnClickListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onClick(DialogInterface dialogInterface, int i) {<NEW_LINE>if (applyAllModes) {<NEW_LINE>for (ApplicationMode mode : ApplicationMode.allPossibleValues()) {<NEW_LINE>// if (!settings.VOICE_PROVIDER.isSetForMode(mode)) {<NEW_LINE>settings.VOICE_PROVIDER.setModeValue(mode, OsmandSettings.VOICE_PROVIDER_NOT_USE);<NEW_LINE>settings.VOICE_MUTE.setModeValue(mode, true);<NEW_LINE>// }<NEW_LINE>}<NEW_LINE>}<NEW_LINE>settings.VOICE_PROVIDER.setModeValue(applicationMode, OsmandSettings.VOICE_PROVIDER_NOT_USE);<NEW_LINE>settings.VOICE_MUTE.setModeValue(applicationMode, true);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>builder.setView(view);<NEW_LINE>builder.show();<NEW_LINE>}
VOICE_MUTE.setModeValue(applicationMode, true);
1,666,809
protected int checkErrors(DataBackup dataBackup, List<MetaModel> metaModelList, String tempDirectoryPath, Map<String, List<String>> subClassesMap) {<NEW_LINE>int errorsCount = 0;<NEW_LINE>for (MetaModel metaModel : metaModelList) {<NEW_LINE>try {<NEW_LINE>List<String> subClasses = subClassesMap.get(metaModel.getFullName());<NEW_LINE>long totalRecord = getMetaModelDataCount(metaModel, subClasses);<NEW_LINE>if (totalRecord > 0) {<NEW_LINE>LOG.debug(<MASK><NEW_LINE>CSVWriter csvWriter = new CSVWriter(new FileWriter(new File(tempDirectoryPath, metaModel.getName() + ".csv")), SEPARATOR, QUOTE_CHAR);<NEW_LINE>writeCSVData(metaModel, csvWriter, dataBackup, 1, subClasses, tempDirectoryPath);<NEW_LINE>csvWriter.close();<NEW_LINE>}<NEW_LINE>} catch (ClassNotFoundException e) {<NEW_LINE>} catch (IOException e) {<NEW_LINE>TraceBackService.trace(e, DataBackupService.class.getName());<NEW_LINE>} catch (Exception e) {<NEW_LINE>JPA.em().getTransaction().rollback();<NEW_LINE>sb.append("\nError occured while processing model : " + metaModel.getFullName() + "\n");<NEW_LINE>sb.append(e.getMessage() + "\n");<NEW_LINE>JPA.em().getTransaction().begin();<NEW_LINE>dataBackup = Beans.get(DataBackupRepository.class).find(dataBackup.getId());<NEW_LINE>dataBackup.setFetchLimit(1);<NEW_LINE>errorsCount++;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return errorsCount;<NEW_LINE>}
"Checking Model : " + metaModel.getFullName());