idx
int32
46
1.86M
input
stringlengths
321
6.6k
target
stringlengths
9
1.24k
739,592
public ObjectNode detail(HttpServletRequest request) throws Exception {<NEW_LINE>String namespaceId = WebUtils.optional(request, CommonParams.NAMESPACE_ID, Constants.DEFAULT_NAMESPACE_ID);<NEW_LINE>String serviceName = WebUtils.required(request, CommonParams.SERVICE_NAME);<NEW_LINE>NamingUtils.checkServiceNameFormat(serviceName);<NEW_LINE>String cluster = WebUtils.optional(request, CommonParams.CLUSTER_NAME, UtilsAndCommons.DEFAULT_CLUSTER_NAME);<NEW_LINE>String ip = <MASK><NEW_LINE>int port = Integer.parseInt(WebUtils.required(request, "port"));<NEW_LINE>com.alibaba.nacos.api.naming.pojo.Instance instance = getInstanceOperator().getInstance(namespaceId, serviceName, cluster, ip, port);<NEW_LINE>ObjectNode result = JacksonUtils.createEmptyJsonNode();<NEW_LINE>result.put("service", serviceName);<NEW_LINE>result.put("ip", ip);<NEW_LINE>result.put("port", port);<NEW_LINE>result.put("clusterName", cluster);<NEW_LINE>result.put("weight", instance.getWeight());<NEW_LINE>result.put("healthy", instance.isHealthy());<NEW_LINE>result.put("instanceId", instance.getInstanceId());<NEW_LINE>result.set(METADATA, JacksonUtils.transferToJsonNode(instance.getMetadata()));<NEW_LINE>return result;<NEW_LINE>}
WebUtils.required(request, "ip");
1,692,318
public void write(org.apache.thrift.protocol.TProtocol oprot, InstanceRequest struct) throws org.apache.thrift.TException {<NEW_LINE>struct.validate();<NEW_LINE>oprot.writeStructBegin(STRUCT_DESC);<NEW_LINE>oprot.writeFieldBegin(REQUEST_ID_FIELD_DESC);<NEW_LINE>oprot.writeI64(struct.requestId);<NEW_LINE>oprot.writeFieldEnd();<NEW_LINE>if (struct.query != null) {<NEW_LINE>oprot.writeFieldBegin(QUERY_FIELD_DESC);<NEW_LINE><MASK><NEW_LINE>oprot.writeFieldEnd();<NEW_LINE>}<NEW_LINE>if (struct.searchSegments != null) {<NEW_LINE>if (struct.isSetSearchSegments()) {<NEW_LINE>oprot.writeFieldBegin(SEARCH_SEGMENTS_FIELD_DESC);<NEW_LINE>{<NEW_LINE>oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, struct.searchSegments.size()));<NEW_LINE>for (java.lang.String _iter141 : struct.searchSegments) {<NEW_LINE>oprot.writeString(_iter141);<NEW_LINE>}<NEW_LINE>oprot.writeListEnd();<NEW_LINE>}<NEW_LINE>oprot.writeFieldEnd();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (struct.isSetEnableTrace()) {<NEW_LINE>oprot.writeFieldBegin(ENABLE_TRACE_FIELD_DESC);<NEW_LINE>oprot.writeBool(struct.enableTrace);<NEW_LINE>oprot.writeFieldEnd();<NEW_LINE>}<NEW_LINE>if (struct.brokerId != null) {<NEW_LINE>if (struct.isSetBrokerId()) {<NEW_LINE>oprot.writeFieldBegin(BROKER_ID_FIELD_DESC);<NEW_LINE>oprot.writeString(struct.brokerId);<NEW_LINE>oprot.writeFieldEnd();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>oprot.writeFieldStop();<NEW_LINE>oprot.writeStructEnd();<NEW_LINE>}
struct.query.write(oprot);
591,450
public void validateQuery(String theQuery, String theFieldName) {<NEW_LINE>if (isBlank(theQuery)) {<NEW_LINE>throw new UnprocessableEntityException(Msg.code<MASK><NEW_LINE>}<NEW_LINE>SubscriptionCriteriaParser.SubscriptionCriteria parsedCriteria = SubscriptionCriteriaParser.parse(theQuery);<NEW_LINE>if (parsedCriteria == null) {<NEW_LINE>throw new UnprocessableEntityException(Msg.code(12) + theFieldName + " can not be parsed");<NEW_LINE>}<NEW_LINE>if (parsedCriteria.getType() == SubscriptionCriteriaParser.TypeEnum.STARTYPE_EXPRESSION) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>for (String next : parsedCriteria.getApplicableResourceTypes()) {<NEW_LINE>if (!myDaoRegistry.isResourceTypeSupported(next)) {<NEW_LINE>throw new UnprocessableEntityException(Msg.code(13) + theFieldName + " contains invalid/unsupported resource type: " + next);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (parsedCriteria.getType() != SubscriptionCriteriaParser.TypeEnum.SEARCH_EXPRESSION) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>int sep = theQuery.indexOf('?');<NEW_LINE>if (sep <= 1) {<NEW_LINE>throw new UnprocessableEntityException(Msg.code(14) + theFieldName + " must be in the form \"{Resource Type}?[params]\"");<NEW_LINE>}<NEW_LINE>String resType = theQuery.substring(0, sep);<NEW_LINE>if (resType.contains("/")) {<NEW_LINE>throw new UnprocessableEntityException(Msg.code(15) + theFieldName + " must be in the form \"{Resource Type}?[params]\"");<NEW_LINE>}<NEW_LINE>}
(11) + theFieldName + " must be populated");
1,131,250
public List<CardSet> loadCardSets(final Session session) {<NEW_LINE>synchronized (options.cardSetIds) {<NEW_LINE>try {<NEW_LINE>final List<CardSet> cardSets = new ArrayList<>();<NEW_LINE>if (!options.getPyxCardSetIds().isEmpty()) {<NEW_LINE>@SuppressWarnings("unchecked")<NEW_LINE>final List<CardSet> pyxCardSets = session.createQuery("from PyxCardSet where id in (:ids)").setParameterList("ids", options.<MASK><NEW_LINE>cardSets.addAll(pyxCardSets);<NEW_LINE>}<NEW_LINE>// Not injecting the service itself because we might need to assisted inject it later<NEW_LINE>// with card id stuff.<NEW_LINE>// also TODO maybe make card ids longs instead of ints<NEW_LINE>final CardcastService service = cardcastServiceProvider.get();<NEW_LINE>// Avoid ConcurrentModificationException<NEW_LINE>for (final String cardcastId : cardcastDeckIds.toArray(new String[0])) {<NEW_LINE>// Ideally, we can assume that anything in that set is going to load, but it is entirely<NEW_LINE>// possible that the cache has expired and we can't re-load it for some reason, so<NEW_LINE>// let's be safe.<NEW_LINE>final CardcastDeck cardcastDeck = service.loadSet(cardcastId);<NEW_LINE>if (null == cardcastDeck) {<NEW_LINE>// TODO better way to indicate this to the user<NEW_LINE>logger.error(String.format("Unable to load %s from Cardcast", cardcastId));<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>cardSets.add(cardcastDeck);<NEW_LINE>}<NEW_LINE>return cardSets;<NEW_LINE>} catch (final Exception e) {<NEW_LINE>logger.error(String.format("Unable to load cards for game %d", id), e);<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
getPyxCardSetIds()).list();
895,718
public void renderButton(@Nonnull PoseStack ms, int mouseX, int mouseY, float partialTicks) {<NEW_LINE>ms.pushPose();<NEW_LINE>ms.translate(x + paddingX, y + paddingY, z);<NEW_LINE>float innerWidth = width - 2 * paddingX;<NEW_LINE>float innerHeight = height - 2 * paddingY;<NEW_LINE>float eX = element.getX(), eY = element.getY();<NEW_LINE>if (rescaleElement) {<NEW_LINE>float xScale = innerWidth / rescaleSizeX;<NEW_LINE>float yScale = innerHeight / rescaleSizeY;<NEW_LINE>ms.<MASK><NEW_LINE>element.at(eX / xScale, eY / yScale);<NEW_LINE>innerWidth /= xScale;<NEW_LINE>innerHeight /= yScale;<NEW_LINE>}<NEW_LINE>element.withBounds((int) innerWidth, (int) innerHeight).render(ms);<NEW_LINE>ms.popPose();<NEW_LINE>if (rescaleElement) {<NEW_LINE>element.at(eX, eY);<NEW_LINE>}<NEW_LINE>}
scale(xScale, yScale, 1);
1,541,582
static void tryVirtualLock() {<NEW_LINE>JNAKernel32Library kernel = JNAKernel32Library.getInstance();<NEW_LINE>Pointer process = null;<NEW_LINE>try {<NEW_LINE>process = kernel.GetCurrentProcess();<NEW_LINE>// By default, Windows limits the number of pages that can be locked.<NEW_LINE>// Thus, we need to first increase the working set size of the JVM by<NEW_LINE>// the amount of memory we wish to lock, plus a small overhead (1MB).<NEW_LINE>SizeT size = new SizeT(JvmInfo.jvmInfo().getMem().getHeapInit().getBytes() + (1024 * 1024));<NEW_LINE>if (!kernel.SetProcessWorkingSetSize(process, size, size)) {<NEW_LINE>LOGGER.warn(<MASK><NEW_LINE>} else {<NEW_LINE>JNAKernel32Library.MemoryBasicInformation memInfo = new JNAKernel32Library.MemoryBasicInformation();<NEW_LINE>long address = 0;<NEW_LINE>while (kernel.VirtualQueryEx(process, new Pointer(address), memInfo, memInfo.size()) != 0) {<NEW_LINE>boolean lockable = memInfo.State.longValue() == JNAKernel32Library.MEM_COMMIT && (memInfo.Protect.longValue() & JNAKernel32Library.PAGE_NOACCESS) != JNAKernel32Library.PAGE_NOACCESS && (memInfo.Protect.longValue() & JNAKernel32Library.PAGE_GUARD) != JNAKernel32Library.PAGE_GUARD;<NEW_LINE>if (lockable) {<NEW_LINE>kernel.VirtualLock(memInfo.BaseAddress, new SizeT(memInfo.RegionSize.longValue()));<NEW_LINE>}<NEW_LINE>// Move to the next region<NEW_LINE>address += memInfo.RegionSize.longValue();<NEW_LINE>}<NEW_LINE>LOCAL_MLOCKALL = true;<NEW_LINE>}<NEW_LINE>} catch (UnsatisfiedLinkError e) {<NEW_LINE>// this will have already been logged by Kernel32Library, no need to repeat it<NEW_LINE>} finally {<NEW_LINE>if (process != null) {<NEW_LINE>kernel.CloseHandle(process);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
"Unable to lock JVM memory. Failed to set working set size. Error code {}", Native.getLastError());
895,057
public static BatchGetDeviceBindStatusResponse unmarshall(BatchGetDeviceBindStatusResponse batchGetDeviceBindStatusResponse, UnmarshallerContext _ctx) {<NEW_LINE>batchGetDeviceBindStatusResponse.setRequestId(_ctx.stringValue("BatchGetDeviceBindStatusResponse.RequestId"));<NEW_LINE>batchGetDeviceBindStatusResponse.setSuccess(_ctx.booleanValue("BatchGetDeviceBindStatusResponse.Success"));<NEW_LINE>batchGetDeviceBindStatusResponse.setCode(_ctx.stringValue("BatchGetDeviceBindStatusResponse.Code"));<NEW_LINE>batchGetDeviceBindStatusResponse.setErrorMessage(_ctx.stringValue("BatchGetDeviceBindStatusResponse.ErrorMessage"));<NEW_LINE>List<DeviceStatus> data = new ArrayList<DeviceStatus>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("BatchGetDeviceBindStatusResponse.Data.Length"); i++) {<NEW_LINE>DeviceStatus deviceStatus = new DeviceStatus();<NEW_LINE>deviceStatus.setIotId(_ctx.stringValue<MASK><NEW_LINE>deviceStatus.setBindStatus(_ctx.integerValue("BatchGetDeviceBindStatusResponse.Data[" + i + "].BindStatus"));<NEW_LINE>data.add(deviceStatus);<NEW_LINE>}<NEW_LINE>batchGetDeviceBindStatusResponse.setData(data);<NEW_LINE>return batchGetDeviceBindStatusResponse;<NEW_LINE>}
("BatchGetDeviceBindStatusResponse.Data[" + i + "].IotId"));
747,974
private boolean detectKeepAlive(Buf buf, RapidoidHelper helper, Bytes bytes, BufRange protocol, BufRanges headers) {<NEW_LINE>IntWrap result = helper.integers[0];<NEW_LINE>// e.g. HTTP/1.1<NEW_LINE>boolean keepAliveByDefault = protocol.isEmpty() || bytes.get(protocol.last()) != '0';<NEW_LINE>// try to detect the opposite of the default<NEW_LINE>if (keepAliveByDefault) {<NEW_LINE>// clo[se]<NEW_LINE>buf.scanLnLn(headers.reset(), result, (byte<MASK><NEW_LINE>} else {<NEW_LINE>// keep-ali[ve]<NEW_LINE>buf.scanLnLn(headers.reset(), result, (byte) 'v', (byte) 'e');<NEW_LINE>}<NEW_LINE>int possibleConnHeaderPos = result.value;<NEW_LINE>// no evidence of the opposite<NEW_LINE>if (possibleConnHeaderPos < 0)<NEW_LINE>return keepAliveByDefault;<NEW_LINE>BufRange possibleConnHdr = headers.get(possibleConnHeaderPos);<NEW_LINE>if (BytesUtil.startsWith(bytes, possibleConnHdr, CONNECTION, true)) {<NEW_LINE>// detected the opposite of the default<NEW_LINE>return !keepAliveByDefault;<NEW_LINE>}<NEW_LINE>return isKeepAlive(bytes, headers, helper, keepAliveByDefault);<NEW_LINE>}
) 's', (byte) 'e');
1,784,965
public void onClick(View arg0) {<NEW_LINE>ParticleSystem ps = new ParticleSystem(this, 100, R.drawable.star_pink, 800);<NEW_LINE>ps.setScaleRange(0.7f, 1.3f);<NEW_LINE>ps.setSpeedRange(0.1f, 0.25f);<NEW_LINE>ps.setRotationSpeedRange(90, 180);<NEW_LINE>ps.setFadeOut<MASK><NEW_LINE>ps.oneShot(arg0, 70);<NEW_LINE>ParticleSystem ps2 = new ParticleSystem(this, 100, R.drawable.star_white, 800);<NEW_LINE>ps2.setScaleRange(0.7f, 1.3f);<NEW_LINE>ps2.setSpeedRange(0.1f, 0.25f);<NEW_LINE>ps.setRotationSpeedRange(90, 180);<NEW_LINE>ps2.setFadeOut(200, new AccelerateInterpolator());<NEW_LINE>ps2.oneShot(arg0, 70);<NEW_LINE>}
(200, new AccelerateInterpolator());
1,575,536
public static StringBuilder append(StringBuilder sb, Pod.Value v) {<NEW_LINE>switch(v.getValCase()) {<NEW_LINE>case VAL_NOT_SET:<NEW_LINE>return sb.append("[null]");<NEW_LINE>case STRING:<NEW_LINE>return sb.append(v.getString());<NEW_LINE>case BOOL:<NEW_LINE>return sb.append(v.getBool());<NEW_LINE>case FLOAT64:<NEW_LINE>return sb.append(v.getFloat64());<NEW_LINE>case FLOAT32:<NEW_LINE>return sb.append(v.getFloat32());<NEW_LINE>case SINT:<NEW_LINE>return sb.append(v.getSint());<NEW_LINE>case SINT8:<NEW_LINE>return sb.append(v.getSint8());<NEW_LINE>case SINT16:<NEW_LINE>return sb.append(v.getSint16());<NEW_LINE>case SINT32:<NEW_LINE>return sb.<MASK><NEW_LINE>case SINT64:<NEW_LINE>return sb.append(v.getSint64());<NEW_LINE>case UINT:<NEW_LINE>return sb.append(v.getUint());<NEW_LINE>case UINT8:<NEW_LINE>return sb.append(v.getUint8());<NEW_LINE>case UINT16:<NEW_LINE>return sb.append(v.getUint16());<NEW_LINE>case UINT32:<NEW_LINE>return sb.append(v.getUint32());<NEW_LINE>case UINT64:<NEW_LINE>return sb.append(v.getUint64());<NEW_LINE>case STRING_ARRAY:<NEW_LINE>return sb.append(v.getStringArray().getValList());<NEW_LINE>case BOOL_ARRAY:<NEW_LINE>return sb.append(v.getBoolArray().getValList());<NEW_LINE>case FLOAT64_ARRAY:<NEW_LINE>return sb.append(v.getFloat64Array().getValList());<NEW_LINE>case FLOAT32_ARRAY:<NEW_LINE>return sb.append(v.getFloat32Array().getValList());<NEW_LINE>case SINT_ARRAY:<NEW_LINE>return sb.append(v.getSintArray().getValList());<NEW_LINE>case SINT8_ARRAY:<NEW_LINE>return sb.append(v.getSint8Array().getValList());<NEW_LINE>case SINT16_ARRAY:<NEW_LINE>return sb.append(v.getSint16Array().getValList());<NEW_LINE>case SINT32_ARRAY:<NEW_LINE>return sb.append(v.getSint32Array().getValList());<NEW_LINE>case SINT64_ARRAY:<NEW_LINE>return sb.append(v.getSint64Array().getValList());<NEW_LINE>case UINT_ARRAY:<NEW_LINE>return sb.append(v.getUintArray().getValList());<NEW_LINE>case UINT8_ARRAY:<NEW_LINE>return sb.append(ProtoDebugTextFormat.escapeBytes(v.getUint8Array()));<NEW_LINE>case UINT16_ARRAY:<NEW_LINE>return sb.append(v.getUint16Array().getValList());<NEW_LINE>case UINT32_ARRAY:<NEW_LINE>return sb.append(v.getUint32Array().getValList());<NEW_LINE>case UINT64_ARRAY:<NEW_LINE>return sb.append(v.getUint64Array().getValList());<NEW_LINE>default:<NEW_LINE>assert false;<NEW_LINE>return sb.append(ProtoDebugTextFormat.shortDebugString(v));<NEW_LINE>}<NEW_LINE>}
append(v.getSint32());
281,109
public Event nextEvent() {<NEW_LINE><MASK><NEW_LINE>if (ev == Event.META_CHANGED) {<NEW_LINE>if (meta == null) {<NEW_LINE>meta = new BundleMeta();<NEW_LINE>}<NEW_LINE>BundleMeta origmeta = source.getMeta();<NEW_LINE>for (int i = meta.size(); i < origmeta.size(); i++) {<NEW_LINE>if (column < 0) {<NEW_LINE>@SuppressWarnings("unchecked")<NEW_LINE>SimpleTypeInformation<Object> type = (SimpleTypeInformation<Object>) origmeta.get(i);<NEW_LINE>// Test whether this type matches<NEW_LINE>if (getInputTypeRestriction().isAssignableFromType(type)) {<NEW_LINE>@SuppressWarnings("unchecked")<NEW_LINE>final SimpleTypeInformation<I> castType = (SimpleTypeInformation<I>) type;<NEW_LINE>meta.add(convertedType(castType));<NEW_LINE>column = i;<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>meta.add(origmeta.get(i));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return ev;<NEW_LINE>}
Event ev = source.nextEvent();
1,209,214
static Object repr(VirtualFrame frame, Object obj, @Cached GetClassNode getClassNode, @Cached(parameters = "Repr") LookupSpecialMethodSlotNode lookupRepr, @Cached CallUnaryMethodNode callRepr, @Cached ObjectNodes.DefaultObjectReprNode defaultRepr, @Cached ConditionProfile isString, @Cached ConditionProfile isPString, @Cached PRaiseNode raiseNode) {<NEW_LINE>Object type = getClassNode.execute(obj);<NEW_LINE>Object reprMethod;<NEW_LINE>try {<NEW_LINE>reprMethod = lookupRepr.execute(frame, type, obj);<NEW_LINE>} catch (PException e) {<NEW_LINE>return defaultRepr.execute(frame, obj);<NEW_LINE>}<NEW_LINE>if (reprMethod != PNone.NO_VALUE) {<NEW_LINE>Object result = callRepr.executeObject(frame, reprMethod, obj);<NEW_LINE>if (isString.profile(result instanceof String) || isPString.profile(result instanceof PString)) {<NEW_LINE>return result;<NEW_LINE>}<NEW_LINE>if (result != PNone.NO_VALUE) {<NEW_LINE>throw raiseNode.raise(TypeError, ErrorMessages.RETURNED_NON_STRING, __REPR__, obj);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return <MASK><NEW_LINE>}
defaultRepr.execute(frame, obj);
928,122
public static void addAllProjects(BufferedWriter wr) throws IOException {<NEW_LINE>write(wr, "allprojects {");<NEW_LINE>write(wr, "apply plugin: \"eclipse\"");<NEW_LINE>space(wr);<NEW_LINE>write(wr, "version = '1.0'");<NEW_LINE>write(wr, "ext {");<NEW_LINE>write(wr, "appName = \"%APP_NAME%\"");<NEW_LINE>write(wr, "gdxVersion = '" + DependencyBank.libgdxVersion + "'");<NEW_LINE>write(wr, "roboVMVersion = '" + DependencyBank.roboVMVersion + "'");<NEW_LINE>write(wr, "box2DLightsVersion = '" + DependencyBank.box2DLightsVersion + "'");<NEW_LINE>write(wr, "ashleyVersion = '" + DependencyBank.ashleyVersion + "'");<NEW_LINE>write(wr, "aiVersion = '" + DependencyBank.aiVersion + "'");<NEW_LINE>write(wr, "gdxControllersVersion = '" + DependencyBank.controllersVersion + "'");<NEW_LINE>write(wr, "}");<NEW_LINE>space(wr);<NEW_LINE>write(wr, "repositories {");<NEW_LINE>write(wr, DependencyBank.mavenLocal);<NEW_LINE>write(wr, DependencyBank.mavenCentral);<NEW_LINE>write(wr, DependencyBank.google);<NEW_LINE>write(wr, DependencyBank.gradlePlugins);<NEW_LINE>write(wr, <MASK><NEW_LINE>write(wr, "maven { url \"" + DependencyBank.libGDXReleaseUrl + "\" }");<NEW_LINE>write(wr, "maven { url \"" + DependencyBank.jitpackUrl + "\" }");<NEW_LINE>write(wr, "}");<NEW_LINE>write(wr, "}");<NEW_LINE>}
"maven { url \"" + DependencyBank.libGDXSnapshotsUrl + "\" }");
688,720
public double cdf(double x) {<NEW_LINE>// Only values within a certain range will have an effect on the result, so we will skip to that range!<NEW_LINE>int from = Arrays.binarySearch(X, x - h * k.cutOff());<NEW_LINE>int to = Arrays.binarySearch(X, x + <MASK><NEW_LINE>// Mostly likely the exact value of x is not in the list, so it returns the inseration points<NEW_LINE>from = from < 0 ? -from - 1 : from;<NEW_LINE>to = to < 0 ? -to - 1 : to;<NEW_LINE>double sum = 0;<NEW_LINE>for (int i = Math.max(0, from); i < Math.min(X.length, to + 1); i++) sum += k.intK((x - X[i]) / h) * getWeight(i);<NEW_LINE>// We perform the addition after the summation to reduce the difference size<NEW_LINE>if (// No weights<NEW_LINE>weights.length == 0)<NEW_LINE>sum += Math.max(0, from);<NEW_LINE>else<NEW_LINE>sum += weights[from];<NEW_LINE>return sum / (X.length);<NEW_LINE>}
h * k.cutOff());
874,790
public static SearchHistoricalSnapshotsResponse unmarshall(SearchHistoricalSnapshotsResponse searchHistoricalSnapshotsResponse, UnmarshallerContext _ctx) {<NEW_LINE>searchHistoricalSnapshotsResponse.setRequestId(_ctx.stringValue("SearchHistoricalSnapshotsResponse.RequestId"));<NEW_LINE>searchHistoricalSnapshotsResponse.setSuccess(_ctx.booleanValue("SearchHistoricalSnapshotsResponse.Success"));<NEW_LINE>searchHistoricalSnapshotsResponse.setCode(_ctx.stringValue("SearchHistoricalSnapshotsResponse.Code"));<NEW_LINE>searchHistoricalSnapshotsResponse.setMessage(_ctx.stringValue("SearchHistoricalSnapshotsResponse.Message"));<NEW_LINE>searchHistoricalSnapshotsResponse.setLimit(_ctx.integerValue("SearchHistoricalSnapshotsResponse.Limit"));<NEW_LINE>searchHistoricalSnapshotsResponse.setNextToken(_ctx.stringValue("SearchHistoricalSnapshotsResponse.NextToken"));<NEW_LINE>searchHistoricalSnapshotsResponse.setTotalCount(_ctx.integerValue("SearchHistoricalSnapshotsResponse.TotalCount"));<NEW_LINE>List<Snapshot> snapshots = new ArrayList<Snapshot>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("SearchHistoricalSnapshotsResponse.Snapshots.Length"); i++) {<NEW_LINE>Snapshot snapshot = new Snapshot();<NEW_LINE>snapshot.setCreatedTime(_ctx.longValue("SearchHistoricalSnapshotsResponse.Snapshots[" + i + "].CreatedTime"));<NEW_LINE>snapshot.setUpdatedTime(_ctx.longValue("SearchHistoricalSnapshotsResponse.Snapshots[" + i + "].UpdatedTime"));<NEW_LINE>snapshot.setSnapshotId(_ctx.stringValue("SearchHistoricalSnapshotsResponse.Snapshots[" + i + "].SnapshotId"));<NEW_LINE>snapshot.setSourceType(_ctx.stringValue("SearchHistoricalSnapshotsResponse.Snapshots[" + i + "].SourceType"));<NEW_LINE>snapshot.setJobId(_ctx.stringValue("SearchHistoricalSnapshotsResponse.Snapshots[" + i + "].JobId"));<NEW_LINE>snapshot.setBackupType(_ctx.stringValue("SearchHistoricalSnapshotsResponse.Snapshots[" + i + "].BackupType"));<NEW_LINE>snapshot.setStatus(_ctx.stringValue("SearchHistoricalSnapshotsResponse.Snapshots[" + i + "].Status"));<NEW_LINE>snapshot.setSnapshotHash(_ctx.stringValue("SearchHistoricalSnapshotsResponse.Snapshots[" + i + "].SnapshotHash"));<NEW_LINE>snapshot.setParentSnapshotHash(_ctx.stringValue("SearchHistoricalSnapshotsResponse.Snapshots[" + i + "].ParentSnapshotHash"));<NEW_LINE>snapshot.setStartTime(_ctx.longValue("SearchHistoricalSnapshotsResponse.Snapshots[" + i + "].StartTime"));<NEW_LINE>snapshot.setCompleteTime(_ctx.longValue("SearchHistoricalSnapshotsResponse.Snapshots[" + i + "].CompleteTime"));<NEW_LINE>snapshot.setRetention(_ctx.longValue("SearchHistoricalSnapshotsResponse.Snapshots[" + i + "].Retention"));<NEW_LINE>snapshot.setBytesTotal(_ctx.longValue("SearchHistoricalSnapshotsResponse.Snapshots[" + i + "].BytesTotal"));<NEW_LINE>snapshot.setFileSystemId(_ctx.stringValue("SearchHistoricalSnapshotsResponse.Snapshots[" + i + "].FileSystemId"));<NEW_LINE>snapshot.setCreateTime(_ctx.longValue("SearchHistoricalSnapshotsResponse.Snapshots[" + i + "].CreateTime"));<NEW_LINE>snapshot.setBucket(_ctx.stringValue("SearchHistoricalSnapshotsResponse.Snapshots[" + i + "].Bucket"));<NEW_LINE>snapshot.setPrefix(_ctx.stringValue("SearchHistoricalSnapshotsResponse.Snapshots[" + i + "].Prefix"));<NEW_LINE>snapshot.setInstanceId(_ctx.stringValue("SearchHistoricalSnapshotsResponse.Snapshots[" + i + "].InstanceId"));<NEW_LINE>snapshot.setPath(_ctx.stringValue("SearchHistoricalSnapshotsResponse.Snapshots[" + i + "].Path"));<NEW_LINE>snapshot.setClientId(_ctx.stringValue("SearchHistoricalSnapshotsResponse.Snapshots[" + i + "].ClientId"));<NEW_LINE>snapshot.setBytesDone(_ctx.longValue("SearchHistoricalSnapshotsResponse.Snapshots[" + i + "].BytesDone"));<NEW_LINE>snapshot.setActualBytes(_ctx.longValue("SearchHistoricalSnapshotsResponse.Snapshots[" + i + "].ActualBytes"));<NEW_LINE>snapshot.setItemsDone(_ctx.longValue("SearchHistoricalSnapshotsResponse.Snapshots[" + i + "].ItemsDone"));<NEW_LINE>snapshot.setItemsTotal(_ctx.longValue("SearchHistoricalSnapshotsResponse.Snapshots[" + i + "].ItemsTotal"));<NEW_LINE>snapshot.setActualItems(_ctx.longValue<MASK><NEW_LINE>snapshot.setErrorFile(_ctx.stringValue("SearchHistoricalSnapshotsResponse.Snapshots[" + i + "].ErrorFile"));<NEW_LINE>List<String> paths = new ArrayList<String>();<NEW_LINE>for (int j = 0; j < _ctx.lengthValue("SearchHistoricalSnapshotsResponse.Snapshots[" + i + "].Paths.Length"); j++) {<NEW_LINE>paths.add(_ctx.stringValue("SearchHistoricalSnapshotsResponse.Snapshots[" + i + "].Paths[" + j + "]"));<NEW_LINE>}<NEW_LINE>snapshot.setPaths(paths);<NEW_LINE>snapshots.add(snapshot);<NEW_LINE>}<NEW_LINE>searchHistoricalSnapshotsResponse.setSnapshots(snapshots);<NEW_LINE>return searchHistoricalSnapshotsResponse;<NEW_LINE>}
("SearchHistoricalSnapshotsResponse.Snapshots[" + i + "].ActualItems"));
1,232,813
void init(ChannelPipeline pipeline) {<NEW_LINE>pipeline.addFirst("idleStateHandler", new IdleStateHandler<MASK><NEW_LINE>pipeline.addAfter("idleStateHandler", "idleEventHandler", timeoutHandler);<NEW_LINE>// pipeline.addLast("logger", new LoggingHandler("Netty", LogLevel.ERROR));<NEW_LINE>if (errorsCather.isPresent()) {<NEW_LINE>pipeline.addLast("bugsnagCatcher", errorsCather.get());<NEW_LINE>}<NEW_LINE>pipeline.addFirst("bytemetrics", new BytesMetricsHandler(m_bytesMetricsCollector));<NEW_LINE>pipeline.addLast("decoder", new MqttDecoder());<NEW_LINE>pipeline.addLast("encoder", MqttEncoder.INSTANCE);<NEW_LINE>pipeline.addLast("metrics", new MessageMetricsHandler(m_metricsCollector));<NEW_LINE>pipeline.addLast("messageLogger", new MQTTMessageLogger());<NEW_LINE>if (metrics.isPresent()) {<NEW_LINE>pipeline.addLast("wizardMetrics", metrics.get());<NEW_LINE>}<NEW_LINE>pipeline.addLast("handler", handler);<NEW_LINE>}
(nettyChannelTimeoutSeconds, 0, 0));
649,702
private void doCopy() {<NEW_LINE>Element el = document.getParagraphElement(editor.getSelectionStart());<NEW_LINE>if (el.getName().toUpperCase().equals("P-IMPLIED"))<NEW_LINE>el = el.getParentElement();<NEW_LINE>String elName = el.getName();<NEW_LINE>StringWriter sw = new StringWriter();<NEW_LINE>String copy;<NEW_LINE>java.awt.datatransfer.Clipboard clip = java.awt.Toolkit.getDefaultToolkit().getSystemClipboard();<NEW_LINE>try {<NEW_LINE>editorKit.write(sw, document, editor.getSelectionStart(), editor.getSelectionEnd(<MASK><NEW_LINE>copy = sw.toString();<NEW_LINE>copy = copy.split("<" + elName + "(.*?)>")[1];<NEW_LINE>copy = copy.split("</" + elName + ">")[0];<NEW_LINE>clip.setContents(new java.awt.datatransfer.StringSelection(copy.trim()), null);<NEW_LINE>} catch (Exception ex) {<NEW_LINE>ex.printStackTrace();<NEW_LINE>}<NEW_LINE>}
) - editor.getSelectionStart());
233,171
public AttackResult completed(@RequestParam String editor) {<NEW_LINE>try {<NEW_LINE>if (editor.isEmpty())<NEW_LINE>return failed(this).feedback("sql-injection.10b.no-code").build();<NEW_LINE>editor = editor.replaceAll("\\<.*?>", "");<NEW_LINE>String regexSetsUpConnection = "(?=.*getConnection.*)";<NEW_LINE>String regexUsesPreparedStatement = "(?=.*PreparedStatement.*)";<NEW_LINE>String regexUsesPlaceholder = "(?=.*\\=\\?.*|.*\\=\\s\\?.*)";<NEW_LINE>String regexUsesSetString = "(?=.*setString.*)";<NEW_LINE>String regexUsesExecute = "(?=.*execute.*)";<NEW_LINE>String regexUsesExecuteUpdate = "(?=.*executeUpdate.*)";<NEW_LINE>String codeline = editor.replace("\n", "").replace("\r", "");<NEW_LINE>boolean setsUpConnection = this.check_text(regexSetsUpConnection, codeline);<NEW_LINE>boolean usesPreparedStatement = this.check_text(regexUsesPreparedStatement, codeline);<NEW_LINE>boolean usesSetString = this.check_text(regexUsesSetString, codeline);<NEW_LINE>boolean usesPlaceholder = this.check_text(regexUsesPlaceholder, codeline);<NEW_LINE>boolean usesExecute = this.check_text(regexUsesExecute, codeline);<NEW_LINE>boolean usesExecuteUpdate = this.check_text(regexUsesExecuteUpdate, codeline);<NEW_LINE>boolean hasImportant = (setsUpConnection && usesPreparedStatement && usesPlaceholder && usesSetString && (usesExecute || usesExecuteUpdate));<NEW_LINE>List<Diagnostic> hasCompiled = this.compileFromString(editor);<NEW_LINE>if (hasImportant && hasCompiled.size() < 1) {<NEW_LINE>return success(this).feedback("sql-injection.10b.success").build();<NEW_LINE>} else if (hasCompiled.size() > 0) {<NEW_LINE>String errors = "";<NEW_LINE>for (Diagnostic d : hasCompiled) {<NEW_LINE>errors += d.getMessage(null) + "<br>";<NEW_LINE>}<NEW_LINE>return failed(this).feedback("sql-injection.10b.compiler-errors").output(errors).build();<NEW_LINE>} else {<NEW_LINE>return failed(this).<MASK><NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>return failed(this).output(e.getMessage()).build();<NEW_LINE>}<NEW_LINE>}
feedback("sql-injection.10b.failed").build();
630,029
final ListTargetsByRuleResult executeListTargetsByRule(ListTargetsByRuleRequest listTargetsByRuleRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(listTargetsByRuleRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<ListTargetsByRuleRequest> request = null;<NEW_LINE>Response<ListTargetsByRuleResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new ListTargetsByRuleRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(listTargetsByRuleRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "EventBridge");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ListTargetsByRule");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<ListTargetsByRuleResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new ListTargetsByRuleResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>}
endClientExecution(awsRequestMetrics, request, response);
420,017
public VolumeAttachment unmarshall(StaxUnmarshallerContext context) throws Exception {<NEW_LINE>VolumeAttachment volumeAttachment = new VolumeAttachment();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>if (context.isStartOfDocument())<NEW_LINE>targetDepth += 1;<NEW_LINE>while (true) {<NEW_LINE>int xmlEvent = context.nextEvent();<NEW_LINE>if (xmlEvent == XmlPullParser.END_DOCUMENT)<NEW_LINE>return volumeAttachment;<NEW_LINE>if (xmlEvent == XmlPullParser.START_TAG) {<NEW_LINE>if (context.testExpression("volumeId", targetDepth)) {<NEW_LINE>volumeAttachment.setVolumeId(StringStaxUnmarshaller.getInstance<MASK><NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (context.testExpression("instanceId", targetDepth)) {<NEW_LINE>volumeAttachment.setInstanceId(StringStaxUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (context.testExpression("device", targetDepth)) {<NEW_LINE>volumeAttachment.setDevice(StringStaxUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (context.testExpression("status", targetDepth)) {<NEW_LINE>volumeAttachment.setState(StringStaxUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (context.testExpression("attachTime", targetDepth)) {<NEW_LINE>volumeAttachment.setAttachTime(DateStaxUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (context.testExpression("deleteOnTermination", targetDepth)) {<NEW_LINE>volumeAttachment.setDeleteOnTermination(BooleanStaxUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>} else if (xmlEvent == XmlPullParser.END_TAG) {<NEW_LINE>if (context.getCurrentDepth() < originalDepth) {<NEW_LINE>return volumeAttachment;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
().unmarshall(context));
13,427
private String processTargetTypeCreation(final CreateUpdateTargetTypeDetailsRequest targetTypeRequest, final String userId) throws PacManException {<NEW_LINE>String targetName = targetTypeRequest.getName().toLowerCase().trim().replaceAll(" ", "-");<NEW_LINE>targetTypeRequest.setName(targetName);<NEW_LINE>boolean isTargetTypeExits = targetTypesRepository.existsById(targetName);<NEW_LINE>if (!isTargetTypeExits) {<NEW_LINE>Date currentDate = new Date();<NEW_LINE>TargetTypes newTargetType = new TargetTypes();<NEW_LINE>newTargetType.setTargetName(targetName);<NEW_LINE>newTargetType.setTargetDesc(targetTypeRequest.getDesc());<NEW_LINE>newTargetType.setCategory(targetTypeRequest.getCategory());<NEW_LINE>newTargetType.setDataSourceName(targetTypeRequest.getDataSource());<NEW_LINE>newTargetType.setTargetConfig(targetTypeRequest.getConfig());<NEW_LINE>newTargetType.setStatus("");<NEW_LINE>newTargetType.setUserId(userId);<NEW_LINE>String endpoint = config.getElasticSearch().getDevIngestHost() + ":" + config.getElasticSearch().getDevIngestPort() + "/" + targetTypeRequest.getDataSource() + "_" + targetName + "/" + targetName;<NEW_LINE>newTargetType.setEndpoint(endpoint);<NEW_LINE>newTargetType.setCreatedDate(currentDate);<NEW_LINE>newTargetType.setModifiedDate(currentDate);<NEW_LINE>newTargetType.<MASK><NEW_LINE>targetTypesRepository.save(newTargetType);<NEW_LINE>return AdminConstants.TARGET_TYPE_CREATION_SUCCESS;<NEW_LINE>} else {<NEW_LINE>try {<NEW_LINE>invokeAPI("DELETE", "aws_" + targetName, null);<NEW_LINE>} catch (Exception exception) {<NEW_LINE>log.error(UNEXPECTED_ERROR_OCCURRED, exception);<NEW_LINE>}<NEW_LINE>throw new PacManException(AdminConstants.TARGET_TYPE_NAME_EXITS);<NEW_LINE>}<NEW_LINE>}
setDomain(targetTypeRequest.getDomain());
798,896
private void evalLocal() throws Exception {<NEW_LINE>CacheCategory cacheCategory = new CacheCategory(Agent.class);<NEW_LINE>CacheKey cacheKey = new CacheKey(TriggerAgent.class, agent.getId());<NEW_LINE>CompiledScript compiledScript = null;<NEW_LINE>Optional<?> optional = CacheManager.get(cacheCategory, cacheKey);<NEW_LINE>if (optional.isPresent()) {<NEW_LINE>compiledScript = (CompiledScript) optional.get();<NEW_LINE>} else {<NEW_LINE>compiledScript = ScriptingFactory.functionalizationCompile(agent.getText());<NEW_LINE>CacheManager.put(cacheCategory, cacheKey, compiledScript);<NEW_LINE>}<NEW_LINE>ScriptContext scriptContext = ScriptingFactory.scriptContextEvalInitialServiceScript();<NEW_LINE>Bindings bindings = scriptContext.getBindings(ScriptContext.ENGINE_SCOPE);<NEW_LINE>Resources resources = new Resources();<NEW_LINE>resources.setContext(ThisApplication.context());<NEW_LINE>resources.setOrganization(new Organization(ThisApplication.context()));<NEW_LINE>resources<MASK><NEW_LINE>resources.setApplications(ThisApplication.context().applications());<NEW_LINE>bindings.put(ScriptingFactory.BINDING_NAME_SERVICE_RESOURCES, resources);<NEW_LINE>eval(compiledScript, scriptContext);<NEW_LINE>updateLastEndTime();<NEW_LINE>}
.setWebservicesClient(new WebservicesClient());
349,715
private double convertUnits(double fromValue, LogVar fromVar, ProductVar toVar) throws UnitType.IllegalUnitConversionException {<NEW_LINE>double toValue = fromValue;<NEW_LINE>String fromUnits = null;<NEW_LINE>if (fromVar.getUnits() == null && toVar.getFromUnits() != null && !toVar.getFromUnits().isEmpty()) {<NEW_LINE>fromUnits = toVar.getFromUnits();<NEW_LINE>} else {<NEW_LINE>fromUnits = fromVar.getUnits();<NEW_LINE>}<NEW_LINE>if (fromUnits != null && !fromUnits.equals(toVar.getUnits())) {<NEW_LINE>try {<NEW_LINE>toValue = UnitType.convertUnits(fromValue, fromVar.getUnits(<MASK><NEW_LINE>} catch (UnitType.IllegalUnitConversionException e) {<NEW_LINE>throw new UnitType.IllegalUnitConversionException("===" + fromVar.getName() + ": [" + fromVar.getUnits() + "]", toVar.getName() + ": [" + toVar.getUnits() + "]");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return toValue;<NEW_LINE>}
), toVar.getUnits());
990,027
public void onEvent(GridEvent<T> event) {<NEW_LINE>super.onEvent(event);<NEW_LINE>if (event.isHandled()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (!event.getCell().isBody()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>Column<?, T> gridColumn = event<MASK><NEW_LINE>boolean enterKey = event.getDomEvent().getType().equals(BrowserEvents.KEYDOWN) && event.getDomEvent().getKeyCode() == KeyCodes.KEY_ENTER;<NEW_LINE>boolean doubleClick = event.getDomEvent().getType().equals(BrowserEvents.DBLCLICK);<NEW_LINE>if (gridColumn.getRenderer() instanceof ComplexRenderer) {<NEW_LINE>ComplexRenderer<?> cplxRenderer = (ComplexRenderer<?>) gridColumn.getRenderer();<NEW_LINE>if (cplxRenderer.getConsumedEvents().contains(event.getDomEvent().getType())) {<NEW_LINE>if (cplxRenderer.onBrowserEvent(event.getCell(), event.getDomEvent())) {<NEW_LINE>event.setHandled(true);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Calls onActivate if KeyDown and Enter or double click<NEW_LINE>if ((enterKey || doubleClick) && cplxRenderer.onActivate(event.getCell())) {<NEW_LINE>event.setHandled(true);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
.getCell().getColumn();
511,087
/*<NEW_LINE>* A record of default values that represent the value of the<NEW_LINE>* outputs if the route is filtered / dropped in the policy<NEW_LINE>*/<NEW_LINE>@VisibleForTesting<NEW_LINE>BDDRoute zeroedRecord() {<NEW_LINE>BDDRoute rec = new BDDRoute(_factory, _configAtomicPredicates.getCommunityAtomicPredicates().getNumAtomicPredicates(), _configAtomicPredicates.getAsPathRegexAtomicPredicates().getNumAtomicPredicates());<NEW_LINE>rec.getLocalPref().setValue(0);<NEW_LINE>rec.getAdminDist().setValue(0);<NEW_LINE>rec.getPrefixLength().setValue(0);<NEW_LINE>rec.getMed().setValue(0);<NEW_LINE>rec.getNextHop().setValue(0);<NEW_LINE>rec.<MASK><NEW_LINE>rec.setNextHopSet(_factory.zero());<NEW_LINE>rec.getTag().setValue(0);<NEW_LINE>rec.getPrefix().setValue(0);<NEW_LINE>for (int i = 0; i < rec.getCommunityAtomicPredicates().length; i++) {<NEW_LINE>rec.getCommunityAtomicPredicates()[i] = _factory.zero();<NEW_LINE>}<NEW_LINE>for (int i = 0; i < rec.getAsPathRegexAtomicPredicates().length; i++) {<NEW_LINE>rec.getAsPathRegexAtomicPredicates()[i] = _factory.zero();<NEW_LINE>}<NEW_LINE>rec.getProtocolHistory().getInteger().setValue(0);<NEW_LINE>return rec;<NEW_LINE>}
setNextHopDiscarded(_factory.zero());
923,715
public boolean canImport(final TransferSupport support) {<NEW_LINE>try {<NEW_LINE>final Transferable t = support.getTransferable();<NEW_LINE>if (t.isDataFlavorSupported(dataFlavor)) {<NEW_LINE>final Object transferData = t.getTransferData(transferFlavor);<NEW_LINE>if (transferData instanceof DocumentPaneTransferInfo) {<NEW_LINE>final DocumentPaneTransferInfo info = (DocumentPaneTransferInfo) transferData;<NEW_LINE>final WebDocumentPane dp = paneData.getDocumentPane();<NEW_LINE>final boolean allowed = dp.isDragBetweenPanesEnabled() && info.isDragBetweenPanesEnabled();<NEW_LINE>return allowed || dp.getId().equals(info.getDocumentPaneId());<NEW_LINE>} else {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>} catch (final Exception e) {<NEW_LINE>LoggerFactory.getLogger(DocumentTransferHandler.class).error(<MASK><NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>}
e.toString(), e);
1,265,945
public void requestPostPhoto(File photo, final String message, OnPostingCompleteListener onPostingCompleteListener) {<NEW_LINE>super.requestPostPhoto(photo, message, onPostingCompleteListener);<NEW_LINE>final Bitmap vkPhoto = getPhoto(photo);<NEW_LINE>VKRequest request = VKApi.uploadWallPhotoRequest(new VKUploadImage(vkPhoto, VKImageParameters.pngImage()), 0, Integer.parseInt(mUserId));<NEW_LINE>request.executeWithListener(new VKRequest.VKRequestListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onComplete(VKResponse response) {<NEW_LINE>VKApiPhoto photoModel = ((VKPhotoArray) response.parsedModel).get(0);<NEW_LINE>makePost(new VKAttachments(photoModel), message, REQUEST_POST_PHOTO);<NEW_LINE>vkPhoto.recycle();<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onError(VKError error) {<NEW_LINE>mLocalListeners.get(REQUEST_POST_PHOTO).onError(getID(), REQUEST_POST_PHOTO, <MASK><NEW_LINE>}<NEW_LINE>});<NEW_LINE>}
error.toString(), null);
23,295
public void testSFLocalEnvEntry_Long_InvalidValue() throws Exception {<NEW_LINE>SFLa ejb1 = fhome1.create();<NEW_LINE>try {<NEW_LINE>// The test case looks for a environment variable named "envLongInvalid".<NEW_LINE>Long tempLong = ejb1.getLongEnvVar("envLongBlankValue");<NEW_LINE>fail("Get environment invalid long object should have failed, instead we got: " + tempLong);<NEW_LINE>} catch (NamingException ne) {<NEW_LINE>svLogger.info("Caught expected " + ne.getClass().getName());<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>// The test case looks for a environment variable named "envLongInvalid".<NEW_LINE>Long tempLong = ejb1.getLongEnvVar("envLongInvalid");<NEW_LINE>fail("Get environment invalid long object should have failed, instead we got: " + tempLong);<NEW_LINE>} catch (NamingException ne) {<NEW_LINE>svLogger.info("Caught expected " + ne.getClass().getName());<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>// The test case looks for a environment variable named "envLongInvalid".<NEW_LINE>Long <MASK><NEW_LINE>fail("Get environment invalid long object should have failed, instead we got: " + tempLong);<NEW_LINE>} catch (NamingException ne) {<NEW_LINE>svLogger.info("Caught expected " + ne.getClass().getName());<NEW_LINE>}<NEW_LINE>ejb1.remove();<NEW_LINE>}
tempLong = ejb1.getLongEnvVar("envLongGT64bit");
519,470
public void doReportStat(SofaTracerSpan sofaTracerSpan) {<NEW_LINE>Map<String, String> tagsWithStr = sofaTracerSpan.getTagsWithStr();<NEW_LINE>StatKey statKey = new StatKey();<NEW_LINE>String localApp = <MASK><NEW_LINE>String dbType = tagsWithStr.get(Tags.DB_TYPE.getKey());<NEW_LINE>String methodName = tagsWithStr.get(CommonSpanTags.METHOD);<NEW_LINE>statKey.setKey(buildString(new String[] { localApp, methodName, dbType }));<NEW_LINE>// success<NEW_LINE>String resultCode = tagsWithStr.get(CommonSpanTags.RESULT_CODE);<NEW_LINE>boolean success = isWebHttpClientSuccess(resultCode);<NEW_LINE>statKey.setResult(success ? SofaTracerConstant.STAT_FLAG_SUCCESS : SofaTracerConstant.STAT_FLAG_FAILS);<NEW_LINE>statKey.setEnd(buildString(new String[] { TracerUtils.getLoadTestMark(sofaTracerSpan) }));<NEW_LINE>// pressure mark<NEW_LINE>statKey.setLoadTest(TracerUtils.isLoadTest(sofaTracerSpan));<NEW_LINE>// value the count and duration<NEW_LINE>long duration = sofaTracerSpan.getEndTime() - sofaTracerSpan.getStartTime();<NEW_LINE>long[] values = new long[] { 1, duration };<NEW_LINE>// reserve<NEW_LINE>this.addStat(statKey, values);<NEW_LINE>}
tagsWithStr.get(CommonSpanTags.LOCAL_APP);
646,692
private static void blockHitAir(ServerWorld serverWorld, RayTraceResult rayTraceResult, ElementalAir airInterfaceInstance) {<NEW_LINE>int arrowAirChargeLevel = airInterfaceInstance.getChargeLevel();<NEW_LINE>if (arrowAirChargeLevel == 0)<NEW_LINE>return;<NEW_LINE>if (!(rayTraceResult instanceof BlockRayTraceResult))<NEW_LINE>throw new AssertionError("BlockRayTraceResult expected");<NEW_LINE>BlockRayTraceResult blockRayTraceResult = (BlockRayTraceResult) rayTraceResult;<NEW_LINE>Vector3d hitPosition = blockRayTraceResult.getHitVec();<NEW_LINE>final Vector3d OFFSET_VARIATION = new <MASK><NEW_LINE>final int SPEED = 0;<NEW_LINE>final int PARTICLE_COUNT = 1;<NEW_LINE>serverWorld.spawnParticle(ParticleTypes.CLOUD, hitPosition.getX(), hitPosition.getY(), hitPosition.getZ(), PARTICLE_COUNT, OFFSET_VARIATION.getX(), OFFSET_VARIATION.getY(), OFFSET_VARIATION.getZ(), SPEED);<NEW_LINE>serverWorld.spawnParticle(ParticleTypes.HAPPY_VILLAGER, hitPosition.getX(), hitPosition.getY(), hitPosition.getZ(), 1, 0, 0, 0, SPEED);<NEW_LINE>}
Vector3d(0.0, 0.0, 0.0);
990,359
public Request<DeleteFleetsRequest> marshall(DeleteFleetsRequest deleteFleetsRequest) {<NEW_LINE>if (deleteFleetsRequest == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>Request<DeleteFleetsRequest> request = new DefaultRequest<DeleteFleetsRequest>(deleteFleetsRequest, "AmazonEC2");<NEW_LINE>request.addParameter("Action", "DeleteFleets");<NEW_LINE>request.addParameter("Version", "2016-11-15");<NEW_LINE><MASK><NEW_LINE>com.amazonaws.internal.SdkInternalList<String> deleteFleetsRequestFleetIdsList = (com.amazonaws.internal.SdkInternalList<String>) deleteFleetsRequest.getFleetIds();<NEW_LINE>if (!deleteFleetsRequestFleetIdsList.isEmpty() || !deleteFleetsRequestFleetIdsList.isAutoConstruct()) {<NEW_LINE>int fleetIdsListIndex = 1;<NEW_LINE>for (String deleteFleetsRequestFleetIdsListValue : deleteFleetsRequestFleetIdsList) {<NEW_LINE>if (deleteFleetsRequestFleetIdsListValue != null) {<NEW_LINE>request.addParameter("FleetId." + fleetIdsListIndex, StringUtils.fromString(deleteFleetsRequestFleetIdsListValue));<NEW_LINE>}<NEW_LINE>fleetIdsListIndex++;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (deleteFleetsRequest.getTerminateInstances() != null) {<NEW_LINE>request.addParameter("TerminateInstances", StringUtils.fromBoolean(deleteFleetsRequest.getTerminateInstances()));<NEW_LINE>}<NEW_LINE>return request;<NEW_LINE>}
request.setHttpMethod(HttpMethodName.POST);
1,368,341
public void initialize(WizardDescriptor wiz) {<NEW_LINE>this.wizardInfo = getWizardInfo(DATAFILE);<NEW_LINE>this.holder = new ResourceConfigHelperHolder();<NEW_LINE>this.helper = holder.getDataSourceHelper();<NEW_LINE>// this.wiz = wiz;<NEW_LINE>// NOI18N<NEW_LINE>wiz.putProperty("NewFileWizard_Title", NbBundle.getMessage<MASK><NEW_LINE>index = 0;<NEW_LINE>project = Templates.getProject(wiz);<NEW_LINE>panels = createPanels();<NEW_LINE>// Make sure list of steps is accurate.<NEW_LINE>steps = createSteps();<NEW_LINE>try {<NEW_LINE>FileObject pkgLocation = project.getProjectDirectory();<NEW_LINE>if (pkgLocation != null) {<NEW_LINE>this.helper.getData().setTargetFileObject(pkgLocation);<NEW_LINE>}<NEW_LINE>} catch (Exception ex) {<NEW_LINE>ErrorManager.getDefault().notify(ErrorManager.INFORMATIONAL, ex);<NEW_LINE>}<NEW_LINE>for (int i = 0; i < panels.length; i++) {<NEW_LINE>Component c = panels[i].getComponent();<NEW_LINE>if (c instanceof JComponent) {<NEW_LINE>// assume Swing components<NEW_LINE>JComponent jc = (JComponent) c;<NEW_LINE>// Step #.<NEW_LINE>// NOI18N<NEW_LINE>jc.putClientProperty(WizardDescriptor.PROP_CONTENT_SELECTED_INDEX, i);<NEW_LINE>// Step name (actually the whole list for reference).<NEW_LINE>// NOI18N<NEW_LINE>jc.putClientProperty(WizardDescriptor.PROP_CONTENT_DATA, steps);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
(ConnPoolWizard.class, "Templates/SunResources/JDBC_Resource"));
608,073
static IdentityProviderModel toModel(MapIdentityProviderEntity entity) {<NEW_LINE>if (entity == null)<NEW_LINE>return null;<NEW_LINE>IdentityProviderModel model = new IdentityProviderModel();<NEW_LINE>model.setInternalId(entity.getId());<NEW_LINE>model.setAlias(entity.getAlias());<NEW_LINE>model.setDisplayName(entity.getDisplayName());<NEW_LINE>model.setProviderId(entity.getProviderId());<NEW_LINE>model.setFirstBrokerLoginFlowId(entity.getFirstBrokerLoginFlowId());<NEW_LINE>model.setPostBrokerLoginFlowId(entity.getPostBrokerLoginFlowId());<NEW_LINE>Boolean enabled = entity.isEnabled();<NEW_LINE>model.setEnabled(enabled == null ? false : enabled);<NEW_LINE>Boolean trustEmail = entity.isTrustEmail();<NEW_LINE>model.setTrustEmail(trustEmail == null ? false : trustEmail);<NEW_LINE>Boolean storeToken = entity.isStoreToken();<NEW_LINE>model.setStoreToken(<MASK><NEW_LINE>Boolean linkOnly = entity.isLinkOnly();<NEW_LINE>model.setLinkOnly(linkOnly == null ? false : linkOnly);<NEW_LINE>Boolean addReadTokenRoleOnCreate = entity.isAddReadTokenRoleOnCreate();<NEW_LINE>model.setAddReadTokenRoleOnCreate(addReadTokenRoleOnCreate == null ? false : addReadTokenRoleOnCreate);<NEW_LINE>Boolean authenticateByDefault = entity.isAuthenticateByDefault();<NEW_LINE>model.setAuthenticateByDefault(authenticateByDefault == null ? false : authenticateByDefault);<NEW_LINE>Map<String, String> config = entity.getConfig();<NEW_LINE>model.setConfig(config == null ? new HashMap<>() : new HashMap<>(config));<NEW_LINE>return model;<NEW_LINE>}
storeToken == null ? false : storeToken);
687,083
private void startHeadingUpdate() {<NEW_LINE>if (mSensorManager == null || mContext == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>SmartLocation.LocationControl locationControl = SmartLocation.with(mContext).location().oneFix().config(LocationParams.BEST_EFFORT);<NEW_LINE>Location currLoc = locationControl.getLastLocation();<NEW_LINE>if (currLoc != null) {<NEW_LINE>mGeofield = new GeomagneticField((float) currLoc.getLatitude(), (float) currLoc.getLongitude(), (float) currLoc.getAltitude(), System.currentTimeMillis());<NEW_LINE>} else {<NEW_LINE>locationControl.start(location -> mGeofield = new GeomagneticField((float) location.getLatitude(), (float) location.getLongitude(), (float) location.getAltitude(), System.currentTimeMillis()));<NEW_LINE>}<NEW_LINE>mSensorManager.registerListener(this, mSensorManager.getDefaultSensor(Sensor<MASK><NEW_LINE>mSensorManager.registerListener(this, mSensorManager.getDefaultSensor(Sensor.TYPE_ACCELEROMETER), SensorManager.SENSOR_DELAY_NORMAL);<NEW_LINE>}
.TYPE_MAGNETIC_FIELD), SensorManager.SENSOR_DELAY_NORMAL);
676,738
public synchronized void checkFilesTTL() {<NEW_LINE>if (dataTTL == Long.MAX_VALUE) {<NEW_LINE>logger.debug("{}: TTL not set, ignore the check", logicalStorageGroupName + "-" + virtualStorageGroupId);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>long ttlLowerBound = System.currentTimeMillis() - dataTTL;<NEW_LINE>logger.debug("{}: TTL removing files before {}", logicalStorageGroupName + "-" + virtualStorageGroupId, new Date(ttlLowerBound));<NEW_LINE>// copy to avoid concurrent modification of deletion<NEW_LINE>List<TsFileResource> seqFiles = new ArrayList<>(tsFileManager.getTsFileList(true));<NEW_LINE>List<TsFileResource> unseqFiles = new ArrayList<>(tsFileManager.getTsFileList(false));<NEW_LINE>for (TsFileResource tsFileResource : seqFiles) {<NEW_LINE>checkFileTTL(tsFileResource, ttlLowerBound, true);<NEW_LINE>}<NEW_LINE>for (TsFileResource tsFileResource : unseqFiles) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>}
checkFileTTL(tsFileResource, ttlLowerBound, false);
1,581,505
// logic similar to float_subtype_new(PyTypeObject *type, PyObject *x) from CPython<NEW_LINE>// floatobject.c we have to first create a temporary float, then fill it into<NEW_LINE>// a natively allocated subtype structure<NEW_LINE>@Specialization(guards = "isSubtypeOfFloat(frame, isSubtype, cls)", limit = "1")<NEW_LINE>static Object floatFromObjectNativeSubclass(VirtualFrame frame, PythonNativeClass cls, Object obj, @Cached @SuppressWarnings("unused") IsSubtypeNode isSubtype, @Cached CExtNodes.FloatSubtypeNew subtypeNew, @Cached FloatNode recursiveCallNode) {<NEW_LINE>try {<NEW_LINE>return subtypeNew.call(cls, recursiveCallNode.executeDouble(frame<MASK><NEW_LINE>} catch (UnexpectedResultException e) {<NEW_LINE>throw CompilerDirectives.shouldNotReachHere("float() returned non-primitive value");<NEW_LINE>}<NEW_LINE>}
, PythonBuiltinClassType.PFloat, obj));
475,388
final void handleChannel(int streamId, ByteBuf frame, long initialRequestN, boolean complete) {<NEW_LINE>ResponderLeaseTracker leaseHandler = this.leaseHandler;<NEW_LINE>Throwable leaseError;<NEW_LINE>if (leaseHandler == null || (leaseError = leaseHandler.use()) == null) {<NEW_LINE>final <MASK><NEW_LINE>if (requestInterceptor != null) {<NEW_LINE>requestInterceptor.onStart(streamId, FrameType.REQUEST_CHANNEL, RequestChannelFrameCodec.metadata(frame));<NEW_LINE>}<NEW_LINE>if (FrameHeaderCodec.hasFollows(frame)) {<NEW_LINE>RequestChannelResponderSubscriber subscriber = new RequestChannelResponderSubscriber(streamId, initialRequestN, frame, this, this);<NEW_LINE>this.add(streamId, subscriber);<NEW_LINE>} else {<NEW_LINE>final Payload firstPayload = super.getPayloadDecoder().apply(frame);<NEW_LINE>RequestChannelResponderSubscriber subscriber = new RequestChannelResponderSubscriber(streamId, initialRequestN, firstPayload, this);<NEW_LINE>if (this.add(streamId, subscriber)) {<NEW_LINE>this.requestChannel(subscriber).subscribe(subscriber);<NEW_LINE>if (complete) {<NEW_LINE>subscriber.handleComplete();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>final RequestInterceptor requestTracker = this.getRequestInterceptor();<NEW_LINE>if (requestTracker != null) {<NEW_LINE>requestTracker.onReject(leaseError, FrameType.REQUEST_CHANNEL, RequestChannelFrameCodec.metadata(frame));<NEW_LINE>}<NEW_LINE>sendLeaseRejection(streamId, leaseError);<NEW_LINE>}<NEW_LINE>}
RequestInterceptor requestInterceptor = this.getRequestInterceptor();
1,393,188
public static void maxf(Planar<GrayF32> inX, Planar<GrayF32> inY, GrayF32 outX, GrayF32 outY) {<NEW_LINE>// input and output should be the same shape<NEW_LINE><MASK><NEW_LINE>InputSanityCheck.reshapeOneIn(inX, outX, outY);<NEW_LINE>// make sure that the pixel index is the same<NEW_LINE>InputSanityCheck.checkIndexing(inX, inY);<NEW_LINE>InputSanityCheck.checkIndexing(outX, outY);<NEW_LINE>for (int y = 0; y < inX.height; y++) {<NEW_LINE>int indexIn = inX.startIndex + inX.stride * y;<NEW_LINE>int indexOut = outX.startIndex + outX.stride * y;<NEW_LINE>for (int x = 0; x < inX.width; x++, indexIn++, indexOut++) {<NEW_LINE>float maxValueX = inX.bands[0].data[indexIn];<NEW_LINE>float maxValueY = inY.bands[0].data[indexIn];<NEW_LINE>float maxNorm = maxValueX * maxValueX + maxValueY * maxValueY;<NEW_LINE>for (int band = 1; band < inX.bands.length; band++) {<NEW_LINE>float valueX = inX.bands[band].data[indexIn];<NEW_LINE>float valueY = inY.bands[band].data[indexIn];<NEW_LINE>float n = valueX * valueX + valueY * valueY;<NEW_LINE>if (n > maxNorm) {<NEW_LINE>maxNorm = n;<NEW_LINE>maxValueX = valueX;<NEW_LINE>maxValueY = valueY;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>outX.data[indexOut] = maxValueX;<NEW_LINE>outY.data[indexOut] = maxValueY;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
InputSanityCheck.checkSameShape(inX, inY);
345,643
public FlowInfo analyseCode(BlockScope currentScope, FlowContext flowContext, FlowInfo flowInfo) {<NEW_LINE>// record variable initialization if any<NEW_LINE>if ((flowInfo.tagBits & FlowInfo.UNREACHABLE_OR_DEAD) == 0) {<NEW_LINE>// only set if actually reached<NEW_LINE>this.bits |= ASTNode.IsLocalDeclarationReachable;<NEW_LINE>}<NEW_LINE>if (this.initialization == null) {<NEW_LINE>return flowInfo;<NEW_LINE>}<NEW_LINE>this.initialization.checkNPEbyUnboxing(currentScope, flowContext, flowInfo);<NEW_LINE>FlowInfo preInitInfo = null;<NEW_LINE>boolean shouldAnalyseResource = this.binding != null && flowInfo.reachMode() == FlowInfo.REACHABLE && currentScope.compilerOptions().analyseResourceLeaks && FakedTrackingVariable.isAnyCloseable(this.initialization.resolvedType);<NEW_LINE>if (shouldAnalyseResource) {<NEW_LINE>preInitInfo = flowInfo.unconditionalCopy();<NEW_LINE>// analysis of resource leaks needs additional context while analyzing the RHS:<NEW_LINE>FakedTrackingVariable.preConnectTrackerAcrossAssignment(this, this.binding, this.initialization, flowInfo);<NEW_LINE>}<NEW_LINE>flowInfo = this.initialization.analyseCode(currentScope, flowContext, flowInfo).unconditionalInits();<NEW_LINE>if (shouldAnalyseResource)<NEW_LINE>FakedTrackingVariable.handleResourceAssignment(currentScope, preInitInfo, flowInfo, flowContext, this, this.initialization, this.binding);<NEW_LINE>else<NEW_LINE>FakedTrackingVariable.cleanUpAfterAssignment(currentScope, Binding.LOCAL, this.initialization);<NEW_LINE>int nullStatus = this.initialization.nullStatus(flowInfo, flowContext);<NEW_LINE>if (!flowInfo.isDefinitelyAssigned(this.binding)) {<NEW_LINE>// for local variable debug attributes<NEW_LINE>this.bits |= FirstAssignmentToLocal;<NEW_LINE>} else {<NEW_LINE>// int i = (i = 0);<NEW_LINE>this.bits &= ~FirstAssignmentToLocal;<NEW_LINE>}<NEW_LINE>flowInfo.markAsDefinitelyAssigned(this.binding);<NEW_LINE>if (currentScope.compilerOptions().isAnnotationBasedNullAnalysisEnabled) {<NEW_LINE>nullStatus = NullAnnotationMatching.checkAssignment(currentScope, flowContext, this.binding, flowInfo, nullStatus, this.<MASK><NEW_LINE>}<NEW_LINE>if ((this.binding.type.tagBits & TagBits.IsBaseType) == 0) {<NEW_LINE>flowInfo.markNullStatus(this.binding, nullStatus);<NEW_LINE>// no need to inform enclosing try block since its locals won't get<NEW_LINE>// known by the finally block<NEW_LINE>}<NEW_LINE>if (this.duplicateCheckObligation != null) {<NEW_LINE>this.duplicateCheckObligation.accept(flowInfo);<NEW_LINE>}<NEW_LINE>return flowInfo;<NEW_LINE>}
initialization, this.initialization.resolvedType);
797,972
private void refreshCommit() {<NEW_LINE>new RefreshCommitTask(getActivity(), repository, base, commentImageGetter) {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>protected FullCommit run(Account account) throws Exception {<NEW_LINE>FullCommit full = super.run(account);<NEW_LINE>List<CommitFile> files = full.getCommit().getFiles();<NEW_LINE>diffStyler.setFiles(files);<NEW_LINE>if (files != null)<NEW_LINE>Collections.sort(files, new CommitFileComparator());<NEW_LINE>return full;<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>protected void onSuccess(FullCommit commit) throws Exception {<NEW_LINE>super.onSuccess(commit);<NEW_LINE>updateList(commit.getCommit(), commit, commit.getFiles());<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>protected void onException(Exception e) throws RuntimeException {<NEW_LINE>super.onException(e);<NEW_LINE>ToastUtils.show(getActivity(), e, R.string.error_commit_load);<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>}.execute();<NEW_LINE>}
ViewUtils.setGone(progress, true);
34,302
public Optional<AbstractDeclaring> datatypeProvider() {<NEW_LINE>Optional<DeclaringType> typeDefining = declaringType().isPresent() ? Optional.of(declaringType().get().associatedTopLevel()) : Optional.<DeclaringType>absent();<NEW_LINE>Optional<DataMirror> typeDefined = typeDefining.isPresent() ? typeDefining.get().datatypeEnabled() : <MASK><NEW_LINE>Optional<DataMirror> packageDefined = packageOf().datatypeEnabled();<NEW_LINE>if (packageDefined.isPresent()) {<NEW_LINE>if (typeDefined.isPresent()) {<NEW_LINE>report().withElement(typeDefining.get().element()).annotationNamed(DataMirror.simpleName()).warning("@%s is also used on the package, this type level annotation is ignored", DataMirror.simpleName());<NEW_LINE>}<NEW_LINE>return Optional.<AbstractDeclaring>of(packageOf());<NEW_LINE>}<NEW_LINE>return typeDefined.isPresent() ? Optional.<AbstractDeclaring>of(typeDefining.get()) : Optional.<AbstractDeclaring>absent();<NEW_LINE>}
Optional.<DataMirror>absent();
1,063,367
public void init(boolean delay) {<NEW_LINE>final Account account = message.getConversation().getAccount();<NEW_LINE>this.file = mXmppConnectionService.getFileBackend().getFile(message, false);<NEW_LINE>final String mime;<NEW_LINE>if (message.getEncryption() == Message.ENCRYPTION_PGP || message.getEncryption() == Message.ENCRYPTION_DECRYPTED) {<NEW_LINE>mime = "application/pgp-encrypted";<NEW_LINE>} else {<NEW_LINE>mime = this.file.getMimeType();<NEW_LINE>}<NEW_LINE>final long originalFileSize = file.getSize();<NEW_LINE>this.delayed = delay;<NEW_LINE>if (Config.ENCRYPT_ON_HTTP_UPLOADED || message.getEncryption() == Message.ENCRYPTION_AXOLOTL || message.getEncryption() == Message.ENCRYPTION_OTR) {<NEW_LINE>this.key = new byte[44];<NEW_LINE>mXmppConnectionService.getRNG().nextBytes(this.key);<NEW_LINE>this.file.setKeyAndIv(this.key);<NEW_LINE>}<NEW_LINE>this.file.setExpectedSize(originalFileSize + (file.getKey() != null ? 16 : 0));<NEW_LINE>message.resetFileParams();<NEW_LINE>this.slotFuture = new SlotRequester(mXmppConnectionService).request(method, account, file, mime);<NEW_LINE>Futures.addCallback(this.slotFuture, new FutureCallback<SlotRequester.Slot>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onSuccess(@NullableDecl SlotRequester.Slot result) {<NEW_LINE>HttpUploadConnection.this.slot = result;<NEW_LINE>try {<NEW_LINE>HttpUploadConnection.this.upload();<NEW_LINE>} catch (final Exception e) {<NEW_LINE>fail(e.getMessage());<NEW_LINE>}<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onFailure(@NotNull final Throwable throwable) {<NEW_LINE>Log.d(Config.LOGTAG, account.getJid().asBareJid() + ": unable to request slot", throwable);<NEW_LINE>fail(throwable.getMessage());<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>message.setTransferable(this);<NEW_LINE>mXmppConnectionService.markMessage(message, Message.STATUS_UNSEND);<NEW_LINE>}
}, MoreExecutors.directExecutor());
481,119
private VirtualFile resolveAbsolutePath(@NotNull String path) {<NEW_LINE>VirtualFile asIsFile = pathToVirtualFile(path);<NEW_LINE>if (asIsFile != null) {<NEW_LINE>return asIsFile;<NEW_LINE>}<NEW_LINE>String projectBasePath = myProject.getBasePath();<NEW_LINE>if (projectBasePath != null) {<NEW_LINE>String projectBasedPath = path.startsWith(projectBasePath) ? path : new File(projectBasePath, path).getAbsolutePath();<NEW_LINE>VirtualFile projectBasedFile = pathToVirtualFile(projectBasedPath);<NEW_LINE>if (projectBasedFile != null) {<NEW_LINE>return projectBasedFile;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>Matcher filenameMatcher = PATTERN_FILENAME.matcher(path);<NEW_LINE>if (filenameMatcher.find()) {<NEW_LINE>String filename = filenameMatcher.group(1);<NEW_LINE>GlobalSearchScope projectScope = ProjectScope.getProjectScope(myProject);<NEW_LINE>PsiFile[] projectFiles = FilenameIndex.getFilesByName(myProject, filename, projectScope);<NEW_LINE>if (projectFiles.length > 0) {<NEW_LINE>return projectFiles[0].getVirtualFile();<NEW_LINE>}<NEW_LINE>GlobalSearchScope libraryScope = ProjectScope.getLibrariesScope(myProject);<NEW_LINE>PsiFile[] libraryFiles = FilenameIndex.getFilesByName(myProject, filename, libraryScope);<NEW_LINE>if (libraryFiles.length > 0) {<NEW_LINE>return <MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>}
libraryFiles[0].getVirtualFile();
1,068,621
final ListWorkteamsResult executeListWorkteams(ListWorkteamsRequest listWorkteamsRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(listWorkteamsRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE><MASK><NEW_LINE>Request<ListWorkteamsRequest> request = null;<NEW_LINE>Response<ListWorkteamsResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new ListWorkteamsRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(listWorkteamsRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "SageMaker");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ListWorkteams");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<ListWorkteamsResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new ListWorkteamsResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
1,122,447
/*<NEW_LINE>* Low-level API performing the actual compilation<NEW_LINE>*/<NEW_LINE>public void performCompilation() {<NEW_LINE>this.startTime = System.currentTimeMillis();<NEW_LINE>FileSystem environment = getLibraryAccess();<NEW_LINE>try {<NEW_LINE>this.compilerOptions = new CompilerOptions(this.options);<NEW_LINE>this.compilerOptions.performMethodsFullRecovery = false;<NEW_LINE>this.compilerOptions.performStatementsRecovery = false;<NEW_LINE>this.batchCompiler = new Compiler(environment, getHandlingPolicy(), this.compilerOptions, getBatchRequestor(), getProblemFactory(), this.out, this.progress);<NEW_LINE>this.batchCompiler.remainingIterations = this.maxRepetition - this.currentRepetition;<NEW_LINE>// temporary code to allow the compiler to revert to a single thread<NEW_LINE>// $NON-NLS-1$<NEW_LINE>String setting = System.getProperty("jdt.compiler.useSingleThread");<NEW_LINE>// $NON-NLS-1$<NEW_LINE>this.batchCompiler.useSingleThread = setting != null && setting.equals("true");<NEW_LINE>if (this.compilerOptions.complianceLevel >= ClassFileConstants.JDK1_6 && this.compilerOptions.processAnnotations) {<NEW_LINE>if (checkVMVersion(ClassFileConstants.JDK1_6)) {<NEW_LINE>initializeAnnotationProcessorManager();<NEW_LINE>if (this.classNames != null) {<NEW_LINE>this.batchCompiler.setBinaryTypes(processClassNames(this.batchCompiler.lookupEnvironment));<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>// report a warning<NEW_LINE>this.logger.logIncorrectVMVersionForAnnotationProcessing();<NEW_LINE>}<NEW_LINE>if (checkVMVersion(ClassFileConstants.JDK9)) {<NEW_LINE>initRootModules(this.batchCompiler.lookupEnvironment, environment);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// set the non-externally configurable options.<NEW_LINE>this.compilerOptions.verbose = this.verbose;<NEW_LINE>this<MASK><NEW_LINE>try {<NEW_LINE>this.logger.startLoggingSources();<NEW_LINE>this.batchCompiler.compile(getCompilationUnits());<NEW_LINE>} finally {<NEW_LINE>this.logger.endLoggingSources();<NEW_LINE>}<NEW_LINE>if (this.extraProblems != null) {<NEW_LINE>loggingExtraProblems();<NEW_LINE>this.extraProblems = null;<NEW_LINE>}<NEW_LINE>if (this.compilerStats != null) {<NEW_LINE>this.compilerStats[this.currentRepetition] = this.batchCompiler.stats;<NEW_LINE>}<NEW_LINE>this.logger.printStats();<NEW_LINE>} finally {<NEW_LINE>// cleanup<NEW_LINE>environment.cleanup();<NEW_LINE>}<NEW_LINE>}
.compilerOptions.produceReferenceInfo = this.produceRefInfo;
792,414
public boolean includeBean(Class<?> beanClass, String beanName) {<NEW_LINE>Class<?> mbeanInterface;<NEW_LINE>if (Proxy.isProxyClass(beanClass)) {<NEW_LINE>Class[] implementedInterfaces = ClassUtils.getAllInterfacesForClass(beanClass);<NEW_LINE>mbeanInterface = Arrays.stream(implementedInterfaces).filter(i -> i.getName().endsWith(MBEAN_SUFFIX)).findFirst().orElse(null);<NEW_LINE>} else {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>if (mbeanInterface != null) {<NEW_LINE>JmxBean a = mbeanInterface.getAnnotation(JmxBean.class);<NEW_LINE>if (a != null) {<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// find with @org.springframework.jmx.export.annotation.ManagedResource and @JmxBean annotations<NEW_LINE>Class<?>[] implementedInterfaces = ClassUtils.getAllInterfacesForClass(beanClass);<NEW_LINE>for (Class<?> ifc : implementedInterfaces) {<NEW_LINE>ManagedResource metadata = attributeSource.getManagedResource(ifc);<NEW_LINE>if (metadata != null) {<NEW_LINE>JmxBean a = ifc.getAnnotation(JmxBean.class);<NEW_LINE>if (a != null) {<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>}
mbeanInterface = JmxUtils.getMBeanInterface(beanClass);
1,061,543
public void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory) {<NEW_LINE>final BindResult<WebEndpointProperties> result = Binder.get(environment).bind(MANAGEMENT_ENDPOINTS_WEB, WebEndpointProperties.class);<NEW_LINE>if (result.isBound()) {<NEW_LINE><MASK><NEW_LINE>List<GroupedOpenApi> newGroups = new ArrayList<>();<NEW_LINE>ActuatorOpenApiCustomizer actuatorOpenApiCustomiser = new ActuatorOpenApiCustomizer(webEndpointProperties);<NEW_LINE>beanFactory.registerSingleton("actuatorOpenApiCustomiser", actuatorOpenApiCustomiser);<NEW_LINE>ActuatorOperationCustomizer actuatorCustomizer = new ActuatorOperationCustomizer();<NEW_LINE>beanFactory.registerSingleton("actuatorCustomizer", actuatorCustomizer);<NEW_LINE>GroupedOpenApi actuatorGroup = GroupedOpenApi.builder().group(ACTUATOR_DEFAULT_GROUP).pathsToMatch(webEndpointProperties.getBasePath() + ALL_PATTERN).pathsToExclude(webEndpointProperties.getBasePath() + HEALTH_PATTERN).addOperationCustomizer(actuatorCustomizer).addOpenApiCustomiser(actuatorOpenApiCustomiser).build();<NEW_LINE>// Add the actuator group<NEW_LINE>newGroups.add(actuatorGroup);<NEW_LINE>if (CollectionUtils.isEmpty(groupedOpenApis)) {<NEW_LINE>GroupedOpenApi defaultGroup = GroupedOpenApi.builder().group(DEFAULT_GROUP_NAME).pathsToMatch(ALL_PATTERN).pathsToExclude(webEndpointProperties.getBasePath() + ALL_PATTERN).build();<NEW_LINE>// Register the default group<NEW_LINE>newGroups.add(defaultGroup);<NEW_LINE>}<NEW_LINE>newGroups.forEach(elt -> beanFactory.registerSingleton(elt.getGroup(), elt));<NEW_LINE>}<NEW_LINE>initBeanFactoryPostProcessor(beanFactory);<NEW_LINE>}
WebEndpointProperties webEndpointProperties = result.get();
1,101,734
final CreateCustomMetricResult executeCreateCustomMetric(CreateCustomMetricRequest createCustomMetricRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(createCustomMetricRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<CreateCustomMetricRequest> request = null;<NEW_LINE>Response<CreateCustomMetricResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new CreateCustomMetricRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(createCustomMetricRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "IoT");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "CreateCustomMetric");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<CreateCustomMetricResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new CreateCustomMetricResultJsonUnmarshaller());<NEW_LINE>response = <MASK><NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
invoke(request, responseHandler, executionContext);
512,271
public // }<NEW_LINE>DataOutputX writeBlob(byte[] value, int offset, int length) throws IOException {<NEW_LINE>if (value == null || value.length == 0) {<NEW_LINE>writeByte((byte) 0);<NEW_LINE>} else {<NEW_LINE>int len = Math.min(length, value.length - offset);<NEW_LINE>if (len <= 253) {<NEW_LINE>writeByte((byte) len);<NEW_LINE>write(value, offset, len);<NEW_LINE>} else if (len <= 65535) {<NEW_LINE>byte[] buff = new byte[3];<NEW_LINE>buff[0] = (byte) 255;<NEW_LINE>write(toBytes(buff, 1, (short) len));<NEW_LINE>write(value, offset, len);<NEW_LINE>} else {<NEW_LINE>byte[<MASK><NEW_LINE>buff[0] = (byte) 254;<NEW_LINE>write(toBytes(buff, 1, len));<NEW_LINE>write(value, offset, len);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return this;<NEW_LINE>}
] buff = new byte[5];
1,461,395
public void migratePrimaryTab(final I_AD_Tab masterTab) {<NEW_LINE>if (windowDAO.hasUISections(masterTab)) {<NEW_LINE>log("Skip migrating {} because already has sections", masterTab);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final I_AD_UI_Section uiSection = createUISection(masterTab, 10);<NEW_LINE>final I_AD_UI_Column <MASK><NEW_LINE>@SuppressWarnings("unused")<NEW_LINE>final I_AD_UI_Column uiColumnRight = createUIColumn(uiSection, 20);<NEW_LINE>final I_AD_UI_ElementGroup uiElementGroup_Left_Default = createUIElementGroup(uiColumnLeft, 10);<NEW_LINE>final List<I_AD_Field> adFields = new ArrayList<>(Services.get(IADWindowDAO.class).retrieveFields(masterTab));<NEW_LINE>adFields.sort(ORDERING_AD_Field_BySeqNo);<NEW_LINE>final Map<String, I_AD_UI_Element> uiElementsById = new HashMap<>();<NEW_LINE>final AtomicInteger uiElement_nextSeqNo = new AtomicInteger(10);<NEW_LINE>final AtomicInteger uiElement_nextSeqNoGrid = new AtomicInteger(10);<NEW_LINE>for (final I_AD_Field adField : adFields) {<NEW_LINE>if (!adField.isActive()) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (!adField.isDisplayed() && !adField.isDisplayedGrid()) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (adField.getIncluded_Tab_ID() > 0) {<NEW_LINE>// skip included tabs<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>final String uiElementId = extractElementId(adField);<NEW_LINE>I_AD_UI_Element uiElement = uiElementsById.get(uiElementId);<NEW_LINE>if (uiElement == null) {<NEW_LINE>uiElement = createUIElement(uiElementGroup_Left_Default, adField, uiElement_nextSeqNo, uiElement_nextSeqNoGrid);<NEW_LINE>if (uiElement != null) {<NEW_LINE>uiElementsById.put(uiElementId, uiElement);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>createUIElementField(uiElement, adField);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
uiColumnLeft = createUIColumn(uiSection, 10);
1,741,593
public String stats(int printPrecision) {<NEW_LINE>// Calculate AUC and also print counts, for each output<NEW_LINE>StringBuilder sb = new StringBuilder();<NEW_LINE>int maxLabelsLength = 15;<NEW_LINE>if (labels != null) {<NEW_LINE>for (String s : labels) {<NEW_LINE>maxLabelsLength = Math.max(s.length(), maxLabelsLength);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>String patternHeader = "%-" + (maxLabelsLength + 5) + "s%-12s%-12s%-10s%-10s";<NEW_LINE>String header = String.format(patternHeader, "Label", <MASK><NEW_LINE>// Label<NEW_LINE>String // Label<NEW_LINE>pattern = // AUC<NEW_LINE>"%-" + (maxLabelsLength + 5) + "s" + "%-12." + printPrecision + "f" + "%-12." + // AUPRC<NEW_LINE>printPrecision + // Count pos, count neg<NEW_LINE>"f" + "%-10d%-10d";<NEW_LINE>sb.append(header);<NEW_LINE>if (underlying != null) {<NEW_LINE>for (int i = 0; i < underlying.length; i++) {<NEW_LINE>double auc = calculateAUC(i);<NEW_LINE>double auprc = calculateAUCPR(i);<NEW_LINE>String label = (labels == null ? String.valueOf(i) : labels.get(i));<NEW_LINE>sb.append("\n").append(String.format(pattern, label, auc, auprc, getCountActualPositive(i), getCountActualNegative(i)));<NEW_LINE>}<NEW_LINE>if (thresholdSteps > 0) {<NEW_LINE>sb.append("\n");<NEW_LINE>sb.append("[Note: Thresholded AUC/AUPRC calculation used with ").append(thresholdSteps).append(" steps); accuracy may reduced compared to exact mode]");<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>// Empty evaluation<NEW_LINE>sb.append("\n-- No Data --\n");<NEW_LINE>}<NEW_LINE>return sb.toString();<NEW_LINE>}
"AUC", "AUPRC", "# Pos", "# Neg");
1,608,898
private File createSegment(File csvDataFile) {<NEW_LINE>// create segment<NEW_LINE>LOGGER.info("Started creating segment from file: {}", csvDataFile);<NEW_LINE>String outDir = new File(_workingDir, "segment").getAbsolutePath();<NEW_LINE>SegmentGeneratorConfig segmentGeneratorConfig = getSegmentGeneratorConfig(csvDataFile, outDir);<NEW_LINE>SegmentIndexCreationDriver driver = new SegmentIndexCreationDriverImpl();<NEW_LINE>try {<NEW_LINE>driver.init(segmentGeneratorConfig);<NEW_LINE>driver.build();<NEW_LINE>} catch (Exception e) {<NEW_LINE>FileUtils.<MASK><NEW_LINE>File csvDir = csvDataFile.getParentFile();<NEW_LINE>FileUtils.deleteQuietly(csvDir);<NEW_LINE>throw new RuntimeException("Caught exception while generating segment from file: " + csvDataFile, e);<NEW_LINE>}<NEW_LINE>String segmentName = driver.getSegmentName();<NEW_LINE>File indexDir = new File(outDir, segmentName);<NEW_LINE>LOGGER.info("Successfully created segment: {} at directory: {}", segmentName, indexDir);<NEW_LINE>// verify segment<NEW_LINE>LOGGER.info("Verifying the segment by loading it");<NEW_LINE>ImmutableSegment segment;<NEW_LINE>try {<NEW_LINE>segment = ImmutableSegmentLoader.load(indexDir, ReadMode.mmap);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new RuntimeException("Caught exception while verifying the created segment", e);<NEW_LINE>}<NEW_LINE>LOGGER.info("Successfully loaded segment: {} of size: {} bytes", segmentName, segment.getSegmentSizeBytes());<NEW_LINE>segment.destroy();<NEW_LINE>return indexDir;<NEW_LINE>}
deleteQuietly(new File(outDir));
109,932
public com.amazonaws.services.codedeploy.model.InvalidComputePlatformException unmarshallFromContext(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>com.amazonaws.services.codedeploy.model.InvalidComputePlatformException invalidComputePlatformException = new com.amazonaws.services.<MASK><NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>} 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 invalidComputePlatformException;<NEW_LINE>}
codedeploy.model.InvalidComputePlatformException(null);
692,842
// must called after tupleDescriptor is computed<NEW_LINE>public void complete() throws UserException {<NEW_LINE>TOlapTableSink tSink = tDataSink.getOlapTableSink();<NEW_LINE>tSink.setTableId(dstTable.getId());<NEW_LINE>tSink.setTupleId(tupleDescriptor.getId().asInt());<NEW_LINE>int numReplicas = 1;<NEW_LINE>for (Partition partition : dstTable.getPartitions()) {<NEW_LINE>numReplicas = dstTable.getPartitionInfo().getReplicaAllocation(partition.getId()).getTotalReplicaNum();<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>tSink.setNumReplicas(numReplicas);<NEW_LINE>tSink.setNeedGenRollup(dstTable.shouldLoadToNewRollup());<NEW_LINE>tSink.setSchema(createSchema(tSink.getDbId(), dstTable));<NEW_LINE>tSink.setPartition(createPartition(tSink.getDbId(), dstTable));<NEW_LINE>List<TOlapTableLocationParam> locationParams = createLocation(dstTable);<NEW_LINE>tSink.setLocation(locationParams.get(0));<NEW_LINE>if (singleReplicaLoad) {<NEW_LINE>tSink.setSlaveLocation(locationParams.get(1));<NEW_LINE>}<NEW_LINE>tSink.setWriteSingleReplica(singleReplicaLoad);<NEW_LINE><MASK><NEW_LINE>}
tSink.setNodesInfo(createPaloNodesInfo());
1,268,341
private void doCloseSubscription(final Subscription subscriptionToClose) {<NEW_LINE>if (isClosed) {<NEW_LINE>// don't need to adjust the subscriptions when closed<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// close subscription<NEW_LINE>subscriptionToClose.isClosed = true;<NEW_LINE>subscriptionToClose.position.reset();<NEW_LINE>// remove from list<NEW_LINE>final int len = subscriptions.length;<NEW_LINE>int index = 0;<NEW_LINE>for (int i = 0; i < len; i++) {<NEW_LINE>if (subscriptionToClose == subscriptions[i]) {<NEW_LINE>index = i;<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>final Subscription[] newSubscriptions;<NEW_LINE>final <MASK><NEW_LINE>if (numMoved == 0) {<NEW_LINE>newSubscriptions = Arrays.copyOf(subscriptions, len - 1);<NEW_LINE>} else {<NEW_LINE>newSubscriptions = new Subscription[len - 1];<NEW_LINE>System.arraycopy(subscriptions, 0, newSubscriptions, 0, index);<NEW_LINE>System.arraycopy(subscriptions, index + 1, newSubscriptions, index, numMoved);<NEW_LINE>}<NEW_LINE>subscriptions = newSubscriptions;<NEW_LINE>// ensuring that the publisher limit is updated<NEW_LINE>dataConsumed.signal();<NEW_LINE>}
int numMoved = len - index - 1;
511,328
private void dialogChanged() {<NEW_LINE>String location = getLocation();<NEW_LINE>String fileName = getFileName();<NEW_LINE>Path path = new Path(location);<NEW_LINE>if (location.length() == 0) {<NEW_LINE>updateStatus("File location must be specified");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (fileName.length() == 0) {<NEW_LINE>updateStatus("File name must be specified");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>int segmentCount = path.segmentCount();<NEW_LINE>if (segmentCount < 2) {<NEW_LINE>// this is a project - check for it's existance<NEW_LINE>IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject(location);<NEW_LINE>if (!project.exists()) {<NEW_LINE>updateStatus("Project does not exist");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>IFile file = project.getFile(fileName);<NEW_LINE>if (file.exists()) {<NEW_LINE>updateStatus("File Already Exists");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>IFolder folder = ResourcesPlugin.getWorkspace().getRoot().getFolder(path);<NEW_LINE>if (!folder.exists()) {<NEW_LINE>updateStatus("Location does not exist");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>IFile file = folder.getFile(fileName);<NEW_LINE>if (file.exists()) {<NEW_LINE>updateStatus("File Already Exists");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>int <MASK><NEW_LINE>if (dotLoc != -1) {<NEW_LINE>String ext = fileName.substring(dotLoc + 1);<NEW_LINE>if (ext.equalsIgnoreCase("xml") == false) {<NEW_LINE>updateStatus("File extension must be \"xml\"");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>updateStatus("File extension must be \"xml\"");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>updateStatus(null);<NEW_LINE>}
dotLoc = fileName.lastIndexOf('.');
221,633
ArrayList<Object> new202() /* reduce ANonTerminal$Declaration */<NEW_LINE>{<NEW_LINE>@SuppressWarnings("hiding")<NEW_LINE>ArrayList<Object> nodeList = new ArrayList<Object>();<NEW_LINE>@SuppressWarnings("unused")<NEW_LINE>ArrayList<Object> nodeArrayList2 = pop();<NEW_LINE>@SuppressWarnings("unused")<NEW_LINE>ArrayList<Object> nodeArrayList1 = pop();<NEW_LINE>LinkedList<Object> listNode3 <MASK><NEW_LINE>{<NEW_LINE>// Block<NEW_LINE>LinkedList<Object> listNode1 = new LinkedList<Object>();<NEW_LINE>PDeclaration pdeclarationNode2;<NEW_LINE>listNode1 = (LinkedList) nodeArrayList1.get(0);<NEW_LINE>pdeclarationNode2 = (PDeclaration) nodeArrayList2.get(0);<NEW_LINE>if (listNode1 != null) {<NEW_LINE>listNode3.addAll(listNode1);<NEW_LINE>}<NEW_LINE>if (pdeclarationNode2 != null) {<NEW_LINE>listNode3.add(pdeclarationNode2);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>nodeList.add(listNode3);<NEW_LINE>return nodeList;<NEW_LINE>}
= new LinkedList<Object>();
1,171,657
public boolean process(List<Point2D_F64> observations, List<Se3_F64> listWorldToView, Point3D_F64 worldPt, Point3D_F64 refinedPt) {<NEW_LINE>func.setObservations(observations, listWorldToView);<NEW_LINE>minimizer.setFunction(func, null);<NEW_LINE><MASK><NEW_LINE>param[1] = worldPt.y;<NEW_LINE>param[2] = worldPt.z;<NEW_LINE>minimizer.initialize(param, 0, convergenceTol * observations.size());<NEW_LINE>for (int i = 0; i < maxIterations; i++) {<NEW_LINE>if (minimizer.iterate())<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>double[] found = minimizer.getParameters();<NEW_LINE>refinedPt.x = found[0];<NEW_LINE>refinedPt.y = found[1];<NEW_LINE>refinedPt.z = found[2];<NEW_LINE>return true;<NEW_LINE>}
param[0] = worldPt.x;
534,273
public void drawU(UGraphic ug) {<NEW_LINE>final double thickness = ug.getParam().getStroke().getThickness();<NEW_LINE>final double radius = 4 + thickness - 1;<NEW_LINE>final double lineHeight = 4 + thickness - 1;<NEW_LINE>final int xWing = 4;<NEW_LINE>final AffineTransform rotate = AffineTransform.getRotateInstance(this.angle);<NEW_LINE>Point2D middle = new Point2D.Double(0, 0);<NEW_LINE>Point2D base = new Point2D.Double(-xWing - radius - 3, 0);<NEW_LINE>Point2D circleBase = new Point2D.Double(-xWing - radius - 3, 0);<NEW_LINE>Point2D lineTop = new Point2D.Double(-xWing, -lineHeight);<NEW_LINE>Point2D lineBottom = new Point2D.Double(-xWing, lineHeight);<NEW_LINE>rotate.transform(lineTop, lineTop);<NEW_LINE>rotate.transform(lineBottom, lineBottom);<NEW_LINE>rotate.transform(base, base);<NEW_LINE>rotate.transform(circleBase, circleBase);<NEW_LINE>drawLine(ug, contact.getX(), contact.getY(), base, middle);<NEW_LINE>final UStroke stroke = new UStroke(thickness);<NEW_LINE>ug.apply(new UTranslate(contact.getX() + circleBase.getX() - radius, contact.getY() + circleBase.getY() - radius)).apply(stroke).draw(new UEllipse(2 * radius, 2 * radius));<NEW_LINE>drawLine(ug.apply(stroke), contact.getX(), contact.<MASK><NEW_LINE>}
getY(), lineTop, lineBottom);
1,714,837
public StreamsBuilder topology() {<NEW_LINE>StreamsBuilder builder = new KafkaStreamsBuilder();<NEW_LINE>// executor<NEW_LINE>builder.addStateStore(Stores.keyValueStoreBuilder(Stores.persistentKeyValueStore(EXECUTOR_STATE_STORE_NAME), Serdes.String(), JsonSerde.of(Executor.class)));<NEW_LINE>// WorkerTask deduplication<NEW_LINE>builder.addStateStore(Stores.keyValueStoreBuilder(Stores.persistentKeyValueStore(WORKERTASK_DEDUPLICATION_STATE_STORE_NAME), Serdes.String(), Serdes.String()));<NEW_LINE>// next deduplication<NEW_LINE>builder.addStateStore(Stores.keyValueStoreBuilder(Stores.persistentKeyValueStore(NEXTS_DEDUPLICATION_STATE_STORE_NAME), Serdes.String(), JsonSerde.of(ExecutorNextTransformer.Store.class)));<NEW_LINE>// trigger deduplication<NEW_LINE>builder.addStateStore(Stores.keyValueStoreBuilder(Stores.persistentKeyValueStore(TRIGGER_DEDUPLICATION_STATE_STORE_NAME), Serdes.String()<MASK><NEW_LINE>// declare common stream<NEW_LINE>KStream<String, WorkerTaskResult> workerTaskResultKStream = this.workerTaskResultKStream(builder);<NEW_LINE>KStream<String, Executor> executorKStream = this.executorKStream(builder);<NEW_LINE>// join with killed<NEW_LINE>KStream<String, ExecutionKilled> executionKilledKStream = this.executionKilledKStream(builder);<NEW_LINE>KStream<String, Executor> executionWithKilled = this.joinExecutionKilled(executionKilledKStream, executorKStream);<NEW_LINE>// join with WorkerResult<NEW_LINE>KStream<String, Executor> executionKStream = this.joinWorkerResult(workerTaskResultKStream, executionWithKilled);<NEW_LINE>// handle state on execution<NEW_LINE>KStream<String, Executor> stream = kafkaStreamSourceService.executorWithFlow(executionKStream, true);<NEW_LINE>stream = this.handleExecutor(stream);<NEW_LINE>// save execution<NEW_LINE>this.toExecution(stream);<NEW_LINE>this.toWorkerTask(stream);<NEW_LINE>this.toWorkerTaskResult(stream);<NEW_LINE>this.toExecutorFlowTriggerTopic(stream);<NEW_LINE>// task Flow<NEW_LINE>KTable<String, WorkerTaskExecution> workerTaskExecutionKTable = this.workerTaskExecutionStream(builder);<NEW_LINE>KStream<String, WorkerTaskExecution> workerTaskExecutionKStream = this.deduplicateWorkerTaskExecution(stream);<NEW_LINE>this.toWorkerTaskExecution(workerTaskExecutionKStream);<NEW_LINE>this.workerTaskExecutionToExecution(workerTaskExecutionKStream);<NEW_LINE>this.handleWorkerTaskExecution(workerTaskExecutionKTable, stream);<NEW_LINE>// purge at end<NEW_LINE>this.purgeExecutor(stream);<NEW_LINE>this.purgeWorkerRunning(workerTaskResultKStream);<NEW_LINE>return builder;<NEW_LINE>}
, Serdes.String()));
911,420
public Object evaluate(ExpressionTemplate template, ExpressionTemplateContext context) throws IOException {<NEW_LINE>Object operand = getOperand().evaluate(template, context);<NEW_LINE>if (getOperator() == UnaryOperator.Negate) {<NEW_LINE>if (operand instanceof Integer) {<NEW_LINE>return -(Integer) operand;<NEW_LINE>} else if (operand instanceof Float) {<NEW_LINE>return -(Float) operand;<NEW_LINE>} else if (operand instanceof Double) {<NEW_LINE>return -(Double) operand;<NEW_LINE>} else if (operand instanceof Byte) {<NEW_LINE>return -(Byte) operand;<NEW_LINE>} else if (operand instanceof Short) {<NEW_LINE>return -(Short) operand;<NEW_LINE>} else if (operand instanceof Long) {<NEW_LINE>return -(Long) operand;<NEW_LINE>} else {<NEW_LINE>ExpressionError.error("Operand of operator '" + getOperator().name() + "' must be a number, got " + operand, getSpan());<NEW_LINE>// never reached<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>} else if (getOperator() == UnaryOperator.Not) {<NEW_LINE>if (!(operand instanceof Boolean)) {<NEW_LINE>ExpressionError.error("Operand of operator '" + getOperator().name(<MASK><NEW_LINE>}<NEW_LINE>return !(Boolean) operand;<NEW_LINE>} else {<NEW_LINE>return operand;<NEW_LINE>}<NEW_LINE>}
) + "' must be a boolean", getSpan());
208,287
private Mono<Response<Void>> stopWebSiteNetworkTraceSlotWithResponseAsync(String resourceGroupName, String name, String slot, Context context) {<NEW_LINE>if (this.client.getEndpoint() == null) {<NEW_LINE>return Mono.<MASK><NEW_LINE>}<NEW_LINE>if (resourceGroupName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (name == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (slot == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (this.client.getSubscriptionId() == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."));<NEW_LINE>}<NEW_LINE>context = this.client.mergeContext(context);<NEW_LINE>return service.stopWebSiteNetworkTraceSlot(this.client.getEndpoint(), resourceGroupName, name, slot, this.client.getSubscriptionId(), this.client.getApiVersion(), context);<NEW_LINE>}
error(new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
555,700
public PNode visit(SimpleSSTNode node) {<NEW_LINE>PNode result = null;<NEW_LINE>switch(node.type) {<NEW_LINE>case BREAK:<NEW_LINE>result = new BreakNode();<NEW_LINE>result.assignSourceSection(createSourceSection(node.startOffset, node.endOffset));<NEW_LINE>break;<NEW_LINE>case CONTINUE:<NEW_LINE>result = new ContinueNode();<NEW_LINE>result.assignSourceSection(createSourceSection(node.startOffset, node.endOffset));<NEW_LINE>break;<NEW_LINE>case PASS:<NEW_LINE>case EMPTY:<NEW_LINE>EmptyNode emptyNode = EmptyNode.create();<NEW_LINE>emptyNode.assignSourceSection(createSourceSection(node.startOffset, node.endOffset));<NEW_LINE>result = emptyNode.asStatement();<NEW_LINE>break;<NEW_LINE>case NONE:<NEW_LINE>result = new ObjectLiteralNode(PNone.NONE);<NEW_LINE>if (node.startOffset < node.endOffset) {<NEW_LINE>result.assignSourceSection(createSourceSection(node.startOffset, node.endOffset));<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>case ELLIPSIS:<NEW_LINE>result = new ObjectLiteralNode(PEllipsis.INSTANCE);<NEW_LINE>result.assignSourceSection(createSourceSection(node<MASK><NEW_LINE>break;<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>}
.startOffset, node.endOffset));
1,067,334
protected void launchGroovy(final IType runType, final IJavaProject javaProject, final String mode) {<NEW_LINE>try {<NEW_LINE>boolean excludeTestCode = (runType != null && !hasTestAttribute(runType));<NEW_LINE>Map<String, String> <MASK><NEW_LINE>String launchName = (runType != null ? runType.getElementName() : javaProject.getElementName());<NEW_LINE>ILaunchConfigurationWorkingCopy workingCopy = findOrCreateLaunchConfig(launchProperties, launchName);<NEW_LINE>List<String> classpath = new ArrayList<>();<NEW_LINE>classpath.add(newArchiveRuntimeClasspathEntry(getExportedGroovyAllJar()).getMemento());<NEW_LINE>for (IPath jarPath : getExtraJarsForClasspath()) {<NEW_LINE>classpath.add(newArchiveRuntimeClasspathEntry(jarPath).getMemento());<NEW_LINE>}<NEW_LINE>Enumeration<URL> jarUrls = getActiveGroovyBundle().findEntries("lib/" + applicationOrConsole().toLowerCase(), "*.jar", false);<NEW_LINE>if (jarUrls != null) {<NEW_LINE>for (URL jarUrl : Collections.list(jarUrls)) {<NEW_LINE>classpath.add(newArchiveRuntimeClasspathEntry(new Path(FileLocator.toFileURL(jarUrl).getPath())).getMemento());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>List<String> sourcepath = new ArrayList<>();<NEW_LINE>for (IRuntimeClasspathEntry entry : computeUnresolvedRuntimeClasspath(javaProject, excludeTestCode)) {<NEW_LINE>sourcepath.add(entry.getMemento());<NEW_LINE>}<NEW_LINE>workingCopy.setAttribute(ATTR_CLASSPATH, classpath);<NEW_LINE>workingCopy.setAttribute(ATTR_SOURCE_PATH, sourcepath);<NEW_LINE>workingCopy.setAttribute(ATTR_DEFAULT_CLASSPATH, false);<NEW_LINE>workingCopy.setAttribute(ATTR_DEFAULT_SOURCE_PATH, false);<NEW_LINE>workingCopy.setAttribute(ATTR_EXCLUDE_TEST_CODE, excludeTestCode);<NEW_LINE>ILaunchConfiguration config = workingCopy.doSave();<NEW_LINE>DebugUITools.launch(config, mode);<NEW_LINE>} catch (Exception e) {<NEW_LINE>GroovyCore.logException(LaunchShortcutHelper.bind(LaunchShortcutHelper.GroovyLaunchShortcut_failureToLaunch, applicationOrConsole()), e);<NEW_LINE>}<NEW_LINE>}
launchProperties = createLaunchProperties(runType, javaProject);
516,440
public void run() {<NEW_LINE>status = Status.DOWNLOADING;<NEW_LINE>stateChanged();<NEW_LINE>RandomAccessFile file = null;<NEW_LINE>InputStream stream = null;<NEW_LINE>HttpURLConnection connection = null;<NEW_LINE>for (URL u : locations) {<NEW_LINE>try {<NEW_LINE>System.out.<MASK><NEW_LINE>// Open connection to URL.<NEW_LINE>connection = openAndRedirectIfRequired(u);<NEW_LINE>// Make sure response code is in the 200 range.<NEW_LINE>if (connection.getResponseCode() / 100 != 2) {<NEW_LINE>throw new IOException("Non-OK response code: " + connection.getResponseCode() + " (" + connection.getResponseMessage() + ")");<NEW_LINE>}<NEW_LINE>System.out.println("...connected");<NEW_LINE>// Check for valid content length.<NEW_LINE>int contentLength = connection.getContentLength();<NEW_LINE>if (contentLength > -1) {<NEW_LINE>if (contentLength != packageSize) {<NEW_LINE>throw new IOException("Expected package size " + packageSize + ", but web server reports " + contentLength);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (size == -1) {<NEW_LINE>size = packageSize;<NEW_LINE>stateChanged();<NEW_LINE>}<NEW_LINE>System.out.println("...downloading" + (downloaded > 0 ? " from byte " + downloaded : ""));<NEW_LINE>boolean success = tryToDownloadFromLocation(file, stream, connection);<NEW_LINE>if (success) {<NEW_LINE>// current location seems OK, leave loop<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>} catch (Exception exc) {<NEW_LINE>exc.printStackTrace();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
println("Trying location " + u + "...");
1,017,981
public Result implement(MycatEnumerableRelImplementor implementor, Prefer pref) {<NEW_LINE>final BlockBuilder builder = new BlockBuilder();<NEW_LINE>final Result leftResult = implementor.visitChild(this, 0, (EnumerableRel) left, pref);<NEW_LINE>Expression leftExpression = toEnumerate(builder.append("left", leftResult.block));<NEW_LINE>final Result rightResult = implementor.visitChild(this, 1, (EnumerableRel) right, pref);<NEW_LINE>Expression rightExpression = toEnumerate(builder.append("right", rightResult.block));<NEW_LINE>final PhysType physType = PhysTypeImpl.of(implementor.getTypeFactory(), getRowType(<MASK><NEW_LINE>final Expression predicate = EnumUtils.generatePredicate(implementor, getCluster().getRexBuilder(), left, right, leftResult.physType, rightResult.physType, condition);<NEW_LINE>return implementor.result(physType, builder.append(Expressions.call(BuiltInMethod.NESTED_LOOP_JOIN.method, leftExpression, rightExpression, predicate, EnumUtils.joinSelector(joinType, physType, ImmutableList.of(leftResult.physType, rightResult.physType)), Expressions.constant(EnumUtils.toLinq4jJoinType(joinType)))).toBlock());<NEW_LINE>}
), pref.preferArray());
432,012
private UserDashboardItemId createUserDashboardItemAndSave(@NonNull final UserDashboardId dashboardId, @NonNull final UserDashboardItemAddRequest request) {<NEW_LINE>//<NEW_LINE>// Get the KPI<NEW_LINE>final int kpiId = request.getKpiId();<NEW_LINE>if (kpiId <= 0) {<NEW_LINE>throw new AdempiereException("kpiId is not set").setParameter("request", request);<NEW_LINE>}<NEW_LINE>final I_WEBUI_KPI kpi = InterfaceWrapperHelper.loadOutOfTrx(kpiId, I_WEBUI_KPI.class);<NEW_LINE>final DashboardWidgetType widgetType = request.getWidgetType();<NEW_LINE>final int seqNo = retrieveLastSeqNo(dashboardId, widgetType) + 10;<NEW_LINE>//<NEW_LINE>final I_WEBUI_DashboardItem webuiDashboardItem = InterfaceWrapperHelper.newInstance(I_WEBUI_DashboardItem.class);<NEW_LINE>webuiDashboardItem.setWEBUI_Dashboard_ID(dashboardId.getRepoId());<NEW_LINE>webuiDashboardItem.setIsActive(true);<NEW_LINE>webuiDashboardItem.setName(kpi.getName());<NEW_LINE>webuiDashboardItem.setSeqNo(seqNo);<NEW_LINE>webuiDashboardItem.setWEBUI_KPI_ID(kpiId);<NEW_LINE>webuiDashboardItem.setWEBUI_DashboardWidgetType(widgetType.getCode());<NEW_LINE>// will be set by change request:<NEW_LINE>// webuiDashboardItem.setES_TimeRange(esTimeRange);<NEW_LINE>// webuiDashboardItem.setES_TimeRange_End(esTimeRangeEnd);<NEW_LINE>InterfaceWrapperHelper.save(webuiDashboardItem);<NEW_LINE>logger.<MASK><NEW_LINE>// TODO: copy trl but also consider the request.getCaption() and use it only for the current language trl.<NEW_LINE>//<NEW_LINE>// Apply the change request<NEW_LINE>if (request.getChangeRequest() != null) {<NEW_LINE>changeUserDashboardItemAndSave(webuiDashboardItem, request.getChangeRequest());<NEW_LINE>}<NEW_LINE>return UserDashboardItemId.ofRepoId(webuiDashboardItem.getWEBUI_DashboardItem_ID());<NEW_LINE>}
trace("Created {} for dashboard {}", webuiDashboardItem, dashboardId);
414,957
public static PdfFunction type0(PdfWriter writer, float[] domain, float[] range, int[] size, int bitsPerSample, int order, float[] encode, float[] decode, byte[] stream) {<NEW_LINE>PdfFunction func = new PdfFunction(writer);<NEW_LINE>func.dictionary = new PdfStream(stream);<NEW_LINE>((PdfStream) func.dictionary).flateCompress(writer.getCompressionLevel());<NEW_LINE>func.dictionary.put(PdfName.FUNCTIONTYPE, new PdfNumber(0));<NEW_LINE>func.dictionary.put(PdfName.DOMAIN, new PdfArray(domain));<NEW_LINE>func.dictionary.put(PdfName.<MASK><NEW_LINE>func.dictionary.put(PdfName.SIZE, new PdfArray(size));<NEW_LINE>func.dictionary.put(PdfName.BITSPERSAMPLE, new PdfNumber(bitsPerSample));<NEW_LINE>if (order != 1)<NEW_LINE>func.dictionary.put(PdfName.ORDER, new PdfNumber(order));<NEW_LINE>if (encode != null)<NEW_LINE>func.dictionary.put(PdfName.ENCODE, new PdfArray(encode));<NEW_LINE>if (decode != null)<NEW_LINE>func.dictionary.put(PdfName.DECODE, new PdfArray(decode));<NEW_LINE>return func;<NEW_LINE>}
RANGE, new PdfArray(range));
1,329,746
protected FullHttpResponse newHandshakeResponse(FullHttpRequest req, HttpHeaders headers) {<NEW_LINE>CharSequence key = req.headers().get(HttpHeaderNames.SEC_WEBSOCKET_KEY);<NEW_LINE>if (key == null) {<NEW_LINE>throw new WebSocketServerHandshakeException("not a WebSocket request: missing key", req);<NEW_LINE>}<NEW_LINE>FullHttpResponse res = new DefaultFullHttpResponse(HTTP_1_1, HttpResponseStatus.SWITCHING_PROTOCOLS, req.content().alloc().buffer(0));<NEW_LINE>if (headers != null) {<NEW_LINE>res.headers().add(headers);<NEW_LINE>}<NEW_LINE>String acceptSeed = key + WEBSOCKET_13_ACCEPT_GUID;<NEW_LINE>byte[] sha1 = WebSocketUtil.sha1(acceptSeed.getBytes(CharsetUtil.US_ASCII));<NEW_LINE>String accept = WebSocketUtil.base64(sha1);<NEW_LINE>if (logger.isDebugEnabled()) {<NEW_LINE>logger.debug("WebSocket version 13 server handshake key: {}, response: {}", key, accept);<NEW_LINE>}<NEW_LINE>res.headers().set(HttpHeaderNames.UPGRADE, HttpHeaderValues.WEBSOCKET).set(HttpHeaderNames.CONNECTION, HttpHeaderValues.UPGRADE).set(HttpHeaderNames.SEC_WEBSOCKET_ACCEPT, accept);<NEW_LINE>String subprotocols = req.headers().get(HttpHeaderNames.SEC_WEBSOCKET_PROTOCOL);<NEW_LINE>if (subprotocols != null) {<NEW_LINE>String selectedSubprotocol = selectSubprotocol(subprotocols);<NEW_LINE>if (selectedSubprotocol == null) {<NEW_LINE>if (logger.isDebugEnabled()) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>res.headers().set(HttpHeaderNames.SEC_WEBSOCKET_PROTOCOL, selectedSubprotocol);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return res;<NEW_LINE>}
logger.debug("Requested subprotocol(s) not supported: {}", subprotocols);
1,487,067
private Container lazyorToRun(ArrayContainer x) {<NEW_LINE>if (isFull()) {<NEW_LINE>return full();<NEW_LINE>}<NEW_LINE>// TODO: should optimize for the frequent case where we have a single run<NEW_LINE>RunContainer answer = new RunContainer(new char[2 * (this.nbrruns + x.getCardinality())], 0);<NEW_LINE>int rlepos = 0;<NEW_LINE><MASK><NEW_LINE>while (i.hasNext() && (rlepos < this.nbrruns)) {<NEW_LINE>if (getValue(rlepos) - i.peekNext() <= 0) {<NEW_LINE>answer.smartAppend(getValue(rlepos), getLength(rlepos));<NEW_LINE>// in theory, this next code could help, in practice it doesn't.<NEW_LINE>rlepos++;<NEW_LINE>} else {<NEW_LINE>answer.smartAppend(i.next());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (i.hasNext()) {<NEW_LINE>while (i.hasNext()) {<NEW_LINE>answer.smartAppend(i.next());<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>while (rlepos < this.nbrruns) {<NEW_LINE>answer.smartAppend(getValue(rlepos), getLength(rlepos));<NEW_LINE>rlepos++;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (answer.isFull()) {<NEW_LINE>return full();<NEW_LINE>}<NEW_LINE>return answer.convertToLazyBitmapIfNeeded();<NEW_LINE>}
PeekableCharIterator i = x.getCharIterator();
1,268,818
public String call() {<NEW_LINE>try {<NEW_LINE>List<Address> addresses = geocoder.getFromLocation(latLng.<MASK><NEW_LINE>if (!addresses.isEmpty()) {<NEW_LINE>String formattedAddress = "";<NEW_LINE>Address address = addresses.get(0);<NEW_LINE>if (address.getSubThoroughfare() != null) {<NEW_LINE>formattedAddress += address.getSubThoroughfare();<NEW_LINE>}<NEW_LINE>if (address.getThoroughfare() != null) {<NEW_LINE>if (!formattedAddress.isEmpty()) {<NEW_LINE>formattedAddress += " ";<NEW_LINE>}<NEW_LINE>formattedAddress += address.getThoroughfare();<NEW_LINE>}<NEW_LINE>if (address.getLocality() != null) {<NEW_LINE>if (!formattedAddress.isEmpty()) {<NEW_LINE>formattedAddress += ", ";<NEW_LINE>}<NEW_LINE>formattedAddress += address.getLocality();<NEW_LINE>}<NEW_LINE>return formattedAddress;<NEW_LINE>}<NEW_LINE>} catch (IOException e) {<NEW_LINE>e.printStackTrace();<NEW_LINE>}<NEW_LINE>return "";<NEW_LINE>}
latitude, latLng.longitude, 1);
370,955
public List<String> idToIpLookup(List<String> nodeIds) {<NEW_LINE>log.info("Asked IDs -> IPs for: [%s]", String.join(",", nodeIds));<NEW_LINE>if (nodeIds.isEmpty()) {<NEW_LINE>return new ArrayList<>();<NEW_LINE>}<NEW_LINE>final String project = envConfig.getProjectId();<NEW_LINE>final String zone = envConfig.getZoneName();<NEW_LINE>try {<NEW_LINE>Compute computeService = createComputeService();<NEW_LINE>Compute.Instances.List request = computeService.instances(<MASK><NEW_LINE>request.setFilter(GceUtils.buildFilter(nodeIds, "name"));<NEW_LINE>List<String> instanceIps = new ArrayList<>();<NEW_LINE>InstanceList response;<NEW_LINE>do {<NEW_LINE>response = request.execute();<NEW_LINE>if (response.getItems() == null) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>for (Instance instance : response.getItems()) {<NEW_LINE>// Assuming that every server has at least one network interface...<NEW_LINE>String ip = instance.getNetworkInterfaces().get(0).getNetworkIP();<NEW_LINE>// ...even though some IPs are reported as null on the spot but later they are ok,<NEW_LINE>// so we skip the ones that are null. fear not, they are picked up later this just<NEW_LINE>// prevents to have a machine called 'null' around which makes the caller wait for<NEW_LINE>// it for maxScalingDuration time before doing anything else<NEW_LINE>if (ip != null && !"null".equals(ip)) {<NEW_LINE>instanceIps.add(ip);<NEW_LINE>} else {<NEW_LINE>// log and skip it<NEW_LINE>log.warn("Call returned null IP for %s, skipping", instance.getName());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>request.setPageToken(response.getNextPageToken());<NEW_LINE>} while (response.getNextPageToken() != null);<NEW_LINE>return instanceIps;<NEW_LINE>} catch (Exception e) {<NEW_LINE>log.error(e, "Unable to convert IDs to IPs.");<NEW_LINE>}<NEW_LINE>return new ArrayList<>();<NEW_LINE>}
).list(project, zone);
148,653
private static Map<String, int[][]> Categories() {<NEW_LINE>Map<String, int[][]> map = new HashMap<String, int[][]>();<NEW_LINE>map.put("Lu", Lu);<NEW_LINE>map.put("Ll", Ll);<NEW_LINE>map.put("Lt", Lt);<NEW_LINE>map.put("Lm", Lm);<NEW_LINE>map.put("Lo", Lo);<NEW_LINE>map.put("Mn", Mn);<NEW_LINE>map.put("Me", Me);<NEW_LINE>map.put("Mc", Mc);<NEW_LINE>map.put("Nd", Nd);<NEW_LINE>map.put("Nl", Nl);<NEW_LINE>map.put("No", No);<NEW_LINE>map.put("Zs", Zs);<NEW_LINE>map.put("Zl", Zl);<NEW_LINE>map.put("Zp", Zp);<NEW_LINE>map.put("Cc", Cc);<NEW_LINE>map.put("Cf", Cf);<NEW_LINE>map.put("Co", Co);<NEW_LINE>map.put("Cs", Cs);<NEW_LINE><MASK><NEW_LINE>map.put("Ps", Ps);<NEW_LINE>map.put("Pe", Pe);<NEW_LINE>map.put("Pc", Pc);<NEW_LINE>map.put("Po", Po);<NEW_LINE>map.put("Sm", Sm);<NEW_LINE>map.put("Sc", Sc);<NEW_LINE>map.put("Sk", Sk);<NEW_LINE>map.put("So", So);<NEW_LINE>map.put("Pi", Pi);<NEW_LINE>map.put("Pf", Pf);<NEW_LINE>map.put("P", P);<NEW_LINE>map.put("S", S);<NEW_LINE>map.put("C", C);<NEW_LINE>map.put("Z", Z);<NEW_LINE>map.put("L", L);<NEW_LINE>map.put("M", M);<NEW_LINE>map.put("N", N);<NEW_LINE>return Collections.unmodifiableMap(map);<NEW_LINE>}
map.put("Pd", Pd);
541,195
public final ChannelFuture handshake(Channel channel, final ChannelPromise promise) {<NEW_LINE>ChannelPipeline pipeline = channel.pipeline();<NEW_LINE>HttpResponseDecoder decoder = pipeline.get(HttpResponseDecoder.class);<NEW_LINE>if (decoder == null) {<NEW_LINE>HttpClientCodec codec = <MASK><NEW_LINE>if (codec == null) {<NEW_LINE>promise.setFailure(new IllegalStateException("ChannelPipeline does not contain " + "an HttpResponseDecoder or HttpClientCodec"));<NEW_LINE>return promise;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>FullHttpRequest request = newHandshakeRequest();<NEW_LINE>channel.writeAndFlush(request).addListener(new ChannelFutureListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void operationComplete(ChannelFuture future) {<NEW_LINE>if (future.isSuccess()) {<NEW_LINE>ChannelPipeline p = future.channel().pipeline();<NEW_LINE>ChannelHandlerContext ctx = p.context(HttpRequestEncoder.class);<NEW_LINE>if (ctx == null) {<NEW_LINE>ctx = p.context(HttpClientCodec.class);<NEW_LINE>}<NEW_LINE>if (ctx == null) {<NEW_LINE>promise.setFailure(new IllegalStateException("ChannelPipeline does not contain " + "an HttpRequestEncoder or HttpClientCodec"));<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>p.addAfter(ctx.name(), "ws-encoder", newWebSocketEncoder());<NEW_LINE>promise.setSuccess();<NEW_LINE>} else {<NEW_LINE>promise.setFailure(future.cause());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>return promise;<NEW_LINE>}
pipeline.get(HttpClientCodec.class);
753,312
private HierarchyInfo updateHierarchyInfo() {<NEW_LINE>int depth = getArraySuperType().getHierarchyDepth() + 1;<NEW_LINE>Klass[] supertypes;<NEW_LINE>Klass[] superKlassTypes = getArraySuperType().getSuperTypes();<NEW_LINE>supertypes = new Klass[superKlassTypes.length + 1];<NEW_LINE>assert supertypes.length == depth + 1;<NEW_LINE>supertypes[depth] = this;<NEW_LINE>System.arraycopy(superKlassTypes, <MASK><NEW_LINE>ObjectKlass.KlassVersion[] transitiveInterfaces;<NEW_LINE>ObjectKlass[] superItfs = getSuperInterfaces();<NEW_LINE>transitiveInterfaces = new ObjectKlass.KlassVersion[superItfs.length];<NEW_LINE>for (int i = 0; i < superItfs.length; i++) {<NEW_LINE>transitiveInterfaces[i] = superItfs[i].getKlassVersion();<NEW_LINE>}<NEW_LINE>return new HierarchyInfo(supertypes, depth, transitiveInterfaces);<NEW_LINE>}
0, supertypes, 0, depth);
817,698
private Bootstrap createClientBootstrap(EventLoopGroup eventLoopGroup) {<NEW_LINE>final Bootstrap bootstrap = new Bootstrap();<NEW_LINE>bootstrap.group(eventLoopGroup);<NEW_LINE>bootstrap.<MASK><NEW_LINE>bootstrap.option(ChannelOption.TCP_NODELAY, TransportSettings.TCP_NO_DELAY.get(settings));<NEW_LINE>bootstrap.option(ChannelOption.SO_KEEPALIVE, TransportSettings.TCP_KEEP_ALIVE.get(settings));<NEW_LINE>final ByteSizeValue tcpSendBufferSize = TransportSettings.TCP_SEND_BUFFER_SIZE.get(settings);<NEW_LINE>if (tcpSendBufferSize.getBytes() > 0) {<NEW_LINE>bootstrap.option(ChannelOption.SO_SNDBUF, Math.toIntExact(tcpSendBufferSize.getBytes()));<NEW_LINE>}<NEW_LINE>final ByteSizeValue tcpReceiveBufferSize = TransportSettings.TCP_RECEIVE_BUFFER_SIZE.get(settings);<NEW_LINE>if (tcpReceiveBufferSize.getBytes() > 0) {<NEW_LINE>bootstrap.option(ChannelOption.SO_RCVBUF, Math.toIntExact(tcpReceiveBufferSize.getBytes()));<NEW_LINE>}<NEW_LINE>bootstrap.option(ChannelOption.RCVBUF_ALLOCATOR, recvByteBufAllocator);<NEW_LINE>final boolean reuseAddress = TransportSettings.TCP_REUSE_ADDRESS.get(settings);<NEW_LINE>bootstrap.option(ChannelOption.SO_REUSEADDR, reuseAddress);<NEW_LINE>return bootstrap;<NEW_LINE>}
channel(NettyBootstrap.clientChannel());
209,583
public static void fstat(EFile efile, String file_name) throws Pausable {<NEW_LINE>// System.err.println("trying entry for "+file_name);<NEW_LINE>try {<NEW_LINE>ZipEntry ent;<NEW_LINE>ent = get_entry(file_name + "/");<NEW_LINE>if (ent == null) {<NEW_LINE>ent = get_entry(file_name);<NEW_LINE>if (ent == null) {<NEW_LINE>efile.reply_posix_error(Posix.ENOENT);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// System.err.println("got entry for "+file_name+" : "+ent.toString()+" isdir="+ent.isDirectory());<NEW_LINE><MASK><NEW_LINE>int file_type = ent.isDirectory() ? EFile.FT_DIRECTORY : EFile.FT_REGULAR;<NEW_LINE>final int RESULT_SIZE = (1 + (29 * 4));<NEW_LINE>ByteBuffer res = ByteBuffer.allocate(RESULT_SIZE);<NEW_LINE>res.order(ByteOrder.BIG_ENDIAN);<NEW_LINE>res.put(EFile.FILE_RESP_INFO);<NEW_LINE>res.putLong(file_size);<NEW_LINE>res.putInt(file_type);<NEW_LINE>put_time(res, ent.getTime());<NEW_LINE>put_time(res, ent.getTime());<NEW_LINE>put_time(res, ent.getTime());<NEW_LINE>res.putInt(0000400);<NEW_LINE>res.putInt(1);<NEW_LINE>res.putInt(0);<NEW_LINE>res.putInt(0);<NEW_LINE>res.putInt(file_name.hashCode());<NEW_LINE>res.putInt(0);<NEW_LINE>res.putInt(0);<NEW_LINE>res.putInt(EFile.FA_READ);<NEW_LINE>efile.driver_output2(res, null);<NEW_LINE>} catch (IOException e) {<NEW_LINE>efile.reply_posix_error(IO.exception_to_posix_code(e));<NEW_LINE>}<NEW_LINE>}
long file_size = ent.getSize();
1,161,000
public void onChunkReady(Vector3ic chunkPos) {<NEW_LINE>WorldProvider worldProvider = CoreRegistry.get(WorldProvider.class);<NEW_LINE>List<NetData.BlockChangeMessage> updateBlockMessages = awaitingChunkReadyBlockUpdates.removeAll(new Vector3i(chunkPos));<NEW_LINE>for (NetData.BlockChangeMessage message : updateBlockMessages) {<NEW_LINE>Vector3i pos = NetMessageUtil.convert(message.getPos());<NEW_LINE>Block newBlock = blockManager.getBlock((short) message.getNewBlock());<NEW_LINE>worldProvider.setBlock(pos, newBlock);<NEW_LINE>}<NEW_LINE>List<NetData.ExtraDataChangeMessage> updateExtraDataMessages = awaitingChunkReadyExtraDataUpdates.<MASK><NEW_LINE>for (NetData.ExtraDataChangeMessage message : updateExtraDataMessages) {<NEW_LINE>Vector3i pos = NetMessageUtil.convert(message.getPos());<NEW_LINE>int newValue = message.getNewData();<NEW_LINE>int i = message.getIndex();<NEW_LINE>worldProvider.setExtraData(i, pos, newValue);<NEW_LINE>}<NEW_LINE>}
removeAll(new Vector3i(chunkPos));
1,721,131
void emailOverallInvoice() {<NEW_LINE>try {<NEW_LINE>String invoiceFile = String.format("%s-%s.csv", invoiceFilePrefix, yearMonth);<NEW_LINE>BlobId invoiceFilename = BlobId.of(billingBucket, invoiceDirectoryPrefix + invoiceFile);<NEW_LINE>try (InputStream in = gcsUtils.openInputStream(invoiceFilename)) {<NEW_LINE>emailService.sendEmail(EmailMessage.newBuilder().setSubject(String.format("Domain Registry invoice data %s", yearMonth)).setBody(String.format("Attached is the %s invoice for the domain registry.", yearMonth)).setFrom(outgoingEmailAddress).setRecipients(invoiceEmailRecipients).setAttachment(Attachment.newBuilder().setContent(CharStreams.toString(new InputStreamReader(in, UTF_8))).setContentType(MediaType.CSV_UTF_8).setFilename(invoiceFile).build()).build());<NEW_LINE>}<NEW_LINE>} catch (Throwable e) {<NEW_LINE>// Strip one layer, because callWithRetry wraps in a RuntimeException<NEW_LINE>sendAlertEmail(String.format("Emailing invoice failed due to %s", getRootCause(<MASK><NEW_LINE>throw new RuntimeException("Emailing invoice failed", e);<NEW_LINE>}<NEW_LINE>}
e).getMessage()));
848,941
private synchronized void next(long jobId) {<NEW_LINE>WorkflowExecution workflowExecution = mWorkflows.get(jobId);<NEW_LINE>mChildren.putIfAbsent(jobId, new ConcurrentHashSet<>());<NEW_LINE>Set<JobConfig> childJobConfigs = workflowExecution.next();<NEW_LINE>if (childJobConfigs.isEmpty()) {<NEW_LINE>done(jobId);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>ConcurrentHashSet<Long> childJobIds = new ConcurrentHashSet<>();<NEW_LINE>for (int i = 0; i < childJobConfigs.size(); i++) {<NEW_LINE>childJobIds.add(mJobMaster.getNewJobId());<NEW_LINE>}<NEW_LINE>mWaitingOn.put(jobId, childJobIds);<NEW_LINE>mChildren.get(jobId).addAll(childJobIds);<NEW_LINE>for (Long childJobId : childJobIds) {<NEW_LINE>mParentWorkflow.put(childJobId, jobId);<NEW_LINE>}<NEW_LINE>Iterator<Long> childJobIdsIter = childJobIds.iterator();<NEW_LINE>Iterator<JobConfig> childJobConfigsIter = childJobConfigs.iterator();<NEW_LINE>while (childJobIdsIter.hasNext() && childJobConfigsIter.hasNext()) {<NEW_LINE><MASK><NEW_LINE>JobConfig childJobConfig = childJobConfigsIter.next();<NEW_LINE>try {<NEW_LINE>mJobMaster.run(childJobConfig, childJobId);<NEW_LINE>} catch (JobDoesNotExistException | ResourceExhaustedException e) {<NEW_LINE>LOG.warn(e.getMessage());<NEW_LINE>final String errorType = ErrorUtils.getErrorType(e);<NEW_LINE>workflowExecution.stop(Status.FAILED, errorType, e.getMessage());<NEW_LINE>stop(jobId, Status.FAILED, errorType, e.getMessage());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
Long childJobId = childJobIdsIter.next();
1,055,703
protected void onAfterInit() {<NEW_LINE>// Services<NEW_LINE>final IModelAttributeSetInstanceListenerService modelAttributeSetInstanceListenerService = Services.get(IModelAttributeSetInstanceListenerService.class);<NEW_LINE>modelAttributeSetInstanceListenerService.registerListener(new InOutLineCountryModelAttributeSetInstanceListener());<NEW_LINE>modelAttributeSetInstanceListenerService.registerListener(new InOutCountryModelAttributeSetInstanceListener());<NEW_LINE>modelAttributeSetInstanceListenerService.registerListener(new OrderLineCountryModelAttributeSetInstanceListener());<NEW_LINE>modelAttributeSetInstanceListenerService.registerListener(new OrderCountryModelAttributeSetInstanceListener());<NEW_LINE>modelAttributeSetInstanceListenerService.registerListener(new InvoiceLineCountryModelAttributeSetInstanceListener());<NEW_LINE>modelAttributeSetInstanceListenerService.registerListener(new InvoiceCountryModelAttributeSetInstanceListener());<NEW_LINE>// In/Ausland attribute<NEW_LINE>modelAttributeSetInstanceListenerService.registerListener(new InOutLineInAusLandModelAttributeSetInstanceListener());<NEW_LINE>modelAttributeSetInstanceListenerService.registerListener(new InOutInAusLandModelAttributeSetInstanceListener());<NEW_LINE>modelAttributeSetInstanceListenerService.registerListener(new OrderLineInAusLandModelAttributeSetInstanceListener());<NEW_LINE>modelAttributeSetInstanceListenerService.registerListener(new OrderInAusLandModelAttributeSetInstanceListener());<NEW_LINE>modelAttributeSetInstanceListenerService.registerListener(new InvoiceLineInAusLandModelAttributeSetInstanceListener());<NEW_LINE>modelAttributeSetInstanceListenerService.registerListener(new InvoiceInAusLandModelAttributeSetInstanceListener());<NEW_LINE>// ADR attribute<NEW_LINE>modelAttributeSetInstanceListenerService.registerListener(new InOutLineADRModelAttributeSetInstanceListener());<NEW_LINE>modelAttributeSetInstanceListenerService.registerListener(new InOutADRModelAttributeSetInstanceListener());<NEW_LINE>modelAttributeSetInstanceListenerService.registerListener(new OrderLineAllocADRModelAttributeSetInstanceListener());<NEW_LINE>modelAttributeSetInstanceListenerService.registerListener(new OrderLineADRModelAttributeSetInstanceListener());<NEW_LINE>modelAttributeSetInstanceListenerService.registerListener(new OrderADRModelAttributeSetInstanceListener());<NEW_LINE>modelAttributeSetInstanceListenerService.registerListener(new InvoiceLineADRModelAttributeSetInstanceListener());<NEW_LINE>modelAttributeSetInstanceListenerService.registerListener(new InvoiceADRModelAttributeSetInstanceListener());<NEW_LINE>modelAttributeSetInstanceListenerService.registerListener(new OrderLineLotNumberModelAttributeSetInstanceListener());<NEW_LINE>modelAttributeSetInstanceListenerService.registerListener(new OrderLineExpiryModelAttributeSetInstanceListener());<NEW_LINE>modelAttributeSetInstanceListenerService<MASK><NEW_LINE>modelAttributeSetInstanceListenerService.registerListener(new AgeModelAttributeSetInstanceListener());<NEW_LINE>//<NEW_LINE>// Setup Time Format (see 06148)<NEW_LINE>Language.setDefaultTimeStyle(DateFormat.SHORT);<NEW_LINE>//<NEW_LINE>// Apply misc workarounds for GOLIVE<NEW_LINE>apply_Fresh_GOLIVE_Workarounds();<NEW_LINE>// task 09833<NEW_LINE>// Register the Printing Info ctx provider for C_Order_MFGWarehouse_Report<NEW_LINE>Services.get(INotificationBL.class).addCtxProvider(C_Order_MFGWarehouse_Report_RecordTextProvider.instance);<NEW_LINE>//<NEW_LINE>// register ProductPOCopyRecordSupport, which needs to know about many different tables<NEW_LINE>CopyRecordFactory.enableForTableName(I_M_Product.Table_Name);<NEW_LINE>CopyRecordFactory.registerCopyRecordSupport(I_M_Product.Table_Name, ProductPOCopyRecordSupport.class);<NEW_LINE>}
.registerListener(new OrderLineMonthsUntilExpiryModelASIListener());
908,926
private void addInfusionConversionRedstoneRecipes(Consumer<FinishedRecipe> consumer, String basePath) {<NEW_LINE>// Block<NEW_LINE>ItemStackToChemicalRecipeBuilder.infusionConversion(IngredientCreatorAccess.item().from(Tags.Items.STORAGE_BLOCKS_REDSTONE), MekanismInfuseTypes.REDSTONE.getStack(90)).build(consumer, Mekanism.rl(basePath + "from_block"));<NEW_LINE>// Dust<NEW_LINE>ItemStackToChemicalRecipeBuilder.infusionConversion(IngredientCreatorAccess.item().from(Tags.Items.DUSTS_REDSTONE), MekanismInfuseTypes.REDSTONE.getStack(10)).build(consumer, Mekanism<MASK><NEW_LINE>// Enriched<NEW_LINE>ItemStackToChemicalRecipeBuilder.infusionConversion(IngredientCreatorAccess.item().from(MekanismTags.Items.ENRICHED_REDSTONE), MekanismInfuseTypes.REDSTONE.getStack(80)).build(consumer, Mekanism.rl(basePath + "from_enriched"));<NEW_LINE>}
.rl(basePath + "from_dust"));
1,199,238
public Optional<Credential> retrieve(Consumer<LogEvent> logger) throws IOException {<NEW_LINE>if (!Files.exists(dockerConfigFile)) {<NEW_LINE>return Optional.empty();<NEW_LINE>}<NEW_LINE>ObjectMapper objectMapper = new ObjectMapper().configure(MapperFeature.ACCEPT_CASE_INSENSITIVE_PROPERTIES, true);<NEW_LINE>try (InputStream fileIn = Files.newInputStream(dockerConfigFile)) {<NEW_LINE>if (legacyConfigFormat) {<NEW_LINE>// legacy config format is the value of the "auths":{ <map> } block of the new config (i.e.,<NEW_LINE>// the <map> of string -> DockerConfigTemplate.AuthTemplate).<NEW_LINE>Map<String, AuthTemplate> auths = objectMapper.readValue(fileIn, new TypeReference<Map<String, AuthTemplate>>() {<NEW_LINE>});<NEW_LINE>DockerConfig dockerConfig = new <MASK><NEW_LINE>return retrieve(dockerConfig, logger);<NEW_LINE>}<NEW_LINE>DockerConfig dockerConfig = new DockerConfig(objectMapper.readValue(fileIn, DockerConfigTemplate.class));<NEW_LINE>return retrieve(dockerConfig, logger);<NEW_LINE>}<NEW_LINE>}
DockerConfig(new DockerConfigTemplate(auths));
83,542
ThymeleafViewResolver thymeleafViewResolver(ThymeleafProperties properties, SpringTemplateEngine templateEngine) {<NEW_LINE>ThymeleafViewResolver resolver = new ThymeleafViewResolver();<NEW_LINE>resolver.setTemplateEngine(templateEngine);<NEW_LINE>resolver.setCharacterEncoding(properties.getEncoding().name());<NEW_LINE>resolver.setContentType(appendCharset(properties.getServlet().getContentType(), resolver.getCharacterEncoding()));<NEW_LINE>resolver.setProducePartialOutputWhileProcessing(properties.getServlet().isProducePartialOutputWhileProcessing());<NEW_LINE>resolver.setExcludedViewNames(properties.getExcludedViewNames());<NEW_LINE>resolver.setViewNames(properties.getViewNames());<NEW_LINE>// This resolver acts as a fallback resolver (e.g. like a<NEW_LINE>// InternalResourceViewResolver) so it needs to have low precedence<NEW_LINE>resolver.<MASK><NEW_LINE>resolver.setCache(properties.isCache());<NEW_LINE>return resolver;<NEW_LINE>}
setOrder(Ordered.LOWEST_PRECEDENCE - 5);
1,543,953
private long rangeQuery2(int i, int tl, int tr, int l, int r) {<NEW_LINE>if (tl == l && tr == r) {<NEW_LINE>return t[i];<NEW_LINE>}<NEW_LINE>int tm = (tl + tr) / 2;<NEW_LINE>// Test how the left and right segments of the interval [tl, tr] overlap with the query [l, r]<NEW_LINE>boolean overlapsLeftSegment = (l <= tm);<NEW_LINE>boolean overlapsRightSegment = (r > tm);<NEW_LINE>if (overlapsLeftSegment && overlapsRightSegment) {<NEW_LINE>return combinationFn.apply(rangeQuery2(2 * i + 1, tl, tm, l, Math.min(tm, r)), rangeQuery2(2 * i + 2, tm + 1, tr, Math.max(l, tm + 1), r));<NEW_LINE>} else if (overlapsLeftSegment) {<NEW_LINE>return rangeQuery2(2 * i + 1, tl, tm, l, Math<MASK><NEW_LINE>} else {<NEW_LINE>return rangeQuery2(2 * i + 2, tm + 1, tr, Math.max(l, tm + 1), r);<NEW_LINE>}<NEW_LINE>}
.min(tm, r));
477,715
public void visitFunctionDeclaration(FunctionDeclaration functionDeclaration) {<NEW_LINE>TypeDeclaration declaringType = getParent(TypeDeclaration.class);<NEW_LINE>if (declaringType != null && functionDeclaration.getType() != null && functionDeclaration.getType().getName() != null && !functionDeclaration.getType().getName().equals("void")) {<NEW_LINE>applyToSuperMethod(declaringType, functionDeclaration, (parentType, parentFunction) -> {<NEW_LINE>if (functionDeclaration.getType().isPrimitive() && !parentFunction.getType().isPrimitive()) {<NEW_LINE>functionDeclaration.getType().setName(StringUtils.capitalize(functionDeclaration.getType().getName()));<NEW_LINE>} else {<NEW_LINE>if ("void".equals(parentFunction.getType().getName())) {<NEW_LINE>if (context.isInDependency(parentType)) {<NEW_LINE>// if parent class belongs to a dependency, we cant<NEW_LINE>// change its definition<NEW_LINE>logger.info("modify return type of " + context.getTypeName(declaringType) + "." + functionDeclaration + ": " + functionDeclaration.getType() + " -> " + parentFunction.getType());<NEW_LINE>functionDeclaration.setType(parentFunction.getType());<NEW_LINE>} else {<NEW_LINE>logger.info("modify return type of " + context.getTypeName(parentType) + "." + parentFunction + ": " + parentFunction.getType() + " -> " + functionDeclaration.getType());<NEW_LINE>parentFunction.<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}<NEW_LINE>}
setType(functionDeclaration.getType());
858,179
public static void logOut(Simplenote application) {<NEW_LINE>application.getSimperium().deauthorizeUser();<NEW_LINE>application.getAccountBucket().reset();<NEW_LINE>application.getNotesBucket().reset();<NEW_LINE>application.getTagsBucket().reset();<NEW_LINE>application.getPreferencesBucket().reset();<NEW_LINE>application.getAccountBucket().stop();<NEW_LINE>AppLog.<MASK><NEW_LINE>application.getNotesBucket().stop();<NEW_LINE>AppLog.add(Type.SYNC, "Stopped note bucket (AuthUtils)");<NEW_LINE>application.getTagsBucket().stop();<NEW_LINE>AppLog.add(Type.SYNC, "Stopped tag bucket (AuthUtils)");<NEW_LINE>application.getPreferencesBucket().stop();<NEW_LINE>AppLog.add(Type.SYNC, "Stopped preference bucket (AuthUtils)");<NEW_LINE>// Resets analytics user back to 'anon' type<NEW_LINE>AnalyticsTracker.refreshMetadata(null);<NEW_LINE>// Remove wp.com token<NEW_LINE>SharedPreferences.Editor editor = PreferenceManager.getDefaultSharedPreferences(application).edit();<NEW_LINE>editor.remove(PrefUtils.PREF_WP_TOKEN);<NEW_LINE>// Remove WordPress sites<NEW_LINE>editor.remove(PrefUtils.PREF_WORDPRESS_SITES);<NEW_LINE>editor.apply();<NEW_LINE>// Remove note scroll positions<NEW_LINE>application.getSharedPreferences(SCROLL_POSITION_PREFERENCES, Context.MODE_PRIVATE).edit().clear().apply();<NEW_LINE>// Remove note last sync times<NEW_LINE>application.getSharedPreferences(SYNC_TIME_PREFERENCES, Context.MODE_PRIVATE).edit().clear().apply();<NEW_LINE>// Remove Passcode Lock password<NEW_LINE>AppLockManager.getInstance().getAppLock().setPassword("");<NEW_LINE>WidgetUtils.updateNoteWidgets(application);<NEW_LINE>}
add(Type.SYNC, "Stopped account bucket (AuthUtils)");
210,068
final TagResourceResult executeTagResource(TagResourceRequest tagResourceRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(tagResourceRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<TagResourceRequest> request = null;<NEW_LINE>Response<TagResourceResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new TagResourceRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(tagResourceRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "Timestream Write");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "TagResource");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>URI cachedEndpoint = null;<NEW_LINE>if (endpointDiscoveryEnabled) {<NEW_LINE>DescribeEndpointsRequest discoveryRequest = new DescribeEndpointsRequest();<NEW_LINE>cachedEndpoint = cache.get(awsCredentialsProvider.getCredentials().getAWSAccessKeyId(), discoveryRequest, true, endpoint);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<TagResourceResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new TagResourceResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext, cachedEndpoint, null);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
HandlerContextKey.SIGNING_REGION, getSigningRegion());
565,566
private // complete.<NEW_LINE>MqttToken handleOldTokens(MqttToken token, MqttException reason) {<NEW_LINE>final String methodName = "handleOldTokens";<NEW_LINE>// @TRACE 222=><NEW_LINE>log.fine(CLASS_NAME, methodName, "222");<NEW_LINE>MqttToken tokToNotifyLater = null;<NEW_LINE>try {<NEW_LINE>// First the token that was related to the disconnect / shutdown may<NEW_LINE>// not be in the token table - temporarily add it if not<NEW_LINE>if (token != null) {<NEW_LINE>if (!token.isComplete() && tokenStore.getToken(token.internalTok.getKey()) == null) {<NEW_LINE>tokenStore.saveToken(token, token.internalTok.getKey());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>Vector toksToNot = clientState.resolveOldTokens(reason);<NEW_LINE><MASK><NEW_LINE>while (toksToNotE.hasMoreElements()) {<NEW_LINE>MqttToken tok = (MqttToken) toksToNotE.nextElement();<NEW_LINE>if (tok.internalTok.getKey().equals(MqttDisconnect.KEY) || tok.internalTok.getKey().equals(MqttConnect.KEY)) {<NEW_LINE>// Its con or discon so remember and notify @ end of disc routine<NEW_LINE>tokToNotifyLater = tok;<NEW_LINE>} else {<NEW_LINE>// notify waiters and callbacks of outstanding tokens<NEW_LINE>// that a problem has occurred and disconnect is in<NEW_LINE>// progress<NEW_LINE>callback.asyncOperationComplete(tok);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (Exception ex) {<NEW_LINE>// Ignore as we are shutting down<NEW_LINE>}<NEW_LINE>return tokToNotifyLater;<NEW_LINE>}
Enumeration toksToNotE = toksToNot.elements();
893,846
public void createAsync(DataStore dataStore, DataObject dataObject, AsyncCompletionCallback<CreateCmdResult> callback) {<NEW_LINE>String iqn = null;<NEW_LINE>String errMsg = null;<NEW_LINE>try {<NEW_LINE>if (dataObject.getType() == DataObjectType.VOLUME) {<NEW_LINE>s_logger.debug("createAsync - creating volume");<NEW_LINE>iqn = createVolume((VolumeInfo) dataObject, dataStore.getId());<NEW_LINE>} else if (dataObject.getType() == DataObjectType.SNAPSHOT) {<NEW_LINE>s_logger.debug("createAsync - creating snapshot");<NEW_LINE>createTempVolume((SnapshotInfo) <MASK><NEW_LINE>} else if (dataObject.getType() == DataObjectType.TEMPLATE) {<NEW_LINE>s_logger.debug("createAsync - creating template");<NEW_LINE>iqn = createTemplateVolume((TemplateInfo) dataObject, dataStore.getId());<NEW_LINE>} else {<NEW_LINE>errMsg = "Invalid DataObjectType (" + dataObject.getType() + ") passed to createAsync";<NEW_LINE>s_logger.error(errMsg);<NEW_LINE>}<NEW_LINE>} catch (Exception ex) {<NEW_LINE>errMsg = ex.getMessage();<NEW_LINE>s_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(iqn, new Answer(null, errMsg == null, errMsg));<NEW_LINE>result.setResult(errMsg);<NEW_LINE>callback.complete(result);<NEW_LINE>}<NEW_LINE>}
dataObject, dataStore.getId());
716,045
private static Node createNode(Map<String, String> attributeMap, Node extendFromNode, Node parent, NodeRepository nodeRepository) {<NEW_LINE>String prototypeId = attributeMap.get("prototype");<NEW_LINE>String name = attributeMap.get("name");<NEW_LINE>String comment = attributeMap.get("comment");<NEW_LINE>String category = attributeMap.get("category");<NEW_LINE>String description = attributeMap.get("description");<NEW_LINE>String image = attributeMap.get("image");<NEW_LINE>String function = attributeMap.get("function");<NEW_LINE>String <MASK><NEW_LINE>String outputRange = attributeMap.get("outputRange");<NEW_LINE>String position = attributeMap.get("position");<NEW_LINE>String handle = attributeMap.get("handle");<NEW_LINE>String alwaysRendered = attributeMap.get("alwaysRendered");<NEW_LINE>Node prototype = prototypeId == null ? extendFromNode : lookupNode(prototypeId, parent, nodeRepository);<NEW_LINE>if (prototype == null)<NEW_LINE>return null;<NEW_LINE>Node node = prototype.extend();<NEW_LINE>if (name != null)<NEW_LINE>node = node.withName(name);<NEW_LINE>if (comment != null)<NEW_LINE>node = node.withComment(comment);<NEW_LINE>if (category != null)<NEW_LINE>node = node.withCategory(category);<NEW_LINE>if (description != null)<NEW_LINE>node = node.withDescription(description);<NEW_LINE>if (image != null)<NEW_LINE>node = node.withImage(image);<NEW_LINE>if (function != null)<NEW_LINE>node = node.withFunction(function);<NEW_LINE>if (outputType != null)<NEW_LINE>node = node.withOutputType(outputType);<NEW_LINE>if (outputRange != null)<NEW_LINE>node = node.withOutputRange(Port.Range.valueOf(outputRange.toUpperCase(Locale.US)));<NEW_LINE>if (position != null)<NEW_LINE>node = node.withPosition(Point.valueOf(position));<NEW_LINE>if (handle != null)<NEW_LINE>node = node.withHandle(handle);<NEW_LINE>if (alwaysRendered != null)<NEW_LINE>node = node.withAlwaysRenderedSet(Boolean.parseBoolean(alwaysRendered));<NEW_LINE>return node;<NEW_LINE>}
outputType = attributeMap.get("outputType");
588,800
protected TableModel tableModel(SerializedFile serialized) {<NEW_LINE>SerializedFileMetadata metadata = serialized.metadata();<NEW_LINE>TableBuilder table = new TableBuilder();<NEW_LINE>table.row("Path ID", "Offset", "Length", "Type ID", "Class ID");<NEW_LINE>Class<ObjectInfo> factory = metadata.objectInfoTable().elementFactory();<NEW_LINE>boolean typeTreePresent = metadata.typeTree().embedded();<NEW_LINE>boolean v2 = ObjectInfoV2.class.isAssignableFrom(factory);<NEW_LINE>boolean v3 = ObjectInfoV3.class.isAssignableFrom(factory);<NEW_LINE>if (typeTreePresent) {<NEW_LINE>table.append("Class Name");<NEW_LINE>}<NEW_LINE>if (v2) {<NEW_LINE>table.append("Script Type ID");<NEW_LINE>}<NEW_LINE>if (v3) {<NEW_LINE>table.append("Stripped");<NEW_LINE>}<NEW_LINE>metadata.objectInfoTable().infoMap().entrySet().stream().forEach(e -> {<NEW_LINE>ObjectInfo info = e.getValue();<NEW_LINE>table.row(e.getKey(), info.offset(), info.length(), info.typeID(), info.classID());<NEW_LINE>if (typeTreePresent) {<NEW_LINE>TypeRoot<Type> baseClass = metadata.typeTree().typeMap().get(info.typeID());<NEW_LINE>String className = baseClass.nodes().data().typeName();<NEW_LINE>table.append(className);<NEW_LINE>}<NEW_LINE>if (v2) {<NEW_LINE>table.append(((ObjectInfoV2<MASK><NEW_LINE>}<NEW_LINE>if (v3) {<NEW_LINE>table.append(((ObjectInfoV3) info).isStripped());<NEW_LINE>}<NEW_LINE>});<NEW_LINE>TableModel model = new TableModel("Objects", table.get());<NEW_LINE>TextTableFormat format = model.format();<NEW_LINE>format.columnFormatter(1, Formatters::hex);<NEW_LINE>return model;<NEW_LINE>}
) info).scriptTypeIndex());
1,731,633
public static void main(String[] args) throws Exception {<NEW_LINE>ExchangeSpecification exchangeSpecification = new ExchangeSpecification(BitcoiniumExchange.class);<NEW_LINE>// exchangeSpecification.setPlainTextUri("http://openexchangerates.org");<NEW_LINE>exchangeSpecification.setApiKey("42djci5kmbtyzrvglfdw3e2dgmh5mr37");<NEW_LINE>System.out.println(exchangeSpecification.toString());<NEW_LINE>Exchange bitcoiniumExchange = ExchangeFactory.INSTANCE.createExchange(exchangeSpecification);<NEW_LINE>// Interested in the public market data feed (no authentication)<NEW_LINE>BitcoiniumMarketDataServiceRaw bitcoiniumMarketDataService = (BitcoiniumMarketDataServiceRaw) bitcoiniumExchange.getMarketDataService();<NEW_LINE>System.out.println("fetching data...");<NEW_LINE>// Get the latest order book data for BTC/USD - BITSTAMP<NEW_LINE>BitcoiniumTickerHistory bitcoiniumTickerHistory = bitcoiniumMarketDataService.getBitcoiniumTickerHistory("BTC", "BITSTAMP_USD", "THIRTY_DAYS");<NEW_LINE>System.out.println(bitcoiniumTickerHistory.toString());<NEW_LINE>List<Date> xAxisData = new ArrayList<>();<NEW_LINE>List<Float> yAxisData = new ArrayList<>();<NEW_LINE>for (int i = 0; i < bitcoiniumTickerHistory.getCondensedTickers().length; i++) {<NEW_LINE>BitcoiniumTicker bitcoiniumTicker = bitcoiniumTickerHistory.getCondensedTickers()[i];<NEW_LINE>Date timestamp = new Date(bitcoiniumTicker.getTimestamp());<NEW_LINE>float price = bitcoiniumTicker.getLast().floatValue();<NEW_LINE>System.out.println(timestamp + ": " + price);<NEW_LINE>xAxisData.add(timestamp);<NEW_LINE>yAxisData.add(price);<NEW_LINE>}<NEW_LINE>// Create Chart<NEW_LINE>XYChart chart = new XYChartBuilder().width(800).height(600).title("Bitstamp Price vs. Date").xAxisTitle("Date").<MASK><NEW_LINE>// Customize Chart<NEW_LINE>chart.getStyler().setLegendPosition(LegendPosition.InsideNE);<NEW_LINE>chart.getStyler().setDefaultSeriesRenderStyle(XYSeriesRenderStyle.Area);<NEW_LINE>XYSeries series = chart.addSeries("Bitcoinium USD/BTC", xAxisData, yAxisData);<NEW_LINE>series.setMarker(SeriesMarkers.NONE);<NEW_LINE>new SwingWrapper(chart).displayChart();<NEW_LINE>}
yAxisTitle("Price").build();
1,770,068
public String downloadS3Template(S3TO s3, long id, String url, String name, ImageFormat format, boolean hvm, Long accountId, String descr, String cksum, String installPathPrefix, String user, String password, long maxTemplateSizeInBytes, Proxy proxy, ResourceType resourceType) {<NEW_LINE>UUID uuid = UUID.randomUUID();<NEW_LINE>String jobId = uuid.toString();<NEW_LINE>URI uri;<NEW_LINE>try {<NEW_LINE>uri = new URI(url);<NEW_LINE>} catch (URISyntaxException e) {<NEW_LINE>throw new CloudRuntimeException("URI is incorrect: " + url);<NEW_LINE>}<NEW_LINE>TemplateDownloader td;<NEW_LINE>if ((uri != null) && (uri.getScheme() != null)) {<NEW_LINE>if (uri.getScheme().equalsIgnoreCase("http") || uri.getScheme().equalsIgnoreCase("https")) {<NEW_LINE>td = new S3TemplateDownloader(s3, url, installPathPrefix, new Completion(jobId), maxTemplateSizeInBytes, user, password, proxy, resourceType);<NEW_LINE>} else {<NEW_LINE>throw new CloudRuntimeException("Scheme is not supported " + url);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>DownloadJob dj = new DownloadJob(td, jobId, id, name, format, hvm, accountId, descr, cksum, installPathPrefix, resourceType);<NEW_LINE>dj.setTmpltPath(installPathPrefix);<NEW_LINE>jobs.put(jobId, dj);<NEW_LINE>threadPool.execute(td);<NEW_LINE>return jobId;<NEW_LINE>}
throw new CloudRuntimeException("Unable to download from URL: " + url);
1,813,637
public static void main(String[] args) throws Exception {<NEW_LINE>// Prepare our context and sockets<NEW_LINE>try (ZContext context = new ZContext()) {<NEW_LINE>// Connect to task ventilator<NEW_LINE>ZMQ.Socket receiver = context.createSocket(SocketType.PULL);<NEW_LINE>receiver.connect("tcp://localhost:5557");<NEW_LINE>// Connect to weather server<NEW_LINE>ZMQ.Socket subscriber = context.createSocket(SocketType.SUB);<NEW_LINE>subscriber.connect("tcp://localhost:5556");<NEW_LINE>subscriber.subscribe("10001 ".getBytes(ZMQ.CHARSET));<NEW_LINE>// Process messages from both sockets<NEW_LINE>// We prioritize traffic from the task ventilator<NEW_LINE>while (!Thread.currentThread().isInterrupted()) {<NEW_LINE>// Process any waiting tasks<NEW_LINE>byte[] task;<NEW_LINE>while ((task = receiver.recv(ZMQ.DONTWAIT)) != null) {<NEW_LINE>System.out.println("process task");<NEW_LINE>}<NEW_LINE>// Process any waiting weather updates<NEW_LINE>byte[] update;<NEW_LINE>while ((update = subscriber.recv(ZMQ.DONTWAIT)) != null) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>// No activity, so sleep for 1 msec<NEW_LINE>Thread.sleep(1000);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
System.out.println("process weather update");
1,551,537
private TypeSymbolPair checkRecordLiteralKeyExpr(BLangExpression keyExpr, boolean computedKey, BRecordType recordType, AnalyzerData data) {<NEW_LINE>Name fieldName;<NEW_LINE>if (computedKey) {<NEW_LINE>checkExpr(keyExpr, symTable.stringType, data);<NEW_LINE>if (keyExpr.getBType() == symTable.semanticError) {<NEW_LINE>return new TypeSymbolPair(null, symTable.semanticError);<NEW_LINE>}<NEW_LINE>LinkedHashSet<BType> fieldTypes = recordType.fields.values().stream().map(field -> field.type).collect(Collectors.toCollection(LinkedHashSet::new));<NEW_LINE>if (recordType.restFieldType.tag != TypeTags.NONE) {<NEW_LINE>fieldTypes.add(recordType.restFieldType);<NEW_LINE>}<NEW_LINE>return new TypeSymbolPair(null, BUnionType.create(null, fieldTypes));<NEW_LINE>} else if (keyExpr.getKind() == NodeKind.SIMPLE_VARIABLE_REF) {<NEW_LINE>BLangSimpleVarRef varRef = (BLangSimpleVarRef) keyExpr;<NEW_LINE>fieldName = names.fromIdNode(varRef.variableName);<NEW_LINE>} else if (keyExpr.getKind() == NodeKind.LITERAL && keyExpr.getBType().tag == TypeTags.STRING) {<NEW_LINE>fieldName = names.fromString((String) ((BLangLiteral) keyExpr).value);<NEW_LINE>} else {<NEW_LINE>dlog.error(keyExpr.pos, DiagnosticErrorCode.INVALID_RECORD_LITERAL_KEY);<NEW_LINE>return new TypeSymbolPair(null, symTable.semanticError);<NEW_LINE>}<NEW_LINE>// Check whether the struct field exists<NEW_LINE>BSymbol fieldSymbol = symResolver.resolveStructField(keyExpr.pos, data.env, fieldName, recordType.tsymbol);<NEW_LINE>BType type = checkRecordLiteralKeyByName(keyExpr.<MASK><NEW_LINE>return new TypeSymbolPair(fieldSymbol instanceof BVarSymbol ? (BVarSymbol) fieldSymbol : null, type);<NEW_LINE>}
pos, fieldSymbol, fieldName, recordType);
1,156,749
public void channelActive(ChannelHandlerContext ctx) throws Exception {<NEW_LINE>Promise<X509Certificate> unusedPromise = ctx.channel().attr(CLIENT_CERTIFICATE_PROMISE_KEY).get().addListener((Promise<X509Certificate> promise) -> {<NEW_LINE>if (promise.isSuccess()) {<NEW_LINE>sslClientCertificateHash = getCertificateHash(promise.get());<NEW_LINE>// Set the client cert hash key attribute for both this channel,<NEW_LINE>// used for collecting metrics on specific clients.<NEW_LINE>ctx.channel().attr(CLIENT_CERTIFICATE_HASH_KEY).set(sslClientCertificateHash);<NEW_LINE>clientAddress = ctx.channel().attr(REMOTE_ADDRESS_KEY).get();<NEW_LINE>metrics.registerActiveConnection("epp", sslClientCertificateHash, ctx.channel());<NEW_LINE>channelRead(ctx, Unpooled.wrappedBuffer(helloBytes));<NEW_LINE>} else {<NEW_LINE>logger.atWarning().withCause(promise.cause()).log("Cannot finish handshake for channel %s, remote IP %s", ctx.channel(), ctx.channel().attr<MASK><NEW_LINE>ChannelFuture unusedFuture = ctx.close();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>super.channelActive(ctx);<NEW_LINE>}
(REMOTE_ADDRESS_KEY).get());
1,574,869
private static boolean jsIsStatic(JSFunction jsFunction) {<NEW_LINE>if (jsFunction.getParent() instanceof JSAssignmentExpression) {<NEW_LINE>// pre-ES6 prototype assignment based classes<NEW_LINE>// Class.foo = function() {}; <- static<NEW_LINE>// Class.prototype.bar = function() {}; <- non-static<NEW_LINE>return Optional.of(jsFunction).map(PsiElement::getParent).map(PsiElement::getFirstChild).filter(JSDefinitionExpression.class::isInstance).filter(d -> !d.getText().contains(".prototype.")).isPresent();<NEW_LINE>} else if (jsFunction.getParent() instanceof JSProperty) {<NEW_LINE>// goog.defineClass(..., {<NEW_LINE>// foo: function() {}, <--- JSFunction (non-static)<NEW_LINE>// v----------------------- JSProperty<NEW_LINE>// statics: { <------------ JSObjectLiteralExpression<NEW_LINE>// v--------------------- JSProperty<NEW_LINE>// bar: function() {}, <- JSFunction (static)<NEW_LINE>// },<NEW_LINE>// })<NEW_LINE>return Optional.of(jsFunction).map(PsiElement::getParent).map(PsiElement::getParent).filter(JSObjectLiteralExpression.class::isInstance).map(PsiElement::getParent).filter(JSProperty.class::isInstance).map(JSProperty.class::cast).filter(p -> Objects.equals(p.getName()<MASK><NEW_LINE>} else if (jsFunction.getParent() instanceof JSClass) {<NEW_LINE>// ES6 classes<NEW_LINE>return Optional.of(jsFunction).map(JSAttributeListOwner::getAttributeList).filter(a -> a.hasModifier(ModifierType.STATIC)).isPresent();<NEW_LINE>}<NEW_LINE>// Shouldn't happen unless it's a standalone function.<NEW_LINE>// Probably makes sense to call it static.<NEW_LINE>// It wouldn't match any class-qualified TS function by name anyway.<NEW_LINE>return true;<NEW_LINE>}
, "statics")).isPresent();
31,718
private void initControllerView(View v) {<NEW_LINE>mPauseButton = v.findViewById(R.id.play_button);<NEW_LINE>if (mPauseButton != null) {<NEW_LINE>mPauseButton.requestFocus();<NEW_LINE>mPauseButton.setOnClickListener(mPauseListener);<NEW_LINE>}<NEW_LINE>mFullscreenButton = v.findViewById(R.id.fullscreen_mode_button);<NEW_LINE>if (mFullscreenButton != null) {<NEW_LINE>mFullscreenButton.requestFocus();<NEW_LINE>mFullscreenButton.setOnClickListener(mFullscreenListener);<NEW_LINE>}<NEW_LINE>mFastForwardButton = v.findViewById(R.id.fast_forward_button);<NEW_LINE>if (mFastForwardButton != null) {<NEW_LINE>mFastForwardButton.setOnClickListener(mFfwdListener);<NEW_LINE>if (!mFromXml) {<NEW_LINE>mFastForwardButton.setVisibility(mUseFastForward ? View.VISIBLE : View.GONE);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>mRewindButton = v.findViewById(R.id.rewind_button);<NEW_LINE>if (mRewindButton != null) {<NEW_LINE>mRewindButton.setOnClickListener(mRewListener);<NEW_LINE>if (!mFromXml) {<NEW_LINE>mRewindButton.setVisibility(mUseFastForward ? View.VISIBLE : View.GONE);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// By default these are hidden. They will be enabled when setPrevNextListeners() is called<NEW_LINE>mNextButton = v.findViewById(R.id.skip_next_button);<NEW_LINE>if (mNextButton != null && !mFromXml && !mListenersSet) {<NEW_LINE>mNextButton.setVisibility(View.GONE);<NEW_LINE>}<NEW_LINE>mPrevButton = v.findViewById(R.id.skip_previous_button);<NEW_LINE>if (mPrevButton != null && !mFromXml && !mListenersSet) {<NEW_LINE>mPrevButton.setVisibility(View.GONE);<NEW_LINE>}<NEW_LINE>mProgress = v.findViewById(R.id.seek_bar);<NEW_LINE>if (mProgress != null) {<NEW_LINE>if (mProgress instanceof SeekBar) {<NEW_LINE>SeekBar seeker = (SeekBar) mProgress;<NEW_LINE>seeker.setOnSeekBarChangeListener(mSeekListener);<NEW_LINE>}<NEW_LINE>mProgress.setMax(1000);<NEW_LINE>}<NEW_LINE>mEndTime = v.<MASK><NEW_LINE>mCurrentTime = v.findViewById(R.id.current_time_text);<NEW_LINE>mFormatBuilder = new StringBuilder();<NEW_LINE>mFormatter = new Formatter(mFormatBuilder, Locale.getDefault());<NEW_LINE>installPrevNextListeners();<NEW_LINE>}
findViewById(R.id.end_time_text);
1,390,749
public Call newCall(Request request) {<NEW_LINE>// add extra headers<NEW_LINE>Request.Builder rb = request.newBuilder();<NEW_LINE>for (Map.Entry<String, String> header : this.extraHeaders.entrySet()) {<NEW_LINE>rb.addHeader(header.getKey(), header.getValue());<NEW_LINE>}<NEW_LINE>for (Map.Entry<String, String> cookie : this.extraCookies.entrySet()) {<NEW_LINE>rb.addHeader("Cookie", String.format("%s=%s", cookie.getKey(), cookie.getValue()));<NEW_LINE>}<NEW_LINE>// add extra query params<NEW_LINE>if (!this.extraQueryParams.isEmpty()) {<NEW_LINE>String newQuery = request.url()<MASK><NEW_LINE>for (Pair queryParam : this.extraQueryParams) {<NEW_LINE>String param = String.format("%s=%s", queryParam.getName(), queryParam.getValue());<NEW_LINE>if (newQuery == null) {<NEW_LINE>newQuery = param;<NEW_LINE>} else {<NEW_LINE>newQuery += "&" + param;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>URI newUri;<NEW_LINE>try {<NEW_LINE>newUri = new URI(request.url().uri().getScheme(), request.url().uri().getAuthority(), request.url().uri().getPath(), newQuery, request.url().uri().getFragment());<NEW_LINE>rb.url(newUri.toURL());<NEW_LINE>} catch (MalformedURLException | URISyntaxException e) {<NEW_LINE>throw new RuntimeException("Error while updating an url", e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return new PlayWSCall(wsClient, this.executor, this.filters, rb.build());<NEW_LINE>}
.uri().getQuery();