idx
int32
46
1.86M
input
stringlengths
321
6.6k
target
stringlengths
9
1.24k
354,022
private void updateNodeInfoFromReportedState(final NodeInfo node, final NodeState currentState, final NodeState reportedState, final NodeStateOrHostInfoChangeHandler nodeListener) {<NEW_LINE>final long timeNow = timer.getCurrentTimeInMillis();<NEW_LINE>log.log(Level.FINE, () -> String.format("Finding new cluster state entry for %s switching state %s", node, currentState.getTextualDifference(reportedState)));<NEW_LINE>if (handleReportedNodeCrashEdge(node, currentState, reportedState, nodeListener, timeNow)) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (initializationProgressHasIncreased(currentState, reportedState)) {<NEW_LINE>node.setInitProgressTime(timeNow);<NEW_LINE>log.log(Level.FINEST, () -> "Reset initialize timer on " + node + <MASK><NEW_LINE>}<NEW_LINE>if (handleImplicitCrashEdgeFromReverseInitProgress(node, currentState, reportedState, nodeListener, timeNow)) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>markNodeUnstableIfDownEdgeDuringInit(node, currentState, reportedState, nodeListener, timeNow);<NEW_LINE>}
" to " + node.getInitProgressTime());
1,752,892
private static void printManagamentStatistic() {<NEW_LINE>OperatingSystemMXBean osMxBean = ManagementFactory.getOperatingSystemMXBean();<NEW_LINE>int processors = osMxBean.getAvailableProcessors();<NEW_LINE>RuntimeMXBean runtimeMXBean = ManagementFactory.getRuntimeMXBean();<NEW_LINE>Logger logger = STATISTIC_LOGGER;<NEW_LINE>logger.info("{} processors, started {}, up {}", processors, start, formatTime(runtimeMXBean.getUptime()));<NEW_LINE>ThreadMXBean threadMxBean = ManagementFactory.getThreadMXBean();<NEW_LINE>if (threadMxBean.isThreadCpuTimeSupported() && threadMxBean.isThreadCpuTimeEnabled()) {<NEW_LINE>long alltime = 0;<NEW_LINE>long[<MASK><NEW_LINE>for (long id : ids) {<NEW_LINE>long time = threadMxBean.getThreadCpuTime(id);<NEW_LINE>if (0 < time) {<NEW_LINE>alltime += time;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>long pTime = alltime / processors;<NEW_LINE>logger.info("cpu-time: {} ms (per-processor: {} ms)", TimeUnit.NANOSECONDS.toMillis(alltime), TimeUnit.NANOSECONDS.toMillis(pTime));<NEW_LINE>}<NEW_LINE>long gcCount = 0;<NEW_LINE>long gcTime = 0;<NEW_LINE>for (GarbageCollectorMXBean gcMxBean : ManagementFactory.getGarbageCollectorMXBeans()) {<NEW_LINE>long count = gcMxBean.getCollectionCount();<NEW_LINE>if (0 < count) {<NEW_LINE>gcCount += count;<NEW_LINE>}<NEW_LINE>long time = gcMxBean.getCollectionTime();<NEW_LINE>if (0 < time) {<NEW_LINE>gcTime += time;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>logger.info("gc: {} ms, {} calls", gcTime, gcCount);<NEW_LINE>double loadAverage = osMxBean.getSystemLoadAverage();<NEW_LINE>if (!(loadAverage < 0.0d)) {<NEW_LINE>logger.info("average load: {}", String.format("%.2f", loadAverage));<NEW_LINE>}<NEW_LINE>}
] ids = threadMxBean.getAllThreadIds();
1,677,239
public static final <V> V executeDirect(Callable<V> exe, Duration totalWaitTime) throws BackendException {<NEW_LINE>Preconditions.checkArgument(!totalWaitTime.isZero(), "Need to specify a positive waitTime: %s", totalWaitTime);<NEW_LINE>long maxTime = System.currentTimeMillis() + totalWaitTime.toMillis();<NEW_LINE>Duration waitTime = pertubateTime(BASE_REATTEMPT_TIME);<NEW_LINE>BackendException lastException;<NEW_LINE>while (true) {<NEW_LINE>try {<NEW_LINE>return exe.call();<NEW_LINE>} catch (final Throwable e) {<NEW_LINE>// Find inner-most StorageException<NEW_LINE>Throwable ex = e;<NEW_LINE>BackendException storeEx = null;<NEW_LINE>do {<NEW_LINE>if (ex instanceof BackendException)<NEW_LINE>storeEx = (BackendException) ex;<NEW_LINE>} while ((ex = ex.getCause()) != null);<NEW_LINE>if (storeEx != null && storeEx instanceof TemporaryBackendException) {<NEW_LINE>lastException = storeEx;<NEW_LINE>} else if (e instanceof BackendException) {<NEW_LINE>throw (BackendException) e;<NEW_LINE>} else {<NEW_LINE>throw new PermanentBackendException("Permanent exception while executing backend operation " + <MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Wait and retry<NEW_LINE>assert lastException != null;<NEW_LINE>if (System.currentTimeMillis() + waitTime.toMillis() < maxTime) {<NEW_LINE>log.info("Temporary exception during backend operation [" + exe.toString() + "]. Attempting backoff retry.", lastException);<NEW_LINE>try {<NEW_LINE>Thread.sleep(waitTime.toMillis());<NEW_LINE>} catch (InterruptedException r) {<NEW_LINE>throw new PermanentBackendException("Interrupted while waiting to retry failed backend operation", r);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>waitTime = pertubateTime(waitTime.multipliedBy(2));<NEW_LINE>}<NEW_LINE>throw new TemporaryBackendException("Could not successfully complete backend operation due to repeated temporary exceptions after " + totalWaitTime, lastException);<NEW_LINE>}
exe.toString(), e);
1,119,333
private Maybe<String> evaluateAndFormat() {<NEW_LINE>Maybe<Double> evaluation = (new Expression(expression)).evaluate();<NEW_LINE>if (evaluation.isNothing()) {<NEW_LINE>return Maybe.nothingBecause("invalid expression: " + expression);<NEW_LINE>}<NEW_LINE>Double result = evaluation.getValue();<NEW_LINE>Long iResult = Math.round(result);<NEW_LINE>if (format == null)<NEW_LINE>return new Maybe<>(result.equals(iResult.doubleValue()) ? iResult.toString() : result.toString());<NEW_LINE>if (// ...use the integer<NEW_LINE>"aAdhHoOxX".indexOf(conversion) >= 0)<NEW_LINE>return new Maybe<>(String.format(locale, format, iResult));<NEW_LINE>if (// ...use boolean<NEW_LINE>"bB".indexOf(conversion) >= 0)<NEW_LINE>return new Maybe<>(result == 0.0 ? "false" : "true");<NEW_LINE>if ("sScC".indexOf(conversion) >= 0) {<NEW_LINE>// ...string & character formatting; use the double<NEW_LINE>String sString;<NEW_LINE>boolean isInt = result.equals(iResult.doubleValue());<NEW_LINE>if (isInt)<NEW_LINE>sString = String.format(locale, format, iResult.toString());<NEW_LINE>else<NEW_LINE>sString = String.format(locale, <MASK><NEW_LINE>return new Maybe<>(sString.replaceAll(" ", HtmlUtil.NBSP.html()));<NEW_LINE>}<NEW_LINE>if ("tT".indexOf(conversion) >= 0) {<NEW_LINE>// ...date<NEW_LINE>Calendar cal = Calendar.getInstance();<NEW_LINE>cal.setTimeInMillis(iResult);<NEW_LINE>return new Maybe<>(String.format(locale, format, cal.getTime()));<NEW_LINE>}<NEW_LINE>if (// ...use the double<NEW_LINE>"eEfgG".indexOf(conversion) >= 0)<NEW_LINE>return new Maybe<>(String.format(locale, format, result));<NEW_LINE>return Maybe.nothingBecause("invalid format: " + format);<NEW_LINE>}
format, result.toString());
1,496,818
void initiateClose(boolean saveState) {<NEW_LINE>log.trace("initiateClose(saveState={}) {}", saveState, getExtent());<NEW_LINE>MinorCompactionTask mct = null;<NEW_LINE>synchronized (this) {<NEW_LINE>if (isClosed() || isClosing()) {<NEW_LINE>String msg = "Tablet " + getExtent() + " already " + closeState;<NEW_LINE>throw new IllegalStateException(msg);<NEW_LINE>}<NEW_LINE>// enter the closing state, no splits or minor compactions can start<NEW_LINE>closeState = CloseState.CLOSING;<NEW_LINE>this.notifyAll();<NEW_LINE>}<NEW_LINE>// Cancel any running compactions and prevent future ones from starting. This is very important<NEW_LINE>// because background compactions may update the metadata table. These metadata updates can not<NEW_LINE>// be allowed after a tablet closes. Compactable has its own lock and calls tablet code, so do<NEW_LINE>// not hold tablet lock while calling it.<NEW_LINE>compactable.close();<NEW_LINE>synchronized (this) {<NEW_LINE>Preconditions.checkState(closeState == CloseState.CLOSING);<NEW_LINE>while (updatingFlushID) {<NEW_LINE>try {<NEW_LINE>this.wait(50);<NEW_LINE>} catch (InterruptedException e) {<NEW_LINE>log.error(e.toString());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// calling this.wait() releases the lock, ensure things are as expected when the lock is<NEW_LINE>// obtained again<NEW_LINE>Preconditions.<MASK><NEW_LINE>if (!saveState || getTabletMemory().getMemTable().getNumEntries() == 0) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>getTabletMemory().waitForMinC();<NEW_LINE>// calling this.wait() in waitForMinC() releases the lock, ensure things are as expected when<NEW_LINE>// the lock is obtained again<NEW_LINE>Preconditions.checkState(closeState == CloseState.CLOSING);<NEW_LINE>try {<NEW_LINE>mct = prepareForMinC(getFlushID(), MinorCompactionReason.CLOSE);<NEW_LINE>} catch (NoNodeException e) {<NEW_LINE>throw new RuntimeException("Exception on " + extent + " during prep for MinC", e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// do minor compaction outside of synch block so that tablet can be read and written to while<NEW_LINE>// compaction runs<NEW_LINE>mct.run();<NEW_LINE>}
checkState(closeState == CloseState.CLOSING);
804,671
public static List<RBAC> translate(String authorizationPolicy) throws IllegalArgumentException, IOException {<NEW_LINE>Object jsonObject = JsonParser.parse(authorizationPolicy);<NEW_LINE>if (!(jsonObject instanceof Map)) {<NEW_LINE>throw new IllegalArgumentException("Authorization policy should be a JSON object. Found: " + (jsonObject == null ? null : jsonObject.getClass()));<NEW_LINE>}<NEW_LINE>@SuppressWarnings("unchecked")<NEW_LINE>Map<String, ?> json = (Map<String, ?>) jsonObject;<NEW_LINE>String name = JsonUtil.getString(json, "name");<NEW_LINE>if (name == null || name.isEmpty()) {<NEW_LINE>throw new IllegalArgumentException("\"name\" is absent or empty");<NEW_LINE>}<NEW_LINE>List<RBAC> rbacs = new ArrayList<>();<NEW_LINE>List<Map<String, ?>> objects = JsonUtil.getListOfObjects(json, "deny_rules");<NEW_LINE>if (objects != null && !objects.isEmpty()) {<NEW_LINE>rbacs.add(RBAC.newBuilder().setAction(Action.DENY).putAllPolicies(parseRules(objects, name)).build());<NEW_LINE>}<NEW_LINE>objects = <MASK><NEW_LINE>if (objects == null || objects.isEmpty()) {<NEW_LINE>throw new IllegalArgumentException("\"allow_rules\" is absent");<NEW_LINE>}<NEW_LINE>rbacs.add(RBAC.newBuilder().setAction(Action.ALLOW).putAllPolicies(parseRules(objects, name)).build());<NEW_LINE>return rbacs;<NEW_LINE>}
JsonUtil.getListOfObjects(json, "allow_rules");
1,592,226
public void resize(DataObject dataObject, AsyncCompletionCallback<CreateCmdResult> callback) {<NEW_LINE>String scaleIOVolumePath = null;<NEW_LINE>String errMsg = null;<NEW_LINE>try {<NEW_LINE>if (dataObject.getType() == DataObjectType.VOLUME) {<NEW_LINE>scaleIOVolumePath = ((VolumeInfo) dataObject).getPath();<NEW_LINE>resizeVolume((VolumeInfo) dataObject);<NEW_LINE>} else {<NEW_LINE>errMsg = "Invalid DataObjectType (" <MASK><NEW_LINE>}<NEW_LINE>} catch (Exception ex) {<NEW_LINE>errMsg = ex.getMessage();<NEW_LINE>LOGGER.error(errMsg);<NEW_LINE>if (callback == null) {<NEW_LINE>throw ex;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (callback != null) {<NEW_LINE>CreateCmdResult result = new CreateCmdResult(scaleIOVolumePath, new Answer(null, errMsg == null, errMsg));<NEW_LINE>result.setResult(errMsg);<NEW_LINE>callback.complete(result);<NEW_LINE>}<NEW_LINE>}
+ dataObject.getType() + ") passed to resize";
861,495
private <T> IQueryBuilder<T> toQueryBuilder(final Class<T> clazz, final String trxName) {<NEW_LINE>final String tableName = InterfaceWrapperHelper.getTableName(clazz);<NEW_LINE>final POInfo poInfo = POInfo.getPOInfo(tableName);<NEW_LINE>final IQueryBuilder<T> queryBuilder = Services.get(IQueryBL.class).createQueryBuilder(clazz, Env.getCtx(), trxName);<NEW_LINE>queryBuilder.addEqualsFilter(COLUMNNAME_AD_Client_ID, this.clientId);<NEW_LINE>queryBuilder.addEqualsFilter(COLUMNNAME_M_Product_ID, this.productId);<NEW_LINE>queryBuilder.addEqualsFilter(COLUMNNAME_M_AttributeSetInstance_ID, attributeSetInstanceId);<NEW_LINE>queryBuilder.addEqualsFilter(COLUMNNAME_C_AcctSchema_ID, this.acctSchemaId);<NEW_LINE>//<NEW_LINE>// Filter by organization, only if it's set and we are querying the M_Cost table.<NEW_LINE>// Else, you can get no results.<NEW_LINE>// e.g. querying PP_Order_Cost, have this.AD_Org_ID=0 but PP_Order_Costs are created using PP_Order's AD_Org_ID<NEW_LINE>// see http://dewiki908/mediawiki/index.php/07741_Rate_Variance_%28103334042334%29.<NEW_LINE>if (!this.orgId.isAny() || I_M_Cost.Table_Name.equals(tableName)) {<NEW_LINE>queryBuilder.addEqualsFilter(COLUMNNAME_AD_Org_ID, orgId);<NEW_LINE>}<NEW_LINE>if (this.costElementId != null) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>if (this.costTypeId != null && poInfo.hasColumnName(COLUMNNAME_M_CostType_ID)) {<NEW_LINE>queryBuilder.addEqualsFilter(COLUMNNAME_M_CostType_ID, this.costTypeId);<NEW_LINE>}<NEW_LINE>return queryBuilder;<NEW_LINE>}
queryBuilder.addEqualsFilter(COLUMNNAME_M_CostElement_ID, costElementId);
1,795,211
public void check() {<NEW_LINE>boolean isTrue = this.type == 1 || this.type == 2 || this.type == 3 || this.type == 4;<NEW_LINE>ValidatorUtils.checkArgument(isTrue, "click type should be one of 1: customize action, 2: open url, 3: open app, 4: open rich media");<NEW_LINE>switch(this.type) {<NEW_LINE>case 1:<NEW_LINE>ValidatorUtils.checkArgument(StringUtils.isNotEmpty(this.intent) || StringUtils.isNotEmpty(this.action), "intent or action is required when click type=1");<NEW_LINE>break;<NEW_LINE>case 2:<NEW_LINE>ValidatorUtils.checkArgument(StringUtils.isNotEmpty(this.url), "url is required when click type=2");<NEW_LINE>ValidatorUtils.checkArgument(this.url<MASK><NEW_LINE>break;<NEW_LINE>case 4:<NEW_LINE>ValidatorUtils.checkArgument(StringUtils.isNotEmpty(this.rich_resource), "richResource is required when click type=4");<NEW_LINE>ValidatorUtils.checkArgument(this.rich_resource.matches(PATTERN), "richResource must start with https");<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}
.matches(PATTERN), "url must start with https");
1,551,916
public UsageAllocation unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>UsageAllocation usageAllocation = new UsageAllocation();<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("AllocatedUsageQuantity", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>usageAllocation.setAllocatedUsageQuantity(context.getUnmarshaller(Integer.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("Tags", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>usageAllocation.setTags(new ListUnmarshaller<Tag>(TagJsonUnmarshaller.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 usageAllocation;<NEW_LINE>}
String currentParentElement = context.getCurrentParentElement();
103,830
public void visitSerializableProperties(final Object object, final JavaBeanProvider.Visitor visitor) {<NEW_LINE>final PropertyDescriptor[] propertyDescriptors = getSerializableProperties(object);<NEW_LINE>for (final PropertyDescriptor property : propertyDescriptors) {<NEW_LINE>ErrorWritingException ex = null;<NEW_LINE>try {<NEW_LINE>final Method readMethod = property.getReadMethod();<NEW_LINE>final <MASK><NEW_LINE>final Class<?> definedIn = readMethod.getDeclaringClass();<NEW_LINE>if (visitor.shouldVisit(name, definedIn)) {<NEW_LINE>final Object value = readMethod.invoke(object);<NEW_LINE>visitor.visit(name, property.getPropertyType(), definedIn, value);<NEW_LINE>}<NEW_LINE>} catch (final IllegalArgumentException e) {<NEW_LINE>ex = new ConversionException("Cannot get property", e);<NEW_LINE>} catch (final IllegalAccessException e) {<NEW_LINE>ex = new ObjectAccessException("Cannot access property", e);<NEW_LINE>} catch (final InvocationTargetException e) {<NEW_LINE>ex = new ConversionException("Cannot get property", e.getTargetException());<NEW_LINE>}<NEW_LINE>if (ex != null) {<NEW_LINE>ex.add("property", object.getClass() + "." + property.getName());<NEW_LINE>throw ex;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
String name = property.getName();
1,500,468
private static void failIfCorrupted(Directory directory) throws IOException {<NEW_LINE>final String[] files = directory.listAll();<NEW_LINE>List<CorruptIndexException> ex = new ArrayList<>();<NEW_LINE>for (String file : files) {<NEW_LINE>if (file.startsWith(CORRUPTED_MARKER_NAME_PREFIX)) {<NEW_LINE>try (ChecksumIndexInput input = directory.openChecksumInput(file, IOContext.READONCE)) {<NEW_LINE>CodecUtil.checkHeader(input, CODEC, CORRUPTED_MARKER_CODEC_VERSION, CORRUPTED_MARKER_CODEC_VERSION);<NEW_LINE>final int size = input.readVInt();<NEW_LINE>final byte[] buffer = new byte[size];<NEW_LINE>input.readBytes(buffer, 0, buffer.length);<NEW_LINE>StreamInput <MASK><NEW_LINE>Exception t = in.readException();<NEW_LINE>if (t instanceof CorruptIndexException) {<NEW_LINE>ex.add((CorruptIndexException) t);<NEW_LINE>} else {<NEW_LINE>ex.add(new CorruptIndexException(t.getMessage(), "preexisting_corruption", t));<NEW_LINE>}<NEW_LINE>CodecUtil.checkFooter(input);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (ex.isEmpty() == false) {<NEW_LINE>ExceptionsHelper.rethrowAndSuppress(ex);<NEW_LINE>}<NEW_LINE>}
in = StreamInput.wrap(buffer);
230,594
public <A, R> EntryStream<K, R> collapseKeys(Collector<? super V, A, R> collector) {<NEW_LINE>Supplier<A> supplier = collector.supplier();<NEW_LINE>BiConsumer<A, ? super V> accumulator = collector.accumulator();<NEW_LINE>BinaryOperator<A<MASK><NEW_LINE>Function<A, R> finisher = collector.finisher();<NEW_LINE>return new StreamEx<>(new CollapseSpliterator<>(equalKeys(), e -> {<NEW_LINE>A a = supplier.get();<NEW_LINE>accumulator.accept(a, e.getValue());<NEW_LINE>return new PairBox<>(e.getKey(), a);<NEW_LINE>}, (pb, e) -> {<NEW_LINE>accumulator.accept(pb.b, e.getValue());<NEW_LINE>return pb;<NEW_LINE>}, (pb1, pb2) -> {<NEW_LINE>pb1.b = combiner.apply(pb1.b, pb2.b);<NEW_LINE>return pb1;<NEW_LINE>}, spliterator()), context).mapToEntry(pb -> pb.a, pb -> finisher.apply(pb.b));<NEW_LINE>}
> combiner = collector.combiner();
1,377,179
public void run(RegressionEnvironment env) {<NEW_LINE>RegressionPath path = new RegressionPath();<NEW_LINE>String stmtTextOne = "@public insert into MyStream select 1 as dummy, transpose(custom('O' || theString, 10)) from SupportBean(theString like 'I%')";<NEW_LINE>env.compileDeploy(stmtTextOne, path);<NEW_LINE>String stmtTextTwo = "@name('s0') select * from MyStream";<NEW_LINE>env.compileDeploy(stmtTextTwo, path).addListener("s0");<NEW_LINE>env.assertStatement("s0", statement -> assertEquals(Pair.class, statement.getEventType().getUnderlyingType()));<NEW_LINE>env.sendEventBean(new SupportBean("I1", 1));<NEW_LINE>env.assertEventNew("s0", result -> {<NEW_LINE>Pair underlying = <MASK><NEW_LINE>EPAssertionUtil.assertProps(result, "dummy,theString,intPrimitive".split(","), new Object[] { 1, "OI1", 10 });<NEW_LINE>assertEquals("OI1", ((SupportBean) underlying.getFirst()).getTheString());<NEW_LINE>});<NEW_LINE>env.undeployAll();<NEW_LINE>}
(Pair) result.getUnderlying();
1,811,456
public void process(T image) {<NEW_LINE>Objects.requireNonNull(norm_to_pixel, "You must set norm_to_pixel first");<NEW_LINE>BoofMiscOps.checkTrue(width != 0 && height != 0, "You must specify width and height");<NEW_LINE>frameID++;<NEW_LINE>observedID.clear();<NEW_LINE>dropped.clear();<NEW_LINE>spawned.clear();<NEW_LINE>spawnable.reset();<NEW_LINE>for (int cloudIdx = 0; cloudIdx < cloud.size(); cloudIdx++) {<NEW_LINE>Point3D_F64 <MASK><NEW_LINE>world_to_view.transform(X, viewX);<NEW_LINE>if (viewX.z <= 0.0)<NEW_LINE>continue;<NEW_LINE>norm_to_pixel.compute(viewX.x / viewX.z, viewX.y / viewX.z, pixel);<NEW_LINE>if (!BoofMiscOps.isInside(width, height, pixel.x, pixel.y))<NEW_LINE>continue;<NEW_LINE>if (cloudIdx_to_id.containsKey(cloudIdx)) {<NEW_LINE>long id = cloudIdx_to_id.get(cloudIdx);<NEW_LINE>PointTrack track = id_to_track.get(id);<NEW_LINE>// if it has been observed twice, that's a bug<NEW_LINE>BoofMiscOps.checkTrue(observedID.add(id));<NEW_LINE>// Save the observed pixel coordinate<NEW_LINE>track.pixel.setTo(pixel);<NEW_LINE>track.lastSeenFrameID = frameID;<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>// Mark this point as a potential point that can be spawned into a new track<NEW_LINE>spawnable.grow().setTo(cloudIdx, pixel);<NEW_LINE>}<NEW_LINE>// Drop tracks which have not been observed.<NEW_LINE>dropUnobserved();<NEW_LINE>// System.out.println("active.size="+activeTracks.size+" dropped.size="+dropped.size()+" totalTracks="+totalTracks);<NEW_LINE>}
X = cloud.get(cloudIdx);
1,810,832
private static Descriptors.FileDescriptor descriptorFromProto(DescriptorProtos.FileDescriptorProto descriptorProto, Map<String, DescriptorProtos.FileDescriptorProto> descriptorProtoIndex, Map<String, Descriptors.FileDescriptor> descriptorCache) throws Descriptors.DescriptorValidationException {<NEW_LINE>// First, check the cache.<NEW_LINE><MASK><NEW_LINE>if (descriptorCache.containsKey(descriptorName)) {<NEW_LINE>return descriptorCache.get(descriptorName);<NEW_LINE>}<NEW_LINE>// Then, fetch all the required dependencies recursively.<NEW_LINE>ImmutableList.Builder<Descriptors.FileDescriptor> dependencies = ImmutableList.builder();<NEW_LINE>for (String dependencyName : descriptorProto.getDependencyList()) {<NEW_LINE>if (!descriptorProtoIndex.containsKey(dependencyName)) {<NEW_LINE>throw new IllegalArgumentException("Could not find dependency: " + dependencyName);<NEW_LINE>}<NEW_LINE>DescriptorProtos.FileDescriptorProto dependencyProto = descriptorProtoIndex.get(dependencyName);<NEW_LINE>dependencies.add(descriptorFromProto(dependencyProto, descriptorProtoIndex, descriptorCache));<NEW_LINE>}<NEW_LINE>// Finally, construct the actual descriptor.<NEW_LINE>Descriptors.FileDescriptor[] empty = new Descriptors.FileDescriptor[0];<NEW_LINE>return Descriptors.FileDescriptor.buildFrom(descriptorProto, dependencies.build().toArray(empty), false);<NEW_LINE>}
String descriptorName = descriptorProto.getName();
1,729,118
// Manufacturing order AND manufacturing order need<NEW_LINE>protected void createManufOrderMrpLines() throws AxelorException {<NEW_LINE>MrpLineType manufOrderMrpLineType = this.getMrpLineType(MrpLineTypeRepository.ELEMENT_MANUFACTURING_ORDER);<NEW_LINE>if (manufOrderMrpLineType == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>MrpLineType manufOrderNeedMrpLineType = this.getMrpLineType(MrpLineTypeRepository.ELEMENT_MANUFACTURING_ORDER_NEED);<NEW_LINE>String statusSelect = manufOrderMrpLineType.getStatusSelect();<NEW_LINE>List<Integer> <MASK><NEW_LINE>if (statusList.isEmpty()) {<NEW_LINE>statusList.add(ManufOrderRepository.STATUS_FINISHED);<NEW_LINE>}<NEW_LINE>List<ManufOrder> manufOrderList = manufOrderRepository.all().filter("self.product.id in (?1) AND self.prodProcess.stockLocation in (?2) " + "AND self.statusSelect IN (?3)", this.productMap.keySet(), this.stockLocationList, statusList).fetch();<NEW_LINE>for (ManufOrder manufOrder : manufOrderList) {<NEW_LINE>this.createManufOrderMrpLines(mrpRepository.find(mrp.getId()), manufOrderRepository.find(manufOrder.getId()), mrpLineTypeRepository.find(manufOrderMrpLineType.getId()), mrpLineTypeRepository.find(manufOrderNeedMrpLineType.getId()));<NEW_LINE>JPA.clear();<NEW_LINE>}<NEW_LINE>}
statusList = StringTool.getIntegerList(statusSelect);
261,216
public boolean validateDataTypes(OpContext oc, boolean experimentalMode) {<NEW_LINE>INDArray x = oc != null ? oc.getInputArray(0) : x();<NEW_LINE>INDArray y = oc != null ? oc.getInputArray(1) : y();<NEW_LINE>INDArray z = oc != null ? oc.getOutputArray(0) : z();<NEW_LINE>Preconditions.checkArgument(x.isR(), "Op.X must be one of floating types: x.datatype=%s for op %s", x.<MASK><NEW_LINE>if (y != null) {<NEW_LINE>Preconditions.checkArgument(y.isR(), "Op.Y must be one of floating types: y.datatype=%s for op %s", y.dataType(), getClass());<NEW_LINE>if (!experimentalMode)<NEW_LINE>Preconditions.checkArgument(x.dataType() == y.dataType(), "Op.X must have same data type as Op.Y");<NEW_LINE>}<NEW_LINE>if (z() != null)<NEW_LINE>Preconditions.checkArgument(z.dataType() == x.dataType(), "Op.Z must have the same type as Op.X: x.datatype=%s, z.datatype=%s for op %s", x.dataType(), z.dataType(), getClass());<NEW_LINE>return true;<NEW_LINE>}
dataType(), getClass());
1,567,082
private void sendSPSandPPS(MediaFormat mediaFormat) {<NEW_LINE>// H265<NEW_LINE>if (type.equals(CodecUtil.H265_MIME)) {<NEW_LINE>List<ByteBuffer> byteBufferList = extractVpsSpsPpsFromH265(mediaFormat.getByteBuffer("csd-0"));<NEW_LINE>oldSps = byteBufferList.get(1);<NEW_LINE><MASK><NEW_LINE>oldVps = byteBufferList.get(0);<NEW_LINE>getVideoData.onSpsPpsVps(oldSps, oldPps, oldVps);<NEW_LINE>// H264<NEW_LINE>} else {<NEW_LINE>oldSps = mediaFormat.getByteBuffer("csd-0");<NEW_LINE>oldPps = mediaFormat.getByteBuffer("csd-1");<NEW_LINE>oldVps = null;<NEW_LINE>getVideoData.onSpsPpsVps(oldSps, oldPps, oldVps);<NEW_LINE>}<NEW_LINE>}
oldPps = byteBufferList.get(2);
540,824
private void peerRemoved(PEPeerTransport pc) {<NEW_LINE>if (is_running) {<NEW_LINE>updateConnectHealth(pc);<NEW_LINE>}<NEW_LINE>if (is_running && !seeding_mode && (prefer_udp || prefer_udp_default)) {<NEW_LINE>int udp = pc.getUDPListenPort();<NEW_LINE>if (udp != 0 && udp == pc.getTCPListenPort()) {<NEW_LINE>BloomFilter filter = prefer_udp_bloom;<NEW_LINE>if (filter == null) {<NEW_LINE>filter = prefer_udp_bloom = BloomFilterFactory.createAddOnly(PREFER_UDP_BLOOM_SIZE);<NEW_LINE>}<NEW_LINE>if (filter.getEntryCount() < PREFER_UDP_BLOOM_SIZE / 10) {<NEW_LINE>filter.add(pc.<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>final int piece = pc.getUniqueAnnounce();<NEW_LINE>if (piece != -1 && superSeedMode) {<NEW_LINE>superSeedModeNumberOfAnnounces--;<NEW_LINE>superSeedPieces[piece].peerLeft();<NEW_LINE>}<NEW_LINE>int[] reserved_pieces = pc.getReservedPieceNumbers();<NEW_LINE>if (reserved_pieces != null) {<NEW_LINE>for (int reserved_piece : reserved_pieces) {<NEW_LINE>PEPiece pe_piece = pePieces[reserved_piece];<NEW_LINE>if (pe_piece != null) {<NEW_LINE>String reserved_by = pe_piece.getReservedBy();<NEW_LINE>if (reserved_by != null && reserved_by.equals(pc.getIp())) {<NEW_LINE>pe_piece.setReservedBy(null);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (pc.isSeed()) {<NEW_LINE>last_seed_disconnect_time = SystemTime.getCurrentTime();<NEW_LINE>if (seeding_mode && disconnectSeedsWhenSeeding()) {<NEW_LINE>String key = pc.getIp() + ":" + pc.getTCPListenPort();<NEW_LINE>synchronized (seeding_seed_disconnects) {<NEW_LINE>seeding_seed_disconnects.put(key, SystemTime.getMonotonousTime());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// async downloadmanager notification<NEW_LINE>adapter.removePeer(pc);<NEW_LINE>// sync peermanager notification<NEW_LINE>final ArrayList<PEPeerManagerListener> peer_manager_listeners = peer_manager_listeners_cow;<NEW_LINE>for (PEPeerManagerListener peer : peer_manager_listeners) {<NEW_LINE>peer.peerRemoved(this, pc);<NEW_LINE>}<NEW_LINE>}
getIp().getBytes());
889,161
public ByteBuffer previousFill(PreviousFillRequest request) throws QueryProcessException, StorageEngineException, IOException, IllegalPathException {<NEW_LINE>TSDataType dataType = TSDataType.values()[request.getDataTypeOrdinal()];<NEW_LINE>PartialPath path = new MeasurementPath(request.getPath(), dataType);<NEW_LINE>long queryId = request.getQueryId();<NEW_LINE>long queryTime = request.getQueryTime();<NEW_LINE>long beforeRange = request.getBeforeRange();<NEW_LINE>Node requester = request.getRequester();<NEW_LINE>Set<String> deviceMeasurements = request.getDeviceMeasurements();<NEW_LINE>RemoteQueryContext queryContext = <MASK><NEW_LINE>ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();<NEW_LINE>DataOutputStream dataOutputStream = new DataOutputStream(byteArrayOutputStream);<NEW_LINE>TimeValuePair timeValuePair = localPreviousFill(path, dataType, queryTime, beforeRange, deviceMeasurements, queryContext);<NEW_LINE>SerializeUtils.serializeTVPair(timeValuePair, dataOutputStream);<NEW_LINE>return ByteBuffer.wrap(byteArrayOutputStream.toByteArray());<NEW_LINE>}
queryManager.getQueryContext(requester, queryId);
1,620,307
public void createBuilderInjectMethod(EFragmentHolder holder, Element element, List<ArgHelper> argHelpers) {<NEW_LINE><MASK><NEW_LINE>JFieldRef builderArgsField = holder.getBuilderArgsField();<NEW_LINE>JMethod builderMethod = builderClass.method(PUBLIC, holder.narrow(builderClass), element.getSimpleName().toString());<NEW_LINE>String docComment = getProcessingEnvironment().getElementUtils().getDocComment(element);<NEW_LINE>codeModelHelper.addTrimmedDocComment(builderMethod, docComment);<NEW_LINE>for (ArgHelper argHelper : argHelpers) {<NEW_LINE>String fieldName = argHelper.param.getSimpleName().toString();<NEW_LINE>TypeMirror actualType = codeModelHelper.getActualTypeOfEnclosingElementOfInjectedElement(holder, argHelper.param);<NEW_LINE>BundleHelper bundleHelper = new BundleHelper(getEnvironment(), actualType);<NEW_LINE>JFieldVar argKeyStaticField = getOrCreateStaticArgField(holder, argHelper.argKey, fieldName);<NEW_LINE>AbstractJClass paramClass = codeModelHelper.typeMirrorToJClass(actualType);<NEW_LINE>JVar arg = builderMethod.param(paramClass, fieldName);<NEW_LINE>builderMethod.body().add(bundleHelper.getExpressionToSaveFromField(builderArgsField, argKeyStaticField, arg));<NEW_LINE>builderMethod.javadoc().addParam(fieldName).append("value for this Fragment argument");<NEW_LINE>}<NEW_LINE>builderMethod.javadoc().addReturn().append("the FragmentBuilder to chain calls");<NEW_LINE>builderMethod.body()._return(_this());<NEW_LINE>}
JDefinedClass builderClass = holder.getBuilderClass();
174,610
// Generates a report that analyzes photos in a given bucket.<NEW_LINE>@RequestMapping(value = "/report", method = RequestMethod.POST)<NEW_LINE>@ResponseBody<NEW_LINE>String report(HttpServletRequest request, HttpServletResponse response) {<NEW_LINE>String email = request.getParameter("email");<NEW_LINE>// Get a list of key names in the given bucket.<NEW_LINE>List <MASK><NEW_LINE>// Create a List to store the data.<NEW_LINE>List<List> myList = new ArrayList<List>();<NEW_LINE>// loop through each element in the List.<NEW_LINE>int len = myKeys.size();<NEW_LINE>for (int z = 0; z < len; z++) {<NEW_LINE>String key = (String) myKeys.get(z);<NEW_LINE>byte[] keyData = s3Client.getObjectBytes(bucketName, key);<NEW_LINE>// Analyze the photo.<NEW_LINE>ArrayList item = photos.DetectLabels(keyData, key);<NEW_LINE>myList.add(item);<NEW_LINE>}<NEW_LINE>// Now we have a list of WorkItems that have all of the analytical data describing the photos in the S3 bucket.<NEW_LINE>InputStream excelData = excel.exportExcel(myList);<NEW_LINE>try {<NEW_LINE>// Email the report.<NEW_LINE>sendMessage.sendReport(excelData, email);<NEW_LINE>} catch (Exception e) {<NEW_LINE>e.printStackTrace();<NEW_LINE>}<NEW_LINE>return "The photos have been analyzed and the report is sent";<NEW_LINE>}
myKeys = s3Client.ListBucketObjects(bucketName);
1,335,912
public void visitUnary(JCTree.JCUnary tree) {<NEW_LINE>super.visitUnary(tree);<NEW_LINE>if (_tp.isGenerate() && !shouldProcessForGeneration()) {<NEW_LINE>// Don't process tree during GENERATE, unless the tree was generated e.g., a bridge method<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>Symbol op = IDynamicJdk.instance().getOperator(tree);<NEW_LINE>boolean isOverload = op instanceof OverloadOperatorSymbol;<NEW_LINE>TreeMaker make = _tp.getTreeMaker();<NEW_LINE>if (!(op instanceof Symbol.MethodSymbol)) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// Handle operator overload expressions<NEW_LINE>Symbol.MethodSymbol <MASK><NEW_LINE>while (operatorMethod instanceof OverloadOperatorSymbol) {<NEW_LINE>operatorMethod = ((OverloadOperatorSymbol) operatorMethod).getMethod();<NEW_LINE>}<NEW_LINE>if (isOverload && operatorMethod != null && tree.getTag() == JCTree.Tag.NEG) {<NEW_LINE>genUnaryMinus(tree, make, operatorMethod);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if ((isOverload && operatorMethod != null) || (tree.arg instanceof JCTree.JCArrayAccess && !_tp.getTypes().isArray(((JCTree.JCArrayAccess) tree.arg).indexed.type))) {<NEW_LINE>switch(tree.getTag()) {<NEW_LINE>case PREINC:<NEW_LINE>case PREDEC:<NEW_LINE>case POSTINC:<NEW_LINE>case POSTDEC:<NEW_LINE>genUnaryIncDec(tree, make, isOverload ? operatorMethod : null);<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>throw new IllegalStateException();<NEW_LINE>}<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (isJailbreakReceiver(tree)) {<NEW_LINE>Tree.Kind kind = tree.getKind();<NEW_LINE>if (kind == Tree.Kind.POSTFIX_INCREMENT || kind == Tree.Kind.POSTFIX_DECREMENT || kind == Tree.Kind.PREFIX_INCREMENT || kind == Tree.Kind.PREFIX_DECREMENT) {<NEW_LINE>// ++, -- operators not supported with jailbreak access to fields, only direct assignment<NEW_LINE>_tp.report(tree, Diagnostic.Kind.ERROR, ExtIssueMsg.MSG_INCREMENT_OP_NOT_ALLOWED_REFLECTION.get());<NEW_LINE>Types types = Types.instance(((BasicJavacTask) _tp.getJavacTask()).getContext());<NEW_LINE>tree.type = types.createErrorType(tree.type);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>result = tree;<NEW_LINE>}
operatorMethod = (Symbol.MethodSymbol) op;
1,569,112
public String createRule() throws UnsupportedEncodingException {<NEW_LINE>String callback = getCallback();<NEW_LINE>boolean isJSON = false;<NEW_LINE>updateProjectListMockNum(SystemVisitorLog.mock(__id__, "createRule", pattern, getCurAccount()));<NEW_LINE>Map<String, Object> options = new HashMap<String, Object>();<NEW_LINE>String _c = get_c();<NEW_LINE>options.put("method", getMethod());<NEW_LINE>String result = mockMgr.generateRule(__id__, pattern, options);<NEW_LINE>if (options.get("callback") != null) {<NEW_LINE>_c = (<MASK><NEW_LINE>callback = (String) options.get("callback");<NEW_LINE>}<NEW_LINE>if (callback != null && !callback.isEmpty()) {<NEW_LINE>setContent(callback + "(" + result + ")");<NEW_LINE>} else if (_c != null && !_c.isEmpty()) {<NEW_LINE>setContent(_c + "(" + result + ")");<NEW_LINE>} else {<NEW_LINE>isJSON = true;<NEW_LINE>setContent(result);<NEW_LINE>}<NEW_LINE>if (isJSON) {<NEW_LINE>return "json";<NEW_LINE>} else {<NEW_LINE>return SUCCESS;<NEW_LINE>}<NEW_LINE>}
String) options.get("callback");
1,159,468
private void newTimeout(final RntbdServiceEndpoint endpoint, final long idleEndpointTimeoutInNanos, final long requestTimerResolutionInNanos) {<NEW_LINE>this.acquisitionAndIdleEndpointDetectionTimeout.set(acquisitionAndIdleEndpointDetectionTimer.newTimeout((Timeout timeout) -> {<NEW_LINE>if (idleEndpointTimeoutInNanos == 0) {<NEW_LINE>if (logger.isDebugEnabled()) {<NEW_LINE>logger.debug("Idle endpoint check is disabled");<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>final long elapsedTimeInNanos = System.nanoTime<MASK><NEW_LINE>if (idleEndpointTimeoutInNanos - elapsedTimeInNanos <= 0) {<NEW_LINE>if (logger.isDebugEnabled()) {<NEW_LINE>logger.debug("{} closing endpoint due to inactivity (elapsedTime: {} > idleEndpointTimeout: {})", endpoint, Duration.ofNanos(elapsedTimeInNanos), Duration.ofNanos(idleEndpointTimeoutInNanos));<NEW_LINE>}<NEW_LINE>endpoint.close();<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (this.requestQueueLength() <= 0) {<NEW_LINE>this.newTimeout(endpoint, idleEndpointTimeoutInNanos, requestTimerResolutionInNanos);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>this.executor.submit(this::runTasksInPendingAcquisitionQueue).addListener(future -> {<NEW_LINE>reportIssueUnless(logger, future.isSuccess(), this, "failed due to ", future.cause());<NEW_LINE>this.newTimeout(endpoint, idleEndpointTimeoutInNanos, requestTimerResolutionInNanos);<NEW_LINE>});<NEW_LINE>}, requestTimerResolutionInNanos, TimeUnit.NANOSECONDS));<NEW_LINE>}
() - endpoint.lastRequestNanoTime();
692,445
public Document[] parse(final DigestURL location, final String mimeType, final String charset, final VocabularyScraper scraper, final int timezoneOffset, final InputStream source) throws Parser.Failure, InterruptedException {<NEW_LINE>Document[] docs = null;<NEW_LINE>File tempFile = null;<NEW_LINE>FileOutputStream out = null;<NEW_LINE>try {<NEW_LINE>tempFile = File.createTempFile("apk" + System.currentTimeMillis(), "jar");<NEW_LINE>out = new FileOutputStream(tempFile);<NEW_LINE>int read = 0;<NEW_LINE>final byte[<MASK><NEW_LINE>while ((read = source.read(data, 0, 1024)) != -1) {<NEW_LINE>out.write(data, 0, read);<NEW_LINE>}<NEW_LINE>out.close();<NEW_LINE>out = null;<NEW_LINE>JarFile jf = new JarFile(tempFile);<NEW_LINE>docs = parse(location, mimeType, charset, jf);<NEW_LINE>} catch (IOException e) {<NEW_LINE>ConcurrentLog.logException(e);<NEW_LINE>} finally {<NEW_LINE>try {<NEW_LINE>if (out != null) {<NEW_LINE>out.close();<NEW_LINE>}<NEW_LINE>} catch (IOException e) {<NEW_LINE>ConcurrentLog.logException(e);<NEW_LINE>} finally {<NEW_LINE>if (tempFile != null) {<NEW_LINE>if (!tempFile.delete()) {<NEW_LINE>log.warn("Could not delete temporary file " + tempFile);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return docs;<NEW_LINE>}
] data = new byte[1024];
998,805
public void processEvent(ComponentSystemEvent event) throws AbortProcessingException {<NEW_LINE>super.processEvent(event);<NEW_LINE>// restore "value" from "filteredValue" - we must work on filtered data when filtering is active<NEW_LINE>// in future we might remember filtered rowKeys and skip them while rendering instead of doing it this way<NEW_LINE>if (event instanceof PostRestoreStateEvent && this == event.getComponent() && isFilteringEnabled() && !isLazy()) {<NEW_LINE>ValueExpression ve = getValueExpression(<MASK><NEW_LINE>if (ve != null) {<NEW_LINE>Object filteredValue = getFilteredValue();<NEW_LINE>if (filteredValue != null) {<NEW_LINE>setValue(filteredValue);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>// trigger filter as previous requests were filtered<NEW_LINE>// in older PF versions, we stored the filtered data in the viewstate but this blows up memory<NEW_LINE>// and caused bugs with editing and serialization like #7999<NEW_LINE>if (isFilteringCurrentlyActive()) {<NEW_LINE>filterAndSort();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
PropertyKeys.filteredValue.name());
459,754
public void finish() throws IOException {<NEW_LINE>if (entries == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (curEntry != null) {<NEW_LINE>closeEntry();<NEW_LINE>}<NEW_LINE>int numEntries = 0;<NEW_LINE>int sizeEntries = 0;<NEW_LINE>final Enumeration elements = entries.elements();<NEW_LINE>while (elements.hasMoreElements()) {<NEW_LINE>final ZipEntry entry = (ZipEntry) elements.nextElement();<NEW_LINE>final int method = entry.getMethod();<NEW_LINE>writeLeInt(CENSIG);<NEW_LINE>writeLeShort(method == STORED ? ZIP_STORED_VERSION : ZIP_DEFLATED_VERSION);<NEW_LINE>writeLeShort(method == STORED ? ZIP_STORED_VERSION : ZIP_DEFLATED_VERSION);<NEW_LINE>writeLeShort(entry.flags);<NEW_LINE>writeLeShort(method);<NEW_LINE>writeLeInt(entry.getDOSTime());<NEW_LINE>writeLeInt((int) entry.getCrc());<NEW_LINE>writeLeInt((int) entry.getCompressedSize());<NEW_LINE>writeLeInt((int) entry.getSize());<NEW_LINE>final byte[] name = entry<MASK><NEW_LINE>if (name.length > 0xffff) {<NEW_LINE>throw new ZipException("Name too long.");<NEW_LINE>}<NEW_LINE>byte[] extra = entry.getExtra();<NEW_LINE>if (extra == null) {<NEW_LINE>extra = new byte[0];<NEW_LINE>}<NEW_LINE>final String strComment = entry.getComment();<NEW_LINE>final byte[] comment = strComment != null ? strComment.getBytes() : new byte[0];<NEW_LINE>if (comment.length > 0xffff) {<NEW_LINE>throw new ZipException("Comment too long.");<NEW_LINE>}<NEW_LINE>writeLeShort(name.length);<NEW_LINE>writeLeShort(extra.length);<NEW_LINE>writeLeShort(comment.length);<NEW_LINE>writeLeShort(0);<NEW_LINE>writeLeInt(0);<NEW_LINE>writeLeShort(0);
.getName().getBytes();
1,545,140
static void runColumnRebuild(RebuildColumnCommandArgs params, RebuildColumnBase ri) throws IOException, ServerConfigurationException, JsonException {<NEW_LINE>String rootDirectory = params.tablePath + Files.SEPARATOR + ".." + Files.SEPARATOR + "..";<NEW_LINE>final Properties properties = new Properties();<NEW_LINE>final String configurationFileName = "/server.conf";<NEW_LINE>final File configurationFile = new File(new File(rootDirectory, PropServerConfiguration.CONFIG_DIRECTORY), configurationFileName);<NEW_LINE>try (InputStream is = new FileInputStream(configurationFile)) {<NEW_LINE>properties.load(is);<NEW_LINE>}<NEW_LINE>final Log log = LogFactory.getLog("recover-var-index");<NEW_LINE>PropServerConfiguration configuration = readServerConfiguration(rootDirectory, properties, log, new BuildInformationHolder());<NEW_LINE>ri.of(params.tablePath, configuration.getCairoConfiguration());<NEW_LINE>try {<NEW_LINE>ri.rebuildPartitionColumn(params.partition, params.column);<NEW_LINE>} catch (CairoException ex) {<NEW_LINE>log.error().$(ex.<MASK><NEW_LINE>}<NEW_LINE>}
getFlyweightMessage()).$();
489,839
public static GetCatalogListResponse unmarshall(GetCatalogListResponse getCatalogListResponse, UnmarshallerContext _ctx) {<NEW_LINE>getCatalogListResponse.setRequestId(_ctx.stringValue("GetCatalogListResponse.RequestId"));<NEW_LINE>getCatalogListResponse.setMessage(_ctx.stringValue("GetCatalogListResponse.Message"));<NEW_LINE>getCatalogListResponse.setCode(_ctx.stringValue("GetCatalogListResponse.Code"));<NEW_LINE>List<DataItem> data = new ArrayList<DataItem>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("GetCatalogListResponse.Data.Length"); i++) {<NEW_LINE>DataItem dataItem = new DataItem();<NEW_LINE>dataItem.setCatalogId(_ctx.longValue("GetCatalogListResponse.Data[" + i + "].CatalogId"));<NEW_LINE>dataItem.setCatalogName(_ctx.stringValue("GetCatalogListResponse.Data[" + i + "].CatalogName"));<NEW_LINE>dataItem.setIsvSubId(_ctx.stringValue("GetCatalogListResponse.Data[" + i + "].IsvSubId"));<NEW_LINE>dataItem.setParentCatalogId(_ctx.longValue<MASK><NEW_LINE>dataItem.setProfileCount(_ctx.longValue("GetCatalogListResponse.Data[" + i + "].ProfileCount"));<NEW_LINE>data.add(dataItem);<NEW_LINE>}<NEW_LINE>getCatalogListResponse.setData(data);<NEW_LINE>return getCatalogListResponse;<NEW_LINE>}
("GetCatalogListResponse.Data[" + i + "].ParentCatalogId"));
954,884
public static boolean hasManagerRole(TomcatVersion version, File tomcatUsersFile, String username) throws IOException {<NEW_LINE>Document doc = getDocument(tomcatUsersFile);<NEW_LINE>Element root = doc.getDocumentElement();<NEW_LINE>// NOI18N<NEW_LINE>NodeList <MASK><NEW_LINE>int length = users.getLength();<NEW_LINE>for (int i = 0; i < length; i++) {<NEW_LINE>Element user = (Element) users.item(i);<NEW_LINE>// NOI18N<NEW_LINE>String name = user.getAttribute("name");<NEW_LINE>if (name.length() == 0) {<NEW_LINE>// NOI18N<NEW_LINE>name = user.getAttribute("username");<NEW_LINE>}<NEW_LINE>if (username.equals(name)) {<NEW_LINE>// NOI18N<NEW_LINE>// NOI18N<NEW_LINE>String roles = user.getAttribute("roles");<NEW_LINE>if (TomcatVersion.TOMCAT_70.equals(version) || TomcatVersion.TOMCAT_80.equals(version) || TomcatVersion.TOMCAT_90.equals(version)) {<NEW_LINE>if (hasRole(roles, "manager-script")) {<NEW_LINE>// NOI18N<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>if (hasRole(roles, "manager")) {<NEW_LINE>// NOI18N<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>}
users = root.getElementsByTagName("user");
33,182
List<HollowDiffViewRow> traverseEffigyToCreateViewRows(HollowDiffViewRow parent) {<NEW_LINE>if (parent.getFieldPair().isLeafNode())<NEW_LINE>return Collections.emptyList();<NEW_LINE>Field fromField = parent.getFieldPair().getFrom();<NEW_LINE>Field toField = parent.getFieldPair().getTo();<NEW_LINE>HollowEffigy from = fromField == null ? null : (HollowEffigy) fromField.getValue();<NEW_LINE>HollowEffigy to = toField == null ? null : (HollowEffigy) toField.getValue();<NEW_LINE>List<EffigyFieldPair> pairs = HollowEffigyFieldPairer.pair(from, <MASK><NEW_LINE>List<HollowDiffViewRow> childRows = new ArrayList<HollowDiffViewRow>();<NEW_LINE>for (int i = 0; i < pairs.size(); i++) {<NEW_LINE>EffigyFieldPair pair = pairs.get(i);<NEW_LINE>int indentation = parent.getRowPath().length + 1;<NEW_LINE>int[] rowPath = Arrays.copyOf(parent.getRowPath(), indentation);<NEW_LINE>rowPath[rowPath.length - 1] = i;<NEW_LINE>childRows.add(new HollowDiffViewRow(pair, rowPath, parent, this));<NEW_LINE>}<NEW_LINE>return childRows;<NEW_LINE>}
to, diffUI.getMatchHints());
1,041,012
private void testHashSTint() {<NEW_LINE>StdOut.println("HashSTint test");<NEW_LINE>HashSTint hashSTint = new HashSTint(5);<NEW_LINE>hashSTint.put(5, 5);<NEW_LINE>hashSTint.put(1, 1);<NEW_LINE>hashSTint.put(9, 9);<NEW_LINE>hashSTint.put(2, 2);<NEW_LINE>hashSTint.put(0, 0);<NEW_LINE>hashSTint.put(99, 99);<NEW_LINE>hashSTint.put(-1, -1);<NEW_LINE>hashSTint.<MASK><NEW_LINE>hashSTint.put(3, 3);<NEW_LINE>hashSTint.put(-5, -5);<NEW_LINE>StdOut.println("\nKeys() test");<NEW_LINE>for (Integer key : hashSTint.keys()) {<NEW_LINE>StdOut.println("Key " + key + ": " + hashSTint.get(key));<NEW_LINE>}<NEW_LINE>StdOut.println("Expected: -5 -2 -1 0 1 2 3 5 9 99\n");<NEW_LINE>// Test delete()<NEW_LINE>StdOut.println("Delete key 2");<NEW_LINE>hashSTint.delete(2);<NEW_LINE>for (Integer key : hashSTint.keys()) {<NEW_LINE>StdOut.println("Key " + key + ": " + hashSTint.get(key));<NEW_LINE>}<NEW_LINE>StdOut.println("\nDelete key 99");<NEW_LINE>hashSTint.delete(99);<NEW_LINE>for (Integer key : hashSTint.keys()) {<NEW_LINE>StdOut.println("Key " + key + ": " + hashSTint.get(key));<NEW_LINE>}<NEW_LINE>StdOut.println("\nDelete key -5");<NEW_LINE>hashSTint.delete(-5);<NEW_LINE>for (Integer key : hashSTint.keys()) {<NEW_LINE>StdOut.println("Key " + key + ": " + hashSTint.get(key));<NEW_LINE>}<NEW_LINE>}
put(-2, -2);
1,580,427
public void bootstrapMonitoringService() {<NEW_LINE>if (configuration != null && configuration.getEnabled().equalsIgnoreCase("true")) {<NEW_LINE>// To make sure that there aren't multiple monitoring services running<NEW_LINE>shutdownMonitoringService();<NEW_LINE>final MBeanServer server = getPlatformMBeanServer();<NEW_LINE>formatter = new JMXMonitoringFormatter(server, buildJobs(), this, notificationEventBus, notificationFactory, enabledNotifiers);<NEW_LINE>Logger.getLogger(JMXMonitoringService.class.getName()).log(Level.INFO, "JMX Monitoring Service will startup");<NEW_LINE>if (Boolean.valueOf(configuration.getAmx())) {<NEW_LINE>AMXConfiguration amxConfig = habitat.getService(AMXConfiguration.class);<NEW_LINE>try {<NEW_LINE>amxConfig.setEnabled(String.valueOf<MASK><NEW_LINE>configuration.setAmx(null);<NEW_LINE>} catch (PropertyVetoException ex) {<NEW_LINE>Logger.getLogger(JMXMonitoringService.class.getName()).log(Level.SEVERE, null, ex);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>monitoringFuture = executor.scheduleAtFixedRate(formatter, monitoringDelay * 1000, TimeUnit.MILLISECONDS.convert(Long.valueOf(configuration.getLogFrequency()), TimeUnit.valueOf(configuration.getLogFrequencyUnit())), TimeUnit.MILLISECONDS);<NEW_LINE>bootstrapNotifierList();<NEW_LINE>}<NEW_LINE>}
(configuration.getAmx()));
223,172
public void onSuccess(V2TIMFriendApplicationResult v2TIMFriendApplicationResult) {<NEW_LINE>List<V2TIMFriendApplication> list = v2TIMFriendApplicationResult.getFriendApplicationList();<NEW_LINE>V2TIMFriendApplication app = new V2TIMFriendApplication();<NEW_LINE>for (int i = 0; i < list.size(); i++) {<NEW_LINE>if (list.get(i).getUserID().equals(userID) && list.get(i).getType() == type) {<NEW_LINE>app = list.get(i);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>V2TIMManager.getFriendshipManager().refuseFriendApplication(app, new V2TIMValueCallback<V2TIMFriendOperationResult>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onError(int i, String s) {<NEW_LINE>CommonUtil.<MASK><NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onSuccess(V2TIMFriendOperationResult v2TIMFriendOperationResult) {<NEW_LINE>CommonUtil.returnSuccess(result, CommonUtil.convertV2TIMFriendOperationResultToMap(v2TIMFriendOperationResult));<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}
returnError(result, i, s);
1,068,974
private static void applyClusterFlowRule(List<FlowRule> list, /*@Valid*/<NEW_LINE>String namespace) {<NEW_LINE>if (list == null || list.isEmpty()) {<NEW_LINE>clearAndResetRulesFor(namespace);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final ConcurrentHashMap<Long, FlowRule> ruleMap = new ConcurrentHashMap<>();<NEW_LINE>Set<Long> flowIdSet = new HashSet<>();<NEW_LINE>for (FlowRule rule : list) {<NEW_LINE>if (!rule.isClusterMode()) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (!FlowRuleUtil.isValidRule(rule)) {<NEW_LINE><MASK><NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (StringUtil.isBlank(rule.getLimitApp())) {<NEW_LINE>rule.setLimitApp(RuleConstant.LIMIT_APP_DEFAULT);<NEW_LINE>}<NEW_LINE>// Flow id should not be null after filtered.<NEW_LINE>ClusterFlowConfig clusterConfig = rule.getClusterConfig();<NEW_LINE>Long flowId = clusterConfig.getFlowId();<NEW_LINE>if (flowId == null) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>ruleMap.put(flowId, rule);<NEW_LINE>FLOW_NAMESPACE_MAP.put(flowId, namespace);<NEW_LINE>flowIdSet.add(flowId);<NEW_LINE>if (!CurrentConcurrencyManager.containsFlowId(flowId)) {<NEW_LINE>CurrentConcurrencyManager.put(flowId, 0);<NEW_LINE>}<NEW_LINE>// Prepare cluster metric from valid flow ID.<NEW_LINE>ClusterMetricStatistics.putMetricIfAbsent(flowId, new ClusterMetric(clusterConfig.getSampleCount(), clusterConfig.getWindowIntervalMs()));<NEW_LINE>}<NEW_LINE>// Cleanup unused cluster metrics.<NEW_LINE>clearAndResetRulesConditional(namespace, new Predicate<Long>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public boolean test(Long flowId) {<NEW_LINE>return !ruleMap.containsKey(flowId);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>FLOW_RULES.putAll(ruleMap);<NEW_LINE>NAMESPACE_FLOW_ID_MAP.put(namespace, flowIdSet);<NEW_LINE>}
RecordLog.warn("[ClusterFlowRuleManager] Ignoring invalid flow rule when loading new flow rules: " + rule);
1,728,354
public void onCreate(Bundle savedInstanceState) {<NEW_LINE>super.onCreate(savedInstanceState);<NEW_LINE>getSupportActionBar().setDisplayHomeAsUpEnabled(true);<NEW_LINE>// Load the raw preferences to show in this screen<NEW_LINE>init(R.xml.pref_seedbox_xirviksemi, SeedboxProvider.XirvikSemi.getSettings().getMaxSeedboxOrder(<MASK><NEW_LINE>initTextPreference("seedbox_xirviksemi_name");<NEW_LINE>initTextPreference("seedbox_xirviksemi_server");<NEW_LINE>initTextPreference("seedbox_xirviksemi_user");<NEW_LINE>initTextPreference("seedbox_xirviksemi_pass");<NEW_LINE>initBooleanPreference("seedbox_xirviksemi_alarmfinished", true);<NEW_LINE>initBooleanPreference("seedbox_xirviksemi_alarmnew", true);<NEW_LINE>excludeFilter = initTextPreference("seedbox_xirviksemi_alarmexclude");<NEW_LINE>includeFilter = initTextPreference("seedbox_xirviksemi_alarminclude");<NEW_LINE>}
PreferenceManager.getDefaultSharedPreferences(this)));
800,465
public void execute(DelegateExecution execution) throws Exception {<NEW_LINE>Date now = new Date();<NEW_LINE>List<String> serializable = new ArrayList<String>();<NEW_LINE>serializable.add("seven");<NEW_LINE>serializable.add("eight");<NEW_LINE>serializable.add("nine");<NEW_LINE>List<Date> dateList = new ArrayList<Date>();<NEW_LINE>dateList.add(new Date());<NEW_LINE>dateList.add(new Date());<NEW_LINE>dateList.add(new Date());<NEW_LINE>List<CockpitVariable> cockpitVariableList = new ArrayList<CockpitVariable>();<NEW_LINE>cockpitVariableList.add(new CockpitVariable("foo", "bar"));<NEW_LINE>cockpitVariableList.add(new CockpitVariable("foo2", "bar"));<NEW_LINE>cockpitVariableList.add(new CockpitVariable("foo3", "bar"));<NEW_LINE>byte[] bytes = "someAnotherBytes".getBytes();<NEW_LINE>FailingSerializable failingSerializable = new FailingSerializable();<NEW_LINE>Map<String, Integer> mapVariable = new HashMap<String, Integer>();<NEW_LINE>Map<String, Object> variables = new HashMap<String, Object>();<NEW_LINE>variables.put("shortVar", (short) 789);<NEW_LINE>variables.put("longVar", 555555L);<NEW_LINE>variables.put("integerVar", 963852);<NEW_LINE><MASK><NEW_LINE>variables.put("doubleVar", 6123.2025);<NEW_LINE>variables.put("trueBooleanVar", true);<NEW_LINE>variables.put("falseBooleanVar", false);<NEW_LINE>variables.put("stringVar", "fanta");<NEW_LINE>variables.put("dateVar", now);<NEW_LINE>variables.put("serializableCollection", serializable);<NEW_LINE>variables.put("bytesVar", bytes);<NEW_LINE>variables.put("value1", "blub");<NEW_LINE>int random = (int) (Math.random() * 100);<NEW_LINE>variables.put("random", random);<NEW_LINE>variables.put("failingSerializable", failingSerializable);<NEW_LINE>variables.put("mapVariable", mapVariable);<NEW_LINE>variables.put("dateList", dateList);<NEW_LINE>variables.put("cockpitVariableList", cockpitVariableList);<NEW_LINE>execution.setVariablesLocal(variables);<NEW_LINE>// set JSON variable<NEW_LINE>JsonSerialized jsonSerialized = new JsonSerialized();<NEW_LINE>jsonSerialized.setFoo("bar");<NEW_LINE>execution.setVariable("jsonSerializable", objectValue(jsonSerialized).serializationDataFormat("application/json"));<NEW_LINE>// set JAXB variable<NEW_LINE>JaxBSerialized jaxBSerialized = new JaxBSerialized();<NEW_LINE>jaxBSerialized.setFoo("bar");<NEW_LINE>execution.setVariable("xmlSerializable", objectValue(jaxBSerialized).serializationDataFormat("application/xml"));<NEW_LINE>}
variables.put("floatVar", 55.55);
509,759
final DescribeVpcClassicLinkResult executeDescribeVpcClassicLink(DescribeVpcClassicLinkRequest describeVpcClassicLinkRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(describeVpcClassicLinkRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DescribeVpcClassicLinkRequest> request = null;<NEW_LINE>Response<DescribeVpcClassicLinkResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DescribeVpcClassicLinkRequestMarshaller().marshall(super.beforeMarshalling(describeVpcClassicLinkRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DescribeVpcClassicLink");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>StaxResponseHandler<DescribeVpcClassicLinkResult> responseHandler = new StaxResponseHandler<DescribeVpcClassicLinkResult>(new DescribeVpcClassicLinkResultStaxUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
addHandlerContext(HandlerContextKey.SERVICE_ID, "EC2");
817,344
void trackService(String servId) {<NEW_LINE>if (trackerClose) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>String[] pairs = servId.split("\\.");<NEW_LINE>if (pairs.length < 2) {<NEW_LINE>// don't track services not using management node id in service id<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>pairs[<MASK><NEW_LINE>String bindingKey = makeMessageQueueName(StringUtils.join(pairs, "."));<NEW_LINE>bindingKeys.add(bindingKey);<NEW_LINE>if (logger.isTraceEnabled()) {<NEW_LINE>logger.trace(String.format("message tracker binds to key[%s], tracking service[%s]", bindingKey, pairs[0]));<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>Channel chan = channelPool.acquire();<NEW_LINE>try {<NEW_LINE>chan.queueBind(name, BusExchange.P2P.toString(), bindingKey);<NEW_LINE>} finally {<NEW_LINE>channelPool.returnChannel(chan);<NEW_LINE>}<NEW_LINE>} catch (IOException e) {<NEW_LINE>throw new CloudRuntimeException(e);<NEW_LINE>}<NEW_LINE>}
pairs.length - 1] = "*";
916,033
public void fullRedraw() {<NEW_LINE>setupCanvas();<NEW_LINE>final StyleLibrary style = context.getStyleLibrary();<NEW_LINE>final StylingPolicy spol = context.getStylingPolicy();<NEW_LINE>final double size = <MASK><NEW_LINE>final double ssize = size / Math.sqrt(samples);<NEW_LINE>final MarkerLibrary ml = style.markers();<NEW_LINE>Random rand = random.getSingleThreadedRandom();<NEW_LINE>if (spol instanceof ClassStylingPolicy) {<NEW_LINE>ClassStylingPolicy cspol = (ClassStylingPolicy) spol;<NEW_LINE>for (int cnum = cspol.getMinStyle(); cnum < cspol.getMaxStyle(); cnum++) {<NEW_LINE>for (DBIDIter iter = cspol.iterateClass(cnum); iter.valid(); iter.advance()) {<NEW_LINE>if (!sample.getSample().contains(iter)) {<NEW_LINE>// TODO: can we test more efficiently than this?<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>final UncertainObject uo = rel.get(iter);<NEW_LINE>if (uo instanceof DiscreteUncertainObject) {<NEW_LINE>drawDiscete((DiscreteUncertainObject) uo, ml, cnum, size);<NEW_LINE>} else {<NEW_LINE>drawContinuous(uo, ml, cnum, ssize, rand);<NEW_LINE>}<NEW_LINE>} catch (ObjectNotFoundException e) {<NEW_LINE>// ignore.<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>// Color-based styling.<NEW_LINE>for (DBIDIter iter = sample.getSample().iter(); iter.valid(); iter.advance()) {<NEW_LINE>try {<NEW_LINE>final int col = spol.getColorForDBID(iter);<NEW_LINE>final UncertainObject uo = rel.get(iter);<NEW_LINE>if (uo instanceof DiscreteUncertainObject) {<NEW_LINE>drawDiscreteDefault((DiscreteUncertainObject) uo, col, size);<NEW_LINE>} else {<NEW_LINE>drawContinuousDefault(uo, col, size, rand);<NEW_LINE>}<NEW_LINE>} catch (ObjectNotFoundException e) {<NEW_LINE>// ignore.<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
style.getSize(StyleLibrary.MARKERPLOT);
124,695
public BatchGetRecordIdentifier unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>BatchGetRecordIdentifier batchGetRecordIdentifier = new BatchGetRecordIdentifier();<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("FeatureGroupName", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>batchGetRecordIdentifier.setFeatureGroupName(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("RecordIdentifiersValueAsString", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>batchGetRecordIdentifier.setRecordIdentifiersValueAsString(new ListUnmarshaller<String>(context.getUnmarshaller(String.class)).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("FeatureNames", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>batchGetRecordIdentifier.setFeatureNames(new ListUnmarshaller<String>(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 batchGetRecordIdentifier;<NEW_LINE>}
String currentParentElement = context.getCurrentParentElement();
1,243,792
protected static void deleteNode(final StructrWebSocket ws, final NodeInterface obj, final Boolean recursive) {<NEW_LINE>final SecurityContext securityContext = ws.getSecurityContext();<NEW_LINE>final App app = StructrApp.getInstance(securityContext);<NEW_LINE>try (final Tx tx = app.tx()) {<NEW_LINE>if (!(obj.isGranted(Permission.delete, securityContext))) {<NEW_LINE>logger.warn("No delete permission for {} on {}", new Object[] { ws.getCurrentUser().toString(), obj.toString() });<NEW_LINE>ws.send(MessageBuilder.status().message("No delete permission").code(400).build(), true);<NEW_LINE>tx.success();<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>} catch (FrameworkException ex) {<NEW_LINE>logger.warn("", ex);<NEW_LINE>}<NEW_LINE>if (Boolean.TRUE.equals(recursive)) {<NEW_LINE>// Remove all child nodes first<NEW_LINE>try {<NEW_LINE>final List<NodeInterface> filteredResults = new LinkedList<>();<NEW_LINE>if (obj instanceof DOMNode) {<NEW_LINE>DOMNode node = (DOMNode) obj;<NEW_LINE>filteredResults.addAll(DOMNode.getAllChildNodes(node));<NEW_LINE>} else if (obj instanceof LinkedTreeNode) {<NEW_LINE>LinkedTreeNode node = (LinkedTreeNode) obj;<NEW_LINE>filteredResults.addAll(node.getAllChildNodes());<NEW_LINE>}<NEW_LINE>for (NodeInterface node : filteredResults) {<NEW_LINE>app.delete(node);<NEW_LINE>}<NEW_LINE>} catch (FrameworkException fex) {<NEW_LINE><MASK><NEW_LINE>ws.send(MessageBuilder.status().code(fex.getStatus()).message(fex.getMessage()).build(), true);<NEW_LINE>} catch (DOMException dex) {<NEW_LINE>logger.warn("DOMException occured.", dex);<NEW_LINE>ws.send(MessageBuilder.status().code(422).message(dex.getMessage()).build(), true);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>app.delete(obj);<NEW_LINE>} catch (FrameworkException fex) {<NEW_LINE>logger.warn("Unable to delete node(s)", fex);<NEW_LINE>}<NEW_LINE>}
logger.warn("Exception occured", fex);
340,638
protected RubyValue run(RubyValue receiver, RubyValue arg1, RubyValue arg2, RubyBlock block) {<NEW_LINE>try {<NEW_LINE>int x = 0;<NEW_LINE>int y = 0;<NEW_LINE>if (arg1 instanceof RubyFixnum) {<NEW_LINE>RubyFixnum rv = (RubyFixnum) arg1;<NEW_LINE>x = rv.toInt();<NEW_LINE>} else {<NEW_LINE>if (arg1 instanceof RubyInteger) {<NEW_LINE>RubyInteger rv = (RubyInteger) arg1;<NEW_LINE>x = rv.toInt();<NEW_LINE>} else {<NEW_LINE>if (arg1 instanceof RubySymbol) {<NEW_LINE>RubySymbol rv = (RubySymbol) arg1;<NEW_LINE>x = rv.toInt();<NEW_LINE>} else {<NEW_LINE>throw new RubyException(RubyRuntime.ArgumentErrorClass, "in Instrumentation.calc_summ: wrong argument type.Should be Fixnum or Integer");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (arg2 instanceof RubyFixnum) {<NEW_LINE>RubyFixnum rv = (RubyFixnum) arg2;<NEW_LINE>y = rv.toInt();<NEW_LINE>} else {<NEW_LINE>if (arg2 instanceof RubyInteger) {<NEW_LINE>RubyInteger rv = (RubyInteger) arg2;<NEW_LINE>y = rv.toInt();<NEW_LINE>} else {<NEW_LINE>if (arg2 instanceof RubySymbol) {<NEW_LINE>RubySymbol rv = (RubySymbol) arg2;<NEW_LINE>y = rv.toInt();<NEW_LINE>} else {<NEW_LINE>throw new RubyException(RubyRuntime.ArgumentErrorClass, "in Instrumentation.calc_summ: wrong argument type.Should be Fixnum or Integer");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>int res = doCalcSumm(x, y);<NEW_LINE>return ObjectFactory.createInteger(res);<NEW_LINE>} catch (Exception e) {<NEW_LINE>e.printStackTrace();<NEW_LINE>LOG.ERROR("Instrumentation.calc_summ failed with exception", e);<NEW_LINE>throw (e instanceof RubyException ? (RubyException) e : new RubyException<MASK><NEW_LINE>}<NEW_LINE>}
(e.getMessage()));
471,747
public static void execKey(KeyEvent keyEvent, int valueIndex) {<NEW_LINE>// valueIndex points to where the value is stored in the array.<NEW_LINE>CallbackBridge.holdingAlt = keyEvent.isAltPressed();<NEW_LINE>CallbackBridge.holdingCapslock = keyEvent.isCapsLockOn();<NEW_LINE>CallbackBridge.holdingCtrl = keyEvent.isCtrlPressed();<NEW_LINE>CallbackBridge.holdingNumlock = keyEvent.isNumLockOn();<NEW_LINE>CallbackBridge.holdingShift = keyEvent.isShiftPressed();<NEW_LINE>System.out.println(keyEvent.getKeyCode() + <MASK><NEW_LINE>char key = (char) (keyEvent.getUnicodeChar() != 0 ? keyEvent.getUnicodeChar() : '\u0000');<NEW_LINE>sendKeyPress(getValueByIndex(valueIndex), key, 0, CallbackBridge.getCurrentMods(), keyEvent.getAction() == KeyEvent.ACTION_DOWN);<NEW_LINE>}
" " + keyEvent.getDisplayLabel());
763,655
public static InsteonHubBindingConfig parse(String itemName, String configStr) {<NEW_LINE>Map<String, String> configMap = stringToMap(configStr);<NEW_LINE>// parse hubId (default used if not present)<NEW_LINE>String hubId = configMap.get(KEY_HUB_ID);<NEW_LINE>if (hubId == null) {<NEW_LINE>// no hubid defined => use default<NEW_LINE>hubId = InsteonHubBinding.DEFAULT_HUB_ID;<NEW_LINE>}<NEW_LINE>// parse required device key<NEW_LINE>String device = configMap.get(KEY_DEVICE);<NEW_LINE>if (device == null) {<NEW_LINE>throw new IllegalArgumentException(KEY_DEVICE + " is not defined in " + configMap);<NEW_LINE>}<NEW_LINE>device = device.replace(".", "");<NEW_LINE>// parse required bindingType key<NEW_LINE>String bindingTypeStr = configMap.get(KEY_BINDING_TYPE);<NEW_LINE>if (bindingTypeStr == null) {<NEW_LINE>throw new IllegalArgumentException(KEY_BINDING_TYPE + " is not defined in " + configMap);<NEW_LINE>}<NEW_LINE>BindingType bindingType = BindingType.parseIgnoreCase(bindingTypeStr);<NEW_LINE>if (bindingType == null) {<NEW_LINE>throw new IllegalArgumentException("Unknown value for " + KEY_BINDING_TYPE + " '" + bindingTypeStr + "'");<NEW_LINE>}<NEW_LINE>// parse all optional keys<NEW_LINE>String onValueStr = configMap.get(KEY_ON_VALUE);<NEW_LINE>Integer onValue = onValueStr == null ? null : Integer.parseInt(onValueStr);<NEW_LINE>String offValueStr = configMap.get(KEY_OFF_VALUE);<NEW_LINE>Integer offValue = offValueStr == null ? null : Integer.parseInt(offValueStr);<NEW_LINE>String openValueStr = configMap.get(KEY_OPEN_VALUE);<NEW_LINE>Integer openValue = openValueStr == null ? null : Integer.parseInt(openValueStr);<NEW_LINE>String closedValueStr = configMap.get(KEY_CLOSED_VALUE);<NEW_LINE>Integer closedValue = closedValueStr == null ? null : Integer.parseInt(closedValueStr);<NEW_LINE>InsteonHubBindingDeviceInfo deviceInfo = new InsteonHubBindingDeviceInfo(hubId, device);<NEW_LINE>return new InsteonHubBindingConfig(itemName, deviceInfo, bindingType, <MASK><NEW_LINE>}
onValue, offValue, openValue, closedValue);
1,116,306
private DeploymentRoutingStatus deploymentStatus(String upstreamName) {<NEW_LINE><MASK><NEW_LINE>Path path = deploymentStatusPath(upstreamName);<NEW_LINE>Optional<byte[]> data = curator.getData(path);<NEW_LINE>if (data.isEmpty()) {<NEW_LINE>return new DeploymentRoutingStatus(RoutingStatus.in, "", "", changedAt);<NEW_LINE>}<NEW_LINE>String agent = "";<NEW_LINE>String reason = "";<NEW_LINE>RoutingStatus status = RoutingStatus.out;<NEW_LINE>if (data.get().length > 0) {<NEW_LINE>// Compatibility with old format, where no data is stored<NEW_LINE>Slime slime = SlimeUtils.jsonToSlime(data.get());<NEW_LINE>Cursor root = slime.get();<NEW_LINE>status = asRoutingStatus(root.field("status").asString());<NEW_LINE>agent = root.field("agent").asString();<NEW_LINE>reason = root.field("cause").asString();<NEW_LINE>changedAt = Instant.ofEpochSecond(root.field("lastUpdate").asLong());<NEW_LINE>}<NEW_LINE>return new DeploymentRoutingStatus(status, agent, reason, changedAt);<NEW_LINE>}
Instant changedAt = clock.instant();
1,243,164
final GetReservationCoverageResult executeGetReservationCoverage(GetReservationCoverageRequest getReservationCoverageRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(getReservationCoverageRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<GetReservationCoverageRequest> request = null;<NEW_LINE>Response<GetReservationCoverageResult> response = null;<NEW_LINE>try {<NEW_LINE><MASK><NEW_LINE>try {<NEW_LINE>request = new GetReservationCoverageRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(getReservationCoverageRequest));<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, "Cost Explorer");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "GetReservationCoverage");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<GetReservationCoverageResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new GetReservationCoverageResultJsonUnmarshaller());<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);
481,741
public Instance pipe(Instance carrier) {<NEW_LINE>Object inputData = carrier.getData();<NEW_LINE>LabelAlphabet labels;<NEW_LINE>LabelSequence target = null;<NEW_LINE>String[][] tokens;<NEW_LINE>StringBuffer source = new StringBuffer();<NEW_LINE>StringTokenization ts = new StringTokenization(source);<NEW_LINE>if (inputData instanceof String)<NEW_LINE>tokens = parseSentence((String) inputData);<NEW_LINE>else if (inputData instanceof String[][])<NEW_LINE>tokens = (String[][]) inputData;<NEW_LINE>else<NEW_LINE>throw new IllegalArgumentException("Not a String; got " + inputData);<NEW_LINE>if (isTargetProcessing()) {<NEW_LINE>labels = (LabelAlphabet) getTargetAlphabet();<NEW_LINE>target = new LabelSequence(labels, tokens.length);<NEW_LINE>}<NEW_LINE>for (int l = 0; l < tokens.length; l++) {<NEW_LINE>int nFeatures;<NEW_LINE>if (isTargetProcessing()) {<NEW_LINE>if (tokens[l].length < 1)<NEW_LINE>throw new IllegalStateException("Missing label at line " + l + " instance " + carrier.getName());<NEW_LINE>nFeatures = tokens[l].length - 1;<NEW_LINE>target.add(tokens[l][nFeatures]);<NEW_LINE>} else<NEW_LINE>nFeatures = tokens[l].length;<NEW_LINE>int start = source.length();<NEW_LINE>String word = makeText(tokens[l]);<NEW_LINE><MASK><NEW_LINE>Token tok = new StringSpan(source, start, source.length() - 1);<NEW_LINE>if (setTokensAsFeatures) {<NEW_LINE>for (int f = 0; f < nFeatures; f++) tok.setFeatureValue(tokens[l][f], 1.0);<NEW_LINE>} else {<NEW_LINE>for (int f = 1; f < nFeatures; f++) tok.setFeatureValue(tokens[l][f], 1.0);<NEW_LINE>}<NEW_LINE>ts.add(tok);<NEW_LINE>}<NEW_LINE>carrier.setData(ts);<NEW_LINE>if (isTargetProcessing())<NEW_LINE>carrier.setTarget(target);<NEW_LINE>return carrier;<NEW_LINE>}
source.append(word + " ");
480,176
private List<SchemaDisplayField> createDisplayFields() {<NEW_LINE>List<SchemaDisplayField> displayFields = new ArrayList<SchemaDisplayField>();<NEW_LINE>switch(schema.getSchemaType()) {<NEW_LINE>case OBJECT:<NEW_LINE>HollowObjectSchema objSchema = (HollowObjectSchema) schema;<NEW_LINE>for (int i = 0; i < objSchema.numFields(); i++) displayFields.add(new SchemaDisplayField(fieldPath + "." + objSchema.getFieldName(i), objSchema, i));<NEW_LINE>return displayFields;<NEW_LINE>case LIST:<NEW_LINE>case SET:<NEW_LINE>HollowCollectionSchema collSchema = (HollowCollectionSchema) schema;<NEW_LINE>displayFields.add(new SchemaDisplayField(fieldPath + ".element", collSchema));<NEW_LINE>return displayFields;<NEW_LINE>case MAP:<NEW_LINE>HollowMapSchema mapSchema = (HollowMapSchema) schema;<NEW_LINE>displayFields.add(new SchemaDisplayField(fieldPath + ".key", mapSchema, 0));<NEW_LINE>displayFields.add(new SchemaDisplayField(fieldPath <MASK><NEW_LINE>return displayFields;<NEW_LINE>}<NEW_LINE>throw new IllegalArgumentException();<NEW_LINE>}
+ ".value", mapSchema, 1));
1,018,301
private Coordinate findNonGabrielPoint(Segment seg) {<NEW_LINE>Coordinate p = seg.getStart();<NEW_LINE><MASK><NEW_LINE>// Find the mid point on the line and compute the radius of enclosing circle<NEW_LINE>Coordinate midPt = new Coordinate((p.x + q.x) / 2.0, (p.y + q.y) / 2.0);<NEW_LINE>double segRadius = p.distance(midPt);<NEW_LINE>// compute envelope of circumcircle<NEW_LINE>Envelope env = new Envelope(midPt);<NEW_LINE>env.expandBy(segRadius);<NEW_LINE>// Find all points in envelope<NEW_LINE>List result = kdt.query(env);<NEW_LINE>// For each point found, test if it falls strictly in the circle<NEW_LINE>// find closest point<NEW_LINE>Coordinate closestNonGabriel = null;<NEW_LINE>double minDist = Double.MAX_VALUE;<NEW_LINE>for (Iterator i = result.iterator(); i.hasNext(); ) {<NEW_LINE>KdNode nextNode = (KdNode) i.next();<NEW_LINE>Coordinate testPt = nextNode.getCoordinate();<NEW_LINE>// ignore segment endpoints<NEW_LINE>if (testPt.equals2D(p) || testPt.equals2D(q))<NEW_LINE>continue;<NEW_LINE>double testRadius = midPt.distance(testPt);<NEW_LINE>if (testRadius < segRadius) {<NEW_LINE>// double testDist = seg.distance(testPt);<NEW_LINE>double testDist = testRadius;<NEW_LINE>if (closestNonGabriel == null || testDist < minDist) {<NEW_LINE>closestNonGabriel = testPt;<NEW_LINE>minDist = testDist;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return closestNonGabriel;<NEW_LINE>}
Coordinate q = seg.getEnd();
108,403
protected static void implMulw(long[] u, long x, long y, long[] z, int zOff) {<NEW_LINE>// assert x >>> 57 == 0;<NEW_LINE>// assert y >>> 57 == 0;<NEW_LINE>// u[0] = 0;<NEW_LINE>u[1] = y;<NEW_LINE>u[2] = u[1] << 1;<NEW_LINE>u[3] = u[2] ^ y;<NEW_LINE>u[4] = u[2] << 1;<NEW_LINE>u[5] = u[4] ^ y;<NEW_LINE>u[6] = u[3] << 1;<NEW_LINE>u[7<MASK><NEW_LINE>int j = (int) x;<NEW_LINE>long g, h = 0, l = u[j & 7];<NEW_LINE>int k = 48;<NEW_LINE>do {<NEW_LINE>j = (int) (x >>> k);<NEW_LINE>g = u[j & 7] ^ u[(j >>> 3) & 7] << 3 ^ u[(j >>> 6) & 7] << 6;<NEW_LINE>l ^= (g << k);<NEW_LINE>h ^= (g >>> -k);<NEW_LINE>} while ((k -= 9) > 0);<NEW_LINE>h ^= ((x & 0x0100804020100800L) & ((y << 7) >> 63)) >>> 8;<NEW_LINE>// assert h >>> 49 == 0;<NEW_LINE>z[zOff] = l & M57;<NEW_LINE>z[zOff + 1] = (l >>> 57) ^ (h << 7);<NEW_LINE>}
] = u[6] ^ y;
980,225
public VolumeInfo createVolumeOnPrimaryStorage(VirtualMachine vm, VolumeInfo volume, HypervisorType rootDiskHyperType, StoragePool storagePool) throws NoTransitionException {<NEW_LINE>VirtualMachineTemplate rootDiskTmplt = _entityMgr.findById(VirtualMachineTemplate.class, vm.getTemplateId());<NEW_LINE>DataCenter dcVO = _entityMgr.findById(DataCenter.class, vm.getDataCenterId());<NEW_LINE>Long podId = storagePool.getPodId() != null ? storagePool.getPodId() : vm.getPodIdToDeployIn();<NEW_LINE>Pod pod = _entityMgr.findById(Pod.class, podId);<NEW_LINE>ServiceOffering svo = _entityMgr.findById(ServiceOffering.class, vm.getServiceOfferingId());<NEW_LINE>DiskOffering diskVO = _entityMgr.findById(DiskOffering.class, volume.getDiskOfferingId());<NEW_LINE>Long clusterId = storagePool.getClusterId();<NEW_LINE>VolumeInfo vol = null;<NEW_LINE>if (volume.getState() == Volume.State.Allocated) {<NEW_LINE>vol = createVolume(volume, vm, rootDiskTmplt, dcVO, pod, clusterId, svo, diskVO, new ArrayList<StoragePool>(), volume.getSize(), rootDiskHyperType);<NEW_LINE>} else if (volume.getState() == Volume.State.Uploaded) {<NEW_LINE>vol = copyVolume(storagePool, volume, vm, rootDiskTmplt, dcVO, <MASK><NEW_LINE>if (vol != null) {<NEW_LINE>// Moving of Volume is successful, decrement the volume resource count from secondary for an account and increment it into primary storage under same account.<NEW_LINE>_resourceLimitMgr.decrementResourceCount(volume.getAccountId(), ResourceType.secondary_storage, volume.getSize());<NEW_LINE>_resourceLimitMgr.incrementResourceCount(volume.getAccountId(), ResourceType.primary_storage, volume.getSize());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (vol == null) {<NEW_LINE>throw new CloudRuntimeException("Volume shouldn't be null " + volume.getId());<NEW_LINE>}<NEW_LINE>VolumeVO volVO = _volsDao.findById(vol.getId());<NEW_LINE>if (volVO.getFormat() == null) {<NEW_LINE>volVO.setFormat(getSupportedImageFormatForCluster(rootDiskHyperType));<NEW_LINE>}<NEW_LINE>_volsDao.update(volVO.getId(), volVO);<NEW_LINE>return volFactory.getVolume(volVO.getId());<NEW_LINE>}
pod, diskVO, svo, rootDiskHyperType);
1,388,051
public boolean prepare(VirtualMachineProfile profile, NicProfile pxeNic, Network network, DeployDestination dest, ReservationContext context) {<NEW_LINE>QueryBuilder<BaremetalPxeVO> sc = <MASK><NEW_LINE>sc.and(sc.entity().getDeviceType(), Op.EQ, BaremetalPxeType.PING.toString());<NEW_LINE>sc.and(sc.entity().getPodId(), Op.EQ, dest.getPod().getId());<NEW_LINE>BaremetalPxeVO pxeVo = sc.find();<NEW_LINE>if (pxeVo == null) {<NEW_LINE>throw new CloudRuntimeException("No PING PXE server found in pod: " + dest.getPod().getId() + ", you need to add it before starting VM");<NEW_LINE>}<NEW_LINE>long pxeServerId = pxeVo.getHostId();<NEW_LINE>String mac = pxeNic.getMacAddress();<NEW_LINE>String ip = pxeNic.getIPv4Address();<NEW_LINE>String gateway = pxeNic.getIPv4Gateway();<NEW_LINE>String mask = pxeNic.getIPv4Netmask();<NEW_LINE>String dns = pxeNic.getIPv4Dns1();<NEW_LINE>if (dns == null) {<NEW_LINE>dns = pxeNic.getIPv4Dns2();<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>String tpl = profile.getTemplate().getUrl();<NEW_LINE>assert tpl != null : "How can a null template get here!!!";<NEW_LINE>PreparePxeServerCommand cmd = new PreparePxeServerCommand(ip, mac, mask, gateway, dns, tpl, profile.getVirtualMachine().getInstanceName(), dest.getHost().getName());<NEW_LINE>PreparePxeServerAnswer ans = (PreparePxeServerAnswer) _agentMgr.send(pxeServerId, cmd);<NEW_LINE>if (!ans.getResult()) {<NEW_LINE>s_logger.warn("Unable tot program PXE server: " + pxeVo.getId() + " because " + ans.getDetails());<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>IpmISetBootDevCommand bootCmd = new IpmISetBootDevCommand(BootDev.pxe);<NEW_LINE>Answer anw = _agentMgr.send(dest.getHost().getId(), bootCmd);<NEW_LINE>if (!anw.getResult()) {<NEW_LINE>s_logger.warn("Unable to set host: " + dest.getHost().getId() + " to PXE boot because " + anw.getDetails());<NEW_LINE>}<NEW_LINE>return anw.getResult();<NEW_LINE>} catch (Exception e) {<NEW_LINE>s_logger.warn("Cannot prepare PXE server", e);<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>}
QueryBuilder.create(BaremetalPxeVO.class);
1,556,350
public void destroy() {<NEW_LINE>Set<ProviderResourceInfo> singletonProviderAndPathInfos = endpointInfo.getSingletonProviderAndPathInfos();<NEW_LINE>for (ProviderResourceInfo o : singletonProviderAndPathInfos) {<NEW_LINE>if (o.getRuntimeType() == RuntimeType.POJO) {<NEW_LINE>Method preDestoryMethod = ResourceUtils.findPreDestroyMethod(o.getProviderResourceClass());<NEW_LINE>InjectionUtils.invokeLifeCycleMethod(o.getObject(), preDestoryMethod);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>Set<ProviderResourceInfo> perRequestProviderAndPathInfos = endpointInfo.getPerRequestProviderAndPathInfos();<NEW_LINE>for (ProviderResourceInfo o : perRequestProviderAndPathInfos) {<NEW_LINE>if (o.getRuntimeType() == RuntimeType.POJO && o.isJaxRsProvider() == true) {<NEW_LINE>Method preDestoryMethod = ResourceUtils.findPreDestroyMethod(o.getProviderResourceClass());<NEW_LINE>InjectionUtils.invokeLifeCycleMethod(<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>// call preDestroy method for non-customized Applications<NEW_LINE>if (!endpointInfo.isCustomizedApp()) {<NEW_LINE>Application app = endpointInfo.getApp();<NEW_LINE>Method preDestoryMethod = ResourceUtils.findPreDestroyMethod(app.getClass());<NEW_LINE>InjectionUtils.invokeLifeCycleMethod(app, preDestoryMethod);<NEW_LINE>} else {<NEW_LINE>for (JaxRsFactoryBeanCustomizer beanCustomizer : beanCustomizers) {<NEW_LINE>beanCustomizer.destroyApplicationScopeResources(jaxRsModuleMetaData);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (server != null) {<NEW_LINE>server.destroy();<NEW_LINE>}<NEW_LINE>if (features != null) {<NEW_LINE>features.clear();<NEW_LINE>}<NEW_LINE>}
o.getObject(), preDestoryMethod);
316,315
protected String embedEngines(String json_in) {<NEW_LINE>// see if we need to embed private search templates<NEW_LINE>Map <MASK><NEW_LINE>long engine_id = ((Long) map.get("engine_id")).longValue();<NEW_LINE>String json_out = json_in;<NEW_LINE>if (engine_id >= Integer.MAX_VALUE || engine_id < 0) {<NEW_LINE>Engine engine = MetaSearchManagerFactory.getSingleton().getMetaSearch().getEngine(engine_id);<NEW_LINE>if (engine == null) {<NEW_LINE>log("Private search template with id '" + engine_id + "' not found!!!!");<NEW_LINE>} else {<NEW_LINE>try {<NEW_LINE>embedEngines(map, engine);<NEW_LINE>json_out = JSONUtils.encodeToJSON(map);<NEW_LINE>log("Embedded private search template '" + engine.getName() + "'");<NEW_LINE>} catch (Throwable e) {<NEW_LINE>log("Failed to embed private search template", e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return (json_out);<NEW_LINE>}
map = JSONUtils.decodeJSON(json_in);
1,324,268
public void onViewCreated(View view, Bundle savedInstanceState) {<NEW_LINE>super.onViewCreated(view, savedInstanceState);<NEW_LINE>progressView = finder.find(R.id.pb_loading);<NEW_LINE>listView = finder.find(android.R.id.list);<NEW_LINE>listView.setOnItemClickListener(this);<NEW_LINE>Activity activity = getActivity();<NEW_LINE>adapter = new HeaderFooterListAdapter<CodeTreeAdapter>(listView, new CodeTreeAdapter(activity));<NEW_LINE>branchFooterView = finder.find(R.id.rl_branch);<NEW_LINE>branchView = finder.find(R.id.tv_branch);<NEW_LINE>branchIconView = finder.find(R.id.tv_branch_icon);<NEW_LINE>branchIconView.setText(TypefaceUtils.ICON_GIT_BRANCH);<NEW_LINE>branchFooterView.setOnClickListener(new OnClickListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onClick(View v) {<NEW_LINE>switchBranches();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>pathHeaderView = activity.getLayoutInflater().inflate(R.layout.path_item, null);<NEW_LINE>pathView = (TextView) pathHeaderView.findViewById(R.id.tv_path);<NEW_LINE>pathView.setMovementMethod(LinkMovementMethod.getInstance());<NEW_LINE>if (pathShowing)<NEW_LINE>adapter.addHeader(pathHeaderView);<NEW_LINE>TextView folderIcon = (TextView) pathHeaderView.findViewById(R.id.tv_folder_icon);<NEW_LINE><MASK><NEW_LINE>TypefaceUtils.setOcticons(branchIconView, folderIcon);<NEW_LINE>listView.setAdapter(adapter);<NEW_LINE>}
folderIcon.setText(TypefaceUtils.ICON_FILE_SUBMODULE);
1,530,101
public static void drawAcceptIcon(Canvas canvas, RectF targetFrame, ResizingBehavior resizing) {<NEW_LINE>// General Declarations<NEW_LINE>Paint paint = CacheForAcceptIcon.paint;<NEW_LINE>// Local Colors<NEW_LINE>int fillColor103 = Color.argb(255, 32, 183, 128);<NEW_LINE>// Resize to Target Frame<NEW_LINE>canvas.save();<NEW_LINE>RectF resizedFrame = CacheForAcceptIcon.resizedFrame;<NEW_LINE>HabiticaIcons.resizingBehaviorApply(resizing, CacheForAcceptIcon.originalFrame, targetFrame, resizedFrame);<NEW_LINE>canvas.translate(resizedFrame.left, resizedFrame.top);<NEW_LINE>canvas.scale(resizedFrame.width() / 13f, resizedFrame.height() / 13f);<NEW_LINE>// Bezier<NEW_LINE>RectF bezierRect = CacheForAcceptIcon.bezierRect;<NEW_LINE>bezierRect.set(0f, 2f, 13f, 12f);<NEW_LINE>Path bezierPath = CacheForAcceptIcon.bezierPath;<NEW_LINE>bezierPath.reset();<NEW_LINE>bezierPath.moveTo(1.5f, 6.5f);<NEW_LINE>bezierPath.lineTo(0f, 8f);<NEW_LINE>bezierPath.lineTo(4f, 12f);<NEW_LINE>bezierPath.lineTo(13f, 3.5f);<NEW_LINE>bezierPath.lineTo(11.5f, 2f);<NEW_LINE>bezierPath.lineTo(4f, 9f);<NEW_LINE>bezierPath.lineTo(1.5f, 6.5f);<NEW_LINE>bezierPath.close();<NEW_LINE>paint.reset();<NEW_LINE>paint.setFlags(Paint.ANTI_ALIAS_FLAG);<NEW_LINE>bezierPath.setFillType(Path.FillType.EVEN_ODD);<NEW_LINE>paint.<MASK><NEW_LINE>paint.setColor(fillColor103);<NEW_LINE>canvas.drawPath(bezierPath, paint);<NEW_LINE>canvas.restore();<NEW_LINE>}
setStyle(Paint.Style.FILL);
613,096
protected void masterOperation(final CreateTableRequest request, final ClusterState state, final ActionListener<CreateTableResponse> listener) {<NEW_LINE>final RelationName relationName = request.getTableName();<NEW_LINE>if (viewsExists(relationName, state)) {<NEW_LINE>listener.onFailure(new RelationAlreadyExists(relationName));<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (request.getCreateIndexRequest() != null) {<NEW_LINE>CreateIndexRequest createIndexRequest = request.getCreateIndexRequest();<NEW_LINE>ActionListener<CreateIndexResponse> wrappedListener = ActionListener.wrap(response -> listener.onResponse(new CreateTableResponse(response.isShardsAcknowledged())), listener::onFailure);<NEW_LINE>transportCreateIndexAction.masterOperation(createIndexRequest, state, wrappedListener);<NEW_LINE>} else if (request.getPutIndexTemplateRequest() != null) {<NEW_LINE>PutIndexTemplateRequest putIndexTemplateRequest = request.getPutIndexTemplateRequest();<NEW_LINE>ActionListener<AcknowledgedResponse> wrappedListener = ActionListener.wrap(response -> listener.onResponse(new CreateTableResponse(response.isAcknowledged())), listener::onFailure);<NEW_LINE>transportPutIndexTemplateAction.<MASK><NEW_LINE>} else {<NEW_LINE>throw new IllegalStateException("Unknown table request");<NEW_LINE>}<NEW_LINE>}
masterOperation(putIndexTemplateRequest, state, wrappedListener);
1,589,248
public INDArray apply(List<Writable> c) {<NEW_LINE>int length = 0;<NEW_LINE>for (Writable w : c) {<NEW_LINE>if (w instanceof NDArrayWritable) {<NEW_LINE>INDArray a = ((NDArrayWritable) w).get();<NEW_LINE>if (a.isRowVector()) {<NEW_LINE>length += a.columns();<NEW_LINE>} else {<NEW_LINE>throw new UnsupportedOperationException("NDArrayWritable is not a row vector." + " Can only concat row vectors with other writables. Shape: " + Arrays.toString(a.shape()));<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>length++;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>INDArray arr = Nd4j.zeros(1, length);<NEW_LINE>int idx = 0;<NEW_LINE>for (Writable w : c) {<NEW_LINE>if (w instanceof NDArrayWritable) {<NEW_LINE>INDArray subArr = ((NDArrayWritable) w).get();<NEW_LINE>int subLength = subArr.columns();<NEW_LINE>arr.get(NDArrayIndex.point(0), NDArrayIndex.interval(idx, idx + subLength)).assign(subArr);<NEW_LINE>idx += subLength;<NEW_LINE>} else {<NEW_LINE>arr.putScalar(idx<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>return arr;<NEW_LINE>}
++, w.toDouble());
1,751,099
public Builder mergeFrom(name.abuchen.portfolio.model.proto.v1.PSecurityEvent other) {<NEW_LINE>if (other == name.abuchen.portfolio.model.proto.v1.PSecurityEvent.getDefaultInstance())<NEW_LINE>return this;<NEW_LINE>if (other.type_ != 0) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>if (other.getDate() != 0L) {<NEW_LINE>setDate(other.getDate());<NEW_LINE>}<NEW_LINE>if (!other.getDetails().isEmpty()) {<NEW_LINE>details_ = other.details_;<NEW_LINE>onChanged();<NEW_LINE>}<NEW_LINE>if (dataBuilder_ == null) {<NEW_LINE>if (!other.data_.isEmpty()) {<NEW_LINE>if (data_.isEmpty()) {<NEW_LINE>data_ = other.data_;<NEW_LINE>bitField0_ = (bitField0_ & ~0x00000001);<NEW_LINE>} else {<NEW_LINE>ensureDataIsMutable();<NEW_LINE>data_.addAll(other.data_);<NEW_LINE>}<NEW_LINE>onChanged();<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>if (!other.data_.isEmpty()) {<NEW_LINE>if (dataBuilder_.isEmpty()) {<NEW_LINE>dataBuilder_.dispose();<NEW_LINE>dataBuilder_ = null;<NEW_LINE>data_ = other.data_;<NEW_LINE>bitField0_ = (bitField0_ & ~0x00000001);<NEW_LINE>dataBuilder_ = com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? getDataFieldBuilder() : null;<NEW_LINE>} else {<NEW_LINE>dataBuilder_.addAllMessages(other.data_);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>this.mergeUnknownFields(other.unknownFields);<NEW_LINE>onChanged();<NEW_LINE>return this;<NEW_LINE>}
setTypeValue(other.getTypeValue());
1,423,877
public static boolean extract(ZipFile zipFile, ZipEntry entryFile, File extractTo, String targetMd5, boolean isDex) throws IOException {<NEW_LINE>int numAttempts = 0;<NEW_LINE>boolean isExtractionSuccessful = false;<NEW_LINE>while (numAttempts < MAX_EXTRACT_ATTEMPTS && !isExtractionSuccessful) {<NEW_LINE>numAttempts++;<NEW_LINE>InputStream is = null;<NEW_LINE>OutputStream os = null;<NEW_LINE>ShareTinkerLog.i(TAG, <MASK><NEW_LINE>try {<NEW_LINE>is = new BufferedInputStream(zipFile.getInputStream(entryFile));<NEW_LINE>os = new BufferedOutputStream(new FileOutputStream(extractTo));<NEW_LINE>byte[] buffer = new byte[ShareConstants.BUFFER_SIZE];<NEW_LINE>int length = 0;<NEW_LINE>while ((length = is.read(buffer)) > 0) {<NEW_LINE>os.write(buffer, 0, length);<NEW_LINE>}<NEW_LINE>} finally {<NEW_LINE>IOHelper.closeQuietly(os);<NEW_LINE>IOHelper.closeQuietly(is);<NEW_LINE>}<NEW_LINE>if (targetMd5 != null) {<NEW_LINE>if (isDex) {<NEW_LINE>isExtractionSuccessful = SharePatchFileUtil.verifyDexFileMd5(extractTo, targetMd5);<NEW_LINE>} else {<NEW_LINE>isExtractionSuccessful = SharePatchFileUtil.verifyFileMd5(extractTo, targetMd5);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>// treat it as true<NEW_LINE>isExtractionSuccessful = true;<NEW_LINE>}<NEW_LINE>ShareTinkerLog.i(TAG, "isExtractionSuccessful: %b", isExtractionSuccessful);<NEW_LINE>if (!isExtractionSuccessful) {<NEW_LINE>final boolean succ = extractTo.delete();<NEW_LINE>if (!succ || extractTo.exists()) {<NEW_LINE>ShareTinkerLog.e(TAG, "Failed to delete corrupted dex " + extractTo.getPath());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return isExtractionSuccessful;<NEW_LINE>}
"try Extracting " + extractTo.getPath());
743,109
public void simulate(ProgramStatement statement) throws ExitingException {<NEW_LINE>// TODO: maybe refactor this, other null strings are handled in a central place now<NEW_LINE>// = "";<NEW_LINE>String message = new String();<NEW_LINE>int <MASK><NEW_LINE>// Need an array to convert to String<NEW_LINE>char[] ch = { ' ' };<NEW_LINE>try {<NEW_LINE>ch[0] = (char) Globals.memory.getByte(byteAddress);<NEW_LINE>while (// only uses single location ch[0]<NEW_LINE>ch[0] != 0) {<NEW_LINE>// parameter to String constructor is a char[] array<NEW_LINE>message = message.concat(new String(ch));<NEW_LINE>byteAddress++;<NEW_LINE>ch[0] = (char) Globals.memory.getByte(byteAddress);<NEW_LINE>}<NEW_LINE>} catch (AddressErrorException e) {<NEW_LINE>throw new ExitingException(statement, e);<NEW_LINE>}<NEW_LINE>JOptionPane.showMessageDialog(null, message + Double.longBitsToDouble(FloatingPointRegisterFile.getValueLong(10)), null, JOptionPane.INFORMATION_MESSAGE);<NEW_LINE>}
byteAddress = RegisterFile.getValue("a0");
1,718,708
public ProjectRequestDocument createDocument(ProjectRequestEvent event) {<NEW_LINE><MASK><NEW_LINE>ProjectRequest request = event.getProjectRequest();<NEW_LINE>ProjectRequestDocument document = new ProjectRequestDocument();<NEW_LINE>document.setGenerationTimestamp(event.getTimestamp());<NEW_LINE>document.setGroupId(request.getGroupId());<NEW_LINE>document.setArtifactId(request.getArtifactId());<NEW_LINE>document.setPackageName(request.getPackageName());<NEW_LINE>document.setVersion(determineVersionInformation(request));<NEW_LINE>document.setClient(determineClientInformation(request));<NEW_LINE>document.setJavaVersion(request.getJavaVersion());<NEW_LINE>if (StringUtils.hasText(request.getJavaVersion()) && metadata.getJavaVersions().get(request.getJavaVersion()) == null) {<NEW_LINE>document.triggerError().setJavaVersion(true);<NEW_LINE>}<NEW_LINE>document.setLanguage(request.getLanguage());<NEW_LINE>if (StringUtils.hasText(request.getLanguage()) && metadata.getLanguages().get(request.getLanguage()) == null) {<NEW_LINE>document.triggerError().setLanguage(true);<NEW_LINE>}<NEW_LINE>document.setPackaging(request.getPackaging());<NEW_LINE>if (StringUtils.hasText(request.getPackaging()) && metadata.getPackagings().get(request.getPackaging()) == null) {<NEW_LINE>document.triggerError().setPackaging(true);<NEW_LINE>}<NEW_LINE>document.setType(request.getType());<NEW_LINE>document.setBuildSystem(determineBuildSystem(request));<NEW_LINE>if (StringUtils.hasText(request.getType()) && metadata.getTypes().get(request.getType()) == null) {<NEW_LINE>document.triggerError().setType(true);<NEW_LINE>}<NEW_LINE>// Let's not rely on the resolved dependencies here<NEW_LINE>List<String> dependencies = new ArrayList<>(request.getDependencies());<NEW_LINE>List<String> validDependencies = dependencies.stream().filter((id) -> metadata.getDependencies().get(id) != null).collect(Collectors.toList());<NEW_LINE>document.setDependencies(new DependencyInformation(validDependencies));<NEW_LINE>List<String> invalidDependencies = dependencies.stream().filter((id) -> (!validDependencies.contains(id))).collect(Collectors.toList());<NEW_LINE>if (!invalidDependencies.isEmpty()) {<NEW_LINE>document.triggerError().triggerInvalidDependencies(invalidDependencies);<NEW_LINE>}<NEW_LINE>// Let's make sure that the document is flagged as invalid no matter what<NEW_LINE>if (event instanceof ProjectFailedEvent) {<NEW_LINE>ErrorStateInformation errorState = document.triggerError();<NEW_LINE>ProjectFailedEvent failed = (ProjectFailedEvent) event;<NEW_LINE>if (failed.getCause() != null) {<NEW_LINE>errorState.setMessage(failed.getCause().getMessage());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return document;<NEW_LINE>}
InitializrMetadata metadata = event.getMetadata();
776,116
private void writeAttributes(final ITreeWriter writer, final NodeModel node, final NodeStyleModel style, final boolean forceFormatting) {<NEW_LINE>final Color color = forceFormatting ? nsc.getColor(node, StyleOption.FOR_UNSELECTED_NODE) : style.getColor();<NEW_LINE>if (color != null) {<NEW_LINE>ColorUtils.addColorAttributes(writer, "COLOR", "ALPHA", color);<NEW_LINE>}<NEW_LINE>final Color backgroundColor = forceFormatting ? nsc.getBackgroundColor(node, StyleOption.FOR_UNSELECTED_NODE) : style.getBackgroundColor();<NEW_LINE>if (backgroundColor != null) {<NEW_LINE>ColorUtils.addColorAttributes(writer, "BACKGROUND_COLOR", "BACKGROUND_ALPHA", backgroundColor);<NEW_LINE>}<NEW_LINE>final NodeGeometryModel shapeConfiguration = forceFormatting ? nsc.getShapeConfiguration(node, StyleOption.FOR_UNSELECTED_NODE) : style.getShapeConfiguration();<NEW_LINE>final NodeStyleShape shape = shapeConfiguration.getShape();<NEW_LINE>if (shape != null) {<NEW_LINE>writer.addAttribute("STYLE", shape.toString());<NEW_LINE>}<NEW_LINE>final Quantity<LengthUnit> shapeHorizontalMargin = shapeConfiguration.getHorizontalMargin();<NEW_LINE>if (!shapeHorizontalMargin.equals(NodeGeometryModel.DEFAULT_MARGIN)) {<NEW_LINE>BackwardCompatibleQuantityWriter.forWriter(writer).writeQuantity("SHAPE_HORIZONTAL_MARGIN", shapeHorizontalMargin);<NEW_LINE>}<NEW_LINE>final Quantity<LengthUnit> shapeVerticalMargin = shapeConfiguration.getVerticalMargin();<NEW_LINE>if (!shapeVerticalMargin.equals(NodeGeometryModel.DEFAULT_MARGIN)) {<NEW_LINE>BackwardCompatibleQuantityWriter.forWriter(writer).writeQuantity("SHAPE_VERTICAL_MARGIN", shapeVerticalMargin);<NEW_LINE>}<NEW_LINE>final boolean uniformShape = shapeConfiguration.isUniform();<NEW_LINE>if (uniformShape) {<NEW_LINE>writer.addAttribute("UNIFORM_SHAPE", "true");<NEW_LINE>}<NEW_LINE>final Boolean numbered = forceFormatting ? Boolean.valueOf(nsc.getNodeNumbering(node)) : style.getNodeNumbering();<NEW_LINE>if (numbered != null) {<NEW_LINE>writer.addAttribute("NUMBERED", Boolean.toString(numbered));<NEW_LINE>}<NEW_LINE>final String format = forceFormatting ? nsc.getNodeFormat(node) : style.getNodeFormat();<NEW_LINE>if (format != null) {<NEW_LINE>writer.addAttribute("FORMAT", format);<NEW_LINE>}<NEW_LINE>final HorizontalTextAlignment textAlignment = forceFormatting ? nsc.getHorizontalTextAlignment(node, StyleOption.<MASK><NEW_LINE>if (textAlignment != null) {<NEW_LINE>writer.addAttribute("TEXT_ALIGN", textAlignment.toString());<NEW_LINE>}<NEW_LINE>}
FOR_UNSELECTED_NODE) : style.getHorizontalTextAlignment();
644,138
private void openTransport4Sender(FileTransportChannelEntity fileTransport) throws GovernanceException {<NEW_LINE>IWeEventFileClient fileClient;<NEW_LINE>try {<NEW_LINE>fileClient = this.buildIWeEventFileClient(fileTransport.getBrokerId(), fileTransport.getGroupId(), fileTransport.getNodeAddress());<NEW_LINE>if (StringUtils.isBlank(fileTransport.getPublicKey())) {<NEW_LINE>fileClient.<MASK><NEW_LINE>} else {<NEW_LINE>fileClient.openTransport4Sender(fileTransport.getTopicName(), new ByteArrayInputStream(fileTransport.getPublicKey().getBytes(StandardCharsets.UTF_8)));<NEW_LINE>}<NEW_LINE>} catch (BrokerException e) {<NEW_LINE>log.error("open sender transport failed.", e);<NEW_LINE>String fileClientKey = fileTransport.getBrokerId() + IDENTIFIER + fileTransport.getGroupId() + IDENTIFIER + fileTransport.getTopicName() + IDENTIFIER + nodeAddress2Path(fileTransport.getNodeAddress());<NEW_LINE>this.fileClientMap.remove(fileClientKey);<NEW_LINE>throw new GovernanceException(e.getMessage());<NEW_LINE>}<NEW_LINE>this.addIWeEventClientToCache(fileTransport.getBrokerId(), fileTransport.getGroupId(), fileClient);<NEW_LINE>this.addTransportToCache(fileTransport.getBrokerId(), fileTransport.getGroupId(), fileTransport.getNodeAddress(), fileTransport.getTopicName(), fileTransport.getOverWrite());<NEW_LINE>log.info("open sender transport success, groupId:{}, topic:{}", fileTransport.getGroupId(), fileTransport.getTopicName());<NEW_LINE>}
openTransport4Sender(fileTransport.getTopicName());
1,182,596
private void verifyDeoptEntries(CodeInfo codeInfo) {<NEW_LINE>boolean hasError = false;<NEW_LINE>List<Entry<AnalysisMethod, Map<Long, DeoptSourceFrameInfo>>> deoptEntries = new ArrayList<>(CompilationInfoSupport.singleton().getDeoptEntries().entrySet());<NEW_LINE>deoptEntries.sort((e1, e2) -> e1.getKey().format("%H.%n(%p)").compareTo(e2.getKey().format("%H.%n(%p)")));<NEW_LINE>for (Entry<AnalysisMethod, Map<Long, DeoptSourceFrameInfo>> entry : deoptEntries) {<NEW_LINE>HostedMethod method = imageHeap.getUniverse().lookup(entry.getKey());<NEW_LINE>List<Entry<Long, DeoptSourceFrameInfo>> sourceFrameInfos = new ArrayList<>(entry.getValue().entrySet());<NEW_LINE>sourceFrameInfos.sort(Comparator.comparingLong(Entry::getKey));<NEW_LINE>for (Entry<Long, DeoptSourceFrameInfo> sourceFrameInfo : sourceFrameInfos) {<NEW_LINE>hasError |= <MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (hasError) {<NEW_LINE>VMError.shouldNotReachHere("Verification of deoptimization entry points failed");<NEW_LINE>}<NEW_LINE>}
verifyDeoptEntry(codeInfo, method, sourceFrameInfo);
449,834
protected void translateCore(final ITranslationEnvironment environment, final IInstruction instruction, final List<ReilInstruction> instructions) {<NEW_LINE>final IOperandTreeNode registerOperand1 = instruction.getOperands().get(0).getRootNode().getChildren().get(0);<NEW_LINE>final IOperandTreeNode registerOperand2 = instruction.getOperands().get(1).getRootNode().getChildren().get(0);<NEW_LINE>final String targetRegister = (registerOperand1.getValue());<NEW_LINE>final String sourceRegister = (registerOperand2.getValue());<NEW_LINE>final OperandSize dw = OperandSize.DWORD;<NEW_LINE>long baseOffset = (instruction.getAddress().toLong() * 0x100) + instructions.size();<NEW_LINE>final String tmpRm15to8 = environment.getNextVariableString();<NEW_LINE>final String tmpRm7to0 = environment.getNextVariableString();<NEW_LINE>final String tmpVar1 = environment.getNextVariableString();<NEW_LINE>final <MASK><NEW_LINE>final String tmpVar3 = environment.getNextVariableString();<NEW_LINE>final String tmpVar4 = environment.getNextVariableString();<NEW_LINE>final String tmpVar5 = environment.getNextVariableString();<NEW_LINE>instructions.add(ReilHelpers.createAnd(baseOffset++, dw, sourceRegister, dw, String.valueOf(0x000000FFL), dw, tmpRm7to0));<NEW_LINE>instructions.add(ReilHelpers.createBsh(baseOffset++, dw, tmpRm7to0, dw, String.valueOf(8), dw, tmpVar1));<NEW_LINE>instructions.add(ReilHelpers.createAnd(baseOffset++, dw, sourceRegister, dw, String.valueOf(0x0000FF00L), dw, tmpRm15to8));<NEW_LINE>instructions.add(ReilHelpers.createBsh(baseOffset++, dw, tmpRm15to8, dw, String.valueOf(-8), dw, tmpVar2));<NEW_LINE>instructions.add(ReilHelpers.createOr(baseOffset++, dw, tmpVar1, dw, tmpVar2, dw, tmpVar3));<NEW_LINE>// signextend targetregister<NEW_LINE>instructions.add(ReilHelpers.createAdd(baseOffset++, dw, tmpVar3, dw, String.valueOf(0x00008000L), dw, tmpVar4));<NEW_LINE>instructions.add(ReilHelpers.createAnd(baseOffset++, dw, tmpVar4, dw, String.valueOf(0x0000FFFF), dw, tmpVar5));<NEW_LINE>instructions.add(ReilHelpers.createSub(baseOffset++, dw, tmpVar5, dw, String.valueOf(0x00008000), dw, targetRegister));<NEW_LINE>}
String tmpVar2 = environment.getNextVariableString();
590,891
private void parseCommand(String command) {<NEW_LINE>if (command == null || command.isEmpty() || command.trim().isEmpty()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>command = command.trim();<NEW_LINE>if (command.isEmpty()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>String lowerCommand = command.toLowerCase();<NEW_LINE>// TODO: Better and more well-abstracted parsing logic.<NEW_LINE>if (lowerCommand.startsWith("create")) {<NEW_LINE>String[] args = command.split(" ");<NEW_LINE>String name = args.length > 1 ? args[1] : "TEST SESSION";<NEW_LINE>createSession(name);<NEW_LINE>} else if (lowerCommand.startsWith("join")) {<NEW_LINE>// Join<NEW_LINE>String[] args = command.split(" ");<NEW_LINE>String name = args.length > 1 ? args[1] : "TEST SESSION";<NEW_LINE>joinSession(name);<NEW_LINE>} else if (lowerCommand.startsWith("leave")) {<NEW_LINE>// leave<NEW_LINE>leaveSession();<NEW_LINE>} else if (lowerCommand.startsWith("ping")) {<NEW_LINE>String[] args = command.split(" ");<NEW_LINE>String pingString = args.length > 1 ? args[1] : "PING STRING";<NEW_LINE>pingSession(pingString);<NEW_LINE>} else if (lowerCommand.startsWith("cleanup")) {<NEW_LINE>cleanUp();<NEW_LINE>} else if (lowerCommand.startsWith("setint")) {<NEW_LINE>String[] args = command.split(" ");<NEW_LINE>String value = args.length > <MASK><NEW_LINE>setIntValue(value);<NEW_LINE>} else if (lowerCommand.startsWith("showint")) {<NEW_LINE>showIntValue();<NEW_LINE>} else if (lowerCommand.startsWith("quit")) {<NEW_LINE>shouldExit = true;<NEW_LINE>} else {<NEW_LINE>System.out.println("\nCommand \"" + command + "\" not recognized!");<NEW_LINE>}<NEW_LINE>System.gc();<NEW_LINE>}
1 ? args[1] : "0";
1,583,362
public long considerStrings(Extractor ext, CrawlURI curi, CharSequence cs, boolean handlingJSFile) {<NEW_LINE>CrawlURI baseUri = curi;<NEW_LINE>Matcher m = TextUtils.getMatcher("jQuery\\.extend\\(Drupal\\.settings,[^'\"]*['\"]basePath['\"]:[^'\"]*['\"]([^'\"]+)['\"]", cs);<NEW_LINE>if (m.find()) {<NEW_LINE>String basePath = m.group(1);<NEW_LINE>try {<NEW_LINE>basePath = StringEscapeUtils.unescapeJavaScript(basePath);<NEW_LINE>} catch (NestableRuntimeException e) {<NEW_LINE>LOGGER.log(Level.WARNING, "problem unescaping purported drupal basePath '" + basePath + "'", e);<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>UURI baseUURI = UURIFactory.getInstance(curi.getUURI(), basePath);<NEW_LINE>baseUri = new CustomizedCrawlURIFacade(curi, baseUURI);<NEW_LINE>} catch (URIException e) {<NEW_LINE>LOGGER.log(Level.WARNING, "problem creating UURI from drupal basePath '" + basePath + "'", e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>TextUtils.recycleMatcher(m);<NEW_LINE>// extract youtube videoid from youtube javascript embed and create link<NEW_LINE>// for watch page<NEW_LINE>m = TextUtils.getMatcher("new[\\s]+YT\\.Player\\(['\"][^'\"]+['\"],[\\s]+\\{[\\n\\s\\w:'\",]+videoId:[\\s]+['\"]([\\w-]+)['\"],", cs);<NEW_LINE>if (m.find()) {<NEW_LINE>String videoId = m.group(1);<NEW_LINE>String newUri = "https://www.youtube.com/watch?v=" + videoId;<NEW_LINE>try {<NEW_LINE>addRelativeToBase(curi, ext.getExtractorParameters().getMaxOutlinks(), newUri, <MASK><NEW_LINE>} catch (URIException e) {<NEW_LINE>// no way this should happen<NEW_LINE>throw new IllegalStateException(newUri, e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>TextUtils.recycleMatcher(m);<NEW_LINE>return super.considerStrings(ext, baseUri, cs, handlingJSFile);<NEW_LINE>}
LinkContext.INFERRED_MISC, Hop.INFERRED);
528,572
public static void searchSymbols(GhidraScript script, AbstractPdb pdb, String searchString) throws CancelledException {<NEW_LINE>PdbDebugInfo debugInfo = pdb.getDebugInfo();<NEW_LINE>if (debugInfo == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>StringBuilder results = new StringBuilder();<NEW_LINE>results.append('\n');<NEW_LINE>int numModules = debugInfo.getNumModules();<NEW_LINE>TaskMonitor monitor = script.getMonitor();<NEW_LINE>int numSymbols = 0;<NEW_LINE>for (int module = 0; module <= numModules; module++) {<NEW_LINE>monitor.checkCanceled();<NEW_LINE>try {<NEW_LINE>Map<Long, AbstractMsSymbol> symbols = debugInfo.getModuleSymbolsByOffset(module);<NEW_LINE>numSymbols += symbols.size();<NEW_LINE>} catch (PdbException e) {<NEW_LINE>// just skip the module... logging this in the next loop.<NEW_LINE>}<NEW_LINE>}<NEW_LINE>monitor.initialize(numSymbols);<NEW_LINE>println(script, "Searching " + numSymbols + " PDB symbol components...");<NEW_LINE>for (int module = 0; module <= numModules; module++) {<NEW_LINE>monitor.checkCanceled();<NEW_LINE>try {<NEW_LINE>Map<Long, AbstractMsSymbol> symbols = debugInfo.getModuleSymbolsByOffset(module);<NEW_LINE>numSymbols += symbols.size();<NEW_LINE>for (Map.Entry<Long, AbstractMsSymbol> entry : symbols.entrySet()) {<NEW_LINE>monitor.checkCanceled();<NEW_LINE>AbstractMsSymbol symbol = entry.getValue();<NEW_LINE>String symbolString = symbol.toString();<NEW_LINE>if (symbolString.contains(searchString)) {<NEW_LINE>results.append("Module " + module + ", Offset " + entry.getKey() + ":\n");<NEW_LINE>results.append(symbolString);<NEW_LINE>results.append('\n');<NEW_LINE>}<NEW_LINE>monitor.incrementProgress(1);<NEW_LINE>}<NEW_LINE>} catch (PdbException e) {<NEW_LINE>Msg.debug(PdbQuery.class, "Skipping module " + module + " due to exception.");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>println(<MASK><NEW_LINE>}
script, results.toString());
398,350
public static DescribeSQLLogFilesResponse unmarshall(DescribeSQLLogFilesResponse describeSQLLogFilesResponse, UnmarshallerContext _ctx) {<NEW_LINE>describeSQLLogFilesResponse.setRequestId(_ctx.stringValue("DescribeSQLLogFilesResponse.RequestId"));<NEW_LINE>describeSQLLogFilesResponse.setTotalRecordCount(_ctx.integerValue("DescribeSQLLogFilesResponse.TotalRecordCount"));<NEW_LINE>describeSQLLogFilesResponse.setPageNumber(_ctx.integerValue("DescribeSQLLogFilesResponse.PageNumber"));<NEW_LINE>describeSQLLogFilesResponse.setPageRecordCount(_ctx.integerValue("DescribeSQLLogFilesResponse.PageRecordCount"));<NEW_LINE>List<LogFile> items = new ArrayList<LogFile>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("DescribeSQLLogFilesResponse.Items.Length"); i++) {<NEW_LINE>LogFile logFile = new LogFile();<NEW_LINE>logFile.setFileID(_ctx.stringValue("DescribeSQLLogFilesResponse.Items[" + i + "].FileID"));<NEW_LINE>logFile.setLogStatus(_ctx.stringValue<MASK><NEW_LINE>logFile.setLogDownloadURL(_ctx.stringValue("DescribeSQLLogFilesResponse.Items[" + i + "].LogDownloadURL"));<NEW_LINE>logFile.setLogSize(_ctx.stringValue("DescribeSQLLogFilesResponse.Items[" + i + "].LogSize"));<NEW_LINE>logFile.setLogStartTime(_ctx.stringValue("DescribeSQLLogFilesResponse.Items[" + i + "].LogStartTime"));<NEW_LINE>logFile.setLogEndTime(_ctx.stringValue("DescribeSQLLogFilesResponse.Items[" + i + "].LogEndTime"));<NEW_LINE>items.add(logFile);<NEW_LINE>}<NEW_LINE>describeSQLLogFilesResponse.setItems(items);<NEW_LINE>return describeSQLLogFilesResponse;<NEW_LINE>}
("DescribeSQLLogFilesResponse.Items[" + i + "].LogStatus"));
1,744,242
final DeleteMetricStreamResult executeDeleteMetricStream(DeleteMetricStreamRequest deleteMetricStreamRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(deleteMetricStreamRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DeleteMetricStreamRequest> request = null;<NEW_LINE>Response<DeleteMetricStreamResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DeleteMetricStreamRequestMarshaller().marshall(super.beforeMarshalling(deleteMetricStreamRequest));<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, "CloudWatch");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DeleteMetricStream");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>StaxResponseHandler<DeleteMetricStreamResult> responseHandler = new StaxResponseHandler<DeleteMetricStreamResult>(new DeleteMetricStreamResultStaxUnmarshaller());<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,350,891
public JobConfiguration toJobConfiguration() {<NEW_LINE>JobConfiguration result = JobConfiguration.newBuilder(jobName, shardingTotalCount).cron(cron).timeZone(timeZone).shardingItemParameters(shardingItemParameters).jobParameter(jobParameter).monitorExecution(monitorExecution).failover(failover).misfire(misfire).maxTimeDiffSeconds(maxTimeDiffSeconds).reconcileIntervalMinutes(reconcileIntervalMinutes).jobShardingStrategyType(jobShardingStrategyType).jobExecutorServiceHandlerType(jobExecutorServiceHandlerType).jobErrorHandlerType(jobErrorHandlerType).jobListenerTypes(jobListenerTypes.toArray(new String[] {})).description(description).disabled(disabled).overwrite(overwrite).label(label).staticSharding(staticSharding).build();<NEW_LINE>jobExtraConfigurations.stream().map(YamlConfiguration::toConfiguration).forEach(result.getExtraConfigurations()::add);<NEW_LINE>for (Object each : props.keySet()) {<NEW_LINE>result.getProps().setProperty(each.toString(), props.get(each.toString<MASK><NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>}
()).toString());
1,547,340
final ListIPSetsResult executeListIPSets(ListIPSetsRequest listIPSetsRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(listIPSetsRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<ListIPSetsRequest> request = null;<NEW_LINE>Response<ListIPSetsResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new ListIPSetsRequestProtocolMarshaller(protocolFactory).marshall<MASK><NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "WAF Regional");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ListIPSets");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<ListIPSetsResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new ListIPSetsResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
(super.beforeMarshalling(listIPSetsRequest));
1,006,774
public CharSequence extractReturnType(ExecutableElement executableElement) {<NEW_LINE>if (executableElement instanceof ExecutableElementImpl) {<NEW_LINE>Binding binding = ((ExecutableElementImpl) executableElement)._binding;<NEW_LINE>if (binding instanceof MethodBinding) {<NEW_LINE>MethodBinding methodBinding = (MethodBinding) binding;<NEW_LINE>@Nullable<NEW_LINE>AbstractMethodDeclaration sourceMethod = methodBinding.sourceMethod();<NEW_LINE>if (sourceMethod != null) {<NEW_LINE>CharSequence rawType = getRawType(methodBinding);<NEW_LINE>char[] content = sourceMethod.compilationResult.compilationUnit.getContents();<NEW_LINE>// intentionaly<NEW_LINE>int sourceEnd = methodBinding.sourceStart();<NEW_LINE>int sourceStart = scanForTheSourceStart(content, sourceEnd);<NEW_LINE>char[] methodTest = Arrays.copyOfRange(content, sourceStart, sourceEnd);<NEW_LINE>Entry<String, List<String>> extracted = SourceTypes.extract(String.valueOf(methodTest));<NEW_LINE>return SourceTypes.stringify(Maps.immutableEntry(rawType.toString()<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return UNABLE_TO_EXTRACT;<NEW_LINE>}
, extracted.getValue()));
569,699
public OperatorStr visitPhysicalHashAggregate(OptExpression optExpression, OperatorPrinter.ExplainContext context) {<NEW_LINE>OperatorStr child = visit(optExpression.getInputs().get(0), new ExplainContext(context.step + 1));<NEW_LINE>PhysicalHashAggregateOperator aggregate = (PhysicalHashAggregateOperator) optExpression.getOp();<NEW_LINE>StringBuilder sb = new StringBuilder("- AGGREGATE(").append(aggregate.getType()).append(") ");<NEW_LINE>sb.append("[").append(aggregate.getGroupBys().stream().map(c -> new ExpressionPrinter().print(c)).collect(Collectors.joining(", "))).append("]");<NEW_LINE>sb.append(buildOutputColumns(aggregate, ""));<NEW_LINE>sb.append("\n");<NEW_LINE>buildCostEstimate(sb, optExpression, context.step);<NEW_LINE>for (Map.Entry<ColumnRefOperator, CallOperator> entry : aggregate.getAggregations().entrySet()) {<NEW_LINE>String analyticCallString = new ExpressionPrinter().print(entry.getKey()) + " := " + new ExpressionPrinter().<MASK><NEW_LINE>buildOperatorProperty(sb, analyticCallString, context.step);<NEW_LINE>}<NEW_LINE>buildCommonProperty(sb, aggregate, context.step);<NEW_LINE>return new OperatorStr(sb.toString(), context.step, Collections.singletonList(child));<NEW_LINE>}
print(entry.getValue());
724,663
private void saveTrackInfo() {<NEW_LINE>GPXFile gpxFile = selectedGpxFile.getGpxFile();<NEW_LINE>if (gpxFile.showCurrentTrack) {<NEW_LINE>settings.CURRENT_TRACK_COLOR.set(trackDrawInfo.getColor());<NEW_LINE>settings.CURRENT_TRACK_COLORING_TYPE.set(trackDrawInfo.getColoringType());<NEW_LINE>settings.CURRENT_TRACK_ROUTE_INFO_ATTRIBUTE.set(trackDrawInfo.getRouteInfoAttribute());<NEW_LINE>settings.CURRENT_TRACK_WIDTH.set(trackDrawInfo.getWidth());<NEW_LINE>settings.CURRENT_TRACK_SHOW_ARROWS.set(trackDrawInfo.isShowArrows());<NEW_LINE>settings.CURRENT_TRACK_SHOW_START_FINISH.set(trackDrawInfo.isShowStartFinish());<NEW_LINE>} else if (gpxDataItem != null) {<NEW_LINE>GpxSplitType splitType = GpxSplitType.getSplitTypeByTypeId(trackDrawInfo.getSplitType());<NEW_LINE>gpxDbHelper.updateColor(gpxDataItem, trackDrawInfo.getColor());<NEW_LINE>gpxDbHelper.updateWidth(gpxDataItem, trackDrawInfo.getWidth());<NEW_LINE>gpxDbHelper.updateShowArrows(gpxDataItem, trackDrawInfo.isShowArrows());<NEW_LINE>// gpxDbHelper.updateShowStartFinish(gpxDataItem, trackDrawInfo.isShowStartFinish());<NEW_LINE>gpxDbHelper.updateSplit(gpxDataItem, <MASK><NEW_LINE>ColoringType coloringType = trackDrawInfo.getColoringType();<NEW_LINE>String routeInfoAttribute = trackDrawInfo.getRouteInfoAttribute();<NEW_LINE>gpxDbHelper.updateColoringType(gpxDataItem, coloringType.getName(routeInfoAttribute));<NEW_LINE>}<NEW_LINE>}
splitType, trackDrawInfo.getSplitInterval());
972,845
private CachedValueProvider.Result<Location> computeLocation() {<NEW_LINE>Objects.requireNonNull(myElement);<NEW_LINE>Location defaultLocation = new Location(-1, -1, null, -1);<NEW_LINE>PsiFile containingFile = myElement.getContainingFile();<NEW_LINE>InjectedLanguageManager injectedLanguageManager = InjectedLanguageManager.getInstance(myElement.getProject());<NEW_LINE>PsiFile topLevelFile = injectedLanguageManager.getTopLevelFile(myElement);<NEW_LINE>if (topLevelFile == null)<NEW_LINE>return CachedValueProvider.Result.create(defaultLocation, ModificationTracker.NEVER_CHANGED);<NEW_LINE>com.intellij.openapi.editor.Document document = PsiDocumentManager.getInstance(myElement.getProject()).getDocument(topLevelFile);<NEW_LINE>if (document == null)<NEW_LINE>return CachedValueProvider.Result.create(defaultLocation, ModificationTracker.NEVER_CHANGED);<NEW_LINE>VirtualFile virtualFile = topLevelFile.getVirtualFile();<NEW_LINE>int offset = injectedLanguageManager.injectedToHost(myElement, myElement.getNavigationElement().getTextOffset());<NEW_LINE>int lineNumber = document.getLineNumber(offset);<NEW_LINE>int column = <MASK><NEW_LINE>Location location = new Location(lineNumber + 1, column + 1, virtualFile != null ? FileUtil.toSystemIndependentName(virtualFile.getPath()) : null, offset);<NEW_LINE>return CachedValueProvider.Result.create(location, containingFile, topLevelFile, document);<NEW_LINE>}
offset - document.getLineStartOffset(lineNumber);
749,486
public OpenSearchAction unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE><MASK><NEW_LINE>if (!reader.isContainer()) {<NEW_LINE>reader.skipValue();<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>OpenSearchAction openSearchAction = new OpenSearchAction();<NEW_LINE>reader.beginObject();<NEW_LINE>while (reader.hasNext()) {<NEW_LINE>String name = reader.nextName();<NEW_LINE>if (name.equals("roleArn")) {<NEW_LINE>openSearchAction.setRoleArn(StringJsonUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>} else if (name.equals("endpoint")) {<NEW_LINE>openSearchAction.setEndpoint(StringJsonUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>} else if (name.equals("index")) {<NEW_LINE>openSearchAction.setIndex(StringJsonUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>} else if (name.equals("type")) {<NEW_LINE>openSearchAction.setType(StringJsonUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>} else if (name.equals("id")) {<NEW_LINE>openSearchAction.setId(StringJsonUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>} else {<NEW_LINE>reader.skipValue();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>reader.endObject();<NEW_LINE>return openSearchAction;<NEW_LINE>}
AwsJsonReader reader = context.getReader();
209,580
/* (non-Javadoc)<NEW_LINE>* @see com.kkalice.adempiere.migrate.DBObjectInterface#createObject(com.kkalice.adempiere.migrate.MigrateLogger, com.kkalice.adempiere.migrate.MigrateDBEngine, com.kkalice.adempiere.migrate.DBConnection, java.lang.String, java.util.HashMap, java.util.HashMap)<NEW_LINE>*/<NEW_LINE>@SuppressWarnings("static-access")<NEW_LINE>public boolean createObject(Parameters parameters, MigrateLogger logger, DBEngine dbEngine, DBConnection db, String name, HashMap<Integer, DBObjectDefinition> headerMap, HashMap<Integer, DBObjectDefinition> contentMap) {<NEW_LINE>boolean success = true;<NEW_LINE>// find source db vendor from first entry in content map<NEW_LINE>DBObject_View_Definition content = (DBObject_View_Definition) contentMap.get(0);<NEW_LINE>String sourceVendor = content.getParent().getVendor();<NEW_LINE>String sourceSchema = content.getParent().getSchema();<NEW_LINE>// definition in contents<NEW_LINE>// concatenate all lines into a single string<NEW_LINE>Vector<Integer> v = new Vector<Integer>(contentMap.keySet());<NEW_LINE>java.util.Collections.sort(v);<NEW_LINE>StringBuffer sqlContent = new StringBuffer();<NEW_LINE>for (Iterator<Integer> it = v.iterator(); it.hasNext(); ) {<NEW_LINE>int key = it.next();<NEW_LINE>content = (DBObject_View_Definition) contentMap.get(key);<NEW_LINE>if (sqlContent.length() > 0)<NEW_LINE>sqlContent.append(System.getProperty("line.separator"));<NEW_LINE>sqlContent.append(content.getDefinition());<NEW_LINE>}<NEW_LINE>String sql = dbEngine.sqlObject_createView(sourceVendor, sourceSchema, db.getVendor(), db.getCatalog(), db.getSchema(), name, <MASK><NEW_LINE>// create the view<NEW_LINE>Statement stmt = db.setStatement();<NEW_LINE>if (db.executeUpdateSilent(stmt, sql, true) == null)<NEW_LINE>success = false;<NEW_LINE>// if creation failed, try again as commented-out stub to make fixing easier for the DBA<NEW_LINE>if (!success) {<NEW_LINE>String lastError = db.getLastSilentError();<NEW_LINE>// try again to create the view<NEW_LINE>if (parameters.isAttemptTranslation() || sourceVendor.equalsIgnoreCase(db.getVendor())) {<NEW_LINE>success = true;<NEW_LINE>logger.log(Level.FINER, "failedToCreateRetrying", new Object[] { getObjectType(), name });<NEW_LINE>sql = dbEngine.sqlObject_createView(sourceVendor, null, db.getVendor(), db.getCatalog(), db.getSchema(), name, sqlContent.toString(), true);<NEW_LINE>if (db.executeUpdate(stmt, sql, true, false) == null)<NEW_LINE>success = false;<NEW_LINE>logger.log(Level.WARNING, "mustRewrite", new Object[] { getObjectType(), name, lastError });<NEW_LINE>}<NEW_LINE>}<NEW_LINE>db.releaseStatement(stmt);<NEW_LINE>return success;<NEW_LINE>}
sqlContent.toString(), false);
332,290
public CoverageNormalizedUnits unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>CoverageNormalizedUnits coverageNormalizedUnits = new CoverageNormalizedUnits();<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("OnDemandNormalizedUnits", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>coverageNormalizedUnits.setOnDemandNormalizedUnits(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("ReservedNormalizedUnits", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>coverageNormalizedUnits.setReservedNormalizedUnits(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("TotalRunningNormalizedUnits", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>coverageNormalizedUnits.setTotalRunningNormalizedUnits(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("CoverageNormalizedUnitsPercentage", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>coverageNormalizedUnits.setCoverageNormalizedUnitsPercentage(context.getUnmarshaller(String.<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 coverageNormalizedUnits;<NEW_LINE>}
class).unmarshall(context));
1,650,755
// getDays<NEW_LINE>public static MHRProcess copyFrom(MHRProcess from, Timestamp dateAcct, int docTypeTargetId, boolean counter, String trxName, boolean setOrder) {<NEW_LINE>MHRProcess to = new MHRProcess(from.getCtx(), 0, trxName);<NEW_LINE>PO.copyValues(from, to, from.getAD_Client_ID(), from.getAD_Org_ID());<NEW_LINE>to.setReversal(true);<NEW_LINE><MASK><NEW_LINE>//<NEW_LINE>// Draft<NEW_LINE>to.setDocStatus(DOCSTATUS_Drafted);<NEW_LINE>to.setDocAction(DOCACTION_Complete);<NEW_LINE>//<NEW_LINE>to.setName(from.getDocumentNo());<NEW_LINE>to.setC_DocType_ID(docTypeTargetId);<NEW_LINE>to.setC_DocTypeTarget_ID(docTypeTargetId);<NEW_LINE>to.setDateAcct(dateAcct);<NEW_LINE>//<NEW_LINE>to.setHR_Job_ID(from.getHR_Job_ID());<NEW_LINE>to.setHR_Department_ID(from.getHR_Department_ID());<NEW_LINE>to.setHR_Payroll_ID(from.getHR_Payroll_ID());<NEW_LINE>to.setHR_Period_ID(from.getHR_Period_ID());<NEW_LINE>to.setC_BPartner_ID(from.getC_BPartner_ID());<NEW_LINE>to.setHR_Employee_ID(from.getHR_Employee_ID());<NEW_LINE>//<NEW_LINE>to.setPosted(false);<NEW_LINE>to.setProcessed(false);<NEW_LINE>to.setProcessing(false);<NEW_LINE>to.saveEx();<NEW_LINE>// Lines<NEW_LINE>if (to.copyLinesFrom(from) == 0)<NEW_LINE>throw new IllegalStateException("Could not create Payroll Lines");<NEW_LINE>return to;<NEW_LINE>}
to.set_ValueNoCheck("DocumentNo", null);
697,816
private void zipFilesToStage(Twister2PipelineOptions options) {<NEW_LINE>File zipFile = null;<NEW_LINE>Set<String> jarSet = new HashSet<>();<NEW_LINE>// TODO figure out if we can remove all the dependencies that come with<NEW_LINE>// the twister2 jars as well since they will be anyway provided from the<NEW_LINE>// system we do not need to pack them<NEW_LINE>List<String> filesToStage = options.getFilesToStage();<NEW_LINE>List<String> trimmed = new ArrayList<>();<NEW_LINE>// remove twister2 jars from the list<NEW_LINE>for (String file : filesToStage) {<NEW_LINE>if (!file.contains("/org/twister2")) {<NEW_LINE>trimmed.add(file);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>FileInputStream fis = null;<NEW_LINE>try {<NEW_LINE>zipFile = File.createTempFile("twister2-", ".zip");<NEW_LINE>FileOutputStream fos = new FileOutputStream(zipFile);<NEW_LINE>ZipOutputStream zipOut = new ZipOutputStream(fos);<NEW_LINE>zipOut.putNextEntry(new ZipEntry("lib/"));<NEW_LINE>for (String srcFile : trimmed) {<NEW_LINE>File fileToZip = new File(srcFile);<NEW_LINE>if (!jarSet.contains(fileToZip.getName())) {<NEW_LINE>jarSet.<MASK><NEW_LINE>} else {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>fis = new FileInputStream(fileToZip);<NEW_LINE>ZipEntry zipEntry = new ZipEntry("lib/" + fileToZip.getName());<NEW_LINE>zipOut.putNextEntry(zipEntry);<NEW_LINE>byte[] bytes = new byte[1024];<NEW_LINE>int length;<NEW_LINE>while ((length = fis.read(bytes)) >= 0) {<NEW_LINE>zipOut.write(bytes, 0, length);<NEW_LINE>}<NEW_LINE>fis.close();<NEW_LINE>}<NEW_LINE>zipOut.close();<NEW_LINE>fos.close();<NEW_LINE>zipFile.deleteOnExit();<NEW_LINE>} catch (FileNotFoundException e) {<NEW_LINE>LOG.info(e.getMessage());<NEW_LINE>} catch (IOException e) {<NEW_LINE>LOG.info(e.getMessage());<NEW_LINE>} finally {<NEW_LINE>if (fis != null) {<NEW_LINE>try {<NEW_LINE>fis.close();<NEW_LINE>} catch (IOException e) {<NEW_LINE>LOG.info(e.getMessage());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (zipFile != null) {<NEW_LINE>options.setJobFileZip(zipFile.getPath());<NEW_LINE>}<NEW_LINE>}
add(fileToZip.getName());
1,079,369
private // -------------------//<NEW_LINE>List<LinkedSection> buildSectionGraph(List<Section> sections) {<NEW_LINE>StopWatch watch = new StopWatch("buildSectionGraph S#" + system.getId() + " size:" + sections.size());<NEW_LINE>watch.start("create list");<NEW_LINE>List<LinkedSection> list = new ArrayList<>();<NEW_LINE>for (Section section : sections) {<NEW_LINE>list.add(new LinkedSection(section));<NEW_LINE>}<NEW_LINE>watch.start("populate starts");<NEW_LINE>final int posCount = orientation.isVertical() ? sheet.getWidth() : sheet.getHeight();<NEW_LINE>final SectionTally<LinkedSection> tally = new SectionTally<>(posCount, list);<NEW_LINE>// Detect and record connections<NEW_LINE>watch.start("connections");<NEW_LINE>for (int i = 0, iBreak = list.size(); i < iBreak; i++) {<NEW_LINE>final LinkedSection source = list.get(i);<NEW_LINE>final Run predRun = source.getLastRun();<NEW_LINE>final int predStart = predRun.getStart();<NEW_LINE>final <MASK><NEW_LINE>final int nextPos = source.getFirstPos() + source.getRunCount();<NEW_LINE>for (LinkedSection target : tally.getSubList(nextPos)) {<NEW_LINE>final Run succRun = target.getFirstRun();<NEW_LINE>if (succRun.getStart() > predStop) {<NEW_LINE>// Since sublist is sorted on coord<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>if (succRun.getStop() >= predStart) {<NEW_LINE>// Record connection, both ways<NEW_LINE>source.addTarget(target);<NEW_LINE>target.addSource(source);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// /watch.print();<NEW_LINE>return list;<NEW_LINE>}
int predStop = predRun.getStop();
1,557,903
public void decode(ByteBuf buf, ProtocolUtils.Direction direction, ProtocolVersion version) {<NEW_LINE>String dimensionIdentifier = null;<NEW_LINE>String levelName = null;<NEW_LINE>if (version.compareTo(ProtocolVersion.MINECRAFT_1_16) >= 0) {<NEW_LINE>if (version.compareTo(ProtocolVersion.MINECRAFT_1_16_2) >= 0) {<NEW_LINE>CompoundBinaryTag dimDataTag = ProtocolUtils.readCompoundTag(buf, BinaryTagIO.reader());<NEW_LINE>dimensionIdentifier = ProtocolUtils.readString(buf);<NEW_LINE>this.currentDimensionData = DimensionData.decodeBaseCompoundTag(dimDataTag, version).annotateWith(dimensionIdentifier, null);<NEW_LINE>} else {<NEW_LINE>dimensionIdentifier = ProtocolUtils.readString(buf);<NEW_LINE>levelName = ProtocolUtils.readString(buf);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>this.dimension = buf.readInt();<NEW_LINE>}<NEW_LINE>if (version.compareTo(ProtocolVersion.MINECRAFT_1_13_2) <= 0) {<NEW_LINE>this.difficulty = buf.readUnsignedByte();<NEW_LINE>}<NEW_LINE>if (version.compareTo(ProtocolVersion.MINECRAFT_1_15) >= 0) {<NEW_LINE>this.partialHashedSeed = buf.readLong();<NEW_LINE>}<NEW_LINE>this.gamemode = buf.readByte();<NEW_LINE>if (version.compareTo(ProtocolVersion.MINECRAFT_1_16) >= 0) {<NEW_LINE>this.previousGamemode = buf.readByte();<NEW_LINE>boolean isDebug = buf.readBoolean();<NEW_LINE>boolean isFlat = buf.readBoolean();<NEW_LINE>this.dimensionInfo = new DimensionInfo(dimensionIdentifier, levelName, isFlat, isDebug);<NEW_LINE>this.shouldKeepPlayerData = buf.readBoolean();<NEW_LINE>} else {<NEW_LINE>this.levelType = <MASK><NEW_LINE>}<NEW_LINE>}
ProtocolUtils.readString(buf, 16);
1,843,550
protected void onCreate(Bundle savedInstanceState) {<NEW_LINE>super.onCreate(savedInstanceState);<NEW_LINE><MASK><NEW_LINE>setBackBtn();<NEW_LINE>setTitle("HeaderAndFooter Use");<NEW_LINE>mRecyclerView = findViewById(R.id.rv);<NEW_LINE>mRecyclerView.setLayoutManager(new LinearLayoutManager(this));<NEW_LINE>initAdapter();<NEW_LINE>View headerView = getHeaderView(0, new View.OnClickListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onClick(View v) {<NEW_LINE>adapter.addHeaderView(getHeaderView(1, getRemoveHeaderListener()), 0);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>adapter.addHeaderView(headerView);<NEW_LINE>View footerView = getFooterView(0, new View.OnClickListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onClick(View v) {<NEW_LINE>adapter.addFooterView(getFooterView(1, getRemoveFooterListener()), 0);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>adapter.addFooterView(footerView, 0);<NEW_LINE>mRecyclerView.setAdapter(adapter);<NEW_LINE>}
setContentView(R.layout.activity_universal_recycler);
980,715
private boolean overlaps(Coordinate p1, Coordinate p2, Coordinate q1, Coordinate q2, double overlapTolerance) {<NEW_LINE>double minq = Math.min(q1.x, q2.x);<NEW_LINE>double maxq = Math.max(q1.x, q2.x);<NEW_LINE>double minp = Math.min(p1.x, p2.x);<NEW_LINE>double maxp = Math.max(p1.x, p2.x);<NEW_LINE>if (minp > maxq + overlapTolerance)<NEW_LINE>return false;<NEW_LINE>if (maxp < minq - overlapTolerance)<NEW_LINE>return false;<NEW_LINE>minq = Math.min(q1.y, q2.y);<NEW_LINE>maxq = Math.max(q1.y, q2.y);<NEW_LINE>minp = Math.min(<MASK><NEW_LINE>maxp = Math.max(p1.y, p2.y);<NEW_LINE>if (minp > maxq + overlapTolerance)<NEW_LINE>return false;<NEW_LINE>if (maxp < minq - overlapTolerance)<NEW_LINE>return false;<NEW_LINE>return true;<NEW_LINE>}
p1.y, p2.y);
110,008
private UserDashboardItem createUserDashboardItem(final I_WEBUI_DashboardItem itemPO) {<NEW_LINE>final IModelTranslationMap trlsMap = InterfaceWrapperHelper.getModelTranslationMap(itemPO);<NEW_LINE>final KPIId kpiId = KPIId.ofRepoIdOrNull(itemPO.getWEBUI_KPI_ID());<NEW_LINE>final KPISupplier kpiSupplier = kpiId != null ? <MASK><NEW_LINE>return //<NEW_LINE>UserDashboardItem.builder().id(UserDashboardItemId.ofRepoId(itemPO.getWEBUI_DashboardItem_ID())).caption(trlsMap.getColumnTrl(I_WEBUI_DashboardItem.COLUMNNAME_Name, itemPO.getName())).url(itemPO.getURL()).seqNo(itemPO.getSeqNo()).widgetType(DashboardWidgetType.ofCode(itemPO.getWEBUI_DashboardWidgetType())).kpiSupplier(kpiSupplier).timeRangeDefaults(//<NEW_LINE>KPITimeRangeDefaults.builder().defaultTimeRange(parseDuration(itemPO.getES_TimeRange()).orElse(null)).defaultTimeRangeEndOffset(parseDuration(itemPO.getES_TimeRange_End()).orElse(null)).build()).build();<NEW_LINE>}
kpisRepo.getKPISupplier(kpiId) : null;
1,459,240
private void readDep(IndexedWord gov, String reln) {<NEW_LINE>readWhiteSpace();<NEW_LINE>if (!isLeftBracket(peek())) {<NEW_LINE>// it's a leaf<NEW_LINE>String label = readName();<NEW_LINE>IndexedWord dep = makeVertex(label);<NEW_LINE>sg.addVertex(dep);<NEW_LINE>if (gov == null)<NEW_LINE>sg.roots.add(dep);<NEW_LINE>sg.addEdge(gov, dep, GrammaticalRelation.valueOf(this.language, reln), Double.NEGATIVE_INFINITY, false);<NEW_LINE>} else {<NEW_LINE>readLeftBracket();<NEW_LINE>String label = readName();<NEW_LINE>IndexedWord dep = makeVertex(label);<NEW_LINE>sg.addVertex(dep);<NEW_LINE>if (gov == null)<NEW_LINE><MASK><NEW_LINE>if (gov != null && reln != null) {<NEW_LINE>sg.addEdge(gov, dep, GrammaticalRelation.valueOf(this.language, reln), Double.NEGATIVE_INFINITY, false);<NEW_LINE>}<NEW_LINE>readWhiteSpace();<NEW_LINE>while (!isRightBracket(peek()) && !isEOF) {<NEW_LINE>reln = readName();<NEW_LINE>readRelnSeparator();<NEW_LINE>readDep(dep, reln);<NEW_LINE>readWhiteSpace();<NEW_LINE>}<NEW_LINE>readRightBracket();<NEW_LINE>}<NEW_LINE>}
sg.roots.add(dep);
1,189,383
// Task: parser string with text and show all indexes of all words<NEW_LINE>public static void main(String[] args) {<NEW_LINE>String INPUT_TEXT = "Hello World! Hello All! Hi World!";<NEW_LINE>// Parse text to words and index<NEW_LINE>List<String> words = Arrays.asList(INPUT_TEXT.split(" "));<NEW_LINE>// Create Multimap<NEW_LINE>MultiMap<String, Integer> multiMap = MultiValueMap.multiValueMap(new LinkedHashMap<String, Set>(), LinkedHashSet.class);<NEW_LINE>// Fill Multimap<NEW_LINE>int i = 0;<NEW_LINE>for (String word : words) {<NEW_LINE>multiMap.put(word, i);<NEW_LINE>i++;<NEW_LINE>}<NEW_LINE>// Print all words<NEW_LINE>// print {Hello=[0, 2], World!=[1, 5], All!=[3], Hi=[4]} - in predictable iteration order<NEW_LINE><MASK><NEW_LINE>// Print all unique words<NEW_LINE>// print [Hello, World!, All!, Hi] - in predictable iteration order<NEW_LINE>System.out.println(multiMap.keySet());<NEW_LINE>// Print all indexes<NEW_LINE>// print [0, 2]<NEW_LINE>System.out.println("Hello = " + multiMap.get("Hello"));<NEW_LINE>// print [1, 5]<NEW_LINE>System.out.println("World = " + multiMap.get("World!"));<NEW_LINE>// print [3]<NEW_LINE>System.out.println("All = " + multiMap.get("All!"));<NEW_LINE>// print [4]<NEW_LINE>System.out.println("Hi = " + multiMap.get("Hi"));<NEW_LINE>// print null<NEW_LINE>System.out.println("Empty = " + multiMap.get("Empty"));<NEW_LINE>// Print count unique words<NEW_LINE>// print 4<NEW_LINE>System.out.println(multiMap.keySet().size());<NEW_LINE>}
System.out.println(multiMap);
1,814,468
// endregion DirectBuffers<NEW_LINE>// region Register/Unregister natives<NEW_LINE>@JniImpl<NEW_LINE>@TruffleBoundary<NEW_LINE>public int RegisterNative(@JavaType(Class.class) StaticObject clazz, @Pointer TruffleObject methodNamePtr, @Pointer TruffleObject methodSignaturePtr, @Pointer TruffleObject closure) {<NEW_LINE>String methodName = NativeUtils.interopPointerToString(methodNamePtr);<NEW_LINE>String methodSignature = NativeUtils.interopPointerToString(methodSignaturePtr);<NEW_LINE>assert methodName != null && methodSignature != null;<NEW_LINE>Symbol<Name> name = getNames().lookup(methodName);<NEW_LINE>Symbol<Signature> signature = getSignatures().lookupValidSignature(methodSignature);<NEW_LINE>Meta meta = getMeta();<NEW_LINE>if (name == null || signature == null) {<NEW_LINE>setPendingException(Meta.initException(meta.java_lang_NoSuchMethodError));<NEW_LINE>return JNI_ERR;<NEW_LINE>}<NEW_LINE>Method targetMethod = clazz.getMirrorKlass(<MASK><NEW_LINE>if (targetMethod != null && targetMethod.isNative()) {<NEW_LINE>targetMethod.unregisterNative();<NEW_LINE>getSubstitutions().removeRuntimeSubstitution(targetMethod);<NEW_LINE>} else {<NEW_LINE>setPendingException(Meta.initException(meta.java_lang_NoSuchMethodError));<NEW_LINE>return JNI_ERR;<NEW_LINE>}<NEW_LINE>Substitutions.EspressoRootNodeFactory factory = null;<NEW_LINE>// Lookup known VM methods to shortcut native boudaries.<NEW_LINE>factory = lookupKnownVmMethods(closure, targetMethod);<NEW_LINE>if (factory == null) {<NEW_LINE>NativeSignature ns = Method.buildJniNativeSignature(targetMethod.getParsedSignature());<NEW_LINE>final TruffleObject boundNative = getNativeAccess().bindSymbol(closure, ns);<NEW_LINE>factory = createJniRootNodeFactory(() -> new NativeMethodNode(boundNative, targetMethod.getMethodVersion()), targetMethod);<NEW_LINE>}<NEW_LINE>Symbol<Type> classType = clazz.getMirrorKlass().getType();<NEW_LINE>getSubstitutions().registerRuntimeSubstitution(classType, name, signature, factory, true);<NEW_LINE>return JNI_OK;<NEW_LINE>}
).lookupDeclaredMethod(name, signature);
928,468
protected void doStart() {<NEW_LINE>synchronized (mutex) {<NEW_LINE>CoordinationState.PersistedState persistedState = persistedStateSupplier.get();<NEW_LINE>coordinationState.set(new CoordinationState(getLocalNode(), persistedState, electionStrategy));<NEW_LINE>peerFinder.setCurrentTerm(getCurrentTerm());<NEW_LINE>configuredHostsResolver.start();<NEW_LINE>final ClusterState lastAcceptedState = coordinationState.get().getLastAcceptedState();<NEW_LINE>if (lastAcceptedState.metadata().clusterUUIDCommitted()) {<NEW_LINE>logger.info("cluster UUID [{}]", lastAcceptedState.metadata().clusterUUID());<NEW_LINE>}<NEW_LINE>final VotingConfiguration votingConfiguration = lastAcceptedState.getLastCommittedConfiguration();<NEW_LINE>if (singleNodeDiscovery && votingConfiguration.isEmpty() == false && votingConfiguration.hasQuorum(Collections.singleton(getLocalNode().getId())) == false) {<NEW_LINE>throw new IllegalStateException("cannot start with [" + DiscoveryModule.DISCOVERY_TYPE_SETTING.getKey() + "] set to [" + DiscoveryModule.SINGLE_NODE_DISCOVERY_TYPE + "] when local node " + getLocalNode() + " does not have quorum in voting configuration " + votingConfiguration);<NEW_LINE>}<NEW_LINE>ClusterState initialState = ClusterState.builder(ClusterName.CLUSTER_NAME_SETTING.get(settings)).blocks(ClusterBlocks.builder().addGlobalBlock(STATE_NOT_RECOVERED_BLOCK).addGlobalBlock(noMasterBlockService.getNoMasterBlock())).nodes(DiscoveryNodes.builder().add(getLocalNode()).localNodeId(getLocalNode().getId<MASK><NEW_LINE>applierState = initialState;<NEW_LINE>clusterApplier.setInitialState(initialState);<NEW_LINE>}<NEW_LINE>}
())).build();
890,910
public Pair<INDArray, MaskState> feedForwardMaskArray(INDArray maskArray, MaskState currentMaskState, int minibatchSize) {<NEW_LINE>// Assume mask array is 2d for time series (1 value per time step)<NEW_LINE>if (maskArray == null) {<NEW_LINE>return new Pair<>(maskArray, currentMaskState);<NEW_LINE>} else if (maskArray.rank() == 2) {<NEW_LINE>// Need to reshape mask array from [minibatch,timeSeriesLength] to 4d minibatch format: [minibatch*timeSeriesLength, 1, 1, 1]<NEW_LINE>return new Pair<>(TimeSeriesUtils.reshapeTimeSeriesMaskToCnn4dMask(maskArray, LayerWorkspaceMgr.noWorkspacesImmutable(), ArrayType.INPUT), currentMaskState);<NEW_LINE>} else {<NEW_LINE>throw new IllegalArgumentException("Received mask array of rank " + maskArray.rank() + "; expected rank 2 mask array. Mask array shape: " + Arrays.toString<MASK><NEW_LINE>}<NEW_LINE>}
(maskArray.shape()));
433,883
protected void initScene() {<NEW_LINE>PointLight light1 = new PointLight();<NEW_LINE>light1.setPower(1.5f);<NEW_LINE>PointLight light2 = new PointLight();<NEW_LINE>light2.setPower(1.5f);<NEW_LINE>getCurrentScene().addLight(light1);<NEW_LINE>getCurrentScene().addLight(light2);<NEW_LINE>getCurrentCamera().<MASK><NEW_LINE>getCurrentCamera().setLookAt(0, 0, 0);<NEW_LINE>try {<NEW_LINE>final LoaderAWD parser = new LoaderAWD(mContext.getResources(), mTextureManager, R.raw.awd_suzanne);<NEW_LINE>parser.parse();<NEW_LINE>Object3D suzanne = parser.getParsedObject();<NEW_LINE>Material material = new Material();<NEW_LINE>material.setDiffuseMethod(new DiffuseMethod.Lambert());<NEW_LINE>material.setColor(0xff990000);<NEW_LINE>material.enableLighting(true);<NEW_LINE>suzanne.setMaterial(material);<NEW_LINE>getCurrentScene().addChild(suzanne);<NEW_LINE>} catch (Exception e) {<NEW_LINE>e.printStackTrace();<NEW_LINE>}<NEW_LINE>Animation3D anim = new TranslateAnimation3D(new Vector3(-10, -10, 5), new Vector3(-10, 10, 5));<NEW_LINE>anim.setDurationMilliseconds(4000);<NEW_LINE>anim.setRepeatMode(Animation.RepeatMode.REVERSE_INFINITE);<NEW_LINE>anim.setTransformable3D(light1);<NEW_LINE>getCurrentScene().registerAnimation(anim);<NEW_LINE>anim.play();<NEW_LINE>anim = new TranslateAnimation3D(new Vector3(10, 10, 5), new Vector3(10, -10, 5));<NEW_LINE>anim.setDurationMilliseconds(2000);<NEW_LINE>anim.setRepeatMode(Animation.RepeatMode.REVERSE_INFINITE);<NEW_LINE>anim.setTransformable3D(light2);<NEW_LINE>getCurrentScene().registerAnimation(anim);<NEW_LINE>anim.play();<NEW_LINE>}
setPosition(0, 2, 4);
1,403,732
public static FileSystemManager generateVfs() throws FileSystemException {<NEW_LINE>DefaultFileSystemManager vfs = new DefaultFileSystemManager();<NEW_LINE>vfs.addProvider("res", new org.apache.commons.vfs2.provider.res.ResourceFileProvider());<NEW_LINE>vfs.addProvider("zip", new org.apache.commons.vfs2.provider.zip.ZipFileProvider());<NEW_LINE>vfs.addProvider("gz", new org.apache.commons.vfs2.provider.gzip.GzipFileProvider());<NEW_LINE>vfs.addProvider("ram", new org.apache.commons.vfs2.provider.ram.RamFileProvider());<NEW_LINE>vfs.addProvider("file", new org.apache.commons.vfs2.provider.local.DefaultLocalFileProvider());<NEW_LINE>vfs.addProvider("jar", new org.apache.commons.vfs2.provider.jar.JarFileProvider());<NEW_LINE>vfs.addProvider("http", new org.apache.commons.vfs2.provider.http.HttpFileProvider());<NEW_LINE>vfs.addProvider("https", new org.apache.commons.vfs2.provider.https.HttpsFileProvider());<NEW_LINE>vfs.addProvider("ftp", new org.apache.commons.vfs2.<MASK><NEW_LINE>vfs.addProvider("ftps", new org.apache.commons.vfs2.provider.ftps.FtpsFileProvider());<NEW_LINE>vfs.addProvider("war", new org.apache.commons.vfs2.provider.jar.JarFileProvider());<NEW_LINE>vfs.addProvider("par", new org.apache.commons.vfs2.provider.jar.JarFileProvider());<NEW_LINE>vfs.addProvider("ear", new org.apache.commons.vfs2.provider.jar.JarFileProvider());<NEW_LINE>vfs.addProvider("sar", new org.apache.commons.vfs2.provider.jar.JarFileProvider());<NEW_LINE>vfs.addProvider("ejb3", new org.apache.commons.vfs2.provider.jar.JarFileProvider());<NEW_LINE>vfs.addProvider("tmp", new org.apache.commons.vfs2.provider.temp.TemporaryFileProvider());<NEW_LINE>vfs.addProvider("tar", new org.apache.commons.vfs2.provider.tar.TarFileProvider());<NEW_LINE>vfs.addProvider("tbz2", new org.apache.commons.vfs2.provider.tar.TarFileProvider());<NEW_LINE>vfs.addProvider("tgz", new org.apache.commons.vfs2.provider.tar.TarFileProvider());<NEW_LINE>vfs.addProvider("bz2", new org.apache.commons.vfs2.provider.bzip2.Bzip2FileProvider());<NEW_LINE>vfs.addProvider("hdfs", new HdfsFileProvider());<NEW_LINE>vfs.addExtensionMap("jar", "jar");<NEW_LINE>vfs.addExtensionMap("zip", "zip");<NEW_LINE>vfs.addExtensionMap("gz", "gz");<NEW_LINE>vfs.addExtensionMap("tar", "tar");<NEW_LINE>vfs.addExtensionMap("tbz2", "tar");<NEW_LINE>vfs.addExtensionMap("tgz", "tar");<NEW_LINE>vfs.addExtensionMap("bz2", "bz2");<NEW_LINE>vfs.addMimeTypeMap("application/x-tar", "tar");<NEW_LINE>vfs.addMimeTypeMap("application/x-gzip", "gz");<NEW_LINE>vfs.addMimeTypeMap("application/zip", "zip");<NEW_LINE>vfs.setFileContentInfoFactory(new FileContentInfoFilenameFactory());<NEW_LINE>vfs.setFilesCache(new SoftRefFilesCache());<NEW_LINE>File cacheDir = computeTopCacheDir();<NEW_LINE>vfs.setReplicator(new UniqueFileReplicator(cacheDir));<NEW_LINE>vfs.setCacheStrategy(CacheStrategy.ON_RESOLVE);<NEW_LINE>vfs.init();<NEW_LINE>vfsInstances.add(new WeakReference<>(vfs));<NEW_LINE>return vfs;<NEW_LINE>}
provider.ftp.FtpFileProvider());
376,924
public void visitPhpTernaryExpression(@NotNull TernaryExpression expression) {<NEW_LINE>final <MASK><NEW_LINE>if (rawCondition != null) {<NEW_LINE>final PsiElement condition = ExpressionSemanticUtil.getExpressionTroughParenthesis(rawCondition);<NEW_LINE>if (condition instanceof BinaryExpression) {<NEW_LINE>final PsiElement trueVariant = ExpressionSemanticUtil.getExpressionTroughParenthesis(expression.getTrueVariant());<NEW_LINE>if (trueVariant != null) {<NEW_LINE>final PsiElement falseVariant = ExpressionSemanticUtil.getExpressionTroughParenthesis(expression.getFalseVariant());<NEW_LINE>if (falseVariant != null) {<NEW_LINE>final boolean isTarget = PhpLanguageUtil.isBoolean(trueVariant) && PhpLanguageUtil.isBoolean(falseVariant);<NEW_LINE>if (isTarget) {<NEW_LINE>final String replacement = this.generateReplacement((BinaryExpression) condition, trueVariant);<NEW_LINE>if (replacement != null) {<NEW_LINE>holder.registerProblem(expression, MessagesPresentationUtil.prefixWithEa(String.format(messagePattern, replacement)), new SimplifyFix(replacement));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
PsiElement rawCondition = expression.getCondition();
613,834
final UpdateAnalysisResult executeUpdateAnalysis(UpdateAnalysisRequest updateAnalysisRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(updateAnalysisRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<UpdateAnalysisRequest> request = null;<NEW_LINE>Response<UpdateAnalysisResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new UpdateAnalysisRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(updateAnalysisRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "QuickSight");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "UpdateAnalysis");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<UpdateAnalysisResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new UpdateAnalysisResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);
558,645
static NettyServerHandler newHandler(ChannelPromise channelUnused, Http2FrameReader frameReader, Http2FrameWriter frameWriter, ServerTransportListener transportListener, List<? extends ServerStreamTracer.Factory> streamTracerFactories, TransportTracer transportTracer, int maxStreams, boolean autoFlowControl, int flowControlWindow, int maxHeaderListSize, int maxMessageSize, long keepAliveTimeInNanos, long keepAliveTimeoutInNanos, long maxConnectionIdleInNanos, long maxConnectionAgeInNanos, long maxConnectionAgeGraceInNanos, boolean permitKeepAliveWithoutCalls, long permitKeepAliveTimeInNanos, Attributes eagAttributes) {<NEW_LINE>Preconditions.checkArgument(maxStreams > 0, "maxStreams must be positive: %s", maxStreams);<NEW_LINE>Preconditions.checkArgument(flowControlWindow > 0, "flowControlWindow must be positive: %s", flowControlWindow);<NEW_LINE>Preconditions.checkArgument(maxHeaderListSize > 0, "maxHeaderListSize must be positive: %s", maxHeaderListSize);<NEW_LINE>Preconditions.checkArgument(maxMessageSize > 0, "maxMessageSize must be positive: %s", maxMessageSize);<NEW_LINE>final <MASK><NEW_LINE>WeightedFairQueueByteDistributor dist = new WeightedFairQueueByteDistributor(connection);<NEW_LINE>// Make benchmarks fast again.<NEW_LINE>dist.allocationQuantum(16 * 1024);<NEW_LINE>DefaultHttp2RemoteFlowController controller = new DefaultHttp2RemoteFlowController(connection, dist);<NEW_LINE>connection.remote().flowController(controller);<NEW_LINE>final KeepAliveEnforcer keepAliveEnforcer = new KeepAliveEnforcer(permitKeepAliveWithoutCalls, permitKeepAliveTimeInNanos, TimeUnit.NANOSECONDS);<NEW_LINE>// Create the local flow controller configured to auto-refill the connection window.<NEW_LINE>connection.local().flowController(new DefaultHttp2LocalFlowController(connection, DEFAULT_WINDOW_UPDATE_RATIO, true));<NEW_LINE>frameWriter = new WriteMonitoringFrameWriter(frameWriter, keepAliveEnforcer);<NEW_LINE>Http2ConnectionEncoder encoder = new DefaultHttp2ConnectionEncoder(connection, frameWriter);<NEW_LINE>encoder = new Http2ControlFrameLimitEncoder(encoder, 10000);<NEW_LINE>Http2ConnectionDecoder decoder = new DefaultHttp2ConnectionDecoder(connection, encoder, frameReader);<NEW_LINE>Http2Settings settings = new Http2Settings();<NEW_LINE>settings.initialWindowSize(flowControlWindow);<NEW_LINE>settings.maxConcurrentStreams(maxStreams);<NEW_LINE>settings.maxHeaderListSize(maxHeaderListSize);<NEW_LINE>return new NettyServerHandler(channelUnused, connection, transportListener, streamTracerFactories, transportTracer, decoder, encoder, settings, maxMessageSize, keepAliveTimeInNanos, keepAliveTimeoutInNanos, maxConnectionIdleInNanos, maxConnectionAgeInNanos, maxConnectionAgeGraceInNanos, keepAliveEnforcer, autoFlowControl, eagAttributes);<NEW_LINE>}
Http2Connection connection = new DefaultHttp2Connection(true);