idx
int32
46
1.86M
input
stringlengths
321
6.6k
target
stringlengths
9
1.24k
216,751
private static void generateBOM(boolean isWebsphereLiberty, String version, File outputDir, Map<String, LibertyFeature> allFeatures, Constants.ArtifactType type) throws MavenRepoGeneratorException, IOException {<NEW_LINE>String groupId = isWebsphereLiberty ? Constants.WEBSPHERE_LIBERTY_FEATURES_GROUP_ID : Constants.OPEN_LIBERTY_FEATURES_GROUP_ID;<NEW_LINE>MavenCoordinates coordinates = new MavenCoordinates(groupId, Constants.BOM_ARTIFACT_ID, version);<NEW_LINE>Model model = new Model();<NEW_LINE>model.setModelVersion(Constants.MAVEN_MODEL_VERSION);<NEW_LINE>model.setGroupId(coordinates.getGroupId());<NEW_LINE>model.setArtifactId(coordinates.getArtifactId());<NEW_LINE>model.setVersion(coordinates.getVersion());<NEW_LINE>model.setPackaging(Constants.ArtifactType.POM.getType());<NEW_LINE>setLicense(model, version, false, false, isWebsphereLiberty);<NEW_LINE>List<Dependency> dependencies = new ArrayList<Dependency>();<NEW_LINE>DependencyManagement dependencyManagement = new DependencyManagement();<NEW_LINE>model.setDependencyManagement(dependencyManagement);<NEW_LINE>dependencyManagement.setDependencies(dependencies);<NEW_LINE>for (LibertyFeature feature : allFeatures.values()) {<NEW_LINE>MavenCoordinates requiredArtifact = feature.getMavenCoordinates();<NEW_LINE>if (requiredArtifact.getGroupId() == coordinates.getGroupId()) {<NEW_LINE>addDependency(dependencies, requiredArtifact, type, "provided");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (isWebsphereLiberty) {<NEW_LINE>MavenCoordinates openLibertyCoordinates = new MavenCoordinates(Constants.OPEN_LIBERTY_FEATURES_GROUP_ID, Constants.BOM_ARTIFACT_ID, version);<NEW_LINE>addDependency(dependencies, openLibertyCoordinates, Constants.ArtifactType.POM, "import");<NEW_LINE>model.setName(Constants.WEBSPHERE_LIBERTY_BOM);<NEW_LINE>model.setDescription(Constants.WEBSPHERE_LIBERTY_BOM);<NEW_LINE>} else {<NEW_LINE>model.setName(Constants.OPEN_LIBERTY_BOM);<NEW_LINE>model.setDescription(Constants.OPEN_LIBERTY_BOM);<NEW_LINE>setScmDevUrl(model);<NEW_LINE>}<NEW_LINE>File artifactDir = new File(outputDir<MASK><NEW_LINE>artifactDir.mkdirs();<NEW_LINE>File targetFile = new File(artifactDir, Utils.getFileName(coordinates, Constants.ArtifactType.POM));<NEW_LINE>if (!targetFile.exists()) {<NEW_LINE>targetFile.createNewFile();<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>Writer writer = new FileWriter(targetFile);<NEW_LINE>new MavenXpp3Writer().write(writer, model);<NEW_LINE>writer.close();<NEW_LINE>} catch (IOException e) {<NEW_LINE>throw new MavenRepoGeneratorException("Could not write POM file " + targetFile, e);<NEW_LINE>}<NEW_LINE>}
, Utils.getRepositorySubpath(coordinates));
1,715,018
public static PresentationE fromJson(String presentationJson) {<NEW_LINE>if (StringUtils.isBlank(presentationJson)) {<NEW_LINE>logger.error("create PresentationE with JSON String failed, " + "the presentation JSON String is null");<NEW_LINE>throw new DataTypeCastException("the presentation JSON String is null");<NEW_LINE>}<NEW_LINE>String presentationString = presentationJson;<NEW_LINE>if (DataToolUtils.isValidFromToJson(presentationJson)) {<NEW_LINE>presentationString = DataToolUtils.removeTagFromToJson(presentationJson);<NEW_LINE>}<NEW_LINE>PresentationE presentationE = DataToolUtils.deserialize(DataToolUtils.convertUtcToTimestamp<MASK><NEW_LINE>if (presentationE == null || presentationE.getVerifiableCredential() == null || presentationE.getVerifiableCredential().isEmpty()) {<NEW_LINE>logger.error("create PresentationE with JSON String failed, " + "due to convert UTC to Timestamp error");<NEW_LINE>throw new DataTypeCastException("convert UTC to Timestamp error");<NEW_LINE>}<NEW_LINE>for (CredentialPojo credentialPojo : presentationE.getVerifiableCredential()) {<NEW_LINE>ErrorCode checkResp = CredentialPojoUtils.isCredentialPojoValid(credentialPojo);<NEW_LINE>if (ErrorCode.SUCCESS.getCode() != checkResp.getCode()) {<NEW_LINE>logger.error("create PresentationE with JSON String failed, {}", checkResp.getCodeDesc());<NEW_LINE>throw new DataTypeCastException(checkResp.getCodeDesc());<NEW_LINE>}<NEW_LINE>if (!CredentialPojoUtils.validClaimAndSaltForMap(credentialPojo.getClaim(), credentialPojo.getSalt())) {<NEW_LINE>logger.error("create PresentationE with JSON String failed, claim and salt of " + "credentialPojo not match.");<NEW_LINE>throw new DataTypeCastException("claim and salt of credentialPojo not match.");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return presentationE;<NEW_LINE>}
(presentationString), PresentationE.class);
1,483,488
public void renderFaces(Tesselator tessellator, BufferBuilder bufferBuilder, double cx, double cy, double cz, float partialTick) {<NEW_LINE>if (shape.fa == 0.0)<NEW_LINE>return;<NEW_LINE>Vec3 v1 = shape.relativiseRender(client.<MASK><NEW_LINE>Vec3 v2 = shape.relativiseRender(client.level, shape.to, partialTick);<NEW_LINE>// consider using built-ins<NEW_LINE>// DebugRenderer.drawBox(new Box(v1.x, v1.y, v1.z, v2.x, v2.y, v2.z), 0.5f, 0.5f, 0.5f, 0.5f);//shape.r, shape.g, shape.b, shape.a);<NEW_LINE>drawBoxFaces(tessellator, bufferBuilder, (float) (v1.x - cx - renderEpsilon), (float) (v1.y - cy - renderEpsilon), (float) (v1.z - cz - renderEpsilon), (float) (v2.x - cx + renderEpsilon), (float) (v2.y - cy + renderEpsilon), (float) (v2.z - cz + renderEpsilon), v1.x != v2.x, v1.y != v2.y, v1.z != v2.z, shape.fr, shape.fg, shape.fb, shape.fa);<NEW_LINE>}
level, shape.from, partialTick);
950,441
private void runAssertionSubquery(RegressionEnvironment env, RegressionPath path) {<NEW_LINE>// test expression reuse<NEW_LINE>String epl = "@name('s0') expression q {" + " x => (select * from Win where intPrimitive = x.p00)" + "}" + "select " + "q(st0).where(x => theString = key0) as val0, " + "q(st0).where(x => theString = key0) as val1, " + "q(st0).where(x => theString = key0) as val2, " + "q(st0).where(x => theString = key0) as val3, " + "q(st0).where(x => theString = key0) as val4, " + "q(st0).where(x => theString = key0) as val5, " + "q(st0).where(x => theString = key0) as val6, " + "q(st0).where(x => theString = key0) as val7, " + "q(st0).where(x => theString = key0) as val8, " + "q(st0).where(x => theString = key0) as val9 " + "from SupportBean_ST0 st0";<NEW_LINE>env.compileDeploy(epl, path).addListener("s0");<NEW_LINE>long start = System.currentTimeMillis();<NEW_LINE>for (int i = 0; i < 5000; i++) {<NEW_LINE>env.sendEventBean(new SupportBean_ST0("ID", "K50", 1050));<NEW_LINE>env.assertEventNew("s0", event -> {<NEW_LINE>for (int j = 0; j < 10; j++) {<NEW_LINE>Collection coll = (Collection) event.get("val" + j);<NEW_LINE>assertEquals(1, coll.size());<NEW_LINE>SupportBean bean = (SupportBean) coll.iterator().next();<NEW_LINE>assertEquals("K50", bean.getTheString());<NEW_LINE>assertEquals(1050, bean.getIntPrimitive());<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}<NEW_LINE>long delta <MASK><NEW_LINE>assertTrue("Delta = " + delta, delta < 1000);<NEW_LINE>env.undeployModuleContaining("s0");<NEW_LINE>}
= System.currentTimeMillis() - start;
872,196
private void validateFields(int line, boolean isConfig, FileTab fileTab) throws IOException, ClassNotFoundException {<NEW_LINE>List<String> relationalFieldList = fileTab.getFileFieldList().stream().filter(field -> !Strings.isNullOrEmpty(field.getSubImportField())).map(field -> field.getImportField().getName() + "." + field.getSubImportField()).collect(Collectors.toList());<NEW_LINE>for (FileField fileField : fileTab.getFileFieldList()) {<NEW_LINE>MetaField importField = fileField.getImportField();<NEW_LINE>if (importField != null && Strings.isNullOrEmpty(fileField.getSubImportField())) {<NEW_LINE>if (importField.getRelationship() != null) {<NEW_LINE>logService.addLog(IExceptionMessage.ADVANCED_IMPORT_LOG_4, importField.getName(), line);<NEW_LINE>}<NEW_LINE>this.validateImportRequiredField(line, Class.forName(fileTab.getMetaModel().getFullName()), importField.<MASK><NEW_LINE>this.validateDateField(line, fileField);<NEW_LINE>} else if (!Strings.isNullOrEmpty(fileField.getSubImportField())) {<NEW_LINE>Mapper mapper = advancedImportService.getMapper(importField.getMetaModel().getFullName());<NEW_LINE>Property parentProp = mapper.getProperty(importField.getName());<NEW_LINE>if (parentProp == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>Property subProperty = this.getAndValidateSubField(line, parentProp, fileField, false);<NEW_LINE>if (subProperty != null) {<NEW_LINE>this.validateImportRequiredField(line, subProperty.getEntity(), subProperty.getName(), fileField, relationalFieldList);<NEW_LINE>this.validateDateField(line, fileField);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
getName(), fileField, null);
648,095
public final void takeVideoSnapshot(@NonNull final VideoResult.Stub stub, @NonNull final File file) {<NEW_LINE>getOrchestrator().scheduleStateful("take video snapshot", CameraState.BIND, new Runnable() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void run() {<NEW_LINE>LOG.i("takeVideoSnapshot:", "running. isTakingVideo:", isTakingVideo());<NEW_LINE>stub.file = file;<NEW_LINE>stub.isSnapshot = true;<NEW_LINE>stub.videoCodec = mVideoCodec;<NEW_LINE>stub.audioCodec = mAudioCodec;<NEW_LINE>stub.location = mLocation;<NEW_LINE>stub.facing = mFacing;<NEW_LINE>stub.videoBitRate = mVideoBitRate;<NEW_LINE>stub.audioBitRate = mAudioBitRate;<NEW_LINE>stub.audio = mAudio;<NEW_LINE>stub.maxSize = mVideoMaxSize;<NEW_LINE>stub.maxDuration = mVideoMaxDuration;<NEW_LINE>// noinspection ConstantConditions<NEW_LINE>AspectRatio ratio = AspectRatio.of<MASK><NEW_LINE>onTakeVideoSnapshot(stub, ratio);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}
(getPreviewSurfaceSize(Reference.OUTPUT));
511,530
public static List<VolumeResponse> createVolumeResponse(ResponseView view, VolumeJoinVO... volumes) {<NEW_LINE>Hashtable<Long, VolumeResponse> vrDataList = new Hashtable<Long, VolumeResponse>();<NEW_LINE>DecimalFormat df = new DecimalFormat("0.0%");<NEW_LINE>for (VolumeJoinVO vr : volumes) {<NEW_LINE>VolumeResponse vrData = vrDataList.get(vr.getId());<NEW_LINE>if (vrData == null) {<NEW_LINE>// first time encountering this volume<NEW_LINE>vrData = ApiDBUtils.newVolumeResponse(view, vr);<NEW_LINE>} else {<NEW_LINE>// update tags<NEW_LINE>vrData = ApiDBUtils.fillVolumeDetails(view, vrData, vr);<NEW_LINE>}<NEW_LINE>vrDataList.put(vr.getId(), vrData);<NEW_LINE>VolumeStats vs = null;<NEW_LINE>if (vr.getFormat() == ImageFormat.VHD || vr.getFormat() == ImageFormat.QCOW2 || vr.getFormat() == ImageFormat.RAW) {<NEW_LINE>if (vrData.getPath() != null) {<NEW_LINE>vs = ApiDBUtils.getVolumeStatistics(vrData.getPath());<NEW_LINE>}<NEW_LINE>} else if (vr.getFormat() == ImageFormat.OVA) {<NEW_LINE>if (vrData.getChainInfo() != null) {<NEW_LINE>vs = ApiDBUtils.getVolumeStatistics(vrData.getChainInfo());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (vs != null) {<NEW_LINE>long vsz = vs.getVirtualSize();<NEW_LINE><MASK><NEW_LINE>double util = (double) psz / vsz;<NEW_LINE>vrData.setUtilization(df.format(util));<NEW_LINE>if (view == ResponseView.Full) {<NEW_LINE>vrData.setVirtualsize(vsz);<NEW_LINE>vrData.setPhysicalsize(psz);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return new ArrayList<VolumeResponse>(vrDataList.values());<NEW_LINE>}
long psz = vs.getPhysicalSize();
1,614,712
protected Map<String, Object> initializeCommandLineModel(InitializrMetadata metadata, String serviceUrl) {<NEW_LINE>Map<String, Object> model = new LinkedHashMap<>();<NEW_LINE>model.put("logo", LOGO);<NEW_LINE>model.put("serviceUrl", serviceUrl);<NEW_LINE>model.put("dependencies", generateDependencyTable(metadata));<NEW_LINE>model.put("types", generateTypeTable(metadata, "Rel", false));<NEW_LINE>Map<String, Object> defaults = metadata.defaults();<NEW_LINE>defaults.put("applicationName", metadata.getConfiguration().generateApplicationName(metadata.getName().getContent()));<NEW_LINE>defaults.put("baseDir", "no base dir");<NEW_LINE>defaults.put("dependencies", "none");<NEW_LINE>Map<String, Object> parametersDescription = buildParametersDescription(metadata);<NEW_LINE>String[][] parameterTable = new String[defaults.size() + 1][];<NEW_LINE>parameterTable[0] = new String[] { "Parameter", "Description", "Default value" };<NEW_LINE>int i = 1;<NEW_LINE>for (String id : defaults.keySet().stream().sorted().collect(Collectors.toList())) {<NEW_LINE>String[] data = new String[3];<NEW_LINE>data[0] = id;<NEW_LINE>data[1] = (<MASK><NEW_LINE>data[2] = (String) defaults.get(id);<NEW_LINE>parameterTable[i++] = data;<NEW_LINE>}<NEW_LINE>model.put("parameters", TableGenerator.generate(parameterTable, this.maxColumnWidth));<NEW_LINE>return model;<NEW_LINE>}
String) parametersDescription.get(id);
106,458
/*<NEW_LINE>* (non-Javadoc)<NEW_LINE>*<NEW_LINE>* @see javax.transaction.Synchronization#afterCompletion(int)<NEW_LINE>*/<NEW_LINE>@Override<NEW_LINE>public void afterCompletion(int status) {<NEW_LINE>if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())<NEW_LINE>Tr.entry(tc, "afterCompletion : " + status + " : " + this);<NEW_LINE>// JPA 5.9.1 Container Responsibilities<NEW_LINE>// - After the JTA transaction has completed (either by transaction commit or rollback),<NEW_LINE>// The container closes the entity manager by calling EntityManager.close. [39]<NEW_LINE>//<NEW_LINE>// [39] The container may choose to pool EntityManagers and instead of creating and<NEW_LINE>// closing in each case acquire one from its pool and call clear() on it.<NEW_LINE>// Note : em may be null now, if it was non-transactional. d472866.1<NEW_LINE>if (ivEm != null) {<NEW_LINE>// d510184<NEW_LINE>ivJpaEm.closeTxEntityManager(ivEm, ivPoolEM);<NEW_LINE>}<NEW_LINE>if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())<NEW_LINE><MASK><NEW_LINE>}
Tr.exit(tc, "afterCompletion");
69,408
public EdgeLabel readEdgeLabel(HugeGraph graph, BackendEntry backendEntry) {<NEW_LINE>if (backendEntry == null) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>TableBackendEntry entry = this.convertEntry(backendEntry);<NEW_LINE>Number id = schemaColumn(entry, HugeKeys.ID);<NEW_LINE>String name = schemaColumn(entry, HugeKeys.NAME);<NEW_LINE>Frequency frequency = schemaEnum(entry, HugeKeys.FREQUENCY, Frequency.class);<NEW_LINE>Number sourceLabel = schemaColumn(entry, HugeKeys.SOURCE_LABEL);<NEW_LINE>Number targetLabel = schemaColumn(entry, HugeKeys.TARGET_LABEL);<NEW_LINE>Object sortKeys = schemaColumn(entry, HugeKeys.SORT_KEYS);<NEW_LINE>Object nullableKeys = schemaColumn(entry, HugeKeys.NULLABLE_KEYS);<NEW_LINE>Object properties = schemaColumn(entry, HugeKeys.PROPERTIES);<NEW_LINE>Object indexLabels = schemaColumn(entry, HugeKeys.INDEX_LABELS);<NEW_LINE>SchemaStatus status = schemaEnum(entry, HugeKeys.STATUS, SchemaStatus.class);<NEW_LINE>Number ttl = schemaColumn(entry, HugeKeys.TTL);<NEW_LINE>Number ttlStartTime = schemaColumn(entry, HugeKeys.TTL_START_TIME);<NEW_LINE>EdgeLabel edgeLabel = new EdgeLabel(graph, this.toId(id), name);<NEW_LINE>edgeLabel.frequency(frequency);<NEW_LINE>edgeLabel.sourceLabel(this.toId(sourceLabel));<NEW_LINE>edgeLabel.targetLabel(this.toId(targetLabel));<NEW_LINE>edgeLabel.properties(this.toIdArray(properties));<NEW_LINE>edgeLabel.sortKeys<MASK><NEW_LINE>edgeLabel.nullableKeys(this.toIdArray(nullableKeys));<NEW_LINE>edgeLabel.indexLabels(this.toIdArray(indexLabels));<NEW_LINE>edgeLabel.status(status);<NEW_LINE>edgeLabel.ttl(ttl.longValue());<NEW_LINE>edgeLabel.ttlStartTime(this.toId(ttlStartTime));<NEW_LINE>this.readEnableLabelIndex(edgeLabel, entry);<NEW_LINE>this.readUserdata(edgeLabel, entry);<NEW_LINE>return edgeLabel;<NEW_LINE>}
(this.toIdArray(sortKeys));
156,072
public static void renderSelections(ISelection[] selections) {<NEW_LINE>float opacity = settings.selectionOpacity.value;<NEW_LINE>boolean ignoreDepth = settings.renderSelectionIgnoreDepth.value;<NEW_LINE>float lineWidth = settings.selectionLineWidth.value;<NEW_LINE>if (!settings.renderSelection.value) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>IRenderer.startLines(settings.colorSelection.value, opacity, lineWidth, ignoreDepth);<NEW_LINE>for (ISelection selection : selections) {<NEW_LINE>IRenderer.drawAABB(selection.aabb(), SELECTION_BOX_EXPANSION);<NEW_LINE>}<NEW_LINE>if (settings.renderSelectionCorners.value) {<NEW_LINE>IRenderer.glColor(settings.colorSelectionPos1.value, opacity);<NEW_LINE>for (ISelection selection : selections) {<NEW_LINE>IRenderer.drawAABB(new AxisAlignedBB(selection.pos1(), selection.pos1().add(<MASK><NEW_LINE>}<NEW_LINE>IRenderer.glColor(settings.colorSelectionPos2.value, opacity);<NEW_LINE>for (ISelection selection : selections) {<NEW_LINE>IRenderer.drawAABB(new AxisAlignedBB(selection.pos2(), selection.pos2().add(1, 1, 1)));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>IRenderer.endLines(ignoreDepth);<NEW_LINE>}
1, 1, 1)));
1,455,221
public <R extends Record, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13> MergeKeyStep13<R, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13> mergeInto(Table<R> table, Field<T1> field1, Field<T2> field2, Field<T3> field3, Field<T4> field4, Field<T5> field5, Field<T6> field6, Field<T7> field7, Field<T8> field8, Field<T9> field9, Field<T10> field10, Field<T11> field11, Field<T12> field12, Field<T13> field13) {<NEW_LINE>return context.mergeInto(table, field1, field2, field3, field4, field5, field6, field7, field8, field9, <MASK><NEW_LINE>}
field10, field11, field12, field13);
200,806
private static void checkUpdateServerResources(File sunResourcesXml, Hk2DeploymentManager dm) {<NEW_LINE>Map<String, String> changedData = new HashMap<String, String>();<NEW_LINE>List<TreeParser.Path> pathList = new ArrayList<TreeParser.Path>();<NEW_LINE>// NOI18N<NEW_LINE>ResourceFinder cpFinder = new ResourceFinder("name");<NEW_LINE>// NOI18N<NEW_LINE>pathList.add(new TreeParser.Path("/resources/jdbc-connection-pool", cpFinder));<NEW_LINE>// NOI18N<NEW_LINE>ResourceFinder jdbcFinder = new ResourceFinder("jndi-name");<NEW_LINE>// NOI18N<NEW_LINE>pathList.add(new TreeParser.Path("/resources/jdbc-resource", jdbcFinder));<NEW_LINE>// NOI18N<NEW_LINE>ResourceFinder connectorPoolFinder = new ResourceFinder("name");<NEW_LINE>// NOI18N<NEW_LINE>pathList.add(new TreeParser.Path("/resources/connector-connection-pool", connectorPoolFinder));<NEW_LINE>// NOI18N<NEW_LINE>ResourceFinder connectorFinder = new ResourceFinder("jndi-name");<NEW_LINE>// NOI18N<NEW_LINE>pathList.add(new TreeParser.Path("/resources/connector-resource", connectorFinder));<NEW_LINE>// NOI18N<NEW_LINE>ResourceFinder aoFinder = new ResourceFinder("jndi-name");<NEW_LINE>// NOI18N<NEW_LINE>pathList.add(new TreeParser.Path("/resources/admin-object-resource", aoFinder));<NEW_LINE>// NOI18N<NEW_LINE>ResourceFinder mailFinder = new ResourceFinder("jndi-name");<NEW_LINE>// NOI18N<NEW_LINE>pathList.add(new TreeParser.Path("/resources/mail-resource", mailFinder));<NEW_LINE>try {<NEW_LINE>TreeParser.readXml(sunResourcesXml, pathList);<NEW_LINE>} catch (IllegalStateException ex) {<NEW_LINE>// NOI18N<NEW_LINE>Logger.getLogger("payara-jakartaee").log(Level.INFO, ex.getLocalizedMessage(), ex);<NEW_LINE>}<NEW_LINE>// NOI18N<NEW_LINE>Map<String, String> <MASK><NEW_LINE>// NOI18N<NEW_LINE>changedData = checkResources(cpFinder, "resources.jdbc-connection-pool.", allRemoteData, changedData, dm);<NEW_LINE>// NOI18N<NEW_LINE>changedData = checkResources(jdbcFinder, "resources.jdbc-resource.", allRemoteData, changedData, dm);<NEW_LINE>// NOI18N<NEW_LINE>changedData = checkResources(connectorPoolFinder, "resources.connector-connection-pool.", allRemoteData, changedData, dm);<NEW_LINE>// NOI18N<NEW_LINE>changedData = checkResources(connectorFinder, "resources.connector-resource.", allRemoteData, changedData, dm);<NEW_LINE>// NOI18N<NEW_LINE>changedData = checkResources(aoFinder, "resources.admin-object-resource.", allRemoteData, changedData, dm);<NEW_LINE>// NOI18N<NEW_LINE>changedData = checkResources(mailFinder, "resources.mail-resource.", allRemoteData, changedData, dm);<NEW_LINE>if (changedData.size() > 0) {<NEW_LINE>putResourceData(changedData, dm);<NEW_LINE>}<NEW_LINE>}
allRemoteData = getResourceData("resources.*", dm);
577,021
private Result<TracePoint> splitResultIfNeeded(String agentRollupId, TraceQuery query, int limit, DelegateResultAction action) throws Exception {<NEW_LINE>TraceQueryPlan plan = getPlan(agentRollupId, query);<NEW_LINE>TraceQuery queryV09 = plan.queryV09();<NEW_LINE>TraceQuery queryPostV09 = plan.queryPostV09();<NEW_LINE>if (queryV09 == null) {<NEW_LINE>checkNotNull(queryPostV09);<NEW_LINE>return action.result(agentRollupId, queryPostV09);<NEW_LINE>} else if (queryPostV09 == null) {<NEW_LINE>checkNotNull(queryV09);<NEW_LINE>return convertFromV09(action.result(V09Support.convertToV09(agentRollupId), queryV09));<NEW_LINE>} else {<NEW_LINE>Result<TracePoint> resultV09 = convertFromV09(action.result(V09Support.convertToV09(agentRollupId), queryV09));<NEW_LINE>Result<TracePoint> resultPostV09 = action.result(agentRollupId, queryPostV09);<NEW_LINE>List<TracePoint> tracePoints = new ArrayList<>();<NEW_LINE>tracePoints.addAll(resultV09.records());<NEW_LINE>tracePoints.addAll(resultPostV09.records());<NEW_LINE>if (tracePoints.size() > limit) {<NEW_LINE>tracePoints = <MASK><NEW_LINE>return new Result<>(tracePoints, true);<NEW_LINE>} else {<NEW_LINE>tracePoints = Ordering.from(Comparator.comparingLong(TracePoint::captureTime)).sortedCopy(tracePoints);<NEW_LINE>return new Result<>(tracePoints, resultV09.moreAvailable() || resultPostV09.moreAvailable());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
TraceDaoImpl.applyLimitByDurationNanosAndThenSortByCaptureTime(tracePoints, limit);
292,448
public String revertToSnapshot(final Connection conn, final VM vmSnapshot, final String vmName, final String oldVmUuid, final Boolean snapshotMemory, final String hostUUID) throws Types.XenAPIException, XmlRpcException {<NEW_LINE>final String results = callHostPluginAsync(conn, "vmopsSnapshot", "revert_memory_snapshot", 10 * 60 * 1000, "snapshotUUID", vmSnapshot.getUuid(conn), "vmName", vmName, "oldVmUuid", oldVmUuid, "snapshotMemory", snapshotMemory.<MASK><NEW_LINE>String errMsg = null;<NEW_LINE>if (results == null || results.isEmpty()) {<NEW_LINE>errMsg = "revert_memory_snapshot return null";<NEW_LINE>} else {<NEW_LINE>if (results.equals("0")) {<NEW_LINE>return results;<NEW_LINE>} else {<NEW_LINE>errMsg = "revert_memory_snapshot exception";<NEW_LINE>}<NEW_LINE>}<NEW_LINE>s_logger.warn(errMsg);<NEW_LINE>throw new CloudRuntimeException(errMsg);<NEW_LINE>}
toString(), "hostUUID", hostUUID);
562,062
protected static void readConfig() {<NEW_LINE>send_peer_ids = COConfigurationManager.getBooleanParameter("Tracker Send Peer IDs");<NEW_LINE>max_peers_to_send = COConfigurationManager.getIntParameter("Tracker Max Peers Returned");<NEW_LINE>scrape_cache_period = COConfigurationManager.getIntParameter("Tracker Scrape Cache", TRTrackerServer.DEFAULT_SCRAPE_CACHE_PERIOD);<NEW_LINE>announce_cache_period = COConfigurationManager.getIntParameter("Tracker Announce Cache", TRTrackerServer.DEFAULT_ANNOUNCE_CACHE_PERIOD);<NEW_LINE>announce_cache_threshold = COConfigurationManager.getIntParameter("Tracker Announce Cache Min Peers", TRTrackerServer.DEFAULT_ANNOUNCE_CACHE_PEER_THRESHOLD);<NEW_LINE>max_seed_retention = COConfigurationManager.getIntParameter("Tracker Max Seeds Retained", 0);<NEW_LINE>seed_limit = COConfigurationManager.getIntParameter("Tracker Max Seeds", 0);<NEW_LINE>List nets = new ArrayList();<NEW_LINE>for (int i = 0; i < AENetworkClassifier.AT_NETWORKS.length; i++) {<NEW_LINE>String <MASK><NEW_LINE>boolean enabled = COConfigurationManager.getBooleanParameter("Tracker Network Selection Default." + net);<NEW_LINE>if (enabled) {<NEW_LINE>nets.add(net);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>String[] s_nets = new String[nets.size()];<NEW_LINE>nets.toArray(s_nets);<NEW_LINE>permitted_networks = s_nets;<NEW_LINE>all_networks_permitted = s_nets.length == AENetworkClassifier.AT_NETWORKS.length;<NEW_LINE>full_scrape_enable = COConfigurationManager.getBooleanParameter("Tracker Server Full Scrape Enable");<NEW_LINE>redirect_on_not_found = COConfigurationManager.getStringParameter("Tracker Server Not Found Redirect").trim();<NEW_LINE>support_experimental_extensions = COConfigurationManager.getBooleanParameter("Tracker Server Support Experimental Extensions");<NEW_LINE>restrict_non_blocking_requests = COConfigurationManager.getBooleanParameter("Tracker TCP NonBlocking Restrict Request Types");<NEW_LINE>String banned = COConfigurationManager.getStringParameter("Tracker Banned Clients", "").trim();<NEW_LINE>banned_clients.clear();<NEW_LINE>if (banned.length() > 0) {<NEW_LINE>banned = banned.toLowerCase(Locale.US).replaceAll(";", ",");<NEW_LINE>String[] bits = banned.split(",");<NEW_LINE>for (String b : bits) {<NEW_LINE>b = b.trim();<NEW_LINE>if (b.length() > 0) {<NEW_LINE>banned_clients.add(b);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
net = AENetworkClassifier.AT_NETWORKS[i];
141,697
private void postProcessCaches() {<NEW_LINE>IClassPath classPath = analysisCache.getClassPath();<NEW_LINE>Map<ClassDescriptor, Object> classAnalysis = analysisCache.getClassAnalysis(ClassData.class);<NEW_LINE>if (classAnalysis == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>Set<Entry<ClassDescriptor, Object>> entrySet = classAnalysis.entrySet();<NEW_LINE>AnalysisData data = new AnalysisData();<NEW_LINE>for (Entry<ClassDescriptor, Object> entry : entrySet) {<NEW_LINE>data.classCount++;<NEW_LINE>if (!(entry.getValue() instanceof ClassData)) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>ClassData cd = (ClassData) entry.getValue();<NEW_LINE>data.byteSize += cd.getData().length;<NEW_LINE>}<NEW_LINE>Set<Entry<String, ICodeBaseEntry>> entrySet2 = classPath.getApplicationCodebaseEntries().entrySet();<NEW_LINE>DescriptorFactory descriptorFactory = DescriptorFactory.instance();<NEW_LINE>for (Entry<String, ICodeBaseEntry> entry : entrySet2) {<NEW_LINE>String className = entry.getKey();<NEW_LINE>if (cacheClassData) {<NEW_LINE>if (className.endsWith(".class")) {<NEW_LINE>className = className.substring(0, className.length() - 6);<NEW_LINE>}<NEW_LINE>classAnalysis.remove(descriptorFactory.getClassDescriptor(className));<NEW_LINE>}<NEW_LINE>data.byteSizeApp += entry.getValue().getNumBytes();<NEW_LINE>}<NEW_LINE>if (cacheClassData) {<NEW_LINE>// create new reference not reachable to anyone except us<NEW_LINE>classAnalysis = new HashMap<MASK><NEW_LINE>classAnalysisCache.put(project, new SoftReference<Map<ClassDescriptor, Object>>(classAnalysis));<NEW_LINE>}<NEW_LINE>reportExtraData(data);<NEW_LINE>}
<ClassDescriptor, Object>(classAnalysis);
1,730,959
public com.amazonaws.services.lambda.model.ServiceException unmarshallFromContext(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>com.amazonaws.services.lambda.model.ServiceException serviceException = new com.amazonaws.services.<MASK><NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>if (context.testExpression("Type", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>serviceException.setType(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return serviceException;<NEW_LINE>}
lambda.model.ServiceException(null);
164,843
final GetWebhookResult executeGetWebhook(GetWebhookRequest getWebhookRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(getWebhookRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<GetWebhookRequest> request = null;<NEW_LINE>Response<GetWebhookResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new GetWebhookRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(getWebhookRequest));<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, "Amplify");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "GetWebhook");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<GetWebhookResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new GetWebhookResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
HandlerContextKey.SIGNING_REGION, getSigningRegion());
1,655,288
public Optional<DocumentLayoutDetailDescriptor.Builder> layoutDetail() {<NEW_LINE>final DocumentEntityDescriptor.Builder entityDescriptor = documentEntity();<NEW_LINE>logger.trace("Generating layout detail for {}", entityDescriptor);<NEW_LINE>// If the detail is never displayed then don't add it to layout<NEW_LINE>final ILogicExpression tabDisplayLogic = descriptorsFactory.getTabDisplayLogic();<NEW_LINE>if (tabDisplayLogic.isConstantFalse()) {<NEW_LINE>logger.trace("Skip adding detail tab to layout because it's never displayed: {}, tabDisplayLogic={}", entityDescriptor, tabDisplayLogic);<NEW_LINE>return Optional.empty();<NEW_LINE>}<NEW_LINE>final Builder layoutSingleRow = layoutSingleRow();<NEW_LINE>final DocumentLayoutDetailDescriptor.Builder builder = DocumentLayoutDetailDescriptor.builder(entityDescriptor.getWindowId(), entityDescriptor.getDetailId()).caption(entityDescriptor.getCaption()).description(entityDescriptor.getDescription()).internalName(entityDescriptor.getInternalName()).gridLayout(layoutGridView()).singleRowLayout(layoutSingleRow).queryOnActivate(entityDescriptor.isQueryIncludedTabOnActivate()).quickInputSupport(extractQuickInputSupport(entityDescriptor)).<MASK><NEW_LINE>return Optional.of(builder);<NEW_LINE>}
newRecordInputMode(entityDescriptor.getIncludedTabNewRecordInputMode());
91,595
public static QueryResult queryExpr(FilterOperator operator, String database, String measurement, ServiceProvider serviceProvider, Map<String, Integer> fieldOrders, Long sessionId) throws AuthException {<NEW_LINE>if (operator == null) {<NEW_LINE>List<IExpression> <MASK><NEW_LINE>return queryByConditions(expressions, database, measurement, serviceProvider, fieldOrders, sessionId);<NEW_LINE>} else if (operator instanceof BasicFunctionOperator) {<NEW_LINE>List<IExpression> iExpressions = new ArrayList<>();<NEW_LINE>iExpressions.add(getIExpressionForBasicFunctionOperator((BasicFunctionOperator) operator));<NEW_LINE>return queryByConditions(iExpressions, database, measurement, serviceProvider, fieldOrders, sessionId);<NEW_LINE>} else {<NEW_LINE>FilterOperator leftOperator = operator.getChildren().get(0);<NEW_LINE>FilterOperator rightOperator = operator.getChildren().get(1);<NEW_LINE>if (operator.getFilterType() == FilterConstant.FilterType.KW_OR) {<NEW_LINE>return QueryResultUtils.orQueryResultProcess(queryExpr(leftOperator, database, measurement, serviceProvider, fieldOrders, sessionId), queryExpr(rightOperator, database, measurement, serviceProvider, fieldOrders, sessionId));<NEW_LINE>} else if (operator.getFilterType() == FilterConstant.FilterType.KW_AND) {<NEW_LINE>if (canMergeOperator(leftOperator) && canMergeOperator(rightOperator)) {<NEW_LINE>List<IExpression> iExpressions1 = getIExpressionByFilterOperatorOperator(leftOperator);<NEW_LINE>List<IExpression> iExpressions2 = getIExpressionByFilterOperatorOperator(rightOperator);<NEW_LINE>iExpressions1.addAll(iExpressions2);<NEW_LINE>return queryByConditions(iExpressions1, database, measurement, serviceProvider, fieldOrders, sessionId);<NEW_LINE>} else {<NEW_LINE>return QueryResultUtils.andQueryResultProcess(queryExpr(leftOperator, database, measurement, serviceProvider, fieldOrders, sessionId), queryExpr(rightOperator, database, measurement, serviceProvider, fieldOrders, sessionId));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>throw new IllegalArgumentException("unknown operator " + operator);<NEW_LINE>}
expressions = new ArrayList<>();
1,744,000
protected final void bindValues(SQLiteStatement stmt, Message entity) {<NEW_LINE>stmt.clearBindings();<NEW_LINE>Long id = entity.getId();<NEW_LINE>if (id != null) {<NEW_LINE>stmt.bindLong(1, id);<NEW_LINE>}<NEW_LINE>String entityID = entity.getEntityID();<NEW_LINE>if (entityID != null) {<NEW_LINE>stmt.bindString(2, entityID);<NEW_LINE>}<NEW_LINE>java.util.Date date = entity.getDate();<NEW_LINE>if (date != null) {<NEW_LINE>stmt.bindLong(3, date.getTime());<NEW_LINE>}<NEW_LINE>Integer type = entity.getType();<NEW_LINE>if (type != null) {<NEW_LINE>stmt.bindLong(4, type);<NEW_LINE>}<NEW_LINE>Integer status = entity.getStatus();<NEW_LINE>if (status != null) {<NEW_LINE>stmt.bindLong(5, status);<NEW_LINE>}<NEW_LINE>Long senderId = entity.getSenderId();<NEW_LINE>if (senderId != null) {<NEW_LINE>stmt.bindLong(6, senderId);<NEW_LINE>}<NEW_LINE>Long threadId = entity.getThreadId();<NEW_LINE>if (threadId != null) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>Long nextMessageId = entity.getNextMessageId();<NEW_LINE>if (nextMessageId != null) {<NEW_LINE>stmt.bindLong(8, nextMessageId);<NEW_LINE>}<NEW_LINE>Long previousMessageId = entity.getPreviousMessageId();<NEW_LINE>if (previousMessageId != null) {<NEW_LINE>stmt.bindLong(9, previousMessageId);<NEW_LINE>}<NEW_LINE>String encryptedText = entity.getEncryptedText();<NEW_LINE>if (encryptedText != null) {<NEW_LINE>stmt.bindString(10, encryptedText);<NEW_LINE>}<NEW_LINE>}
stmt.bindLong(7, threadId);
1,230,104
public XMLObject unmarshallMessage(InputStream messageStream) throws MessageDecodingException {<NEW_LINE>try {<NEW_LINE>Document messageDoc = parserPool.parse(messageStream);<NEW_LINE>Element messageElem = messageDoc.getDocumentElement();<NEW_LINE>if (tc.isDebugEnabled()) {<NEW_LINE>Tr.debug(tc, "Resultant DOM message was:\n{}", messageElem == null ? "null" : SerializeSupport.nodeToString(messageElem));<NEW_LINE>Tr.debug(tc, "Unmarshalling message");<NEW_LINE>}<NEW_LINE>// Unmarshaller unmarshaller = Configuration.getUnmarshallerFactory().getUnmarshaller(messageElem)<NEW_LINE>Unmarshaller unmarshaller = XMLObjectProviderRegistrySupport.getUnmarshallerFactory().getUnmarshaller(messageElem);<NEW_LINE>if (unmarshaller == null) {<NEW_LINE>if (tc.isDebugEnabled()) {<NEW_LINE>Tr.debug(tc, "Unable to unmarshall message, no unmarshaller registered for message element " + QNameSupport.getNodeQName(messageElem));<NEW_LINE>}<NEW_LINE>throw new MessageDecodingException("Unable to unmarshall message, no unmarshaller registered for message element " + QNameSupport.getNodeQName(messageElem));<NEW_LINE>}<NEW_LINE>XMLObject message = unmarshaller.unmarshall(messageElem);<NEW_LINE>if (tc.isDebugEnabled()) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>return message;<NEW_LINE>} catch (XMLParserException e) {<NEW_LINE>if (tc.isDebugEnabled()) {<NEW_LINE>Tr.debug(tc, "XMLParserException e:" + e);<NEW_LINE>}<NEW_LINE>throw new MessageDecodingException("Encountered error parsing message into its DOM representation", e);<NEW_LINE>} catch (UnmarshallingException e) {<NEW_LINE>if (tc.isDebugEnabled()) {<NEW_LINE>Tr.debug(tc, "UnmarshallingException e:" + e);<NEW_LINE>}<NEW_LINE>throw new MessageDecodingException("Encountered error unmarshalling message from its DOM representation", e);<NEW_LINE>}<NEW_LINE>}
Tr.debug(tc, "Message succesfully unmarshalled");
397,956
public ComponentSelector desugarSelector(ComponentSelector selector) {<NEW_LINE>if (selector instanceof ModuleComponentSelector) {<NEW_LINE>ModuleComponentSelector module = (ModuleComponentSelector) selector;<NEW_LINE><MASK><NEW_LINE>if (!moduleAttributes.isEmpty()) {<NEW_LINE>ImmutableAttributes attributes = ((AttributeContainerInternal) moduleAttributes).asImmutable();<NEW_LINE>return DefaultModuleComponentSelector.newSelector(module.getModuleIdentifier(), module.getVersionConstraint(), desugar(attributes), module.getRequestedCapabilities());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (selector instanceof DefaultProjectComponentSelector) {<NEW_LINE>DefaultProjectComponentSelector project = (DefaultProjectComponentSelector) selector;<NEW_LINE>AttributeContainer projectAttributes = project.getAttributes();<NEW_LINE>if (!projectAttributes.isEmpty()) {<NEW_LINE>ImmutableAttributes attributes = ((AttributeContainerInternal) projectAttributes).asImmutable();<NEW_LINE>return new DefaultProjectComponentSelector(project.getBuildIdentifier(), project.getIdentityPath(), project.projectPath(), project.getProjectName(), desugar(attributes), project.getRequestedCapabilities());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return selector;<NEW_LINE>}
AttributeContainer moduleAttributes = module.getAttributes();
1,381,336
public Void call() throws Exception {<NEW_LINE>if (log.isInfoEnabled())<NEW_LINE>log.info(<MASK><NEW_LINE>// returns once synchronous overflow is complete.<NEW_LINE>dataService.forceOverflow(true, /* immediate */<NEW_LINE>compactingMerge);<NEW_LINE>if (log.isInfoEnabled())<NEW_LINE>log.info("Synchronous overflow is done: " + dataService.getServiceName());<NEW_LINE>// wait until overflow processing is done.<NEW_LINE>while (dataService.isOverflowActive()) {<NEW_LINE>Thread.sleep(100);<NEW_LINE>}<NEW_LINE>if (log.isInfoEnabled())<NEW_LINE>log.info("Asynchronous overflow is done: " + dataService.getServiceName());<NEW_LINE>if (truncateJournal) {<NEW_LINE>if (!dataService.purgeOldResources(5000, /* ms */<NEW_LINE>true)) {<NEW_LINE>log.warn("Could not pause write service - resources will not be purged.");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>}
"dataService: " + dataService.getServiceName());
1,232,455
final DeleteThingGroupResult executeDeleteThingGroup(DeleteThingGroupRequest deleteThingGroupRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(deleteThingGroupRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DeleteThingGroupRequest> request = null;<NEW_LINE>Response<DeleteThingGroupResult> response = null;<NEW_LINE>try {<NEW_LINE><MASK><NEW_LINE>try {<NEW_LINE>request = new DeleteThingGroupRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(deleteThingGroupRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "IoT");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DeleteThingGroup");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DeleteThingGroupResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DeleteThingGroupResultJsonUnmarshaller());<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);
47,440
// http://localhost:9000/aaa/asset?screen_name=loklak_app&id_str=123&file=image.jpg&data=<NEW_LINE>@Override<NEW_LINE>protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {<NEW_LINE>Query post = RemoteAccess.evaluate(request);<NEW_LINE>// manage DoS<NEW_LINE>if (post.isDoS_blackout()) {<NEW_LINE>response.sendError(503, "your request frequency is too high");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>Map<String, byte[]> <MASK><NEW_LINE>byte[] data = m.get("data");<NEW_LINE>if (data == null || data.length == 0) {<NEW_LINE>response.sendError(400, "your request does not contain a data object.");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>byte[] screen_name_b = m.get("screen_name");<NEW_LINE>if (screen_name_b == null || screen_name_b.length == 0) {<NEW_LINE>response.sendError(400, "your request does not contain a screen_name.");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>byte[] id_str_b = m.get("id_str");<NEW_LINE>if (id_str_b == null || id_str_b.length == 0) {<NEW_LINE>response.sendError(400, "your request does not contain a id_str.");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>byte[] file_b = m.get("file");<NEW_LINE>if (file_b == null || file_b.length == 0) {<NEW_LINE>response.sendError(400, "your request does not contain a file name.");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>String screen_name = new String(screen_name_b, 0, screen_name_b.length, StandardCharsets.UTF_8);<NEW_LINE>String id_str = new String(id_str_b, 0, id_str_b.length, StandardCharsets.UTF_8);<NEW_LINE>String file = new String(file_b, 0, file_b.length, StandardCharsets.UTF_8);<NEW_LINE>File f = DAO.getAssetFile(screen_name, id_str, file);<NEW_LINE>f.getParentFile().mkdirs();<NEW_LINE>FileOutputStream fos = new FileOutputStream(f);<NEW_LINE>fos.write(data);<NEW_LINE>fos.close();<NEW_LINE>post.setResponse(response, "application/octet-stream");<NEW_LINE>post.finalize();<NEW_LINE>}
m = RemoteAccess.getPostMap(request);
1,107,518
public Haplotype composeHaplotypeBasedOnReference(final int index, final int paddingSize, final ReferenceMultiSparkSource reference) {<NEW_LINE>Utils.nonNull(reference, "the input reference cannot be null");<NEW_LINE><MASK><NEW_LINE>ParamUtils.inRange(index, 0, 1, "the input allele index must be 0 or 1");<NEW_LINE>final SAMSequenceDictionary dictionary = reference.getReferenceSequenceDictionary(null);<NEW_LINE>Utils.nonNull(dictionary, "the input reference does not have a dictionary");<NEW_LINE>final SAMSequenceRecord contigRecord = dictionary.getSequence(getContig());<NEW_LINE>Utils.nonNull(contigRecord, "the input reference does not have a contig named: " + getContig());<NEW_LINE>final int contigLength = contigRecord.getSequenceLength();<NEW_LINE>if (contigLength < getEnd()) {<NEW_LINE>throw new IllegalArgumentException(String.format("this variant goes beyond the end of " + "the containing contig based on the input reference: " + "contig %s length is %d but variant end is %d", getContig(), contigLength, getEnd()));<NEW_LINE>}<NEW_LINE>final SimpleInterval referenceInterval = composePaddedInterval(getContig(), contigLength, getStart(), getEnd(), paddingSize);<NEW_LINE>final ReferenceBases bases;<NEW_LINE>try {<NEW_LINE>bases = reference.getReferenceBases(referenceInterval);<NEW_LINE>} catch (final IOException ex) {<NEW_LINE>throw new GATKException("could not read reference file");<NEW_LINE>}<NEW_LINE>if (index == 0) {<NEW_LINE>final Haplotype result = new Haplotype(bases.getBases(), true);<NEW_LINE>result.setCigar(new Cigar(Collections.singletonList(new CigarElement(referenceInterval.size(), CigarOperator.M))));<NEW_LINE>result.setGenomeLocation(referenceInterval);<NEW_LINE>return result;<NEW_LINE>} else {<NEW_LINE>// index == 1<NEW_LINE>switch(getStructuralVariantType()) {<NEW_LINE>case INS:<NEW_LINE>return composeInsertionHaplotype(bases);<NEW_LINE>case DEL:<NEW_LINE>return composeDeletionHaplotype(bases);<NEW_LINE>default:<NEW_LINE>// not jet supported. Please add more types as needed.<NEW_LINE>throw new UnsupportedOperationException("not supported yet");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
ParamUtils.isPositiveOrZero(paddingSize, "the input padding must be 0 or greater");
492,633
public GetSystemTemplateRevisionsResult unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>GetSystemTemplateRevisionsResult getSystemTemplateRevisionsResult = new GetSystemTemplateRevisionsResult();<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 getSystemTemplateRevisionsResult;<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("summaries", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>getSystemTemplateRevisionsResult.setSummaries(new ListUnmarshaller<SystemTemplateSummary>(SystemTemplateSummaryJsonUnmarshaller.getInstance()).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("nextToken", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>getSystemTemplateRevisionsResult.setNextToken(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return getSystemTemplateRevisionsResult;<NEW_LINE>}
JsonToken token = context.getCurrentToken();
1,849,374
/*<NEW_LINE>* (non-Javadoc)<NEW_LINE>* @see<NEW_LINE>* com.aptana.formatter.ui.FormatterModifyTabPage#createOptions(com.aptana.formatter.ui.IFormatterControlManager,<NEW_LINE>* org.eclipse.swt.widgets.Composite)<NEW_LINE>*/<NEW_LINE>@Override<NEW_LINE>protected void createOptions(IFormatterControlManager manager, Composite parent) {<NEW_LINE>Group group = SWTFactory.createGroup(parent, Messages.JSFormatterIndentationTabPage_indentationGeneralGroupLabel, 2, 1, GridData.FILL_HORIZONTAL);<NEW_LINE>final Combo tabOptions = manager.createCombo(group, JSFormatterConstants.FORMATTER_TAB_CHAR, FormatterMessages.IndentationTabPage_general_group_option_tab_policy, TAB_OPTION_ITEMS, TAB_OPTION_NAMES);<NEW_LINE>final Text indentationSize = manager.createNumber(group, JSFormatterConstants.FORMATTER_INDENTATION_SIZE, FormatterMessages.IndentationTabPage_general_group_option_indent_size, 1);<NEW_LINE>final Text tabSize = manager.createNumber(group, JSFormatterConstants.FORMATTER_TAB_SIZE, FormatterMessages.IndentationTabPage_general_group_option_tab_size, 1);<NEW_LINE>tabSize.addModifyListener(new ModifyListener() {<NEW_LINE><NEW_LINE>public void modifyText(ModifyEvent e) {<NEW_LINE>int index = tabOptions.getSelectionIndex();<NEW_LINE>if (index >= 0) {<NEW_LINE>final boolean tabMode = CodeFormatterConstants.TAB.equals(TAB_OPTION_ITEMS[index]);<NEW_LINE>if (tabMode) {<NEW_LINE>indentationSize.setText(tabSize.getText());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>new TabOptionHandler(manager, tabOptions, indentationSize, tabSize);<NEW_LINE>group = SWTFactory.createGroup(parent, Messages.JSFormatterTabPage_indentGroupLabel, 1, 1, GridData.FILL_HORIZONTAL);<NEW_LINE>manager.createCheckbox(group, JSFormatterConstants.INDENT_BLOCKS, Messages.JSFormatterIndentationTabPage_statementsWithinBlocks);<NEW_LINE>manager.createCheckbox(group, JSFormatterConstants.INDENT_FUNCTION_BODY, Messages.JSFormatterIndentationTabPage_statementsWithinFunctions);<NEW_LINE>manager.createCheckbox(group, JSFormatterConstants.INDENT_SWITCH_BODY, Messages.JSFormatterIndentationTabPage_statementsWithinSwitch);<NEW_LINE>manager.createCheckbox(group, JSFormatterConstants.INDENT_CASE_BODY, Messages.JSFormatterIndentationTabPage_statementsWithinCase);<NEW_LINE>manager.createCheckbox(group, <MASK><NEW_LINE>}
JSFormatterConstants.INDENT_GROUP_BODY, Messages.JSFormatterIndentationTabPage_statementsWithinJSGroups);
1,258,341
private void _buildPramatiXML() throws Exception {<NEW_LINE>Map tableNames = new HashMap();<NEW_LINE>StringBuffer sb = new StringBuffer();<NEW_LINE>sb.append("<?xml version=\"1.0\"?>\n");<NEW_LINE>sb.append("<!DOCTYPE pramati-j2ee-server PUBLIC \"-//Pramati Technologies //DTD Pramati J2ee Server 3.5 SP5//EN\" \"http://www.pramati.com/dtd/pramati-j2ee-server_3_5.dtd\">\n");<NEW_LINE>sb.append("\n<pramati-j2ee-server>\n");<NEW_LINE>sb.append("\t<vhost-name>default</vhost-name>\n");<NEW_LINE>sb.append("\t<auto-start>TRUE</auto-start>\n");<NEW_LINE>sb.append("\t<realm-name />\n");<NEW_LINE>sb.append("\t<ejb-module>\n");<NEW_LINE>sb.append("\t\t<name>").append(_jarFileName).append("</name>\n");<NEW_LINE>SAXReader reader = new SAXReader();<NEW_LINE>reader.setEntityResolver(new EntityResolver());<NEW_LINE>Document doc = reader.read(new File("classes/META-INF/ejb-jar.xml"));<NEW_LINE>Iterator itr = doc.getRootElement().element("enterprise-beans").elements("session").iterator();<NEW_LINE>while (itr.hasNext()) {<NEW_LINE>Element entity = <MASK><NEW_LINE>sb.append("\t\t<ejb>\n");<NEW_LINE>sb.append("\t\t\t<name>").append(entity.elementText("ejb-name")).append("</name>\n");<NEW_LINE>sb.append("\t\t\t<max-pool-size>40</max-pool-size>\n");<NEW_LINE>sb.append("\t\t\t<min-pool-size>20</min-pool-size>\n");<NEW_LINE>sb.append("\t\t\t<enable-freepool>false</enable-freepool>\n");<NEW_LINE>sb.append("\t\t\t<pool-waittimeout-millis>60000</pool-waittimeout-millis>\n");<NEW_LINE>sb.append("\t\t\t<low-activity-interval>20</low-activity-interval>\n");<NEW_LINE>sb.append("\t\t\t<is-secure>false</is-secure>\n");<NEW_LINE>sb.append("\t\t\t<is-clustered>true</is-clustered>\n");<NEW_LINE>if (entity.elementText("display-name").endsWith("LocalManagerEJB")) {<NEW_LINE>sb.append("\t\t\t<jndi-name>ejb/liferay/").append(entity.elementText("display-name")).append("Home</jndi-name>\n");<NEW_LINE>} else {<NEW_LINE>sb.append("\t\t\t<jndi-name>").append(entity.elementText("ejb-name")).append("</jndi-name>\n");<NEW_LINE>}<NEW_LINE>sb.append("\t\t\t<local-jndi-name>").append(entity.elementText("ejb-name")).append("__PRAMATI_LOCAL").append("</local-jndi-name>\n");<NEW_LINE>sb.append(_buildPramatiXMLRefs(entity));<NEW_LINE>sb.append("\t\t</ejb>\n");<NEW_LINE>}<NEW_LINE>sb.append("\t</ejb-module>\n");<NEW_LINE>sb.append("</pramati-j2ee-server>");<NEW_LINE>File outputFile = new File("classes/pramati-j2ee-server.xml");<NEW_LINE>if (!outputFile.exists() || !FileUtil.read(outputFile).equals(sb.toString())) {<NEW_LINE>FileUtil.write(outputFile, sb.toString());<NEW_LINE>Logger.info(EJBXMLBuilder.class, outputFile.toString());<NEW_LINE>}<NEW_LINE>}
(Element) itr.next();
1,813,036
public static void main(String[] args) {<NEW_LINE>EdgeWeightedGraph edgeWeightedGraph = new EdgeWeightedGraph(5);<NEW_LINE>edgeWeightedGraph.addEdge(new Edge<MASK><NEW_LINE>edgeWeightedGraph.addEdge(new Edge(0, 3, 0.5));<NEW_LINE>edgeWeightedGraph.addEdge(new Edge(1, 2, 0.12));<NEW_LINE>edgeWeightedGraph.addEdge(new Edge(1, 4, 0.91));<NEW_LINE>edgeWeightedGraph.addEdge(new Edge(2, 3, 0.72));<NEW_LINE>edgeWeightedGraph.addEdge(new Edge(3, 4, 0.8));<NEW_LINE>edgeWeightedGraph.addEdge(new Edge(3, 4, 0.82));<NEW_LINE>edgeWeightedGraph.addEdge(new Edge(4, 4, 0.1));<NEW_LINE>Exercise42_Partitioning.KruskalMSTPartitioning kruskalMSTPartitioning = new Exercise42_Partitioning().new KruskalMSTPartitioning(edgeWeightedGraph);<NEW_LINE>for (Edge edge : kruskalMSTPartitioning.edges()) {<NEW_LINE>StdOut.println(edge);<NEW_LINE>}<NEW_LINE>StdOut.println("\nExpected:\n" + "1-2 0.12000\n" + "0-1 0.42000\n" + "0-3 0.50000\n" + "3-4 0.80000");<NEW_LINE>}
(0, 1, 0.42));
869,644
void circuitBreakerOpenAndThenClose() {<NEW_LINE>CircuitBreakerConfig config = CircuitBreakerConfig.custom().slidingWindowType(SlidingWindowType.COUNT_BASED).slidingWindowSize(10).failureRateThreshold(25.0f).waitDurationInOpenState(Duration.ofSeconds(10)).permittedNumberOfCallsInHalfOpenState(4).build();<NEW_LINE>CircuitBreakerRegistry registry = CircuitBreakerRegistry.of(config);<NEW_LINE>CircuitBreaker circuitBreaker = registry.circuitBreaker("flightSearchService");<NEW_LINE>circuitBreaker.getEventPublisher().onCallNotPermitted(e -> {<NEW_LINE>System.out.println(e.toString());<NEW_LINE>// just to simulate lag so the circuitbreaker can change state<NEW_LINE>try {<NEW_LINE>Thread.sleep(1000);<NEW_LINE>} catch (InterruptedException interruptedException) {<NEW_LINE>interruptedException.printStackTrace();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>circuitBreaker.getEventPublisher().onError(e -> System.out.println(e.toString()));<NEW_LINE>circuitBreaker.getEventPublisher().onStateTransition(e -> System.out.println(e.toString()));<NEW_LINE>FlightSearchService service = new FlightSearchService();<NEW_LINE>SearchRequest request = new <MASK><NEW_LINE>service.setPotentialFailure(new SucceedXTimesFailYTimesAndThenSucceed(4, 4));<NEW_LINE>Supplier<List<Flight>> flightsSupplier = circuitBreaker.decorateSupplier(() -> service.searchFlights(request));<NEW_LINE>for (int i = 0; i < 50; i++) {<NEW_LINE>try {<NEW_LINE>System.out.println(flightsSupplier.get());<NEW_LINE>Thread.sleep(1000);<NEW_LINE>} catch (Exception e) {<NEW_LINE>e.printStackTrace();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
SearchRequest("NYC", "LAX", "12/31/2020");
928,552
private boolean isEqualToInitalRequestMethod(SipServletMessage message) {<NEW_LINE>if (c_logger.isTraceEntryExitEnabled()) {<NEW_LINE>Object[] params = { _tuWrapper.getAppName(), _tuWrapper.getId() };<NEW_LINE>c_logger.traceEntry(this, " isEqualToInitalRequestMethod", params);<NEW_LINE>}<NEW_LINE>boolean isEqual = false;<NEW_LINE>if (_initialDialogMethod != null) {<NEW_LINE>if (message.getMethod().equals(_initialDialogMethod)) {<NEW_LINE>isEqual = true;<NEW_LINE>} else {<NEW_LINE>if (c_logger.isTraceDebugEnabled()) {<NEW_LINE>StringBuffer b = new StringBuffer(100);<NEW_LINE>b.append("Different method in received response = ");<NEW_LINE>b.append(message.getMethod());<NEW_LINE>b.append(" Initial dialog method = ");<NEW_LINE>b.append(_initialDialogMethod);<NEW_LINE>c_logger.traceDebug(this, "isEqualToInitalRequestMethod", b.toString());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>if (c_logger.isTraceDebugEnabled()) {<NEW_LINE>c_logger.traceDebug(this, "isEqualToInitalRequestMethod", <MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (c_logger.isTraceDebugEnabled()) {<NEW_LINE>c_logger.traceDebug(this, "isEqualToInitalRequestMethod", isEqual ? "true" : "false");<NEW_LINE>}<NEW_LINE>return isEqual;<NEW_LINE>}
"_initialDialogMethod is null. Is dialog ? " + _tuWrapper.isTUDialog());
396,062
protected FilterResults performFiltering(CharSequence constraint) {<NEW_LINE>FilterResults results = new FilterResults();<NEW_LINE>ArrayList<Label> filteredArrayList = new ArrayList<>();<NEW_LINE>if (labels == null) {<NEW_LINE>labels <MASK><NEW_LINE>}<NEW_LINE>if (constraint == null || constraint.length() == 0) {<NEW_LINE>// set the Original result to return<NEW_LINE>results.count = labels.size();<NEW_LINE>results.values = labels;<NEW_LINE>} else {<NEW_LINE>constraint = constraint.toString().toLowerCase();<NEW_LINE>for (Label label : labels) {<NEW_LINE>String data = label.toString();<NEW_LINE>if (data.toLowerCase().startsWith(constraint.toString())) {<NEW_LINE>filteredArrayList.add(Label.fromText(label.getText()));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// set the Filtered result to return<NEW_LINE>results.count = filteredArrayList.size();<NEW_LINE>results.values = filteredArrayList;<NEW_LINE>}<NEW_LINE>return results;<NEW_LINE>}
= new ArrayList<>(displayedLabels);
1,021,035
protected <T extends com.x.base.core.project.organization.Role> T convert(Business business, Role role, Class<T> clz) throws Exception {<NEW_LINE>T t = clz.newInstance();<NEW_LINE>t.setName(role.getName());<NEW_LINE>t.setDescription(role.getDescription());<NEW_LINE>t.setUnique(role.getUnique());<NEW_LINE>t.setDistinguishedName(role.getDistinguishedName());<NEW_LINE>t.setOrderNumber(role.getOrderNumber());<NEW_LINE>if (ListTools.isNotEmpty(role.getPersonList())) {<NEW_LINE>for (String str : role.getPersonList()) {<NEW_LINE>Person o = business.person().pick(str);<NEW_LINE>t.getPersonList().add(o.getDistinguishedName());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (ListTools.isNotEmpty(role.getGroupList())) {<NEW_LINE>for (String str : role.getGroupList()) {<NEW_LINE>Group o = business.<MASK><NEW_LINE>t.getGroupList().add(o.getDistinguishedName());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return t;<NEW_LINE>}
group().pick(str);
1,848,397
private int doSerialTasksWithRate() throws Exception {<NEW_LINE>initTasksArray();<NEW_LINE>long delayStep = (perMin ? 60000 : 1000) / rate;<NEW_LINE>long nextStartTime = System.currentTimeMillis();<NEW_LINE>int count = 0;<NEW_LINE>final long t0 = System.currentTimeMillis();<NEW_LINE>for (int k = 0; (repetitions == REPEAT_EXHAUST && !exhausted) || k < repetitions; k++) {<NEW_LINE>if (stopNow) {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>for (int l = 0; l < tasksArray.length; l++) {<NEW_LINE>final PerfTask task = tasksArray[l];<NEW_LINE>while (!stopNow) {<NEW_LINE>long waitMore = nextStartTime - System.currentTimeMillis();<NEW_LINE>if (waitMore > 0) {<NEW_LINE>// TODO: better to use condition to notify<NEW_LINE>Thread.sleep(1);<NEW_LINE>} else {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (stopNow) {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>// this aims at avarage rate.<NEW_LINE>nextStartTime += delayStep;<NEW_LINE>try {<NEW_LINE>final int inc = task.runAndMaybeStats(letChildReport);<NEW_LINE>count += inc;<NEW_LINE>if (countsByTime != null) {<NEW_LINE>final int slot = (int) ((System.currentTimeMillis<MASK><NEW_LINE>if (slot >= countsByTime.length) {<NEW_LINE>countsByTime = ArrayUtil.grow(countsByTime, 1 + slot);<NEW_LINE>}<NEW_LINE>countsByTime[slot] += inc;<NEW_LINE>}<NEW_LINE>if (anyExhaustibleTasks)<NEW_LINE>updateExhausted(task);<NEW_LINE>} catch (@SuppressWarnings("unused") NoMoreDataException e) {<NEW_LINE>exhausted = true;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>stopNow = false;<NEW_LINE>return count;<NEW_LINE>}
() - t0) / logByTimeMsec);
144,074
public boolean onActivityResult(Activity activity, int requestCode, int resultCode, Intent data) {<NEW_LINE>if (payPromise == null) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>switch(requestCode) {<NEW_LINE>case LOAD_PAYMENT_DATA_REQUEST_CODE:<NEW_LINE>switch(resultCode) {<NEW_LINE>case Activity.RESULT_OK:<NEW_LINE>PaymentData <MASK><NEW_LINE>ArgCheck.nonNull(paymentData);<NEW_LINE>String tokenJson = paymentData.getPaymentMethodToken().getToken();<NEW_LINE>JSONObject obj = null;<NEW_LINE>try {<NEW_LINE>obj = new JSONObject(tokenJson);<NEW_LINE>} catch (JSONException e) {<NEW_LINE>e.printStackTrace();<NEW_LINE>}<NEW_LINE>Token token = Token.fromJson(obj);<NEW_LINE>if (token == null) {<NEW_LINE>payPromise.reject(getErrorCode("parseResponse"), getErrorDescription("parseResponse"));<NEW_LINE>} else {<NEW_LINE>payPromise.resolve(putExtraToTokenMap(convertTokenToWritableMap(token), getBillingAddress(paymentData), paymentData.getShippingAddress(), paymentData.getEmail()));<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>case Activity.RESULT_CANCELED:<NEW_LINE>payPromise.reject(getErrorCode("purchaseCancelled"), getErrorDescription("purchaseCancelled"));<NEW_LINE>break;<NEW_LINE>case AutoResolveHelper.RESULT_ERROR:<NEW_LINE>Status status = AutoResolveHelper.getStatusFromIntent(data);<NEW_LINE>// Log the status for debugging.<NEW_LINE>// Generally, there is no need to show an error to<NEW_LINE>// the user as the Google Pay API will do that.<NEW_LINE>payPromise.reject(getErrorCode("stripe"), status.getStatusMessage());<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>}<NEW_LINE>payPromise = null;<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>}
paymentData = PaymentData.getFromIntent(data);
1,792,279
public boolean checkNode(final NodeModel node) {<NEW_LINE>final NodeLinks <MASK><NEW_LINE>if (nodeLinks != null) {<NEW_LINE>for (final NodeLinkModel l : nodeLinks.getLinks()) {<NEW_LINE>if (!(l instanceof ConnectorModel)) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (checkLink((ConnectorModel) l)) {<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (!node.hasID()) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>final MapLinks mapLinks = MapLinks.getLinks(node.getMap());<NEW_LINE>if (mapLinks == null) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>final Set<NodeLinkModel> targetLinks = mapLinks.get(node.getID());<NEW_LINE>if (targetLinks == null) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>for (final NodeLinkModel l : targetLinks) {<NEW_LINE>if (!(l instanceof ConnectorModel)) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (checkLink((ConnectorModel) l)) {<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>}
nodeLinks = NodeLinks.getLinkExtension(node);
1,048,380
public Builder mergeFrom(com.databricks.api.proto.mlflow.DatabricksArtifacts.GetCredentialsForRead.Response other) {<NEW_LINE>if (other == com.databricks.api.proto.mlflow.DatabricksArtifacts.GetCredentialsForRead.Response.getDefaultInstance())<NEW_LINE>return this;<NEW_LINE>if (credentialInfosBuilder_ == null) {<NEW_LINE>if (!other.credentialInfos_.isEmpty()) {<NEW_LINE>if (credentialInfos_.isEmpty()) {<NEW_LINE>credentialInfos_ = other.credentialInfos_;<NEW_LINE>bitField0_ = (bitField0_ & ~0x00000001);<NEW_LINE>} else {<NEW_LINE>ensureCredentialInfosIsMutable();<NEW_LINE>credentialInfos_.addAll(other.credentialInfos_);<NEW_LINE>}<NEW_LINE>onChanged();<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>if (!other.credentialInfos_.isEmpty()) {<NEW_LINE>if (credentialInfosBuilder_.isEmpty()) {<NEW_LINE>credentialInfosBuilder_.dispose();<NEW_LINE>credentialInfosBuilder_ = null;<NEW_LINE>credentialInfos_ = other.credentialInfos_;<NEW_LINE>bitField0_ = (bitField0_ & ~0x00000001);<NEW_LINE>credentialInfosBuilder_ = com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? getCredentialInfosFieldBuilder() : null;<NEW_LINE>} else {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (other.hasNextPageToken()) {<NEW_LINE>bitField0_ |= 0x00000002;<NEW_LINE>nextPageToken_ = other.nextPageToken_;<NEW_LINE>onChanged();<NEW_LINE>}<NEW_LINE>this.mergeUnknownFields(other.unknownFields);<NEW_LINE>onChanged();<NEW_LINE>return this;<NEW_LINE>}
credentialInfosBuilder_.addAllMessages(other.credentialInfos_);
1,731,546
protected void poll() throws IOException {<NEW_LINE>boolean downloaded = AwsUtils.downloadFileIfChanged(config.workS3BucketName, config.workS3BucketPrefix, file, 0);<NEW_LINE>if (downloaded || tagGroups == null) {<NEW_LINE><MASK><NEW_LINE>DataInputStream in = new DataInputStream(new FileInputStream(file));<NEW_LINE>try {<NEW_LINE>TreeMap<Long, Collection<TagGroup>> tagGroupsWithResourceGroups = TagGroup.Serializer.deserializeTagGroups(config, in);<NEW_LINE>TreeMap<Long, Collection<TagGroup>> tagGroups = removeResourceGroups(tagGroupsWithResourceGroups);<NEW_LINE>Interval totalInterval = null;<NEW_LINE>if (tagGroups.size() > 0) {<NEW_LINE>totalInterval = new Interval(tagGroups.firstKey(), new DateTime(tagGroups.lastKey()).plusMonths(1).getMillis(), DateTimeZone.UTC);<NEW_LINE>}<NEW_LINE>this.totalInterval = totalInterval;<NEW_LINE>this.tagGroups = tagGroups;<NEW_LINE>this.tagGroupsWithResourceGroups = tagGroupsWithResourceGroups;<NEW_LINE>logger.info("done reading " + file);<NEW_LINE>} finally {<NEW_LINE>in.close();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
logger.info("trying to read from " + file);
724,147
public static void main(String[] args) throws Exception {<NEW_LINE>BasicConfigurator.configure();<NEW_LINE>initTracing();<NEW_LINE>initStatsExporter();<NEW_LINE>// Create http client that will trace requests. By default trace context is propagated using<NEW_LINE>// w3c TraceContext propagator.<NEW_LINE>// To use B3 propagation use following<NEW_LINE>// OcJettyHttpClient httpClient =<NEW_LINE>// new OcJettyHttpClient(<NEW_LINE>// new HttpClientTransportOverHTTP(),<NEW_LINE>// new SslContextFactory(),<NEW_LINE>// null,<NEW_LINE>// Tracing.getPropagationComponent().getB3Format());<NEW_LINE>OcJettyHttpClient httpClient = new OcJettyHttpClient(new HttpClientTransportOverHTTP(), new <MASK><NEW_LINE>httpClient.start();<NEW_LINE>do {<NEW_LINE>HttpRequest request = (HttpRequest) httpClient.newRequest("http://localhost:8080/helloworld/request").method(HttpMethod.GET);<NEW_LINE>HttpRequest asyncRequest = (HttpRequest) httpClient.newRequest("http://localhost:8080/helloworld/request/async").method(HttpMethod.GET);<NEW_LINE>HttpRequest postRequest = (HttpRequest) httpClient.newRequest("http://localhost:8080/helloworld/request").method(HttpMethod.POST);<NEW_LINE>postRequest.content(new StringContentProvider("{\"hello\": \"world\"}"), "application/json");<NEW_LINE>if (request == null) {<NEW_LINE>logger.info("Request is null");<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>request.send();<NEW_LINE>asyncRequest.send();<NEW_LINE>postRequest.send();<NEW_LINE>try {<NEW_LINE>Thread.sleep(15000);<NEW_LINE>} catch (Exception e) {<NEW_LINE>logger.error("Error while sleeping");<NEW_LINE>}<NEW_LINE>} while (true);<NEW_LINE>}
SslContextFactory(), null, null);
1,569,763
private void saveLog(final SaveMode saveMode) {<NEW_LINE>try (ContextLogger cLog = new ContextLogger("LogCacheActivity.saveLog(mode=%s)", saveMode)) {<NEW_LINE>final OfflineLogEntry logEntry = getEntryFromView();<NEW_LINE>final boolean logChanged = logEntry.hasSaveRelevantChanges(lastSavedState);<NEW_LINE>final boolean doSave = SaveMode.FORCE.equals(saveMode) || (!SaveMode.SKIP.equals(saveMode) && logChanged);<NEW_LINE>cLog.add("logChanged=%b, doSave=%b", logChanged, doSave);<NEW_LINE>if (doSave) {<NEW_LINE>lastSavedState = logEntry;<NEW_LINE>new AsyncTask<Void, Void, Void>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>protected Void doInBackground(final Void... params) {<NEW_LINE>try (ContextLogger ccLog = new ContextLogger("LogCacheActivity.saveLog.doInBackground(gc=%s)", cache.getGeocode())) {<NEW_LINE>cache.logOffline(LogCacheActivity.this, logEntry);<NEW_LINE>Settings.setLastCacheLog(logEntry.log);<NEW_LINE>ccLog.<MASK><NEW_LINE>imageListFragment.adjustImagePersistentState();<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}.execute();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
add("log=%s", logEntry.log);
732,422
public static Object toPrimitiveFromForeign(Object tObj, TruffleString hint) {<NEW_LINE>assert isForeignObject(tObj);<NEW_LINE>InteropLibrary interop = InteropLibrary.<MASK><NEW_LINE>if (interop.isNull(tObj)) {<NEW_LINE>return Null.instance;<NEW_LINE>} else if (JSInteropUtil.isBoxedPrimitive(tObj, interop)) {<NEW_LINE>return JSInteropUtil.toPrimitiveOrDefault(tObj, Null.instance, interop, null);<NEW_LINE>} else if (JavaScriptLanguage.getCurrentEnv().isHostObject(tObj)) {<NEW_LINE>if (Strings.HINT_NUMBER.equals(hint) && JavaScriptLanguage.getCurrentLanguage().getJSContext().isOptionNashornCompatibilityMode() && interop.isMemberInvocable(tObj, "doubleValue")) {<NEW_LINE>try {<NEW_LINE>return interop.invokeMember(tObj, "doubleValue");<NEW_LINE>} catch (UnsupportedMessageException | ArityException | UnknownIdentifierException | UnsupportedTypeException e) {<NEW_LINE>throw Errors.createTypeErrorInteropException(tObj, e, "doubleValue()", null);<NEW_LINE>}<NEW_LINE>} else if (interop.isInstant(tObj)) {<NEW_LINE>return JSDate.getDateValueFromInstant(tObj, interop);<NEW_LINE>} else if (isJavaArray(tObj, interop)) {<NEW_LINE>return formatJavaArray(tObj, interop);<NEW_LINE>} else if (interop.isMetaObject(tObj)) {<NEW_LINE>return javaClassToString(tObj, interop);<NEW_LINE>} else if (interop.isException(tObj)) {<NEW_LINE>return javaExceptionToString(tObj, interop);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return foreignOrdinaryToPrimitive(tObj, hint);<NEW_LINE>}
getFactory().getUncached(tObj);
1,709,969
public org.mlflow.api.proto.Service.ListArtifacts.Response buildPartial() {<NEW_LINE>org.mlflow.api.proto.Service.ListArtifacts.Response result = new org.mlflow.api.proto.Service.ListArtifacts.Response(this);<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.rootUri_ = rootUri_;<NEW_LINE>if (filesBuilder_ == null) {<NEW_LINE>if (((bitField0_ & 0x00000002) == 0x00000002)) {<NEW_LINE>files_ = java.<MASK><NEW_LINE>bitField0_ = (bitField0_ & ~0x00000002);<NEW_LINE>}<NEW_LINE>result.files_ = files_;<NEW_LINE>} else {<NEW_LINE>result.files_ = filesBuilder_.build();<NEW_LINE>}<NEW_LINE>if (((from_bitField0_ & 0x00000004) == 0x00000004)) {<NEW_LINE>to_bitField0_ |= 0x00000002;<NEW_LINE>}<NEW_LINE>result.nextPageToken_ = nextPageToken_;<NEW_LINE>result.bitField0_ = to_bitField0_;<NEW_LINE>onBuilt();<NEW_LINE>return result;<NEW_LINE>}
util.Collections.unmodifiableList(files_);
1,651,117
public Map.Entry<String, Integer> convert(String input) throws OptionsParsingException {<NEW_LINE>int pos = input.indexOf('=');<NEW_LINE>if (pos == 0 || input.length() == 0) {<NEW_LINE>throw new OptionsParsingException("Specify either 'value' or 'name=value', where 'value' is an integer");<NEW_LINE>} else if (pos < 0) {<NEW_LINE>try {<NEW_LINE>return Maps.immutableEntry("", Integer.parseInt(input));<NEW_LINE>} catch (NumberFormatException e) {<NEW_LINE>throw new OptionsParsingException("'" + input + "' is not an int", e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>String name = input.substring(0, pos);<NEW_LINE>String value = input.substring(pos + 1);<NEW_LINE>try {<NEW_LINE>return Maps.immutableEntry(name, Integer.parseInt(value));<NEW_LINE>} catch (NumberFormatException e) {<NEW_LINE>throw new OptionsParsingException(<MASK><NEW_LINE>}<NEW_LINE>}
"'" + value + "' is not an int", e);
579,644
// -----------------------------------------------------<NEW_LINE>// Actually Crud<NEW_LINE>// -------------<NEW_LINE>@Execute<NEW_LINE>@Secured({ ROLE })<NEW_LINE>public HtmlResponse create(final CreateForm form) {<NEW_LINE>verifyCrudMode(form.crudMode, CrudMode.CREATE);<NEW_LINE>validate(form, messages -> {<NEW_LINE>}, this::asEditHtml);<NEW_LINE>verifyToken(this::asEditHtml);<NEW_LINE>getDataConfig(form).ifPresent(entity -> {<NEW_LINE>try {<NEW_LINE>dataConfigService.store(entity);<NEW_LINE>saveInfo(messages -> messages.addSuccessCrudCreateCrudTable(GLOBAL));<NEW_LINE>} catch (final Exception e) {<NEW_LINE>throwValidationError(messages -> messages.addErrorsCrudFailedToCreateCrudTable(GLOBAL, buildThrowableMessage(e)), this::asEditHtml);<NEW_LINE>}<NEW_LINE>}).orElse(() -> {<NEW_LINE>throwValidationError(messages -> messages.addErrorsCrudFailedToCreateInstance<MASK><NEW_LINE>});<NEW_LINE>return redirect(getClass());<NEW_LINE>}
(GLOBAL), this::asEditHtml);
1,693,217
final PutStorageConfigurationResult executePutStorageConfiguration(PutStorageConfigurationRequest putStorageConfigurationRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(putStorageConfigurationRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE><MASK><NEW_LINE>Request<PutStorageConfigurationRequest> request = null;<NEW_LINE>Response<PutStorageConfigurationResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new PutStorageConfigurationRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(putStorageConfigurationRequest));<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, "IoTSiteWise");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "PutStorageConfiguration");<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>String hostPrefix = "api.";<NEW_LINE>String resolvedHostPrefix = String.format("api.");<NEW_LINE>endpointTraitHost = UriResourcePathUtils.updateUriHost(endpoint, resolvedHostPrefix);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<PutStorageConfigurationResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new PutStorageConfigurationResultJsonUnmarshaller());<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>}
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
447,508
public void populateItem(final Item<RepositoryCommit> commitItem) {<NEW_LINE>final RepositoryCommit commit = commitItem.getModelObject();<NEW_LINE>// author gravatar<NEW_LINE>commitItem.add(new AvatarImage("commitAuthor", commit.getAuthorIdent(), null, 16, false));<NEW_LINE>// merge icon<NEW_LINE>if (commit.getParentCount() > 1) {<NEW_LINE>commitItem.add(WicketUtils.newImage("commitIcon", "commit_merge_16x16.png"));<NEW_LINE>} else {<NEW_LINE>commitItem.add(WicketUtils.newBlankImage("commitIcon"));<NEW_LINE>}<NEW_LINE>// short message<NEW_LINE>String shortMessage = commit.getShortMessage();<NEW_LINE>String trimmedMessage = shortMessage;<NEW_LINE>if (commit.getRefs() != null && commit.getRefs().size() > 0) {<NEW_LINE>trimmedMessage = StringUtils.trimString(shortMessage, Constants.LEN_SHORTLOG_REFS);<NEW_LINE>} else {<NEW_LINE>trimmedMessage = StringUtils.trimString(shortMessage, Constants.LEN_SHORTLOG);<NEW_LINE>}<NEW_LINE>LinkPanel shortlog = new LinkPanel("commitShortMessage", "list", trimmedMessage, CommitPage.class, WicketUtils.newObjectParameter(change.repository, commit.getName()));<NEW_LINE>if (!shortMessage.equals(trimmedMessage)) {<NEW_LINE>WicketUtils.setHtmlTooltip(shortlog, shortMessage);<NEW_LINE>}<NEW_LINE>commitItem.add(shortlog);<NEW_LINE>// commit hash link<NEW_LINE>int hashLen = app().settings().getInteger(Keys.web.shortCommitIdLength, 6);<NEW_LINE>LinkPanel commitHash = new LinkPanel("hashLink", null, commit.getName().substring(0, hashLen), CommitPage.class, WicketUtils.newObjectParameter(change.repository, commit.getName()));<NEW_LINE>WicketUtils.setCssClass(commitHash, "shortsha1");<NEW_LINE>WicketUtils.setHtmlTooltip(<MASK><NEW_LINE>commitItem.add(commitHash);<NEW_LINE>}
commitHash, commit.getName());
716,300
public PutEmailIdentityDkimSigningAttributesResult unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>PutEmailIdentityDkimSigningAttributesResult putEmailIdentityDkimSigningAttributesResult = new PutEmailIdentityDkimSigningAttributesResult();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return putEmailIdentityDkimSigningAttributesResult;<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("DkimStatus", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>putEmailIdentityDkimSigningAttributesResult.setDkimStatus(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("DkimTokens", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>putEmailIdentityDkimSigningAttributesResult.setDkimTokens(new ListUnmarshaller<String>(context.getUnmarshaller(String.class<MASK><NEW_LINE>}<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return putEmailIdentityDkimSigningAttributesResult;<NEW_LINE>}
)).unmarshall(context));
1,693,876
final DescribeLocationHdfsResult executeDescribeLocationHdfs(DescribeLocationHdfsRequest describeLocationHdfsRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(describeLocationHdfsRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DescribeLocationHdfsRequest> request = null;<NEW_LINE>Response<DescribeLocationHdfsResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DescribeLocationHdfsRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(describeLocationHdfsRequest));<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, "DataSync");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DescribeLocationHdfs");<NEW_LINE>request.<MASK><NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DescribeLocationHdfsResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DescribeLocationHdfsResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
1,167,088
public boolean copyDatastoreFile(String srcFilePath, ManagedObjectReference morSrcDc, ManagedObjectReference morDestDs, String destFilePath, ManagedObjectReference morDestDc, boolean forceOverwrite) throws Exception {<NEW_LINE>String srcDsName = getName();<NEW_LINE>DatastoreMO destDsMo = new DatastoreMO(_context, morDestDs);<NEW_LINE>String destDsName = destDsMo.getName();<NEW_LINE>ManagedObjectReference morFileManager = _context.getServiceContent().getFileManager();<NEW_LINE>String srcFullPath = srcFilePath;<NEW_LINE>if (!DatastoreFile.isFullDatastorePath(srcFullPath))<NEW_LINE>srcFullPath = String.format("[%s] %s", srcDsName, srcFilePath);<NEW_LINE>String destFullPath = destFilePath;<NEW_LINE>if (!DatastoreFile.isFullDatastorePath(destFullPath))<NEW_LINE>destFullPath = String.format("[%s] %s", destDsName, destFilePath);<NEW_LINE>ManagedObjectReference morTask = _context.getService().copyDatastoreFileTask(morFileManager, srcFullPath, morSrcDc, destFullPath, morDestDc, forceOverwrite);<NEW_LINE>boolean result = _context.getVimClient().waitForTask(morTask);<NEW_LINE>if (result) {<NEW_LINE>_context.waitForTaskProgressDone(morTask);<NEW_LINE>return true;<NEW_LINE>} else {<NEW_LINE>s_logger.error("VMware copyDatastoreFile_Task failed due to " + TaskMO<MASK><NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>}
.getTaskFailureInfo(_context, morTask));
1,613,260
public Body visitBody(Body body) {<NEW_LINE>if (body instanceof IntervalElim) {<NEW_LINE>IntervalElim intervalElim = (IntervalElim) body;<NEW_LINE>List<IntervalElim.CasePair> cases = intervalElim.getCases();<NEW_LINE>for (int i = 0; i < cases.size(); i++) {<NEW_LINE>Pair<Expression, Expression> <MASK><NEW_LINE>cases.set(i, new IntervalElim.CasePair(pair.proj1 == null ? null : pair.proj1.accept(this, null), pair.proj2 == null ? null : pair.proj2.accept(this, null)));<NEW_LINE>}<NEW_LINE>if (intervalElim.getOtherwise() != null) {<NEW_LINE>visitElimBody(intervalElim.getOtherwise());<NEW_LINE>}<NEW_LINE>} else if (body instanceof Expression) {<NEW_LINE>return ((Expression) body).accept(this, null);<NEW_LINE>} else if (body instanceof ElimBody) {<NEW_LINE>visitElimBody((ElimBody) body);<NEW_LINE>} else {<NEW_LINE>assert body == null;<NEW_LINE>}<NEW_LINE>return body;<NEW_LINE>}
pair = cases.get(i);
1,609,732
public Mono<Response<Flux<ByteBuffer>>> whatIfAtManagementGroupScopeWithResponseAsync(String groupId, String deploymentName, ScopedDeploymentWhatIf parameters) {<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 (groupId == null) {<NEW_LINE>return Mono.<MASK><NEW_LINE>}<NEW_LINE>if (deploymentName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (parameters == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null."));<NEW_LINE>} else {<NEW_LINE>parameters.validate();<NEW_LINE>}<NEW_LINE>final String accept = "application/json";<NEW_LINE>return FluxUtil.withContext(context -> service.whatIfAtManagementGroupScope(this.client.getEndpoint(), groupId, deploymentName, this.client.getApiVersion(), parameters, accept, context)).contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));<NEW_LINE>}
error(new IllegalArgumentException("Parameter groupId is required and cannot be null."));
532,087
public FreeTrialAccountInfo unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>FreeTrialAccountInfo freeTrialAccountInfo = new FreeTrialAccountInfo();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE><MASK><NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>if (context.testExpression("accountId", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>freeTrialAccountInfo.setAccountId(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("freeTrialInfo", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>freeTrialAccountInfo.setFreeTrialInfo(new ListUnmarshaller<FreeTrialInfo>(FreeTrialInfoJsonUnmarshaller.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 freeTrialAccountInfo;<NEW_LINE>}
String currentParentElement = context.getCurrentParentElement();
1,698,104
public void startExecutor() throws InvalidTopologyException {<NEW_LINE>LOG.log(Level.INFO, "Preparing evaluator for running executor-id: {0}", heronExecutorId);<NEW_LINE>String[] executorCmd = getExecutorCommand();<NEW_LINE>processTarget = Thread.currentThread();<NEW_LINE>// Log the working directory, this will make people fast locate the<NEW_LINE>// directory to find the log files<NEW_LINE>File workingDirectory = new File(".");<NEW_LINE>String cwdPath = workingDirectory.getAbsolutePath();<NEW_LINE>LOG.log(Level.INFO, "Working dir: {0}", cwdPath);<NEW_LINE>HashMap<String, <MASK><NEW_LINE>final Process regularExecutor = ShellUtils.runASyncProcess(true, executorCmd, workingDirectory, executorEnvironment);<NEW_LINE>LOG.log(Level.INFO, "Started heron executor-id: {0}", heronExecutorId);<NEW_LINE>try {<NEW_LINE>regularExecutor.waitFor();<NEW_LINE>LOG.log(Level.WARNING, "Heron executor process terminated");<NEW_LINE>} catch (InterruptedException e) {<NEW_LINE>LOG.log(Level.INFO, "Destroy heron executor-id: {0}", heronExecutorId);<NEW_LINE>regularExecutor.destroy();<NEW_LINE>}<NEW_LINE>}
String> executorEnvironment = getEnvironment(cwdPath);
1,261,078
public static void bufferedToGray(BufferedImage src, float[] data, int dstStartIndex, int dstStride) {<NEW_LINE>final int width = src.getWidth();<NEW_LINE>final int height = src.getHeight();<NEW_LINE>if (src.getType() == BufferedImage.TYPE_BYTE_GRAY) {<NEW_LINE>// If the buffered image is a gray scale image there is a bug where getRGB distorts<NEW_LINE>// the image. See Bug ID: 5051418 , it has been around since 2004. Fuckers...<NEW_LINE>WritableRaster raster = src.getRaster();<NEW_LINE>// CONCURRENT_REMOVE_BELOW<NEW_LINE>float[] hack = new float[1];<NEW_LINE>// CONCURRENT_BELOW BoofConcurrency.loopFor(0, height, y -> {<NEW_LINE>for (int y = 0; y < height; y++) {<NEW_LINE>// CONCURRENT_INLINE int hack[] = new int[1];<NEW_LINE>int index = dstStartIndex + y * dstStride;<NEW_LINE>for (int x = 0; x < width; x++) {<NEW_LINE>raster.getPixel(x, y, hack);<NEW_LINE>data[index++] = hack[0];<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// CONCURRENT_ABOVE });<NEW_LINE>} else {<NEW_LINE>// CONCURRENT_BELOW BoofConcurrency.loopFor(0, height, y -> {<NEW_LINE>for (int y = 0; y < height; y++) {<NEW_LINE>int index = dstStartIndex + y * dstStride;<NEW_LINE>for (int x = 0; x < width; x++) {<NEW_LINE>int argb = <MASK><NEW_LINE>int r = (argb >>> 16) & 0xFF;<NEW_LINE>int g = (argb >>> 8) & 0xFF;<NEW_LINE>int b = argb & 0xFF;<NEW_LINE>float ave = (r + g + b) / 3.0f;<NEW_LINE>data[index++] = ave;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// CONCURRENT_ABOVE });<NEW_LINE>}<NEW_LINE>}
src.getRGB(x, y);
981,590
public synchronized void createTweet(Status status, int account) {<NEW_LINE>ContentValues values = new ContentValues();<NEW_LINE>String originalName = "";<NEW_LINE>long time = status.getCreatedAt().getTime();<NEW_LINE>long id = status.getId();<NEW_LINE>if (status.isRetweet()) {<NEW_LINE>originalName = status.getUser().getScreenName();<NEW_LINE>status = status.getRetweetedStatus();<NEW_LINE>}<NEW_LINE>String[] html = TweetLinkUtils.getLinksInStatus(status);<NEW_LINE>String text = html[0];<NEW_LINE>String media = html[1];<NEW_LINE>String url = html[2];<NEW_LINE>String hashtags = html[3];<NEW_LINE>String users = html[4];<NEW_LINE>if (media.contains("/tweet_video/")) {<NEW_LINE>media = media.replace("tweet_video", "tweet_video_thumb").replace(".mp4", ".png").replace(".m3u8", ".png");<NEW_LINE>;<NEW_LINE>}<NEW_LINE>values.put(SavedTweetSQLiteHelper.COLUMN_TEXT, text);<NEW_LINE>values.<MASK><NEW_LINE>values.put(SavedTweetSQLiteHelper.COLUMN_NAME, status.getUser().getName());<NEW_LINE>values.put(SavedTweetSQLiteHelper.COLUMN_PRO_PIC, status.getUser().getOriginalProfileImageURL());<NEW_LINE>values.put(SavedTweetSQLiteHelper.COLUMN_SCREEN_NAME, status.getUser().getScreenName());<NEW_LINE>values.put(SavedTweetSQLiteHelper.COLUMN_TIME, time);<NEW_LINE>values.put(SavedTweetSQLiteHelper.COLUMN_RETWEETER, originalName);<NEW_LINE>values.put(SavedTweetSQLiteHelper.COLUMN_PIC_URL, media);<NEW_LINE>values.put(SavedTweetSQLiteHelper.COLUMN_URL, url);<NEW_LINE>values.put(SavedTweetSQLiteHelper.COLUMN_USERS, users);<NEW_LINE>values.put(SavedTweetSQLiteHelper.COLUMN_HASHTAGS, hashtags);<NEW_LINE>values.put(SavedTweetSQLiteHelper.COLUMN_ANIMATED_GIF, TweetLinkUtils.getGIFUrl(status, url));<NEW_LINE>values.put(SavedTweetSQLiteHelper.COLUMN_ACCOUNT, account);<NEW_LINE>try {<NEW_LINE>database.insert(SavedTweetSQLiteHelper.TABLE_HOME, null, values);<NEW_LINE>} catch (Exception e) {<NEW_LINE>open();<NEW_LINE>database.insert(SavedTweetSQLiteHelper.TABLE_HOME, null, values);<NEW_LINE>}<NEW_LINE>}
put(SavedTweetSQLiteHelper.COLUMN_TWEET_ID, id);
1,294,240
final DeleteFHIRDatastoreResult executeDeleteFHIRDatastore(DeleteFHIRDatastoreRequest deleteFHIRDatastoreRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(deleteFHIRDatastoreRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DeleteFHIRDatastoreRequest> request = null;<NEW_LINE>Response<DeleteFHIRDatastoreResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DeleteFHIRDatastoreRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(deleteFHIRDatastoreRequest));<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, "HealthLake");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DeleteFHIRDatastore");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DeleteFHIRDatastoreResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DeleteFHIRDatastoreResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>}
endClientExecution(awsRequestMetrics, request, response);
1,226,270
private Version computeMinCompatVersion() {<NEW_LINE>if (major == 6) {<NEW_LINE>// force the minimum compatibility for version 6 to 5.6 since we don't reference version 5 anymore<NEW_LINE>return Version.fromId(5060099);<NEW_LINE>} else if (major == 7) {<NEW_LINE>// force the minimum compatibility for version 7 to 6.8 since we don't reference version 6 anymore<NEW_LINE>return Version.fromId(6080099);<NEW_LINE>} else if (major >= 8) {<NEW_LINE>// all major versions from 8 onwards are compatible with last minor series of the previous major<NEW_LINE>Version bwcVersion = null;<NEW_LINE>for (int i = DeclaredVersionsHolder.DECLARED_VERSIONS.size() - 1; i >= 0; i--) {<NEW_LINE>final Version candidateVersion = <MASK><NEW_LINE>if (candidateVersion.major == major - 1 && after(candidateVersion)) {<NEW_LINE>if (bwcVersion != null && candidateVersion.minor < bwcVersion.minor) {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>bwcVersion = candidateVersion;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return bwcVersion == null ? this : bwcVersion;<NEW_LINE>}<NEW_LINE>return Version.min(this, fromId(major * 1000000 + 0 * 10000 + 99));<NEW_LINE>}
DeclaredVersionsHolder.DECLARED_VERSIONS.get(i);
636,451
public double[][] chooseInitialMeans(Relation<? extends NumberVector> relation, int k, NumberVectorDistance<?> distance) {<NEW_LINE>if (relation.size() < k) {<NEW_LINE>throw new AbortException("Database has less than k objects.");<NEW_LINE>}<NEW_LINE>// Ugly cast; but better than code duplication.<NEW_LINE>@SuppressWarnings("unchecked")<NEW_LINE>Relation<O> rel = (Relation<O>) relation;<NEW_LINE>// Get a distance query<NEW_LINE>@SuppressWarnings("unchecked")<NEW_LINE>final PrimitiveDistance<? super O> distF = (PrimitiveDistance<? super O>) distance;<NEW_LINE>final DistanceQuery<O> distQ = new QueryBuilder<>(rel, distF).distanceQuery();<NEW_LINE>DBIDs medids = chooseInitialMedoids(k, <MASK><NEW_LINE>double[][] medoids = new double[k][];<NEW_LINE>DBIDIter iter = medids.iter();<NEW_LINE>for (int i = 0; i < k; i++, iter.advance()) {<NEW_LINE>medoids[i] = relation.get(iter).toArray();<NEW_LINE>}<NEW_LINE>return medoids;<NEW_LINE>}
rel.getDBIDs(), distQ);
1,135,827
public List<FieldChange> cleanup(BibEntry entry) {<NEW_LINE>List<LinkedFile> fileList = entry.getFiles();<NEW_LINE>List<LinkedFile> <MASK><NEW_LINE>boolean changed = false;<NEW_LINE>for (LinkedFile fileEntry : fileList) {<NEW_LINE>String oldFileName = fileEntry.getLink();<NEW_LINE>String newFileName = null;<NEW_LINE>if (fileEntry.isOnlineLink()) {<NEW_LINE>// keep online link untouched<NEW_LINE>newFileName = oldFileName;<NEW_LINE>} else {<NEW_LINE>// only try to transform local file path to relative one<NEW_LINE>newFileName = FileUtil.relativize(Path.of(oldFileName), databaseContext.getFileDirectories(filePreferences)).toString();<NEW_LINE>}<NEW_LINE>LinkedFile newFileEntry = fileEntry;<NEW_LINE>if (!oldFileName.equals(newFileName)) {<NEW_LINE>newFileEntry = new LinkedFile(fileEntry.getDescription(), Path.of(newFileName), fileEntry.getFileType());<NEW_LINE>changed = true;<NEW_LINE>}<NEW_LINE>newFileList.add(newFileEntry);<NEW_LINE>}<NEW_LINE>if (changed) {<NEW_LINE>Optional<FieldChange> change = entry.setFiles(newFileList);<NEW_LINE>if (change.isPresent()) {<NEW_LINE>return Collections.singletonList(change.get());<NEW_LINE>} else {<NEW_LINE>return Collections.emptyList();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return Collections.emptyList();<NEW_LINE>}
newFileList = new ArrayList<>();
1,186,349
public boolean touchUp(float x, float y, int pointer, int button) {<NEW_LINE>if (pointer > 1)<NEW_LINE>return false;<NEW_LINE>// check if we are still tapping.<NEW_LINE>if (inTapRectangle && !isWithinTapRectangle(x, y, tapRectangleCenterX, tapRectangleCenterY))<NEW_LINE>inTapRectangle = false;<NEW_LINE>boolean wasPanning = panning;<NEW_LINE>panning = false;<NEW_LINE>longPressTask.cancel();<NEW_LINE>if (longPressFired)<NEW_LINE>return false;<NEW_LINE>if (inTapRectangle) {<NEW_LINE>// handle taps<NEW_LINE>if (lastTapButton != button || lastTapPointer != pointer || TimeUtils.nanoTime() - lastTapTime > tapCountInterval || !isWithinTapRectangle(x, y, lastTapX, lastTapY))<NEW_LINE>tapCount = 0;<NEW_LINE>tapCount++;<NEW_LINE>lastTapTime = TimeUtils.nanoTime();<NEW_LINE>lastTapX = x;<NEW_LINE>lastTapY = y;<NEW_LINE>lastTapButton = button;<NEW_LINE>lastTapPointer = pointer;<NEW_LINE>touchDownTime = 0;<NEW_LINE>return listener.tap(x, y, tapCount, button);<NEW_LINE>}<NEW_LINE>if (pinching) {<NEW_LINE>// handle pinch end<NEW_LINE>pinching = false;<NEW_LINE>listener.pinchStop();<NEW_LINE>panning = true;<NEW_LINE>// we are in pan mode again, reset velocity tracker<NEW_LINE>if (pointer == 0) {<NEW_LINE>// first pointer has lifted off, set up panning to use the second pointer...<NEW_LINE>tracker.start(pointer2.x, pointer2.y, Gdx.input.getCurrentEventTime());<NEW_LINE>} else {<NEW_LINE>// second pointer has lifted off, set up panning to use the first pointer...<NEW_LINE>tracker.start(pointer1.x, pointer1.y, Gdx.input.getCurrentEventTime());<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>// handle no longer panning<NEW_LINE>boolean handled = false;<NEW_LINE>if (wasPanning && !panning)<NEW_LINE>handled = listener.panStop(x, y, pointer, button);<NEW_LINE>// handle fling<NEW_LINE>long time = Gdx.input.getCurrentEventTime();<NEW_LINE>if (time - touchDownTime <= maxFlingDelay) {<NEW_LINE>tracker.update(x, y, time);<NEW_LINE>handled = listener.fling(tracker.getVelocityX(), tracker.<MASK><NEW_LINE>}<NEW_LINE>touchDownTime = 0;<NEW_LINE>return handled;<NEW_LINE>}
getVelocityY(), button) || handled;
706,802
private void loadNode509() {<NEW_LINE>PropertyTypeNode node = new PropertyTypeNode(this.context, Identifiers.NonExclusiveLimitAlarmType_LowLowState_Id, new QualifiedName(0, "Id"), new LocalizedText("en", "Id"), LocalizedText.NULL_VALUE, UInteger.valueOf(0), UInteger.valueOf(0), new DataValue(Variant.NULL_VALUE), Identifiers.Boolean, -1, new UInteger[] {}, UByte.valueOf(1), UByte.valueOf(1), 0.0, false);<NEW_LINE>node.addReference(new Reference(Identifiers.NonExclusiveLimitAlarmType_LowLowState_Id, Identifiers.HasTypeDefinition, Identifiers.PropertyType<MASK><NEW_LINE>node.addReference(new Reference(Identifiers.NonExclusiveLimitAlarmType_LowLowState_Id, Identifiers.HasModellingRule, Identifiers.ModellingRule_Mandatory.expanded(), true));<NEW_LINE>node.addReference(new Reference(Identifiers.NonExclusiveLimitAlarmType_LowLowState_Id, Identifiers.HasProperty, Identifiers.NonExclusiveLimitAlarmType_LowLowState.expanded(), false));<NEW_LINE>this.nodeManager.addNode(node);<NEW_LINE>}
.expanded(), true));
1,307,047
public // update delete menu<NEW_LINE>void removeTable() {<NEW_LINE>// NOI18N<NEW_LINE>Log.getLogger().entering("QueryBuilderGraphFrame", "removeTable");<NEW_LINE>QueryBuilder.showBusyCursor(true);<NEW_LINE>// Important: suppress bogus regeneration of the text query<NEW_LINE>_queryBuilder._updateText = false;<NEW_LINE>try {<NEW_LINE>removeTable(_selectedNode);<NEW_LINE>} finally {<NEW_LINE>_queryBuilder._updateText = true;<NEW_LINE>}<NEW_LINE>// enable/disable group_by menu item<NEW_LINE>if (_sqlTextArea.getText() == null) {<NEW_LINE>runQueryMenuItem.setEnabled(false);<NEW_LINE>groupByMenuItem.setEnabled(false);<NEW_LINE>_queryBuilder.getQueryBuilderPane().<MASK><NEW_LINE>_queryBuilder.getQueryBuilderPane().getQueryBuilderSqlTextArea().setParseQueryMenuEnabled(false);<NEW_LINE>} else if (_sqlTextArea.getText().trim().length() == 0) {<NEW_LINE>runQueryMenuItem.setEnabled(false);<NEW_LINE>groupByMenuItem.setEnabled(false);<NEW_LINE>_queryBuilder.getQueryBuilderPane().getQueryBuilderSqlTextArea().setRunQueryMenuEnabled(false);<NEW_LINE>_queryBuilder.getQueryBuilderPane().getQueryBuilderSqlTextArea().setParseQueryMenuEnabled(false);<NEW_LINE>} else {<NEW_LINE>runQueryMenuItem.setEnabled(true);<NEW_LINE>groupByMenuItem.setEnabled(true);<NEW_LINE>_queryBuilder.getQueryBuilderPane().getQueryBuilderSqlTextArea().setRunQueryMenuEnabled(true);<NEW_LINE>_queryBuilder.getQueryBuilderPane().getQueryBuilderSqlTextArea().setParseQueryMenuEnabled(true);<NEW_LINE>}<NEW_LINE>QueryBuilder.showBusyCursor(false);<NEW_LINE>}
getQueryBuilderSqlTextArea().setRunQueryMenuEnabled(false);
1,819,252
// ActivityLifecycleCallbacks<NEW_LINE>@SuppressLint("LongLogTag")<NEW_LINE>@Override<NEW_LINE>public void onActivityResumed(@NonNull Activity activity) {<NEW_LINE>if (mIsInBackground) {<NEW_LINE>AnalyticsTracker.track(AnalyticsTracker.Stat.APPLICATION_OPENED, AnalyticsTracker.CATEGORY_USER, "application_opened");<NEW_LINE>mIsInBackground = false;<NEW_LINE>AppLog.add(Type.ACTION, "App opened");<NEW_LINE>WorkManager.getInstance(getApplicationContext()).cancelUniqueWork(TAG_SYNC);<NEW_LINE>Log.d("Simplenote.onActivityResumed", "Stopped worker");<NEW_LINE>}<NEW_LINE>String activitySimpleName = activity.getClass().getSimpleName();<NEW_LINE>mAccountBucket.start();<NEW_LINE>AppLog.add(Type.SYNC, "Started account bucket (" + activitySimpleName + ")");<NEW_LINE>mPreferencesBucket.start();<NEW_LINE>AppLog.add(Type.SYNC, "Started preference bucket (" + activitySimpleName + ")");<NEW_LINE>mNotesBucket.start();<NEW_LINE>AppLog.add(Type.SYNC, "Started note bucket (" + activitySimpleName + ")");<NEW_LINE>mTagsBucket.start();<NEW_LINE>AppLog.add(Type.<MASK><NEW_LINE>}
SYNC, "Started tag bucket (" + activitySimpleName + ")");
174,390
public void contribute(BuildContext context, AotOptions aotOptions) {<NEW_LINE>ResourceLoader resourceLoader = new DefaultResourceLoader(context.getClassLoader());<NEW_LINE>ClassLoader classLoader = context.getClassLoader();<NEW_LINE>Class<?> applicationClass;<NEW_LINE>String applicationClassName = context.getApplicationClass();<NEW_LINE>if (applicationClassName == null) {<NEW_LINE>logger.warn("No application class detected, skipping context bootstrap generation");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>logger.info("Detected application class: " + applicationClassName);<NEW_LINE>applicationClass = ClassUtils.forName(applicationClassName, classLoader);<NEW_LINE>} catch (ClassNotFoundException exc) {<NEW_LINE>throw new IllegalStateException("Could not load application class " + applicationClassName, exc);<NEW_LINE>}<NEW_LINE>StopWatch watch = new StopWatch();<NEW_LINE>logger.info("Processing application context");<NEW_LINE>watch.start();<NEW_LINE>GenericApplicationContext applicationContext = new AotApplicationContextFactory(resourceLoader).createApplicationContext(applicationClass);<NEW_LINE>configureEnvironment(applicationContext.getEnvironment());<NEW_LINE>ApplicationContextAotProcessor aotProcessor = new ApplicationContextAotProcessor(classLoader);<NEW_LINE>DefaultBootstrapWriterContext writerContext = new DefaultBootstrapWriterContext("org.springframework.aot", BOOTSTRAP_CLASS_NAME);<NEW_LINE>aotProcessor.process(applicationContext, writerContext);<NEW_LINE>watch.stop();<NEW_LINE>logger.info("Processed " + applicationContext.getBeanFactory().getBeanDefinitionNames().length + " bean definitions in " + watch.getTotalTimeMillis() + "ms");<NEW_LINE>writerContext.toJavaFiles().forEach(javaFile -> context.addSourceFiles(<MASK><NEW_LINE>NativeConfigurationRegistry nativeConfigurationRegistry = writerContext.getNativeConfigurationRegistry();<NEW_LINE>context.getOptions().addAll(nativeConfigurationRegistry.options());<NEW_LINE>context.describeReflection(reflectionDescriptor -> nativeConfigurationRegistry.reflection().toClassDescriptors().forEach(reflectionDescriptor::merge));<NEW_LINE>context.describeResources(resourcesDescriptor -> resourcesDescriptor.merge(nativeConfigurationRegistry.resources().toResourcesDescriptor()));<NEW_LINE>context.describeProxies(proxiesDescriptor -> proxiesDescriptor.merge(nativeConfigurationRegistry.proxy().toProxiesDescriptor()));<NEW_LINE>context.describeInitialization(initializationDescriptor -> initializationDescriptor.merge(nativeConfigurationRegistry.initialization().toInitializationDescriptor()));<NEW_LINE>context.describeSerialization(serializationDescriptor -> serializationDescriptor.merge(nativeConfigurationRegistry.serialization().toSerializationDescriptor()));<NEW_LINE>context.describeJNIReflection(reflectionDescriptor -> nativeConfigurationRegistry.jni().toClassDescriptors().forEach(reflectionDescriptor::merge));<NEW_LINE>}
SourceFiles.fromJavaFile(javaFile)));
640,152
private void loadAliases() {<NEW_LINE>String currentDisplayName = txtDisplayName.getText();<NEW_LINE>String currentAlias = cboAlias.getSelectedItem() == null ? null : cboAlias<MASK><NEW_LINE>try {<NEW_LINE>cboAlias.removeAllItems();<NEW_LINE>Enumeration<String> e = keyStore.aliases();<NEW_LINE>while (e.hasMoreElements()) {<NEW_LINE>cboAlias.addItem(e.nextElement());<NEW_LINE>}<NEW_LINE>// if the display name is empty or identical to the alias, set it<NEW_LINE>// to the alias of the newly selected cert<NEW_LINE>if ((StringUtils.isEmpty(currentDisplayName) || (currentDisplayName != null && currentDisplayName.equals(currentAlias))) && cboAlias.getSelectedItem() != null) {<NEW_LINE>txtDisplayName.setText(cboAlias.getSelectedItem().toString());<NEW_LINE>}<NEW_LINE>} catch (KeyStoreException e) {<NEW_LINE>cboAlias.removeAllItems();<NEW_LINE>logger.error("Unable to obtain aliases from keystore", e);<NEW_LINE>showGenericError("plugin.certconfig.ALIAS_LOAD_EXCEPTION", e);<NEW_LINE>}<NEW_LINE>}
.getSelectedItem().toString();
1,587,026
private AWSCredentials credentials(String tag) {<NEW_LINE>SecretProvider awsSecrets = context.getSecrets().getSecrets("aws");<NEW_LINE>SecretProvider emrSecrets = awsSecrets.getSecrets("emr");<NEW_LINE>String accessKeyId = emrSecrets.getSecretOptional("access_key_id").or(() -> awsSecrets.getSecret("access_key_id"));<NEW_LINE>String secretAccessKey = emrSecrets.getSecretOptional("secret_access_key").or(() -> awsSecrets.getSecret("secret_access_key"));<NEW_LINE>AWSCredentials credentials <MASK><NEW_LINE>Optional<String> roleArn = emrSecrets.getSecretOptional("role_arn").or(awsSecrets.getSecretOptional("role_arn"));<NEW_LINE>if (!roleArn.isPresent()) {<NEW_LINE>return credentials;<NEW_LINE>}<NEW_LINE>// use STS to assume role<NEW_LINE>String roleSessionName = emrSecrets.getSecretOptional("role_session_name").or(awsSecrets.getSecretOptional("role_session_name")).or("digdag-emr-" + tag);<NEW_LINE>AWSSecurityTokenServiceClient stsClient = new AWSSecurityTokenServiceClient(credentials);<NEW_LINE>AssumeRoleResult assumeResult = stsClient.assumeRole(new AssumeRoleRequest().withRoleArn(roleArn.get()).withDurationSeconds(3600).withRoleSessionName(roleSessionName));<NEW_LINE>return new BasicSessionCredentials(assumeResult.getCredentials().getAccessKeyId(), assumeResult.getCredentials().getSecretAccessKey(), assumeResult.getCredentials().getSessionToken());<NEW_LINE>}
= new BasicAWSCredentials(accessKeyId, secretAccessKey);
1,493,205
public static DescribeInstancesResponse unmarshall(DescribeInstancesResponse describeInstancesResponse, UnmarshallerContext context) {<NEW_LINE>describeInstancesResponse.setRequestId(context.stringValue("DescribeInstancesResponse.RequestId"));<NEW_LINE>describeInstancesResponse.setPageSize<MASK><NEW_LINE>describeInstancesResponse.setCurrentPage(context.integerValue("DescribeInstancesResponse.CurrentPage"));<NEW_LINE>describeInstancesResponse.setTotalCount(context.integerValue("DescribeInstancesResponse.TotalCount"));<NEW_LINE>List<Instance> items = new ArrayList<Instance>();<NEW_LINE>for (int i = 0; i < context.lengthValue("DescribeInstancesResponse.Items.Length"); i++) {<NEW_LINE>Instance instance = new Instance();<NEW_LINE>instance.setId(context.longValue("DescribeInstancesResponse.Items[" + i + "].Id"));<NEW_LINE>instance.setName(context.stringValue("DescribeInstancesResponse.Items[" + i + "].Name"));<NEW_LINE>instance.setOwner(context.stringValue("DescribeInstancesResponse.Items[" + i + "].Owner"));<NEW_LINE>instance.setCreationTime(context.longValue("DescribeInstancesResponse.Items[" + i + "].CreationTime"));<NEW_LINE>instance.setProductId(context.stringValue("DescribeInstancesResponse.Items[" + i + "].ProductId"));<NEW_LINE>instance.setProductCode(context.stringValue("DescribeInstancesResponse.Items[" + i + "].ProductCode"));<NEW_LINE>instance.setProtection(context.booleanValue("DescribeInstancesResponse.Items[" + i + "].Protection"));<NEW_LINE>instance.setLabelsec(context.integerValue("DescribeInstancesResponse.Items[" + i + "].Labelsec"));<NEW_LINE>instance.setOdpsRiskLevelName(context.stringValue("DescribeInstancesResponse.Items[" + i + "].OdpsRiskLevelName"));<NEW_LINE>instance.setSensitive(context.booleanValue("DescribeInstancesResponse.Items[" + i + "].Sensitive"));<NEW_LINE>instance.setRiskLevelId(context.longValue("DescribeInstancesResponse.Items[" + i + "].RiskLevelId"));<NEW_LINE>instance.setRiskLevelName(context.stringValue("DescribeInstancesResponse.Items[" + i + "].RiskLevelName"));<NEW_LINE>instance.setRuleName(context.stringValue("DescribeInstancesResponse.Items[" + i + "].RuleName"));<NEW_LINE>instance.setDepartName(context.stringValue("DescribeInstancesResponse.Items[" + i + "].DepartName"));<NEW_LINE>instance.setTotalCount(context.integerValue("DescribeInstancesResponse.Items[" + i + "].TotalCount"));<NEW_LINE>instance.setSensitiveCount(context.integerValue("DescribeInstancesResponse.Items[" + i + "].SensitiveCount"));<NEW_LINE>instance.setAcl(context.stringValue("DescribeInstancesResponse.Items[" + i + "].Acl"));<NEW_LINE>items.add(instance);<NEW_LINE>}<NEW_LINE>describeInstancesResponse.setItems(items);<NEW_LINE>return describeInstancesResponse;<NEW_LINE>}
(context.integerValue("DescribeInstancesResponse.PageSize"));
90,696
static void dfs(int u) {<NEW_LINE>dfs_num[u] <MASK><NEW_LINE>for (int v : adjList[u]) if (dfs_num[v] == 0) {<NEW_LINE>parent[v] = u;<NEW_LINE>if (u == root)<NEW_LINE>++rootChildren;<NEW_LINE>dfs(v);<NEW_LINE>if (dfs_low[v] >= dfs_num[u])<NEW_LINE>artPoints[u] = true;<NEW_LINE>if (dfs_low[v] > dfs_num[u])<NEW_LINE>System.out.printf("Bridge between %d %d%n", u, v);<NEW_LINE>dfs_low[u] = Math.min(dfs_low[v], dfs_low[u]);<NEW_LINE>} else if (parent[u] != v)<NEW_LINE>dfs_low[u] = Math.min(dfs_low[u], dfs_num[v]);<NEW_LINE>}
= dfs_low[u] = ++counter;
336,625
public void shutDown(Runnable shutDownCompleteHandler) {<NEW_LINE>log.info("NetworkNode shutdown started");<NEW_LINE>if (!shutDownInProgress) {<NEW_LINE>shutDownInProgress = true;<NEW_LINE>if (server != null) {<NEW_LINE>server.shutDown();<NEW_LINE>server = null;<NEW_LINE>}<NEW_LINE>Set<MASK><NEW_LINE>int numConnections = allConnections.size();<NEW_LINE>if (numConnections == 0) {<NEW_LINE>log.info("Shutdown immediately because no connections are open.");<NEW_LINE>if (shutDownCompleteHandler != null) {<NEW_LINE>shutDownCompleteHandler.run();<NEW_LINE>}<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>log.info("Shutdown {} connections", numConnections);<NEW_LINE>AtomicInteger shutdownCompleted = new AtomicInteger();<NEW_LINE>Timer timeoutHandler = UserThread.runAfter(() -> {<NEW_LINE>if (shutDownCompleteHandler != null) {<NEW_LINE>log.info("Shutdown completed due timeout");<NEW_LINE>shutDownCompleteHandler.run();<NEW_LINE>}<NEW_LINE>}, 1500, TimeUnit.MILLISECONDS);<NEW_LINE>allConnections.forEach(c -> c.shutDown(CloseConnectionReason.APP_SHUT_DOWN, () -> {<NEW_LINE>shutdownCompleted.getAndIncrement();<NEW_LINE>log.info("Shutdown of node {} completed", c.getPeersNodeAddressOptional());<NEW_LINE>if (shutdownCompleted.get() == numConnections) {<NEW_LINE>log.info("Shutdown completed with all connections closed");<NEW_LINE>timeoutHandler.stop();<NEW_LINE>if (shutDownCompleteHandler != null) {<NEW_LINE>shutDownCompleteHandler.run();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}));<NEW_LINE>}<NEW_LINE>}
<Connection> allConnections = getAllConnections();
2,382
public int testClockwise() {<NEW_LINE>if (points.size() < 3) {<NEW_LINE>return 0;<NEW_LINE>}<NEW_LINE>final int size = points.size();<NEW_LINE>// Count the number of positive and negative oriented angles<NEW_LINE>int c = 0;<NEW_LINE>// TODO: faster when using an iterator?<NEW_LINE>for (int i = 0; i < size; i++) {<NEW_LINE>// Three consecutive points<NEW_LINE>final int j = (i + 1) % size;<NEW_LINE>final int k = (i + 2) % size;<NEW_LINE>final double dxji = points.get(j)[0] - points.get(i)[0];<NEW_LINE>final double dykj = points.get(k)[1] - points<MASK><NEW_LINE>final double dyji = points.get(j)[1] - points.get(i)[1];<NEW_LINE>final double dxkj = points.get(k)[0] - points.get(j)[0];<NEW_LINE>final double z = (dxji * dykj) - (dyji * dxkj);<NEW_LINE>if (z < 0) {<NEW_LINE>c--;<NEW_LINE>} else if (z > 0) {<NEW_LINE>c++;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return (c > 0) ? -1 : (c < 0) ? +1 : 0;<NEW_LINE>}
.get(j)[1];
521,921
private boolean executeCachedSql(String sql, int flags, String @Nullable [] columnNames) throws SQLException {<NEW_LINE>PreferQueryMode preferQueryMode = connection.getPreferQueryMode();<NEW_LINE>// Simple statements should not replace ?, ? with $1, $2<NEW_LINE>boolean shouldUseParameterized = false;<NEW_LINE>QueryExecutor queryExecutor = connection.getQueryExecutor();<NEW_LINE>Object key = queryExecutor.createQueryKey(sql, replaceProcessingEnabled, shouldUseParameterized, columnNames);<NEW_LINE>CachedQuery cachedQuery;<NEW_LINE>boolean shouldCache = preferQueryMode == PreferQueryMode.EXTENDED_CACHE_EVERYTHING;<NEW_LINE>if (shouldCache) {<NEW_LINE>cachedQuery = queryExecutor.borrowQueryByKey(key);<NEW_LINE>} else {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>if (wantsGeneratedKeysOnce) {<NEW_LINE>SqlCommand sqlCommand = cachedQuery.query.getSqlCommand();<NEW_LINE>wantsGeneratedKeysOnce = sqlCommand != null && sqlCommand.isReturningKeywordPresent();<NEW_LINE>}<NEW_LINE>boolean res;<NEW_LINE>try {<NEW_LINE>res = executeWithFlags(cachedQuery, flags);<NEW_LINE>} finally {<NEW_LINE>if (shouldCache) {<NEW_LINE>queryExecutor.releaseQuery(cachedQuery);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return res;<NEW_LINE>}
cachedQuery = queryExecutor.createQueryByKey(key);
1,135,099
public KeyPair generateKeyPair() {<NEW_LINE>if (!initialised) {<NEW_LINE>throw new IllegalStateException("EC Key Pair Generator not initialised");<NEW_LINE>}<NEW_LINE>AsymmetricCipherKeyPair pair = engine.generateKeyPair();<NEW_LINE>ECPublicKeyParameters pub = <MASK><NEW_LINE>ECPrivateKeyParameters priv = (ECPrivateKeyParameters) pair.getPrivate();<NEW_LINE>if (ecParams instanceof ECParameterSpec) {<NEW_LINE>ECParameterSpec p = (ECParameterSpec) ecParams;<NEW_LINE>BCECGOST3410PublicKey pubKey = new BCECGOST3410PublicKey(algorithm, pub, p);<NEW_LINE>return new KeyPair(pubKey, new BCECGOST3410PrivateKey(algorithm, priv, pubKey, p));<NEW_LINE>} else if (ecParams == null) {<NEW_LINE>return new KeyPair(new BCECGOST3410PublicKey(algorithm, pub), new BCECGOST3410PrivateKey(algorithm, priv));<NEW_LINE>} else {<NEW_LINE>java.security.spec.ECParameterSpec p = (java.security.spec.ECParameterSpec) ecParams;<NEW_LINE>BCECGOST3410PublicKey pubKey = new BCECGOST3410PublicKey(algorithm, pub, p);<NEW_LINE>return new KeyPair(pubKey, new BCECGOST3410PrivateKey(algorithm, priv, pubKey, p));<NEW_LINE>}<NEW_LINE>}
(ECPublicKeyParameters) pair.getPublic();
1,577,129
private void threadSequence(final SequenceForKmers seqForKmers) {<NEW_LINE>final int startPos = findStart(seqForKmers);<NEW_LINE>if (startPos == -1) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final MultiDeBruijnVertex startingVertex = getOrCreateKmerVertex(seqForKmers.sequence, startPos);<NEW_LINE>// increase the counts of all edges incoming into the starting vertex supported by going back in sequence<NEW_LINE>if (INCREASE_COUNTS_BACKWARDS) {<NEW_LINE>increaseCountsInMatchedKmers(seqForKmers, startingVertex, startingVertex.getSequence(), kmerSize - 2);<NEW_LINE>}<NEW_LINE>if (debugGraphTransformations) {<NEW_LINE>startingVertex.addRead(seqForKmers.name);<NEW_LINE>}<NEW_LINE>// keep track of information about the reference source<NEW_LINE>if (seqForKmers.isRef) {<NEW_LINE>if (refSource != null) {<NEW_LINE>throw new IllegalStateException("Found two refSources! prev: " + refSource + ", new: " + startingVertex);<NEW_LINE>}<NEW_LINE>referencePath = new ArrayList<>(seqForKmers.sequence.length - kmerSize);<NEW_LINE>referencePath.add(startingVertex);<NEW_LINE>refSource = new Kmer(seqForKmers.sequence, seqForKmers.start, kmerSize);<NEW_LINE>}<NEW_LINE>// loop over all of the bases in sequence, extending the graph by one base at each point, as appropriate<NEW_LINE>MultiDeBruijnVertex vertex = startingVertex;<NEW_LINE>for (int i = startPos + 1; i <= seqForKmers.stop - kmerSize; i++) {<NEW_LINE>vertex = extendChainByOne(vertex, seqForKmers.sequence, i, <MASK><NEW_LINE>if (seqForKmers.isRef) {<NEW_LINE>referencePath.add(vertex);<NEW_LINE>}<NEW_LINE>if (debugGraphTransformations) {<NEW_LINE>vertex.addRead(seqForKmers.name);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (seqForKmers.isRef) {<NEW_LINE>referencePath = Collections.unmodifiableList(referencePath);<NEW_LINE>}<NEW_LINE>}
seqForKmers.count, seqForKmers.isRef);
533,256
public void visitModuleDef(JCModuleDecl tree) {<NEW_LINE>toLeftMargin();<NEW_LINE>printAnnotations(tree.mods.annotations);<NEW_LINE>if (tree.getModuleType() == ModuleTree.ModuleKind.OPEN) {<NEW_LINE>print("open ");<NEW_LINE>}<NEW_LINE>print("module ");<NEW_LINE>print(fullName(tree.qualId));<NEW_LINE>int old = cs.indentTopLevelClassMembers() ? indent() : out.leftMargin;<NEW_LINE>int bcol = old;<NEW_LINE>switch(cs.getModuleDeclBracePlacement()) {<NEW_LINE>case NEW_LINE:<NEW_LINE>newline();<NEW_LINE>toColExactly(old);<NEW_LINE>break;<NEW_LINE>case NEW_LINE_HALF_INDENTED:<NEW_LINE>newline();<NEW_LINE><MASK><NEW_LINE>toColExactly(bcol);<NEW_LINE>break;<NEW_LINE>case NEW_LINE_INDENTED:<NEW_LINE>newline();<NEW_LINE>bcol = out.leftMargin;<NEW_LINE>toColExactly(bcol);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>if (cs.spaceBeforeModuleDeclLeftBrace())<NEW_LINE>needSpace();<NEW_LINE>print('{');<NEW_LINE>printInnerCommentsAsTrailing(tree, true);<NEW_LINE>if (!tree.directives.isEmpty()) {<NEW_LINE>blankLines(cs.getBlankLinesAfterModuleHeader());<NEW_LINE>boolean firstDirective = true;<NEW_LINE>for (JCTree t : tree.directives) {<NEW_LINE>printStat(t, true, firstDirective, true, true, false);<NEW_LINE>firstDirective = false;<NEW_LINE>}<NEW_LINE>blankLines(cs.getBlankLinesBeforeModuleClosingBrace());<NEW_LINE>} else {<NEW_LINE>printEmptyBlockComments(tree, false);<NEW_LINE>}<NEW_LINE>toColExactly(bcol);<NEW_LINE>undent(old);<NEW_LINE>print('}');<NEW_LINE>}
bcol += (indentSize >> 1);
624,128
final DeleteBrowserSettingsResult executeDeleteBrowserSettings(DeleteBrowserSettingsRequest deleteBrowserSettingsRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(deleteBrowserSettingsRequest);<NEW_LINE><MASK><NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DeleteBrowserSettingsRequest> request = null;<NEW_LINE>Response<DeleteBrowserSettingsResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DeleteBrowserSettingsRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(deleteBrowserSettingsRequest));<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, "WorkSpaces Web");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DeleteBrowserSettings");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DeleteBrowserSettingsResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DeleteBrowserSettingsResultJsonUnmarshaller());<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,303,498
protected void throwable(BodyWriter w, Throwable throwable, boolean isCause) {<NEW_LINE>if (throwable != null) {<NEW_LINE>if (isCause) {<NEW_LINE>w.escape("Caused by: ");<NEW_LINE>}<NEW_LINE>w.escapeln(throwable.toString());<NEW_LINE>for (StackTraceElement ste : throwable.getStackTrace()) {<NEW_LINE><MASK><NEW_LINE>if (className.startsWith("ratpack") || className.startsWith("io.netty") || className.startsWith("com.google") || className.startsWith("java") || className.startsWith("org.springsource.loaded")) {<NEW_LINE>w.print("<span class='stack-core'> at ").escape(ste.toString()).println("</span>");<NEW_LINE>} else {<NEW_LINE>w.print(" at ").escape(ste.toString()).println("");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>throwable(w, throwable.getCause(), true);<NEW_LINE>}<NEW_LINE>}
String className = ste.getClassName();
673,354
private byte[] encodeBlock(ArrayList<Point> list) {<NEW_LINE>// Quantification<NEW_LINE><MASK><NEW_LINE>int[] index = new int[m];<NEW_LINE>long[] value = new long[m];<NEW_LINE>double eps = Math.pow(2, beta);<NEW_LINE>for (int i = 0; i < m; i++) {<NEW_LINE>Point p = list.get(i);<NEW_LINE>index[i] = p.getIndex();<NEW_LINE>value[i] = Math.round(p.getValue() / eps);<NEW_LINE>}<NEW_LINE>BitConstructor constructor = new BitConstructor(9 + 13 * m);<NEW_LINE>// Block size with 16 bits<NEW_LINE>constructor.add(writeIndex, 16);<NEW_LINE>// Number of reserved components with 16 bits<NEW_LINE>constructor.add(m, 16);<NEW_LINE>// Exponent of quantification level with 16 bits<NEW_LINE>constructor.add(beta, 16);<NEW_LINE>// Encode the index sequence<NEW_LINE>encodeIndex(index, constructor);<NEW_LINE>// Encode the value sequence<NEW_LINE>encodeValue(value, constructor);<NEW_LINE>constructor.pad();<NEW_LINE>// return the encoded bytes<NEW_LINE>return constructor.toByteArray();<NEW_LINE>}
int m = list.size();
1,702,262
public final void mouseReleased(MouseEvent e) {<NEW_LINE>if (e.getSource() == textView && SwingUtilities.isLeftMouseButton(e)) {<NEW_LINE>int pos = textView.<MASK><NEW_LINE>if (pos != -1 && pos == lastPressedPos) {<NEW_LINE>int line = textView.getDocument().getDefaultRootElement().getElementIndex(pos);<NEW_LINE>if (line >= 0) {<NEW_LINE>lineClicked(line, pos);<NEW_LINE>// do NOT allow this window's caret to steal the focus from editor window<NEW_LINE>e.consume();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>lastPressedPos = -1;<NEW_LINE>}<NEW_LINE>if (e.isPopupTrigger()) {<NEW_LINE>Point p = // Convert immediately to our component space - if the<NEW_LINE>SwingUtilities.// Convert immediately to our component space - if the<NEW_LINE>convertPoint(// Convert immediately to our component space - if the<NEW_LINE>(Component) e.getSource(), // text view scrolls before the component is opened, popup can<NEW_LINE>// appear above the top of the screen<NEW_LINE>e.getPoint(), this);<NEW_LINE>postPopupMenu(p, this);<NEW_LINE>}<NEW_LINE>}
viewToModel(e.getPoint());
390,226
public void addSyntheticFieldWriteAccessMethod(SyntheticMethodBinding methodBinding) {<NEW_LINE>generateMethodInfoHeader(methodBinding);<NEW_LINE>int methodAttributeOffset = this.contentsOffset;<NEW_LINE>// this will add exception attribute, synthetic attribute, deprecated attribute,...<NEW_LINE>int attributeNumber = generateMethodInfoAttributes(methodBinding);<NEW_LINE>// Code attribute<NEW_LINE>int codeAttributeOffset = this.contentsOffset;<NEW_LINE>// add code attribute<NEW_LINE>attributeNumber++;<NEW_LINE>generateCodeAttributeHeader();<NEW_LINE><MASK><NEW_LINE>this.codeStream.generateSyntheticBodyForFieldWriteAccess(methodBinding);<NEW_LINE>completeCodeAttributeForSyntheticMethod(methodBinding, codeAttributeOffset, ((SourceTypeBinding) methodBinding.declaringClass).scope.referenceCompilationUnit().compilationResult.getLineSeparatorPositions());<NEW_LINE>// update the number of attributes<NEW_LINE>this.contents[methodAttributeOffset++] = (byte) (attributeNumber >> 8);<NEW_LINE>this.contents[methodAttributeOffset] = (byte) attributeNumber;<NEW_LINE>}
this.codeStream.init(this);
393,822
public static TextEdit generateAccessors(IType type, AccessorField[] accessors, boolean generateComments, Range cursor, IProgressMonitor monitor) {<NEW_LINE>if (type == null || type.getCompilationUnit() == null) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>ASTNode declarationNode = null;<NEW_LINE>CompilationUnit astRoot = CoreASTProvider.getInstance().getAST(type.getCompilationUnit(), CoreASTProvider.WAIT_YES, monitor);<NEW_LINE>if (astRoot != null && cursor != null) {<NEW_LINE>ASTNode node = NodeFinder.perform(astRoot, DiagnosticsHelper.getStartOffset(type.getCompilationUnit(), cursor), DiagnosticsHelper.getLength(type.getCompilationUnit(), cursor));<NEW_LINE>declarationNode = SourceAssistProcessor.getTypeDeclarationNode(node);<NEW_LINE>}<NEW_LINE>// If cursor position is not specified, then insert to the last by default.<NEW_LINE>IJavaElement insertPosition = (declarationNode != null) ? CodeGenerationUtils.findInsertElement(type, null) : CodeGenerationUtils.findInsertElement(type, cursor);<NEW_LINE>GenerateGetterSetterOperation operation = new GenerateGetterSetterOperation(type, null, generateComments, insertPosition);<NEW_LINE>return operation.createTextEdit(null, accessors);<NEW_LINE>} catch (OperationCanceledException | CoreException e) {<NEW_LINE><MASK><NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>}
JavaLanguageServerPlugin.logException("Failed to generate the accessors.", e);
1,719,391
protected void dynamicUpdateBrokerConfig(int podId, Admin ac, KafkaBrokerConfigurationDiff configurationDiff, KafkaBrokerLoggingConfigurationDiff logDiff) throws ForceableProblem, InterruptedException {<NEW_LINE>Map<ConfigResource, Collection<AlterConfigOp>> updatedConfig = new HashMap<>(2);<NEW_LINE>updatedConfig.put(Util.getBrokersConfig(podId), configurationDiff.getConfigDiff());<NEW_LINE>updatedConfig.put(Util.getBrokersLogging(podId), logDiff.getLoggingDiff());<NEW_LINE>LOGGER.debugCr(reconciliation, "Altering broker configuration {}", podId);<NEW_LINE>LOGGER.traceCr(reconciliation, "Altering broker configuration {} with {}", podId, updatedConfig);<NEW_LINE>AlterConfigsResult alterConfigResult = ac.incrementalAlterConfigs(updatedConfig);<NEW_LINE>KafkaFuture<Void> brokerConfigFuture = alterConfigResult.values().get(Util.getBrokersConfig(podId));<NEW_LINE>KafkaFuture<Void> brokerLoggingConfigFuture = alterConfigResult.values().get(Util.getBrokersLogging(podId));<NEW_LINE>await(Util.kafkaFutureToVertxFuture(reconciliation, vertx, brokerConfigFuture), 30, TimeUnit.SECONDS, error -> {<NEW_LINE>LOGGER.errorCr(reconciliation, "Error doing dynamic config update", error);<NEW_LINE>return new ForceableProblem("Error doing dynamic update", error);<NEW_LINE>});<NEW_LINE>await(Util.kafkaFutureToVertxFuture(reconciliation, vertx, brokerLoggingConfigFuture), 30, TimeUnit.SECONDS, error -> {<NEW_LINE>LOGGER.errorCr(reconciliation, "Error performing dynamic logging update for pod {}", podId, error);<NEW_LINE>return new ForceableProblem("Error performing dynamic logging update for pod " + podId, error);<NEW_LINE>});<NEW_LINE>LOGGER.<MASK><NEW_LINE>}
infoCr(reconciliation, "Dynamic reconfiguration for broker {} was successful.", podId);
799,225
private void commandStos(Instruction instruction, int flags) {<NEW_LINE>int addressSize;<NEW_LINE>int rDI, rCX;<NEW_LINE>switch(instruction.getOp0Kind()) {<NEW_LINE>case OpKind.MEMORY_ESDI:<NEW_LINE>addressSize = CodeSize.CODE16;<NEW_LINE>rDI = Register.DI;<NEW_LINE>rCX = Register.CX;<NEW_LINE>break;<NEW_LINE>case OpKind.MEMORY_ESEDI:<NEW_LINE>addressSize = CodeSize.CODE32;<NEW_LINE>rDI = Register.EDI;<NEW_LINE>rCX = Register.ECX;<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>addressSize = CodeSize.CODE64;<NEW_LINE>rDI = Register.RDI;<NEW_LINE>rCX = Register.RCX;<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>if (instruction.getRepePrefix() || instruction.getRepnePrefix()) {<NEW_LINE>info.opAccesses[0] = (byte) OpAccess.COND_WRITE;<NEW_LINE>info.opAccesses[1<MASK><NEW_LINE>if ((flags & Flags.NO_MEMORY_USAGE) == 0)<NEW_LINE>addMemory(Register.ES, rDI, Register.NONE, 1, 0, MemorySize.UNKNOWN, OpAccess.COND_WRITE, addressSize, 0);<NEW_LINE>if ((flags & Flags.NO_REGISTER_USAGE) == 0) {<NEW_LINE>assert info.usedRegisters.size() == 1 : info.usedRegisters.size();<NEW_LINE>info.usedRegisters.set(0, new UsedRegister(info.usedRegisters.get(0).getRegister(), OpAccess.COND_READ));<NEW_LINE>addRegister(flags, rCX, OpAccess.READ_COND_WRITE);<NEW_LINE>if ((flags & Flags.IS_64_BIT) == 0)<NEW_LINE>addRegister(flags, Register.ES, OpAccess.COND_READ);<NEW_LINE>addRegister(flags, rDI, OpAccess.COND_READ);<NEW_LINE>addRegister(flags, rDI, OpAccess.COND_WRITE);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>if ((flags & Flags.NO_MEMORY_USAGE) == 0)<NEW_LINE>addMemory(Register.ES, rDI, Register.NONE, 1, 0, instruction.getMemorySize(), OpAccess.WRITE, addressSize, 0);<NEW_LINE>if ((flags & Flags.NO_REGISTER_USAGE) == 0) {<NEW_LINE>if ((flags & Flags.IS_64_BIT) == 0)<NEW_LINE>addRegister(flags, Register.ES, OpAccess.READ);<NEW_LINE>addRegister(flags, rDI, OpAccess.READ_WRITE);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
] = (byte) OpAccess.COND_READ;
1,575,042
final RenderUiTemplateResult executeRenderUiTemplate(RenderUiTemplateRequest renderUiTemplateRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(renderUiTemplateRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<RenderUiTemplateRequest> request = null;<NEW_LINE>Response<RenderUiTemplateResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new RenderUiTemplateRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(renderUiTemplateRequest));<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, "SageMaker");<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<RenderUiTemplateResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new RenderUiTemplateResultJsonUnmarshaller());<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, "RenderUiTemplate");
283,699
private void buildMetatype() throws InvalidPropertyException, UnavailableException, ResourceAdapterInternalException, ClassNotFoundException {<NEW_LINE>MetaGenInstance instance = config.getInstance();<NEW_LINE>if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {<NEW_LINE>Tr.debug(this, tc, "Building metatype for:", instance);<NEW_LINE>Tr.debug(this, tc, "adapterName", instance.adapterName);<NEW_LINE>Tr.debug(this, tc, "raXmlFile", instance.xmlFileSet.raXmlFile);<NEW_LINE>Tr.debug(this, tc, "wlpRaXmlFile", instance.xmlFileSet.wlpRaXmlFile);<NEW_LINE>Tr.debug(this, tc, "parsedXml", instance.xmlFileSet.parsedXml);<NEW_LINE>Tr.debug(this, tc, "parsedWlpXml", instance.xmlFileSet.parsedWlpXml);<NEW_LINE>}<NEW_LINE>// This applies the wlp settings after all the merging is complete.<NEW_LINE>if (instance.xmlFileSet.parsedWlpXml != null) {<NEW_LINE>if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {<NEW_LINE>Tr.debug(this, tc, "combining ra and wlp xmls");<NEW_LINE>}<NEW_LINE>DeploymentDescriptorParser.combineWlpAndRaXmls(instance.adapterName, instance.xmlFileSet.parsedXml, instance.xmlFileSet.parsedWlpXml);<NEW_LINE>}<NEW_LINE>WlpIbmuiGroups ibmuiGroups = instance.xmlFileSet.parsedXml.getWlpIbmuiGroups();<NEW_LINE>if (ibmuiGroups != null) {<NEW_LINE>config.setIbmuiGroups(ibmuiGroups);<NEW_LINE>instance.metatype.<MASK><NEW_LINE>}<NEW_LINE>instance.metatype.setOriginatingRaConnector(instance.xmlFileSet.parsedXml);<NEW_LINE>// buildResourceAdapters(...) MUST EXECUTE FIRST!<NEW_LINE>buildResourceAdapters(instance);<NEW_LINE>buildConnectionFactories(instance);<NEW_LINE>buildAdminObjects(instance);<NEW_LINE>buildMessageListeners(instance);<NEW_LINE>instance.markAsProcessed();<NEW_LINE>}
setIbmuiGroupOrder(ibmuiGroups.getGroupOrder());
1,490,782
public MediaContainerDetectionResult probe(AudioReference reference, SeekableInputStream inputStream) throws IOException {<NEW_LINE>if (!checkNextBytes(inputStream, M3U_HEADER_TAG) && !checkNextBytes(inputStream, M3U_ENTRY_TAG)) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>log.debug("Track {} is an M3U playlist file.", reference.identifier);<NEW_LINE>String[] lines = DataFormatTools.streamToLines(inputStream, StandardCharsets.UTF_8);<NEW_LINE>String <MASK><NEW_LINE>if (hlsStreamUrl != null) {<NEW_LINE>AudioTrackInfoBuilder infoBuilder = AudioTrackInfoBuilder.create(reference, inputStream);<NEW_LINE>AudioReference httpReference = HttpAudioSourceManager.getAsHttpReference(reference);<NEW_LINE>if (httpReference != null) {<NEW_LINE>return supportedFormat(this, TYPE_HLS_OUTER, infoBuilder.setIdentifier(httpReference.identifier).build());<NEW_LINE>} else {<NEW_LINE>return refer(this, new AudioReference(hlsStreamUrl, infoBuilder.getTitle(), new MediaContainerDescriptor(this, TYPE_HLS_INNER)));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>MediaContainerDetectionResult result = loadSingleItemPlaylist(lines);<NEW_LINE>if (result != null) {<NEW_LINE>return result;<NEW_LINE>}<NEW_LINE>return unsupportedFormat(this, "The playlist file contains no links.");<NEW_LINE>}
hlsStreamUrl = HlsStreamSegmentUrlProvider.findHlsEntryUrl(lines);
1,663,046
public static void main(String[] args) throws Exception {<NEW_LINE>Options options = new Options();<NEW_LINE>options.addOption(option(0, "l", OPTION_LOCAL, "Run the topology in local mode."));<NEW_LINE>options.addOption(option(0, "r", OPTION_REMOTE, "Deploy the topology to a remote cluster."));<NEW_LINE>options.addOption(option(0, "R", OPTION_RESOURCE, "Treat the supplied path as a classpath resource instead of a file."));<NEW_LINE>options.addOption(option(1, "s", OPTION_SLEEP, "ms", "When running locally, the amount of time to sleep (in ms.) " + "before killing the topology and shutting down the local cluster."));<NEW_LINE>options.addOption(option(0, "d"<MASK><NEW_LINE>options.addOption(option(0, "q", OPTION_NO_DETAIL, "Suppress the printing of topology details."));<NEW_LINE>options.addOption(option(0, "n", OPTION_NO_SPLASH, "Suppress the printing of the splash screen."));<NEW_LINE>options.addOption(option(0, "i", OPTION_INACTIVE, "Deploy the topology, but do not activate it."));<NEW_LINE>options.addOption(option(1, "z", OPTION_ZOOKEEPER, "host:port", "When running in local mode, use the ZooKeeper at the " + "specified <host>:<port> instead of the in-process ZooKeeper. (requires Storm 0.9.3 or later)"));<NEW_LINE>options.addOption(option(1, "f", OPTION_FILTER, "file", "Perform property substitution. Use the specified file " + "as a source of properties, and replace keys identified with {$[property name]} with the value defined " + "in the properties file."));<NEW_LINE>options.addOption(option(0, "e", OPTION_ENV_FILTER, "Perform environment variable substitution. Replace keys" + "identified with `${ENV-[NAME]}` will be replaced with the corresponding `NAME` environment value"));<NEW_LINE>CommandLineParser parser = new BasicParser();<NEW_LINE>CommandLine cmd = parser.parse(options, args);<NEW_LINE>if (cmd.getArgs().length != 1) {<NEW_LINE>usage(options);<NEW_LINE>System.exit(1);<NEW_LINE>}<NEW_LINE>runCli(cmd);<NEW_LINE>}
, OPTION_DRY_RUN, "Do not run or deploy the topology. Just build, validate, " + "and print information about the topology."));
187,902
private void warnAboutPerformanceOnUnqualifiedResources(String theParamName, RequestDetails theRequest, @Nullable List<String> theCandidateTargetTypes) {<NEW_LINE>StringBuilder builder = new StringBuilder();<NEW_LINE>builder.append("This search uses an unqualified resource(a parameter in a chain without a resource type). ");<NEW_LINE>builder.append("This is less efficient than using a qualified type. ");<NEW_LINE>if (theCandidateTargetTypes != null) {<NEW_LINE>builder.append("[" + theParamName + "] resolves to [" + theCandidateTargetTypes.stream().collect(Collectors.joining(",")) + "].");<NEW_LINE>builder.append("If you know what you're looking for, try qualifying it using the form ");<NEW_LINE>builder.append(theCandidateTargetTypes.stream().map(cls -> "[" + cls + ":" + theParamName + "]").collect(<MASK><NEW_LINE>} else {<NEW_LINE>builder.append("If you know what you're looking for, try qualifying it using the form: '");<NEW_LINE>builder.append(theParamName).append(":[resourceType]");<NEW_LINE>builder.append("'");<NEW_LINE>}<NEW_LINE>String message = builder.toString();<NEW_LINE>StorageProcessingMessage msg = new StorageProcessingMessage().setMessage(message);<NEW_LINE>HookParams params = new HookParams().add(RequestDetails.class, theRequest).addIfMatchesType(ServletRequestDetails.class, theRequest).add(StorageProcessingMessage.class, msg);<NEW_LINE>CompositeInterceptorBroadcaster.doCallHooks(myInterceptorBroadcaster, theRequest, Pointcut.JPA_PERFTRACE_WARNING, params);<NEW_LINE>}
Collectors.joining(" or ")));
1,641,137
public boolean performOk() {<NEW_LINE>getPreferenceStore().setValue(BACKUP_ON_SAVE, fBackupOnSaveButton.getSelection());<NEW_LINE>getPreferenceStore().setValue(OPEN_DIAGRAMS_ON_LOAD, fOpenDiagramsOnLoadButton.getSelection());<NEW_LINE>getPreferenceStore().setValue(MRU_MAX, fMRUSizeSpinner.getSelection());<NEW_LINE>getPreferenceStore().setValue(HIGHLIGHT_UNUSED_ELEMENTS_IN_MODEL_TREE, fShowUnusedElementsInModelTreeButton.getSelection());<NEW_LINE>getPreferenceStore().setValue(TREE_SEARCH_AUTO, fAutoSearchButton.getSelection());<NEW_LINE>getPreferenceStore().setValue(SHOW_WARNING_ON_DELETE_FROM_TREE, fWarnOnDeleteButton.getSelection());<NEW_LINE>getPreferenceStore().setValue(USE_LABEL_EXPRESSIONS_IN_ANALYSIS_TABLE, fUseLabelExpressionsButton.getSelection());<NEW_LINE>getPreferenceStore().setValue(SCALE_IMAGE_EXPORT, fScaleImagesButton.getSelection());<NEW_LINE>if (fUseEdgeBrowserButton != null) {<NEW_LINE>getPreferenceStore().setValue(EDGE_BROWSER, fUseEdgeBrowserButton.getSelection());<NEW_LINE>}<NEW_LINE>getPreferenceStore().setValue(HINTS_BROWSER_JS_ENABLED, fEnableJSHintsButton.getSelection());<NEW_LINE>getPreferenceStore().setValue(<MASK><NEW_LINE>if (AnimationUtil.supportsAnimation()) {<NEW_LINE>getPreferenceStore().setValue(ANIMATE_VIEW, fDoAnimationViewButton.getSelection());<NEW_LINE>getPreferenceStore().setValue(ANIMATION_VIEW_TIME, fAnimationViewTimeSpinner.getSelection());<NEW_LINE>getPreferenceStore().setValue(ANIMATE_VISUALISER_NODES, fAnimateVisualiserNodesButton.getSelection());<NEW_LINE>getPreferenceStore().setValue(ANIMATE_VISUALISER_TIME, fAnimationVisualiserTimeSpinner.getSelection());<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>}
HINTS_BROWSER_EXTERNAL_HOSTS_ENABLED, fEnableExternalHostsHintsButton.getSelection());
897,632
private void unsollicitedUpdate(String data) {<NEW_LINE>// Example of<NEW_LINE>// I=00000000000000000000000000000000&O=10000000000000000000000000000000&\<NEW_LINE>// A0=0&A1=0&A2=0&A3=0&A4=0&A5=0&A6=0&A7=0&A8=0&A9=0&A10=0&A11=0&A12=0&A13=0&A14=0&A15=0&C1=47&C2=0&C3=0&C4=0&C5=0&C6=0&C7=0&C8=0<NEW_LINE>final Pattern VALIDATION_PATTERN = Pattern.compile("I=(\\d{32})&O=(\\d{32})&([AC]\\d{1,2}=\\d+&)*[^I]*");<NEW_LINE>final Matcher matcher = VALIDATION_PATTERN.matcher(data);<NEW_LINE>while (matcher.find()) {<NEW_LINE>// Workaround of an IPX800 bug<NEW_LINE>String completeCommand = matcher.group();<NEW_LINE><MASK><NEW_LINE>for (String command : completeCommand.split("&")) {<NEW_LINE>int sepIndex = command.indexOf("=");<NEW_LINE>if (sepIndex == -1) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>String prefix = command.substring(0, sepIndex);<NEW_LINE>Ipx800PortType slotType = Ipx800PortType.getSlotByPrefix(prefix.substring(0, 1));<NEW_LINE>if (slotType == null) {<NEW_LINE>logger.error("Not supported type for now '{}'", prefix);<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (sepIndex == 1) {<NEW_LINE>onBitUpdate(command.substring(sepIndex + 1), slotType);<NEW_LINE>} else {<NEW_LINE>onBitUpdate(command.substring(sepIndex + 1), slotType, Integer.parseInt(prefix.substring(1)));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
logger.debug("Command : " + completeCommand);
1,718,429
// @see https://gist.github.com/viperwarp/2beb6bbefcc268dee7ad<NEW_LINE>public static WritableMap convertJsonToMap(JSONObject jsonObject) throws JSONException {<NEW_LINE>WritableMap map = new WritableNativeMap();<NEW_LINE>Iterator<String> iterator = jsonObject.keys();<NEW_LINE>while (iterator.hasNext()) {<NEW_LINE>String key = iterator.next();<NEW_LINE>Object value = jsonObject.get(key);<NEW_LINE>if (value instanceof JSONObject) {<NEW_LINE>map.putMap(key, convertJsonToMap((JSONObject) value));<NEW_LINE>} else if (value instanceof Boolean) {<NEW_LINE>map.putBoolean(key, (Boolean) value);<NEW_LINE>} else if (value instanceof Integer) {<NEW_LINE>map.putInt(key, (Integer) value);<NEW_LINE>} else if (value instanceof Double) {<NEW_LINE>map.putDouble(key, (Double) value);<NEW_LINE>} else if (value instanceof String) {<NEW_LINE>map.putString<MASK><NEW_LINE>} else {<NEW_LINE>map.putString(key, value.toString());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return map;<NEW_LINE>}
(key, (String) value);
60,691
public Event copyToAsync(CommandQueue queue, Image dest, long[] srcOrigin, long[] destOrigin, long[] region) {<NEW_LINE>if (srcOrigin.length != 3 || destOrigin.length != 3 || region.length != 3) {<NEW_LINE>throw new IllegalArgumentException("origin and region must both be arrays of length 3");<NEW_LINE>}<NEW_LINE>Utils.pointerBuffers[0].rewind();<NEW_LINE>Utils.pointerBuffers[1].rewind();<NEW_LINE>Utils.pointerBuffers[2].rewind();<NEW_LINE>Utils.pointerBuffers[3].rewind();<NEW_LINE>Utils.pointerBuffers[1].put(srcOrigin).position(0);<NEW_LINE>Utils.pointerBuffers[2].put(destOrigin).position(0);<NEW_LINE>Utils.pointerBuffers[3].put(region).position(0);<NEW_LINE>CLCommandQueue q = ((LwjglCommandQueue) queue).getQueue();<NEW_LINE>int ret = CL10.clEnqueueCopyImage(q, image, ((LwjglImage) dest).getImage(), Utils.pointerBuffers[1], Utils.pointerBuffers[2], Utils.pointerBuffers[3], null, Utils.pointerBuffers[0]);<NEW_LINE>Utils.checkError(ret, "clEnqueueCopyImage");<NEW_LINE>long event = Utils.pointerBuffers<MASK><NEW_LINE>return new LwjglEvent(q.getCLEvent(event));<NEW_LINE>}
[0].get(0);
914,332
private void delete(Table table) throws IOException {<NEW_LINE>final byte[] rowToBeDeleted = Bytes.toBytes("RowToBeDeleted");<NEW_LINE>System.out.println("\n*** DELETE ~Insert data and then delete it~ ***");<NEW_LINE>System.out.println("Inserting a data to be deleted later.");<NEW_LINE>Put put = new Put(rowToBeDeleted);<NEW_LINE>put.addColumn(family1.getBytes(), qualifier1, cellData);<NEW_LINE>table.put(put);<NEW_LINE>Get get = new Get(rowToBeDeleted);<NEW_LINE>Result result = table.get(get);<NEW_LINE>byte[] value = result.getValue(family1.getBytes(), qualifier1);<NEW_LINE>System.out.println("Fetch the data: " + Bytes.toString(value));<NEW_LINE>assert Arrays.equals(cellData, value);<NEW_LINE>System.out.println("Deleting");<NEW_LINE>Delete delete = new Delete(rowToBeDeleted);<NEW_LINE>delete.addColumn(<MASK><NEW_LINE>table.delete(delete);<NEW_LINE>result = table.get(get);<NEW_LINE>value = result.getValue(family1.getBytes(), qualifier1);<NEW_LINE>System.out.println("Fetch the data: " + Bytes.toString(value));<NEW_LINE>assert Arrays.equals(null, value);<NEW_LINE>System.out.println("Done. ");<NEW_LINE>}
family1.getBytes(), qualifier1);
654,515
public FlipperObject toFlipperObject(@Nullable RoundingParams roundingParams) {<NEW_LINE>if (roundingParams == null) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>FlipperObject.Builder optionsJson = new FlipperObject.Builder();<NEW_LINE>optionsJson.put("borderWidth", roundingParams.getBorderWidth());<NEW_LINE>optionsJson.put("cornersRadii", toSonarArray(roundingParams.getCornersRadii()));<NEW_LINE>optionsJson.put("padding", roundingParams.getPadding());<NEW_LINE>optionsJson.put("roundAsCircle", roundingParams.getRoundAsCircle());<NEW_LINE>optionsJson.put("roundingMethod", roundingParams.getRoundingMethod());<NEW_LINE>optionsJson.put("borderColor", InspectorValue.immutable(Color, roundingParams.getBorderColor()));<NEW_LINE>optionsJson.put("overlayColor", InspectorValue.immutable(Color<MASK><NEW_LINE>return optionsJson.build();<NEW_LINE>}
, roundingParams.getOverlayColor()));
1,854,343
public PiecewisePolynomialResult interpolate(final double[] xValues, final double[] yValues) {<NEW_LINE>ArgChecker.notNull(xValues, "xValues");<NEW_LINE>ArgChecker.notNull(yValues, "yValues");<NEW_LINE>ArgChecker.isTrue(xValues.length == yValues.length | xValues.length + 2 == yValues.length, "(xValues length = yValues length) or (xValues length + 2 = yValues length)");<NEW_LINE>ArgChecker.isTrue(xValues.length > 2, "Data points should be more than 2");<NEW_LINE>final int nDataPts = xValues.length;<NEW_LINE>final int yValuesLen = yValues.length;<NEW_LINE>for (int i = 0; i < nDataPts; ++i) {<NEW_LINE>ArgChecker.isFalse(Double.isNaN(xValues[i]), "xValues containing NaN");<NEW_LINE>ArgChecker.isFalse(Double.isInfinite(xValues[i]), "xValues containing Infinity");<NEW_LINE>}<NEW_LINE>for (int i = 0; i < yValuesLen; ++i) {<NEW_LINE>ArgChecker.isFalse(Double.isNaN(yValues[i]), "yValues containing NaN");<NEW_LINE>ArgChecker.isFalse(Double.isInfinite(<MASK><NEW_LINE>}<NEW_LINE>double[] xValuesSrt = Arrays.copyOf(xValues, nDataPts);<NEW_LINE>double[] yValuesSrt;<NEW_LINE>if (nDataPts == yValuesLen) {<NEW_LINE>yValuesSrt = Arrays.copyOf(yValues, nDataPts);<NEW_LINE>} else {<NEW_LINE>yValuesSrt = Arrays.copyOfRange(yValues, 1, nDataPts + 1);<NEW_LINE>}<NEW_LINE>DoubleArrayMath.sortPairs(xValuesSrt, yValuesSrt);<NEW_LINE>ArgChecker.noDuplicatesSorted(xValuesSrt, "xValues");<NEW_LINE>final double[] intervals = _solver.intervalsCalculator(xValuesSrt);<NEW_LINE>final double[] slopes = _solver.slopesCalculator(yValuesSrt, intervals);<NEW_LINE>final PiecewisePolynomialResult result = _method.interpolate(xValues, yValues);<NEW_LINE>ArgChecker.isTrue(result.getOrder() == 4, "Primary interpolant is not cubic");<NEW_LINE>final double[] initialFirst = _function.differentiate(result, xValuesSrt).rowArray(0);<NEW_LINE>final double[] first = firstDerivativeCalculator(yValuesSrt, intervals, slopes, initialFirst);<NEW_LINE>final double[][] coefs = _solver.solve(yValuesSrt, intervals, slopes, first);<NEW_LINE>for (int i = 0; i < nDataPts - 1; ++i) {<NEW_LINE>for (int j = 0; j < 4; ++j) {<NEW_LINE>ArgChecker.isFalse(Double.isNaN(coefs[i][j]), "Too large input");<NEW_LINE>ArgChecker.isFalse(Double.isInfinite(coefs[i][j]), "Too large input");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return new PiecewisePolynomialResult(DoubleArray.copyOf(xValuesSrt), DoubleMatrix.copyOf(coefs), 4, 1);<NEW_LINE>}
yValues[i]), "yValues containing Infinity");
356,073
private void update(CopyOnWriteList<UIUpdatable> updateables, boolean is_visible) {<NEW_LINE>long start = 0;<NEW_LINE>Map<UIUpdatable, Long> mapTimeMap = DEBUG_TIMER ? new HashMap<UIUpdatable, Long>() : null;<NEW_LINE>Display display = Utils.getDisplay();<NEW_LINE>if (display == null || display.isDisposed()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>for (UIUpdatable updateable : updateables) {<NEW_LINE>try {<NEW_LINE>if (DEBUG_TIMER) {<NEW_LINE>start = SystemTime.getCurrentTime();<NEW_LINE>}<NEW_LINE>if (updateable instanceof UIUpdatableAlways) {<NEW_LINE>((UIUpdatableAlways) updateable).updateUI(is_visible);<NEW_LINE>} else {<NEW_LINE>updateable.updateUI();<NEW_LINE>}<NEW_LINE>if (DEBUG_TIMER) {<NEW_LINE>long diff = SystemTime.getCurrentTime() - start;<NEW_LINE>if (diff > 0) {<NEW_LINE>mapTimeMap.put(<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (Throwable t) {<NEW_LINE>Logger.log(new LogEvent(LOGID, "Error while trying to update UI Element " + updateable.getUpdateUIName(), t));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (DEBUG_TIMER) {<NEW_LINE>makeDebugToolTip(mapTimeMap);<NEW_LINE>}<NEW_LINE>}
updateable, new Long(diff));
1,790,400
public void store(DomRepresentation mailRep) throws IOException {<NEW_LINE>// Parses and normalizes the DOM document<NEW_LINE>Document doc = mailRep.getDocument();<NEW_LINE>Element mailElt = doc.getDocumentElement();<NEW_LINE>Element statusElt = (Element) mailElt.getElementsByTagName("status").item(0);<NEW_LINE>Element subjectElt = (Element) mailElt.getElementsByTagName<MASK><NEW_LINE>Element contentElt = (Element) mailElt.getElementsByTagName("content").item(0);<NEW_LINE>Element accountRefElt = (Element) mailElt.getElementsByTagName("accountRef").item(0);<NEW_LINE>// Output the XML element values<NEW_LINE>System.out.println("Status: " + statusElt.getTextContent());<NEW_LINE>System.out.println("Subject: " + subjectElt.getTextContent());<NEW_LINE>System.out.println("Content: " + contentElt.getTextContent());<NEW_LINE>System.out.println("Account URI: " + accountRefElt.getTextContent());<NEW_LINE>}
("subject").item(0);
1,357,556
final GetQueryStateResult executeGetQueryState(GetQueryStateRequest getQueryStateRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(getQueryStateRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<GetQueryStateRequest> request = null;<NEW_LINE>Response<GetQueryStateResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new GetQueryStateRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(getQueryStateRequest));<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, "LakeFormation");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "GetQueryState");<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>String hostPrefix = "query-";<NEW_LINE>String resolvedHostPrefix = String.format("query-");<NEW_LINE>endpointTraitHost = <MASK><NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<GetQueryStateResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new GetQueryStateResultJsonUnmarshaller());<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);