idx
int32
46
1.86M
input
stringlengths
321
6.6k
target
stringlengths
9
1.24k
840,171
private <T> List<T> loadFileList(String basekey, Class<T> type) throws BackingStoreException {<NEW_LINE>Preferences pref = NbPreferences.forModule(JavaScopeBuilder.class).node(PREF_SCOPE).node(basekey);<NEW_LINE>List<T> toRet <MASK><NEW_LINE>for (String key : pref.keys()) {<NEW_LINE>final String url = pref.get(key, null);<NEW_LINE>if (url != null && !url.isEmpty()) {<NEW_LINE>try {<NEW_LINE>final FileObject f = URLMapper.findFileObject(new URL(url));<NEW_LINE>if (f != null && f.isValid()) {<NEW_LINE>if (type.isAssignableFrom(FileObject.class)) {<NEW_LINE>toRet.add((T) f);<NEW_LINE>} else {<NEW_LINE>toRet.add((T) new NonRecursiveFolder() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public FileObject getFolder() {<NEW_LINE>return f;<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (MalformedURLException ex) {<NEW_LINE>Exceptions.printStackTrace(ex);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return toRet;<NEW_LINE>}
= new LinkedList<T>();
1,654,785
public void dump(FormattedWriter writer) {<NEW_LINE>if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())<NEW_LINE>SibTr.entry(this, tc, "dump", <MASK><NEW_LINE>try {<NEW_LINE>writer.newLine();<NEW_LINE>writer.startTag(this.getClass().getSimpleName());<NEW_LINE>writer.indent();<NEW_LINE>super.dump(writer);<NEW_LINE>if (subConsumer != null)<NEW_LINE>subConsumer.dump(writer);<NEW_LINE>writer.outdent();<NEW_LINE>writer.newLine();<NEW_LINE>writer.endTag(this.getClass().getSimpleName());<NEW_LINE>} catch (Throwable t) {<NEW_LINE>// No FFDC Code Needed<NEW_LINE>try {<NEW_LINE>writer.write("\nUnable to dump " + this + " " + t);<NEW_LINE>} catch (IOException e) {<NEW_LINE>e.printStackTrace();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())<NEW_LINE>SibTr.exit(this, tc, "dump");<NEW_LINE>}
new Object[] { writer });
162,425
protected void encodeStepStatus(FacesContext context, Wizard wizard) throws IOException {<NEW_LINE><MASK><NEW_LINE>String currentStep = wizard.getStep();<NEW_LINE>boolean currentFound = false;<NEW_LINE>writer.startElement("ul", null);<NEW_LINE>writer.writeAttribute("class", Wizard.STEP_STATUS_CLASS, null);<NEW_LINE>for (UIComponent child : wizard.getChildren()) {<NEW_LINE>if (child instanceof Tab && child.isRendered()) {<NEW_LINE>Tab tab = (Tab) child;<NEW_LINE>String title = tab.getTitle();<NEW_LINE>UIComponent titleFacet = tab.getFacet("title");<NEW_LINE>boolean active = (!currentFound) && (currentStep == null || tab.getId().equals(currentStep));<NEW_LINE>String titleStyleClass = active ? Wizard.ACTIVE_STEP_CLASS : Wizard.STEP_CLASS;<NEW_LINE>if (tab.getTitleStyleClass() != null) {<NEW_LINE>titleStyleClass = titleStyleClass + " " + tab.getTitleStyleClass();<NEW_LINE>}<NEW_LINE>if (active) {<NEW_LINE>currentFound = true;<NEW_LINE>}<NEW_LINE>writer.startElement("li", null);<NEW_LINE>writer.writeAttribute("class", titleStyleClass, null);<NEW_LINE>if (tab.getTitleStyle() != null) {<NEW_LINE>writer.writeAttribute("style", tab.getTitleStyle(), null);<NEW_LINE>}<NEW_LINE>if (tab.getTitletip() != null) {<NEW_LINE>writer.writeAttribute("title", tab.getTitletip(), null);<NEW_LINE>}<NEW_LINE>if (ComponentUtils.shouldRenderFacet(titleFacet)) {<NEW_LINE>titleFacet.encodeAll(context);<NEW_LINE>} else if (title != null) {<NEW_LINE>writer.writeText(title, null);<NEW_LINE>}<NEW_LINE>writer.endElement("li");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>writer.endElement("ul");<NEW_LINE>}
ResponseWriter writer = context.getResponseWriter();
311,458
private synchronized void cleanUselessSourceWrapper(Set<String> uselessStorageIds) {<NEW_LINE>Iterator<Map.Entry<String, DataSourceWrapper>> iterator = dataSourceWrapperMap.entrySet().iterator();<NEW_LINE>LoggerInit.TDDL_DYNAMIC_CONFIG.info(String<MASK><NEW_LINE>while (iterator.hasNext()) {<NEW_LINE>DataSourceWrapper dsw = iterator.next().getValue();<NEW_LINE>if (uselessStorageIds.contains(dsw.getStorageId())) {<NEW_LINE>try {<NEW_LINE>LoggerInit.TDDL_DYNAMIC_CONFIG.info(String.format("unregister %s storageIds successfully", dsw.getDataSourceKey()));<NEW_LINE>iterator.remove();<NEW_LINE>destroy(dsw);<NEW_LINE>} catch (Throwable e) {<NEW_LINE>logger.error("we got exception when close datasource : " + dsw.getDataSourceKey(), e);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>logger.warn("continue save the storageId : " + dsw.getDataSourceKey());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>resetPolarDBXSourceHolder(false);<NEW_LINE>}
.format("unregister %s storageIds", uselessStorageIds));
1,248,667
public IntermediateLayer constructIntermediateLayer(long queryId, UDTFPlan udtfPlan, RawQueryInputLayer rawTimeSeriesInputLayer, Map<Expression, IntermediateLayer> expressionIntermediateLayerMap, Map<Expression, TSDataType> expressionDataTypeMap, LayerMemoryAssigner memoryAssigner) throws QueryProcessException, IOException {<NEW_LINE>if (!expressionIntermediateLayerMap.containsKey(this)) {<NEW_LINE><MASK><NEW_LINE>IntermediateLayer parentLayerPointReader = expression.constructIntermediateLayer(queryId, udtfPlan, rawTimeSeriesInputLayer, expressionIntermediateLayerMap, expressionDataTypeMap, memoryAssigner);<NEW_LINE>Transformer transformer = new LogicNotTransformer(parentLayerPointReader.constructPointReader());<NEW_LINE>expressionDataTypeMap.put(this, transformer.getDataType());<NEW_LINE>// SingleInputColumnMultiReferenceIntermediateLayer doesn't support ConstantLayerPointReader<NEW_LINE>// yet. And since a ConstantLayerPointReader won't produce too much IO,<NEW_LINE>// SingleInputColumnSingleReferenceIntermediateLayer could be a better choice.<NEW_LINE>expressionIntermediateLayerMap.put(this, memoryAssigner.getReference(this) == 1 || isConstantOperand() ? new SingleInputColumnSingleReferenceIntermediateLayer(this, queryId, memoryBudgetInMB, transformer) : new SingleInputColumnMultiReferenceIntermediateLayer(this, queryId, memoryBudgetInMB, transformer));<NEW_LINE>}<NEW_LINE>return expressionIntermediateLayerMap.get(this);<NEW_LINE>}
float memoryBudgetInMB = memoryAssigner.assign();
312,349
public void scrobble(HttpServletRequest request, HttpServletResponse response) throws Exception {<NEW_LINE>request = wrapRequest(request);<NEW_LINE>Player player = playerService.getPlayer(request, response);<NEW_LINE>boolean submission = getBooleanParameter(request, "submission", true);<NEW_LINE>int[] ids = getRequiredIntParameters(request, "id");<NEW_LINE>long[] <MASK><NEW_LINE>if (times.length > 0 && times.length != ids.length) {<NEW_LINE>error(request, response, ErrorCode.GENERIC, "Wrong number of timestamps: " + times.length);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>for (int i = 0; i < ids.length; i++) {<NEW_LINE>int id = ids[i];<NEW_LINE>MediaFile file = mediaFileService.getMediaFile(id);<NEW_LINE>if (file == null) {<NEW_LINE>LOG.warn("File to scrobble not found: " + id);<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>Instant time = times.length == 0 ? null : Instant.ofEpochMilli(times[i]);<NEW_LINE>statusService.addRemotePlay(new PlayStatus(UUID.randomUUID(), file, player, time == null ? Instant.now() : time));<NEW_LINE>mediaFileService.incrementPlayCount(file);<NEW_LINE>audioScrobblerService.register(file, player.getUsername(), submission, time);<NEW_LINE>}<NEW_LINE>writeEmptyResponse(request, response);<NEW_LINE>}
times = getLongParameters(request, "time");
1,414,818
public void load(SerializedField metadata, DrillBuf buffer) {<NEW_LINE>List<SerializedField> children = metadata.getChildList();<NEW_LINE>SerializedField offsetField = children.get(0);<NEW_LINE>offsets.load(offsetField, buffer);<NEW_LINE><MASK><NEW_LINE>for (int i = 1; i < children.size(); i++) {<NEW_LINE>SerializedField child = children.get(i);<NEW_LINE>MaterializedField fieldDef = MaterializedField.create(child);<NEW_LINE>ValueVector vector = getChild(fieldDef.getName());<NEW_LINE>if (vector == null) {<NEW_LINE>// if we arrive here, we didn't have a matching vector.<NEW_LINE>vector = BasicTypeHelper.getNewVector(fieldDef, allocator);<NEW_LINE>putChild(fieldDef.getName(), vector);<NEW_LINE>}<NEW_LINE>int vectorLength = child.getBufferLength();<NEW_LINE>vector.load(child, buffer.slice(bufOffset, vectorLength));<NEW_LINE>bufOffset += vectorLength;<NEW_LINE>}<NEW_LINE>assert bufOffset == buffer.writerIndex();<NEW_LINE>}
int bufOffset = offsetField.getBufferLength();
324,095
public static void copyStartUpSo() {<NEW_LINE>try {<NEW_LINE>// copy libjsb.so to cache/weex/jsb/cputype<NEW_LINE>String pkgName = WXEnvironment.getApplication().getPackageName();<NEW_LINE>String cacheFile = WXEnvironment.getApplication().getApplicationContext().getCacheDir().getPath();<NEW_LINE>// cp weexjsb any way<NEW_LINE>// if android api < 16 copy libweexjst.so else copy libweexjsb.so<NEW_LINE>boolean pieSupport = true;<NEW_LINE>File newfile;<NEW_LINE>String startSoName = WXEnvironment.CORE_JSB_SO_NAME;<NEW_LINE>String startSoPath = STARTUPSO;<NEW_LINE>if (Build.VERSION.SDK_INT < Build.VERSION_CODES.JELLY_BEAN) {<NEW_LINE>pieSupport = false;<NEW_LINE>startSoName = WXEnvironment.CORE_JST_SO_NAME;<NEW_LINE>startSoPath = STARTUPSOANDROID15;<NEW_LINE>}<NEW_LINE>final File copyPath = _desSoCopyFile(startSoName);<NEW_LINE>if (!copyPath.exists()) {<NEW_LINE>copyPath.mkdirs();<NEW_LINE>}<NEW_LINE>newfile = new File(copyPath, startSoPath);<NEW_LINE>WXEnvironment<MASK><NEW_LINE>String jsb = WXEnvironment.getDefaultSettingValue(startSoName, "-1");<NEW_LINE>if (newfile.exists() && TextUtils.equals(WXEnvironment.getAppVersionName(), jsb)) {<NEW_LINE>// no update so skip copy<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>String path = "/data/data/" + pkgName + "/lib";<NEW_LINE>if (cacheFile != null && cacheFile.indexOf("/cache") > 0) {<NEW_LINE>path = cacheFile.replace("/cache", "/lib");<NEW_LINE>}<NEW_LINE>File oldfile = null;<NEW_LINE>if (pieSupport) {<NEW_LINE>oldfile = new File(path, STARTUPSO);<NEW_LINE>} else {<NEW_LINE>oldfile = new File(path, STARTUPSOANDROID15);<NEW_LINE>}<NEW_LINE>if (!oldfile.exists()) {<NEW_LINE>try {<NEW_LINE>String weexjsb = ((PathClassLoader) (WXSoInstallMgrSdk.class.getClassLoader())).findLibrary(startSoName);<NEW_LINE>oldfile = new File(weexjsb);<NEW_LINE>} catch (Throwable throwable) {<NEW_LINE>// do nothing<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (!oldfile.exists()) {<NEW_LINE>String extractSoPath = WXEnvironment.extractSo();<NEW_LINE>oldfile = new File(extractSoPath, STARTUPSO);<NEW_LINE>}<NEW_LINE>if (oldfile.exists()) {<NEW_LINE>WXFileUtils.copyFile(oldfile, newfile);<NEW_LINE>}<NEW_LINE>WXEnvironment.writeDefaultSettingsValue(startSoName, WXEnvironment.getAppVersionName());<NEW_LINE>} catch (Throwable e) {<NEW_LINE>e.printStackTrace();<NEW_LINE>}<NEW_LINE>}
.CORE_JSB_SO_PATH = newfile.getAbsolutePath();
1,617,546
private static SpeedStat calculateStat(List<IOTaskResult.Point> points) {<NEW_LINE>SpeedStat result = new SpeedStat();<NEW_LINE>if (points.size() == 0) {<NEW_LINE>return result;<NEW_LINE>}<NEW_LINE>double totalDuration = 0.0;<NEW_LINE>long totalSize = 0L;<NEW_LINE>double[] speeds = new double[points.size()];<NEW_LINE>double maxSpeed = 0.0;<NEW_LINE>double minSpeed = Double.MAX_VALUE;<NEW_LINE>int i = 0;<NEW_LINE>for (IOTaskResult.Point p : points) {<NEW_LINE>totalDuration += p.mDurationSeconds;<NEW_LINE>totalSize += p.mDataSizeBytes;<NEW_LINE>// convert B/s to MB/s<NEW_LINE>double speed = p.mDataSizeBytes / (p.mDurationSeconds * 1024 * 1024);<NEW_LINE>maxSpeed = Math.max(maxSpeed, speed);<NEW_LINE>minSpeed = Math.min(minSpeed, speed);<NEW_LINE>speeds[i++] = speed;<NEW_LINE>}<NEW_LINE>// convert B/s to MB/s<NEW_LINE>double avgSpeed = totalSize / (totalDuration * 1024 * 1024);<NEW_LINE>double var = 0;<NEW_LINE>for (double s : speeds) {<NEW_LINE>var += (s - avgSpeed) * (s - avgSpeed);<NEW_LINE>}<NEW_LINE>result.mTotalDurationSeconds = totalDuration;<NEW_LINE>result.mTotalSizeBytes = totalSize;<NEW_LINE>result.mMaxSpeedMbps = maxSpeed;<NEW_LINE>result.mMinSpeedMbps = Double.compare(minSpeed, Double.<MASK><NEW_LINE>result.mAvgSpeedMbps = avgSpeed;<NEW_LINE>result.mStdDev = Math.sqrt(var);<NEW_LINE>return result;<NEW_LINE>}
MAX_VALUE) == 0 ? 0.0 : minSpeed;
1,087,637
public void testTimerAccessFromTimeoutAfterCancel() throws Exception {<NEW_LINE>NpTimedObjectTimerLocal timerBean;<NEW_LINE>// --------------------------------------------------------------------<NEW_LINE>// Create a BMT Stateless Bean to test it<NEW_LINE>// --------------------------------------------------------------------<NEW_LINE>svLogger.info("Creating a BMT Stateless Bean to execute test ..." + NL);<NEW_LINE>timerBean = lookupBean(svJndi_SLBMT);<NEW_LINE>svLogger.info("Calling prepAccessAfterCancelTest() ... ");<NEW_LINE>timerBean.prepAccessAfterCancelTest(NpTimedObjectTimerBean.infoAccessAfterCancel);<NEW_LINE>timerBean.cancelAccessAfterCancelTimer().countDown();<NEW_LINE>timerBean.waitForTimer(WAIT_FOR_TIMER_RUN);<NEW_LINE>assertEquals("Unexpected timer result", NpTimedObjectTimerBean.infoAccessAfterCancel, NpTimedObjectTimerBean.svAccessAfterCreateResult);<NEW_LINE>// --------------------------------------------------------------------<NEW_LINE>// Create a CMT RequiresNew Stateless Bean to test it<NEW_LINE>// --------------------------------------------------------------------<NEW_LINE>svLogger.info("Creating a CMT RequiresNew Stateless Bean to execute test ..." + NL);<NEW_LINE>timerBean = lookupBean(svJndi_SLRequiresNew);<NEW_LINE>svLogger.info("Calling prepAccessAfterCancelTest() ... ");<NEW_LINE>timerBean.prepAccessAfterCancelTest(NpTimedObjectTimerBean.infoAccessAfterCancel);<NEW_LINE>timerBean.cancelAccessAfterCancelTimer().countDown();<NEW_LINE>timerBean.waitForTimer(WAIT_FOR_TIMER_RUN);<NEW_LINE>assertEquals("Unexpected timer result", NpTimedObjectTimerBean.infoAccessAfterCancel, NpTimedObjectTimerBean.svAccessAfterCreateResult);<NEW_LINE>// --------------------------------------------------------------------<NEW_LINE>// Create a CMT Required Stateless Bean to test it<NEW_LINE>// --------------------------------------------------------------------<NEW_LINE>svLogger.info("Creating a CMT Required Stateless Bean to execute test ..." + NL);<NEW_LINE>timerBean = lookupBean(svJndi_SLRequired);<NEW_LINE>svLogger.info("Calling prepAccessAfterCancelTest() ... ");<NEW_LINE>timerBean.prepAccessAfterCancelTest(NpTimedObjectTimerBean.infoAccessAfterCancel);<NEW_LINE>timerBean.cancelAccessAfterCancelTimer().countDown();<NEW_LINE>timerBean.waitForTimer(WAIT_FOR_TIMER_RUN);<NEW_LINE>assertEquals("Unexpected timer result", NpTimedObjectTimerBean.infoAccessAfterCancel, NpTimedObjectTimerBean.svAccessAfterCreateResult);<NEW_LINE>// --------------------------------------------------------------------<NEW_LINE>// Create a CMT NotSupported Stateless Bean to test it<NEW_LINE>// --------------------------------------------------------------------<NEW_LINE>svLogger.info("Creating a CMT NotSupported Stateless Bean to execute test ..." + NL);<NEW_LINE>timerBean = lookupBean(svJndi_SLNotSupported);<NEW_LINE>svLogger.info("Calling prepAccessAfterCancelTest() ... ");<NEW_LINE><MASK><NEW_LINE>timerBean.cancelAccessAfterCancelTimer().countDown();<NEW_LINE>timerBean.waitForTimer(WAIT_FOR_TIMER_RUN);<NEW_LINE>assertEquals("Unexpected timer result", NpTimedObjectTimerBean.infoAccessAfterCancel, NpTimedObjectTimerBean.svAccessAfterCreateResult);<NEW_LINE>}
timerBean.prepAccessAfterCancelTest(NpTimedObjectTimerBean.infoAccessAfterCancel);
453,882
public Void call() throws Exception {<NEW_LINE>Calendar currentTime = Calendar.getInstance();<NEW_LINE>Date callDate = currentTime.getTime();<NEW_LINE>List<Result> resultsSoFar = getResultList();<NEW_LINE>int numberOfResults = resultsSoFar.size();<NEW_LINE>System.out.println("Task " + id + " call(" + numberOfResults + <MASK><NEW_LINE>if (myInstructions.size() > numberOfResults) {<NEW_LINE>Instruction currentInstruction = myInstructions.get(numberOfResults);<NEW_LINE>switch(currentInstruction) {<NEW_LINE>case SKIP:<NEW_LINE>resultsSoFar.add(new Result(callDate, Instruction.STATE_ERROR));<NEW_LINE>throw new Exception("State error");<NEW_LINE>case FAIL:<NEW_LINE>resultsSoFar.add(new Result(callDate, Instruction.FAIL));<NEW_LINE>throw new Exception(ProgrammableTriggerTask.FAILURE_MESSAGE);<NEW_LINE>case PASS:<NEW_LINE>resultsSoFar.add(new Result(callDate, Instruction.PASS));<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>throw new Exception("I was driven too many times");<NEW_LINE>}
") " + currentTime.getTime());
1,176,645
public static void copyFile(final File srcFile, final File destFile, final boolean preserveFileDate) throws IOException {<NEW_LINE>if (srcFile == null) {<NEW_LINE>throw new NullPointerException("Source must not be null");<NEW_LINE>}<NEW_LINE>if (destFile == null) {<NEW_LINE>throw new NullPointerException("Destination must not be null");<NEW_LINE>}<NEW_LINE>if (!srcFile.exists()) {<NEW_LINE>throw new FileNotFoundException("Source '" + srcFile + "' does not exist");<NEW_LINE>}<NEW_LINE>if (srcFile.isDirectory()) {<NEW_LINE>throw new <MASK><NEW_LINE>}<NEW_LINE>if (srcFile.getCanonicalPath().equals(destFile.getCanonicalPath())) {<NEW_LINE>throw new IOException("Source '" + srcFile + "' and destination '" + destFile + "' are the same");<NEW_LINE>}<NEW_LINE>final File parentFile = destFile.getParentFile();<NEW_LINE>if (parentFile != null) {<NEW_LINE>if (!parentFile.mkdirs() && !parentFile.isDirectory()) {<NEW_LINE>throw new IOException("Destination '" + parentFile + "' directory cannot be created");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (destFile.exists() && !destFile.canWrite()) {<NEW_LINE>throw new IOException("Destination '" + destFile + "' exists but is read-only");<NEW_LINE>}<NEW_LINE>doCopyFile(srcFile, destFile, preserveFileDate);<NEW_LINE>}
IOException("Source '" + srcFile + "' exists but is a directory");
664,513
public void log(Logger useLogger) {<NEW_LINE>String methodName = "log";<NEW_LINE>useLogger.logp(Level.FINER, CLASS_NAME, methodName, "BiDi Map (Empty): BEGIN: [ {0} ]", getHashText());<NEW_LINE>useLogger.logp(Level.<MASK><NEW_LINE>holderInternMap.log(useLogger);<NEW_LINE>useLogger.logp(Level.FINER, CLASS_NAME, methodName, "Held Intern Map:");<NEW_LINE>heldInternMap.log(useLogger);<NEW_LINE>useLogger.logp(Level.FINER, CLASS_NAME, methodName, "Holder-to-held Map: [ NULL ]");<NEW_LINE>useLogger.logp(Level.FINER, CLASS_NAME, methodName, "Held-to-holder Map: [ NULL ]");<NEW_LINE>useLogger.logp(Level.FINER, CLASS_NAME, methodName, "BiDi Map (Empty): END: [ {0} ]", getHashText());<NEW_LINE>}
FINER, CLASS_NAME, methodName, "Holder Intern Map:");
168,376
private String storageOverhead(Map<Integer, Integer> finalNodeToOverhead) {<NEW_LINE>double maxOverhead = Double.MIN_VALUE;<NEW_LINE>PartitionBalance pb = new PartitionBalance(currentCluster, currentStoreDefs);<NEW_LINE>StringBuilder sb = new StringBuilder();<NEW_LINE>sb.append("Per-node store-overhead:").append(Utils.NEWLINE);<NEW_LINE>DecimalFormat doubleDf = new DecimalFormat("####.##");<NEW_LINE>for (int nodeId : finalCluster.getNodeIds()) {<NEW_LINE>Node node = finalCluster.getNodeById(nodeId);<NEW_LINE>String nodeTag = "Node " + String.format("%4d", nodeId) + " (" + node.getHost() + ")";<NEW_LINE>int initialLoad = 0;<NEW_LINE>if (currentCluster.getNodeIds().contains(nodeId)) {<NEW_LINE>initialLoad = pb.getNaryPartitionCount(nodeId);<NEW_LINE>}<NEW_LINE>int toLoad = 0;<NEW_LINE>if (finalNodeToOverhead.containsKey(nodeId)) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>double overhead = (initialLoad + toLoad) / (double) initialLoad;<NEW_LINE>if (initialLoad > 0 && maxOverhead < overhead) {<NEW_LINE>maxOverhead = overhead;<NEW_LINE>}<NEW_LINE>String loadTag = String.format("%6d", initialLoad) + " + " + String.format("%6d", toLoad) + " -> " + String.format("%6d", initialLoad + toLoad) + " (" + doubleDf.format(overhead) + " X)";<NEW_LINE>sb.append(nodeTag + " : " + loadTag).append(Utils.NEWLINE);<NEW_LINE>}<NEW_LINE>sb.append(Utils.NEWLINE).append("**** Max per-node storage overhead: " + doubleDf.format(maxOverhead) + " X.").append(Utils.NEWLINE);<NEW_LINE>return (sb.toString());<NEW_LINE>}
toLoad = finalNodeToOverhead.get(nodeId);
727,848
private void initListeners() {<NEW_LINE>ddListener = new PropertyChangeListener() {<NEW_LINE><NEW_LINE>public void propertyChange(PropertyChangeEvent evt) {<NEW_LINE>String propertyName = evt.getPropertyName();<NEW_LINE>Object newValue = evt.getNewValue();<NEW_LINE>Object oldValue = evt.getOldValue();<NEW_LINE>if (ClientDataObject.PROP_DOCUMENT_DTD.equals(propertyName)) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>if (ClientDataObject.PROP_VALID.equals(propertyName) && Boolean.TRUE.equals(newValue)) {<NEW_LINE>removePropertyChangeListener(ClientDataNode.this.ddListener);<NEW_LINE>}<NEW_LINE>if (Node.PROP_PROPERTY_SETS.equals(propertyName)) {<NEW_LINE>firePropertySetsChange(null, null);<NEW_LINE>}<NEW_LINE>if (XmlMultiViewDataObject.PROP_SAX_ERROR.equals(propertyName)) {<NEW_LINE>fireShortDescriptionChange((String) oldValue, (String) newValue);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>};<NEW_LINE>getDataObject().addPropertyChangeListener(ddListener);<NEW_LINE>}
firePropertyChange(PROPERTY_DOCUMENT_TYPE, oldValue, newValue);
513,621
public final WeekPartContext weekPart() throws RecognitionException {<NEW_LINE>WeekPartContext _localctx = new WeekPartContext(_ctx, getState());<NEW_LINE>enterRule(_localctx, 488, RULE_weekPart);<NEW_LINE>int _la;<NEW_LINE>try {<NEW_LINE>enterOuterAlt(_localctx, 1);<NEW_LINE>{<NEW_LINE>setState(3262);<NEW_LINE>_errHandler.sync(this);<NEW_LINE>switch(_input.LA(1)) {<NEW_LINE>case PLUS:<NEW_LINE>case MINUS:<NEW_LINE>case IntegerLiteral:<NEW_LINE>case FloatingPointLiteral:<NEW_LINE>{<NEW_LINE>setState(3259);<NEW_LINE>numberconstant();<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>case IDENT:<NEW_LINE>{<NEW_LINE>setState(3260);<NEW_LINE>((WeekPartContext) _localctx).i = match(IDENT);<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>case QUESTION:<NEW_LINE>{<NEW_LINE>setState(3261);<NEW_LINE>substitution();<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>throw new NoViableAltException(this);<NEW_LINE>}<NEW_LINE>setState(3264);<NEW_LINE>_la = _input.LA(1);<NEW_LINE>if (!(_la == TIMEPERIOD_WEEK || _la == TIMEPERIOD_WEEKS)) {<NEW_LINE>_errHandler.recoverInline(this);<NEW_LINE>} else {<NEW_LINE>if (_input.LA(1) == Token.EOF)<NEW_LINE>matchedEOF = true;<NEW_LINE>_errHandler.reportMatch(this);<NEW_LINE>consume();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (RecognitionException re) {<NEW_LINE>_localctx.exception = re;<NEW_LINE><MASK><NEW_LINE>_errHandler.recover(this, re);<NEW_LINE>} finally {<NEW_LINE>exitRule();<NEW_LINE>}<NEW_LINE>return _localctx;<NEW_LINE>}
_errHandler.reportError(this, re);
1,654,470
public AsyncIterator<String> listScopes() {<NEW_LINE>Exceptions.checkNotClosed(closed.get(), this);<NEW_LINE>long traceId = LoggerHelpers.traceEnter(log, "listScopes");<NEW_LINE><MASK><NEW_LINE>try {<NEW_LINE>final Function<ContinuationToken, CompletableFuture<Map.Entry<ContinuationToken, Collection<String>>>> function = token -> this.retryConfig.runAsync(() -> {<NEW_LINE>RPCAsyncCallback<ScopesResponse> callback = new RPCAsyncCallback<>(requestId, "listScopes");<NEW_LINE>new ControllerClientTagger(client, timeoutMillis).withTag(requestId, LIST_SCOPES).listScopes(ScopesRequest.newBuilder().setContinuationToken(token).build(), callback);<NEW_LINE>return callback.getFuture().thenApplyAsync(x -> {<NEW_LINE>List<String> result = x.getScopesList();<NEW_LINE>return new AbstractMap.SimpleEntry<>(x.getContinuationToken(), result);<NEW_LINE>}, this.executor);<NEW_LINE>}, this.executor);<NEW_LINE>return new ContinuationTokenAsyncIterator<>(function, ContinuationToken.newBuilder().build());<NEW_LINE>} finally {<NEW_LINE>LoggerHelpers.traceLeave(log, "listStreams", traceId);<NEW_LINE>}<NEW_LINE>}
long requestId = requestIdGenerator.get();
146,921
public static void RomListAddItem(String FullFileName, String FileName, String GoodName, int TextColor) {<NEW_LINE>GalleryItem item = new GalleryItem(mActiveGalleryActivity, GoodName, FileName, FullFileName, TextColor);<NEW_LINE>mGalleryItems.add(item);<NEW_LINE>if (mActiveGalleryActivity != null && mActiveGalleryActivity.mProgress != null) {<NEW_LINE>Handler h = new Handler(Looper.getMainLooper());<NEW_LINE>final <MASK><NEW_LINE>final String ProgressSubText = new String(FullFileName);<NEW_LINE>final String ProgressMessage = new String("Added " + GoodName);<NEW_LINE>h.post(new Runnable() {<NEW_LINE><NEW_LINE>public void run() {<NEW_LINE>mActiveGalleryActivity.mProgress.setText(ProgressText);<NEW_LINE>mActiveGalleryActivity.mProgress.setSubtext(ProgressSubText);<NEW_LINE>mActiveGalleryActivity.mProgress.setMessage(ProgressMessage);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}<NEW_LINE>}
String ProgressText = new String(FileName);
1,293,144
public boolean checkTrigger(GameEvent event, Game game) {<NEW_LINE>Permanent sourcePermanent = game.getPermanentOrLKIBattlefield(this.getSourceId());<NEW_LINE>if (sourcePermanent != null) {<NEW_LINE>Permanent attachedTo = game.getPermanentOrLKIBattlefield(sourcePermanent.getAttachedTo());<NEW_LINE>if (event.getSourceId().equals(attachedTo.getId())) {<NEW_LINE>Permanent blocked = game.getPermanent(event.getTargetId());<NEW_LINE>if (blocked != null && filter.match(blocked, game)) {<NEW_LINE>this.getEffects().setTargetPointer(new FixedTarget(event<MASK><NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (event.getTargetId().equals(attachedTo.getId())) {<NEW_LINE>Permanent blocker = game.getPermanent(event.getSourceId());<NEW_LINE>if (blocker != null) {<NEW_LINE>this.getEffects().setTargetPointer(new FixedTarget(event.getSourceId(), game));<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>}
.getTargetId(), game));
1,095,222
public Clustering improveClustering(Clustering clustering) {<NEW_LINE>if (instanceBeingClustered == -1)<NEW_LINE>sampleNextInstanceToCluster(clustering);<NEW_LINE>int clusterIndex = clustering.getLabel(instanceBeingClustered);<NEW_LINE>double bestScore = Double.NEGATIVE_INFINITY;<NEW_LINE>int clusterToMerge = -1;<NEW_LINE>int instanceToMerge = -1;<NEW_LINE>for (int i = 0; i < unclusteredInstances.size(); i++) {<NEW_LINE>int neighbor = unclusteredInstances.get(i);<NEW_LINE>int neighborCluster = clustering.getLabel(neighbor);<NEW_LINE>double score = getScore(clustering, clusterIndex, neighborCluster);<NEW_LINE>if (score > bestScore) {<NEW_LINE>bestScore = score;<NEW_LINE>clusterToMerge = neighborCluster;<NEW_LINE>instanceToMerge = neighbor;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (bestScore < stoppingThreshold) {<NEW_LINE>// Move on to next instance to cluster.<NEW_LINE>sampleNextInstanceToCluster(clustering);<NEW_LINE>if (instanceBeingClustered != -1 && unclusteredInstances.size() != 0)<NEW_LINE>return improveClustering(clustering);<NEW_LINE>else {<NEW_LINE>// Converged and no more instances to cluster.<NEW_LINE>if (doPostConvergenceMerges) {<NEW_LINE>throw new UnsupportedOperationException("PostConvergenceMerges not yet implemented.");<NEW_LINE>}<NEW_LINE>converged = true;<NEW_LINE>progressLogger.info("Converged with score " + bestScore);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>// Merge and continue.<NEW_LINE>progressLogger.info("Merging " + clusterIndex + "(" + clustering.size(clusterIndex) + " nodes) and " + clusterToMerge + "(" + clustering.size(clusterToMerge) + " nodes) [" + bestScore + <MASK><NEW_LINE>updateScoreMatrix(clustering, clusterIndex, clusterToMerge);<NEW_LINE>unclusteredInstances.remove(unclusteredInstances.indexOf(instanceToMerge));<NEW_LINE>clustering = ClusterUtils.mergeClusters(clustering, clusterIndex, clusterToMerge);<NEW_LINE>}<NEW_LINE>return clustering;<NEW_LINE>}
"] numClusters=" + clustering.getNumClusters());
1,684,431
protected void mutate(BackendAction item) {<NEW_LINE>BackendEntry e = item.entry();<NEW_LINE>assert e instanceof TextBackendEntry;<NEW_LINE>TextBackendEntry entry = (TextBackendEntry) e;<NEW_LINE>InMemoryDBTable table = this.table(entry.type());<NEW_LINE>switch(item.action()) {<NEW_LINE>case INSERT:<NEW_LINE>LOG.debug("[store {}] add entry: {}", this.store, entry);<NEW_LINE>table.insert(null, entry);<NEW_LINE>break;<NEW_LINE>case DELETE:<NEW_LINE>LOG.debug("[store {}] remove id: {}", this.store, entry.id());<NEW_LINE>table.delete(null, entry);<NEW_LINE>break;<NEW_LINE>case APPEND:<NEW_LINE>LOG.debug("[store {}] append entry: {}", this.store, entry);<NEW_LINE><MASK><NEW_LINE>break;<NEW_LINE>case ELIMINATE:<NEW_LINE>LOG.debug("[store {}] eliminate entry: {}", this.store, entry);<NEW_LINE>table.eliminate(null, entry);<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>throw new BackendException("Unsupported mutate type: %s", item.action());<NEW_LINE>}<NEW_LINE>}
table.append(null, entry);
395,167
public static void partialReduceIntMult(int[] inputArray, int[] outputArray, int gidx) {<NEW_LINE>int localIdx = OpenCLIntrinsics.get_local_id(0);<NEW_LINE>int <MASK><NEW_LINE>int groupID = OpenCLIntrinsics.get_group_id(0);<NEW_LINE>int[] localArray = (int[]) NewArrayNode.newUninitializedArray(int.class, LOCAL_WORK_GROUP_SIZE);<NEW_LINE>localArray[localIdx] = inputArray[gidx];<NEW_LINE>for (int stride = (localGroupSize / 2); stride > 0; stride /= 2) {<NEW_LINE>OpenCLIntrinsics.localBarrier();<NEW_LINE>if (localIdx < stride) {<NEW_LINE>localArray[localIdx] *= localArray[localIdx + stride];<NEW_LINE>}<NEW_LINE>}<NEW_LINE>OpenCLIntrinsics.globalBarrier();<NEW_LINE>if (localIdx == 0) {<NEW_LINE>outputArray[groupID + 1] = localArray[0];<NEW_LINE>}<NEW_LINE>}
localGroupSize = OpenCLIntrinsics.get_local_size(0);
982,986
public soot.Value eval(Body b) {<NEW_LINE>if (type().isString() && isConstant())<NEW_LINE>return soot.jimple.StringConstant.v(constant().stringValue());<NEW_LINE>if (isStringAdd()) {<NEW_LINE>Local v;<NEW_LINE>if (firstStringAddPart()) {<NEW_LINE>// new StringBuffer<NEW_LINE>v = b.newTemp(b.newNewExpr(lookupType("java.lang", "StringBuffer").sootRef(), this));<NEW_LINE>b.setLine(this);<NEW_LINE>b.add(b.newInvokeStmt(b.newSpecialInvokeExpr(v, Scene.v().getMethod("<java.lang.StringBuffer: void <init>()>").makeRef(), this), this));<NEW_LINE>b.setLine(this);<NEW_LINE>b.add(b.newInvokeStmt(b.newVirtualInvokeExpr(v, lookupType("java.lang", "StringBuffer").methodWithArgs("append", new TypeDecl[] { getLeftOperand().type().stringPromotion() }).sootRef(), asImmediate(b, getLeftOperand().eval(b)), this), this));<NEW_LINE>} else<NEW_LINE>v = (Local) <MASK><NEW_LINE>// append<NEW_LINE>b.setLine(this);<NEW_LINE>b.add(b.newInvokeStmt(b.newVirtualInvokeExpr(v, lookupType("java.lang", "StringBuffer").methodWithArgs("append", new TypeDecl[] { getRightOperand().type().stringPromotion() }).sootRef(), asImmediate(b, getRightOperand().eval(b)), this), this));<NEW_LINE>if (lastStringAddPart()) {<NEW_LINE>return b.newTemp(b.newVirtualInvokeExpr(v, Scene.v().getMethod("<java.lang.StringBuffer: java.lang.String toString()>").makeRef(), this));<NEW_LINE>} else<NEW_LINE>return v;<NEW_LINE>} else<NEW_LINE>return b.newAddExpr(// Binary numeric promotion<NEW_LINE>b.// Binary numeric promotion<NEW_LINE>newTemp(// Binary numeric promotion<NEW_LINE>getLeftOperand().type().// Binary numeric promotion<NEW_LINE>emitCastTo(b, getLeftOperand(), type())), // Binary numeric promotion<NEW_LINE>asImmediate(// Binary numeric promotion<NEW_LINE>b, // Binary numeric promotion<NEW_LINE>getRightOperand().type().// Binary numeric promotion<NEW_LINE>emitCastTo(b, getRightOperand(), type())), this);<NEW_LINE>}
getLeftOperand().eval(b);
1,293,810
public void updateAndConnect(ConnectionModel model) {<NEW_LINE>Map<String, Connection> connections = Connections.getInstance(this).getConnections();<NEW_LINE>Log.i(TAG, "Updating connection: " + connections.keySet().toString());<NEW_LINE>try {<NEW_LINE>Connection connection = connections.get(model.getClientHandle());<NEW_LINE>// First disconnect the current instance of this connection<NEW_LINE>if (connection.isConnected()) {<NEW_LINE>connection.changeConnectionStatus(Connection.ConnectionStatus.DISCONNECTING);<NEW_LINE>connection.getClient().disconnect();<NEW_LINE>}<NEW_LINE>// Update the connection.<NEW_LINE>connection.updateConnection(model.getClientId(), model.getServerHostName(), model.getServerPort(), model.isTlsConnection());<NEW_LINE>connection.changeConnectionStatus(Connection.ConnectionStatus.CONNECTING);<NEW_LINE>String[] actionArgs = new String[1];<NEW_LINE>actionArgs[0] = model.getClientId();<NEW_LINE>final ActionListener callback = new ActionListener(this, ActionListener.Action.CONNECT, connection, actionArgs);<NEW_LINE>connection.getClient().setCallback(new MqttCallbackHandler(this, model.getClientHandle()));<NEW_LINE>connection.getClient().setTraceCallback(new MqttTraceCallback());<NEW_LINE>MqttConnectOptions connOpts = optionsFromModel(model);<NEW_LINE>connection.addConnectionOptions(connOpts);<NEW_LINE>Connections.getInstance(this).updateConnection(connection);<NEW_LINE>drawerFragment.updateConnection(connection);<NEW_LINE>connection.getClient().connect(connOpts, null, callback);<NEW_LINE>Fragment fragment = new ConnectionFragment();<NEW_LINE>Bundle bundle = new Bundle();<NEW_LINE>bundle.putString(ActivityConstants.CONNECTION_KEY, connection.handle());<NEW_LINE>fragment.setArguments(bundle);<NEW_LINE><MASK><NEW_LINE>displayFragment(fragment, title);<NEW_LINE>} catch (MqttException ex) {<NEW_LINE>Log.e(TAG, "Exception occurred updating connection: " + connections.keySet().toString() + " : " + ex.getMessage());<NEW_LINE>}<NEW_LINE>}
String title = connection.getId();
992,850
private static EncodingType encodingFromElement(Element element) throws Exception {<NEW_LINE>EncodingType result = new EncodingType();<NEW_LINE>if (!ENCODING_ELEMENT.equals(element.getLocalName()) || !NAMESPACE.equals(getNamespaceUri(element))) {<NEW_LINE>throw new Exception("encoding element is invalid");<NEW_LINE>}<NEW_LINE>// Process attributes<NEW_LINE>NamedNodeMap attributes = element.getAttributes();<NEW_LINE>for (int i = 0; i < attributes.getLength(); i++) {<NEW_LINE>Attr attribute = (Attr) attributes.item(i);<NEW_LINE>String namespaceUri = getNamespaceUri(attribute);<NEW_LINE>if (namespaceUri == null) {<NEW_LINE>throw new Exception("encoding element is invalid");<NEW_LINE>}<NEW_LINE>if (isStandartXmlNamespace(namespaceUri)) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (NAMESPACE.equals(namespaceUri)) {<NEW_LINE>throw new Exception("encoding element is invalid");<NEW_LINE>}<NEW_LINE>QName qName = new QName(namespaceUri, attribute.getLocalName(), attribute.getPrefix() == null ? "" : attribute.getPrefix());<NEW_LINE>result.getAnyAttributes().put(<MASK><NEW_LINE>}<NEW_LINE>// Process elements<NEW_LINE>NodeList childNodes = element.getChildNodes();<NEW_LINE>for (int i = 0; i < childNodes.getLength(); i++) {<NEW_LINE>Node node = childNodes.item(i);<NEW_LINE>if (node.getNodeType() == Node.ELEMENT_NODE) {<NEW_LINE>throw new Exception("encoding element is invalid");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>result.setValue(element.getTextContent());<NEW_LINE>return result;<NEW_LINE>}
qName, attribute.getValue());
282,603
private static // to be assigned<NEW_LINE>boolean assertNoDanglingSnapshots(ClusterState state) {<NEW_LINE>final SnapshotsInProgress snapshotsInProgress = state.custom(SnapshotsInProgress.TYPE, SnapshotsInProgress.EMPTY);<NEW_LINE>final SnapshotDeletionsInProgress snapshotDeletionsInProgress = state.custom(SnapshotDeletionsInProgress.TYPE, SnapshotDeletionsInProgress.EMPTY);<NEW_LINE>final Set<String> reposWithRunningDelete = snapshotDeletionsInProgress.getEntries().stream().filter(entry -> entry.state() == SnapshotDeletionsInProgress.State.STARTED).map(SnapshotDeletionsInProgress.Entry::repository).<MASK><NEW_LINE>for (List<SnapshotsInProgress.Entry> repoEntry : snapshotsInProgress.entriesByRepo()) {<NEW_LINE>final SnapshotsInProgress.Entry entry = repoEntry.get(0);<NEW_LINE>for (ShardSnapshotStatus value : entry.shardsByRepoShardId().values()) {<NEW_LINE>if (value.equals(ShardSnapshotStatus.UNASSIGNED_QUEUED)) {<NEW_LINE>assert reposWithRunningDelete.contains(entry.repository()) : "Found shard snapshot waiting to be assigned in [" + entry + "] but it is not blocked by any running delete";<NEW_LINE>} else if (value.isActive()) {<NEW_LINE>assert reposWithRunningDelete.contains(entry.repository()) == false : "Found shard snapshot actively executing in [" + entry + "] when it should be blocked by a running delete [" + Strings.toString(snapshotDeletionsInProgress) + "]";<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>}
collect(Collectors.toSet());
789,587
private CloseableIterable<ManifestEntry<DataFile>> deletedDataFiles(TableMetadata base, Long startingSnapshotId, Expression dataFilter, PartitionSet partitionSet) {<NEW_LINE>// if there is no current table state, no files have been deleted<NEW_LINE>if (base.currentSnapshot() == null) {<NEW_LINE>return CloseableIterable.empty();<NEW_LINE>}<NEW_LINE>Pair<List<ManifestFile>, Set<Long>> history = validationHistory(base, startingSnapshotId, VALIDATE_DATA_FILES_EXIST_OPERATIONS, ManifestContent.DATA);<NEW_LINE>List<ManifestFile> manifests = history.first();<NEW_LINE>Set<Long> newSnapshots = history.second();<NEW_LINE>ManifestGroup manifestGroup = new ManifestGroup(ops.io(), manifests, ImmutableList.of()).caseSensitive(caseSensitive).filterManifestEntries(entry -> newSnapshots.contains(entry.snapshotId())).filterManifestEntries(entry -> entry.status().equals(ManifestEntry.Status.DELETED)).specsById(base.specsById()).ignoreExisting();<NEW_LINE>if (dataFilter != null) {<NEW_LINE>manifestGroup = manifestGroup.filterData(dataFilter);<NEW_LINE>}<NEW_LINE>if (partitionSet != null) {<NEW_LINE>manifestGroup = manifestGroup.filterManifestEntries(entry -> partitionSet.contains(entry.file().specId(), entry.file<MASK><NEW_LINE>}<NEW_LINE>return manifestGroup.entries();<NEW_LINE>}
().partition()));
647,111
public List<Community> findAuthorizedByGroup(Context context, EPerson ePerson, List<Integer> actions) throws SQLException {<NEW_LINE>StringBuilder query = new StringBuilder();<NEW_LINE>query.append("select c from Community c join c.resourcePolicies rp join rp.epersonGroup rpGroup WHERE ");<NEW_LINE>for (int i = 0; i < actions.size(); i++) {<NEW_LINE>Integer action = actions.get(i);<NEW_LINE>if (i != 0) {<NEW_LINE>query.append(" AND ");<NEW_LINE>}<NEW_LINE>query.append<MASK><NEW_LINE>}<NEW_LINE>query.append(" AND rp.resourceTypeId=").append(Constants.COMMUNITY);<NEW_LINE>query.append(" AND rp.epersonGroup.id IN (select g.id from Group g where (from EPerson e where e.id = :eperson_id) in " + "elements(epeople))");<NEW_LINE>Query persistenceQuery = createQuery(context, query.toString());<NEW_LINE>persistenceQuery.setParameter("eperson_id", ePerson.getID());<NEW_LINE>persistenceQuery.setHint("org.hibernate.cacheable", Boolean.TRUE);<NEW_LINE>return list(persistenceQuery);<NEW_LINE>}
("rp.actionId=").append(action);
1,666,099
public void writeExternal(Element element) throws WriteExternalException {<NEW_LINE>ConfigurationState state = new ConfigurationState();<NEW_LINE>state.myServerName = myServerName;<NEW_LINE>if (myDeploymentSource != null) {<NEW_LINE>DeploymentSourceType type = myDeploymentSource.getType();<NEW_LINE>Element deploymentTag = new Element("deployment").setAttribute(<MASK><NEW_LINE>type.save(myDeploymentSource, deploymentTag);<NEW_LINE>if (myDeploymentConfiguration != null) {<NEW_LINE>Object configurationState = myDeploymentConfiguration.getSerializer().getState();<NEW_LINE>if (configurationState != null) {<NEW_LINE>Element settingsTag = new Element(SETTINGS_ELEMENT);<NEW_LINE>XmlSerializer.serializeInto(configurationState, settingsTag, SERIALIZATION_FILTERS);<NEW_LINE>deploymentTag.addContent(settingsTag);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>state.myDeploymentTag = deploymentTag;<NEW_LINE>}<NEW_LINE>XmlSerializer.serializeInto(state, element, SERIALIZATION_FILTERS);<NEW_LINE>super.writeExternal(element);<NEW_LINE>}
DEPLOYMENT_SOURCE_TYPE_ATTRIBUTE, type.getId());
682,119
private final void decrypt() throws InvalidTokenException {<NEW_LINE>byte[] tokenData;<NEW_LINE>try {<NEW_LINE>tokenData = LTPAKeyUtil.decrypt(encryptedBytes.clone(), sharedKey, cipher);<NEW_LINE>checkTokenBytes(tokenData);<NEW_LINE>String UTF8TokenString = toUTF8String(tokenData);<NEW_LINE>String[] userFields = LTPATokenizer.parseToken(UTF8TokenString);<NEW_LINE>Map<String, ArrayList<String>> attribs = LTPATokenizer.parseUserData(userFields[0]);<NEW_LINE>userData = new UserData(attribs);<NEW_LINE>String tokenString = toSimpleString(tokenData);<NEW_LINE>String[] fields = LTPATokenizer.parseToken(tokenString);<NEW_LINE>String[] expirationArray = userData.getAttributes(AttributeNameConstants.WSTOKEN_EXPIRATION);<NEW_LINE>if (expirationArray != null && expirationArray[expirationArray.length - 1] != null) {<NEW_LINE>// the new expiration value inside the signature<NEW_LINE>expirationInMilliseconds = Long.parseLong(expirationArray[expirationArray.length - 1]);<NEW_LINE>} else {<NEW_LINE>// the old expiration value outside of the signature<NEW_LINE>expirationInMilliseconds = Long.parseLong(fields[1]);<NEW_LINE>}<NEW_LINE>byte[] signature = Base64Coder.base64Decode(Base64Coder.<MASK><NEW_LINE>setSignature(signature);<NEW_LINE>} catch (BadPaddingException e) {<NEW_LINE>if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled()) {<NEW_LINE>Tr.event(this, tc, "Caught BadPaddingException while decrypting token, this is only a critical problem if decryption should have worked.", e);<NEW_LINE>}<NEW_LINE>throw new InvalidTokenException(e.getMessage(), e);<NEW_LINE>} catch (Exception e) {<NEW_LINE>if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled()) {<NEW_LINE>Tr.event(this, tc, "Error decrypting; " + e);<NEW_LINE>}<NEW_LINE>throw new InvalidTokenException(e.getMessage(), e);<NEW_LINE>}<NEW_LINE>}
getBytes(fields[2]));
1,383,428
public void createAndSplitEntrySetMethod(ClassWriter cw, Map<String, BField> fields, String className, JvmCastGen jvmCastGen) {<NEW_LINE>MethodVisitor mv = cw.visitMethod(ACC_PUBLIC, "entrySet", RECORD_SET, RECORD_SET_MAP_ENTRY, null);<NEW_LINE>mv.visitCode();<NEW_LINE>int selfIndex = 0;<NEW_LINE>int entrySetVarIndex = 1;<NEW_LINE>mv.visitTypeInsn(NEW, LINKED_HASH_SET);<NEW_LINE>mv.visitInsn(DUP);<NEW_LINE>mv.visitMethodInsn(INVOKESPECIAL, LINKED_HASH_SET, JVM_INIT_METHOD, "()V", false);<NEW_LINE>mv.visitVarInsn(ASTORE, entrySetVarIndex);<NEW_LINE>if (!fields.isEmpty()) {<NEW_LINE>mv.visitVarInsn(ALOAD, selfIndex);<NEW_LINE><MASK><NEW_LINE>mv.visitMethodInsn(INVOKEVIRTUAL, className, "addEntry", LINKED_HASH_SET_OP, false);<NEW_LINE>splitEntrySetMethod(cw, fields, className, jvmCastGen);<NEW_LINE>}<NEW_LINE>// Add all from super.entrySet() to the current entry set.<NEW_LINE>mv.visitVarInsn(ALOAD, entrySetVarIndex);<NEW_LINE>mv.visitVarInsn(ALOAD, 0);<NEW_LINE>mv.visitMethodInsn(INVOKESPECIAL, LINKED_HASH_MAP, "entrySet", RECORD_SET, false);<NEW_LINE>mv.visitMethodInsn(INVOKEINTERFACE, SET, "addAll", ADD_COLLECTION, true);<NEW_LINE>mv.visitInsn(POP);<NEW_LINE>mv.visitVarInsn(ALOAD, entrySetVarIndex);<NEW_LINE>mv.visitInsn(ARETURN);<NEW_LINE>mv.visitMaxs(0, 0);<NEW_LINE>mv.visitEnd();<NEW_LINE>}
mv.visitVarInsn(ALOAD, entrySetVarIndex);
119,786
private <T> StructuredQuery exampleToQuery(Example<T> example, DatastoreQueryOptions queryOptions, boolean keyQuery) {<NEW_LINE>validateExample(example);<NEW_LINE>T probe = example.getProbe();<NEW_LINE>FullEntity.Builder<IncompleteKey> probeEntityBuilder = Entity.newBuilder();<NEW_LINE>this.datastoreEntityConverter.write(probe, probeEntityBuilder);<NEW_LINE>FullEntity<IncompleteKey> probeEntity = probeEntityBuilder.build();<NEW_LINE>DatastorePersistentEntity<?> persistentEntity = this.datastoreMappingContext.getPersistentEntity(example.getProbeType());<NEW_LINE>LinkedList<StructuredQuery.Filter> filters = new LinkedList<>();<NEW_LINE>NullHandler nullHandler = example.getMatcher().getNullHandler();<NEW_LINE>persistentEntity.doWithColumnBackedProperties((persistentProperty) -> {<NEW_LINE>if (!ignoredProperty(example, persistentProperty)) {<NEW_LINE>Value<?> value = getValue(example, probeEntity, persistentEntity, persistentProperty);<NEW_LINE>addFilter(nullHandler, filters, persistentProperty.getFieldName(), value);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>persistentEntity.doWithAssociations((AssociationHandler<DatastorePersistentProperty>) association -> {<NEW_LINE>PersistentPropertyAccessor<?> accessor = persistentEntity.<MASK><NEW_LINE>DatastorePersistentProperty property = association.getInverse();<NEW_LINE>Object value = accessor.getProperty(property);<NEW_LINE>Value<?> key = value == null ? NullValue.of() : KeyValue.of(objectToKeyFactory.getKeyFromObject(value, this.datastoreMappingContext.getPersistentEntity(value.getClass())));<NEW_LINE>addFilter(nullHandler, filters, property.getFieldName(), key);<NEW_LINE>});<NEW_LINE>StructuredQuery.Builder<?> builder = keyQuery ? Query.newKeyQueryBuilder() : Query.newEntityQueryBuilder();<NEW_LINE>builder.setKind(persistentEntity.kindName());<NEW_LINE>if (!filters.isEmpty()) {<NEW_LINE>builder.setFilter(StructuredQuery.CompositeFilter.and(filters.pop(), filters.toArray(new StructuredQuery.Filter[0])));<NEW_LINE>}<NEW_LINE>applyQueryOptions(builder, queryOptions, persistentEntity);<NEW_LINE>return builder.build();<NEW_LINE>}
getPropertyAccessor(example.getProbe());
265,579
public void write(org.apache.thrift.protocol.TProtocol prot, multi_get_response struct) throws org.apache.thrift.TException {<NEW_LINE>org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot;<NEW_LINE>java.util.BitSet optionals = new java.util.BitSet();<NEW_LINE>if (struct.isSetError()) {<NEW_LINE>optionals.set(0);<NEW_LINE>}<NEW_LINE>if (struct.isSetKvs()) {<NEW_LINE>optionals.set(1);<NEW_LINE>}<NEW_LINE>if (struct.isSetApp_id()) {<NEW_LINE>optionals.set(2);<NEW_LINE>}<NEW_LINE>if (struct.isSetPartition_index()) {<NEW_LINE>optionals.set(3);<NEW_LINE>}<NEW_LINE>if (struct.isSetServer()) {<NEW_LINE>optionals.set(4);<NEW_LINE>}<NEW_LINE>oprot.writeBitSet(optionals, 5);<NEW_LINE>if (struct.isSetError()) {<NEW_LINE>oprot.writeI32(struct.error);<NEW_LINE>}<NEW_LINE>if (struct.isSetKvs()) {<NEW_LINE>{<NEW_LINE>oprot.writeI32(<MASK><NEW_LINE>for (key_value _iter28 : struct.kvs) {<NEW_LINE>_iter28.write(oprot);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (struct.isSetApp_id()) {<NEW_LINE>oprot.writeI32(struct.app_id);<NEW_LINE>}<NEW_LINE>if (struct.isSetPartition_index()) {<NEW_LINE>oprot.writeI32(struct.partition_index);<NEW_LINE>}<NEW_LINE>if (struct.isSetServer()) {<NEW_LINE>oprot.writeString(struct.server);<NEW_LINE>}<NEW_LINE>}
struct.kvs.size());
1,598,658
public void startOneIndividualStreamRecording(Session session, Participant participant) {<NEW_LINE>Recording recording = this.sessionsRecordings.get(session.getSessionId());<NEW_LINE>if (recording == null) {<NEW_LINE>recording = this.sessionsRecordingsStarting.get(session.getSessionId());<NEW_LINE>if (recording == null) {<NEW_LINE>log.error("Cannot start recording of new stream {}. Session {} is not being recorded", participant.getPublisherStreamId(), session.getSessionId());<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (OutputMode.INDIVIDUAL.equals(recording.getOutputMode())) {<NEW_LINE>// Start new RecorderEndpoint for this stream<NEW_LINE>log.info("Starting new RecorderEndpoint in session {} for new stream of participant {}", session.getSessionId(), participant.getParticipantPublicId());<NEW_LINE>MediaProfileSpecType profile = null;<NEW_LINE>try {<NEW_LINE>profile = this.singleStreamRecordingService.generateMediaProfile(recording.getRecordingProperties(), participant);<NEW_LINE>} catch (OpenViduException e) {<NEW_LINE>log.error("Cannot start single stream recorder for stream {} in session {}: {}", participant.getPublisherStreamId(), session.getSessionId(<MASK><NEW_LINE>return;<NEW_LINE>}<NEW_LINE>this.singleStreamRecordingService.startRecorderEndpointForPublisherEndpoint(recording.getId(), profile, participant, new CountDownLatch(1));<NEW_LINE>} else if (RecordingUtils.IS_COMPOSED(recording.getOutputMode()) && !recording.hasVideo()) {<NEW_LINE>// Connect this stream to existing Composite recorder<NEW_LINE>log.info("Joining PublisherEndpoint to existing Composite in session {} for new stream of participant {}", session.getSessionId(), participant.getParticipantPublicId());<NEW_LINE>this.composedRecordingService.joinPublisherEndpointToComposite(session, recording.getId(), participant);<NEW_LINE>}<NEW_LINE>}
), e.getMessage());
960,888
private InternalImageProcessorResult process(Renderable renderer) throws JRException {<NEW_LINE>if (renderer instanceof ResourceRenderer) {<NEW_LINE>renderer = imageRenderersCache.getLoadedRenderer((ResourceRenderer) renderer);<NEW_LINE>}<NEW_LINE>// check dimension first, to avoid caching renderers that might not be used eventually, due to their dimension errors<NEW_LINE>Dimension2D dimension = null;<NEW_LINE>if (needDimension) {<NEW_LINE>DimensionRenderable dimensionRenderer = imageRenderersCache.getDimensionRenderable(renderer);<NEW_LINE>dimension = dimensionRenderer == null ? null : dimensionRenderer.getDimension(jasperReportsContext);<NEW_LINE>}<NEW_LINE>ExifOrientationEnum exifOrientation = ExifOrientationEnum.NORMAL;<NEW_LINE>String imagePath = null;<NEW_LINE>// if (image.isLazy()) //FIXMEDOCX learn how to link images<NEW_LINE>// {<NEW_LINE>//<NEW_LINE>// }<NEW_LINE>// else<NEW_LINE>// {<NEW_LINE>if (// we do not cache imagePath for non-data renderers because they render width different width/height each time<NEW_LINE>renderer instanceof DataRenderable && rendererToImagePathMap.containsKey(renderer.getId())) {<NEW_LINE>Pair<String, ExifOrientationEnum> imagePair = rendererToImagePathMap.get(renderer.getId());<NEW_LINE>imagePath = imagePair.first();<NEW_LINE>exifOrientation = imagePair.second();<NEW_LINE>} else {<NEW_LINE>JRPrintElementIndex imageIndex = getElementIndex(cell);<NEW_LINE>DataRenderable imageRenderer = getRendererUtil().getImageDataRenderable(imageRenderersCache, renderer, new Dimension(availableImageWidth, availableImageHeight), ModeEnum.OPAQUE == imageElement.getModeValue() ? imageElement.getBackcolor() : null);<NEW_LINE>byte[] imageData = imageRenderer.getData(jasperReportsContext);<NEW_LINE>exifOrientation = ImageUtil.getExifOrientation(imageData);<NEW_LINE>String fileExtension = JRTypeSniffer.<MASK><NEW_LINE>String imageName = IMAGE_NAME_PREFIX + imageIndex.toString() + (fileExtension == null ? "" : ("." + fileExtension));<NEW_LINE>// FIXMEDOCX optimize with a different implementation of entry<NEW_LINE>// FIXMEDOCX optimize with a different implementation of entry<NEW_LINE>docxZip.addEntry(new FileBufferedZipEntry("word/media/" + imageName, imageData));<NEW_LINE>relsHelper.exportImage(imageName);<NEW_LINE>imagePath = imageName;<NEW_LINE>// imagePath = "Pictures/" + imageName;<NEW_LINE>if (imageRenderer == renderer) {<NEW_LINE>// cache imagePath only for true ImageRenderable instances because the wrapping ones render with different width/height each time<NEW_LINE>rendererToImagePathMap.put(renderer.getId(), new Pair<>(imagePath, exifOrientation));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// }<NEW_LINE>return new InternalImageProcessorResult(imagePath, dimension, exifOrientation);<NEW_LINE>}
getImageTypeValue(imageData).getFileExtension();
1,326,448
private void addMutate(SourceBuilder code) {<NEW_LINE>code.addLine("").addLine("/**").addLine(" * Invokes {@code mutator} with the bimap to be returned from").addLine(" * %s.", datatype.getType().javadocNoArgMethodLink(property.getGetterName())).addLine(" *").addLine(" * <p>This method mutates the bimap in-place. {@code mutator} is a void").addLine(" * consumer, so any value returned from a lambda will be ignored. Take care").addLine(" * not to call pure functions, like %s.", Type.from(Collection.class).javadocNoArgMethodLink("stream")).addLine(" *").addLine(" * @return this {@code Builder} object").addLine(" * @throws NullPointerException if {@code mutator} is null").addLine(" */").addLine("public %s %s(%s mutator) {", datatype.getBuilder(), mutator(property), mutatorType.getFunctionalInterface());<NEW_LINE>if (overridesForcePutMethod) {<NEW_LINE>code.addLine(" mutator.%s(new %s<>(%s, this::%s));", mutatorType.getMethodName(), CheckedBiMap.TYPE, property.getField(), forcePutMethod(property));<NEW_LINE>} else {<NEW_LINE>code.addLine(" // If %s is overridden, this method will be updated to delegate to it", forcePutMethod(property)).addLine(" mutator.%s(%s);", mutatorType.getMethodName(), property.getField());<NEW_LINE>}<NEW_LINE>code.addLine(" return (%s) this;", datatype.getBuilder<MASK><NEW_LINE>}
()).addLine("}");
1,441,243
final ListNodesResult executeListNodes(ListNodesRequest listNodesRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(listNodesRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<ListNodesRequest> request = null;<NEW_LINE>Response<ListNodesResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new ListNodesRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(listNodesRequest));<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, "Kafka");<NEW_LINE>request.<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<ListNodesResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new ListNodesResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
addHandlerContext(HandlerContextKey.OPERATION_NAME, "ListNodes");
1,844,392
public void marshall(CallAnalyticsJobSummary callAnalyticsJobSummary, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (callAnalyticsJobSummary == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(callAnalyticsJobSummary.getCallAnalyticsJobName(), CALLANALYTICSJOBNAME_BINDING);<NEW_LINE>protocolMarshaller.marshall(<MASK><NEW_LINE>protocolMarshaller.marshall(callAnalyticsJobSummary.getStartTime(), STARTTIME_BINDING);<NEW_LINE>protocolMarshaller.marshall(callAnalyticsJobSummary.getCompletionTime(), COMPLETIONTIME_BINDING);<NEW_LINE>protocolMarshaller.marshall(callAnalyticsJobSummary.getLanguageCode(), LANGUAGECODE_BINDING);<NEW_LINE>protocolMarshaller.marshall(callAnalyticsJobSummary.getCallAnalyticsJobStatus(), CALLANALYTICSJOBSTATUS_BINDING);<NEW_LINE>protocolMarshaller.marshall(callAnalyticsJobSummary.getFailureReason(), FAILUREREASON_BINDING);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>}
callAnalyticsJobSummary.getCreationTime(), CREATIONTIME_BINDING);
377,650
public void marshall(CreateControlMappingSource createControlMappingSource, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (createControlMappingSource == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(createControlMappingSource.getSourceName(), SOURCENAME_BINDING);<NEW_LINE>protocolMarshaller.marshall(createControlMappingSource.getSourceDescription(), SOURCEDESCRIPTION_BINDING);<NEW_LINE>protocolMarshaller.marshall(<MASK><NEW_LINE>protocolMarshaller.marshall(createControlMappingSource.getSourceType(), SOURCETYPE_BINDING);<NEW_LINE>protocolMarshaller.marshall(createControlMappingSource.getSourceKeyword(), SOURCEKEYWORD_BINDING);<NEW_LINE>protocolMarshaller.marshall(createControlMappingSource.getSourceFrequency(), SOURCEFREQUENCY_BINDING);<NEW_LINE>protocolMarshaller.marshall(createControlMappingSource.getTroubleshootingText(), TROUBLESHOOTINGTEXT_BINDING);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>}
createControlMappingSource.getSourceSetUpOption(), SOURCESETUPOPTION_BINDING);
454,747
public DeleteRegistryResult unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>DeleteRegistryResult deleteRegistryResult = new DeleteRegistryResult();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return deleteRegistryResult;<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("RegistryName", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>deleteRegistryResult.setRegistryName(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("RegistryArn", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>deleteRegistryResult.setRegistryArn(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("Status", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>deleteRegistryResult.setStatus(context.getUnmarshaller(String.<MASK><NEW_LINE>}<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return deleteRegistryResult;<NEW_LINE>}
class).unmarshall(context));
346,123
public WormAnimation with(int coordinateStart, int coordinateEnd, int radius, boolean isRightSide) {<NEW_LINE>if (hasChanges(coordinateStart, coordinateEnd, radius, isRightSide)) {<NEW_LINE>animator = createAnimator();<NEW_LINE>this.coordinateStart = coordinateStart;<NEW_LINE>this.coordinateEnd = coordinateEnd;<NEW_LINE>this.radius = radius;<NEW_LINE>this.isRightSide = isRightSide;<NEW_LINE>rectLeftEdge = coordinateStart - radius;<NEW_LINE>rectRightEdge = coordinateStart + radius;<NEW_LINE>value.setRectStart(rectLeftEdge);<NEW_LINE>value.setRectEnd(rectRightEdge);<NEW_LINE>RectValues rect = createRectValues(isRightSide);<NEW_LINE>long duration = animationDuration / 2;<NEW_LINE>ValueAnimator straightAnimator = createWormAnimator(rect.fromX, rect.toX, duration, false, value);<NEW_LINE>ValueAnimator reverseAnimator = createWormAnimator(rect.reverseFromX, rect.reverseToX, duration, true, value);<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>return this;<NEW_LINE>}
animator.playSequentially(straightAnimator, reverseAnimator);
156,665
public void visit(BLangWaitExpr waitExpr, AnalyzerData data) {<NEW_LINE>data.expType = new BFutureType(TypeTags.FUTURE, data.expType, null);<NEW_LINE>checkExpr(waitExpr.getExpression(), data.expType, data);<NEW_LINE>// Handle union types in lhs<NEW_LINE>if (data.resultType.tag == TypeTags.UNION) {<NEW_LINE>LinkedHashSet<BType> memberTypes = collectMemberTypes((BUnionType) data.resultType, new LinkedHashSet<>());<NEW_LINE>if (memberTypes.size() == 1) {<NEW_LINE>data.resultType = memberTypes.toArray(new BType[0])[0];<NEW_LINE>} else {<NEW_LINE>data.resultType = BUnionType.create(null, memberTypes);<NEW_LINE>}<NEW_LINE>} else if (data.resultType != symTable.semanticError) {<NEW_LINE>// Handle other types except for semantic errors<NEW_LINE>data.resultType = ((BFutureType) data.resultType).constraint;<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>if (waitFutureExpression.getKind() == NodeKind.BINARY_EXPR) {<NEW_LINE>setEventualTypeForAlternateWaitExpression(waitFutureExpression, waitExpr.pos, data);<NEW_LINE>} else {<NEW_LINE>setEventualTypeForWaitExpression(waitFutureExpression, waitExpr.pos, data);<NEW_LINE>}<NEW_LINE>waitExpr.setBType(data.resultType);<NEW_LINE>if (data.resultType != null && data.resultType != symTable.semanticError) {<NEW_LINE>types.setImplicitCastExpr(waitExpr, waitExpr.getBType(), ((BFutureType) data.expType).constraint);<NEW_LINE>}<NEW_LINE>}
BLangExpression waitFutureExpression = waitExpr.getExpression();
1,043,257
private static byte[] postPutMultiPartBinary(int connectTimeout, int readTimeout, String address, String method, List<NameValuePair> heads, Collection<FormField> formFields, Collection<FilePart> fileParts) throws Exception {<NEW_LINE>HttpURLConnection connection = null;<NEW_LINE>String boundary = StringTools.TWO_HYPHENS + StringTools.TWO_HYPHENS + System.currentTimeMillis();<NEW_LINE>try {<NEW_LINE>URL url = new URL(address);<NEW_LINE>connection = (HttpURLConnection) url.openConnection();<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new ExceptionMultiPartBinary(e, connection);<NEW_LINE>}<NEW_LINE>byte[] bytes = null;<NEW_LINE>try (ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream()) {<NEW_LINE>if (null != fileParts) {<NEW_LINE>for (FilePart filePart : fileParts) {<NEW_LINE>writeFilePart(byteArrayOutputStream, filePart, boundary);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (null != formFields) {<NEW_LINE>for (FormField formField : formFields) {<NEW_LINE>writeFormField(byteArrayOutputStream, formField, boundary);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>IOUtils.write(StringTools.TWO_HYPHENS + boundary + StringTools.TWO_HYPHENS, byteArrayOutputStream, DefaultCharset.charset_utf_8);<NEW_LINE>bytes = byteArrayOutputStream.toByteArray();<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new ExceptionMultiPartBinary(e, connection);<NEW_LINE>}<NEW_LINE>addHeadsMultiPart(connection, heads, boundary);<NEW_LINE>connection.setRequestProperty(CONTENT_LENGTH, bytes.length + "");<NEW_LINE>connection.setRequestMethod(method);<NEW_LINE>connection.setUseCaches(false);<NEW_LINE>connection.setDoOutput(true);<NEW_LINE>connection.setDoInput(true);<NEW_LINE>connection.setConnectTimeout(connectTimeout);<NEW_LINE>connection.setReadTimeout(readTimeout);<NEW_LINE>try {<NEW_LINE>connection.connect();<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new ExceptionMultiPartBinary(e, connection);<NEW_LINE>}<NEW_LINE>try (OutputStream output = connection.getOutputStream()) {<NEW_LINE><MASK><NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new ExceptionMultiPartBinary(e, connection);<NEW_LINE>}<NEW_LINE>return readBinary(connection);<NEW_LINE>}
IOUtils.write(bytes, output);
1,851,314
final ModifyInstancePlacementResult executeModifyInstancePlacement(ModifyInstancePlacementRequest modifyInstancePlacementRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(modifyInstancePlacementRequest);<NEW_LINE><MASK><NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<ModifyInstancePlacementRequest> request = null;<NEW_LINE>Response<ModifyInstancePlacementResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new ModifyInstancePlacementRequestMarshaller().marshall(super.beforeMarshalling(modifyInstancePlacementRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "EC2");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ModifyInstancePlacement");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>StaxResponseHandler<ModifyInstancePlacementResult> responseHandler = new StaxResponseHandler<ModifyInstancePlacementResult>(new ModifyInstancePlacementResultStaxUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
614,251
public void renameCodeSnippets() {<NEW_LINE>// BEGIN: com.azure.storage.file.share.ShareDirectoryAsyncClient.rename#String<NEW_LINE>ShareDirectoryAsyncClient renamedClient = client.rename(destinationPath).block();<NEW_LINE>System.out.println("Directory Client has been renamed");<NEW_LINE>// END: com.azure.storage.file.share.ShareDirectoryAsyncClient.rename#String<NEW_LINE>// BEGIN: com.azure.storage.file.share.ShareDirectoryAsyncClient.renameWithResponse#ShareFileRenameOptions<NEW_LINE>FileSmbProperties smbProperties = new FileSmbProperties().setNtfsFileAttributes(EnumSet.of(NtfsFileAttributes.READ_ONLY)).setFileCreationTime(OffsetDateTime.now()).setFileLastWriteTime(OffsetDateTime.now()).setFilePermissionKey("filePermissionKey");<NEW_LINE>ShareFileRenameOptions options = new ShareFileRenameOptions(destinationPath).setDestinationRequestConditions(new ShareRequestConditions().setLeaseId(leaseId)).setSourceRequestConditions(new ShareRequestConditions().setLeaseId(leaseId)).setIgnoreReadOnly(false).setReplaceIfExists(false).setFilePermission("filePermission").setSmbProperties(smbProperties);<NEW_LINE>ShareDirectoryAsyncClient newRenamedClient = client.renameWithResponse(options).block().getValue();<NEW_LINE><MASK><NEW_LINE>// END: com.azure.storage.file.share.ShareDirectoryAsyncClient.renameWithResponse#ShareFileRenameOptions<NEW_LINE>}
System.out.println("Directory Client has been renamed");
660,576
protected String makeLink(Screen frameOwner) {<NEW_LINE>Window window = frameOwner.getWindow();<NEW_LINE>Entity entity = null;<NEW_LINE>if (window.getFrameOwner() instanceof EditorScreen) {<NEW_LINE>entity = ((EditorScreen) frameOwner).getEditedEntity();<NEW_LINE>}<NEW_LINE>GlobalConfig globalConfig = configuration.getConfig(GlobalConfig.class);<NEW_LINE>String url = String.format("%s/open?screen=%s", globalConfig.getWebAppUrl(), frameOwner.getId());<NEW_LINE>Object entityId = referenceToEntitySupport.getReferenceIdForLink(entity);<NEW_LINE>if (entity != null) {<NEW_LINE>String item;<NEW_LINE>if (entityId instanceof String) {<NEW_LINE>item = metadata.getClassNN(entity.getClass()).getName() + "-{" + entityId + "}";<NEW_LINE>} else {<NEW_LINE>item = metadata.getClassNN(entity.getClass()).getName() + "-" + entityId;<NEW_LINE>}<NEW_LINE>url += String.format("&item=%s&params=item:%s", item, item);<NEW_LINE>}<NEW_LINE>Map<String, <MASK><NEW_LINE>StringBuilder sb = new StringBuilder();<NEW_LINE>if (params != null) {<NEW_LINE>for (Map.Entry<String, Object> param : params.entrySet()) {<NEW_LINE>Object value = param.getValue();<NEW_LINE>if (value instanceof String || /*|| value instanceof Integer || value instanceof Double*/<NEW_LINE>value instanceof Boolean) {<NEW_LINE>sb.append(",").append(param.getKey()).append(":").append(URLEncodeUtils.encodeUtf8(value.toString()));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (sb.length() > 0) {<NEW_LINE>if (entity != null) {<NEW_LINE>url += sb.toString();<NEW_LINE>} else {<NEW_LINE>url += "&params=" + sb.deleteCharAt(0).toString();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return url;<NEW_LINE>}
Object> params = getWindowParams(window);
404,324
private Collection<Component> defineProblemComponents() {<NEW_LINE>final List<Component> all = new ArrayList<Component>();<NEW_LINE>final String ID = ProblemAnalyzer.ID;<NEW_LINE>//<NEW_LINE>all.//<NEW_LINE>add(//<NEW_LINE>C(ProblemHandler.class, DefaultProblemHandler.ID, DefaultProblemHandler.class).//<NEW_LINE>config(E("errorType").value("Error,RuntimeException,Exception")).req(ServerConfigManager.class));<NEW_LINE>//<NEW_LINE>all.//<NEW_LINE>add(C(ProblemHandler.class, LongExecutionProblemHandler.ID, LongExecutionProblemHandler.class)<MASK><NEW_LINE>//<NEW_LINE>all.//<NEW_LINE>add(//<NEW_LINE>C(MessageAnalyzer.class, ID, ProblemAnalyzer.class).is(PER_LOOKUP).req(ReportManager.class, ID).//<NEW_LINE>req(//<NEW_LINE>ServerConfigManager.class).//<NEW_LINE>req(ProblemHandler.class, new String[] { DefaultProblemHandler.ID, LongExecutionProblemHandler.ID }, "m_handlers"));<NEW_LINE>//<NEW_LINE>all.//<NEW_LINE>add(//<NEW_LINE>C(ReportManager.class, ID, DefaultReportManager.class).is(PER_LOOKUP).//<NEW_LINE>req(//<NEW_LINE>ReportDelegate.class, //<NEW_LINE>ID).//<NEW_LINE>req(//<NEW_LINE>ReportBucketManager.class, //<NEW_LINE>HourlyReportDao.class, //<NEW_LINE>HourlyReportContentDao.class, DomainValidator.class).config(E("name").value(ID)));<NEW_LINE>all.add(A(ProblemDelegate.class));<NEW_LINE>return all;<NEW_LINE>}
.req(ServerConfigManager.class));
1,337,356
public void onActivityCreated(@Nullable Bundle savedInstanceState) {<NEW_LINE>super.onActivityCreated(savedInstanceState);<NEW_LINE>if (savedInstanceState == null) {<NEW_LINE>numItems = 0;<NEW_LINE>readGranted = hasPermissions(this.getActivity(), Manifest.permission.READ_EXTERNAL_STORAGE);<NEW_LINE>writeGranted = hasPermissions(this.getActivity(), Manifest.permission.WRITE_EXTERNAL_STORAGE);<NEW_LINE>cameraGranted = hasPermissions(this.getActivity(), Manifest.permission.CAMERA);<NEW_LINE>microphoneGranted = hasPermissions(this.getActivity(), Manifest.permission.RECORD_AUDIO);<NEW_LINE>if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S) {<NEW_LINE>bluetoothConnectGranted = hasPermissions(this.getActivity(), Manifest.permission.BLUETOOTH_CONNECT);<NEW_LINE>}<NEW_LINE>contactsGranted = hasPermissions(this.getActivity(), Manifest.permission.READ_CONTACTS);<NEW_LINE>if (!readGranted || !writeGranted) {<NEW_LINE>items[numItems] = READ_WRITE;<NEW_LINE>numItems++;<NEW_LINE>}<NEW_LINE>if (!cameraGranted) {<NEW_LINE>items[numItems] = CAMERA;<NEW_LINE>numItems++;<NEW_LINE>}<NEW_LINE>if (!microphoneGranted) {<NEW_LINE>items[numItems] = CALLS;<NEW_LINE>numItems++;<NEW_LINE>}<NEW_LINE>if (!contactsGranted) {<NEW_LINE>items[numItems] = CONTACTS;<NEW_LINE>numItems++;<NEW_LINE>}<NEW_LINE>currentPermission = items[0];<NEW_LINE>setContent(currentPermission);<NEW_LINE>showSetupLayout();<NEW_LINE>} else {<NEW_LINE>isAllowingAccessShown = savedInstanceState.getBoolean("isAllowingAccessShown", false);<NEW_LINE>numItems = <MASK><NEW_LINE>currentPermission = savedInstanceState.getInt("currentPermission", 0);<NEW_LINE>items = savedInstanceState.getIntArray("items");<NEW_LINE>microphoneGranted = savedInstanceState.getBoolean("microphoneGranted", false);<NEW_LINE>setContent(currentPermission);<NEW_LINE>if (isAllowingAccessShown) {<NEW_LINE>showAllowAccessLayout();<NEW_LINE>} else {<NEW_LINE>showSetupLayout();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
savedInstanceState.getInt("numItems", 0);
1,588,543
public void updateResourceFolderSizeByFileType(Connection conn, int type) {<NEW_LINE>Map<String, Long> resourceSizeMap = listAllResourcesByFileType(conn, type);<NEW_LINE>String sql = "UPDATE t_ds_resources SET size=? where type=? and full_name=? and is_directory = true";<NEW_LINE>PreparedStatement pstmt = null;<NEW_LINE>try {<NEW_LINE>pstmt = conn.prepareStatement(sql);<NEW_LINE>for (Map.Entry<String, Long> entry : resourceSizeMap.entrySet()) {<NEW_LINE>pstmt.setLong(1, entry.getValue());<NEW_LINE>pstmt.setInt(2, type);<NEW_LINE>pstmt.setString(<MASK><NEW_LINE>pstmt.addBatch();<NEW_LINE>}<NEW_LINE>pstmt.executeBatch();<NEW_LINE>} catch (Exception e) {<NEW_LINE>logger.error(e.getMessage(), e);<NEW_LINE>throw new RuntimeException("sql: " + sql, e);<NEW_LINE>} finally {<NEW_LINE>if (Objects.nonNull(pstmt)) {<NEW_LINE>try {<NEW_LINE>if (!pstmt.isClosed()) {<NEW_LINE>pstmt.close();<NEW_LINE>}<NEW_LINE>} catch (SQLException e) {<NEW_LINE>logger.error(e.getMessage(), e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>ConnectionUtils.releaseResource(conn);<NEW_LINE>}<NEW_LINE>}
3, entry.getKey());
1,765,450
public void run() {<NEW_LINE>StyledDocument doc = pane.getStyledDocument();<NEW_LINE>// NOI18N<NEW_LINE>Style hlStyle = doc.addStyle("regularBlue-findtype", defStyle);<NEW_LINE>hlStyle.addAttribute(HyperlinkSupport.TYPE_ATTRIBUTE, new TypeLink());<NEW_LINE>StyleConstants.setForeground(hlStyle, UIUtils.getLinkColor());<NEW_LINE>StyleConstants.setUnderline(hlStyle, true);<NEW_LINE>List<Integer> l = Collections.emptyList();<NEW_LINE>try {<NEW_LINE>l = getHighlightOffsets(doc.getText(0, doc.getLength()));<NEW_LINE>} catch (BadLocationException ex) {<NEW_LINE>Support.LOG.log(Level.SEVERE, null, ex);<NEW_LINE>}<NEW_LINE>List<Highlight> highlights = new ArrayList<Highlight>(l.size());<NEW_LINE>for (int i = 0; i < l.size(); i++) {<NEW_LINE>highlights.add(new Highlight(l.get(i), l.get(++i)));<NEW_LINE>}<NEW_LINE>pane.putClientProperty(HIGHLIGHTS_PROPERTY, highlights);<NEW_LINE>pane.removeMouseMotionListener(FindTypesSupport.this);<NEW_LINE>pane.addMouseMotionListener(FindTypesSupport.this);<NEW_LINE>pane.removeMouseListener(FindTypesSupport.this);<NEW_LINE><MASK><NEW_LINE>}
pane.addMouseListener(FindTypesSupport.this);
857,111
public static AsciiSet fromPattern(String pattern) {<NEW_LINE>final boolean[] members = new boolean[128];<NEW_LINE>final <MASK><NEW_LINE>for (int i = 0; i < n; ++i) {<NEW_LINE>final char c = pattern.charAt(i);<NEW_LINE>if (c >= members.length) {<NEW_LINE>throw new IllegalArgumentException("invalid pattern, '" + c + "' is not ascii");<NEW_LINE>}<NEW_LINE>final boolean isStartOrEnd = i == 0 || i == n - 1;<NEW_LINE>if (isStartOrEnd || c != '-') {<NEW_LINE>members[c] = true;<NEW_LINE>} else {<NEW_LINE>final char s = pattern.charAt(i - 1);<NEW_LINE>final char e = pattern.charAt(i + 1);<NEW_LINE>for (char v = s; v <= e; ++v) {<NEW_LINE>members[v] = true;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return new AsciiSet(members);<NEW_LINE>}
int n = pattern.length();
1,466,118
private void onExecute(BaseActionElement actionElement, RenderedAdaptiveCard renderedAdaptiveCard) {<NEW_LINE>ExecuteAction executeAction = Util.tryCastTo(actionElement, ExecuteAction.class);<NEW_LINE>String verb = executeAction.GetVerb();<NEW_LINE>String data = executeAction.GetDataJson();<NEW_LINE>Map<String, String> keyValueMap = renderedAdaptiveCard.getInputs();<NEW_LINE>if (!data.isEmpty()) {<NEW_LINE>try {<NEW_LINE>JSONObject object = null;<NEW_LINE>if (!data.equals("null\n")) {<NEW_LINE>object = new JSONObject(data);<NEW_LINE>} else {<NEW_LINE>object = new JSONObject();<NEW_LINE>}<NEW_LINE>showToast("Execute verb: " + verb + "\nData: " + object.toString() + "\nInput: " + keyValueMap.toString(), Toast.LENGTH_LONG);<NEW_LINE>} catch (JSONException e) {<NEW_LINE>showToast(e.<MASK><NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>showToast("Execute verb: " + verb + "\nInput: " + keyValueMap.toString(), Toast.LENGTH_LONG);<NEW_LINE>}<NEW_LINE>}
toString(), Toast.LENGTH_LONG);
1,831,401
private void replaceString(String newValue, int start, int end, int segmentNumber) {<NEW_LINE>TextRange range = TextRange.create(start, end);<NEW_LINE>if (!TextRange.from(0, myDocument.getCharsSequence().length()).contains(range)) {<NEW_LINE>LOG.error("Diagnostic for EA-54980. Can't extract " + range + " range. " + presentTemplate(myTemplate), AttachmentFactory.createAttachment(myDocument));<NEW_LINE>}<NEW_LINE>String oldText = range.subSequence(myDocument.getCharsSequence()).toString();<NEW_LINE>if (!oldText.equals(newValue)) {<NEW_LINE><MASK><NEW_LINE>myDocument.replaceString(start, end, newValue);<NEW_LINE>int newEnd = start + newValue.length();<NEW_LINE>mySegments.replaceSegmentAt(segmentNumber, start, newEnd);<NEW_LINE>mySegments.setNeighboursGreedy(segmentNumber, true);<NEW_LINE>fixOverlappedSegments(segmentNumber);<NEW_LINE>}<NEW_LINE>}
mySegments.setNeighboursGreedy(segmentNumber, false);
1,636,304
protected void paintIcon(Graphics2D g2) {<NEW_LINE>g2.setColor(Color.BLUE.darker().darker());<NEW_LINE>final int[] xpos = { 0, scale(6), scale(4), scale(2) };<NEW_LINE>final int[] ypos = { scale(13), scale(13), scale(15), scale(15) };<NEW_LINE>g2.fillPolygon(xpos, ypos, 4);<NEW_LINE>for (var i = 0; i < 4; i++) {<NEW_LINE>xpos[i] += scale(10);<NEW_LINE>}<NEW_LINE>g2.fillPolygon(xpos, ypos, 4);<NEW_LINE>final int xbase = scale(9);<NEW_LINE>final int ybase = scale(11);<NEW_LINE>var xtop = scale(13);<NEW_LINE>var ytop = scale(3);<NEW_LINE>g2.setStroke(new BasicStroke(scale(2)));<NEW_LINE>g2.setColor(Color.BLACK);<NEW_LINE>g2.drawLine(xtop, ytop, xbase, ybase);<NEW_LINE>xtop -= scale(2);<NEW_LINE>ytop -= scale(2);<NEW_LINE>g2.setStroke(new BasicStroke(scale(1)));<NEW_LINE>g2.setColor(Color.RED);<NEW_LINE>g2.fillOval(xtop, ytop, scale(4), scale(4));<NEW_LINE>g2.drawOval(xtop, ytop, scale(4), scale(4));<NEW_LINE><MASK><NEW_LINE>g2.fillRoundRect(0, scale(10), scale(16), scale(4), scale(2), scale(2));<NEW_LINE>g2.drawRoundRect(0, scale(10), scale(16), scale(4), scale(2), scale(2));<NEW_LINE>}
g2.setColor(Color.BLUE);
1,626,511
public void run() {<NEW_LINE>try {<NEW_LINE>BufferedImage image = new BufferedImage(width, height, BufferedImage.TYPE_INT_RGB);<NEW_LINE>for (int x = 0; x < width; x++) {<NEW_LINE>for (int y = 0; y < height; y++) {<NEW_LINE>int i = (x + (width * y)) * bpp;<NEW_LINE>int r = buffer.get(i) & 0xFF;<NEW_LINE>int g = buffer.get(i + 1) & 0xFF;<NEW_LINE>int b = buffer.<MASK><NEW_LINE>image.setRGB(x, height - (y + 1), (0xFF << 24) | (r << 16) | (g << 8) | b);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>ImageIO.write(image, Options.getScreenshotFormat(), file);<NEW_LINE>UI.getNotificationManager().sendNotification(String.format("Saved screenshot to %s", file.getAbsolutePath()), Colors.PURPLE, new NotificationListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void click() {<NEW_LINE>try {<NEW_LINE>Utils.openInFileManager(file);<NEW_LINE>} catch (IOException e) {<NEW_LINE>Log.warn("Failed to open screenshot location.", e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} catch (Exception e) {<NEW_LINE>ErrorHandler.error("Failed to take a screenshot.", e, true);<NEW_LINE>}<NEW_LINE>}
get(i + 2) & 0xFF;
278,750
public Xml.Document visitDocument(Xml.Document document, ExecutionContext ctx) {<NEW_LINE>Xml.Document doc = <MASK><NEW_LINE>Validated versionValidation = Semver.validate(version, versionPattern);<NEW_LINE>if (versionValidation.isValid()) {<NEW_LINE>versionComparator = versionValidation.getValue();<NEW_LINE>}<NEW_LINE>if (documentHasManagedDependency(doc, ctx)) {<NEW_LINE>return document;<NEW_LINE>}<NEW_LINE>String versionToUse = findVersionToUse(ctx);<NEW_LINE>if (versionToUse.equals(existingManagedDependencyVersion())) {<NEW_LINE>return document;<NEW_LINE>}<NEW_LINE>Xml.Tag root = document.getRoot();<NEW_LINE>List<? extends Content> rootContent = root.getContent() != null ? root.getContent() : emptyList();<NEW_LINE>Xml.Tag dependencyManagementTag = root.getChild("dependencyManagement").orElse(null);<NEW_LINE>if (dependencyManagementTag == null) {<NEW_LINE>doc = (Xml.Document) new AddToTagVisitor<>(root, Xml.Tag.build("<dependencyManagement>\n<dependencies/>\n</dependencyManagement>"), new MavenTagInsertionComparator(rootContent)).visitNonNull(doc, ctx);<NEW_LINE>} else if (!dependencyManagementTag.getChild("dependencies").isPresent()) {<NEW_LINE>doc = (Xml.Document) new AddToTagVisitor<>(dependencyManagementTag, Xml.Tag.build("\n<dependencies/>\n"), new MavenTagInsertionComparator(rootContent)).visitNonNull(doc, ctx);<NEW_LINE>}<NEW_LINE>doc = (Xml.Document) new InsertDependencyInOrder(groupId, artifactId, versionToUse, type, scope, classifier).visitNonNull(doc, ctx);<NEW_LINE>return doc;<NEW_LINE>}
super.visitDocument(document, ctx);
609,499
private static int nextID(Connection conn, int AD_Sequence_ID, boolean adempiereSys) {<NEW_LINE>if (conn == null || AD_Sequence_ID == 0) {<NEW_LINE>return -3;<NEW_LINE>}<NEW_LINE>//<NEW_LINE>int retValue = -1;<NEW_LINE>String sqlUpdate = "{call nextID(?,?,?)}";<NEW_LINE>CallableStatement cstmt = null;<NEW_LINE>try {<NEW_LINE>cstmt = conn.prepareCall(sqlUpdate, <MASK><NEW_LINE>cstmt.setInt(1, AD_Sequence_ID);<NEW_LINE>cstmt.setString(2, adempiereSys ? "Y" : "N");<NEW_LINE>cstmt.registerOutParameter(3, Types.INTEGER);<NEW_LINE>if (DB.getDatabase().isQueryTimeoutSupported()) {<NEW_LINE>cstmt.setQueryTimeout(QUERY_TIME_OUT);<NEW_LINE>}<NEW_LINE>cstmt.execute();<NEW_LINE>retValue = cstmt.getInt(3);<NEW_LINE>} catch (Exception e) {<NEW_LINE>s_log.error(e.toString());<NEW_LINE>} finally {<NEW_LINE>DB.close(cstmt);<NEW_LINE>}<NEW_LINE>return retValue;<NEW_LINE>}
ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY);
1,301,856
public void onClick(View view) {<NEW_LINE>String msg = commitMsg.getText().toString();<NEW_LINE>String author = commitAuthor.getText().toString().trim();<NEW_LINE>String authorName = null, authorEmail = null;<NEW_LINE>int ltidx;<NEW_LINE>if (msg.trim().equals("")) {<NEW_LINE>commitMsg.setError(mActivity.getString(R.string.error_no_commit_msg));<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (!author.equals("")) {<NEW_LINE>ltidx = author.indexOf('<');<NEW_LINE>if (!author.endsWith(">") || ltidx == -1) {<NEW_LINE>commitAuthor.setError(mActivity.getString(R.string.error_invalid_author));<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>authorName = author.substring(0, ltidx);<NEW_LINE>authorEmail = author.substring(ltidx + 1, <MASK><NEW_LINE>}<NEW_LINE>boolean amend = isAmend.isChecked();<NEW_LINE>boolean stage = autoStage.isChecked();<NEW_LINE>commit(msg, amend, stage, authorName, authorEmail);<NEW_LINE>d.dismiss();<NEW_LINE>}
author.length() - 1);
949,693
protected List<DocParameter> buildDocParameters(final String ref, final JsonObject docRoot, final boolean doSubRef) {<NEW_LINE>JsonObject responseObject = docRoot.getAsJsonObject("definitions").getAsJsonObject(ref);<NEW_LINE>String className = responseObject.get("title").getAsString();<NEW_LINE>JsonObject extProperties = docRoot.getAsJsonObject(className);<NEW_LINE>JsonArray requiredProperties = responseObject.getAsJsonArray("required");<NEW_LINE>JsonObject properties = responseObject.getAsJsonObject("properties");<NEW_LINE>List<DocParameter> docParameterList = new ArrayList<>();<NEW_LINE>if (Objects.isNull(properties)) {<NEW_LINE>return docParameterList;<NEW_LINE>}<NEW_LINE>Set<String> fieldNames = properties.keySet();<NEW_LINE>for (String fieldName : fieldNames) {<NEW_LINE>JsonObject fieldInfo = properties.getAsJsonObject(fieldName);<NEW_LINE>DocParameter docParameter = GsonUtils.getInstance().fromJson(fieldInfo, DocParameter.class);<NEW_LINE>docParameter.setName(fieldName);<NEW_LINE>docParameter.setRequired(!(Objects.isNull(requiredProperties) || requiredProperties.isEmpty()) && requiredProperties.contains(fieldInfo));<NEW_LINE>if (Objects.nonNull(extProperties)) {<NEW_LINE>JsonObject <MASK><NEW_LINE>if (Objects.nonNull(prop)) {<NEW_LINE>docParameter.setMaxLength(Objects.isNull(prop.get("maxLength")) ? "-" : prop.get("maxLength").getAsString());<NEW_LINE>if (Objects.nonNull(prop.get("required"))) {<NEW_LINE>docParameter.setRequired(Boolean.parseBoolean(prop.get("required").getAsString()));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>docParameterList.add(docParameter);<NEW_LINE>RefInfo refInfo = this.getRefInfo(fieldInfo);<NEW_LINE>if (Objects.nonNull(refInfo) && doSubRef) {<NEW_LINE>String subRef = refInfo.ref;<NEW_LINE>boolean nextDoRef = !Objects.equals(ref, subRef);<NEW_LINE>List<DocParameter> refs = buildDocParameters(subRef, docRoot, nextDoRef);<NEW_LINE>docParameter.setRefs(refs);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return docParameterList;<NEW_LINE>}
prop = extProperties.getAsJsonObject(fieldName);
1,221,582
private void parseInsertNameWithReference(ByteBuffer buffer) throws QpackException, EncodingException {<NEW_LINE>while (true) {<NEW_LINE>switch(_operation) {<NEW_LINE>case NONE:<NEW_LINE>byte firstByte = buffer.get(buffer.position());<NEW_LINE>_referenceDynamicTable <MASK><NEW_LINE>_operation = Operation.INDEX;<NEW_LINE>_integerParser.setPrefix(6);<NEW_LINE>continue;<NEW_LINE>case INDEX:<NEW_LINE>_index = _integerParser.decodeInt(buffer);<NEW_LINE>if (_index < 0)<NEW_LINE>return;<NEW_LINE>_operation = Operation.VALUE;<NEW_LINE>_stringParser.setPrefix(8);<NEW_LINE>continue;<NEW_LINE>case VALUE:<NEW_LINE>String value = _stringParser.decode(buffer);<NEW_LINE>if (value == null)<NEW_LINE>return;<NEW_LINE>int index = _index;<NEW_LINE>boolean dynamic = _referenceDynamicTable;<NEW_LINE>reset();<NEW_LINE>_handler.onInsertNameWithReference(index, dynamic, value);<NEW_LINE>return;<NEW_LINE>default:<NEW_LINE>throw new IllegalStateException(_operation.name());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
= (firstByte & 0x40) == 0;
1,286,364
public Builder mergeFrom(io.kubernetes.client.proto.V1.PersistentVolumeSpec other) {<NEW_LINE>if (other == io.kubernetes.client.proto.V1.PersistentVolumeSpec.getDefaultInstance())<NEW_LINE>return this;<NEW_LINE>internalGetMutableCapacity().<MASK><NEW_LINE>if (other.hasPersistentVolumeSource()) {<NEW_LINE>mergePersistentVolumeSource(other.getPersistentVolumeSource());<NEW_LINE>}<NEW_LINE>if (!other.accessModes_.isEmpty()) {<NEW_LINE>if (accessModes_.isEmpty()) {<NEW_LINE>accessModes_ = other.accessModes_;<NEW_LINE>bitField0_ = (bitField0_ & ~0x00000004);<NEW_LINE>} else {<NEW_LINE>ensureAccessModesIsMutable();<NEW_LINE>accessModes_.addAll(other.accessModes_);<NEW_LINE>}<NEW_LINE>onChanged();<NEW_LINE>}<NEW_LINE>if (other.hasClaimRef()) {<NEW_LINE>mergeClaimRef(other.getClaimRef());<NEW_LINE>}<NEW_LINE>if (other.hasPersistentVolumeReclaimPolicy()) {<NEW_LINE>bitField0_ |= 0x00000010;<NEW_LINE>persistentVolumeReclaimPolicy_ = other.persistentVolumeReclaimPolicy_;<NEW_LINE>onChanged();<NEW_LINE>}<NEW_LINE>if (other.hasStorageClassName()) {<NEW_LINE>bitField0_ |= 0x00000020;<NEW_LINE>storageClassName_ = other.storageClassName_;<NEW_LINE>onChanged();<NEW_LINE>}<NEW_LINE>if (!other.mountOptions_.isEmpty()) {<NEW_LINE>if (mountOptions_.isEmpty()) {<NEW_LINE>mountOptions_ = other.mountOptions_;<NEW_LINE>bitField0_ = (bitField0_ & ~0x00000040);<NEW_LINE>} else {<NEW_LINE>ensureMountOptionsIsMutable();<NEW_LINE>mountOptions_.addAll(other.mountOptions_);<NEW_LINE>}<NEW_LINE>onChanged();<NEW_LINE>}<NEW_LINE>if (other.hasVolumeMode()) {<NEW_LINE>bitField0_ |= 0x00000080;<NEW_LINE>volumeMode_ = other.volumeMode_;<NEW_LINE>onChanged();<NEW_LINE>}<NEW_LINE>if (other.hasNodeAffinity()) {<NEW_LINE>mergeNodeAffinity(other.getNodeAffinity());<NEW_LINE>}<NEW_LINE>this.mergeUnknownFields(other.unknownFields);<NEW_LINE>onChanged();<NEW_LINE>return this;<NEW_LINE>}
mergeFrom(other.internalGetCapacity());
1,839,404
public void marshall(CreateTapeWithBarcodeRequest createTapeWithBarcodeRequest, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (createTapeWithBarcodeRequest == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(createTapeWithBarcodeRequest.getGatewayARN(), GATEWAYARN_BINDING);<NEW_LINE>protocolMarshaller.marshall(createTapeWithBarcodeRequest.getTapeSizeInBytes(), TAPESIZEINBYTES_BINDING);<NEW_LINE>protocolMarshaller.marshall(createTapeWithBarcodeRequest.getTapeBarcode(), TAPEBARCODE_BINDING);<NEW_LINE>protocolMarshaller.marshall(<MASK><NEW_LINE>protocolMarshaller.marshall(createTapeWithBarcodeRequest.getKMSKey(), KMSKEY_BINDING);<NEW_LINE>protocolMarshaller.marshall(createTapeWithBarcodeRequest.getPoolId(), POOLID_BINDING);<NEW_LINE>protocolMarshaller.marshall(createTapeWithBarcodeRequest.getWorm(), WORM_BINDING);<NEW_LINE>protocolMarshaller.marshall(createTapeWithBarcodeRequest.getTags(), TAGS_BINDING);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>}
createTapeWithBarcodeRequest.getKMSEncrypted(), KMSENCRYPTED_BINDING);
394,959
private static void addConfiguration(OCWorkspaceImpl.ModifiableModel workspaceModifiable, String id, String displayName, File directory, Map<OCLanguageKind, PerLanguageCompilerOpts> configLanguages, Map<VirtualFile, PerFileCompilerOpts> configSourceFiles) {<NEW_LINE>OCResolveConfigurationImpl.ModifiableModel config = workspaceModifiable.addConfiguration(id, displayName, null, OCResolveConfiguration.DEFAULT_FILE_SEPARATORS);<NEW_LINE>for (Map.Entry<OCLanguageKind, PerLanguageCompilerOpts> languageEntry : configLanguages.entrySet()) {<NEW_LINE>OCCompilerSettings.ModifiableModel langSettings = config.getLanguageCompilerSettings(languageEntry.getKey());<NEW_LINE>PerLanguageCompilerOpts configForLanguage = languageEntry.getValue();<NEW_LINE>langSettings.setCompiler(configForLanguage.kind, configForLanguage.compiler, directory);<NEW_LINE>langSettings.setCompilerSwitches(configForLanguage.switches);<NEW_LINE>}<NEW_LINE>for (Map.Entry<VirtualFile, PerFileCompilerOpts> fileEntry : configSourceFiles.entrySet()) {<NEW_LINE>PerFileCompilerOpts compilerOpts = fileEntry.getValue();<NEW_LINE>OCCompilerSettings.ModifiableModel fileCompilerSettings = config.addSource(fileEntry.<MASK><NEW_LINE>fileCompilerSettings.setCompilerSwitches(compilerOpts.switches);<NEW_LINE>}<NEW_LINE>}
getKey(), compilerOpts.kind);
1,590,787
public List<SuppressionRule> parseSuppressionRules(InputStream inputStream, SuppressionRuleFilter filter) throws SuppressionParseException, SAXException {<NEW_LINE>try (InputStream schemaStream13 = FileUtils.getResourceAsStream(SUPPRESSION_SCHEMA_1_3);<NEW_LINE>InputStream schemaStream12 = FileUtils.getResourceAsStream(SUPPRESSION_SCHEMA_1_2);<NEW_LINE>InputStream <MASK><NEW_LINE>InputStream schemaStream10 = FileUtils.getResourceAsStream(SUPPRESSION_SCHEMA_1_0)) {<NEW_LINE>final BOMInputStream bomStream = new BOMInputStream(inputStream);<NEW_LINE>final ByteOrderMark bom = bomStream.getBOM();<NEW_LINE>final String defaultEncoding = StandardCharsets.UTF_8.name();<NEW_LINE>final String charsetName = bom == null ? defaultEncoding : bom.getCharsetName();<NEW_LINE>final SuppressionHandler handler = new SuppressionHandler(filter);<NEW_LINE>final SAXParser saxParser = XmlUtils.buildSecureSaxParser(schemaStream13, schemaStream12, schemaStream11, schemaStream10);<NEW_LINE>final XMLReader xmlReader = saxParser.getXMLReader();<NEW_LINE>xmlReader.setErrorHandler(new SuppressionErrorHandler());<NEW_LINE>xmlReader.setContentHandler(handler);<NEW_LINE>xmlReader.setEntityResolver(new ClassloaderResolver());<NEW_LINE>try (Reader reader = new InputStreamReader(bomStream, charsetName)) {<NEW_LINE>final InputSource in = new InputSource(reader);<NEW_LINE>xmlReader.parse(in);<NEW_LINE>return handler.getSuppressionRules();<NEW_LINE>}<NEW_LINE>} catch (ParserConfigurationException | FileNotFoundException ex) {<NEW_LINE>LOGGER.debug("", ex);<NEW_LINE>throw new SuppressionParseException(ex);<NEW_LINE>} catch (SAXException ex) {<NEW_LINE>if (ex.getMessage().contains("Cannot find the declaration of element 'suppressions'.")) {<NEW_LINE>throw ex;<NEW_LINE>} else {<NEW_LINE>LOGGER.debug("", ex);<NEW_LINE>throw new SuppressionParseException(ex);<NEW_LINE>}<NEW_LINE>} catch (IOException ex) {<NEW_LINE>LOGGER.debug("", ex);<NEW_LINE>throw new SuppressionParseException(ex);<NEW_LINE>}<NEW_LINE>}
schemaStream11 = FileUtils.getResourceAsStream(SUPPRESSION_SCHEMA_1_1);
723,964
public static LogFileKey fromKey(Key key) {<NEW_LINE>var logFileKey = new LogFileKey();<NEW_LINE>byte[] rowParts = key.getRow().getBytes();<NEW_LINE><MASK><NEW_LINE>logFileKey.seq = getSequence(rowParts);<NEW_LINE>logFileKey.event = LogEvents.valueOf(key.getColumnFamilyData().toString());<NEW_LINE>// verify event number in row matches column family<NEW_LINE>if (eventType(logFileKey.event) != rowParts[0]) {<NEW_LINE>throw new AssertionError("Event in row differs from column family. Key: " + key);<NEW_LINE>}<NEW_LINE>log.trace("From row {} get {} {} {}", Arrays.toString(rowParts), logFileKey.event, logFileKey.tabletId, logFileKey.seq);<NEW_LINE>// handle special cases of what is stored in the qualifier<NEW_LINE>switch(logFileKey.event) {<NEW_LINE>case OPEN:<NEW_LINE>logFileKey.tserverSession = key.getColumnQualifierData().toString();<NEW_LINE>break;<NEW_LINE>case COMPACTION_START:<NEW_LINE>logFileKey.filename = key.getColumnQualifierData().toString();<NEW_LINE>break;<NEW_LINE>case DEFINE_TABLET:<NEW_LINE>try (DataInputBuffer buffer = new DataInputBuffer()) {<NEW_LINE>byte[] bytes = key.getColumnQualifierData().toArray();<NEW_LINE>buffer.reset(bytes, bytes.length);<NEW_LINE>logFileKey.tablet = KeyExtent.readFrom(buffer);<NEW_LINE>} catch (IOException e) {<NEW_LINE>throw new UncheckedIOException(e);<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>case COMPACTION_FINISH:<NEW_LINE>case MANY_MUTATIONS:<NEW_LINE>case MUTATION:<NEW_LINE>// nothing to do<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>throw new AssertionError("Invalid event type in key: " + key);<NEW_LINE>}<NEW_LINE>return logFileKey;<NEW_LINE>}
logFileKey.tabletId = getTabletId(rowParts);
115,020
protected void paintEnabledText(JLabel l, Graphics g, String s, int textX, int textY) {<NEW_LINE>boolean hasEmbeddedMenuBar = hasVisibleEmbeddedMenuBar(rootPane.getJMenuBar());<NEW_LINE>int labelWidth = l.getWidth();<NEW_LINE>int textWidth <MASK><NEW_LINE>int gap = UIScale.scale(menuBarTitleGap);<NEW_LINE>// The passed in textX coordinate is always to horizontally center the text within the label bounds.<NEW_LINE>// Modify textX so that the text is painted either centered within the window bounds or leading aligned.<NEW_LINE>boolean center = hasEmbeddedMenuBar ? centerTitleIfMenuBarEmbedded : centerTitle;<NEW_LINE>if (center) {<NEW_LINE>// If window is wide enough, center title within window bounds.<NEW_LINE>// Otherwise, leave it centered within free space (label bounds).<NEW_LINE>int centeredTextX = ((l.getParent().getWidth() - textWidth) / 2) - l.getX();<NEW_LINE>if (centeredTextX >= gap && centeredTextX + textWidth <= labelWidth - gap)<NEW_LINE>textX = centeredTextX;<NEW_LINE>} else {<NEW_LINE>// leading aligned<NEW_LINE>boolean leftToRight = getComponentOrientation().isLeftToRight();<NEW_LINE>Insets insets = l.getInsets();<NEW_LINE>int leadingInset = hasEmbeddedMenuBar ? gap : (leftToRight ? insets.left : insets.right);<NEW_LINE>int leadingTextX = leftToRight ? leadingInset : labelWidth - leadingInset - textWidth;<NEW_LINE>if (leftToRight ? leadingTextX < textX : leadingTextX > textX)<NEW_LINE>textX = leadingTextX;<NEW_LINE>}<NEW_LINE>super.paintEnabledText(l, g, s, textX, textY);<NEW_LINE>}
= labelWidth - (textX * 2);
69,671
private void fillHorizontalEdge(Picture pic, int comp, int mbAddr, int[][] bs) {<NEW_LINE>SliceHeader sh = di.shs[mbAddr];<NEW_LINE>int mbWidth = sh.sps.picWidthInMbsMinus1 + 1;<NEW_LINE><MASK><NEW_LINE>int beta = sh.sliceBetaOffsetDiv2 << 1;<NEW_LINE>int mbX = mbAddr % mbWidth;<NEW_LINE>int mbY = mbAddr / mbWidth;<NEW_LINE>boolean topAvailable = mbY > 0 && (sh.disableDeblockingFilterIdc != 2 || di.shs[mbAddr - mbWidth] == sh);<NEW_LINE>int curQp = di.mbQps[comp][mbAddr];<NEW_LINE>int cW = 2 - pic.getColor().compWidth[comp];<NEW_LINE>int cH = 2 - pic.getColor().compHeight[comp];<NEW_LINE>if (topAvailable) {<NEW_LINE>int topQp = di.mbQps[comp][mbAddr - mbWidth];<NEW_LINE>int avgQp = (topQp + curQp + 1) >> 1;<NEW_LINE>for (int blkX = 0; blkX < 4; blkX++) {<NEW_LINE>int thisBlkX = (mbX << 2) + blkX;<NEW_LINE>int thisBlkY = (mbY << 2);<NEW_LINE>filterBlockEdgeHoris(pic, comp, thisBlkX << cW, thisBlkY << cH, getIdxAlpha(alpha, avgQp), getIdxBeta(beta, avgQp), bs[0][blkX], 1 << cW);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>boolean skip4x4 = comp == 0 && di.tr8x8Used[mbAddr] || cH == 1;<NEW_LINE>for (int blkY = 1; blkY < 4; blkY++) {<NEW_LINE>if (skip4x4 && (blkY & 1) == 1)<NEW_LINE>continue;<NEW_LINE>for (int blkX = 0; blkX < 4; blkX++) {<NEW_LINE>int thisBlkX = (mbX << 2) + blkX;<NEW_LINE>int thisBlkY = (mbY << 2) + blkY;<NEW_LINE>filterBlockEdgeHoris(pic, comp, thisBlkX << cW, thisBlkY << cH, getIdxAlpha(alpha, curQp), getIdxBeta(beta, curQp), bs[blkY][blkX], 1 << cW);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
int alpha = sh.sliceAlphaC0OffsetDiv2 << 1;
132,093
public void deleteById(String id) {<NEW_LINE>String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups");<NEW_LINE>if (resourceGroupName == null) {<NEW_LINE>throw LOGGER.logExceptionAsError(new IllegalArgumentException(String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id)));<NEW_LINE>}<NEW_LINE>String workspaceName = Utils.getValueFromIdByName(id, "workspaces");<NEW_LINE>if (workspaceName == null) {<NEW_LINE>throw LOGGER.logExceptionAsError(new IllegalArgumentException(String.<MASK><NEW_LINE>}<NEW_LINE>String sqlPoolName = Utils.getValueFromIdByName(id, "sqlPools");<NEW_LINE>if (sqlPoolName == null) {<NEW_LINE>throw LOGGER.logExceptionAsError(new IllegalArgumentException(String.format("The resource ID '%s' is not valid. Missing path segment 'sqlPools'.", id)));<NEW_LINE>}<NEW_LINE>String workloadGroupName = Utils.getValueFromIdByName(id, "workloadGroups");<NEW_LINE>if (workloadGroupName == null) {<NEW_LINE>throw LOGGER.logExceptionAsError(new IllegalArgumentException(String.format("The resource ID '%s' is not valid. Missing path segment 'workloadGroups'.", id)));<NEW_LINE>}<NEW_LINE>String workloadClassifierName = Utils.getValueFromIdByName(id, "workloadClassifiers");<NEW_LINE>if (workloadClassifierName == null) {<NEW_LINE>throw LOGGER.logExceptionAsError(new IllegalArgumentException(String.format("The resource ID '%s' is not valid. Missing path segment 'workloadClassifiers'.", id)));<NEW_LINE>}<NEW_LINE>this.delete(resourceGroupName, workspaceName, sqlPoolName, workloadGroupName, workloadClassifierName, Context.NONE);<NEW_LINE>}
format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id)));
1,472,954
public static List<Object> recursivelyDeconstructReadableArray(ReadableArray readableArray) {<NEW_LINE>List<Object> deconstructedList = new ArrayList<>(readableArray.size());<NEW_LINE>for (int i = 0; i < readableArray.size(); i++) {<NEW_LINE>ReadableType indexType = readableArray.getType(i);<NEW_LINE>switch(indexType) {<NEW_LINE>case Null:<NEW_LINE><MASK><NEW_LINE>break;<NEW_LINE>case Boolean:<NEW_LINE>deconstructedList.add(i, readableArray.getBoolean(i));<NEW_LINE>break;<NEW_LINE>case Number:<NEW_LINE>deconstructedList.add(i, readableArray.getDouble(i));<NEW_LINE>break;<NEW_LINE>case String:<NEW_LINE>deconstructedList.add(i, readableArray.getString(i));<NEW_LINE>break;<NEW_LINE>case Map:<NEW_LINE>deconstructedList.add(i, OAuthManagerModule.recursivelyDeconstructReadableMap(readableArray.getMap(i)));<NEW_LINE>break;<NEW_LINE>case Array:<NEW_LINE>deconstructedList.add(i, OAuthManagerModule.recursivelyDeconstructReadableArray(readableArray.getArray(i)));<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>throw new IllegalArgumentException("Could not convert object at index " + i + ".");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return deconstructedList;<NEW_LINE>}
deconstructedList.add(i, null);
1,294,337
public static byte[] serialize(Descriptors.Descriptor descriptor) {<NEW_LINE>byte[] schemaDataBytes;<NEW_LINE>try {<NEW_LINE>Map<String, FileDescriptorProto> fileDescriptorProtoCache = new HashMap<>();<NEW_LINE>// recursively cache all FileDescriptorProto<NEW_LINE>serializeFileDescriptor(descriptor.getFile(), fileDescriptorProtoCache);<NEW_LINE>// extract root message path<NEW_LINE>String rootMessageTypeName = descriptor.getFullName();<NEW_LINE>String rootFileDescriptorName = descriptor.getFile().getFullName();<NEW_LINE>// build FileDescriptorSet, this is equal to < protoc --include_imports --descriptor_set_out ><NEW_LINE>byte[] fileDescriptorSet = FileDescriptorSet.newBuilder().addAllFile(fileDescriptorProtoCache.values()).build().toByteArray();<NEW_LINE>// serialize to bytes<NEW_LINE>ProtobufNativeSchemaData schemaData = ProtobufNativeSchemaData.builder().fileDescriptorSet(fileDescriptorSet).rootFileDescriptorName(rootFileDescriptorName).rootMessageTypeName(rootMessageTypeName).build();<NEW_LINE>schemaDataBytes = new <MASK><NEW_LINE>logger.debug("descriptor '{}' serialized to '{}'.", descriptor.getFullName(), schemaDataBytes);<NEW_LINE>} catch (Exception e) {<NEW_LINE>e.printStackTrace();<NEW_LINE>throw new SchemaSerializationException(e);<NEW_LINE>}<NEW_LINE>return schemaDataBytes;<NEW_LINE>}
ObjectMapper().writeValueAsBytes(schemaData);
759,867
private void changeOnOffline(String subject, String consumerGroup, boolean isOnline, StatusSource src) {<NEW_LINE>synchronized (getConsumerLockKey(subject, consumerGroup, "onOffline")) {<NEW_LINE>final String realSubject = RetrySubjectUtils.getRealSubject(subject);<NEW_LINE>final String retrySubject = RetrySubjectUtils.buildRetrySubject(realSubject, consumerGroup);<NEW_LINE>final String key = MapKeyBuilder.buildSubscribeKey(realSubject, consumerGroup);<NEW_LINE>final PullEntry <MASK><NEW_LINE>changeOnOffline(pullEntry, isOnline, src);<NEW_LINE>final PullEntry retryPullEntry = pullEntryMap.get(MapKeyBuilder.buildSubscribeKey(retrySubject, consumerGroup));<NEW_LINE>changeOnOffline(retryPullEntry, isOnline, src);<NEW_LINE>final DefaultPullConsumer pullConsumer = pullConsumerMap.get(key);<NEW_LINE>if (pullConsumer == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (isOnline) {<NEW_LINE>pullConsumer.online(src);<NEW_LINE>} else {<NEW_LINE>pullConsumer.offline(src);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
pullEntry = pullEntryMap.get(key);
1,377,922
public OperationSummary unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>OperationSummary operationSummary = new OperationSummary();<NEW_LINE><MASK><NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>if (context.testExpression("OperationId", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>operationSummary.setOperationId(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("Status", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>operationSummary.setStatus(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("Type", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>operationSummary.setType(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("SubmittedDate", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>operationSummary.setSubmittedDate(DateJsonUnmarshallerFactory.getInstance("unixTimestamp").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 operationSummary;<NEW_LINE>}
int originalDepth = context.getCurrentDepth();
354,701
public void takePicture(final Map<String, Object> options, final int viewTag, final Promise promise) {<NEW_LINE>final File cacheDirectory = getContext().getCacheDir();<NEW_LINE>addUIBlock(viewTag, new UIManager.UIBlock<ExpoCameraView>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void resolve(ExpoCameraView view) {<NEW_LINE>if (!Build.FINGERPRINT.contains("generic")) {<NEW_LINE>if (view.isCameraOpened()) {<NEW_LINE>view.takePicture(options, promise, cacheDirectory);<NEW_LINE>} else {<NEW_LINE>promise.reject("E_CAMERA_UNAVAILABLE", "Camera is not running");<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>Bitmap image = CameraViewHelper.generateSimulatorPhoto(view.getWidth(), view.getHeight());<NEW_LINE>new ResolveTakenPictureAsyncTask(image, promise, options, cacheDirectory, view).execute();<NEW_LINE>}<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void reject(Throwable throwable) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>});<NEW_LINE>}
promise.reject(ERROR_TAG, throwable);
837,699
static void clearCaches(@Nonnull PsiFile injected, @Nonnull DocumentWindowImpl documentWindow) {<NEW_LINE>VirtualFileWindowImpl virtualFile = (VirtualFileWindowImpl) injected.getVirtualFile();<NEW_LINE>PsiManagerEx psiManagerEx = <MASK><NEW_LINE>if (psiManagerEx.getProject().isDisposed())<NEW_LINE>return;<NEW_LINE>DebugUtil.performPsiModification("injected clearCaches", () -> psiManagerEx.getFileManager().setViewProvider(virtualFile, null));<NEW_LINE>VirtualFile delegate = virtualFile.getDelegate();<NEW_LINE>if (!delegate.isValid())<NEW_LINE>return;<NEW_LINE>FileViewProvider viewProvider = psiManagerEx.getFileManager().findCachedViewProvider(delegate);<NEW_LINE>if (viewProvider == null)<NEW_LINE>return;<NEW_LINE>for (PsiFile hostFile : ((AbstractFileViewProvider) viewProvider).getCachedPsiFiles()) {<NEW_LINE>// modification of cachedInjectedDocuments must be under InjectedLanguageManagerImpl.ourInjectionPsiLock<NEW_LINE>synchronized (InjectedLanguageManagerImpl.ourInjectionPsiLock) {<NEW_LINE>List<DocumentWindow> cachedInjectedDocuments = getCachedInjectedDocuments(hostFile);<NEW_LINE>for (int i = cachedInjectedDocuments.size() - 1; i >= 0; i--) {<NEW_LINE>DocumentWindow cachedInjectedDocument = cachedInjectedDocuments.get(i);<NEW_LINE>if (cachedInjectedDocument == documentWindow) {<NEW_LINE>cachedInjectedDocuments.remove(i);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
(PsiManagerEx) injected.getManager();
1,555,665
private void performDocking() {<NEW_LINE>if (isAlive()) {<NEW_LINE>switch(anchorControlPosition.getPosition()) {<NEW_LINE>case DockPosition.TOP_LEFT:<NEW_LINE>dockedShell.setLocation(mainShell.toDisplay(anchorControl.getLocation()));<NEW_LINE>break;<NEW_LINE>case DockPosition.TOP_RIGHT:<NEW_LINE>break;<NEW_LINE>case DockPosition.BOTTOM_LEFT:<NEW_LINE>{<NEW_LINE>Point p = mainShell.toDisplay(anchorControl.getLocation());<NEW_LINE>p.x += anchorControlPosition.getOffset().xOffset;<NEW_LINE>p.y += anchorControlPosition.getOffset().yOffset;<NEW_LINE>p.y += anchorControl.getSize().y;<NEW_LINE>dockedShell.setLocation(p);<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>case DockPosition.BOTTOM_RIGHT:<NEW_LINE>{<NEW_LINE>Point p = mainShell.<MASK><NEW_LINE>p.x += anchorControlPosition.getOffset().xOffset;<NEW_LINE>p.y += anchorControlPosition.getOffset().yOffset;<NEW_LINE>p.x += anchorControl.getSize().x;<NEW_LINE>p.y += anchorControl.getSize().y;<NEW_LINE>dockedShell.setLocation(p);<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
toDisplay(anchorControl.getLocation());
1,790,659
public void deleteFiles(Iterable<String> paths) throws BulkDeletionFailureException {<NEW_LINE>if (awsProperties.s3DeleteTags() != null && !awsProperties.s3DeleteTags().isEmpty()) {<NEW_LINE>Tasks.foreach(paths).noRetry().executeWith(executorService()).suppressFailureWhenFinished().onFailure((path, exc) -> LOG.warn("Failed to add delete tags: {} to {}", awsProperties.s3DeleteTags(), path, exc)).run(path -> tagFileToDelete(path, awsProperties.s3DeleteTags()));<NEW_LINE>}<NEW_LINE>if (!awsProperties.isS3DeleteEnabled()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>SetMultimap<String, String> bucketToObjects = Multimaps.newSetMultimap(Maps.newHashMap(), Sets::newHashSet);<NEW_LINE>int numberOfFailedDeletions = 0;<NEW_LINE>for (String path : paths) {<NEW_LINE>S3URI location = new S3URI(path, awsProperties.s3BucketToAccessPointMapping());<NEW_LINE>String bucket = location.bucket();<NEW_LINE>String objectKey = location.key();<NEW_LINE>Set<String> objectsInBucket = bucketToObjects.get(bucket);<NEW_LINE>if (objectsInBucket.size() == awsProperties.s3FileIoDeleteBatchSize()) {<NEW_LINE>List<String> <MASK><NEW_LINE>numberOfFailedDeletions += failedDeletionsForBatch.size();<NEW_LINE>failedDeletionsForBatch.forEach(failedPath -> LOG.warn("Failed to delete object at path {}", failedPath));<NEW_LINE>bucketToObjects.removeAll(bucket);<NEW_LINE>}<NEW_LINE>bucketToObjects.get(bucket).add(objectKey);<NEW_LINE>}<NEW_LINE>// Delete the remainder<NEW_LINE>for (Map.Entry<String, Collection<String>> bucketToObjectsEntry : bucketToObjects.asMap().entrySet()) {<NEW_LINE>final String bucket = bucketToObjectsEntry.getKey();<NEW_LINE>final Collection<String> objects = bucketToObjectsEntry.getValue();<NEW_LINE>List<String> failedDeletions = deleteObjectsInBucket(bucket, objects);<NEW_LINE>failedDeletions.forEach(failedPath -> LOG.warn("Failed to delete object at path {}", failedPath));<NEW_LINE>numberOfFailedDeletions += failedDeletions.size();<NEW_LINE>}<NEW_LINE>if (numberOfFailedDeletions > 0) {<NEW_LINE>throw new BulkDeletionFailureException(numberOfFailedDeletions);<NEW_LINE>}<NEW_LINE>}
failedDeletionsForBatch = deleteObjectsInBucket(bucket, objectsInBucket);
1,149,216
public com.amazonaws.services.gluedatabrew.model.InternalServerException unmarshallFromContext(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>com.amazonaws.services.gluedatabrew.model.InternalServerException internalServerException = new com.amazonaws.services.gluedatabrew.model.InternalServerException(null);<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>} 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 internalServerException;<NEW_LINE>}
JsonToken token = context.getCurrentToken();
861,772
/*<NEW_LINE>* (non-Javadoc)<NEW_LINE>*<NEW_LINE>* @see javax.swing.event.ChangeListener#stateChanged(javax.swing.event. ChangeEvent)<NEW_LINE>*/<NEW_LINE>public void stateChanged(ChangeEvent e) {<NEW_LINE>if (e.getSource() == ftp) {<NEW_LINE>// This event is sent when the FTPClient has no more data in the 'todo' queue<NEW_LINE>// and there are no additional operations pending. We use our checkbox to<NEW_LINE>// determine if we should auto-hideButton.<NEW_LINE>progressBars.removeAll();<NEW_LINE>cancelButton.setEnabled(false);<NEW_LINE>hideButton.setText("Close");<NEW_LINE>if (autohide.isSelected())<NEW_LINE>setVisible(false);<NEW_LINE>} else {<NEW_LINE>FTPTransferObject fto = (FTPTransferObject) e.getSource();<NEW_LINE>JProgressBar bar;<NEW_LINE>if (fto.complete) {<NEW_LINE>// Transfer complete so remove from panel and allow the slot to be reused.<NEW_LINE>bar = bars.remove(fto);<NEW_LINE>if (bar != null) {<NEW_LINE>bar.setValue(fto.currentPosition);<NEW_LINE>countDown.setText(--numFiles + " file(s) remaining");<NEW_LINE>progressBars.remove(bar);<NEW_LINE>}<NEW_LINE>if (cancelling) {<NEW_LINE>// If it's a cancelButton request, delete the completely transferred file.<NEW_LINE>log.error("Canceled; removing " + fto.remoteDir + fto.remote);<NEW_LINE>ftp.remove(fto.remoteDir + "/" + fto.remote);<NEW_LINE>}<NEW_LINE>} else if (bars.containsKey(fto)) {<NEW_LINE>bar = bars.get(fto);<NEW_LINE>bar.setValue(fto.currentPosition);<NEW_LINE>} else {<NEW_LINE>// New FTO that's not being shown yet...<NEW_LINE>bar = new JProgressBar();<NEW_LINE>bar.setStringPainted(true);<NEW_LINE>// bar.setString(fto.remoteDir + fto.remote);<NEW_LINE><MASK><NEW_LINE>bars.put(fto, bar);<NEW_LINE>progressBars.add(bar);<NEW_LINE>pack();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
bar.setMaximum(fto.maximumPosition);
1,235,222
public WeightedPaths singleSourceShortestPaths(Id sourceV, Directions dir, String label, String weight, long degree, long skipDegree, long capacity, long limit) {<NEW_LINE>E.checkNotNull(sourceV, "source vertex id");<NEW_LINE>this.checkVertexExist(sourceV, "source vertex");<NEW_LINE>E.checkNotNull(dir, "direction");<NEW_LINE>checkDegree(degree);<NEW_LINE>checkCapacity(capacity);<NEW_LINE>checkSkipDegree(skipDegree, degree, capacity);<NEW_LINE>checkLimit(limit);<NEW_LINE>Id labelId = this.getEdgeLabelId(label);<NEW_LINE>Traverser traverser = new Traverser(sourceV, dir, labelId, weight, <MASK><NEW_LINE>while (true) {<NEW_LINE>// Found, reach max depth or reach capacity, stop searching<NEW_LINE>traverser.forward();<NEW_LINE>if (traverser.done()) {<NEW_LINE>return traverser.shortestPaths();<NEW_LINE>}<NEW_LINE>checkCapacity(traverser.capacity, traverser.size, "shortest path");<NEW_LINE>}<NEW_LINE>}
degree, skipDegree, capacity, limit);
1,162,571
public static DescribeVulMachineListResponse unmarshall(DescribeVulMachineListResponse describeVulMachineListResponse, UnmarshallerContext context) {<NEW_LINE>describeVulMachineListResponse.setRequestId(context.stringValue("DescribeVulMachineListResponse.RequestId"));<NEW_LINE>describeVulMachineListResponse.setTotalCount(context.integerValue("DescribeVulMachineListResponse.TotalCount"));<NEW_LINE>List<MachineStatistic> machineStatistics = new ArrayList<MachineStatistic>();<NEW_LINE>for (int i = 0; i < context.lengthValue("DescribeVulMachineListResponse.MachineStatistics.Length"); i++) {<NEW_LINE>MachineStatistic machineStatistic = new MachineStatistic();<NEW_LINE>machineStatistic.setUuid(context.stringValue("DescribeVulMachineListResponse.MachineStatistics[" + i + "].Uuid"));<NEW_LINE>machineStatistic.setCveNum(context.integerValue<MASK><NEW_LINE>machineStatistic.setEmgNum(context.integerValue("DescribeVulMachineListResponse.MachineStatistics[" + i + "].EmgNum"));<NEW_LINE>machineStatistic.setSysNum(context.integerValue("DescribeVulMachineListResponse.MachineStatistics[" + i + "].SysNum"));<NEW_LINE>machineStatistic.setCmsNum(context.integerValue("DescribeVulMachineListResponse.MachineStatistics[" + i + "].CmsNum"));<NEW_LINE>machineStatistic.setCmsDealedTotalNum(context.integerValue("DescribeVulMachineListResponse.MachineStatistics[" + i + "].CmsDealedTotalNum"));<NEW_LINE>machineStatistic.setVulDealedTotalNum(context.integerValue("DescribeVulMachineListResponse.MachineStatistics[" + i + "].VulDealedTotalNum"));<NEW_LINE>machineStatistic.setVulAsapSum(context.integerValue("DescribeVulMachineListResponse.MachineStatistics[" + i + "].VulAsapSum"));<NEW_LINE>machineStatistic.setVulLaterSum(context.integerValue("DescribeVulMachineListResponse.MachineStatistics[" + i + "].VulLaterSum"));<NEW_LINE>machineStatistic.setVulNntfSum(context.integerValue("DescribeVulMachineListResponse.MachineStatistics[" + i + "].VulNntfSum"));<NEW_LINE>machineStatistic.setVulSeriousTotal(context.integerValue("DescribeVulMachineListResponse.MachineStatistics[" + i + "].VulSeriousTotal"));<NEW_LINE>machineStatistic.setVulHighTotal(context.integerValue("DescribeVulMachineListResponse.MachineStatistics[" + i + "].VulHighTotal"));<NEW_LINE>machineStatistic.setVulMediumTotal(context.integerValue("DescribeVulMachineListResponse.MachineStatistics[" + i + "].VulMediumTotal"));<NEW_LINE>machineStatistic.setVulLowTotal(context.integerValue("DescribeVulMachineListResponse.MachineStatistics[" + i + "].VulLowTotal"));<NEW_LINE>machineStatistics.add(machineStatistic);<NEW_LINE>}<NEW_LINE>describeVulMachineListResponse.setMachineStatistics(machineStatistics);<NEW_LINE>return describeVulMachineListResponse;<NEW_LINE>}
("DescribeVulMachineListResponse.MachineStatistics[" + i + "].CveNum"));
85,441
ArmeriaServerConfigurator serverConfigurator(Optional<ZipkinQueryApiV2> httpQuery, Optional<ZipkinHttpCollector> httpCollector, Optional<ZipkinHealthController> healthController, Optional<ZipkinMetricsController> metricsController, Optional<MeterRegistry> meterRegistry, Optional<CollectorRegistry> collectorRegistry, @Value("${zipkin.query.timeout:11s}") Duration queryTimeout) {<NEW_LINE>return sb -> {<NEW_LINE>httpQuery.ifPresent(h -> {<NEW_LINE>Function<HttpService, HttpService> timeoutDecorator = service -> (ctx, req) -> {<NEW_LINE>ctx.setRequestTimeout(queryTimeout);<NEW_LINE>return service.serve(ctx, req);<NEW_LINE>};<NEW_LINE>sb.annotatedService(httpQuery.get(), timeoutDecorator);<NEW_LINE>// For UI.<NEW_LINE>sb.annotatedService("/zipkin", httpQuery.get(), timeoutDecorator);<NEW_LINE>});<NEW_LINE>httpCollector.ifPresent(sb::annotatedService);<NEW_LINE>healthController.ifPresent(sb::annotatedService);<NEW_LINE><MASK><NEW_LINE>collectorRegistry.ifPresent(registry -> {<NEW_LINE>PrometheusExpositionService prometheusService = new PrometheusExpositionService(registry);<NEW_LINE>sb.service("/actuator/prometheus", prometheusService);<NEW_LINE>sb.service("/prometheus", prometheusService);<NEW_LINE>});<NEW_LINE>// Directly implement info endpoint, but use different content type for the /actuator path<NEW_LINE>sb.service("/actuator/info", infoService(MEDIA_TYPE_ACTUATOR));<NEW_LINE>sb.service("/info", infoService(MediaType.JSON_UTF_8));<NEW_LINE>// It's common for backend requests to have timeouts of the magic number 10s, so we go ahead<NEW_LINE>// and default to a slightly longer timeout on the server to be able to handle these with<NEW_LINE>// better error messages where possible.<NEW_LINE>sb.requestTimeout(Duration.ofSeconds(11));<NEW_LINE>// Block TRACE requests because https://github.com/openzipkin/zipkin/issues/2286<NEW_LINE>sb.routeDecorator().trace("prefix:/").build((delegate, ctx, req) -> HttpResponse.of(HttpStatus.METHOD_NOT_ALLOWED));<NEW_LINE>};<NEW_LINE>}
metricsController.ifPresent(sb::annotatedService);
1,488,331
public Request<DescribeLifecycleHooksRequest> marshall(DescribeLifecycleHooksRequest describeLifecycleHooksRequest) {<NEW_LINE>if (describeLifecycleHooksRequest == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>Request<DescribeLifecycleHooksRequest> request = new DefaultRequest<DescribeLifecycleHooksRequest>(describeLifecycleHooksRequest, "AmazonAutoScaling");<NEW_LINE>request.addParameter("Action", "DescribeLifecycleHooks");<NEW_LINE>request.addParameter("Version", "2011-01-01");<NEW_LINE>request.setHttpMethod(HttpMethodName.POST);<NEW_LINE>if (describeLifecycleHooksRequest.getAutoScalingGroupName() != null) {<NEW_LINE>request.addParameter("AutoScalingGroupName", StringUtils.fromString<MASK><NEW_LINE>}<NEW_LINE>if (!describeLifecycleHooksRequest.getLifecycleHookNames().isEmpty() || !((com.amazonaws.internal.SdkInternalList<String>) describeLifecycleHooksRequest.getLifecycleHookNames()).isAutoConstruct()) {<NEW_LINE>com.amazonaws.internal.SdkInternalList<String> lifecycleHookNamesList = (com.amazonaws.internal.SdkInternalList<String>) describeLifecycleHooksRequest.getLifecycleHookNames();<NEW_LINE>int lifecycleHookNamesListIndex = 1;<NEW_LINE>for (String lifecycleHookNamesListValue : lifecycleHookNamesList) {<NEW_LINE>if (lifecycleHookNamesListValue != null) {<NEW_LINE>request.addParameter("LifecycleHookNames.member." + lifecycleHookNamesListIndex, StringUtils.fromString(lifecycleHookNamesListValue));<NEW_LINE>}<NEW_LINE>lifecycleHookNamesListIndex++;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return request;<NEW_LINE>}
(describeLifecycleHooksRequest.getAutoScalingGroupName()));
1,228,845
final UpdatePullRequestApprovalStateResult executeUpdatePullRequestApprovalState(UpdatePullRequestApprovalStateRequest updatePullRequestApprovalStateRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(updatePullRequestApprovalStateRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE><MASK><NEW_LINE>Request<UpdatePullRequestApprovalStateRequest> request = null;<NEW_LINE>Response<UpdatePullRequestApprovalStateResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new UpdatePullRequestApprovalStateRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(updatePullRequestApprovalStateRequest));<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, "CodeCommit");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "UpdatePullRequestApprovalState");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<UpdatePullRequestApprovalStateResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new UpdatePullRequestApprovalStateResultJsonUnmarshaller());<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);
487,671
private ResponseData<Boolean> processSetPubKey(String type, String weAddress, String owner, String pubKey, String privateKey, boolean isDelegate) {<NEW_LINE>try {<NEW_LINE>String attributeKey = new StringBuffer().append(WeIdConstant.WEID_DOC_PUBLICKEY_PREFIX).append("/").append(type).append("/").append("base64").toString();<NEW_LINE>String attrValue = new StringBuffer().append(pubKey).append(WeIdConstant.SEPARATOR).append(owner).toString();<NEW_LINE>return weIdServiceEngine.setAttribute(weAddress, attributeKey, attrValue, privateKey, isDelegate);<NEW_LINE>} catch (PrivateKeyIllegalException e) {<NEW_LINE>logger.error("[addPublicKey] set PublicKey failed because privateKey is illegal. ", e);<NEW_LINE>return new ResponseData<>(false, e.getErrorCode());<NEW_LINE>} catch (Exception e) {<NEW_LINE><MASK><NEW_LINE>return new ResponseData<>(false, ErrorCode.UNKNOW_ERROR);<NEW_LINE>}<NEW_LINE>}
logger.error("[addPublicKey] set PublicKey failed with exception. ", e);
360,354
public static LeafSlice[] slices(List<LeafReaderContext> leaves, int maxDocsPerSlice, int maxSegmentsPerSlice) {<NEW_LINE>// Make a copy so we can sort:<NEW_LINE>List<LeafReaderContext> sortedLeaves <MASK><NEW_LINE>// Sort by maxDoc, descending:<NEW_LINE>Collections.sort(sortedLeaves, Collections.reverseOrder(Comparator.comparingInt(l -> l.reader().maxDoc())));<NEW_LINE>final List<List<LeafReaderContext>> groupedLeaves = new ArrayList<>();<NEW_LINE>long docSum = 0;<NEW_LINE>List<LeafReaderContext> group = null;<NEW_LINE>for (LeafReaderContext ctx : sortedLeaves) {<NEW_LINE>if (ctx.reader().maxDoc() > maxDocsPerSlice) {<NEW_LINE>assert group == null;<NEW_LINE>groupedLeaves.add(Collections.singletonList(ctx));<NEW_LINE>} else {<NEW_LINE>if (group == null) {<NEW_LINE>group = new ArrayList<>();<NEW_LINE>group.add(ctx);<NEW_LINE>groupedLeaves.add(group);<NEW_LINE>} else {<NEW_LINE>group.add(ctx);<NEW_LINE>}<NEW_LINE>docSum += ctx.reader().maxDoc();<NEW_LINE>if (group.size() >= maxSegmentsPerSlice || docSum > maxDocsPerSlice) {<NEW_LINE>group = null;<NEW_LINE>docSum = 0;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>LeafSlice[] slices = new LeafSlice[groupedLeaves.size()];<NEW_LINE>int upto = 0;<NEW_LINE>for (List<LeafReaderContext> currentLeaf : groupedLeaves) {<NEW_LINE>slices[upto] = new LeafSlice(currentLeaf);<NEW_LINE>++upto;<NEW_LINE>}<NEW_LINE>return slices;<NEW_LINE>}
= new ArrayList<>(leaves);
701,762
private JPanel createLegendPane() {<NEW_LINE>JPanel legendPanel = new JPanel();<NEW_LINE>legendPanel.setLayout(new FlowLayout(FlowLayout.LEFT, 0, 0));<NEW_LINE>legendPanel.setBorder(// $NON-NLS-1$<NEW_LINE>BorderFactory.// $NON-NLS-1$<NEW_LINE>createTitledBorder(JMeterUtils.getResString("aggregate_graph_legend")));<NEW_LINE>// $NON-NLS-1$<NEW_LINE>legendPanel.// $NON-NLS-1$<NEW_LINE>add(// $NON-NLS-1$<NEW_LINE>GuiUtils.// $NON-NLS-1$<NEW_LINE>createLabelCombo(JMeterUtils.getResString("aggregate_graph_legend_placement"), legendPlacementList));<NEW_LINE>// $NON-NLS-1$ // default: bottom<NEW_LINE>legendPlacementList.setSelectedItem(JMeterUtils.getResString("aggregate_graph_legend.placement.bottom"));<NEW_LINE>// $NON-NLS-1$<NEW_LINE>legendPanel.// $NON-NLS-1$<NEW_LINE>add(// $NON-NLS-1$<NEW_LINE>GuiUtils.// $NON-NLS-1$<NEW_LINE>createLabelCombo(JMeterUtils.getResString("aggregate_graph_font"), fontNameList));<NEW_LINE>// default: sans serif<NEW_LINE>fontNameList.setSelectedIndex(0);<NEW_LINE>// $NON-NLS-1$<NEW_LINE>legendPanel.// $NON-NLS-1$<NEW_LINE>add(// $NON-NLS-1$<NEW_LINE>GuiUtils.// $NON-NLS-1$<NEW_LINE>createLabelCombo(JMeterUtils.getResString("aggregate_graph_size"), fontSizeList));<NEW_LINE>// default: 10<NEW_LINE>fontSizeList.setSelectedItem(StatGraphProperties.getFontSize()[2]);<NEW_LINE>// $NON-NLS-1$<NEW_LINE>legendPanel.// $NON-NLS-1$<NEW_LINE>add(// $NON-NLS-1$<NEW_LINE>GuiUtils.// $NON-NLS-1$<NEW_LINE>createLabelCombo(JMeterUtils.<MASK><NEW_LINE>// $NON-NLS-1$ // default: normal<NEW_LINE>fontStyleList.setSelectedItem(JMeterUtils.getResString("fontstyle.normal"));<NEW_LINE>return legendPanel;<NEW_LINE>}
getResString("aggregate_graph_style"), fontStyleList));
591,146
public static RepositoryConnection parse(String str) {<NEW_LINE>String[] fields = str.split(RC_DELIMITER);<NEW_LINE>int l = fields.length;<NEW_LINE>String url = fields[0];<NEW_LINE>String username = l > 1 && !fields[1].equals(""<MASK><NEW_LINE>String password = l > 2 && !fields[2].equals("") ? Scrambler.getInstance().descramble(fields[2]) : null;<NEW_LINE>String extCmd = l > 3 && !fields[3].equals("") ? fields[3] : null;<NEW_LINE>boolean save = l > 4 && !fields[4].equals("") ? Boolean.parseBoolean(fields[4]) : true;<NEW_LINE>String certFile = l > 5 && !fields[5].equals("") ? fields[5] : null;<NEW_LINE>String certPassword = l > 6 && !fields[6].equals("") ? Scrambler.getInstance().descramble(fields[6]) : null;<NEW_LINE>String portNumberString = l > 7 ? fields[7] : "-1";<NEW_LINE>int portNumber = -1;<NEW_LINE>try {<NEW_LINE>portNumber = Integer.parseInt(portNumberString);<NEW_LINE>} catch (NumberFormatException ex) {<NEW_LINE>}<NEW_LINE>return new RepositoryConnection(url, username, password == null ? null : password.toCharArray(), extCmd, save, certFile, certPassword == null ? null : certPassword.toCharArray(), portNumber);<NEW_LINE>}
) ? fields[1] : null;
730,424
public void run() {<NEW_LINE>ILogger logger = raftNode.getLogger(getClass());<NEW_LINE>RaftState state = raftNode.state();<NEW_LINE>LeaderState leaderState = state.leaderState();<NEW_LINE>if (leaderState == null) {<NEW_LINE>logger.fine("Not retrying leadership transfer since not leader...");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>LeadershipTransferState leadershipTransferState = state.leadershipTransferState();<NEW_LINE><MASK><NEW_LINE>if (retryCount == maxRetryCount) {<NEW_LINE>String msg = "Leadership transfer to " + leadershipTransferState.endpoint() + " timed out!";<NEW_LINE>logger.warning(msg);<NEW_LINE>state.completeLeadershipTransfer(new IllegalStateException(msg));<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>RaftEndpoint targetEndpoint = leadershipTransferState.endpoint();<NEW_LINE>if (state.commitIndex() < state.log().lastLogOrSnapshotIndex()) {<NEW_LINE>logger.warning("Waiting until all appended entries to be committed before transferring leadership to " + targetEndpoint);<NEW_LINE>reschedule();<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (retryCount > 0) {<NEW_LINE>logger.fine("Retrying leadership transfer to " + leadershipTransferState.endpoint());<NEW_LINE>} else {<NEW_LINE>logger.info("Transferring leadership to " + leadershipTransferState.endpoint());<NEW_LINE>}<NEW_LINE>leaderState.getFollowerState(targetEndpoint).appendRequestAckReceived();<NEW_LINE>raftNode.sendAppendRequest(targetEndpoint);<NEW_LINE>LogEntry entry = state.log().lastLogOrSnapshotEntry();<NEW_LINE>raftNode.send(new TriggerLeaderElection(raftNode.getLocalMember(), state.term(), entry.term(), entry.index()), targetEndpoint);<NEW_LINE>reschedule();<NEW_LINE>}
checkTrue(leadershipTransferState != null, "No leadership transfer state!");
993,072
private ContentValues generateContentValuesForSinglePartTransfer(TransferType type, String bucket, String key, File file, ObjectMetadata metadata, CannedAccessControlList cannedAcl, TransferUtilityOptions tuOptions) {<NEW_LINE>final ContentValues values = new ContentValues();<NEW_LINE>values.put(TransferTable.<MASK><NEW_LINE>values.put(TransferTable.COLUMN_STATE, TransferState.WAITING.toString());<NEW_LINE>values.put(TransferTable.COLUMN_BUCKET_NAME, bucket);<NEW_LINE>values.put(TransferTable.COLUMN_KEY, key);<NEW_LINE>values.put(TransferTable.COLUMN_FILE, file.getAbsolutePath());<NEW_LINE>values.put(TransferTable.COLUMN_BYTES_CURRENT, 0L);<NEW_LINE>if (type.equals(TransferType.UPLOAD)) {<NEW_LINE>values.put(TransferTable.COLUMN_BYTES_TOTAL, file == null ? 0L : file.length());<NEW_LINE>}<NEW_LINE>values.put(TransferTable.COLUMN_IS_MULTIPART, 0);<NEW_LINE>values.put(TransferTable.COLUMN_PART_NUM, 0);<NEW_LINE>values.put(TransferTable.COLUMN_IS_ENCRYPTED, 0);<NEW_LINE>values.putAll(generateContentValuesForObjectMetadata(metadata));<NEW_LINE>if (cannedAcl != null) {<NEW_LINE>values.put(TransferTable.COLUMN_CANNED_ACL, cannedAcl.toString());<NEW_LINE>}<NEW_LINE>if (tuOptions != null) {<NEW_LINE>values.put(TransferTable.COLUMN_TRANSFER_UTILITY_OPTIONS, gson.toJson(tuOptions));<NEW_LINE>}<NEW_LINE>return values;<NEW_LINE>}
COLUMN_TYPE, type.toString());
1,466,254
void checkThreadPoolLeak(ExecutorService e, Exception stackTraceEx) {<NEW_LINE>if (this.detectionLevel == ThreadLeakDetectionLevel.None) {<NEW_LINE>// Not doing anything in this case.<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (!e.isShutdown()) {<NEW_LINE>log.warn("THREAD POOL LEAK: {} (ShutDown={}, Terminated={}) finalized without being properly shut down.", e, e.isShutdown(), e.isTerminated(), stackTraceEx);<NEW_LINE>if (this.detectionLevel == ThreadLeakDetectionLevel.Aggressive) {<NEW_LINE>// Not pretty, but outputting this stack trace on System.err helps with those unit tests that turned off<NEW_LINE>// logging.<NEW_LINE><MASK><NEW_LINE>log.error("THREAD POOL LEAK DETECTED WITH LEVEL SET TO {}. SHUTTING DOWN.", ThreadLeakDetectionLevel.Aggressive);<NEW_LINE>this.onLeakDetected.run();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
stackTraceEx.printStackTrace(System.err);
1,586,722
protected <T extends JpaObject> String idleApplicationAlias(Business business, String name, String excludeId) throws Exception {<NEW_LINE>if (StringUtils.isEmpty(name)) {<NEW_LINE>return "";<NEW_LINE>}<NEW_LINE>List<String> list = new ArrayList<>();<NEW_LINE>list.add(name);<NEW_LINE>for (int i = 1; i < 99; i++) {<NEW_LINE>list.add(name + String.format("%02d", i));<NEW_LINE>}<NEW_LINE>list.add(StringTools.uniqueToken());<NEW_LINE>EntityManager em = business.entityManagerContainer().get(Application.class);<NEW_LINE><MASK><NEW_LINE>CriteriaQuery<String> cq = cb.createQuery(String.class);<NEW_LINE>Root<Application> root = cq.from(Application.class);<NEW_LINE>Predicate p = root.get(Application_.alias).in(list);<NEW_LINE>if (StringUtils.isNotEmpty(excludeId)) {<NEW_LINE>p = cb.and(p, cb.notEqual(root.get(JpaObject.id_FIELDNAME), excludeId));<NEW_LINE>}<NEW_LINE>cq.select(root.get(Application_.alias)).where(p);<NEW_LINE>List<String> os = em.createQuery(cq).getResultList();<NEW_LINE>list = ListUtils.subtract(list, os);<NEW_LINE>return list.get(0);<NEW_LINE>}
CriteriaBuilder cb = em.getCriteriaBuilder();
1,679,241
public boolean parseResource(HttpMessage message, Source source, int depth) {<NEW_LINE>String baseURL = message.getRequestHeader().getURI().toString();<NEW_LINE>// Content-location header<NEW_LINE>String location = message.getResponseHeader().getHeader(HttpHeader.CONTENT_LOCATION);<NEW_LINE>if (location != null && !location.isEmpty()) {<NEW_LINE>processURL(message, depth, location, baseURL);<NEW_LINE>}<NEW_LINE>// Refresh header<NEW_LINE>String refresh = message.getResponseHeader().getHeader(HttpHeader.REFRESH);<NEW_LINE>if (refresh != null && !refresh.isEmpty()) {<NEW_LINE>Matcher matcher = SpiderHtmlParser.URL_PATTERN.matcher(refresh);<NEW_LINE>if (matcher.find()) {<NEW_LINE>String url = matcher.group(1);<NEW_LINE>processURL(message, depth, url, baseURL);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Link header - potentially multiple absolute or relative URLs in < ><NEW_LINE>String link = message.getResponseHeader(<MASK><NEW_LINE>if (link != null && !link.isEmpty()) {<NEW_LINE>int offset = 0;<NEW_LINE>while (true) {<NEW_LINE>int i = link.indexOf("<", offset);<NEW_LINE>if (i < 0) {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>int j = link.indexOf(">", i);<NEW_LINE>if (j < 0) {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>processURL(message, depth, link.substring(i + 1, j), baseURL);<NEW_LINE>offset = j;<NEW_LINE>}<NEW_LINE>processURL(message, depth, location, baseURL);<NEW_LINE>}<NEW_LINE>// We do not consider the message fully parsed<NEW_LINE>return false;<NEW_LINE>}
).getHeader(HttpHeader.LINK);
1,355,082
boolean compare(Object op1, Object op2) {<NEW_LINE>if (op1 == null || op2 == null) {<NEW_LINE>throw new TemplateException("Unable to compare null operands [op1=" + op1 + ", op2=" + op2 + "]");<NEW_LINE>}<NEW_LINE>Comparable c1;<NEW_LINE>Comparable c2;<NEW_LINE>if (op1 instanceof Comparable && op1.getClass().equals(op2.getClass())) {<NEW_LINE>c1 = (Comparable) op1;<NEW_LINE>c2 = (Comparable) op2;<NEW_LINE>} else {<NEW_LINE><MASK><NEW_LINE>c2 = Operator.getDecimal(op2);<NEW_LINE>}<NEW_LINE>int result = c1.compareTo(c2);<NEW_LINE>switch(this) {<NEW_LINE>case GE:<NEW_LINE>return result >= 0;<NEW_LINE>case GT:<NEW_LINE>return result > 0;<NEW_LINE>case LE:<NEW_LINE>return result <= 0;<NEW_LINE>case LT:<NEW_LINE>return result < 0;<NEW_LINE>default:<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>}
c1 = Operator.getDecimal(op1);
1,814,225
public void processMessage(final WebSocketMessage webSocketData) {<NEW_LINE>setDoTransactionNotifications(true);<NEW_LINE>final Class<Relation> relType = StructrApp.getConfiguration().getRelationshipEntityClass("DOMNodeSYNCDOMNode");<NEW_LINE>final SecurityContext securityContext <MASK><NEW_LINE>final String sourceId = webSocketData.getId();<NEW_LINE>final String targetId = webSocketData.getNodeDataStringValue("targetId");<NEW_LINE>final String syncMode = webSocketData.getNodeDataStringValue("syncMode");<NEW_LINE>final DOMNode sourceNode = (DOMNode) getNode(sourceId);<NEW_LINE>final DOMNode targetNode = (DOMNode) getNode(targetId);<NEW_LINE>final App app = StructrApp.getInstance(securityContext);<NEW_LINE>if ((sourceNode != null) && (targetNode != null)) {<NEW_LINE>try {<NEW_LINE>app.create(sourceNode, targetNode, relType);<NEW_LINE>if (syncMode.equals("bidir")) {<NEW_LINE>app.create(targetNode, sourceNode, relType);<NEW_LINE>}<NEW_LINE>} catch (Throwable t) {<NEW_LINE>getWebSocket().send(MessageBuilder.status().code(400).message(t.getMessage()).build(), true);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>getWebSocket().send(MessageBuilder.status().code(400).message("The SYNC_MODE command needs id and targetId!").build(), true);<NEW_LINE>}<NEW_LINE>}
= getWebSocket().getSecurityContext();
671,780
private static Queue<?> traceQueue(ConfigurableApplicationContext springContext, Queue<?> queue) {<NEW_LINE>if (!springContext.isActive()) {<NEW_LINE>return queue;<NEW_LINE>}<NEW_LINE>CurrentTraceContext currentTraceContext = springContext.getBean(CurrentTraceContext.class);<NEW_LINE>@SuppressWarnings("unchecked")<NEW_LINE>Queue envelopeQueue = queue;<NEW_LINE>return new AbstractQueue<Object>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public int size() {<NEW_LINE>return envelopeQueue.size();<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public boolean offer(Object o) {<NEW_LINE>TraceContext traceContext = currentTraceContext.context();<NEW_LINE>return envelopeQueue.offer(new Envelope(o, traceContext));<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public Object poll() {<NEW_LINE><MASK><NEW_LINE>if (object == null) {<NEW_LINE>return null;<NEW_LINE>} else if (object instanceof Envelope) {<NEW_LINE>Envelope envelope = (Envelope) object;<NEW_LINE>restoreTheContext(envelope);<NEW_LINE>return envelope.body;<NEW_LINE>}<NEW_LINE>return object;<NEW_LINE>}<NEW_LINE><NEW_LINE>private void restoreTheContext(Envelope envelope) {<NEW_LINE>if (envelope.traceContext != null) {<NEW_LINE>currentTraceContext.maybeScope(envelope.traceContext);<NEW_LINE>}<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public Object peek() {<NEW_LINE>Object peek = queue.peek();<NEW_LINE>if (peek instanceof Envelope) {<NEW_LINE>Envelope envelope = (Envelope) peek;<NEW_LINE>restoreTheContext(envelope);<NEW_LINE>return (envelope).body;<NEW_LINE>}<NEW_LINE>return peek;<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>@SuppressWarnings("unchecked")<NEW_LINE>public Iterator<Object> iterator() {<NEW_LINE>Iterator<?> iterator = queue.iterator();<NEW_LINE>return new Iterator<Object>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public boolean hasNext() {<NEW_LINE>return iterator.hasNext();<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public Object next() {<NEW_LINE>Object next = iterator.next();<NEW_LINE>if (next instanceof Envelope) {<NEW_LINE>Envelope envelope = (Envelope) next;<NEW_LINE>restoreTheContext(envelope);<NEW_LINE>return (envelope).body;<NEW_LINE>}<NEW_LINE>return next;<NEW_LINE>}<NEW_LINE>};<NEW_LINE>}<NEW_LINE>};<NEW_LINE>}
Object object = envelopeQueue.poll();
1,074,733
private void populateAttributes(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) {<NEW_LINE>primaryColor = MiscUtils.getColor(getContext(), R.attr.colorPrimary);<NEW_LINE>screenWidth = MiscUtils.getScreenWidth(getContext());<NEW_LINE>tenDp = MiscUtils.dpToPixel(getContext(), 10);<NEW_LINE>maxFixedItemWidth = MiscUtils.dpToPixel(getContext(), 168);<NEW_LINE>TypedArray ta = context.getTheme().obtainStyledAttributes(attrs, R.styleable.BottomBar, defStyleAttr, defStyleRes);<NEW_LINE>try {<NEW_LINE>tabXmlResource = ta.getResourceId(R.styleable.BottomBar_bb_tabXmlResource, 0);<NEW_LINE>isTabletMode = ta.getBoolean(R.styleable.BottomBar_bb_tabletMode, false);<NEW_LINE>behaviors = ta.getInteger(R.styleable.BottomBar_bb_behavior, BEHAVIOR_NONE);<NEW_LINE>inActiveTabAlpha = ta.getFloat(R.styleable.BottomBar_bb_inActiveTabAlpha, isShiftingMode() ? DEFAULT_INACTIVE_SHIFTING_TAB_ALPHA : 1);<NEW_LINE>activeTabAlpha = ta.getFloat(R.styleable.BottomBar_bb_activeTabAlpha, 1);<NEW_LINE>@ColorInt<NEW_LINE>int defaultInActiveColor = isShiftingMode() ? Color.WHITE : ContextCompat.getColor(context, R.color.bb_inActiveBottomBarItemColor);<NEW_LINE>int defaultActiveColor = isShiftingMode() ? Color.WHITE : primaryColor;<NEW_LINE>longPressHintsEnabled = ta.getBoolean(R.styleable.BottomBar_bb_longPressHintsEnabled, true);<NEW_LINE>inActiveTabColor = ta.getColor(R.styleable.BottomBar_bb_inActiveTabColor, defaultInActiveColor);<NEW_LINE>activeTabColor = ta.getColor(R.styleable.BottomBar_bb_activeTabColor, defaultActiveColor);<NEW_LINE>badgeBackgroundColor = ta.getColor(R.styleable.BottomBar_bb_badgeBackgroundColor, Color.RED);<NEW_LINE>hideBadgeWhenActive = ta.getBoolean(R.styleable.BottomBar_bb_badgesHideWhenActive, true);<NEW_LINE>titleTextAppearance = ta.getResourceId(R.styleable.BottomBar_bb_titleTextAppearance, 0);<NEW_LINE>titleTypeFace = getTypeFaceFromAsset(ta.getString(R.styleable.BottomBar_bb_titleTypeFace));<NEW_LINE>showShadow = ta.getBoolean(<MASK><NEW_LINE>} finally {<NEW_LINE>ta.recycle();<NEW_LINE>}<NEW_LINE>}
R.styleable.BottomBar_bb_showShadow, true);
1,574,422
public boolean init(String uri, final SnapshotThrottle snapshotThrottle, final SnapshotCopierOptions opts) {<NEW_LINE>this.rpcService = opts.getRaftClientService();<NEW_LINE>this.timerManager = opts.getTimerManager();<NEW_LINE>this.raftOptions = opts.getRaftOptions();<NEW_LINE>this.snapshotThrottle = snapshotThrottle;<NEW_LINE>final int prefixSize = Snapshot.REMOTE_SNAPSHOT_URI_SCHEME.length();<NEW_LINE>if (uri == null || !uri.startsWith(Snapshot.REMOTE_SNAPSHOT_URI_SCHEME)) {<NEW_LINE>LOG.error("Invalid uri {}.", uri);<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>final int slasPos = uri.indexOf('/');<NEW_LINE>final String ipAndPort = uri.substring(0, slasPos);<NEW_LINE>uri = uri.substring(slasPos + 1);<NEW_LINE>try {<NEW_LINE>this.readId = Long.parseLong(uri);<NEW_LINE>final String[] ipAndPortStrs = ipAndPort.split(":");<NEW_LINE>this.endpoint = new Endpoint(ipAndPortStrs[0], Integer.parseInt(ipAndPortStrs[1]));<NEW_LINE>} catch (final Exception e) {<NEW_LINE>LOG.error("Fail to parse readerId or endpoint.", e);<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>if (!this.rpcService.connect(this.endpoint)) {<NEW_LINE>LOG.error("Fail to init channel to {}.", this.endpoint);<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>}
uri = uri.substring(prefixSize);
376,039
private void writePage(Page page) {<NEW_LINE>int[] writerIndexes = getWriterIndexes(page);<NEW_LINE>// position count for each writer<NEW_LINE>int[] sizes = new int[writers.size()];<NEW_LINE>for (int index : writerIndexes) {<NEW_LINE>sizes[index]++;<NEW_LINE>}<NEW_LINE>// record which positions are used by which writer<NEW_LINE>int[][] writerPositions = new int[writers.size()][];<NEW_LINE>int[] counts = new int[writers.size()];<NEW_LINE>for (int position = 0; position < page.getPositionCount(); position++) {<NEW_LINE>int index = writerIndexes[position];<NEW_LINE>int count = counts[index];<NEW_LINE>if (count == 0) {<NEW_LINE>writerPositions[index] = new int[sizes[index]];<NEW_LINE>}<NEW_LINE>writerPositions[index][count] = position;<NEW_LINE>counts[index] = count + 1;<NEW_LINE>}<NEW_LINE>// invoke the writers<NEW_LINE>Page dataPage = getDataPage(page);<NEW_LINE>for (int index = 0; index < writerPositions.length; index++) {<NEW_LINE>int[] positions = writerPositions[index];<NEW_LINE>if (positions == null) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>// If write is partitioned across multiple writers, filter page using dictionary blocks<NEW_LINE>Page pageForWriter = dataPage;<NEW_LINE>if (positions.length != dataPage.getPositionCount()) {<NEW_LINE>verify(positions.length == counts[index]);<NEW_LINE>pageForWriter = pageForWriter.getPositions(positions, 0, positions.length);<NEW_LINE>}<NEW_LINE>HiveWriter writer = writers.get(index);<NEW_LINE>long currentWritten = writer.getWrittenBytes();<NEW_LINE><MASK><NEW_LINE>writer.append(pageForWriter);<NEW_LINE>writtenBytes += (writer.getWrittenBytes() - currentWritten);<NEW_LINE>systemMemoryUsage += (writer.getSystemMemoryUsage() - currentMemory);<NEW_LINE>}<NEW_LINE>}
long currentMemory = writer.getSystemMemoryUsage();
1,221,138
private ExecutionTimeResult potentialNextClosestMatch(final ZonedDateTime date) throws NoSuchValueException {<NEW_LINE>final List<Integer> year = yearsValueGenerator.generateCandidates(date.getYear(), date.getYear()).stream().filter(d -> d >= date.getYear()).collect(Collectors.toList());<NEW_LINE>final int lowestMonth = months.getValues().get(0);<NEW_LINE>final int lowestHour = hours.getValues().get(0);<NEW_LINE>final int lowestMinute = minutes.getValues().get(0);<NEW_LINE>final int lowestSecond = seconds.getValues().get(0);<NEW_LINE>if (year.isEmpty()) {<NEW_LINE>return getNextPotentialYear(date, lowestMonth, lowestHour, lowestMinute, lowestSecond);<NEW_LINE>}<NEW_LINE>if (!months.getValues().contains(date.getMonthValue())) {<NEW_LINE>return getNextPotentialMonth(date, lowestHour, lowestMinute, lowestSecond);<NEW_LINE>}<NEW_LINE>final Optional<TimeNode> <MASK><NEW_LINE>if (!optionalDays.isPresent()) {<NEW_LINE>return new ExecutionTimeResult(toBeginOfNextMonth(date), false);<NEW_LINE>}<NEW_LINE>final TimeNode node = optionalDays.get();<NEW_LINE>if (!node.getValues().contains(date.getDayOfMonth())) {<NEW_LINE>return getNextPotentialDayOfMonth(date, lowestHour, lowestMinute, lowestSecond, node);<NEW_LINE>}<NEW_LINE>if (!hours.getValues().contains(date.getHour())) {<NEW_LINE>return getNextPotentialHour(date);<NEW_LINE>}<NEW_LINE>if (!minutes.getValues().contains(date.getMinute())) {<NEW_LINE>return getNextPotentialMinute(date);<NEW_LINE>}<NEW_LINE>if (!seconds.getValues().contains(date.getSecond())) {<NEW_LINE>return getNextPotentialSecond(date);<NEW_LINE>}<NEW_LINE>return new ExecutionTimeResult(date, true);<NEW_LINE>}
optionalDays = generateDays(cronDefinition, date);
1,443,478
private void addRouteWalk(TransportRouteResultSegment s1, TransportRouteResultSegment s2, LatLon start, LatLon end, List<Way> res, List<GeometryWayStyle<?>> styles) {<NEW_LINE>final RouteCalculationResult walkingRouteSegment = transportHelper.getWalkingRouteSegment(s1, s2);<NEW_LINE>if (walkingRouteSegment != null && walkingRouteSegment.getRouteLocations().size() > 0) {<NEW_LINE>final List<Location> routeLocations = walkingRouteSegment.getRouteLocations();<NEW_LINE>Way way = new Way(TransportRoutePlanner.GEOMETRY_WAY_ID);<NEW_LINE>way.putTag(OSMSettings.OSMTagKey.NAME.getValue(), String.format(Locale.US, "Walk %d m", walkingRouteSegment.getWholeDistance()));<NEW_LINE>for (Location l : routeLocations) {<NEW_LINE>way.addNode(new Node(l.getLatitude(), l.getLongitude(), -1));<NEW_LINE>}<NEW_LINE>res.add(way);<NEW_LINE>addStyle(null, Collections.singletonList(way), styles);<NEW_LINE>} else {<NEW_LINE>double dist = MapUtils.getDistance(start, end);<NEW_LINE>Way way = new Way(TransportRoutePlanner.GEOMETRY_WAY_ID);<NEW_LINE>way.putTag(OSMSettings.OSMTagKey.NAME.getValue(), String.format(Locale<MASK><NEW_LINE>way.addNode(new Node(start.getLatitude(), start.getLongitude(), -1));<NEW_LINE>way.addNode(new Node(end.getLatitude(), end.getLongitude(), -1));<NEW_LINE>res.add(way);<NEW_LINE>addStyle(null, Collections.singletonList(way), styles);<NEW_LINE>}<NEW_LINE>}
.US, "Walk %.1f m", dist));