idx
int32
46
1.86M
input
stringlengths
321
6.6k
target
stringlengths
9
1.24k
639,719
private void insideForEach(Env env) throws IOException {<NEW_LINE>int offset = env.getOffset();<NEW_LINE>TreePath path = env.getPath();<NEW_LINE>EnhancedForLoopTree efl = (EnhancedForLoopTree) path.getLeaf();<NEW_LINE>SourcePositions sourcePositions = env.getSourcePositions();<NEW_LINE><MASK><NEW_LINE>if (sourcePositions.getStartPosition(root, efl.getExpression()) >= offset) {<NEW_LINE>TokenSequence<JavaTokenId> last = findLastNonWhitespaceToken(env, (int) sourcePositions.getEndPosition(root, efl.getVariable()), offset);<NEW_LINE>if (last != null && last.token().id() == JavaTokenId.COLON) {<NEW_LINE>env.insideForEachExpression();<NEW_LINE>addKeyword(env, NEW_KEYWORD, SPACE, false);<NEW_LINE>localResult(env);<NEW_LINE>}<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>TokenSequence<JavaTokenId> last = findLastNonWhitespaceToken(env, (int) sourcePositions.getEndPosition(root, efl.getExpression()), offset);<NEW_LINE>if (last != null && last.token().id() == JavaTokenId.RPAREN) {<NEW_LINE>addKeywordsForStatement(env);<NEW_LINE>} else {<NEW_LINE>env.insideForEachExpression();<NEW_LINE>addKeyword(env, NEW_KEYWORD, SPACE, false);<NEW_LINE>}<NEW_LINE>localResult(env);<NEW_LINE>}
CompilationUnitTree root = env.getRoot();
1,343,714
private void showHideDimming(boolean show) {<NEW_LINE>Activity activity = mActivity.get();<NEW_LINE>if (activity == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// Disable dimming on certain circumstances<NEW_LINE>if (show && mDimColorResId == R.color.dimming && (isPlaying() || isSigning() || mGeneralData.getScreenDimmingTimeoutMin() == GeneralData.SCREEN_DIMMING_NEVER)) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>View rootView = activity.getWindow().getDecorView().getRootView();<NEW_LINE>View dimContainer = rootView.<MASK><NEW_LINE>if (dimContainer == null) {<NEW_LINE>LayoutInflater layoutInflater = activity.getLayoutInflater();<NEW_LINE>dimContainer = layoutInflater.inflate(R.layout.dim_container, null);<NEW_LINE>if (rootView instanceof ViewGroup) {<NEW_LINE>// Add negative margin to fix un-proper viewport positioning on some devices<NEW_LINE>// NOTE: below code is not working!!!<NEW_LINE>// NOTE: comment out code below if you don't want this<NEW_LINE>// LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(<NEW_LINE>// LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.MATCH_PARENT);<NEW_LINE>// params.setMargins(-200, -200, -200, -200);<NEW_LINE>// ((ViewGroup) rootView).addView(dimContainer, params);<NEW_LINE>((ViewGroup) rootView).addView(dimContainer);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>dimContainer.setBackgroundResource(mDimColorResId);<NEW_LINE>dimContainer.setVisibility(show ? View.VISIBLE : View.GONE);<NEW_LINE>}
findViewById(R.id.dim_container);
1,126,190
/*<NEW_LINE>* Loads the icon for the application, either a user provided one or the default one.<NEW_LINE>*/<NEW_LINE>private boolean prepareApplicationIcon(File outputPngFile, List<File> mipmapDirectories, List<Integer> standardICSizes, List<Integer> foregroundICSizes) {<NEW_LINE>String userSpecifiedIcon = Strings.nullToEmpty(project.getIcon());<NEW_LINE>try {<NEW_LINE>BufferedImage icon;<NEW_LINE>if (!userSpecifiedIcon.isEmpty()) {<NEW_LINE>File iconFile = new File(project.getAssetsDirectory(), userSpecifiedIcon);<NEW_LINE>icon = ImageIO.read(iconFile);<NEW_LINE>if (icon == null) {<NEW_LINE>// This can happen if the iconFile isn't an image file.<NEW_LINE>// For example, icon is null if the file is a .wav file.<NEW_LINE>// TODO(lizlooney) - This happens if the user specifies a .ico file. We should<NEW_LINE>// fix that.<NEW_LINE>userErrors.print(String.format(ICON_ERROR, userSpecifiedIcon));<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>// Load the default image.<NEW_LINE>icon = ImageIO.read(Compiler.class.getResource(DEFAULT_ICON));<NEW_LINE>}<NEW_LINE>BufferedImage roundIcon = produceRoundIcon(icon);<NEW_LINE>BufferedImage roundRectIcon = produceRoundedCornerIcon(icon);<NEW_LINE>BufferedImage foregroundIcon = produceForegroundImageIcon(icon);<NEW_LINE>// For each mipmap directory, create all types of ic_launcher photos with respective mipmap sizes<NEW_LINE>for (int i = 0; i < mipmapDirectories.size(); i++) {<NEW_LINE>File mipmapDirectory = mipmapDirectories.get(i);<NEW_LINE>Integer standardSize = standardICSizes.get(i);<NEW_LINE>Integer foregroundSize = foregroundICSizes.get(i);<NEW_LINE>BufferedImage round = resizeImage(roundIcon, standardSize, standardSize);<NEW_LINE>BufferedImage roundRect = resizeImage(roundRectIcon, standardSize, standardSize);<NEW_LINE>BufferedImage foreground = resizeImage(foregroundIcon, foregroundSize, foregroundSize);<NEW_LINE>File roundIconPng = new File(mipmapDirectory, "ic_launcher_round.png");<NEW_LINE>File roundRectIconPng = new File(mipmapDirectory, "ic_launcher.png");<NEW_LINE>File foregroundPng = new File(mipmapDirectory, "ic_launcher_foreground.png");<NEW_LINE>ImageIO.write(round, "png", roundIconPng);<NEW_LINE>ImageIO.write(roundRect, "png", roundRectIconPng);<NEW_LINE>ImageIO.<MASK><NEW_LINE>}<NEW_LINE>ImageIO.write(icon, "png", outputPngFile);<NEW_LINE>} catch (Exception e) {<NEW_LINE>e.printStackTrace();<NEW_LINE>// If the user specified the icon, this is fatal.<NEW_LINE>if (!userSpecifiedIcon.isEmpty()) {<NEW_LINE>userErrors.print(String.format(ICON_ERROR, userSpecifiedIcon));<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>}
write(foreground, "png", foregroundPng);
649,280
private JToggleButton createPlacesSelectedNodeToggleButton() {<NEW_LINE>final JToggleButton checkBoxOnlySpecificNodes = createToggleButtonWithIconAndLabel("PlaceSelectedNodeOnSlide.icon", "slide.placenode");<NEW_LINE>checkBoxOnlySpecificNodes.setAlignmentX(Component.CENTER_ALIGNMENT);<NEW_LINE>checkBoxOnlySpecificNodes.addActionListener(new ActionListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void actionPerformed(ActionEvent e) {<NEW_LINE>final String centeredNodeId = slide.getPlacedNodeId();<NEW_LINE>final IMapSelection selection = Controller.getCurrentController().getSelection();<NEW_LINE>if (centeredNodeId == null) {<NEW_LINE>final NodeModel selected = selection.getSelected();<NEW_LINE>if (selected != null) {<NEW_LINE>UndoableSlide.of(slide).setPlacedNodeId(selected.getID());<NEW_LINE>setNodePlacementControlsEnabled(<MASK><NEW_LINE>} else {<NEW_LINE>UndoableSlide.of(slide).setPlacedNodeId(null);<NEW_LINE>setNodePlacementControlsEnabled(false, slide.getPlacedNodePosition());<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>UndoableSlide.of(slide).setPlacedNodeId(null);<NEW_LINE>setNodePlacementControlsEnabled(false, slide.getPlacedNodePosition());<NEW_LINE>final MapModel map = Controller.getCurrentController().getMap();<NEW_LINE>final NodeModel node = map.getNodeForID(centeredNodeId);<NEW_LINE>if (node != null)<NEW_LINE>selection.selectAsTheOnlyOneSelected(node);<NEW_LINE>}<NEW_LINE>checkBoxOnlySpecificNodes.setSelected(slide.getPlacedNodeId() != null);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>return checkBoxOnlySpecificNodes;<NEW_LINE>}
true, slide.getPlacedNodePosition());
391,880
final SendUsersMessagesResult executeSendUsersMessages(SendUsersMessagesRequest sendUsersMessagesRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(sendUsersMessagesRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<SendUsersMessagesRequest> request = null;<NEW_LINE>Response<SendUsersMessagesResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new SendUsersMessagesRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(sendUsersMessagesRequest));<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, "Pinpoint");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "SendUsersMessages");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<SendUsersMessagesResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(<MASK><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>}
false), new SendUsersMessagesResultJsonUnmarshaller());
57,166
public void authorizeContainer(String apiKey, String containerName) {<NEW_LINE>_logger.infof("Authorizing %s for %s\n", apiKey, containerName);<NEW_LINE>// add the container if it does not exist; update datelastaccessed if it<NEW_LINE>// does<NEW_LINE>java.sql.Date now = new java.sql.Date(new Date().getTime());<NEW_LINE>String insertContainersString = String.format("REPLACE INTO %s (%s, %s, %s) VALUES (?, ?, ?)", TABLE_CONTAINERS, COLUMN_CONTAINER_NAME, COLUMN_DATE_CREATED, COLUMN_DATE_LAST_ACCESSED);<NEW_LINE>int numInsertRows;<NEW_LINE>try (PreparedStatement insertContainers = _dbConn.prepareStatement(insertContainersString)) {<NEW_LINE>insertContainers.setString(1, containerName);<NEW_LINE>insertContainers.setDate(2, now);<NEW_LINE>insertContainers.setDate(3, now);<NEW_LINE>numInsertRows = executeUpdate(insertContainers);<NEW_LINE>} catch (SQLException e) {<NEW_LINE>throw new BatfishException("Could not update containers table", e);<NEW_LINE>}<NEW_LINE>// MySQL says 2 rows impacted when an old row is updated; otherwise it<NEW_LINE>// says 1<NEW_LINE>if (numInsertRows == 1) {<NEW_LINE>_logger.infof("New container added\n");<NEW_LINE>}<NEW_LINE>// return if already accessible<NEW_LINE>if (isAccessibleNetwork(apiKey, containerName, false)) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>int numRows;<NEW_LINE>String insertPermissionsString = String.format("INSERT INTO %s (%s, %s) VALUES (?, ?)", TABLE_PERMISSIONS, COLUMN_APIKEY, COLUMN_CONTAINER_NAME);<NEW_LINE>try (PreparedStatement insertPermissions = _dbConn.prepareStatement(insertPermissionsString)) {<NEW_LINE>insertPermissions.setString(1, apiKey);<NEW_LINE>insertPermissions.setString(2, containerName);<NEW_LINE>numRows = executeUpdate(insertPermissions);<NEW_LINE>} catch (SQLException e) {<NEW_LINE>throw new BatfishException("Could not update permissions table", e);<NEW_LINE>}<NEW_LINE>if (numRows > 0) {<NEW_LINE>String cacheKey = getPermsCacheKey(apiKey, containerName);<NEW_LINE>_cachePermissions.<MASK><NEW_LINE>_logger.infof("Authorization successful\n");<NEW_LINE>}<NEW_LINE>}
put(cacheKey, Boolean.TRUE);
1,594,156
public ForecastResult unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>ForecastResult forecastResult = new ForecastResult();<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("TimePeriod", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>forecastResult.setTimePeriod(DateIntervalJsonUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("MeanValue", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>forecastResult.setMeanValue(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("PredictionIntervalLowerBound", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>forecastResult.setPredictionIntervalLowerBound(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("PredictionIntervalUpperBound", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>forecastResult.setPredictionIntervalUpperBound(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return forecastResult;<NEW_LINE>}
String currentParentElement = context.getCurrentParentElement();
1,654,210
public long authorizedInstanceRead(long instanceId) throws JobSecurityException, NoSuchJobInstanceException {<NEW_LINE>String submitter = persistenceManagerService.getJobInstanceSubmitter(instanceId);<NEW_LINE>Set<String> listOfGroupsForJobID = null;<NEW_LINE>Set<String> listOfGroupsForSubject = null;<NEW_LINE>boolean checkGroupSecurity = false;<NEW_LINE>if (this.isAdmin(runAsSubject())) {<NEW_LINE>} else if (this.isMonitor(runAsSubject())) {<NEW_LINE>} else if (this.isSubmitter(runAsSubject())) {<NEW_LINE>boolean submitterRole = this.isSubmitter(runAsSubject());<NEW_LINE>boolean isGroupAdmin = this.isGroupAdmin();<NEW_LINE>boolean isGroupMonitor = this.isGroupMonitor();<NEW_LINE>// if you don't also own the job you can't view it<NEW_LINE>if (batchSecurityHelper.getRunAsUser().equals(submitter)) {<NEW_LINE>} else if (this.isGroupAdmin() || this.isGroupMonitor()) {<NEW_LINE>checkGroupSecurity = true;<NEW_LINE>} else {<NEW_LINE>throw new JobSecurityException(getFormattedMessage("USER_UNAUTHORIZED_JOB_INSTANCE", new Object[] { getRunAsUser(), instanceId }, "CWWKY0302W: User {0} is not authorized to perform batch operations associated with job instance {1}."));<NEW_LINE>}<NEW_LINE>} else if (this.isGroupAdmin() || this.isGroupMonitor()) {<NEW_LINE>checkGroupSecurity = true;<NEW_LINE>} else {<NEW_LINE>throw new JobSecurityException(getFormattedMessage("USER_UNAUTHORIZED_NO_BATCH_ROLES", new Object[] { getRunAsUser() }, "CWWKY0303W: User {0} is not authorized to perform any batch operations."));<NEW_LINE>}<NEW_LINE>if (checkGroupSecurity) {<NEW_LINE>listOfGroupsForJobID = persistenceManagerService.getJobInstance(instanceId).getGroupNames();<NEW_LINE><MASK><NEW_LINE>if (subjectInGroups(listOfGroupsForSubject, listOfGroupsForJobID)) {<NEW_LINE>} else {<NEW_LINE>// user not in any groups listed - disallow access<NEW_LINE>// construct message to be displayed<NEW_LINE>String log_jobGroups = constructGroupListForAuthFailString(listOfGroupsForJobID);<NEW_LINE>if (batchGroupSecurityHelper != null) {<NEW_LINE>logger.fine(log_jobGroups);<NEW_LINE>logger.warning(getFormattedMessage("USER_GROUP_UNAUTHORIZED_JOB_INSTANCE", new Object[] { instanceId, getRunAsUser(), constructGroupListForAuthFailString(listOfGroupsForJobID) }, "CWWKY0305W: Access to job instance {0} denied. The job has an operation group name defined and the user {1} has batchGroupMonitor or batchGroupAdmin authority but is not a member of the any appropriate group {2}."));<NEW_LINE>throw new JobSecurityException(getFormattedMessage("USER_UNAUTHORIZED_JOB_INSTANCE", new Object[] { getRunAsUser(), instanceId }, "CWWKY0302W: User {0} is not authorized to perform batch operations associated with job instance {1}."));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return instanceId;<NEW_LINE>}
listOfGroupsForSubject = getSubjectGroups(runAsSubject());
1,365,359
private static void tryAssertion12(RegressionEnvironment env, String stmtText, String outputLimit, AtomicInteger milestone) {<NEW_LINE>sendTimer(env, 0);<NEW_LINE>env.compileDeploy(stmtText).addListener("s0");<NEW_LINE>String[] fields = new String[] { "symbol", "sum(price)" };<NEW_LINE>ResultAssertTestResult expected = new ResultAssertTestResult(CATEGORY, outputLimit, fields);<NEW_LINE>expected.addResultInsert(200, 1, new Object[][] { { "IBM", 25d } });<NEW_LINE>expected.addResultInsert(800, 1, new Object[][] { { "MSFT", 34d } });<NEW_LINE>expected.addResultInsert(1500, 1, new Object[][] { { "IBM", 58d } });<NEW_LINE>expected.addResultInsert(1500, 2, new Object[][] { { "YAH", 59d } });<NEW_LINE>expected.addResultInsert(2100, 1, new Object[][] { { "IBM", 85d } });<NEW_LINE>expected.addResultInsert(3500, 1, new Object[][] { { "YAH", 87d } });<NEW_LINE>expected.addResultInsert(4300, 1, new Object[][] { { "IBM", 109d } });<NEW_LINE>expected.addResultInsert(4900, 1, new Object[][] { { "YAH", 112d } });<NEW_LINE>expected.addResultRemove(5700, 0, new Object[][] { { "IBM", 87d } });<NEW_LINE>expected.addResultInsert(5900, 1, new Object[][] { { "YAH", 88d } });<NEW_LINE>expected.addResultRemove(6300, 0, new Object[][] { { "MSFT", 79d } });<NEW_LINE>expected.addResultRemove(7000, 0, new Object[][] { { "IBM", 54d }<MASK><NEW_LINE>ResultAssertExecution execution = new ResultAssertExecution(stmtText, env, expected);<NEW_LINE>execution.execute(false, milestone);<NEW_LINE>}
, { "YAH", 54d } });
1,668,256
public boolean onActivate(Level level, Player player, Block block, Block target, BlockFace face, double fx, double fy, double fz) {<NEW_LINE>if (player.isAdventure()) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>if (block.getId() == AIR && (target instanceof BlockSolid || target instanceof BlockSolidMeta)) {<NEW_LINE>if (target.getId() == OBSIDIAN) {<NEW_LINE>if (level.createPortal(target)) {<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>BlockFire fire = (BlockFire) Block.get(BlockID.FIRE);<NEW_LINE>fire.x = block.x;<NEW_LINE>fire.y = block.y;<NEW_LINE>fire.z = block.z;<NEW_LINE>fire.level = level;<NEW_LINE>if (fire.isBlockTopFacingSurfaceSolid(fire.down()) || fire.canNeighborBurn()) {<NEW_LINE>BlockIgniteEvent e = new BlockIgniteEvent(block, null, player, BlockIgniteEvent.BlockIgniteCause.FLINT_AND_STEEL);<NEW_LINE>block.getLevel().getServer().getPluginManager().callEvent(e);<NEW_LINE>if (!e.isCancelled()) {<NEW_LINE>level.setBlock(fire, fire, true);<NEW_LINE>level.addLevelSoundEvent(block, LevelSoundEventPacket.SOUND_IGNITE);<NEW_LINE>level.scheduleUpdate(fire, fire.tickRate() + ThreadLocalRandom.current().nextInt(10));<NEW_LINE>if ((player.gamemode & 0x01) == 0 && this.useOn(block)) {<NEW_LINE>if (this.getDamage() >= this.getMaxDurability()) {<NEW_LINE>this.count = 0;<NEW_LINE>}<NEW_LINE>player.<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>}
getInventory().setItemInHand(this);
629,057
public static ListClusterConnectionTypesResponse unmarshall(ListClusterConnectionTypesResponse listClusterConnectionTypesResponse, UnmarshallerContext _ctx) {<NEW_LINE>listClusterConnectionTypesResponse.setRequestId(_ctx.stringValue("ListClusterConnectionTypesResponse.RequestId"));<NEW_LINE>listClusterConnectionTypesResponse.setHttpStatusCode<MASK><NEW_LINE>listClusterConnectionTypesResponse.setSuccess(_ctx.booleanValue("ListClusterConnectionTypesResponse.Success"));<NEW_LINE>listClusterConnectionTypesResponse.setErrorCode(_ctx.stringValue("ListClusterConnectionTypesResponse.ErrorCode"));<NEW_LINE>listClusterConnectionTypesResponse.setCode(_ctx.integerValue("ListClusterConnectionTypesResponse.Code"));<NEW_LINE>listClusterConnectionTypesResponse.setMessage(_ctx.stringValue("ListClusterConnectionTypesResponse.Message"));<NEW_LINE>listClusterConnectionTypesResponse.setDynamicMessage(_ctx.stringValue("ListClusterConnectionTypesResponse.DynamicMessage"));<NEW_LINE>List<DataItem> data = new ArrayList<DataItem>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("ListClusterConnectionTypesResponse.Data.Length"); i++) {<NEW_LINE>DataItem dataItem = new DataItem();<NEW_LINE>dataItem.setCode(_ctx.stringValue("ListClusterConnectionTypesResponse.Data[" + i + "].Code"));<NEW_LINE>dataItem.setShowName(_ctx.stringValue("ListClusterConnectionTypesResponse.Data[" + i + "].ShowName"));<NEW_LINE>data.add(dataItem);<NEW_LINE>}<NEW_LINE>listClusterConnectionTypesResponse.setData(data);<NEW_LINE>return listClusterConnectionTypesResponse;<NEW_LINE>}
(_ctx.integerValue("ListClusterConnectionTypesResponse.HttpStatusCode"));
924,097
public static Element serializeExecutionAction(Document doc, XCScheme.SchemePrePostAction action) {<NEW_LINE>Element <MASK><NEW_LINE>executionAction.setAttribute("ActionType", "Xcode.IDEStandardExecutionActionsCore.ExecutionActionType.ShellScriptAction");<NEW_LINE>Element actionContent = doc.createElement("ActionContent");<NEW_LINE>actionContent.setAttribute("title", "Run Script");<NEW_LINE>actionContent.setAttribute("scriptText", action.getCommand());<NEW_LINE>actionContent.setAttribute("shellToInvoke", "/bin/bash");<NEW_LINE>Optional<XCScheme.BuildableReference> buildableReference = action.getBuildableReference();<NEW_LINE>if (buildableReference.isPresent()) {<NEW_LINE>Element environmentBuildable = doc.createElement("EnvironmentBuildable");<NEW_LINE>environmentBuildable.appendChild(serializeBuildableReference(doc, buildableReference.get()));<NEW_LINE>actionContent.appendChild(environmentBuildable);<NEW_LINE>}<NEW_LINE>executionAction.appendChild(actionContent);<NEW_LINE>return executionAction;<NEW_LINE>}
executionAction = doc.createElement("ExecutionAction");
178,131
public boolean apply(Game game, Ability source) {<NEW_LINE>Player controller = game.getPlayer(source.getControllerId());<NEW_LINE>Spell spell = game.getStack().getSpell(this.getTargetPointer().getFirst(game, source));<NEW_LINE>if (controller != null && spell != null) {<NEW_LINE>MageObject mageObject = game.getObject(source);<NEW_LINE>if (mageObject instanceof Permanent) {<NEW_LINE>Permanent permanent = game.<MASK><NEW_LINE>if (permanent != null && game.getState().getValue(mageObject.getId() + "_letter") != null) {<NEW_LINE>int lifegainValue = 0;<NEW_LINE>String spellName = spell.getName();<NEW_LINE>for (int i = 0; i < spellName.length(); i++) {<NEW_LINE>char letter = spellName.charAt(i);<NEW_LINE>String chosenLetter = (String) game.getState().getValue(mageObject.getId() + "_letter");<NEW_LINE>if (chosenLetter != null && Character.isLetter(letter) && Character.toUpperCase(letter) == chosenLetter.charAt(0)) {<NEW_LINE>lifegainValue++;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>controller.gainLife(lifegainValue, game, source);<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>}
getPermanentOrLKIBattlefield(source.getSourceId());
773,557
// not used<NEW_LINE>@Deprecated<NEW_LINE>public void trimStackTrace(Member target) {<NEW_LINE>Throwable t = new Throwable();<NEW_LINE>StackTraceElement[] origStackTrace = cause.getStackTrace();<NEW_LINE>StackTraceElement[<MASK><NEW_LINE>int skip = 0;<NEW_LINE>for (int i = 1; i <= origStackTrace.length && i <= currentStackTrace.length; ++i) {<NEW_LINE>StackTraceElement a = origStackTrace[origStackTrace.length - i];<NEW_LINE>StackTraceElement b = currentStackTrace[currentStackTrace.length - i];<NEW_LINE>if (a.equals(b)) {<NEW_LINE>skip += 1;<NEW_LINE>} else {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// If we know what method was being called, strip everything<NEW_LINE>// before the call. This hides the JRuby and reflection internals.<NEW_LINE>if (target != null) {<NEW_LINE>String className = target.getDeclaringClass().getName();<NEW_LINE>String methodName = target.getName();<NEW_LINE>for (int i = origStackTrace.length - skip - 1; i >= 0; --i) {<NEW_LINE>StackTraceElement frame = origStackTrace[i];<NEW_LINE>if (frame.getClassName().equals(className) && frame.getMethodName().equals(methodName)) {<NEW_LINE>skip = origStackTrace.length - i - 1;<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (skip > 0) {<NEW_LINE>final int len = origStackTrace.length - skip;<NEW_LINE>StackTraceElement[] newStackTrace = new StackTraceElement[len];<NEW_LINE>System.arraycopy(origStackTrace, 0, newStackTrace, 0, len);<NEW_LINE>cause.setStackTrace(newStackTrace);<NEW_LINE>}<NEW_LINE>}
] currentStackTrace = t.getStackTrace();
932,194
public TokensBuilder addSequencePair(List<Integer> tokenId1s, List<Integer> tokenMap1, List<Integer> tokenId2s, List<Integer> tokenMap2) {<NEW_LINE>if (withSpecialTokens) {<NEW_LINE>tokenIds.add(IntStream.of(clsTokenId));<NEW_LINE>tokenMap.add(IntStream.of(SPECIAL_TOKEN_POSITION));<NEW_LINE>}<NEW_LINE>tokenIds.add(tokenId1s.stream().mapToInt(Integer::valueOf));<NEW_LINE>tokenMap.add(tokenMap1.stream().mapToInt(Integer::valueOf));<NEW_LINE>int previouslyFinalMap = tokenMap1.get(<MASK><NEW_LINE>if (withSpecialTokens) {<NEW_LINE>tokenIds.add(IntStream.of(sepTokenId));<NEW_LINE>tokenMap.add(IntStream.of(SPECIAL_TOKEN_POSITION));<NEW_LINE>}<NEW_LINE>tokenIds.add(tokenId2s.stream().mapToInt(Integer::valueOf));<NEW_LINE>tokenMap.add(tokenMap2.stream().mapToInt(i -> i + previouslyFinalMap));<NEW_LINE>if (withSpecialTokens) {<NEW_LINE>tokenIds.add(IntStream.of(sepTokenId));<NEW_LINE>tokenMap.add(IntStream.of(SPECIAL_TOKEN_POSITION));<NEW_LINE>}<NEW_LINE>return this;<NEW_LINE>}
tokenMap1.size() - 1);
676,991
private void processProjected(List<SchemaPath> columns) {<NEW_LINE>projectedColumns = new ArrayList<ColumnDefn>();<NEW_LINE>if (isSkipQuery()) {<NEW_LINE>projectedColumns.add(new ColumnDefn(PcapColumn.DUMMY_NAME, new PcapColumn.PcapDummy()));<NEW_LINE>} else if (isStarQuery()) {<NEW_LINE>Set<Map.Entry<String, PcapColumn>> pcapColumns;<NEW_LINE>if (config.getStat()) {<NEW_LINE>pcapColumns = PcapColumn.getSummaryColumns().entrySet();<NEW_LINE>} else {<NEW_LINE>pcapColumns = PcapColumn.getColumns().entrySet();<NEW_LINE>}<NEW_LINE>for (Map.Entry<String, PcapColumn> pcapColumn : pcapColumns) {<NEW_LINE>makePcapColumns(projectedColumns, pcapColumn.getKey(), pcapColumn.getValue());<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>for (SchemaPath schemaPath : columns) {<NEW_LINE>// Support Case-Insensitive<NEW_LINE>String projectedName = schemaPath.rootName().toLowerCase();<NEW_LINE>PcapColumn pcapColumn;<NEW_LINE>if (config.getStat()) {<NEW_LINE>pcapColumn = PcapColumn.getSummaryColumns().get(projectedName);<NEW_LINE>} else {<NEW_LINE>pcapColumn = PcapColumn.<MASK><NEW_LINE>}<NEW_LINE>if (pcapColumn != null) {<NEW_LINE>makePcapColumns(projectedColumns, projectedName, pcapColumn);<NEW_LINE>} else {<NEW_LINE>makePcapColumns(projectedColumns, projectedName, new PcapColumn.PcapDummy());<NEW_LINE>logger.debug("{} missing the PcapColumn implement class.", projectedName);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>Collections.unmodifiableList(projectedColumns);<NEW_LINE>}
getColumns().get(projectedName);
1,051,656
public boolean removeClient(RealmModel realm, String id) {<NEW_LINE>ClientModel client = getClientById(realm, id);<NEW_LINE>if (client == null)<NEW_LINE>return false;<NEW_LINE>invalidateClient(client.getId());<NEW_LINE>// this is needed so that a client that hasn't been committed isn't cached in a query<NEW_LINE>listInvalidations.add(realm.getId());<NEW_LINE>invalidationEvents.add(ClientRemovedEvent.create(client));<NEW_LINE>cache.clientRemoval(realm.getId(), id, <MASK><NEW_LINE>client.getRolesStream().forEach(role -> {<NEW_LINE>roleRemovalInvalidations(role.getId(), role.getName(), client.getId());<NEW_LINE>});<NEW_LINE>if (client.isServiceAccountsEnabled()) {<NEW_LINE>UserModel serviceAccount = session.users().getServiceAccount(client);<NEW_LINE>if (serviceAccount != null) {<NEW_LINE>session.users().removeUser(realm, serviceAccount);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return getClientDelegate().removeClient(realm, id);<NEW_LINE>}
client.getClientId(), invalidations);
1,002,369
public void createPrintJobs(@NonNull final IPrintingQueueSource source, @NonNull final ContextForAsyncProcessing printJobContext) {<NEW_LINE>final PrintingQueueProcessingInfo printingQueueProcessingInfo = source.getProcessingInfo();<NEW_LINE>int printJobCount = 0;<NEW_LINE>final List<I_C_Print_Job_Instructions> pdfPrintingJobInstructions = new ArrayList<>();<NEW_LINE>try {<NEW_LINE>// important: we shall poll the queue respecting the FIFO order<NEW_LINE>final Iterator<I_C_Printing_Queue<MASK><NEW_LINE>while (it.hasNext()) {<NEW_LINE>final I_C_Printing_Queue item = it.next();<NEW_LINE>try (final MDCCloseable ignored = TableRecordMDC.putTableRecordReference(item)) {<NEW_LINE>pdfPrintingJobInstructions.addAll(createPrintJob(source, printingQueueProcessingInfo, item));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} finally {<NEW_LINE>final PrintingAsyncBatch printingAsyncBatch = PrintingAsyncBatch.builder().name(source.getName()).printJobContext(printJobContext).printJobCount(printJobCount).build();<NEW_LINE>enqueuePrintJobInstructionsForPDFPrintingIfNeeded(pdfPrintingJobInstructions, printingAsyncBatch);<NEW_LINE>}<NEW_LINE>}
> it = source.createItemsIterator();
1,678,017
public void run(RegressionEnvironment env) {<NEW_LINE>RegressionPath path = new RegressionPath();<NEW_LINE>String epl <MASK><NEW_LINE>env.compileDeploy(epl, path);<NEW_LINE>String startTime = "2002-05-30T09:00:00.000";<NEW_LINE>env.advanceTime(DateTime.parseDefaultMSec(startTime));<NEW_LINE>String[] fields = "val0,val1,val2,val3,val4,val5".split(",");<NEW_LINE>epl = "@name('s0') select " + "current_timestamp.withTime(varhour, varmin, varsec, varmsec) as val0," + "utildate.withTime(varhour, varmin, varsec, varmsec) as val1," + "longdate.withTime(varhour, varmin, varsec, varmsec) as val2," + "caldate.withTime(varhour, varmin, varsec, varmsec) as val3," + "localdate.withTime(varhour, varmin, varsec, varmsec) as val4," + "zoneddate.withTime(varhour, varmin, varsec, varmsec) as val5" + " from SupportDateTime";<NEW_LINE>env.compileDeploy(epl, path).addListener("s0");<NEW_LINE>env.assertStmtTypes("s0", fields, new EPTypeClass[] { LONGBOXED.getEPType(), DATE.getEPType(), LONGBOXED.getEPType(), CALENDAR.getEPType(), LOCALDATETIME.getEPType(), ZONEDDATETIME.getEPType() });<NEW_LINE>env.sendEventBean(SupportDateTime.make(null));<NEW_LINE>env.assertPropsNew("s0", fields, new Object[] { SupportDateTime.getValueCoerced(startTime, "long"), null, null, null, null, null });<NEW_LINE>String expectedTime = "2002-05-30T09:00:00.000";<NEW_LINE>// variable is null<NEW_LINE>env.runtimeSetVariable("variables", "varhour", null);<NEW_LINE>env.sendEventBean(SupportDateTime.make(startTime));<NEW_LINE>env.assertPropsNew("s0", fields, SupportDateTime.getArrayCoerced(expectedTime, "long", "util", "long", "cal", "ldt", "zdt"));<NEW_LINE>expectedTime = "2002-05-30T01:02:03.004";<NEW_LINE>env.runtimeSetVariable("variables", "varhour", 1);<NEW_LINE>env.runtimeSetVariable("variables", "varmin", 2);<NEW_LINE>env.runtimeSetVariable("variables", "varsec", 3);<NEW_LINE>env.runtimeSetVariable("variables", "varmsec", 4);<NEW_LINE>env.sendEventBean(SupportDateTime.make(startTime));<NEW_LINE>env.assertPropsNew("s0", fields, SupportDateTime.getArrayCoerced(expectedTime, "long", "util", "long", "cal", "ldt", "zdt"));<NEW_LINE>expectedTime = "2002-05-30T00:00:00.006";<NEW_LINE>env.runtimeSetVariable("variables", "varhour", 0);<NEW_LINE>env.runtimeSetVariable("variables", "varmin", null);<NEW_LINE>env.runtimeSetVariable("variables", "varsec", null);<NEW_LINE>env.runtimeSetVariable("variables", "varmsec", 6);<NEW_LINE>env.sendEventBean(SupportDateTime.make(startTime));<NEW_LINE>env.assertPropsNew("s0", fields, SupportDateTime.getArrayCoerced(expectedTime, "long", "util", "long", "cal", "ldt", "zdt"));<NEW_LINE>env.undeployAll();<NEW_LINE>}
= "@name('variables') @public create variable int varhour;\n" + "@public create variable int varmin;\n" + "@public create variable int varsec;\n" + "@public create variable int varmsec;\n";
500,980
public void handleMessage(Message m) {<NEW_LINE>MainActivity target = mTarget.get();<NEW_LINE>if (target == null)<NEW_LINE>return;<NEW_LINE>if (m.what == CONST.MSG_TYPE.STR_DEBUG.ordinal()) {<NEW_LINE>Log.d(CONST.TAG, (String) m.obj);<NEW_LINE>} else if (m.what == CONST.MSG_TYPE.STR_INFO.ordinal()) {<NEW_LINE>target.updateStatus((String) m.obj);<NEW_LINE>Log.i(CONST.TAG, (String) m.obj);<NEW_LINE>} else if (m.what == CONST.MSG_TYPE.STR_ERROR.ordinal()) {<NEW_LINE>target.updateStatus((String) m.obj);<NEW_LINE>Log.e(CONST.TAG, (String) m.obj);<NEW_LINE>} else if (m.what == CONST.MSG_TYPE.CLI_STOP.ordinal()) {<NEW_LINE>pjsua.pjsuaDestroy();<NEW_LINE><MASK><NEW_LINE>} else if (m.what == CONST.MSG_TYPE.CLI_RESTART.ordinal()) {<NEW_LINE>int status = pjsua.pjsuaRestart();<NEW_LINE>if (status != 0) {<NEW_LINE>LOG.INFO(this, "Failed restarting telnet");<NEW_LINE>}<NEW_LINE>} else if (m.what == CONST.MSG_TYPE.QUIT.ordinal()) {<NEW_LINE>target.finish();<NEW_LINE>System.gc();<NEW_LINE>android.os.Process.killProcess(android.os.Process.myPid());<NEW_LINE>}<NEW_LINE>}
LOG.INFO(this, "Telnet Unavailable");
1,718,079
public ECPoint twice() {<NEW_LINE>if (this.isInfinity()) {<NEW_LINE>return this;<NEW_LINE>}<NEW_LINE>ECCurve curve = this.getCurve();<NEW_LINE>ECFieldElement X1 = this.x;<NEW_LINE>if (X1.isZero()) {<NEW_LINE>// A point with X == 0 is its own additive inverse<NEW_LINE>return curve.getInfinity();<NEW_LINE>}<NEW_LINE>ECFieldElement L1 = this.y, Z1 = this.zs[0];<NEW_LINE><MASK><NEW_LINE>ECFieldElement L1Z1 = Z1IsOne ? L1 : L1.multiply(Z1);<NEW_LINE>ECFieldElement Z1Sq = Z1IsOne ? Z1 : Z1.square();<NEW_LINE>ECFieldElement a = curve.getA();<NEW_LINE>ECFieldElement aZ1Sq = Z1IsOne ? a : a.multiply(Z1Sq);<NEW_LINE>ECFieldElement T = L1.square().add(L1Z1).add(aZ1Sq);<NEW_LINE>if (T.isZero()) {<NEW_LINE>return new SecT193R2Point(curve, T, curve.getB().sqrt());<NEW_LINE>}<NEW_LINE>ECFieldElement X3 = T.square();<NEW_LINE>ECFieldElement Z3 = Z1IsOne ? T : T.multiply(Z1Sq);<NEW_LINE>ECFieldElement X1Z1 = Z1IsOne ? X1 : X1.multiply(Z1);<NEW_LINE>ECFieldElement L3 = X1Z1.squarePlusProduct(T, L1Z1).add(X3).add(Z3);<NEW_LINE>return new SecT193R2Point(curve, X3, L3, new ECFieldElement[] { Z3 });<NEW_LINE>}
boolean Z1IsOne = Z1.isOne();
1,572,850
private boolean usesApiGatewayApiKeys(ServiceShape service, String operationAuth) {<NEW_LINE>// Get the authorizer for this operation if it has no "type" or<NEW_LINE>// "customAuthType" set, as is required for API Gateway's API keys.<NEW_LINE>Optional<AuthorizerDefinition> definitionOptional = service.getTrait(AuthorizersTrait.class).flatMap(authorizers -> authorizers.getAuthorizer(operationAuth).filter(authorizer -> !authorizer.getType().isPresent() && !authorizer.getCustomAuthType<MASK><NEW_LINE>if (!definitionOptional.isPresent()) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>AuthorizerDefinition definition = definitionOptional.get();<NEW_LINE>// We then need to validate that the @httpApiKeyAuth trait has been set<NEW_LINE>// to authenticate the operation, declaring it's a built-in scheme.<NEW_LINE>return definition.getScheme().equals(HttpApiKeyAuthTrait.ID);<NEW_LINE>}
().isPresent()));
642,397
public void validateCustomerVisibleNaming(IntermediateModel trimmedModel) {<NEW_LINE>Metadata metadata = trimmedModel.getMetadata();<NEW_LINE>validateCustomerVisibleName(metadata.getSyncInterface(), "metadata-derived interface name");<NEW_LINE>validateCustomerVisibleName(metadata.getSyncBuilderInterface(), "metadata-derived builder interface name");<NEW_LINE>validateCustomerVisibleName(metadata.getAsyncInterface(), "metadata-derived async interface name");<NEW_LINE>validateCustomerVisibleName(metadata.getAsyncBuilderInterface(), "metadata-derived async builder interface name");<NEW_LINE>validateCustomerVisibleName(metadata.getBaseBuilderInterface(), "metadata-derived builder interface name");<NEW_LINE>validateCustomerVisibleName(metadata.getBaseExceptionName(), "metadata-derived exception name");<NEW_LINE>validateCustomerVisibleName(metadata.getBaseRequestName(), "metadata-derived request name");<NEW_LINE>validateCustomerVisibleName(metadata.getBaseResponseName(), "metadata-derived response name");<NEW_LINE>trimmedModel.getOperations().values().forEach(operation -> {<NEW_LINE>validateCustomerVisibleName(<MASK><NEW_LINE>});<NEW_LINE>trimmedModel.getWaiters().forEach((name, waiter) -> {<NEW_LINE>validateCustomerVisibleName(name, "waiters");<NEW_LINE>});<NEW_LINE>trimmedModel.getShapes().values().forEach(shape -> {<NEW_LINE>String shapeName = shape.getShapeName();<NEW_LINE>validateCustomerVisibleName(shapeName, "shapes");<NEW_LINE>shape.getMembers().forEach(member -> {<NEW_LINE>validateCustomerVisibleName(member.getFluentGetterMethodName(), shapeName + " shape");<NEW_LINE>validateCustomerVisibleName(member.getFluentSetterMethodName(), shapeName + " shape");<NEW_LINE>validateCustomerVisibleName(member.getFluentEnumGetterMethodName(), shapeName + " shape");<NEW_LINE>validateCustomerVisibleName(member.getFluentEnumSetterMethodName(), shapeName + " shape");<NEW_LINE>validateCustomerVisibleName(member.getExistenceCheckMethodName(), shapeName + " shape");<NEW_LINE>validateCustomerVisibleName(member.getBeanStyleGetterMethodName(), shapeName + " shape");<NEW_LINE>validateCustomerVisibleName(member.getBeanStyleSetterMethodName(), shapeName + " shape");<NEW_LINE>validateCustomerVisibleName(member.getEnumType(), shapeName + " shape");<NEW_LINE>});<NEW_LINE>});<NEW_LINE>}
operation.getOperationName(), "operations");
341,438
public Single<AuthenticationResponse> map(ProviderRequest authenticatedRequest, AuthenticationResponse previousResponse) {<NEW_LINE>Optional<Subject> maybeUser = previousResponse.user();<NEW_LINE>Optional<Subject> maybeService = previousResponse.service();<NEW_LINE>if (maybeService.isEmpty() && maybeUser.isEmpty()) {<NEW_LINE>return Single.just(previousResponse);<NEW_LINE>}<NEW_LINE>// create a new response<NEW_LINE>AuthenticationResponse.Builder builder = AuthenticationResponse.builder().<MASK><NEW_LINE>previousResponse.description().ifPresent(builder::description);<NEW_LINE>Single<AuthenticationResponse.Builder> result = Single.just(builder);<NEW_LINE>if (maybeUser.isPresent()) {<NEW_LINE>if (supportedTypes.contains(SubjectType.USER)) {<NEW_LINE>// service will be done after use<NEW_LINE>result = result.flatMapSingle(it -> enhance(authenticatedRequest, previousResponse, maybeUser.get()).peek(it::user).map(ignored -> it));<NEW_LINE>} else {<NEW_LINE>result = result.peek(it -> it.service(maybeUser.get()));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (maybeService.isPresent()) {<NEW_LINE>if (supportedTypes.contains(SubjectType.SERVICE)) {<NEW_LINE>result = result.flatMapSingle(it -> enhance(authenticatedRequest, previousResponse, maybeService.get()).peek(it::user).map(ignored -> it));<NEW_LINE>} else {<NEW_LINE>result = result.peek(it -> it.service(maybeService.get()));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return result.map(AuthenticationResponse.Builder::build);<NEW_LINE>}
requestHeaders(previousResponse.requestHeaders());
1,299,474
public void write(BackendAIOConnection c) {<NEW_LINE>ByteBuffer buffer = c.allocate();<NEW_LINE>BufferUtil.writeUB3(buffer, calcPacketSize());<NEW_LINE>buffer.put(packetId);<NEW_LINE>BufferUtil.writeUB4(buffer, clientFlags);<NEW_LINE>BufferUtil.writeUB4(buffer, maxPacketSize);<NEW_LINE>buffer.put((byte) charsetIndex);<NEW_LINE>buffer = c.writeToBuffer(FILLER, buffer);<NEW_LINE>if (user == null) {<NEW_LINE>buffer = c.checkWriteBuffer(buffer, 1, true);<NEW_LINE>buffer.put((byte) 0);<NEW_LINE>} else {<NEW_LINE>byte[] userData = user.getBytes();<NEW_LINE>buffer = c.checkWriteBuffer(buffer, userData.length + 1, true);<NEW_LINE>BufferUtil.writeWithNull(buffer, userData);<NEW_LINE>}<NEW_LINE>if (password == null) {<NEW_LINE>buffer = c.checkWriteBuffer(buffer, 1, true);<NEW_LINE>buffer.put((byte) 0);<NEW_LINE>} else {<NEW_LINE>buffer = c.checkWriteBuffer(buffer, BufferUtil<MASK><NEW_LINE>BufferUtil.writeWithLength(buffer, password);<NEW_LINE>}<NEW_LINE>if (database == null) {<NEW_LINE>buffer = c.checkWriteBuffer(buffer, 1, true);<NEW_LINE>buffer.put((byte) 0);<NEW_LINE>} else {<NEW_LINE>byte[] databaseData = database.getBytes();<NEW_LINE>buffer = c.checkWriteBuffer(buffer, databaseData.length + 1, true);<NEW_LINE>BufferUtil.writeWithNull(buffer, databaseData);<NEW_LINE>}<NEW_LINE>c.write(buffer);<NEW_LINE>}
.getLength(password), true);
1,655,098
public void executeQueryPhase(ShardSearchRequest request, boolean keepStatesInContext, SearchShardTask task, ActionListener<SearchPhaseResult> listener) {<NEW_LINE>assert request.canReturnNullResponseIfMatchNoDocs() == false || request.numberOfShards() > 1 : "empty responses require more than one shard";<NEW_LINE>final IndexShard shard = getShard(request);<NEW_LINE>rewriteAndFetchShardRequest(shard, request, new ActionListener<ShardSearchRequest>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onResponse(ShardSearchRequest orig) {<NEW_LINE>// check if we can shortcut the query phase entirely.<NEW_LINE>if (orig.canReturnNullResponseIfMatchNoDocs()) {<NEW_LINE>assert orig.scroll() == null;<NEW_LINE>final CanMatchResponse canMatchResp;<NEW_LINE>try {<NEW_LINE>ShardSearchRequest clone = new ShardSearchRequest(orig);<NEW_LINE>canMatchResp = canMatch(clone, false);<NEW_LINE>} catch (Exception exc) {<NEW_LINE>listener.onFailure(exc);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (canMatchResp.canMatch == false) {<NEW_LINE>listener.onResponse(QuerySearchResult.nullInstance());<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// fork the execution in the search thread pool<NEW_LINE>runAsync(getExecutor(shard), () -> executeQueryPhase(orig<MASK><NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onFailure(Exception exc) {<NEW_LINE>listener.onFailure(exc);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}
, task, keepStatesInContext), listener);
194,545
final AdminRespondToAuthChallengeResult executeAdminRespondToAuthChallenge(AdminRespondToAuthChallengeRequest adminRespondToAuthChallengeRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(adminRespondToAuthChallengeRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<AdminRespondToAuthChallengeRequest> request = null;<NEW_LINE>Response<AdminRespondToAuthChallengeResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new AdminRespondToAuthChallengeRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(adminRespondToAuthChallengeRequest));<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, "Cognito Identity Provider");<NEW_LINE>request.<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<AdminRespondToAuthChallengeResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new AdminRespondToAuthChallengeResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
addHandlerContext(HandlerContextKey.OPERATION_NAME, "AdminRespondToAuthChallenge");
773,787
default <R1, R2, R3, R4> Reader<T, R4> forEach4(Function<? super R, Function<? super T, ? extends R1>> value2, BiFunction<? super R, ? super R1, Function<? super T, ? extends R2>> value3, Function3<? super R, ? super R1, ? super R2, Function<? super T, ? extends R3>> value4, Function4<? super R, ? super R1, ? super R2, ? super R3, ? extends R4> yieldingFunction) {<NEW_LINE>Reader<? super T, ? extends R4> res = this.flatMap(in -> {<NEW_LINE>Reader<T, R1> a = functionToReader(value2.apply(in));<NEW_LINE>return a.flatMap(ina -> {<NEW_LINE>Reader<T, R2> b = functionToReader(value3.apply(in, ina));<NEW_LINE>return b.flatMap(inb -> {<NEW_LINE>Reader<T, R3> c = functionToReader(value4.apply<MASK><NEW_LINE>return c.mapFn(in2 -> {<NEW_LINE>return yieldingFunction.apply(in, ina, inb, in2);<NEW_LINE>});<NEW_LINE>});<NEW_LINE>});<NEW_LINE>});<NEW_LINE>return (Reader<T, R4>) res;<NEW_LINE>}
(in, ina, inb));
171,443
protected void realInverse2(double[] a, int offa, boolean scale) {<NEW_LINE>if (n == 1)<NEW_LINE>return;<NEW_LINE>switch(plan) {<NEW_LINE>case SPLIT_RADIX:<NEW_LINE>double xi;<NEW_LINE>if (n > 4) {<NEW_LINE>cftfsub(n, a, <MASK><NEW_LINE>rftbsub(n, a, offa, nc, w, nw);<NEW_LINE>} else if (n == 4) {<NEW_LINE>cftbsub(n, a, offa, ip, nw, w);<NEW_LINE>}<NEW_LINE>xi = a[offa] - a[offa + 1];<NEW_LINE>a[offa] += a[offa + 1];<NEW_LINE>a[offa + 1] = xi;<NEW_LINE>if (scale) {<NEW_LINE>scale(n, a, offa, false);<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>case MIXED_RADIX:<NEW_LINE>rfftf(a, offa);<NEW_LINE>for (int k = n - 1; k >= 2; k--) {<NEW_LINE>int idx = offa + k;<NEW_LINE>double tmp = a[idx];<NEW_LINE>a[idx] = a[idx - 1];<NEW_LINE>a[idx - 1] = tmp;<NEW_LINE>}<NEW_LINE>if (scale) {<NEW_LINE>scale(n, a, offa, false);<NEW_LINE>}<NEW_LINE>int m;<NEW_LINE>if (n % 2 == 0) {<NEW_LINE>m = n / 2;<NEW_LINE>for (int i = 1; i < m; i++) {<NEW_LINE>int idx = offa + 2 * i + 1;<NEW_LINE>a[idx] = -a[idx];<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>m = (n - 1) / 2;<NEW_LINE>for (int i = 0; i < m; i++) {<NEW_LINE>int idx = offa + 2 * i + 1;<NEW_LINE>a[idx] = -a[idx];<NEW_LINE>}<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>case BLUESTEIN:<NEW_LINE>bluestein_real_inverse2(a, offa);<NEW_LINE>if (scale) {<NEW_LINE>scale(n, a, offa, false);<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}
offa, ip, nw, w);
671,859
public static void main(String[] args) {<NEW_LINE>Scanner s = new Scanner(System.in);<NEW_LINE>System.out.println("Of First Matrix");<NEW_LINE>System.out.println(" Enter number of rows ");<NEW_LINE>int rows_first = s.nextInt();<NEW_LINE>System.out.println(" Enter number of columns ");<NEW_LINE>int columns_first = s.nextInt();<NEW_LINE>int[][] matrix1 = new int[rows_first][columns_first];<NEW_LINE>System.out.println("Of Second Matrix");<NEW_LINE>System.out.println(" Enter number of rows ");<NEW_LINE>int rows_second = s.nextInt();<NEW_LINE>System.out.println(" Enter number of columns ");<NEW_LINE>int columns_second = s.nextInt();<NEW_LINE>int[][] matrix2 = new int[rows_second][columns_second];<NEW_LINE>if (columns_first != columns_second || rows_first != rows_second) {<NEW_LINE>System.out.println(" Matrices's order is not identical ");<NEW_LINE>} else {<NEW_LINE>System.out.println(" Enter elements of 1st matrix ");<NEW_LINE>for (int i = 0; i < rows_first; i++) {<NEW_LINE>for (int j = 0; j < columns_first; j++) {<NEW_LINE>matrix1[i][j] = s.nextInt();<NEW_LINE>}<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>for (int i = 0; i < rows_first; i++) {<NEW_LINE>for (int j = 0; j < columns_first; j++) {<NEW_LINE>matrix2[i][j] = s.nextInt();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>boolean b = check_identical(matrix1, matrix2);<NEW_LINE>if (b)<NEW_LINE>System.out.println("Matrices are identical");<NEW_LINE>else<NEW_LINE>System.out.println(" Matrices are not identical");<NEW_LINE>}<NEW_LINE>}
System.out.println(" Enter elements of 2nd matrix ");
318,063
private HdfsBlobStore createBlobstore(URI blobstoreUri, String path, Settings repositorySettings) {<NEW_LINE>Configuration hadoopConfiguration = new Configuration(repositorySettings.getAsBoolean("load_defaults", true));<NEW_LINE>hadoopConfiguration.setClassLoader(HdfsRepository.class.getClassLoader());<NEW_LINE>hadoopConfiguration.reloadConfiguration();<NEW_LINE>final Settings confSettings = repositorySettings.getByPrefix("conf.");<NEW_LINE>for (String key : confSettings.keySet()) {<NEW_LINE>logger.debug("Adding configuration to HDFS Client Configuration : {} = {}", key, confSettings.get(key));<NEW_LINE>hadoopConfiguration.set(key, confSettings.get(key));<NEW_LINE>}<NEW_LINE>// Disable FS cache<NEW_LINE>hadoopConfiguration.setBoolean("fs.hdfs.impl.disable.cache", true);<NEW_LINE>// Create a hadoop user<NEW_LINE>UserGroupInformation ugi = login(hadoopConfiguration, repositorySettings);<NEW_LINE>// Sense if HA is enabled<NEW_LINE>// HA requires elevated permissions during regular usage in the event that a failover operation<NEW_LINE>// occurs and a new connection is required.<NEW_LINE>String host = blobstoreUri.getHost();<NEW_LINE>String configKey = HdfsClientConfigKeys.Failover.PROXY_PROVIDER_KEY_PREFIX + "." + host;<NEW_LINE>Class<?> ret = hadoopConfiguration.getClass(configKey, null, FailoverProxyProvider.class);<NEW_LINE>boolean haEnabled = ret != null;<NEW_LINE>// Create the filecontext with our user information<NEW_LINE>// This will correctly configure the filecontext to have our UGI as its internal user.<NEW_LINE>FileContext fileContext = ugi.doAs((PrivilegedAction<FileContext>) () -> {<NEW_LINE>try {<NEW_LINE>AbstractFileSystem fs = <MASK><NEW_LINE>return FileContext.getFileContext(fs, hadoopConfiguration);<NEW_LINE>} catch (UnsupportedFileSystemException e) {<NEW_LINE>throw new UncheckedIOException(e);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>logger.debug("Using file-system [{}] for URI [{}], path [{}]", fileContext.getDefaultFileSystem(), fileContext.getDefaultFileSystem().getUri(), path);<NEW_LINE>try {<NEW_LINE>return new HdfsBlobStore(fileContext, path, bufferSize, isReadOnly(), haEnabled);<NEW_LINE>} catch (IOException e) {<NEW_LINE>throw new UncheckedIOException(String.format(Locale.ROOT, "Cannot create HDFS repository for uri [%s]", blobstoreUri), e);<NEW_LINE>}<NEW_LINE>}
AbstractFileSystem.get(blobstoreUri, hadoopConfiguration);
381,934
public Deferred<Boolean> flushNotMatched(final TSDB tsdb) {<NEW_LINE>if (!store_failures) {<NEW_LINE>not_matched.clear();<NEW_LINE>return Deferred.fromResult(true);<NEW_LINE>}<NEW_LINE>final byte[] row_key = new byte[TREE_ID_WIDTH + 1];<NEW_LINE>System.arraycopy(idToBytes(tree_id), 0, row_key, 0, TREE_ID_WIDTH);<NEW_LINE>row_key[TREE_ID_WIDTH] = NOT_MATCHED_ROW_SUFFIX;<NEW_LINE>final byte[][] qualifiers = new byte[not_matched.size()][];<NEW_LINE>final byte[][] values = new byte[not_matched.size()][];<NEW_LINE>int index = 0;<NEW_LINE>for (Map.Entry<String, String> entry : not_matched.entrySet()) {<NEW_LINE>qualifiers[index] = new byte[NOT_MATCHED_PREFIX.length + (entry.getKey().length() / 2)];<NEW_LINE>System.arraycopy(NOT_MATCHED_PREFIX, 0, qualifiers[index], 0, NOT_MATCHED_PREFIX.length);<NEW_LINE>final byte[] tsuid = UniqueId.<MASK><NEW_LINE>System.arraycopy(tsuid, 0, qualifiers[index], NOT_MATCHED_PREFIX.length, tsuid.length);<NEW_LINE>values[index] = entry.getValue().getBytes(CHARSET);<NEW_LINE>index++;<NEW_LINE>}<NEW_LINE>final PutRequest put = new PutRequest(tsdb.treeTable(), row_key, TREE_FAMILY, qualifiers, values);<NEW_LINE>not_matched.clear();<NEW_LINE>final class PutCB implements Callback<Deferred<Boolean>, Object> {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public Deferred<Boolean> call(Object result) throws Exception {<NEW_LINE>return Deferred.fromResult(true);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return tsdb.getClient().put(put).addCallbackDeferring(new PutCB());<NEW_LINE>}
stringToUid(entry.getKey());
640,391
protected Map<Object, Object> convertToParameters(Object... iArgs) {<NEW_LINE>final Map<Object, Object> params;<NEW_LINE>if (iArgs.length == 1 && iArgs[0] instanceof Map) {<NEW_LINE>params = (Map<Object<MASK><NEW_LINE>} else {<NEW_LINE>if (iArgs.length == 1 && iArgs[0] != null && iArgs[0].getClass().isArray() && iArgs[0] instanceof Object[])<NEW_LINE>iArgs = (Object[]) iArgs[0];<NEW_LINE>params = new HashMap<Object, Object>(iArgs.length);<NEW_LINE>for (int i = 0; i < iArgs.length; ++i) {<NEW_LINE>Object par = iArgs[i];<NEW_LINE>if (par instanceof OIdentifiable && ((OIdentifiable) par).getIdentity().isValid())<NEW_LINE>// USE THE RID ONLY<NEW_LINE>par = ((OIdentifiable) par).getIdentity();<NEW_LINE>params.put(i, par);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return params;<NEW_LINE>}
, Object>) iArgs[0];
1,498,709
public static DeviceInfo of(DeviceInstanceEntity instance, DeviceProductEntity product) {<NEW_LINE>DeviceInfo deviceInfo = FastBeanCopier.copy(instance, new DeviceInfo());<NEW_LINE>deviceInfo.setMessageProtocol(product.getMessageProtocol());<NEW_LINE>deviceInfo.setTransportProtocol(product.getTransportProtocol());<NEW_LINE>deviceInfo.setDeviceType(product.getDeviceType().getText());<NEW_LINE>deviceInfo.setClassifiedId(product.getClassifiedId());<NEW_LINE>deviceInfo.<MASK><NEW_LINE>deviceInfo.setProjectName(product.getProjectName());<NEW_LINE>deviceInfo.setProductName(product.getName());<NEW_LINE>deviceInfo.setNetworkWay(product.getNetworkWay());<NEW_LINE>if (CollectionUtils.isEmpty(instance.getConfiguration())) {<NEW_LINE>deviceInfo.setConfiguration(product.getConfiguration());<NEW_LINE>}<NEW_LINE>if (StringUtils.isEmpty(instance.getDeriveMetadata())) {<NEW_LINE>deviceInfo.setDeriveMetadata(product.getMetadata());<NEW_LINE>}<NEW_LINE>return deviceInfo;<NEW_LINE>}
setProjectId(product.getProjectId());
1,198,558
private static J2ObjcMappingFileProvider depJ2ObjcMappingFileProvider(RuleContext ruleContext) {<NEW_LINE>NestedSetBuilder<Artifact> depsHeaderMappingsBuilder = NestedSetBuilder.stableOrder();<NEW_LINE>NestedSetBuilder<Artifact> depsClassMappingsBuilder = NestedSetBuilder.stableOrder();<NEW_LINE>NestedSetBuilder<Artifact> depsDependencyMappingsBuilder = NestedSetBuilder.stableOrder();<NEW_LINE>NestedSetBuilder<Artifact> depsArchiveSourceMappingsBuilder = NestedSetBuilder.stableOrder();<NEW_LINE>for (J2ObjcMappingFileProvider mapping : getJ2ObjCMappings(ruleContext)) {<NEW_LINE>depsHeaderMappingsBuilder.addTransitive(mapping.getHeaderMappingFiles());<NEW_LINE>depsClassMappingsBuilder.<MASK><NEW_LINE>depsDependencyMappingsBuilder.addTransitive(mapping.getDependencyMappingFiles());<NEW_LINE>depsArchiveSourceMappingsBuilder.addTransitive(mapping.getArchiveSourceMappingFiles());<NEW_LINE>}<NEW_LINE>return new J2ObjcMappingFileProvider(depsHeaderMappingsBuilder.build(), depsClassMappingsBuilder.build(), depsDependencyMappingsBuilder.build(), depsArchiveSourceMappingsBuilder.build());<NEW_LINE>}
addTransitive(mapping.getClassMappingFiles());
126,936
static void vp8_temporal_filter_apply(FullAccessIntArrPointer frame1, int stride, FullAccessIntArrPointer frame2, int block_size, int strength, int filter_weight, FullAccessIntArrPointer accumulator, FullAccessIntArrPointer count) {<NEW_LINE>int i, j, k;<NEW_LINE>int modifier;<NEW_LINE>int byt = 0;<NEW_LINE>frame2 = frame2.shallowCopy();<NEW_LINE>final int rounding = strength > 0 ? 1 << (strength - 1) : 0;<NEW_LINE>for (i = 0, k = 0; i < block_size; ++i) {<NEW_LINE>for (j = 0; j < block_size; j++, k++) {<NEW_LINE>int <MASK><NEW_LINE>int pixel_value = frame2.getAndInc();<NEW_LINE>modifier = src_byte - pixel_value;<NEW_LINE>modifier *= modifier;<NEW_LINE>modifier *= 3;<NEW_LINE>modifier += rounding;<NEW_LINE>modifier >>= strength;<NEW_LINE>if (modifier > 16)<NEW_LINE>modifier = 16;<NEW_LINE>modifier = 16 - modifier;<NEW_LINE>modifier *= filter_weight;<NEW_LINE>count.setRel(k, (short) (count.getRel(k) + modifier));<NEW_LINE>accumulator.setRel(k, (short) (accumulator.getRel(k) + modifier * pixel_value));<NEW_LINE>byt++;<NEW_LINE>}<NEW_LINE>byt += stride - block_size;<NEW_LINE>}<NEW_LINE>}
src_byte = frame1.getRel(byt);
1,561,056
public static long incTwoBytePrimaryByOffset(long basePrimary, boolean isCompressible, int offset) {<NEW_LINE>// Extract the second byte, minus the minimum byte value,<NEW_LINE>// plus the offset, modulo the number of usable byte values, plus the minimum.<NEW_LINE>// Reserve the PRIMARY_COMPRESSION_LOW_BYTE and high byte if necessary.<NEW_LINE>long primary;<NEW_LINE>if (isCompressible) {<NEW_LINE>offset += ((int) (basePrimary ><MASK><NEW_LINE>primary = ((offset % 251) + 4) << 16;<NEW_LINE>offset /= 251;<NEW_LINE>} else {<NEW_LINE>offset += ((int) (basePrimary >> 16) & 0xff) - 2;<NEW_LINE>primary = ((offset % 254) + 2) << 16;<NEW_LINE>offset /= 254;<NEW_LINE>}<NEW_LINE>// First byte, assume no further overflow.<NEW_LINE>return primary | ((basePrimary & 0xff000000L) + ((long) offset << 24));<NEW_LINE>}
> 16) & 0xff) - 4;
1,425,481
public void startUpdateThread() {<NEW_LINE>ScheduledExecutorService executor = Executors.newSingleThreadScheduledExecutor();<NEW_LINE>Runnable periodicTask = () -> {<NEW_LINE>if (GeyserImpl.getInstance() != null) {<NEW_LINE>// Update player table<NEW_LINE>playerTableModel.getDataVector().removeAllElements();<NEW_LINE>for (GeyserSession player : GeyserImpl.getInstance().getSessionManager().getSessions().values()) {<NEW_LINE>Vector<String> row = new Vector<>();<NEW_LINE>row.add(player.getSocketAddress().getHostName());<NEW_LINE>row.add(player.getPlayerEntity().getUsername());<NEW_LINE>playerTableModel.addRow(row);<NEW_LINE>}<NEW_LINE>playerTableModel.fireTableDataChanged();<NEW_LINE>}<NEW_LINE>// Update ram graph<NEW_LINE>final long freeMemory = Runtime.getRuntime().freeMemory();<NEW_LINE>final long totalMemory = Runtime.getRuntime().totalMemory();<NEW_LINE>final int freePercent = (int) (freeMemory * 100.0 / totalMemory + 0.5);<NEW_LINE>ramValues.add(100 - freePercent);<NEW_LINE>ramGraph.setXLabel(GeyserLocale.getLocaleStringLog("geyser.gui.graph.usage", String.format("%,d", (totalMemory - freeMemory) / MEGABYTE), freePercent));<NEW_LINE>// Trim the list<NEW_LINE><MASK><NEW_LINE>if (k > 10)<NEW_LINE>ramValues.subList(0, k - 10).clear();<NEW_LINE>// Update the graph<NEW_LINE>ramGraph.setValues(ramValues);<NEW_LINE>};<NEW_LINE>// SwingUtilities.invokeLater is called so we don't run into threading issues with the GUI<NEW_LINE>executor.scheduleAtFixedRate(() -> SwingUtilities.invokeLater(periodicTask), 0, 1, TimeUnit.SECONDS);<NEW_LINE>}
int k = ramValues.size();
1,195,455
public void syncAgentInstancesFrom(Agents agentsFromDB) {<NEW_LINE>for (Agent agentFromDB : agentsFromDB) {<NEW_LINE>String uuid = agentFromDB.getUuid();<NEW_LINE>if (uuidToAgentInstanceMap.containsKey(uuid)) {<NEW_LINE>uuidToAgentInstanceMap.get<MASK><NEW_LINE>} else {<NEW_LINE>AgentInstance newAgent = createFromAgent(agentFromDB, new SystemEnvironment(), agentStatusChangeListener);<NEW_LINE>uuidToAgentInstanceMap.put(uuid, newAgent);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>synchronized (uuidToAgentInstanceMap) {<NEW_LINE>List<String> uuids = new ArrayList<>();<NEW_LINE>for (String uuid : uuidToAgentInstanceMap.keySet()) {<NEW_LINE>AgentInstance instance = uuidToAgentInstanceMap.get(uuid);<NEW_LINE>if (!(instance.getStatus() == AgentStatus.Pending)) {<NEW_LINE>if (!agentsFromDB.hasAgent(uuid)) {<NEW_LINE>uuids.add(uuid);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>uuids.forEach(uuidToAgentInstanceMap::remove);<NEW_LINE>}<NEW_LINE>}
(uuid).syncAgentFrom(agentFromDB);
1,693,209
public static ListDevicesResponse unmarshall(ListDevicesResponse listDevicesResponse, UnmarshallerContext _ctx) {<NEW_LINE>listDevicesResponse.setRequestId(_ctx.stringValue("ListDevicesResponse.RequestId"));<NEW_LINE>List<Result> devices = new ArrayList<Result>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("ListDevicesResponse.Devices.Length"); i++) {<NEW_LINE>Result result = new Result();<NEW_LINE>result.setDeviceId(_ctx.stringValue("ListDevicesResponse.Devices[" + i + "].DeviceId"));<NEW_LINE>result.setDeviceType(_ctx.stringValue("ListDevicesResponse.Devices[" + i + "].DeviceType"));<NEW_LINE>result.setUsageType(_ctx.integerValue("ListDevicesResponse.Devices[" + i + "].UsageType"));<NEW_LINE>result.setUsageTypeDesc(_ctx.stringValue("ListDevicesResponse.Devices[" + i + "].UsageTypeDesc"));<NEW_LINE>result.setDeviceModel(_ctx.stringValue("ListDevicesResponse.Devices[" + i + "].DeviceModel"));<NEW_LINE>result.setDeviceModelId(_ctx.longValue("ListDevicesResponse.Devices[" + i + "].DeviceModelId"));<NEW_LINE>result.setDeviceBrand(_ctx.stringValue<MASK><NEW_LINE>result.setUuid(_ctx.stringValue("ListDevicesResponse.Devices[" + i + "].Uuid"));<NEW_LINE>result.setVin(_ctx.stringValue("ListDevicesResponse.Devices[" + i + "].Vin"));<NEW_LINE>result.setSerialNumber(_ctx.stringValue("ListDevicesResponse.Devices[" + i + "].SerialNumber"));<NEW_LINE>result.setMacAddress(_ctx.stringValue("ListDevicesResponse.Devices[" + i + "].MacAddress"));<NEW_LINE>result.setHardwareId(_ctx.stringValue("ListDevicesResponse.Devices[" + i + "].HardwareId"));<NEW_LINE>result.setSoftwareId(_ctx.stringValue("ListDevicesResponse.Devices[" + i + "].SoftwareId"));<NEW_LINE>result.setRegion(_ctx.stringValue("ListDevicesResponse.Devices[" + i + "].Region"));<NEW_LINE>result.setName(_ctx.stringValue("ListDevicesResponse.Devices[" + i + "].Name"));<NEW_LINE>result.setProjectId(_ctx.stringValue("ListDevicesResponse.Devices[" + i + "].ProjectId"));<NEW_LINE>result.setStatus(_ctx.stringValue("ListDevicesResponse.Devices[" + i + "].Status"));<NEW_LINE>devices.add(result);<NEW_LINE>}<NEW_LINE>listDevicesResponse.setDevices(devices);<NEW_LINE>return listDevicesResponse;<NEW_LINE>}
("ListDevicesResponse.Devices[" + i + "].DeviceBrand"));
737,372
public static Order adaptOrder(CoinbaseProOrder order) {<NEW_LINE>OrderType type = "buy".equals(order.getSide()) ? OrderType.BID : OrderType.ASK;<NEW_LINE>CurrencyPair currencyPair = new CurrencyPair(order.getProductId().replace('-', '/'));<NEW_LINE>Order.Builder builder = null;<NEW_LINE>if (order.getType() == null) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>switch(order.getType()) {<NEW_LINE>case "market":<NEW_LINE>builder = new MarketOrder.Builder(type, currencyPair);<NEW_LINE>break;<NEW_LINE>case "limit":<NEW_LINE>if (order.getStop() == null) {<NEW_LINE>builder = new LimitOrder.Builder(type, currencyPair).limitPrice(order.getPrice());<NEW_LINE>} else {<NEW_LINE>builder = new StopOrder.Builder(type, currencyPair).<MASK><NEW_LINE>}<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>if (builder == null) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>builder.orderStatus(adaptOrderStatus(order)).originalAmount(order.getSize()).id(order.getId()).timestamp(parseDate(order.getCreatedAt())).cumulativeAmount(order.getFilledSize()).fee(order.getFillFees());<NEW_LINE>BigDecimal averagePrice;<NEW_LINE>if (order.getFilledSize().signum() != 0 && order.getExecutedvalue().signum() != 0) {<NEW_LINE>averagePrice = order.getExecutedvalue().divide(order.getFilledSize(), MathContext.DECIMAL32);<NEW_LINE>} else {<NEW_LINE>averagePrice = BigDecimal.ZERO;<NEW_LINE>}<NEW_LINE>return builder.averagePrice(averagePrice).build();<NEW_LINE>}
stopPrice(order.getStopPrice());
1,028,833
private void splice(final Ruby runtime, int beg, int len, final RubyArray rplArr, final int rlen) {<NEW_LINE>if (len < 0)<NEW_LINE>throw runtime.newIndexError("negative length (" + len + ")");<NEW_LINE>if (beg < 0 && (beg += realLength) < 0)<NEW_LINE>throw runtime.newIndexError("index " + (beg - realLength) + " out of array");<NEW_LINE>unpack();<NEW_LINE>modify();<NEW_LINE>int valuesLength = values.length - begin;<NEW_LINE>if (beg >= realLength) {<NEW_LINE>len = beg + rlen;<NEW_LINE>if (len >= valuesLength)<NEW_LINE>spliceRealloc(len, valuesLength);<NEW_LINE>try {<NEW_LINE>Helpers.fillNil(values, begin + realLength, begin + beg, runtime);<NEW_LINE>} catch (ArrayIndexOutOfBoundsException e) {<NEW_LINE>throw concurrentModification(runtime, e);<NEW_LINE>}<NEW_LINE>realLength = len;<NEW_LINE>} else {<NEW_LINE>if (beg + len > realLength)<NEW_LINE>len = realLength - beg;<NEW_LINE>int alen = realLength + rlen - len;<NEW_LINE>if (alen >= valuesLength)<NEW_LINE>spliceRealloc(alen, valuesLength);<NEW_LINE>if (len != rlen) {<NEW_LINE>safeArrayCopy(values, begin + (beg + len), values, begin + beg + rlen, realLength - (beg + len));<NEW_LINE>realLength = alen;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (rlen > 0) {<NEW_LINE>rplArr.copyInto(<MASK><NEW_LINE>}<NEW_LINE>}
values, begin + beg, rlen);
527,864
public static QueryRskStatisticResponse unmarshall(QueryRskStatisticResponse queryRskStatisticResponse, UnmarshallerContext _ctx) {<NEW_LINE>queryRskStatisticResponse.setRequestId(_ctx.stringValue("QueryRskStatisticResponse.RequestId"));<NEW_LINE>queryRskStatisticResponse.setCode(_ctx.integerValue("QueryRskStatisticResponse.Code"));<NEW_LINE>queryRskStatisticResponse.setMessage(_ctx.stringValue("QueryRskStatisticResponse.Message"));<NEW_LINE>queryRskStatisticResponse.setTotal(_ctx.integerValue("QueryRskStatisticResponse.Total"));<NEW_LINE>List<DataItem> data = new ArrayList<DataItem>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("QueryRskStatisticResponse.Data.Length"); i++) {<NEW_LINE>DataItem dataItem = new DataItem();<NEW_LINE>dataItem.setType(_ctx.stringValue<MASK><NEW_LINE>dataItem.setOcId(_ctx.stringValue("QueryRskStatisticResponse.Data[" + i + "].OcId"));<NEW_LINE>dataItem.setUpdateDate(_ctx.stringValue("QueryRskStatisticResponse.Data[" + i + "].UpdateDate"));<NEW_LINE>dataItem.setCount(_ctx.longValue("QueryRskStatisticResponse.Data[" + i + "].Count"));<NEW_LINE>dataItem.setCorpName(_ctx.stringValue("QueryRskStatisticResponse.Data[" + i + "].CorpName"));<NEW_LINE>data.add(dataItem);<NEW_LINE>}<NEW_LINE>queryRskStatisticResponse.setData(data);<NEW_LINE>return queryRskStatisticResponse;<NEW_LINE>}
("QueryRskStatisticResponse.Data[" + i + "].Type"));
993,616
private void unRecordEventRegistration(EventRegistration zombiedRegistration) {<NEW_LINE>synchronized (globalEventRegistrations) {<NEW_LINE>boolean found = false;<NEW_LINE>List<EventRegistration> registrationList = globalEventRegistrations.get(zombiedRegistration);<NEW_LINE>if (registrationList != null) {<NEW_LINE>for (int i = 0; i < registrationList.size(); i++) {<NEW_LINE>if (registrationList.get(i) == zombiedRegistration) {<NEW_LINE>found = true;<NEW_LINE>registrationList.remove(i);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (registrationList.isEmpty()) {<NEW_LINE>globalEventRegistrations.remove(zombiedRegistration);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>hardAssert(found || !zombiedRegistration.isUserInitiated());<NEW_LINE>// If the registration was recorded twice, we need to remove its second<NEW_LINE>// record.<NEW_LINE>if (!zombiedRegistration.getQuerySpec().isDefault()) {<NEW_LINE>EventRegistration defaultRegistration = zombiedRegistration.clone(QuerySpec.defaultQueryAtPath(zombiedRegistration.getQuerySpec<MASK><NEW_LINE>registrationList = globalEventRegistrations.get(defaultRegistration);<NEW_LINE>if (registrationList != null) {<NEW_LINE>for (int i = 0; i < registrationList.size(); i++) {<NEW_LINE>if (registrationList.get(i) == zombiedRegistration) {<NEW_LINE>registrationList.remove(i);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (registrationList.isEmpty()) {<NEW_LINE>globalEventRegistrations.remove(defaultRegistration);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
().getPath()));
1,347,583
public void run(RegressionEnvironment env) {<NEW_LINE>RegressionPath path = new RegressionPath();<NEW_LINE>String epl = "@public create " + rep.getName() + " schema MyTwoColEvent(c0 string, c1 int);\n" + "@public @name('window') create window MyWindow#keepall as MyTwoColEvent;\n" + "insert into MyWindow select theString as c0 from SupportBean;\n" + "insert into MyWindow select id as c1 from SupportBean_S0;\n";<NEW_LINE>env.compileDeploy(epl, path);<NEW_LINE>String[] fields = "c0,c1".split(",");<NEW_LINE>env.sendEventBean(new SupportBean("E1", 0));<NEW_LINE>env.assertPropsPerRowIterator("window", fields, new Object[][] { { "E1", null } });<NEW_LINE>env.milestone(0);<NEW_LINE>env.<MASK><NEW_LINE>env.assertPropsPerRowIterator("window", fields, new Object[][] { { "E1", null }, { null, 10 } });<NEW_LINE>env.undeployAll();<NEW_LINE>}
sendEventBean(new SupportBean_S0(10));
1,755,326
private static final void writeDoc(Writer writer, String url, ArrayList<String> sentences, String grep) throws IOException {<NEW_LINE>writer.write("<form name=\"yacydoc" + url + "\" method=\"post\" action=\"#\" enctype=\"multipart/form-data\" accept-charset=\"UTF-8\">\n");<NEW_LINE>writer.write("<fieldset>\n");<NEW_LINE>writer.write("<h1><a href=\"" + url + "\">" + url + "</a></h1>\n");<NEW_LINE>writer.write("<dl>\n");<NEW_LINE>int c = 0;<NEW_LINE>for (String line : sentences) {<NEW_LINE>if (grep != null && grep.length() > 0 && line.indexOf(grep) < 0)<NEW_LINE>continue;<NEW_LINE>writer.write("<dt>");<NEW_LINE>if (c++ == 0) {<NEW_LINE>if (grep == null || grep.length() == 0)<NEW_LINE>writer.write("all lines in document");<NEW_LINE>else {<NEW_LINE>writer.write("matches for grep phrase \"");<NEW_LINE>writer.write(grep);<NEW_LINE>writer.write("\"");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>writer.write("</dt>");<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>writer.write("</dl>\n");<NEW_LINE>writer.write("</fieldset>\n");<NEW_LINE>writer.write("</form>\n");<NEW_LINE>}
writedd(writer, line, grep);
830,140
private static void registerTypeHandlers(Context context, TypeHandlerLibrary library, ModuleEnvironment environment) {<NEW_LINE>for (Class<? extends TypeHandler> handler : environment.getSubtypesOf(TypeHandler.class)) {<NEW_LINE>RegisterTypeHandler register = handler.getAnnotation(RegisterTypeHandler.class);<NEW_LINE>if (register != null) {<NEW_LINE>Optional<Type> opt = GenericsUtil.getTypeParameterBindingForInheritedClass(handler, TypeHandler.class, 0);<NEW_LINE>if (opt.isPresent()) {<NEW_LINE>TypeHandler instance = InjectionHelper.createWithConstructorInjection(handler, context);<NEW_LINE><MASK><NEW_LINE>library.addTypeHandler(TypeInfo.of(opt.get()), instance);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>for (Class<? extends TypeHandlerFactory> clazz : environment.getSubtypesOf(TypeHandlerFactory.class)) {<NEW_LINE>if (!clazz.isAnnotationPresent(RegisterTypeHandlerFactory.class)) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>TypeHandlerFactory instance = InjectionHelper.createWithConstructorInjection(clazz, context);<NEW_LINE>InjectionHelper.inject(instance, context);<NEW_LINE>library.addTypeHandlerFactory(instance);<NEW_LINE>}<NEW_LINE>}
InjectionHelper.inject(instance, context);
1,031,283
public String constructExampleCode(CodegenProperty codegenProperty, HashMap<String, CodegenModel> modelMaps, int depth) {<NEW_LINE>if (depth > 10)<NEW_LINE>return "...";<NEW_LINE>depth++;<NEW_LINE>if (codegenProperty.isArray) {<NEW_LINE>// array<NEW_LINE>return "list(" + constructExampleCode(codegenProperty.<MASK><NEW_LINE>} else if (codegenProperty.isMap) {<NEW_LINE>// TODO: map<NEW_LINE>return "TODO";<NEW_LINE>} else if (languageSpecificPrimitives.contains(codegenProperty.dataType)) {<NEW_LINE>// primitive type<NEW_LINE>if ("character".equals(codegenProperty.dataType)) {<NEW_LINE>if (StringUtils.isEmpty(codegenProperty.example)) {<NEW_LINE>return "\"" + codegenProperty.example + "\"";<NEW_LINE>} else {<NEW_LINE>if (Boolean.TRUE.equals(codegenProperty.isEnum)) {<NEW_LINE>// enum<NEW_LINE>return "\"" + ((List<Object>) codegenProperty.allowableValues.get("values")).get(0) + "\"";<NEW_LINE>} else {<NEW_LINE>return "\"" + codegenProperty.name + "_example\"";<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>// numeric<NEW_LINE>if (StringUtils.isEmpty(codegenProperty.example)) {<NEW_LINE>return codegenProperty.example;<NEW_LINE>} else {<NEW_LINE>return "123";<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>// look up the model<NEW_LINE>if (modelMaps.containsKey(codegenProperty.dataType)) {<NEW_LINE>return constructExampleCode(modelMaps.get(codegenProperty.dataType), modelMaps, depth);<NEW_LINE>} else {<NEW_LINE>LOGGER.error("Error in constructing examples. Failed to look up the model {}", codegenProperty.dataType);<NEW_LINE>return "TODO";<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
items, modelMaps, depth) + ")";
1,730,517
private boolean parallelExecution(String pack, List<String> tests) throws Exception {<NEW_LINE>int deviceCount = hostMachineDeviceManager.getDevicesByHost().getAllDevices().size();<NEW_LINE>if (deviceCount == 0) {<NEW_LINE>figlet("No Devices Connected");<NEW_LINE>System.exit(0);<NEW_LINE>}<NEW_LINE>LOGGER.info(LOGGER.getName() + "Total Number of devices detected::" + deviceCount + "\n");<NEW_LINE>createAppiumLogsFolder();<NEW_LINE>createSnapshotDirectoryFor();<NEW_LINE>String platform = getOverriddenStringValue("Platform");<NEW_LINE>if (deviceAllocationManager.getDevices() != null && platform.equalsIgnoreCase(ANDROID) || platform.equalsIgnoreCase(BOTH)) {<NEW_LINE>if (!capabilities.getCapabilityObjectFromKey("android").has("automationName")) {<NEW_LINE>throw new IllegalArgumentException("Please set automationName " + "as UIAutomator2 or Espresso to create Android driver");<NEW_LINE>}<NEW_LINE>generateDirectoryForAdbLogs();<NEW_LINE>}<NEW_LINE>boolean result = false;<NEW_LINE><MASK><NEW_LINE>String framework = FRAMEWORK.get();<NEW_LINE>if (framework.equalsIgnoreCase("testng")) {<NEW_LINE>String executionType = runner.equalsIgnoreCase("distribute") ? "distribute" : "parallel";<NEW_LINE>result = ATDExecutor.constructXMLAndTriggerParallelRunner(tests, pack, deviceCount, executionType);<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>}
String runner = RUNNER.get();
406,000
public Map<String, Double> calculateSpellColorPercentages() {<NEW_LINE>final Map<String, Integer> colorCount = new HashMap<>();<NEW_LINE>for (final ColoredManaSymbol color : ColoredManaSymbol.values()) {<NEW_LINE>colorCount.put(color.toString(), 0);<NEW_LINE>}<NEW_LINE>// Counts how many colored mana symbols we've seen in total so we can get the percentage of each color<NEW_LINE>int totalCount = 0;<NEW_LINE>List<Card> fixedSpells = getFixedSpells();<NEW_LINE>for (Card spell : fixedSpells) {<NEW_LINE>for (String symbol : spell.getManaCostSymbols()) {<NEW_LINE>symbol = symbol.replace("{", "").replace("}", "");<NEW_LINE>if (isColoredManaSymbol(symbol)) {<NEW_LINE>for (ColoredManaSymbol allowed : allowedColors) {<NEW_LINE>if (symbol.contains(allowed.toString())) {<NEW_LINE>int cnt = colorCount.get(allowed.toString());<NEW_LINE>colorCount.put(allowed.toString(), cnt + 1);<NEW_LINE>totalCount++;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>final Map<String, Double> percentages = new HashMap<>();<NEW_LINE>for (Map.Entry<String, Integer> singleCount : colorCount.entrySet()) {<NEW_LINE><MASK><NEW_LINE>int count = singleCount.getValue();<NEW_LINE>// Calculate the percentage this color has out of the total color counts<NEW_LINE>double percentage = (count / (double) totalCount) * 100;<NEW_LINE>percentages.put(color, percentage);<NEW_LINE>}<NEW_LINE>return percentages;<NEW_LINE>}
String color = singleCount.getKey();
1,805,008
void emailSpec11Reports(LocalDate date, SoyTemplateInfo soyTemplateInfo, String subject, ImmutableSet<RegistrarThreatMatches> registrarThreatMatchesSet) {<NEW_LINE>ImmutableMap.Builder<RegistrarThreatMatches, Throwable> failedMatchesBuilder = ImmutableMap.builder();<NEW_LINE>for (RegistrarThreatMatches registrarThreatMatches : registrarThreatMatchesSet) {<NEW_LINE>RegistrarThreatMatches filteredMatches = filterOutNonPublishedMatches(registrarThreatMatches);<NEW_LINE>if (!filteredMatches.threatMatches().isEmpty()) {<NEW_LINE>try {<NEW_LINE>// Handle exceptions individually per registrar so that one failed email doesn't prevent<NEW_LINE>// the rest from being sent.<NEW_LINE>emailRegistrar(<MASK><NEW_LINE>} catch (Throwable e) {<NEW_LINE>failedMatchesBuilder.put(registrarThreatMatches, getRootCause(e));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>ImmutableMap<RegistrarThreatMatches, Throwable> failedMatches = failedMatchesBuilder.build();<NEW_LINE>if (!failedMatches.isEmpty()) {<NEW_LINE>ImmutableList<Map.Entry<RegistrarThreatMatches, Throwable>> failedMatchesList = failedMatches.entrySet().asList();<NEW_LINE>// Send an alert email and throw a RuntimeException with the first failure as the cause,<NEW_LINE>// but log the rest so that we have that information.<NEW_LINE>Throwable firstThrowable = failedMatchesList.get(0).getValue();<NEW_LINE>sendAlertEmail(String.format("Spec11 Emailing Failure %s", date), String.format("Emailing Spec11 reports failed due to %s", firstThrowable.getMessage()));<NEW_LINE>for (int i = 1; i < failedMatches.size(); i++) {<NEW_LINE>logger.atSevere().withCause(failedMatchesList.get(i).getValue()).log("Additional exception thrown when sending email to registrar %s, in addition to the" + " re-thrown exception.", failedMatchesList.get(i).getKey().clientId());<NEW_LINE>}<NEW_LINE>throw new RuntimeException("Emailing Spec11 reports failed, first exception:", firstThrowable);<NEW_LINE>}<NEW_LINE>sendAlertEmail(String.format("Spec11 Pipeline Success %s", date), "Spec11 reporting completed successfully.");<NEW_LINE>}
date, soyTemplateInfo, subject, filteredMatches);
905,658
private static org.jreleaser.model.Changelog convertChangelog(Changelog changelog) {<NEW_LINE>org.jreleaser.model.Changelog c = new org.jreleaser.model.Changelog();<NEW_LINE>if (changelog.isEnabledSet())<NEW_LINE>c.setEnabled(changelog.isEnabled());<NEW_LINE>if (changelog.isLinksSet())<NEW_LINE>c.setLinks(changelog.isLinks());<NEW_LINE>c.setSort(changelog.getSort().name());<NEW_LINE>c.setExternal(tr(changelog.getExternal()));<NEW_LINE>c.setFormatted(tr(changelog.resolveFormatted()));<NEW_LINE>c.getIncludeLabels().addAll(tr(changelog.getIncludeLabels()));<NEW_LINE>c.getExcludeLabels().addAll(tr(changelog.getExcludeLabels()));<NEW_LINE>c.setFormat(tr(changelog.getFormat()));<NEW_LINE>c.setContent(tr(changelog.getContent()));<NEW_LINE>c.setContentTemplate(tr(changelog.getContentTemplate()));<NEW_LINE>c.setPreset(tr(changelog.getPreset()));<NEW_LINE>c.setCategories(convertCategories<MASK><NEW_LINE>c.setLabelers(convertLabelers(changelog.getLabelers()));<NEW_LINE>c.setReplacers(convertReplacers(changelog.getReplacers()));<NEW_LINE>c.setHide(convertHide(changelog.getHide()));<NEW_LINE>c.setContributors(convertContributors(changelog.getContributors()));<NEW_LINE>return c;<NEW_LINE>}
(changelog.getCategories()));
1,131,564
public List<GenericTrigger> loadTriggers(DBRProgressMonitor monitor, @NotNull GenericStructContainer container, @Nullable GenericTableBase table) throws DBException {<NEW_LINE>try (JDBCSession session = DBUtils.openMetaSession(monitor, container, "Read triggers")) {<NEW_LINE>try (JDBCPreparedStatement dbStat = (JDBCPreparedStatement) prepareTableTriggersLoadStatement(session, container, table)) {<NEW_LINE>List<GenericTrigger> result = new ArrayList<>();<NEW_LINE>try (JDBCResultSet dbResult = dbStat.executeQuery()) {<NEW_LINE>while (dbResult.next()) {<NEW_LINE>String name = JDBCUtils.safeGetString(dbResult, 1);<NEW_LINE>if (name == null) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>name = name.trim();<NEW_LINE>SQLServerGenericTrigger trigger = new <MASK><NEW_LINE>result.add(trigger);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>}<NEW_LINE>} catch (SQLException e) {<NEW_LINE>throw new DBException(e, container.getDataSource());<NEW_LINE>}<NEW_LINE>}
SQLServerGenericTrigger(table, name, null);
650,837
protected Tuple3<Boolean, Double, Map<String, String>>[] detect(MTable series, boolean detectLast) throws Exception {<NEW_LINE>series = OutlierUtil.getMTable(series, this.params);<NEW_LINE>String[] featureCols = series.getColNames();<NEW_LINE>int iStart = detectLast ? series.getNumRow() - 1 : 0;<NEW_LINE>int iEnd = series.getNumRow();<NEW_LINE>double[] histogram = new double[k];<NEW_LINE>double[] scores = new double[iEnd - iStart];<NEW_LINE>Arrays.fill(scores, 1.0);<NEW_LINE>for (String featureCol : featureCols) {<NEW_LINE>double[] values = OutlierUtil.getNumericArray(series, featureCol);<NEW_LINE>double min = Double.MAX_VALUE, max = -Double.MAX_VALUE, sum = 0.0;<NEW_LINE>Arrays.fill(histogram, 0.0);<NEW_LINE>for (double val : values) {<NEW_LINE>min = Math.min(min, val);<NEW_LINE>max = <MASK><NEW_LINE>sum += val;<NEW_LINE>}<NEW_LINE>double step = (max - min + EPS) / k;<NEW_LINE>double avg = 1.0 / sum;<NEW_LINE>for (double val : values) {<NEW_LINE>int index = (int) Math.floor((val - min) / step);<NEW_LINE>histogram[index] += avg;<NEW_LINE>}<NEW_LINE>for (int j = iStart, j1 = 0; j < iEnd; ++j, ++j1) {<NEW_LINE>int index = (int) Math.floor((values[j] - min) / step);<NEW_LINE>scores[j1] *= histogram[index];<NEW_LINE>}<NEW_LINE>}<NEW_LINE>Tuple3<Boolean, Double, Map<String, String>>[] result = new Tuple3[scores.length];<NEW_LINE>for (int i = 0; i < scores.length; ++i) {<NEW_LINE>double score = -Math.log(scores[i]);<NEW_LINE>if (isPredDetail) {<NEW_LINE>result[i] = Tuple3.of(score > DEFAULT_THRESHOLD, score, new HashMap<>());<NEW_LINE>} else {<NEW_LINE>result[i] = Tuple3.of(score > DEFAULT_THRESHOLD, null, null);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>}
Math.max(max, val);
1,526,052
public EppResponse run() throws EppException {<NEW_LINE>extensionManager.register(MetadataExtension.class);<NEW_LINE>validateRegistrarIsLoggedIn(registrarId);<NEW_LINE>extensionManager.validate();<NEW_LINE>Create command = (Create) resourceCommand;<NEW_LINE>DateTime now = tm().getTransactionTime();<NEW_LINE>verifyResourceDoesNotExist(ContactResource.class, targetId, now, registrarId);<NEW_LINE>ContactResource newContact = new ContactResource.Builder().setContactId(targetId).setAuthInfo(command.getAuthInfo()).setCreationRegistrarId(registrarId).setPersistedCurrentSponsorRegistrarId(registrarId).setRepoId(createRepoId(allocateId(), roidSuffix)).setFaxNumber(command.getFax()).setVoiceNumber(command.getVoice()).setDisclose(command.getDisclose()).setEmailAddress(command.getEmail()).setInternationalizedPostalInfo(command.getInternationalizedPostalInfo()).setLocalizedPostalInfo(command.getLocalizedPostalInfo()).build();<NEW_LINE>validateAsciiPostalInfo(newContact.getInternationalizedPostalInfo());<NEW_LINE>validateContactAgainstPolicy(newContact);<NEW_LINE>// We don't want to store contact details in the history entry.<NEW_LINE>historyBuilder.setType(HistoryEntry.Type.CONTACT_CREATE).// We don't want to store contact details in the history entry.<NEW_LINE>setXmlBytes(null).setContact(newContact);<NEW_LINE>tm().insertAll(ImmutableSet.of(newContact, historyBuilder.build(), ForeignKeyIndex.create(newContact, newContact.getDeletionTime()), EppResourceIndex.create(Key.create(newContact))));<NEW_LINE>return responseBuilder.setResData(ContactCreateData.create(newContact.getContactId()<MASK><NEW_LINE>}
, now)).build();
118,028
public static FundingRecord adaptFundingRecord(Currency currency, CoinbaseProTransfer coinbaseProTransfer) {<NEW_LINE>FundingRecord.Status status = FundingRecord.Status.PROCESSING;<NEW_LINE>Date processedAt = coinbaseProTransfer.processedAt();<NEW_LINE>Date canceledAt = coinbaseProTransfer.canceledAt();<NEW_LINE>if (canceledAt != null)<NEW_LINE>status = FundingRecord.Status.CANCELLED;<NEW_LINE>else if (processedAt != null)<NEW_LINE>status = FundingRecord.Status.COMPLETE;<NEW_LINE>String address = coinbaseProTransfer.getDetails().getCryptoAddress();<NEW_LINE>if (address == null)<NEW_LINE>address = coinbaseProTransfer.getDetails().getSentToAddress();<NEW_LINE>String cryptoTransactionHash = coinbaseProTransfer<MASK><NEW_LINE>String transactionHash = adaptTransactionHash(currency.getSymbol(), cryptoTransactionHash);<NEW_LINE>return new FundingRecord(address, coinbaseProTransfer.getDetails().getDestinationTag(), coinbaseProTransfer.createdAt(), currency, coinbaseProTransfer.amount(), coinbaseProTransfer.getId(), transactionHash, coinbaseProTransfer.type(), status, null, null, null);<NEW_LINE>}
.getDetails().getCryptoTransactionHash();
1,033,827
Optional<BuckFixSpec> writeFixSpec(BuildId buildId, ExitCode exitCode, Optional<Exception> exceptionForFix) {<NEW_LINE>try {<NEW_LINE>// Because initially there's no fix spec file in the log dir, build a Buck Fix Spec from logs<NEW_LINE>Either<BuckFixSpec, BuckFixSpecParser.FixSpecFailure> fixSpec = BuckFixSpecParser.parseFromBuildIdWithExitCode(new BuildLogHelper(filesystem), fixConfig, buildId, exitCode, false, exceptionForFix);<NEW_LINE>if (fixSpec.isRight()) {<NEW_LINE>LOG.warn("Error fetching logs for build %s: %s", buildId, fixSpec.getRight().humanReadableError());<NEW_LINE>return Optional.empty();<NEW_LINE>}<NEW_LINE>Path specPath = BuckFixSpecWriter.writeSpecToLogDir(filesystem.getRootPath().getPath(), <MASK><NEW_LINE>LOG.info("wrote fix spec file to: %s", specPath);<NEW_LINE>return Optional.of(fixSpec.getLeft());<NEW_LINE>} catch (IOException e) {<NEW_LINE>LOG.warn(e, "Error while writing fix spec file to log directory");<NEW_LINE>}<NEW_LINE>return Optional.empty();<NEW_LINE>}
invocationInfo, fixSpec.getLeft());
1,204,415
protected static // ------------------------------------------------------------------------------------<NEW_LINE>void printImages(EnumMap<measurements, Map<String, Double>> values) {<NEW_LINE>System.out.println();<NEW_LINE>for (measurements m : values.keySet()) {<NEW_LINE>Map<String, Double> map = values.get(m);<NEW_LINE>ArrayList<Map.Entry<String, Double>> list = new ArrayList<Map.Entry<String, Double>>(map.entrySet());<NEW_LINE>Collections.sort(list, new Comparator<Map.Entry<String, Double>>() {<NEW_LINE><NEW_LINE>public int compare(Map.Entry<String, Double> o1, Map.Entry<String, Double> o2) {<NEW_LINE>double diff = o1.getValue<MASK><NEW_LINE>return diff > 0 ? 1 : (diff < 0 ? -1 : 0);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>LinkedHashMap<String, Double> sortedMap = new LinkedHashMap<String, Double>();<NEW_LINE>for (Map.Entry<String, Double> entry : list) {<NEW_LINE>if (!entry.getValue().isNaN()) {<NEW_LINE>sortedMap.put(entry.getKey(), entry.getValue());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (!sortedMap.isEmpty())<NEW_LINE>printImage(sortedMap, m);<NEW_LINE>}<NEW_LINE>System.out.println();<NEW_LINE>}
() - o2.getValue();
459,351
private Result searchMultipleDocumentTypes(Searcher searcher, Query query, Execution execution) {<NEW_LINE>Set<String> docTypes = resolveDocumentTypes(query, execution.context().getIndexFacts());<NEW_LINE>Result invalidRankProfile = checkValidRankProfiles(query, docTypes);<NEW_LINE>if (invalidRankProfile != null)<NEW_LINE>return invalidRankProfile;<NEW_LINE>List<Query> <MASK><NEW_LINE>if (queries.size() == 1) {<NEW_LINE>return searcher.search(queries.get(0), execution);<NEW_LINE>} else {<NEW_LINE>Result mergedResult = new Result(query);<NEW_LINE>List<FutureTask<Result>> pending = new ArrayList<>(queries.size());<NEW_LINE>for (Query q : queries) {<NEW_LINE>FutureTask<Result> task = new FutureTask<>(() -> searcher.search(q, execution));<NEW_LINE>try {<NEW_LINE>executor.execute(task);<NEW_LINE>pending.add(task);<NEW_LINE>} catch (RejectedExecutionException rej) {<NEW_LINE>task.run();<NEW_LINE>processResult(query, task, mergedResult);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>for (FutureTask<Result> task : pending) {<NEW_LINE>processResult(query, task, mergedResult);<NEW_LINE>}<NEW_LINE>// Should we trim the merged result?<NEW_LINE>if (query.getOffset() > 0 || query.getHits() < mergedResult.hits().size()) {<NEW_LINE>if (mergedResult.getHitOrderer() != null) {<NEW_LINE>// Make sure we have the necessary data for sorting<NEW_LINE>searcher.fill(mergedResult, VespaBackEndSearcher.SORTABLE_ATTRIBUTES_SUMMARY_CLASS, execution);<NEW_LINE>}<NEW_LINE>mergedResult.hits().trim(query.getOffset(), query.getHits());<NEW_LINE>// Needed when doing a trim<NEW_LINE>query.setOffset(0);<NEW_LINE>}<NEW_LINE>return mergedResult;<NEW_LINE>}<NEW_LINE>}
queries = createQueries(query, docTypes);
1,081,497
private Hotkey listToHotkey(List list) {<NEW_LINE>try {<NEW_LINE>String actionId = (String) list.get(0);<NEW_LINE>KeyStroke keyStroke = KeyStroke.getKeyStroke((String) list.get(1));<NEW_LINE>if (keyStroke == null) {<NEW_LINE>LOGGER.warning("Error loading hotkey, invalid: " + list);<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>// Optional data with default values<NEW_LINE>Type type = Hotkey.Type.REGULAR;<NEW_LINE>String custom = "";<NEW_LINE>int delay = 0;<NEW_LINE>if (list.size() > 2) {<NEW_LINE>type = Hotkey.Type.getTypeFromId(((Number) list.get(<MASK><NEW_LINE>}<NEW_LINE>if (list.size() > 3) {<NEW_LINE>custom = (String) list.get(3);<NEW_LINE>}<NEW_LINE>if (list.size() > 4) {<NEW_LINE>delay = ((Number) list.get(4)).intValue();<NEW_LINE>}<NEW_LINE>return new Hotkey(actionId, keyStroke, type, custom, delay);<NEW_LINE>} catch (IndexOutOfBoundsException | NullPointerException | ClassCastException ex) {<NEW_LINE>LOGGER.warning("Error loading hotkey: " + list + " [" + ex + "]");<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>}
2)).intValue());
354,723
public Description matchAnnotation(AnnotationTree tree, VisitorState state) {<NEW_LINE>Symbol sym = ASTHelpers.getSymbol(tree);<NEW_LINE>if (sym == null) {<NEW_LINE>return NO_MATCH;<NEW_LINE>}<NEW_LINE>Attribute.Compound annotation = sym.getRawAttributes().stream().filter(a -> a.type.tsym.getQualifiedName().contentEquals(INCOMPATIBLE_MODIFIERS)).findAny().orElse(null);<NEW_LINE>if (annotation == null) {<NEW_LINE>return NO_MATCH;<NEW_LINE>}<NEW_LINE>Set<Modifier> incompatibleModifiers = new LinkedHashSet<>();<NEW_LINE>getValue(annotation, "value").ifPresent(a -> getModifiers(incompatibleModifiers, a));<NEW_LINE>getValue(annotation, "modifier").ifPresent(a <MASK><NEW_LINE>if (incompatibleModifiers.isEmpty()) {<NEW_LINE>return NO_MATCH;<NEW_LINE>}<NEW_LINE>Tree parent = state.getPath().getParentPath().getLeaf();<NEW_LINE>if (!(parent instanceof ModifiersTree)) {<NEW_LINE>// e.g. An annotated package name<NEW_LINE>return NO_MATCH;<NEW_LINE>}<NEW_LINE>Set<Modifier> incompatible = Sets.intersection(incompatibleModifiers, ((ModifiersTree) parent).getFlags());<NEW_LINE>if (incompatible.isEmpty()) {<NEW_LINE>return NO_MATCH;<NEW_LINE>}<NEW_LINE>String annotationName = ASTHelpers.getAnnotationName(tree);<NEW_LINE>String nameString = annotationName != null ? String.format("The annotation '@%s'", annotationName) : "This annotation";<NEW_LINE>String message = String.format("%s has specified that it should not be used together with the following modifiers: %s", nameString, incompatible);<NEW_LINE>return buildDescription(tree).addFix(SuggestedFixes.removeModifiers((ModifiersTree) parent, state, incompatible).orElse(SuggestedFix.emptyFix())).setMessage(message).build();<NEW_LINE>}
-> getModifiers(incompatibleModifiers, a));
1,027,191
// TODO Set this to private once WalkableAreaBuilder is gone<NEW_LINE>protected void applyWayProperties(StreetEdge street, StreetEdge backStreet, WayProperties wayData, OSMWithTags way) {<NEW_LINE>Set<T2<StreetNote, NoteMatcher>> notes = wayPropertySet.getNoteForWay(way);<NEW_LINE>boolean motorVehicleNoThrough = wayPropertySetSource.isMotorVehicleThroughTrafficExplicitlyDisallowed(way);<NEW_LINE>boolean bicycleNoThrough = wayPropertySetSource.isBicycleNoThroughTrafficExplicitlyDisallowed(way);<NEW_LINE>boolean walkNoThrough = wayPropertySetSource.isWalkNoThroughTrafficExplicitlyDisallowed(way);<NEW_LINE>if (street != null) {<NEW_LINE>double safety = wayData.getSafetyFeatures().first;<NEW_LINE>street<MASK><NEW_LINE>if (safety < bestBikeSafety) {<NEW_LINE>bestBikeSafety = (float) safety;<NEW_LINE>}<NEW_LINE>if (notes != null) {<NEW_LINE>for (T2<StreetNote, NoteMatcher> note : notes) graph.streetNotesService.addStaticNote(street, note.first, note.second);<NEW_LINE>}<NEW_LINE>street.setMotorVehicleNoThruTraffic(motorVehicleNoThrough);<NEW_LINE>street.setBicycleNoThruTraffic(bicycleNoThrough);<NEW_LINE>street.setWalkNoThruTraffic(walkNoThrough);<NEW_LINE>}<NEW_LINE>if (backStreet != null) {<NEW_LINE>double safety = wayData.getSafetyFeatures().second;<NEW_LINE>if (safety < bestBikeSafety) {<NEW_LINE>bestBikeSafety = (float) safety;<NEW_LINE>}<NEW_LINE>backStreet.setBicycleSafetyFactor((float) safety);<NEW_LINE>if (notes != null) {<NEW_LINE>for (T2<StreetNote, NoteMatcher> note : notes) graph.streetNotesService.addStaticNote(backStreet, note.first, note.second);<NEW_LINE>}<NEW_LINE>backStreet.setMotorVehicleNoThruTraffic(motorVehicleNoThrough);<NEW_LINE>backStreet.setBicycleNoThruTraffic(bicycleNoThrough);<NEW_LINE>backStreet.setWalkNoThruTraffic(walkNoThrough);<NEW_LINE>}<NEW_LINE>}
.setBicycleSafetyFactor((float) safety);
619,694
final GetRegexPatternSetResult executeGetRegexPatternSet(GetRegexPatternSetRequest getRegexPatternSetRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(getRegexPatternSetRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<GetRegexPatternSetRequest> request = null;<NEW_LINE>Response<GetRegexPatternSetResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new GetRegexPatternSetRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(getRegexPatternSetRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "WAF Regional");<NEW_LINE>request.<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<GetRegexPatternSetResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new GetRegexPatternSetResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
addHandlerContext(HandlerContextKey.OPERATION_NAME, "GetRegexPatternSet");
1,095,414
public static void main(String[] args) {<NEW_LINE>int vertexCount = 3;<NEW_LINE>ArrayList<ArrayList<Integer>> graph = new ArrayList<>(vertexCount);<NEW_LINE>// Initializing each element of ArrayList with ArrayList<NEW_LINE>for (int i = 0; i < vertexCount; i++) {<NEW_LINE>graph.add(new ArrayList<Integer>());<NEW_LINE>}<NEW_LINE>// We can add any number of columns to each row<NEW_LINE>graph.get(0).add(1);<NEW_LINE>graph.get(1).add(2);<NEW_LINE>graph.get(2).add(0);<NEW_LINE>graph.get(1).add(0);<NEW_LINE>graph.get(2).add(1);<NEW_LINE>graph.get<MASK><NEW_LINE>vertexCount = graph.size();<NEW_LINE>for (int i = 0; i < vertexCount; i++) {<NEW_LINE>int edgeCount = graph.get(i).size();<NEW_LINE>for (int j = 0; j < edgeCount; j++) {<NEW_LINE>Integer startVertex = i;<NEW_LINE>Integer endVertex = graph.get(i).get(j);<NEW_LINE>System.out.printf("Vertex %d is connected to vertex %d%n", startVertex, endVertex);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
(0).add(2);
536,320
public static UsersPrivilegesMetadata swapPrivileges(UsersPrivilegesMetadata usersPrivileges, RelationName source, RelationName target) {<NEW_LINE>HashMap<String, Set<Privilege>> privilegesByUser = new HashMap<>();<NEW_LINE>for (Map.Entry<String, Set<Privilege>> userPrivileges : usersPrivileges.usersPrivileges.entrySet()) {<NEW_LINE>String user = userPrivileges.getKey();<NEW_LINE>Set<Privilege> privileges = userPrivileges.getValue();<NEW_LINE>Set<Privilege> updatedPrivileges = new HashSet<>();<NEW_LINE>for (Privilege privilege : privileges) {<NEW_LINE>PrivilegeIdent ident = privilege.ident();<NEW_LINE>if (ident.clazz() == Privilege.Clazz.TABLE) {<NEW_LINE>if (source.fqn().equals(ident.ident())) {<NEW_LINE>updatedPrivileges.add(new Privilege(privilege.state(), ident.type(), ident.clazz(), target.fqn(), privilege.grantor()));<NEW_LINE>} else if (target.fqn().equals(ident.ident())) {<NEW_LINE>updatedPrivileges.add(new Privilege(privilege.state(), ident.type(), ident.clazz(), source.fqn(), privilege.grantor()));<NEW_LINE>} else {<NEW_LINE>updatedPrivileges.add(privilege);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>updatedPrivileges.add(privilege);<NEW_LINE>}<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>return new UsersPrivilegesMetadata(privilegesByUser);<NEW_LINE>}
privilegesByUser.put(user, updatedPrivileges);
1,086,864
public void run(RegressionEnvironment env) {<NEW_LINE>String joinStatement = "@name('s0') select * from " + "SupportMarketDataBean#length(3)," + "SupportBean#length(3)" + " where symbol=theString and volume=longBoxed";<NEW_LINE>env.compileDeploy(joinStatement).addListener("s0");<NEW_LINE>Object[] setOne = new Object[5];<NEW_LINE>Object[] setTwo = new Object[5];<NEW_LINE>for (int i = 0; i < setOne.length; i++) {<NEW_LINE>setOne[i] = new SupportMarketDataBean("IBM", 0, (long) i, "");<NEW_LINE>SupportBean theEvent = new SupportBean();<NEW_LINE>theEvent.setTheString("IBM");<NEW_LINE>theEvent.setLongBoxed((long) i);<NEW_LINE>setTwo[i] = theEvent;<NEW_LINE>}<NEW_LINE>sendEvent<MASK><NEW_LINE>sendEvent(env, setTwo[0]);<NEW_LINE>env.assertListener("s0", listener -> assertNotNull(listener.getLastNewData()));<NEW_LINE>env.undeployAll();<NEW_LINE>}
(env, setOne[0]);
1,652,482
public static void main(String[] args) {<NEW_LINE>LinkedListNode lA1 = new LinkedListNode(3, null, null);<NEW_LINE>LinkedListNode lA2 = new LinkedListNode(1, null, lA1);<NEW_LINE>LinkedListNode lA3 = new LinkedListNode(5, null, lA2);<NEW_LINE>LinkedListNode lB1 = new LinkedListNode(5, null, null);<NEW_LINE>LinkedListNode lB2 = new LinkedListNode(9, null, lB1);<NEW_LINE>LinkedListNode lB3 = new <MASK><NEW_LINE>LinkedListNode list3 = addLists(lA1, lB1);<NEW_LINE>System.out.println(" " + lA1.printForward());<NEW_LINE>System.out.println("+ " + lB1.printForward());<NEW_LINE>System.out.println("= " + list3.printForward());<NEW_LINE>int l1 = linkedListToInt(lA1);<NEW_LINE>int l2 = linkedListToInt(lB1);<NEW_LINE>int l3 = linkedListToInt(list3);<NEW_LINE>System.out.print(l1 + " + " + l2 + " = " + l3 + "\n");<NEW_LINE>System.out.print(l1 + " + " + l2 + " = " + (l1 + l2));<NEW_LINE>}
LinkedListNode(1, null, lB2);
1,810,394
// closeIt<NEW_LINE>@Override<NEW_LINE>public boolean reverseCorrectIt() {<NEW_LINE>ModelValidationEngine.get().fireDocValidate(this, ModelValidator.TIMING_BEFORE_REVERSECORRECT);<NEW_LINE>//<NEW_LINE>// Get the reversal of this document's parent (if any)<NEW_LINE>// NOTE: we assume that the Reversal_ID links were set right away (see below in this method)<NEW_LINE>final I_PP_Cost_Collector parentCostCollectorReversal;<NEW_LINE>if (getPP_Cost_Collector_Parent_ID() > 0) {<NEW_LINE>final I_PP_Cost_Collector parentCostCollector = getPP_Cost_Collector_Parent();<NEW_LINE>parentCostCollectorReversal = parentCostCollector.getReversal();<NEW_LINE>} else {<NEW_LINE>parentCostCollectorReversal = null;<NEW_LINE>}<NEW_LINE>//<NEW_LINE>// Create reversal cost collector<NEW_LINE>final I_PP_Cost_Collector reversal = InterfaceWrapperHelper.newInstance(I_PP_Cost_Collector.class, this);<NEW_LINE>// honorIsCalculated=true<NEW_LINE>InterfaceWrapperHelper.copyValues(this, reversal, true);<NEW_LINE>final IPPCostCollectorBL costCollectorBL = Services.get(IPPCostCollectorBL.class);<NEW_LINE>costCollectorBL.setQuantities(reversal, costCollectorBL.getQuantities(this).negate());<NEW_LINE>reversal.setProcessed(false);<NEW_LINE>reversal.setProcessing(false);<NEW_LINE>reversal.setReversal(this);<NEW_LINE>reversal.setPP_Cost_Collector_Parent(parentCostCollectorReversal);<NEW_LINE>reversal.setDocStatus(X_PP_Cost_Collector.DOCSTATUS_Drafted);<NEW_LINE><MASK><NEW_LINE>Services.get(IPPCostCollectorDAO.class).save(reversal);<NEW_LINE>//<NEW_LINE>// Link the reversal to this cost collector<NEW_LINE>// NOTE: we need to do this right away because the link needs to be accessible right away in case of child cost collector reversal<NEW_LINE>setReversal(reversal);<NEW_LINE>Services.get(IPPCostCollectorDAO.class).save(this);<NEW_LINE>//<NEW_LINE>// Process reversal and update its status<NEW_LINE>docActionBL.processEx(reversal, X_PP_Cost_Collector.DOCACTION_Complete, X_PP_Cost_Collector.DOCSTATUS_Completed);<NEW_LINE>reversal.setProcessing(false);<NEW_LINE>reversal.setDocStatus(DOCSTATUS_Reversed);<NEW_LINE>reversal.setDocAction(DOCACTION_None);<NEW_LINE>Services.get(IPPCostCollectorDAO.class).save(reversal);<NEW_LINE>ModelValidationEngine.get().fireDocValidate(this, ModelValidator.TIMING_AFTER_REVERSECORRECT);<NEW_LINE>//<NEW_LINE>// Update status of this document:<NEW_LINE>// NOTE: we need to do this AFTER we are firing the AFTER events because in case some of the interceptors are failing<NEW_LINE>// we want to preserve the original document status.<NEW_LINE>// But nevertheless, i think the right fix shall be in org.compiere.wf.MWFActivity.performWork(Trx)<NEW_LINE>setDocStatus(DOCSTATUS_Reversed);<NEW_LINE>setDocAction(DOCACTION_None);<NEW_LINE>return true;<NEW_LINE>}
reversal.setDocAction(X_PP_Cost_Collector.DOCACTION_Complete);
332,939
public static DescribeParameterTemplatesResponse unmarshall(DescribeParameterTemplatesResponse describeParameterTemplatesResponse, UnmarshallerContext _ctx) {<NEW_LINE>describeParameterTemplatesResponse.setRequestId(_ctx.stringValue("DescribeParameterTemplatesResponse.RequestId"));<NEW_LINE>describeParameterTemplatesResponse.setParameterCount(_ctx.stringValue("DescribeParameterTemplatesResponse.ParameterCount"));<NEW_LINE>describeParameterTemplatesResponse.setDBVersion(_ctx.stringValue("DescribeParameterTemplatesResponse.DBVersion"));<NEW_LINE>describeParameterTemplatesResponse.setDBType(_ctx.stringValue("DescribeParameterTemplatesResponse.DBType"));<NEW_LINE>describeParameterTemplatesResponse.setEngine(_ctx.stringValue("DescribeParameterTemplatesResponse.Engine"));<NEW_LINE>List<TemplateRecord> parameters = new ArrayList<TemplateRecord>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("DescribeParameterTemplatesResponse.Parameters.Length"); i++) {<NEW_LINE>TemplateRecord templateRecord = new TemplateRecord();<NEW_LINE>templateRecord.setCheckingCode(_ctx.stringValue("DescribeParameterTemplatesResponse.Parameters[" + i + "].CheckingCode"));<NEW_LINE>templateRecord.setParameterName(_ctx.stringValue("DescribeParameterTemplatesResponse.Parameters[" + i + "].ParameterName"));<NEW_LINE>templateRecord.setParameterValue(_ctx.stringValue("DescribeParameterTemplatesResponse.Parameters[" + i + "].ParameterValue"));<NEW_LINE>templateRecord.setForceModify(_ctx.stringValue("DescribeParameterTemplatesResponse.Parameters[" + i + "].ForceModify"));<NEW_LINE>templateRecord.setForceRestart(_ctx.stringValue("DescribeParameterTemplatesResponse.Parameters[" + i + "].ForceRestart"));<NEW_LINE>templateRecord.setParameterDescription(_ctx.stringValue("DescribeParameterTemplatesResponse.Parameters[" + i + "].ParameterDescription"));<NEW_LINE>templateRecord.setIsNodeAvailable(_ctx.stringValue("DescribeParameterTemplatesResponse.Parameters[" + i + "].IsNodeAvailable"));<NEW_LINE>templateRecord.setParamRelyRule(_ctx.stringValue<MASK><NEW_LINE>parameters.add(templateRecord);<NEW_LINE>}<NEW_LINE>describeParameterTemplatesResponse.setParameters(parameters);<NEW_LINE>return describeParameterTemplatesResponse;<NEW_LINE>}
("DescribeParameterTemplatesResponse.Parameters[" + i + "].ParamRelyRule"));
1,733,622
// Returns true if polygon_a contains polygon_b.<NEW_LINE>private static boolean polygonContainsPolygon_(Polygon polygon_a, Polygon polygon_b, double tolerance, ProgressTracker progress_tracker) {<NEW_LINE>Envelope2D env_a = new Envelope2D(), env_b = new Envelope2D();<NEW_LINE>polygon_a.queryEnvelope2D(env_a);<NEW_LINE>polygon_b.queryEnvelope2D(env_b);<NEW_LINE>// Quick envelope rejection test for false equality.<NEW_LINE>if (!envelopeInfContainsEnvelope_(env_a, env_b, tolerance))<NEW_LINE>return false;<NEW_LINE>// Quick rasterize test to see whether the the geometries are disjoint,<NEW_LINE>// or if one is contained in the other.<NEW_LINE>int relation = tryRasterizedContainsOrDisjoint_(<MASK><NEW_LINE>if (relation == Relation.disjoint || relation == Relation.within)<NEW_LINE>return false;<NEW_LINE>if (relation == Relation.contains)<NEW_LINE>return true;<NEW_LINE>return polygonContainsPolygonImpl_(polygon_a, polygon_b, tolerance, progress_tracker);<NEW_LINE>}
polygon_a, polygon_b, tolerance, false);
1,734,213
final UpdateJobStatusResult executeUpdateJobStatus(UpdateJobStatusRequest updateJobStatusRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(updateJobStatusRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<UpdateJobStatusRequest> request = null;<NEW_LINE>Response<UpdateJobStatusResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new UpdateJobStatusRequestMarshaller().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, "S3 Control");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "UpdateJobStatus");<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>ValidationUtils.assertStringNotEmpty(updateJobStatusRequest.getAccountId(), "AccountId");<NEW_LINE>HostnameValidator.validateHostnameCompliant(updateJobStatusRequest.getAccountId(), "AccountId", "updateJobStatusRequest");<NEW_LINE>String hostPrefix = "{AccountId}.";<NEW_LINE>String resolvedHostPrefix = String.format("%s.", updateJobStatusRequest.getAccountId());<NEW_LINE>endpointTraitHost = UriResourcePathUtils.updateUriHost(endpoint, resolvedHostPrefix);<NEW_LINE>}<NEW_LINE>StaxResponseHandler<UpdateJobStatusResult> responseHandler = new com.amazonaws.services.s3control.internal.S3ControlStaxResponseHandler<UpdateJobStatusResult>(new UpdateJobStatusResultStaxUnmarshaller());<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(updateJobStatusRequest));
415,472
final DeleteOutpostResult executeDeleteOutpost(DeleteOutpostRequest deleteOutpostRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(deleteOutpostRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DeleteOutpostRequest> request = null;<NEW_LINE>Response<DeleteOutpostResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DeleteOutpostRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(deleteOutpostRequest));<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, "Outposts");<NEW_LINE>request.<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DeleteOutpostResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DeleteOutpostResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
addHandlerContext(HandlerContextKey.OPERATION_NAME, "DeleteOutpost");
1,828,005
public void run(RegressionEnvironment env) {<NEW_LINE>String[] fields = "c0".split(",");<NEW_LINE>TreeMap<Integer, List<SupportBean>> treemap = new TreeMap<>();<NEW_LINE>String epl = "@name('s0') select sorted(intPrimitive).floorEvent(intPrimitive-1) as c0 from SupportBean#length(3) as sb";<NEW_LINE>env.eplToModelCompileDeploy<MASK><NEW_LINE>makeSendBean(env, treemap, "E1", 10);<NEW_LINE>env.assertPropsNew("s0", fields, new Object[] { floorEntryFirstEvent(treemap, 10 - 1) });<NEW_LINE>makeSendBean(env, treemap, "E2", 20);<NEW_LINE>env.assertPropsNew("s0", fields, new Object[] { floorEntryFirstEvent(treemap, 20 - 1) });<NEW_LINE>env.milestone(0);<NEW_LINE>makeSendBean(env, treemap, "E3", 15);<NEW_LINE>env.assertPropsNew("s0", fields, new Object[] { floorEntryFirstEvent(treemap, 15 - 1) });<NEW_LINE>makeSendBean(env, treemap, "E3", 17);<NEW_LINE>env.assertPropsNew("s0", fields, new Object[] { floorEntryFirstEvent(treemap, 17 - 1) });<NEW_LINE>env.undeployAll();<NEW_LINE>}
(epl).addListener("s0");
1,223,325
public void write(final MacroMap env) throws IOException {<NEW_LINE>if (!env.isEmpty()) {<NEW_LINE>String value = null;<NEW_LINE>// Very simple sanity check of vars...<NEW_LINE>// NOI18N<NEW_LINE>Pattern <MASK><NEW_LINE>for (String name : env.getExportVariablesSet()) {<NEW_LINE>// check capitalized key by pattern<NEW_LINE>if (!pattern.matcher(name.toUpperCase(java.util.Locale.ENGLISH)).matches()) {<NEW_LINE>// NOI18N<NEW_LINE>Logger.getInstance().// NOI18N<NEW_LINE>log(// NOI18N<NEW_LINE>Level.WARNING, // NOI18N<NEW_LINE>"Will not pass environment variable named {0} as it contains non alpha-numeric characters", name);<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>value = env.get(name);<NEW_LINE>// As value will be enclosed in quotes, will escape all<NEW_LINE>// existent quotes.<NEW_LINE>if (value != null) {<NEW_LINE>if (value.indexOf('"') >= 0) {<NEW_LINE>// NOI18N<NEW_LINE>// NOI18N<NEW_LINE>value = value.replace("\"", "\\\"");<NEW_LINE>}<NEW_LINE>// NOI18N<NEW_LINE>writer.write(name + "=\"" + value + "\" && export " + name + "\n");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>writer.flush();<NEW_LINE>}<NEW_LINE>}
pattern = Pattern.compile("[A-Z0-9_]+");
1,414,500
public void execute(Transaction transaction) throws UserException, BimserverLockConflictException, BimserverDatabaseException, IOException, QueryException {<NEW_LINE>PackageMetaData packageMetaData = transaction.getDatabaseSession().getMetaDataManager().getPackageMetaData(transaction.getProject().getSchema());<NEW_LINE>Query query = new Query(packageMetaData);<NEW_LINE>QueryPart queryPart = query.createQueryPart();<NEW_LINE>queryPart.addOid(oid);<NEW_LINE>HashMapVirtualObject object = transaction.get(oid);<NEW_LINE>if (object == null) {<NEW_LINE>QueryObjectProvider queryObjectProvider = new QueryObjectProvider(transaction.getDatabaseSession(), transaction.getBimServer(), query, Collections.singleton(transaction.getPreviousRevision().getOid()), packageMetaData);<NEW_LINE>object = queryObjectProvider.next();<NEW_LINE>transaction.updated(object);<NEW_LINE>}<NEW_LINE>EClass eClass = transaction.getDatabaseSession().getEClassForOid(oid);<NEW_LINE>if (!ChangeHelper.canBeChanged(eClass)) {<NEW_LINE>throw new UserException("Only objects from the following schemas are allowed to be changed: Ifc2x3tc1 and IFC4, this object (" + eClass.getName() + ") is from the \"" + eClass.getEPackage().getName() + "\" package");<NEW_LINE>}<NEW_LINE>if (object == null) {<NEW_LINE>throw new UserException("No object of type \"" + eClass.getName() + "\" with oid " + oid + " found in project with pid " + transaction.getProject().getId());<NEW_LINE>}<NEW_LINE>EReference eReference = packageMetaData.getEReference(eClass.getName(), referenceName);<NEW_LINE>if (eReference == null) {<NEW_LINE>throw new UserException("No reference with the name \"" + referenceName + "\" found in class \"" + <MASK><NEW_LINE>}<NEW_LINE>if (!eReference.isMany()) {<NEW_LINE>throw new UserException("Reference is not of type 'many'");<NEW_LINE>}<NEW_LINE>List list = (List) object.get(eReference.getName());<NEW_LINE>while (!list.isEmpty()) {<NEW_LINE>list.remove(0);<NEW_LINE>}<NEW_LINE>}
eClass.getName() + "\"");
1,444,740
public void testClearMicroProfileThreadContextTypes() throws Exception {<NEW_LINE>CurrentLocation.setLocation("Winona", "Minnesota");<NEW_LINE>try {<NEW_LINE>ContextService contextSvc = InitialContext.doLookup("java:comp/DefaultContextService");<NEW_LINE>Executor contextSnapshot = contextSvc.createContextualProxy(new SerializableContextSnapshot(), Executor.class);<NEW_LINE>// verify before serializing/deserializing<NEW_LINE>contextSnapshot.execute(() -> {<NEW_LINE>try {<NEW_LINE>assertNotNull(InitialContext.doLookup("java:comp/env/executorRef"));<NEW_LINE>} catch (NamingException x) {<NEW_LINE>throw new RuntimeException(x);<NEW_LINE>}<NEW_LINE>assertTrue(CurrentLocation.isUnspecified());<NEW_LINE>});<NEW_LINE>// verify context restored<NEW_LINE>assertEquals("Winona", CurrentLocation.getCity());<NEW_LINE>assertEquals("Minnesota", CurrentLocation.getState());<NEW_LINE>// serialize<NEW_LINE>ByteArrayOutputStream bos = new ByteArrayOutputStream();<NEW_LINE>ObjectOutputStream oos = new ObjectOutputStream(bos);<NEW_LINE>oos.writeObject(contextSnapshot);<NEW_LINE>byte[] bytes = bos.toByteArray();<NEW_LINE>oos.close();<NEW_LINE><MASK><NEW_LINE>// deserialize<NEW_LINE>ObjectInputStream oin = new ObjectInputStream(new ByteArrayInputStream(bytes));<NEW_LINE>contextSnapshot = (Executor) oin.readObject();<NEW_LINE>oin.close();<NEW_LINE>contextSnapshot.execute(() -> {<NEW_LINE>try {<NEW_LINE>assertNotNull(InitialContext.doLookup("java:comp/env/executorRef"));<NEW_LINE>} catch (NamingException x) {<NEW_LINE>throw new RuntimeException(x);<NEW_LINE>}<NEW_LINE>assertTrue(CurrentLocation.isUnspecified());<NEW_LINE>});<NEW_LINE>// verify context restored<NEW_LINE>assertEquals("Decorah", CurrentLocation.getCity());<NEW_LINE>assertEquals("Iowa", CurrentLocation.getState());<NEW_LINE>} finally {<NEW_LINE>CurrentLocation.clear();<NEW_LINE>}<NEW_LINE>}
CurrentLocation.setLocation("Decorah", "Iowa");
1,220,900
private List<File> findResourcesFromExportTxt(final File contentsDir) {<NEW_LINE>final File exportTxt = new File(contentsDir, "export.txt");<NEW_LINE>if (!exportTxt.exists()) {<NEW_LINE>log("No export.txt in " + contentsDir.getAbsolutePath());<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>final Map<String, String[]> exportTable;<NEW_LINE>try {<NEW_LINE>exportTable = parseExportTxt(exportTxt);<NEW_LINE>} catch (final Exception e) {<NEW_LINE>log(<MASK><NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>final String[] resourceNames;<NEW_LINE>// Check from most-specific to least-specific:<NEW_LINE>if (exportTable.containsKey("application." + PLATFORM + BITS)) {<NEW_LINE>log("Found 'application." + PLATFORM + BITS + "' in export.txt");<NEW_LINE>resourceNames = exportTable.get("application." + PLATFORM + BITS);<NEW_LINE>} else if (exportTable.containsKey("application." + PLATFORM)) {<NEW_LINE>log("Found 'application." + PLATFORM + "' in export.txt");<NEW_LINE>resourceNames = exportTable.get("application." + PLATFORM);<NEW_LINE>} else if (exportTable.containsKey("application")) {<NEW_LINE>log("Found 'application' in export.txt");<NEW_LINE>resourceNames = exportTable.get("application");<NEW_LINE>} else {<NEW_LINE>log("No matching platform in " + exportTxt.getAbsolutePath());<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>final List<File> resources = new ArrayList<>();<NEW_LINE>for (final String resourceName : resourceNames) {<NEW_LINE>final File resource = new File(contentsDir, resourceName).getAbsoluteFile();<NEW_LINE>if (resource.exists()) {<NEW_LINE>resources.add(resource);<NEW_LINE>} else {<NEW_LINE>log(resourceName + " is mentioned in " + exportTxt.getAbsolutePath() + "but doesn't actually exist. Moving on.");<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return resources;<NEW_LINE>}
"Couldn't parse export.txt: " + e.getMessage());
125,302
private void parseUrl(Class<T> type, URL url, List<String> classNames) throws ServiceConfigurationError {<NEW_LINE>InputStream inputStream = null;<NEW_LINE>BufferedReader reader = null;<NEW_LINE>try {<NEW_LINE>inputStream = url.openStream();<NEW_LINE>reader = new BufferedReader(new InputStreamReader(inputStream, MotanConstants.DEFAULT_CHARACTER));<NEW_LINE>String line = null;<NEW_LINE>int indexNumber = 0;<NEW_LINE>while ((line = reader.readLine()) != null) {<NEW_LINE>indexNumber++;<NEW_LINE>parseLine(type, url, line, indexNumber, classNames);<NEW_LINE>}<NEW_LINE>} catch (Exception x) {<NEW_LINE>failLog(type, "Error reading spi configuration file", x);<NEW_LINE>} finally {<NEW_LINE>try {<NEW_LINE>if (reader != null) {<NEW_LINE>reader.close();<NEW_LINE>}<NEW_LINE>if (inputStream != null) {<NEW_LINE>inputStream.close();<NEW_LINE>}<NEW_LINE>} catch (IOException y) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
failLog(type, "Error closing spi configuration file", y);
1,103,860
public PayResponse pay(PayRequest request) {<NEW_LINE>AliPayTradeCreateRequest payRequest = new AliPayTradeCreateRequest();<NEW_LINE>payRequest.setMethod(AliPayConstants.ALIPAY_TRADE_APP_PAY);<NEW_LINE>payRequest.setAppId(aliPayConfig.getAppId());<NEW_LINE>payRequest.setTimestamp(LocalDateTime.now().format(formatter));<NEW_LINE>payRequest.setNotifyUrl(aliPayConfig.getNotifyUrl());<NEW_LINE>AliPayTradeCreateRequest.BizContent bizContent = new AliPayTradeCreateRequest.BizContent();<NEW_LINE>bizContent.setOutTradeNo(request.getOrderId());<NEW_LINE>bizContent.setTotalAmount(request.getOrderAmount());<NEW_LINE>bizContent.setSubject(request.getOrderName());<NEW_LINE>bizContent.setIsAsyncPay(true);<NEW_LINE>payRequest.setBizContent(JsonUtil.toJsonWithUnderscores(bizContent)<MASK><NEW_LINE>payRequest.setSign(AliPaySignature.sign(MapUtil.object2MapWithUnderline(payRequest), aliPayConfig.getPrivateKey()));<NEW_LINE>PayResponse payResponse = new PayResponse();<NEW_LINE>payResponse.setOrderInfo(MapUtil.toUrlWithSortAndEncode(MapUtil.removeEmptyKeyAndValue(MapUtil.object2MapWithUnderline(payRequest))));<NEW_LINE>return payResponse;<NEW_LINE>}
.replaceAll("\\s*", ""));
1,454,057
public static void deleteGlobalEdgeComment(final AbstractSQLProvider provider, final INaviEdge edge, final Integer commentId, final Integer userId) throws CouldntDeleteException {<NEW_LINE>Preconditions.checkNotNull(provider, "IE00505: provider argument can not be null");<NEW_LINE>Preconditions.checkNotNull(edge, "IE00506: codeNode argument can not be null");<NEW_LINE>Preconditions.checkNotNull(commentId, "IE00507: comment argument can not be null");<NEW_LINE>Preconditions.checkNotNull(userId, "IE00508: userId argument can not be null");<NEW_LINE>final String function = " { ? = call delete_global_edge_comment(?, ?, ?, ?, ?, ?) } ";<NEW_LINE>try {<NEW_LINE>final CallableStatement deleteCommentFunction = provider.getConnection().getConnection().prepareCall(function);<NEW_LINE>try {<NEW_LINE>deleteCommentFunction.registerOutParameter(1, Types.INTEGER);<NEW_LINE>deleteCommentFunction.setInt(2, getModuleId(edge.getSource()));<NEW_LINE>deleteCommentFunction.setInt(3, getModuleId(edge.getTarget()));<NEW_LINE>deleteCommentFunction.setObject(4, ((INaviCodeNode) edge.getSource()).getAddress().toBigInteger(), Types.BIGINT);<NEW_LINE>deleteCommentFunction.setObject(5, ((INaviCodeNode) edge.getTarget()).getAddress().toBigInteger(), Types.BIGINT);<NEW_LINE><MASK><NEW_LINE>deleteCommentFunction.setInt(7, userId);<NEW_LINE>deleteCommentFunction.execute();<NEW_LINE>deleteCommentFunction.getInt(1);<NEW_LINE>if (deleteCommentFunction.wasNull()) {<NEW_LINE>throw new IllegalArgumentException("Error: the comment id returned from the database was null");<NEW_LINE>}<NEW_LINE>} finally {<NEW_LINE>deleteCommentFunction.close();<NEW_LINE>}<NEW_LINE>} catch (SQLException | MaybeNullException exception) {<NEW_LINE>throw new CouldntDeleteException(exception);<NEW_LINE>}<NEW_LINE>}
deleteCommentFunction.setInt(6, commentId);
424,076
private static serverObjects putBlogEntry(final serverObjects prop, final BlogBoard.BlogEntry entry, final String context, final int number, final boolean hasRights, final boolean xml) {<NEW_LINE>prop.putHTML("mode_entries_" + number + "_subject", UTF8.String(entry.getSubject()));<NEW_LINE>prop.putHTML("mode_entries_" + number + "_author", UTF8.String(entry.getAuthor()));<NEW_LINE>// comments<NEW_LINE>if (entry.getCommentMode() == 0) {<NEW_LINE>prop.put("mode_entries_" + number + "_commentsactive", "0");<NEW_LINE>} else {<NEW_LINE>prop.put("mode_entries_" + number + "_commentsactive", "1");<NEW_LINE>prop.put("mode_entries_" + number + "_commentsactive_pageid", entry.getKey());<NEW_LINE>prop.put("mode_entries_" + number + "_commentsactive_context", context);<NEW_LINE>prop.put("mode_entries_" + number + "_commentsactive_comments", entry.getCommentsSize());<NEW_LINE>}<NEW_LINE>prop.put("mode_entries_" + number + "_date", dateString(entry.getDate()));<NEW_LINE>prop.put("mode_entries_" + number + "_rfc822date", HeaderFramework.formatRFC1123(entry.getDate()));<NEW_LINE>prop.put("mode_entries_" + number + "_pageid", entry.getKey());<NEW_LINE>prop.put("mode_entries_" + number + "_context", context);<NEW_LINE>prop.put("mode_entries_" + number + "_ip", entry.getIp());<NEW_LINE>if (xml) {<NEW_LINE>prop.put("mode_entries_" + number + "_page", entry.getPage());<NEW_LINE>prop.put("mode_entries_" + number + <MASK><NEW_LINE>} else {<NEW_LINE>prop.putWiki("mode_entries_" + number + "_page", entry.getPage());<NEW_LINE>}<NEW_LINE>if (hasRights) {<NEW_LINE>prop.put("mode_entries_" + number + "_admin", "1");<NEW_LINE>prop.put("mode_entries_" + number + "_admin_pageid", entry.getKey());<NEW_LINE>} else {<NEW_LINE>prop.put("mode_entries_" + number + "_admin", "0");<NEW_LINE>}<NEW_LINE>return prop;<NEW_LINE>}
"_timestamp", entry.getTimestamp());
166,612
public void marshall(ComplianceItem complianceItem, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (complianceItem == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(complianceItem.getComplianceType(), COMPLIANCETYPE_BINDING);<NEW_LINE>protocolMarshaller.marshall(complianceItem.getResourceType(), RESOURCETYPE_BINDING);<NEW_LINE>protocolMarshaller.marshall(<MASK><NEW_LINE>protocolMarshaller.marshall(complianceItem.getId(), ID_BINDING);<NEW_LINE>protocolMarshaller.marshall(complianceItem.getTitle(), TITLE_BINDING);<NEW_LINE>protocolMarshaller.marshall(complianceItem.getStatus(), STATUS_BINDING);<NEW_LINE>protocolMarshaller.marshall(complianceItem.getSeverity(), SEVERITY_BINDING);<NEW_LINE>protocolMarshaller.marshall(complianceItem.getExecutionSummary(), EXECUTIONSUMMARY_BINDING);<NEW_LINE>protocolMarshaller.marshall(complianceItem.getDetails(), DETAILS_BINDING);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>}
complianceItem.getResourceId(), RESOURCEID_BINDING);
1,814,156
public StarlarkCallable rule(StarlarkFunction implementation, Boolean test, Object attrs, Object implicitOutputs, Boolean executable, Boolean outputToGenfiles, Sequence<?> fragments, Sequence<?> hostFragments, Boolean starlarkTestable, Sequence<?> toolchains, boolean useToolchainTransition, String doc, Sequence<?> providesArg, Sequence<?> execCompatibleWith, Object analysisTest, Object buildSetting, Object cfg, Object execGroups, Object compileOneFiletype, Object name, StarlarkThread thread) throws EvalException {<NEW_LINE>ImmutableMap.Builder<String, FakeDescriptor> attrsMapBuilder = ImmutableMap.builder();<NEW_LINE>if (attrs != null && attrs != Starlark.NONE) {<NEW_LINE>attrsMapBuilder.putAll(Dict.cast(attrs, String.class<MASK><NEW_LINE>}<NEW_LINE>attrsMapBuilder.put("name", IMPLICIT_NAME_ATTRIBUTE_DESCRIPTOR);<NEW_LINE>List<AttributeInfo> attrInfos = attrsMapBuilder.build().entrySet().stream().filter(entry -> !entry.getKey().startsWith("_")).map(entry -> entry.getValue().asAttributeInfo(entry.getKey())).collect(Collectors.toList());<NEW_LINE>attrInfos.sort(new AttributeNameComparator());<NEW_LINE>RuleDefinitionIdentifier functionIdentifier = new RuleDefinitionIdentifier();<NEW_LINE>// Only the Builder is passed to RuleInfoWrapper as the rule name may not be available yet.<NEW_LINE>RuleInfo.Builder ruleInfo = RuleInfo.newBuilder().setDocString(doc).addAllAttribute(attrInfos);<NEW_LINE>if (name != Starlark.NONE) {<NEW_LINE>ruleInfo.setRuleName((String) name);<NEW_LINE>}<NEW_LINE>Location loc = thread.getCallerLocation();<NEW_LINE>ruleInfoList.add(new RuleInfoWrapper(functionIdentifier, loc, ruleInfo));<NEW_LINE>return functionIdentifier;<NEW_LINE>}
, FakeDescriptor.class, "attrs"));
1,554,070
public void startServer() throws Exception {<NEW_LINE>IndexListServlet indexList = new IndexListServlet();<NEW_LINE>if (this.bindAddress != null) {<NEW_LINE>this.server = new Server(new InetSocketAddress(InetAddress.getByName(this.bindAddress), port));<NEW_LINE>} else {<NEW_LINE>this.server = new Server(this.port);<NEW_LINE>}<NEW_LINE>ServletContextHandler handler = new ServletContextHandler(this.server, pathPrefix);<NEW_LINE>handler.addServlet(new ServletHolder(indexList), "/");<NEW_LINE>if (metricsRegistries != null) {<NEW_LINE>// TODO: there is a way to wire these up automagically via the AdminServlet, but it escapes me right now<NEW_LINE>handler.addServlet(new ServletHolder(new MetricsServlet(<MASK><NEW_LINE>handler.addServlet(new ServletHolder(new io.prometheus.client.exporter.MetricsServlet()), "/prometheus");<NEW_LINE>handler.addServlet(new ServletHolder(new HealthCheckServlet(metricsRegistries.healthCheckRegistry)), "/healthcheck");<NEW_LINE>handler.addServlet(new ServletHolder(new PingServlet()), "/ping");<NEW_LINE>indexList.addLink("/metrics", "codahale metrics");<NEW_LINE>indexList.addLink("/prometheus", "prometheus metrics");<NEW_LINE>indexList.addLink("/healthcheck", "healthcheck endpoint");<NEW_LINE>indexList.addLink("/ping", "ping me");<NEW_LINE>}<NEW_LINE>if (this.context.getConfig().enableHttpConfig) {<NEW_LINE>handler.addServlet(new ServletHolder(new MaxwellConfigServlet(this.context)), "/config");<NEW_LINE>indexList.addLink("/config", "POST endpoing to update maxwell config.");<NEW_LINE>}<NEW_LINE>if (diagnosticContext != null) {<NEW_LINE>handler.addServlet(new ServletHolder(new DiagnosticHealthCheck(diagnosticContext)), "/diagnostic");<NEW_LINE>indexList.addLink("/diagnostic", "deeper diagnostic health checks");<NEW_LINE>}<NEW_LINE>this.server.start();<NEW_LINE>this.server.join();<NEW_LINE>}
metricsRegistries.metricRegistry)), "/metrics");
1,656,587
private static String optionsValue(final String agentArgsText) throws FileNotFoundException, IOException {<NEW_LINE>if (agentArgsText == null) {<NEW_LINE>throw new IllegalArgumentException();<NEW_LINE>}<NEW_LINE>if (!agentArgsText.startsWith(CLIBootstrap.FILE_OPTIONS_INTRODUCER)) {<NEW_LINE>return agentArgsText;<NEW_LINE>}<NEW_LINE>final File argsFile = new File(agentArgsText.substring(CLIBootstrap<MASK><NEW_LINE>final LineNumberReader reader = new LineNumberReader(new FileReader(argsFile));<NEW_LINE>final String result;<NEW_LINE>try {<NEW_LINE>result = reader.readLine();<NEW_LINE>} finally {<NEW_LINE>reader.close();<NEW_LINE>}<NEW_LINE>if (Boolean.getBoolean("keep.argsfile")) {<NEW_LINE>System.err.println("Agent arguments file retained: " + argsFile.getAbsolutePath());<NEW_LINE>} else {<NEW_LINE>if (!argsFile.delete()) {<NEW_LINE>logger.log(Level.FINE, "Unable to delete temporary args file {0}; continuing", argsFile.getAbsolutePath());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>}
.FILE_OPTIONS_INTRODUCER.length()));
389,070
public static void onEnter(@Advice.Origin Method originMethod, @Advice.Local("otelMethod") Method method, @Advice.AllArguments(typing = Assigner.Typing.DYNAMIC) Object[] args, @Advice.Local("otelOperationEndSupport") AsyncOperationEndSupport<MethodRequest, Object> operationEndSupport, @Advice.Local("otelRequest") MethodRequest request, @Advice.Local("otelContext") Context context, @Advice.Local("otelScope") Scope scope) {<NEW_LINE>// Every usage of @Advice.Origin Method is replaced with a call to Class.getMethod, copy it<NEW_LINE>// to local variable so that there would be only one call to Class.getMethod.<NEW_LINE>method = originMethod;<NEW_LINE>Instrumenter<MethodRequest, Object> instrumenter = instrumenterWithAttributes();<NEW_LINE>Context current = Java8BytecodeBridge.currentContext();<NEW_LINE>request <MASK><NEW_LINE>if (instrumenter.shouldStart(current, request)) {<NEW_LINE>context = instrumenter.start(current, request);<NEW_LINE>scope = context.makeCurrent();<NEW_LINE>operationEndSupport = AsyncOperationEndSupport.create(instrumenter, Object.class, method.getReturnType());<NEW_LINE>}<NEW_LINE>}
= new MethodRequest(method, args);
945,978
public boolean configure(FeatureContext context) {<NEW_LINE>final boolean disabled = PropertiesHelper.isProperty(context.getConfiguration().getProperty(ServerProperties.WADL_FEATURE_DISABLE));<NEW_LINE>if (disabled) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>if (!ReflectionHelper.isJaxbAvailable()) {<NEW_LINE>LOGGER.warning(LocalizationMessages.WADL_FEATURE_DISABLED_NOJAXB());<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>if (!ReflectionHelper.isXmlTransformAvailable()) {<NEW_LINE>LOGGER.<MASK><NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>if (!WadlApplicationContextImpl.isJaxbImplAvailable()) {<NEW_LINE>LOGGER.warning(LocalizationMessages.WADL_FEATURE_DISABLED());<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>context.register(WadlModelProcessor.class);<NEW_LINE>context.register(new AbstractBinder() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>protected void configure() {<NEW_LINE>bind(WadlApplicationContextImpl.class).to(WadlApplicationContext.class).in(Singleton.class);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>return true;<NEW_LINE>}
warning(LocalizationMessages.WADL_FEATURE_DISABLED_NOTRANSFORM());
684,700
public static List<Class<?>> findAllImplementations(Class<?> restrictionClass, boolean everything) {<NEW_LINE>if (restrictionClass == null) {<NEW_LINE>return Collections.emptyList();<NEW_LINE>}<NEW_LINE>// Default is served from the registry<NEW_LINE>if (!everything) {<NEW_LINE>return findAllImplementations(restrictionClass);<NEW_LINE>}<NEW_LINE>// This codepath is used by utility classes to also find buggy<NEW_LINE>// implementations (e.g. non-instantiable, abstract) of the interfaces.<NEW_LINE>List<Class<?>> known = findAllImplementations(restrictionClass);<NEW_LINE>// For quickly skipping seen entries:<NEW_LINE>HashSet<Class<?>> dupes <MASK><NEW_LINE>for (Iterator<Class<?>> iter = ELKIServiceScanner.nonindexedClasses(); iter.hasNext(); ) {<NEW_LINE>Class<?> cls = iter.next();<NEW_LINE>if (dupes.contains(cls)) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (!restrictionClass.isAssignableFrom(cls)) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>known.add(cls);<NEW_LINE>dupes.add(cls);<NEW_LINE>}<NEW_LINE>return known;<NEW_LINE>}
= new HashSet<>(known);
1,327,452
private void initUserComponents() {<NEW_LINE>GridBagConstraints gridBagConstraints;<NEW_LINE>// panel parameters<NEW_LINE>setLayout(new GridBagLayout());<NEW_LINE>setBorder(new EmptyBorder(new Insets(5, 5, 0, 5)));<NEW_LINE>setPreferredSize(new Dimension(preferredWidth, 22 * fieldEntries.size() + 8));<NEW_LINE>for (int i = 0; i < fieldEntries.size(); i++) {<NEW_LINE>GenericTableModel.TableEntry entry = (GenericTableModel.<MASK><NEW_LINE>JLabel requiredMark = new JLabel();<NEW_LINE>JLabel label = new JLabel();<NEW_LINE>textFields[i] = new JTextField();<NEW_LINE>// First control is either empty label or '*' label to mark required<NEW_LINE>// field.<NEW_LINE>if (entry.isRequiredField()) {<NEW_LINE>// NOI18N<NEW_LINE>requiredMark.setText(bundle.getString("LBL_RequiredMark"));<NEW_LINE>// NOI18N<NEW_LINE>requiredMark.getAccessibleContext().setAccessibleName(bundle.getString("ACSN_RequiredMark"));<NEW_LINE>// NOI18N<NEW_LINE>requiredMark.getAccessibleContext().setAccessibleDescription(bundle.getString("ACSD_RequiredMark"));<NEW_LINE>}<NEW_LINE>requiredMark.setLabelFor(textFields[i]);<NEW_LINE>gridBagConstraints = new GridBagConstraints();<NEW_LINE>gridBagConstraints.anchor = GridBagConstraints.WEST;<NEW_LINE>gridBagConstraints.insets = new Insets(0, 0, 4, 4);<NEW_LINE>add(requiredMark, gridBagConstraints);<NEW_LINE>// Initialize and add label<NEW_LINE>label.setLabelFor(textFields[i]);<NEW_LINE>// NOI18N<NEW_LINE>label.setText(entry.getLabelName());<NEW_LINE>label.setDisplayedMnemonic(entry.getLabelMnemonic());<NEW_LINE>gridBagConstraints = new GridBagConstraints();<NEW_LINE>gridBagConstraints.anchor = GridBagConstraints.WEST;<NEW_LINE>gridBagConstraints.insets = new Insets(0, 0, 4, 4);<NEW_LINE>add(label, gridBagConstraints);<NEW_LINE>// Initialize and add text field<NEW_LINE>textFields[i].addKeyListener(new TextFieldHandler(textFields[i], i));<NEW_LINE>textFields[i].getAccessibleContext().setAccessibleName(entry.getAccessibleName());<NEW_LINE>textFields[i].getAccessibleContext().setAccessibleDescription(entry.getAccessibleDescription());<NEW_LINE>gridBagConstraints = new GridBagConstraints();<NEW_LINE>gridBagConstraints.gridwidth = GridBagConstraints.REMAINDER;<NEW_LINE>gridBagConstraints.fill = GridBagConstraints.HORIZONTAL;<NEW_LINE>gridBagConstraints.weightx = 1.0;<NEW_LINE>gridBagConstraints.insets = new Insets(0, 0, 4, 0);<NEW_LINE>add(textFields[i], gridBagConstraints);<NEW_LINE>}<NEW_LINE>}
TableEntry) fieldEntries.get(i);
712,508
public ViewHolderShareContacts onCreateViewHolder(ViewGroup parent, int viewType) {<NEW_LINE>LayoutInflater inflater = (LayoutInflater) mContext.getSystemService(Context.LAYOUT_INFLATER_SERVICE);<NEW_LINE>Display display = ((Activity) mContext).getWindowManager().getDefaultDisplay();<NEW_LINE>DisplayMetrics outMetrics = new DisplayMetrics();<NEW_LINE>display.getMetrics(outMetrics);<NEW_LINE>View rowView = inflater.inflate(R.layout.item_contact_share, parent, false);<NEW_LINE>ViewHolderShareContacts holder = new ViewHolderShareContacts(rowView);<NEW_LINE>holder.itemProgress = rowView.findViewById(R.id.item_progress);<NEW_LINE>holder.itemHeader = rowView.findViewById(R.id.header);<NEW_LINE>holder.textHeader = rowView.findViewById(R.id.text_header);<NEW_LINE>holder.itemLayout = rowView.<MASK><NEW_LINE>holder.contactNameTextView = rowView.findViewById(R.id.contact_name);<NEW_LINE>if (!isScreenInPortrait(mContext)) {<NEW_LINE>float width = TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, MAX_WIDTH_CONTACT_NAME_LAND, mContext.getResources().getDisplayMetrics());<NEW_LINE>holder.contactNameTextView.setMaxWidthEmojis((int) width);<NEW_LINE>} else {<NEW_LINE>float width = TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, MAX_WIDTH_CONTACT_NAME_PORT, mContext.getResources().getDisplayMetrics());<NEW_LINE>holder.contactNameTextView.setMaxWidthEmojis((int) width);<NEW_LINE>}<NEW_LINE>holder.emailTextView = rowView.findViewById(R.id.contact_mail);<NEW_LINE>holder.avatar = rowView.findViewById(R.id.contact_avatar);<NEW_LINE>holder.verifiedIcon = rowView.findViewById(R.id.verified_icon);<NEW_LINE>holder.contactStateIcon = rowView.findViewById(R.id.contact_state);<NEW_LINE>return holder;<NEW_LINE>}
findViewById(R.id.item_content);
760,582
public void generateVarLoad(MethodVisitor mv, BIRNode.BIRVariableDcl varDcl, int valueIndex) {<NEW_LINE>BType bType = <MASK><NEW_LINE>switch(varDcl.kind) {<NEW_LINE>case GLOBAL:<NEW_LINE>{<NEW_LINE>BIRNode.BIRGlobalVariableDcl globalVar = (BIRNode.BIRGlobalVariableDcl) varDcl;<NEW_LINE>String moduleName = JvmCodeGenUtil.getPackageName(globalVar.pkgId);<NEW_LINE>String varName = varDcl.name.value;<NEW_LINE>String className = jvmPackageGen.lookupGlobalVarClassName(moduleName, varName);<NEW_LINE>String typeSig = getTypeDesc(bType);<NEW_LINE>mv.visitFieldInsn(GETSTATIC, className, varName, typeSig);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>case SELF:<NEW_LINE>mv.visitVarInsn(ALOAD, 0);<NEW_LINE>return;<NEW_LINE>case CONSTANT:<NEW_LINE>{<NEW_LINE>String varName = varDcl.name.value;<NEW_LINE>PackageID moduleId = ((BIRNode.BIRGlobalVariableDcl) varDcl).pkgId;<NEW_LINE>String pkgName = JvmCodeGenUtil.getPackageName(moduleId);<NEW_LINE>String className = jvmPackageGen.lookupGlobalVarClassName(pkgName, varName);<NEW_LINE>String typeSig = getTypeDesc(bType);<NEW_LINE>mv.visitFieldInsn(GETSTATIC, className, varName, typeSig);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>generateVarLoadForType(mv, bType, valueIndex);<NEW_LINE>}
JvmCodeGenUtil.getReferredType(varDcl.type);
146,484
private MethodTree createHashCodeMethod(WorkingCopy wc, DeclaredType type) {<NEW_LINE>TreeMaker make = wc.getTreeMaker();<NEW_LINE>Set<Modifier> mods = EnumSet.of(Modifier.PUBLIC);<NEW_LINE>// Used in test code<NEW_LINE>Integer number = refactoring.getContext().lookup(Integer.class);<NEW_LINE>int startNumber;<NEW_LINE>int multiplyNumber;<NEW_LINE>if (number != null) {<NEW_LINE>startNumber = number.intValue();<NEW_LINE>multiplyNumber = number.intValue();<NEW_LINE>} else {<NEW_LINE>startNumber = generatePrimeNumber(2, 10);<NEW_LINE>multiplyNumber = generatePrimeNumber(10, 100);<NEW_LINE>}<NEW_LINE>List<StatementTree> statements = new ArrayList<>();<NEW_LINE>// int hash = <startNumber>;<NEW_LINE>// NOI18N<NEW_LINE>statements.add(make.Variable(make.Modifiers(EnumSet.noneOf(Modifier.class)), "hash", make.PrimitiveType(TypeKind.INT), make.Literal(startNumber)));<NEW_LINE>TypeMirror tm = type;<NEW_LINE>// NOI18N<NEW_LINE>ExpressionTree variableRead = prepareExpression(wc, HASH_CODE_PATTERNS, tm, "delegate");<NEW_LINE>// NOI18N<NEW_LINE>statements.add(make.ExpressionStatement(make.Assignment(make.Identifier("hash"), make.Binary(Tree.Kind.PLUS, make.Binary(Tree.Kind.MULTIPLY, make.Literal(multiplyNumber), make.Identifier("hash")), variableRead))));<NEW_LINE>// NOI18N<NEW_LINE>statements.add(make.Return(make.Identifier("hash")));<NEW_LINE>BlockTree body = make.Block(statements, false);<NEW_LINE>ModifiersTree modifiers = prepareModifiers(wc, mods, make, true);<NEW_LINE>// NOI18N<NEW_LINE>return make.Method(modifiers, "hashCode", make.PrimitiveType(TypeKind.INT), Collections.<TypeParameterTree>emptyList(), Collections.<VariableTree>emptyList(), Collections.<ExpressionTree><MASK><NEW_LINE>}
emptyList(), body, null);
514,972
public Expression optimize(SessionLocal session) {<NEW_LINE><MASK><NEW_LINE>boolean constant = !whenOperand && left.isConstant();<NEW_LINE>if (constant && left.isNullConstant()) {<NEW_LINE>return TypedValueExpression.UNKNOWN;<NEW_LINE>}<NEW_LINE>boolean allValuesConstant = true;<NEW_LINE>boolean allValuesNull = true;<NEW_LINE>TypeInfo leftType = left.getType();<NEW_LINE>for (int i = 0, l = valueList.size(); i < l; i++) {<NEW_LINE>Expression e = valueList.get(i);<NEW_LINE>e = e.optimize(session);<NEW_LINE>TypeInfo.checkComparable(leftType, e.getType());<NEW_LINE>if (e.isConstant() && !e.getValue(session).containsNull()) {<NEW_LINE>allValuesNull = false;<NEW_LINE>}<NEW_LINE>if (allValuesConstant && !e.isConstant()) {<NEW_LINE>allValuesConstant = false;<NEW_LINE>}<NEW_LINE>if (left instanceof ExpressionColumn && e instanceof Parameter) {<NEW_LINE>((Parameter) e).setColumn(((ExpressionColumn) left).getColumn());<NEW_LINE>}<NEW_LINE>valueList.set(i, e);<NEW_LINE>}<NEW_LINE>return optimize2(session, constant, allValuesConstant, allValuesNull, valueList);<NEW_LINE>}
left = left.optimize(session);
646,695
public void marshall(ReservationPurchaseRecommendation reservationPurchaseRecommendation, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (reservationPurchaseRecommendation == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(reservationPurchaseRecommendation.getAccountScope(), ACCOUNTSCOPE_BINDING);<NEW_LINE>protocolMarshaller.marshall(reservationPurchaseRecommendation.getLookbackPeriodInDays(), LOOKBACKPERIODINDAYS_BINDING);<NEW_LINE>protocolMarshaller.marshall(<MASK><NEW_LINE>protocolMarshaller.marshall(reservationPurchaseRecommendation.getPaymentOption(), PAYMENTOPTION_BINDING);<NEW_LINE>protocolMarshaller.marshall(reservationPurchaseRecommendation.getServiceSpecification(), SERVICESPECIFICATION_BINDING);<NEW_LINE>protocolMarshaller.marshall(reservationPurchaseRecommendation.getRecommendationDetails(), RECOMMENDATIONDETAILS_BINDING);<NEW_LINE>protocolMarshaller.marshall(reservationPurchaseRecommendation.getRecommendationSummary(), RECOMMENDATIONSUMMARY_BINDING);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>}
reservationPurchaseRecommendation.getTermInYears(), TERMINYEARS_BINDING);
1,560,864
public int compare(PolicyStats p1, PolicyStats p2) {<NEW_LINE>Metric metric1 = p1.metrics().get(header);<NEW_LINE>Metric metric2 = p2.metrics().get(header);<NEW_LINE>if (metric1 == null) {<NEW_LINE>return (metric2 == null) ? 0 : -1;<NEW_LINE>} else if (metric2 == null) {<NEW_LINE>return 1;<NEW_LINE>} else if (metric1.value() instanceof LongSupplier) {<NEW_LINE>return Long.compare(((LongSupplier) metric1.value()).getAsLong(), ((LongSupplier) metric2.value()).getAsLong());<NEW_LINE>} else if (metric1.value() instanceof DoubleSupplier) {<NEW_LINE>return Double.compare(((DoubleSupplier) metric1.value()).getAsDouble(), ((DoubleSupplier) metric2.value()).getAsDouble());<NEW_LINE>} else if (metric1.value() instanceof Supplier) {<NEW_LINE>Object value1 = ((Supplier<?>) metric1.value()).get();<NEW_LINE>Object value2 = ((Supplier<?>) metric2.value()).get();<NEW_LINE>if (value1 instanceof Comparable<?>) {<NEW_LINE>@SuppressWarnings("unchecked")<NEW_LINE>Comparable<Object> comparator = (Comparable<Object>) value1;<NEW_LINE>return comparator.compareTo(value2);<NEW_LINE>}<NEW_LINE>return objectFormatter().apply(value1).compareTo(objectFormatter<MASK><NEW_LINE>}<NEW_LINE>return objectFormatter().apply(metric1.value()).compareTo(objectFormatter().apply(metric2.value()));<NEW_LINE>}
().apply(value2));
1,340,537
public DropGraph visit(final ASTDrop node, final Object data) throws VisitorException {<NEW_LINE>final DropGraph op = new DropGraph();<NEW_LINE>if (node.isSilent())<NEW_LINE>op.setSilent(true);<NEW_LINE>final ASTGraphRefAll graphRef = <MASK><NEW_LINE>if (graphRef.jjtGetNumChildren() > 0) {<NEW_LINE>final TermNode targetGraph = (TermNode) graphRef.jjtGetChild(0).jjtAccept(this, data);<NEW_LINE>if (targetGraph instanceof ConstantNode) {<NEW_LINE>op.setTargetGraph((ConstantNode) targetGraph);<NEW_LINE>} else {<NEW_LINE>op.setTargetSolutionSet(targetGraph.getValueExpression().getName());<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>if (graphRef.isDefault()) {<NEW_LINE>op.setScope(Scope.DEFAULT_CONTEXTS);<NEW_LINE>} else if (graphRef.isNamed()) {<NEW_LINE>op.setScope(Scope.NAMED_CONTEXTS);<NEW_LINE>}<NEW_LINE>if (graphRef.isAllGraphs()) {<NEW_LINE>op.setAllGraphs(true);<NEW_LINE>}<NEW_LINE>if (graphRef.isAllSolutions()) {<NEW_LINE>op.setAllSolutionSets(true);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return op;<NEW_LINE>}
node.jjtGetChild(ASTGraphRefAll.class);
288,923
ActionResult<Wo> execute(EffectivePerson effectivePerson, String workId, String flag, boolean stream) throws Exception {<NEW_LINE>try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) {<NEW_LINE>ActionResult<Wo> result = new ActionResult<>();<NEW_LINE>Business business = new Business(emc);<NEW_LINE>Work work = emc.find(workId, Work.class);<NEW_LINE>if (work == null) {<NEW_LINE>WorkCompleted workCompleted = emc.find(workId, WorkCompleted.class);<NEW_LINE>if (null == workCompleted) {<NEW_LINE>throw new Exception("workId: " + workId + " not exist in work or workCompleted");<NEW_LINE>}<NEW_LINE>if (!business.readable(effectivePerson, workCompleted)) {<NEW_LINE>throw new ExceptionWorkCompletedAccessDenied(effectivePerson.getDistinguishedName(), workCompleted.getTitle(), workCompleted.getId());<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>if (!business.readable(effectivePerson, work)) {<NEW_LINE>throw new ExceptionAccessDenied(effectivePerson, work);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>Wo wo = null;<NEW_LINE>GeneralFile generalFile = emc.find(flag, GeneralFile.class);<NEW_LINE>if (generalFile != null) {<NEW_LINE>StorageMapping gfMapping = ThisApplication.context().storageMappings().get(GeneralFile.class, generalFile.getStorage());<NEW_LINE>wo = new Wo(generalFile.readContent(gfMapping), this.contentType(stream, generalFile.getName()), this.contentDisposition(stream, generalFile.getName()));<NEW_LINE>generalFile.deleteContent(gfMapping);<NEW_LINE>emc.beginTransaction(GeneralFile.class);<NEW_LINE>emc.delete(GeneralFile.<MASK><NEW_LINE>emc.commit();<NEW_LINE>}<NEW_LINE>result.setData(wo);<NEW_LINE>return result;<NEW_LINE>}<NEW_LINE>}
class, generalFile.getId());
646,896
private com.google.api.services.sheets.v4.model.CellData cellData2sheetCellData(CellData cellData) {<NEW_LINE>com.google.api.services.sheets.v4.model.CellData sheetCellData = new com.google.api.services.sheets.v4.model.CellData();<NEW_LINE>ExtendedValue ev = new ExtendedValue();<NEW_LINE>if (cellData != null) {<NEW_LINE>if (cellData.value instanceof String) {<NEW_LINE>ev.setStringValue((String) cellData.value);<NEW_LINE>} else if (cellData.value instanceof Integer) {<NEW_LINE>ev.setNumberValue(new Double((Integer) cellData.value));<NEW_LINE>} else if (cellData.value instanceof Double) {<NEW_LINE>ev.setNumberValue<MASK><NEW_LINE>} else if (cellData.value instanceof OffsetDateTime) {<NEW_LINE>// supposedly started internally as a double, but not sure how to transform correctly<NEW_LINE>// ev.setNumberValue((Double) cellData.value);<NEW_LINE>ev.setStringValue(cellData.value.toString());<NEW_LINE>} else if (cellData.value instanceof Boolean) {<NEW_LINE>ev.setBoolValue((Boolean) cellData.value);<NEW_LINE>} else if (cellData.value == null) {<NEW_LINE>ev.setStringValue("");<NEW_LINE>} else {<NEW_LINE>ev.setStringValue(cellData.value.toString());<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>ev.setStringValue("");<NEW_LINE>}<NEW_LINE>sheetCellData.setUserEnteredValue(ev);<NEW_LINE>return sheetCellData;<NEW_LINE>}
((Double) cellData.value);
51,868
public Pipeline createPipeline(final BuildCause buildCause, final PipelineConfig pipelineConfig, final SchedulingContext context, final String md5, final Clock clock) {<NEW_LINE>return (Pipeline) transactionTemplate.execute((TransactionCallback) status -> {<NEW_LINE>Pipeline pipeline = null;<NEW_LINE>if (shouldCancel(buildCause, pipelineConfig.name())) {<NEW_LINE><MASK><NEW_LINE>cancelSchedule(pipelineConfig.name());<NEW_LINE>} else {<NEW_LINE>try {<NEW_LINE>Pipeline newPipeline = instanceFactory.createPipelineInstance(pipelineConfig, buildCause, context, md5, clock);<NEW_LINE>pipeline = pipelineService.save(newPipeline);<NEW_LINE>finishSchedule(pipelineConfig.name(), buildCause, pipeline.getBuildCause());<NEW_LINE>LOGGER.debug("[Pipeline Schedule] Successfully scheduled pipeline {}, buildCause:{}, configOrigin: {}", pipelineConfig.name(), buildCause, pipelineConfig.getOrigin());<NEW_LINE>} catch (BuildCauseOutOfDateException e) {<NEW_LINE>cancelSchedule(pipelineConfig.name());<NEW_LINE>LOGGER.info("[Pipeline Schedule] Build cause {} is out of date. Scheduling is cancelled. Go will reschedule this pipeline. configOrigin: {}", buildCause, pipelineConfig.getOrigin());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return pipeline;<NEW_LINE>});<NEW_LINE>}
LOGGER.debug("[Pipeline Schedule] Cancelling scheduling as build cause {} is the same as the most recent schedule", buildCause);
703,804
private static void appendInt9(CharSink sink, int i) {<NEW_LINE>int c;<NEW_LINE>sink.put((char) ('0' + i / 100000000));<NEW_LINE>sink.put((char) ('0' + (c = <MASK><NEW_LINE>sink.put((char) ('0' + (c %= 10000000) / 1000000));<NEW_LINE>sink.put((char) ('0' + (c %= 1000000) / 100000));<NEW_LINE>sink.put((char) ('0' + (c %= 100000) / 10000));<NEW_LINE>sink.put((char) ('0' + (c %= 10000) / 1000));<NEW_LINE>sink.put((char) ('0' + (c %= 1000) / 100));<NEW_LINE>sink.put((char) ('0' + (c %= 100) / 10));<NEW_LINE>sink.put((char) ('0' + (c % 10)));<NEW_LINE>}
i % 100000000) / 10000000));