idx
int32
46
1.86M
input
stringlengths
321
6.6k
target
stringlengths
9
1.24k
1,156,005
public Row nextRecord(Row row) throws IOException {<NEW_LINE>try {<NEW_LINE>QueryResult result = conn.query(new Query(this.query + " LIMIT 1 OFFSET " + offset));<NEW_LINE>if (result == null) {<NEW_LINE>hasNext = false;<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>List<QueryResult.Result> results = result.getResults();<NEW_LINE>if (CollectionUtils.isEmpty(results)) {<NEW_LINE>hasNext = false;<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>List<QueryResult.Series> series = results.get(0).getSeries();<NEW_LINE>if (CollectionUtils.isEmpty(series)) {<NEW_LINE>hasNext = false;<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>List<Object> values = series.get(0).getValues().get(0);<NEW_LINE>for (int i = 0; i < fields.size(); i++) {<NEW_LINE>row.setField(i, values.get(i));<NEW_LINE>}<NEW_LINE>offset++;<NEW_LINE>return row;<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new IOException("Couldn't read data - " + <MASK><NEW_LINE>}<NEW_LINE>}
e.getMessage(), e);
1,507,014
public OperationResult show(Screen screen) {<NEW_LINE>checkNotNullArgument(screen);<NEW_LINE>checkNotYetOpened(screen);<NEW_LINE>if (isMaxTabCountExceeded(screen)) {<NEW_LINE>showTooManyOpenTabsMessage();<NEW_LINE>return OperationResult.fail();<NEW_LINE>}<NEW_LINE>StopWatch uiPermissionsWatch = createStopWatch(ScreenLifeCycle.<MASK><NEW_LINE>windowCreationHelper.applyUiPermissions(screen.getWindow());<NEW_LINE>uiPermissionsWatch.stop();<NEW_LINE>StopWatch beforeShowWatch = createStopWatch(ScreenLifeCycle.BEFORE_SHOW, screen.getId());<NEW_LINE>applyDataLoadingSettings(screen);<NEW_LINE>fireEvent(screen, BeforeShowEvent.class, new BeforeShowEvent(screen));<NEW_LINE>loadDataBeforeShow(screen);<NEW_LINE>beforeShowWatch.stop();<NEW_LINE>LaunchMode launchMode = screen.getWindow().getContext().getLaunchMode();<NEW_LINE>if (launchMode instanceof OpenMode) {<NEW_LINE>OpenMode openMode = (OpenMode) launchMode;<NEW_LINE>switch(openMode) {<NEW_LINE>case ROOT:<NEW_LINE>showRootWindow(screen);<NEW_LINE>break;<NEW_LINE>case THIS_TAB:<NEW_LINE>showThisTabWindow(screen);<NEW_LINE>break;<NEW_LINE>case NEW_WINDOW:<NEW_LINE>case NEW_TAB:<NEW_LINE>showNewTabWindow(screen);<NEW_LINE>break;<NEW_LINE>case DIALOG:<NEW_LINE>showDialogWindow(screen);<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>throw new UnsupportedOperationException("Unsupported OpenMode " + openMode);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>userActionsLog.trace("Screen {} {} opened", screen.getId(), screen.getClass());<NEW_LINE>afterShowWindow(screen);<NEW_LINE>changeUrl(screen);<NEW_LINE>StopWatch afterShowWatch = createStopWatch(ScreenLifeCycle.AFTER_SHOW, screen.getId());<NEW_LINE>fireEvent(screen, AfterShowEvent.class, new AfterShowEvent(screen));<NEW_LINE>afterShowWatch.stop();<NEW_LINE>events.publish(new ScreenOpenedEvent(screen));<NEW_LINE>screenProfiler.initProfilerMarkerForWindow(screen.getId());<NEW_LINE>return OperationResult.success();<NEW_LINE>}
UI_PERMISSIONS, screen.getId());
1,466,993
static protected DecoderInputs readDecoderInputs(final int nsymbols, final InputBitStream ibs, final StringBuilder sb) throws IOException {<NEW_LINE>final int min = ibs.readNibble();<NEW_LINE>final int max = ibs.readNibble();<NEW_LINE>if (sb != null)<NEW_LINE>sb.append("min=" + min + ", max=" + max + "\n");<NEW_LINE>final int[] length = new int[nsymbols];<NEW_LINE>final int[] symbol = new int[nsymbols];<NEW_LINE>// the current code length<NEW_LINE>int codeSize = min;<NEW_LINE>int lastSymbol = 0;<NEW_LINE>while (codeSize <= max) {<NEW_LINE>final int sizeCount = ibs.readNibble();<NEW_LINE>if (sb != null)<NEW_LINE>sb.append("codeSize=" + codeSize + ", sizeCount=" + sizeCount + ", symbols=[");<NEW_LINE>for (int i = 0; i < sizeCount; i++, lastSymbol++) {<NEW_LINE>final int tmp = ibs.readNibble();<NEW_LINE>if (sb != null)<NEW_LINE>sb.append(" " + tmp);<NEW_LINE>length[lastSymbol] = codeSize;<NEW_LINE>symbol[lastSymbol] = tmp;<NEW_LINE>}<NEW_LINE>if (sb != null)<NEW_LINE>sb.append(" ]\n");<NEW_LINE>codeSize++;<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>final BitVector shortestCodeWord = LongArrayBitVector.getInstance().length(shortestCodeWordLength);<NEW_LINE>for (int i = shortestCodeWordLength - 1; i >= 0; i--) {<NEW_LINE>shortestCodeWord.set(i, ibs.readBit());<NEW_LINE>}<NEW_LINE>if (sb != null) {<NEW_LINE>sb.append("shortestCodeWord=" + shortestCodeWord + "\n");<NEW_LINE>}<NEW_LINE>return new DecoderInputs(shortestCodeWord, length, symbol);<NEW_LINE>}
final int shortestCodeWordLength = length[0];
1,311,159
public static int[] extractArcs(ASN1ObjectIdentifier oid) throws InvalidObjectIdException {<NEW_LINE><MASK><NEW_LINE>StringTokenizer strTokCnt = new StringTokenizer(oidStr, ".", false);<NEW_LINE>int arcCount = strTokCnt.countTokens();<NEW_LINE>StringTokenizer strTok = new StringTokenizer(oidStr, ".", true);<NEW_LINE>boolean expectDelimiter = false;<NEW_LINE>int[] arcs = new int[arcCount];<NEW_LINE>int i = 0;<NEW_LINE>while (strTok.hasMoreTokens()) {<NEW_LINE>String token = strTok.nextToken();<NEW_LINE>if (expectDelimiter && (!token.equals(".") || !strTok.hasMoreTokens())) {<NEW_LINE>throw new InvalidObjectIdException(res.getString("InvalidOidNotNonNegativeIntSequence.exception.message"));<NEW_LINE>} else if (!expectDelimiter) {<NEW_LINE>try {<NEW_LINE>arcs[i] = Integer.parseInt(token);<NEW_LINE>if (arcs[i] < 0) {<NEW_LINE>throw new InvalidObjectIdException(res.getString("InvalidOidNotNonNegativeIntSequence.exception.message"));<NEW_LINE>}<NEW_LINE>i++;<NEW_LINE>} catch (NumberFormatException ex) {<NEW_LINE>throw new InvalidObjectIdException(res.getString("InvalidOidNotNonNegativeIntSequence.exception.message"));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>expectDelimiter = !expectDelimiter;<NEW_LINE>}<NEW_LINE>return arcs;<NEW_LINE>}
String oidStr = oid.getId();
240,770
public static List<String> check(ByteBuffer data) {<NEW_LINE>List<String> messages = new ArrayList<String>();<NEW_LINE>int frameSize = data.getInt();<NEW_LINE>if (!"icpf".equals(ProresDecoder.readSig(data))) {<NEW_LINE>messages.add("[ERROR] Missing ProRes signature (icpf).");<NEW_LINE>return messages;<NEW_LINE>}<NEW_LINE>short headerSize = data.getShort();<NEW_LINE>if (headerSize > 148) {<NEW_LINE>messages.add("[ERROR] Wrong ProRes frame header.");<NEW_LINE>return messages;<NEW_LINE>}<NEW_LINE>short version = data.getShort();<NEW_LINE>int res1 = data.getInt();<NEW_LINE>short width = data.getShort();<NEW_LINE><MASK><NEW_LINE>if (width < 0 || width > 10000 || height < 0 || height > 10000) {<NEW_LINE>messages.add("[ERROR] Wrong ProRes frame header, invalid image size [" + width + "x" + height + "].");<NEW_LINE>return messages;<NEW_LINE>}<NEW_LINE>int flags1 = data.get();<NEW_LINE>data.position(data.position() + headerSize - 13);<NEW_LINE>if (((flags1 >> 2) & 3) == 0) {<NEW_LINE>checkPicture(data, width, height, messages);<NEW_LINE>} else {<NEW_LINE>checkPicture(data, width, height / 2, messages);<NEW_LINE>checkPicture(data, width, height / 2, messages);<NEW_LINE>}<NEW_LINE>return messages;<NEW_LINE>}
short height = data.getShort();
724,265
private Notification create() {<NEW_LINE>Type type = this.type.getSettingValue();<NEW_LINE>Color foreground = HtmlColors.decode(foregroundColor.getSettingValue());<NEW_LINE>Color background = HtmlColors.decode(backgroundColor.getSettingValue());<NEW_LINE>Notification.Builder b = new Notification.Builder(type);<NEW_LINE>b.setDesktopEnabled(desktopState.getSettingValue());<NEW_LINE>b.setSoundEnabled(soundState.getSettingValue());<NEW_LINE>b.setForeground(foreground);<NEW_LINE>b.setBackground(background);<NEW_LINE>b.setSoundFile(soundFile.getSettingValue());<NEW_LINE>b.setVolume(volumeSlider.getSettingValue());<NEW_LINE>b.setSoundCooldown(soundCooldown.getSettingValue(0L).intValue());<NEW_LINE>b.setSoundInactiveCooldown(soundInactiveCooldown.getSettingValue(0L).intValue());<NEW_LINE>b.setChannels(channels.getSettingValue());<NEW_LINE>b.<MASK><NEW_LINE>b.setOptions(getSubTypes());<NEW_LINE>current = new Notification(b);<NEW_LINE>return current;<NEW_LINE>}
setMatcher(matcher.getSettingValue());
1,444,264
private void gatherAllProvides(Node root) {<NEW_LINE>if (!processClosurePrimitives) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>Node externs = root.getFirstChild();<NEW_LINE>Node js = root.getSecondChild();<NEW_LINE>Map<String, ProvidedName> providedNames = new ProcessClosureProvidesAndRequires(compiler, /* preserveGoogProvidesAndRequires= */<NEW_LINE>true).collectProvidedNames(externs, js);<NEW_LINE>for (ProvidedName name : providedNames.values()) {<NEW_LINE>if (name.getCandidateDefinition() != null) {<NEW_LINE>// This name will be defined eventually in the source code.<NEW_LINE>Node firstDefinitionNode = name.getCandidateDefinition();<NEW_LINE>if (NodeUtil.isExprAssign(firstDefinitionNode) && firstDefinitionNode.getFirstFirstChild().isName()) {<NEW_LINE>// Treat assignments of provided names as declarations.<NEW_LINE>undeclaredNamesForClosure.add(firstDefinitionNode.getFirstFirstChild());<NEW_LINE>}<NEW_LINE>} else if (name.getFirstProvideCall() != null && NodeUtil.isExprCall(name.getFirstProvideCall()) && !name.isFromLegacyModule()) {<NEW_LINE>// This name is implicitly created by a goog.provide call; declare it in the scope once<NEW_LINE>// reaching the provide call. The exception is legacy goog.modules, which are declared<NEW_LINE>// once leaving the module.<NEW_LINE>providedNamesFromCall.put(<MASK><NEW_LINE>}<NEW_LINE>if (name.isExplicitlyProvided() && !name.isFromLegacyModule()) {<NEW_LINE>typeRegistry.registerLegacyClosureNamespace(name.getNamespace());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
name.getFirstProvideCall(), name);
532,763
public int onStartCommand(Intent intent, int flags, int startId) {<NEW_LINE>// Update widget<NEW_LINE>WidgetHelper.updateWidgets(getApplicationContext());<NEW_LINE>CharSequence tickerText = getText(R.string.notification_ticker);<NEW_LINE>Intent stopRecordingIntent = new Intent();<NEW_LINE>stopRecordingIntent.setAction(ACTION_STOP_RECORDING);<NEW_LINE>// Have to make this unique for God knows what reason<NEW_LINE>stopRecordingIntent.setData(Uri.withAppendedPath(Uri.parse(URI_SCHEME + "://stop/"), Long.toHexString(new Random().nextLong())));<NEW_LINE>@SuppressLint("WrongConstant")<NEW_LINE>PendingIntent pendingIntent = PendingIntent.getBroadcast(this, 0, /* no requestCode */<NEW_LINE>stopRecordingIntent, PendingIntent.FLAG_ONE_SHOT | PendingIntentCompat.FLAG_IMMUTABLE);<NEW_LINE>final String CHANNEL_ID = "matlog_logging_channel";<NEW_LINE>// Set the icon, scrolling text and timestamp<NEW_LINE>NotificationCompat.Builder notification = new NotificationCompat.Builder(getApplicationContext(), CHANNEL_ID);<NEW_LINE>notification.setSmallIcon(R.drawable.ic_launcher_foreground);<NEW_LINE>notification.setTicker(tickerText);<NEW_LINE>notification.setWhen(System.currentTimeMillis());<NEW_LINE>notification.setContentTitle(getString<MASK><NEW_LINE>notification.setContentText(getString(R.string.notification_subtext));<NEW_LINE>notification.setContentIntent(pendingIntent);<NEW_LINE>NotificationUtils.getNewNotificationManager(this, CHANNEL_ID, "Logcat Recording Service", NotificationManagerCompat.IMPORTANCE_DEFAULT);<NEW_LINE>startForeground(R.string.notification_title, notification.build());<NEW_LINE>return super.onStartCommand(intent, flags, startId);<NEW_LINE>}
(R.string.notification_title));
1,511,654
public Block parseBlock(RawBlock rawBlock) throws BlockHashNotConnectingException, BlockHeightNotConnectingException {<NEW_LINE>long startTs = System.currentTimeMillis();<NEW_LINE>int blockHeight = rawBlock.getHeight();<NEW_LINE>log.trace("Parse block at height={} ", blockHeight);<NEW_LINE>validateIfBlockIsConnecting(rawBlock);<NEW_LINE>daoStateService.onNewBlockHeight(blockHeight);<NEW_LINE>// We create a block from the rawBlock but the transaction list is not set yet (is empty)<NEW_LINE>final Block block = new Block(blockHeight, rawBlock.getTime(), rawBlock.getHash(), rawBlock.getPreviousBlockHash());<NEW_LINE>if (isBlockAlreadyAdded(rawBlock)) {<NEW_LINE>log.warn("Block was already added.");<NEW_LINE><MASK><NEW_LINE>} else {<NEW_LINE>daoStateService.onNewBlockWithEmptyTxs(block);<NEW_LINE>}<NEW_LINE>// Worst case is that all txs in a block are depending on another, so only one get resolved at each iteration.<NEW_LINE>// Min tx size is 189 bytes (normally about 240 bytes), 1 MB can contain max. about 5300 txs (usually 2000).<NEW_LINE>// Realistically we don't expect more than a few recursive calls.<NEW_LINE>// There are some blocks with testing such dependency chains like block 130768 where at each iteration only<NEW_LINE>// one get resolved.<NEW_LINE>// Lately there is a patter with 24 iterations observed<NEW_LINE>rawBlock.getRawTxs().forEach(rawTx -> txParser.findTx(rawTx, genesisTxId, genesisBlockHeight, genesisTotalSupply).ifPresent(tx -> daoStateService.onNewTxForLastBlock(block, tx)));<NEW_LINE>daoStateService.onParseBlockComplete(block);<NEW_LINE>long duration = System.currentTimeMillis() - startTs;<NEW_LINE>if (duration > 10) {<NEW_LINE>log.info("Parsing {} transactions at block height {} took {} ms", rawBlock.getRawTxs().size(), blockHeight, duration);<NEW_LINE>}<NEW_LINE>return block;<NEW_LINE>}
DevEnv.logErrorAndThrowIfDevMode("Block was already added. rawBlock=" + rawBlock);
1,507,610
public void end(InterpretationContext ec, String tagName) {<NEW_LINE>// pop the action data object pushed in isApplicable() method call<NEW_LINE>// we assume that each this begin<NEW_LINE>IADataForComplexProperty actionData = (IADataForComplexProperty) actionDataStack.pop();<NEW_LINE>if (actionData.inError) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>PropertySetter nestedBean = new PropertySetter(actionData.getNestedComplexProperty());<NEW_LINE>nestedBean.setContext(context);<NEW_LINE>// have the nested element point to its parent if possible<NEW_LINE>if (nestedBean.computeAggregationType("parent") == AggregationType.AS_COMPLEX_PROPERTY) {<NEW_LINE>nestedBean.setComplexProperty("parent", actionData.parentBean.getObj());<NEW_LINE>}<NEW_LINE>// start the nested complex property if it implements LifeCycle and is not<NEW_LINE>// marked with a @NoAutoStart annotation<NEW_LINE><MASK><NEW_LINE>if (nestedComplexProperty instanceof LifeCycle && NoAutoStartUtil.notMarkedWithNoAutoStart(nestedComplexProperty)) {<NEW_LINE>((LifeCycle) nestedComplexProperty).start();<NEW_LINE>}<NEW_LINE>Object o = ec.peekObject();<NEW_LINE>if (o != actionData.getNestedComplexProperty()) {<NEW_LINE>addError("The object on the top the of the stack is not the component pushed earlier.");<NEW_LINE>} else {<NEW_LINE>ec.popObject();<NEW_LINE>// Now let us attach the component<NEW_LINE>switch(actionData.aggregationType) {<NEW_LINE>case AS_COMPLEX_PROPERTY:<NEW_LINE>actionData.parentBean.setComplexProperty(tagName, actionData.getNestedComplexProperty());<NEW_LINE>break;<NEW_LINE>case AS_COMPLEX_PROPERTY_COLLECTION:<NEW_LINE>actionData.parentBean.addComplexProperty(tagName, actionData.getNestedComplexProperty());<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>addError("Unexpected aggregationType " + actionData.aggregationType);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
Object nestedComplexProperty = actionData.getNestedComplexProperty();
298,395
private float[][] swapResults(MatrixLocations srcData, MatrixLocations dstData, float[] times, float[] distances, float[] weights) {<NEW_LINE>boolean hasTimes = times != null;<NEW_LINE>boolean hasDistances = distances != null;<NEW_LINE>boolean hasWeights = weights != null;<NEW_LINE>float[] newTimes = new float[hasTimes ? times.length : 0];<NEW_LINE>float[] newDistances = new float[<MASK><NEW_LINE>float[] newWeights = new float[hasWeights ? weights.length : 0];<NEW_LINE>int i = 0;<NEW_LINE>int srcSize = srcData.size();<NEW_LINE>int dstSize = dstData.size();<NEW_LINE>for (int dst = 0; dst < dstSize; dst++) {<NEW_LINE>for (int src = 0; src < srcSize; src++) {<NEW_LINE>int index = dst + src * dstSize;<NEW_LINE>if (hasTimes)<NEW_LINE>newTimes[index] = times[i];<NEW_LINE>if (hasDistances)<NEW_LINE>newDistances[index] = distances[i];<NEW_LINE>if (hasWeights)<NEW_LINE>newWeights[index] = weights[i];<NEW_LINE>i++;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return new float[][] { newTimes, newDistances, newWeights };<NEW_LINE>}
hasDistances ? distances.length : 0];
934,752
protected void onCreate(Bundle savedInstanceState) {<NEW_LINE>super.onCreate(savedInstanceState);<NEW_LINE><MASK><NEW_LINE>youTubePlayerView = findViewById(R.id.youtube_player_view);<NEW_LINE>mediaRouteButtonRoot = findViewById(R.id.media_route_button_root);<NEW_LINE>chromeCastControlsRoot = findViewById(R.id.chromecast_controls_root);<NEW_LINE>getLifecycle().addObserver(youTubePlayerView);<NEW_LINE>notificationManager = new NotificationManager(this, ChromeCastExampleActivity.class);<NEW_LINE>youTubePlayersManager = new YouTubePlayersManager(this, youTubePlayerView, chromeCastControlsRoot, notificationManager, getLifecycle());<NEW_LINE>mediaRouteButton = MediaRouteButtonUtils.initMediaRouteButton(this);<NEW_LINE>registerBroadcastReceiver();<NEW_LINE>// can't use CastContext until I'm sure the user has GooglePlayServices<NEW_LINE>PlayServicesUtils.checkGooglePlayServicesAvailability(this, googlePlayServicesAvailabilityRequestCode, this::initChromeCast);<NEW_LINE>}
setContentView(R.layout.activity_chromecast_example);
1,186,121
public static GetExecutionDetailsOfPredictiveJobResponse unmarshall(GetExecutionDetailsOfPredictiveJobResponse getExecutionDetailsOfPredictiveJobResponse, UnmarshallerContext context) {<NEW_LINE>getExecutionDetailsOfPredictiveJobResponse.setRequestId(context.stringValue("GetExecutionDetailsOfPredictiveJobResponse.RequestId"));<NEW_LINE>getExecutionDetailsOfPredictiveJobResponse.setSuccess<MASK><NEW_LINE>getExecutionDetailsOfPredictiveJobResponse.setCode(context.stringValue("GetExecutionDetailsOfPredictiveJobResponse.Code"));<NEW_LINE>getExecutionDetailsOfPredictiveJobResponse.setMessage(context.stringValue("GetExecutionDetailsOfPredictiveJobResponse.Message"));<NEW_LINE>getExecutionDetailsOfPredictiveJobResponse.setHttpStatusCode(context.integerValue("GetExecutionDetailsOfPredictiveJobResponse.HttpStatusCode"));<NEW_LINE>Job job = new Job();<NEW_LINE>job.setJobId(context.stringValue("GetExecutionDetailsOfPredictiveJobResponse.Job.JobId"));<NEW_LINE>job.setJobGroupId(context.stringValue("GetExecutionDetailsOfPredictiveJobResponse.Job.JobGroupId"));<NEW_LINE>job.setStrategyId(context.stringValue("GetExecutionDetailsOfPredictiveJobResponse.Job.StrategyId"));<NEW_LINE>job.setStatus(context.stringValue("GetExecutionDetailsOfPredictiveJobResponse.Job.Status"));<NEW_LINE>job.setFailureReason(context.stringValue("GetExecutionDetailsOfPredictiveJobResponse.Job.FailureReason"));<NEW_LINE>List<String> callingNumbers = new ArrayList<String>();<NEW_LINE>for (int i = 0; i < context.lengthValue("GetExecutionDetailsOfPredictiveJobResponse.Job.CallingNumbers.Length"); i++) {<NEW_LINE>callingNumbers.add(context.stringValue("GetExecutionDetailsOfPredictiveJobResponse.Job.CallingNumbers[" + i + "]"));<NEW_LINE>}<NEW_LINE>job.setCallingNumbers(callingNumbers);<NEW_LINE>List<Task> tasks = new ArrayList<Task>();<NEW_LINE>for (int i = 0; i < context.lengthValue("GetExecutionDetailsOfPredictiveJobResponse.Job.Tasks.Length"); i++) {<NEW_LINE>Task task = new Task();<NEW_LINE>task.setTaskId(context.stringValue("GetExecutionDetailsOfPredictiveJobResponse.Job.Tasks[" + i + "].TaskId"));<NEW_LINE>task.setJobId(context.stringValue("GetExecutionDetailsOfPredictiveJobResponse.Job.Tasks[" + i + "].JobId"));<NEW_LINE>task.setPlanedTime(context.longValue("GetExecutionDetailsOfPredictiveJobResponse.Job.Tasks[" + i + "].PlanedTime"));<NEW_LINE>task.setActualTime(context.longValue("GetExecutionDetailsOfPredictiveJobResponse.Job.Tasks[" + i + "].ActualTime"));<NEW_LINE>task.setEndTime(context.longValue("GetExecutionDetailsOfPredictiveJobResponse.Job.Tasks[" + i + "].EndTime"));<NEW_LINE>task.setCallingNumber(context.stringValue("GetExecutionDetailsOfPredictiveJobResponse.Job.Tasks[" + i + "].CallingNumber"));<NEW_LINE>task.setCalledNumber(context.stringValue("GetExecutionDetailsOfPredictiveJobResponse.Job.Tasks[" + i + "].CalledNumber"));<NEW_LINE>task.setCallId(context.stringValue("GetExecutionDetailsOfPredictiveJobResponse.Job.Tasks[" + i + "].CallId"));<NEW_LINE>task.setStatus(context.stringValue("GetExecutionDetailsOfPredictiveJobResponse.Job.Tasks[" + i + "].Status"));<NEW_LINE>task.setDuration(context.integerValue("GetExecutionDetailsOfPredictiveJobResponse.Job.Tasks[" + i + "].Duration"));<NEW_LINE>Contact contact = new Contact();<NEW_LINE>contact.setContactId(context.stringValue("GetExecutionDetailsOfPredictiveJobResponse.Job.Tasks[" + i + "].Contact.ContactId"));<NEW_LINE>contact.setContactName(context.stringValue("GetExecutionDetailsOfPredictiveJobResponse.Job.Tasks[" + i + "].Contact.ContactName"));<NEW_LINE>contact.setHonorific(context.stringValue("GetExecutionDetailsOfPredictiveJobResponse.Job.Tasks[" + i + "].Contact.Honorific"));<NEW_LINE>contact.setPhoneNumber(context.stringValue("GetExecutionDetailsOfPredictiveJobResponse.Job.Tasks[" + i + "].Contact.PhoneNumber"));<NEW_LINE>contact.setReferenceId(context.stringValue("GetExecutionDetailsOfPredictiveJobResponse.Job.Tasks[" + i + "].Contact.ReferenceId"));<NEW_LINE>contact.setJobId(context.stringValue("GetExecutionDetailsOfPredictiveJobResponse.Job.Tasks[" + i + "].Contact.JobId"));<NEW_LINE>task.setContact(contact);<NEW_LINE>tasks.add(task);<NEW_LINE>}<NEW_LINE>job.setTasks(tasks);<NEW_LINE>getExecutionDetailsOfPredictiveJobResponse.setJob(job);<NEW_LINE>return getExecutionDetailsOfPredictiveJobResponse;<NEW_LINE>}
(context.booleanValue("GetExecutionDetailsOfPredictiveJobResponse.Success"));
1,418,928
private void handleUpsert(ImmutableSegmentImpl immutableSegment) {<NEW_LINE>String segmentName = immutableSegment.getSegmentName();<NEW_LINE>int partitionGroupId = SegmentUtils.getRealtimeSegmentPartitionId(segmentName, _tableNameWithType, _helixManager, _primaryKeyColumns.get(0));<NEW_LINE>PartitionUpsertMetadataManager <MASK><NEW_LINE>ThreadSafeMutableRoaringBitmap validDocIds = new ThreadSafeMutableRoaringBitmap();<NEW_LINE>immutableSegment.enableUpsert(partitionUpsertMetadataManager, validDocIds);<NEW_LINE>Map<String, PinotSegmentColumnReader> columnToReaderMap = new HashMap<>();<NEW_LINE>for (String primaryKeyColumn : _primaryKeyColumns) {<NEW_LINE>columnToReaderMap.put(primaryKeyColumn, new PinotSegmentColumnReader(immutableSegment, primaryKeyColumn));<NEW_LINE>}<NEW_LINE>columnToReaderMap.put(_upsertComparisonColumn, new PinotSegmentColumnReader(immutableSegment, _upsertComparisonColumn));<NEW_LINE>int numTotalDocs = immutableSegment.getSegmentMetadata().getTotalDocs();<NEW_LINE>int numPrimaryKeyColumns = _primaryKeyColumns.size();<NEW_LINE>Iterator<PartitionUpsertMetadataManager.RecordInfo> recordInfoIterator = new Iterator<PartitionUpsertMetadataManager.RecordInfo>() {<NEW_LINE><NEW_LINE>private int _docId = 0;<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public boolean hasNext() {<NEW_LINE>return _docId < numTotalDocs;<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public PartitionUpsertMetadataManager.RecordInfo next() {<NEW_LINE>Object[] values = new Object[numPrimaryKeyColumns];<NEW_LINE>for (int i = 0; i < numPrimaryKeyColumns; i++) {<NEW_LINE>Object value = columnToReaderMap.get(_primaryKeyColumns.get(i)).getValue(_docId);<NEW_LINE>if (value instanceof byte[]) {<NEW_LINE>value = new ByteArray((byte[]) value);<NEW_LINE>}<NEW_LINE>values[i] = value;<NEW_LINE>}<NEW_LINE>PrimaryKey primaryKey = new PrimaryKey(values);<NEW_LINE>Object upsertComparisonValue = columnToReaderMap.get(_upsertComparisonColumn).getValue(_docId);<NEW_LINE>Preconditions.checkState(upsertComparisonValue instanceof Comparable, "Upsert comparison column: %s must be comparable", _upsertComparisonColumn);<NEW_LINE>return new PartitionUpsertMetadataManager.RecordInfo(primaryKey, _docId++, (Comparable) upsertComparisonValue);<NEW_LINE>}<NEW_LINE>};<NEW_LINE>partitionUpsertMetadataManager.addSegment(immutableSegment, recordInfoIterator);<NEW_LINE>}
partitionUpsertMetadataManager = _tableUpsertMetadataManager.getOrCreatePartitionManager(partitionGroupId);
1,278,948
public void removeAccessToken(String tokenValue) {<NEW_LINE>byte[] accessKey = serializeKey(ACCESS + tokenValue);<NEW_LINE>byte[] authKey = serializeKey(AUTH + tokenValue);<NEW_LINE>byte[] accessToRefreshKey = serializeKey(ACCESS_TO_REFRESH + tokenValue);<NEW_LINE>RedisConnection conn = getConnection();<NEW_LINE>try {<NEW_LINE>conn.openPipeline();<NEW_LINE>conn.get(accessKey);<NEW_LINE>conn.get(authKey);<NEW_LINE>conn.del(accessKey);<NEW_LINE>conn.del(accessToRefreshKey);<NEW_LINE>// Don't remove the refresh token - it's up to the caller to do that<NEW_LINE>conn.del(authKey);<NEW_LINE>List<Object> results = conn.closePipeline();<NEW_LINE>byte[] access = (byte[]) results.get(0);<NEW_LINE>byte[] auth = (byte[]) results.get(1);<NEW_LINE>OAuth2Authentication authentication = deserializeAuthentication(auth);<NEW_LINE>if (authentication != null) {<NEW_LINE>String key = authenticationKeyGenerator.extractKey(authentication);<NEW_LINE>byte[] authToAccessKey = serializeKey(AUTH_TO_ACCESS + key);<NEW_LINE>byte[] unameKey = serializeKey(UNAME_TO_ACCESS + getApprovalKey(authentication));<NEW_LINE>byte[] clientId = serializeKey(CLIENT_ID_TO_ACCESS + authentication.<MASK><NEW_LINE>conn.openPipeline();<NEW_LINE>conn.del(authToAccessKey);<NEW_LINE>conn.sRem(unameKey, access);<NEW_LINE>conn.sRem(clientId, access);<NEW_LINE>conn.del(serialize(ACCESS + key));<NEW_LINE>conn.closePipeline();<NEW_LINE>}<NEW_LINE>} finally {<NEW_LINE>conn.close();<NEW_LINE>}<NEW_LINE>}
getOAuth2Request().getClientId());
1,027,521
public void marshall(ContinuousExportDescription continuousExportDescription, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (continuousExportDescription == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(continuousExportDescription.getExportId(), EXPORTID_BINDING);<NEW_LINE>protocolMarshaller.marshall(continuousExportDescription.getStatus(), STATUS_BINDING);<NEW_LINE>protocolMarshaller.marshall(continuousExportDescription.getStatusDetail(), STATUSDETAIL_BINDING);<NEW_LINE>protocolMarshaller.marshall(continuousExportDescription.getS3Bucket(), S3BUCKET_BINDING);<NEW_LINE>protocolMarshaller.marshall(<MASK><NEW_LINE>protocolMarshaller.marshall(continuousExportDescription.getStopTime(), STOPTIME_BINDING);<NEW_LINE>protocolMarshaller.marshall(continuousExportDescription.getDataSource(), DATASOURCE_BINDING);<NEW_LINE>protocolMarshaller.marshall(continuousExportDescription.getSchemaStorageConfig(), SCHEMASTORAGECONFIG_BINDING);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>}
continuousExportDescription.getStartTime(), STARTTIME_BINDING);
695,380
public synchronized WebRtcServiceState terminate(@NonNull WebRtcServiceState currentState, @Nullable RemotePeer remotePeer) {<NEW_LINE>Log.i(tag, "terminate():");<NEW_LINE>RemotePeer activePeer = currentState<MASK><NEW_LINE>if (activePeer == null && remotePeer == null) {<NEW_LINE>Log.i(tag, "skipping with no active peer");<NEW_LINE>return currentState;<NEW_LINE>} else if (activePeer != null && !activePeer.callIdEquals(remotePeer)) {<NEW_LINE>Log.i(tag, "skipping remotePeer is not active peer");<NEW_LINE>return currentState;<NEW_LINE>} else {<NEW_LINE>activePeer = remotePeer;<NEW_LINE>}<NEW_LINE>ApplicationDependencies.getAppForegroundObserver().removeListener(webRtcInteractor.getForegroundListener());<NEW_LINE>webRtcInteractor.updatePhoneState(LockManager.PhoneState.PROCESSING);<NEW_LINE>boolean playDisconnectSound = (activePeer.getState() == CallState.DIALING) || (activePeer.getState() == CallState.REMOTE_RINGING) || (activePeer.getState() == CallState.RECEIVED_BUSY) || (activePeer.getState() == CallState.CONNECTED);<NEW_LINE>webRtcInteractor.stopAudio(playDisconnectSound);<NEW_LINE>webRtcInteractor.terminateCall(activePeer.getId());<NEW_LINE>webRtcInteractor.updatePhoneState(LockManager.PhoneState.IDLE);<NEW_LINE>webRtcInteractor.stopForegroundService();<NEW_LINE>return WebRtcVideoUtil.deinitializeVideo(currentState).builder().changeCallInfoState().activePeer(null).commit().changeLocalDeviceState().commit().actionProcessor(new IdleActionProcessor(webRtcInteractor)).terminate(remotePeer.getCallId()).build();<NEW_LINE>}
.getCallInfoState().getActivePeer();
194,505
private void animate(int keyFrame) {<NEW_LINE>// get the next position from the mission data<NEW_LINE>Map<String, Object> <MASK><NEW_LINE>Point position = (Point) datum.get("POSITION");<NEW_LINE>// update the HUD<NEW_LINE>runOnUiThread(() -> {<NEW_LINE>mCurrAltitude.setText(String.format("%.2f", position.getZ()));<NEW_LINE>mCurrHeading.setText(String.format("%.2f", (float) datum.get("HEADING")));<NEW_LINE>mCurrPitch.setText(String.format("%.2f", (float) datum.get("PITCH")));<NEW_LINE>mCurrRoll.setText(String.format("%.2f", (float) datum.get("ROLL")));<NEW_LINE>});<NEW_LINE>// update mission progress seek bar<NEW_LINE>mMissionProgressSeekBar.setProgress(mKeyFrame);<NEW_LINE>// update plane's position and orientation<NEW_LINE>mPlane3D.setGeometry(position);<NEW_LINE>mPlane3D.getAttributes().put("HEADING", datum.get("HEADING"));<NEW_LINE>mPlane3D.getAttributes().put("PITCH", datum.get("PITCH"));<NEW_LINE>mPlane3D.getAttributes().put("ROLL", datum.get("ROLL"));<NEW_LINE>// update mini map plane's position and rotation<NEW_LINE>mPlane2D.setGeometry(position);<NEW_LINE>if (mFollowFreeCamButton.isSelected()) {<NEW_LINE>if (mMapView == null || position == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// rotate the map view in the direction of motion to make graphic always point up<NEW_LINE>mMapView.setViewpoint(new Viewpoint(position, mMapView.getMapScale(), 360 + (float) datum.get("HEADING")));<NEW_LINE>} else {<NEW_LINE>mPlane2D.getAttributes().put("ANGLE", 360 + (float) datum.get("HEADING") - mMapView.getMapRotation());<NEW_LINE>}<NEW_LINE>}
datum = mMissionData.get(keyFrame);
962,122
public void process(@Element String input, MultiOutputReceiver output) {<NEW_LINE>FailsafeElement<String, String> element = FailsafeElement.of(input, input);<NEW_LINE>// Early Return if maxRetries is set to 0<NEW_LINE>if (maxRetries == 0) {<NEW_LINE>output.get(RETRYABLE_ERRORS).output(element);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>ObjectMapper mapper = new ObjectMapper();<NEW_LINE>JsonNode jsonDLQElement = mapper.readTree(input);<NEW_LINE>int retryCount = jsonDLQElement.get("_metadata_retry_count").asInt();<NEW_LINE>if (retryCount <= maxRetries) {<NEW_LINE>output.get(RETRYABLE_ERRORS).output(element);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>String error = jsonDLQElement.<MASK><NEW_LINE>element.setErrorMessage(error);<NEW_LINE>output.get(PERMANENT_ERRORS).output(element);<NEW_LINE>} catch (IOException e) {<NEW_LINE>LOG.error("Issue parsing JSON record {}. Unable to continue.", input, e);<NEW_LINE>output.get(PERMANENT_ERRORS).output(element);<NEW_LINE>}<NEW_LINE>}
get("_metadata_error").asText();
342,224
protected boolean processPluginStream(SFPluginDetailsImpl details, InputStream is) {<NEW_LINE>Properties properties = new Properties();<NEW_LINE>try {<NEW_LINE>properties.load(is);<NEW_LINE><MASK><NEW_LINE>String download_url = properties.getProperty(pid + ".dl_link", "");<NEW_LINE>if (download_url.length() == 0) {<NEW_LINE>download_url = "<unknown>";<NEW_LINE>} else if (!download_url.startsWith("http")) {<NEW_LINE>download_url = site_prefix + download_url;<NEW_LINE>}<NEW_LINE>String author = properties.getProperty(pid + ".author", "");<NEW_LINE>String desc = properties.getProperty(pid + ".description", "");<NEW_LINE>String cvs_download_url = properties.getProperty(pid + ".dl_link_cvs", null);<NEW_LINE>if (cvs_download_url == null || cvs_download_url.length() == 0) {<NEW_LINE>cvs_download_url = download_url;<NEW_LINE>} else if (!download_url.startsWith("http")) {<NEW_LINE>cvs_download_url = site_prefix + cvs_download_url;<NEW_LINE>}<NEW_LINE>String comment = properties.getProperty(pid + ".comment", "");<NEW_LINE>// I don't think this one is ever set (not even in the old html scraping code)<NEW_LINE>String info_url = properties.getProperty(pid + ".info_url", null);<NEW_LINE>details.setDetails(download_url, author, cvs_download_url, desc, comment, info_url);<NEW_LINE>return true;<NEW_LINE>} catch (IOException e) {<NEW_LINE>Debug.out(e);<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>}
String pid = details.getId();
1,020,613
public boolean startKubernetesCluster(long kubernetesClusterId, boolean onCreate) throws CloudRuntimeException {<NEW_LINE>if (!KubernetesServiceEnabled.value()) {<NEW_LINE>logAndThrow(Level.ERROR, "Kubernetes Service plugin is disabled");<NEW_LINE>}<NEW_LINE>final KubernetesClusterVO kubernetesCluster = kubernetesClusterDao.findById(kubernetesClusterId);<NEW_LINE>if (kubernetesCluster == null) {<NEW_LINE>throw new InvalidParameterValueException("Failed to find Kubernetes cluster with given ID");<NEW_LINE>}<NEW_LINE>if (kubernetesCluster.getRemoved() != null) {<NEW_LINE>throw new InvalidParameterValueException(String.format("Kubernetes cluster : %s is already deleted", kubernetesCluster.getName()));<NEW_LINE>}<NEW_LINE>accountManager.checkAccess(CallContext.current().getCallingAccount(), SecurityChecker.AccessType.OperateEntry, false, kubernetesCluster);<NEW_LINE>if (kubernetesCluster.getState().equals(KubernetesCluster.State.Running)) {<NEW_LINE>if (LOGGER.isDebugEnabled()) {<NEW_LINE>LOGGER.debug(String.format("Kubernetes cluster : %s is in running state", kubernetesCluster.getName()));<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>if (kubernetesCluster.getState().equals(KubernetesCluster.State.Starting)) {<NEW_LINE>if (LOGGER.isDebugEnabled()) {<NEW_LINE>LOGGER.debug(String.format("Kubernetes cluster : %s is already in starting state", kubernetesCluster.getName()));<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>final DataCenter zone = dataCenterDao.findById(kubernetesCluster.getZoneId());<NEW_LINE>if (zone == null) {<NEW_LINE>logAndThrow(Level.WARN, String.format("Unable to find zone for Kubernetes cluster : %s", kubernetesCluster.getName()));<NEW_LINE>}<NEW_LINE>KubernetesClusterStartWorker startWorker = new KubernetesClusterStartWorker(kubernetesCluster, this);<NEW_LINE>startWorker = ComponentContext.inject(startWorker);<NEW_LINE>if (onCreate) {<NEW_LINE>// Start for Kubernetes cluster in 'Created' state<NEW_LINE>Account owner = accountService.getActiveAccountById(kubernetesCluster.getAccountId());<NEW_LINE>String<MASK><NEW_LINE>startWorker.setKeys(keys);<NEW_LINE>return startWorker.startKubernetesClusterOnCreate();<NEW_LINE>} else {<NEW_LINE>// Start for Kubernetes cluster in 'Stopped' state. Resources are already provisioned, just need to be started<NEW_LINE>return startWorker.startStoppedKubernetesCluster();<NEW_LINE>}<NEW_LINE>}
[] keys = getServiceUserKeys(owner);
539,375
public RuleResult execute(final Map<String, String> ruleParam, Map<String, String> resourceAttributes) {<NEW_LINE>logger.debug("========IAMCertificateExpiryRule started=========");<NEW_LINE>Annotation annotation = null;<NEW_LINE>Date validTo = null;<NEW_LINE>String expiredDate = resourceAttributes.get("expirydate");<NEW_LINE>SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");<NEW_LINE>String targetExpiryDurationInString = ruleParam.get(PacmanRuleConstants.EXPIRED_DURATION);<NEW_LINE>String severity = ruleParam.get(PacmanRuleConstants.SEVERITY);<NEW_LINE>String category = ruleParam.get(PacmanRuleConstants.CATEGORY);<NEW_LINE>MDC.put("executionId", ruleParam.get("executionId"));<NEW_LINE>MDC.put("ruleId", ruleParam.get(PacmanSdkConstants.RULE_ID));<NEW_LINE>List<LinkedHashMap<String, Object>> issueList = new ArrayList<>();<NEW_LINE>LinkedHashMap<String, Object> issue = new LinkedHashMap<>();<NEW_LINE>if (!PacmanUtils.doesAllHaveValue(targetExpiryDurationInString, severity, category)) {<NEW_LINE>logger.info(PacmanRuleConstants.MISSING_CONFIGURATION);<NEW_LINE>throw new InvalidInputException(PacmanRuleConstants.MISSING_CONFIGURATION);<NEW_LINE>}<NEW_LINE>if (expiredDate != null) {<NEW_LINE>try {<NEW_LINE>validTo = dateFormat.parse(expiredDate);<NEW_LINE>} catch (ParseException e) {<NEW_LINE>logger.info("Exception in ACM accesskey" + e.getMessage());<NEW_LINE>}<NEW_LINE>int targetExpiryDurationInt = Integer.parseInt(targetExpiryDurationInString);<NEW_LINE>if (calculateSslExpiredDuration(validTo, targetExpiryDurationInt)) {<NEW_LINE>annotation = Annotation.buildAnnotation(ruleParam, Annotation.Type.ISSUE);<NEW_LINE>annotation.put(PacmanSdkConstants.DESCRIPTION, "SSL(IAM) Expiry within " + targetExpiryDurationInString + " days found!!");<NEW_LINE>annotation.<MASK><NEW_LINE>annotation.put(PacmanRuleConstants.CATEGORY, category);<NEW_LINE>issue.put(PacmanRuleConstants.VIOLATION_REASON, "SSL(IAM) Expiry within " + targetExpiryDurationInString + " days found!!");<NEW_LINE>issueList.add(issue);<NEW_LINE>annotation.put("issueDetails", issueList.toString());<NEW_LINE>logger.debug("========ACMCertificateExpiryRule ended with annotation {} : =========", annotation);<NEW_LINE>return new RuleResult(PacmanSdkConstants.STATUS_FAILURE, PacmanRuleConstants.FAILURE_MESSAGE, annotation);<NEW_LINE>} else {<NEW_LINE>logger.info("SSL(IAM) validity not expired");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>logger.debug("========IAMCertificateExpiryRule ended=========");<NEW_LINE>return new RuleResult(PacmanSdkConstants.STATUS_SUCCESS, PacmanRuleConstants.SUCCESS_MESSAGE);<NEW_LINE>}
put(PacmanRuleConstants.SEVERITY, severity);
1,553,485
public static void splitDatafiles(Text midRow, double splitRatio, Map<TabletFile, FileUtil.FileInfo> firstAndLastRows, SortedMap<StoredTabletFile, DataFileValue> datafiles, SortedMap<StoredTabletFile, DataFileValue> lowDatafileSizes, SortedMap<StoredTabletFile, DataFileValue> highDatafileSizes, List<StoredTabletFile> highDatafilesToRemove) {<NEW_LINE>for (Entry<StoredTabletFile, DataFileValue> entry : datafiles.entrySet()) {<NEW_LINE>Text firstRow = null;<NEW_LINE>Text lastRow = null;<NEW_LINE>boolean rowsKnown = false;<NEW_LINE>FileUtil.FileInfo mfi = firstAndLastRows.get(entry.getKey());<NEW_LINE>if (mfi != null) {<NEW_LINE>firstRow = mfi.getFirstRow();<NEW_LINE>lastRow = mfi.getLastRow();<NEW_LINE>rowsKnown = true;<NEW_LINE>}<NEW_LINE>if (rowsKnown && firstRow.compareTo(midRow) > 0) {<NEW_LINE>// only in high<NEW_LINE>long highSize = entry.getValue().getSize();<NEW_LINE>long highEntries = entry.getValue().getNumEntries();<NEW_LINE>highDatafileSizes.put(entry.getKey(), new DataFileValue(highSize, highEntries, entry.getValue().getTime()));<NEW_LINE>} else if (rowsKnown && lastRow.compareTo(midRow) <= 0) {<NEW_LINE>// only in low<NEW_LINE>long lowSize = entry.getValue().getSize();<NEW_LINE>long lowEntries = entry.getValue().getNumEntries();<NEW_LINE>lowDatafileSizes.put(entry.getKey(), new DataFileValue(lowSize, lowEntries, entry.getValue().getTime()));<NEW_LINE>highDatafilesToRemove.add(entry.getKey());<NEW_LINE>} else {<NEW_LINE>long lowSize = (long) Math.floor((entry.getValue().getSize() * splitRatio));<NEW_LINE>long lowEntries = (long) Math.floor((entry.getValue()<MASK><NEW_LINE>lowDatafileSizes.put(entry.getKey(), new DataFileValue(lowSize, lowEntries, entry.getValue().getTime()));<NEW_LINE>long highSize = (long) Math.ceil((entry.getValue().getSize() * (1.0 - splitRatio)));<NEW_LINE>long highEntries = (long) Math.ceil((entry.getValue().getNumEntries() * (1.0 - splitRatio)));<NEW_LINE>highDatafileSizes.put(entry.getKey(), new DataFileValue(highSize, highEntries, entry.getValue().getTime()));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
.getNumEntries() * splitRatio));
861,454
public void onRender(MatrixStack matrixStack, float partialTicks) {<NEW_LINE>if (fakePlayer == null || !tracer.isChecked())<NEW_LINE>return;<NEW_LINE>// GL settings<NEW_LINE>GL11.glEnable(GL11.GL_BLEND);<NEW_LINE>GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);<NEW_LINE>GL11.glEnable(GL11.GL_LINE_SMOOTH);<NEW_LINE>GL11.glDisable(GL11.GL_DEPTH_TEST);<NEW_LINE>matrixStack.push();<NEW_LINE>RenderUtils.applyRenderOffset(matrixStack);<NEW_LINE>float[] colorF = color.getColorF();<NEW_LINE>RenderSystem.setShaderColor(colorF[0], colorF[1], colorF[2], 0.5F);<NEW_LINE>// box<NEW_LINE>matrixStack.push();<NEW_LINE>matrixStack.translate(fakePlayer.getX(), fakePlayer.getY(), fakePlayer.getZ());<NEW_LINE>matrixStack.scale(fakePlayer.getWidth() + 0.1F, fakePlayer.getHeight() + 0.1F, fakePlayer.getWidth() + 0.1F);<NEW_LINE>Box bb = new Box(-0.5, 0, -0.5, 0.5, 1, 0.5);<NEW_LINE>RenderUtils.drawOutlinedBox(bb, matrixStack);<NEW_LINE>matrixStack.pop();<NEW_LINE>// line<NEW_LINE>Vec3d start = RotationUtils.getClientLookVec().add(RenderUtils.getCameraPos());<NEW_LINE>Vec3d end = fakePlayer.getBoundingBox().getCenter();<NEW_LINE>Matrix4f matrix = matrixStack.peek().getPositionMatrix();<NEW_LINE>BufferBuilder bufferBuilder = Tessellator.getInstance().getBuffer();<NEW_LINE>RenderSystem.setShader(GameRenderer::getPositionShader);<NEW_LINE>bufferBuilder.begin(VertexFormat.DrawMode.DEBUG_LINES, VertexFormats.POSITION);<NEW_LINE>bufferBuilder.vertex(matrix, (float) start.x, (float) start.y, (float) start.z).next();<NEW_LINE>bufferBuilder.vertex(matrix, (float) end.x, (float) end.y, (float) end.z).next();<NEW_LINE>bufferBuilder.end();<NEW_LINE>BufferRenderer.draw(bufferBuilder);<NEW_LINE>matrixStack.pop();<NEW_LINE>// GL resets<NEW_LINE><MASK><NEW_LINE>GL11.glDisable(GL11.GL_BLEND);<NEW_LINE>GL11.glDisable(GL11.GL_LINE_SMOOTH);<NEW_LINE>}
GL11.glEnable(GL11.GL_DEPTH_TEST);
1,515,873
private void addBlocks(Marker marker) {<NEW_LINE>// Add block around the template section so that<NEW_LINE>// START<NEW_LINE>// BODY<NEW_LINE>// END<NEW_LINE>// is transformed to:<NEW_LINE>// BLOCK (synthetic)<NEW_LINE>// START<NEW_LINE>// BLOCK (synthetic)<NEW_LINE>// BODY<NEW_LINE>// END<NEW_LINE>// This prevents the start or end markers from mingling with the code in the block body.<NEW_LINE>Node outerBlock = IR.block().srcref(marker.startMarker);<NEW_LINE>outerBlock.setIsSyntheticBlock(true);<NEW_LINE>outerBlock.insertBefore(marker.startMarker);<NEW_LINE>Node innerBlock = IR.block(<MASK><NEW_LINE>innerBlock.setIsSyntheticBlock(true);<NEW_LINE>// Move everything after the start Node up to the end Node into the inner block.<NEW_LINE>moveSiblingExclusive(innerBlock, marker.startMarker, marker.endMarker);<NEW_LINE>// Add the start node.<NEW_LINE>outerBlock.addChildToBack(outerBlock.getNext().detach());<NEW_LINE>// Add the inner block<NEW_LINE>outerBlock.addChildToBack(innerBlock);<NEW_LINE>// and finally the end node.<NEW_LINE>outerBlock.addChildToBack(outerBlock.getNext().detach());<NEW_LINE>// NOTE: Moving the code into a block made sense prior to ES2015 when declarations were never<NEW_LINE>// block scoped. But with ES2015+ function, class, let and const are all block scoped.<NEW_LINE>// Here we are only rewriting functions because this is the behavior that "normalize" previously<NEW_LINE>// had and we aren't currently (July 2020) trying to improve this code's behavior. This<NEW_LINE>// maintains the status quo and allows the normalization of function to be removed.<NEW_LINE>//<NEW_LINE>rewriteFunctionDeclarationsInBlock(innerBlock);<NEW_LINE>compiler.reportChangeToEnclosingScope(outerBlock);<NEW_LINE>}
).srcref(marker.startMarker);
1,765,468
public void reserve(NicProfile nic, Network config, VirtualMachineProfile vm, DeployDestination dest, ReservationContext context) throws InsufficientVirtualNetworkCapacityException, InsufficientAddressCapacityException {<NEW_LINE>assert nic.getTrafficType() == TrafficType.Control;<NEW_LINE>// we have to get management/private ip for the control nic for vmware/hyperv due ssh issues.<NEW_LINE>HypervisorType hType = vm.getHypervisorType();<NEW_LINE>if (((hType == HypervisorType.VMware) || (hType == HypervisorType.Hyperv)) && isRouterVm(vm)) {<NEW_LINE>super.reserve(nic, <MASK><NEW_LINE>String mac = _networkMgr.getNextAvailableMacAddressInNetwork(config.getId());<NEW_LINE>nic.setMacAddress(mac);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>String ip = _dcDao.allocateLinkLocalIpAddress(dest.getDataCenter().getId(), dest.getPod().getId(), nic.getId(), context.getReservationId());<NEW_LINE>if (ip == null) {<NEW_LINE>throw new InsufficientAddressCapacityException("Insufficient link local address capacity", DataCenter.class, dest.getDataCenter().getId());<NEW_LINE>}<NEW_LINE>String netmask = NetUtils.cidr2Netmask(_cidr);<NEW_LINE>s_logger.debug(String.format("Reserved NIC for %s [ipv4:%s netmask:%s gateway:%s]", vm.getInstanceName(), ip, netmask, _gateway));<NEW_LINE>nic.setIPv4Address(ip);<NEW_LINE>nic.setMacAddress(NetUtils.long2Mac(NetUtils.ip2Long(ip) | (14l << 40)));<NEW_LINE>nic.setIPv4Netmask(netmask);<NEW_LINE>nic.setFormat(AddressFormat.Ip4);<NEW_LINE>nic.setIPv4Gateway(_gateway);<NEW_LINE>}
config, vm, dest, context);
1,043,372
public void scroll(Coordinates where, int xOffset, int yOffset) {<NEW_LINE>long downTime = SystemClock.uptimeMillis();<NEW_LINE>List<MotionEvent> motionEvents = new ArrayList<MotionEvent>();<NEW_LINE>Point origin = where.getLocationOnScreen();<NEW_LINE>Point destination = new Point(origin.x + xOffset, origin.y + yOffset);<NEW_LINE>motionEvents.add(getMotionEvent(downTime, downTime, MotionEvent.ACTION_DOWN, origin));<NEW_LINE>Scroll scroll = new Scroll(origin, destination, downTime);<NEW_LINE>// Initial acceleration from origin to reference point<NEW_LINE>motionEvents.add(getBatchedMotionEvent(downTime, downTime, origin, scroll.getDecelerationPoint(), Scroll.INITIAL_STEPS, Scroll.TIME_BETWEEN_EVENTS));<NEW_LINE>// Deceleration phase from reference point to destination<NEW_LINE>motionEvents.add(getBatchedMotionEvent(downTime, scroll.getEventTimeForReferencePoint(), scroll.getDecelerationPoint(), destination, Scroll<MASK><NEW_LINE>motionEvents.add(getMotionEvent(downTime, (downTime + scroll.getEventTimeForDestinationPoint()), MotionEvent.ACTION_UP, destination));<NEW_LINE>motions.send(motionEvents);<NEW_LINE>}
.DECELERATION_STEPS, Scroll.TIME_BETWEEN_EVENTS));
392,033
protected <T> CompletableFuture<ResponseMessage<T>> executeAsync(HttpRequest request, Object obj, TypeReference<T> ref) {<NEW_LINE>addAuthToReqIfKeyPresent(request);<NEW_LINE>try {<NEW_LINE>String jsonBody = objectMapper.writeValueAsString(obj);<NEW_LINE>final AsyncRequestProducer requestProducer = new BasicRequestProducer(request, AsyncEntityProducers.create(jsonBody, ContentType.APPLICATION_JSON));<NEW_LINE>Future<Message<HttpResponse, String>> future = http.execute(requestProducer, new BasicResponseConsumer<>(new StringAsyncEntityConsumer()), null);<NEW_LINE>return CompletableFuture.supplyAsync(() -> {<NEW_LINE>try {<NEW_LINE>Message<HttpResponse, String> message = future.get();<NEW_LINE>return createMessage(message, ref);<NEW_LINE>} catch (ExecutionException | InterruptedException e) {<NEW_LINE>throw new RuntimeException(e);<NEW_LINE>}<NEW_LINE>}, executorService);<NEW_LINE>} catch (JsonProcessingException e) {<NEW_LINE><MASK><NEW_LINE>CompletableFuture<ResponseMessage<T>> completableFuture = new CompletableFuture<>();<NEW_LINE>completableFuture.completeExceptionally(e);<NEW_LINE>return completableFuture;<NEW_LINE>}<NEW_LINE>}
log.error("Could not serialize to json object - {}", obj);
649,213
/*<NEW_LINE>*<NEW_LINE>*/<NEW_LINE>public void add(ResponseList<twitter4j.Status> statuses, AddUserCallback addUserCallback) {<NEW_LINE>TwitterStatus firstItem = size() > 0 ? get(0) : null;<NEW_LINE>int addCount = 0;<NEW_LINE>boolean stillMore = true;<NEW_LINE>TwitterStatus lastAddedStatus = null;<NEW_LINE>mGetNewStatusesMaxId = null;<NEW_LINE>for (Status status : statuses) {<NEW_LINE>if (firstItem != null && status.getId() == firstItem.mId) {<NEW_LINE>stillMore = false;<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>lastAddedStatus = new TwitterStatus(status);<NEW_LINE>add(lastAddedStatus);<NEW_LINE>if (addUserCallback != null) {<NEW_LINE>addUserCallback.addUser(status.getUser());<NEW_LINE>if (status.isRetweet()) {<NEW_LINE>Status retweetedStatus = status.getRetweetedStatus();<NEW_LINE>if (retweetedStatus != null) {<NEW_LINE>addUserCallback.<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>addCount += 1;<NEW_LINE>}<NEW_LINE>if (stillMore && lastAddedStatus != null) {<NEW_LINE>mGetNewStatusesMaxId = lastAddedStatus.mId;<NEW_LINE>}<NEW_LINE>if (addCount > 0) {<NEW_LINE>sort();<NEW_LINE>}<NEW_LINE>}
addUser(retweetedStatus.getUser());
194,466
public void initAccessibility() {<NEW_LINE>this.getAccessibleContext().setAccessibleDescription(Util.THIS.getString("ACSD_TreeEntityDeclCustomizer"));<NEW_LINE>nameField.getAccessibleContext().setAccessibleDescription(Util.THIS.getString("ACSD_nameField2"));<NEW_LINE>typeCombo.getAccessibleContext().setAccessibleDescription(Util.THIS.getString("ACSD_typeCombo"));<NEW_LINE>internValueField.getAccessibleContext().setAccessibleDescription(Util.THIS.getString("ACSD_internValueField"));<NEW_LINE>internValueField.selectAll();<NEW_LINE>externPublicField.getAccessibleContext().setAccessibleDescription(Util<MASK><NEW_LINE>externSystemField.getAccessibleContext().setAccessibleDescription(Util.THIS.getString("ACSD_externSystemField"));<NEW_LINE>unparsedPublicField.getAccessibleContext().setAccessibleDescription(Util.THIS.getString("ACSD_unparsedPublicField"));<NEW_LINE>unparsedSystemField.getAccessibleContext().setAccessibleDescription(Util.THIS.getString("ACSD_unparsedSystemField"));<NEW_LINE>unparsedNotationField.getAccessibleContext().setAccessibleDescription(Util.THIS.getString("ACSD_unparsedNotationField"));<NEW_LINE>}
.THIS.getString("ACSD_externPublicField"));
1,670,474
private String toStringRepresentation(boolean withPassword) {<NEW_LINE>MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper("LedgerMetadata");<NEW_LINE>helper.add("formatVersion", metadataFormatVersion).add("ensembleSize", ensembleSize).add("writeQuorumSize", writeQuorumSize).add("ackQuorumSize", ackQuorumSize).add("state", state);<NEW_LINE>if (state == State.CLOSED) {<NEW_LINE>helper.add("length", length).add("lastEntryId", lastEntryId);<NEW_LINE>}<NEW_LINE>if (hasPassword()) {<NEW_LINE>helper.add("digestType", digestType);<NEW_LINE>if (withPassword) {<NEW_LINE>helper.add("password", "base64:" + Base64.getEncoder().encodeToString(password));<NEW_LINE>} else {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>helper.add("ensembles", ensembles.toString());<NEW_LINE>helper.add("customMetadata", customMetadata.entrySet().stream().collect(Collectors.toMap(e -> e.getKey(), e -> "base64:" + Base64.getEncoder().encodeToString(e.getValue()))));<NEW_LINE>return helper.toString();<NEW_LINE>}
helper.add("password", "OMITTED");
512,956
private void processGOT16Relocation(MIPS_ElfRelocationContext mipsRelocationContext, MIPS_DeferredRelocation got16reloc, int lo16Addend) {<NEW_LINE>long addend;<NEW_LINE>if (mipsRelocationContext.extractAddend()) {<NEW_LINE>addend = ((got16reloc.oldValue & 0xffff) << 16) + lo16Addend;<NEW_LINE>} else {<NEW_LINE>addend = got16reloc.addend;<NEW_LINE>}<NEW_LINE>long symbolValue = (int) mipsRelocationContext.getSymbolValue(got16reloc.elfSymbol);<NEW_LINE>String symbolName = got16reloc.elfSymbol.getNameAsString();<NEW_LINE>// generate page offset<NEW_LINE>long value = (symbolValue + addend + 0x8000) & ~0xffff;<NEW_LINE>// Get section GOT entry for local symbol<NEW_LINE>Address gotAddr = mipsRelocationContext.getSectionGotAddress(value);<NEW_LINE>if (gotAddr == null) {<NEW_LINE>// failed to allocate section GOT entry for symbol<NEW_LINE>markAsError(mipsRelocationContext.getProgram(), got16reloc.relocAddr, Integer.toString(got16reloc.relocType), symbolName, "Relocation Failed, unable to allocate GOT entry for relocation symbol: " + <MASK><NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// use address offset within section GOT as value<NEW_LINE>value = getGpOffset(mipsRelocationContext, gotAddr.getOffset());<NEW_LINE>if (value == -1) {<NEW_LINE>// Unhandled GOT/GP case<NEW_LINE>markAsError(mipsRelocationContext.getProgram(), got16reloc.relocAddr, Integer.toString(got16reloc.relocType), symbolName, "Failed to perform GP-based relocation", mipsRelocationContext.getLog());<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>int newValue = (got16reloc.oldValue & ~0xffff) | ((int) value & 0xffff);<NEW_LINE>Memory memory = mipsRelocationContext.getProgram().getMemory();<NEW_LINE>try {<NEW_LINE>memory.setInt(got16reloc.relocAddr, shuffle(newValue, got16reloc.relocType, mipsRelocationContext));<NEW_LINE>} catch (MemoryAccessException e) {<NEW_LINE>// Unexpected since we did a previous getInt without failure<NEW_LINE>throw new AssertException(e);<NEW_LINE>}<NEW_LINE>}
symbolName, mipsRelocationContext.getLog());
272,086
public Affine3D deriveWithConcatenation(double Txx, double Tyx, double Txy, double Tyy, double Txt, double Tyt) {<NEW_LINE>double rxx = (mxx * Txx + mxy * Tyx);<NEW_LINE>double rxy = (<MASK><NEW_LINE>// double rxz = (mxz /* * 1.0 + mxx * 0.0 + mxy * 0.0 + mxt * 0.0 */);<NEW_LINE>double rxt = (mxx * Txt + mxy * Tyt + mxt);<NEW_LINE>double ryx = (myx * Txx + myy * Tyx);<NEW_LINE>double ryy = (myx * Txy + myy * Tyy);<NEW_LINE>// double ryz = (myz /* * 1.0 + myx * 0.0 + myy * 0.0 + myt * 0.0 */);<NEW_LINE>double ryt = (myx * Txt + myy * Tyt + myt);<NEW_LINE>double rzx = (mzx * Txx + mzy * Tyx);<NEW_LINE>double rzy = (mzx * Txy + mzy * Tyy);<NEW_LINE>// double rzz = (mzz /* * 1.0 + mzx * 0.0 + mzy * 0.0 + mzt * 0.0 */);<NEW_LINE>double rzt = (mzx * Txt + mzy * Tyt + mzt);<NEW_LINE>this.mxx = rxx;<NEW_LINE>this.mxy = rxy;<NEW_LINE>// this.mxz = rxz; // == mxz anyway<NEW_LINE>this.mxt = rxt;<NEW_LINE>this.myx = ryx;<NEW_LINE>this.myy = ryy;<NEW_LINE>// this.myz = ryz; // == myz anyway<NEW_LINE>this.myt = ryt;<NEW_LINE>this.mzx = rzx;<NEW_LINE>this.mzy = rzy;<NEW_LINE>// this.mzz = rzz; // == mzz anyway<NEW_LINE>this.mzt = rzt;<NEW_LINE>updateState();<NEW_LINE>return this;<NEW_LINE>}
mxx * Txy + mxy * Tyy);
882,445
static void store8(byte[] out, int offset, long in) {<NEW_LINE>out[offset + 0] = (byte) ((in >> 0x00) & 0xFF);<NEW_LINE>out[offset + 1] = (byte) ((in >> 0x08) & 0xFF);<NEW_LINE>out[offset + 2] = (byte) ((in >> 0x10) & 0xFF);<NEW_LINE>out[offset + 3] = (byte) ((in >> 0x18) & 0xFF);<NEW_LINE>out[offset + 4] = (byte) ((in >> 0x20) & 0xFF);<NEW_LINE>out[offset + 5] = (byte) ((in >> 0x28) & 0xFF);<NEW_LINE>out[offset + 6] = (byte) ((<MASK><NEW_LINE>out[offset + 7] = (byte) ((in >> 0x38) & 0xFF);<NEW_LINE>}
in >> 0x30) & 0xFF);
1,818,134
public VIF createVif(final Connection conn, final String vmName, final VM vm, final VirtualMachineTO vmSpec, final NicTO nic) throws XmlRpcException, XenAPIException {<NEW_LINE>assert nic.getUuid() != null : "Nic should have a uuid value";<NEW_LINE>if (s_logger.isDebugEnabled()) {<NEW_LINE>s_logger.debug(<MASK><NEW_LINE>}<NEW_LINE>VIF.Record vifr = new VIF.Record();<NEW_LINE>vifr.VM = vm;<NEW_LINE>vifr.device = Integer.toString(nic.getDeviceId());<NEW_LINE>vifr.MAC = nic.getMac();<NEW_LINE>// Nicira needs these IDs to find the NIC<NEW_LINE>vifr.otherConfig = new HashMap<String, String>();<NEW_LINE>vifr.otherConfig.put("nicira-iface-id", nic.getUuid());<NEW_LINE>vifr.otherConfig.put("nicira-vm-id", vm.getUuid(conn));<NEW_LINE>// Provide XAPI with the cloudstack vm and nic uids.<NEW_LINE>vifr.otherConfig.put("cloudstack-nic-id", nic.getUuid());<NEW_LINE>if (vmSpec != null) {<NEW_LINE>vifr.otherConfig.put("cloudstack-vm-id", vmSpec.getUuid());<NEW_LINE>}<NEW_LINE>// OVS plugin looks at network UUID in the vif 'otherconfig' details to<NEW_LINE>// group VIF's & tunnel ports as part of tier<NEW_LINE>// when bridge is setup for distributed routing<NEW_LINE>vifr.otherConfig.put("cloudstack-network-id", nic.getNetworkUuid());<NEW_LINE>vifr.network = getNetwork(conn, nic);<NEW_LINE>if (nic.getNetworkRateMbps() != null && nic.getNetworkRateMbps().intValue() != -1) {<NEW_LINE>vifr.qosAlgorithmType = "ratelimit";<NEW_LINE>vifr.qosAlgorithmParams = new HashMap<String, String>();<NEW_LINE>// convert mbs to kilobyte per second<NEW_LINE>vifr.qosAlgorithmParams.put("kbps", Integer.toString(nic.getNetworkRateMbps() * 128));<NEW_LINE>}<NEW_LINE>vifr.lockingMode = Types.VifLockingMode.NETWORK_DEFAULT;<NEW_LINE>final VIF vif = VIF.create(conn, vifr);<NEW_LINE>if (s_logger.isDebugEnabled()) {<NEW_LINE>vifr = vif.getRecord(conn);<NEW_LINE>if (vifr != null) {<NEW_LINE>s_logger.debug("Created a vif " + vifr.uuid + " on " + nic.getDeviceId());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return vif;<NEW_LINE>}
"Creating VIF for " + vmName + " on nic " + nic);
85,764
private void loadNode1170() {<NEW_LINE>PropertyTypeNode node = new PropertyTypeNode(this.context, Identifiers.ProgramStateMachineType_LastTransition_Id, new QualifiedName(0, "Id"), new LocalizedText("en", "Id"), LocalizedText.NULL_VALUE, UInteger.valueOf(0), UInteger.valueOf(0), new DataValue(Variant.NULL_VALUE), Identifiers.NodeId, -1, new UInteger[] {}, UByte.valueOf(1), UByte.valueOf(1), 0.0, false);<NEW_LINE>node.addReference(new Reference(Identifiers.ProgramStateMachineType_LastTransition_Id, Identifiers.HasTypeDefinition, Identifiers.PropertyType.expanded(), true));<NEW_LINE>node.addReference(new Reference(Identifiers.ProgramStateMachineType_LastTransition_Id, Identifiers.HasModellingRule, Identifiers.ModellingRule_Mandatory.expanded(), true));<NEW_LINE>node.addReference(new Reference(Identifiers.ProgramStateMachineType_LastTransition_Id, Identifiers.HasProperty, Identifiers.ProgramStateMachineType_LastTransition.expanded(), false));<NEW_LINE><MASK><NEW_LINE>}
this.nodeManager.addNode(node);
1,105,860
protected void registerFrontAppServlet(ServletContext servletContext) {<NEW_LINE>boolean hasFrontApp = false;<NEW_LINE>try {<NEW_LINE>hasFrontApp = servletContext.getResource("/" + FRONT_CONTEXT_NAME) != null;<NEW_LINE>} catch (MalformedURLException e) {<NEW_LINE>// Do nothing<NEW_LINE>}<NEW_LINE>if (hasFrontApp) {<NEW_LINE>String contextPath = servletContext.getContextPath();<NEW_LINE>String baseUrl = System.getProperty("cuba.front.baseUrl");<NEW_LINE>if (baseUrl == null || baseUrl.length() == 0) {<NEW_LINE>String path = "/" + FRONT_CONTEXT_NAME + "/";<NEW_LINE>System.setProperty("cuba.front.baseUrl", "/".equals(contextPath) ? path : contextPath + path);<NEW_LINE>}<NEW_LINE>String apiUrl = System.getProperty("cuba.front.apiUrl");<NEW_LINE>if (apiUrl == null || apiUrl.length() == 0) {<NEW_LINE>String path = "/rest/";<NEW_LINE>System.setProperty("cuba.front.apiUrl", "/".equals(contextPath<MASK><NEW_LINE>}<NEW_LINE>DispatcherServlet frontServlet;<NEW_LINE>try {<NEW_LINE>Class frontServletClass = ReflectionHelper.getClass("com.haulmont.frontservlet.AppFrontServlet");<NEW_LINE>frontServlet = (DispatcherServlet) ReflectionHelper.newInstance(frontServletClass, FRONT_CONTEXT_NAME, (Supplier<ApplicationContext>) AppContext::getApplicationContext);<NEW_LINE>} catch (NoSuchMethodException e) {<NEW_LINE>throw new RuntimeException("Unable to instantiate app front servlet", e);<NEW_LINE>}<NEW_LINE>ServletRegistration.Dynamic cubaServletReg = servletContext.addServlet("app_front_servlet", frontServlet);<NEW_LINE>cubaServletReg.setLoadOnStartup(3);<NEW_LINE>cubaServletReg.setAsyncSupported(true);<NEW_LINE>cubaServletReg.addMapping(String.format("/%s/*", FRONT_CONTEXT_NAME));<NEW_LINE>}<NEW_LINE>}
) ? path : contextPath + path);
1,346,994
private void loadNode165() {<NEW_LINE>BaseDataVariableTypeNode node = new BaseDataVariableTypeNode(this.context, Identifiers.SessionDiagnosticsArrayType_SessionDiagnostics_ClientConnectionTime, new QualifiedName(0, "ClientConnectionTime"), new LocalizedText("en", "ClientConnectionTime"), LocalizedText.NULL_VALUE, UInteger.valueOf(0), UInteger.valueOf(0), new DataValue(Variant.NULL_VALUE), Identifiers.UtcTime, -1, new UInteger[] {}, UByte.valueOf(1), UByte.valueOf(1), 0.0, false);<NEW_LINE>node.addReference(new Reference(Identifiers.SessionDiagnosticsArrayType_SessionDiagnostics_ClientConnectionTime, Identifiers.HasTypeDefinition, Identifiers.BaseDataVariableType<MASK><NEW_LINE>node.addReference(new Reference(Identifiers.SessionDiagnosticsArrayType_SessionDiagnostics_ClientConnectionTime, Identifiers.HasModellingRule, Identifiers.ModellingRule_Mandatory.expanded(), true));<NEW_LINE>node.addReference(new Reference(Identifiers.SessionDiagnosticsArrayType_SessionDiagnostics_ClientConnectionTime, Identifiers.HasComponent, Identifiers.SessionDiagnosticsArrayType_SessionDiagnostics.expanded(), false));<NEW_LINE>this.nodeManager.addNode(node);<NEW_LINE>}
.expanded(), true));
1,495,194
public boolean createQuery(final QueryPredicate predicate, final MemoryQuery query, final boolean isFirst) {<NEW_LINE>final boolean isString = predicate.getType().equals(String.class);<NEW_LINE>final Object value = getReadValue(predicate.getValue());<NEW_LINE>final String name = predicate.getName();<NEW_LINE>checkOccur(query, predicate.getOccurrence(), isFirst);<NEW_LINE>// only String properties can be used for inexact search<NEW_LINE>if (predicate.isExactMatch() || !isString) {<NEW_LINE>if (isString && value == null) {<NEW_LINE>// special handling for string attributes<NEW_LINE>// (empty string is equal to null)<NEW_LINE>query.beginGroup(Conjunction.Or);<NEW_LINE>query.addPredicate(new NullPredicate(name));<NEW_LINE>query.addPredicate(new ValuePredicate(name, ""));<NEW_LINE>query.endGroup();<NEW_LINE>} else {<NEW_LINE>query.addPredicate(<MASK><NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>if (value != null && isString) {<NEW_LINE>query.addPredicate(new StringContainsPredicate(name, (String) value));<NEW_LINE>} else {<NEW_LINE>query.beginGroup(Conjunction.Or);<NEW_LINE>query.addPredicate(new NullPredicate(name));<NEW_LINE>query.addPredicate(new ValuePredicate(name, ""));<NEW_LINE>query.endGroup();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>}
new ValuePredicate(name, value));
641,657
public double transitionRegression(Person person, long time) {<NEW_LINE>GrowthChart bmiChart = growthChart.get(GrowthChart.ChartType.BMI);<NEW_LINE>PediatricGrowthTrajectory pgt = (PediatricGrowthTrajectory) person.attributes.get(Person.GROWTH_TRAJECTORY);<NEW_LINE>long start = (long) person.attributes.get(WEIGHT_MANAGEMENT_START);<NEW_LINE>int startAgeInMonths = person.ageInMonths(start);<NEW_LINE>double bmiAtStart = pgt.currentBMI(person, start);<NEW_LINE>String gender = (String) person.attributes.get(Person.GENDER);<NEW_LINE>double originalPercentile = bmiChart.percentileFor(startAgeInMonths, gender, bmiAtStart);<NEW_LINE>double bmiForPercentileAtTwenty = bmiChart.lookUp(240, gender, originalPercentile);<NEW_LINE>double height = growthChart.get(GrowthChart.ChartType.HEIGHT).lookUp(240, gender, person.getVitalSign(VitalSign.HEIGHT_PERCENTILE, time));<NEW_LINE>double targetWeight = BMI.weightForHeightAndBMI(height, bmiForPercentileAtTwenty);<NEW_LINE>int ageTwenty = 20;<NEW_LINE>int lossAndRegressionTotalYears = 7;<NEW_LINE>double weightAtTwenty = BMI.weightForHeightAndBMI(height, pgt.tail().bmi);<NEW_LINE>int regressionEndAge <MASK><NEW_LINE>double percentageElapsed = (person.ageInDecimalYears(time) - ageTwenty) / (regressionEndAge - ageTwenty);<NEW_LINE>return weightAtTwenty + (percentageElapsed * (targetWeight - weightAtTwenty));<NEW_LINE>}
= (startAgeInMonths / 12) + lossAndRegressionTotalYears;
1,656,724
public void marshall(ProvisionedProductAttribute provisionedProductAttribute, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (provisionedProductAttribute == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(provisionedProductAttribute.getName(), NAME_BINDING);<NEW_LINE>protocolMarshaller.marshall(provisionedProductAttribute.getArn(), ARN_BINDING);<NEW_LINE>protocolMarshaller.marshall(provisionedProductAttribute.getType(), TYPE_BINDING);<NEW_LINE>protocolMarshaller.marshall(provisionedProductAttribute.getId(), ID_BINDING);<NEW_LINE>protocolMarshaller.marshall(provisionedProductAttribute.getStatus(), STATUS_BINDING);<NEW_LINE>protocolMarshaller.marshall(provisionedProductAttribute.getStatusMessage(), STATUSMESSAGE_BINDING);<NEW_LINE>protocolMarshaller.marshall(provisionedProductAttribute.getCreatedTime(), CREATEDTIME_BINDING);<NEW_LINE>protocolMarshaller.marshall(provisionedProductAttribute.getIdempotencyToken(), IDEMPOTENCYTOKEN_BINDING);<NEW_LINE>protocolMarshaller.marshall(provisionedProductAttribute.getLastRecordId(), LASTRECORDID_BINDING);<NEW_LINE>protocolMarshaller.marshall(provisionedProductAttribute.getLastProvisioningRecordId(), LASTPROVISIONINGRECORDID_BINDING);<NEW_LINE>protocolMarshaller.marshall(provisionedProductAttribute.getLastSuccessfulProvisioningRecordId(), LASTSUCCESSFULPROVISIONINGRECORDID_BINDING);<NEW_LINE>protocolMarshaller.marshall(provisionedProductAttribute.getTags(), TAGS_BINDING);<NEW_LINE>protocolMarshaller.marshall(provisionedProductAttribute.getPhysicalId(), PHYSICALID_BINDING);<NEW_LINE>protocolMarshaller.marshall(provisionedProductAttribute.getProductId(), PRODUCTID_BINDING);<NEW_LINE>protocolMarshaller.marshall(provisionedProductAttribute.getProductName(), PRODUCTNAME_BINDING);<NEW_LINE>protocolMarshaller.marshall(provisionedProductAttribute.getProvisioningArtifactId(), PROVISIONINGARTIFACTID_BINDING);<NEW_LINE>protocolMarshaller.marshall(provisionedProductAttribute.getProvisioningArtifactName(), PROVISIONINGARTIFACTNAME_BINDING);<NEW_LINE>protocolMarshaller.marshall(provisionedProductAttribute.getUserArn(), USERARN_BINDING);<NEW_LINE>protocolMarshaller.marshall(provisionedProductAttribute.getUserArnSession(), USERARNSESSION_BINDING);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + <MASK><NEW_LINE>}<NEW_LINE>}
e.getMessage(), e);
637,508
private static CTBackground createBackground(String rId) {<NEW_LINE>org.docx4j.wml.ObjectFactory wmlObjectFactory = new org.docx4j.wml.ObjectFactory();<NEW_LINE>CTBackground background = wmlObjectFactory.createCTBackground();<NEW_LINE>background.setColor("FFFFFF");<NEW_LINE>org.docx4j.vml.ObjectFactory vmlObjectFactory = new org.docx4j.vml.ObjectFactory();<NEW_LINE>// Create object for background (wrapped in JAXBElement)<NEW_LINE>org.docx4j.vml.CTBackground background2 = vmlObjectFactory.createCTBackground();<NEW_LINE>JAXBElement<org.docx4j.vml.CTBackground> backgroundWrapped = vmlObjectFactory.createBackground(background2);<NEW_LINE>background.<MASK><NEW_LINE>background2.setTargetscreensize("1024,768");<NEW_LINE>background2.setVmlId("_x0000_s1025");<NEW_LINE>background2.setBwmode(org.docx4j.vml.officedrawing.STBWMode.WHITE);<NEW_LINE>// Create object for fill<NEW_LINE>CTFill fill = vmlObjectFactory.createCTFill();<NEW_LINE>background2.setFill(fill);<NEW_LINE>fill.setTitle("Alien 1");<NEW_LINE>fill.setId(rId);<NEW_LINE>fill.setType(org.docx4j.vml.STFillType.FRAME);<NEW_LINE>fill.setRecolor(org.docx4j.vml.STTrueFalse.T);<NEW_LINE>return background;<NEW_LINE>}
getAnyAndAny().add(backgroundWrapped);
1,627,046
/*<NEW_LINE>* (non-Javadoc)<NEW_LINE>* @see org.eclipse.jface.dialogs.TitleAreaDialog#createDialogArea(org.eclipse.swt.widgets.Composite)<NEW_LINE>*/<NEW_LINE>@Override<NEW_LINE>protected Control createDialogArea(Composite parent) {<NEW_LINE>Composite dialogArea = (Composite) super.createDialogArea(parent);<NEW_LINE>// $NON-NLS-1$<NEW_LINE>titleImage = UIPlugin.getImageDescriptor("/icons/full/security.png").createImage();<NEW_LINE>dialogArea.addDisposeListener(new DisposeListener() {<NEW_LINE><NEW_LINE>public void widgetDisposed(DisposeEvent e) {<NEW_LINE>if (titleImage != null) {<NEW_LINE>setTitleImage(null);<NEW_LINE>titleImage.dispose();<NEW_LINE>titleImage = null;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>setTitleImage(titleImage);<NEW_LINE>setTitle(title);<NEW_LINE>setMessage(message);<NEW_LINE>Composite container = new Composite(dialogArea, SWT.NONE);<NEW_LINE>container.setLayoutData(GridDataFactory.fillDefaults().grab(true<MASK><NEW_LINE>container.setLayout(GridLayoutFactory.swtDefaults().margins(convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_MARGIN), convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_MARGIN)).spacing(convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_SPACING), convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_SPACING)).numColumns(2).create());<NEW_LINE>label = new Label(container, SWT.NONE);<NEW_LINE>label.setLayoutData(GridDataFactory.swtDefaults().create());<NEW_LINE>label.setText(StringUtil.makeFormLabel(Messages.PasswordPromptDialog_Password));<NEW_LINE>passwordText = new Text(container, SWT.SINGLE | SWT.PASSWORD | SWT.BORDER);<NEW_LINE>passwordText.setLayoutData(GridDataFactory.fillDefaults().grab(true, false).create());<NEW_LINE>if (password != null) {<NEW_LINE>passwordText.setText(String.copyValueOf(password));<NEW_LINE>}<NEW_LINE>if (savePasswordPrompt) {
, true).create());
974,096
private void workerDumpInfoOutput() {<NEW_LINE>RuntimeMXBean runtimeMXBean = ManagementFactory.getRuntimeMXBean();<NEW_LINE>String pid = runtimeMXBean.getName().split("@")[0];<NEW_LINE>LOG.debug("worker pid is " + pid);<NEW_LINE>String dumpOutFile = JStormUtils.getLogFileName();<NEW_LINE>if (dumpOutFile == null) {<NEW_LINE>return;<NEW_LINE>} else {<NEW_LINE>dumpOutFile += ".dump";<NEW_LINE>}<NEW_LINE>try {<NEW_LINE><MASK><NEW_LINE>if (!file.exists()) {<NEW_LINE>PathUtils.touch(dumpOutFile);<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>LOG.warn("Failed to touch " + dumpOutFile, e);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>PrintWriter outFile = new PrintWriter(new FileWriter(dumpOutFile, true));<NEW_LINE>StringBuilder jstackCommand = new StringBuilder();<NEW_LINE>jstackCommand.append("jstack ");<NEW_LINE>jstackCommand.append(pid);<NEW_LINE>LOG.debug("Begin to execute " + jstackCommand.toString());<NEW_LINE>String jstackOutput = JStormUtils.launchProcess(jstackCommand.toString(), new HashMap<String, String>(), false);<NEW_LINE>outFile.println(jstackOutput);<NEW_LINE>StringBuilder jmapCommand = new StringBuilder();<NEW_LINE>jmapCommand.append("jmap -heap ");<NEW_LINE>jmapCommand.append(pid);<NEW_LINE>LOG.debug("Begin to execute " + jmapCommand.toString());<NEW_LINE>String jmapOutput = JStormUtils.launchProcess(jmapCommand.toString(), new HashMap<String, String>(), false);<NEW_LINE>outFile.println(jmapOutput);<NEW_LINE>} catch (Exception e) {<NEW_LINE>LOG.error("can't execute jstack and jmap for pid: " + pid);<NEW_LINE>LOG.error(String.valueOf(e));<NEW_LINE>}<NEW_LINE>}
File file = new File(dumpOutFile);
1,300,411
public int fill(Supplier<E> s, int limit) {<NEW_LINE>if (null == s)<NEW_LINE>throw new IllegalArgumentException("supplier is null");<NEW_LINE>if (limit < 0)<NEW_LINE>throw new IllegalArgumentException("limit is negative:" + limit);<NEW_LINE>if (limit == 0)<NEW_LINE>return 0;<NEW_LINE>LinkedQueueNode<E> tail = newNode(s.get());<NEW_LINE>final LinkedQueueNode<E> head = tail;<NEW_LINE>for (int i = 1; i < limit; i++) {<NEW_LINE>final LinkedQueueNode<E> temp = newNode(s.get());<NEW_LINE>// spNext : soProducerNode ensures correct construction<NEW_LINE>tail.spNext(temp);<NEW_LINE>tail = temp;<NEW_LINE>}<NEW_LINE>final LinkedQueueNode<MASK><NEW_LINE>soProducerNode(tail);<NEW_LINE>// same bubble as offer, and for the same reasons.<NEW_LINE>oldPNode.soNext(head);<NEW_LINE>return limit;<NEW_LINE>}
<E> oldPNode = lpProducerNode();
621,856
public void createContents(Composite dialogArea) {<NEW_LINE>List<Disposable> disposables = new ArrayList<>();<NEW_LINE>dialogArea.addDisposeListener(de -> {<NEW_LINE>for (Disposable d : disposables) {<NEW_LINE>d.dispose();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>// Favourites pulldown composite<NEW_LINE>Composite sbComposite = dialogArea;<NEW_LINE>if (model.getFavourites() != null) {<NEW_LINE>sbComposite = new Composite(dialogArea, SWT.NONE);<NEW_LINE>GridLayout layout <MASK><NEW_LINE>layout.marginWidth = 0;<NEW_LINE>layout.marginHeight = 0;<NEW_LINE>sbComposite.setLayout(layout);<NEW_LINE>GridDataFactory.fillDefaults().grab(true, false).applyTo(sbComposite);<NEW_LINE>}<NEW_LINE>// Search box:<NEW_LINE>Text pattern = new Text(sbComposite, SWT.SINGLE | SWT.BORDER | SWT.SEARCH | SWT.ICON_CANCEL);<NEW_LINE>// pattern.getAccessible().addAccessibleListener(new AccessibleAdapter() {<NEW_LINE>// public void getName(AccessibleEvent e) {<NEW_LINE>// e.result = LegacyActionTools.removeMnemonics(headerLabel)<NEW_LINE>// .getText());<NEW_LINE>// }<NEW_LINE>// });<NEW_LINE>pattern.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));<NEW_LINE>pattern.setMessage(model.getSearchBoxHintMessage());<NEW_LINE>SwtConnect.connect(pattern, model.getSearchBox(), true);<NEW_LINE>// Favourites pulldown<NEW_LINE>if (model.getFavourites() != null) {<NEW_LINE>createFavouritesPulldown(sbComposite, model.getFavourites(), model.getSearchBox());<NEW_LINE>}<NEW_LINE>// Tree viewer with results<NEW_LINE>TreeViewer viewer = new TreeViewer(dialogArea, SWT.SINGLE);<NEW_LINE>ColumnViewerToolTipSupport.enableFor(viewer);<NEW_LINE>GridDataFactory.fillDefaults().grab(true, true).applyTo(viewer.getControl());<NEW_LINE>viewer.setContentProvider(new SymbolsContentProvider());<NEW_LINE>viewer.setLabelProvider(new GotoSymbolsLabelProvider(viewer.getTree().getFont()));<NEW_LINE>viewer.setUseHashlookup(true);<NEW_LINE>disposables.add(model.getSymbols().onChange(UIValueListener.from((e, v) -> {<NEW_LINE>if (!viewer.getControl().isDisposed())<NEW_LINE>viewer.refresh();<NEW_LINE>})));<NEW_LINE>// TODO: somehow show selection in local file, (but not in other file ?)<NEW_LINE>// viewer.addSelectionChangedListener(event -> {<NEW_LINE>// IStructuredSelection selection = (IStructuredSelection) event.getSelection();<NEW_LINE>// if (selection.isEmpty()) {<NEW_LINE>// return;<NEW_LINE>// }<NEW_LINE>// SymbolInformation symbolInformation = (SymbolInformation) selection.getFirstElement();<NEW_LINE>// Location location = symbolInformation.getLocation();<NEW_LINE>//<NEW_LINE>// IResource targetResource = LSPEclipseUtils.findResourceFor(location.getUri());<NEW_LINE>// if (targetResource == null) {<NEW_LINE>// return;<NEW_LINE>// }<NEW_LINE>// IDocument targetDocument = FileBuffers.getTextFileBufferManager()<NEW_LINE>// .getTextFileBuffer(targetResource.getFullPath(), LocationKind.IFILE).getDocument();<NEW_LINE>// if (targetDocument != null) {<NEW_LINE>// try {<NEW_LINE>// int offset = LSPEclipseUtils.toOffset(location.getRange().getStart(), targetDocument);<NEW_LINE>// int endOffset = LSPEclipseUtils.toOffset(location.getRange().getEnd(), targetDocument);<NEW_LINE>// fTextEditor.selectAndReveal(offset, endOffset - offset);<NEW_LINE>// } catch (BadLocationException e) {<NEW_LINE>// LanguageServerPlugin.logError(e);<NEW_LINE>// }<NEW_LINE>// }<NEW_LINE>// });<NEW_LINE>installWidgetListeners(pattern, viewer);<NEW_LINE>// Status label<NEW_LINE>if (enableStatusLine) {<NEW_LINE>StyledText statusLabel = new StyledText(dialogArea, SWT.NONE);<NEW_LINE>// Allow for some extra space for highlight fonts<NEW_LINE>statusLabel.setLeftMargin(3);<NEW_LINE>statusLabel.setBottomMargin(2);<NEW_LINE>statusLabel.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));<NEW_LINE>Stylers stylers = new Stylers(dialogArea.getFont());<NEW_LINE>disposables.add(stylers);<NEW_LINE>SwtConnect.connectHighlighted(stylers.bold(), statusLabel, model.getStatus(), Duration.ofMillis(500));<NEW_LINE>}<NEW_LINE>viewer.setInput(model);<NEW_LINE>}
= new GridLayout(2, false);
1,075,096
public void cancelFileUpload(String uploadId, String xSdsAuthToken) throws ApiException {<NEW_LINE>Object localVarPostBody = null;<NEW_LINE>// verify the required parameter 'uploadId' is set<NEW_LINE>if (uploadId == null) {<NEW_LINE>throw new ApiException(400, "Missing the required parameter 'uploadId' when calling cancelFileUpload");<NEW_LINE>}<NEW_LINE>// create path and map variables<NEW_LINE>String localVarPath = "/v4/nodes/files/uploads/{upload_id}".replaceAll("\\{" + "upload_id" + "\\}", apiClient.escapeString(uploadId.toString()));<NEW_LINE>// query params<NEW_LINE>List<Pair> localVarQueryParams = new ArrayList<Pair>();<NEW_LINE>Map<String, String> localVarHeaderParams = new HashMap<String, String>();<NEW_LINE>Map<String, Object> localVarFormParams = new HashMap<String, Object>();<NEW_LINE>if (xSdsAuthToken != null)<NEW_LINE>localVarHeaderParams.put("X-Sds-Auth-Token", apiClient.parameterToString(xSdsAuthToken));<NEW_LINE>final String[] localVarAccepts = { "application/json" };<NEW_LINE>final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);<NEW_LINE>final String[] localVarContentTypes = {};<NEW_LINE>final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);<NEW_LINE>String[] localVarAuthNames <MASK><NEW_LINE>apiClient.invokeAPI(localVarPath, "DELETE", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, null);<NEW_LINE>}
= new String[] { "oauth2" };
1,661,026
private void addBackup() {<NEW_LINE>// move the current log file to the newly formatted backup name<NEW_LINE>String newname = this.fileinfo + this.myFormat.format(new Date(HttpDispatcher.getApproxTime())) + this.extensioninfo;<NEW_LINE>File newFile = new File(newname);<NEW_LINE>renameFile(getFile(), newFile);<NEW_LINE>// now see if we need to delete an existing backup to make room<NEW_LINE>// if not set to unlimited<NEW_LINE>if (getMaximumBackupFiles() > 0) {<NEW_LINE>while (this.backups.size() >= getMaximumBackupFiles()) {<NEW_LINE>File oldest = this.backups.removeLast();<NEW_LINE>if (null != oldest && oldest.exists()) {<NEW_LINE>if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {<NEW_LINE>Tr.debug(tc, getFileName() + ": Purging oldest backup-> " + oldest.getName());<NEW_LINE>}<NEW_LINE>oldest.delete();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>}
this.backups.addFirst(newFile);
985,083
public ShortestPathDeltaStepping compute(long startNode) {<NEW_LINE>// reset<NEW_LINE>for (int i = 0; i < nodeCount; i++) {<NEW_LINE>distance.<MASK><NEW_LINE>}<NEW_LINE>buckets.reset();<NEW_LINE>// basically assign start node to bucket 0<NEW_LINE>relax(graph.toMappedNodeId(startNode), 0);<NEW_LINE>// as long as the bucket contains any value<NEW_LINE>while (!buckets.isEmpty() && running()) {<NEW_LINE>// reset temporary arrays<NEW_LINE>light.clear();<NEW_LINE>heavy.clear();<NEW_LINE>// get next bucket index<NEW_LINE>final int phase = buckets.nextNonEmptyBucket();<NEW_LINE>// for each node in bucket<NEW_LINE>buckets.forEachInBucket(phase, node -> {<NEW_LINE>// relax each outgoing light edge<NEW_LINE>graph.forEachRelationship(node, direction, (sourceNodeId, targetNodeId, relationId, cost) -> {<NEW_LINE>final int iCost = (int) (cost * multiplier + distance.get(sourceNodeId));<NEW_LINE>if (cost <= delta) {<NEW_LINE>// determine if light or heavy edge<NEW_LINE>light.add(() -> relax(targetNodeId, iCost));<NEW_LINE>} else {<NEW_LINE>heavy.add(() -> relax(targetNodeId, iCost));<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>});<NEW_LINE>return true;<NEW_LINE>});<NEW_LINE>ParallelUtil.run(light, executorService, futures);<NEW_LINE>ParallelUtil.run(heavy, executorService, futures);<NEW_LINE>}<NEW_LINE>return this;<NEW_LINE>}
set(i, Integer.MAX_VALUE);
1,832,984
public boolean apply(Game game, Ability source) {<NEW_LINE>Player controller = game.getPlayer(source.getControllerId());<NEW_LINE>Player opponent = game.getPlayer(this.getTargetPointer().getFirst(game, source));<NEW_LINE>if (controller == null || opponent == null) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>// Name a card.<NEW_LINE>String cardName = ChooseACardNameEffect.TypeOfName.ALL.getChoice(controller, game, source, false);<NEW_LINE>boolean opponentGuess = false;<NEW_LINE>if (opponent.chooseUse(Outcome.Neutral, "Is the chosen card (" + cardName + ") in " + controller.getLogName() + "'s hand?", source, game)) {<NEW_LINE>opponentGuess = true;<NEW_LINE>}<NEW_LINE>boolean rightGuess = !opponentGuess;<NEW_LINE>for (Card card : controller.getHand().getCards(game)) {<NEW_LINE>if (CardUtil.haveSameNames(card, cardName, game)) {<NEW_LINE>rightGuess = opponentGuess;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>game.informPlayers(opponent.getLogName() + " guesses that " + cardName + " is " + (opponentGuess ? "" : "not") + " in " + controller.getLogName() + "'s hand");<NEW_LINE>if (controller.chooseUse(outcome, "Reveal your hand?", source, game)) {<NEW_LINE>controller.revealCards("hand of " + controller.getName(), <MASK><NEW_LINE>if (!rightGuess) {<NEW_LINE>controller.drawCards(1, source, game);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>}
controller.getHand(), game);
445,930
public void init() {<NEW_LINE>Map<String, String> metadata = nacosDiscoveryProperties.getMetadata();<NEW_LINE>Environment env = context.getEnvironment();<NEW_LINE>String endpointBasePath = env.getProperty(MANAGEMENT_ENDPOINT_BASE_PATH);<NEW_LINE>if (StringUtils.hasLength(endpointBasePath)) {<NEW_LINE>metadata.put(MANAGEMENT_ENDPOINT_BASE_PATH, endpointBasePath);<NEW_LINE>}<NEW_LINE>Integer managementPort = ManagementServerPortUtils.getPort(context);<NEW_LINE>if (null != managementPort) {<NEW_LINE>metadata.put(MANAGEMENT_PORT, managementPort.toString());<NEW_LINE>String contextPath = env.getProperty("management.server.servlet.context-path");<NEW_LINE>String <MASK><NEW_LINE>if (StringUtils.hasLength(contextPath)) {<NEW_LINE>metadata.put(MANAGEMENT_CONTEXT_PATH, contextPath);<NEW_LINE>}<NEW_LINE>if (StringUtils.hasLength(address)) {<NEW_LINE>metadata.put(MANAGEMENT_ADDRESS, address);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (null != nacosDiscoveryProperties.getHeartBeatInterval()) {<NEW_LINE>metadata.put(PreservedMetadataKeys.HEART_BEAT_INTERVAL, nacosDiscoveryProperties.getHeartBeatInterval().toString());<NEW_LINE>}<NEW_LINE>if (null != nacosDiscoveryProperties.getHeartBeatTimeout()) {<NEW_LINE>metadata.put(PreservedMetadataKeys.HEART_BEAT_TIMEOUT, nacosDiscoveryProperties.getHeartBeatTimeout().toString());<NEW_LINE>}<NEW_LINE>if (null != nacosDiscoveryProperties.getIpDeleteTimeout()) {<NEW_LINE>metadata.put(PreservedMetadataKeys.IP_DELETE_TIMEOUT, nacosDiscoveryProperties.getIpDeleteTimeout().toString());<NEW_LINE>}<NEW_LINE>customize(registrationCustomizers);<NEW_LINE>}
address = env.getProperty("management.server.address");
789,696
public void marshall(HlsAkamaiSettings hlsAkamaiSettings, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (hlsAkamaiSettings == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(hlsAkamaiSettings.getConnectionRetryInterval(), CONNECTIONRETRYINTERVAL_BINDING);<NEW_LINE>protocolMarshaller.marshall(hlsAkamaiSettings.getFilecacheDuration(), FILECACHEDURATION_BINDING);<NEW_LINE>protocolMarshaller.marshall(hlsAkamaiSettings.getHttpTransferMode(), HTTPTRANSFERMODE_BINDING);<NEW_LINE>protocolMarshaller.marshall(hlsAkamaiSettings.getNumRetries(), NUMRETRIES_BINDING);<NEW_LINE>protocolMarshaller.marshall(hlsAkamaiSettings.getRestartDelay(), RESTARTDELAY_BINDING);<NEW_LINE>protocolMarshaller.marshall(<MASK><NEW_LINE>protocolMarshaller.marshall(hlsAkamaiSettings.getToken(), TOKEN_BINDING);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>}
hlsAkamaiSettings.getSalt(), SALT_BINDING);
1,120,863
public GraphExtension init(GraphHopper graphhopper) throws Exception {<NEW_LINE>if (storage != null)<NEW_LINE>throw new Exception("GraphStorageBuilder has been already initialized.");<NEW_LINE>if (parameters.containsKey(ENABLED))<NEW_LINE>enabled = Boolean.parseBoolean(parameters.get(ENABLED));<NEW_LINE>if (enabled) {<NEW_LINE>if (parameters.containsKey(PARAM_KEY_STREETS))<NEW_LINE>streetsFile = parameters.get(PARAM_KEY_STREETS);<NEW_LINE>else {<NEW_LINE>ErrorLoggingUtility.logMissingConfigParameter(HereTrafficGraphStorageBuilder.class, PARAM_KEY_STREETS);<NEW_LINE>}<NEW_LINE>if (parameters.containsKey(PARAM_KEY_PATTERNS_15MINUTES))<NEW_LINE>patterns15MinutesFile = parameters.get(PARAM_KEY_PATTERNS_15MINUTES);<NEW_LINE>else {<NEW_LINE>ErrorLoggingUtility.logMissingConfigParameter(HereTrafficGraphStorageBuilder.class, PARAM_KEY_PATTERNS_15MINUTES);<NEW_LINE>}<NEW_LINE>if (parameters.containsKey(PARAM_KEY_REFERENCE_PATTERN))<NEW_LINE>refPatternIdsFile = parameters.get(PARAM_KEY_REFERENCE_PATTERN);<NEW_LINE>else {<NEW_LINE>ErrorLoggingUtility.<MASK><NEW_LINE>}<NEW_LINE>if (parameters.containsKey(PARAM_KEY_OUTPUT_LOG))<NEW_LINE>outputLog = Boolean.parseBoolean(parameters.get(PARAM_KEY_OUTPUT_LOG));<NEW_LINE>else {<NEW_LINE>ErrorLoggingUtility.logMissingConfigParameter(HereTrafficGraphStorageBuilder.class, PARAM_KEY_OUTPUT_LOG);<NEW_LINE>}<NEW_LINE>if (parameters.containsKey(MATCHING_RADIUS))<NEW_LINE>matchingRadius = Integer.parseInt(parameters.get(MATCHING_RADIUS));<NEW_LINE>else {<NEW_LINE>ErrorLoggingUtility.logMissingConfigParameter(HereTrafficGraphStorageBuilder.class, MATCHING_RADIUS);<NEW_LINE>LOGGER.info("The Here matching radius is not set. The default is applied!");<NEW_LINE>}<NEW_LINE>storage = new TrafficGraphStorage();<NEW_LINE>} else {<NEW_LINE>LOGGER.info("Traffic not enabled.");<NEW_LINE>}<NEW_LINE>return storage;<NEW_LINE>}
logMissingConfigParameter(HereTrafficGraphStorageBuilder.class, PARAM_KEY_REFERENCE_PATTERN);
1,476,477
private void init() {<NEW_LINE>setUndecorated(true);<NEW_LINE>try {<NEW_LINE>if (GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice().isWindowTranslucencySupported(WindowTranslucency.TRANSLUCENT)) {<NEW_LINE>if (!Config.getInstance().isNoTransparency())<NEW_LINE>setOpacity(0.85f);<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>Logger.log(e);<NEW_LINE>}<NEW_LINE>setIconImage(ImageResource.getImage("icon.png"));<NEW_LINE>setSize(getScaledInt(350), getScaledInt(200));<NEW_LINE>setLocationRelativeTo(null);<NEW_LINE>setResizable(false);<NEW_LINE>getContentPane().setLayout(null);<NEW_LINE>getContentPane().setBackground(ColorResource.getDarkestBgColor());<NEW_LINE>titlePanel = new TitlePanel(null, this);<NEW_LINE>titlePanel.setOpaque(false);<NEW_LINE>titlePanel.setBounds(0, 0, getScaledInt(350), getScaledInt(50));<NEW_LINE>closeBtn = new CustomButton();<NEW_LINE>closeBtn.setBounds(getScaledInt(320), getScaledInt(5), getScaledInt(24), getScaledInt(24));<NEW_LINE>closeBtn.setIcon(ImageResource.getIcon("title_close.png", 20, 20));<NEW_LINE>closeBtn.setBackground(ColorResource.getDarkestBgColor());<NEW_LINE>closeBtn.setBorderPainted(false);<NEW_LINE>closeBtn.setFocusPainted(false);<NEW_LINE>closeBtn.setName("CLOSE");<NEW_LINE>closeBtn.addActionListener(this);<NEW_LINE>minBtn = new CustomButton();<NEW_LINE>minBtn.setBounds(getScaledInt(296), getScaledInt(5), getScaledInt(24), getScaledInt(24));<NEW_LINE>minBtn.setIcon(ImageResource.getIcon("title_min.png", 20, 20));<NEW_LINE>minBtn.setBackground(ColorResource.getDarkestBgColor());<NEW_LINE>minBtn.setBorderPainted(false);<NEW_LINE>minBtn.setFocusPainted(false);<NEW_LINE>minBtn.setName("MIN");<NEW_LINE>minBtn.addActionListener(this);<NEW_LINE>titleLbl = new JLabel(StringResource.get("TITLE_CONVERT"));<NEW_LINE>titleLbl.setFont(FontResource.getBiggerFont());<NEW_LINE>titleLbl.setForeground(ColorResource.getSelectionColor());<NEW_LINE>titleLbl.setBounds(getScaledInt(25), getScaledInt(15), getScaledInt(250), getScaledInt(30));<NEW_LINE>JLabel lineLbl = new JLabel();<NEW_LINE>lineLbl.setBackground(ColorResource.getSelectionColor());<NEW_LINE>lineLbl.setBounds(0, getScaledInt(55), getScaledInt(400), 2);<NEW_LINE>lineLbl.setOpaque(true);<NEW_LINE>prg = new JProgressBar();<NEW_LINE>prg.setBounds(getScaledInt(20), getScaledInt(85), getScaledInt(350) - getScaledInt(40), getScaledInt(5));<NEW_LINE>statLbl = new JLabel();<NEW_LINE>statLbl.setForeground(Color.WHITE);<NEW_LINE>statLbl.setBounds(getScaledInt(20), getScaledInt(100), getScaledInt(350) - getScaledInt(40), getScaledInt(25));<NEW_LINE>titlePanel.add(titleLbl);<NEW_LINE>titlePanel.add(minBtn);<NEW_LINE>titlePanel.add(closeBtn);<NEW_LINE>add(lineLbl);<NEW_LINE>add(titlePanel);<NEW_LINE>add(prg);<NEW_LINE>add(statLbl);<NEW_LINE>panel = new JPanel(null);<NEW_LINE>panel.setBounds(0, getScaledInt(150), getScaledInt(350), getScaledInt(50));<NEW_LINE><MASK><NEW_LINE>btnCN = new CustomButton(StringResource.get("MENU_PAUSE"));<NEW_LINE>btnCN.setBounds(0, 1, getScaledInt(350), getScaledInt(50));<NEW_LINE>btnCN.setName("CLOSE");<NEW_LINE>applyStyle(btnCN);<NEW_LINE>panel.add(btnCN);<NEW_LINE>add(panel);<NEW_LINE>}
panel.setBackground(Color.DARK_GRAY);
1,517,483
private void validateAllInsertsMatchTheirConditionalUrls(Map<IIdType, DaoMethodOutcome> theIdToPersistedOutcome, Map<String, IIdType> conditionalUrlToIdMap, RequestDetails theRequest) {<NEW_LINE>conditionalUrlToIdMap.entrySet().stream().filter(entry -> entry.getKey() != null).forEach(entry -> {<NEW_LINE><MASK><NEW_LINE>IIdType value = entry.getValue();<NEW_LINE>DaoMethodOutcome daoMethodOutcome = theIdToPersistedOutcome.get(value);<NEW_LINE>if (daoMethodOutcome != null && !daoMethodOutcome.isNop() && daoMethodOutcome.getResource() != null) {<NEW_LINE>InMemoryMatchResult match = mySearchParamMatcher.match(matchUrl, daoMethodOutcome.getResource(), theRequest);<NEW_LINE>if (ourLog.isDebugEnabled()) {<NEW_LINE>ourLog.debug("Checking conditional URL [{}] against resource with ID [{}]: Supported?:[{}], Matched?:[{}]", matchUrl, value, match.supported(), match.matched());<NEW_LINE>}<NEW_LINE>if (match.supported()) {<NEW_LINE>if (!match.matched()) {<NEW_LINE>throw new PreconditionFailedException(Msg.code(539) + "Invalid conditional URL \"" + matchUrl + "\". The given resource is not matched by this URL.");<NEW_LINE>}<NEW_LINE>;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}
String matchUrl = entry.getKey();
1,505,415
public Request<CreateInstanceProfileRequest> marshall(CreateInstanceProfileRequest createInstanceProfileRequest) {<NEW_LINE>if (createInstanceProfileRequest == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>Request<CreateInstanceProfileRequest> request = new DefaultRequest<CreateInstanceProfileRequest>(createInstanceProfileRequest, "AmazonIdentityManagement");<NEW_LINE>request.addParameter("Action", "CreateInstanceProfile");<NEW_LINE>request.addParameter("Version", "2010-05-08");<NEW_LINE>request.setHttpMethod(HttpMethodName.POST);<NEW_LINE>if (createInstanceProfileRequest.getInstanceProfileName() != null) {<NEW_LINE>request.addParameter("InstanceProfileName", StringUtils.fromString(createInstanceProfileRequest.getInstanceProfileName()));<NEW_LINE>}<NEW_LINE>if (createInstanceProfileRequest.getPath() != null) {<NEW_LINE>request.addParameter("Path", StringUtils.fromString(createInstanceProfileRequest.getPath()));<NEW_LINE>}<NEW_LINE>if (!createInstanceProfileRequest.getTags().isEmpty() || !((com.amazonaws.internal.SdkInternalList<Tag>) createInstanceProfileRequest.getTags()).isAutoConstruct()) {<NEW_LINE>com.amazonaws.internal.SdkInternalList<Tag> tagsList = (com.amazonaws.internal.SdkInternalList<Tag>) createInstanceProfileRequest.getTags();<NEW_LINE>int tagsListIndex = 1;<NEW_LINE>for (Tag tagsListValue : tagsList) {<NEW_LINE>if (tagsListValue != null) {<NEW_LINE>if (tagsListValue.getKey() != null) {<NEW_LINE>request.addParameter("Tags.member." + tagsListIndex + ".Key", StringUtils.fromString<MASK><NEW_LINE>}<NEW_LINE>if (tagsListValue.getValue() != null) {<NEW_LINE>request.addParameter("Tags.member." + tagsListIndex + ".Value", StringUtils.fromString(tagsListValue.getValue()));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>tagsListIndex++;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return request;<NEW_LINE>}
(tagsListValue.getKey()));
639,796
public Object jmeClone() {<NEW_LINE>VehicleControl control = new VehicleControl(collisionShape, mass);<NEW_LINE>control.setAngularFactor(getAngularFactor());<NEW_LINE>control.setAngularSleepingThreshold(getAngularSleepingThreshold());<NEW_LINE>control.setAngularVelocity(getAngularVelocity());<NEW_LINE>control.setCcdMotionThreshold(getCcdMotionThreshold());<NEW_LINE>control.setCcdSweptSphereRadius(getCcdSweptSphereRadius());<NEW_LINE>control.setCollideWithGroups(getCollideWithGroups());<NEW_LINE>control.setCollisionGroup(getCollisionGroup());<NEW_LINE>control.setContactResponse(isContactResponse());<NEW_LINE>control.setDamping(getLinearDamping(), getAngularDamping());<NEW_LINE>control.setFriction(getFriction());<NEW_LINE>control.setGravity(getGravity());<NEW_LINE>control.setKinematic(isKinematic());<NEW_LINE>control.setLinearSleepingThreshold(getLinearSleepingThreshold());<NEW_LINE>control.setLinearVelocity(getLinearVelocity());<NEW_LINE>control.setPhysicsLocation(getPhysicsLocation());<NEW_LINE>control.setPhysicsRotation(getPhysicsRotationMatrix());<NEW_LINE>control.setRestitution(getRestitution());<NEW_LINE>control.setFrictionSlip(getFrictionSlip());<NEW_LINE>control.setMaxSuspensionTravelCm(getMaxSuspensionTravelCm());<NEW_LINE>control.setSuspensionStiffness(getSuspensionStiffness());<NEW_LINE>control.setSuspensionCompression(tuning.suspensionCompression);<NEW_LINE>control.setSuspensionDamping(tuning.suspensionDamping);<NEW_LINE>control.setMaxSuspensionForce(getMaxSuspensionForce());<NEW_LINE>for (Iterator<VehicleWheel> it = wheels.iterator(); it.hasNext(); ) {<NEW_LINE>VehicleWheel wheel = it.next();<NEW_LINE>VehicleWheel newWheel = control.addWheel(wheel.getLocation(), wheel.getDirection(), wheel.getAxle(), wheel.getRestLength(), wheel.getRadius(), wheel.isFrontWheel());<NEW_LINE>newWheel.setFrictionSlip(wheel.getFrictionSlip());<NEW_LINE>newWheel.setMaxSuspensionTravelCm(wheel.getMaxSuspensionTravelCm());<NEW_LINE>newWheel.<MASK><NEW_LINE>newWheel.setWheelsDampingCompression(wheel.getWheelsDampingCompression());<NEW_LINE>newWheel.setWheelsDampingRelaxation(wheel.getWheelsDampingRelaxation());<NEW_LINE>newWheel.setMaxSuspensionForce(wheel.getMaxSuspensionForce());<NEW_LINE>// Copy the wheel spatial reference directly for now. They'll<NEW_LINE>// get fixed up in the cloneFields() method<NEW_LINE>newWheel.setWheelSpatial(wheel.getWheelSpatial());<NEW_LINE>}<NEW_LINE>control.setApplyPhysicsLocal(isApplyPhysicsLocal());<NEW_LINE>control.setEnabled(isEnabled());<NEW_LINE>control.spatial = spatial;<NEW_LINE>return control;<NEW_LINE>}
setSuspensionStiffness(wheel.getSuspensionStiffness());
1,361,953
final DisassociateHealthCheckResult executeDisassociateHealthCheck(DisassociateHealthCheckRequest disassociateHealthCheckRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(disassociateHealthCheckRequest);<NEW_LINE><MASK><NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DisassociateHealthCheckRequest> request = null;<NEW_LINE>Response<DisassociateHealthCheckResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DisassociateHealthCheckRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(disassociateHealthCheckRequest));<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, "Shield");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DisassociateHealthCheck");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DisassociateHealthCheckResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DisassociateHealthCheckResultJsonUnmarshaller());<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();
937,951
private // region Parameters<NEW_LINE>void applyAllParameters(@NonNull CaptureRequest.Builder builder, @Nullable CaptureRequest.Builder oldBuilder) {<NEW_LINE>LOG.i("applyAllParameters:", "called for tag", builder.<MASK><NEW_LINE>builder.set(CaptureRequest.CONTROL_MODE, CaptureRequest.CONTROL_MODE_AUTO);<NEW_LINE>applyDefaultFocus(builder);<NEW_LINE>applyFlash(builder, Flash.OFF);<NEW_LINE>applyLocation(builder, null);<NEW_LINE>applyWhiteBalance(builder, WhiteBalance.AUTO);<NEW_LINE>applyHdr(builder, Hdr.OFF);<NEW_LINE>applyZoom(builder, 0F);<NEW_LINE>applyExposureCorrection(builder, 0F);<NEW_LINE>applyPreviewFrameRate(builder, 0F);<NEW_LINE>if (oldBuilder != null) {<NEW_LINE>// We might be in a metering operation, or the old builder might have some special<NEW_LINE>// metering parameters. Copy these special keys over to the new builder.<NEW_LINE>// These are the keys changed by metering.Parameters, or by us in applyFocusForMetering.<NEW_LINE>builder.set(CaptureRequest.CONTROL_AF_REGIONS, oldBuilder.get(CaptureRequest.CONTROL_AF_REGIONS));<NEW_LINE>builder.set(CaptureRequest.CONTROL_AE_REGIONS, oldBuilder.get(CaptureRequest.CONTROL_AE_REGIONS));<NEW_LINE>builder.set(CaptureRequest.CONTROL_AWB_REGIONS, oldBuilder.get(CaptureRequest.CONTROL_AWB_REGIONS));<NEW_LINE>builder.set(CaptureRequest.CONTROL_AF_MODE, oldBuilder.get(CaptureRequest.CONTROL_AF_MODE));<NEW_LINE>// Do NOT copy exposure or focus triggers!<NEW_LINE>}<NEW_LINE>}
build().getTag());
963,780
final DeleteAccessPolicyResult executeDeleteAccessPolicy(DeleteAccessPolicyRequest deleteAccessPolicyRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(deleteAccessPolicyRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DeleteAccessPolicyRequest> request = null;<NEW_LINE>Response<DeleteAccessPolicyResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DeleteAccessPolicyRequestProtocolMarshaller(protocolFactory).marshall<MASK><NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "IoTSiteWise");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DeleteAccessPolicy");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>URI endpointTraitHost = null;<NEW_LINE>if (!clientConfiguration.isDisableHostPrefixInjection()) {<NEW_LINE>String hostPrefix = "monitor.";<NEW_LINE>String resolvedHostPrefix = String.format("monitor.");<NEW_LINE>endpointTraitHost = UriResourcePathUtils.updateUriHost(endpoint, resolvedHostPrefix);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DeleteAccessPolicyResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DeleteAccessPolicyResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext, null, endpointTraitHost);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
(super.beforeMarshalling(deleteAccessPolicyRequest));
558,112
public GetDiscoveredResourceCountsResult unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>GetDiscoveredResourceCountsResult getDiscoveredResourceCountsResult = new GetDiscoveredResourceCountsResult();<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 getDiscoveredResourceCountsResult;<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("totalDiscoveredResources", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>getDiscoveredResourceCountsResult.setTotalDiscoveredResources(context.getUnmarshaller(Long.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("resourceCounts", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>getDiscoveredResourceCountsResult.setResourceCounts(new ListUnmarshaller<ResourceCount>(ResourceCountJsonUnmarshaller.getInstance()).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("nextToken", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>getDiscoveredResourceCountsResult.setNextToken(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 getDiscoveredResourceCountsResult;<NEW_LINE>}
class).unmarshall(context));
848,870
protected void paintBackground() {<NEW_LINE>super.paintBackground();<NEW_LINE>if (paintState == EdgeWidget.DISABLED) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>DependencyGraphScene scene = getDependencyGraphScene();<NEW_LINE><MASK><NEW_LINE>Rectangle bounds = getClientArea();<NEW_LINE>if (node.isRoot()) {<NEW_LINE>paintBottom(g, bounds, ROOT, Color.WHITE, bounds.height / 2);<NEW_LINE>} else {<NEW_LINE>Color scopeC = scene.getColor(node);<NEW_LINE>if (scopeC != null) {<NEW_LINE>paintCorner(RIGHT_BOTTOM, g, bounds, scopeC, Color.WHITE, bounds.width / 2, bounds.height / 2);<NEW_LINE>}<NEW_LINE>int conflictType = scene.supportsVersions() ? node.getConflictType(scene::isConflict, scene::compareVersions) : VERSION_NO_CONFLICT;<NEW_LINE>Color leftTopC = null;<NEW_LINE>if (conflictType != VERSION_NO_CONFLICT) {<NEW_LINE>leftTopC = conflictType == VERSION_CONFLICT ? (paintState == EdgeWidget.GRAYED ? DISABLE_CONFLICT : CONFLICT) : (paintState == EdgeWidget.GRAYED ? DISABLE_WARNING : WARNING);<NEW_LINE>} else {<NEW_LINE>int state = node.getManagedState();<NEW_LINE>if (GraphNode.OVERRIDES_MANAGED == state) {<NEW_LINE>leftTopC = WARNING;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (leftTopC != null) {<NEW_LINE>paintCorner(LEFT_TOP, g, bounds, leftTopC, Color.WHITE, bounds.width, bounds.height / 2);<NEW_LINE>}<NEW_LINE>if (node.getPrimaryLevel() == 1) {<NEW_LINE>paintBottom(g, bounds, DIRECTS, Color.WHITE, bounds.height / 6);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (getState().isHovered() || getState().isSelected()) {<NEW_LINE>paintHover(g, bounds, hoverBorderC, getState().isSelected());<NEW_LINE>}<NEW_LINE>}
Graphics2D g = scene.getGraphics();
1,535,060
public static AbstractPointer BDWTOKEN(ByteDataWrapperPointer ptr, U8Pointer[] cacheHeader) throws CorruptDataException {<NEW_LINE>PointerPointer tokenOffset = ptr.tokenOffsetEA();<NEW_LINE>if (null == cacheHeader) {<NEW_LINE>I32 tokenOffsetI32 = I32Pointer.cast(tokenOffset).at(0);<NEW_LINE>if (!tokenOffsetI32.isZero()) {<NEW_LINE>return U8Pointer.cast(ptr).add(tokenOffsetI32);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>try {<NEW_LINE>J9ShrOffsetPointer <MASK><NEW_LINE>UDATA offset = j9shrOffset.offset();<NEW_LINE>if (!offset.isZero()) {<NEW_LINE>int layer = SharedClassesMetaDataHelper.getCacheLayerFromJ9shrOffset(j9shrOffset);<NEW_LINE>return cacheHeader[layer].add(offset);<NEW_LINE>}<NEW_LINE>} catch (NoClassDefFoundError | NoSuchFieldException e) {<NEW_LINE>// J9ShrOffset didn't exist in the VM that created this core file<NEW_LINE>// even though it appears to support a multi-layer cache.<NEW_LINE>throw new CorruptDataException(e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return U8Pointer.NULL;<NEW_LINE>}
j9shrOffset = J9ShrOffsetPointer.cast(tokenOffset);
1,520,181
private boolean createPage(StackPane pane, int index) {<NEW_LINE>if (pagination.getPageFactory() != null && pane.getChildren().isEmpty()) {<NEW_LINE>Node content = pagination.<MASK><NEW_LINE>// If the content is null we don't want to switch pages.<NEW_LINE>if (content != null) {<NEW_LINE>pane.getChildren().setAll(content);<NEW_LINE>return true;<NEW_LINE>} else {<NEW_LINE>// Disable animation if the new page does not exist. It is strange to<NEW_LINE>// see the same page animated out then in.<NEW_LINE>boolean isAnimate = animate;<NEW_LINE>if (isAnimate) {<NEW_LINE>animate = false;<NEW_LINE>}<NEW_LINE>if (pagination.getPageFactory().call(previousIndex) != null) {<NEW_LINE>pagination.setCurrentPageIndex(previousIndex);<NEW_LINE>} else {<NEW_LINE>// Set the page index to 0 because both the current,<NEW_LINE>// and the previous pages have no content.<NEW_LINE>pagination.setCurrentPageIndex(0);<NEW_LINE>}<NEW_LINE>if (isAnimate) {<NEW_LINE>animate = true;<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>}
getPageFactory().call(index);
1,610,578
final ListContainersResult executeListContainers(ListContainersRequest listContainersRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(listContainersRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<ListContainersRequest> request = null;<NEW_LINE>Response<ListContainersResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new ListContainersRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(listContainersRequest));<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, "MediaStore");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ListContainers");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<ListContainersResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new ListContainersResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>}
endClientExecution(awsRequestMetrics, request, response);
1,307,968
public EvalQueryQuality evaluate(String taskId, SearchHit[] hits, List<RatedDocument> ratedDocs) {<NEW_LINE>List<RatedSearchHit> ratedSearchHits = joinHitsWithRatings(hits, ratedDocs);<NEW_LINE>int relevantRetrieved = 0;<NEW_LINE>for (RatedSearchHit hit : ratedSearchHits) {<NEW_LINE>OptionalInt rating = hit.getRating();<NEW_LINE>if (rating.isPresent() && isRelevant(rating.getAsInt())) {<NEW_LINE>relevantRetrieved++;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>int relevant = 0;<NEW_LINE>for (RatedDocument rd : ratedDocs) {<NEW_LINE>if (isRelevant(rd.getRating())) {<NEW_LINE>relevant++;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>double recall = 0.0;<NEW_LINE>if (relevant > 0) {<NEW_LINE>recall = (double) relevantRetrieved / relevant;<NEW_LINE>}<NEW_LINE>EvalQueryQuality evalQueryQuality <MASK><NEW_LINE>evalQueryQuality.setMetricDetails(new RecallAtK.Detail(relevantRetrieved, relevant));<NEW_LINE>evalQueryQuality.addHitsAndRatings(ratedSearchHits);<NEW_LINE>return evalQueryQuality;<NEW_LINE>}
= new EvalQueryQuality(taskId, recall);
968,773
public coprocess.CoprocessSessionState.SessionState buildPartial() {<NEW_LINE>coprocess.CoprocessSessionState.SessionState result = new coprocess.CoprocessSessionState.SessionState(this);<NEW_LINE>int from_bitField0_ = bitField0_;<NEW_LINE>int to_bitField0_ = 0;<NEW_LINE>result.lastCheck_ = lastCheck_;<NEW_LINE>result.allowance_ = allowance_;<NEW_LINE>result.rate_ = rate_;<NEW_LINE>result.per_ = per_;<NEW_LINE>result.expires_ = expires_;<NEW_LINE>result.quotaMax_ = quotaMax_;<NEW_LINE>result.quotaRenews_ = quotaRenews_;<NEW_LINE>result.quotaRemaining_ = quotaRemaining_;<NEW_LINE>result.quotaRenewalRate_ = quotaRenewalRate_;<NEW_LINE>result.accessRights_ = internalGetAccessRights();<NEW_LINE>result.accessRights_.makeImmutable();<NEW_LINE>result.orgId_ = orgId_;<NEW_LINE>result.oauthClientId_ = oauthClientId_;<NEW_LINE>result.oauthKeys_ = internalGetOauthKeys();<NEW_LINE>result.oauthKeys_.makeImmutable();<NEW_LINE>if (basicAuthDataBuilder_ == null) {<NEW_LINE>result.basicAuthData_ = basicAuthData_;<NEW_LINE>} else {<NEW_LINE>result.basicAuthData_ = basicAuthDataBuilder_.build();<NEW_LINE>}<NEW_LINE>if (jwtDataBuilder_ == null) {<NEW_LINE>result.jwtData_ = jwtData_;<NEW_LINE>} else {<NEW_LINE>result<MASK><NEW_LINE>}<NEW_LINE>result.hmacEnabled_ = hmacEnabled_;<NEW_LINE>result.hmacSecret_ = hmacSecret_;<NEW_LINE>result.isInactive_ = isInactive_;<NEW_LINE>result.applyPolicyId_ = applyPolicyId_;<NEW_LINE>result.dataExpires_ = dataExpires_;<NEW_LINE>if (monitorBuilder_ == null) {<NEW_LINE>result.monitor_ = monitor_;<NEW_LINE>} else {<NEW_LINE>result.monitor_ = monitorBuilder_.build();<NEW_LINE>}<NEW_LINE>result.enableDetailedRecording_ = enableDetailedRecording_;<NEW_LINE>result.metadata_ = metadata_;<NEW_LINE>if (((bitField0_ & 0x00800000) == 0x00800000)) {<NEW_LINE>tags_ = tags_.getUnmodifiableView();<NEW_LINE>bitField0_ = (bitField0_ & ~0x00800000);<NEW_LINE>}<NEW_LINE>result.tags_ = tags_;<NEW_LINE>result.alias_ = alias_;<NEW_LINE>result.lastUpdated_ = lastUpdated_;<NEW_LINE>result.idExtractorDeadline_ = idExtractorDeadline_;<NEW_LINE>result.sessionLifetime_ = sessionLifetime_;<NEW_LINE>result.bitField0_ = to_bitField0_;<NEW_LINE>onBuilt();<NEW_LINE>return result;<NEW_LINE>}
.jwtData_ = jwtDataBuilder_.build();
1,399,854
public <A> WeightedDiscreteUncertainObject newFeatureVector(Random rand, A array, NumberArrayAdapter<?, A> adapter) {<NEW_LINE>UncertainObject uo = inner.<MASK><NEW_LINE>final int distributionSize = rand.nextInt((maxQuant - minQuant) + 1) + minQuant;<NEW_LINE>DoubleVector[] samples = new DoubleVector[distributionSize];<NEW_LINE>double[] weights = new double[distributionSize];<NEW_LINE>double wsum = 0.;<NEW_LINE>for (int i = 0; i < distributionSize; i++) {<NEW_LINE>samples[i] = uo.drawSample(rand);<NEW_LINE>double w = rand.nextDouble();<NEW_LINE>while (w <= 0.) {<NEW_LINE>// Avoid zero weights.<NEW_LINE>w = rand.nextDouble();<NEW_LINE>}<NEW_LINE>weights[i] = w;<NEW_LINE>wsum += w;<NEW_LINE>}<NEW_LINE>// Normalize to a total weight of 1:<NEW_LINE>assert (wsum > 0.);<NEW_LINE>for (int i = 0; i < distributionSize; i++) {<NEW_LINE>weights[i] /= wsum;<NEW_LINE>}<NEW_LINE>return new WeightedDiscreteUncertainObject(samples, weights);<NEW_LINE>}
newFeatureVector(rand, array, adapter);
729,955
void renderMarker(Canvas canvas, Paint paint, float opacity, RNSVGMarkerPosition position, float strokeWidth) {<NEW_LINE>int count = saveAndSetupCanvas(canvas, mCTM);<NEW_LINE>markerTransform.reset();<NEW_LINE>Point origin = position.origin;<NEW_LINE>markerTransform.setTranslate((float) origin.x * mScale, (float) origin.y * mScale);<NEW_LINE>double markerAngle = "auto".equals(mOrient) ? -1 : Double.parseDouble(mOrient);<NEW_LINE>float degrees = 180 + (float) (markerAngle == -1 ? position.angle : markerAngle);<NEW_LINE>markerTransform.preRotate(degrees);<NEW_LINE>boolean useStrokeWidth = "strokeWidth".equals(mMarkerUnits);<NEW_LINE>if (useStrokeWidth) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>double width = relativeOnWidth(mMarkerWidth) / mScale;<NEW_LINE>double height = relativeOnHeight(mMarkerHeight) / mScale;<NEW_LINE>RectF eRect = new RectF(0, 0, (float) width, (float) height);<NEW_LINE>if (mAlign != null) {<NEW_LINE>RectF vbRect = new RectF(mMinX * mScale, mMinY * mScale, (mMinX + mVbWidth) * mScale, (mMinY + mVbHeight) * mScale);<NEW_LINE>Matrix viewBoxMatrix = ViewBox.getTransform(vbRect, eRect, mAlign, mMeetOrSlice);<NEW_LINE>float[] values = new float[9];<NEW_LINE>viewBoxMatrix.getValues(values);<NEW_LINE>markerTransform.preScale(values[Matrix.MSCALE_X], values[Matrix.MSCALE_Y]);<NEW_LINE>}<NEW_LINE>double x = relativeOnWidth(mRefX);<NEW_LINE>double y = relativeOnHeight(mRefY);<NEW_LINE>markerTransform.preTranslate((float) -x, (float) -y);<NEW_LINE>canvas.concat(markerTransform);<NEW_LINE>drawGroup(canvas, paint, opacity);<NEW_LINE>restoreCanvas(canvas, count);<NEW_LINE>}
markerTransform.preScale(strokeWidth, strokeWidth);
1,037,343
public void save() {<NEW_LINE>FileOutputStream fw = null;<NEW_LINE>try {<NEW_LINE>StringBuilder sb = new StringBuilder();<NEW_LINE>if (url == null)<NEW_LINE>throw new NullPointerException("url is null");<NEW_LINE>sb.append("type: " + getType() + "\n");<NEW_LINE>sb.append("url: " + url + "\n");<NEW_LINE>sb.append("size: " + size + "\n");<NEW_LINE>if (headers != null) {<NEW_LINE>Iterator<HttpHeader> headerIterator = headers.getAll();<NEW_LINE>while (headerIterator.hasNext()) {<NEW_LINE><MASK><NEW_LINE>sb.append("header: " + header.getName() + ":" + header.getValue() + "\n");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (getType() == XDMConstants.HDS) {<NEW_LINE>sb.append("bitrate: " + ((HdsMetadata) this).getBitRate() + "\n");<NEW_LINE>}<NEW_LINE>if (getType() == XDMConstants.DASH) {<NEW_LINE>sb.append("url2: " + ((DashMetadata) this).getUrl2() + "\n");<NEW_LINE>sb.append("len1: " + ((DashMetadata) this).getLen1() + "\n");<NEW_LINE>sb.append("len2: " + ((DashMetadata) this).getLen2() + "\n");<NEW_LINE>if (((DashMetadata) this).getHeaders2() != null) {<NEW_LINE>Iterator<HttpHeader> headerIterator = ((DashMetadata) this).getHeaders2().getAll();<NEW_LINE>while (headerIterator.hasNext()) {<NEW_LINE>HttpHeader header = headerIterator.next();<NEW_LINE>sb.append("header2: " + header.getName() + ":" + header.getValue() + "\n");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (!StringUtils.isNullOrEmptyOrBlank(ydlUrl)) {<NEW_LINE>sb.append("ydlUrl: " + ydlUrl);<NEW_LINE>}<NEW_LINE>File metadataFolder = new File(Config.getInstance().getMetadataFolder());<NEW_LINE>if (!metadataFolder.exists()) {<NEW_LINE>metadataFolder.mkdirs();<NEW_LINE>}<NEW_LINE>File file = new File(metadataFolder, id);<NEW_LINE>fw = new FileOutputStream(file);<NEW_LINE>fw.write(sb.toString().getBytes());<NEW_LINE>fw.close();<NEW_LINE>} catch (Exception e) {<NEW_LINE>Logger.log(e);<NEW_LINE>if (fw != null) {<NEW_LINE>try {<NEW_LINE>fw.close();<NEW_LINE>} catch (Exception ex) {<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
HttpHeader header = headerIterator.next();
610,862
public CancelSpotInstanceRequestsResult unmarshall(StaxUnmarshallerContext context) throws Exception {<NEW_LINE>CancelSpotInstanceRequestsResult cancelSpotInstanceRequestsResult = new CancelSpotInstanceRequestsResult();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>if (context.isStartOfDocument())<NEW_LINE>targetDepth += 1;<NEW_LINE>while (true) {<NEW_LINE>XMLEvent xmlEvent = context.nextEvent();<NEW_LINE>if (xmlEvent.isEndDocument())<NEW_LINE>return cancelSpotInstanceRequestsResult;<NEW_LINE>if (xmlEvent.isAttribute() || xmlEvent.isStartElement()) {<NEW_LINE>if (context.testExpression("spotInstanceRequestSet", targetDepth)) {<NEW_LINE>cancelSpotInstanceRequestsResult.withCancelledSpotInstanceRequests(new ArrayList<CancelledSpotInstanceRequest>());<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (context.testExpression("spotInstanceRequestSet/item", targetDepth)) {<NEW_LINE>cancelSpotInstanceRequestsResult.withCancelledSpotInstanceRequests(CancelledSpotInstanceRequestStaxUnmarshaller.getInstance<MASK><NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>} else if (xmlEvent.isEndElement()) {<NEW_LINE>if (context.getCurrentDepth() < originalDepth) {<NEW_LINE>return cancelSpotInstanceRequestsResult;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
().unmarshall(context));
1,687,263
public static void publishPost(Activity activity, final PostModel post, SiteModel site, Dispatcher dispatcher, @Nullable OnPublishingCallback onPublishingCallback) {<NEW_LINE>// If the post is empty, don't publish<NEW_LINE>if (!PostUtils.isPublishable(post)) {<NEW_LINE>String message = activity.getString(post.isPage() ? R.string.<MASK><NEW_LINE>ToastUtils.showToast(activity, message, ToastUtils.Duration.SHORT);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>boolean isFirstTimePublish = PostUtils.isFirstTimePublish(post);<NEW_LINE>PostUtils.preparePostForPublish(post, site);<NEW_LINE>// save the post in the DB so the UploadService will get the latest change<NEW_LINE>dispatcher.dispatch(PostActionBuilder.newUpdatePostAction(post));<NEW_LINE>if (NetworkUtils.isNetworkAvailable(activity)) {<NEW_LINE>UploadService.uploadPost(activity, post.getId(), isFirstTimePublish);<NEW_LINE>if (onPublishingCallback != null) {<NEW_LINE>onPublishingCallback.onPublishing(isFirstTimePublish);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>PostUtils.trackSavePostAnalytics(post, site);<NEW_LINE>}
error_publish_empty_page : R.string.error_publish_empty_post);
1,618,682
public AddOnLibrary importFromFile(File file) throws IOException {<NEW_LINE>var diiBuilder = AddOnLibraryDto.newBuilder();<NEW_LINE>try (var zip = new ZipFile(file)) {<NEW_LINE>ZipEntry entry = zip.getEntry(LIBRARY_INFO_FILE);<NEW_LINE>if (entry == null) {<NEW_LINE>throw new IOException(I18N.getText("library.error.addOn.noConfigFile"<MASK><NEW_LINE>}<NEW_LINE>var builder = AddOnLibraryDto.newBuilder();<NEW_LINE>JsonFormat.parser().merge(new InputStreamReader(zip.getInputStream(entry)), builder);<NEW_LINE>// MT MacroScript properties<NEW_LINE>var pathAssetMap = processAssets(builder.getNamespace(), zip);<NEW_LINE>var mtsPropBuilder = MTScriptPropertiesDto.newBuilder();<NEW_LINE>ZipEntry mtsPropsZipEntry = zip.getEntry(MACROSCRIPT_PROPERTY_FILE);<NEW_LINE>if (mtsPropsZipEntry != null) {<NEW_LINE>JsonFormat.parser().merge(new InputStreamReader(zip.getInputStream(mtsPropsZipEntry)), mtsPropBuilder);<NEW_LINE>}<NEW_LINE>// Event properties<NEW_LINE>var eventPropBuilder = AddOnLibraryEventsDto.newBuilder();<NEW_LINE>ZipEntry eventsZipEntry = zip.getEntry(EVENT_PROPERTY_FILE);<NEW_LINE>if (eventsZipEntry != null) {<NEW_LINE>JsonFormat.parser().merge(new InputStreamReader(zip.getInputStream(eventsZipEntry)), eventPropBuilder);<NEW_LINE>}<NEW_LINE>var addOnLib = builder.build();<NEW_LINE>byte[] data = Files.readAllBytes(file.toPath());<NEW_LINE>var asset = Type.MTLIB.getFactory().apply(addOnLib.getNamespace(), data);<NEW_LINE>addAsset(asset);<NEW_LINE>return AddOnLibrary.fromDto(asset.getMD5Key(), addOnLib, mtsPropBuilder.build(), eventPropBuilder.build(), pathAssetMap);<NEW_LINE>}<NEW_LINE>}
, file.getPath()));
658,005
public void process(WordprocessingMLPackage wordMLPackage) throws Docx4JException {<NEW_LINE>commentRangeStart = new HashMap<String, String>();<NEW_LINE>commentRangeEnd = new HashMap<String, String>();<NEW_LINE>commentReference = new HashMap<String, String>();<NEW_LINE>footnoteReference = new HashMap<String, String>();<NEW_LINE>endnoteReference = new HashMap<String, String>();<NEW_LINE>// A component can apply in both the main document part,<NEW_LINE>// and in headers/footers. See further<NEW_LINE>// http://forums.opendope.org/Support-components-in-headers-footers-tp2964174p2964174.html<NEW_LINE>process(wordMLPackage.getMainDocumentPart());<NEW_LINE>// Add headers/footers<NEW_LINE>RelationshipsPart rp = wordMLPackage.getMainDocumentPart().getRelationshipsPart();<NEW_LINE>for (Relationship r : rp.getRelationships().getRelationship()) {<NEW_LINE>if (r.getType().equals(Namespaces.HEADER)) {<NEW_LINE>process((HeaderPart) rp.getPart(r));<NEW_LINE>} else if (r.getType().equals(Namespaces.FOOTER)) {<NEW_LINE>process((FooterPart<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
) rp.getPart(r));
1,683,998
private static List<String> readMetadata(Context context) throws IOException {<NEW_LINE>File resourcesDirectory = new File("/data/local/tmp/exopackage/" + context.getPackageName() + "/resources");<NEW_LINE>BufferedReader br = null;<NEW_LINE>try {<NEW_LINE>br = new BufferedReader(new FileReader(new File(resourcesDirectory, "metadata.txt")));<NEW_LINE>ArrayList<String> resources = new ArrayList<>();<NEW_LINE>for (String line; (line = br.readLine()) != null; ) {<NEW_LINE>String[] values = line.split(" ");<NEW_LINE>if (values.length != 2) {<NEW_LINE>throw new RuntimeException("Bad metadata for resources... (" + line + ")");<NEW_LINE>}<NEW_LINE>if (!values[0].equals("resources")) {<NEW_LINE>throw new RuntimeException("Unrecognized resource type: (" + line + ")");<NEW_LINE>}<NEW_LINE>File apk = new File(resourcesDirectory, values[1] + ".apk");<NEW_LINE>if (!apk.exists()) {<NEW_LINE>throw new <MASK><NEW_LINE>}<NEW_LINE>resources.add(apk.getAbsolutePath());<NEW_LINE>}<NEW_LINE>return resources;<NEW_LINE>} finally {<NEW_LINE>if (br != null) {<NEW_LINE>br.close();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
RuntimeException("resources don't exist... (" + line + ")");
435,058
public void read(org.apache.thrift.protocol.TProtocol prot, getDiskUsage_args struct) throws org.apache.thrift.TException {<NEW_LINE>org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot;<NEW_LINE>java.util.BitSet incoming = iprot.readBitSet(2);<NEW_LINE>if (incoming.get(0)) {<NEW_LINE>{<NEW_LINE>org.apache.thrift.protocol.TSet _set29 = iprot.readSetBegin(org.apache.<MASK><NEW_LINE>struct.tables = new java.util.HashSet<java.lang.String>(2 * _set29.size);<NEW_LINE>@org.apache.thrift.annotation.Nullable<NEW_LINE>java.lang.String _elem30;<NEW_LINE>for (int _i31 = 0; _i31 < _set29.size; ++_i31) {<NEW_LINE>_elem30 = iprot.readString();<NEW_LINE>struct.tables.add(_elem30);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>struct.setTablesIsSet(true);<NEW_LINE>}<NEW_LINE>if (incoming.get(1)) {<NEW_LINE>struct.credentials = new org.apache.accumulo.core.securityImpl.thrift.TCredentials();<NEW_LINE>struct.credentials.read(iprot);<NEW_LINE>struct.setCredentialsIsSet(true);<NEW_LINE>}<NEW_LINE>}
thrift.protocol.TType.STRING);
1,022,692
public Sql[] generateSql(final AddDefaultValueStatement statement, final Database database, final SqlGeneratorChain sqlGeneratorChain) {<NEW_LINE>if (!(statement.getDefaultValue() instanceof SequenceNextValueFunction)) {<NEW_LINE>return super.generateSql(statement, database, sqlGeneratorChain);<NEW_LINE>}<NEW_LINE>List<Sql> commands = new ArrayList<>(Arrays.asList(super.generateSql(statement, database, sqlGeneratorChain)));<NEW_LINE>// for postgres, we need to also set the sequence to be owned by this table for true serial like functionality.<NEW_LINE>// this will allow a drop table cascade to remove the sequence as well.<NEW_LINE>SequenceNextValueFunction sequenceFunction = (SequenceNextValueFunction) statement.getDefaultValue();<NEW_LINE><MASK><NEW_LINE>String sequenceSchemaName = sequenceFunction.getSchemaName();<NEW_LINE>String sequence = database.escapeObjectName(null, sequenceSchemaName, sequenceName, Sequence.class);<NEW_LINE>Sql alterSequenceOwner = new UnparsedSql("ALTER SEQUENCE " + sequence + " OWNED BY " + database.escapeTableName(statement.getCatalogName(), statement.getSchemaName(), statement.getTableName()) + "." + database.escapeObjectName(statement.getColumnName(), Column.class), getAffectedColumn(statement), getAffectedSequence(sequenceFunction));<NEW_LINE>commands.add(alterSequenceOwner);<NEW_LINE>return commands.toArray(new Sql[commands.size()]);<NEW_LINE>}
String sequenceName = sequenceFunction.getValue();
883,025
private static List<Step> createCucumberSteps(io.cucumber.messages.types.Pickle pickle, GherkinDialect dialect, CucumberQuery cucumberQuery) {<NEW_LINE>List<Step> list = new ArrayList<>();<NEW_LINE>String previousGivenWhenThen = dialect.getGivenKeywords().stream().filter(s -> !StepType.isAstrix(s)).findFirst().orElseThrow(() -> new IllegalStateException("No Given keyword for dialect: " + dialect.getName()));<NEW_LINE>for (io.cucumber.messages.types.PickleStep pickleStep : pickle.getSteps()) {<NEW_LINE>String gherkinStepId = pickleStep.getAstNodeIds().get(0);<NEW_LINE>io.cucumber.messages.types.Step <MASK><NEW_LINE>Location location = GherkinMessagesLocation.from(gherkinStep.getLocation());<NEW_LINE>String keyword = gherkinStep.getKeyword();<NEW_LINE>Step step = new GherkinMessagesStep(pickleStep, dialect, previousGivenWhenThen, location, keyword);<NEW_LINE>if (step.getType().isGivenWhenThen()) {<NEW_LINE>previousGivenWhenThen = step.getKeyword();<NEW_LINE>}<NEW_LINE>list.add(step);<NEW_LINE>}<NEW_LINE>return list;<NEW_LINE>}
gherkinStep = cucumberQuery.getGherkinStep(gherkinStepId);
1,011,419
public DateTime parseDateTime(String text) {<NEW_LINE>InternalParser parser = requireParser();<NEW_LINE>Chronology chrono = selectChronology(null);<NEW_LINE>DateTimeParserBucket bucket = new DateTimeParserBucket(0, chrono, iLocale, iPivotYear, iDefaultYear);<NEW_LINE>int newPos = parser.parseInto(bucket, text, 0);<NEW_LINE>if (newPos >= 0) {<NEW_LINE>if (newPos >= text.length()) {<NEW_LINE>long millis = bucket.computeMillis(true, text);<NEW_LINE>if (iOffsetParsed && bucket.getOffsetInteger() != null) {<NEW_LINE>int parsedOffset = bucket.getOffsetInteger();<NEW_LINE>DateTimeZone parsedZone = DateTimeZone.forOffsetMillis(parsedOffset);<NEW_LINE>chrono = chrono.withZone(parsedZone);<NEW_LINE>} else if (bucket.getZone() != null) {<NEW_LINE>chrono = chrono.withZone(bucket.getZone());<NEW_LINE>}<NEW_LINE>DateTime dt = new DateTime(millis, chrono);<NEW_LINE>if (iZone != null) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>return dt;<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>newPos = ~newPos;<NEW_LINE>}<NEW_LINE>throw new IllegalArgumentException(FormatUtils.createErrorMessage(text, newPos));<NEW_LINE>}
dt = dt.withZone(iZone);
1,175,468
/*<NEW_LINE>* (non-Javadoc)<NEW_LINE>*<NEW_LINE>* @see de.miethxml.kabeja.parser.entities.DXFEntityHandler#parseGroup(int,<NEW_LINE>* de.miethxml.kabeja.parser.DXFValue)<NEW_LINE>*/<NEW_LINE>public void parseGroup(int groupCode, DXFValue value) {<NEW_LINE>switch(groupCode) {<NEW_LINE>// point 1<NEW_LINE>case GROUPCODE_START_X:<NEW_LINE>solid.getPoint1().setX(value.getDoubleValue());<NEW_LINE>break;<NEW_LINE>case GROUPCODE_START_Y:<NEW_LINE>solid.getPoint1().setY(value.getDoubleValue());<NEW_LINE>break;<NEW_LINE>case GROUPCODE_START_Z:<NEW_LINE>solid.getPoint1().setZ(value.getDoubleValue());<NEW_LINE>break;<NEW_LINE>// point 2<NEW_LINE>case POINT2_X:<NEW_LINE>solid.getPoint2().<MASK><NEW_LINE>break;<NEW_LINE>case POINT2_Y:<NEW_LINE>solid.getPoint2().setY(value.getDoubleValue());<NEW_LINE>break;<NEW_LINE>case POINT2_Z:<NEW_LINE>solid.getPoint2().setZ(value.getDoubleValue());<NEW_LINE>break;<NEW_LINE>// point 3<NEW_LINE>case POINT3_X:<NEW_LINE>solid.getPoint3().setX(value.getDoubleValue());<NEW_LINE>break;<NEW_LINE>case POINT3_Y:<NEW_LINE>solid.getPoint3().setY(value.getDoubleValue());<NEW_LINE>break;<NEW_LINE>case POINT3_Z:<NEW_LINE>solid.getPoint3().setZ(value.getDoubleValue());<NEW_LINE>break;<NEW_LINE>// point 4<NEW_LINE>case POINT4_X:<NEW_LINE>solid.getPoint4().setX(value.getDoubleValue());<NEW_LINE>break;<NEW_LINE>case POINT4_Y:<NEW_LINE>solid.getPoint4().setY(value.getDoubleValue());<NEW_LINE>break;<NEW_LINE>case POINT4_Z:<NEW_LINE>solid.getPoint4().setZ(value.getDoubleValue());<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>super.parseCommonProperty(groupCode, value, solid);<NEW_LINE>}<NEW_LINE>}
setX(value.getDoubleValue());
507,691
public UnifyResult apply(UnifyRuleCall call) {<NEW_LINE>// Child of projectTarget is equivalent to child of filterQuery.<NEW_LINE>try {<NEW_LINE>// TODO: make sure that constants are ok<NEW_LINE>final MutableProject target = (MutableProject) call.target;<NEW_LINE><MASK><NEW_LINE>final RexNode newCondition;<NEW_LINE>final MutableFilter query = (MutableFilter) call.query;<NEW_LINE>try {<NEW_LINE>newCondition = query.condition.accept(shuttle);<NEW_LINE>} catch (MatchFailed e) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>final MutableFilter newFilter = MutableFilter.of(target, newCondition);<NEW_LINE>if (query.getParent() instanceof MutableProject) {<NEW_LINE>final MutableRel inverse = invert(((MutableProject) query.getParent()).getNamedProjects(), newFilter, shuttle);<NEW_LINE>return call.create(query.getParent()).result(inverse);<NEW_LINE>} else {<NEW_LINE>final MutableRel inverse = invert(query, newFilter, target);<NEW_LINE>return call.result(inverse);<NEW_LINE>}<NEW_LINE>} catch (MatchFailed e) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>}
final RexShuttle shuttle = getRexShuttle(target);
1,184,234
public void onMessageReceived(final RemoteMessage remoteMessage) {<NEW_LINE>super.onMessageReceived(remoteMessage);<NEW_LINE>final Boolean isBrazeMessage = this.remotePushClientType.handleRemoteMessages(this, remoteMessage);<NEW_LINE>if (!isBrazeMessage) {<NEW_LINE>final String senderId = getString(R.string.gcm_defaultSenderId);<NEW_LINE>final String from = remoteMessage.getFrom();<NEW_LINE>if (!TextUtils.equals(from, senderId)) {<NEW_LINE>Timber.e("Received a message from %s, expecting %s", from, senderId);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final Map<String, String<MASK><NEW_LINE>final PushNotificationEnvelope envelope = PushNotificationEnvelope.builder().activity(this.gson.fromJson(data.get("activity"), Activity.class)).erroredPledge(this.gson.fromJson(data.get("errored_pledge"), PushNotificationEnvelope.ErroredPledge.class)).gcm(this.gson.fromJson(data.get("gcm"), GCM.class)).message(this.gson.fromJson(data.get("message"), PushNotificationEnvelope.Message.class)).project(this.gson.fromJson(data.get("project"), PushNotificationEnvelope.Project.class)).survey(this.gson.fromJson(data.get("survey"), PushNotificationEnvelope.Survey.class)).build();<NEW_LINE>if (envelope == null) {<NEW_LINE>Timber.e("Cannot parse message, malformed or unexpected data: %s", data.toString());<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>Timber.d("Received message: %s", envelope.toString());<NEW_LINE>this.pushNotifications.add(envelope);<NEW_LINE>}<NEW_LINE>}
> data = remoteMessage.getData();
215,303
public void incLiveness(final String userId, final String field) {<NEW_LINE>Stopwatchs.start("Inc liveness");<NEW_LINE>final String date = DateFormatUtils.format(System.currentTimeMillis(), "yyyyMMdd");<NEW_LINE>try {<NEW_LINE>JSONObject liveness = livenessRepository.getByUserAndDate(userId, date);<NEW_LINE>if (null == liveness) {<NEW_LINE>liveness = new JSONObject();<NEW_LINE>liveness.put(Liveness.LIVENESS_USER_ID, userId);<NEW_LINE>liveness.put(Liveness.LIVENESS_DATE, date);<NEW_LINE>liveness.put(Liveness.LIVENESS_POINT, 0);<NEW_LINE>liveness.put(Liveness.LIVENESS_ACTIVITY, 0);<NEW_LINE>liveness.put(Liveness.LIVENESS_ARTICLE, 0);<NEW_LINE>liveness.put(Liveness.LIVENESS_COMMENT, 0);<NEW_LINE>liveness.put(Liveness.LIVENESS_PV, 0);<NEW_LINE>liveness.put(Liveness.LIVENESS_REWARD, 0);<NEW_LINE>liveness.put(Liveness.LIVENESS_THANK, 0);<NEW_LINE>liveness.put(Liveness.LIVENESS_VOTE, 0);<NEW_LINE>liveness.put(Liveness.LIVENESS_VOTE, 0);<NEW_LINE>liveness.put(Liveness.LIVENESS_ACCEPT_ANSWER, 0);<NEW_LINE>livenessRepository.add(liveness);<NEW_LINE>}<NEW_LINE>liveness.put(field, liveness.optInt(field) + 1);<NEW_LINE>livenessRepository.update(liveness.optString(Keys.OBJECT_ID), liveness);<NEW_LINE>} catch (final RepositoryException e) {<NEW_LINE>LOGGER.log(Level.ERROR, "Updates a liveness [" + date + <MASK><NEW_LINE>} finally {<NEW_LINE>Stopwatchs.end();<NEW_LINE>}<NEW_LINE>}
"] field [" + field + "] failed", e);
467,708
synchronized static Map<String, Throwable> loadAllLibraries() {<NEW_LINE>final String[] toLoad = { "avutil", "swresample", "swscale", "avcodec", "avformat", "avfilter", "avdevice", "faad", "ft2", "png", "jpegdroid", "mad", <MASK><NEW_LINE>HashMap<String, Throwable> exceptions = new HashMap<String, Throwable>();<NEW_LINE>for (String s : toLoad) {<NEW_LINE>try {<NEW_LINE>Log.i(LOG_LIB, "Loading library " + s + "...");<NEW_LINE>System.loadLibrary(s);<NEW_LINE>} catch (UnsatisfiedLinkError e) {<NEW_LINE>exceptions.put(s, e);<NEW_LINE>Log.e(LOG_LIB, "Failed to load library : " + s + " due to link error " + e.getLocalizedMessage(), e);<NEW_LINE>} catch (SecurityException e) {<NEW_LINE>exceptions.put(s, e);<NEW_LINE>Log.e(LOG_LIB, "Failed to load library : " + s + " due to security error " + e.getLocalizedMessage(), e);<NEW_LINE>} catch (Throwable e) {<NEW_LINE>exceptions.put(s, e);<NEW_LINE>Log.e(LOG_LIB, "Failed to load library : " + s + " due to Runtime error " + e.getLocalizedMessage(), e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>errors = Collections.unmodifiableMap(exceptions);<NEW_LINE>return errors;<NEW_LINE>}
"openjpeg", "z", "gpac", "mp4box" };
403,160
private <T> Mono<T> updateControllerAndRetry(RxDocumentServiceRequest request, Mono<T> nextRequestMono) {<NEW_LINE>return this.shouldUpdateRequestController(request).flatMap(shouldUpdate -> {<NEW_LINE>if (shouldUpdate) {<NEW_LINE>this.refreshRequestController();<NEW_LINE>return this.resolveRequestController().flatMap(updatedController -> {<NEW_LINE>if (updatedController.canHandleRequest(request)) {<NEW_LINE>return updatedController.processRequest(request, nextRequestMono).doOnError(throwable <MASK><NEW_LINE>} else {<NEW_LINE>// If we reach here and still can not handle the request, it should mean the request has staled info<NEW_LINE>// and the request will fail by server<NEW_LINE>logger.warn("Can not find request controller to handle request {} with pkRangeId {}", request.getActivityId(), this.getResolvedPartitionKeyRangeId(request));<NEW_LINE>return nextRequestMono;<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} else {<NEW_LINE>return nextRequestMono;<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}
-> this.handleException(throwable));
837,278
public GeoComplexPolygon createGeoComplexPolygon(final PlanetModel planetModel, final List<List<GeoPoint>> pointsList, final GeoPoint testPoint) {<NEW_LINE>// Is it inside or outside?<NEW_LINE>final Boolean isTestPointInside = isInsidePolygon(testPoint, points);<NEW_LINE>if (isTestPointInside != null) {<NEW_LINE>try {<NEW_LINE>// Legal pole<NEW_LINE>if (isTestPointInside == poleMustBeInside) {<NEW_LINE>return new GeoComplexPolygon(planetModel, pointsList, testPoint, isTestPointInside);<NEW_LINE>} else {<NEW_LINE>return new GeoComplexPolygon(planetModel, pointsList, new GeoPoint(-testPoint.x, -testPoint.y, -<MASK><NEW_LINE>}<NEW_LINE>} catch (@SuppressWarnings("unused") IllegalArgumentException e) {<NEW_LINE>// Probably bad choice of test point.<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// If pole choice was illegal, try another one<NEW_LINE>return null;<NEW_LINE>}
testPoint.z), !isTestPointInside);
635,056
public ExportTaskExecutionInfo unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>ExportTaskExecutionInfo exportTaskExecutionInfo = new ExportTaskExecutionInfo();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE><MASK><NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>if (context.testExpression("creationTime", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>exportTaskExecutionInfo.setCreationTime(context.getUnmarshaller(Long.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("completionTime", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>exportTaskExecutionInfo.setCompletionTime(context.getUnmarshaller(Long.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return exportTaskExecutionInfo;<NEW_LINE>}
String currentParentElement = context.getCurrentParentElement();
36,755
// testargumentContainsExceptionInTwoCallbackClasses<NEW_LINE>public void testargumentContainsExceptionInTwoCallbackClasses(String BASE_URL, StringBuilder sb) throws Exception {<NEW_LINE>Client client = ClientBuilder.newClient();<NEW_LINE>invokeClear(client, BASE_URL);<NEW_LINE>invokeReset(client, BASE_URL);<NEW_LINE>Future<Response> suspend2 = client.target(BASE_URL + "rest/resource/suspend").request().async().get();<NEW_LINE>Future<Response> register2 = client.target(BASE_URL + "rest/resource/registerclasses?stage=0").request().async().get();<NEW_LINE>sb.append(compareResult(register2, FALSE));<NEW_LINE>Future<Response> exception2 = client.target(BASE_URL + "rest/resource/resumechecked?stage=1").request().async().get();<NEW_LINE><MASK><NEW_LINE>Response suspendResponse3 = suspend2.get();<NEW_LINE>sb.append(intequalCompare(suspendResponse3.getStatusInfo().getStatusCode(), Response.Status.INTERNAL_SERVER_ERROR.getStatusCode(), true));<NEW_LINE>// assertEquals(suspendResponse3.getStatusInfo().getStatusCode(), Response.Status.INTERNAL_SERVER_ERROR.getStatusCode());<NEW_LINE>suspendResponse3.close();<NEW_LINE>Future<Response> error3 = client.target(BASE_URL + "rest/resource/error").request().async().get();<NEW_LINE>sb.append(compareResult(error3, RuntimeException.class.getName()));<NEW_LINE>error3 = client.target(BASE_URL + "rest/resource/seconderror").request().async().get();<NEW_LINE>sb.append(compareResult(error3, RuntimeException.class.getName()));<NEW_LINE>System.out.println("from testargumentContainsExceptionInTwoCallbackClasses: " + sb);<NEW_LINE>// return sb.toString();<NEW_LINE>}
Response response3 = exception2.get();
1,500,351
private ImmutableList<String> argumentsInternal(@Nullable ArtifactExpander artifactExpander) throws CommandLineExpansionException, InterruptedException {<NEW_LINE>ImmutableList.Builder<String> builder = ImmutableList.builder();<NEW_LINE><MASK><NEW_LINE>for (int i = 0; i < count; ) {<NEW_LINE>Object arg = arguments.get(i++);<NEW_LINE>Object substitutedArg = substituteTreeFileArtifactArgvFragment(arg);<NEW_LINE>if (substitutedArg instanceof NestedSet) {<NEW_LINE>evalSimpleVectorArg(((NestedSet<?>) substitutedArg).toList(), builder);<NEW_LINE>} else if (substitutedArg instanceof Iterable) {<NEW_LINE>evalSimpleVectorArg((Iterable<?>) substitutedArg, builder);<NEW_LINE>} else if (substitutedArg instanceof ArgvFragment) {<NEW_LINE>if (artifactExpander != null && substitutedArg instanceof TreeArtifactExpansionArgvFragment) {<NEW_LINE>TreeArtifactExpansionArgvFragment expansionArg = (TreeArtifactExpansionArgvFragment) substitutedArg;<NEW_LINE>expansionArg.eval(builder, artifactExpander);<NEW_LINE>} else {<NEW_LINE>i = ((ArgvFragment) substitutedArg).eval(arguments, i, builder, stripOutputPaths());<NEW_LINE>}<NEW_LINE>} else if (substitutedArg instanceof DerivedArtifact && stripOutputPaths()) {<NEW_LINE>builder.add(PathStripper.strip((DerivedArtifact) substitutedArg));<NEW_LINE>} else if (substitutedArg instanceof PathFragment && stripOutputPaths() && PathStripper.isOutputPath((PathFragment) substitutedArg, getOutputRoot())) {<NEW_LINE>builder.add(PathStripper.strip(((PathFragment) substitutedArg)).getPathString());<NEW_LINE>} else {<NEW_LINE>builder.add(CommandLineItem.expandToCommandLine(substitutedArg));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return builder.build();<NEW_LINE>}
int count = arguments.size();
1,830,095
public static void main(String[] args) {<NEW_LINE><MASK><NEW_LINE>TsunamiConfig tsunamiConfig = loadConfig();<NEW_LINE>try (ScanResult scanResult = new ClassGraph().enableAllInfo().blacklistPackages("com.google.tsunami.plugin.testing").scan()) {<NEW_LINE>logger.atInfo().log("Full classpath scan took %s", stopwatch);<NEW_LINE>Injector injector = Guice.createInjector(new TsunamiCliModule(scanResult, args, tsunamiConfig));<NEW_LINE>// Exit with non-zero code if scan failed.<NEW_LINE>if (!injector.getInstance(TsunamiCli.class).run()) {<NEW_LINE>System.exit(1);<NEW_LINE>}<NEW_LINE>logger.atInfo().log("Full Tsunami scan took %s.", stopwatch.stop());<NEW_LINE>} catch (Throwable e) {<NEW_LINE>logger.atSevere().withCause(e).log("Exiting due to workflow execution exceptions.");<NEW_LINE>if (e instanceof InterruptedException) {<NEW_LINE>Thread.currentThread().interrupt();<NEW_LINE>}<NEW_LINE>System.exit(1);<NEW_LINE>}<NEW_LINE>}
Stopwatch stopwatch = Stopwatch.createStarted();
685,058
public static Constructor<?> findConstructorBestMatch(Class<?> clazz, Class<?>... parameterTypes) {<NEW_LINE>String fullConstructorName = clazz.getName() + getParametersString(parameterTypes) + "#bestmatch";<NEW_LINE>if (constructorCache.containsKey(fullConstructorName)) {<NEW_LINE>Constructor<?> constructor = constructorCache.get(fullConstructorName);<NEW_LINE>if (constructor == null)<NEW_LINE>throw new NoSuchMethodError(fullConstructorName);<NEW_LINE>return constructor;<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>Constructor<?> constructor = findConstructorExact(clazz, parameterTypes);<NEW_LINE>constructorCache.put(fullConstructorName, constructor);<NEW_LINE>return constructor;<NEW_LINE>} catch (NoSuchMethodError ignored) {<NEW_LINE>}<NEW_LINE>Constructor<?> bestMatch = null;<NEW_LINE>Constructor<?>[] constructors = clazz.getDeclaredConstructors();<NEW_LINE>for (Constructor<?> constructor : constructors) {<NEW_LINE>// compare name and parameters<NEW_LINE>if (ClassUtils.isAssignable(parameterTypes, constructor.getParameterTypes(), true)) {<NEW_LINE>// get accessible version of method<NEW_LINE>if (bestMatch == null || MemberUtils.compareParameterTypes(constructor.getParameterTypes(), bestMatch.getParameterTypes(), parameterTypes) < 0) {<NEW_LINE>bestMatch = constructor;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (bestMatch != null) {<NEW_LINE>bestMatch.setAccessible(true);<NEW_LINE>constructorCache.put(fullConstructorName, bestMatch);<NEW_LINE>return bestMatch;<NEW_LINE>} else {<NEW_LINE><MASK><NEW_LINE>constructorCache.put(fullConstructorName, null);<NEW_LINE>throw e;<NEW_LINE>}<NEW_LINE>}
NoSuchMethodError e = new NoSuchMethodError(fullConstructorName);
1,470,530
private void headerClicked(TableColumn column, MouseEvent event) {<NEW_LINE>TableViewSelectionModel<ObservableList<SpreadsheetCell>> sm = gridViewSkin.handle.getGridView().getSelectionModel();<NEW_LINE>int lastRow = gridViewSkin.getItemCount() - 1;<NEW_LINE>int indexColumn = column.getTableView().getColumns().indexOf(column);<NEW_LINE>TablePosition focusedPosition = sm.getTableView().getFocusModel().getFocusedCell();<NEW_LINE>if (event.isShortcutDown()) {<NEW_LINE>BitSet tempSet = (BitSet) selectedColumns.clone();<NEW_LINE>sm.selectRange(0, column, lastRow, column);<NEW_LINE>selectedColumns.or(tempSet);<NEW_LINE>selectedColumns.set(indexColumn);<NEW_LINE>} else if (event.isShiftDown() && focusedPosition != null && focusedPosition.getTableColumn() != null) {<NEW_LINE>sm.clearSelection();<NEW_LINE>sm.selectRange(0, column, lastRow, focusedPosition.getTableColumn());<NEW_LINE>sm.getTableView().getFocusModel().focus(0, focusedPosition.getTableColumn());<NEW_LINE>int min = Math.min(indexColumn, focusedPosition.getColumn());<NEW_LINE>int max = Math.max(<MASK><NEW_LINE>selectedColumns.set(min, max + 1);<NEW_LINE>} else {<NEW_LINE>sm.clearSelection();<NEW_LINE>sm.selectRange(0, column, lastRow, column);<NEW_LINE>// And we want to have the focus on the first cell in order to be able to copy/paste between columns.<NEW_LINE>sm.getTableView().getFocusModel().focus(0, column);<NEW_LINE>selectedColumns.set(indexColumn);<NEW_LINE>}<NEW_LINE>}
indexColumn, focusedPosition.getColumn());
1,583,530
private static void appendWithIndent(TreeElement parent, TreeChild child) throws ReadOnlyException {<NEW_LINE>TreeParentNode doc = parent;<NEW_LINE>// will get <filesystem> then TreeDocument then null<NEW_LINE>int depth = -2;<NEW_LINE>while (doc != null) {<NEW_LINE>doc = ((TreeChild) doc).getParentNode();<NEW_LINE>depth++;<NEW_LINE>}<NEW_LINE>TreeChild position = insertBefore(parent, child);<NEW_LINE>try {<NEW_LINE>if (position != null) {<NEW_LINE><MASK><NEW_LINE>// NOI18N<NEW_LINE>parent.insertBefore(new TreeText("\n" + spaces((depth + 1) * INDENT_STEP)), position);<NEW_LINE>} else {<NEW_LINE>if (/*XXX this is clumsy*/<NEW_LINE>parent.hasChildNodes()) {<NEW_LINE>parent.appendChild(new TreeText(spaces(INDENT_STEP)));<NEW_LINE>} else {<NEW_LINE>// NOI18N<NEW_LINE>parent.appendChild(new TreeText("\n" + spaces((depth + 1) * INDENT_STEP)));<NEW_LINE>}<NEW_LINE>parent.appendChild(child);<NEW_LINE>// NOI18N<NEW_LINE>parent.appendChild(new TreeText("\n" + spaces(depth * INDENT_STEP)));<NEW_LINE>}<NEW_LINE>parent.normalize();<NEW_LINE>} catch (InvalidArgumentException e) {<NEW_LINE>assert false : e;<NEW_LINE>}<NEW_LINE>}
parent.insertBefore(child, position);
533,165
private static List<String> separateAdditionsDeletions(String input) {<NEW_LINE>StringBuilder dels = new StringBuilder();<NEW_LINE>StringBuilder adds = new StringBuilder();<NEW_LINE>for (String str : input.split("\n")) {<NEW_LINE>if (str.length() > 0) {<NEW_LINE>if (str.charAt(0) == '-') {<NEW_LINE>dels.append(' ').append(str.substring(1)).append("\n");<NEW_LINE>if (str.contains(SmPLJavaDSL.getDotsStatementElementName() + "();") || methodHeader.test(str.substring(1).strip())) {<NEW_LINE>adds.append("\n");<NEW_LINE>} else {<NEW_LINE>// Add a "deletion anchor" dummy statement which we can use when anchoring addition statements.<NEW_LINE>adds.append(SmPLJavaDSL.getDeletionAnchorName()).append("();\n");<NEW_LINE>}<NEW_LINE>} else if (str.charAt(0) == '+') {<NEW_LINE>dels.append("\n");<NEW_LINE>adds.append(' ').append(str.substring(1)).append("\n");<NEW_LINE>} else {<NEW_LINE>dels.append(str).append("\n");<NEW_LINE>adds.append<MASK><NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>dels.append(str).append("\n");<NEW_LINE>adds.append(str).append("\n");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return Arrays.asList(dels.toString(), adds.toString());<NEW_LINE>}
(str).append("\n");
1,576,528
public <V1, V2, V3, V4, V5> Promise<MultipleResultsN<V1, V2, V3, V4, V5>, OneReject<Throwable>, MasterProgress> when(Callable<V1> callableV1, Callable<V2> callableV2, Callable<V3> callableV3, Callable<V4> callableV4, Callable<V5> callableV5, Callable<?> callable6, Callable<?>... callables) {<NEW_LINE>assertNotNull(callableV1, CALLABLE_V1);<NEW_LINE>assertNotNull(callableV2, CALLABLE_V2);<NEW_LINE>assertNotNull(callableV3, CALLABLE_V3);<NEW_LINE>assertNotNull(callableV4, CALLABLE_V4);<NEW_LINE>assertNotNull(callableV5, CALLABLE_V5);<NEW_LINE>assertNotNull(callable6, "callable6");<NEW_LINE>Promise<V1, Throwable, ?> promise1 = when(callableV1);<NEW_LINE>Promise<V2, Throwable, ?> promise2 = when(callableV2);<NEW_LINE>Promise<V3, Throwable, ?> promise3 = when(callableV3);<NEW_LINE>Promise<V4, Throwable, ?> promise4 = when(callableV4);<NEW_LINE>Promise<V5, Throwable, ?> promise5 = when(callableV5);<NEW_LINE>Promise[] promiseN <MASK><NEW_LINE>for (int i = 0; i < callables.length; i++) {<NEW_LINE>if (callables[i] instanceof DeferredCallable) {<NEW_LINE>promiseN[i] = when((DeferredCallable) callables[i]);<NEW_LINE>} else {<NEW_LINE>promiseN[i] = when(callables[i]);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return new MasterDeferredObjectN(promise1, promise2, promise3, promise4, promise5, when(callable6), promiseN);<NEW_LINE>}
= new Promise[callables.length];
1,159,829
static String nameDecode(String value) throws BadLdapGrammarException {<NEW_LINE>if (value == null) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>StringBuilder decoded = new StringBuilder(value.length());<NEW_LINE>int i = 0;<NEW_LINE>while (i < value.length()) {<NEW_LINE>char currentChar = value.charAt(i);<NEW_LINE>if (currentChar == '\\') {<NEW_LINE>// Ending with a single backslash is not allowed<NEW_LINE>if (value.length() <= i + 1) {<NEW_LINE>throw new BadLdapGrammarException("Unexpected end of value " + "unterminated '\\'");<NEW_LINE>}<NEW_LINE>char nextChar = value.charAt(i + 1);<NEW_LINE>if (isNormalBackslashEscape(nextChar)) {<NEW_LINE>decoded.append(nextChar);<NEW_LINE>i += 2;<NEW_LINE>} else {<NEW_LINE>if (value.length() <= i + 2) {<NEW_LINE>throw new BadLdapGrammarException("Unexpected end of value " + "expected special or hex, found '" + nextChar + "'");<NEW_LINE>}<NEW_LINE>// This should be a hex value<NEW_LINE>String hexString = "" + nextChar + value.charAt(i + 2);<NEW_LINE>decoded.append((char) Integer<MASK><NEW_LINE>i += 3;<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>// This character wasn't escaped - just append it<NEW_LINE>decoded.append(currentChar);<NEW_LINE>i++;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return decoded.toString();<NEW_LINE>}
.parseInt(hexString, HEX));
585,731
public static PullActionDataResponse unmarshall(PullActionDataResponse pullActionDataResponse, UnmarshallerContext _ctx) {<NEW_LINE>pullActionDataResponse.setRequestId(_ctx.stringValue("PullActionDataResponse.RequestId"));<NEW_LINE>pullActionDataResponse.setErrorCode(_ctx.stringValue("PullActionDataResponse.ErrorCode"));<NEW_LINE>pullActionDataResponse.setErrorMessage(_ctx.stringValue("PullActionDataResponse.ErrorMessage"));<NEW_LINE>pullActionDataResponse.setMessage(_ctx.stringValue("PullActionDataResponse.Message"));<NEW_LINE>pullActionDataResponse.setCode(_ctx.stringValue("PullActionDataResponse.Code"));<NEW_LINE>pullActionDataResponse.setPartitionIndex(_ctx.integerValue("PullActionDataResponse.PartitionIndex"));<NEW_LINE>pullActionDataResponse.setDynamicCode(_ctx.stringValue("PullActionDataResponse.DynamicCode"));<NEW_LINE>pullActionDataResponse.setSuccess(_ctx.booleanValue("PullActionDataResponse.Success"));<NEW_LINE>pullActionDataResponse.setNextMessageId(_ctx.longValue("PullActionDataResponse.NextMessageId"));<NEW_LINE>pullActionDataResponse.setDynamicMessage(_ctx.stringValue("PullActionDataResponse.DynamicMessage"));<NEW_LINE>List<Action> actions = new ArrayList<Action>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("PullActionDataResponse.Actions.Length"); i++) {<NEW_LINE>Action action = new Action();<NEW_LINE>action.setStoreId(_ctx.longValue<MASK><NEW_LINE>action.setGmtCreate(_ctx.longValue("PullActionDataResponse.Actions[" + i + "].GmtCreate"));<NEW_LINE>action.setLeaveTimestamp(_ctx.longValue("PullActionDataResponse.Actions[" + i + "].LeaveTimestamp"));<NEW_LINE>action.setLocationLayerType(_ctx.stringValue("PullActionDataResponse.Actions[" + i + "].LocationLayerType"));<NEW_LINE>action.setStayValid(_ctx.booleanValue("PullActionDataResponse.Actions[" + i + "].StayValid"));<NEW_LINE>action.setGender(_ctx.stringValue("PullActionDataResponse.Actions[" + i + "].Gender"));<NEW_LINE>action.setUkId(_ctx.longValue("PullActionDataResponse.Actions[" + i + "].UkId"));<NEW_LINE>action.setArriveTimestamp(_ctx.longValue("PullActionDataResponse.Actions[" + i + "].ArriveTimestamp"));<NEW_LINE>action.setGmtModified(_ctx.longValue("PullActionDataResponse.Actions[" + i + "].GmtModified"));<NEW_LINE>action.setImageType(_ctx.stringValue("PullActionDataResponse.Actions[" + i + "].ImageType"));<NEW_LINE>action.setInStay(_ctx.longValue("PullActionDataResponse.Actions[" + i + "].InStay"));<NEW_LINE>action.setStatus(_ctx.integerValue("PullActionDataResponse.Actions[" + i + "].Status"));<NEW_LINE>action.setAge(_ctx.integerValue("PullActionDataResponse.Actions[" + i + "].Age"));<NEW_LINE>action.setId(_ctx.longValue("PullActionDataResponse.Actions[" + i + "].Id"));<NEW_LINE>action.setImageUrl(_ctx.stringValue("PullActionDataResponse.Actions[" + i + "].ImageUrl"));<NEW_LINE>action.setLocationId(_ctx.longValue("PullActionDataResponse.Actions[" + i + "].LocationId"));<NEW_LINE>action.setStayPeriod(_ctx.integerValue("PullActionDataResponse.Actions[" + i + "].StayPeriod"));<NEW_LINE>action.setFacePointNumber(_ctx.integerValue("PullActionDataResponse.Actions[" + i + "].FacePointNumber"));<NEW_LINE>action.setScore(_ctx.floatValue("PullActionDataResponse.Actions[" + i + "].Score"));<NEW_LINE>action.setSpecialType(_ctx.stringValue("PullActionDataResponse.Actions[" + i + "].SpecialType"));<NEW_LINE>action.setImageObjectKey(_ctx.stringValue("PullActionDataResponse.Actions[" + i + "].ImageObjectKey"));<NEW_LINE>action.setBodyPointNumber(_ctx.integerValue("PullActionDataResponse.Actions[" + i + "].BodyPointNumber"));<NEW_LINE>ObjectPositionInImage objectPositionInImage = new ObjectPositionInImage();<NEW_LINE>objectPositionInImage.setBottom(_ctx.floatValue("PullActionDataResponse.Actions[" + i + "].ObjectPositionInImage.Bottom"));<NEW_LINE>objectPositionInImage.setLeft(_ctx.floatValue("PullActionDataResponse.Actions[" + i + "].ObjectPositionInImage.Left"));<NEW_LINE>objectPositionInImage.setTop(_ctx.floatValue("PullActionDataResponse.Actions[" + i + "].ObjectPositionInImage.Top"));<NEW_LINE>objectPositionInImage.setRight(_ctx.floatValue("PullActionDataResponse.Actions[" + i + "].ObjectPositionInImage.Right"));<NEW_LINE>action.setObjectPositionInImage(objectPositionInImage);<NEW_LINE>PointInMap pointInMap = new PointInMap();<NEW_LINE>pointInMap.setX(_ctx.floatValue("PullActionDataResponse.Actions[" + i + "].PointInMap.X"));<NEW_LINE>pointInMap.setY(_ctx.floatValue("PullActionDataResponse.Actions[" + i + "].PointInMap.Y"));<NEW_LINE>action.setPointInMap(pointInMap);<NEW_LINE>actions.add(action);<NEW_LINE>}<NEW_LINE>pullActionDataResponse.setActions(actions);<NEW_LINE>return pullActionDataResponse;<NEW_LINE>}
("PullActionDataResponse.Actions[" + i + "].StoreId"));
1,160,082
private void initialize(Snapshot snapshot) {<NEW_LINE>// TODO: if some property cannot be loaded for current snapshot version, FAIL initializing the snapshot!<NEW_LINE>Storage storage = snapshot.getStorage();<NEW_LINE>String version = getProperty(storage, SNAPSHOT_VERSION);<NEW_LINE>chartCache = Integer.parseInt(getProperty(storage, PROP_CHART_CACHE));<NEW_LINE>uptime = Long.parseLong(getProperty(storage, PROP_UPTIME));<NEW_LINE>prevUpTime = Long.parseLong(getProperty(storage, PROP_PREV_UPTIME));<NEW_LINE>takeHeapDumpSupported = false;<NEW_LINE>cpuMonitoringSupported = Boolean.parseBoolean(getProperty(storage, PROP_CPU_MONITORING_SUPPORTED));<NEW_LINE>gcMonitoringSupported = Boolean.parseBoolean(getProperty(storage, PROP_GC_MONITORING_SUPPORTED));<NEW_LINE>memoryMonitoringSupported = Boolean.parseBoolean(getProperty(storage, PROP_MEMORY_MONITORING_SUPPORTED));<NEW_LINE>classMonitoringSupported = Boolean.parseBoolean(getProperty(storage, PROP_CLASS_MONITORING_SUPPORTED));<NEW_LINE>threadsMonitoringSupported = Boolean.parseBoolean(getProperty(storage, PROP_THREADS_MONITORING_SUPPORTED));<NEW_LINE>processorsCount = Integer.parseInt(getProperty(storage, PROP_NUMBER_OF_PROCESSORS));<NEW_LINE>processCpuTime = Long.parseLong(getProperty(storage, PROP_PROCESS_CPU_TIME));<NEW_LINE>processGcTime = Long.parseLong(getProperty(storage, PROP_PROCESS_GC_TIME));<NEW_LINE>prevProcessCpuTime = Long.parseLong(getProperty(storage, PROP_PREV_PROCESS_CPU_TIME));<NEW_LINE>prevProcessGcTime = Long.parseLong(getProperty(storage, PROP_PREV_PROCESS_GC_TIME));<NEW_LINE>heapCapacity = Long.parseLong(getProperty(storage, PROP_HEAP_CAPACITY));<NEW_LINE>heapUsed = Long.parseLong(getProperty(storage, PROP_HEAP_USED));<NEW_LINE>maxHeap = Long.parseLong(getProperty(storage, PROP_MAX_HEAP));<NEW_LINE>permgenCapacity = Long.parseLong(getProperty(storage, PROP_PERMGEN_CAPACITY));<NEW_LINE>permgenUsed = Long.parseLong(getProperty(storage, PROP_PERMGEN_USED));<NEW_LINE>permgenMax = Long.parseLong(getProperty(storage, PROP_PERMGEN_MAX));<NEW_LINE>sharedUnloaded = Long.parseLong<MASK><NEW_LINE>totalUnloaded = Long.parseLong(getProperty(storage, PROP_TOTAL_UNLOADED));<NEW_LINE>sharedLoaded = Long.parseLong(getProperty(storage, PROP_SHARED_LOADED));<NEW_LINE>totalLoaded = Long.parseLong(getProperty(storage, PROP_TOTAL_LOADED));<NEW_LINE>totalThreads = Long.parseLong(getProperty(storage, PROP_TOTAL_THREADS));<NEW_LINE>daemonThreads = Long.parseLong(getProperty(storage, PROP_DAEMON_THREADS));<NEW_LINE>peakThreads = Long.parseLong(getProperty(storage, PROP_PEAK_THREADS));<NEW_LINE>startedThreads = Long.parseLong(getProperty(storage, PROP_STARTED_THREADS));<NEW_LINE>if (version.compareTo("1.1") >= 0) {<NEW_LINE>// NOI18N<NEW_LINE>heapName = getProperty(storage, PROP_HEAP_NAME);<NEW_LINE>permgenName = getProperty(storage, PROP_PERMGEN_NAME);<NEW_LINE>} else {<NEW_LINE>// NOI18N<NEW_LINE>heapName = NbBundle.getMessage(ApplicationMonitorModel.class, "LBL_Heap");<NEW_LINE>// NOI18N<NEW_LINE>permgenName = NbBundle.getMessage(ApplicationMonitorModel.class, "LBL_PermGen");<NEW_LINE>}<NEW_LINE>}
(getProperty(storage, PROP_SHARED_UNLOADED));
960,986
private void invokePeriodicOperations(long currentWorldTime) {<NEW_LINE>List<EntityRef> operationsToInvoke = new LinkedList<>();<NEW_LINE>Iterator<Long> scheduledOperationsIterator = periodicOperationsSortedByTime.keySet().iterator();<NEW_LINE>long processedTime;<NEW_LINE>while (scheduledOperationsIterator.hasNext()) {<NEW_LINE>processedTime = scheduledOperationsIterator.next();<NEW_LINE>if (processedTime > currentWorldTime) {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>operationsToInvoke.addAll(periodicOperationsSortedByTime.get(processedTime));<NEW_LINE>scheduledOperationsIterator.remove();<NEW_LINE>}<NEW_LINE>operationsToInvoke.stream().filter(EntityRef::exists).forEach(periodicEntity -> {<NEW_LINE>final PeriodicActionComponent periodicActionComponent = periodicEntity.getComponent(PeriodicActionComponent.class);<NEW_LINE>// If there is a PeriodicActionComponent, proceed. Else report an error to the log.<NEW_LINE>if (periodicActionComponent != null) {<NEW_LINE>final Set<String> actionIds = periodicActionComponent.getTriggeredActionsAndReschedule(currentWorldTime);<NEW_LINE>saveOrRemoveComponent(periodicEntity, periodicActionComponent);<NEW_LINE>if (!periodicActionComponent.isEmpty()) {<NEW_LINE>periodicOperationsSortedByTime.put(periodicActionComponent.getLowestWakeUp(), periodicEntity);<NEW_LINE>}<NEW_LINE>for (String actionId : actionIds) {<NEW_LINE>periodicEntity.send(new PeriodicActionTriggeredEvent(actionId));<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>logger.<MASK><NEW_LINE>}<NEW_LINE>});<NEW_LINE>}
error("ERROR: This entity is missing a DelayedActionComponent: {}. " + "So skipping delayed actions for this entity", periodicEntity);
391,553
// Flood fill to count the number of components in an image<NEW_LINE>private int floodFill(int[][] image) {<NEW_LINE>Graph graph = new Graph(image.length * image[0].length);<NEW_LINE>int[] neighborRows = { -1, 1, 0, 0 };<NEW_LINE>int[] neighborColumns = { 0, 0, -1, 1 };<NEW_LINE>for (int row = 0; row < image.length; row++) {<NEW_LINE>for (int column = 0; column < image[0].length; column++) {<NEW_LINE>for (int i = 0; i < 4; i++) {<NEW_LINE>int neighborRow = row + neighborRows[i];<NEW_LINE>int neighborColumn = column + neighborColumns[i];<NEW_LINE>if (isValidCell(image, neighborRow, neighborColumn)) {<NEW_LINE>if (image[row][column] == image[neighborRow][neighborColumn]) {<NEW_LINE>int vertexId1 = getCellIndex(row, column, image[0].length);<NEW_LINE>int vertexId2 = getCellIndex(neighborRow, neighborColumn, image[0].length);<NEW_LINE>// Used to avoid connecting vertices more than once<NEW_LINE>if (vertexId1 < vertexId2) {<NEW_LINE>graph.addEdge(vertexId1, vertexId2);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>int components = 0;<NEW_LINE>boolean[] visited = new boolean[graph.vertices()];<NEW_LINE>for (int vertex = 0; vertex < graph.vertices(); vertex++) {<NEW_LINE>if (!visited[vertex]) {<NEW_LINE>components++;<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>return components;<NEW_LINE>}
depthFirstSearch(graph, vertex, visited);