idx
int32 46
1.86M
| input
stringlengths 321
6.6k
| target
stringlengths 9
1.24k
|
|---|---|---|
1,156,252
|
ImmutableList<String> condenseCompilerArguments(CoreArg kotlinArgs) {<NEW_LINE>ImmutableMap.Builder<String, Optional<String><MASK><NEW_LINE>LinkedHashMap<String, Optional<String>> freeArgs = Maps.newLinkedHashMap();<NEW_LINE>kotlinArgs.getFreeCompilerArgs().forEach(arg -> freeArgs.put(arg, Optional.empty()));<NEW_LINE>optionBuilder.putAll(freeArgs);<NEW_LINE>// Args from CommonToolArguments.kt and KotlinCommonToolOptions.kt<NEW_LINE>if (kotlinArgs.getAllWarningsAsErrors()) {<NEW_LINE>optionBuilder.put("-Werror", Optional.empty());<NEW_LINE>}<NEW_LINE>if (kotlinArgs.getSuppressWarnings()) {<NEW_LINE>optionBuilder.put("-nowarn", Optional.empty());<NEW_LINE>}<NEW_LINE>if (kotlinArgs.getVerbose()) {<NEW_LINE>optionBuilder.put("-verbose", Optional.empty());<NEW_LINE>}<NEW_LINE>// Args from K2JVMCompilerArguments.kt and KotlinJvmOptions.kt<NEW_LINE>optionBuilder.put("-jvm-target", Optional.of(kotlinArgs.getJvmTarget()));<NEW_LINE>if (kotlinArgs.getIncludeRuntime()) {<NEW_LINE>optionBuilder.put("-include-runtime", Optional.empty());<NEW_LINE>}<NEW_LINE>kotlinArgs.getJdkHome().ifPresent(jdkHome -> optionBuilder.put("-jdk-home", Optional.of(jdkHome)));<NEW_LINE>if (kotlinArgs.getNoJdk()) {<NEW_LINE>optionBuilder.put("-no-jdk", Optional.empty());<NEW_LINE>}<NEW_LINE>if (kotlinArgs.getNoStdlib()) {<NEW_LINE>optionBuilder.put("-no-stdlib", Optional.empty());<NEW_LINE>}<NEW_LINE>if (kotlinArgs.getNoReflect()) {<NEW_LINE>optionBuilder.put("-no-reflect", Optional.empty());<NEW_LINE>}<NEW_LINE>if (kotlinArgs.getJavaParameters()) {<NEW_LINE>optionBuilder.put("-java-parameters", Optional.empty());<NEW_LINE>}<NEW_LINE>kotlinArgs.getApiVersion().ifPresent(apiVersion -> optionBuilder.put("-api-version", Optional.of(apiVersion)));<NEW_LINE>kotlinArgs.getLanguageVersion().ifPresent(languageVersion -> optionBuilder.put("-language-version", Optional.of(languageVersion)));<NEW_LINE>// Return de-duping keys and sorting by them.<NEW_LINE>return optionBuilder.build().entrySet().stream().filter(distinctByKey(Map.Entry::getKey)).sorted(comparing(Map.Entry::getKey, String.CASE_INSENSITIVE_ORDER)).flatMap(entry -> {<NEW_LINE>if (entry.getValue().isPresent()) {<NEW_LINE>return ImmutableList.of(entry.getKey(), entry.getValue().get()).stream();<NEW_LINE>} else {<NEW_LINE>return ImmutableList.of(entry.getKey()).stream();<NEW_LINE>}<NEW_LINE>}).collect(toImmutableList());<NEW_LINE>}
|
> optionBuilder = ImmutableMap.builder();
|
595,488
|
public int compareSp(Slice str1, Slice str2) {<NEW_LINE>SliceInput sliceInput1 = str1.getInput();<NEW_LINE>SliceInput sliceInput2 = str2.getInput();<NEW_LINE>int minLen = Math.min(str1.length(), str2.length());<NEW_LINE>int len1 = str1.length();<NEW_LINE>int len2 = str2.length();<NEW_LINE>while (sliceInput1.isReadable() && sliceInput2.isReadable()) {<NEW_LINE>int weight1 <MASK><NEW_LINE>int weight2 = sortOrder[codeOfSimpleFromUTF8(sliceInput2)];<NEW_LINE>if (weight1 != weight2) {<NEW_LINE>return weight1 - weight2;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>int res = 0;<NEW_LINE>if (len1 != len2) {<NEW_LINE>int swap = 1;<NEW_LINE>if (DIFF_IF_ONLY_END_SPACE_DIFFERENCE) {<NEW_LINE>res = 1;<NEW_LINE>}<NEW_LINE>if (len1 < len2) {<NEW_LINE>sliceInput1 = sliceInput2;<NEW_LINE>len1 = len2;<NEW_LINE>swap = -1;<NEW_LINE>res = -res;<NEW_LINE>}<NEW_LINE>int rest = len1 - minLen;<NEW_LINE>while (rest > 0) {<NEW_LINE>int weight = sortOrder[codeOfSimpleFromUTF8(sliceInput1)];<NEW_LINE>--rest;<NEW_LINE>if (weight != spaceWeight) {<NEW_LINE>return weight < spaceWeight ? -swap : swap;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return res;<NEW_LINE>}
|
= sortOrder[codeOfSimpleFromUTF8(sliceInput1)];
|
1,785,758
|
private boolean fitHomographAndPredict(List<Point2D_F64> detectedDots, LlahOperations.FoundDocument doc, Track track) {<NEW_LINE>// Fit a homography to points<NEW_LINE>if (!fitHomography(detectedDots, doc))<NEW_LINE>return false;<NEW_LINE>// Create a list of used landmarks from the inlier set<NEW_LINE>inlierPairs.clear();<NEW_LINE>int N = ransac.getMatchSet().size();<NEW_LINE>for (int i = 0; i < N; i++) {<NEW_LINE>int inputIdx = ransac.getInputIndex(i);<NEW_LINE>int dotIdx = ransacDotIdx.get(inputIdx);<NEW_LINE>int landmarkIdx = doc.landmarkToDots.indexOf(dotIdx);<NEW_LINE>track.observed.grow().setTo(detectedDots<MASK><NEW_LINE>inlierPairs.add(ransacPairs.get(inputIdx));<NEW_LINE>}<NEW_LINE>// Estimate using all the inliers by minimizing algebraic errors<NEW_LINE>estimateHomography.process(inlierPairs, foundH);<NEW_LINE>// Non-linear refinement of reprojection error<NEW_LINE>refineHomography.fitModel(inlierPairs, foundH, refinedH);<NEW_LINE>// Use the homography to estimate where the landmarks would have appeared<NEW_LINE>UtilHomography_F64.convert(refinedH, track.doc_to_imagePixel);<NEW_LINE>track.predicted.resize(doc.document.landmarks.size);<NEW_LINE>// Predict where all the observations shuld be based on the homography<NEW_LINE>for (int landmarkIdx = 0; landmarkIdx < doc.document.landmarks.size; landmarkIdx++) {<NEW_LINE>Point2D_F64 predictedPixel = track.predicted.get(landmarkIdx);<NEW_LINE>HomographyPointOps_F64.transform(track.doc_to_imagePixel, doc.document.landmarks.get(landmarkIdx), predictedPixel);<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>}
|
.get(dotIdx), landmarkIdx);
|
1,364,838
|
protected MultiGetResult<K, V> do_GET_ALL(Set<? extends K> keys) {<NEW_LINE>RedisConnection con = null;<NEW_LINE>try {<NEW_LINE>con = connectionFactory.getConnection();<NEW_LINE>ArrayList<K> keyList = new ArrayList<>(keys);<NEW_LINE>byte[][] newKeys = keyList.stream().map((k) -> buildKey(k)).toArray(byte[][]::new);<NEW_LINE>Map<K, CacheGetResult<V>> resultMap = new HashMap<>();<NEW_LINE>if (newKeys.length > 0) {<NEW_LINE>List mgetResults = con.mGet(newKeys);<NEW_LINE>for (int i = 0; i < mgetResults.size(); i++) {<NEW_LINE>Object value = mgetResults.get(i);<NEW_LINE>K <MASK><NEW_LINE>if (value != null) {<NEW_LINE>CacheValueHolder<V> holder = (CacheValueHolder<V>) valueDecoder.apply((byte[]) value);<NEW_LINE>if (System.currentTimeMillis() >= holder.getExpireTime()) {<NEW_LINE>resultMap.put(key, CacheGetResult.EXPIRED_WITHOUT_MSG);<NEW_LINE>} else {<NEW_LINE>CacheGetResult<V> r = new CacheGetResult<>(CacheResultCode.SUCCESS, null, holder);<NEW_LINE>resultMap.put(key, r);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>resultMap.put(key, CacheGetResult.NOT_EXISTS_WITHOUT_MSG);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return new MultiGetResult<>(CacheResultCode.SUCCESS, null, resultMap);<NEW_LINE>} catch (Exception ex) {<NEW_LINE>logError("GET_ALL", "keys(" + keys.size() + ")", ex);<NEW_LINE>return new MultiGetResult<>(ex);<NEW_LINE>} finally {<NEW_LINE>closeConnection(con);<NEW_LINE>}<NEW_LINE>}
|
key = keyList.get(i);
|
1,415,476
|
public static void init() {<NEW_LINE>Panel canvasPanel = new Panel();<NEW_LINE>createCanvasPanel(canvasPanel);<NEW_LINE>if (frame != null) {<NEW_LINE>frame.setVisible(false);<NEW_LINE>}<NEW_LINE>frame = new JFrame();<NEW_LINE>frame.add(canvasPanel);<NEW_LINE>canvas.addKeyListener(stdDraw3D);<NEW_LINE>canvas.addMouseListener(stdDraw3D);<NEW_LINE>canvas.addMouseMotionListener(stdDraw3D);<NEW_LINE>// closes all windows<NEW_LINE><MASK><NEW_LINE>frame.setResizable(false);<NEW_LINE>frame.pack();<NEW_LINE>rootGroup = new BranchGroup();<NEW_LINE>rootGroup.setCapability(BranchGroup.ALLOW_CHILDREN_EXTEND);<NEW_LINE>rootGroup.setCapability(BranchGroup.ALLOW_CHILDREN_WRITE);<NEW_LINE>shapeGroup1 = new BranchGroup();<NEW_LINE>shapeGroup1.setCapability(BranchGroup.ALLOW_CHILDREN_EXTEND);<NEW_LINE>shapeGroup1.setCapability(BranchGroup.ALLOW_CHILDREN_WRITE);<NEW_LINE>shapeGroup1.setCapability(BranchGroup.ALLOW_DETACH);<NEW_LINE>shapeGroup2 = new BranchGroup();<NEW_LINE>shapeGroup2.setCapability(BranchGroup.ALLOW_CHILDREN_EXTEND);<NEW_LINE>shapeGroup2.setCapability(BranchGroup.ALLOW_CHILDREN_WRITE);<NEW_LINE>shapeGroup2.setCapability(BranchGroup.ALLOW_DETACH);<NEW_LINE>lightGroup = new BranchGroup();<NEW_LINE>lightGroup.setCapability(BranchGroup.ALLOW_DETACH);<NEW_LINE>lightGroup.setCapability(BranchGroup.ALLOW_CHILDREN_EXTEND);<NEW_LINE>addLight();<NEW_LINE>onscreenGroup = shapeGroup1;<NEW_LINE>offscreenGroup = shapeGroup2;<NEW_LINE>rootGroup.addChild(onscreenGroup);<NEW_LINE>rootGroup.addChild(lightGroup);<NEW_LINE>universe = new SimpleUniverse(canvas, 2);<NEW_LINE>universe.addBranchGraph(rootGroup);<NEW_LINE>ViewingPlatform viewingPlatform = universe.getViewingPlatform();<NEW_LINE>viewingPlatform.setNominalViewingTransform();<NEW_LINE>zoomOut();<NEW_LINE>// Add orbit behavior to the ViewingPlatform<NEW_LINE>OrbitBehavior orbit = new OrbitBehavior(canvas, OrbitBehavior.REVERSE_ALL ^ OrbitBehavior.STOP_ZOOM);<NEW_LINE>BoundingSphere bounds = new BoundingSphere(new Point3d(0.0, 0.0, 0.0), width);<NEW_LINE>orbit.setMinRadius(0);<NEW_LINE>orbit.setSchedulingBounds(bounds);<NEW_LINE>viewingPlatform.setViewPlatformBehavior(orbit);<NEW_LINE>setPenColor(WHITE);<NEW_LINE>setPenWidth(1);<NEW_LINE>frame.setVisible(true);<NEW_LINE>}
|
frame.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
|
730,350
|
private void parsePy() {<NEW_LINE>try {<NEW_LINE>String args = Arrays.stream(argNames).collect(Collectors.joining(","));<NEW_LINE>String head = "import polyglot\n" + "@polyglot.export_value\n" + "def polyglot_enso_python_eval(" + args + "):\n";<NEW_LINE>String indentLines = code.getForeignSource().lines().map(l -> " " + l).collect(Collectors.joining("\n"));<NEW_LINE>Source source = Source.newBuilder(code.getLanguage().getTruffleId(), head + <MASK><NEW_LINE>EpbContext context = EpbContext.get(this);<NEW_LINE>CallTarget ct = context.getEnv().parsePublic(source);<NEW_LINE>ct.call();<NEW_LINE>Object fn = context.getEnv().importSymbol("polyglot_enso_python_eval");<NEW_LINE>foreign = insert(PyForeignNodeGen.create(fn));<NEW_LINE>} catch (Throwable e) {<NEW_LINE>if (InteropLibrary.getUncached().isException(e)) {<NEW_LINE>parseError = (AbstractTruffleException) e;<NEW_LINE>} else {<NEW_LINE>throw e;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
|
indentLines, "").build();
|
1,395,168
|
public void initialize() {<NEW_LINE>final AtlonaPro3Config config = getAtlonaConfig();<NEW_LINE>if (config == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (config.getIpAddress() == null || config.getIpAddress().trim().length() == 0) {<NEW_LINE>updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.CONFIGURATION_ERROR, "IP Address of Atlona Pro3 is missing from configuration");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>session = new SocketChannelSession(getThing().getUID().getAsString(), config.getIpAddress(), 23);<NEW_LINE>atlonaHandler = new AtlonaPro3PortocolHandler(session, config, getCapabilities(), new StatefulHandlerCallback(new AtlonaHandlerCallback() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void stateChanged(String channelId, State state) {<NEW_LINE>updateState(channelId, state);<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void statusChanged(ThingStatus status, ThingStatusDetail detail, String msg) {<NEW_LINE><MASK><NEW_LINE>if (status != ThingStatus.ONLINE) {<NEW_LINE>disconnect(true);<NEW_LINE>}<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void setProperty(String propertyName, String propertyValue) {<NEW_LINE>getThing().setProperty(propertyName, propertyValue);<NEW_LINE>}<NEW_LINE>}));<NEW_LINE>// Try initial connection in a scheduled task<NEW_LINE>this.scheduler.schedule(this::connect, 1, TimeUnit.SECONDS);<NEW_LINE>}
|
updateStatus(status, detail, msg);
|
22,312
|
public ListenerResult listen(WorkflowContext context) throws WorkflowListenerException {<NEW_LINE>GroupResourceProcessForm form = (GroupResourceProcessForm) context.getProcessForm();<NEW_LINE>String groupId = form.getInlongGroupId();<NEW_LINE>String streamId = form.getInlongStreamId();<NEW_LINE>String applicant = context.getApplicant();<NEW_LINE>// update inlong group status<NEW_LINE>groupService.updateStatus(groupId, EntityStatus.GROUP_CONFIG_SUCCESSFUL.getCode(), applicant);<NEW_LINE>// update inlong stream status<NEW_LINE>streamService.updateStatus(groupId, streamId, EntityStatus.STREAM_CONFIG_SUCCESSFUL.getCode(), applicant);<NEW_LINE>// update file data source status<NEW_LINE>fileDetailMapper.updateStatusAfterApprove(groupId, streamId, EntityStatus.AGENT_ADD.getCode(), applicant);<NEW_LINE>// Update stream source status<NEW_LINE>sourceService.updateStatus(groupId, streamId, SourceState.<MASK><NEW_LINE>return ListenerResult.success();<NEW_LINE>}
|
TO_BE_ISSUED_ADD.getCode(), applicant);
|
1,512,882
|
private void stopTimerIfStillRunning(ExecuteContext ctx) {<NEW_LINE>Iterable<Tag> queryTags = queryTagsSupplier.get();<NEW_LINE>if (queryTags == null)<NEW_LINE>return;<NEW_LINE>Timer.Sample sample;<NEW_LINE>synchronized (sampleLock) {<NEW_LINE>sample = sampleByExecuteContext.remove(ctx);<NEW_LINE>}<NEW_LINE>if (sample == null)<NEW_LINE>return;<NEW_LINE>String exceptionName = "none";<NEW_LINE>String exceptionSubclass = "none";<NEW_LINE>Exception exception = ctx.exception();<NEW_LINE>if (exception != null) {<NEW_LINE>if (exception instanceof DataAccessException) {<NEW_LINE>DataAccessException dae = (DataAccessException) exception;<NEW_LINE>exceptionName = dae.sqlStateClass().name().toLowerCase().replace('_', ' ');<NEW_LINE>exceptionSubclass = dae.sqlStateSubclass().name().toLowerCase(<MASK><NEW_LINE>if (exceptionSubclass.contains("no subclass")) {<NEW_LINE>exceptionSubclass = "none";<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>String simpleName = exception.getClass().getSimpleName();<NEW_LINE>exceptionName = StringUtils.isNotBlank(simpleName) ? simpleName : exception.getClass().getName();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// noinspection unchecked<NEW_LINE>sample.stop(Timer.builder("jooq.query").description("Execution time of a SQL query performed with JOOQ").tags(queryTags).tag("type", ctx.type().name().toLowerCase()).tag("exception", exceptionName).tag("exception.subclass", exceptionSubclass).tags(tags).register(registry));<NEW_LINE>}
|
).replace('_', ' ');
|
1,759,940
|
static void postEval(ScriptingContainer container, ScriptContext context) {<NEW_LINE>if (context == null)<NEW_LINE>return;<NEW_LINE>Object receiver = Utils.getReceiverObject(context);<NEW_LINE>Bindings engineMap = context.getBindings(ScriptContext.ENGINE_SCOPE);<NEW_LINE>Iterator<Map.Entry<String, Object>> iter = engineMap.entrySet().iterator();<NEW_LINE>for (; iter.hasNext(); ) {<NEW_LINE>Map.Entry<String, Object> entry = iter.next();<NEW_LINE>if (Utils.shouldLVarBeDeleted(container, entry.getKey())) {<NEW_LINE>iter.remove();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>Set<String> keys = container.getVarMap().keySet();<NEW_LINE>if (keys != null && keys.size() > 0) {<NEW_LINE>for (String key : keys) {<NEW_LINE>Object value = container.getVarMap().get(key);<NEW_LINE>engineMap.put(Utils<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>Bindings globalMap = context.getBindings(ScriptContext.GLOBAL_SCOPE);<NEW_LINE>if (globalMap == null)<NEW_LINE>return;<NEW_LINE>keys = globalMap.keySet();<NEW_LINE>if (keys != null && keys.size() > 0) {<NEW_LINE>for (String key : keys) {<NEW_LINE>if (engineMap.containsKey(key))<NEW_LINE>continue;<NEW_LINE>Object value = container.getVarMap().get(receiver, key);<NEW_LINE>globalMap.put(key, value);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
|
.adjustKey(key), value);
|
1,023,827
|
public // args is @Sensitive to avoid tracing parameters we don't care about<NEW_LINE>Object invoke(@Sensitive Object proxy, Method method, @Sensitive Object[] args) throws Throwable {<NEW_LINE>Object ret;<NEW_LINE>String methodName = method.getName();<NEW_LINE>if (method.getDeclaringClass() == Object.class) {<NEW_LINE>if ("toString".equals(methodName)) {<NEW_LINE>return proxy.getClass().getName() + '@' + Integer.toHexString(System.identityHashCode(proxy)) + '[' + this + ']';<NEW_LINE>}<NEW_LINE>if ("equals".equals(methodName)) {<NEW_LINE>return proxy == args[0];<NEW_LINE>}<NEW_LINE>if ("hashCode".equals(methodName)) {<NEW_LINE>return getTarget().hashCode();<NEW_LINE>}<NEW_LINE>throw new UnsupportedOperationException(method.toString());<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>// This method takes an argument of ExtendedBeanManager.LifecycleListener but this class is not available at compile time.<NEW_LINE>if (methodName.equals("registerLifecycleListener")) {<NEW_LINE>if (args.length != 1) {<NEW_LINE>// Basic sanity check without doing a classloader lookup.<NEW_LINE>throw new IllegalStateException("registerLifecycleListener should have one argument");<NEW_LINE>}<NEW_LINE>// only one argument.<NEW_LINE>Object listener = args[0];<NEW_LINE>Method proxyMethod = extendedBeanManager.getClass().getMethod("registerLifecycleListener", Object.class);<NEW_LINE>ret = <MASK><NEW_LINE>// All other methods will be going to the bean manager, not the extended bean manager.<NEW_LINE>} else {<NEW_LINE>ret = method.invoke(getTarget(), args);<NEW_LINE>}<NEW_LINE>if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {<NEW_LINE>Tr.debug(tc, "Invoked BeanManager method", cdiService, method, args, ret);<NEW_LINE>}<NEW_LINE>} catch (InvocationTargetException e) {<NEW_LINE>throw e.getCause();<NEW_LINE>} catch (Throwable t) {<NEW_LINE>throw new IllegalStateException(t);<NEW_LINE>}<NEW_LINE>return ret;<NEW_LINE>}
|
proxyMethod.invoke(extendedBeanManager, listener);
|
653,233
|
public CreateSessionRequest decode(SerializationContext context, UaDecoder decoder) {<NEW_LINE>RequestHeader requestHeader = (RequestHeader) decoder.readStruct("RequestHeader", RequestHeader.TYPE_ID);<NEW_LINE>ApplicationDescription clientDescription = (ApplicationDescription) decoder.readStruct("ClientDescription", ApplicationDescription.TYPE_ID);<NEW_LINE>String serverUri = decoder.readString("ServerUri");<NEW_LINE>String <MASK><NEW_LINE>String sessionName = decoder.readString("SessionName");<NEW_LINE>ByteString clientNonce = decoder.readByteString("ClientNonce");<NEW_LINE>ByteString clientCertificate = decoder.readByteString("ClientCertificate");<NEW_LINE>Double requestedSessionTimeout = decoder.readDouble("RequestedSessionTimeout");<NEW_LINE>UInteger maxResponseMessageSize = decoder.readUInt32("MaxResponseMessageSize");<NEW_LINE>return new CreateSessionRequest(requestHeader, clientDescription, serverUri, endpointUrl, sessionName, clientNonce, clientCertificate, requestedSessionTimeout, maxResponseMessageSize);<NEW_LINE>}
|
endpointUrl = decoder.readString("EndpointUrl");
|
1,675,636
|
public void start() {<NEW_LINE>// This needs to be at the begnning of the start method for Oauth2 to work<NEW_LINE>// correctly on the web. This handles the login when the Oauth2 login page<NEW_LINE>// redirects back tothe app<NEW_LINE>if (Oauth2.handleRedirect(e -> {<NEW_LINE>if (e.getSource() instanceof AccessToken) {<NEW_LINE><MASK><NEW_LINE>AccessToken token = (AccessToken) e.getSource();<NEW_LINE>setAccessToken(token);<NEW_LINE>showLoggedIn();<NEW_LINE>} else {<NEW_LINE>Log.p("Failed to login " + e.getSource());<NEW_LINE>showLogin();<NEW_LINE>}<NEW_LINE>return;<NEW_LINE>})) {<NEW_LINE>// The Oauth redirect was handled. Use the handleRedirect callback for control flow<NEW_LINE>// do not continue with rest of start() method.<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (current != null) {<NEW_LINE>current.show();<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>showLogin();<NEW_LINE>}
|
Log.p("Logged in: " + e);
|
1,007,932
|
// Converts an FpML 'StubValue' to a {@code IborRateStubCalculation}.<NEW_LINE>private IborRateStubCalculation parseStubCalculation(XmlElement baseEl, FpmlDocument document) {<NEW_LINE>Optional<XmlElement> rateOptEl = baseEl.findChild("stubRate");<NEW_LINE>if (rateOptEl.isPresent()) {<NEW_LINE>return IborRateStubCalculation.ofFixedRate(document.parseDecimal(rateOptEl.get()));<NEW_LINE>}<NEW_LINE>Optional<XmlElement> amountOptEl = baseEl.findChild("stubAmount");<NEW_LINE>if (amountOptEl.isPresent()) {<NEW_LINE>return IborRateStubCalculation.ofKnownAmount(document.parseCurrencyAmount(amountOptEl.get()));<NEW_LINE>}<NEW_LINE>List<XmlElement> indicesEls = baseEl.getChildren("floatingRate");<NEW_LINE>if (indicesEls.size() == 1) {<NEW_LINE>XmlElement indexEl = indicesEls.get(0);<NEW_LINE>document.validateNotPresent(indexEl, "floatingRateMultiplierSchedule");<NEW_LINE>document.validateNotPresent(indexEl, "spreadSchedule");<NEW_LINE>document.validateNotPresent(indexEl, "rateTreatment");<NEW_LINE><MASK><NEW_LINE>document.validateNotPresent(indexEl, "floorRateSchedule");<NEW_LINE>return IborRateStubCalculation.ofIborRate((IborIndex) document.parseIndex(indexEl));<NEW_LINE>} else if (indicesEls.size() == 2) {<NEW_LINE>XmlElement index1El = indicesEls.get(0);<NEW_LINE>document.validateNotPresent(index1El, "floatingRateMultiplierSchedule");<NEW_LINE>document.validateNotPresent(index1El, "spreadSchedule");<NEW_LINE>document.validateNotPresent(index1El, "rateTreatment");<NEW_LINE>document.validateNotPresent(index1El, "capRateSchedule");<NEW_LINE>document.validateNotPresent(index1El, "floorRateSchedule");<NEW_LINE>XmlElement index2El = indicesEls.get(1);<NEW_LINE>document.validateNotPresent(index2El, "floatingRateMultiplierSchedule");<NEW_LINE>document.validateNotPresent(index2El, "spreadSchedule");<NEW_LINE>document.validateNotPresent(index2El, "rateTreatment");<NEW_LINE>document.validateNotPresent(index2El, "capRateSchedule");<NEW_LINE>document.validateNotPresent(index2El, "floorRateSchedule");<NEW_LINE>return IborRateStubCalculation.ofIborInterpolatedRate((IborIndex) document.parseIndex(index1El), (IborIndex) document.parseIndex(index2El));<NEW_LINE>}<NEW_LINE>throw new FpmlParseException("Unknown stub structure: " + baseEl);<NEW_LINE>}
|
document.validateNotPresent(indexEl, "capRateSchedule");
|
1,827,945
|
public static List<URI> readDnsConf() {<NEW_LINE>final Logger logger = LoggerFactory.getLogger(DnsUtil.class);<NEW_LINE>final boolean debug = logger.isDebugEnabled();<NEW_LINE>final File file = new File(Sys.sysProp(QBIT_DNS_RESOLV_CONF, "/etc/resolv.conf"));<NEW_LINE>if (file.exists()) {<NEW_LINE>final List<String> <MASK><NEW_LINE>if (debug)<NEW_LINE>logger.debug("file contents {}", lines);<NEW_LINE>return lines.stream().filter(line -> line.startsWith("nameserver")).map(line -> {<NEW_LINE>if (debug)<NEW_LINE>logger.debug("file content line = {}", line);<NEW_LINE>final String uriToParse = line.replace("nameserver ", "").trim();<NEW_LINE>final String[] split = Str.split(uriToParse, ':');<NEW_LINE>try {<NEW_LINE>if (split.length == 1) {<NEW_LINE>return new URI("dns", "", split[0], 53, "", "", "");<NEW_LINE>} else if (split.length >= 2) {<NEW_LINE>return new URI("dns", "", split[0], Integer.parseInt(split[1]), "", "", "");<NEW_LINE>} else {<NEW_LINE>throw new IllegalStateException("Unable to parse URI from /etc/resolv.conf");<NEW_LINE>}<NEW_LINE>} catch (URISyntaxException e) {<NEW_LINE>throw new IllegalStateException("failed to convert to URI");<NEW_LINE>}<NEW_LINE>}).collect(Collectors.toList());<NEW_LINE>} else {<NEW_LINE>throw new IllegalStateException("" + file + " not found");<NEW_LINE>}<NEW_LINE>}
|
lines = IO.readLines(file);
|
321,345
|
protected String buildString() {<NEW_LINE>StringBuilder sb = new StringBuilder();<NEW_LINE>String ls = System.getProperty("line.separator");<NEW_LINE>sb.append("[SSH2 KEX init Header (").append(length()).append(" bytes)]").append(ls);<NEW_LINE>sb.append(" Message Number: ").append(messageNumber).append(ls);<NEW_LINE>sb.append(" cookie: ").append(ByteArrays.toHexString(cookie, " ")).append(ls);<NEW_LINE>sb.append(" kex_algorithms: ").append(kexAlgorithms).append(ls);<NEW_LINE>sb.append(" server_host_key_algorithms: ").append(serverHostKeyAlgorithms).append(ls);<NEW_LINE>sb.append(" encryption_algorithms_client_to_server: ").append(encryptionAlgorithmsClientToServer).append(ls);<NEW_LINE>sb.append(" encryption_algorithms_server_to_client: ").append(encryptionAlgorithmsServerToClient).append(ls);<NEW_LINE>sb.append(" mac_algorithms_client_to_server: ").append(macAlgorithmsClientToServer).append(ls);<NEW_LINE>sb.append(" mac_algorithms_server_to_client: ").append(macAlgorithmsServerToClient).append(ls);<NEW_LINE>sb.append(" compression_algorithms_client_to_server: ").append(compressionAlgorithmsClientToServer).append(ls);<NEW_LINE>sb.append(" compression_algorithms_server_to_client: ").append<MASK><NEW_LINE>sb.append(" languages_client_to_server: ").append(languagesClientToServer).append(ls);<NEW_LINE>sb.append(" languages_server_to_client: ").append(languagesServerToClient).append(ls);<NEW_LINE>sb.append(" first_kex_packet_follows: ").append(firstKexPacketFollows).append(ls);<NEW_LINE>sb.append(" reserved: ").append(ByteArrays.toHexString(reserved, " ")).append(ls);<NEW_LINE>return sb.toString();<NEW_LINE>}
|
(compressionAlgorithmsServerToClient).append(ls);
|
431,968
|
public static WriteRequest parseProto(WriteRequestPb proto) {<NEW_LINE>WriteTypePb writeTypePb = proto.getWriteType();<NEW_LINE>DataRecordPb dataRecordPb = proto.getDataRecord();<NEW_LINE>Map<String, Object> properties = Collections.<MASK><NEW_LINE>DataRecordPb.RecordKeyCase recordKeyCase = dataRecordPb.getRecordKeyCase();<NEW_LINE>switch(recordKeyCase) {<NEW_LINE>case VERTEX_RECORD_KEY:<NEW_LINE>VertexRecordKey vertexRecordKey = VertexRecordKey.parseProto(dataRecordPb.getVertexRecordKey());<NEW_LINE>return buildWriteVertexRequest(writeTypePb, new DataRecord(vertexRecordKey, properties));<NEW_LINE>case EDGE_RECORD_KEY:<NEW_LINE>EdgeRecordKey edgeRecordKey = EdgeRecordKey.parseProto(dataRecordPb.getEdgeRecordKey());<NEW_LINE>return buildWriteEdgeRequest(writeTypePb, new DataRecord(edgeRecordKey, properties));<NEW_LINE>default:<NEW_LINE>throw new IllegalArgumentException("Invalid record key case [" + recordKeyCase + "]");<NEW_LINE>}<NEW_LINE>}
|
unmodifiableMap(dataRecordPb.getPropertiesMap());
|
706,881
|
public void showPopup(final Component popupContainer, final Component infoPane) throws InterruptedException {<NEW_LINE>final Component c = MageFrame.getUI(<MASK><NEW_LINE>SwingUtilities.invokeLater(() -> {<NEW_LINE>if (!popupTextWindowOpen || enlargedWindowState != EnlargedWindowState.CLOSED) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (data.getLocationOnScreen() == null) {<NEW_LINE>data.setLocationOnScreen(cardPanel.getCardLocationOnScreen().getCardPoint());<NEW_LINE>}<NEW_LINE>Point location = new Point((int) data.getLocationOnScreen().getX() + data.getPopupOffsetX() - 40, (int) data.getLocationOnScreen().getY() + data.getPopupOffsetY() - 40);<NEW_LINE>location = GuiDisplayUtil.keepComponentInsideParent(location, parentPoint, infoPane, parentComponent);<NEW_LINE>location.translate(-parentPoint.x, -parentPoint.y);<NEW_LINE>popupContainer.setLocation(location);<NEW_LINE>popupContainer.setVisible(true);<NEW_LINE>c.repaint();<NEW_LINE>});<NEW_LINE>}
|
).getComponent(MageComponents.DESKTOP_PANE);
|
80,980
|
// read the particle information from a PacketBuffer after the client has received it from the server<NEW_LINE>@Override<NEW_LINE>public FlameParticleData read(@Nonnull ParticleType<FlameParticleData> type, PacketBuffer buf) {<NEW_LINE>// warning! never trust the data read in from a packet buffer.<NEW_LINE>final int MIN_COLOUR = 0;<NEW_LINE>final int MAX_COLOUR = 255;<NEW_LINE>int red = MathHelper.clamp(buf.readInt(), MIN_COLOUR, MAX_COLOUR);<NEW_LINE>int green = MathHelper.clamp(buf.readInt(), MIN_COLOUR, MAX_COLOUR);<NEW_LINE>int blue = MathHelper.clamp(buf.<MASK><NEW_LINE>Color color = new Color(red, green, blue);<NEW_LINE>double diameter = constrainDiameterToValidRange(buf.readDouble());<NEW_LINE>return new FlameParticleData(color, diameter);<NEW_LINE>}
|
readInt(), MIN_COLOUR, MAX_COLOUR);
|
1,622,956
|
ActionResult<List<Wo>> execute(EffectivePerson effectivePerson, String application, String infoId) throws Exception {<NEW_LINE>ActionResult<List<Wo>> result = new ActionResult<>();<NEW_LINE>List<Wo> wraps = null;<NEW_LINE>List<HotPictureInfo> hotPictureInfos = null;<NEW_LINE>Cache.CacheCategory cacheCategory = new Cache.CacheCategory(HotPictureInfo.class);<NEW_LINE>HotPictureInfoServiceAdv hotPictureInfoService = new HotPictureInfoServiceAdv();<NEW_LINE>if (application == null || application.isEmpty() || "(0)".equals(application)) {<NEW_LINE>throw new InfoApplicationEmptyException();<NEW_LINE>}<NEW_LINE>if (infoId == null || infoId.isEmpty() || "(0)".equals(infoId)) {<NEW_LINE>throw new InfoIdEmptyException();<NEW_LINE>}<NEW_LINE>String cacheKey = "list#" + application + "#" + infoId;<NEW_LINE>CacheKey cacheKeyObj = new Cache.CacheKey(cacheKey);<NEW_LINE>Optional<?> element = CacheManager.get(cacheCategory, cacheKeyObj);<NEW_LINE>if (null != element) {<NEW_LINE>if (element.isPresent()) {<NEW_LINE>wraps = (List<Wo>) element.get();<NEW_LINE>result.setData(wraps);<NEW_LINE>return result;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>hotPictureInfos = <MASK><NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new InfoListByApplicationException(e, application, infoId);<NEW_LINE>}<NEW_LINE>if (hotPictureInfos != null && !hotPictureInfos.isEmpty()) {<NEW_LINE>try {<NEW_LINE>wraps = Wo.copier.copy(hotPictureInfos);<NEW_LINE>CacheManager.put(cacheCategory, cacheKeyObj, wraps);<NEW_LINE>result.setData(wraps);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new InfoWrapOutException(e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>}
|
hotPictureInfoService.listByApplicationInfoId(application, infoId);
|
1,726,279
|
public void onMessage(Message inMessage) {<NEW_LINE>// disposable exchange, swapped with real Exchange on correlation<NEW_LINE>inMessage.setExchange(new ExchangeImpl());<NEW_LINE>inMessage.getExchange().<MASK><NEW_LINE>inMessage.put(Message.DECOUPLED_CHANNEL_MESSAGE, Boolean.TRUE);<NEW_LINE>// REVISIT: how to get response headers?<NEW_LINE>// inMessage.put(Message.PROTOCOL_HEADERS, req.getXXX());<NEW_LINE>Headers.getSetProtocolHeaders(inMessage);<NEW_LINE>inMessage.put(Message.RESPONSE_CODE, HttpURLConnection.HTTP_OK);<NEW_LINE>// remove server-specific properties<NEW_LINE>inMessage.remove(AbstractHTTPDestination.HTTP_REQUEST);<NEW_LINE>inMessage.remove(AbstractHTTPDestination.HTTP_RESPONSE);<NEW_LINE>inMessage.remove(Message.ASYNC_POST_RESPONSE_DISPATCH);<NEW_LINE>// cache this inputstream since it's defer to use in case of async<NEW_LINE>try {<NEW_LINE>InputStream in = inMessage.getContent(InputStream.class);<NEW_LINE>if (in != null) {<NEW_LINE>CachedOutputStream cos = new CachedOutputStream();<NEW_LINE>IOUtils.copy(in, cos);<NEW_LINE>inMessage.setContent(InputStream.class, cos.getInputStream());<NEW_LINE>}<NEW_LINE>incomingObserver.onMessage(inMessage);<NEW_LINE>} catch (IOException e) {<NEW_LINE>logStackTrace(e);<NEW_LINE>}<NEW_LINE>}
|
put(Bus.class, bus);
|
1,074,468
|
public MarketDataBox<RatesCurveInputs> build(RatesCurveInputsId id, MarketDataConfig marketDataConfig, ScenarioMarketData marketData, ReferenceData refData) {<NEW_LINE>CurveGroupName groupName = id.getCurveGroupName();<NEW_LINE>CurveName curveName = id.getCurveName();<NEW_LINE>RatesCurveGroupDefinition groupDefn = marketDataConfig.get(RatesCurveGroupDefinition.class, groupName);<NEW_LINE>Optional<CurveDefinition> optionalDefinition = groupDefn.findCurveDefinition(id.getCurveName());<NEW_LINE>if (!optionalDefinition.isPresent()) {<NEW_LINE>throw new IllegalArgumentException(Messages.format("No curve named '{}' found in group '{}'", curveName, groupName));<NEW_LINE>}<NEW_LINE>CurveDefinition configuredDefn = optionalDefinition.get();<NEW_LINE>// determine market data needs<NEW_LINE>MarketDataBox<LocalDate> valuationDates = marketData.getValuationDate();<NEW_LINE>boolean multipleValuationDates = valuationDates.isScenarioValue();<NEW_LINE>// curve definition can vary for each valuation date<NEW_LINE>if (multipleValuationDates) {<NEW_LINE>List<CurveDefinition> curveDefns = IntStream.range(0, valuationDates.getScenarioCount()).mapToObj(valuationDates::getValue).map((LocalDate valDate) -> configuredDefn.filtered(valDate, refData)).collect(toImmutableList());<NEW_LINE>Set<MarketDataId<?>> requirements = nodeRequirements(curveDefns);<NEW_LINE>Map<MarketDataId<?>, MarketDataBox<?>> marketDataValues = requirements.stream().collect(toImmutableMap(k -> k, k -> marketData.getValue(k)));<NEW_LINE>return buildMultipleCurveInputs(MarketDataBox.ofScenarioValues(curveDefns), marketDataValues, valuationDates, refData);<NEW_LINE>}<NEW_LINE>// only one valuation date<NEW_LINE>LocalDate valuationDate = valuationDates.getValue(0);<NEW_LINE>CurveDefinition filteredDefn = configuredDefn.filtered(valuationDate, refData);<NEW_LINE>Set<MarketDataId<?>> requirements = nodeRequirements<MASK><NEW_LINE>Map<MarketDataId<?>, MarketDataBox<?>> marketDataValues = requirements.stream().collect(toImmutableMap(k -> k, k -> marketData.getValue(k)));<NEW_LINE>// Do any of the inputs contain values for multiple scenarios, or do they contain 1 value each?<NEW_LINE>boolean multipleInputValues = marketDataValues.values().stream().anyMatch(MarketDataBox::isScenarioValue);<NEW_LINE>return multipleInputValues || multipleValuationDates ? buildMultipleCurveInputs(MarketDataBox.ofSingleValue(filteredDefn), marketDataValues, valuationDates, refData) : buildSingleCurveInputs(filteredDefn, marketDataValues, valuationDate, refData);<NEW_LINE>}
|
(ImmutableList.of(filteredDefn));
|
1,192,278
|
public boolean handleMessage(Message message) {<NEW_LINE>// #492 - NullPointerException when expanding item with auto-scroll<NEW_LINE>if (mRecyclerView == null) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>int firstVisibleItem = getFlexibleLayoutManager().findFirstCompletelyVisibleItemPosition();<NEW_LINE>int lastVisibleItem <MASK><NEW_LINE>int itemsToShow = position + subItemsCount - lastVisibleItem;<NEW_LINE>// log.v("autoScroll itemsToShow=%s firstVisibleItem=%s lastVisibleItem=%s RvChildCount=%s", itemsToShow, firstVisibleItem, lastVisibleItem, mRecyclerView.getChildCount());<NEW_LINE>if (itemsToShow > 0) {<NEW_LINE>int scrollMax = position - firstVisibleItem;<NEW_LINE>int scrollMin = Math.max(0, position + subItemsCount - lastVisibleItem);<NEW_LINE>int scrollBy = Math.min(scrollMax, scrollMin);<NEW_LINE>int spanCount = getFlexibleLayoutManager().getSpanCount();<NEW_LINE>if (spanCount > 1) {<NEW_LINE>scrollBy = scrollBy % spanCount + spanCount;<NEW_LINE>}<NEW_LINE>int scrollTo = firstVisibleItem + scrollBy;<NEW_LINE>// log.v("autoScroll scrollMin=%s scrollMax=%s scrollBy=%s scrollTo=%s", scrollMin, scrollMax, scrollBy, scrollTo);<NEW_LINE>performScroll(scrollTo);<NEW_LINE>} else if (position < firstVisibleItem) {<NEW_LINE>performScroll(position);<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>}
|
= getFlexibleLayoutManager().findLastCompletelyVisibleItemPosition();
|
35,919
|
public Path copy(final Path source, final Path target, final TransferStatus status, final ConnectionCallback callback, final StreamListener listener) throws BackgroundException {<NEW_LINE>InputStream in;<NEW_LINE>StatusOutputStream out;<NEW_LINE>in = from.getFeature(Read.class).read(source, new TransferStatus(status), callback);<NEW_LINE>Write writer = to.getFeature(MultipartWrite.class);<NEW_LINE>if (null == writer) {<NEW_LINE>// Fallback if multipart write is not available<NEW_LINE>writer = <MASK><NEW_LINE>}<NEW_LINE>out = writer.write(target, status, callback);<NEW_LINE>new StreamCopier(status, status).withListener(listener).transfer(in, out);<NEW_LINE>if (!PathAttributes.EMPTY.equals(status.getResponse())) {<NEW_LINE>if (log.isDebugEnabled()) {<NEW_LINE>log.debug(String.format("Received reply %s for creating file %s", status.getResponse(), target));<NEW_LINE>}<NEW_LINE>return new Path(target).withAttributes(status.getResponse());<NEW_LINE>}<NEW_LINE>log.warn(String.format("Missing status from writer %s", writer));<NEW_LINE>return target;<NEW_LINE>}
|
to.getFeature(Write.class);
|
1,277,129
|
public Object show(String title, HelpCtx helpCtx, Object[] options, boolean setMaxNeededSize, String name) {<NEW_LINE>RepositoryDialogPanel corectPanel = new RepositoryDialogPanel();<NEW_LINE>corectPanel.panel.setLayout(new BorderLayout());<NEW_LINE>corectPanel.panel.add(getPanel(), BorderLayout.NORTH);<NEW_LINE>// NOI18N<NEW_LINE>DialogDescriptor dialogDescriptor = new DialogDescriptor(corectPanel, title);<NEW_LINE>JPanel p = getPanel();<NEW_LINE>if (setMaxNeededSize) {<NEW_LINE>if (bPushPull) {<NEW_LINE>maxNeededSize.setSize(maxNeededSize.width, maxNeededSize.height + HG_PUSH_PULL_VERT_PADDING);<NEW_LINE>}<NEW_LINE>p.setPreferredSize(maxNeededSize);<NEW_LINE>}<NEW_LINE>if (options != null) {<NEW_LINE>// NOI18N<NEW_LINE>dialogDescriptor.setOptions(options);<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>return dialogDescriptor.getValue();<NEW_LINE>}
|
showDialog(dialogDescriptor, helpCtx, name);
|
401,373
|
protected void checkEmptyParcelPalletLines(LogisticalForm logisticalForm, List<String> errorMessageList) throws LogisticalFormError {<NEW_LINE>if (logisticalForm.getLogisticalFormLineList() == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>Map<LogisticalFormLine, BigDecimal> qtyMap = new HashMap<>();<NEW_LINE>LogisticalFormLine currentLine = null;<NEW_LINE>for (LogisticalFormLine logisticalFormLine : logisticalForm.getLogisticalFormLineList()) {<NEW_LINE>if (logisticalFormLine.getTypeSelect() != LogisticalFormLineRepository.TYPE_DETAIL) {<NEW_LINE>currentLine = logisticalFormLine;<NEW_LINE>qtyMap.<MASK><NEW_LINE>} else {<NEW_LINE>if (currentLine == null) {<NEW_LINE>throw new LogisticalFormError(logisticalForm, I18n.get(IExceptionMessage.LOGISTICAL_FORM_LINES_ORPHAN_DETAIL));<NEW_LINE>}<NEW_LINE>qtyMap.merge(currentLine, logisticalFormLine.getQty(), BigDecimal::add);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>for (Entry<LogisticalFormLine, BigDecimal> entry : qtyMap.entrySet()) {<NEW_LINE>LogisticalFormLine logisticalFormLine = entry.getKey();<NEW_LINE>BigDecimal qty = entry.getValue();<NEW_LINE>if (qty.signum() <= 0) {<NEW_LINE>String msg;<NEW_LINE>if (logisticalFormLine.getTypeSelect() == LogisticalFormLineRepository.TYPE_PARCEL) {<NEW_LINE>msg = I18n.get(IExceptionMessage.LOGISTICAL_FORM_LINES_EMPTY_PARCEL);<NEW_LINE>} else {<NEW_LINE>msg = I18n.get(IExceptionMessage.LOGISTICAL_FORM_LINES_EMPTY_PALLET);<NEW_LINE>}<NEW_LINE>String errorMessage = String.format(msg, logisticalFormLine.getParcelPalletNumber());<NEW_LINE>errorMessageList.add(errorMessage);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
|
put(currentLine, BigDecimal.ZERO);
|
1,165,495
|
public boolean apply(Game game, Ability source) {<NEW_LINE>Permanent equipment = game.getPermanent(source.getSourceId());<NEW_LINE>if (equipment != null && equipment.getAttachedTo() != null) {<NEW_LINE>Permanent creature = game.getPermanent(equipment.getAttachedTo());<NEW_LINE>if (creature == null) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>UUID defenderId = game.getCombat().getDefenderId(creature.getId());<NEW_LINE>Player defendingPlayer = game.getPlayer(defenderId);<NEW_LINE>if (defendingPlayer == null) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>CardsImpl cards = new CardsImpl();<NEW_LINE>for (Card card : defendingPlayer.getLibrary().getCards(game)) {<NEW_LINE>cards.add(card);<NEW_LINE>if (card.isLand(game)) {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>defendingPlayer.revealCards(equipment.<MASK><NEW_LINE>defendingPlayer.moveCards(cards, Zone.GRAVEYARD, source, game);<NEW_LINE>if (!cards.isEmpty()) {<NEW_LINE>ContinuousEffect effect = new BoostTargetEffect(cards.size(), 0, Duration.EndOfTurn);<NEW_LINE>effect.setTargetPointer(new FixedTarget(creature, game));<NEW_LINE>game.addEffect(effect, source);<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>}
|
getName(), cards, game);
|
1,120,151
|
public void marshall(Layer layer, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (layer == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(layer.getArn(), ARN_BINDING);<NEW_LINE>protocolMarshaller.marshall(layer.getStackId(), STACKID_BINDING);<NEW_LINE>protocolMarshaller.marshall(layer.getLayerId(), LAYERID_BINDING);<NEW_LINE>protocolMarshaller.marshall(layer.getType(), TYPE_BINDING);<NEW_LINE>protocolMarshaller.marshall(layer.getName(), NAME_BINDING);<NEW_LINE>protocolMarshaller.marshall(layer.getShortname(), SHORTNAME_BINDING);<NEW_LINE>protocolMarshaller.marshall(layer.getAttributes(), ATTRIBUTES_BINDING);<NEW_LINE>protocolMarshaller.marshall(layer.getCloudWatchLogsConfiguration(), CLOUDWATCHLOGSCONFIGURATION_BINDING);<NEW_LINE>protocolMarshaller.marshall(layer.getCustomInstanceProfileArn(), CUSTOMINSTANCEPROFILEARN_BINDING);<NEW_LINE>protocolMarshaller.marshall(layer.getCustomJson(), CUSTOMJSON_BINDING);<NEW_LINE>protocolMarshaller.marshall(layer.getCustomSecurityGroupIds(), CUSTOMSECURITYGROUPIDS_BINDING);<NEW_LINE>protocolMarshaller.marshall(layer.getDefaultSecurityGroupNames(), DEFAULTSECURITYGROUPNAMES_BINDING);<NEW_LINE>protocolMarshaller.marshall(layer.getPackages(), PACKAGES_BINDING);<NEW_LINE>protocolMarshaller.marshall(layer.getVolumeConfigurations(), VOLUMECONFIGURATIONS_BINDING);<NEW_LINE>protocolMarshaller.marshall(<MASK><NEW_LINE>protocolMarshaller.marshall(layer.getAutoAssignElasticIps(), AUTOASSIGNELASTICIPS_BINDING);<NEW_LINE>protocolMarshaller.marshall(layer.getAutoAssignPublicIps(), AUTOASSIGNPUBLICIPS_BINDING);<NEW_LINE>protocolMarshaller.marshall(layer.getDefaultRecipes(), DEFAULTRECIPES_BINDING);<NEW_LINE>protocolMarshaller.marshall(layer.getCustomRecipes(), CUSTOMRECIPES_BINDING);<NEW_LINE>protocolMarshaller.marshall(layer.getCreatedAt(), CREATEDAT_BINDING);<NEW_LINE>protocolMarshaller.marshall(layer.getInstallUpdatesOnBoot(), INSTALLUPDATESONBOOT_BINDING);<NEW_LINE>protocolMarshaller.marshall(layer.getUseEbsOptimizedInstances(), USEEBSOPTIMIZEDINSTANCES_BINDING);<NEW_LINE>protocolMarshaller.marshall(layer.getLifecycleEventConfiguration(), LIFECYCLEEVENTCONFIGURATION_BINDING);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>}
|
layer.getEnableAutoHealing(), ENABLEAUTOHEALING_BINDING);
|
930,828
|
private static void printUnits(PatchingChain<Unit> u, String msg) {<NEW_LINE>System.out.println("\r\r*********** " + msg);<NEW_LINE>HashMap<Unit, Integer> numbers = new HashMap<>();<NEW_LINE>{<NEW_LINE>int i = 0;<NEW_LINE>for (Iterator<Unit> it = u.snapshotIterator(); it.hasNext(); ) {<NEW_LINE>numbers.put(it.next(), i++);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>for (Iterator<Unit> udit = u.snapshotIterator(); udit.hasNext(); ) {<NEW_LINE>final Unit unit = udit.next();<NEW_LINE>final Integer numb = numbers.get(unit);<NEW_LINE>if (unit instanceof TargetArgInst) {<NEW_LINE>TargetArgInst ti = (TargetArgInst) unit;<NEW_LINE>if (ti.getTarget() == null) {<NEW_LINE>System.out.println(unit + " null null null null null null null null null");<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>System.out.println(numb + " " + unit + " #" + numbers.get(ti.getTarget()));<NEW_LINE>continue;<NEW_LINE>} else if (unit instanceof TableSwitchInst) {<NEW_LINE>TableSwitchInst tswi = (TableSwitchInst) unit;<NEW_LINE>System.out.println(numb + " SWITCH:");<NEW_LINE>System.out.println("\tdefault: " + tswi.getDefaultTarget() + " " + numbers.get(tswi.getDefaultTarget()));<NEW_LINE>int idx = 0;<NEW_LINE>for (int x = tswi.getLowIndex(), e = tswi.getHighIndex(); x <= e; x++) {<NEW_LINE>System.out.println("\t " + x + ": " + tswi.getTarget(idx) + " " + numbers.get(tswi<MASK><NEW_LINE>}<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>System.out.println(numb + " " + unit);<NEW_LINE>}<NEW_LINE>}
|
.getTarget(idx++)));
|
472,037
|
public void onBindViewHolder(final BookmarksViewHolder holder, final int position) {<NEW_LINE>final AppBookmark item = getItem(position);<NEW_LINE>holder.page.setText(TxtUtils.percentFormatInt(item.getPercent()));<NEW_LINE>FileMeta m = AppDB.get().load(MyPath.toAbsolute(item.path));<NEW_LINE>if (m != null && m.getPages() != null && m.getPages() > 0) {<NEW_LINE>holder.page.setText("" + Math.round(item.getPercent() * m.getPages()));<NEW_LINE>}<NEW_LINE>holder.title.setText(ExtUtils.getFileName(item.getPath()));<NEW_LINE>holder.text.setText(item.text);<NEW_LINE>holder.remove.setOnClickListener(new OnClickListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onClick(View v) {<NEW_LINE>onDeleteClickListener.onResultRecive(item);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>holder.remove.setImageResource(withPageNumber ? R.drawable.glyphicons_208_remove_2 : R.drawable.glyphicons_basic_578_share);<NEW_LINE>TintUtil.setTintImageNoAlpha(holder.remove, holder.remove.getResources().getColor(R.color.lt_grey_dima));<NEW_LINE>if (withTitle) {<NEW_LINE>// holder.title.setVisibility(View.VISIBLE);<NEW_LINE>// holder.title.setVisibility(View.GONE);<NEW_LINE>} else {<NEW_LINE>holder.title.setVisibility(View.GONE);<NEW_LINE>}<NEW_LINE>TintUtil.setTintBgSimple(holder.page, 240);<NEW_LINE>holder.page.setTextColor(Color.WHITE);<NEW_LINE>if (withPageNumber) {<NEW_LINE>holder.<MASK><NEW_LINE>// holder.remove.setVisibility(View.VISIBLE);<NEW_LINE>} else {<NEW_LINE>holder.page.setVisibility(View.GONE);<NEW_LINE>// holder.remove.setVisibility(View.GONE);<NEW_LINE>}<NEW_LINE>IMG.getCoverPageWithEffectPos(holder.image, item.getPath(), IMG.getImageSize(), position);<NEW_LINE>Clouds.showHideCloudImage(holder.cloudImage, item.getPath());<NEW_LINE>if (!AppState.get().isBorderAndShadow) {<NEW_LINE>holder.parent.setBackgroundColor(Color.TRANSPARENT);<NEW_LINE>}<NEW_LINE>bindItemClickAndLongClickListeners(holder.parent, getItem(position));<NEW_LINE>if (AppState.get().appTheme == AppState.THEME_DARK_OLED) {<NEW_LINE>holder.parent.setBackgroundColor(Color.BLACK);<NEW_LINE>}<NEW_LINE>}
|
page.setVisibility(View.VISIBLE);
|
1,587,257
|
private void drawGraph(Canvas canvas) {<NEW_LINE>mPaint.setPathEffect(null);<NEW_LINE>mPaint.<MASK><NEW_LINE>mPaint.setColor(getResources().getColor(R.color.dk_color_4c00C9F4));<NEW_LINE>mPaint.setStrokeWidth(GRAPH_STROKE_WIDTH);<NEW_LINE>mPaint.setAntiAlias(true);<NEW_LINE>if (drawLeftLine) {<NEW_LINE>float middleValue = currentValue - (currentValue - lastValue) / 2f;<NEW_LINE>float middleY = ((pointBottomY - pointTopY) * 1f / (maxValue - minValue) * (maxValue - middleValue + minValue) + pointTopY);<NEW_LINE>canvas.drawLine(0, middleY, pointX, pointY, mPaint);<NEW_LINE>drawGradient(canvas, middleY, false);<NEW_LINE>}<NEW_LINE>if (drawRightLine) {<NEW_LINE>float middleValue = currentValue - (currentValue - nextValue) / 2f;<NEW_LINE>float middleY = ((pointBottomY - pointTopY) * 1f / (maxValue - minValue) * (maxValue - middleValue + minValue) + pointTopY);<NEW_LINE>canvas.drawLine(pointX, pointY, viewWidth, middleY, mPaint);<NEW_LINE>drawGradient(canvas, middleY, true);<NEW_LINE>}<NEW_LINE>}
|
setStyle(Paint.Style.FILL);
|
422,192
|
protected void onCreate(@Nullable Bundle savedInstanceState) {<NEW_LINE>super.onCreate(savedInstanceState);<NEW_LINE>setContentView(R.layout.activity_main);<NEW_LINE>// authentication with an API key or named user is required to access basemaps and other<NEW_LINE>// location services<NEW_LINE>ArcGISRuntimeEnvironment.setApiKey(BuildConfig.API_KEY);<NEW_LINE>mMapView = findViewById(R.id.mapView);<NEW_LINE>// create a map with streets basemap<NEW_LINE>ArcGISMap map = new ArcGISMap(BasemapStyle.ARCGIS_STREETS);<NEW_LINE>// create service feature table from URL<NEW_LINE>mServiceFeatureTable = new ServiceFeatureTable(getString(R.string.service_layer_url));<NEW_LINE>// create a feature layer from table<NEW_LINE>FeatureLayer featureLayer = new FeatureLayer(mServiceFeatureTable);<NEW_LINE>// add the layer to the map<NEW_LINE>map.getOperationalLayers().add(featureLayer);<NEW_LINE>// add a listener to the MapView to detect when a user has performed a single tap to add a new feature to<NEW_LINE>// the service feature table<NEW_LINE>mMapView.setOnTouchListener(new DefaultMapViewOnTouchListener(this, mMapView) {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public boolean onSingleTapConfirmed(MotionEvent event) {<NEW_LINE>// create a point from where the user clicked<NEW_LINE>android.graphics.Point point = new android.graphics.Point((int) event.getX(), (<MASK><NEW_LINE>// create a map point from a point<NEW_LINE>Point mapPoint = mMapView.screenToLocation(point);<NEW_LINE>// add a new feature to the service feature table<NEW_LINE>addFeature(mapPoint, mServiceFeatureTable);<NEW_LINE>return super.onSingleTapConfirmed(event);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>// set map to be displayed in map view<NEW_LINE>mMapView.setMap(map);<NEW_LINE>mMapView.setViewpoint(new Viewpoint(40.0, -95.0, 10000000.0));<NEW_LINE>}
|
int) event.getY());
|
1,734,419
|
private boolean startProcess() {<NEW_LINE>log.fine(processInstance.toString());<NEW_LINE>boolean started = false;<NEW_LINE>// hengsin, bug [ 1633995 ]<NEW_LINE>boolean clientOnly = false;<NEW_LINE>if (!processInstance.getClassName().toLowerCase().startsWith(MRule.SCRIPT_PREFIX)) {<NEW_LINE>try {<NEW_LINE>Class<?> processClass = Class.forName(processInstance.getClassName());<NEW_LINE>if (ClientProcess.class.isAssignableFrom(processClass))<NEW_LINE>clientOnly = true;<NEW_LINE>} catch (Exception e) {<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (isServerProcess && !clientOnly) {<NEW_LINE>try {<NEW_LINE>Server server = CConnection.get().getServer();<NEW_LINE>if (server != null) {<NEW_LINE>// See ServerBean<NEW_LINE>processInstance = server.process(Env.getRemoteCallCtx(Env.getCtx()), processInstance);<NEW_LINE>log.finest("server => " + processInstance);<NEW_LINE>started = true;<NEW_LINE>}<NEW_LINE>} catch (UndeclaredThrowableException ex) {<NEW_LINE>Throwable cause = ex.getCause();<NEW_LINE>if (cause != null) {<NEW_LINE>if (cause instanceof InvalidClassException)<NEW_LINE>log.log(Level.SEVERE, "Version Server <> Client: " + cause.toString() + " - " + processInstance, ex);<NEW_LINE>else<NEW_LINE>log.log(Level.SEVERE, "AppsServer error(1b): " + cause.toString() + " - " + processInstance, ex);<NEW_LINE>} else<NEW_LINE>log.log(Level.<MASK><NEW_LINE>started = false;<NEW_LINE>} catch (Exception ex) {<NEW_LINE>Throwable cause = ex.getCause();<NEW_LINE>if (cause == null)<NEW_LINE>cause = ex;<NEW_LINE>log.log(Level.SEVERE, "AppsServer error - " + processInstance, cause);<NEW_LINE>started = false;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Run locally<NEW_LINE>if (!started && (!isServerProcess || clientOnly)) {<NEW_LINE>if (processInstance.getClassName().toLowerCase().startsWith(MRule.SCRIPT_PREFIX)) {<NEW_LINE>return ProcessUtil.startScriptProcess(Env.getCtx(), processInstance, transaction);<NEW_LINE>} else {<NEW_LINE>if (processInstance.isManagedTransaction())<NEW_LINE>return ProcessUtil.startJavaProcess(Env.getCtx(), processInstance, transaction);<NEW_LINE>else<NEW_LINE>return ProcessUtil.startJavaProcess(Env.getCtx(), processInstance, transaction, processInstance.isManagedTransaction());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return !processInstance.isError();<NEW_LINE>}
|
SEVERE, " AppsServer error(1) - " + processInstance, ex);
|
1,612,442
|
private void initView(View rootView) {<NEW_LINE>if (isEditMode) {<NEW_LINE>initProgressDialog();<NEW_LINE>initLocationManager();<NEW_LINE>LL_diary_time_information = (LinearLayout) rootView.findViewById(R.id.LL_diary_time_information);<NEW_LINE>SP_diary_mood = (Spinner) rootView.findViewById(R.id.SP_diary_mood);<NEW_LINE>SP_diary_mood.setVisibility(View.VISIBLE);<NEW_LINE>SP_diary_weather = (Spinner) rootView.findViewById(R.id.SP_diary_weather);<NEW_LINE>SP_diary_weather.setVisibility(View.VISIBLE);<NEW_LINE>// For hidden hint<NEW_LINE>EDT_diary_title.setText(" ");<NEW_LINE>EDT_diary_title.getBackground().mutate().setColorFilter(ThemeManager.getInstance().getThemeMainColor(getActivity()), PorterDuff.Mode.SRC_ATOP);<NEW_LINE>initMoodSpinner();<NEW_LINE>initWeatherSpinner();<NEW_LINE>IV_diary_location.setOnClickListener(this);<NEW_LINE>IV_diary_delete.setOnClickListener(this);<NEW_LINE>IV_diary_clear.setVisibility(View.GONE);<NEW_LINE>IV_diary_photo.setImageResource(R.drawable.ic_photo_camera_white_24dp);<NEW_LINE>IV_diary_photo.setOnClickListener(this);<NEW_LINE>} else {<NEW_LINE>EDT_diary_title.setVisibility(View.GONE);<NEW_LINE>RL_diary_weather = (RelativeLayout) rootView.findViewById(R.id.RL_diary_weather);<NEW_LINE>RL_diary_weather.setVisibility(View.GONE);<NEW_LINE>RL_diary_mood = (RelativeLayout) rootView.findViewById(R.id.RL_diary_mood);<NEW_LINE>RL_diary_mood.setVisibility(View.GONE);<NEW_LINE>IV_diary_weather = (ImageView) rootView.findViewById(R.id.IV_diary_weather);<NEW_LINE>TV_diary_weather = (TextView) rootView.findViewById(R.id.TV_diary_weather);<NEW_LINE><MASK><NEW_LINE>TV_diary_weather.setVisibility(View.VISIBLE);<NEW_LINE>IV_diary_location_name_icon.setVisibility(View.VISIBLE);<NEW_LINE>TV_diary_title_content = (TextView) rootView.findViewById(R.id.TV_diary_title_content);<NEW_LINE>TV_diary_title_content.setVisibility(View.VISIBLE);<NEW_LINE>TV_diary_title_content.setTextColor(ThemeManager.getInstance().getThemeMainColor(getActivity()));<NEW_LINE>IV_diary_delete.setOnClickListener(this);<NEW_LINE>IV_diary_clear.setVisibility(View.GONE);<NEW_LINE>IV_diary_save.setVisibility(View.GONE);<NEW_LINE>IV_diary_photo.setImageResource(R.drawable.ic_photo_white_24dp);<NEW_LINE>IV_diary_photo.setOnClickListener(this);<NEW_LINE>}<NEW_LINE>}
|
IV_diary_weather.setVisibility(View.VISIBLE);
|
1,572,606
|
public int toDiv(DivStructure div) {<NEW_LINE>int <MASK><NEW_LINE>int fracPart = roundUp(getFractions());<NEW_LINE>if (intPart > 2) {<NEW_LINE>div.setQuot(isNeg() ? DivStructure.MIN_QUOTIENT : DivStructure.MAX_QUOTIENT);<NEW_LINE>div.setRem(0L);<NEW_LINE>return E_DEC_OVERFLOW;<NEW_LINE>}<NEW_LINE>long quot, rem;<NEW_LINE>if (intPart == 2) {<NEW_LINE>quot = ((long) getBuffValAt(0)) * DIG_BASE + getBuffValAt(1);<NEW_LINE>} else if (intPart == 1) {<NEW_LINE>quot = getBuffValAt(0);<NEW_LINE>} else {<NEW_LINE>quot = 0L;<NEW_LINE>}<NEW_LINE>rem = fracPart != 0 ? getBuffValAt(intPart) : 0;<NEW_LINE>if (isNeg()) {<NEW_LINE>quot = -quot;<NEW_LINE>rem = -rem;<NEW_LINE>}<NEW_LINE>div.setQuot(quot);<NEW_LINE>div.setRem(rem);<NEW_LINE>return E_DEC_OK;<NEW_LINE>}
|
intPart = roundUp(getIntegers());
|
1,201,068
|
private static JSONObject store(V8Frame frame) {<NEW_LINE>JSONObject obj = newJSONObject();<NEW_LINE>obj.put(TYPE, V8Value.Type.Frame.toString());<NEW_LINE>PropertyLong index = frame.getIndex();<NEW_LINE>obj.put(INDEX, getLongOrNull(index));<NEW_LINE>obj.put(FRAME_RECEIVER, store(frame.getReceiver(), true, false));<NEW_LINE>obj.put(FRAME_FUNC, store(frame.getFunction(), true, false));<NEW_LINE>storeReference(frame.getScriptRef(), obj, SCRIPT);<NEW_LINE>obj.put(FRAME_CONSTRUCT_CALL, frame.isConstructCall());<NEW_LINE>obj.put(FRAME_AT_RETURN, frame.isAtReturn());<NEW_LINE>obj.put(<MASK><NEW_LINE>storeReferences(frame.getArgumentRefs(), obj, FRAME_ARGUMENTS, true);<NEW_LINE>storeReferences(frame.getLocalRefs(), obj, FRAME_LOCALS, true);<NEW_LINE>obj.put(POSITION, frame.getPosition());<NEW_LINE>obj.put(LINE, frame.getLine());<NEW_LINE>obj.put(COLUMN, frame.getColumn());<NEW_LINE>obj.put(EVT_SOURCE_LINE_TEXT, frame.getSourceLineText());<NEW_LINE>obj.put(SCOPES, store(frame.getScopes()));<NEW_LINE>obj.put(TEXT, frame.getText());<NEW_LINE>return obj;<NEW_LINE>}
|
FRAME_DEBUGGER, frame.isDebuggerFrame());
|
955,358
|
public CancelCapacityReservationFleetsResult unmarshall(StaxUnmarshallerContext context) throws Exception {<NEW_LINE>CancelCapacityReservationFleetsResult cancelCapacityReservationFleetsResult = new CancelCapacityReservationFleetsResult();<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>XMLEvent xmlEvent = context.nextEvent();<NEW_LINE>if (xmlEvent.isEndDocument())<NEW_LINE>return cancelCapacityReservationFleetsResult;<NEW_LINE>if (xmlEvent.isAttribute() || xmlEvent.isStartElement()) {<NEW_LINE>if (context.testExpression("successfulFleetCancellationSet", targetDepth)) {<NEW_LINE>cancelCapacityReservationFleetsResult.withSuccessfulFleetCancellations(new ArrayList<CapacityReservationFleetCancellationState>());<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (context.testExpression("successfulFleetCancellationSet/item", targetDepth)) {<NEW_LINE>cancelCapacityReservationFleetsResult.withSuccessfulFleetCancellations(CapacityReservationFleetCancellationStateStaxUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (context.testExpression("failedFleetCancellationSet", targetDepth)) {<NEW_LINE>cancelCapacityReservationFleetsResult.withFailedFleetCancellations(<MASK><NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (context.testExpression("failedFleetCancellationSet/item", targetDepth)) {<NEW_LINE>cancelCapacityReservationFleetsResult.withFailedFleetCancellations(FailedCapacityReservationFleetCancellationResultStaxUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>} else if (xmlEvent.isEndElement()) {<NEW_LINE>if (context.getCurrentDepth() < originalDepth) {<NEW_LINE>return cancelCapacityReservationFleetsResult;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
|
new ArrayList<FailedCapacityReservationFleetCancellationResult>());
|
651,531
|
public static void remove(Level world, ItemStack wand, Player player, BlockPos pos) {<NEW_LINE>BlockState air = Blocks.AIR.defaultBlockState();<NEW_LINE>BlockState ogBlock = world.getBlockState(pos);<NEW_LINE>checkNBT(wand);<NEW_LINE>if (!isEnabled(wand))<NEW_LINE>return;<NEW_LINE>Map<BlockPos, BlockState> blockSet = new HashMap<>();<NEW_LINE>blockSet.put(pos, air);<NEW_LINE>SymmetryMirror symmetry = SymmetryMirror.fromNBT((CompoundTag) wand.getTag().getCompound(SYMMETRY));<NEW_LINE>Vec3 mirrorPos = symmetry.getPosition();<NEW_LINE>if (mirrorPos.distanceTo(Vec3.atLowerCornerOf(pos)) > AllConfigs.SERVER.curiosities.maxSymmetryWandRange.get())<NEW_LINE>return;<NEW_LINE>symmetry.process(blockSet);<NEW_LINE>BlockPos to = new BlockPos(mirrorPos);<NEW_LINE>List<BlockPos> targets = new ArrayList<>();<NEW_LINE>targets.add(pos);<NEW_LINE>for (BlockPos position : blockSet.keySet()) {<NEW_LINE>if (!player.isCreative() && ogBlock.getBlock() != world.getBlockState(position).getBlock())<NEW_LINE>continue;<NEW_LINE>if (position.equals(pos))<NEW_LINE>continue;<NEW_LINE>BlockState blockstate = world.getBlockState(position);<NEW_LINE>if (blockstate.getMaterial() != Material.AIR) {<NEW_LINE>targets.add(position);<NEW_LINE>world.levelEvent(2001, position, Block.getId(blockstate));<NEW_LINE>world.<MASK><NEW_LINE>if (!player.isCreative()) {<NEW_LINE>if (!player.getMainHandItem().isEmpty())<NEW_LINE>player.getMainHandItem().mineBlock(world, blockstate, position, player);<NEW_LINE>BlockEntity tileentity = blockstate.hasBlockEntity() ? world.getBlockEntity(position) : null;<NEW_LINE>// Add fortune, silk touch and other loot modifiers<NEW_LINE>Block.dropResources(blockstate, world, pos, tileentity, player, player.getMainHandItem());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>AllPackets.channel.send(PacketDistributor.TRACKING_ENTITY_AND_SELF.with(() -> player), new SymmetryEffectPacket(to, targets));<NEW_LINE>}
|
setBlock(position, air, 3);
|
997,239
|
public void removeDecorator(@Nonnull String id, boolean dirtyMode) {<NEW_LINE><MASK><NEW_LINE>final WindowInfoImpl info = getDecoratorInfoById(id);<NEW_LINE>myDecorator2Info.remove(decorator);<NEW_LINE>myId2Decorator.remove(id);<NEW_LINE>WindowInfoImpl sideInfo = getDockedInfoAt(info.getAnchor(), !info.isSplit());<NEW_LINE>if (info.isDocked()) {<NEW_LINE>if (sideInfo == null) {<NEW_LINE>new RemoveDockedComponentCmd(info, dirtyMode).run();<NEW_LINE>} else {<NEW_LINE>// return new RemoveSplitAndDockedComponentCmd(info, dirtyMode, finishCallBack);<NEW_LINE>}<NEW_LINE>} else if (info.isSliding()) {<NEW_LINE>// return new RemoveSlidingComponentCmd(decorator, info, dirtyMode, finishCallBack);<NEW_LINE>} else {<NEW_LINE>throw new IllegalArgumentException("Unknown window type");<NEW_LINE>}<NEW_LINE>}
|
final ToolWindowInternalDecorator decorator = getDecoratorById(id);
|
1,075,597
|
private boolean appendEntry(final long index, final PersistedRaftRecord entry, final CompletableFuture<AppendResponse> future) {<NEW_LINE>try {<NEW_LINE>final IndexedRaftLogEntry indexed;<NEW_LINE>indexed = raft.getLog().append(entry);<NEW_LINE>log.trace("Appended {}", indexed);<NEW_LINE>raft.getReplicationMetrics().setAppendIndex(indexed.index());<NEW_LINE>} catch (final JournalException.OutOfDiskSpace e) {<NEW_LINE>log.trace("Append failed: ", e);<NEW_LINE>raft.getLogCompactor().compact();<NEW_LINE><MASK><NEW_LINE>return false;<NEW_LINE>} catch (final InvalidChecksum e) {<NEW_LINE>log.debug("Entry checksum doesn't match entry data: ", e);<NEW_LINE>failAppend(index - 1, future);<NEW_LINE>return false;<NEW_LINE>} catch (final InvalidIndex e) {<NEW_LINE>failAppend(index - 1, future);<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>}
|
failAppend(index - 1, future);
|
1,771,973
|
protected HistoryEntry addPage(final Page page) {<NEW_LINE>final Boolean ignoreNewPages = ignoreNewPages_.get();<NEW_LINE>if (ignoreNewPages != null && ignoreNewPages.booleanValue()) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>final int sizeLimit = window_.getWebClient().getOptions().getHistorySizeLimit();<NEW_LINE>if (sizeLimit <= 0) {<NEW_LINE>entries_.clear();<NEW_LINE>index_ = -1;<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>index_++;<NEW_LINE>while (entries_.size() > index_) {<NEW_LINE>entries_.remove(index_);<NEW_LINE>}<NEW_LINE>while (entries_.size() >= sizeLimit) {<NEW_LINE>entries_.remove(0);<NEW_LINE>index_--;<NEW_LINE>}<NEW_LINE>final HistoryEntry entry = new HistoryEntry(page);<NEW_LINE>entries_.add(entry);<NEW_LINE>final int cacheLimit = Math.max(window_.getWebClient().getOptions(<MASK><NEW_LINE>if (entries_.size() > cacheLimit) {<NEW_LINE>entries_.get(entries_.size() - cacheLimit - 1).clearPage();<NEW_LINE>}<NEW_LINE>return entry;<NEW_LINE>}
|
).getHistoryPageCacheLimit(), 0);
|
153,485
|
private HuId aggregateTUsToLU(@NonNull final List<I_M_HU> tusOrVhus) {<NEW_LINE>Check.assumeNotEmpty(tusOrVhus, "at least one TU shall be received from manufacturing order");<NEW_LINE>I_M_HU lu = null;<NEW_LINE>I_M_HU_PI_Item luPIItem = null;<NEW_LINE>if (aggregateToLU.getExistingLU() != null) {<NEW_LINE>final JsonRenderedHUQRCode qrCode = aggregateToLU.getExistingLU().getHuQRCode();<NEW_LINE>final HuId <MASK><NEW_LINE>lu = handlingUnitsDAO.getById(luId);<NEW_LINE>} else {<NEW_LINE>if (aggregateToLU.getNewLU() == null) {<NEW_LINE>throw new AdempiereException("LU packing materials spec needs to be provided when no actual LU is specified.");<NEW_LINE>}<NEW_LINE>luPIItem = handlingUnitsDAO.getPackingInstructionItemById(aggregateToLU.getNewLU().getLuPIItemId());<NEW_LINE>}<NEW_LINE>for (final I_M_HU tu : tusOrVhus) {<NEW_LINE>if (lu == null) {<NEW_LINE>final List<I_M_HU> createdLUs = HUTransformService.newInstance().tuToNewLUs(tu, QtyTU.ONE.toBigDecimal(), Objects.requireNonNull(luPIItem), true);<NEW_LINE>lu = CollectionUtils.singleElement(createdLUs);<NEW_LINE>} else {<NEW_LINE>HUTransformService.newInstance().tuToExistingLU(tu, QtyTU.ONE.toBigDecimal(), lu);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (lu == null) {<NEW_LINE>// shall not happen<NEW_LINE>throw new AdempiereException("No LU was created");<NEW_LINE>}<NEW_LINE>return HuId.ofRepoId(lu.getM_HU_ID());<NEW_LINE>}
|
luId = loadingAndSavingSupportServices.getHuIdByQRCode(qrCode);
|
1,185,797
|
public void downloadURL(URL url, int index) {<NEW_LINE>try {<NEW_LINE>Document doc = Http.url(url).get();<NEW_LINE>Elements images = doc.select("article.ep-contents img");<NEW_LINE>// Find maximum # of images for optimal filename indexing<NEW_LINE>int epiLog = (int) (Math.floor(Math.log10(episodes.size())) + 1), imgLog = (int) (Math.floor(Math.log10(images.size())) + 1);<NEW_LINE>for (int i = 0; i < images.size(); i++) {<NEW_LINE>String link = images.get(i).attr("src");<NEW_LINE>TapasticEpisode episode = episodes.get(index - 1);<NEW_LINE>// Build elaborate filename prefix<NEW_LINE>StringBuilder prefix = new StringBuilder();<NEW_LINE>prefix.append(String.format("ep%0" + epiLog + "d", index));<NEW_LINE>prefix.append(String.format("-%0" + imgLog + "dof%0" + imgLog + "d-", i + 1, images.size()));<NEW_LINE>prefix.append(episode.filename.replace(" ", "-"));<NEW_LINE>prefix.append("-");<NEW_LINE>addURLToDownload(new URL(link), prefix.toString());<NEW_LINE>if (isThisATest()) {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (IOException e) {<NEW_LINE>logger.<MASK><NEW_LINE>}<NEW_LINE>}
|
error("[!] Exception while downloading " + url, e);
|
1,305,983
|
protected void generateEvidence(IndentWriter writer) {<NEW_LINE>writer.println("Tunnel Handler");<NEW_LINE>writer.indent();<NEW_LINE>writer.println("started=" + started + ", active=" + active);<NEW_LINE>if (init_fail != null) {<NEW_LINE>writer.println("Init fail: " + init_fail);<NEW_LINE>}<NEW_LINE>long now = SystemTime.getMonotonousTime();<NEW_LINE>writer.println("total local=" + total_local_servers);<NEW_LINE>writer.println("last local create=" + (last_local_server_create_time == 0 ? "<never>" : String.valueOf(now - last_local_server_create_time)));<NEW_LINE>writer.println("last local agree=" + (last_local_server_agree_time == 0 ? "<never>" : String.valueOf(now - last_local_server_agree_time)));<NEW_LINE><MASK><NEW_LINE>writer.println("last remote create=" + (last_server_create_time == 0 ? "<never>" : String.valueOf(now - last_server_create_time)));<NEW_LINE>writer.println("last remote agree=" + (last_server_agree_time == 0 ? "<never>" : String.valueOf(now - last_server_agree_time)));<NEW_LINE>synchronized (tunnels) {<NEW_LINE>writer.println("tunnels=" + tunnels.size());<NEW_LINE>for (PairManagerTunnel tunnel : tunnels.values()) {<NEW_LINE>writer.println(" " + tunnel.getString());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>writer.println("IPv4 punchers: " + nat_punchers_ipv4.size());<NEW_LINE>for (DHTNATPuncher p : nat_punchers_ipv4) {<NEW_LINE>writer.println(" " + p.getStats());<NEW_LINE>}<NEW_LINE>writer.println("IPv6 punchers: " + nat_punchers_ipv6.size());<NEW_LINE>for (DHTNATPuncher p : nat_punchers_ipv6) {<NEW_LINE>writer.println(" " + p.getStats());<NEW_LINE>}<NEW_LINE>} finally {<NEW_LINE>writer.exdent();<NEW_LINE>}<NEW_LINE>}
|
writer.println("total remote=" + total_servers);
|
210,554
|
public static ExchangeMetaData adaptToExchangeMetaData(GateioMarketDataServiceRaw marketDataService) throws IOException {<NEW_LINE>Map<CurrencyPair, CurrencyPairMetaData> currencyPairs = new HashMap<>();<NEW_LINE>Map<Currency, CurrencyMetaData> currencies = new HashMap<>();<NEW_LINE>for (Entry<CurrencyPair, GateioMarketInfo> entry : marketDataService.getBTERMarketInfo().entrySet()) {<NEW_LINE>CurrencyPair currencyPair = entry.getKey();<NEW_LINE>GateioMarketInfo btermarketInfo = entry.getValue();<NEW_LINE>CurrencyPairMetaData currencyPairMetaData = new CurrencyPairMetaData(btermarketInfo.getFee(), btermarketInfo.getMinAmount(), null, btermarketInfo.getDecimalPlaces(), null);<NEW_LINE>currencyPairs.put(currencyPair, currencyPairMetaData);<NEW_LINE>}<NEW_LINE>if (marketDataService.getApiKey() != null) {<NEW_LINE>Map<String, GateioFeeInfo<MASK><NEW_LINE>Map<String, GateioCoin> coins = marketDataService.getGateioCoinInfo().getCoins();<NEW_LINE>for (String coin : coins.keySet()) {<NEW_LINE>GateioCoin gateioCoin = coins.get(coin);<NEW_LINE>GateioFeeInfo gateioFeeInfo = gateioFees.get(coin);<NEW_LINE>if (gateioCoin != null && gateioFeeInfo != null) {<NEW_LINE>currencies.put(new Currency(coin), adaptCurrencyMetaData(gateioCoin, gateioFeeInfo));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return new ExchangeMetaData(currencyPairs, currencies, null, null, null);<NEW_LINE>}
|
> gateioFees = marketDataService.getGateioFees();
|
1,311,988
|
private static List<KeyValuePair<String, Object>> flattenParamsValue(Object value, String keyPrefix) {<NEW_LINE>List<KeyValuePair<<MASK><NEW_LINE>// I wish Java had pattern matching :(<NEW_LINE>if (value == null) {<NEW_LINE>flatParams = singleParam(keyPrefix, "");<NEW_LINE>} else if (value instanceof Map<?, ?>) {<NEW_LINE>flatParams = flattenParamsMap((Map<?, ?>) value, keyPrefix);<NEW_LINE>} else if (value instanceof String) {<NEW_LINE>flatParams = singleParam(keyPrefix, value);<NEW_LINE>} else if (value instanceof File) {<NEW_LINE>flatParams = singleParam(keyPrefix, value);<NEW_LINE>} else if (value instanceof InputStream) {<NEW_LINE>flatParams = singleParam(keyPrefix, value);<NEW_LINE>} else if (value instanceof Collection<?>) {<NEW_LINE>flatParams = flattenParamsCollection((Collection<?>) value, keyPrefix);<NEW_LINE>} else if (value.getClass().isArray()) {<NEW_LINE>Object[] array = getArrayForObject(value);<NEW_LINE>Collection<?> collection = Arrays.stream(array).collect(Collectors.toList());<NEW_LINE>flatParams = flattenParamsCollection(collection, keyPrefix);<NEW_LINE>} else if (value.getClass().isEnum()) {<NEW_LINE>flatParams = singleParam(keyPrefix, ApiResource.GSON.toJson(value).replaceAll("\"", ""));<NEW_LINE>} else {<NEW_LINE>flatParams = singleParam(keyPrefix, value.toString());<NEW_LINE>}<NEW_LINE>return flatParams;<NEW_LINE>}
|
String, Object>> flatParams = null;
|
550,925
|
public void run() {<NEW_LINE>try {<NEW_LINE>Document beforeReformat = null;<NEW_LINE>beforeReformat = collectChangesBeforeCurrentSettingsAppliance(project);<NEW_LINE>// important not mark as generated not to get the classes before setting language level<NEW_LINE>PsiFile psiFile = createFileFromText(project, myTextToReformat);<NEW_LINE>prepareForReformat(psiFile);<NEW_LINE>try {<NEW_LINE>apply(mySettings);<NEW_LINE>} catch (ConfigurationException ignore) {<NEW_LINE>}<NEW_LINE>CodeStyleSettings clone = mySettings.clone();<NEW_LINE>clone.setRightMargin(getDefaultLanguage(), getAdjustedRightMargin());<NEW_LINE>CodeStyleSettingsManager.getInstance(project).setTemporarySettings(clone);<NEW_LINE>PsiFile formatted;<NEW_LINE>try {<NEW_LINE>formatted = doReformat(project, psiFile);<NEW_LINE>} finally {<NEW_LINE>CodeStyleSettingsManager.getInstance(project).dropTemporarySettings();<NEW_LINE>}<NEW_LINE>myEditor.getSettings().setTabSize(clone.getTabSize(getFileType()));<NEW_LINE>Document document = myEditor.getDocument();<NEW_LINE>document.replaceString(0, document.getTextLength(<MASK><NEW_LINE>if (beforeReformat != null) {<NEW_LINE>highlightChanges(beforeReformat);<NEW_LINE>}<NEW_LINE>} catch (IncorrectOperationException e) {<NEW_LINE>LOG.error(e);<NEW_LINE>}<NEW_LINE>}
|
), formatted.getText());
|
381,236
|
public Request<DeleteCollectionRequest> marshall(DeleteCollectionRequest deleteCollectionRequest) {<NEW_LINE>if (deleteCollectionRequest == null) {<NEW_LINE>throw new AmazonClientException("Invalid argument passed to marshall(DeleteCollectionRequest)");<NEW_LINE>}<NEW_LINE>Request<DeleteCollectionRequest> request = new DefaultRequest<DeleteCollectionRequest>(deleteCollectionRequest, "AmazonRekognition");<NEW_LINE>String target = "RekognitionService.DeleteCollection";<NEW_LINE>request.addHeader("X-Amz-Target", target);<NEW_LINE>request.setHttpMethod(HttpMethodName.POST);<NEW_LINE>String uriResourcePath = "/";<NEW_LINE>request.setResourcePath(uriResourcePath);<NEW_LINE>try {<NEW_LINE>StringWriter stringWriter = new StringWriter();<NEW_LINE>AwsJsonWriter jsonWriter = JsonUtils.getJsonWriter(stringWriter);<NEW_LINE>jsonWriter.beginObject();<NEW_LINE>if (deleteCollectionRequest.getCollectionId() != null) {<NEW_LINE><MASK><NEW_LINE>jsonWriter.name("CollectionId");<NEW_LINE>jsonWriter.value(collectionId);<NEW_LINE>}<NEW_LINE>jsonWriter.endObject();<NEW_LINE>jsonWriter.close();<NEW_LINE>String snippet = stringWriter.toString();<NEW_LINE>byte[] content = snippet.getBytes(UTF8);<NEW_LINE>request.setContent(new StringInputStream(snippet));<NEW_LINE>request.addHeader("Content-Length", Integer.toString(content.length));<NEW_LINE>} catch (Throwable t) {<NEW_LINE>throw new AmazonClientException("Unable to marshall request to JSON: " + t.getMessage(), t);<NEW_LINE>}<NEW_LINE>if (!request.getHeaders().containsKey("Content-Type")) {<NEW_LINE>request.addHeader("Content-Type", "application/x-amz-json-1.1");<NEW_LINE>}<NEW_LINE>return request;<NEW_LINE>}
|
String collectionId = deleteCollectionRequest.getCollectionId();
|
1,315,422
|
private void addStubsForUndeclaredProperties(Name n, String alias, Node parent, Node addAfter) {<NEW_LINE>checkState(n.canCollapseUnannotatedChildNames(), n);<NEW_LINE>checkArgument(NodeUtil<MASK><NEW_LINE>checkNotNull(addAfter);<NEW_LINE>if (n.props == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>for (Name p : n.props) {<NEW_LINE>if (!p.needsToBeStubbed()) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>String propAlias = appendPropForAlias(alias, p.getBaseName());<NEW_LINE>Node nameNode = IR.name(propAlias);<NEW_LINE>Node newVar = IR.var(nameNode).srcrefTreeIfMissing(addAfter);<NEW_LINE>newVar.insertAfter(addAfter);<NEW_LINE>// Determine if this is a constant var by checking the first<NEW_LINE>// reference to it. Don't check the declaration, as it might be null.<NEW_LINE>Node constPropNode = p.getFirstRef().getNode();<NEW_LINE>nameNode.putBooleanProp(Node.IS_CONSTANT_NAME, constPropNode.getBooleanProp(Node.IS_CONSTANT_NAME));<NEW_LINE>compiler.reportChangeToEnclosingScope(newVar);<NEW_LINE>addAfter = newVar;<NEW_LINE>}<NEW_LINE>}
|
.isStatementBlock(parent), parent);
|
1,255,087
|
void countBasedSlidingWindow_Failed_And_SlowCalls() {<NEW_LINE>CircuitBreakerConfig config = CircuitBreakerConfig.custom().slidingWindowType(SlidingWindowType.COUNT_BASED).slidingWindowSize(10).failureRateThreshold(70.0f).slowCallRateThreshold(70.0f).slowCallDurationThreshold(Duration.ofSeconds(2)).build();<NEW_LINE>CircuitBreakerRegistry <MASK><NEW_LINE>CircuitBreaker circuitBreaker = registry.circuitBreaker("flightSearchService");<NEW_LINE>FlightSearchService service = new FlightSearchService();<NEW_LINE>SearchRequest request = new SearchRequest("NYC", "LAX", "12/31/2020");<NEW_LINE>service.setPotentialDelay(new AlwaysSlowNSeconds(2));<NEW_LINE>Supplier<List<Flight>> flightsSupplier = circuitBreaker.decorateSupplier(() -> service.searchFlights(request));<NEW_LINE>for (int i = 0; i < 20; i++) {<NEW_LINE>try {<NEW_LINE>System.out.println(flightsSupplier.get());<NEW_LINE>} catch (Exception e) {<NEW_LINE>e.printStackTrace();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
|
registry = CircuitBreakerRegistry.of(config);
|
960,308
|
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.<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "SFN");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "TagResource");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<TagResourceResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new TagResourceResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
|
addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);
|
1,814,360
|
protected void ExpandBuff(boolean wrapAround) {<NEW_LINE>char[] newbuffer = new char[bufsize + 2048];<NEW_LINE>int[] newbufline = new int[bufsize + 2048];<NEW_LINE>int[] newbufcolumn = new int[bufsize + 2048];<NEW_LINE>try {<NEW_LINE>if (wrapAround) {<NEW_LINE>System.arraycopy(buffer, tokenBegin, newbuffer, 0, bufsize - tokenBegin);<NEW_LINE>System.arraycopy(buffer, 0, newbuffer, bufsize - tokenBegin, bufpos);<NEW_LINE>buffer = newbuffer;<NEW_LINE>System.arraycopy(bufline, tokenBegin, newbufline, 0, bufsize - tokenBegin);<NEW_LINE>System.arraycopy(bufline, 0, newbufline, bufsize - tokenBegin, bufpos);<NEW_LINE>bufline = newbufline;<NEW_LINE>System.arraycopy(bufcolumn, tokenBegin, newbufcolumn, 0, bufsize - tokenBegin);<NEW_LINE>System.arraycopy(bufcolumn, 0, newbufcolumn, bufsize - tokenBegin, bufpos);<NEW_LINE>bufcolumn = newbufcolumn;<NEW_LINE>maxNextCharInd = (bufpos += (bufsize - tokenBegin));<NEW_LINE>} else {<NEW_LINE>System.arraycopy(buffer, tokenBegin, newbuffer, 0, bufsize - tokenBegin);<NEW_LINE>buffer = newbuffer;<NEW_LINE>System.arraycopy(bufline, tokenBegin, <MASK><NEW_LINE>bufline = newbufline;<NEW_LINE>System.arraycopy(bufcolumn, tokenBegin, newbufcolumn, 0, bufsize - tokenBegin);<NEW_LINE>bufcolumn = newbufcolumn;<NEW_LINE>maxNextCharInd = (bufpos -= tokenBegin);<NEW_LINE>}<NEW_LINE>} catch (Throwable t) {<NEW_LINE>throw new Error(t.getMessage());<NEW_LINE>}<NEW_LINE>bufsize += 2048;<NEW_LINE>available = bufsize;<NEW_LINE>tokenBegin = 0;<NEW_LINE>}
|
newbufline, 0, bufsize - tokenBegin);
|
93,633
|
public Void visitAnnotation(AnnotationTree node, Void p) {<NEW_LINE>AnnotationMirror <MASK><NEW_LINE>// Warn if a @This annotation is in an illegal location.<NEW_LINE>if (AnnotationUtils.areSame(annot, getTypeFactory().THIS_ANNOTATION)) {<NEW_LINE>TreePath parentPath = getCurrentPath().getParentPath();<NEW_LINE>Tree parent = parentPath.getLeaf();<NEW_LINE>Tree grandparent = parentPath.getParentPath().getLeaf();<NEW_LINE>Tree greatGrandparent = parentPath.getParentPath().getParentPath().getLeaf();<NEW_LINE>boolean isReturnAnnot = grandparent instanceof MethodTree && (parent.equals(((MethodTree) grandparent).getReturnType()) || parent instanceof ModifiersTree);<NEW_LINE>boolean isReceiverAnnot = greatGrandparent instanceof MethodTree && grandparent.equals(((MethodTree) greatGrandparent).getReceiverParameter()) && parent.equals(((VariableTree) grandparent).getModifiers());<NEW_LINE>boolean isCastAnnot = grandparent instanceof TypeCastTree && parent.equals(((TypeCastTree) grandparent).getType());<NEW_LINE>if (!(isReturnAnnot || isReceiverAnnot || isCastAnnot)) {<NEW_LINE>checker.reportError(node, "this.location");<NEW_LINE>}<NEW_LINE>if (isReturnAnnot && ElementUtils.isStatic(TreeUtils.elementFromDeclaration((MethodTree) grandparent))) {<NEW_LINE>checker.reportError(node, "this.location");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return super.visitAnnotation(node, p);<NEW_LINE>}
|
annot = TreeUtils.annotationFromAnnotationTree(node);
|
403,058
|
public static void validateGofish(JReleaserContext context, Distribution distribution, Gofish packager, Errors errors) {<NEW_LINE>JReleaserModel model = context.getModel();<NEW_LINE>Gofish parentPackager = model.getPackagers().getGofish();<NEW_LINE>if (!packager.isActiveSet() && parentPackager.isActiveSet()) {<NEW_LINE>packager.setActive(parentPackager.getActive());<NEW_LINE>}<NEW_LINE>if (!packager.resolveEnabled(context.getModel().getProject(), distribution)) {<NEW_LINE>packager.disable();<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>GitService service = model.getRelease().getGitService();<NEW_LINE>if (!service.isReleaseSupported()) {<NEW_LINE>packager.disable();<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>context.getLogger().debug("distribution.{}.gofish", distribution.getName());<NEW_LINE>List<Artifact> candidateArtifacts = packager.resolveCandidateArtifacts(context, distribution);<NEW_LINE>if (candidateArtifacts.size() == 0) {<NEW_LINE><MASK><NEW_LINE>packager.disable();<NEW_LINE>return;<NEW_LINE>} else if (candidateArtifacts.stream().filter(artifact -> isBlank(artifact.getPlatform())).count() > 1) {<NEW_LINE>errors.configuration(RB.$("validation_packager_multiple_artifacts", "distribution." + distribution.getName() + ".gofish"));<NEW_LINE>packager.disable();<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>validateCommitAuthor(packager, parentPackager);<NEW_LINE>Gofish.GofishRepository repository = packager.getRepository();<NEW_LINE>repository.resolveEnabled(model.getProject());<NEW_LINE>validateTap(context, distribution, repository, parentPackager.getRepository(), "gofish.repository");<NEW_LINE>validateTemplate(context, distribution, packager, parentPackager, errors);<NEW_LINE>mergeExtraProperties(packager, parentPackager);<NEW_LINE>validateContinueOnError(packager, parentPackager);<NEW_LINE>if (isBlank(packager.getDownloadUrl())) {<NEW_LINE>packager.setDownloadUrl(parentPackager.getDownloadUrl());<NEW_LINE>}<NEW_LINE>validateArtifactPlatforms(context, distribution, packager, candidateArtifacts, errors);<NEW_LINE>}
|
packager.setActive(Active.NEVER);
|
1,160,253
|
public void transmit(AMQChannel channel) throws IOException {<NEW_LINE>int channelNumber = channel.getChannelNumber();<NEW_LINE>AMQConnection connection = channel.getConnection();<NEW_LINE>synchronized (assembler) {<NEW_LINE>Method m = this.assembler.getMethod();<NEW_LINE>if (m.hasContent()) {<NEW_LINE>byte[] body = this.assembler.getContentBody();<NEW_LINE>Frame headerFrame = this.assembler.getContentHeader().toFrame(channelNumber, body.length);<NEW_LINE>int frameMax = connection.getFrameMax();<NEW_LINE>boolean cappedFrameMax = frameMax > 0;<NEW_LINE>int bodyPayloadMax = cappedFrameMax ? frameMax - EMPTY_FRAME_SIZE : body.length;<NEW_LINE>if (cappedFrameMax && headerFrame.size() > frameMax) {<NEW_LINE>String msg = String.format("Content headers exceeded max frame size: %d > %d", headerFrame.size(), frameMax);<NEW_LINE>throw new IllegalArgumentException(msg);<NEW_LINE>}<NEW_LINE>connection.writeFrame<MASK><NEW_LINE>connection.writeFrame(headerFrame);<NEW_LINE>for (int offset = 0; offset < body.length; offset += bodyPayloadMax) {<NEW_LINE>int remaining = body.length - offset;<NEW_LINE>int fragmentLength = (remaining < bodyPayloadMax) ? remaining : bodyPayloadMax;<NEW_LINE>Frame frame = Frame.fromBodyFragment(channelNumber, body, offset, fragmentLength);<NEW_LINE>connection.writeFrame(frame);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>connection.writeFrame(m.toFrame(channelNumber));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>connection.flush();<NEW_LINE>}
|
(m.toFrame(channelNumber));
|
874,819
|
private byte[] createPubrelBytes(final int packetId, final boolean retained, @Nullable final Long expiry, @Nullable final Long publishTimestamp) {<NEW_LINE>final byte[] result;<NEW_LINE>if (expiry != null && publishTimestamp != null) {<NEW_LINE>result = new byte[Short.BYTES + 1 + Long.BYTES * 2];<NEW_LINE>} else {<NEW_LINE>result = new byte[Short.BYTES + 1];<NEW_LINE>}<NEW_LINE>int cursor = 0;<NEW_LINE>cursor = XodusUtils.serializeShort(packetId, result, cursor);<NEW_LINE>result[cursor] = PUBREL_BIT;<NEW_LINE>if (retained) {<NEW_LINE>result[cursor] |= RETAINED_MESSAGE_BIT;<NEW_LINE>}<NEW_LINE>cursor++;<NEW_LINE>if (expiry != null && publishTimestamp != null) {<NEW_LINE>cursor = XodusUtils.serializeLong(expiry, result, cursor);<NEW_LINE>cursor = XodusUtils.<MASK><NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>}
|
serializeLong(publishTimestamp, result, cursor);
|
1,428,533
|
public View onCreateTextInputView(@NonNull LayoutInflater layoutInflater, @Nullable ViewGroup viewGroup, @Nullable Bundle bundle, CalendarConstraints constraints, @NonNull final OnSelectionChangedListener<Pair<Long, Long>> listener) {<NEW_LINE>View root = layoutInflater.inflate(R.layout.mtrl_picker_text_input_date_range, viewGroup, false);<NEW_LINE>final TextInputLayout startTextInput = root.findViewById(R.id.mtrl_picker_text_input_range_start);<NEW_LINE>final TextInputLayout endTextInput = root.findViewById(R.id.mtrl_picker_text_input_range_end);<NEW_LINE><MASK><NEW_LINE>EditText endEditText = endTextInput.getEditText();<NEW_LINE>if (ManufacturerUtils.isDateInputKeyboardMissingSeparatorCharacters()) {<NEW_LINE>// Using the URI variation places the '/' and '.' in more prominent positions<NEW_LINE>startEditText.setInputType(InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_VARIATION_URI);<NEW_LINE>endEditText.setInputType(InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_VARIATION_URI);<NEW_LINE>}<NEW_LINE>invalidRangeStartError = root.getResources().getString(R.string.mtrl_picker_invalid_range);<NEW_LINE>SimpleDateFormat format = UtcDates.getTextInputFormat();<NEW_LINE>if (selectedStartItem != null) {<NEW_LINE>startEditText.setText(format.format(selectedStartItem));<NEW_LINE>proposedTextStart = selectedStartItem;<NEW_LINE>}<NEW_LINE>if (selectedEndItem != null) {<NEW_LINE>endEditText.setText(format.format(selectedEndItem));<NEW_LINE>proposedTextEnd = selectedEndItem;<NEW_LINE>}<NEW_LINE>String formatHint = UtcDates.getTextInputHint(root.getResources(), format);<NEW_LINE>startTextInput.setPlaceholderText(formatHint);<NEW_LINE>endTextInput.setPlaceholderText(formatHint);<NEW_LINE>startEditText.addTextChangedListener(new DateFormatTextWatcher(formatHint, format, startTextInput, constraints) {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>void onValidDate(@Nullable Long day) {<NEW_LINE>proposedTextStart = day;<NEW_LINE>updateIfValidTextProposal(startTextInput, endTextInput, listener);<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>void onInvalidDate() {<NEW_LINE>proposedTextStart = null;<NEW_LINE>updateIfValidTextProposal(startTextInput, endTextInput, listener);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>endEditText.addTextChangedListener(new DateFormatTextWatcher(formatHint, format, endTextInput, constraints) {<NEW_LINE><NEW_LINE>void onValidDate(@Nullable Long day) {<NEW_LINE>proposedTextEnd = day;<NEW_LINE>updateIfValidTextProposal(startTextInput, endTextInput, listener);<NEW_LINE>}<NEW_LINE><NEW_LINE>void onInvalidDate() {<NEW_LINE>proposedTextEnd = null;<NEW_LINE>updateIfValidTextProposal(startTextInput, endTextInput, listener);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>ViewUtils.requestFocusAndShowKeyboard(startEditText);<NEW_LINE>return root;<NEW_LINE>}
|
EditText startEditText = startTextInput.getEditText();
|
1,264,532
|
private void doWork() {<NEW_LINE>if (url == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>FileObject fo;<NEW_LINE>if (url.getProtocol().equals("file")) {<NEW_LINE>// NOI18N<NEW_LINE>fo = FileUtil.toFileObject(new File(url.getPath()));<NEW_LINE>} else {<NEW_LINE>// NOI18N<NEW_LINE>fo = URLMapper.findFileObject(url);<NEW_LINE>}<NEW_LINE>DataObject <MASK><NEW_LINE>EditorCookie ed = dobj.getLookup().lookup(EditorCookie.class);<NEW_LINE>if (ed != null && fo == dobj.getPrimaryFile()) {<NEW_LINE>if (lineNumber == -1) {<NEW_LINE>ed.open();<NEW_LINE>} else {<NEW_LINE>lc = dobj.getLookup().lookup(LineCookie.class);<NEW_LINE>SwingUtilities.invokeLater(this);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>Toolkit.getDefaultToolkit().beep();<NEW_LINE>}<NEW_LINE>} catch (Exception ex) {<NEW_LINE>// ignore<NEW_LINE>}<NEW_LINE>}
|
dobj = DataObject.find(fo);
|
1,243,367
|
public synchronized boolean reschedule(Function<CclRuleInfo<RescheduleTask>, Boolean> function) {<NEW_LINE>final RescheduleTask currentRescheduleTask = this.rescheduleTask;<NEW_LINE>if (currentRescheduleTask == null) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>currentRescheduleTask.setWaitEndTs(System.currentTimeMillis());<NEW_LINE>boolean active = currentRescheduleTask.getActivation().compareAndSet(false, true);<NEW_LINE>if (active) {<NEW_LINE>this.executingFuture = processor.getHandler().submit(this.schema, null, () -> {<NEW_LINE>try {<NEW_LINE>if (!rescheduled || this.isClosed()) {<NEW_LINE>throw new TddlNestableRuntimeException("can not be rescheduled.");<NEW_LINE>}<NEW_LINE>if (rescheduleParam != null) {<NEW_LINE>int sqlSimpleMaxLen = CobarServer.getInstance().getConfig().getSystem().getSqlSimpleMaxLen();<NEW_LINE>ByteString sql = rescheduleParam.sql;<NEW_LINE>sqlSample = sql.substring(0, Math.min(sqlSimpleMaxLen<MASK><NEW_LINE>innerExecute(rescheduleParam.sql, rescheduleParam.params, rescheduleParam.handler, rescheduleParam.dataContext);<NEW_LINE>}<NEW_LINE>} catch (Throwable e) {<NEW_LINE>handleError(ErrorCode.ERR_HANDLE_DATA, e);<NEW_LINE>} finally {<NEW_LINE>if (function != null) {<NEW_LINE>function.apply(currentRescheduleTask.getCclRuleInfo());<NEW_LINE>}<NEW_LINE>setRescheduled(false, null);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}<NEW_LINE>return active;<NEW_LINE>}
|
, sql.length()));
|
442,254
|
public AutoScalingPolicyDescription unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>AutoScalingPolicyDescription autoScalingPolicyDescription = new AutoScalingPolicyDescription();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE><MASK><NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>if (context.testExpression("PolicyName", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>autoScalingPolicyDescription.setPolicyName(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("TargetTrackingScalingPolicyConfiguration", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>autoScalingPolicyDescription.setTargetTrackingScalingPolicyConfiguration(AutoScalingTargetTrackingScalingPolicyConfigurationDescriptionJsonUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>}<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return autoScalingPolicyDescription;<NEW_LINE>}
|
JsonToken token = context.getCurrentToken();
|
114,080
|
final AssociateIdentityProviderConfigResult executeAssociateIdentityProviderConfig(AssociateIdentityProviderConfigRequest associateIdentityProviderConfigRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(associateIdentityProviderConfigRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<AssociateIdentityProviderConfigRequest> request = null;<NEW_LINE>Response<AssociateIdentityProviderConfigResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new AssociateIdentityProviderConfigRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(associateIdentityProviderConfigRequest));<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, "EKS");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "AssociateIdentityProviderConfig");<NEW_LINE>request.<MASK><NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<AssociateIdentityProviderConfigResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new AssociateIdentityProviderConfigResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
|
addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
|
411,490
|
public static double itakuraSaitoDist(double[] speechFrame1, double[] speechFrame2, int fftSize, int lpOrder) {<NEW_LINE>double[] preemphasizedFrame1 = SignalProcUtils.applyPreemphasis(speechFrame1, 0.97);<NEW_LINE>double[] preemphasizedFrame2 = SignalProcUtils.applyPreemphasis(speechFrame2, 0.97);<NEW_LINE>// Windowing<NEW_LINE>double[] windowedSpeechFrame1 = new double[preemphasizedFrame1.length];<NEW_LINE>System.arraycopy(preemphasizedFrame1, 0, windowedSpeechFrame1, 0, preemphasizedFrame1.length);<NEW_LINE>double[] windowedSpeechFrame2 = new double[preemphasizedFrame2.length];<NEW_LINE>System.arraycopy(preemphasizedFrame2, 0, windowedSpeechFrame2, 0, preemphasizedFrame2.length);<NEW_LINE>HammingWindow w1 = new HammingWindow(speechFrame1.length);<NEW_LINE>w1.apply(windowedSpeechFrame1, 0);<NEW_LINE>HammingWindow w2 = new HammingWindow(speechFrame2.length);<NEW_LINE><MASK><NEW_LINE>//<NEW_LINE>int w;<NEW_LINE>double[] Xabs1 = LpcAnalyser.calcSpecFrameLinear(speechFrame1, lpOrder, fftSize);<NEW_LINE>double[] Xabs2 = LpcAnalyser.calcSpecFrameLinear(speechFrame2, lpOrder, fftSize);<NEW_LINE>// Itakura-Saito distance using power spectrum: pf1/pf2 - log(pf1/pf2) - 1<NEW_LINE>double dist = 0.0;<NEW_LINE>for (w = 0; w < Xabs1.length; w++) Xabs1[w] = Xabs1[w] * Xabs1[w];<NEW_LINE>for (w = 0; w < Xabs2.length; w++) Xabs2[w] = Xabs2[w] * Xabs2[w];<NEW_LINE>for (w = 0; w < Xabs1.length; w++) dist += Xabs1[w] / Math.max(Xabs2[w], 1e-20) - Math.log(Math.max(Xabs1[w], 1e-20)) + Math.log(Math.max(Xabs2[w], 1e-20)) - 1.0;<NEW_LINE>return Math.min(dist, MAX_SPECTRAL_DISTANCE);<NEW_LINE>}
|
w2.apply(windowedSpeechFrame2, 0);
|
457,102
|
public void marshall(IntentSummary intentSummary, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (intentSummary == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(intentSummary.getIntentId(), INTENTID_BINDING);<NEW_LINE>protocolMarshaller.marshall(intentSummary.getIntentName(), INTENTNAME_BINDING);<NEW_LINE>protocolMarshaller.marshall(intentSummary.getDescription(), DESCRIPTION_BINDING);<NEW_LINE>protocolMarshaller.marshall(intentSummary.getParentIntentSignature(), PARENTINTENTSIGNATURE_BINDING);<NEW_LINE>protocolMarshaller.marshall(intentSummary.getInputContexts(), INPUTCONTEXTS_BINDING);<NEW_LINE>protocolMarshaller.marshall(intentSummary.getOutputContexts(), OUTPUTCONTEXTS_BINDING);<NEW_LINE>protocolMarshaller.marshall(intentSummary.getLastUpdatedDateTime(), LASTUPDATEDDATETIME_BINDING);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + <MASK><NEW_LINE>}<NEW_LINE>}
|
e.getMessage(), e);
|
593,952
|
public JsonObject toJson() {<NEW_LINE>JsonObject jsonObject = new JsonObject();<NEW_LINE>if (libraryPath != null) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>jsonObject.addProperty("kind", kind);<NEW_LINE>if (name != null) {<NEW_LINE>jsonObject.addProperty("name", name);<NEW_LINE>}<NEW_LINE>if (typeArguments != null) {<NEW_LINE>JsonArray jsonArrayTypeArguments = new JsonArray();<NEW_LINE>for (RuntimeCompletionExpressionType elt : typeArguments) {<NEW_LINE>jsonArrayTypeArguments.add(elt.toJson());<NEW_LINE>}<NEW_LINE>jsonObject.add("typeArguments", jsonArrayTypeArguments);<NEW_LINE>}<NEW_LINE>if (returnType != null) {<NEW_LINE>jsonObject.add("returnType", returnType.toJson());<NEW_LINE>}<NEW_LINE>if (parameterTypes != null) {<NEW_LINE>JsonArray jsonArrayParameterTypes = new JsonArray();<NEW_LINE>for (RuntimeCompletionExpressionType elt : parameterTypes) {<NEW_LINE>jsonArrayParameterTypes.add(elt.toJson());<NEW_LINE>}<NEW_LINE>jsonObject.add("parameterTypes", jsonArrayParameterTypes);<NEW_LINE>}<NEW_LINE>if (parameterNames != null) {<NEW_LINE>JsonArray jsonArrayParameterNames = new JsonArray();<NEW_LINE>for (String elt : parameterNames) {<NEW_LINE>jsonArrayParameterNames.add(new JsonPrimitive(elt));<NEW_LINE>}<NEW_LINE>jsonObject.add("parameterNames", jsonArrayParameterNames);<NEW_LINE>}<NEW_LINE>return jsonObject;<NEW_LINE>}
|
jsonObject.addProperty("libraryPath", libraryPath);
|
1,276,180
|
public static GetTaskFileResultListResponse unmarshall(GetTaskFileResultListResponse getTaskFileResultListResponse, UnmarshallerContext _ctx) {<NEW_LINE>getTaskFileResultListResponse.setRequestId(_ctx.stringValue("GetTaskFileResultListResponse.RequestId"));<NEW_LINE>getTaskFileResultListResponse.setDataSize(_ctx.integerValue("GetTaskFileResultListResponse.DataSize"));<NEW_LINE>getTaskFileResultListResponse.setSuccess(_ctx.booleanValue("GetTaskFileResultListResponse.Success"));<NEW_LINE>getTaskFileResultListResponse.setCode(_ctx.stringValue("GetTaskFileResultListResponse.Code"));<NEW_LINE>getTaskFileResultListResponse.setMessage(_ctx.stringValue("GetTaskFileResultListResponse.Message"));<NEW_LINE>getTaskFileResultListResponse.setPageSize(_ctx.integerValue("GetTaskFileResultListResponse.PageSize"));<NEW_LINE>getTaskFileResultListResponse.setTotalCount(_ctx.integerValue("GetTaskFileResultListResponse.TotalCount"));<NEW_LINE>List<TaskResultReviewInfo> data = new ArrayList<TaskResultReviewInfo>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("GetTaskFileResultListResponse.Data.Length"); i++) {<NEW_LINE>TaskResultReviewInfo taskResultReviewInfo = new TaskResultReviewInfo();<NEW_LINE>taskResultReviewInfo.setStatus(_ctx.integerValue("GetTaskFileResultListResponse.Data[" + i + "].Status"));<NEW_LINE>taskResultReviewInfo.setDataType(_ctx.integerValue("GetTaskFileResultListResponse.Data[" + i + "].DataType"));<NEW_LINE>taskResultReviewInfo.setHitNumber(_ctx.integerValue("GetTaskFileResultListResponse.Data[" + i + "].HitNumber"));<NEW_LINE>taskResultReviewInfo.setHitRule(_ctx.booleanValue("GetTaskFileResultListResponse.Data[" + i + "].HitRule"));<NEW_LINE>taskResultReviewInfo.setNextVid(_ctx.stringValue("GetTaskFileResultListResponse.Data[" + i + "].NextVid"));<NEW_LINE>taskResultReviewInfo.setPreVid(_ctx.stringValue("GetTaskFileResultListResponse.Data[" + i + "].PreVid"));<NEW_LINE>taskResultReviewInfo.setReviewAccuracyRate(_ctx.floatValue("GetTaskFileResultListResponse.Data[" + i + "].ReviewAccuracyRate"));<NEW_LINE>taskResultReviewInfo.setRealViolationNumber(_ctx.integerValue("GetTaskFileResultListResponse.Data[" + i + "].RealViolationNumber"));<NEW_LINE>taskResultReviewInfo.setIsHitRule(_ctx.booleanValue<MASK><NEW_LINE>taskResultReviewInfo.setFileName(_ctx.stringValue("GetTaskFileResultListResponse.Data[" + i + "].FileName"));<NEW_LINE>taskResultReviewInfo.setTotalScore(_ctx.integerValue("GetTaskFileResultListResponse.Data[" + i + "].TotalScore"));<NEW_LINE>taskResultReviewInfo.setCheckNumber(_ctx.integerValue("GetTaskFileResultListResponse.Data[" + i + "].CheckNumber"));<NEW_LINE>taskResultReviewInfo.setFileMergeName(_ctx.stringValue("GetTaskFileResultListResponse.Data[" + i + "].FileMergeName"));<NEW_LINE>taskResultReviewInfo.setBucketName(_ctx.stringValue("GetTaskFileResultListResponse.Data[" + i + "].BucketName"));<NEW_LINE>taskResultReviewInfo.setHandTaskFile(_ctx.booleanValue("GetTaskFileResultListResponse.Data[" + i + "].HandTaskFile"));<NEW_LINE>taskResultReviewInfo.setTaskId(_ctx.stringValue("GetTaskFileResultListResponse.Data[" + i + "].TaskId"));<NEW_LINE>taskResultReviewInfo.setVid(_ctx.stringValue("GetTaskFileResultListResponse.Data[" + i + "].Vid"));<NEW_LINE>List<String> hitRuleSet = new ArrayList<String>();<NEW_LINE>for (int j = 0; j < _ctx.lengthValue("GetTaskFileResultListResponse.Data[" + i + "].HitRuleSet.Length"); j++) {<NEW_LINE>hitRuleSet.add(_ctx.stringValue("GetTaskFileResultListResponse.Data[" + i + "].HitRuleSet[" + j + "]"));<NEW_LINE>}<NEW_LINE>taskResultReviewInfo.setHitRuleSet(hitRuleSet);<NEW_LINE>data.add(taskResultReviewInfo);<NEW_LINE>}<NEW_LINE>getTaskFileResultListResponse.setData(data);<NEW_LINE>return getTaskFileResultListResponse;<NEW_LINE>}
|
("GetTaskFileResultListResponse.Data[" + i + "].IsHitRule"));
|
1,082,720
|
public PyTableFnBatchOp linkFrom(BatchOperator<?>... inputs) {<NEW_LINE>BatchOperator<<MASK><NEW_LINE>JsonObject fnSpec = new JsonObject();<NEW_LINE>fnSpec.add("classObject", JsonConverter.gson.toJsonTree(getClassObject()));<NEW_LINE>fnSpec.addProperty("classObjectType", getClassObjectType());<NEW_LINE>fnSpec.addProperty("pythonVersion", getPythonVersion());<NEW_LINE>final String fnSpecJson = fnSpec.toString();<NEW_LINE>Map<String, String> runConfig = new HashMap<>();<NEW_LINE>if (getParams().contains(HasPythonEnv.PYTHON_ENV)) {<NEW_LINE>runConfig.put(BasePythonBridge.PY_VIRTUAL_ENV_KEY, getPythonEnv());<NEW_LINE>}<NEW_LINE>// WARNING: "tEnv" is used in auto-replacement to blink's code, don't change!<NEW_LINE>BatchTableEnvironment tEnv = MLEnvironmentFactory.get(getMLEnvironmentId()).getBatchTableEnvironment();<NEW_LINE>final String funcName = UDFHelper.generateRandomFuncName();<NEW_LINE>TableFunction<?> f = PyFnFactory.makeTableFn(funcName, fnSpecJson, getResultTypes(), runConfig::getOrDefault);<NEW_LINE>tEnv.registerFunction(funcName, f);<NEW_LINE>UDTFBatchOp udtfBatchOp = new UDTFBatchOp().setFuncName(funcName).setSelectedCols(getSelectedCols()).setOutputCols(getOutputCols()).setReservedCols(getReservedCols()).setMLEnvironmentId(getMLEnvironmentId());<NEW_LINE>this.setOutputTable(udtfBatchOp.linkFrom(in).getOutputTable());<NEW_LINE>return this;<NEW_LINE>}
|
?> in = checkAndGetFirst(inputs);
|
311,051
|
public void initialize(OptionValues options, Iterable<DebugHandlersFactory> factories, HotSpotProviders providers, GraalHotSpotVMConfig config, HotSpotAllocationSnippets.Templates allocationSnippetTemplates) {<NEW_LINE>super.initialize(options, runtime, providers);<NEW_LINE>assert target == providers.getCodeCache().getTarget();<NEW_LINE>instanceofSnippets = new InstanceOfSnippets.Templates(options, runtime, providers);<NEW_LINE>allocationSnippets = allocationSnippetTemplates;<NEW_LINE>monitorSnippets = new MonitorSnippets.Templates(options, runtime, providers, config.useFastLocking);<NEW_LINE>g1WriteBarrierSnippets = new HotSpotG1WriteBarrierSnippets.Templates(options, runtime, providers, config);<NEW_LINE>serialWriteBarrierSnippets = new HotSpotSerialWriteBarrierSnippets.Templates(options, runtime, providers);<NEW_LINE>exceptionObjectSnippets = new LoadExceptionObjectSnippets.Templates(options, providers);<NEW_LINE>assertionSnippets = new AssertionSnippets.Templates(options, providers);<NEW_LINE>logSnippets = new LogSnippets.Templates(options, providers);<NEW_LINE>arraycopySnippets = new ArrayCopySnippets.Templates(new HotSpotArraycopySnippets(), runtime, options, providers);<NEW_LINE>stringToBytesSnippets = new StringToBytesSnippets.Templates(options, providers);<NEW_LINE>identityHashCodeSnippets = new IdentityHashCodeSnippets.Templates(new HotSpotHashCodeSnippets(), options, providers, HotSpotReplacementsUtil.MARK_WORD_LOCATION);<NEW_LINE>isArraySnippets = new IsArraySnippets.Templates(new <MASK><NEW_LINE>objectCloneSnippets = new ObjectCloneSnippets.Templates(options, providers);<NEW_LINE>foreignCallSnippets = new ForeignCallSnippets.Templates(options, providers);<NEW_LINE>registerFinalizerSnippets = new RegisterFinalizerSnippets.Templates(options, providers);<NEW_LINE>objectSnippets = new ObjectSnippets.Templates(options, providers);<NEW_LINE>unsafeSnippets = new UnsafeSnippets.Templates(options, providers);<NEW_LINE>replacements.registerSnippetTemplateCache(new BigIntegerSnippets.Templates(options, providers));<NEW_LINE>replacements.registerSnippetTemplateCache(new DigestBaseSnippets.Templates(options, providers));<NEW_LINE>initializeExtensions(options, factories, providers, config);<NEW_LINE>}
|
HotSpotIsArraySnippets(), options, providers);
|
1,343,622
|
protected void writeInternal(BeltData d) {<NEW_LINE>super.writeInternal(d);<NEW_LINE>long addr = writePointer;<NEW_LINE>MemoryUtil.memPutFloat(addr + 26, d.qX);<NEW_LINE>MemoryUtil.memPutFloat(addr + 30, d.qY);<NEW_LINE>MemoryUtil.memPutFloat(addr + 34, d.qZ);<NEW_LINE>MemoryUtil.memPutFloat(addr + 38, d.qW);<NEW_LINE>MemoryUtil.memPutFloat(addr + 42, d.sourceU);<NEW_LINE>MemoryUtil.memPutFloat(addr + 46, d.sourceV);<NEW_LINE>MemoryUtil.memPutFloat(addr + 50, d.minU);<NEW_LINE>MemoryUtil.memPutFloat(<MASK><NEW_LINE>MemoryUtil.memPutFloat(addr + 58, d.maxU);<NEW_LINE>MemoryUtil.memPutFloat(addr + 62, d.maxV);<NEW_LINE>MemoryUtil.memPutByte(addr + 66, d.scrollMult);<NEW_LINE>}
|
addr + 54, d.minV);
|
1,621,385
|
protected Object convertEscaped(Object value) {<NEW_LINE>if (value == null) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>Matcher matcher = Pattern.compile("(.*)!\\{(.*)\\}").matcher((String) value);<NEW_LINE>if (matcher.matches()) {<NEW_LINE>String stringValue = matcher.group(1);<NEW_LINE>try {<NEW_LINE>Class<?> aClass = Class.forName(matcher.group(2));<NEW_LINE>if (Date.class.isAssignableFrom(aClass)) {<NEW_LINE>Date date = new ISODateFormat().parse(stringValue);<NEW_LINE>value = aClass.getConstructor(long.class).newInstance(date.getTime());<NEW_LINE>} else if (Enum.class.isAssignableFrom(aClass)) {<NEW_LINE>value = Enum.valueOf((Class<? <MASK><NEW_LINE>} else {<NEW_LINE>value = aClass.getConstructor(String.class).newInstance(stringValue);<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new UnexpectedLiquibaseException(e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return value;<NEW_LINE>}
|
extends Enum>) aClass, stringValue);
|
1,586,369
|
public String emitFunction(BIRNode.BIRFunction func, int tabs) {<NEW_LINE>String funcString = "";<NEW_LINE>funcString += emitTabs(tabs);<NEW_LINE>funcString += emitFlags(func.flags);<NEW_LINE>if (!funcString.equals("")) {<NEW_LINE>funcString += emitSpaces(1);<NEW_LINE>}<NEW_LINE>funcString += emitName(func.name);<NEW_LINE>funcString += emitSpaces(1);<NEW_LINE>funcString += emitType(func.type, 0);<NEW_LINE>funcString += emitSpaces(1);<NEW_LINE>funcString += "{";<NEW_LINE>funcString += emitLBreaks(1);<NEW_LINE>funcString += emitLocalVars(func.localVars, tabs + 1);<NEW_LINE>funcString += emitLBreaks(1);<NEW_LINE>funcString += emitBasicBlocks(func.basicBlocks, tabs + 1);<NEW_LINE>funcString += emitLBreaks(1);<NEW_LINE>funcString += emitErrorEntries(<MASK><NEW_LINE>funcString += emitLBreaks(1);<NEW_LINE>funcString += emitTabs(tabs);<NEW_LINE>funcString += "}";<NEW_LINE>return funcString;<NEW_LINE>}
|
func.errorTable, tabs + 1);
|
928,268
|
public static void convert(Frame input, ImageBase output, boolean swapRgb, DogArray_I8 work) {<NEW_LINE>if (work == null)<NEW_LINE>work = new DogArray_I8();<NEW_LINE>Buffer <MASK><NEW_LINE>if (!(data instanceof ByteBuffer)) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>ByteBuffer bb = (ByteBuffer) data;<NEW_LINE>output.reshape(input.imageWidth, input.imageHeight);<NEW_LINE>if (output instanceof Planar) {<NEW_LINE>((Planar) output).setNumberOfBands(input.imageChannels);<NEW_LINE>ConvertByteBufferImage.from_3BU8_to_3PU8(bb, 0, input.imageStride, (Planar) output, work);<NEW_LINE>if (swapRgb) {<NEW_LINE>BGR_to_RGB((Planar) output);<NEW_LINE>}<NEW_LINE>} else if (output instanceof ImageGray) {<NEW_LINE>ConvertByteBufferImage.from_3BU8_to_U8(bb, 0, input.imageStride, (GrayU8) output, work);<NEW_LINE>} else if (output instanceof ImageInterleaved) {<NEW_LINE>ConvertByteBufferImage.from_3BU8_to_3IU8(bb, 0, input.imageStride, (InterleavedU8) output);<NEW_LINE>} else {<NEW_LINE>throw new IllegalArgumentException("Unsupported output type");<NEW_LINE>}<NEW_LINE>}
|
data = input.image[0];
|
1,789,006
|
public SNewRevisionAdded convertToSObject(NewRevisionAdded input) {<NEW_LINE>if (input == null) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>SNewRevisionAdded result = new SNewRevisionAdded();<NEW_LINE>result.setOid(input.getOid());<NEW_LINE>result.setUuid(input.getUuid());<NEW_LINE>result.setRid(input.getRid());<NEW_LINE>result.setDate(input.getDate());<NEW_LINE>result.setAccessMethod(SAccessMethod.values()[input.getAccessMethod<MASK><NEW_LINE>User executorVal = input.getExecutor();<NEW_LINE>result.setExecutorId(executorVal == null ? -1 : executorVal.getOid());<NEW_LINE>Revision revisionVal = input.getRevision();<NEW_LINE>result.setRevisionId(revisionVal == null ? -1 : revisionVal.getOid());<NEW_LINE>Project projectVal = input.getProject();<NEW_LINE>result.setProjectId(projectVal == null ? -1 : projectVal.getOid());<NEW_LINE>return result;<NEW_LINE>}
|
().ordinal()]);
|
15,424
|
public static ListTakeStockOrderTasksResponse unmarshall(ListTakeStockOrderTasksResponse listTakeStockOrderTasksResponse, UnmarshallerContext _ctx) {<NEW_LINE>listTakeStockOrderTasksResponse.setRequestId(_ctx.stringValue("ListTakeStockOrderTasksResponse.RequestId"));<NEW_LINE>listTakeStockOrderTasksResponse.setPageSize(_ctx.integerValue("ListTakeStockOrderTasksResponse.PageSize"));<NEW_LINE>listTakeStockOrderTasksResponse.setTotalCount(_ctx.integerValue("ListTakeStockOrderTasksResponse.TotalCount"));<NEW_LINE>listTakeStockOrderTasksResponse.setPageNumber(_ctx.integerValue("ListTakeStockOrderTasksResponse.PageNumber"));<NEW_LINE>listTakeStockOrderTasksResponse.setSuccess<MASK><NEW_LINE>List<TakeStockOrderTaskModel> takeStockOrderTasks = new ArrayList<TakeStockOrderTaskModel>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("ListTakeStockOrderTasksResponse.TakeStockOrderTasks.Length"); i++) {<NEW_LINE>TakeStockOrderTaskModel takeStockOrderTaskModel = new TakeStockOrderTaskModel();<NEW_LINE>takeStockOrderTaskModel.setDeviceNumber(_ctx.stringValue("ListTakeStockOrderTasksResponse.TakeStockOrderTasks[" + i + "].DeviceNumber"));<NEW_LINE>takeStockOrderTaskModel.setCreateDate(_ctx.stringValue("ListTakeStockOrderTasksResponse.TakeStockOrderTasks[" + i + "].CreateDate"));<NEW_LINE>takeStockOrderTaskModel.setOperateQuantity(_ctx.integerValue("ListTakeStockOrderTasksResponse.TakeStockOrderTasks[" + i + "].OperateQuantity"));<NEW_LINE>takeStockOrderTaskModel.setStatus(_ctx.stringValue("ListTakeStockOrderTasksResponse.TakeStockOrderTasks[" + i + "].Status"));<NEW_LINE>takeStockOrderTaskModel.setTakeStockTaskId(_ctx.stringValue("ListTakeStockOrderTasksResponse.TakeStockOrderTasks[" + i + "].TakeStockTaskId"));<NEW_LINE>takeStockOrderTaskModel.setSyncStatus(_ctx.stringValue("ListTakeStockOrderTasksResponse.TakeStockOrderTasks[" + i + "].SyncStatus"));<NEW_LINE>takeStockOrderTaskModel.setDescription(_ctx.stringValue("ListTakeStockOrderTasksResponse.TakeStockOrderTasks[" + i + "].Description"));<NEW_LINE>takeStockOrderTaskModel.setTakeStockOrderId(_ctx.stringValue("ListTakeStockOrderTasksResponse.TakeStockOrderTasks[" + i + "].TakeStockOrderId"));<NEW_LINE>takeStockOrderTaskModel.setCode(_ctx.stringValue("ListTakeStockOrderTasksResponse.TakeStockOrderTasks[" + i + "].Code"));<NEW_LINE>takeStockOrderTaskModel.setUpdateDate(_ctx.stringValue("ListTakeStockOrderTasksResponse.TakeStockOrderTasks[" + i + "].UpdateDate"));<NEW_LINE>takeStockOrderTasks.add(takeStockOrderTaskModel);<NEW_LINE>}<NEW_LINE>listTakeStockOrderTasksResponse.setTakeStockOrderTasks(takeStockOrderTasks);<NEW_LINE>return listTakeStockOrderTasksResponse;<NEW_LINE>}
|
(_ctx.booleanValue("ListTakeStockOrderTasksResponse.Success"));
|
309,619
|
public boolean removeLogrotateFile() {<NEW_LINE>boolean deleted = false;<NEW_LINE>try {<NEW_LINE>if (Files.exists(getLogrotateConfPath())) {<NEW_LINE>deleted = Files.deleteIfExists(getLogrotateConfPath());<NEW_LINE>log.debug("Deleted {} : {}", getLogrotateConfPath(), deleted);<NEW_LINE>} else {<NEW_LINE>deleted = true;<NEW_LINE>}<NEW_LINE>} catch (Throwable t) {<NEW_LINE>log.debug("Couldn't delete {}", getLogrotateConfPath(), t);<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>Set<SingularityExecutorLogrotateFrequency> additionalFileFrequencies = getCronFakedLogrotateAdditionalFileFrequencies();<NEW_LINE>for (SingularityExecutorLogrotateFrequency frequency : additionalFileFrequencies) {<NEW_LINE>try {<NEW_LINE>if (frequency.getCronSchedule().isPresent() || logrotateFrequency.getCronSchedule().isPresent()) {<NEW_LINE>boolean logrotateConfDeleted = !Files.exists(getLogrotateHourlyConfPath(frequency)) || Files.deleteIfExists(getLogrotateHourlyConfPath(frequency));<NEW_LINE>log.debug("Deleted {} : {}", getLogrotateHourlyConfPath(frequency), logrotateConfDeleted);<NEW_LINE>deleted = deleted && logrotateConfDeleted;<NEW_LINE>}<NEW_LINE>} catch (Throwable t) {<NEW_LINE>log.debug("Couldn't delete {}", getLogrotateHourlyConfPath(frequency), t);<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>if (requiresSizeBasedRotation()) {<NEW_LINE>boolean sizeBasedConfDeleted = !Files.exists(getLogrotateSizeBasedConfPath()) || Files.deleteIfExists(getLogrotateSizeBasedConfPath());<NEW_LINE>log.debug("Deleted {} : {}", getLogrotateSizeBasedConfPath(), sizeBasedConfDeleted);<NEW_LINE>deleted = deleted && sizeBasedConfDeleted;<NEW_LINE>}<NEW_LINE>} catch (Throwable t) {<NEW_LINE>log.debug("Couldn't delete {}", getLogrotateSizeBasedConfPath(), t);<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>if (!additionalFileFrequencies.isEmpty() || logrotateFrequency.getCronSchedule().isPresent()) {<NEW_LINE>boolean cronDeleted = !Files.exists(getLogrotateCronPath()) || Files.deleteIfExists(getLogrotateCronPath());<NEW_LINE>log.debug(<MASK><NEW_LINE>deleted = deleted && cronDeleted;<NEW_LINE>}<NEW_LINE>} catch (Throwable t) {<NEW_LINE>log.debug("Couldn't delete {}", getLogrotateCronPath(), t);<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>return deleted;<NEW_LINE>}
|
"Deleted {} : {}", getLogrotateCronPath(), cronDeleted);
|
1,611,402
|
public void indexDrop(IndexDescriptor index) throws SchemaKernelException {<NEW_LINE>if (index == IndexDescriptor.NO_INDEX) {<NEW_LINE>throw new DropIndexFailureException("No index was specified.");<NEW_LINE>}<NEW_LINE>if (index.isTokenIndex()) {<NEW_LINE>assertTokenAndRelationshipPropertyIndexesSupported("Failed to drop token lookup index.");<NEW_LINE>}<NEW_LINE>exclusiveSchemaLock(index.schema());<NEW_LINE>exclusiveSchemaNameLock(index.getName());<NEW_LINE>assertIndexExistsForDrop(index);<NEW_LINE>if (index.isUnique()) {<NEW_LINE>if (allStoreHolder.indexGetOwningUniquenessConstraintId(index) != null) {<NEW_LINE>IndexBelongsToConstraintException cause = new <MASK><NEW_LINE>throw new DropIndexFailureException("Unable to drop index: " + cause.getUserMessage(token), cause);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>ktx.txState().indexDoDrop(index);<NEW_LINE>}
|
IndexBelongsToConstraintException(index.schema());
|
13,997
|
private List<ProfiledSpan> buildProfiledSpanList(SegmentObject segmentObject) {<NEW_LINE>List<ProfiledSpan> spans = new ArrayList<>();<NEW_LINE>segmentObject.getSpansList().forEach(spanObject -> {<NEW_LINE>ProfiledSpan span = new ProfiledSpan();<NEW_LINE>span.setSpanId(spanObject.getSpanId());<NEW_LINE>span.setParentSpanId(spanObject.getParentSpanId());<NEW_LINE>span.setStartTime(spanObject.getStartTime());<NEW_LINE>span.setEndTime(spanObject.getEndTime());<NEW_LINE>span.setError(spanObject.getIsError());<NEW_LINE>span.setLayer(spanObject.getSpanLayer().name());<NEW_LINE>span.setType(spanObject.getSpanType().name());<NEW_LINE>span.setEndpointName(spanObject.getOperationName());<NEW_LINE>span.setPeer(spanObject.getPeer());<NEW_LINE>span.setEndpointName(spanObject.getOperationName());<NEW_LINE>span.setServiceCode(segmentObject.getService());<NEW_LINE>span.setServiceInstanceName(segmentObject.getServiceInstance());<NEW_LINE>span.setComponent(getComponentLibraryCatalogService().getComponentName(spanObject.getComponentId()));<NEW_LINE>spanObject.getTagsList().forEach(tag -> {<NEW_LINE>KeyValue keyValue = new KeyValue();<NEW_LINE>keyValue.setKey(tag.getKey());<NEW_LINE>keyValue.setValue(tag.getValue());<NEW_LINE>span.getTags().add(keyValue);<NEW_LINE>});<NEW_LINE>spanObject.getLogsList().forEach(log -> {<NEW_LINE>LogEntity logEntity = new LogEntity();<NEW_LINE>logEntity.setTime(log.getTime());<NEW_LINE>log.getDataList().forEach(data -> {<NEW_LINE>KeyValue keyValue = new KeyValue();<NEW_LINE>keyValue.<MASK><NEW_LINE>keyValue.setValue(data.getValue());<NEW_LINE>logEntity.getData().add(keyValue);<NEW_LINE>});<NEW_LINE>span.getLogs().add(logEntity);<NEW_LINE>});<NEW_LINE>spans.add(span);<NEW_LINE>});<NEW_LINE>return spans;<NEW_LINE>}
|
setKey(data.getKey());
|
1,782,779
|
public static ClusterInfo discoverClusterInfo(Settings settings, Log log) {<NEW_LINE>ClusterName remoteClusterName = null;<NEW_LINE>EsMajorVersion remoteVersion = null;<NEW_LINE>String clusterName = settings.getProperty(InternalConfigurationOptions.INTERNAL_ES_CLUSTER_NAME);<NEW_LINE>String clusterUUID = settings.getProperty(InternalConfigurationOptions.INTERNAL_ES_CLUSTER_UUID);<NEW_LINE>String version = settings.getProperty(InternalConfigurationOptions.INTERNAL_ES_VERSION);<NEW_LINE>if (StringUtils.hasText(clusterName) && StringUtils.hasText(version)) {<NEW_LINE>// UUID is optional for now<NEW_LINE>if (log.isDebugEnabled()) {<NEW_LINE>log.debug(String.format("Elasticsearch cluster [NAME:%s][UUID:%s][VERSION:%s] already present in configuration; skipping discovery", clusterName, clusterUUID, version));<NEW_LINE>}<NEW_LINE>remoteClusterName = new ClusterName(clusterName, clusterUUID);<NEW_LINE>remoteVersion = EsMajorVersion.parse(version);<NEW_LINE>return new ClusterInfo(remoteClusterName, remoteVersion);<NEW_LINE>}<NEW_LINE>RestClient bootstrap = new RestClient(settings);<NEW_LINE>// first get ES main action info<NEW_LINE>try {<NEW_LINE>ClusterInfo mainInfo = bootstrap.mainInfo();<NEW_LINE>if (log.isDebugEnabled()) {<NEW_LINE>log.debug(String.format("Discovered Elasticsearch cluster [%s/%s], version [%s]", mainInfo.getClusterName().getName(), mainInfo.getClusterName().getUUID(), mainInfo.getMajorVersion()));<NEW_LINE>}<NEW_LINE>settings.setInternalClusterInfo(mainInfo);<NEW_LINE>return mainInfo;<NEW_LINE>} catch (EsHadoopException ex) {<NEW_LINE>throw new EsHadoopIllegalArgumentException(String.format("Cannot detect ES version - " + "typically this happens if the network/Elasticsearch cluster is not accessible or when targeting " + "a WAN/Cloud instance without the proper setting '%s'"<MASK><NEW_LINE>} finally {<NEW_LINE>bootstrap.close();<NEW_LINE>}<NEW_LINE>}
|
, ConfigurationOptions.ES_NODES_WAN_ONLY), ex);
|
1,412,349
|
final PutIntegrationResult executePutIntegration(PutIntegrationRequest putIntegrationRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(putIntegrationRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<PutIntegrationRequest> request = null;<NEW_LINE>Response<PutIntegrationResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new PutIntegrationRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(putIntegrationRequest));<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, "API Gateway");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "PutIntegration");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<PutIntegrationResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new PutIntegrationResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
|
HandlerContextKey.SIGNING_REGION, getSigningRegion());
|
331,717
|
public void object(String type, int keyword, int offset, int length) {<NEW_LINE>AttributeSet aset;<NEW_LINE>switch(type) {<NEW_LINE>case "CLNumber":<NEW_LINE>aset = sc.addAttribute(SimpleAttributeSet.EMPTY, StyleConstants.Foreground, numberColor);<NEW_LINE>highlight(<MASK><NEW_LINE>break;<NEW_LINE>case "CLString":<NEW_LINE>aset = sc.addAttribute(SimpleAttributeSet.EMPTY, StyleConstants.Foreground, textColor);<NEW_LINE>highlight(mEditor, offset, length, aset);<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>switch(keyword) {<NEW_LINE>case SECTION_ELEMENT:<NEW_LINE>aset = sc.addAttribute(SimpleAttributeSet.EMPTY, StyleConstants.Foreground, sectionColor);<NEW_LINE>break;<NEW_LINE>case ATTRIBUTE_ELEMENT:<NEW_LINE>aset = sc.addAttribute(SimpleAttributeSet.EMPTY, StyleConstants.Foreground, keywordColor);<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>aset = sc.addAttribute(SimpleAttributeSet.EMPTY, StyleConstants.Foreground, attributeColor);<NEW_LINE>}<NEW_LINE>highlight(mEditor, offset, length, aset);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}
|
mEditor, offset, length, aset);
|
255,051
|
private void collectTimeseriesSchema(List<String> prefixPaths, List<TimeseriesSchema> timeseriesSchemas) throws MetadataException {<NEW_LINE>// Due to add/remove node, some slots may in the state of PULLING, which will not contains the<NEW_LINE>// corresponding schemas.<NEW_LINE>// In this case, we need to pull series from previous holder.<NEW_LINE>Map<PartitionGroup, List<String>> prePartitionGroupPathMap = new HashMap<>();<NEW_LINE>RaftNode header = dataGroupMember.getHeader();<NEW_LINE>Map<Integer, PartitionGroup> slotPreviousHolderMap = ((SlotPartitionTable) dataGroupMember.getMetaGroupMember().getPartitionTable()).getPreviousNodeMap().get(header);<NEW_LINE>for (String prefixPath : prefixPaths) {<NEW_LINE>int slot = ClusterUtils.getSlotByPathTimeWithSync(new PartialPath(prefixPath), dataGroupMember.getMetaGroupMember());<NEW_LINE>if (dataGroupMember.getSlotManager().checkSlotInMetaMigrationStatus(slot) && slotPreviousHolderMap.containsKey(slot)) {<NEW_LINE>prePartitionGroupPathMap.computeIfAbsent(slotPreviousHolderMap.get(slot), s -> new ArrayList<>()).add(prefixPath);<NEW_LINE>} else {<NEW_LINE>getCSchemaProcessor().collectTimeseriesSchema(new PartialPath(prefixPath), timeseriesSchemas);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (prePartitionGroupPathMap.isEmpty()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>for (Map.Entry<PartitionGroup, List<String>> partitionGroupListEntry : prePartitionGroupPathMap.entrySet()) {<NEW_LINE>PartitionGroup partitionGroup = partitionGroupListEntry.getKey();<NEW_LINE>List<String> paths = partitionGroupListEntry.getValue();<NEW_LINE>MetaPuller.getInstance().<MASK><NEW_LINE>}<NEW_LINE>}
|
pullTimeSeriesSchemas(partitionGroup, paths, timeseriesSchemas);
|
660,519
|
static MultiSearchResponse reduce(int numRequest, Map<String, List<Tuple<Integer, SearchRequest>>> itemsPerIndex, Map<String, Tuple<MultiSearchResponse, Exception>> shardResponses) {<NEW_LINE>MultiSearchResponse.Item[] items = new MultiSearchResponse.Item[numRequest];<NEW_LINE>for (Map.Entry<String, Tuple<MultiSearchResponse, Exception>> rspEntry : shardResponses.entrySet()) {<NEW_LINE>List<Tuple<Integer, SearchRequest>> reqSlots = itemsPerIndex.get(rspEntry.getKey());<NEW_LINE>if (rspEntry.getValue().v1() != null) {<NEW_LINE>MultiSearchResponse shardResponse = rspEntry.getValue().v1();<NEW_LINE>for (int i = 0; i < shardResponse.getResponses().length; i++) {<NEW_LINE>int slot = reqSlots.get(i).v1();<NEW_LINE>items[slot] = <MASK><NEW_LINE>}<NEW_LINE>} else if (rspEntry.getValue().v2() != null) {<NEW_LINE>Exception e = rspEntry.getValue().v2();<NEW_LINE>for (Tuple<Integer, SearchRequest> originSlot : reqSlots) {<NEW_LINE>items[originSlot.v1()] = new MultiSearchResponse.Item(null, e);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>throw new AssertionError();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return new MultiSearchResponse(items, 1L);<NEW_LINE>}
|
shardResponse.getResponses()[i];
|
1,652,816
|
public static void initFontLabelEdgeAttr(ST_Agedge_s e, ST_fontinfo fi, ST_fontinfo lfi) {<NEW_LINE>ENTERING("ak3pxrdrq900wymudwnjmbito", "initFontLabelEdgeAttr");<NEW_LINE>try {<NEW_LINE>if (N(fi.fontname))<NEW_LINE>initFontEdgeAttr(e, fi);<NEW_LINE>lfi.fontsize = late_double(e, Z.z().E_labelfontsize, fi.fontsize, MIN_FONTSIZE);<NEW_LINE>lfi.fontname = late_nnstring(e, Z.z(<MASK><NEW_LINE>lfi.fontcolor = late_nnstring(e, Z.z().E_labelfontcolor, fi.fontcolor);<NEW_LINE>} finally {<NEW_LINE>LEAVING("ak3pxrdrq900wymudwnjmbito", "initFontLabelEdgeAttr");<NEW_LINE>}<NEW_LINE>}
|
).E_labelfontname, fi.fontname);
|
1,035,630
|
public LayoutAlgorithm.Builder<AttributedVertex, ?, ?> apply(String name) {<NEW_LINE>switch(name) {<NEW_LINE>case GEM:<NEW_LINE>return GEMLayoutAlgorithm.edgeAwareBuilder();<NEW_LINE>case FORCED_BALANCED:<NEW_LINE>return KKLayoutAlgorithm.<AttributedVertex>builder().preRelaxDuration(1000);<NEW_LINE>case FORCE_DIRECTED:<NEW_LINE>return FRLayoutAlgorithm.<AttributedVertex>builder().repulsionContractBuilder(BarnesHutFRRepulsion.builder());<NEW_LINE>case CIRCLE:<NEW_LINE>return CircleLayoutAlgorithm.<AttributedVertex>builder().reduceEdgeCrossing(false);<NEW_LINE>case COMPACT_RADIAL:<NEW_LINE>return TidierRadialTreeLayoutAlgorithm.<AttributedVertex, AttributedEdge>edgeAwareBuilder().edgeComparator(edgeTypeComparator);<NEW_LINE>case MIN_CROSS_TOP_DOWN:<NEW_LINE>return EiglspergerLayoutAlgorithm.<AttributedVertex, AttributedEdge>edgeAwareBuilder().edgeComparator(edgeTypeComparator).layering(Layering.TOP_DOWN);<NEW_LINE>case MIN_CROSS_LONGEST_PATH:<NEW_LINE>return EiglspergerLayoutAlgorithm.<AttributedVertex, AttributedEdge>edgeAwareBuilder().edgeComparator(edgeTypeComparator).layering(Layering.LONGEST_PATH);<NEW_LINE>case MIN_CROSS_NETWORK_SIMPLEX:<NEW_LINE>return EiglspergerLayoutAlgorithm.<AttributedVertex, AttributedEdge>edgeAwareBuilder().edgeComparator(edgeTypeComparator).layering(Layering.NETWORK_SIMPLEX);<NEW_LINE>case MIN_CROSS_COFFMAN_GRAHAM:<NEW_LINE>return EiglspergerLayoutAlgorithm.<AttributedVertex, AttributedEdge>edgeAwareBuilder().edgeComparator(edgeTypeComparator).layering(Layering.COFFMAN_GRAHAM);<NEW_LINE>case VERT_MIN_CROSS_TOP_DOWN:<NEW_LINE>return EiglspergerLayoutAlgorithm.<AttributedVertex, AttributedEdge>edgeAwareBuilder().edgeComparator(edgeTypeComparator).favoredEdgePredicate(favoredEdgePredicate).layering(Layering.TOP_DOWN);<NEW_LINE>case VERT_MIN_CROSS_LONGEST_PATH:<NEW_LINE>return EiglspergerLayoutAlgorithm.<AttributedVertex, AttributedEdge>edgeAwareBuilder().edgeComparator(edgeTypeComparator).favoredEdgePredicate(favoredEdgePredicate).layering(Layering.LONGEST_PATH);<NEW_LINE>case VERT_MIN_CROSS_NETWORK_SIMPLEX:<NEW_LINE>return EiglspergerLayoutAlgorithm.<AttributedVertex, AttributedEdge>edgeAwareBuilder().edgeComparator(edgeTypeComparator).favoredEdgePredicate(favoredEdgePredicate).layering(Layering.NETWORK_SIMPLEX);<NEW_LINE>case VERT_MIN_CROSS_COFFMAN_GRAHAM:<NEW_LINE>return EiglspergerLayoutAlgorithm.<AttributedVertex, AttributedEdge>edgeAwareBuilder().edgeComparator(edgeTypeComparator).favoredEdgePredicate(favoredEdgePredicate<MASK><NEW_LINE>case RADIAL:<NEW_LINE>return RadialTreeLayoutAlgorithm.<AttributedVertex>builder().verticalVertexSpacing(300);<NEW_LINE>case BALLOON:<NEW_LINE>return BalloonLayoutAlgorithm.<AttributedVertex>builder().verticalVertexSpacing(300);<NEW_LINE>case HIERACHICAL:<NEW_LINE>return EdgeAwareTreeLayoutAlgorithm.<AttributedVertex, AttributedEdge>edgeAwareBuilder();<NEW_LINE>case COMPACT_HIERARCHICAL:<NEW_LINE>default:<NEW_LINE>return TidierTreeLayoutAlgorithm.<AttributedVertex, AttributedEdge>edgeAwareBuilder().edgeComparator(edgeTypeComparator);<NEW_LINE>}<NEW_LINE>}
|
).layering(Layering.COFFMAN_GRAHAM);
|
641,875
|
public void onInputSizeChanged(final int width, final int height) {<NEW_LINE>super.onInputSizeChanged(width, height);<NEW_LINE>int size = filters.size();<NEW_LINE>for (int i = 0; i < size; i++) {<NEW_LINE>filters.get(i).onInputSizeChanged(width, height);<NEW_LINE>}<NEW_LINE>if (frameBuffers != null && (frameWidth != width || frameHeight != height || frameBuffers.length != size - 1)) {<NEW_LINE>destroyFramebuffers();<NEW_LINE>frameWidth = width;<NEW_LINE>frameHeight = height;<NEW_LINE>}<NEW_LINE>if (frameBuffers == null) {<NEW_LINE>frameBuffers = new int[size - 1];<NEW_LINE>frameBufferTextures = new int[size - 1];<NEW_LINE>for (int i = 0; i < size - 1; i++) {<NEW_LINE>GLES20.<MASK><NEW_LINE>GLES20.glGenTextures(1, frameBufferTextures, i);<NEW_LINE>GLES20.glBindTexture(GLES20.GL_TEXTURE_2D, frameBufferTextures[i]);<NEW_LINE>GLES20.glTexImage2D(GLES20.GL_TEXTURE_2D, 0, GLES20.GL_RGBA, width, height, 0, GLES20.GL_RGBA, GLES20.GL_UNSIGNED_BYTE, null);<NEW_LINE>GLES20.glTexParameterf(GLES20.GL_TEXTURE_2D, GLES20.GL_TEXTURE_MAG_FILTER, GLES20.GL_LINEAR);<NEW_LINE>GLES20.glTexParameterf(GLES20.GL_TEXTURE_2D, GLES20.GL_TEXTURE_MIN_FILTER, GLES20.GL_LINEAR);<NEW_LINE>GLES20.glTexParameterf(GLES20.GL_TEXTURE_2D, GLES20.GL_TEXTURE_WRAP_S, GLES20.GL_CLAMP_TO_EDGE);<NEW_LINE>GLES20.glTexParameterf(GLES20.GL_TEXTURE_2D, GLES20.GL_TEXTURE_WRAP_T, GLES20.GL_CLAMP_TO_EDGE);<NEW_LINE>GLES20.glBindFramebuffer(GLES20.GL_FRAMEBUFFER, frameBuffers[i]);<NEW_LINE>GLES20.glFramebufferTexture2D(GLES20.GL_FRAMEBUFFER, GLES20.GL_COLOR_ATTACHMENT0, GLES20.GL_TEXTURE_2D, frameBufferTextures[i], 0);<NEW_LINE>GLES20.glBindTexture(GLES20.GL_TEXTURE_2D, 0);<NEW_LINE>GLES20.glBindFramebuffer(GLES20.GL_FRAMEBUFFER, 0);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
|
glGenFramebuffers(1, frameBuffers, i);
|
1,286,801
|
final PutEmailMonitoringConfigurationResult executePutEmailMonitoringConfiguration(PutEmailMonitoringConfigurationRequest putEmailMonitoringConfigurationRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(putEmailMonitoringConfigurationRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<PutEmailMonitoringConfigurationRequest> request = null;<NEW_LINE>Response<PutEmailMonitoringConfigurationResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new PutEmailMonitoringConfigurationRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(putEmailMonitoringConfigurationRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "WorkMail");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "PutEmailMonitoringConfiguration");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<PutEmailMonitoringConfigurationResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new PutEmailMonitoringConfigurationResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
|
HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());
|
721,279
|
protected final void sendInternal() throws StatusException {<NEW_LINE>try (ParcelHolder parcel = ParcelHolder.obtain()) {<NEW_LINE>int flags = 0;<NEW_LINE>// Placeholder for flags. Will be filled in below.<NEW_LINE>parcel.<MASK><NEW_LINE>parcel.get().writeInt(transactionIndex++);<NEW_LINE>switch(outboundState) {<NEW_LINE>case INITIAL:<NEW_LINE>flags |= TransactionUtils.FLAG_PREFIX;<NEW_LINE>flags |= writePrefix(parcel.get());<NEW_LINE>onOutboundState(State.PREFIX_SENT);<NEW_LINE>if (!messageAvailable() && !suffixReady) {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>// Fall-through.<NEW_LINE>case PREFIX_SENT:<NEW_LINE>InputStream messageStream = peekNextMessage();<NEW_LINE>if (messageStream != null) {<NEW_LINE>flags |= TransactionUtils.FLAG_MESSAGE_DATA;<NEW_LINE>flags |= writeMessageData(parcel.get(), messageStream);<NEW_LINE>} else {<NEW_LINE>checkState(suffixReady);<NEW_LINE>}<NEW_LINE>if (suffixReady && !messageAvailable()) {<NEW_LINE>onOutboundState(State.ALL_MESSAGES_SENT);<NEW_LINE>} else {<NEW_LINE>// There's still more message data to deliver, break out.<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>// Fall-through.<NEW_LINE>case ALL_MESSAGES_SENT:<NEW_LINE>flags |= TransactionUtils.FLAG_SUFFIX;<NEW_LINE>flags |= writeSuffix(parcel.get());<NEW_LINE>onOutboundState(State.SUFFIX_SENT);<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>throw new AssertionError();<NEW_LINE>}<NEW_LINE>TransactionUtils.fillInFlags(parcel.get(), flags);<NEW_LINE>int dataSize = parcel.get().dataSize();<NEW_LINE>transport.sendTransaction(callId, parcel);<NEW_LINE>statsTraceContext.outboundWireSize(dataSize);<NEW_LINE>statsTraceContext.outboundUncompressedSize(dataSize);<NEW_LINE>} catch (IOException e) {<NEW_LINE>throw Status.INTERNAL.withCause(e).asException();<NEW_LINE>}<NEW_LINE>}
|
get().writeInt(0);
|
59,834
|
private Mono<PagedResponse<EventSubscriptionInner>> listGlobalByResourceGroupNextSinglePageAsync(String nextLink) {<NEW_LINE>if (nextLink == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (this.client.getEndpoint() == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));<NEW_LINE>}<NEW_LINE>final String accept = "application/json";<NEW_LINE>return FluxUtil.withContext(context -> service.listGlobalByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)).<PagedResponse<EventSubscriptionInner>>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)).contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext(<MASK><NEW_LINE>}
|
)).readOnly()));
|
997,553
|
private Color evalColor(String color) {<NEW_LINE>Color targetColor = Color.RED;<NEW_LINE>if (color == null) {<NEW_LINE>color = Settings.DefaultHighlightColor;<NEW_LINE>}<NEW_LINE>if (color.startsWith("#")) {<NEW_LINE>if (color.length() > 7) {<NEW_LINE>// might be the version #nnnnnnnnn<NEW_LINE>if (color.length() == 10) {<NEW_LINE>int cR = 255, cG = 0, cB = 0;<NEW_LINE>try {<NEW_LINE>cR = Integer.decode(color.substring(1, 4));<NEW_LINE>cG = Integer.decode(color<MASK><NEW_LINE>cB = Integer.decode(color.substring(7, 10));<NEW_LINE>} catch (NumberFormatException ex) {<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>targetColor = new Color(cR, cG, cB);<NEW_LINE>} catch (IllegalArgumentException ex) {<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>// supposing it is a hex value<NEW_LINE>try {<NEW_LINE>targetColor = new Color(Integer.decode(color));<NEW_LINE>} catch (NumberFormatException nex) {<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>// supposing color contains one of the defined color names<NEW_LINE>if (!color.endsWith("Gray") || "Gray".equals(color)) {<NEW_LINE>// the name might be given with any mix of lower/upper-case<NEW_LINE>// only lightGray, LIGHT_GRAY, darkGray and DARK_GRAY must be given exactly<NEW_LINE>color = color.toUpperCase();<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>Field field = Class.forName("java.awt.Color").getField(color);<NEW_LINE>targetColor = (Color) field.get(null);<NEW_LINE>} catch (Exception e) {<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return targetColor;<NEW_LINE>}
|
.substring(4, 7));
|
630,815
|
public void onArmorStandInteract(final PlayerInteractAtEntityEvent event) {<NEW_LINE>final User user = ess.getUser(event.getPlayer());<NEW_LINE>if (!(event.getRightClicked() instanceof ArmorStand)) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (prot.getSettingBool(AntiBuildConfig.disable_build) && !user.canBuild() && !user.isAuthorized("essentials.build") && !metaPermCheck(user, "place", Material.ARMOR_STAND)) {<NEW_LINE>if (ess.getSettings().warnOnBuildDisallow()) {<NEW_LINE>user.sendMessage(tl("antiBuildPlace", Material<MASK><NEW_LINE>}<NEW_LINE>event.setCancelled(true);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (prot.checkProtectionItems(AntiBuildConfig.blacklist_placement, Material.ARMOR_STAND) && !user.isAuthorized("essentials.protect.exemptplacement")) {<NEW_LINE>if (ess.getSettings().warnOnBuildDisallow()) {<NEW_LINE>user.sendMessage(tl("antiBuildPlace", Material.ARMOR_STAND.toString()));<NEW_LINE>}<NEW_LINE>event.setCancelled(true);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (prot.checkProtectionItems(AntiBuildConfig.alert_on_placement, Material.ARMOR_STAND) && !user.isAuthorized("essentials.protect.alerts.notrigger")) {<NEW_LINE>prot.getEssentialsConnect().alert(user, Material.ARMOR_STAND.toString(), tl("alertPlaced"));<NEW_LINE>}<NEW_LINE>}
|
.ARMOR_STAND.toString()));
|
168,315
|
public static ListApiMsgRecordsResponse unmarshall(ListApiMsgRecordsResponse listApiMsgRecordsResponse, UnmarshallerContext _ctx) {<NEW_LINE>listApiMsgRecordsResponse.setRequestId(_ctx.stringValue("ListApiMsgRecordsResponse.RequestId"));<NEW_LINE>listApiMsgRecordsResponse.setPageIndex(_ctx.integerValue("ListApiMsgRecordsResponse.PageIndex"));<NEW_LINE>listApiMsgRecordsResponse.setSuccess(_ctx.booleanValue("ListApiMsgRecordsResponse.Success"));<NEW_LINE>listApiMsgRecordsResponse.setCnt<MASK><NEW_LINE>listApiMsgRecordsResponse.setErrorMessage(_ctx.stringValue("ListApiMsgRecordsResponse.ErrorMessage"));<NEW_LINE>listApiMsgRecordsResponse.setPageSize(_ctx.integerValue("ListApiMsgRecordsResponse.PageSize"));<NEW_LINE>listApiMsgRecordsResponse.setErrorCode(_ctx.stringValue("ListApiMsgRecordsResponse.ErrorCode"));<NEW_LINE>List<ApiMsgSearchVO> data = new ArrayList<ApiMsgSearchVO>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("ListApiMsgRecordsResponse.Data.Length"); i++) {<NEW_LINE>ApiMsgSearchVO apiMsgSearchVO = new ApiMsgSearchVO();<NEW_LINE>apiMsgSearchVO.setMsg(_ctx.stringValue("ListApiMsgRecordsResponse.Data[" + i + "].Msg"));<NEW_LINE>apiMsgSearchVO.setUid(_ctx.stringValue("ListApiMsgRecordsResponse.Data[" + i + "].Uid"));<NEW_LINE>apiMsgSearchVO.setWriteTime(_ctx.longValue("ListApiMsgRecordsResponse.Data[" + i + "].WriteTime"));<NEW_LINE>apiMsgSearchVO.setMsgId(_ctx.stringValue("ListApiMsgRecordsResponse.Data[" + i + "].MsgId"));<NEW_LINE>apiMsgSearchVO.setState(_ctx.stringValue("ListApiMsgRecordsResponse.Data[" + i + "].State"));<NEW_LINE>apiMsgSearchVO.setType(_ctx.integerValue("ListApiMsgRecordsResponse.Data[" + i + "].Type"));<NEW_LINE>data.add(apiMsgSearchVO);<NEW_LINE>}<NEW_LINE>listApiMsgRecordsResponse.setData(data);<NEW_LINE>return listApiMsgRecordsResponse;<NEW_LINE>}
|
(_ctx.longValue("ListApiMsgRecordsResponse.Cnt"));
|
177,066
|
public I_PP_Product_BOM createBOM(@NonNull final ProductBOMVersionsId bomVersionsId, @NonNull final BOMCreateRequest request) {<NEW_LINE>final OrgId orgId = request.getOrgId();<NEW_LINE>final I_PP_Product_BOM bomRecord = newInstance(I_PP_Product_BOM.class);<NEW_LINE>bomRecord.setAD_Org_ID(orgId.getRepoId());<NEW_LINE>bomRecord.setM_Product_ID(request.getProductId().getRepoId());<NEW_LINE>bomRecord.setValue(request.getProductValue());<NEW_LINE>bomRecord.<MASK><NEW_LINE>bomRecord.setC_UOM_ID(request.getUomId().getRepoId());<NEW_LINE>bomRecord.setPP_Product_BOMVersions_ID(bomVersionsId.getRepoId());<NEW_LINE>bomRecord.setValidFrom(TimeUtil.asTimestamp(request.getValidFrom()));<NEW_LINE>bomRecord.setM_AttributeSetInstance_ID(AttributeSetInstanceId.toRepoId(request.getAttributeSetInstanceId()));<NEW_LINE>bomRecord.setDateDoc(TimeUtil.asTimestamp(Instant.now()));<NEW_LINE>bomRecord.setC_DocType_ID(getBOMDocTypeId().getRepoId());<NEW_LINE>bomRecord.setDocStatus(DocStatus.Drafted.getCode());<NEW_LINE>bomRecord.setDocAction(X_PP_Product_BOM.DOCACTION_Complete);<NEW_LINE>if (request.getIsActive() != null) {<NEW_LINE>bomRecord.setIsActive(request.getIsActive());<NEW_LINE>}<NEW_LINE>if (request.getBomUse() != null) {<NEW_LINE>bomRecord.setBOMUse(request.getBomUse().getCode());<NEW_LINE>}<NEW_LINE>if (request.getBomType() != null) {<NEW_LINE>bomRecord.setBOMType(request.getBomType().getCode());<NEW_LINE>}<NEW_LINE>saveRecord(bomRecord);<NEW_LINE>final ProductBOMId bomId = ProductBOMId.ofRepoId(bomRecord.getPP_Product_BOM_ID());<NEW_LINE>request.getLines().stream().map(line -> CreateBOMLineRequest.builder().bomId(bomId).orgId(orgId).isActive(request.getIsActive()).validFrom(request.getValidFrom()).line(line).build()).forEach(this::createBOMLine);<NEW_LINE>return bomRecord;<NEW_LINE>}
|
setName(request.getProductName());
|
1,215,951
|
final AssociateBrowserSettingsResult executeAssociateBrowserSettings(AssociateBrowserSettingsRequest associateBrowserSettingsRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(associateBrowserSettingsRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE><MASK><NEW_LINE>Request<AssociateBrowserSettingsRequest> request = null;<NEW_LINE>Response<AssociateBrowserSettingsResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new AssociateBrowserSettingsRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(associateBrowserSettingsRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "WorkSpaces Web");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "AssociateBrowserSettings");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<AssociateBrowserSettingsResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new AssociateBrowserSettingsResultJsonUnmarshaller());<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);
|
670,799
|
protected int letterUnderCursor(float x) {<NEW_LINE>if (linesBreak.size > 0) {<NEW_LINE>if (cursorLine * 2 >= linesBreak.size) {<NEW_LINE>return text.length();<NEW_LINE>} else {<NEW_LINE>float[] glyphPositions = this.glyphPositions.items;<NEW_LINE>int start = linesBreak.items[cursorLine * 2];<NEW_LINE>x += glyphPositions[start];<NEW_LINE>int end = linesBreak.<MASK><NEW_LINE>int i = start;<NEW_LINE>for (; i < end; i++) if (glyphPositions[i] > x)<NEW_LINE>break;<NEW_LINE>if (i > 0 && glyphPositions[i] - x <= x - glyphPositions[i - 1]) {<NEW_LINE>return Math.min(i, text.length());<NEW_LINE>}<NEW_LINE>return Math.max(0, i - 1);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>return 0;<NEW_LINE>}<NEW_LINE>}
|
items[cursorLine * 2 + 1];
|
264,662
|
public OrcWriterOptions.Builder toOrcWriterOptionsBuilder() {<NEW_LINE>DefaultOrcWriterFlushPolicy flushPolicy = DefaultOrcWriterFlushPolicy.builder().withStripeMinSize(stripeMinSize).withStripeMaxSize(stripeMaxSize).withStripeMaxRowCount(stripeMaxRowCount).build();<NEW_LINE>OptionalInt resolvedCompressionLevel = OptionalInt.empty();<NEW_LINE>if (compressionLevel != DEFAULT_COMPRESSION_LEVEL) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>// Give separate copy to callers for isolation.<NEW_LINE>return OrcWriterOptions.builder().withFlushPolicy(flushPolicy).withRowGroupMaxRowCount(rowGroupMaxRowCount).withDictionaryMaxMemory(dictionaryMaxMemory).withMaxStringStatisticsLimit(stringStatisticsLimit).withMaxCompressionBufferSize(maxCompressionBufferSize).withStreamLayoutFactory(getStreamLayoutFactory(streamLayoutType)).withDwrfStripeCacheEnabled(isDwrfStripeCacheEnabled).withDwrfStripeCacheMaxSize(dwrfStripeCacheMaxSize).withDwrfStripeCacheMode(dwrfStripeCacheMode).withCompressionLevel(resolvedCompressionLevel);<NEW_LINE>}
|
resolvedCompressionLevel = OptionalInt.of(compressionLevel);
|
601,515
|
public PrivateBinDataV1 encrypt(String strToEncrypt) throws Exception {<NEW_LINE>byte[] iv = randomInitializationVector();<NEW_LINE>byte[] salt = generateRandomSalt();<NEW_LINE>byte[] key = DeEncryptor.generateRandomKey(AES_KEY_LENGTH);<NEW_LINE>SecretKey <MASK><NEW_LINE>Cipher cipher = getCipher();<NEW_LINE>GCMParameterSpec parameterSpec = new GCMParameterSpec(AUTH_TAG_LENGTH, iv);<NEW_LINE>cipher.init(Cipher.ENCRYPT_MODE, secretKey, parameterSpec);<NEW_LINE>cipher.updateAAD("".getBytes());<NEW_LINE>byte[] encrypted = cipher.doFinal(strToEncrypt.getBytes());<NEW_LINE>return new PrivateBinDataV1(Base64.getEncoder().encodeToString(iv), 1, ITERATIONS, AES_KEY_LENGTH, AUTH_TAG_LENGTH, "gcm", "", "aes", Base64.getEncoder().encodeToString(salt), Base64.getEncoder().encodeToString(encrypted), Base64.getEncoder().encodeToString(key));<NEW_LINE>}
|
secretKey = generateDerivedkey(key, salt);
|
626,571
|
private Optional<File> downloadAndExtract(URL url, File targetFile) throws IOException {<NEW_LINE><MASK><NEW_LINE>File targetFolder = targetFile.getParentFile();<NEW_LINE>File tempDir = config.isAvoidTmpFolder() ? targetFolder : createTempDirectory("").toFile();<NEW_LINE>File temporaryFile = new File(tempDir, targetFile.getName());<NEW_LINE>log.trace("Target folder {} ... using temporal file {}", targetFolder, temporaryFile);<NEW_LINE>copyInputStreamToFile(httpClient.execute(httpClient.createHttpGet(url)).getEntity().getContent(), temporaryFile);<NEW_LINE>List<File> extractedFiles = extract(temporaryFile);<NEW_LINE>File resultingDriver = new File(targetFolder, extractedFiles.iterator().next().getName());<NEW_LINE>boolean driverExists = resultingDriver.exists();<NEW_LINE>if ((!driverExists || config.isForceDownload()) && !config.isAvoidTmpFolder()) {<NEW_LINE>if (driverExists) {<NEW_LINE>log.debug("Overriding former driver {}", resultingDriver);<NEW_LINE>deleteFile(resultingDriver);<NEW_LINE>}<NEW_LINE>for (File f : extractedFiles) {<NEW_LINE>moveFileToDirectory(f, targetFolder, true);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (!config.isExecutable(resultingDriver)) {<NEW_LINE>setFileExecutable(resultingDriver);<NEW_LINE>}<NEW_LINE>if (!config.isAvoidTmpFolder()) {<NEW_LINE>deleteFolder(tempDir);<NEW_LINE>}<NEW_LINE>log.trace("Driver after extraction {}", resultingDriver);<NEW_LINE>return of(resultingDriver);<NEW_LINE>}
|
log.info("Downloading {}", url);
|
1,023,088
|
protected String doIt() {<NEW_LINE>final I_AD_Tab adTab = getRecord(I_AD_Tab.class);<NEW_LINE>if (adTab.getTemplate_Tab_ID() > 0) {<NEW_LINE>throw new AdempiereException("Not allowed when using a template tab");<NEW_LINE>}<NEW_LINE>//<NEW_LINE>int count = 0;<NEW_LINE>for (final I_AD_Column adColumn : retrieveColumns(adTab)) {<NEW_LINE>try {<NEW_LINE>final I_AD_Field field = createADField(adTab, adColumn, p_IsDisplayNonIDColumns, p_EntityType);<NEW_LINE>addLog("@Created@: " + field.getName() + " (@AD_Column_ID@: " + adColumn.getColumnName() + ")");<NEW_LINE>count++;<NEW_LINE>} catch (final Exception e) {<NEW_LINE>log.<MASK><NEW_LINE>addLog("Error creating " + adColumn.getColumnName() + ": " + e.getLocalizedMessage());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (p_IsTest) {<NEW_LINE>throw new AdempiereException("ROLLBACK");<NEW_LINE>}<NEW_LINE>return "@Created@ #" + count;<NEW_LINE>}
|
warn("Failed to create field for {}", adColumn, e);
|
693,785
|
public String makeSortString(String value, String language) {<NEW_LINE>if (filters == null) {<NEW_LINE>// Log an error if the class is not configured correctly<NEW_LINE>log.error("No filters defined for " + this.getClass().getName());<NEW_LINE>} else {<NEW_LINE>// Normalize language into a two or three character code<NEW_LINE>if (language != null) {<NEW_LINE>if (language.length() > 2 && language.charAt(2) == '_') {<NEW_LINE>language = language.substring(0, 2);<NEW_LINE>}<NEW_LINE>if (language.length() > 3) {<NEW_LINE>language = language.substring(0, 3);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Iterate through filters, applying each in turn<NEW_LINE>for (int idx = 0; idx < filters.length; idx++) {<NEW_LINE>if (language != null) {<NEW_LINE>value = filters[idx].filter(value, language);<NEW_LINE>} else {<NEW_LINE>value = filters<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return value;<NEW_LINE>}
|
[idx].filter(value);
|
1,450,327
|
private void markAggregationRecordAsSubmitted(AggregationEntry aggregationEntry) {<NEW_LINE>// Update the attribute that marks an item as submitted<NEW_LINE>Map<String, AttributeValue> aggregationEntryKey = new HashMap<>();<NEW_LINE>AttributeValue tenantIDValue = AttributeValue.builder().s(aggregationEntry.getTenantID()).build();<NEW_LINE>aggregationEntryKey.put(PRIMARY_KEY_NAME, tenantIDValue);<NEW_LINE>AttributeValue aggregationStringValue = AttributeValue.builder().s(formatAggregationEntry(aggregationEntry.getPeriodStart().toEpochMilli())).build();<NEW_LINE>aggregationEntryKey.put(SORT_KEY_NAME, aggregationStringValue);<NEW_LINE>Map<String, String> expressionAttributeNames = new HashMap<>();<NEW_LINE>expressionAttributeNames.put(SUBMITTED_KEY_EXPRESSION_NAME, SUBMITTED_KEY_ATTRIBUTE_NAME);<NEW_LINE>Map<String, AttributeValue> expressionAttributeValues = new HashMap<>();<NEW_LINE>AttributeValue keySubmittedValue = AttributeValue.builder().bool(true).build();<NEW_LINE>expressionAttributeValues.put(KEY_SUBMITTED_EXPRESSION_VALUE, keySubmittedValue);<NEW_LINE>String updateExpression = String.format("SET %s = %s", SUBMITTED_KEY_EXPRESSION_NAME, KEY_SUBMITTED_EXPRESSION_VALUE);<NEW_LINE>UpdateItemRequest updateRequest = UpdateItemRequest.builder().tableName(TABLE_NAME).key(aggregationEntryKey).updateExpression(updateExpression).expressionAttributeNames(expressionAttributeNames).expressionAttributeValues(expressionAttributeValues).build();<NEW_LINE>try {<NEW_LINE>ddb.updateItem(updateRequest);<NEW_LINE>} catch (ResourceNotFoundException | InternalServerErrorException | TransactionCanceledException e) {<NEW_LINE>LOGGER.<MASK><NEW_LINE>}<NEW_LINE>LOGGER.info("Marked aggregation record {} for tenant {} as published", aggregationEntry.getTenantID(), formatAggregationEntry(aggregationEntry.getPeriodStart().toEpochMilli()));<NEW_LINE>}
|
error(e.getMessage());
|
20,309
|
public boolean visualizationVarStatus(ModStatusVar pchkInput, Command cmd, Item item, EventPublisher eventPublisher) {<NEW_LINE>LcnDefs.Var var = this.regId == 0 ? LcnDefs.Var<MASK><NEW_LINE>if (pchkInput.getLogicalSourceAddr().equals(this.addr) && pchkInput.getVar() == var) {<NEW_LINE>if (item.getAcceptedDataTypes().contains(OpenClosedType.class)) {<NEW_LINE>eventPublisher.postUpdate(item.getName(), pchkInput.getValue().isLockedRegulator() ? OpenClosedType.CLOSED : OpenClosedType.OPEN);<NEW_LINE>return true;<NEW_LINE>} else if (item.getAcceptedDataTypes().contains(OnOffType.class)) {<NEW_LINE>eventPublisher.postUpdate(item.getName(), pchkInput.getValue().isLockedRegulator() ? OnOffType.ON : OnOffType.OFF);<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>}
|
.R1VARSETPOINT : LcnDefs.Var.R2VARSETPOINT;
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.