idx
int32
46
1.86M
input
stringlengths
321
6.6k
target
stringlengths
9
1.24k
1,096,744
public static void createPersistenceXml(String storeName) {<NEW_LINE>String configPropertyName = AppContextLoader.PERSISTENCE_CONFIG;<NEW_LINE>String fileName = "persistence.xml";<NEW_LINE>if (!Stores.isMain(storeName)) {<NEW_LINE>configPropertyName = configPropertyName + "_" + storeName;<NEW_LINE>fileName = storeName + "-" + fileName;<NEW_LINE>}<NEW_LINE>String <MASK><NEW_LINE>if (Strings.isNullOrEmpty(configProperty)) {<NEW_LINE>log.debug("Property {} is not set, assuming {} is not a RdbmsStore", configPropertyName, storeName);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>List<String> files = Splitter.on(AppProperties.SEPARATOR_PATTERN).omitEmptyStrings().trimResults().splitToList(configProperty);<NEW_LINE>if (!Stores.isMain(storeName) && !files.contains("com/haulmont/cuba/base-persistence.xml")) {<NEW_LINE>files = new ArrayList<>(files);<NEW_LINE>files.add(0, "com/haulmont/cuba/base-persistence.xml");<NEW_LINE>}<NEW_LINE>PersistenceConfigProcessor processor = new PersistenceConfigProcessor();<NEW_LINE>processor.setStorageName(storeName);<NEW_LINE>processor.setSourceFiles(files);<NEW_LINE>String dataDir = AppContext.getProperty("cuba.dataDir");<NEW_LINE>processor.setOutputFile(dataDir + "/" + fileName);<NEW_LINE>processor.create();<NEW_LINE>}
configProperty = AppContext.getProperty(configPropertyName);
1,419,562
private void addMultiAsFile(BytecodeCreator methodCreator, AssignableResultHandle multipartForm, String formParamName, String partType, FieldInfo field, ResultHandle multi) {<NEW_LINE>if (partType == null) {<NEW_LINE>throw new IllegalArgumentException("No @PartType annotation found on multipart form field " + field.declaringClass().name() + "." + field.name());<NEW_LINE>}<NEW_LINE>if (partType.equalsIgnoreCase(MediaType.APPLICATION_OCTET_STREAM)) {<NEW_LINE>// MultipartForm#binaryFileUpload(String name, String filename, Multi<Byte> content, String mediaType);<NEW_LINE>methodCreator.// MultipartForm#binaryFileUpload(String name, String filename, Multi<Byte> content, String mediaType);<NEW_LINE>assign(// MultipartForm#binaryFileUpload(String name, String filename, Multi<Byte> content, String mediaType);<NEW_LINE>multipartForm, // filename = name<NEW_LINE>methodCreator.invokeVirtualMethod(MethodDescriptor.ofMethod(QuarkusMultipartForm.class, "multiAsBinaryFileUpload", QuarkusMultipartForm.class, String.class, String.class, Multi.class, String.class), multipartForm, methodCreator.load(formParamName), methodCreator.load(formParamName), multi, <MASK><NEW_LINE>} else {<NEW_LINE>// MultipartForm#multiAsTextFileUpload(String name, String filename, Multi<Byte> content, String mediaType)<NEW_LINE>methodCreator.// MultipartForm#multiAsTextFileUpload(String name, String filename, Multi<Byte> content, String mediaType)<NEW_LINE>assign(// MultipartForm#multiAsTextFileUpload(String name, String filename, Multi<Byte> content, String mediaType)<NEW_LINE>multipartForm, // filename = name<NEW_LINE>methodCreator.invokeVirtualMethod(MethodDescriptor.ofMethod(QuarkusMultipartForm.class, "multiAsTextFileUpload", QuarkusMultipartForm.class, String.class, String.class, Multi.class, String.class), multipartForm, methodCreator.load(formParamName), methodCreator.load(formParamName), multi, methodCreator.load(partType)));<NEW_LINE>}<NEW_LINE>}
methodCreator.load(partType)));
1,001,049
private void updateStoragePoolHostVOAndDetails(StoragePool pool, long hostId, ModifyStoragePoolAnswer mspAnswer) {<NEW_LINE>StoragePoolHostVO poolHost = storagePoolHostDao.findByPoolHost(pool.getId(), hostId);<NEW_LINE>if (poolHost == null) {<NEW_LINE>poolHost = new StoragePoolHostVO(pool.getId(), hostId, mspAnswer.getPoolInfo().getLocalPath()<MASK><NEW_LINE>storagePoolHostDao.persist(poolHost);<NEW_LINE>} else {<NEW_LINE>poolHost.setLocalPath(mspAnswer.getPoolInfo().getLocalPath().replaceAll("//", "/"));<NEW_LINE>}<NEW_LINE>StoragePoolVO poolVO = this.primaryStoreDao.findById(pool.getId());<NEW_LINE>poolVO.setUsedBytes(mspAnswer.getPoolInfo().getCapacityBytes() - mspAnswer.getPoolInfo().getAvailableBytes());<NEW_LINE>poolVO.setCapacityBytes(mspAnswer.getPoolInfo().getCapacityBytes());<NEW_LINE>if (StringUtils.isNotEmpty(mspAnswer.getPoolType())) {<NEW_LINE>StoragePoolDetailVO poolType = storagePoolDetailsDao.findDetail(pool.getId(), "pool_type");<NEW_LINE>if (poolType == null) {<NEW_LINE>StoragePoolDetailVO storagePoolDetailVO = new StoragePoolDetailVO(pool.getId(), "pool_type", mspAnswer.getPoolType(), false);<NEW_LINE>storagePoolDetailsDao.persist(storagePoolDetailVO);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>primaryStoreDao.update(pool.getId(), poolVO);<NEW_LINE>}
.replaceAll("//", "/"));
956,321
protected Map<String, Object> createEditorScreenOptions(WindowInfo windowInfo, NavigationState requestedState, AppUI ui) {<NEW_LINE>UrlChangeHandler urlChangeHandler = ui.getUrlChangeHandler();<NEW_LINE>String idParam = MapUtils.isNotEmpty(requestedState.getParams()) ? requestedState.getParams().get("id") : NEW_ENTITY_ID;<NEW_LINE>Class<? extends Entity> entityClass = EditorTypeExtractor.extractEntityClass(windowInfo);<NEW_LINE>if (entityClass == null) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>MetaClass metaClass = metadata.getClassNN(entityClass);<NEW_LINE>if (!security.isEntityOpPermitted(metaClass, EntityOp.READ)) {<NEW_LINE>urlChangeHandler.revertNavigationState();<NEW_LINE>throw new AccessDeniedException(PermissionType.ENTITY_OP, EntityOp.READ, entityClass.getSimpleName());<NEW_LINE>}<NEW_LINE>if (NEW_ENTITY_ID.equals(idParam)) {<NEW_LINE>boolean createPermitted = security.isEntityOpPermitted(metaClass, EntityOp.CREATE);<NEW_LINE>if (!createPermitted) {<NEW_LINE>throw new AccessDeniedException(PermissionType.ENTITY_OP, EntityOp.CREATE, entityClass.getSimpleName());<NEW_LINE>}<NEW_LINE>return ParamsMap.of(WindowParams.ITEM.name(), metadata.create(entityClass));<NEW_LINE>}<NEW_LINE>MetaProperty primaryKeyProperty = metadataTools.getPrimaryKeyProperty(metaClass);<NEW_LINE>if (primaryKeyProperty == null) {<NEW_LINE>throw new IllegalStateException(String.format("Entity %s has no primary key", metaClass.getName()));<NEW_LINE>}<NEW_LINE>Class<?> idType = primaryKeyProperty.getJavaType();<NEW_LINE>Object id = UrlIdSerializer.deserializeId(idType, idParam);<NEW_LINE>LoadContext<?> ctx = new LoadContext(metaClass);<NEW_LINE>ctx.setId(id);<NEW_LINE>ctx.setView(View.MINIMAL);<NEW_LINE>Entity <MASK><NEW_LINE>if (entity == null) {<NEW_LINE>urlChangeHandler.revertNavigationState();<NEW_LINE>throw new EntityAccessException(metaClass, id);<NEW_LINE>}<NEW_LINE>return ParamsMap.of(WindowParams.ITEM.name(), entity);<NEW_LINE>}
entity = dataManager.load(ctx);
1,205,247
// activateBean<NEW_LINE>@Override<NEW_LINE>public EJBObject activateBean(Object primaryKey) throws FinderException, RemoteException {<NEW_LINE>// d215317<NEW_LINE>EJSWrapperCommon wrappers = null;<NEW_LINE>// Single-object ejbSelect methods may result in a null value,<NEW_LINE>// and since this code path also supports ejbSelect, null must<NEW_LINE>// be tolerated and returned. d149627<NEW_LINE>if (primaryKey == null) {<NEW_LINE>if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())<NEW_LINE><MASK><NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>// If noLocalCopies and allowPrimaryKeyMutation are true then we<NEW_LINE>// must create a deep copy of the primaryKey object to avoid data<NEW_LINE>// corruption. PQ62081 d138865<NEW_LINE>// The copy will actually be made in activateBean_Common only if the<NEW_LINE>// primary key is used to insert into the cache, but the determination<NEW_LINE>// must be done here, as it is different for local and remote. d215317<NEW_LINE>// "Primary Key" should not be copied for a StatefulSession bean. d247634<NEW_LINE>boolean pkeyCopyRequired = false;<NEW_LINE>if (noLocalCopies && allowPrimaryKeyMutation && !statefulSessionHome) {<NEW_LINE>pkeyCopyRequired = true;<NEW_LINE>}<NEW_LINE>wrappers = ivEntityHelper.activateBean_Common(this, primaryKey, pkeyCopyRequired);<NEW_LINE>// f111627<NEW_LINE>return wrappers.getRemoteWrapper();<NEW_LINE>}
Tr.debug(tc, "activateBean : key = null, returning null");
25,697
private void refreshList(JTable table, JButton refreshbutton, JTextField filterfield, LinkedList<Object[]> list, String resourcestring) {<NEW_LINE>// first check whether we have any saved values at all<NEW_LINE>if (list != null) {<NEW_LINE>// table-values might be changed, so selection listener should not react<NEW_LINE>tableUpdateActive = true;<NEW_LINE>// get table model<NEW_LINE>DefaultTableModel dtm = (DefaultTableModel) table.getModel();<NEW_LINE>// delete all data from the author-table<NEW_LINE>dtm.setRowCount(0);<NEW_LINE>// create an iterator for the linked list<NEW_LINE>ListIterator<Object[]> iterator = list.listIterator();<NEW_LINE>// go through complete linked list and add each element to the table(model)<NEW_LINE>while (iterator.hasNext()) {<NEW_LINE>dtm.<MASK><NEW_LINE>}<NEW_LINE>// enable filter field<NEW_LINE>filterfield.setEnabled(true);<NEW_LINE>// disable refresh button<NEW_LINE>refreshbutton.setEnabled(false);<NEW_LINE>// show amount of entries<NEW_LINE>statusMsgLabel.setText("(" + String.valueOf(table.getRowCount()) + " " + getResourceMap().getString(resourcestring) + ")");<NEW_LINE>// all changes have been made...<NEW_LINE>tableUpdateActive = false;<NEW_LINE>}<NEW_LINE>}
addRow(iterator.next());
1,353,615
private static StringBuilder appendPath(StringBuilder sb, int indent, PathIterator pathIterator) {<NEW_LINE>double[] coords = new double[6];<NEW_LINE>while (!pathIterator.isDone()) {<NEW_LINE>int <MASK><NEW_LINE>String typeStr;<NEW_LINE>int endIndex;<NEW_LINE>switch(type) {<NEW_LINE>case PathIterator.SEG_CLOSE:<NEW_LINE>typeStr = "SEG_CLOSE";<NEW_LINE>endIndex = 0;<NEW_LINE>break;<NEW_LINE>case PathIterator.SEG_CUBICTO:<NEW_LINE>typeStr = "SEG_CUBICTO";<NEW_LINE>endIndex = 6;<NEW_LINE>break;<NEW_LINE>case PathIterator.SEG_LINETO:<NEW_LINE>typeStr = "SEG_LINETO";<NEW_LINE>endIndex = 2;<NEW_LINE>break;<NEW_LINE>case PathIterator.SEG_MOVETO:<NEW_LINE>typeStr = "SEG_MOVETO";<NEW_LINE>endIndex = 2;<NEW_LINE>break;<NEW_LINE>case PathIterator.SEG_QUADTO:<NEW_LINE>typeStr = "SEG_QUADTO";<NEW_LINE>endIndex = 4;<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>throw new IllegalStateException("Invalid type=" + type);<NEW_LINE>}<NEW_LINE>ArrayUtilities.appendSpaces(sb, indent);<NEW_LINE>sb.append(typeStr).append(": ");<NEW_LINE>for (int i = 0; i < endIndex; ) {<NEW_LINE>sb.append("[").append(coords[i++]).append(",").append(coords[i++]).append("] ");<NEW_LINE>}<NEW_LINE>sb.append('\n');<NEW_LINE>pathIterator.next();<NEW_LINE>}<NEW_LINE>return sb;<NEW_LINE>}
type = pathIterator.currentSegment(coords);
1,344,595
private void singleLine(float x1, float y1, float x2, float y2, int color) {<NEW_LINE>float r = strokeWeight * 0.5f;<NEW_LINE>float dx = x2 - x1;<NEW_LINE>float dy = y2 - y1;<NEW_LINE>float d = PApplet.sqrt(dx * dx + dy * dy);<NEW_LINE>float tx = dy / d * r;<NEW_LINE>float ty = dx / d * r;<NEW_LINE>if (strokeCap == PROJECT) {<NEW_LINE>x1 -= ty;<NEW_LINE>x2 += ty;<NEW_LINE>y1 -= tx;<NEW_LINE>y2 += tx;<NEW_LINE>}<NEW_LINE>triangle(x1 - tx, y1 + ty, x1 + tx, y1 - ty, x2 - tx, y2 + ty, color);<NEW_LINE>triangle(x2 + tx, y2 - ty, x2 - tx, y2 + ty, x1 + tx, y1 - ty, color);<NEW_LINE>if (r >= LINE_DETAIL_LIMIT && strokeCap == ROUND) {<NEW_LINE>int <MASK><NEW_LINE>float step = HALF_PI / segments;<NEW_LINE>float c = PApplet.cos(step);<NEW_LINE>float s = PApplet.sin(step);<NEW_LINE>for (int i = 0; i < segments; ++i) {<NEW_LINE>// this is the equivalent of multiplying the vector <tx, ty> by the 2x2 rotation matrix [[c -s] [s c]]<NEW_LINE>float nx = c * tx - s * ty;<NEW_LINE>float ny = s * tx + c * ty;<NEW_LINE>triangle(x2, y2, x2 + ty, y2 + tx, x2 + ny, y2 + nx, color);<NEW_LINE>triangle(x2, y2, x2 - tx, y2 + ty, x2 - nx, y2 + ny, color);<NEW_LINE>triangle(x1, y1, x1 - ty, y1 - tx, x1 - ny, y1 - nx, color);<NEW_LINE>triangle(x1, y1, x1 + tx, y1 - ty, x1 + nx, y1 - ny, color);<NEW_LINE>tx = nx;<NEW_LINE>ty = ny;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
segments = circleDetail(r, HALF_PI);
621,260
final ListAggregatedUtterancesResult executeListAggregatedUtterances(ListAggregatedUtterancesRequest listAggregatedUtterancesRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(listAggregatedUtterancesRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<ListAggregatedUtterancesRequest> request = null;<NEW_LINE>Response<ListAggregatedUtterancesResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new ListAggregatedUtterancesRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(listAggregatedUtterancesRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "Lex Models V2");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ListAggregatedUtterances");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<ListAggregatedUtterancesResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new ListAggregatedUtterancesResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
HandlerContextKey.SIGNING_REGION, getSigningRegion());
755,546
public void startBlock(String block) {<NEW_LINE>if (block.equals("paging")) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>Object node;<NEW_LINE>if (stack.size() == 0) {<NEW_LINE>if (root == null) {<NEW_LINE>root = "entry";<NEW_LINE>}<NEW_LINE>node = new Vector() {<NEW_LINE><NEW_LINE>public synchronized void addElement(Object obj) {<NEW_LINE>if (responseDestination != null) {<NEW_LINE>if (responseOffset == -1) {<NEW_LINE>responseDestination.addItem(obj);<NEW_LINE>} else {<NEW_LINE>Hashtable h = (Hashtable) responseDestination.getItemAt(responseOffset);<NEW_LINE>h<MASK><NEW_LINE>responseDestination.setItem(responseOffset, h);<NEW_LINE>responseOffset++;<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>super.addElement(obj);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>};<NEW_LINE>stack.addElement(node);<NEW_LINE>if (connectionType.length() > 0 || getUrl().indexOf("search") > 0) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>node = stack.elementAt(stack.size() - 1);<NEW_LINE>}<NEW_LINE>Hashtable data = new Hashtable();<NEW_LINE>if (node instanceof Hashtable) {<NEW_LINE>((Hashtable) node).put(block, data);<NEW_LINE>} else {<NEW_LINE>((Vector) node).addElement(data);<NEW_LINE>}<NEW_LINE>stack.addElement(data);<NEW_LINE>currentData = data;<NEW_LINE>}
.putAll((Hashtable) obj);
932,225
public XContentBuilder toXContent(XContentBuilder builder, Params params) throws IOException {<NEW_LINE>builder.startObject().startArray(TYPES_ALLOWED.getPreferredName());<NEW_LINE>for (String type : typesAllowed.stream().sorted().collect(Collectors.toList())) {<NEW_LINE>builder.value(type);<NEW_LINE>}<NEW_LINE>builder.endArray().<MASK><NEW_LINE>List<Map.Entry<String, Set<String>>> languagesByName = languageContexts.entrySet().stream().sorted(Map.Entry.comparingByKey()).collect(Collectors.toList());<NEW_LINE>for (Map.Entry<String, Set<String>> languageContext : languagesByName) {<NEW_LINE>builder.startObject().field(LANGUAGE.getPreferredName(), languageContext.getKey()).startArray(CONTEXTS.getPreferredName());<NEW_LINE>for (String context : languageContext.getValue().stream().sorted().collect(Collectors.toList())) {<NEW_LINE>builder.value(context);<NEW_LINE>}<NEW_LINE>builder.endArray().endObject();<NEW_LINE>}<NEW_LINE>return builder.endArray().endObject();<NEW_LINE>}
startArray(LANGUAGE_CONTEXTS.getPreferredName());
26,493
public static void testAlternating() {<NEW_LINE>System.out.println("Alternating case... universe = [0," + universe_size + ")");<NEW_LINE>RoaringBitmap r = new RoaringBitmap();<NEW_LINE>for (int i = 1; i < universe_size; i++) {<NEW_LINE>if (i % 2 == 0)<NEW_LINE>r.add(i);<NEW_LINE>}<NEW_LINE>System.out.println("Adding all even values in the universe");<NEW_LINE><MASK><NEW_LINE>System.out.println("Bits used per value = " + F.format(r.getSizeInBytes() * 8.0 / r.getCardinality()));<NEW_LINE>r.runOptimize();<NEW_LINE>System.out.println("Bits used per value after run optimize = " + F.format(r.getSizeInBytes() * 8.0 / r.getCardinality()));<NEW_LINE>System.out.println("An uncompressed bitset might use " + F.format(universe_size * 1.0 / r.getCardinality()) + " bits per value set");<NEW_LINE>System.out.println();<NEW_LINE>}
System.out.println("As a bitmap it would look like 01010101... ");
710,821
private Mono<Response<RemediationInner>> cancelAtSubscriptionWithResponseAsync(String remediationName, Context context) {<NEW_LINE>if (this.client.getEndpoint() == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (this.client.getSubscriptionId() == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (remediationName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter remediationName is required and cannot be null."));<NEW_LINE>}<NEW_LINE>final String apiVersion = "2021-10-01";<NEW_LINE>final String accept = "application/json";<NEW_LINE>context = <MASK><NEW_LINE>return service.cancelAtSubscription(this.client.getEndpoint(), this.client.getSubscriptionId(), remediationName, apiVersion, accept, context);<NEW_LINE>}
this.client.mergeContext(context);
691,447
public void queryAlertsForDetection() {<NEW_LINE>// BEGIN: readme-sample-listAnomaliesForAlert<NEW_LINE>String alertConfigurationId = "9ol48er30-6e6e-4391-b78f-b00dfee1e6f5";<NEW_LINE>final OffsetDateTime startTime = OffsetDateTime.parse("2020-01-01T00:00:00Z");<NEW_LINE>final OffsetDateTime endTime = OffsetDateTime.parse("2020-09-09T00:00:00Z");<NEW_LINE>metricsAdvisorClient.listAlerts(alertConfigurationId, startTime, endTime).forEach(alert -> {<NEW_LINE>System.out.printf("AnomalyAlert Id: %s%n", alert.getId());<NEW_LINE>System.out.printf("AnomalyAlert created on: %s%n", alert.getCreatedTime());<NEW_LINE>// List anomalies for returned alerts<NEW_LINE>metricsAdvisorClient.listAnomaliesForAlert(alertConfigurationId, alert.getId()).forEach(anomaly -> {<NEW_LINE>System.out.printf("DataPoint Anomaly was created on: %s%n", anomaly.getCreatedTime());<NEW_LINE>System.out.printf("DataPoint Anomaly severity: %s%n", anomaly.getSeverity().toString());<NEW_LINE>System.out.printf("DataPoint Anomaly status: %s%n", anomaly.getStatus());<NEW_LINE>System.out.printf("DataPoint Anomaly related series key: %s%n", anomaly.<MASK><NEW_LINE>});<NEW_LINE>});<NEW_LINE>// END: readme-sample-listAnomaliesForAlert<NEW_LINE>}
getSeriesKey().asMap());
890,432
public ReportSettings prepareReportSettings(StockMove stockMove, String format) throws AxelorException {<NEW_LINE>if (stockMove.getPrintingSettings() == null) {<NEW_LINE>throw new AxelorException(TraceBackRepository.CATEGORY_MISSING_FIELD, String.format(I18n.get(IExceptionMessage.STOCK_MOVES_MISSING_PRINTING_SETTINGS), stockMove<MASK><NEW_LINE>}<NEW_LINE>String locale = ReportSettings.getPrintingLocale(stockMove.getPartner());<NEW_LINE>String title = getFileName(stockMove);<NEW_LINE>ReportSettings reportSetting = ReportFactory.createReport(IReport.CONFORMITY_CERTIFICATE, title + " - ${date}");<NEW_LINE>return reportSetting.addParam("StockMoveId", stockMove.getId()).addParam("Timezone", stockMove.getCompany() != null ? stockMove.getCompany().getTimezone() : null).addParam("Locale", locale).addParam("HeaderHeight", stockMove.getPrintingSettings().getPdfHeaderHeight()).addParam("FooterHeight", stockMove.getPrintingSettings().getPdfFooterHeight()).addFormat(format);<NEW_LINE>}
.getStockMoveSeq()), stockMove);
1,537,011
public static DescribeLiveSnapshotConfigResponse unmarshall(DescribeLiveSnapshotConfigResponse describeLiveSnapshotConfigResponse, UnmarshallerContext _ctx) {<NEW_LINE>describeLiveSnapshotConfigResponse.setRequestId(_ctx.stringValue("DescribeLiveSnapshotConfigResponse.RequestId"));<NEW_LINE>describeLiveSnapshotConfigResponse.setPageNum(_ctx.integerValue("DescribeLiveSnapshotConfigResponse.PageNum"));<NEW_LINE>describeLiveSnapshotConfigResponse.setOrder(_ctx.stringValue("DescribeLiveSnapshotConfigResponse.Order"));<NEW_LINE>describeLiveSnapshotConfigResponse.setTotalPage<MASK><NEW_LINE>describeLiveSnapshotConfigResponse.setPageSize(_ctx.integerValue("DescribeLiveSnapshotConfigResponse.PageSize"));<NEW_LINE>describeLiveSnapshotConfigResponse.setTotalNum(_ctx.integerValue("DescribeLiveSnapshotConfigResponse.TotalNum"));<NEW_LINE>List<LiveStreamSnapshotConfig> liveStreamSnapshotConfigList = new ArrayList<LiveStreamSnapshotConfig>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("DescribeLiveSnapshotConfigResponse.LiveStreamSnapshotConfigList.Length"); i++) {<NEW_LINE>LiveStreamSnapshotConfig liveStreamSnapshotConfig = new LiveStreamSnapshotConfig();<NEW_LINE>liveStreamSnapshotConfig.setOverwriteOssObject(_ctx.stringValue("DescribeLiveSnapshotConfigResponse.LiveStreamSnapshotConfigList[" + i + "].OverwriteOssObject"));<NEW_LINE>liveStreamSnapshotConfig.setTimeInterval(_ctx.integerValue("DescribeLiveSnapshotConfigResponse.LiveStreamSnapshotConfigList[" + i + "].TimeInterval"));<NEW_LINE>liveStreamSnapshotConfig.setAppName(_ctx.stringValue("DescribeLiveSnapshotConfigResponse.LiveStreamSnapshotConfigList[" + i + "].AppName"));<NEW_LINE>liveStreamSnapshotConfig.setCreateTime(_ctx.stringValue("DescribeLiveSnapshotConfigResponse.LiveStreamSnapshotConfigList[" + i + "].CreateTime"));<NEW_LINE>liveStreamSnapshotConfig.setOssBucket(_ctx.stringValue("DescribeLiveSnapshotConfigResponse.LiveStreamSnapshotConfigList[" + i + "].OssBucket"));<NEW_LINE>liveStreamSnapshotConfig.setDomainName(_ctx.stringValue("DescribeLiveSnapshotConfigResponse.LiveStreamSnapshotConfigList[" + i + "].DomainName"));<NEW_LINE>liveStreamSnapshotConfig.setCallback(_ctx.stringValue("DescribeLiveSnapshotConfigResponse.LiveStreamSnapshotConfigList[" + i + "].Callback"));<NEW_LINE>liveStreamSnapshotConfig.setSequenceOssObject(_ctx.stringValue("DescribeLiveSnapshotConfigResponse.LiveStreamSnapshotConfigList[" + i + "].SequenceOssObject"));<NEW_LINE>liveStreamSnapshotConfig.setOssEndpoint(_ctx.stringValue("DescribeLiveSnapshotConfigResponse.LiveStreamSnapshotConfigList[" + i + "].OssEndpoint"));<NEW_LINE>liveStreamSnapshotConfigList.add(liveStreamSnapshotConfig);<NEW_LINE>}<NEW_LINE>describeLiveSnapshotConfigResponse.setLiveStreamSnapshotConfigList(liveStreamSnapshotConfigList);<NEW_LINE>return describeLiveSnapshotConfigResponse;<NEW_LINE>}
(_ctx.integerValue("DescribeLiveSnapshotConfigResponse.TotalPage"));
1,844,025
public void populateOnGround(World world, Random random, Chunk chunk) {<NEW_LINE>int sourceX = chunk.getX() << 4;<NEW_LINE>int sourceZ = chunk.getZ() << 4;<NEW_LINE>for (int i = 0; i < 7; i++) {<NEW_LINE>int x = <MASK><NEW_LINE>int z = sourceZ + random.nextInt(16);<NEW_LINE>int y = world.getHighestBlockYAt(x, z);<NEW_LINE>Block sourceBlock = world.getBlockAt(x, y, z);<NEW_LINE>BlockStateDelegate delegate = new BlockStateDelegate();<NEW_LINE>JungleBush bush = new JungleBush(random, delegate);<NEW_LINE>if (bush.generate(sourceBlock.getLocation())) {<NEW_LINE>delegate.updateBlockStates();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>super.populateOnGround(world, random, chunk);<NEW_LINE>melonDecorator.populate(world, random, chunk);<NEW_LINE>}
sourceX + random.nextInt(16);
601,432
public void write(org.apache.thrift.protocol.TProtocol prot, compactionCompleted_args struct) throws org.apache.thrift.TException {<NEW_LINE>org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot;<NEW_LINE>java.util.BitSet optionals = new java.util.BitSet();<NEW_LINE>if (struct.isSetTinfo()) {<NEW_LINE>optionals.set(0);<NEW_LINE>}<NEW_LINE>if (struct.isSetCredentials()) {<NEW_LINE>optionals.set(1);<NEW_LINE>}<NEW_LINE>if (struct.isSetExternalCompactionId()) {<NEW_LINE>optionals.set(2);<NEW_LINE>}<NEW_LINE>if (struct.isSetExtent()) {<NEW_LINE>optionals.set(3);<NEW_LINE>}<NEW_LINE>if (struct.isSetStats()) {<NEW_LINE>optionals.set(4);<NEW_LINE>}<NEW_LINE>oprot.writeBitSet(optionals, 5);<NEW_LINE>if (struct.isSetTinfo()) {<NEW_LINE>struct.tinfo.write(oprot);<NEW_LINE>}<NEW_LINE>if (struct.isSetCredentials()) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>if (struct.isSetExternalCompactionId()) {<NEW_LINE>oprot.writeString(struct.externalCompactionId);<NEW_LINE>}<NEW_LINE>if (struct.isSetExtent()) {<NEW_LINE>struct.extent.write(oprot);<NEW_LINE>}<NEW_LINE>if (struct.isSetStats()) {<NEW_LINE>struct.stats.write(oprot);<NEW_LINE>}<NEW_LINE>}
struct.credentials.write(oprot);
1,343,053
private void deleteIsomorphism() {<NEW_LINE>int[] compacted = new int[nextFreeCell - _removedCells];<NEW_LINE>int[] nodes = new int[_nodesToRemove.size() + 1];<NEW_LINE>int[] gains = new int[_nodesToRemove.size() + 1];<NEW_LINE>int idx = 1;<NEW_LINE>if (_nodesToRemove.isEmpty()) {<NEW_LINE>// If no equality detected, simply resize the array<NEW_LINE>System.arraycopy(mdd, 0, compacted, 0, nextFreeCell);<NEW_LINE>mdd = compacted;<NEW_LINE>} else {<NEW_LINE>int to, from = 0;<NEW_LINE>int gain = 0;<NEW_LINE>int[] keys = _nodesToRemove.keys();<NEW_LINE>Arrays.sort(keys);<NEW_LINE>// otherwise, iterate over nodes to remove<NEW_LINE>for (int k : keys) {<NEW_LINE>// node to remove<NEW_LINE>nodes[idx] = k;<NEW_LINE>to = nodes[idx] - nodes[idx - 1] - gain;<NEW_LINE>System.arraycopy(mdd, nodes[idx - 1] + <MASK><NEW_LINE>from += to;<NEW_LINE>gain = _nodesToRemove.get(k);<NEW_LINE>gains[idx] = gains[idx - 1] + gain;<NEW_LINE>idx++;<NEW_LINE>}<NEW_LINE>System.arraycopy(mdd, nodes[idx - 1] + gain, compacted, from, compacted.length - from);<NEW_LINE>for (int i = 0; i < compacted.length; i++) {<NEW_LINE>if (compacted[i] > EMPTY) {<NEW_LINE>compacted[i] -= gains[searchClosest(nodes, compacted[i])];<NEW_LINE>}<NEW_LINE>}<NEW_LINE>mdd = compacted;<NEW_LINE>nextFreeCell -= _removedCells;<NEW_LINE>}<NEW_LINE>}
gain, compacted, from, to);
1,795,586
private JComponent createButtonPanel() {<NEW_LINE>JPanel fileChooserPanel = new JPanel(new GridLayout(1, 0));<NEW_LINE>fileChooserPanel.<MASK><NEW_LINE>fileChooser = new JFileChooser();<NEW_LINE>final JButton chooseFileButton = new JButton("Open...");<NEW_LINE>chooseFileButton.addActionListener(new ActionListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void actionPerformed(ActionEvent arg0) {<NEW_LINE>int returnVal = fileChooser.showOpenDialog(ConstantQAudioPlayer.this);<NEW_LINE>if (returnVal == JFileChooser.APPROVE_OPTION) {<NEW_LINE>File file = fileChooser.getSelectedFile();<NEW_LINE>PlayerState currentState = player.getState();<NEW_LINE>player.load(file);<NEW_LINE>if (currentState == PlayerState.NO_FILE_LOADED || currentState == PlayerState.PLAYING) {<NEW_LINE>player.play();<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>// canceled<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>fileChooserPanel.add(chooseFileButton);<NEW_LINE>stopButton = new JButton("Stop");<NEW_LINE>fileChooserPanel.add(stopButton);<NEW_LINE>stopButton.addActionListener(new ActionListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void actionPerformed(ActionEvent arg0) {<NEW_LINE>player.stop();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>playButton = new JButton("Play");<NEW_LINE>playButton.addActionListener(new ActionListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void actionPerformed(ActionEvent arg0) {<NEW_LINE>player.play();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>fileChooserPanel.add(playButton);<NEW_LINE>pauzeButton = new JButton("Pauze");<NEW_LINE>pauzeButton.addActionListener(new ActionListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void actionPerformed(ActionEvent arg0) {<NEW_LINE>player.pauze();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>fileChooserPanel.add(pauzeButton);<NEW_LINE>return fileChooserPanel;<NEW_LINE>}
setBorder(new TitledBorder("Actions"));
1,087,193
// It's Map<Long, DataFlavor> actually, but javac complains if the type isn't erased...<NEW_LINE>@Override<NEW_LINE>protected void startDrag(Transferable trans, long[] formats, Map formatMap) {<NEW_LINE>activeDSContextPeer = this;<NEW_LINE>// NOTE: we ignore the formats[] and the formatMap altogether.<NEW_LINE>// AWT provides those to allow for more flexible representations of<NEW_LINE>// e.g. text data (in various formats, encodings, etc.) However, FX<NEW_LINE>// code isn't ready to handle those (e.g. it can't digest a<NEW_LINE>// StringReader as data, etc.) So instead we perform our internal<NEW_LINE>// translation.<NEW_LINE>// Note that fetchData == true. FX doesn't support delayed data<NEW_LINE>// callbacks yet anyway, so we have to fetch all the data from AWT upfront.<NEW_LINE><MASK><NEW_LINE>sourceActions = getDragSourceContext().getSourceActions();<NEW_LINE>// Release the FX nested loop to allow onDragDetected to start the actual DnD operation,<NEW_LINE>// and then start an AWT nested loop to wait until DnD finishes.<NEW_LINE>if (!FXDnD.fxAppThreadIsDispatchThread) {<NEW_LINE>loop = java.awt.Toolkit.getDefaultToolkit().getSystemEventQueue().createSecondaryLoop();<NEW_LINE>SwingNodeHelper.leaveFXNestedLoop(FXDnDInteropN.this);<NEW_LINE>if (!loop.enter()) {<NEW_LINE>// An error occured, but there's little we can do here...<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
transferable.updateData(trans, true);
330,265
public void extractKeyParts(final CacheKeyBuilder keyBuilder, final Object targetObject, final Object[] params) {<NEW_LINE><MASK><NEW_LINE>if (ctxObj == null) {<NEW_LINE>keyBuilder.setSkipCaching();<NEW_LINE>final CacheGetException ex = new CacheGetException("Got null context parameter.").setTargetObject(targetObject).setMethodArguments(params).setInvalidParameter(parameterIndex, ctxObj).setAnnotation(CacheCtx.class);<NEW_LINE>logger.warn("Got null context object. Skip caching", ex);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>Properties ctx = null;<NEW_LINE>boolean error = false;<NEW_LINE>Exception errorException = null;<NEW_LINE>if (isModel) {<NEW_LINE>try {<NEW_LINE>ctx = InterfaceWrapperHelper.getCtx(ctxObj);<NEW_LINE>} catch (final Exception ex) {<NEW_LINE>error = true;<NEW_LINE>errorException = ex;<NEW_LINE>}<NEW_LINE>} else if (ctxObj instanceof Properties) {<NEW_LINE>ctx = (Properties) ctxObj;<NEW_LINE>} else {<NEW_LINE>error = true;<NEW_LINE>}<NEW_LINE>if (error) {<NEW_LINE>keyBuilder.setSkipCaching();<NEW_LINE>final CacheGetException ex = new CacheGetException("Invalid parameter type.").addSuppressIfNotNull(errorException).setTargetObject(targetObject).setMethodArguments(params).setInvalidParameter(parameterIndex, ctxObj).setAnnotation(CacheCtx.class);<NEW_LINE>logger.warn("Invalid parameter type for @CacheCtx annotation. Skip caching.", ex);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final ArrayKey key = buildCacheKey(ctx);<NEW_LINE>keyBuilder.add(key);<NEW_LINE>}
final Object ctxObj = params[parameterIndex];
1,661,813
private void initHotkeys() {<NEW_LINE>// Don't change focus on TAB<NEW_LINE>setFocusTraversalKeys(KeyboardFocusManager.FORWARD_TRAVERSAL_KEYS, new HashSet<KeyStroke>());<NEW_LINE>final InputMap inputMap = this.getInputMap();<NEW_LINE>final ActionMap actionMap = getActionMap();<NEW_LINE>inputMap.put(KeyStroke.getKeyStroke(KeyEvent.VK_LEFT, 0), "LEFT");<NEW_LINE>actionMap.put("LEFT", m_leftAction);<NEW_LINE>inputMap.put(KeyStroke.getKeyStroke(KeyEvent.VK_LEFT, InputEvent.SHIFT_DOWN_MASK), "shift LEFT");<NEW_LINE><MASK><NEW_LINE>inputMap.put(KeyStroke.getKeyStroke(KeyEvent.VK_RIGHT, 0), "RIGHT");<NEW_LINE>actionMap.put("RIGHT", m_rightAction);<NEW_LINE>inputMap.put(KeyStroke.getKeyStroke(KeyEvent.VK_RIGHT, InputEvent.SHIFT_DOWN_MASK), "shift RIGHT");<NEW_LINE>actionMap.put("shift RIGHT", m_rightAction);<NEW_LINE>inputMap.put(KeyStroke.getKeyStroke(KeyEvent.VK_UP, 0), "UP");<NEW_LINE>actionMap.put("UP", m_upAction);<NEW_LINE>inputMap.put(KeyStroke.getKeyStroke(KeyEvent.VK_UP, InputEvent.SHIFT_DOWN_MASK), "shift UP");<NEW_LINE>actionMap.put("shift UP", m_upAction);<NEW_LINE>inputMap.put(KeyStroke.getKeyStroke(KeyEvent.VK_DOWN, 0), "DOWN");<NEW_LINE>actionMap.put("DOWN", m_downAction);<NEW_LINE>inputMap.put(KeyStroke.getKeyStroke(KeyEvent.VK_DOWN, InputEvent.SHIFT_DOWN_MASK), "shift DOWN");<NEW_LINE>actionMap.put("shift DOWN", m_downAction);<NEW_LINE>inputMap.put(KeyStroke.getKeyStroke(KeyEvent.VK_PAGE_DOWN, 0), "PAGE_DOWN");<NEW_LINE>actionMap.put("PAGE_DOWN", m_pageDownAction);<NEW_LINE>inputMap.put(KeyStroke.getKeyStroke(KeyEvent.VK_PAGE_DOWN, InputEvent.SHIFT_DOWN_MASK), "shift PAGE_DOWN");<NEW_LINE>actionMap.put("shift PAGE_DOWN", m_pageDownAction);<NEW_LINE>inputMap.put(KeyStroke.getKeyStroke(KeyEvent.VK_PAGE_UP, 0), "PAGE_UP");<NEW_LINE>actionMap.put("PAGE_UP", m_pageUpAction);<NEW_LINE>inputMap.put(KeyStroke.getKeyStroke(KeyEvent.VK_PAGE_UP, InputEvent.SHIFT_DOWN_MASK), "shift PAGE_UP");<NEW_LINE>actionMap.put("shift PAGE_UP", m_pageUpAction);<NEW_LINE>inputMap.put(KeyStroke.getKeyStroke(KeyEvent.VK_TAB, 0), "TAB");<NEW_LINE>actionMap.put("TAB", m_tabAction);<NEW_LINE>}
actionMap.put("shift LEFT", m_leftAction);
889,709
private Pair<Integer, Set<JMeterTreeNode>> searchInTree(GuiPackage guiPackage, Searcher searcher, String wordToSearch) {<NEW_LINE>int numberOfMatches = 0;<NEW_LINE>JMeterTreeModel jMeterTreeModel = guiPackage.getTreeModel();<NEW_LINE>Set<JMeterTreeNode> nodes = new LinkedHashSet<>();<NEW_LINE>for (JMeterTreeNode jMeterTreeNode : jMeterTreeModel.getNodesOfType(Searchable.class)) {<NEW_LINE>try {<NEW_LINE>Searchable searchable = (Searchable) jMeterTreeNode.getUserObject();<NEW_LINE>List<String> searchableTokens = searchable.getSearchableTokens();<NEW_LINE>boolean result = searcher.search(searchableTokens);<NEW_LINE>if (result) {<NEW_LINE>numberOfMatches++;<NEW_LINE>nodes.add(jMeterTreeNode);<NEW_LINE>}<NEW_LINE>} catch (Exception ex) {<NEW_LINE>logger.error("Error occurred searching for word:{} in node:{}", wordToSearch, jMeterTreeNode.getName(), ex);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>this.currentSearchIndex = -1;<NEW_LINE>this.lastSearchResult.clear();<NEW_LINE><MASK><NEW_LINE>return Pair.of(numberOfMatches, nodes);<NEW_LINE>}
this.lastSearchResult.addAll(nodes);
390,393
private static String simplifyModuleID(String candidateID, String fallbackExt) {<NEW_LINE>String moduleID = null;<NEW_LINE>if (candidateID == null) {<NEW_LINE>moduleID = "_default_" + fallbackExt;<NEW_LINE>} else if (candidateID.equals("")) {<NEW_LINE>moduleID = "_default_" + fallbackExt;<NEW_LINE>}<NEW_LINE>if (null == moduleID) {<NEW_LINE>moduleID = candidateID.replace(' ', '_');<NEW_LINE>if (moduleID.startsWith("/")) {<NEW_LINE>moduleID = moduleID.substring(1);<NEW_LINE>}<NEW_LINE>// This moduleID will be later used to construct file path,<NEW_LINE>// replace the illegal characters in file name<NEW_LINE>// \ / : * ? " < > | with _<NEW_LINE>moduleID = moduleID.replace('\\', '_'<MASK><NEW_LINE>moduleID = moduleID.replace('*', '_');<NEW_LINE>moduleID = moduleID.replace('?', '_').replace('"', '_');<NEW_LINE>moduleID = moduleID.replace('<', '_').replace('>', '_');<NEW_LINE>moduleID = moduleID.replace('|', '_');<NEW_LINE>// This moduleID will also be used to construct an ObjectName<NEW_LINE>// to register the module, so replace additional special<NEW_LINE>// characters , = used in property parsing with -<NEW_LINE>moduleID = moduleID.replace(',', '_').replace('=', '_');<NEW_LINE>}<NEW_LINE>return moduleID;<NEW_LINE>}
).replace('/', '_');
1,573,947
protected void onPostExecute(BitmapWithMetadata bitmapWithMetadata) {<NEW_LINE>if (bitmapWithMetadata != null) {<NEW_LINE><MASK><NEW_LINE>Log.d(LOG_TAG_DECODE_TASK, "Decoded image size: [" + bitmapWithMetadata.getBitmap().getWidth() + ", " + bitmapWithMetadata.getBitmap().getHeight() + "].");<NEW_LINE>decoded.add(bitmapWithMetadata);<NEW_LINE>Collections.sort(decoded, cmp);<NEW_LINE>if (decoded.size() > 3) {<NEW_LINE>Bitmap bitmap = decoded.remove(0).getBitmap();<NEW_LINE>display(bitmap);<NEW_LINE>available.add(bitmap);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>double delay = 0;<NEW_LINE>while (!decoded.isEmpty()) {<NEW_LINE>BitmapWithMetadata bitmap = decoded.remove(0);<NEW_LINE>worker.schedule(new DisplayTask(bitmap.getBitmap()), (int) (delay * 1000), TimeUnit.MILLISECONDS);<NEW_LINE>delay += bitmap.getDuration();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
new DecodeTask().execute();
574,968
private void referenceUnitDuty(Business business, WoIdentity woIdentity) throws Exception {<NEW_LINE>EntityManager em = business.entityManagerContainer().get(UnitDuty.class);<NEW_LINE>CriteriaBuilder cb = em.getCriteriaBuilder();<NEW_LINE>CriteriaQuery<UnitDuty> cq = cb.createQuery(UnitDuty.class);<NEW_LINE>Root<UnitDuty> root = cq.from(UnitDuty.class);<NEW_LINE>Predicate p = cb.isMember(woIdentity.getId(), root<MASK><NEW_LINE>List<UnitDuty> os = em.createQuery(cq.select(root).where(p)).getResultList().stream().distinct().collect(Collectors.toList());<NEW_LINE>List<WoUnitDuty> wos = WoUnitDuty.copier.copy(os);<NEW_LINE>wos = business.unitDuty().sort(wos);<NEW_LINE>for (WoUnitDuty woUnitDuty : wos) {<NEW_LINE>this.referenceUnit(business, woUnitDuty);<NEW_LINE>}<NEW_LINE>woIdentity.setWoUnitDutyList(wos);<NEW_LINE>}
.get(UnitDuty_.identityList));
1,095,204
private String PPVAL(final int index, final boolean showBinary) {<NEW_LINE>if (index >= getKeys().size())<NEW_LINE>return "-";<NEW_LINE>if (index > getKeys().capacity()) {<NEW_LINE>throw new RuntimeException("index=" + index + ", keys.size=" + getKeys().size() + ", keys.capacity=" + getKeys().capacity());<NEW_LINE>}<NEW_LINE>final byte[] key = <MASK><NEW_LINE>final String keyStr = showBinary ? BytesUtil.toString(key) + "(" + BytesUtil.toBitString(key) + ")" : BytesUtil.toString(key);<NEW_LINE>final String valStr;<NEW_LINE>if (false) /* showValues */<NEW_LINE>{<NEW_LINE>final long addr;<NEW_LINE>if (hasRawRecords()) {<NEW_LINE>addr = getRawRecord(index);<NEW_LINE>} else {<NEW_LINE>addr = IRawStore.NULL;<NEW_LINE>}<NEW_LINE>if (addr != IRawStore.NULL) {<NEW_LINE>// A raw record<NEW_LINE>valStr = "@" + htree.getStore().toString(addr);<NEW_LINE>} else {<NEW_LINE>final byte[] value = getValues().get(index);<NEW_LINE>valStr = BytesUtil.toString(value);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>valStr = null;<NEW_LINE>}<NEW_LINE>if (valStr == null) {<NEW_LINE>return keyStr;<NEW_LINE>}<NEW_LINE>return keyStr + "=>" + valStr;<NEW_LINE>}
getKeys().get(index);
1,428,035
public final void typeDefinitionStart() throws RecognitionException, TokenStreamException {<NEW_LINE>returnAST = null;<NEW_LINE>ASTPair currentAST = new ASTPair();<NEW_LINE>AST typeDefinitionStart_AST = null;<NEW_LINE>modifiersOpt();<NEW_LINE>{<NEW_LINE>switch(LA(1)) {<NEW_LINE>case LITERAL_class:<NEW_LINE>{<NEW_LINE>match(LITERAL_class);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>case LITERAL_interface:<NEW_LINE>{<NEW_LINE>match(LITERAL_interface);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>case LITERAL_enum:<NEW_LINE>{<NEW_LINE>match(LITERAL_enum);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>case LITERAL_trait:<NEW_LINE>{<NEW_LINE>match(LITERAL_trait);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>case AT:<NEW_LINE>{<NEW_LINE>AST tmp93_AST = null;<NEW_LINE>tmp93_AST = astFactory.create(LT(1));<NEW_LINE>match(AT);<NEW_LINE>match(LITERAL_interface);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>default:<NEW_LINE>{<NEW_LINE>throw new NoViableAltException(LT<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>returnAST = typeDefinitionStart_AST;<NEW_LINE>}
(1), getFilename());
178,347
protected String doInBackground(Void... params) {<NEW_LINE>try {<NEW_LINE>if (json_req == null)<NEW_LINE>return "Error creating the request!";<NEW_LINE>// check sdcard state<NEW_LINE>File root;<NEW_LINE>try {<NEW_LINE>root = AnyplaceUtils.getRadioMapFoler(ctx, mBuildID, mFloor_number);<NEW_LINE>} catch (Exception e) {<NEW_LINE>return e.getMessage();<NEW_LINE>}<NEW_LINE>// rename the radiomap according to the floor<NEW_LINE>String filename_radiomap_download = AnyplaceUtils.getRadioMapFileName(mFloor_number);<NEW_LINE>String mean_fname = filename_radiomap_download;<NEW_LINE>String rbf_weights_fname = mean_fname.replace(".txt", "-rbf-weights.txt");<NEW_LINE>String parameters_fname = mean_fname.replace(".txt", "-parameters.txt");<NEW_LINE>File okfile = new File(root, "ok.txt");<NEW_LINE>if (!mForceDonwload && okfile.exists()) {<NEW_LINE>success = true;<NEW_LINE>return "Successfully read radio map from cache!";<NEW_LINE>}<NEW_LINE>okfile.delete();<NEW_LINE>// changed in order to receive only the radio map for the<NEW_LINE>// current floor<NEW_LINE>String response = NetworkUtils.downloadHttpClientJsonPost(AnyplaceAPI.getRadioDownloadXY(), json_req);<NEW_LINE>JSONObject json = new JSONObject(response);<NEW_LINE>if (json.getString("status").equalsIgnoreCase("error")) {<NEW_LINE>return "Error Message: " + json.getString("message");<NEW_LINE>}<NEW_LINE>String means = json.getString("map_url_mean");<NEW_LINE>String parameters = json.getString("map_url_parameters");<NEW_LINE>String weights = json.getString("map_url_weights");<NEW_LINE>// create the credentials JSON in order to send and download the<NEW_LINE>// radio map<NEW_LINE>JSONObject json_credentials = new JSONObject();<NEW_LINE>json_credentials.put("username", "username");<NEW_LINE>json_credentials.put("password", "pass");<NEW_LINE>String cred_str = json_credentials.toString();<NEW_LINE>String ms = NetworkUtils.downloadHttpClientJsonPost(means, cred_str);<NEW_LINE>String ps = <MASK><NEW_LINE>String ws = NetworkUtils.downloadHttpClientJsonPost(weights, cred_str);<NEW_LINE>// check if the files downloaded correctly<NEW_LINE>if (ms.contains("error") || ps.contains("error") || ws.contains("error")) {<NEW_LINE>json = new JSONObject(response);<NEW_LINE>return "Error Message: " + json.getString("message");<NEW_LINE>}<NEW_LINE>FileWriter out;<NEW_LINE>out = new FileWriter(new File(root, rbf_weights_fname));<NEW_LINE>out.write(ws);<NEW_LINE>out.close();<NEW_LINE>out = new FileWriter(new File(root, parameters_fname));<NEW_LINE>out.write(ps);<NEW_LINE>out.close();<NEW_LINE>out = new FileWriter(new File(root, mean_fname));<NEW_LINE>out.write(ms);<NEW_LINE>out.close();<NEW_LINE>out = new FileWriter(okfile);<NEW_LINE>out.write("ok;version:0;");<NEW_LINE>out.close();<NEW_LINE>success = true;<NEW_LINE>return "Successfully saved radio maps!";<NEW_LINE>} catch (ConnectTimeoutException e) {<NEW_LINE>return "Connecting to Anyplace service is taking too long!";<NEW_LINE>} catch (SocketTimeoutException e) {<NEW_LINE>return "Communication with the server is taking too long!";<NEW_LINE>} catch (Exception e) {<NEW_LINE>return "Error downloading radio maps [ " + e.getMessage() + " ]";<NEW_LINE>}<NEW_LINE>}
NetworkUtils.downloadHttpClientJsonPost(parameters, cred_str);
202,493
public static void main(String[] args) {<NEW_LINE>Scanner sc = new Scanner(System.in);<NEW_LINE>int TC = sc.nextInt();<NEW_LINE>while (TC-- > 0) {<NEW_LINE>// these two values are not used<NEW_LINE>int xsize = sc.nextInt(), ysize = sc.nextInt();<NEW_LINE>int[] x = new int[11], y = new int[11];<NEW_LINE>x[0] = sc.nextInt();<NEW_LINE>y[0] = sc.nextInt();<NEW_LINE>n = sc.nextInt();<NEW_LINE>for (i = 1; i <= n; ++i) {<NEW_LINE>// karel's position is at index 0<NEW_LINE>x[i] = sc.nextInt();<NEW_LINE>y[<MASK><NEW_LINE>}<NEW_LINE>for (// build distance table<NEW_LINE>// build distance table<NEW_LINE>i = 0; // build distance table<NEW_LINE>i <= n; ++i) for (// Manhattan distance<NEW_LINE>j = i; // Manhattan distance<NEW_LINE>j <= n; // Manhattan distance<NEW_LINE>++j) dist[i][j] = dist[j][i] = Math.abs(x[i] - x[j]) + Math.abs(y[i] - y[j]);<NEW_LINE>for (i = 0; i < 11; ++i) for (j = 0; j < (1 << 11); ++j) memo[i][j] = -1;<NEW_LINE>// DP-TSP<NEW_LINE>System.out.printf("%d\n", dp(0, 1));<NEW_LINE>// System.out.printf("The shortest path has length %d\n", dp(0, 1)); // DP-TSP<NEW_LINE>}<NEW_LINE>}
i] = sc.nextInt();
1,258,492
public long insertMessageOutbox(long threadId, OutgoingTextMessage message, boolean forceSms, long date, InsertListener insertListener) {<NEW_LINE>SQLiteDatabase db = databaseHelper.getSignalWritableDatabase();<NEW_LINE>long type = Types.BASE_SENDING_TYPE;<NEW_LINE>if (message.isKeyExchange())<NEW_LINE>type |= Types.KEY_EXCHANGE_BIT;<NEW_LINE>else if (message.isSecureMessage())<NEW_LINE>type |= (Types.SECURE_MESSAGE_BIT | Types.PUSH_MESSAGE_BIT);<NEW_LINE>else if (message.isEndSession())<NEW_LINE>type |= Types.END_SESSION_BIT;<NEW_LINE>if (forceSms)<NEW_LINE>type |= Types.MESSAGE_FORCE_SMS_BIT;<NEW_LINE>if (message.isIdentityVerified())<NEW_LINE>type |= Types.KEY_EXCHANGE_IDENTITY_VERIFIED_BIT;<NEW_LINE>else if (message.isIdentityDefault())<NEW_LINE>type |= Types.KEY_EXCHANGE_IDENTITY_DEFAULT_BIT;<NEW_LINE>RecipientId recipientId = message.getRecipient().getId();<NEW_LINE>Map<RecipientId, EarlyReceiptCache.Receipt> earlyDeliveryReceipts = earlyDeliveryReceiptCache.remove(date);<NEW_LINE>ContentValues contentValues = new ContentValues(6);<NEW_LINE>contentValues.put(RECIPIENT_ID, recipientId.serialize());<NEW_LINE>contentValues.put(THREAD_ID, threadId);<NEW_LINE>contentValues.put(BODY, message.getMessageBody());<NEW_LINE>contentValues.put(DATE_RECEIVED, System.currentTimeMillis());<NEW_LINE>contentValues.put(DATE_SENT, date);<NEW_LINE>contentValues.put(READ, 1);<NEW_LINE>contentValues.put(TYPE, type);<NEW_LINE>contentValues.put(SUBSCRIPTION_ID, message.getSubscriptionId());<NEW_LINE>contentValues.put(EXPIRES_IN, message.getExpiresIn());<NEW_LINE>contentValues.put(DELIVERY_RECEIPT_COUNT, Stream.of(earlyDeliveryReceipts.values()).mapToLong(EarlyReceiptCache.Receipt::getCount).sum());<NEW_LINE>contentValues.put(RECEIPT_TIMESTAMP, Stream.of(earlyDeliveryReceipts.values()).mapToLong(EarlyReceiptCache.Receipt::getTimestamp).max().orElse(-1));<NEW_LINE>long messageId = db.insert(TABLE_NAME, null, contentValues);<NEW_LINE>if (insertListener != null) {<NEW_LINE>insertListener.onComplete();<NEW_LINE>}<NEW_LINE>if (!message.isIdentityVerified() && !message.isIdentityDefault()) {<NEW_LINE>SignalDatabase.threads().setLastScrolled(threadId, 0);<NEW_LINE>SignalDatabase.<MASK><NEW_LINE>}<NEW_LINE>SignalDatabase.threads().setHasSentSilently(threadId, true);<NEW_LINE>ApplicationDependencies.getDatabaseObserver().notifyMessageInsertObservers(threadId, new MessageId(messageId, false));<NEW_LINE>if (!message.isIdentityVerified() && !message.isIdentityDefault()) {<NEW_LINE>TrimThreadJob.enqueueAsync(threadId);<NEW_LINE>}<NEW_LINE>return messageId;<NEW_LINE>}
threads().setLastSeenSilently(threadId);
1,829,666
final ListTagsForResourceResult executeListTagsForResource(ListTagsForResourceRequest listTagsForResourceRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(listTagsForResourceRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<ListTagsForResourceRequest> request = null;<NEW_LINE>Response<ListTagsForResourceResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new ListTagsForResourceRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(listTagsForResourceRequest));<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, "codestar notifications");<NEW_LINE>request.<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<ListTagsForResourceResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new ListTagsForResourceResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
addHandlerContext(HandlerContextKey.OPERATION_NAME, "ListTagsForResource");
537,016
public boolean apply(Game game, Ability source) {<NEW_LINE>// Outcome.Benefit - AI will boost all the time (Feather choice)<NEW_LINE>// TODO: add AI hint logic in the choice method, see Tyrant's Choice as example<NEW_LINE>TwoChoiceVote vote = new TwoChoiceVote("Feather (+1/+1 counter)", "Quill (draw a card)", Outcome.Benefit);<NEW_LINE>vote.doVotes(source, game);<NEW_LINE>int <MASK><NEW_LINE>int quillCount = vote.getVoteCount(false);<NEW_LINE>Permanent permanent = source.getSourcePermanentIfItStillExists(game);<NEW_LINE>if (featherCount > 0 && permanent != null) {<NEW_LINE>permanent.addCounters(CounterType.P1P1.createInstance(featherCount), source.getControllerId(), source, game);<NEW_LINE>}<NEW_LINE>Player player = game.getPlayer(source.getControllerId());<NEW_LINE>if (quillCount > 0 && player != null) {<NEW_LINE>int drawn = player.drawCards(quillCount, source, game);<NEW_LINE>player.discard(drawn, false, false, source, game);<NEW_LINE>}<NEW_LINE>return featherCount + quillCount > 0;<NEW_LINE>}
featherCount = vote.getVoteCount(true);
376,745
private void storeCaches(final Set<String> geocodes, final Set<Integer> listIds) {<NEW_LINE>final <MASK><NEW_LINE>waitDialog = new ProgressDialog(activity);<NEW_LINE>waitDialog.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL);<NEW_LINE>waitDialog.setCancelable(true);<NEW_LINE>waitDialog.setCancelMessage(loadDetailsHandler.disposeMessage());<NEW_LINE>waitDialog.setMax(geocodes.size());<NEW_LINE>waitDialog.setOnCancelListener(arg0 -> {<NEW_LINE>try {<NEW_LINE>if (loadDetailsThread != null) {<NEW_LINE>loadDetailsThread.stopIt();<NEW_LINE>}<NEW_LINE>} catch (final Exception e) {<NEW_LINE>Log.e("CGeoMap.storeCaches.onCancel", e);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>final float etaTime = geocodes.size() * 7.0f / 60.0f;<NEW_LINE>final int roundedEta = Math.round(etaTime);<NEW_LINE>if (etaTime < 0.4) {<NEW_LINE>waitDialog.setMessage(res.getString(R.string.caches_downloading) + " " + res.getString(R.string.caches_eta_ltm));<NEW_LINE>} else {<NEW_LINE>waitDialog.setMessage(res.getString(R.string.caches_downloading) + " " + res.getQuantityString(R.plurals.caches_eta_mins, roundedEta, roundedEta));<NEW_LINE>}<NEW_LINE>waitDialog.show();<NEW_LINE>loadDetailsThread = new LoadDetails(loadDetailsHandler, geocodes, listIds);<NEW_LINE>loadDetailsThread.start();<NEW_LINE>}
LoadDetailsHandler loadDetailsHandler = new LoadDetailsHandler(this);
1,090,463
static boolean isClockwiseRing(MultiPathImpl polygon, int iring) {<NEW_LINE>int high_point_index = polygon.getHighestPointIndex(iring);<NEW_LINE>int path_start = polygon.getPathStart(iring);<NEW_LINE>int path_end = polygon.getPathEnd(iring);<NEW_LINE>Point2D q = polygon.getXY(high_point_index);<NEW_LINE>Point2D p, r;<NEW_LINE>if (high_point_index == path_start) {<NEW_LINE>p = polygon.getXY(path_end - 1);<NEW_LINE>r = polygon.getXY(path_start + 1);<NEW_LINE>} else if (high_point_index == path_end - 1) {<NEW_LINE>p = polygon.getXY(high_point_index - 1);<NEW_LINE><MASK><NEW_LINE>} else {<NEW_LINE>p = polygon.getXY(high_point_index - 1);<NEW_LINE>r = polygon.getXY(high_point_index + 1);<NEW_LINE>}<NEW_LINE>int orientation = Point2D.orientationRobust(p, q, r);<NEW_LINE>if (orientation == 0)<NEW_LINE>return polygon.calculateRingArea2D(iring) > 0.0;<NEW_LINE>return orientation == -1;<NEW_LINE>}
r = polygon.getXY(path_start);
331,761
private Set<Artifact> resolveArtifact(Artifact artifact, MavenParameters mavenParameters, PluginParameters pluginParameters, ConfigurationVersion configurationVersion) throws MojoFailureException {<NEW_LINE>notNull(mavenParameters.getLocalRepository(), "Maven parameter localRepository should be provided by maven container.");<NEW_LINE>notNull(mavenParameters.getRepoSystem(), "Maven parameter repoSystem should be provided by maven container.");<NEW_LINE>notNull(mavenParameters.getRepoSession(), "Maven parameter repoSession should be provided by maven container.");<NEW_LINE>ArtifactRequest request = new ArtifactRequest();<NEW_LINE>request.setArtifact(artifact);<NEW_LINE>request.setRepositories(mavenParameters.getRemoteRepos());<NEW_LINE>ArtifactResult resolutionResult = null;<NEW_LINE>try {<NEW_LINE>resolutionResult = mavenParameters.getRepoSystem().resolveArtifact(mavenParameters.getRepoSession(), request);<NEW_LINE>if (resolutionResult != null) {<NEW_LINE>if (resolutionResult.getExceptions() != null && !resolutionResult.getExceptions().isEmpty()) {<NEW_LINE>List<Exception> exceptions = resolutionResult.getExceptions();<NEW_LINE>for (Exception exception : exceptions) {<NEW_LINE>getLog().debug(<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (resolutionResult.isMissing()) {<NEW_LINE>if (ignoreMissingArtifact(pluginParameters, configurationVersion)) {<NEW_LINE>getLog().warn("Ignoring missing artifact " + request.getArtifact());<NEW_LINE>} else {<NEW_LINE>throw new MojoFailureException("Could not resolve artifact " + request.getArtifact());<NEW_LINE>}<NEW_LINE>return new HashSet<>();<NEW_LINE>}<NEW_LINE>return new HashSet<>(Collections.singletonList(resolutionResult.getArtifact()));<NEW_LINE>}<NEW_LINE>} catch (final ArtifactResolutionException e) {<NEW_LINE>if (ignoreMissingArtifact(pluginParameters, configurationVersion)) {<NEW_LINE>getLog().warn(e.getMessage());<NEW_LINE>} else {<NEW_LINE>throw new MojoFailureException(e.getMessage(), e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return new HashSet<>();<NEW_LINE>}
exception.getMessage(), exception);
307,747
private Mono<Response<Flux<ByteBuffer>>> createWithResponseAsync(String resourceGroupName, String monitorName, LogzMonitorResourceInner body, Context context) {<NEW_LINE>if (this.client.getEndpoint() == null) {<NEW_LINE>return Mono.<MASK><NEW_LINE>}<NEW_LINE>if (this.client.getSubscriptionId() == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (resourceGroupName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (monitorName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter monitorName is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (body != null) {<NEW_LINE>body.validate();<NEW_LINE>}<NEW_LINE>final String accept = "application/json";<NEW_LINE>context = this.client.mergeContext(context);<NEW_LINE>return service.create(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, monitorName, this.client.getApiVersion(), body, accept, context);<NEW_LINE>}
error(new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
1,123,144
public static void horizontal3(Kernel1D_F32 kernel, GrayF32 image, GrayF32 dest) {<NEW_LINE>final float[] dataSrc = image.data;<NEW_LINE>final float[] dataDst = dest.data;<NEW_LINE>final float k1 = kernel.data[0];<NEW_LINE>final float k2 = kernel.data[1];<NEW_LINE>final float k3 = kernel.data[2];<NEW_LINE>final int radius = kernel.getRadius();<NEW_LINE>final <MASK><NEW_LINE>// CONCURRENT_BELOW BoofConcurrency.loopFor(0, image.height, i -> {<NEW_LINE>for (int i = 0; i < image.height; i++) {<NEW_LINE>int indexDst = dest.startIndex + i * dest.stride + radius;<NEW_LINE>int j = image.startIndex + i * image.stride - radius;<NEW_LINE>final int jEnd = j + width - radius;<NEW_LINE>for (j += radius; j < jEnd; j++) {<NEW_LINE>int indexSrc = j;<NEW_LINE>float total = (dataSrc[indexSrc++]) * k1;<NEW_LINE>total += (dataSrc[indexSrc++]) * k2;<NEW_LINE>total += (dataSrc[indexSrc]) * k3;<NEW_LINE>dataDst[indexDst++] = total;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// CONCURRENT_ABOVE });<NEW_LINE>}
int width = image.getWidth();
1,626,315
public Table build() {<NEW_LINE>List<ColumnVector> columns = new ArrayList<>(types.size());<NEW_LINE>try {<NEW_LINE>for (int i = 0; i < types.size(); i++) {<NEW_LINE>DataType dataType = types.get(i);<NEW_LINE><MASK><NEW_LINE>Object dataArray = typeErasedData.get(i);<NEW_LINE>if (dtype.isNestedType()) {<NEW_LINE>if (dtype.equals(DType.LIST)) {<NEW_LINE>columns.add(fromLists(dataType, (Object[]) dataArray));<NEW_LINE>} else if (dtype.equals(DType.STRUCT)) {<NEW_LINE>columns.add(fromStructs(dataType, (StructData[]) dataArray));<NEW_LINE>} else {<NEW_LINE>throw new IllegalStateException("Unexpected nested type: " + dtype);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>columns.add(from(dtype, dataArray));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return new Table(columns.toArray(new ColumnVector[columns.size()]));<NEW_LINE>} finally {<NEW_LINE>for (ColumnVector cv : columns) {<NEW_LINE>cv.close();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
DType dtype = dataType.getType();
55,307
public void translate(final ITranslationEnvironment environment, final IInstruction instruction, final List<ReilInstruction> instructions) throws InternalTranslationException {<NEW_LINE>TranslationHelpers.checkTranslationArguments(environment, instruction, instructions, "crnand");<NEW_LINE>final IOperandTreeNode targetCRBit = instruction.getOperands().get(0).getRootNode().getChildren().get(0);<NEW_LINE>final IOperandTreeNode sourceCRBit1 = instruction.getOperands().get(1).getRootNode().getChildren().get(0);<NEW_LINE>final IOperandTreeNode sourceCRBit2 = instruction.getOperands().get(2).getRootNode().getChildren().get(0);<NEW_LINE>Long baseOffset = instruction.getAddress().toLong() * 0x100;<NEW_LINE>final OperandSize bt = OperandSize.BYTE;<NEW_LINE>final String tmpVar1 = environment.getNextVariableString();<NEW_LINE>instructions.add(ReilHelpers.createAnd(baseOffset++, bt, Helpers.getCRBit(Integer.decode(sourceCRBit1.getValue())), bt, Helpers.getCRBit(Integer.decode(sourceCRBit2.getValue()<MASK><NEW_LINE>instructions.add(ReilHelpers.createBisz(baseOffset++, bt, tmpVar1, bt, Helpers.getCRBit(Integer.decode(targetCRBit.getValue()))));<NEW_LINE>}
)), bt, tmpVar1));
1,386,329
@Path("/runningqueries")<NEW_LINE>public Response listRunningQueries() {<NEW_LINE>try {<NEW_LINE>int queriesWaitingCount = m_queuingManager.getQueryWaitingCount();<NEW_LINE>ArrayList<Pair<String, QueryMetric>> runningQueries = m_queuingManager.getRunningQueries();<NEW_LINE>JsonArray queryInfo = new JsonArray();<NEW_LINE>JsonObject responseJson = new JsonObject();<NEW_LINE>for (Pair<String, QueryMetric> query : runningQueries) {<NEW_LINE>JsonObject queryJson = new JsonObject();<NEW_LINE>String queryHash = query.getFirst();<NEW_LINE>QueryMetric queryMetric = query.getSecond();<NEW_LINE>queryJson.addProperty("query hash", queryHash);<NEW_LINE>queryJson.addProperty("metric name", queryMetric.getName());<NEW_LINE>queryJson.add(<MASK><NEW_LINE>queryInfo.add(queryJson);<NEW_LINE>}<NEW_LINE>responseJson.add("queries", queryInfo);<NEW_LINE>responseJson.addProperty("queries waiting", queriesWaitingCount);<NEW_LINE>logger.debug("Listing running queries.");<NEW_LINE>Response.ResponseBuilder responseBuilder = Response.status(Response.Status.OK).entity(responseJson.toString());<NEW_LINE>setHeaders(responseBuilder);<NEW_LINE>return responseBuilder.build();<NEW_LINE>} catch (Exception e) {<NEW_LINE>logger.error("Failed to get running queries.", e);<NEW_LINE>return setHeaders(Response.status(Response.Status.INTERNAL_SERVER_ERROR).entity(new ErrorResponse(e.getMessage()))).build();<NEW_LINE>}<NEW_LINE>}
"query JSON", queryMetric.getJsonObj());
1,262,324
final CreateNodeFromTemplateJobResult executeCreateNodeFromTemplateJob(CreateNodeFromTemplateJobRequest createNodeFromTemplateJobRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(createNodeFromTemplateJobRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<CreateNodeFromTemplateJobRequest> request = null;<NEW_LINE>Response<CreateNodeFromTemplateJobResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new CreateNodeFromTemplateJobRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(createNodeFromTemplateJobRequest));<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, "Panorama");<NEW_LINE>request.<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<CreateNodeFromTemplateJobResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new CreateNodeFromTemplateJobResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
addHandlerContext(HandlerContextKey.OPERATION_NAME, "CreateNodeFromTemplateJob");
1,581,028
public void marshall(Trail trail, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (trail == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(trail.getName(), NAME_BINDING);<NEW_LINE>protocolMarshaller.marshall(trail.getS3BucketName(), S3BUCKETNAME_BINDING);<NEW_LINE>protocolMarshaller.marshall(trail.getS3KeyPrefix(), S3KEYPREFIX_BINDING);<NEW_LINE>protocolMarshaller.marshall(trail.getSnsTopicName(), SNSTOPICNAME_BINDING);<NEW_LINE>protocolMarshaller.marshall(trail.getSnsTopicARN(), SNSTOPICARN_BINDING);<NEW_LINE>protocolMarshaller.marshall(trail.getIncludeGlobalServiceEvents(), INCLUDEGLOBALSERVICEEVENTS_BINDING);<NEW_LINE>protocolMarshaller.marshall(trail.getIsMultiRegionTrail(), ISMULTIREGIONTRAIL_BINDING);<NEW_LINE>protocolMarshaller.marshall(trail.getHomeRegion(), HOMEREGION_BINDING);<NEW_LINE>protocolMarshaller.marshall(trail.getTrailARN(), TRAILARN_BINDING);<NEW_LINE>protocolMarshaller.marshall(trail.getLogFileValidationEnabled(), LOGFILEVALIDATIONENABLED_BINDING);<NEW_LINE>protocolMarshaller.marshall(trail.getCloudWatchLogsLogGroupArn(), CLOUDWATCHLOGSLOGGROUPARN_BINDING);<NEW_LINE>protocolMarshaller.marshall(trail.getCloudWatchLogsRoleArn(), CLOUDWATCHLOGSROLEARN_BINDING);<NEW_LINE>protocolMarshaller.marshall(<MASK><NEW_LINE>protocolMarshaller.marshall(trail.getHasCustomEventSelectors(), HASCUSTOMEVENTSELECTORS_BINDING);<NEW_LINE>protocolMarshaller.marshall(trail.getHasInsightSelectors(), HASINSIGHTSELECTORS_BINDING);<NEW_LINE>protocolMarshaller.marshall(trail.getIsOrganizationTrail(), ISORGANIZATIONTRAIL_BINDING);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>}
trail.getKmsKeyId(), KMSKEYID_BINDING);
481,594
private void initComponents() {<NEW_LINE>// GEN-BEGIN:initComponents<NEW_LINE>java.awt.GridBagConstraints gridBagConstraints;<NEW_LINE>jLabel1 = new javax.swing.JLabel();<NEW_LINE>folderPanel = new javax.swing.JPanel();<NEW_LINE>setLayout(new java.awt.GridBagLayout());<NEW_LINE>getAccessibleContext().setAccessibleDescription(java.util.ResourceBundle.getBundle("org/netbeans/modules/web/jsf/dialogs/Bundle").getString("ACSD_BrowseFiles"));<NEW_LINE>setBorder(new javax.swing.border.EmptyBorder(new java.awt.Insets(12, 12, 12, 12)));<NEW_LINE>jLabel1.setText(org.openide.util.NbBundle.getMessage(BrowseFolders.class, "LBL_Folders"));<NEW_LINE>jLabel1.setDisplayedMnemonic(java.util.ResourceBundle.getBundle("org/netbeans/modules/web/jsf/dialogs/Bundle").getString("MNE_Folders").charAt(0));<NEW_LINE>gridBagConstraints = new java.awt.GridBagConstraints();<NEW_LINE>gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER;<NEW_LINE>gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;<NEW_LINE>gridBagConstraints.insets = new java.awt.Insets(0, 0, 2, 0);<NEW_LINE>add(jLabel1, gridBagConstraints);<NEW_LINE>folderPanel.setLayout(new java.awt.BorderLayout());<NEW_LINE>gridBagConstraints = new java.awt.GridBagConstraints();<NEW_LINE>gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER;<NEW_LINE>gridBagConstraints.gridheight <MASK><NEW_LINE>gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;<NEW_LINE>gridBagConstraints.weightx = 1.0;<NEW_LINE>gridBagConstraints.weighty = 1.0;<NEW_LINE>add(folderPanel, gridBagConstraints);<NEW_LINE>}
= java.awt.GridBagConstraints.REMAINDER;
686,921
public // }<NEW_LINE>GanttExportSettings createExportSettings() {<NEW_LINE>GanttExportSettings result = new GanttExportSettings();<NEW_LINE>if (myRootPreferences != null) {<NEW_LINE>String exportRange = myRootPreferences.get("exportRange", null);<NEW_LINE>if (exportRange == null) {<NEW_LINE>result.setStartDate(myExportRangeStart.getValue());<NEW_LINE>result.setEndDate(myExportRangeEnd.getValue());<NEW_LINE>} else {<NEW_LINE>String[] <MASK><NEW_LINE>try {<NEW_LINE>result.setStartDate(DateParser.parse(rangeBounds[0]));<NEW_LINE>result.setEndDate(DateParser.parse(rangeBounds[1]));<NEW_LINE>} catch (InvalidDateException e) {<NEW_LINE>GPLogger.log(e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>result.setCommandLineMode(myRootPreferences.getBoolean("commandLine", false));<NEW_LINE>if (myRootPreferences.getBoolean("expandResources", false)) {<NEW_LINE>result.setExpandedResources("");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>}
rangeBounds = exportRange.split(" ");
254,649
private void action_loadBOM() {<NEW_LINE>// m_frame.setBusy(true);<NEW_LINE>m_frame.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));<NEW_LINE>reload = false;<NEW_LINE>int M_Product_ID = getM_Product_ID();<NEW_LINE>if (M_Product_ID == 0)<NEW_LINE>return;<NEW_LINE>MProduct M_Product = MProduct.get(getCtx(), M_Product_ID);<NEW_LINE>treeInfo.setText(" Current Selection: " + M_Product.getValue());<NEW_LINE>Vector<Object> line = new Vector<Object>(17);<NEW_LINE>// 0 Select<NEW_LINE>line.add(new Boolean(false));<NEW_LINE>// 1 IsActive<NEW_LINE>line.add(new Boolean<MASK><NEW_LINE>// 2 Line<NEW_LINE>line.add(new Integer(0));<NEW_LINE>KeyNamePair pp = new KeyNamePair(M_Product.getM_Product_ID(), M_Product.getValue().concat("_").concat(M_Product.getName()));<NEW_LINE>// 3 M_Product_ID<NEW_LINE>line.add(pp);<NEW_LINE>MUOM u = new MUOM(M_Product.getCtx(), M_Product.getC_UOM_ID(), M_Product.get_TrxName());<NEW_LINE>KeyNamePair uom = new KeyNamePair(M_Product.getC_UOM_ID(), u.getUOMSymbol());<NEW_LINE>// 4 C_UOM_ID<NEW_LINE>line.add(uom);<NEW_LINE>// 5 QtyBOM<NEW_LINE>line.add(Env.ONE);<NEW_LINE>DefaultMutableTreeNode parent = new DefaultMutableTreeNode(line);<NEW_LINE>m_root = (DefaultMutableTreeNode) parent.getRoot();<NEW_LINE>dataBOM.clear();<NEW_LINE>if (isImplosion()) {<NEW_LINE>for (MProductBOM bomline : getParentBOMs(M_Product_ID)) {<NEW_LINE>addParent(bomline, parent);<NEW_LINE>}<NEW_LINE>m_tree = new myJTree(parent);<NEW_LINE>m_tree.addMouseListener(mouseListener);<NEW_LINE>} else {<NEW_LINE>for (MProductBOM bom : getChildBOMs(M_Product_ID, true)) {<NEW_LINE>addChild(bom, parent);<NEW_LINE>}<NEW_LINE>m_tree = new myJTree(parent);<NEW_LINE>m_tree.addMouseListener(mouseListener);<NEW_LINE>}<NEW_LINE>m_tree.addTreeSelectionListener(this);<NEW_LINE>treePane.getViewport().add(m_tree, null);<NEW_LINE>loadTableBOM();<NEW_LINE>dataPane.getViewport().add(tableBOM, null);<NEW_LINE>// 4Layers - Set divider location<NEW_LINE>splitPane.setDividerLocation(DIVIDER_LOCATION);<NEW_LINE>// 4Layers - end<NEW_LINE>// Popup<NEW_LINE>// if (m_selected_id != 0)<NEW_LINE>// {<NEW_LINE>// }<NEW_LINE>// m_frame.setBusy(false);<NEW_LINE>m_frame.setCursor(Cursor.getDefaultCursor());<NEW_LINE>}
(M_Product.isActive()));
526,216
private void checkCallDestroyed(long chatId, long callId, int endCallReason, boolean isIgnored) {<NEW_LINE>getChatManagement().setOpeningMeetingLink(chatId, false);<NEW_LINE>if (shouldNotify(this)) {<NEW_LINE>toSystemSettingNotification(this);<NEW_LINE>}<NEW_LINE>if (wakeLock != null && wakeLock.isHeld()) {<NEW_LINE>wakeLock.release();<NEW_LINE>}<NEW_LINE>getChatManagement().removeNotificationShown(chatId);<NEW_LINE>try {<NEW_LINE>if (endCallReason == MegaChatCall.END_CALL_REASON_NO_ANSWER && !isIgnored) {<NEW_LINE>MegaChatRoom chatRoom = megaChatApi.getChatRoom(chatId);<NEW_LINE>if (chatRoom != null && !chatRoom.isGroup() && !chatRoom.isMeeting() && megaApi.isChatNotifiable(chatId)) {<NEW_LINE>try {<NEW_LINE>logDebug("Show missed call notification");<NEW_LINE>ChatAdvancedNotificationBuilder notificationBuilder = ChatAdvancedNotificationBuilder.newInstance(this, megaApi, megaChatApi);<NEW_LINE><MASK><NEW_LINE>} catch (Exception e) {<NEW_LINE>logError("EXCEPTION when showing missed call notification", e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>logError("EXCEPTION when showing missed call notification", e);<NEW_LINE>}<NEW_LINE>}
notificationBuilder.showMissedCallNotification(chatId, callId);
291,373
public void onReceive(final Context context, Intent intent) {<NEW_LINE>if (null == context || null == intent)<NEW_LINE>return;<NEW_LINE>final Long id = intent.getLongExtra(KEXTRA_ID, 0);<NEW_LINE>final Integer pid = intent.getIntExtra(KEXTRA_PID, 0);<NEW_LINE>if (0 == id || 0 == pid)<NEW_LINE>return;<NEW_LINE>if (pid != Process.myPid()) {<NEW_LINE>Log.w(TAG, "onReceive id:%d, pid:%d, mypid:%d", id, pid, Process.myPid());<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>boolean found = false;<NEW_LINE>synchronized (alarm_waiting_set) {<NEW_LINE>Iterator<Object[]> it = alarm_waiting_set.iterator();<NEW_LINE>while (it.hasNext()) {<NEW_LINE>Object[<MASK><NEW_LINE>Long curId = (Long) next[TSetData.ID.ordinal()];<NEW_LINE>Log.i(TAG, "onReceive id=%d, curId=%d", id, curId);<NEW_LINE>if (curId.equals(id)) {<NEW_LINE>Log.i(TAG, "onReceive find alarm id:%d, pid:%d, delta miss time:%d", id, pid, SystemClock.elapsedRealtime() - (Long) next[TSetData.WAITTIME.ordinal()]);<NEW_LINE>it.remove();<NEW_LINE>found = true;<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (!found)<NEW_LINE>Log.e(TAG, "onReceive not found id:%d, pid:%d, alarm_waiting_set.size:%d", id, pid, alarm_waiting_set.size());<NEW_LINE>}<NEW_LINE>if (null != wakerlock)<NEW_LINE>wakerlock.lock(200);<NEW_LINE>if (found)<NEW_LINE>onAlarm(id);<NEW_LINE>}
] next = it.next();
491,553
public Object doGetDataFromControllerByName(String name) {<NEW_LINE>Controller controller = JbootControllerContext.get();<NEW_LINE>if (name.contains(".")) {<NEW_LINE>String[] modelAndAttr = name.split("\\.");<NEW_LINE>String modelName = modelAndAttr[0];<NEW_LINE>String attr = modelAndAttr[1];<NEW_LINE>Object object = controller.getAttr(modelName);<NEW_LINE>if (object == null) {<NEW_LINE>return null;<NEW_LINE>} else if (object instanceof Model) {<NEW_LINE>return ((Model) object).get(attr);<NEW_LINE>} else if (object instanceof Map) {<NEW_LINE>return ((Map) object).get(attr);<NEW_LINE>} else {<NEW_LINE>try {<NEW_LINE>Method method = object.getClass().getMethod("get" <MASK><NEW_LINE>return method.invoke(object);<NEW_LINE>} catch (Exception e) {<NEW_LINE>e.printStackTrace();<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>return controller.getAttr(name);<NEW_LINE>}<NEW_LINE>}
+ StrKit.firstCharToUpperCase(attr));
1,190,384
public int compare(final LoadedRow x, final LoadedRow y) {<NEW_LINE>for (final SortedField t : this.sort.getSortOrder()) {<NEW_LINE>final int index = t.getIndex();<NEW_LINE>final String xStr = x.getData()[index];<NEW_LINE>final String yStr = <MASK><NEW_LINE>switch(t.getSortType()) {<NEW_LINE>case SortDecimal:<NEW_LINE>final double xDouble = this.sort.getFormat().parse(xStr);<NEW_LINE>final double yDouble = this.sort.getFormat().parse(yStr);<NEW_LINE>final int c = Double.compare(xDouble, yDouble);<NEW_LINE>if (c != 0) {<NEW_LINE>return c;<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>case SortInteger:<NEW_LINE>final int xInteger = Integer.parseInt(xStr);<NEW_LINE>final int yInteger = Integer.parseInt(yStr);<NEW_LINE>final int c2 = xInteger - yInteger;<NEW_LINE>if (c2 != 0) {<NEW_LINE>return c2;<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>case SortString:<NEW_LINE>final int c3 = xStr.compareTo(yStr);<NEW_LINE>if (c3 != 0) {<NEW_LINE>return c3;<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>throw new QuantError("Unknown sort method: " + t.getSortType());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// failing all of this, they are equal<NEW_LINE>return 0;<NEW_LINE>}
y.getData()[index];
1,571,815
public boolean isValidForSlot(Slot s, ItemStack is) {<NEW_LINE>final ItemStack top = getHost().getInternalInventory().getStackInSlot(0);<NEW_LINE>final ItemStack bot = getHost().getInternalInventory().getStackInSlot(1);<NEW_LINE>if (s == this.middle) {<NEW_LINE>ItemDefinition<MASK><NEW_LINE>if (press.isSameAs(top) || press.isSameAs(bot)) {<NEW_LINE>return !press.isSameAs(is);<NEW_LINE>}<NEW_LINE>return InscriberRecipes.findRecipe(getHost().getLevel(), is, top, bot, false) != null;<NEW_LINE>} else if (s == this.top && !bot.isEmpty() || s == this.bottom && !top.isEmpty()) {<NEW_LINE>ItemStack otherSlot;<NEW_LINE>if (s == this.top) {<NEW_LINE>otherSlot = this.bottom.getItem();<NEW_LINE>} else {<NEW_LINE>otherSlot = this.top.getItem();<NEW_LINE>}<NEW_LINE>// name presses<NEW_LINE>ItemDefinition<?> namePress = AEItems.NAME_PRESS;<NEW_LINE>if (namePress.isSameAs(otherSlot)) {<NEW_LINE>return namePress.isSameAs(is);<NEW_LINE>}<NEW_LINE>// everything else<NEW_LINE>// test for a partial recipe match (ignoring the middle slot)<NEW_LINE>return InscriberRecipes.isValidOptionalIngredientCombination(getHost().getLevel(), is, otherSlot);<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>}
<?> press = AEItems.NAME_PRESS;
362,152
public com.tencent.mars.sample.chat.proto.Messagepush.MessagePush buildPartial() {<NEW_LINE>com.tencent.mars.sample.chat.proto.Messagepush.MessagePush result = new com.tencent.mars.sample.chat.<MASK><NEW_LINE>int from_bitField0_ = bitField0_;<NEW_LINE>int to_bitField0_ = 0;<NEW_LINE>if (((from_bitField0_ & 0x00000001) == 0x00000001)) {<NEW_LINE>to_bitField0_ |= 0x00000001;<NEW_LINE>}<NEW_LINE>result.topic_ = topic_;<NEW_LINE>if (((from_bitField0_ & 0x00000002) == 0x00000002)) {<NEW_LINE>to_bitField0_ |= 0x00000002;<NEW_LINE>}<NEW_LINE>result.content_ = content_;<NEW_LINE>if (((from_bitField0_ & 0x00000004) == 0x00000004)) {<NEW_LINE>to_bitField0_ |= 0x00000004;<NEW_LINE>}<NEW_LINE>result.from_ = from_;<NEW_LINE>result.bitField0_ = to_bitField0_;<NEW_LINE>onBuilt();<NEW_LINE>return result;<NEW_LINE>}
proto.Messagepush.MessagePush(this);
197,449
final DescribeDimensionResult executeDescribeDimension(DescribeDimensionRequest describeDimensionRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(describeDimensionRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DescribeDimensionRequest> request = null;<NEW_LINE>Response<DescribeDimensionResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DescribeDimensionRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(describeDimensionRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "IoT");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DescribeDimension");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DescribeDimensionResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DescribeDimensionResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());
253,986
public String format(long timestamp) {<NEW_LINE>// If the format is unknown, use the default formatter.<NEW_LINE>if (invalidFormat) {<NEW_LINE>return formatter.format(timestamp);<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>long delta = timestamp - refTimestamp;<NEW_LINE>sb.setLength(0);<NEW_LINE>// If we need to reformat<NEW_LINE>if (delta >= pdiff || delta < ndiff) {<NEW_LINE>refTimestamp = timestamp;<NEW_LINE>formatter.format(timestamp, sb, position);<NEW_LINE>refMilli = Long.parseLong(sb.substring(position.getBeginIndex()<MASK><NEW_LINE>refBeginning = sb.substring(0, position.getBeginIndex());<NEW_LINE>refEnding = sb.substring(position.getEndIndex());<NEW_LINE>pdiff = 1000 - refMilli;<NEW_LINE>ndiff = -refMilli;<NEW_LINE>return sb.toString();<NEW_LINE>} else {<NEW_LINE>long newMilli = delta + refMilli;<NEW_LINE>if (newMilli >= 100)<NEW_LINE>sb.append(refBeginning).append(newMilli).append(refEnding);<NEW_LINE>else if (newMilli >= 10)<NEW_LINE>sb.append(refBeginning).append('0').append(newMilli).append(refEnding);<NEW_LINE>else<NEW_LINE>sb.append(refBeginning).append("00").append(newMilli).append(refEnding);<NEW_LINE>return sb.toString();<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>// Throw FFDC in case anything goes wrong<NEW_LINE>// Still generate the date via the SimpleDateFormat<NEW_LINE>invalidFormat = true;<NEW_LINE>sb = null;<NEW_LINE>return formatter.format(timestamp);<NEW_LINE>}<NEW_LINE>}
, position.getEndIndex()));
1,845,908
private void validate(String name, Map<String, Object> parsed, Map<String, ConfigValue> configs) {<NEW_LINE>if (!_configKeys.containsKey(name)) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>ConfigKey key = _configKeys.get(name);<NEW_LINE>ConfigValue value = configs.get(name);<NEW_LINE>if (key._recommender != null) {<NEW_LINE>try {<NEW_LINE>List<Object> recommendedValues = key._recommender.validValues(name, parsed);<NEW_LINE>List<Object> originalRecommendedValues = value.recommendedValues();<NEW_LINE>if (!originalRecommendedValues.isEmpty()) {<NEW_LINE>Set<Object> originalRecommendedValueSet <MASK><NEW_LINE>recommendedValues.removeIf(o -> !originalRecommendedValueSet.contains(o));<NEW_LINE>}<NEW_LINE>value.recommendedValues(recommendedValues);<NEW_LINE>value.visible(key._recommender.visible(name, parsed));<NEW_LINE>} catch (ConfigException e) {<NEW_LINE>value.addErrorMessage(e.getMessage());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>configs.put(name, value);<NEW_LINE>for (String dependent : key._dependents) {<NEW_LINE>validate(dependent, parsed, configs);<NEW_LINE>}<NEW_LINE>}
= new HashSet<>(originalRecommendedValues);
302,821
final ListRuleNamesByTargetResult executeListRuleNamesByTarget(ListRuleNamesByTargetRequest listRuleNamesByTargetRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(listRuleNamesByTargetRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE><MASK><NEW_LINE>Request<ListRuleNamesByTargetRequest> request = null;<NEW_LINE>Response<ListRuleNamesByTargetResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new ListRuleNamesByTargetRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(listRuleNamesByTargetRequest));<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, "EventBridge");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ListRuleNamesByTarget");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<ListRuleNamesByTargetResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new ListRuleNamesByTargetResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
658,455
public static FeedbackResponseCommentAttributes valueOf(FeedbackResponseComment comment) {<NEW_LINE>FeedbackResponseCommentAttributes frca = new FeedbackResponseCommentAttributes();<NEW_LINE>frca.courseId = comment.getCourseId();<NEW_LINE>frca.feedbackSessionName = comment.getFeedbackSessionName();<NEW_LINE>frca.commentGiver = comment.getGiverEmail();<NEW_LINE>frca.commentText = comment.getCommentText();<NEW_LINE>frca.feedbackResponseId = comment.getFeedbackResponseId();<NEW_LINE>frca.feedbackQuestionId = comment.getFeedbackQuestionId();<NEW_LINE>if (comment.getShowCommentTo() != null) {<NEW_LINE>frca.showCommentTo = new ArrayList<>(comment.getShowCommentTo());<NEW_LINE>}<NEW_LINE>if (comment.getShowGiverNameTo() != null) {<NEW_LINE>frca.showGiverNameTo = new ArrayList<>(comment.getShowGiverNameTo());<NEW_LINE>}<NEW_LINE>frca.isVisibilityFollowingFeedbackQuestion = comment.getIsVisibilityFollowingFeedbackQuestion();<NEW_LINE>if (comment.getCreatedAt() != null) {<NEW_LINE>frca.createdAt = comment.getCreatedAt();<NEW_LINE>}<NEW_LINE>if (comment.getLastEditorEmail() == null) {<NEW_LINE>frca<MASK><NEW_LINE>} else {<NEW_LINE>frca.lastEditorEmail = comment.getLastEditorEmail();<NEW_LINE>}<NEW_LINE>if (comment.getLastEditedAt() == null) {<NEW_LINE>frca.lastEditedAt = frca.getCreatedAt();<NEW_LINE>} else {<NEW_LINE>frca.lastEditedAt = comment.getLastEditedAt();<NEW_LINE>}<NEW_LINE>frca.feedbackResponseCommentId = comment.getFeedbackResponseCommentId();<NEW_LINE>if (comment.getGiverSection() != null) {<NEW_LINE>frca.giverSection = comment.getGiverSection();<NEW_LINE>}<NEW_LINE>if (comment.getReceiverSection() != null) {<NEW_LINE>frca.receiverSection = comment.getReceiverSection();<NEW_LINE>}<NEW_LINE>frca.commentGiverType = comment.getCommentGiverType();<NEW_LINE>frca.isCommentFromFeedbackParticipant = comment.getIsCommentFromFeedbackParticipant();<NEW_LINE>return frca;<NEW_LINE>}
.lastEditorEmail = frca.getCommentGiver();
1,682,018
public List<byte[]> sendBatch(String streamName, List<byte[]> data) {<NEW_LINE>if (data == null || data.isEmpty()) {<NEW_LINE>return Collections.emptyList();<NEW_LINE>}<NEW_LINE>final PutRecordsRequest request = new PutRecordsRequest();<NEW_LINE>request.setStreamName(streamName);<NEW_LINE>final List<PutRecordsRequestEntry> records = new ArrayList<PutRecordsRequestEntry>(data.size());<NEW_LINE>for (final byte[] d : data) {<NEW_LINE>final String partKey = StringUtils.isBlank(this.partitionKey) ? UUID.randomUUID().toString() : this.partitionKey;<NEW_LINE>final PutRecordsRequestEntry r = new PutRecordsRequestEntry();<NEW_LINE>r.setData(ByteBuffer.wrap(d));<NEW_LINE>r.setPartitionKey(partKey);<NEW_LINE>records.add(r);<NEW_LINE>}<NEW_LINE>request.setRecords(records);<NEW_LINE>request.<MASK><NEW_LINE>final PutRecordsResult result = client.putRecords(request);<NEW_LINE>final int size = result.getRecords().size();<NEW_LINE>final List<byte[]> failures = new ArrayList<byte[]>(result.getFailedRecordCount());<NEW_LINE>for (int i = 0; i < size; i++) {<NEW_LINE>if (result.getRecords().get(i).getErrorCode() != null) {<NEW_LINE>// always retry failed record<NEW_LINE>failures.add(data.get(i));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return failures;<NEW_LINE>}
getRequestClientOptions().appendUserAgent(userAgent);
1,675,801
private void completeParseSingular(@NotNull final CommandSender sender, @NotNull @Unmodifiable final List<String> params, @NotNull final List<String> suggestions) {<NEW_LINE>if (params.size() <= 1) {<NEW_LINE>if (sender instanceof Player && (params.isEmpty() || "me".startsWith(params.get(0).toLowerCase(Locale.ROOT)))) {<NEW_LINE>suggestions.add("me");<NEW_LINE>}<NEW_LINE>if ("--null".startsWith(params.get(0).toLowerCase(Locale.ROOT))) {<NEW_LINE>suggestions.add("--null");<NEW_LINE>}<NEW_LINE>final Stream<String> names = Bukkit.getOnlinePlayers().stream().map(Player::getName);<NEW_LINE>suggestByParameter(names, suggestions, params.isEmpty() ? null : params.get(0));<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final String name = params.get(params.size() - 1);<NEW_LINE>if (!name.startsWith("%") || name.endsWith("%")) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final int index = name.indexOf('_');<NEW_LINE>if (index == -1) {<NEW_LINE>// no arguments supplied yet<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final PlaceholderExpansion expansion = PlaceholderAPIPlugin.getInstance().getLocalExpansionManager().findExpansionByIdentifier(name.substring(1, index)).orElse(null);<NEW_LINE>if (expansion == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final Set<String> possible = new HashSet<>(expansion.getPlaceholders());<NEW_LINE>PlaceholderAPIPlugin.getInstance().getCloudExpansionManager().findCloudExpansionByName(expansion.getName()).ifPresent(cloud -> possible.addAll<MASK><NEW_LINE>suggestByParameter(possible.stream(), suggestions, params.get(params.size() - 1));<NEW_LINE>}
(cloud.getPlaceholders()));
1,327,773
public void tokenize(final SourceCode sourceCode, final Tokens tokenEntries) {<NEW_LINE>final AntlrTokenManager tokenManager = getLexerForSource(sourceCode);<NEW_LINE>tokenManager.setFileName(sourceCode.getFileName());<NEW_LINE><MASK><NEW_LINE>try {<NEW_LINE>AntlrToken currentToken = tokenFilter.getNextToken();<NEW_LINE>while (currentToken != null) {<NEW_LINE>processToken(tokenEntries, tokenManager.getFileName(), currentToken);<NEW_LINE>currentToken = tokenFilter.getNextToken();<NEW_LINE>}<NEW_LINE>} catch (final AntlrTokenManager.ANTLRSyntaxError err) {<NEW_LINE>// Wrap exceptions of the ANTLR tokenizer in a TokenMgrError, so they are correctly handled<NEW_LINE>// when CPD is executed with the '--skipLexicalErrors' command line option<NEW_LINE>throw new TokenMgrError(err.getLine(), err.getColumn(), tokenManager.getFileName(), err.getMessage(), err.getCause());<NEW_LINE>} finally {<NEW_LINE>tokenEntries.add(TokenEntry.getEOF());<NEW_LINE>}<NEW_LINE>}
final AntlrTokenFilter tokenFilter = getTokenFilter(tokenManager);
1,049,946
public void ariseAlert(final int serverId, final AlertPack alert) {<NEW_LINE>ExUtil.exec(table, new Runnable() {<NEW_LINE><NEW_LINE>public void run() {<NEW_LINE>while (table.getItemCount() > 500) {<NEW_LINE>table.remove(table.getItemCount() - 1);<NEW_LINE>}<NEW_LINE>AlertData data = new AlertData(serverId, alert);<NEW_LINE>TableItem t = new TableItem(table, SWT.NONE, 0);<NEW_LINE>t.setText(new String[] { //<NEW_LINE>//<NEW_LINE>FormatUtil.print(new Date(alert.time), "HH:mm:ss.SSS"), //<NEW_LINE>AlertLevel.getName(alert.level), //<NEW_LINE>alert.title, //<NEW_LINE>alert.message, TextProxy.object.getLoadText(DateUtil.yyyymmdd(TimeUtil.getCurrentTime()), data.<MASK><NEW_LINE>t.setData(data);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}
p.objHash, serverId) });
159,272
public Ddl scan() {<NEW_LINE>Ddl.Builder builder = Ddl.builder();<NEW_LINE>listDatabaseOptions(builder);<NEW_LINE>listTables(builder);<NEW_LINE>listViews(builder);<NEW_LINE>listColumns(builder);<NEW_LINE>listColumnOptions(builder);<NEW_LINE>Map<String, NavigableMap<String, Index.Builder>> indexes = Maps.newHashMap();<NEW_LINE>listIndexes(indexes);<NEW_LINE>listIndexColumns(builder, indexes);<NEW_LINE>for (Map.Entry<String, NavigableMap<String, Index.Builder>> tableEntry : indexes.entrySet()) {<NEW_LINE>String tableName = tableEntry.getKey();<NEW_LINE>ImmutableList.Builder<String> tableIndexes = ImmutableList.builder();<NEW_LINE>for (Map.Entry<String, Index.Builder> entry : tableEntry.getValue().entrySet()) {<NEW_LINE>Index.Builder indexBuilder = entry.getValue();<NEW_LINE>tableIndexes.add(indexBuilder.build().prettyPrint());<NEW_LINE>}<NEW_LINE>builder.createTable(tableName).indexes(tableIndexes.build()).endTable();<NEW_LINE>}<NEW_LINE>Map<String, NavigableMap<String, ForeignKey.Builder>> foreignKeys = Maps.newHashMap();<NEW_LINE>listForeignKeys(foreignKeys);<NEW_LINE>for (Map.Entry<String, NavigableMap<String, ForeignKey.Builder>> tableEntry : foreignKeys.entrySet()) {<NEW_LINE>String tableName = tableEntry.getKey();<NEW_LINE>ImmutableList.Builder<String> tableForeignKeys = ImmutableList.builder();<NEW_LINE>for (Map.Entry<String, ForeignKey.Builder> entry : tableEntry.getValue().entrySet()) {<NEW_LINE>ForeignKey.Builder foreignKeyBuilder = entry.getValue();<NEW_LINE>ForeignKey fkBuilder = foreignKeyBuilder.build();<NEW_LINE>// Add the table and referenced table to the referencedTables TreeMultiMap of the ddl<NEW_LINE>builder.addReferencedTable(fkBuilder.table(<MASK><NEW_LINE>tableForeignKeys.add(fkBuilder.prettyPrint());<NEW_LINE>}<NEW_LINE>builder.createTable(tableName).foreignKeys(tableForeignKeys.build()).endTable();<NEW_LINE>}<NEW_LINE>Map<String, NavigableMap<String, CheckConstraint>> checkConstraints = listCheckConstraints();<NEW_LINE>for (Map.Entry<String, NavigableMap<String, CheckConstraint>> tableEntry : checkConstraints.entrySet()) {<NEW_LINE>String tableName = tableEntry.getKey();<NEW_LINE>ImmutableList.Builder<String> constraints = ImmutableList.builder();<NEW_LINE>for (Map.Entry<String, CheckConstraint> entry : tableEntry.getValue().entrySet()) {<NEW_LINE>constraints.add(entry.getValue().prettyPrint());<NEW_LINE>}<NEW_LINE>builder.createTable(tableName).checkConstraints(constraints.build()).endTable();<NEW_LINE>}<NEW_LINE>return builder.build();<NEW_LINE>}
), fkBuilder.referencedTable());
362,072
public static long[] queryRWICount(final MultiProtocolURL targetBaseURL, final Seed target, int timeout) {<NEW_LINE>// prepare request<NEW_LINE>final String salt = crypt.randomSalt();<NEW_LINE>// send request<NEW_LINE>try {<NEW_LINE>final Map<String, ContentBody> parts = basicRequestParts(Switchboard.getSwitchboard(), target.hash, salt);<NEW_LINE>parts.put("object"<MASK><NEW_LINE>parts.put("env", UTF8.StringBody(""));<NEW_LINE>// ConcurrentLog.info("**hello-DEBUG**queryRWICount**", "posting request to " + targetBaseURL);<NEW_LINE>final Post post = new Post(targetBaseURL, target.hash, "/yacy/query.html", parts, timeout);<NEW_LINE>// ConcurrentLog.info("**hello-DEBUG**queryRWICount**", "received CONTENT from requesting " + targetBaseURL + (post.result == null ? "NULL" : (": length = " + post.result.length)));<NEW_LINE>final Map<String, String> result = FileUtils.table(post.result);<NEW_LINE>if (result == null || result.isEmpty())<NEW_LINE>return new long[] { -1, -1 };<NEW_LINE>// ConcurrentLog.info("**hello-DEBUG**queryRWICount**", "received RESULT from requesting " + targetBaseURL + " : result = " + result.toString());<NEW_LINE>final String resp = result.get("response");<NEW_LINE>// ConcurrentLog.info("**hello-DEBUG**queryRWICount**", "received RESPONSE from requesting " + targetBaseURL + " : response = " + resp);<NEW_LINE>if (resp == null)<NEW_LINE>return new long[] { -1, -1 };<NEW_LINE>String magic = result.get("magic");<NEW_LINE>if (magic == null)<NEW_LINE>magic = "0";<NEW_LINE>try {<NEW_LINE>return new long[] { Long.parseLong(resp), Long.parseLong(magic) };<NEW_LINE>} catch (final NumberFormatException e) {<NEW_LINE>return new long[] { -1, -1 };<NEW_LINE>}<NEW_LINE>} catch (final Exception e) {<NEW_LINE>// ConcurrentLog.info("**hello-DEBUG**queryRWICount**", "received EXCEPTION from requesting " + targetBaseURL + ": " + e.getMessage());<NEW_LINE>if (Network.log.isFine())<NEW_LINE>Network.log.fine("yacyClient.queryRWICount error:" + e.getMessage());<NEW_LINE>return new long[] { -1, -1 };<NEW_LINE>}<NEW_LINE>}
, UTF8.StringBody("rwicount"));
130,524
final GetNotificationChannelResult executeGetNotificationChannel(GetNotificationChannelRequest getNotificationChannelRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(getNotificationChannelRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<GetNotificationChannelRequest> request = null;<NEW_LINE>Response<GetNotificationChannelResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new GetNotificationChannelRequestProtocolMarshaller(protocolFactory).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, "FMS");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "GetNotificationChannel");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<GetNotificationChannelResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new GetNotificationChannelResultJsonUnmarshaller());<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(getNotificationChannelRequest));
183,748
public static StatViewAdditionalPropsForge make(ExprNode[] validated, int startIndex, EventType parentEventType, ViewForgeEnv viewForgeEnv) {<NEW_LINE>if (validated.length <= startIndex) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>List<String> additionalProps = new ArrayList<>();<NEW_LINE>List<ExprNode> lastValueForges = new ArrayList<>();<NEW_LINE>List<EPType> lastValueTypes = new ArrayList<>();<NEW_LINE>List<DataInputOutputSerdeForge> lastSerdes = new ArrayList<>();<NEW_LINE>boolean copyAllProperties = false;<NEW_LINE>for (int i = startIndex; i < validated.length; i++) {<NEW_LINE>if (validated[i] instanceof ExprWildcard) {<NEW_LINE>copyAllProperties = true;<NEW_LINE>} else {<NEW_LINE>additionalProps.add(ExprNodeUtilityPrint.toExpressionStringMinPrecedenceSafe(validated[i]));<NEW_LINE>EPType evalType = validated[i].getForge().getEvaluationType();<NEW_LINE>lastValueTypes.add(evalType);<NEW_LINE>lastValueForges.add(validated[i]);<NEW_LINE>lastSerdes.add(viewForgeEnv.getSerdeResolver().serdeForDerivedViewAddProp(evalType, viewForgeEnv.getStatementRawInfo()));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (copyAllProperties) {<NEW_LINE>for (EventPropertyDescriptor propertyDescriptor : parentEventType.getPropertyDescriptors()) {<NEW_LINE>if (propertyDescriptor.isFragment()) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>additionalProps.add(propertyDescriptor.getPropertyName());<NEW_LINE>EPType type = propertyDescriptor.getPropertyEPType();<NEW_LINE>lastValueForges.add(new ExprIdentNodeImpl(parentEventType, propertyDescriptor.getPropertyName(), viewForgeEnv.getStreamNumber()));<NEW_LINE>lastValueTypes.add(type);<NEW_LINE>lastSerdes.add(viewForgeEnv.getSerdeResolver().serdeForDerivedViewAddProp(type, viewForgeEnv.getStatementRawInfo()));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>String[] addPropsArr = additionalProps.toArray(new String[additionalProps.size()]);<NEW_LINE>ExprNode[] valueExprArr = lastValueForges.toArray(new ExprNode[lastValueForges.size()]);<NEW_LINE>EPTypeClass[] typeArr = lastValueTypes.toArray(new EPTypeClass[lastValueTypes.size()]);<NEW_LINE>DataInputOutputSerdeForge[] additionalForges = lastSerdes.toArray(new DataInputOutputSerdeForge[0]);<NEW_LINE>return new StatViewAdditionalPropsForge(<MASK><NEW_LINE>}
addPropsArr, valueExprArr, typeArr, additionalForges);
1,606,750
private boolean isMockTcpPortIsInRange(int port) {<NEW_LINE>boolean inRange = false;<NEW_LINE>if (StringUtils.isNotEmpty(this.tcpMockPorts)) {<NEW_LINE>try {<NEW_LINE>if (this.tcpMockPorts.contains("-")) {<NEW_LINE>String[] tcpMockPortArr = this.tcpMockPorts.split("-");<NEW_LINE>int num1 = Integer.parseInt(tcpMockPortArr[0]);<NEW_LINE>int num2 = Integer.parseInt(tcpMockPortArr[1]);<NEW_LINE>int startNum = num1 > num2 ? num2 : num1;<NEW_LINE>int endNum <MASK><NEW_LINE>if (port < startNum || port > endNum) {<NEW_LINE>inRange = false;<NEW_LINE>} else {<NEW_LINE>inRange = true;<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>int tcpPortConfigNum = Integer.parseInt(this.tcpMockPorts);<NEW_LINE>if (port == tcpPortConfigNum) {<NEW_LINE>inRange = true;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return inRange;<NEW_LINE>}
= num1 < num2 ? num2 : num1;
475,800
public Cursor handle(RelNode logicalPlan, ExecutionContext executionContext) {<NEW_LINE>LogicalDal logicalDal = (LogicalDal) logicalPlan;<NEW_LINE>SqlSetDefaultRole sqlNode = <MASK><NEW_LINE>PolarPrivManager manager = PolarPrivManager.getInstance();<NEW_LINE>List<PolarAccountInfo> toUsers = sqlNode.getUsers().stream().map(SqlUserName::toPolarAccount).map(manager::getAndCheckExactUser).collect(Collectors.toList());<NEW_LINE>checkCanSetDefaultRole(executionContext, toUsers);<NEW_LINE>List<PolarAccountInfo> roles = sqlNode.getRoles().stream().map(SqlUserName::toPolarAccount).map(manager::getAndCheckExactUser).collect(Collectors.toList());<NEW_LINE>toUsers.forEach(user -> user.getRolePrivileges().checkRolesGranted(roles.stream().map(PolarAccountInfo::getAccount)));<NEW_LINE>PolarRolePrivilege.DefaultRoleState defaultRoleState = PolarRolePrivilege.DefaultRoleState.from(sqlNode.getDefaultRoleSpec());<NEW_LINE>manager.runWithMetaDBConnection(conn -> {<NEW_LINE>try {<NEW_LINE>PolarRolePrivilege.syncDefaultRolesToDb(conn, toUsers, defaultRoleState, roles);<NEW_LINE>conn.commit();<NEW_LINE>manager.reloadAccounts(conn, toUsers.stream().map(PolarAccountInfo::getAccount).collect(Collectors.toList()));<NEW_LINE>} catch (Throwable t) {<NEW_LINE>LOGGER.error("Failed to set default roles!", t);<NEW_LINE>throw new TddlRuntimeException(ERR_SERVER, "Failed to persist account data!", t);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>manager.triggerReload();<NEW_LINE>return new AffectRowCursor(toUsers.size() * roles.size());<NEW_LINE>}
(SqlSetDefaultRole) logicalDal.getNativeSqlNode();
914,276
final DescribeJobResult executeDescribeJob(DescribeJobRequest describeJobRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(describeJobRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DescribeJobRequest> request = null;<NEW_LINE>Response<DescribeJobResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DescribeJobRequestMarshaller().marshall(super.beforeMarshalling(describeJobRequest));<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, "S3 Control");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DescribeJob");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>URI endpointTraitHost = null;<NEW_LINE>if (!clientConfiguration.isDisableHostPrefixInjection()) {<NEW_LINE>ValidationUtils.assertStringNotEmpty(describeJobRequest.getAccountId(), "AccountId");<NEW_LINE>HostnameValidator.validateHostnameCompliant(describeJobRequest.getAccountId(), "AccountId", "describeJobRequest");<NEW_LINE>String hostPrefix = "{AccountId}.";<NEW_LINE>String resolvedHostPrefix = String.format("%s.", describeJobRequest.getAccountId());<NEW_LINE>endpointTraitHost = <MASK><NEW_LINE>}<NEW_LINE>StaxResponseHandler<DescribeJobResult> responseHandler = new com.amazonaws.services.s3control.internal.S3ControlStaxResponseHandler<DescribeJobResult>(new DescribeJobResultStaxUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext, null, endpointTraitHost);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
UriResourcePathUtils.updateUriHost(endpoint, resolvedHostPrefix);
1,708,452
public void printWarning(int daysBeforeExpireWarning, String keyStoreName, String alias, X509Certificate cert) {<NEW_LINE>try {<NEW_LINE>long millisDelta = ((((daysBeforeExpireWarning * 24L) * 60L) * 60L) * 1000L);<NEW_LINE>long millisBeforeExpiration = cert.getNotAfter().getTime() - System.currentTimeMillis();<NEW_LINE>long daysLeft = ((((millisBeforeExpiration / 1000L) / 60L) / 60L) / 24L);<NEW_LINE>// cert is already expired<NEW_LINE>if (millisBeforeExpiration < 0) {<NEW_LINE>Tr.error(tc, "ssl.expiration.expired.CWPKI0017E", new Object[] { alias, keyStoreName });<NEW_LINE>} else if (millisBeforeExpiration < millisDelta) {<NEW_LINE>Tr.warning(tc, "ssl.expiration.warning.CWPKI0016W", new Object[] { alias, keyStoreName, Long.valueOf(daysLeft) });<NEW_LINE>} else {<NEW_LINE>if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())<NEW_LINE>Tr.debug(tc, "The certificate with alias " + alias + " from keyStore " + keyStoreName + " has " + daysLeft + " days left before expiring.");<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())<NEW_LINE>Tr.debug(tc, "Exception reading KeyStore certificates during expiration check; " + e);<NEW_LINE>FFDCFilter.processException(e, getClass().<MASK><NEW_LINE>}<NEW_LINE>}
getName(), "printWarning", this);
1,099,129
private Component createStatusBar() {<NEW_LINE>// stateLabel<NEW_LINE>callStatusLabel.setForeground(Color.WHITE);<NEW_LINE>dtmfLabel.setForeground(Color.WHITE);<NEW_LINE>callStatusLabel.setText(callPeer.getState().getLocalizedStateString());<NEW_LINE>PeerStatusPanel statusPanel = new PeerStatusPanel(new GridBagLayout());<NEW_LINE>GridBagConstraints constraints = new GridBagConstraints();<NEW_LINE>constraints.gridx = 0;<NEW_LINE>constraints.gridy = 0;<NEW_LINE><MASK><NEW_LINE>initSecurityStatusLabel();<NEW_LINE>constraints.gridx++;<NEW_LINE>statusPanel.add(holdStatusLabel, constraints);<NEW_LINE>constraints.gridx++;<NEW_LINE>statusPanel.add(muteStatusLabel, constraints);<NEW_LINE>constraints.gridx++;<NEW_LINE>callStatusLabel.setBorder(BorderFactory.createEmptyBorder(2, 3, 2, 12));<NEW_LINE>statusPanel.add(callStatusLabel, constraints);<NEW_LINE>constraints.gridx++;<NEW_LINE>constraints.weightx = 1f;<NEW_LINE>statusPanel.add(dtmfLabel, constraints);<NEW_LINE>return statusPanel;<NEW_LINE>}
statusPanel.add(securityStatusLabel, constraints);
552,056
public static Map<Object, Object> createBrokerProps() {<NEW_LINE>Map<Object, Object> props = new HashMap<>();<NEW_LINE>props.put("metric.reporters", CruiseControlMetricsReporter.class.getName());<NEW_LINE>StringJoiner csvJoiner = new StringJoiner(",");<NEW_LINE>csvJoiner.add(SecurityProtocol.PLAINTEXT.name + "://localhost:" + KafkaCruiseControlIntegrationTestUtils.findRandomOpenPortOnAllLocalInterfaces());<NEW_LINE>props.put(KafkaConfig.ListenersProp(), csvJoiner.toString());<NEW_LINE>props.put(CruiseControlMetricsReporterConfig.CRUISE_CONTROL_METRICS_TOPIC_AUTO_CREATE_CONFIG, "true");<NEW_LINE>props.put(CruiseControlMetricsReporterConfig.CRUISE_CONTROL_METRICS_TOPIC_REPLICATION_FACTOR_CONFIG, "2");<NEW_LINE>props.<MASK><NEW_LINE>props.put(CruiseControlMetricsReporterConfig.CRUISE_CONTROL_METRICS_REPORTER_INTERVAL_MS_CONFIG, "10000");<NEW_LINE>return props;<NEW_LINE>}
put(CruiseControlMetricsReporterConfig.CRUISE_CONTROL_METRICS_TOPIC_NUM_PARTITIONS_CONFIG, "1");
1,436,161
public void addUsage(Content content, HostAddress hostAddress) throws TskCoreException {<NEW_LINE>String key = content.getDataSource().getId() + "#" + hostAddress.getId() + "#" + content.getId();<NEW_LINE>Boolean cachedValue = hostAddressUsageCache.getIfPresent(key);<NEW_LINE>if (null != cachedValue) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final String insertSQL = db.getInsertOrIgnoreSQL(" INTO tsk_host_address_usage(addr_obj_id, obj_id, data_source_obj_id) " + " VALUES(" + hostAddress.getId() + ", " + content.getId() + ", " + content.getDataSource().getId() + ") ");<NEW_LINE>db.acquireSingleUserCaseWriteLock();<NEW_LINE>try (CaseDbConnection connection = this.db.getConnection();<NEW_LINE>Statement s = connection.createStatement()) {<NEW_LINE><MASK><NEW_LINE>hostAddressUsageCache.put(key, true);<NEW_LINE>} catch (SQLException ex) {<NEW_LINE>throw new TskCoreException(String.format("Error associating host address %s with artifact with id %d", hostAddress.getAddress(), content.getId()), ex);<NEW_LINE>} finally {<NEW_LINE>db.releaseSingleUserCaseWriteLock();<NEW_LINE>}<NEW_LINE>}
connection.executeUpdate(s, insertSQL);
69,051
public CreateBillingGroupResult createBillingGroup(CreateBillingGroupRequest createBillingGroupRequest) throws AmazonServiceException, AmazonClientException {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(createBillingGroupRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<CreateBillingGroupRequest> request = null;<NEW_LINE>Response<CreateBillingGroupResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new <MASK><NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>Unmarshaller<CreateBillingGroupResult, JsonUnmarshallerContext> unmarshaller = new CreateBillingGroupResultJsonUnmarshaller();<NEW_LINE>JsonResponseHandler<CreateBillingGroupResult> responseHandler = new JsonResponseHandler<CreateBillingGroupResult>(unmarshaller);<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.ClientExecuteTime);<NEW_LINE>endClientExecution(awsRequestMetrics, request, response, LOGGING_AWS_REQUEST_METRIC);<NEW_LINE>}<NEW_LINE>}
CreateBillingGroupRequestMarshaller().marshall(createBillingGroupRequest);
976,393
public void prepare(Map<String, Object> conf, TopologyContext context, OutputCollector collector) {<NEW_LINE>String mdF = ConfUtils.getString(conf, metadataFilterParamName);<NEW_LINE>if (StringUtils.isNotBlank(mdF)) {<NEW_LINE>// split it in key value<NEW_LINE>int equals = mdF.indexOf('=');<NEW_LINE>if (equals != -1) {<NEW_LINE>String key = mdF.substring(0, equals);<NEW_LINE>String value = mdF.substring(equals + 1);<NEW_LINE>filterKeyValue = new String[] { key.trim(), value.trim() };<NEW_LINE>} else {<NEW_LINE>LOG.error("Can't split into key value : {}", mdF);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>fieldNameForText = ConfUtils.getString(conf, textFieldParamName);<NEW_LINE>maxLengthText = ConfUtils.getInt<MASK><NEW_LINE>fieldNameForURL = ConfUtils.getString(conf, urlFieldParamName);<NEW_LINE>canonicalMetadataName = ConfUtils.getString(conf, canonicalMetadataParamName);<NEW_LINE>for (String mapping : ConfUtils.loadListFromConf(metadata2fieldParamName, conf)) {<NEW_LINE>int equals = mapping.indexOf('=');<NEW_LINE>if (equals != -1) {<NEW_LINE>String key = mapping.substring(0, equals).trim();<NEW_LINE>String value = mapping.substring(equals + 1).trim();<NEW_LINE>metadata2field.put(key, value);<NEW_LINE>LOG.info("Mapping key {} to field {}", key, value);<NEW_LINE>} else {<NEW_LINE>mapping = mapping.trim();<NEW_LINE>metadata2field.put(mapping, mapping);<NEW_LINE>LOG.info("Mapping key {} to field {}", mapping, mapping);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
(conf, textLengthParamName, -1);
1,022,555
public AckArgs deserialize(JsonParser jp, DeserializationContext ctxt) throws IOException, JsonProcessingException {<NEW_LINE>List<Object> args = new ArrayList<Object>();<NEW_LINE><MASK><NEW_LINE>ObjectMapper mapper = (ObjectMapper) jp.getCodec();<NEW_LINE>JsonNode root = mapper.readTree(jp);<NEW_LINE>AckCallback<?> callback = currentAckClass.get();<NEW_LINE>Iterator<JsonNode> iter = root.iterator();<NEW_LINE>int i = 0;<NEW_LINE>while (iter.hasNext()) {<NEW_LINE>Object val;<NEW_LINE>Class<?> clazz = callback.getResultClass();<NEW_LINE>if (callback instanceof MultiTypeAckCallback) {<NEW_LINE>MultiTypeAckCallback multiTypeAckCallback = (MultiTypeAckCallback) callback;<NEW_LINE>clazz = multiTypeAckCallback.getResultClasses()[i];<NEW_LINE>}<NEW_LINE>JsonNode arg = iter.next();<NEW_LINE>if (arg.isTextual() || arg.isBoolean()) {<NEW_LINE>clazz = Object.class;<NEW_LINE>}<NEW_LINE>val = mapper.treeToValue(arg, clazz);<NEW_LINE>args.add(val);<NEW_LINE>i++;<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>}
AckArgs result = new AckArgs(args);
680,271
public void finish() {<NEW_LINE>wizard.completed = true;<NEW_LINE>int upLimit = wizard.getUploadLimit();<NEW_LINE>if (upLimit > 0) {<NEW_LINE>COConfigurationManager.setParameter(TransferSpeedValidator.AUTO_UPLOAD_ENABLED_CONFIGKEY, false);<NEW_LINE>COConfigurationManager.setParameter(TransferSpeedValidator.AUTO_UPLOAD_SEEDING_ENABLED_CONFIGKEY, false);<NEW_LINE>COConfigurationManager.setParameter("Max Upload Speed KBs", upLimit / DisplayFormatters.getKinB());<NEW_LINE>COConfigurationManager.setParameter("enable.seedingonly.upload.rate", false);<NEW_LINE>COConfigurationManager.setParameter("max active torrents", wizard.maxActiveTorrents);<NEW_LINE>COConfigurationManager.setParameter("max downloads", wizard.maxDownloads);<NEW_LINE>try {<NEW_LINE>SpeedManager sm = CoreFactory.getSingleton().getSpeedManager();<NEW_LINE>boolean is_manual = wizard.isUploadLimitManual();<NEW_LINE>sm.setEstimatedUploadCapacityBytesPerSec(upLimit, is_manual ? SpeedManagerLimitEstimate.TYPE_MANUAL : SpeedManagerLimitEstimate.TYPE_MEASURED);<NEW_LINE>} catch (Throwable e) {<NEW_LINE>Debug.out(e);<NEW_LINE>}<NEW_LINE>// toggle to ensure listeners get the message that they should recalc things<NEW_LINE>COConfigurationManager.setParameter("Auto Adjust Transfer Defaults", false);<NEW_LINE>COConfigurationManager.setParameter("Auto Adjust Transfer Defaults", true);<NEW_LINE>}<NEW_LINE>if (wizard.getWizardMode() != ConfigureWizard.WIZARD_MODE_FULL) {<NEW_LINE>wizard.close();<NEW_LINE>} else {<NEW_LINE>COConfigurationManager.<MASK><NEW_LINE>COConfigurationManager.setParameter("UDP.Listen.Port", wizard.serverUDPListenPort);<NEW_LINE>COConfigurationManager.setParameter("UDP.NonData.Listen.Port", wizard.serverUDPListenPort);<NEW_LINE>COConfigurationManager.setParameter("General_sDefaultTorrent_Directory", wizard.torrentPath);<NEW_LINE>if (wizard.hasDataPathChanged()) {<NEW_LINE>COConfigurationManager.setParameter("Default save path", wizard.getDataPath());<NEW_LINE>}<NEW_LINE>COConfigurationManager.setParameter("Wizard Completed", true);<NEW_LINE>COConfigurationManager.save();<NEW_LINE>wizard.switchToClose();<NEW_LINE>}<NEW_LINE>}
setParameter("TCP.Listen.Port", wizard.serverTCPListenPort);
1,500,585
public static void main(String[] args) throws Throwable {<NEW_LINE>logger.info("JSweet candy scaffold tool - version: " + JSweetDefTranslatorConfig.getVersionNumber());<NEW_LINE>JSAP jsapSpec = defineArgs();<NEW_LINE>JSAPResult jsapArgs = parseArgs(jsapSpec, args);<NEW_LINE>if (!jsapArgs.success() || jsapArgs.getBoolean("help")) {<NEW_LINE>printUsage(jsapSpec);<NEW_LINE>System.exit(0);<NEW_LINE>}<NEW_LINE>if (jsapArgs.getBoolean("verbose")) {<NEW_LINE>LogManager.getLogger("org.jsweet").setLevel(Level.ALL);<NEW_LINE>}<NEW_LINE>String candyName = jsapArgs.getString("name");<NEW_LINE>File outDir = jsapArgs.getFile("out");<NEW_LINE>if (outDir == null || StringUtils.isBlank(outDir.getPath())) {<NEW_LINE>outDir = new File("./candy-" + candyName + "-sources");<NEW_LINE>}<NEW_LINE>outDir.mkdirs();<NEW_LINE>//<NEW_LINE>List<File> //<NEW_LINE>tsFiles = //<NEW_LINE>Stream.of(jsapArgs.getString("tsFiles").split(",")).//<NEW_LINE>filter(//<NEW_LINE>StringUtils::isNotBlank).//<NEW_LINE>map(File::new).collect(toList());<NEW_LINE>//<NEW_LINE>List<File> //<NEW_LINE>tsDependencies = //<NEW_LINE>Stream.of(defaultString(jsapArgs.getString("tsDeps")).split(",")).//<NEW_LINE>filter(//<NEW_LINE>StringUtils::isNotBlank).//<NEW_LINE>map(File::new).collect(toList());<NEW_LINE>JSweetCoreVersion coreVersion = JSweetCoreVersion.parse<MASK><NEW_LINE>addCoreDependencies(coreVersion, tsDependencies);<NEW_LINE>//<NEW_LINE>logger.//<NEW_LINE>info(//<NEW_LINE>"scaffolding candy: \n" + "* candyName: " + candyName + "\n" + "* tsFiles: " + //<NEW_LINE>tsFiles + "\n" + "* tsDependencies: " + //<NEW_LINE>tsDependencies + "\n" + "* coreVersion: " + //<NEW_LINE>coreVersion + "\n" + " to out: " + outDir.getAbsolutePath());<NEW_LINE>//<NEW_LINE>//<NEW_LINE>TypescriptDef2Java.//<NEW_LINE>translate(//<NEW_LINE>tsFiles, //<NEW_LINE>tsDependencies, //<NEW_LINE>outDir, //<NEW_LINE>null, false, false);<NEW_LINE>logger.info("**************************************************************");<NEW_LINE>logger.info("candy " + candyName + " successfully generated to " + outDir);<NEW_LINE>logger.info("**************************************************************");<NEW_LINE>}
(jsapArgs.getString("coreVersion"));
596,018
private URLConnection connection(String name, boolean cacheMetadata) throws IOException {<NEW_LINE>LOG.log(Level.FINE, "metadata in {0}: {1}", new Object[] { baseURL, name });<NEW_LINE>URLConnection conn = new ConnectionBuilder().job(job).url(new URL(baseURL, Utilities.uriEncode(name))).timeout(TIMEOUT).connection();<NEW_LINE>if (cacheMetadata) {<NEW_LINE>assert Thread.holdsLock(nonDirs);<NEW_LINE>lastModified.put(name, conn.getLastModified());<NEW_LINE><MASK><NEW_LINE>if (contentLength == -1) {<NEW_LINE>LOG.warning("unknown content length for " + name + " in " + baseURL);<NEW_LINE>size.put(name, 0);<NEW_LINE>} else {<NEW_LINE>size.put(name, contentLength);<NEW_LINE>}<NEW_LINE>if (contentLength >= 0) {<NEW_LINE>byte[] buf = new byte[Math.min(contentLength, /* BufferedInputStream.defaultBufferSize */<NEW_LINE>8192)];<NEW_LINE>InputStream is = conn.getInputStream();<NEW_LINE>try {<NEW_LINE>int p = 0;<NEW_LINE>int read;<NEW_LINE>while (p < buf.length && (read = is.read(buf, p, buf.length - p)) != -1) {<NEW_LINE>p += read;<NEW_LINE>}<NEW_LINE>if (p == buf.length) {<NEW_LINE>headers.put(name, buf);<NEW_LINE>} else {<NEW_LINE>LOG.warning("incomplete read for " + name + " in " + baseURL + ": read up to " + p + " where reported length is " + contentLength);<NEW_LINE>}<NEW_LINE>} finally {<NEW_LINE>is.close();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return conn;<NEW_LINE>}
int contentLength = conn.getContentLength();
426,572
private void paintInstanceClassic(InstancePainter painter) {<NEW_LINE>final var g = painter.getGraphics();<NEW_LINE>final var bds = painter.getBounds();<NEW_LINE>final var state = (StateData) painter.getData();<NEW_LINE>final var widthVal = painter.getAttributeValue(StdAttr.WIDTH);<NEW_LINE>final var width = widthVal == null ? 8 : widthVal.getWidth();<NEW_LINE>// determine text to draw in label<NEW_LINE>String a;<NEW_LINE>String b = null;<NEW_LINE>if (painter.getShowState()) {<NEW_LINE>int val = state == null ? 0 : state.value;<NEW_LINE>final var str = StringUtil.toHexString(width, val);<NEW_LINE>if (str.length() <= 4) {<NEW_LINE>a = str;<NEW_LINE>} else {<NEW_LINE>final var split = str.length() - 4;<NEW_LINE>a = str.substring(0, split);<NEW_LINE>b = str.substring(split);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>a = S.get("randomLabel");<NEW_LINE>b = S.get("randomWidthLabel", "" + widthVal.getWidth());<NEW_LINE>}<NEW_LINE>// draw boundary, label<NEW_LINE>painter.drawBounds();<NEW_LINE>g.setColor(painter<MASK><NEW_LINE>painter.drawLabel();<NEW_LINE>// draw input and output ports<NEW_LINE>if (b == null)<NEW_LINE>painter.drawPort(OUT, "Q", Direction.WEST);<NEW_LINE>else<NEW_LINE>painter.drawPort(OUT);<NEW_LINE>g.setColor(Color.GRAY);<NEW_LINE>painter.drawPort(RST, "0", Direction.SOUTH);<NEW_LINE>painter.drawPort(NXT, S.get("memEnableLabel"), Direction.EAST);<NEW_LINE>g.setColor(Color.BLACK);<NEW_LINE>painter.drawClock(CK, Direction.NORTH);<NEW_LINE>// draw contents<NEW_LINE>if (b == null) {<NEW_LINE>GraphicsUtil.drawText(g, a, bds.getX() + 20, bds.getY() + 4, GraphicsUtil.H_CENTER, GraphicsUtil.V_TOP);<NEW_LINE>} else {<NEW_LINE>GraphicsUtil.drawText(g, a, bds.getX() + 20, bds.getY() + 3, GraphicsUtil.H_CENTER, GraphicsUtil.V_TOP);<NEW_LINE>GraphicsUtil.drawText(g, b, bds.getX() + 20, bds.getY() + 15, GraphicsUtil.H_CENTER, GraphicsUtil.V_TOP);<NEW_LINE>}<NEW_LINE>}
.getAttributeValue(StdAttr.LABEL_COLOR));
523,408
public static void main(String[] args) {<NEW_LINE>// Sequence of input pairs to produce a tree of height 4:<NEW_LINE>// 0 1<NEW_LINE>// 0 2<NEW_LINE>// 0 3<NEW_LINE>// 6 7<NEW_LINE>// 8 9<NEW_LINE>// 6 8<NEW_LINE>// 0 6<NEW_LINE>// 10 11<NEW_LINE>// 10 12<NEW_LINE>// 10 13<NEW_LINE>// 10 14<NEW_LINE>// 10 15<NEW_LINE>// 10 16<NEW_LINE>// 10 17<NEW_LINE>// 10 18<NEW_LINE>// 0 10<NEW_LINE>// Path of height 4: 9 -> 8 -> 6 -> 0 -> 10<NEW_LINE>WeightedQuickUnionPathCompression weightedQuickUnionPathCompression = new Exercise13_WeightedQUPathCompression().new WeightedQuickUnionPathCompression(19);<NEW_LINE>weightedQuickUnionPathCompression.union(0, 1);<NEW_LINE>weightedQuickUnionPathCompression.union(0, 2);<NEW_LINE>weightedQuickUnionPathCompression.union(0, 3);<NEW_LINE>weightedQuickUnionPathCompression.union(6, 7);<NEW_LINE>weightedQuickUnionPathCompression.union(8, 9);<NEW_LINE><MASK><NEW_LINE>weightedQuickUnionPathCompression.union(0, 6);<NEW_LINE>weightedQuickUnionPathCompression.union(10, 11);<NEW_LINE>weightedQuickUnionPathCompression.union(10, 12);<NEW_LINE>weightedQuickUnionPathCompression.union(10, 13);<NEW_LINE>weightedQuickUnionPathCompression.union(10, 14);<NEW_LINE>weightedQuickUnionPathCompression.union(10, 15);<NEW_LINE>weightedQuickUnionPathCompression.union(10, 16);<NEW_LINE>weightedQuickUnionPathCompression.union(10, 17);<NEW_LINE>weightedQuickUnionPathCompression.union(10, 18);<NEW_LINE>weightedQuickUnionPathCompression.union(0, 10);<NEW_LINE>StdOut.println("Components: " + weightedQuickUnionPathCompression.count() + " Expected: 3");<NEW_LINE>}
weightedQuickUnionPathCompression.union(6, 8);
154,703
//<NEW_LINE>private void showRequestValues(HttpServletRequest servletRequest, HttpServletResponse servletResponse, PrintWriter responseWriter) {<NEW_LINE>Enumeration<String> headerNames = servletRequest.getHeaderNames();<NEW_LINE>while (headerNames.hasMoreElements()) {<NEW_LINE>String headerName = headerNames.nextElement();<NEW_LINE>String headerValue = servletRequest.getHeader(headerName);<NEW_LINE>responseWriter.println("Header [ " + headerName + " ] [ " + headerValue + " ]");<NEW_LINE>}<NEW_LINE>Enumeration<String<MASK><NEW_LINE>while (parameterNames.hasMoreElements()) {<NEW_LINE>String parameterName = parameterNames.nextElement();<NEW_LINE>String parameterValue = servletRequest.getParameter(parameterName);<NEW_LINE>responseWriter.println("Parameter [ " + parameterName + " ] [ " + parameterValue + " ]");<NEW_LINE>}<NEW_LINE>String comment = servletRequest.getParameter(COMMENT_PARAMETER_NAME);<NEW_LINE>if (comment != null) {<NEW_LINE>try {<NEW_LINE>comment = URLDecoder.decode(comment, "UTF-8");<NEW_LINE>} catch (UnsupportedEncodingException e) {<NEW_LINE>// Ignore<NEW_LINE>}<NEW_LINE>responseWriter.println("Comment [ " + comment + " ]");<NEW_LINE>}<NEW_LINE>}
> parameterNames = servletRequest.getParameterNames();
1,050,329
private static boolean insertPreHeader(MethodNode mth, LoopInfo loop) {<NEW_LINE>BlockNode start = loop.getStart();<NEW_LINE>List<BlockNode> preds = start.getPredecessors();<NEW_LINE>// don't count back edge<NEW_LINE>int predsCount = preds.size() - 1;<NEW_LINE>if (predsCount == 1) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>if (predsCount == 0) {<NEW_LINE>if (!start.contains(AFlag.MTH_ENTER_BLOCK)) {<NEW_LINE>mth.addWarnComment("Unexpected block without predecessors: " + start);<NEW_LINE>}<NEW_LINE>BlockNode newEnterBlock = BlockSplitter.startNewBlock(mth, -1);<NEW_LINE>newEnterBlock.add(AFlag.SYNTHETIC);<NEW_LINE>newEnterBlock.add(AFlag.MTH_ENTER_BLOCK);<NEW_LINE>mth.setEnterBlock(newEnterBlock);<NEW_LINE>start.remove(AFlag.MTH_ENTER_BLOCK);<NEW_LINE>BlockSplitter.connect(newEnterBlock, start);<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>// multiple predecessors<NEW_LINE>BlockNode preHeader = BlockSplitter.startNewBlock(mth, -1);<NEW_LINE>preHeader.add(AFlag.SYNTHETIC);<NEW_LINE>for (BlockNode pred : new ArrayList<>(preds)) {<NEW_LINE>BlockSplitter.<MASK><NEW_LINE>}<NEW_LINE>BlockSplitter.connect(preHeader, start);<NEW_LINE>return true;<NEW_LINE>}
replaceConnection(pred, start, preHeader);
99,477
private boolean isReachable(int timeOut) {<NEW_LINE>boolean reachable = false;<NEW_LINE>Socket socket = new Socket();<NEW_LINE>try {<NEW_LINE>System.out.println("before socketAddress...host=" + host + " AND port" + port);<NEW_LINE>SocketAddress socketAddress = new InetSocketAddress(host, port);<NEW_LINE>s = System.currentTimeMillis();<NEW_LINE>// this method will block no more than timeout ms.<NEW_LINE>socket.connect(socketAddress, 1000);<NEW_LINE>f = System.currentTimeMillis();<NEW_LINE>counterTimeout = counterTimeout + <MASK><NEW_LINE>} catch (Exception e) {<NEW_LINE>f = System.currentTimeMillis();<NEW_LINE>System.out.println("Exception in connect..." + e.getMessage());<NEW_LINE>counterTimeout = counterTimeout + (int) (f - s);<NEW_LINE>Logger.E(TAG, "Exception in connect..." + e.getMessage());<NEW_LINE>} finally {<NEW_LINE>try {<NEW_LINE>if (socket.isConnected()) {<NEW_LINE>reachable = true;<NEW_LINE>socket.close();<NEW_LINE>} else {<NEW_LINE>reachable = false;<NEW_LINE>socket.close();<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>e.printStackTrace();<NEW_LINE>Logger.E(TAG, "Exception in finally..." + e.getMessage());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return reachable;<NEW_LINE>}
(int) (f - s);
1,634,294
final GetParametersByPathResult executeGetParametersByPath(GetParametersByPathRequest getParametersByPathRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(getParametersByPathRequest);<NEW_LINE><MASK><NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<GetParametersByPathRequest> request = null;<NEW_LINE>Response<GetParametersByPathResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new GetParametersByPathRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(getParametersByPathRequest));<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, "SSM");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "GetParametersByPath");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<GetParametersByPathResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new GetParametersByPathResultJsonUnmarshaller());<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,636,304
protected void paintIcon(Graphics2D g2) {<NEW_LINE>g2.setColor(Color.BLUE.<MASK><NEW_LINE>final int[] xpos = { 0, scale(6), scale(4), scale(2) };<NEW_LINE>final int[] ypos = { scale(13), scale(13), scale(15), scale(15) };<NEW_LINE>g2.fillPolygon(xpos, ypos, 4);<NEW_LINE>for (var i = 0; i < 4; i++) {<NEW_LINE>xpos[i] += scale(10);<NEW_LINE>}<NEW_LINE>g2.fillPolygon(xpos, ypos, 4);<NEW_LINE>final int xbase = scale(9);<NEW_LINE>final int ybase = scale(11);<NEW_LINE>var xtop = scale(13);<NEW_LINE>var ytop = scale(3);<NEW_LINE>g2.setStroke(new BasicStroke(scale(2)));<NEW_LINE>g2.setColor(Color.BLACK);<NEW_LINE>g2.drawLine(xtop, ytop, xbase, ybase);<NEW_LINE>xtop -= scale(2);<NEW_LINE>ytop -= scale(2);<NEW_LINE>g2.setStroke(new BasicStroke(scale(1)));<NEW_LINE>g2.setColor(Color.RED);<NEW_LINE>g2.fillOval(xtop, ytop, scale(4), scale(4));<NEW_LINE>g2.drawOval(xtop, ytop, scale(4), scale(4));<NEW_LINE>g2.setColor(Color.BLUE);<NEW_LINE>g2.fillRoundRect(0, scale(10), scale(16), scale(4), scale(2), scale(2));<NEW_LINE>g2.drawRoundRect(0, scale(10), scale(16), scale(4), scale(2), scale(2));<NEW_LINE>}
darker().darker());
90,393
// Initialize a BundleData from a resource quota and configurations and modify the quota accordingly.<NEW_LINE>private BundleData initializeBundleData(final ResourceQuota quota, final ShellArguments arguments) {<NEW_LINE>final double messageRate = (quota.getMsgRateIn() + quota.getMsgRateOut()) / 2;<NEW_LINE>final int messageSize = (int) Math.ceil((quota.getBandwidthIn() + quota.getBandwidthOut()) / (2 * messageRate));<NEW_LINE>arguments.rate = messageRate * arguments.rateMultiplier;<NEW_LINE>arguments.size = messageSize;<NEW_LINE>final NamespaceBundleStats startingStats = new NamespaceBundleStats();<NEW_LINE>// Modify the original quota so that new rates are set.<NEW_LINE>final double modifiedRate = messageRate * arguments.rateMultiplier;<NEW_LINE>final double modifiedBandwidth = (quota.getBandwidthIn() + quota.getBandwidthOut()) * arguments.rateMultiplier / 2;<NEW_LINE>quota.setMsgRateIn(modifiedRate);<NEW_LINE>quota.setMsgRateOut(modifiedRate);<NEW_LINE>quota.setBandwidthIn(modifiedBandwidth);<NEW_LINE>quota.setBandwidthOut(modifiedBandwidth);<NEW_LINE>// Assume modified memory usage is comparable to the rate multiplier times the original usage.<NEW_LINE>quota.setMemory(quota.getMemory() * arguments.rateMultiplier);<NEW_LINE>startingStats.msgRateIn = quota.getMsgRateIn();<NEW_LINE>startingStats.msgRateOut = quota.getMsgRateOut();<NEW_LINE>startingStats<MASK><NEW_LINE>startingStats.msgThroughputOut = quota.getBandwidthOut();<NEW_LINE>final BundleData bundleData = new BundleData(10, 1000, startingStats);<NEW_LINE>// Assume there is ample history for the bundle.<NEW_LINE>bundleData.getLongTermData().setNumSamples(1000);<NEW_LINE>bundleData.getShortTermData().setNumSamples(10);<NEW_LINE>return bundleData;<NEW_LINE>}
.msgThroughputIn = quota.getBandwidthIn();
1,607,808
public ProcessorConfiguration unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>ProcessorConfiguration processorConfiguration = new ProcessorConfiguration();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE><MASK><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("Lambda", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>processorConfiguration.setLambda(LambdaConfigurationJsonUnmarshaller.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 processorConfiguration;<NEW_LINE>}
JsonToken token = context.getCurrentToken();
282,640
private boolean doDatabaseUpdate() {<NEW_LINE>ArrayList<ContentProviderOperation> batch = new ArrayList<>(addToTheseLists.size() + removeFromTheseLists.size());<NEW_LINE>for (String listId : addToTheseLists) {<NEW_LINE>String listItemId = SeriesGuideContract.ListItems.generateListItemId(itemStableId, itemType, listId);<NEW_LINE>batch.add(ContentProviderOperation.newInsert(SeriesGuideContract.ListItems.CONTENT_URI).withValue(SeriesGuideContract.ListItems.LIST_ITEM_ID, listItemId).withValue(SeriesGuideContract.ListItems.ITEM_REF_ID, itemStableId).withValue(SeriesGuideContract.ListItems.TYPE, itemType).withValue(SeriesGuideContract.Lists.LIST_ID, listId).build());<NEW_LINE>}<NEW_LINE>for (String listId : removeFromTheseLists) {<NEW_LINE>String listItemId = SeriesGuideContract.ListItems.generateListItemId(itemStableId, itemType, listId);<NEW_LINE>batch.add(ContentProviderOperation.newDelete(SeriesGuideContract.ListItems.buildListItemUri(listItemId)).build());<NEW_LINE>}<NEW_LINE>// apply ops<NEW_LINE>try {<NEW_LINE>DBUtils.<MASK><NEW_LINE>} catch (OperationApplicationException e) {<NEW_LINE>Timber.e(e, "Applying list changes failed");<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>// notify URI used by list fragments<NEW_LINE>getContext().getContentResolver().notifyChange(SeriesGuideContract.ListItems.CONTENT_WITH_DETAILS_URI, null);<NEW_LINE>return true;<NEW_LINE>}
applyInSmallBatches(getContext(), batch);
979,613
/* (non-Javadoc)<NEW_LINE>* @see com.kkalice.adempiere.migrate.DBObjectInterface#loadContents(java.util.HashMap, com.kkalice.adempiere.migrate.MigrateLogger, com.kkalice.adempiere.migrate.MigrateDBEngine, com.kkalice.adempiere.migrate.DBConnection, java.lang.String)<NEW_LINE>*/<NEW_LINE>public void loadContents(HashMap<Integer, DBObjectDefinition> contentMap, Parameters parameters, MigrateLogger logger, DBEngine dbEngine, DBConnection parent, String name, HashMap<Integer, DBObjectDefinition> headerMap, PreparedStatementWrapper statement) {<NEW_LINE>parent.setPreparedStatementString(statement, 1, name);<NEW_LINE>ResultSet rs = parent.executeQuery(statement);<NEW_LINE>int counter = 0;<NEW_LINE>while (parent.getResultSetNext(rs)) {<NEW_LINE>String viewName = <MASK><NEW_LINE>String viewDefinition = parent.getResultSetString(rs, "VIEW_DEFINITION");<NEW_LINE>DBObject_View_Definition obj = new DBObject_View_Definition(parent, viewName, counter);<NEW_LINE>obj.initializeDefinition(viewDefinition);<NEW_LINE>contentMap.put(new Integer(counter), obj);<NEW_LINE>counter++;<NEW_LINE>}<NEW_LINE>parent.releaseResultSet(rs);<NEW_LINE>}
parent.getResultSetString(rs, "VIEW_NAME");
134,310
final DescribePublicIpv4PoolsResult executeDescribePublicIpv4Pools(DescribePublicIpv4PoolsRequest describePublicIpv4PoolsRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(describePublicIpv4PoolsRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DescribePublicIpv4PoolsRequest> request = null;<NEW_LINE>Response<DescribePublicIpv4PoolsResult> response = null;<NEW_LINE>try {<NEW_LINE><MASK><NEW_LINE>try {<NEW_LINE>request = new DescribePublicIpv4PoolsRequestMarshaller().marshall(super.beforeMarshalling(describePublicIpv4PoolsRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "EC2");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DescribePublicIpv4Pools");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>StaxResponseHandler<DescribePublicIpv4PoolsResult> responseHandler = new StaxResponseHandler<DescribePublicIpv4PoolsResult>(new DescribePublicIpv4PoolsResultStaxUnmarshaller());<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);
408,390
public static void codeableConcepts() {<NEW_LINE>// START SNIPPET: codeableConcepts<NEW_LINE>Patient patient = new Patient();<NEW_LINE>// Coded types can naturally be set using plain strings<NEW_LINE>Coding statusCoding = patient<MASK><NEW_LINE>statusCoding.setSystem("http://hl7.org/fhir/v3/MaritalStatus");<NEW_LINE>statusCoding.setCode("M");<NEW_LINE>statusCoding.setDisplay("Married");<NEW_LINE>// You could add a second coding to the field if needed too. This<NEW_LINE>// can be useful if you want to convey the concept using different<NEW_LINE>// codesystems.<NEW_LINE>Coding secondStatus = patient.getMaritalStatus().addCoding();<NEW_LINE>secondStatus.setCode("H");<NEW_LINE>secondStatus.setSystem("http://example.com#maritalStatus");<NEW_LINE>secondStatus.setDisplay("Happily Married");<NEW_LINE>// CodeableConcept also has a text field meant to convey<NEW_LINE>// a user readable version of the concepts it conveys.<NEW_LINE>patient.getMaritalStatus().setText("Happily Married");<NEW_LINE>// There are also accessors for retrieving values<NEW_LINE>String firstCode = patient.getMaritalStatus().getCoding().get(0).getCode();<NEW_LINE>String secondCode = patient.getMaritalStatus().getCoding().get(1).getCode();<NEW_LINE>// END SNIPPET: codeableConcepts<NEW_LINE>}
.getMaritalStatus().addCoding();
114,434
final TagResourceResult executeTagResource(TagResourceRequest tagResourceRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(tagResourceRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<TagResourceRequest> request = null;<NEW_LINE>Response<TagResourceResult> response = null;<NEW_LINE>try {<NEW_LINE><MASK><NEW_LINE>try {<NEW_LINE>request = new TagResourceRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(tagResourceRequest));<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, "DAX");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "TagResource");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<TagResourceResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new TagResourceResultJsonUnmarshaller());<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);
326,724
private void putPlotInFirstFreeMatrixSpace(DrawHandler drawer, PlotState plotState) {<NEW_LINE>// Go through all lines and all values in each line<NEW_LINE>for (int ySeq = 0; ySeq < matrix.rows(); ySeq++) {<NEW_LINE>List<List<AbstractPlot>> oneLine = matrix.row(ySeq);<NEW_LINE>for (int xSeq = 0; xSeq < oneLine.size(); xSeq++) {<NEW_LINE>List<AbstractPlot> oneValue = oneLine.get(xSeq);<NEW_LINE>// If a free space is found use it<NEW_LINE>if (oneValue == null) {<NEW_LINE>oneLine.set(xSeq, createPlots(drawer, plotState<MASK><NEW_LINE>return;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// If the actual x-coordinates line is < than the default grid width add a new value<NEW_LINE>if (oneLine.size() < gridWidth) {<NEW_LINE>oneLine.add(createPlots(drawer, plotState, oneLine.size(), ySeq, "no coordinate specified -> expanded x-list"));<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// If every space in the matrix is occupied and the position is still not found add a new line and fill its first place<NEW_LINE>List<List<AbstractPlot>> newLine = new ArrayList<List<AbstractPlot>>();<NEW_LINE>newLine.add(createPlots(drawer, plotState, 0, matrix.rows(), "no coordinate specified -> every matrix space occupied, expanded y-list"));<NEW_LINE>matrix.addLine(newLine);<NEW_LINE>}
, xSeq, ySeq, "no coordinate specified -> free space found"));
1,809,323
public void preVisit(ExploreNode exploreNode) {<NEW_LINE>if (skipNode(exploreNode)) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final ExploreNode parent = stack.peek();<NEW_LINE>if (exploreNode == this.rootModule) {<NEW_LINE>assert parent == null;<NEW_LINE><MASK><NEW_LINE>this.writer.append(Integer.toString(mn.hashCode()));<NEW_LINE>this.writer.append(" [label=\"");<NEW_LINE>this.writer.append(mn.getName().toString());<NEW_LINE>this.writer.append("\",style = filled]");<NEW_LINE>this.writer.append(";\n");<NEW_LINE>stack.push(exploreNode);<NEW_LINE>} else {<NEW_LINE>final SemanticNode sn = (SemanticNode) exploreNode;<NEW_LINE>this.writer.append(Integer.toString(sn.hashCode()));<NEW_LINE>this.writer.append(type2format.getOrDefault(exploreNode.getClass(), " [") + "label=\"");<NEW_LINE>if (exploreNode instanceof OpDefNode) {<NEW_LINE>this.writer.append(toDot(((OpDefNode) sn).getName().toString()));<NEW_LINE>} else {<NEW_LINE>this.writer.append(toDot(sn.getTreeNode().getHumanReadableImage()));<NEW_LINE>}<NEW_LINE>if (includeLineNumbers) {<NEW_LINE>// Wrap location for more compact nodes in dot output.<NEW_LINE>final String loc = sn.getLocation().toString();<NEW_LINE>this.writer.append("\n");<NEW_LINE>this.writer.append(loc.replace("of module", "\n"));<NEW_LINE>this.writer.append("\n" + sn.getClass().getSimpleName());<NEW_LINE>}<NEW_LINE>this.writer.append("\"]");<NEW_LINE>this.writer.append(";\n");<NEW_LINE>this.writer.append(Integer.toString(parent.hashCode()));<NEW_LINE>this.writer.append(" -> ");<NEW_LINE>this.writer.append(Integer.toString(sn.hashCode()));<NEW_LINE>this.writer.append("\n");<NEW_LINE>stack.push(sn);<NEW_LINE>}<NEW_LINE>}
final ModuleNode mn = (ModuleNode) exploreNode;
890,848
private void checkAssignment(Varnode output, Varnode value, PcodeOp op, TaskMonitor monitor) throws CancelledException {<NEW_LINE>Varnode[] inputs = op.getInputs();<NEW_LINE>int opcode = op.getOpcode();<NEW_LINE>if (output != null && !output.isUnique() && opcode != PcodeOp.LOAD && opcode != PcodeOp.STORE && opcode != PcodeOp.COPY) {<NEW_LINE>checkStackOffsetAssignment(op, value, monitor);<NEW_LINE>}<NEW_LINE>Register reg = program.getRegister(output.getAddress(), output.getSize());<NEW_LINE>if (reg == null || reg.isProgramCounter() || reg.isProcessorContext() || framePointerCandidatesDismissed.contains(reg.getBaseRegister())) {<NEW_LINE>Msg.debug(this, "SET: " + output + " = " + value);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (addRegister(reg, registersModified)) {<NEW_LINE>if (DEBUG) {<NEW_LINE>Msg.debug(this, "MODIFIED: " + reg + " = " + value);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>Msg.debug(this, <MASK><NEW_LINE>}<NEW_LINE>if (framePointerCandidates.containsKey(reg)) {<NEW_LINE>if (value.getAddress().equals(reg.getAddress())) {<NEW_LINE>// Ignore register restore<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>framePointerCandidatesDismissed.add(reg);<NEW_LINE>framePointerCandidates.remove(reg);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (opcode != PcodeOp.LOAD) {<NEW_LINE>if (value.equals(getStackPointerVarnode()) || (inputs.length == 1 && inputs[0].equals(getStackPointerVarnode())) || (inputs.length == 2 && (inputs[0].equals(getStackPointerVarnode()) || inputs[1].equals(getStackPointerVarnode())))) {<NEW_LINE>framePointerCandidates.put(reg, new FramePointerCandidate(reg, op.getSeqnum(), value));<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>framePointerCandidatesDismissed.add(reg);<NEW_LINE>}
"SET: " + output + " = " + value);
1,049,567
public void write(org.apache.thrift.protocol.TProtocol prot, grayUpgrade_args struct) throws org.apache.thrift.TException {<NEW_LINE>TTupleProtocol oprot = (TTupleProtocol) prot;<NEW_LINE>BitSet optionals = new BitSet();<NEW_LINE>if (struct.is_set_topologyName()) {<NEW_LINE>optionals.set(0);<NEW_LINE>}<NEW_LINE>if (struct.is_set_component()) {<NEW_LINE>optionals.set(1);<NEW_LINE>}<NEW_LINE>if (struct.is_set_workers()) {<NEW_LINE>optionals.set(2);<NEW_LINE>}<NEW_LINE>if (struct.is_set_workerNum()) {<NEW_LINE>optionals.set(3);<NEW_LINE>}<NEW_LINE>oprot.writeBitSet(optionals, 4);<NEW_LINE>if (struct.is_set_topologyName()) {<NEW_LINE>oprot.writeString(struct.topologyName);<NEW_LINE>}<NEW_LINE>if (struct.is_set_component()) {<NEW_LINE>oprot.writeString(struct.component);<NEW_LINE>}<NEW_LINE>if (struct.is_set_workers()) {<NEW_LINE>{<NEW_LINE>oprot.writeI32(<MASK><NEW_LINE>for (String _iter316 : struct.workers) {<NEW_LINE>oprot.writeString(_iter316);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (struct.is_set_workerNum()) {<NEW_LINE>oprot.writeI32(struct.workerNum);<NEW_LINE>}<NEW_LINE>}
struct.workers.size());
1,276,228
public int compareTo(getBlobReplication_result 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 = Boolean.valueOf(is_set_success()).compareTo(other.is_set_success());<NEW_LINE>if (lastComparison != 0) {<NEW_LINE>return lastComparison;<NEW_LINE>}<NEW_LINE>if (is_set_success()) {<NEW_LINE>lastComparison = org.apache.thrift.TBaseHelper.compareTo(<MASK><NEW_LINE>if (lastComparison != 0) {<NEW_LINE>return lastComparison;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>lastComparison = Boolean.valueOf(is_set_knf()).compareTo(other.is_set_knf());<NEW_LINE>if (lastComparison != 0) {<NEW_LINE>return lastComparison;<NEW_LINE>}<NEW_LINE>if (is_set_knf()) {<NEW_LINE>lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.knf, other.knf);<NEW_LINE>if (lastComparison != 0) {<NEW_LINE>return lastComparison;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return 0;<NEW_LINE>}
this.success, other.success);
770,672
private Map<String, List<String>> processAllowedCodes(RuntimeResourceDefinition theResDef, List<AllowedCodeInValueSet> theAllowedCodeInValueSet) {<NEW_LINE>Map<String, <MASK><NEW_LINE>for (AllowedCodeInValueSet next : theAllowedCodeInValueSet) {<NEW_LINE>String resourceName = next.getResourceName();<NEW_LINE>String valueSetUrl = next.getValueSetUrl();<NEW_LINE>ValidateUtil.isNotBlankOrThrowIllegalArgument(resourceName, "Resource name supplied by SearchNarrowingInterceptor must not be null");<NEW_LINE>ValidateUtil.isNotBlankOrThrowIllegalArgument(valueSetUrl, "ValueSet URL supplied by SearchNarrowingInterceptor must not be null");<NEW_LINE>if (!resourceName.equals(theResDef.getName())) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (shouldHandleThroughConsentService(valueSetUrl)) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>String paramName;<NEW_LINE>if (next.isNegate()) {<NEW_LINE>paramName = next.getSearchParameterName() + Constants.PARAMQUALIFIER_TOKEN_NOT_IN;<NEW_LINE>} else {<NEW_LINE>paramName = next.getSearchParameterName() + Constants.PARAMQUALIFIER_TOKEN_IN;<NEW_LINE>}<NEW_LINE>if (retVal == null) {<NEW_LINE>retVal = new HashMap<>();<NEW_LINE>}<NEW_LINE>retVal.computeIfAbsent(paramName, k -> new ArrayList<>()).add(valueSetUrl);<NEW_LINE>}<NEW_LINE>return retVal;<NEW_LINE>}
List<String>> retVal = null;
1,010,353
public List<T> query(String filter, String sortBy, boolean ascending, String zoneId) {<NEW_LINE>validateOrderBy(queryConverter.map(sortBy));<NEW_LINE>SearchQueryConverter.ProcessedFilter where = queryConverter.convert(filter, sortBy, ascending, zoneId);<NEW_LINE>logger.debug("Filtering groups with SQL: " + where);<NEW_LINE>List<T> result;<NEW_LINE>try {<NEW_LINE>String completeSql = getQuerySQL(where);<NEW_LINE>logger.debug("complete sql: " + completeSql + ", params: " + where.getParams());<NEW_LINE>if (pageSize > 0 && pageSize < Integer.MAX_VALUE) {<NEW_LINE>result = pagingListFactory.createJdbcPagingList(completeSql, where.getParams(), rowMapper, pageSize);<NEW_LINE>} else {<NEW_LINE>result = namedParameterJdbcTemplate.query(completeSql, where.getParams(), rowMapper);<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>} catch (DataAccessException e) {<NEW_LINE>logger.debug(<MASK><NEW_LINE>throw new IllegalArgumentException("Invalid filter: " + filter);<NEW_LINE>}<NEW_LINE>}
"Filter '" + filter + "' generated invalid SQL", e);