idx int32 46 1.86M | input stringlengths 321 6.6k | target stringlengths 9 1.24k |
|---|---|---|
442,007 | private void enterRoom() {<NEW_LINE>mTRTCCloud = TRTCCloud.sharedInstance(getApplicationContext());<NEW_LINE>mTRTCCloud.setListener(new TRTCCloudImplListener(ScreenAnchorActivity.this));<NEW_LINE>final TRTCCloudDef.TRTCParams screenParams = new TRTCCloudDef.TRTCParams();<NEW_LINE>screenParams.sdkAppId = GenerateTestUserSig.SDKAPPID;<NEW_LINE>screenParams.userId = mUserId;<NEW_LINE>screenParams.<MASK><NEW_LINE>screenParams.userSig = GenerateTestUserSig.genTestUserSig(screenParams.userId);<NEW_LINE>screenParams.role = TRTCRoleAnchor;<NEW_LINE>mTRTCCloud.startLocalAudio(TRTCCloudDef.TRTC_AUDIO_QUALITY_DEFAULT);<NEW_LINE>mTRTCCloud.enterRoom(screenParams, TRTC_APP_SCENE_VIDEOCALL);<NEW_LINE>String text = getString(R.string.screenshare_room_id) + mRoomId + "\n" + getString(R.string.screenshare_username) + mUserId + "\n" + getString(R.string.screenshare_resolution) + "\n" + getString(R.string.screenshare_watch_tips);<NEW_LINE>mTextScreenCaptureInfo.setVisibility(View.VISIBLE);<NEW_LINE>mTextScreenCaptureInfo.setText(text);<NEW_LINE>} | roomId = Integer.parseInt(mRoomId); |
512,835 | public static void convert(GrayU16 input, GrayF64 output) {<NEW_LINE>if (input.isSubimage() || output.isSubimage()) {<NEW_LINE>// CONCURRENT_BELOW BoofConcurrency.loopFor(0, input.height, y -> {<NEW_LINE>for (int y = 0; y < input.height; y++) {<NEW_LINE>int indexSrc = input.getIndex(0, y);<NEW_LINE>int indexDst = output.getIndex(0, y);<NEW_LINE>for (int x = 0; x < input.width; x++) {<NEW_LINE>output.data[indexDst++] = (double) (input.<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>// CONCURRENT_ABOVE });<NEW_LINE>} else {<NEW_LINE>final int N = input.width * input.height;<NEW_LINE>// CONCURRENT_BELOW BoofConcurrency.loopBlocks(0,N,(i0,i1)->{<NEW_LINE>int i0 = 0, i1 = N;<NEW_LINE>for (int i = i0; i < i1; i++) {<NEW_LINE>output.data[i] = (double) (input.data[i] & 0xFFFF);<NEW_LINE>}<NEW_LINE>// CONCURRENT_INLINE });<NEW_LINE>}<NEW_LINE>} | data[indexSrc++] & 0xFFFF); |
1,668,823 | private void validateUserForAssetUpdate(String userId, EntityDetail originalAssetEntity, InstanceProperties updatedAssetProperties, InstanceStatus newInstanceStatus, String methodName) throws UserNotAuthorizedException {<NEW_LINE>Asset originalAsset = this.getAssetBeanFromEntity(originalAssetEntity, methodName);<NEW_LINE>AssetAuditHeader assetAuditHeader = new AssetAuditHeader();<NEW_LINE>assetAuditHeader.setCreatedBy(originalAssetEntity.getCreatedBy());<NEW_LINE>assetAuditHeader.setCreateTime(originalAssetEntity.getCreateTime());<NEW_LINE>assetAuditHeader.setMaintainedBy(originalAssetEntity.getMaintainedBy());<NEW_LINE>assetAuditHeader.<MASK><NEW_LINE>assetAuditHeader.setUpdateTime(originalAssetEntity.getUpdateTime());<NEW_LINE>assetAuditHeader.setVersion(assetAuditHeader.getVersion());<NEW_LINE>EntityDetail updatedAssetEntity = new EntityDetail(originalAssetEntity);<NEW_LINE>updatedAssetEntity.setProperties(updatedAssetProperties);<NEW_LINE>updatedAssetEntity.setStatus(newInstanceStatus);<NEW_LINE>Asset updatedAsset = this.getAssetBeanFromEntity(updatedAssetEntity, methodName);<NEW_LINE>securityVerifier.validateUserForAssetDetailUpdate(userId, originalAsset, assetAuditHeader, updatedAsset);<NEW_LINE>} | setUpdatedBy(originalAssetEntity.getUpdatedBy()); |
1,685,636 | private Object initItem(Class clazz, String[] fieldDef, int startIndex) throws Exception {<NEW_LINE>HashMap<String, Field> cache = mFieldCache.get(clazz);<NEW_LINE>if (cache == null) {<NEW_LINE>cache = new HashMap<>();<NEW_LINE>Class c = clazz;<NEW_LINE>while (c != null) {<NEW_LINE>for (Field f : c.getDeclaredFields()) {<NEW_LINE>f.setAccessible(true);<NEW_LINE>cache.put(f.getName(), f);<NEW_LINE>}<NEW_LINE>c = c.getSuperclass();<NEW_LINE>}<NEW_LINE>mFieldCache.put(clazz, cache);<NEW_LINE>}<NEW_LINE>Object item = clazz.newInstance();<NEW_LINE>for (int i = startIndex; i < fieldDef.length; i++) {<NEW_LINE>String[] fieldData = fieldDef[i].split("=", 2);<NEW_LINE>Field f = cache.get(fieldData[0]);<NEW_LINE>Class type = f.getType();<NEW_LINE>if (type == int.class || type == long.class) {<NEW_LINE>f.set(item, Integer.parseInt(fieldData[1]));<NEW_LINE>} else if (type == CharSequence.class || type == String.class) {<NEW_LINE>f.set(item, fieldData[1]);<NEW_LINE>} else if (type == Intent.class) {<NEW_LINE>if (!fieldData[1].startsWith("#Intent")) {<NEW_LINE>fieldData[1] = "#Intent;" + fieldData[1] + ";end";<NEW_LINE>}<NEW_LINE>f.set(item, Intent.parseUri(fieldData[1], 0));<NEW_LINE>} else if (type == ComponentName.class) {<NEW_LINE>f.set(item, ComponentName.<MASK><NEW_LINE>} else {<NEW_LINE>throw new Exception("Added parsing logic for " + f.getName() + " of type " + f.getType());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return item;<NEW_LINE>} | unflattenFromString(fieldData[1])); |
1,613,180 | private boolean modifyLanguage(DomainFile df, DBHandle dbh) throws IOException, ImproperUseException {<NEW_LINE>// TODO: Check for address map and overlay entries which could break from<NEW_LINE>// changing the memory model !!<NEW_LINE>Table table = dbh.getTable(TABLE_NAME);<NEW_LINE>if (table == null) {<NEW_LINE>Msg.showError(getClass(), null, "Script Error", "Bad program database!!");<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>DBRecord record = table.getRecord(new StringField(LANGUAGE_ID));<NEW_LINE>if (record == null) {<NEW_LINE>// must be in old style combined language/compiler spec format<NEW_LINE>Msg.showError(getClass(<MASK><NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>String langId = record.getString(0);<NEW_LINE>LanguageDescription desc = null;<NEW_LINE>List<LanguageDescription> descriptions = DefaultLanguageService.getLanguageService().getLanguageDescriptions(true);<NEW_LINE>List<String> choices = new ArrayList<>(descriptions.size());<NEW_LINE>for (int i = 0; i < descriptions.size(); i++) {<NEW_LINE>choices.add(descriptions.get(i).getLanguageID().getIdAsString());<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>langId = askChoice("Select New Language", "Language ID:", choices, null);<NEW_LINE>if (langId != null) {<NEW_LINE>Msg.warn(this, "Changing language ID from '" + record.getString(0) + "' to '" + langId + "' for program: " + df.getName());<NEW_LINE>desc = DefaultLanguageService.getLanguageService().getLanguageDescription(new LanguageID(langId));<NEW_LINE>long txId = dbh.startTransaction();<NEW_LINE>try {<NEW_LINE>record.setString(0, langId);<NEW_LINE>table.putRecord(record);<NEW_LINE>record = table.getSchema().createRecord(new StringField(LANGUAGE_VERSION));<NEW_LINE>record.setString(0, desc.getVersion() + "." + desc.getMinorVersion());<NEW_LINE>table.putRecord(record);<NEW_LINE>} finally {<NEW_LINE>dbh.endTransaction(txId, true);<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>} catch (CancelledException e) {<NEW_LINE>// just return false<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>} | ), null, "Script Error", "Old program file! Language fix is not appropriate."); |
226,795 | protected void paintCell(final Graphics2D g2d, final C c, final Rectangle rect, final int columnIndex, final TableColumn column, final TableColumn draggedColumn, final TableColumnModel columnModel) {<NEW_LINE>// Table reference<NEW_LINE>final JTable table = c.getTable();<NEW_LINE>// Complex check for the cases when trailing border should be painted<NEW_LINE>// It can be painted for middle columns, dragged column or when table is smaller than viewport<NEW_LINE>final JScrollPane scrollPane = SwingUtils.getScrollPane(table);<NEW_LINE>final boolean paintTrailingBorder = scrollPane != null && (column == draggedColumn || table.getAutoResizeMode() == JTable.AUTO_RESIZE_OFF && scrollPane.getViewport().getWidth() > table.getWidth() || (ltr ? columnIndex != columnModel.getColumnCount() - 1 : columnIndex != 0));<NEW_LINE>// Left side border<NEW_LINE>if (ltr || paintTrailingBorder) {<NEW_LINE>g2d.setColor(gridColor);<NEW_LINE>g2d.drawLine(rect.x - 1, rect.y + 2, rect.x - 1, rect.y + rect.height - 4);<NEW_LINE>}<NEW_LINE>// Painting dragged cell renderer<NEW_LINE>final JComponent headerRenderer <MASK><NEW_LINE>headerRenderer.setOpaque(false);<NEW_LINE>headerRenderer.setEnabled(table == null || table.isEnabled());<NEW_LINE>rendererPane.paintComponent(g2d, headerRenderer, component, rect.x, rect.y, rect.width, rect.height, true);<NEW_LINE>// Right side border<NEW_LINE>if (!ltr || paintTrailingBorder) {<NEW_LINE>g2d.setColor(gridColor);<NEW_LINE>g2d.drawLine(rect.x + rect.width - 1, rect.y + 2, rect.x + rect.width - 1, rect.y + rect.height - 4);<NEW_LINE>}<NEW_LINE>} | = (JComponent) getHeaderRenderer(columnIndex); |
949,186 | static byte[] convert1bppTo8bpp(byte[] data) {<NEW_LINE>final byte[] result = new <MASK><NEW_LINE>for (int i = 0; i < data.length; i++) {<NEW_LINE>result[(i * 8) + 0] = (byte) ((data[i] >> 7) & 0x01);<NEW_LINE>result[(i * 8) + 1] = (byte) ((data[i] >> 6) & 0x01);<NEW_LINE>result[(i * 8) + 2] = (byte) ((data[i] >> 5) & 0x01);<NEW_LINE>result[(i * 8) + 3] = (byte) ((data[i] >> 4) & 0x01);<NEW_LINE>result[(i * 8) + 4] = (byte) ((data[i] >> 3) & 0x01);<NEW_LINE>result[(i * 8) + 5] = (byte) ((data[i] >> 2) & 0x01);<NEW_LINE>result[(i * 8) + 6] = (byte) ((data[i] >> 1) & 0x01);<NEW_LINE>result[(i * 8) + 7] = (byte) ((data[i] >> 0) & 0x01);<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>} | byte[data.length * 8]; |
1,363,495 | private float minScale() {<NEW_LINE>int viewHeight = getHeightInternal() - getPaddingBottom() + getPaddingTop();<NEW_LINE>int viewWidth = getWidthInternal() <MASK><NEW_LINE>switch(minimumScaleType) {<NEW_LINE>case ScaleType.CENTER_CROP:<NEW_LINE>case ScaleType.START:<NEW_LINE>return Math.max(viewWidth / (float) sWidth(), viewHeight / (float) sHeight());<NEW_LINE>case ScaleType.FIT_WIDTH:<NEW_LINE>return viewWidth / (float) sWidth();<NEW_LINE>case ScaleType.FIT_HEIGHT:<NEW_LINE>return viewHeight / (float) sHeight();<NEW_LINE>case ScaleType.ORIGINAL_SIZE:<NEW_LINE>return 1;<NEW_LINE>case ScaleType.SMART_FIT:<NEW_LINE>if (sHeight() > sWidth()) {<NEW_LINE>// Fit to width<NEW_LINE>return viewWidth / (float) sWidth();<NEW_LINE>} else {<NEW_LINE>// Fit to height<NEW_LINE>return viewHeight / (float) sHeight();<NEW_LINE>}<NEW_LINE>case ScaleType.SMART_FILL:<NEW_LINE>float scale1 = viewHeight / (float) sHeight();<NEW_LINE>float scale2 = viewWidth / (float) sWidth();<NEW_LINE>return Math.max(scale1, scale2);<NEW_LINE>case ScaleType.CUSTOM:<NEW_LINE>if (minScale > 0)<NEW_LINE>return minScale;<NEW_LINE>else<NEW_LINE>return Math.min(viewWidth / (float) sWidth(), viewHeight / (float) sHeight());<NEW_LINE>case ScaleType.CENTER_INSIDE:<NEW_LINE>default:<NEW_LINE>return Math.min(viewWidth / (float) sWidth(), viewHeight / (float) sHeight());<NEW_LINE>}<NEW_LINE>} | - getPaddingLeft() + getPaddingRight(); |
90,224 | public void start() {<NEW_LINE>if (current != null) {<NEW_LINE>current.show();<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>String imageURL = "https://upload.wikimedia.org/wikipedia/commons/f/f5/Steve_Jobs_Headshot_2010-CROP2.jpg";<NEW_LINE>Form hi = new Form("Hi World", new BorderLayout());<NEW_LINE>ImageViewer viewer = new ImageViewer();<NEW_LINE>Button getCroppedImage = new Button("Get Crop");<NEW_LINE>getCroppedImage.addActionListener(e -> {<NEW_LINE>Label l = new Label(viewer.getCroppedImage(<MASK><NEW_LINE>Dialog.show("Crop is", l, new Command("OK"));<NEW_LINE>});<NEW_LINE>Button getCroppedImageFullSize = new Button("Get Crop (Full Size)");<NEW_LINE>getCroppedImageFullSize.addActionListener(e -> {<NEW_LINE>Label l = new Label(viewer.getCroppedImage(0x0));<NEW_LINE>Dialog.show("Crop is", l, new Command("OK"));<NEW_LINE>});<NEW_LINE>Util.downloadImageToCache(imageURL).ready(img -> {<NEW_LINE>viewer.setImage(img);<NEW_LINE>hi.revalidateWithAnimationSafety();<NEW_LINE>}).except(ex -> Log.e(ex));<NEW_LINE>hi.add(BorderLayout.CENTER, viewer);<NEW_LINE>hi.add(BorderLayout.SOUTH, FlowLayout.encloseIn(getCroppedImage, getCroppedImageFullSize));<NEW_LINE>hi.show();<NEW_LINE>} | 300, -1, 0x0)); |
98,215 | public boolean write(OutputStream outputStream, ProgressReporter progressReporter) throws SerializerException {<NEW_LINE>if (this.emfJsonSerializer == null) {<NEW_LINE>this.emfJsonSerializer = new EmfJsonSerializer(outputStream, includeHidden, SERIALIZE_EMPTY_LISTS);<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>if (mode == Mode.HEADER) {<NEW_LINE><MASK><NEW_LINE>IfcHeader ifcHeader = model.getModelMetaData().getIfcHeader();<NEW_LINE>if (ifcHeader != null) {<NEW_LINE>this.emfJsonSerializer.print("\"header\":");<NEW_LINE>this.emfJsonSerializer.writeObject(ifcHeader);<NEW_LINE>this.emfJsonSerializer.print("\n,");<NEW_LINE>}<NEW_LINE>this.emfJsonSerializer.print("\"objects\":[");<NEW_LINE>mode = Mode.BODY;<NEW_LINE>iterator = model.iterator();<NEW_LINE>return true;<NEW_LINE>} else if (mode == Mode.BODY) {<NEW_LINE>if (iterator.hasNext()) {<NEW_LINE>IdEObject object = iterator.next();<NEW_LINE>if (object.getOid() == -1) {<NEW_LINE>throw new SerializerException("Object cannot have oid -1 " + object.eClass().getName());<NEW_LINE>}<NEW_LINE>if (object.eClass().getEAnnotation("hidden") == null || includeHidden) {<NEW_LINE>if (!firstObject) {<NEW_LINE>this.emfJsonSerializer.print(",");<NEW_LINE>} else {<NEW_LINE>firstObject = false;<NEW_LINE>}<NEW_LINE>this.emfJsonSerializer.writeObject(object);<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>} else {<NEW_LINE>this.emfJsonSerializer.print("]");<NEW_LINE>this.emfJsonSerializer.print("}");<NEW_LINE>mode = Mode.FOOTER;<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>} else if (mode == Mode.FOOTER) {<NEW_LINE>mode = Mode.DONE;<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>} catch (Throwable e) {<NEW_LINE>throw new SerializerException(e);<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>} | this.emfJsonSerializer.print("{"); |
1,268,373 | public void tryUOWManagerLookup(HttpServletRequest request, HttpServletResponse response) throws Exception {<NEW_LINE>final UOWManager uowm = (UOWManager) new <MASK><NEW_LINE>if (!(uowm instanceof UOWManager)) {<NEW_LINE>throw new Exception("Lookup of java:comp/websphere/UOWManager failed");<NEW_LINE>}<NEW_LINE>final long localUOWId = uowm.getLocalUOWId();<NEW_LINE>uowm.runUnderUOW(UOWSynchronizationRegistry.UOW_TYPE_GLOBAL_TRANSACTION, false, new UOWAction() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void run() throws Exception {<NEW_LINE>if (localUOWId == uowm.getLocalUOWId()) {<NEW_LINE>throw new Exception("UOWAction not run under new UOW");<NEW_LINE>}<NEW_LINE>System.out.println("Expiration time: " + uowm.getUOWExpiration());<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} | InitialContext().lookup("java:comp/websphere/UOWManager"); |
338,247 | public void updateCronTrigger(String schedulerObjectName, String triggerName, String groupName, int misfireInstruction, String cronExpression, String timeZone) throws Exception {<NEW_LINE>if (schedulerObjectName == null) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>ObjectName on = ObjectName.getInstance(schedulerObjectName);<NEW_LINE>if (!mBeanServer.isRegistered(on)) {<NEW_LINE>throw new IllegalArgumentException("Cannot find quartz scheduler with ObjectName: " + schedulerObjectName);<NEW_LINE>}<NEW_LINE>// get existing trigger map<NEW_LINE>CompositeData data = (CompositeData) mBeanServer.invoke(on, "getTrigger", new Object[] { triggerName, groupName }, new String[] { "java.lang.String", "java.lang.String" });<NEW_LINE>if (data == null) {<NEW_LINE>throw new IllegalArgumentException("Cannot find trigger details for group: " + groupName + " name: " + triggerName);<NEW_LINE>}<NEW_LINE>// trigger references job - let's get its data<NEW_LINE>String jobName = (String) data.get("jobName");<NEW_LINE>String jobGroupName = (String) data.get("jobGroup");<NEW_LINE>CompositeData jobData = (CompositeData) mBeanServer.invoke(on, "getJobDetail", new Object[] { jobName, jobGroupName }, new String[] { "java.lang.String", "java.lang.String" });<NEW_LINE>if (jobData == null) {<NEW_LINE>throw new IllegalArgumentException("Cannot find job details for group: " + jobGroupName + " name: " + jobName);<NEW_LINE>}<NEW_LINE>Map<String, Object> jobParams = new HashMap<>();<NEW_LINE>Map<String, Object> jobDataMap = new HashMap<>();<NEW_LINE>initJobParams(jobParams, jobDataMap, jobName, jobGroupName, jobData);<NEW_LINE>Map<String, Object> triggerParams = new HashMap<>();<NEW_LINE>jobDataMap.put("CamelQuartzTriggerType", "cron");<NEW_LINE>// also ensure the job data map is up to date with the cron trigger changes<NEW_LINE>triggerParams.put("cronExpression", cronExpression);<NEW_LINE>jobDataMap.put("CamelQuartzTriggerCronExpression", cronExpression);<NEW_LINE>if (timeZone != null) {<NEW_LINE>triggerParams.put("timeZone", timeZone);<NEW_LINE>jobDataMap.put("CamelQuartzTriggerCronTimeZone", timeZone);<NEW_LINE>}<NEW_LINE>triggerParams.put("name", triggerName);<NEW_LINE>triggerParams.put("group", groupName);<NEW_LINE>triggerParams.put("jobName", jobName);<NEW_LINE>triggerParams.put("jobGroup", jobGroupName);<NEW_LINE>triggerParams.put("misfireInstruction", misfireInstruction);<NEW_LINE>// update trigger<NEW_LINE>mBeanServer.invoke(on, "scheduleBasicJob", new Object[] { jobParams, triggerParams }, new String[] { "java.util.Map", "java.util.Map" });<NEW_LINE>} | throw new IllegalArgumentException("Cannot find quartz scheduler with ObjectName: " + schedulerObjectName); |
371,645 | public static GetStackResponse unmarshall(GetStackResponse getStackResponse, UnmarshallerContext _ctx) {<NEW_LINE>getStackResponse.setRequestId(_ctx.stringValue("GetStackResponse.RequestId"));<NEW_LINE>List<StackInfoItem> stackInfo = new ArrayList<StackInfoItem>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("GetStackResponse.StackInfo.Length"); i++) {<NEW_LINE>StackInfoItem stackInfoItem = new StackInfoItem();<NEW_LINE>stackInfoItem.setStartTime(_ctx.longValue("GetStackResponse.StackInfo[" + i + "].StartTime"));<NEW_LINE>stackInfoItem.setException(_ctx.stringValue("GetStackResponse.StackInfo[" + i + "].Exception"));<NEW_LINE>stackInfoItem.setApi(_ctx.stringValue("GetStackResponse.StackInfo[" + i + "].Api"));<NEW_LINE>stackInfoItem.setLine(_ctx.stringValue("GetStackResponse.StackInfo[" + i + "].Line"));<NEW_LINE>stackInfoItem.setDuration(_ctx.longValue("GetStackResponse.StackInfo[" + i + "].Duration"));<NEW_LINE>stackInfoItem.setRpcId(_ctx.stringValue("GetStackResponse.StackInfo[" + i + "].RpcId"));<NEW_LINE>stackInfoItem.setServiceName(_ctx.stringValue("GetStackResponse.StackInfo[" + i + "].ServiceName"));<NEW_LINE>ExtInfo extInfo = new ExtInfo();<NEW_LINE>extInfo.setType(_ctx.stringValue("GetStackResponse.StackInfo[" + i + "].ExtInfo.Type"));<NEW_LINE>extInfo.setInfo(_ctx.stringValue<MASK><NEW_LINE>stackInfoItem.setExtInfo(extInfo);<NEW_LINE>stackInfo.add(stackInfoItem);<NEW_LINE>}<NEW_LINE>getStackResponse.setStackInfo(stackInfo);<NEW_LINE>return getStackResponse;<NEW_LINE>} | ("GetStackResponse.StackInfo[" + i + "].ExtInfo.Info")); |
452,720 | public void onCreate() {<NEW_LINE>super.onCreate();<NEW_LINE>setting = OldMainActivity.Setting;<NEW_LINE>layout_functionbar = OldMainActivity.CURRENT_ACTIVITY.get().findViewById(R.id.layout_functions);<NEW_LINE>buttonUser = layout_functionbar.findViewById(R.id.main_button_user);<NEW_LINE>buttonPlugin = layout_functionbar.findViewById(R.id.main_button_plugin);<NEW_LINE>buttonGamelist = layout_functionbar.findViewById(R.id.main_button_gamelist);<NEW_LINE>buttonGamedir = layout_functionbar.findViewById(R.id.main_button_gamedir);<NEW_LINE>buttonSetting = layout_functionbar.findViewById(R.id.main_button_setting);<NEW_LINE>buttonKeyboard = layout_functionbar.findViewById(R.id.main_button_keyboard);<NEW_LINE>buttonHome = layout_functionbar.findViewById(R.id.main_button_home);<NEW_LINE>buttonLog = layout_functionbar.findViewById(R.id.main_button_log);<NEW_LINE>textUserName = layout_functionbar.<MASK><NEW_LINE>textUserType = layout_functionbar.findViewById(R.id.functionbar_usertype);<NEW_LINE>for (View v : new View[] { buttonUser, buttonPlugin, buttonGamelist, buttonGamedir, buttonSetting, buttonKeyboard, buttonHome, buttonLog }) {<NEW_LINE>v.setOnClickListener(clickListener);<NEW_LINE>}<NEW_LINE>refreshUI();<NEW_LINE>} | findViewById(R.id.functionbar_username); |
1,234,383 | final CreatePolicyResult executeCreatePolicy(CreatePolicyRequest createPolicyRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(createPolicyRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<CreatePolicyRequest> request = null;<NEW_LINE>Response<CreatePolicyResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new CreatePolicyRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(createPolicyRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "IoT");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "CreatePolicy");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<CreatePolicyResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new CreatePolicyResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>} | endClientExecution(awsRequestMetrics, request, response); |
1,785,724 | public RowsMatch matches(StatisticsProvider<C> evaluator) {<NEW_LINE>ColumnStatistics<C> leftStat = (ColumnStatistics<C>) left.accept(evaluator, null);<NEW_LINE>if (IsPredicate.isNullOrEmpty(leftStat)) {<NEW_LINE>return RowsMatch.SOME;<NEW_LINE>}<NEW_LINE>ColumnStatistics<C> rightStat = (ColumnStatistics<C>) right.accept(evaluator, null);<NEW_LINE>if (IsPredicate.isNullOrEmpty(rightStat)) {<NEW_LINE>return RowsMatch.SOME;<NEW_LINE>}<NEW_LINE>if (IsPredicate.isAllNulls(leftStat, evaluator.getRowCount()) || IsPredicate.isAllNulls(rightStat, evaluator.getRowCount())) {<NEW_LINE>return RowsMatch.NONE;<NEW_LINE>}<NEW_LINE>if (!IsPredicate.hasNonNullValues(leftStat, evaluator.getRowCount()) || !IsPredicate.hasNonNullValues(rightStat, evaluator.getRowCount())) {<NEW_LINE>return RowsMatch.SOME;<NEW_LINE>}<NEW_LINE>if (left.getMajorType().getMinorType() == TypeProtos.MinorType.VARDECIMAL) {<NEW_LINE>int leftScale = left.getMajorType().getScale();<NEW_LINE>int rightScale = right.getMajorType().getScale();<NEW_LINE>if (leftScale > rightScale) {<NEW_LINE>rightStat = (ColumnStatistics<C>) adjustDecimalStatistics((ColumnStatistics<BigInteger<MASK><NEW_LINE>} else if (leftScale < rightScale) {<NEW_LINE>leftStat = (ColumnStatistics<C>) adjustDecimalStatistics((ColumnStatistics<BigInteger>) leftStat, rightScale - leftScale);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return predicate.apply(leftStat, rightStat);<NEW_LINE>} | >) rightStat, leftScale - rightScale); |
132,543 | private void registerInner(@Nullable final Object bus) {<NEW_LINE>if (bus == null)<NEW_LINE>return;<NEW_LINE>Class<?> aClass = bus.getClass();<NEW_LINE>String className = aClass.getName();<NEW_LINE>boolean isNeedRecordTags = false;<NEW_LINE>synchronized (mClassName_BusesMap) {<NEW_LINE>Set<Object> buses = mClassName_BusesMap.get(className);<NEW_LINE>if (buses == null) {<NEW_LINE><MASK><NEW_LINE>mClassName_BusesMap.put(className, buses);<NEW_LINE>isNeedRecordTags = true;<NEW_LINE>}<NEW_LINE>if (buses.contains(bus)) {<NEW_LINE>Log.w(TAG, "The bus of <" + bus + "> already registered.");<NEW_LINE>return;<NEW_LINE>} else {<NEW_LINE>buses.add(bus);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (isNeedRecordTags) {<NEW_LINE>recordTags(aClass, className);<NEW_LINE>}<NEW_LINE>consumeStickyIfExist(bus);<NEW_LINE>} | buses = new CopyOnWriteArraySet<>(); |
1,188,508 | static /* package */<NEW_LINE>String loadFromKeyValueCache(final String key, final long maxAgeMilliseconds) {<NEW_LINE>synchronized (MUTEX_IO) {<NEW_LINE>File file = getKeyValueCacheFile(key);<NEW_LINE>if (file == null) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>Date now = new Date();<NEW_LINE>long oldestAcceptableAge = Math.max(0, now.getTime() - maxAgeMilliseconds);<NEW_LINE>if (getKeyValueCacheAge(file) < oldestAcceptableAge) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>// Update mtime to make the LRU work<NEW_LINE>file.setLastModified(now.getTime());<NEW_LINE>try {<NEW_LINE>RandomAccessFile f = new RandomAccessFile(file, "r");<NEW_LINE>byte[] bytes = new byte[(<MASK><NEW_LINE>f.readFully(bytes);<NEW_LINE>f.close();<NEW_LINE>return new String(bytes, "UTF-8");<NEW_LINE>} catch (IOException e) {<NEW_LINE>PLog.e(TAG, "error reading from cache", e);<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | int) f.length()]; |
137,348 | private void updateFailedShardsCache(final ClusterState state) {<NEW_LINE>RoutingNode localRoutingNode = state.getRoutingNodes().node(state.nodes().getLocalNodeId());<NEW_LINE>if (localRoutingNode == null) {<NEW_LINE>failedShardsCache.clear();<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>DiscoveryNode masterNode = state<MASK><NEW_LINE>// remove items from cache which are not in our routing table anymore and resend failures that have not executed on master yet<NEW_LINE>for (Iterator<Map.Entry<ShardId, ShardRouting>> iterator = failedShardsCache.entrySet().iterator(); iterator.hasNext(); ) {<NEW_LINE>ShardRouting failedShardRouting = iterator.next().getValue();<NEW_LINE>ShardRouting matchedRouting = localRoutingNode.getByShardId(failedShardRouting.shardId());<NEW_LINE>if (matchedRouting == null || matchedRouting.isSameAllocation(failedShardRouting) == false) {<NEW_LINE>iterator.remove();<NEW_LINE>} else {<NEW_LINE>if (masterNode != null) {<NEW_LINE>// TODO: can we remove this? Is resending shard failures the responsibility of shardStateAction?<NEW_LINE>String message = "master " + masterNode + " has not removed previously failed shard. resending shard failure";<NEW_LINE>logger.trace("[{}] re-sending failed shard [{}], reason [{}]", matchedRouting.shardId(), matchedRouting, message);<NEW_LINE>shardStateAction.localShardFailed(matchedRouting, message, null, ActionListener.noop(), state);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | .nodes().getMasterNode(); |
944,173 | public void onCreate() {<NEW_LINE>super.onCreate();<NEW_LINE>this.layout_log = OldMainActivity.CURRENT_ACTIVITY.get().findViewById(R.id.layout_log);<NEW_LINE>this.scrollView = new ScrollView(mContext);<NEW_LINE>this.scrollView.setLayoutParams(new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT));<NEW_LINE>this.scrollView.setBackgroundColor(Color.parseColor("#7F8E8E8E"));<NEW_LINE>this.layout_log.addView(scrollView);<NEW_LINE>this.logView = new LineTextView(mContext);<NEW_LINE>this.logView.setLayoutParams(new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT));<NEW_LINE>this.logView.setTextSize(DisplayUtils<MASK><NEW_LINE>this.logView.setTextColor(Color.WHITE);<NEW_LINE>this.logView.setTextIsSelectable(true);<NEW_LINE>this.scrollView.addView(logView);<NEW_LINE>this.buttonRefreshFromFile = layout_log.findViewById(R.id.log_button_refresh_from_file);<NEW_LINE>this.buttonRefreshFromThread = layout_log.findViewById(R.id.log_button_refresh_from_this);<NEW_LINE>for (View view : new View[] { buttonRefreshFromFile, buttonRefreshFromThread }) {<NEW_LINE>view.setOnClickListener(this);<NEW_LINE>}<NEW_LINE>showAnim = AnimationUtils.loadAnimation(mContext, R.anim.layout_show);<NEW_LINE>} | .getPxFromSp(mContext, 3)); |
83,914 | public void mousePressed(MouseEvent e) {<NEW_LINE>ZonePoint zp = getPoint(e);<NEW_LINE>if (SwingUtilities.isLeftMouseButton(e)) {<NEW_LINE>if (rectangle == null) {<NEW_LINE>originPoint = zp;<NEW_LINE>rectangle = createRect(originPoint, originPoint);<NEW_LINE>} else {<NEW_LINE><MASK><NEW_LINE>if (rectangle.width == 0 || rectangle.height == 0) {<NEW_LINE>rectangle = null;<NEW_LINE>renderer.repaint();<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// Draw Rectangle with initial point as Center<NEW_LINE>if (e.isAltDown()) {<NEW_LINE>if (zp.x > originPoint.x)<NEW_LINE>rectangle.x -= rectangle.width;<NEW_LINE>if (zp.y > originPoint.y)<NEW_LINE>rectangle.y -= rectangle.height;<NEW_LINE>rectangle.width *= 2;<NEW_LINE>rectangle.height *= 2;<NEW_LINE>}<NEW_LINE>// System.out.println("Adding Rectangle to zone: " + rectangle);<NEW_LINE>completeDrawable(renderer.getZone().getId(), getPen(), new ShapeDrawable(rectangle, false));<NEW_LINE>rectangle = null;<NEW_LINE>}<NEW_LINE>setIsEraser(isEraser(e));<NEW_LINE>}<NEW_LINE>super.mousePressed(e);<NEW_LINE>} | rectangle = createRect(originPoint, zp); |
503,257 | public void initialise() throws Exception {<NEW_LINE>setLayout(new BorderLayout());<NEW_LINE>ExplanationPreferencesPanelPluginLoader loader = new ExplanationPreferencesPanelPluginLoader(getEditorKit());<NEW_LINE>Set<PreferencesPanelPlugin> plugins = new TreeSet<>((o1, o2) -> {<NEW_LINE>String s1 = o1.getLabel();<NEW_LINE>String s2 = o2.getLabel();<NEW_LINE>return s1.compareTo(s2);<NEW_LINE>});<NEW_LINE>plugins.addAll(loader.getPlugins());<NEW_LINE>for (PreferencesPanelPlugin plugin : plugins) {<NEW_LINE>try {<NEW_LINE><MASK><NEW_LINE>panel.initialise();<NEW_LINE>String label = plugin.getLabel();<NEW_LINE>final JScrollPane sp = new JScrollPane(panel);<NEW_LINE>sp.setBorder(new EmptyBorder(0, 0, 0, 0));<NEW_LINE>map.put(label, panel);<NEW_LINE>componentMap.put(label, sp);<NEW_LINE>tabbedPane.addTab(label, sp);<NEW_LINE>} catch (Throwable e) {<NEW_LINE>logger.warn("An error occurred whilst trying to instantiate the explanation preferences panel plugin '{}': {}", plugin.getLabel(), e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>add(tabbedPane);<NEW_LINE>updatePanelSelection(null);<NEW_LINE>} | PreferencesPanel panel = plugin.newInstance(); |
788,678 | private void fillAddressValues(String streetAddress, String extendedStreetAddress, String postalCodeAddress, String localityAddress, String poBoxAddress, String regionAddress, String countryAddress) {<NEW_LINE>mAddressStreetView.setText(streetAddress);<NEW_LINE>mAddressExtendedStreetView.setText(extendedStreetAddress);<NEW_LINE>mAddressCityView.setText(localityAddress);<NEW_LINE>mAddressRegionView.setText(regionAddress);<NEW_LINE>mAddressPostcodeView.setText(postalCodeAddress);<NEW_LINE>mAddressPoBoxView.setText(poBoxAddress);<NEW_LINE>mAddressCountryView.setText(countryAddress);<NEW_LINE>mAddressFullCombinedView.setHint(mOptionHint);<NEW_LINE>List<String> addressParts = new ArrayList<>();<NEW_LINE>if (!TextUtils.isEmpty(streetAddress)) {<NEW_LINE>addressParts.add(streetAddress);<NEW_LINE>}<NEW_LINE>if (!TextUtils.isEmpty(extendedStreetAddress)) {<NEW_LINE>addressParts.add(extendedStreetAddress);<NEW_LINE>}<NEW_LINE>if (!TextUtils.isEmpty(postalCodeAddress)) {<NEW_LINE>addressParts.add(postalCodeAddress);<NEW_LINE>}<NEW_LINE>if (!TextUtils.isEmpty(localityAddress)) {<NEW_LINE>addressParts.add(localityAddress);<NEW_LINE>}<NEW_LINE>if (!TextUtils.isEmpty(poBoxAddress)) {<NEW_LINE>addressParts.add(poBoxAddress);<NEW_LINE>}<NEW_LINE>if (!TextUtils.isEmpty(regionAddress)) {<NEW_LINE>addressParts.add(regionAddress);<NEW_LINE>}<NEW_LINE>if (!TextUtils.isEmpty(countryAddress)) {<NEW_LINE>addressParts.add(countryAddress);<NEW_LINE>}<NEW_LINE>boolean isEmpty = TextUtils.isEmpty(streetAddress) && TextUtils.isEmpty(localityAddress) && TextUtils.isEmpty(regionAddress) && TextUtils.isEmpty(postalCodeAddress<MASK><NEW_LINE>if (!isEmpty) {<NEW_LINE>mAddressFullCombinedView.setText(TextUtils.join("\n", addressParts));<NEW_LINE>}<NEW_LINE>} | ) && TextUtils.isEmpty(countryAddress); |
567,211 | private boolean doSubscribe(BackOffExecution backOffExecution) {<NEW_LINE>CompletableFuture<MASK><NEW_LINE>CompletableFuture<Void> containerUnsubscribeFuture = this.unsubscribeFuture;<NEW_LINE>State state = this.state.get();<NEW_LINE>// someone has called stop while we were in here.<NEW_LINE>if (!state.isPrepareListening() && state.isListening()) {<NEW_LINE>containerUnsubscribeFuture.join();<NEW_LINE>}<NEW_LINE>if (!this.state.compareAndSet(state, State.prepareListening())) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>CompletableFuture<Void> listenFuture = getRequiredSubscriber().initialize(backOffExecution, patternMapping.keySet().stream().map(ByteArrayWrapper::getArray).collect(Collectors.toList()), channelMapping.keySet().stream().map(ByteArrayWrapper::getArray).collect(Collectors.toList()));<NEW_LINE>listenFuture.whenComplete((unused, throwable) -> {<NEW_LINE>if (throwable == null) {<NEW_LINE>logger.debug("RedisMessageListenerContainer listeners registered successfully.");<NEW_LINE>this.state.set(State.listening());<NEW_LINE>} else {<NEW_LINE>logger.debug("Failed to start RedisMessageListenerContainer listeners.", throwable);<NEW_LINE>this.state.set(State.notListening());<NEW_LINE>}<NEW_LINE>propagate(unused, throwable, containerListenFuture);<NEW_LINE>// re-arm listen future for a later lazy-listen attempt<NEW_LINE>if (throwable != null) {<NEW_LINE>this.listenFuture = new CompletableFuture<>();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>logger.debug("Subscribing to topics for RedisMessageListenerContainer.");<NEW_LINE>return true;<NEW_LINE>} | <Void> containerListenFuture = this.listenFuture; |
460,394 | private void updateDownloadNotification(String url, int totalBytes, int currentBytes) {<NEW_LINE>Context context = RhodesActivity.getContext();<NEW_LINE>RemoteViews expandedView = new RemoteViews(context.getPackageName(), R.layout.status_bar_ongoing_event_progress_bar);<NEW_LINE>StringBuilder newUrl = new StringBuilder();<NEW_LINE>if (url.length() < 17)<NEW_LINE>newUrl.append(url);<NEW_LINE>else {<NEW_LINE>newUrl.append(url.substring(0, 7));<NEW_LINE>newUrl.append("...");<NEW_LINE>newUrl.append(url.substring(url.length() - 7, url.length()));<NEW_LINE>}<NEW_LINE>expandedView.setTextViewText(R.id.title, newUrl.toString());<NEW_LINE>StringBuffer downloadingText = new StringBuffer();<NEW_LINE>if (totalBytes > 0) {<NEW_LINE>long progress = currentBytes * 100 / totalBytes;<NEW_LINE>downloadingText.append(progress);<NEW_LINE>downloadingText.append('%');<NEW_LINE>}<NEW_LINE>expandedView.setTextViewText(R.id.progress_text, downloadingText.toString());<NEW_LINE>expandedView.setProgressBar(R.id.progress_bar, totalBytes < 0 ? 100 : totalBytes, currentBytes, totalBytes < 0);<NEW_LINE>Builder builder = AndroidFunctionalityManager.getAndroidFunctionality().getNotificationBuilder(context, String.valueOf(DOWNLOAD_PACKAGE_ID), url);<NEW_LINE>builder.setSmallIcon(android.R.drawable.stat_sys_download);<NEW_LINE>builder.setDefaults(Notification.FLAG_ONGOING_EVENT);<NEW_LINE>// min API = 24<NEW_LINE>// builder.setCustomContentView(expandedView);<NEW_LINE>Intent intent = new Intent(ACTION_ASK_CANCEL_DOWNLOAD);<NEW_LINE>builder.setContentIntent(PendingIntent.getBroadcast(context<MASK><NEW_LINE>intent = new Intent(ACTION_CANCEL_DOWNLOAD);<NEW_LINE>builder.setDeleteIntent(PendingIntent.getBroadcast(context, 0, intent, 0));<NEW_LINE>mNM.notify(DOWNLOAD_PACKAGE_ID, builder.build());<NEW_LINE>} | , 0, intent, 0)); |
21,584 | private void createAvoidRoadsFilesItems() {<NEW_LINE>List<File> avoidRoadsFiles = avoidRoadsHelper.collectAvoidRoadsFiles();<NEW_LINE>if (!Algorithms.isEmpty(avoidRoadsFiles)) {<NEW_LINE>items.add(new SubtitleDividerItem(app));<NEW_LINE>items.add(new TitleItem(getString(R.string.files_with_route_restrictions)));<NEW_LINE>LayoutInflater inflater = UiUtilities.<MASK><NEW_LINE>for (File file : avoidRoadsFiles) {<NEW_LINE>String fileName = file.getName();<NEW_LINE>String name = capitalizeFirstLetter(fileName.replace(AVOID_ROADS_FILE_EXT, ""));<NEW_LINE>boolean enabled = enabledFiles.contains(fileName);<NEW_LINE>View itemView = inflater.inflate(R.layout.bottom_sheet_item_with_switch_and_dialog, null, false);<NEW_LINE>AndroidUiHelper.updateVisibility(itemView.findViewById(R.id.divider), false);<NEW_LINE>final BottomSheetItemWithCompoundButton[] item = new BottomSheetItemWithCompoundButton[1];<NEW_LINE>item[0] = (BottomSheetItemWithCompoundButton) new BottomSheetItemWithCompoundButton.Builder().setChecked(enabled).setTitle(name).setIcon(getActiveIcon(R.drawable.ic_action_file_report)).setCustomView(itemView).setOnClickListener(v -> {<NEW_LINE>boolean checked = !item[0].isChecked();<NEW_LINE>if (checked) {<NEW_LINE>enabledFiles.add(fileName);<NEW_LINE>} else {<NEW_LINE>enabledFiles.remove(fileName);<NEW_LINE>}<NEW_LINE>item[0].setChecked(checked);<NEW_LINE>}).create();<NEW_LINE>avoidRoadsHelper.getDirectionPointsForFileAsync(file, result -> {<NEW_LINE>int size = result.queryInBox(new QuadRect(0, 0, Integer.MAX_VALUE, Integer.MAX_VALUE), new ArrayList<>()).size();<NEW_LINE>String roads = getString(R.string.roads);<NEW_LINE>String used = getString(enabled ? R.string.shared_string_used : R.string.shared_string_not_used);<NEW_LINE>String roadsCount = getString(R.string.ltr_or_rtl_combine_via_colon, roads.toLowerCase(), String.valueOf(size));<NEW_LINE>String description = getString(R.string.ltr_or_rtl_combine_via_bold_point, used, roadsCount);<NEW_LINE>item[0].setDescription(description);<NEW_LINE>return true;<NEW_LINE>});<NEW_LINE>items.add(item[0]);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | getInflater(getContext(), nightMode); |
1,060,357 | public int largestRectangleArea(int[] heights) {<NEW_LINE>int res = 0, n = heights.length;<NEW_LINE>Deque<Integer> stk = new ArrayDeque<>();<NEW_LINE>int[] left = new int[n];<NEW_LINE>int[] right = new int[n];<NEW_LINE>Arrays.fill(right, n);<NEW_LINE>for (int i = 0; i < n; ++i) {<NEW_LINE>while (!stk.isEmpty() && heights[stk.peek()] >= heights[i]) {<NEW_LINE>right[<MASK><NEW_LINE>}<NEW_LINE>left[i] = stk.isEmpty() ? -1 : stk.peek();<NEW_LINE>stk.push(i);<NEW_LINE>}<NEW_LINE>for (int i = 0; i < n; ++i) {<NEW_LINE>res = Math.max(res, heights[i] * (right[i] - left[i] - 1));<NEW_LINE>}<NEW_LINE>return res;<NEW_LINE>} | stk.pop()] = i; |
1,465,491 | final UpdateResourceResult executeUpdateResource(UpdateResourceRequest updateResourceRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(updateResourceRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<UpdateResourceRequest> request = null;<NEW_LINE>Response<UpdateResourceResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new UpdateResourceRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(updateResourceRequest));<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, "LakeFormation");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "UpdateResource");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<UpdateResourceResult>> 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 UpdateResourceResultJsonUnmarshaller()); |
1,056,779 | // for Java 7, the type of elements of JComboBox needs to be specified to avoid the warning and it's not supported in Java 6<NEW_LINE>@SuppressWarnings("unchecked")<NEW_LINE>private void buildGUI() {<NEW_LINE>JPanel dirPanel = new JPanel();<NEW_LINE>dirPanel.setLayout(new BoxLayout(dirPanel, BoxLayout.X_AXIS));<NEW_LINE>dirField = new JTextField(fileDir.getPath());<NEW_LINE>dirField.setColumns(30);<NEW_LINE>dirPanel.add(dirField);<NEW_LINE>browseButton = new JButton(BROWSE_OPTION);<NEW_LINE>browseButton.addActionListener(this);<NEW_LINE>dirPanel.add(browseButton);<NEW_LINE>JXTitledPanel titledPanel = new org.jdesktop.swingx.JXTitledPanel();<NEW_LINE>Border loweredetched = BorderFactory.createEtchedBorder(EtchedBorder.LOWERED);<NEW_LINE>titledPanel.setBorder(BorderFactory.createTitledBorder(loweredetched, "Directory Selection"));<NEW_LINE>titledPanel.add(dirPanel, BorderLayout.NORTH);<NEW_LINE>msgLabel = new JLabel();<NEW_LINE>titledPanel.add(msgLabel, BorderLayout.CENTER);<NEW_LINE>selectedPSFileList = new ListPanel();<NEW_LINE>selectedPSFileList.getJList().addListSelectionListener(this);<NEW_LINE>resetList();<NEW_LINE>loweredetched = BorderFactory.createEtchedBorder(EtchedBorder.LOWERED);<NEW_LINE>selectedPSFileList.setBorder(BorderFactory.createTitledBorder(loweredetched, "All .ps files (select one or more):"));<NEW_LINE>selectedPSFileList.getJList().setBackground(Color.white);<NEW_LINE>JPanel buttonPanel = new JPanel();<NEW_LINE>psViewButton = new JButton(PS_VIEW_OPTION);<NEW_LINE>psViewButton.addActionListener(this);<NEW_LINE>psMergeButton = new JButton(PS_MERGE_OPTION);<NEW_LINE>psMergeButton.addActionListener(this);<NEW_LINE>pdfBookletButton = new JButton(PDF_BOOKLET_OPTION);<NEW_LINE>pdfBookletButton.addActionListener(this);<NEW_LINE>if (selectedPSFileList.getJList().getSelectedIndex() == -1) {<NEW_LINE>psViewButton.setEnabled(false);<NEW_LINE>psMergeButton.setEnabled(false);<NEW_LINE>pdfBookletButton.setEnabled(false);<NEW_LINE>}<NEW_LINE>closeButton = new JButton(CLOSE_OPTION);<NEW_LINE>closeButton.addActionListener(this);<NEW_LINE>buttonPanel.setLayout(new BoxLayout(buttonPanel, BoxLayout.X_AXIS));<NEW_LINE>buttonPanel.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10));<NEW_LINE>buttonPanel.add(psViewButton);<NEW_LINE>buttonPanel.add(Box.createHorizontalStrut(10));<NEW_LINE>buttonPanel.add(psMergeButton);<NEW_LINE>buttonPanel.add(Box.createHorizontalStrut(10));<NEW_LINE>buttonPanel.add(pdfBookletButton);<NEW_LINE>buttonPanel.add(Box.createHorizontalStrut(10));<NEW_LINE>buttonPanel.add(closeButton);<NEW_LINE>getContentPane().setLayout(new BoxLayout(getContentPane(), BoxLayout.Y_AXIS));<NEW_LINE>getContentPane().add(Box.createVerticalStrut(10));<NEW_LINE><MASK><NEW_LINE>getContentPane().add(Box.createVerticalStrut(15));<NEW_LINE>getContentPane().add(selectedPSFileList);<NEW_LINE>getContentPane().add(buttonPanel);<NEW_LINE>getContentPane().add(Box.createVerticalStrut(5));<NEW_LINE>pack();<NEW_LINE>} | getContentPane().add(titledPanel); |
77,604 | private static void raw(CCEXTradeServiceRaw tradeService) throws IOException {<NEW_LINE>CurrencyPair pair = new CurrencyPair("DASH", "BTC");<NEW_LINE>LimitOrder limitOrder = new LimitOrder.Builder(OrderType.BID, pair).limitPrice(new BigDecimal("0.00001000")).originalAmount(new BigDecimal("100")).build();<NEW_LINE>try {<NEW_LINE>String uuid = tradeService.placeCCEXLimitOrder(limitOrder);<NEW_LINE>System.out.println("Order successfully placed. ID=" + uuid);<NEW_LINE>// wait for order to propagate<NEW_LINE>Thread.sleep(7000);<NEW_LINE>System.out.println();<NEW_LINE>System.out.<MASK><NEW_LINE>System.out.println("Attempting to cancel order " + uuid);<NEW_LINE>boolean cancelled = tradeService.cancelCCEXLimitOrder(uuid);<NEW_LINE>if (cancelled) {<NEW_LINE>System.out.println("Order successfully canceled.");<NEW_LINE>} else {<NEW_LINE>System.out.println("Order not successfully canceled.");<NEW_LINE>}<NEW_LINE>// wait for cancellation to propagate<NEW_LINE>Thread.sleep(7000);<NEW_LINE>System.out.println();<NEW_LINE>System.out.println(tradeService.getCCEXOpenOrders());<NEW_LINE>} catch (Exception e) {<NEW_LINE>e.printStackTrace();<NEW_LINE>}<NEW_LINE>} | println(tradeService.getCCEXOpenOrders()); |
509,261 | private static boolean verify(JReleaserContext context, Keyring keyring, FilePair filePair) throws SigningException {<NEW_LINE>context.getLogger().setPrefix("verify");<NEW_LINE>try {<NEW_LINE>context.getLogger().debug("{}", context.relativizeToBasedir(filePair.signatureFile));<NEW_LINE>InputStream sigInputStream = PGPUtil.getDecoderStream(new BufferedInputStream(new FileInputStream(filePair.signatureFile.toFile())));<NEW_LINE>PGPObjectFactory pgpObjFactory = new PGPObjectFactory(sigInputStream, keyring.getKeyFingerPrintCalculator());<NEW_LINE>Iterable<?> pgpSigList = null;<NEW_LINE><MASK><NEW_LINE>if (obj instanceof PGPCompressedData) {<NEW_LINE>PGPCompressedData c1 = (PGPCompressedData) obj;<NEW_LINE>pgpObjFactory = new PGPObjectFactory(c1.getDataStream(), keyring.getKeyFingerPrintCalculator());<NEW_LINE>pgpSigList = (Iterable<?>) pgpObjFactory.nextObject();<NEW_LINE>} else {<NEW_LINE>pgpSigList = (Iterable<?>) obj;<NEW_LINE>}<NEW_LINE>InputStream fileInputStream = new BufferedInputStream(new FileInputStream(filePair.inputFile.toFile()));<NEW_LINE>PGPSignature sig = (PGPSignature) pgpSigList.iterator().next();<NEW_LINE>PGPPublicKey pubKey = keyring.readPublicKey();<NEW_LINE>sig.init(new JcaPGPContentVerifierBuilderProvider().setProvider(BouncyCastleProvider.PROVIDER_NAME), pubKey);<NEW_LINE>int ch;<NEW_LINE>while ((ch = fileInputStream.read()) >= 0) {<NEW_LINE>sig.update((byte) ch);<NEW_LINE>}<NEW_LINE>fileInputStream.close();<NEW_LINE>sigInputStream.close();<NEW_LINE>return sig.verify();<NEW_LINE>} catch (IOException | PGPException e) {<NEW_LINE>throw new SigningException(RB.$("ERROR_signing_verify_signature", context.relativizeToBasedir(filePair.inputFile)), e);<NEW_LINE>} finally {<NEW_LINE>context.getLogger().restorePrefix();<NEW_LINE>}<NEW_LINE>} | Object obj = pgpObjFactory.nextObject(); |
849,280 | public static ScenarioSetup initRestartProcessInstanceBatch() {<NEW_LINE>return new ScenarioSetup() {<NEW_LINE><NEW_LINE>public void execute(ProcessEngine engine, String scenarioName) {<NEW_LINE>List<String> <MASK><NEW_LINE>String processDefinitionId = null;<NEW_LINE>for (int i = 0; i < 10; i++) {<NEW_LINE>ProcessInstance processInstance = engine.getRuntimeService().startProcessInstanceByKey("oneTaskProcessRestart_710", "RestartProcessInstanceBatchScenario");<NEW_LINE>processDefinitionId = processInstance.getProcessDefinitionId();<NEW_LINE>processInstanceIds.add(processInstance.getId());<NEW_LINE>String taskId = engine.getTaskService().createTaskQuery().processDefinitionKey("oneTaskProcessRestart_710").processInstanceBusinessKey("RestartProcessInstanceBatchScenario").singleResult().getId();<NEW_LINE>engine.getTaskService().complete(taskId);<NEW_LINE>}<NEW_LINE>Batch batch = engine.getRuntimeService().restartProcessInstances(processDefinitionId).startBeforeActivity("theTask").processInstanceIds(processInstanceIds).skipCustomListeners().skipIoMappings().withoutBusinessKey().executeAsync();<NEW_LINE>engine.getManagementService().setProperty("RestartProcessInstanceBatchScenario.batchId", batch.getId());<NEW_LINE>}<NEW_LINE>};<NEW_LINE>} | processInstanceIds = new ArrayList<>(); |
1,819,436 | final SendActivationCodeResult executeSendActivationCode(SendActivationCodeRequest sendActivationCodeRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(sendActivationCodeRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<SendActivationCodeRequest> request = null;<NEW_LINE>Response<SendActivationCodeResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new SendActivationCodeRequestProtocolMarshaller(protocolFactory).marshall<MASK><NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "SSM Contacts");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "SendActivationCode");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<SendActivationCodeResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new SendActivationCodeResultJsonUnmarshaller());<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>} | (super.beforeMarshalling(sendActivationCodeRequest)); |
350,785 | public static ListCasesResponse unmarshall(ListCasesResponse listCasesResponse, UnmarshallerContext _ctx) {<NEW_LINE>listCasesResponse.setRequestId(_ctx.stringValue("ListCasesResponse.RequestId"));<NEW_LINE>listCasesResponse.setMessage(_ctx.stringValue("ListCasesResponse.Message"));<NEW_LINE>listCasesResponse.setHttpStatusCode(_ctx.longValue("ListCasesResponse.HttpStatusCode"));<NEW_LINE>listCasesResponse.setCode(_ctx.stringValue("ListCasesResponse.Code"));<NEW_LINE>listCasesResponse.setSuccess(_ctx.booleanValue("ListCasesResponse.Success"));<NEW_LINE>Data data = new Data();<NEW_LINE>data.setPageNumber(_ctx.longValue("ListCasesResponse.Data.PageNumber"));<NEW_LINE>data.setPageSize(_ctx.longValue("ListCasesResponse.Data.PageSize"));<NEW_LINE>data.setTotalCount(_ctx.longValue("ListCasesResponse.Data.TotalCount"));<NEW_LINE>List<ListItem> list = new ArrayList<ListItem>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("ListCasesResponse.Data.List.Length"); i++) {<NEW_LINE>ListItem listItem = new ListItem();<NEW_LINE>listItem.setAbandonType(_ctx.stringValue("ListCasesResponse.Data.List[" + i + "].AbandonType"));<NEW_LINE>listItem.setAttemptCount(_ctx.longValue("ListCasesResponse.Data.List[" + i + "].AttemptCount"));<NEW_LINE>listItem.setExpandInfo(_ctx.stringValue("ListCasesResponse.Data.List[" + i + "].ExpandInfo"));<NEW_LINE>listItem.setFailureReason(_ctx.stringValue<MASK><NEW_LINE>listItem.setPhoneNumber(_ctx.stringValue("ListCasesResponse.Data.List[" + i + "].PhoneNumber"));<NEW_LINE>listItem.setState(_ctx.stringValue("ListCasesResponse.Data.List[" + i + "].State"));<NEW_LINE>listItem.setCaseId(_ctx.stringValue("ListCasesResponse.Data.List[" + i + "].CaseId"));<NEW_LINE>listItem.setCustomVariables(_ctx.stringValue("ListCasesResponse.Data.List[" + i + "].CustomVariables"));<NEW_LINE>list.add(listItem);<NEW_LINE>}<NEW_LINE>data.setList(list);<NEW_LINE>listCasesResponse.setData(data);<NEW_LINE>return listCasesResponse;<NEW_LINE>} | ("ListCasesResponse.Data.List[" + i + "].FailureReason")); |
1,528,766 | private static void tryAssertion18(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(1200, 0, new Object[][] { { "IBM", 34d }, { "MSFT", 34d } });<NEW_LINE>expected.addResultInsert(2200, 0, new Object[][] { { "IBM", 85d }, { "MSFT", 85d }, { "IBM", 85d }, { "YAH", 85d }, { "IBM", 85d } });<NEW_LINE>expected.addResultInsert(3200, 0, new Object[][] { { "IBM", 85d }, { "MSFT", 85d }, { "IBM", 85d }, { "YAH", 85d }, { "IBM", 85d } });<NEW_LINE>expected.addResultInsert(4200, 0, new Object[][] { { "IBM", 87d }, { "MSFT", 87d }, { "IBM", 87d }, { "YAH", 87d }, { "IBM", 87d }<MASK><NEW_LINE>expected.addResultInsert(5200, 0, new Object[][] { { "IBM", 112d }, { "MSFT", 112d }, { "IBM", 112d }, { "YAH", 112d }, { "IBM", 112d }, { "YAH", 112d }, { "IBM", 112d }, { "YAH", 112d } });<NEW_LINE>expected.addResultInsert(6200, 0, new Object[][] { { "MSFT", 88d }, { "IBM", 88d }, { "YAH", 88d }, { "IBM", 88d }, { "YAH", 88d }, { "IBM", 88d }, { "YAH", 88d }, { "YAH", 88d } });<NEW_LINE>expected.addResultInsert(7200, 0, new Object[][] { { "IBM", 54d }, { "YAH", 54d }, { "IBM", 54d }, { "YAH", 54d }, { "YAH", 54d } });<NEW_LINE>ResultAssertExecution execution = new ResultAssertExecution(stmtText, env, expected);<NEW_LINE>execution.execute(false, milestone);<NEW_LINE>} | , { "YAH", 87d } }); |
1,493,474 | public CreateAppResult createApp(CreateAppRequest createAppRequest) throws AmazonServiceException, AmazonClientException {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(createAppRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<CreateAppRequest> request = null;<NEW_LINE>Response<CreateAppResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new <MASK><NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>Unmarshaller<CreateAppResult, JsonUnmarshallerContext> unmarshaller = new CreateAppResultJsonUnmarshaller();<NEW_LINE>JsonResponseHandler<CreateAppResult> responseHandler = new JsonResponseHandler<CreateAppResult>(unmarshaller);<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.ClientExecuteTime);<NEW_LINE>endClientExecution(awsRequestMetrics, request, response, LOGGING_AWS_REQUEST_METRIC);<NEW_LINE>}<NEW_LINE>} | CreateAppRequestMarshaller().marshall(createAppRequest); |
1,394,881 | public ApiResponse handleApiView(String name, JSONObject params) throws ApiException {<NEW_LINE>if (VIEW_PARAMS.equals(name)) {<NEW_LINE>ApiResponseList result = new ApiResponseList("Parameters");<NEW_LINE>if (params.containsKey(VIEW_PARAMS_PARAM_SITE)) {<NEW_LINE>String paramSite = params.getString(VIEW_PARAMS_PARAM_SITE);<NEW_LINE>if (!paramSite.isEmpty()) {<NEW_LINE>String <MASK><NEW_LINE>if (!extension.hasSite(site)) {<NEW_LINE>throw new ApiException(ApiException.Type.DOES_NOT_EXIST, paramSite);<NEW_LINE>}<NEW_LINE>if (extension.hasParameters(site)) {<NEW_LINE>result.addItem(createSiteParamStatsResponse(extension.getSiteParameters(site)));<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>Collection<SiteParameters> siteParams = extension.getAllSiteParameters();<NEW_LINE>for (SiteParameters siteParam : siteParams) {<NEW_LINE>result.addItem(createSiteParamStatsResponse(siteParam));<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>} else {<NEW_LINE>throw new ApiException(ApiException.Type.BAD_VIEW);<NEW_LINE>}<NEW_LINE>} | site = ApiUtils.getAuthority(paramSite); |
1,311,077 | protected void init() {<NEW_LINE>myErrorText = new ErrorText(getErrorTextAlignment());<NEW_LINE>myErrorText.setVisible(false);<NEW_LINE>final ComponentAdapter resizeListener = new ComponentAdapter() {<NEW_LINE><NEW_LINE>private int myHeight;<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void componentResized(ComponentEvent event) {<NEW_LINE>int height = !myErrorText.isVisible() ? 0 : event.getComponent().getHeight();<NEW_LINE>if (height != myHeight) {<NEW_LINE>myHeight = height;<NEW_LINE>myResizeInProgress = true;<NEW_LINE>myErrorText.setMinimumSize(new Dimension(0, height));<NEW_LINE>JRootPane root = myPeer.getRootPane();<NEW_LINE>if (root != null) {<NEW_LINE>root.validate();<NEW_LINE>}<NEW_LINE>if (myActualSize != null && !shouldAddErrorNearButtons()) {<NEW_LINE>myPeer.setSize(myActualSize.<MASK><NEW_LINE>}<NEW_LINE>myErrorText.revalidate();<NEW_LINE>myResizeInProgress = false;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>};<NEW_LINE>myErrorText.myLabel.addComponentListener(resizeListener);<NEW_LINE>Disposer.register(myDisposable, () -> myErrorText.myLabel.removeComponentListener(resizeListener));<NEW_LINE>final JPanel root = new JPanel(createRootLayout());<NEW_LINE>myPeer.setContentPane(root);<NEW_LINE>final CustomShortcutSet sc = new CustomShortcutSet(SHOW_OPTION_KEYSTROKE);<NEW_LINE>final AnAction toggleShowOptions = new NoTransactionAction() {<NEW_LINE><NEW_LINE>@RequiredUIAccess<NEW_LINE>@Override<NEW_LINE>public void actionPerformed(AnActionEvent e) {<NEW_LINE>expandNextOptionButton();<NEW_LINE>}<NEW_LINE>};<NEW_LINE>toggleShowOptions.registerCustomShortcutSet(sc, root);<NEW_LINE>initRootPanel(root);<NEW_LINE>if (myErrorPane == null) {<NEW_LINE>myErrorPane = root;<NEW_LINE>}<NEW_LINE>MnemonicHelper.init(root);<NEW_LINE>if (!postponeValidation()) {<NEW_LINE>startTrackingValidation();<NEW_LINE>}<NEW_LINE>if (SystemInfo.isWindows) {<NEW_LINE>installEnterHook(root);<NEW_LINE>}<NEW_LINE>} | width, myActualSize.height + height); |
34,645 | public void validateStatement(String contextName, StatementSpecCompiled spec, StatementCompileTimeServices compileTimeServices) throws ExprValidationException {<NEW_LINE>StatementSpecCompiledAnalyzerResult <MASK><NEW_LINE>List<FilterSpecCompiled> filters = streamAnalysis.getFilters();<NEW_LINE>// Category validation<NEW_LINE>boolean isCreateWindow = spec.getRaw().getCreateWindowDesc() != null;<NEW_LINE>String message = "Category context '" + contextName + "' requires that any of the events types that are listed in the category context also appear in any of the filter expressions of the statement";<NEW_LINE>// if no create-window: at least one of the filters must match one of the filters specified by the context<NEW_LINE>if (!isCreateWindow) {<NEW_LINE>for (FilterSpecCompiled filter : filters) {<NEW_LINE>EventType stmtFilterType = filter.getFilterForEventType();<NEW_LINE>if (stmtFilterType == categoryEventType) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (EventTypeUtility.isTypeOrSubTypeOf(stmtFilterType, categoryEventType)) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (!filters.isEmpty()) {<NEW_LINE>throw new ExprValidationException(message);<NEW_LINE>}<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// validate create-window<NEW_LINE>String declaredAsName = spec.getRaw().getCreateWindowDesc().getAsEventTypeName();<NEW_LINE>if (declaredAsName != null) {<NEW_LINE>if (categoryEventType.getName().equals(declaredAsName)) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>throw new ExprValidationException(message);<NEW_LINE>}<NEW_LINE>} | streamAnalysis = StatementSpecCompiledAnalyzer.analyzeFilters(spec); |
211,739 | private void loadNode37() throws IOException, SAXException {<NEW_LINE>DataTypeDescriptionTypeNode node = new DataTypeDescriptionTypeNode(this.context, Identifiers.OpcUa_XmlSchema_BuildInfo, new QualifiedName(0, "BuildInfo"), new LocalizedText("en", "BuildInfo"), LocalizedText.NULL_VALUE, UInteger.valueOf(0), UInteger.valueOf(0), new DataValue(Variant.NULL_VALUE), Identifiers.String, -1, new UInteger[] {}, UByte.valueOf(1), UByte.valueOf(1), 0.0, false);<NEW_LINE>node.addReference(new Reference(Identifiers.OpcUa_XmlSchema_BuildInfo, Identifiers.HasTypeDefinition, Identifiers.DataTypeDescriptionType.expanded(), true));<NEW_LINE>node.addReference(new Reference(Identifiers.OpcUa_XmlSchema_BuildInfo, Identifiers.HasComponent, Identifiers.OpcUa_XmlSchema.expanded(), false));<NEW_LINE>StringBuilder sb = new StringBuilder();<NEW_LINE>sb.append("<String xmlns=\"http://opcfoundation.org/UA/2008/02/Types.xsd\">//xs:element[@name='BuildInfo']</String>");<NEW_LINE>String xml = sb.toString();<NEW_LINE>OpcUaXmlStreamDecoder decoder = new OpcUaXmlStreamDecoder(context.getServer().getSerializationContext()).setInput(new StringReader(xml));<NEW_LINE>Object o = decoder.readVariantValue();<NEW_LINE>DataValue value = new <MASK><NEW_LINE>node.setValue(value);<NEW_LINE>this.nodeManager.addNode(node);<NEW_LINE>} | DataValue(new Variant(o)); |
343,291 | public boolean apply(Game game, Ability source) {<NEW_LINE>Player controller = game.getPlayer(source.getControllerId());<NEW_LINE>MageObject mageObject = game.getObject(source);<NEW_LINE>if (controller == null || mageObject == null) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>Permanent faceDownCreature = game.getPermanent(getTargetPointer().getFirst(game, source));<NEW_LINE>if (faceDownCreature != null) {<NEW_LINE>Permanent copyFaceDown = faceDownCreature.copy();<NEW_LINE>copyFaceDown.setFaceDown(false, game);<NEW_LINE>Cards cards = new CardsImpl(copyFaceDown);<NEW_LINE>Player player = game.getPlayer(faceDownCreature.getControllerId());<NEW_LINE>controller.lookAtCards("face down card - " + mageObject.<MASK><NEW_LINE>if (player != null) {<NEW_LINE>game.informPlayers(controller.getLogName() + " looks at a face down creature of " + player.getLogName());<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>} | getName(), cards, game); |
792,888 | public void doXContent(XContentBuilder builder, Params params) throws IOException {<NEW_LINE>builder.startObject(NAME);<NEW_LINE>builder.field(<MASK><NEW_LINE>builder.startArray(FIELDS_FIELD.getPreferredName());<NEW_LINE>for (Map.Entry<String, Float> fieldEntry : this.fieldsAndBoosts.entrySet()) {<NEW_LINE>builder.value(fieldEntry.getKey() + "^" + fieldEntry.getValue());<NEW_LINE>}<NEW_LINE>builder.endArray();<NEW_LINE>builder.field(OPERATOR_FIELD.getPreferredName(), operator.toString());<NEW_LINE>if (minimumShouldMatch != null) {<NEW_LINE>builder.field(MINIMUM_SHOULD_MATCH_FIELD.getPreferredName(), minimumShouldMatch);<NEW_LINE>}<NEW_LINE>builder.field(ZERO_TERMS_QUERY_FIELD.getPreferredName(), zeroTermsQuery.toString());<NEW_LINE>builder.field(GENERATE_SYNONYMS_PHRASE_QUERY.getPreferredName(), autoGenerateSynonymsPhraseQuery);<NEW_LINE>printBoostAndQueryName(builder);<NEW_LINE>builder.endObject();<NEW_LINE>} | QUERY_FIELD.getPreferredName(), value); |
648,620 | public void startElement(String tag, Map<String, String> h) {<NEW_LINE>switch(tag) {<NEW_LINE>case "hyphen-char":<NEW_LINE>String hh = h.get("value");<NEW_LINE>if (hh != null && hh.length() == 1) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>break;<NEW_LINE>case "classes":<NEW_LINE>currElement = ELEM_CLASSES;<NEW_LINE>break;<NEW_LINE>case "patterns":<NEW_LINE>currElement = ELEM_PATTERNS;<NEW_LINE>break;<NEW_LINE>case "exceptions":<NEW_LINE>currElement = ELEM_EXCEPTIONS;<NEW_LINE>exception = new ArrayList<>();<NEW_LINE>break;<NEW_LINE>case "hyphen":<NEW_LINE>if (token.length() > 0) {<NEW_LINE>exception.add(token.toString());<NEW_LINE>}<NEW_LINE>exception.add(new Hyphen(h.get("pre"), h.get("no"), h.get("post")));<NEW_LINE>currElement = ELEM_HYPHEN;<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>token.setLength(0);<NEW_LINE>} | hyphenChar = hh.charAt(0); |
224,130 | protected ModelAndView handleContext(String contextName, Context context, HttpServletRequest request, HttpServletResponse response) throws Exception {<NEW_LINE>String resourceName = ServletRequestUtils.getStringParameter(request, "resource", null);<NEW_LINE>String <MASK><NEW_LINE>String redirectUrl;<NEW_LINE>if (referer != null) {<NEW_LINE>redirectUrl = referer.replaceAll(replacePattern, "");<NEW_LINE>} else {<NEW_LINE>redirectUrl = request.getContextPath() + getViewName();<NEW_LINE>}<NEW_LINE>if (resourceName != null && resourceName.length() > 0) {<NEW_LINE>boolean reset = false;<NEW_LINE>try {<NEW_LINE>reset = getContainerWrapper().getResourceResolver().resetResource(context, resourceName, getContainerWrapper());<NEW_LINE>} catch (NamingException e) {<NEW_LINE>request.setAttribute("errorMessage", getMessageSourceAccessor().getMessage("probe.src.reset.datasource.notfound", new Object[] { resourceName }));<NEW_LINE>logger.trace("", e);<NEW_LINE>}<NEW_LINE>if (!reset) {<NEW_LINE>request.setAttribute("errorMessage", getMessageSourceAccessor().getMessage("probe.src.reset.datasource.c3p0"));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>logger.debug("Redirected to {}", redirectUrl);<NEW_LINE>return new ModelAndView(new RedirectView(redirectUrl));<NEW_LINE>} | referer = request.getHeader("Referer"); |
757,042 | default URI absoluteUri() {<NEW_LINE>try {<NEW_LINE>// Use raw string representation and URL to avoid re-encoding chars like '%'<NEW_LINE>URI partialUri = new URL(isSecure() ? "https" : "http", localAddress(), localPort(), path().absolute().toRawString()).toURI();<NEW_LINE>StringBuilder sb = new StringBuilder(partialUri.toString());<NEW_LINE>if (uri().toString().endsWith("/") && sb.charAt(sb.length() - 1) != '/') {<NEW_LINE>sb.append('/');<NEW_LINE>}<NEW_LINE>// unfortunately, the URI constructor encodes the 'query' and 'fragment' which is totally silly<NEW_LINE>if (query() != null && !query().isEmpty()) {<NEW_LINE>sb.append("?"<MASK><NEW_LINE>}<NEW_LINE>if (fragment() != null && !fragment().isEmpty()) {<NEW_LINE>sb.append("#").append(fragment());<NEW_LINE>}<NEW_LINE>return new URI(sb.toString());<NEW_LINE>} catch (URISyntaxException | MalformedURLException e) {<NEW_LINE>throw new HttpException("Unable to parse request URL", Http.Status.BAD_REQUEST_400, e);<NEW_LINE>}<NEW_LINE>} | ).append(query()); |
620,200 | public Result processWorkPackage(@NonNull final I_C_Queue_WorkPackage workpackage, final String localTrxName) {<NEW_LINE>trxManager.assertTrxNameNull(localTrxName);<NEW_LINE>final Properties ctx = InterfaceWrapperHelper.getCtx(workpackage);<NEW_LINE>final int adClientId = workpackage.getAD_Client_ID();<NEW_LINE>Check.assume(adClientId > 0, "No point in calling this process with AD_Client_ID=0");<NEW_LINE>//<NEW_LINE>// Get parameters<NEW_LINE>final int maxInvoiceCandidatesToUpdate = getMaxInvoiceCandidatesToUpdate();<NEW_LINE>//<NEW_LINE>// Update invalid ICs<NEW_LINE>// Only those which are not locked at all<NEW_LINE>invoiceCandBL.updateInvalid().setContext(ctx, localTrxName).setLockedBy(ILock.NULL).setTaggedWithNoTag().setLimit(maxInvoiceCandidatesToUpdate).update();<NEW_LINE>//<NEW_LINE>// If we updated just a limited set of invoice candidates,<NEW_LINE>// then create a new workpackage to update the rest of them.<NEW_LINE>if (maxInvoiceCandidatesToUpdate > 0) {<NEW_LINE>final int countRemaining = invoiceCandDAO.tagToRecompute().setContext(ctx, localTrxName).setLockedBy(ILock.NULL).setTaggedWithNoTag().countToBeTagged();<NEW_LINE>if (countRemaining > 0) {<NEW_LINE>final AsyncBatchId asyncBatchId = AsyncBatchId.ofRepoIdOrNull(getC_Queue_WorkPackage().getC_Async_Batch_ID());<NEW_LINE>final IInvoiceCandUpdateSchedulerRequest request = InvoiceCandUpdateSchedulerRequest.of(ctx, localTrxName, asyncBatchId);<NEW_LINE>schedule(request);<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>return Result.SUCCESS;<NEW_LINE>} | Loggables.addLog("Scheduled another workpackage for {} remaining recompute records", countRemaining); |
31,009 | public SelectResourceConfigResult unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>SelectResourceConfigResult selectResourceConfigResult = new SelectResourceConfigResult();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE><MASK><NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return selectResourceConfigResult;<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("Results", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>selectResourceConfigResult.setResults(new ListUnmarshaller<String>(context.getUnmarshaller(String.class)).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("QueryInfo", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>selectResourceConfigResult.setQueryInfo(QueryInfoJsonUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("NextToken", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>selectResourceConfigResult.setNextToken(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 selectResourceConfigResult;<NEW_LINE>} | JsonToken token = context.getCurrentToken(); |
1,448,383 | private void convertGroupsToInternalRep(List<LDAPObject> ldapGroups, Map<String, LDAPObject> ldapGroupsMap, List<GroupTreeResolver.Group> ldapGroupsRep) {<NEW_LINE>String groupsRdnAttr = config.getGroupNameLdapAttribute();<NEW_LINE>for (LDAPObject ldapGroup : ldapGroups) {<NEW_LINE>String groupName = ldapGroup.getAttributeAsString(groupsRdnAttr);<NEW_LINE>// String groupName = ldapGroup.getUuid();<NEW_LINE>if (config.isPreserveGroupsInheritance()) {<NEW_LINE>Set<String> subgroupNames = new HashSet<>();<NEW_LINE>for (LDAPDn groupDn : getLDAPSubgroups(ldapGroup)) {<NEW_LINE>String subGroupName = groupDn.getFirstRdn().getAttrValue(groupsRdnAttr);<NEW_LINE>subgroupNames.add(subGroupName);<NEW_LINE>}<NEW_LINE>ldapGroupsRep.add(new GroupTreeResolver<MASK><NEW_LINE>}<NEW_LINE>ldapGroupsMap.put(groupName, ldapGroup);<NEW_LINE>}<NEW_LINE>} | .Group(groupName, subgroupNames)); |
1,299,131 | static RemoteMessage remoteMessageFromReadableMap(ReadableMap readableMap) {<NEW_LINE>RemoteMessage.Builder builder = new RemoteMessage.Builder(readableMap.getString(KEY_TO));<NEW_LINE>if (readableMap.hasKey(KEY_TTL)) {<NEW_LINE>builder.setTtl(readableMap.getInt(KEY_TTL));<NEW_LINE>}<NEW_LINE>if (readableMap.hasKey(KEY_MESSAGE_ID)) {<NEW_LINE>builder.setMessageId(readableMap.getString(KEY_MESSAGE_ID));<NEW_LINE>}<NEW_LINE>if (readableMap.hasKey(KEY_MESSAGE_TYPE)) {<NEW_LINE>builder.setMessageType(readableMap.getString(KEY_MESSAGE_TYPE));<NEW_LINE>}<NEW_LINE>if (readableMap.hasKey(KEY_COLLAPSE_KEY)) {<NEW_LINE>builder.setCollapseKey(readableMap.getString(KEY_COLLAPSE_KEY));<NEW_LINE>}<NEW_LINE>if (readableMap.hasKey(KEY_DATA)) {<NEW_LINE>ReadableMap <MASK><NEW_LINE>ReadableMapKeySetIterator iterator = messageData.keySetIterator();<NEW_LINE>while (iterator.hasNextKey()) {<NEW_LINE>String key = iterator.nextKey();<NEW_LINE>builder.addData(key, messageData.getString(key));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return builder.build();<NEW_LINE>} | messageData = readableMap.getMap(KEY_DATA); |
883,660 | public J.Identifier visitIdentifier(J.Identifier identifier, ExecutionContext ctx) {<NEW_LINE>J.Identifier i = super.visitIdentifier(identifier, ctx);<NEW_LINE>i = i.withMarkers(i.getMarkers().removeByType(LastRead.class));<NEW_LINE>Map<String, UUID> variableIds = getCursor().getNearestMessage("variables");<NEW_LINE>if (variableIds != null) {<NEW_LINE>UUID id = variableIds.<MASK><NEW_LINE>if (id != null) {<NEW_LINE>Cursor parent = getCursor().dropParentUntil(t -> t instanceof J && !(t instanceof J.Parentheses));<NEW_LINE>if (cursorIsInstanceOf(parent, J.Unary.class, J.Binary.class, J.If.class, J.Synchronized.class, J.ControlParentheses.class, J.ForLoop.Control.class, J.ForEachLoop.Control.class, J.WhileLoop.class, J.DoWhileLoop.class, J.InstanceOf.class, J.AssignmentOperation.class)) {<NEW_LINE>i = i.withMarkers(i.getMarkers().setByType(new LastRead(randomId(), id)));<NEW_LINE>} else {<NEW_LINE>Cursor grandparent = parent.dropParentUntil(t -> t instanceof J && !(t instanceof J.Parentheses));<NEW_LINE>if (cursorIsInstanceOf(grandparent, J.Binary.class)) {<NEW_LINE>i = i.withMarkers(i.getMarkers().setByType(new LastRead(randomId(), id)));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return i;<NEW_LINE>} | get(identifier.getSimpleName()); |
208,624 | private void createProtocolFinder(PortUnification pu) throws PropertyVetoException {<NEW_LINE>while (!(parser.getEventType() == END_ELEMENT && parser.getLocalName().equals("port-unification"))) {<NEW_LINE>try {<NEW_LINE>if (parser.next() == START_ELEMENT && parser.getLocalName().equals("protocol-finder") && pu != null) {<NEW_LINE>ProtocolFinder pf = <MASK><NEW_LINE>List<ProtocolFinder> pfList = pu.getProtocolFinder();<NEW_LINE>pfList.add(pf);<NEW_LINE>for (int i = 0; i < parser.getAttributeCount(); i++) {<NEW_LINE>String attr = parser.getAttributeLocalName(i);<NEW_LINE>String val = parser.getAttributeValue(i);<NEW_LINE>if (attr.equals("protocol")) {<NEW_LINE>pf.setProtocol(val);<NEW_LINE>}<NEW_LINE>if (attr.equals("name")) {<NEW_LINE>pf.setName(val);<NEW_LINE>}<NEW_LINE>if (attr.equals("classname")) {<NEW_LINE>pf.setClassname(val);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (TransactionFailure ex) {<NEW_LINE>LOGGER.log(Level.SEVERE, failureCreatingProtocolFinder, ex);<NEW_LINE>} catch (XMLStreamException ex) {<NEW_LINE>LOGGER.log(Level.SEVERE, problemParsingProtocolFinder, ex);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | pu.createChild(ProtocolFinder.class); |
1,605,387 | public static String format(double number, int width) {<NEW_LINE>Preconditions.checkArgument(number >= 0, "Non-negative numbers cannot be formatted by this method");<NEW_LINE>var integerDigits = (int) Math.max(0, Math.log10(number) + 1);<NEW_LINE>var fractionalDigits = width - integerDigits - 1;<NEW_LINE>var minFractional = Math.pow(10, -fractionalDigits);<NEW_LINE>var fractional = number - Math.floor(number);<NEW_LINE>// In cases where we have more integer digits than we have space, or when the fractional part is zero,<NEW_LINE>// we can go to the integer-formatter.<NEW_LINE>// We have to take the decimal point into account which we'd need if we would show the fractional.<NEW_LINE>if (fractional < 1e-9 || integerDigits > width - 1) {<NEW_LINE>return format<MASK><NEW_LINE>}<NEW_LINE>// If the fractional is smaller than the amount of fractional space we have, we omit<NEW_LINE>// the fractional and instead prefix "~"<NEW_LINE>if (fractional + 1e-9 < minFractional && integerDigits - 1 <= width) {<NEW_LINE>return "~" + format((long) number, width - 1);<NEW_LINE>}<NEW_LINE>// handles low numbers more efficiently since no format is needed<NEW_LINE>var format = getFormat();<NEW_LINE>format.setMaximumFractionDigits(fractionalDigits);<NEW_LINE>return format.format(number);<NEW_LINE>} | ((long) number, width); |
524,743 | public static void writeTsFile(String path) {<NEW_LINE>try {<NEW_LINE>File f = FSFactoryProducer.getFSFactory().getFile(path);<NEW_LINE>Files.delete(f.toPath());<NEW_LINE>Schema schema = new Schema();<NEW_LINE>schema.extendTemplate(DEFAULT_TEMPLATE, new MeasurementSchema("sensor_1", TSDataType.FLOAT, TSEncoding.RLE));<NEW_LINE>schema.extendTemplate(DEFAULT_TEMPLATE, new MeasurementSchema("sensor_2", TSDataType<MASK><NEW_LINE>schema.extendTemplate(DEFAULT_TEMPLATE, new MeasurementSchema("sensor_3", TSDataType.INT32, TSEncoding.TS_2DIFF));<NEW_LINE>try (TsFileWriter tsFileWriter = new TsFileWriter(f, schema)) {<NEW_LINE>// construct TSRecord<NEW_LINE>for (int i = 0; i < 100; i++) {<NEW_LINE>TSRecord tsRecord = new TSRecord(i, "device_" + (i % 4));<NEW_LINE>DataPoint dPoint1 = new LongDataPoint("sensor_1", i);<NEW_LINE>DataPoint dPoint2 = new LongDataPoint("sensor_2", i);<NEW_LINE>DataPoint dPoint3 = new LongDataPoint("sensor_3", i);<NEW_LINE>tsRecord.addTuple(dPoint1);<NEW_LINE>tsRecord.addTuple(dPoint2);<NEW_LINE>tsRecord.addTuple(dPoint3);<NEW_LINE>// write TSRecord<NEW_LINE>tsFileWriter.write(tsRecord);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>logger.error("Write {} failed. ", path, e);<NEW_LINE>}<NEW_LINE>} | .INT32, TSEncoding.TS_2DIFF)); |
577,181 | private boolean arePrefsChanged(String mimeType) {<NEW_LINE>boolean isChanged = false;<NEW_LINE>Preferences prefs = selector.getPreferences(mimeType);<NEW_LINE>Preferences savedPrefs = MimeLookup.getLookup(mimeType).lookup(Preferences.class);<NEW_LINE>HashSet<String> hashSet = new HashSet<String>();<NEW_LINE>try {<NEW_LINE>hashSet.addAll(Arrays.asList(prefs.keys()));<NEW_LINE>hashSet.addAll(Arrays.asList(savedPrefs.keys()));<NEW_LINE>} catch (BackingStoreException ex) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>for (String key : hashSet) {<NEW_LINE>String current = prefs.get(key, null);<NEW_LINE>String saved = <MASK><NEW_LINE>if (saved == null) {<NEW_LINE>if (key.equals(SimpleValueNames.ON_SAVE_REMOVE_TRAILING_WHITESPACE) || key.equals(SimpleValueNames.ON_SAVE_REFORMAT)) {<NEW_LINE>// NOI18N<NEW_LINE>saved = "never";<NEW_LINE>} else if (key.equals(SimpleValueNames.ON_SAVE_USE_GLOBAL_SETTINGS)) {<NEW_LINE>// NOI18N<NEW_LINE>saved = "true";<NEW_LINE>} else {<NEW_LINE>saved = selector.getSavedValue(mimeType, key);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>isChanged |= current == null ? saved != null : !current.equals(saved);<NEW_LINE>if (isChanged) {<NEW_LINE>// no need to iterate further<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return isChanged;<NEW_LINE>} | savedPrefs.get(key, null); |
1,102,588 | public Future<ResultString> deployDirectory() {<NEW_LINE>JFileChooser chooser = new JFileChooser();<NEW_LINE>chooser.setDialogTitle(NbBundle.getMessage(Hk2ItemNode.class, "LBL_ChooseButton"));<NEW_LINE>chooser.setDialogType(JFileChooser.CUSTOM_DIALOG);<NEW_LINE>chooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);<NEW_LINE>chooser.setMultiSelectionEnabled(false);<NEW_LINE>int returnValue = chooser.showDialog(WindowManager.getDefault().getMainWindow(), NbBundle.getMessage<MASK><NEW_LINE>if (instance != null || returnValue != JFileChooser.APPROVE_OPTION) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>final File dir = new File(chooser.getSelectedFile().getAbsolutePath());<NEW_LINE>Future<ResultString> future = ServerAdmin.<ResultString>exec(instance, new CommandDeploy(dir.getParentFile().getName(), Util.computeTarget(instance.getProperties()), dir, null, null, null, instance.isHotDeployEnabled()));<NEW_LINE>status = new WeakReference<Future<ResultString>>(future);<NEW_LINE>return future;<NEW_LINE>} | (Hk2ItemNode.class, "LBL_ChooseButton")); |
868,677 | public static URI parseURI(String connectionString, URI defaultURI) {<NEW_LINE>final URI uri = parseMaybeWithScheme(connectionString, <MASK><NEW_LINE>// Repack the connection string with provided default elements - where missing from the original string - and reparse into a URI.<NEW_LINE>final String scheme = uri.getScheme() != null ? uri.getScheme() : defaultURI.getScheme();<NEW_LINE>// TODO: support for IDN<NEW_LINE>final String host = uri.getHost() != null ? uri.getHost() : defaultURI.getHost();<NEW_LINE>final String path = "".equals(uri.getPath()) ? defaultURI.getPath() : uri.getPath();<NEW_LINE>final String rawQuery = uri.getQuery() == null ? defaultURI.getRawQuery() : uri.getRawQuery();<NEW_LINE>final String rawFragment = uri.getFragment() == null ? defaultURI.getRawFragment() : uri.getRawFragment();<NEW_LINE>final int port = uri.getPort() < 0 ? defaultURI.getPort() : uri.getPort();<NEW_LINE>try {<NEW_LINE>// The query part is attached in original "raw" format, to preserve the escaping of characters. This is needed since any<NEW_LINE>// escaped query structure characters (`&` and `=`) wouldn't remain escaped when passed back through the URI constructor<NEW_LINE>// (since they are legal in the query part), and that would later interfere with correctly parsing the attributes.<NEW_LINE>// And same with escaped `#` chars in the fragment part.<NEW_LINE>String connStr = new URI(scheme, uri.getUserInfo(), host, port, path, null, null).toString();<NEW_LINE>if (StringUtils.hasLength(rawQuery)) {<NEW_LINE>connStr += "?" + rawQuery;<NEW_LINE>}<NEW_LINE>if (StringUtils.hasLength(rawFragment)) {<NEW_LINE>connStr += "#" + rawFragment;<NEW_LINE>}<NEW_LINE>return new URI(connStr);<NEW_LINE>} catch (URISyntaxException e) {<NEW_LINE>// should only happen if the defaultURI is malformed<NEW_LINE>throw new IllegalArgumentException("Invalid connection configuration [" + connectionString + "]: " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>} | defaultURI.getScheme() + "://"); |
1,559,067 | private List<HintDeclaration> computeExcerptProjectionHints(TypeSystem typeSystem) {<NEW_LINE>TypeHintCreatingProcessor excerptProjectionProcessor = TypeProcessor.namedProcessor("RestMvcConfigurationProcessor - ExcerptProjection").<MASK><NEW_LINE>return typeSystem.findTypesAnnotated(REPOSITORY_REST_RESOURCE, true).stream().map(typeSystem::resolveName).flatMap(type -> {<NEW_LINE>Map<String, String> annotationValuesInHierarchy = type.getAnnotationValuesInHierarchy(REPOSITORY_REST_RESOURCE);<NEW_LINE>if (!annotationValuesInHierarchy.containsKey("excerptProjection")) {<NEW_LINE>return Stream.empty();<NEW_LINE>}<NEW_LINE>String excerptProjectionSignatureType = annotationValuesInHierarchy.get("excerptProjection");<NEW_LINE>Type targetProjectionType = typeSystem.resolve(TypeName.fromTypeSignature(excerptProjectionSignatureType));<NEW_LINE>if (targetProjectionType == null || targetProjectionType.getDottedName().equals("org.springframework.data.rest.core.annotation.RepositoryRestResource$None")) {<NEW_LINE>return Stream.empty();<NEW_LINE>}<NEW_LINE>List<HintDeclaration> projectionHints = new ArrayList<>();<NEW_LINE>// types reachable<NEW_LINE>projectionHints.addAll(excerptProjectionProcessor.toProcessType(targetProjectionType));<NEW_LINE>// the projection proxy<NEW_LINE>HintDeclaration proxyHint = new HintDeclaration();<NEW_LINE>JdkProxyDescriptor proxyDescriptor = new JdkProxyDescriptor(Arrays.asList(targetProjectionType.getDottedName(), "org.springframework.data.projection.TargetAware", "org.springframework.aop.SpringProxy", "org.springframework.core.DecoratingProxy"));<NEW_LINE>proxyHint.addProxyDescriptor(proxyDescriptor);<NEW_LINE>projectionHints.add(proxyHint);<NEW_LINE>return projectionHints.stream();<NEW_LINE>}).collect(Collectors.toList());<NEW_LINE>} | skipFieldInspection().use(typeSystem); |
1,623,663 | public Map<Map.Entry<Client, PaxosValue>, PaxosResponse> apply(Set<Map.Entry<Client, PaxosValue>> request) {<NEW_LINE>SetMultimap<Client, PaxosValue> requestAsMultimap = ImmutableSetMultimap.copyOf(request);<NEW_LINE>for (WithDedicatedExecutor<BatchPaxosLearner> remoteLearner : remoteLearners) {<NEW_LINE>try {<NEW_LINE>remoteLearner.executor().execute(() -> {<NEW_LINE>try {<NEW_LINE>remoteLearner.<MASK><NEW_LINE>} catch (Throwable e) {<NEW_LINE>log.warn("Failed to teach learner after scheduling the task.", e);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} catch (CheckedRejectedExecutionException e) {<NEW_LINE>log.warn("Failed to teach learner, because we could not schedule the task at all", e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// force local learner to update<NEW_LINE>localLearner.service().learn(requestAsMultimap);<NEW_LINE>return Maps.toMap(request, $ -> SUCCESSFUL_RESPONSE);<NEW_LINE>} | service().learn(requestAsMultimap); |
1,385,821 | public WxOutMsg eventClick(WxInMsg msg) {<NEW_LINE>String eventKey = msg.getEventKey();<NEW_LINE>log.debug("eventKey: " + eventKey);<NEW_LINE>log.debug("extKey: " + msg.getExtkey());<NEW_LINE>Wx_reply reply = wxReplyService.fetch(Cnd.where("type", "=", "keyword").and("wxid", "=", msg.getExtkey()).and("keyword", "=", eventKey));<NEW_LINE>if (reply != null) {<NEW_LINE>if ("txt".equals(reply.getMsgType())) {<NEW_LINE>String txtId = reply.getContent();<NEW_LINE>Wx_reply_txt txt = wxReplyTxtService.fetch(txtId);<NEW_LINE>return Wxs.respText(null, txt == null ? "" : txt.getContent());<NEW_LINE>} else if ("image".equals(reply.getMsgType())) {<NEW_LINE>String imgId = reply.getContent();<NEW_LINE>Wx_reply_img img = wxReplyImgService.fetch(imgId);<NEW_LINE>return Wxs.respImage(null, img.getMediaId());<NEW_LINE>} else if ("news".equals(reply.getMsgType())) {<NEW_LINE>String[] newsIds = StringUtils.split(Strings.sNull(reply<MASK><NEW_LINE>List<WxArticle> list = new ArrayList<>();<NEW_LINE>List<Wx_reply_news> newsList = wxReplyNewsService.query(Cnd.where("id", "in", newsIds).asc("location"));<NEW_LINE>for (Wx_reply_news news : newsList) {<NEW_LINE>WxArticle wxArticle = new WxArticle();<NEW_LINE>wxArticle.setDescription(news.getDescription());<NEW_LINE>wxArticle.setPicUrl(news.getPicUrl());<NEW_LINE>wxArticle.setTitle(news.getTitle());<NEW_LINE>wxArticle.setUrl(news.getUrl());<NEW_LINE>list.add(wxArticle);<NEW_LINE>}<NEW_LINE>return Wxs.respNews(null, list);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return defaultMsg(msg);<NEW_LINE>} | .getContent()), ","); |
1,835,247 | public IStatus runInWorkspace(IProgressMonitor monitor) {<NEW_LINE>IStatus status = Status.OK_STATUS;<NEW_LINE>SubMonitor subMonitor = SubMonitor.convert(monitor, addedRootPaths.size() + removedRootPaths.size());<NEW_LINE>try {<NEW_LINE><MASK><NEW_LINE>IProject[] projects = getWorkspaceRoot().getProjects();<NEW_LINE>for (IProject project : projects) {<NEW_LINE>if (ResourceUtils.isContainedIn(project.getLocation(), removedRootPaths)) {<NEW_LINE>try {<NEW_LINE>project.delete(false, true, subMonitor.split(1));<NEW_LINE>} catch (CoreException e) {<NEW_LINE>JavaLanguageServerPlugin.logException("Problems removing '" + project.getName() + "' from workspace.", e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>importProjects(addedRootPaths, subMonitor.split(addedRootPaths.size()));<NEW_LINE>registerWatchers(true);<NEW_LINE>long elapsed = System.currentTimeMillis() - start;<NEW_LINE>JavaLanguageServerPlugin.logInfo("Updated workspace folders in " + elapsed + " ms: Added " + addedRootPaths.size() + " folder(s), removed" + removedRootPaths.size() + " folders.");<NEW_LINE>JavaLanguageServerPlugin.logInfo(getWorkspaceInfo());<NEW_LINE>return Status.OK_STATUS;<NEW_LINE>} catch (CoreException e) {<NEW_LINE>String msg = "Error updating workspace folders";<NEW_LINE>JavaLanguageServerPlugin.logError(msg);<NEW_LINE>status = StatusFactory.newErrorStatus(msg, e);<NEW_LINE>}<NEW_LINE>cleanInvalidProjects(preferenceManager.getPreferences().getRootPaths(), monitor);<NEW_LINE>return status;<NEW_LINE>} | long start = System.currentTimeMillis(); |
725,520 | @ApiOperation("Removes a token for a user")<NEW_LINE>@AuditEvent(type = AuditEventTypes.USER_ACCESS_TOKEN_DELETE)<NEW_LINE>public void revokeToken(@ApiParam(name = "userId", required = true) @PathParam("userId") String userId, @ApiParam(name = "idOrToken", required = true) @PathParam("idOrToken") String idOrToken) {<NEW_LINE>final User user = loadUserById(userId);<NEW_LINE>final String username = user.getName();<NEW_LINE>if (!isPermitted(USERS_TOKENREMOVE, username)) {<NEW_LINE>throw new ForbiddenException("Not allowed to remove tokens for user " + username);<NEW_LINE>}<NEW_LINE>// The endpoint supports both, deletion by token ID and deletion by using the token value itself.<NEW_LINE>// The latter should not be used anymore because the plain text token will be part of the URL and URLs<NEW_LINE>// will most probably be logged. We keep the old behavior for backwards compatibility.<NEW_LINE>// TODO: Remove support for old behavior in 4.0<NEW_LINE>final AccessToken accessToken = Optional.ofNullable(accessTokenService.loadById(idOrToken)).orElse<MASK><NEW_LINE>if (accessToken != null) {<NEW_LINE>accessTokenService.destroy(accessToken);<NEW_LINE>} else {<NEW_LINE>throw new NotFoundException("Couldn't find access token for user " + username);<NEW_LINE>}<NEW_LINE>} | (accessTokenService.load(idOrToken)); |
1,657,720 | public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {<NEW_LINE>super.onViewCreated(view, savedInstanceState);<NEW_LINE>callback = (DiaryViewerCallback) getTargetFragment();<NEW_LINE>diaryId = getArguments()<MASK><NEW_LINE>// Init the object<NEW_LINE>if (diaryId != -1) {<NEW_LINE>if (isEditMode) {<NEW_LINE>diaryViewerHandler = new DiaryViewerHandler(this);<NEW_LINE>diaryFileManager = new FileManager(getActivity(), FileManager.DIARY_EDIT_CACHE_DIR);<NEW_LINE>diaryFileManager.clearDir();<NEW_LINE>PB_diary_item_content_hint.setVisibility(View.VISIBLE);<NEW_LINE>mTask = new CopyDiaryToEditCacheTask(getActivity(), diaryFileManager, this);<NEW_LINE>// Make ths ProgressBar show 0.7s+.<NEW_LINE>loadDiaryHandler = new Handler();<NEW_LINE>initHandlerOrTaskIsRunning = true;<NEW_LINE>loadDiaryHandler.postDelayed(new Runnable() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void run() {<NEW_LINE>// Copy the file into editCash<NEW_LINE>mTask.execute(((DiaryActivity) getActivity()).getTopicId(), diaryId);<NEW_LINE>}<NEW_LINE>}, 700);<NEW_LINE>} else {<NEW_LINE>diaryFileManager = new FileManager(getActivity(), ((DiaryActivity) getActivity()).getTopicId(), diaryId);<NEW_LINE>diaryPhotoFileList = new ArrayList<>();<NEW_LINE>initData();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | .getLong("diaryId", -1L); |
93,012 | final GlobalSignOutResult executeGlobalSignOut(GlobalSignOutRequest globalSignOutRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(globalSignOutRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<GlobalSignOutRequest> request = null;<NEW_LINE>Response<GlobalSignOutResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new GlobalSignOutRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(globalSignOutRequest));<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<GlobalSignOutResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new GlobalSignOutResultJsonUnmarshaller());<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, "GlobalSignOut"); |
88,955 | public RetMessage syncBatchDeleteShards(@PathVariable String clusterName, @RequestBody List<String> shardNames) {<NEW_LINE>logger.info("[deleteShard] Delete Shards {} - {}", clusterName, shardNames);<NEW_LINE>try {<NEW_LINE>ClusterTbl clusterTbl = clusterService.find(clusterName);<NEW_LINE>if (clusterTbl == null) {<NEW_LINE>return RetMessage.createSuccessMessage("Cluster already not exist");<NEW_LINE>}<NEW_LINE>List<ShardTbl> allShards = shardService.findAllByClusterName(clusterName);<NEW_LINE>if (!allShards.isEmpty()) {<NEW_LINE>// some already deleted, some not<NEW_LINE>Set<String> allShardNames = allShards.stream().map(ShardTbl::getShardName).collect(Collectors.toSet());<NEW_LINE>if (!allShardNames.containsAll(shardNames)) {<NEW_LINE>return RetMessage.createSuccessMessage("Some shard already not exist");<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>return RetMessage.createSuccessMessage("Shard already not exist");<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>List<DcTbl> dcTbls = clusterService.getClusterRelatedDcs(clusterName);<NEW_LINE>for (DcTbl dcTbl : dcTbls) {<NEW_LINE>try {<NEW_LINE>metaServerConsoleServiceManagerWrapper.get(dcTbl.getDcName()).clusterModified(clusterName, clusterMetaService.getClusterMeta(dcTbl.getDcName(), clusterName));<NEW_LINE>} catch (Exception e) {<NEW_LINE>logger.warn("[modifiedCluster] notify dc {} MetaServer fail", dcTbl.getDcName(), e);<NEW_LINE>return RetMessage.createFailMessage("[" + dcTbl.getDcName() + "]MetaServer fails" + e.getMessage());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return RetMessage.createSuccessMessage("Successfully deleted shard");<NEW_LINE>} catch (Exception e) {<NEW_LINE>logger.error("[deleteShard]", e);<NEW_LINE>return RetMessage.createFailMessage(e.getMessage());<NEW_LINE>}<NEW_LINE>} | shardService.deleteShards(clusterTbl, shardNames); |
1,364,224 | public void onReceive(Context context, Intent intent) {<NEW_LINE>String action = intent.getAction();<NEW_LINE>Log.d(TAG, "intent: " + intent);<NEW_LINE>if (Intent.ACTION_POWER_CONNECTED.equals(action)) {<NEW_LINE>Intent cmd <MASK><NEW_LINE>cmd.setClass(context, UploadService.class);<NEW_LINE>context.startService(cmd);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (Intent.ACTION_POWER_DISCONNECTED.equals(action)) {<NEW_LINE>Intent cmd = new Intent(UploadService.INTENT_POWER_DISCONNECTED);<NEW_LINE>cmd.setClass(context, UploadService.class);<NEW_LINE>context.startService(cmd);<NEW_LINE>}<NEW_LINE>if (ConnectivityManager.CONNECTIVITY_ACTION.equals(action)) {<NEW_LINE>boolean wifi = onWifi(context);<NEW_LINE>Log.d(TAG, "onWifi = " + wifi);<NEW_LINE>Intent cmd = new Intent(wifi ? UploadService.INTENT_NETWORK_WIFI : UploadService.INTENT_NETWORK_NOT_WIFI);<NEW_LINE>String ssid = getSSID(context);<NEW_LINE>cmd.putExtra("SSID", ssid);<NEW_LINE>Log.d(TAG, "extra ssid (chk)= " + cmd.getStringExtra("SSID"));<NEW_LINE>cmd.setClass(context, UploadService.class);<NEW_LINE>context.startService(cmd);<NEW_LINE>}<NEW_LINE>} | = new Intent(UploadService.INTENT_POWER_CONNECTED); |
654,299 | public boolean schemaExists(Client voltClient) {<NEW_LINE>final String testString = "Test";<NEW_LINE>boolean schemaExists = false;<NEW_LINE>try {<NEW_LINE>ClientResponse response = voltClient.callProcedure("Get", testString.getBytes(UTF8), testString);<NEW_LINE>if (response.getStatus() == ClientResponse.SUCCESS) {<NEW_LINE>// YCSB Database exists...<NEW_LINE>schemaExists = true;<NEW_LINE>} else {<NEW_LINE>// If we'd connected to a copy of VoltDB without the schema and tried to call Get<NEW_LINE>// we'd have got a ProcCallException<NEW_LINE>logger.error("Error while calling schemaExists(): " + response.getStatusString());<NEW_LINE>schemaExists = false;<NEW_LINE>}<NEW_LINE>} catch (ProcCallException pce) {<NEW_LINE>schemaExists = false;<NEW_LINE>// Sanity check: Make sure we've got the *right* ProcCallException...<NEW_LINE>if (!pce.getMessage().equals(PROCEDURE_GET_WAS_NOT_FOUND)) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>logger.error("Error while creating classes.", e);<NEW_LINE>schemaExists = false;<NEW_LINE>}<NEW_LINE>return schemaExists;<NEW_LINE>} | logger.error("Got unexpected Exception while calling schemaExists()", pce); |
633,159 | public static void fmlInit() {<NEW_LINE>CustomRotationHelper.INSTANCE.registerHandlerForAll(BlockButton.class, VanillaRotationHandlers::rotateButton);<NEW_LINE>CustomRotationHelper.INSTANCE.registerHandlerForAll(BlockTripWireHook.class, VanillaRotationHandlers::rotateTripWireHook);<NEW_LINE>CustomRotationHelper.INSTANCE.registerHandlerForAll(BlockDoor.class, VanillaRotationHandlers::rotateDoor);<NEW_LINE>CustomRotationHelper.INSTANCE.registerHandlerForAll(BlockPistonBase.class, VanillaRotationHandlers::rotatePiston);<NEW_LINE>CustomRotationHelper.INSTANCE.registerHandlerForAll(BlockLever.class, VanillaRotationHandlers::rotateLever);<NEW_LINE>CustomRotationHelper.INSTANCE.registerHandlerForAll(BlockShulkerBox.class, VanillaRotationHandlers::rotateShulkerBox);<NEW_LINE>CustomRotationHelper.INSTANCE.registerHandlerForAll(BlockDispenser.class, getHandlerFreely(BlockDispenser.class));<NEW_LINE>CustomRotationHelper.INSTANCE.registerHandlerForAll(BlockObserver.class, getHandlerFreely(BlockObserver.class));<NEW_LINE>CustomRotationHelper.INSTANCE.registerHandlerForAll(BlockEndRod.class, getHandlerFreely(BlockEndRod.class));<NEW_LINE>CustomRotationHelper.INSTANCE.registerHandlerForAll(BlockFenceGate.class, getHandlerHorizontalFreely(BlockFenceGate.class));<NEW_LINE>CustomRotationHelper.INSTANCE.registerHandlerForAll(BlockRedstoneDiode.class, getHandlerHorizontalFreely(BlockRedstoneDiode.class));<NEW_LINE>CustomRotationHelper.INSTANCE.registerHandlerForAll(BlockPumpkin.class, getHandlerHorizontalFreely(BlockPumpkin.class));<NEW_LINE>CustomRotationHelper.INSTANCE.registerHandlerForAll(BlockGlazedTerracotta.class, getHandlerHorizontalFreely(BlockGlazedTerracotta.class));<NEW_LINE>CustomRotationHelper.INSTANCE.registerHandlerForAll(BlockAnvil.class, getHandlerHorizontalFreely(BlockAnvil.class));<NEW_LINE>CustomRotationHelper.INSTANCE.registerHandlerForAll(BlockEnderChest.class, getHandlerHorizontalFreely(BlockEnderChest.class));<NEW_LINE>CustomRotationHelper.INSTANCE.registerHandlerForAll(BlockFurnace.class, getHandlerHorizontalFreely(BlockFurnace.class));<NEW_LINE>CustomRotationHelper.INSTANCE.registerHandlerForAll(BlockCocoa.class, VanillaRotationHandlers::rotateCocoa);<NEW_LINE>CustomRotationHelper.INSTANCE.registerHandlerForAll(BlockTorch.class, VanillaRotationHandlers::rotateTorch);<NEW_LINE>CustomRotationHelper.INSTANCE.registerHandlerForAll(BlockLadder.class, VanillaRotationHandlers::rotateLadder);<NEW_LINE>CustomRotationHelper.INSTANCE.registerHandlerForAll(BlockHopper.class, VanillaRotationHandlers::rotateHopper);<NEW_LINE>CustomRotationHelper.INSTANCE.registerHandlerForAll(BlockChest.class, VanillaRotationHandlers::rotateChest);<NEW_LINE>CustomRotationHelper.INSTANCE.registerHandlerForAll(<MASK><NEW_LINE>CustomRotationHelper.INSTANCE.registerHandlerForAll(BlockStairs.class, VanillaRotationHandlers::rotateStairs);<NEW_LINE>CustomRotationHelper.INSTANCE.registerHandlerForAll(BlockSkull.class, VanillaRotationHandlers::rotateSkull);<NEW_LINE>CustomRotationHelper.INSTANCE.registerHandlerForAll(BlockBanner.BlockBannerHanging.class, VanillaRotationHandlers::rotateHangingBanner);<NEW_LINE>CustomRotationHelper.INSTANCE.registerHandlerForAll(BlockWallSign.class, VanillaRotationHandlers::rotateWallSign);<NEW_LINE>CustomRotationHelper.INSTANCE.registerHandlerForAll(BlockBanner.BlockBannerStanding.class, VanillaRotationHandlers::rotateStandingBanner);<NEW_LINE>CustomRotationHelper.INSTANCE.registerHandlerForAll(BlockStandingSign.class, VanillaRotationHandlers::rotateStandingSign);<NEW_LINE>} | BlockTrapDoor.class, VanillaRotationHandlers::rotateTrapDoor); |
1,816,522 | private static List<SpecModelValidationError> validateReturnType(SpecMethodModel<DelegateMethod, Void> delegateMethod, Class<? extends Annotation> delegateMethodAnnotation, DelegateMethodDescription delegateMethodDescription) {<NEW_LINE>final List<SpecModelValidationError> <MASK><NEW_LINE>// When using Kotlin, we get incorrect return type "error.NonExistentClass". Just ignore it.<NEW_LINE>if (!delegateMethod.returnType.equals(ClassNames.NON_EXISTENT_CLASS) && !delegateMethodDescription.returnType.equals(TypeName.OBJECT) && !delegateMethodDescription.returnType.equals(delegateMethod.returnType)) {<NEW_LINE>validationErrors.add(new SpecModelValidationError(delegateMethod.representedObject, "A method annotated with @" + delegateMethodAnnotation.getSimpleName() + " needs to return " + delegateMethodDescription.returnType + ". Note that even if your return value is a subclass of " + delegateMethodDescription.returnType + ", you should still use " + delegateMethodDescription.returnType + " as the return type."));<NEW_LINE>}<NEW_LINE>return validationErrors;<NEW_LINE>} | validationErrors = new ArrayList<>(); |
515,649 | public static Map<String, Object> evaluateParameterDefaultValues(JasperReportsContext jasperReportsContext, JasperReport report, Map<String, Object> initialParameters) throws JRException {<NEW_LINE>Map<String, Object> valuesMap = initialParameters == null ? new HashMap<>() : new HashMap<>(initialParameters);<NEW_LINE>valuesMap.put(JRParameter.JASPER_REPORT, report);<NEW_LINE>ObjectFactory factory = new ObjectFactory();<NEW_LINE>JRDataset reportDataset = report.getMainDataset();<NEW_LINE>JRFillDataset fillDataset = factory.getDataset(reportDataset);<NEW_LINE>@SuppressWarnings("deprecation")<NEW_LINE>JasperReportsContext depContext = net.sf.jasperreports.engine.util.LocalJasperReportsContext.getLocalContext(jasperReportsContext, initialParameters);<NEW_LINE>fillDataset.setJasperReportsContext(depContext);<NEW_LINE>fillDataset.createCalculator(report);<NEW_LINE>fillDataset.initCalculator();<NEW_LINE>JRResourcesFillUtil.ResourcesFillContext resourcesContext = JRResourcesFillUtil.setResourcesFillContext(valuesMap);<NEW_LINE>try {<NEW_LINE>fillDataset.setParameterValues(valuesMap);<NEW_LINE>Map<String, Object> <MASK><NEW_LINE>JRParameter[] parameters = reportDataset.getParameters();<NEW_LINE>for (int i = 0; i < parameters.length; i++) {<NEW_LINE>JRParameter param = parameters[i];<NEW_LINE>if (!param.isSystemDefined()) {<NEW_LINE>String name = param.getName();<NEW_LINE>Object value = fillDataset.getParameterValue(name);<NEW_LINE>parameterValues.put(name, value);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return parameterValues;<NEW_LINE>} finally {<NEW_LINE>fillDataset.disposeParameterContributors();<NEW_LINE>JRResourcesFillUtil.revertResourcesFillContext(resourcesContext);<NEW_LINE>}<NEW_LINE>} | parameterValues = new HashMap<>(); |
1,084,940 | public boolean apply(Game game, Ability source) {<NEW_LINE>Player controller = game.getPlayer(source.getControllerId());<NEW_LINE>if (controller == null || !controller.chooseUse(Outcome.PutCreatureInPlay, "Put an Angel, Demon, or Dragon creature card from your hand onto the battlefield tapped and attacking?", source, game)) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>if (target.canChoose(controller.getId(), source, game) && target.choose(outcome, controller.getId(), source.getSourceId(), source, game)) {<NEW_LINE>if (!target.getTargets().isEmpty()) {<NEW_LINE>UUID cardId = target.getFirstTarget();<NEW_LINE>Card card = game.getCard(cardId);<NEW_LINE>if (card != null && game.getCombat() != null) {<NEW_LINE>UUID defenderId = game.getCombat().getDefendingPlayerId(source.getSourceId(), game);<NEW_LINE>if (defenderId != null) {<NEW_LINE>controller.moveCards(card, Zone.BATTLEFIELD, source, game, true, false, false, null);<NEW_LINE>Permanent creature = game.getPermanent(cardId);<NEW_LINE>if (creature != null) {<NEW_LINE>game.getCombat().addAttackerToCombat(card.getId(), defenderId, game);<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>} | TargetCardInHand target = new TargetCardInHand(filter); |
1,655,176 | private void initView() {<NEW_LINE>mNetworkList = findViewById(R.id.network_list);<NEW_LINE>LinearLayoutManager layoutManager = new LinearLayoutManager(getContext());<NEW_LINE>mNetworkList.setLayoutManager(layoutManager);<NEW_LINE>mNetworkListAdapter = new NetworkListAdapter(getContext());<NEW_LINE>mNetworkList.setAdapter(mNetworkListAdapter);<NEW_LINE>DividerItemDecoration decoration = new DividerItemDecoration(DividerItemDecoration.VERTICAL);<NEW_LINE>decoration.setDrawable(getResources().getDrawable(R.drawable.dk_divider));<NEW_LINE>decoration.showHeaderDivider(true);<NEW_LINE>mNetworkList.addItemDecoration(decoration);<NEW_LINE>mNetworkListAdapter.setOnItemClickListener(new NetworkListAdapter.OnItemClickListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onClick(NetworkRecord record) {<NEW_LINE>Bundle bundle = new Bundle();<NEW_LINE><MASK><NEW_LINE>((BaseActivity) getContext()).showContent(NetworkDetailFragment.class, bundle);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>((EditText) findViewById(R.id.network_list_filter)).addTextChangedListener(mTextWatcher);<NEW_LINE>} | bundle.putSerializable(KEY_RECORD, record); |
681,939 | public CompletableSource.Subscriber wrapCompletableSubscriberAndCancellable(final CompletableSource.Subscriber subscriber, final ContextMap context) {<NEW_LINE>if (subscriber instanceof ContextPreservingCompletableSubscriber) {<NEW_LINE><MASK><NEW_LINE>if (s.saved == context) {<NEW_LINE>return subscriber instanceof ContextPreservingCompletableSubscriberAndCancellable ? subscriber : new ContextPreservingCompletableSubscriberAndCancellable(s.subscriber, context);<NEW_LINE>}<NEW_LINE>} else if (subscriber instanceof ContextPreservingCancellableCompletableSubscriber) {<NEW_LINE>final ContextPreservingCancellableCompletableSubscriber s = (ContextPreservingCancellableCompletableSubscriber) subscriber;<NEW_LINE>if (s.saved == context) {<NEW_LINE>return new ContextPreservingCompletableSubscriberAndCancellable(s.subscriber, context);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return new ContextPreservingCompletableSubscriberAndCancellable(subscriber, context);<NEW_LINE>} | final ContextPreservingCompletableSubscriber s = (ContextPreservingCompletableSubscriber) subscriber; |
568,542 | private Case createCaseWithDataSources(String workingDirectory, String caseOutputPath, String caseName, CaseType caseType, List<String> dataSourcePaths) throws CaseActionException, NoCurrentCaseException, IllegalStateException, IllegalArgumentException {<NEW_LINE>Case openCase = null;<NEW_LINE>String uniqueCaseName = String.format("%s_%s", <MASK><NEW_LINE>String outputFolder = PathUtil.getAbsolutePath(workingDirectory, caseOutputPath);<NEW_LINE>String caseOutputFolder = Paths.get(outputFolder, uniqueCaseName).toString();<NEW_LINE>File caseOutputFolderFile = new File(caseOutputFolder);<NEW_LINE>if (!caseOutputFolderFile.exists()) {<NEW_LINE>caseOutputFolderFile.mkdirs();<NEW_LINE>}<NEW_LINE>Case.createAsCurrentCase(caseType, caseOutputFolder, new CaseDetails(uniqueCaseName));<NEW_LINE>openCase = Case.getCurrentCaseThrows();<NEW_LINE>addDataSourcesToCase(PathUtil.getAbsolutePaths(workingDirectory, dataSourcePaths), caseName);<NEW_LINE>return openCase;<NEW_LINE>} | caseName, TimeStampUtils.createTimeStamp()); |
1,806,628 | public void onResume() {<NEW_LINE>super.onResume();<NEW_LINE>tileFileSystemMaxQueueSize.setText(Configuration.getInstance().getTileFileSystemMaxQueueSize() + "");<NEW_LINE>tileFileSystemThreads.setText(Configuration.getInstance().getTileFileSystemThreads() + "");<NEW_LINE>tileDownloadMaxQueueSize.setText(Configuration.getInstance(<MASK><NEW_LINE>tileDownloadThreads.setText(Configuration.getInstance().getTileDownloadThreads() + "");<NEW_LINE>gpsWaitTime.setText(Configuration.getInstance().getGpsWaitTime() + "");<NEW_LINE>additionalExpirationTime.setText(Configuration.getInstance().getExpirationExtendedDuration() + "");<NEW_LINE>cacheMapTileCount.setText(Configuration.getInstance().getCacheMapTileCount() + "");<NEW_LINE>if (Configuration.getInstance().getExpirationOverrideDuration() != null)<NEW_LINE>overrideExpirationTime.setText(Configuration.getInstance().getExpirationOverrideDuration() + "");<NEW_LINE>httpUserAgent.setText(Configuration.getInstance().getUserAgentValue());<NEW_LINE>checkBoxMapViewDebug.setChecked(Configuration.getInstance().isDebugMapView());<NEW_LINE>checkBoxDebugMode.setChecked(Configuration.getInstance().isDebugMode());<NEW_LINE>checkBoxDebugTileProvider.setChecked(Configuration.getInstance().isDebugTileProviders());<NEW_LINE>checkBoxHardwareAcceleration.setChecked(Configuration.getInstance().isMapViewHardwareAccelerated());<NEW_LINE>checkBoxDebugDownloading.setChecked(Configuration.getInstance().isDebugMapTileDownloader());<NEW_LINE>textViewCacheDirectory.setText(Configuration.getInstance().getOsmdroidTileCache().getAbsolutePath());<NEW_LINE>textViewBaseDirectory.setText(Configuration.getInstance().getOsmdroidBasePath().getAbsolutePath());<NEW_LINE>cacheMaxSize.setText(Configuration.getInstance().getTileFileSystemCacheMaxBytes() + "");<NEW_LINE>cacheTrimSize.setText(Configuration.getInstance().getTileFileSystemCacheTrimBytes() + "");<NEW_LINE>zoomSpeedDefault.setText(Configuration.getInstance().getAnimationSpeedDefault() + "");<NEW_LINE>zoomSpeedShort.setText(Configuration.getInstance().getAnimationSpeedShort() + "");<NEW_LINE>} | ).getTileDownloadMaxQueueSize() + ""); |
740,411 | final CreatePlacementResult executeCreatePlacement(CreatePlacementRequest createPlacementRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(createPlacementRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<CreatePlacementRequest> request = null;<NEW_LINE>Response<CreatePlacementResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new CreatePlacementRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(createPlacementRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "IoT 1Click Projects");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "CreatePlacement");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<CreatePlacementResult>> 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 CreatePlacementResultJsonUnmarshaller()); |
1,083,469 | private int addStructuredMap(JsonParser parser, FlatRecordWriter flatRecordWriter, String mapTypeName, HollowMapWriteRecord mapRec) throws IOException {<NEW_LINE>JsonToken token = parser.nextToken();<NEW_LINE>mapRec.reset();<NEW_LINE>HollowMapSchema schema = (HollowMapSchema) hollowSchemas.get(mapTypeName);<NEW_LINE>while (token != JsonToken.END_ARRAY) {<NEW_LINE>if (token == JsonToken.START_OBJECT) {<NEW_LINE>int keyOrdinal = -1, valueOrdinal = -1;<NEW_LINE>while (token != JsonToken.END_OBJECT) {<NEW_LINE>if (token == JsonToken.START_OBJECT || token == JsonToken.START_ARRAY) {<NEW_LINE>if ("key".equals(parser.getCurrentName()))<NEW_LINE>keyOrdinal = parseSubType(parser, flatRecordWriter, <MASK><NEW_LINE>else if ("value".equals(parser.getCurrentName()))<NEW_LINE>valueOrdinal = parseSubType(parser, flatRecordWriter, token, schema.getValueType());<NEW_LINE>}<NEW_LINE>token = parser.nextToken();<NEW_LINE>}<NEW_LINE>mapRec.addEntry(keyOrdinal, valueOrdinal);<NEW_LINE>}<NEW_LINE>token = parser.nextToken();<NEW_LINE>}<NEW_LINE>return addRecord(schema.getName(), mapRec, flatRecordWriter);<NEW_LINE>} | token, schema.getKeyType()); |
703,491 | public BatchGetRecordResult unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>BatchGetRecordResult batchGetRecordResult = new BatchGetRecordResult();<NEW_LINE><MASK><NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return batchGetRecordResult;<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("Records", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>batchGetRecordResult.setRecords(new ListUnmarshaller<BatchGetRecordResultDetail>(BatchGetRecordResultDetailJsonUnmarshaller.getInstance()).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("Errors", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>batchGetRecordResult.setErrors(new ListUnmarshaller<BatchGetRecordError>(BatchGetRecordErrorJsonUnmarshaller.getInstance()).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("UnprocessedIdentifiers", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>batchGetRecordResult.setUnprocessedIdentifiers(new ListUnmarshaller<BatchGetRecordIdentifier>(BatchGetRecordIdentifierJsonUnmarshaller.getInstance()).unmarshall(context));<NEW_LINE>}<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return batchGetRecordResult;<NEW_LINE>} | int originalDepth = context.getCurrentDepth(); |
405,471 | final DescribePortfolioResult executeDescribePortfolio(DescribePortfolioRequest describePortfolioRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(describePortfolioRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DescribePortfolioRequest> request = null;<NEW_LINE>Response<DescribePortfolioResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DescribePortfolioRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(describePortfolioRequest));<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, "Service Catalog");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DescribePortfolio");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DescribePortfolioResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DescribePortfolioResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | awsRequestMetrics.endEvent(Field.RequestMarshallTime); |
440,165 | public void initLineMask(LineData[] lines) {<NEW_LINE>if (myLineMask == null) {<NEW_LINE>myLineMask = new int[myLinesArray != null ? Math.max(lines.length, myLinesArray.length) : lines.length];<NEW_LINE>Arrays.fill(myLineMask, 0);<NEW_LINE>if (myLinesArray != null) {<NEW_LINE>for (int i = 0; i < myLinesArray.length; i++) {<NEW_LINE>final LineData data = myLinesArray[i];<NEW_LINE>if (data != null) {<NEW_LINE>myLineMask[i] = data.getHits();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>if (myLineMask.length < lines.length) {<NEW_LINE>int[] lineMask = new int[lines.length];<NEW_LINE>System.arraycopy(myLineMask, 0, lineMask, 0, myLineMask.length);<NEW_LINE>myLineMask = lineMask;<NEW_LINE>}<NEW_LINE>for (int i = 0; i < lines.length; i++) {<NEW_LINE>if (lines[i] != null) {<NEW_LINE>myLineMask[i] += <MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | lines[i].getHits(); |
751,080 | private Mono<Response<Void>> verifyDomainOwnershipWithResponseAsync(String resourceGroupName, String certificateOrderName, Context context) {<NEW_LINE>if (this.client.getEndpoint() == null) {<NEW_LINE>return Mono.<MASK><NEW_LINE>}<NEW_LINE>if (resourceGroupName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (certificateOrderName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter certificateOrderName is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (this.client.getSubscriptionId() == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."));<NEW_LINE>}<NEW_LINE>final String accept = "application/json";<NEW_LINE>context = this.client.mergeContext(context);<NEW_LINE>return service.verifyDomainOwnership(this.client.getEndpoint(), resourceGroupName, certificateOrderName, this.client.getSubscriptionId(), this.client.getApiVersion(), accept, context);<NEW_LINE>} | error(new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); |
1,121,504 | public void queue(@Nonnull final Runnable runnable, final boolean urgent, final boolean anyModality) {<NEW_LINE>synchronized (myLock) {<NEW_LINE>if (myAlarm.isDisposed())<NEW_LINE>return;<NEW_LINE>final boolean wasRaised = myRaised;<NEW_LINE>myRaised = true;<NEW_LINE>myIsEmpty = false;<NEW_LINE>if (!wasRaised) {<NEW_LINE>final Runnable request = new Runnable() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void run() {<NEW_LINE>synchronized (myLock) {<NEW_LINE>if (!myRaised)<NEW_LINE>return;<NEW_LINE>myRaised = false;<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>synchronized (myLock) {<NEW_LINE>myIsEmpty = !myRaised;<NEW_LINE>}<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public String toString() {<NEW_LINE>return runnable.toString();<NEW_LINE>}<NEW_LINE>};<NEW_LINE>if (Alarm.ThreadToUse.SWING_THREAD.equals(myThreadToUse)) {<NEW_LINE>if (anyModality) {<NEW_LINE>myAlarm.addRequest(request, urgent ? 0 : myDelay, ModalityState.any());<NEW_LINE>} else if (!ApplicationManager.getApplication().isDispatchThread()) {<NEW_LINE>myAlarm.addRequest(request, urgent ? 0 : myDelay, ModalityState.NON_MODAL);<NEW_LINE>} else {<NEW_LINE>myAlarm.addRequest(request, urgent ? 0 : myDelay);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>myAlarm.addRequest(request, urgent ? 0 : myDelay);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | BackgroundTaskUtil.runUnderDisposeAwareIndicator(myAlarm, runnable); |
275,023 | public GetCellReadinessSummaryResult unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>GetCellReadinessSummaryResult getCellReadinessSummaryResult = new GetCellReadinessSummaryResult();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return getCellReadinessSummaryResult;<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("nextToken", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>getCellReadinessSummaryResult.setNextToken(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("readiness", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>getCellReadinessSummaryResult.setReadiness(context.getUnmarshaller(String.<MASK><NEW_LINE>}<NEW_LINE>if (context.testExpression("readinessChecks", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>getCellReadinessSummaryResult.setReadinessChecks(new ListUnmarshaller<ReadinessCheckSummary>(ReadinessCheckSummaryJsonUnmarshaller.getInstance()).unmarshall(context));<NEW_LINE>}<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return getCellReadinessSummaryResult;<NEW_LINE>} | class).unmarshall(context)); |
1,258,053 | public Variable emitIntegerTestMove(Value leftVal, Value right, Value trueValue, Value falseValue) {<NEW_LINE>Logger.traceBuildLIR(Logger.BACKEND.SPIRV, "emitIntegerTestMove: " + leftVal + " " + "&" + right + " ? " + trueValue + " : " + falseValue);<NEW_LINE>assert leftVal.getPlatformKind() == right.getPlatformKind() && ((SPIRVKind) leftVal.<MASK><NEW_LINE>assert trueValue.getPlatformKind() == falseValue.getPlatformKind();<NEW_LINE>LIRKind kind = LIRKind.combine(trueValue, falseValue);<NEW_LINE>final Variable result = newVariable(kind);<NEW_LINE>SPIRVBinary.IntegerTestNode integerTestNode = new SPIRVBinary.IntegerTestNode(SPIRVAssembler.SPIRVBinaryOp.BITWISE_AND, kind, leftVal, right);<NEW_LINE>SPIRVBinary.IntegerTestMoveNode moveNode = new SPIRVBinary.IntegerTestMoveNode(integerTestNode, result, kind, trueValue, falseValue);<NEW_LINE>append(new SPIRVLIRStmt.AssignStmt(result, moveNode));<NEW_LINE>return result;<NEW_LINE>} | getPlatformKind()).isInteger(); |
1,665,490 | public ListFacesResult unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>ListFacesResult listFacesResult = new ListFacesResult();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return listFacesResult;<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("Faces", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>listFacesResult.setFaces(new ListUnmarshaller<Face>(FaceJsonUnmarshaller.getInstance()).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("NextToken", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>listFacesResult.setNextToken(context.getUnmarshaller(String.<MASK><NEW_LINE>}<NEW_LINE>if (context.testExpression("FaceModelVersion", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>listFacesResult.setFaceModelVersion(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 listFacesResult;<NEW_LINE>} | class).unmarshall(context)); |
1,461,389 | public void marshall(License license, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (license == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(license.getLicenseArn(), LICENSEARN_BINDING);<NEW_LINE>protocolMarshaller.marshall(license.getLicenseName(), LICENSENAME_BINDING);<NEW_LINE>protocolMarshaller.marshall(license.getProductName(), PRODUCTNAME_BINDING);<NEW_LINE>protocolMarshaller.marshall(license.getProductSKU(), PRODUCTSKU_BINDING);<NEW_LINE>protocolMarshaller.marshall(license.getIssuer(), ISSUER_BINDING);<NEW_LINE>protocolMarshaller.marshall(<MASK><NEW_LINE>protocolMarshaller.marshall(license.getStatus(), STATUS_BINDING);<NEW_LINE>protocolMarshaller.marshall(license.getValidity(), VALIDITY_BINDING);<NEW_LINE>protocolMarshaller.marshall(license.getBeneficiary(), BENEFICIARY_BINDING);<NEW_LINE>protocolMarshaller.marshall(license.getEntitlements(), ENTITLEMENTS_BINDING);<NEW_LINE>protocolMarshaller.marshall(license.getConsumptionConfiguration(), CONSUMPTIONCONFIGURATION_BINDING);<NEW_LINE>protocolMarshaller.marshall(license.getLicenseMetadata(), LICENSEMETADATA_BINDING);<NEW_LINE>protocolMarshaller.marshall(license.getCreateTime(), CREATETIME_BINDING);<NEW_LINE>protocolMarshaller.marshall(license.getVersion(), VERSION_BINDING);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>} | license.getHomeRegion(), HOMEREGION_BINDING); |
108,753 | public void emitCode(PTXCompilationResultBuilder crb, PTXAssembler asm) {<NEW_LINE>if (rhs instanceof PTXLIROp) {<NEW_LINE>((PTXLIROp) rhs).emit(crb, asm, (Variable) lhs);<NEW_LINE>} else if (lhsKind.isVector() && rhsKind.isVector()) {<NEW_LINE>Variable rhsVar = (Variable) rhs;<NEW_LINE>Variable lhsVar = (Variable) lhs;<NEW_LINE>PTXVectorSplit rhsVectorSplit = new PTXVectorSplit(rhsVar);<NEW_LINE>PTXVectorSplit lhsVectorSplit = new PTXVectorSplit(lhsVar);<NEW_LINE>PTXVectorAssign.doVectorToVectorAssign(asm, lhsVectorSplit, rhsVectorSplit);<NEW_LINE>} else {<NEW_LINE>asm.emitSymbol(TAB);<NEW_LINE>if (shouldEmitMove(lhsKind, rhsKind)) {<NEW_LINE>asm.emit(MOVE + DOT + lhsKind.toString());<NEW_LINE>} else {<NEW_LINE><MASK><NEW_LINE>if ((lhsKind.isFloating() || rhsKind.isFloating()) && getFPURoundingMode(lhsKind, rhsKind) != null) {<NEW_LINE>asm.emit(getFPURoundingMode(lhsKind, rhsKind));<NEW_LINE>asm.emitSymbol(DOT);<NEW_LINE>}<NEW_LINE>asm.emit(lhsKind.toString());<NEW_LINE>asm.emitSymbol(DOT);<NEW_LINE>asm.emit(rhsKind.toString());<NEW_LINE>}<NEW_LINE>asm.emitSymbol(TAB);<NEW_LINE>asm.emitValue(lhs);<NEW_LINE>asm.emitSymbol(COMMA + SPACE);<NEW_LINE>asm.emitValue(rhs);<NEW_LINE>}<NEW_LINE>asm.delimiter();<NEW_LINE>asm.eol();<NEW_LINE>} | asm.emit(CONVERT + DOT); |
567,355 | public DescribeDatastoreResult unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>DescribeDatastoreResult describeDatastoreResult = new DescribeDatastoreResult();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE><MASK><NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return describeDatastoreResult;<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("datastore", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>describeDatastoreResult.setDatastore(DatastoreJsonUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("statistics", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>describeDatastoreResult.setStatistics(DatastoreStatisticsJsonUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>}<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return describeDatastoreResult;<NEW_LINE>} | JsonToken token = context.getCurrentToken(); |
838,600 | private void generateRootMessageGroovyClass(StringBuilder sb) {<NEW_LINE>sb.append(String.format("\npublic class %s {", Message.class.getSimpleName()));<NEW_LINE>sb.append(String.format("\n%sMessageProperites props", whiteSpace(4)));<NEW_LINE>sb.append(String.format("\n%sdef headers = [:]", whiteSpace(4)));<NEW_LINE>sb.append(String.format("\n%sString id = Platform.uuid()", whiteSpace(4)));<NEW_LINE>sb.append(String.format(<MASK><NEW_LINE>sb.append(String.format("\n%sdef creatingTime\n", whiteSpace(4)));<NEW_LINE>sb.append(String.format("\n%sString toString() {", whiteSpace(4)));<NEW_LINE>sb.append(String.format("\n%sproperties.each {", whiteSpace(8)));<NEW_LINE>sb.append(String.format("\n%sif (it.value instanceof NotNullObject)" + " { throw new UIRuntimeException(\"propertiy ${it.key} can not be null in ${fullName()}\")}", whiteSpace(12)));<NEW_LINE>sb.append(String.format("\n%s}\n", whiteSpace(8)));<NEW_LINE>sb.append(String.format("\n%sreturn JSON.dump([(fullName()):this])", whiteSpace(8)));<NEW_LINE>sb.append(String.format("\n%s}\n", whiteSpace(4)));<NEW_LINE>sb.append(String.format("\n%sdef fullName() {}", whiteSpace(4)));<NEW_LINE>sb.append(String.format("\n}\n\n"));<NEW_LINE>generatedGroovyClassName.add(Message.class.getSimpleName());<NEW_LINE>} | "\n%sString serviceId = 'ApiMediator'", whiteSpace(4))); |
1,581,944 | public static void main(String[] args) {<NEW_LINE>if (args.length < 2) {<NEW_LINE>System.out.println("Please specify a bucket name and key name");<NEW_LINE>System.exit(1);<NEW_LINE>}<NEW_LINE>// snippet-start:[s3.java.getobjecttags.main]<NEW_LINE>String bucketName = args[0];<NEW_LINE>String keyName = args[1];<NEW_LINE>System.out.println("Retrieving Object Tags for " + keyName);<NEW_LINE>final AmazonS3 s3 = AmazonS3ClientBuilder.standard().withRegion(Regions.DEFAULT_REGION).build();<NEW_LINE>try {<NEW_LINE>GetObjectTaggingRequest getTaggingRequest = new GetObjectTaggingRequest(bucketName, keyName);<NEW_LINE>GetObjectTaggingResult tags = s3.getObjectTagging(getTaggingRequest);<NEW_LINE>List<Tag> tagSet = tags.getTagSet();<NEW_LINE>// Iterate through the list<NEW_LINE>Iterator<Tag> tagIterator = tagSet.iterator();<NEW_LINE>while (tagIterator.hasNext()) {<NEW_LINE>Tag tag = (Tag) tagIterator.next();<NEW_LINE>System.out.println(tag.getKey());<NEW_LINE>System.out.<MASK><NEW_LINE>}<NEW_LINE>} catch (AmazonServiceException e) {<NEW_LINE>System.err.println(e.getErrorMessage());<NEW_LINE>System.exit(1);<NEW_LINE>}<NEW_LINE>// snippet-end:[s3.java.getobjecttags.main]<NEW_LINE>} | println(tag.getValue()); |
437,612 | public IndexMetaDataGenerations withAddedSnapshot(SnapshotId snapshotId, Map<IndexId, String> newLookup, Map<String, String> newIdentifiers) {<NEW_LINE>final Map<SnapshotId, Map<IndexId, String>> updatedIndexMetaLookup = new HashMap<>(this.lookup);<NEW_LINE>final Map<String, String> updatedIndexMetaIdentifiers = new HashMap<>(identifiers);<NEW_LINE>updatedIndexMetaIdentifiers.putAll(newIdentifiers);<NEW_LINE>if (newLookup.isEmpty() == false) {<NEW_LINE>final Map<String, String> identifierDeduplicator = Maps.newMapWithExpectedSize(this.identifiers.size());<NEW_LINE>for (String identifier : identifiers.keySet()) {<NEW_LINE>identifierDeduplicator.put(identifier, identifier);<NEW_LINE>}<NEW_LINE>final Map<IndexId, String> fixedLookup = Maps.newMapWithExpectedSize(newLookup.size());<NEW_LINE>for (Map.Entry<IndexId, String> entry : newLookup.entrySet()) {<NEW_LINE>final String generation = entry.getValue();<NEW_LINE>fixedLookup.put(entry.getKey(), identifierDeduplicator.getOrDefault(generation, generation));<NEW_LINE>}<NEW_LINE>final Map<IndexId, String> existing = updatedIndexMetaLookup.put(snapshotId, Map.copyOf(fixedLookup));<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>return new IndexMetaDataGenerations(updatedIndexMetaLookup, updatedIndexMetaIdentifiers);<NEW_LINE>} | assert existing == null : "unexpected existing index generation mappings " + existing; |
1,615,557 | public void writeLayout(DataOutputStream dos) throws IOException {<NEW_LINE>dos.writeInt(LAYOUT_SIGNATURE);<NEW_LINE>dos.writeInt(LAYOUT_VERSION);<NEW_LINE>dos.writeInt(LAYOUT_KEYS);<NEW_LINE>dos.writeInt(keypad.length * 20 + 4);<NEW_LINE>dos.writeInt(keypad.length);<NEW_LINE>for (int i = 0; i < keypad.length; i++) {<NEW_LINE>dos.writeInt(keypad[i].hashCode());<NEW_LINE>dos.writeBoolean(keypad[i].isVisible());<NEW_LINE>dos.writeInt(snapOrigins[i]);<NEW_LINE>dos.writeInt(snapModes[i]);<NEW_LINE>dos.writeFloat(snapOffsets[i].x);<NEW_LINE>dos.writeFloat<MASK><NEW_LINE>}<NEW_LINE>dos.writeInt(LAYOUT_SCALES);<NEW_LINE>dos.writeInt(keyScales.length * 4 + 4);<NEW_LINE>dos.writeInt(keyScales.length);<NEW_LINE>for (float keyScale : keyScales) {<NEW_LINE>dos.writeFloat(keyScale);<NEW_LINE>}<NEW_LINE>dos.writeInt(LAYOUT_COLORS);<NEW_LINE>dos.writeInt(colors.length * 4 + 4);<NEW_LINE>dos.writeInt(colors.length);<NEW_LINE>for (int color : colors) {<NEW_LINE>dos.writeInt(color);<NEW_LINE>}<NEW_LINE>dos.writeInt(LAYOUT_EOF);<NEW_LINE>dos.writeInt(0);<NEW_LINE>} | (snapOffsets[i].y); |
1,368,458 | static Future<RouterBuilder> create(Vertx vertx, String url, OpenAPILoaderOptions options) {<NEW_LINE>ContextInternal ctx = (ContextInternal) vertx.getOrCreateContext();<NEW_LINE>Promise<RouterBuilder> promise = ctx.promise();<NEW_LINE><MASK><NEW_LINE>OpenAPIHolderImpl loader = new OpenAPIHolderImpl(vertx, httpClient, vertx.fileSystem(), options);<NEW_LINE>loader.loadOpenAPI(url).onComplete(ar -> {<NEW_LINE>if (ar.failed()) {<NEW_LINE>if (ar.cause() instanceof ValidationException) {<NEW_LINE>promise.fail(RouterBuilderException.createInvalidSpec(ar.cause()));<NEW_LINE>} else {<NEW_LINE>promise.fail(RouterBuilderException.createInvalidSpecFile(url, ar.cause()));<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>RouterBuilder factory;<NEW_LINE>try {<NEW_LINE>factory = new OpenAPI3RouterBuilderImpl(vertx, httpClient, loader, options);<NEW_LINE>} catch (Exception e) {<NEW_LINE>promise.fail(RouterBuilderException.createRouterBuilderInstantiationError(e, url));<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>promise.complete(factory);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>return promise.future();<NEW_LINE>} | HttpClient httpClient = vertx.createHttpClient(); |
373,444 | private EPerson createEPersonFromRestObject(Context context, EPersonRest epersonRest) throws AuthorizeException {<NEW_LINE>EPerson eperson = null;<NEW_LINE>try {<NEW_LINE><MASK><NEW_LINE>// this should be probably moved to the converter (a merge method?)<NEW_LINE>eperson.setCanLogIn(epersonRest.isCanLogIn());<NEW_LINE>eperson.setRequireCertificate(epersonRest.isRequireCertificate());<NEW_LINE>eperson.setEmail(epersonRest.getEmail());<NEW_LINE>eperson.setNetid(epersonRest.getNetid());<NEW_LINE>if (epersonRest.getPassword() != null) {<NEW_LINE>es.setPassword(eperson, epersonRest.getPassword());<NEW_LINE>}<NEW_LINE>es.update(context, eperson);<NEW_LINE>metadataConverter.setMetadata(context, eperson, epersonRest.getMetadata());<NEW_LINE>} catch (SQLException e) {<NEW_LINE>throw new RuntimeException(e.getMessage(), e);<NEW_LINE>}<NEW_LINE>return eperson;<NEW_LINE>} | eperson = es.create(context); |
1,737,015 | public Object read(final InputStream is) {<NEW_LINE>final ART1 result = new ART1();<NEW_LINE>final EncogReadHelper in = new EncogReadHelper(is);<NEW_LINE>EncogFileSection section;<NEW_LINE>while ((section = in.readNextSection()) != null) {<NEW_LINE>if (section.getSectionName().equals("ART1") && section.getSubSectionName().equals("PARAMS")) {<NEW_LINE>final Map<String, String> params = section.parseParams();<NEW_LINE>result.getProperties().putAll(params);<NEW_LINE>}<NEW_LINE>if (section.getSectionName().equals("ART1") && section.getSubSectionName().equals("NETWORK")) {<NEW_LINE>final Map<String, String> params = section.parseParams();<NEW_LINE>result.setA1(EncogFileSection.parseDouble<MASK><NEW_LINE>result.setB1(EncogFileSection.parseDouble(params, ART.PROPERTY_B1));<NEW_LINE>result.setC1(EncogFileSection.parseDouble(params, ART.PROPERTY_C1));<NEW_LINE>result.setD1(EncogFileSection.parseDouble(params, ART.PROPERTY_D1));<NEW_LINE>result.setF1Count(EncogFileSection.parseInt(params, PersistConst.PROPERTY_F1_COUNT));<NEW_LINE>result.setF2Count(EncogFileSection.parseInt(params, PersistConst.PROPERTY_F2_COUNT));<NEW_LINE>result.setNoWinner(EncogFileSection.parseInt(params, ART.PROPERTY_NO_WINNER));<NEW_LINE>result.setL(EncogFileSection.parseDouble(params, ART.PROPERTY_L));<NEW_LINE>result.setVigilance(EncogFileSection.parseDouble(params, ART.PROPERTY_VIGILANCE));<NEW_LINE>result.setWeightsF1toF2(EncogFileSection.parseMatrix(params, PersistConst.PROPERTY_WEIGHTS_F1_F2));<NEW_LINE>result.setWeightsF2toF1(EncogFileSection.parseMatrix(params, PersistConst.PROPERTY_WEIGHTS_F2_F1));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>} | (params, ART.PROPERTY_A1)); |
1,144,062 | public void onConfigurationChanged(Options options) {<NEW_LINE>if (topBar == null)<NEW_LINE>return;<NEW_LINE>Options withDefault = options.copy().withDefaultOptions(defaultOptions);<NEW_LINE>if (currentRightButtons != null && !currentRightButtons.isEmpty())<NEW_LINE>topBarController.applyRightButtons(currentRightButtons);<NEW_LINE>if (currentLeftButtons != null && !currentLeftButtons.isEmpty())<NEW_LINE>topBarController.applyLeftButtons(currentLeftButtons);<NEW_LINE>if (withDefault.topBar.buttons.back.visible.isTrue()) {<NEW_LINE>topBar.setBackButton(createButtonController(withDefault.topBar.buttons.back));<NEW_LINE>}<NEW_LINE>topBar.setOverflowButtonColor(withDefault.topBar.rightButtonColor.get(Color.BLACK));<NEW_LINE>topBar.applyTopTabsColors(withDefault.topTabs.selectedTabColor, withDefault.topTabs.unselectedTabColor);<NEW_LINE>topBar.setBorderColor(withDefault.topBar<MASK><NEW_LINE>topBar.setBackgroundColor(withDefault.topBar.background.color.get(Color.WHITE));<NEW_LINE>topBar.setTitleTextColor(withDefault.topBar.title.color.get(TopBar.DEFAULT_TITLE_COLOR));<NEW_LINE>topBar.setSubtitleColor(withDefault.topBar.subtitle.color.get(TopBar.DEFAULT_TITLE_COLOR));<NEW_LINE>} | .borderColor.get(DEFAULT_BORDER_COLOR)); |
1,709,569 | public BuildRule createBuildRule(BuildRuleCreationContextWithTargetGraph context, BuildTarget buildTarget, BuildRuleParams params, JavaAnnotationProcessorDescriptionArg args) {<NEW_LINE>if (!args.getProcessorClass().isPresent() && args.getProcessorClasses().isEmpty()) {<NEW_LINE>throw new HumanReadableException(String.format("%s: must specify a processor class, none specified;", buildTarget));<NEW_LINE>}<NEW_LINE>JavacPluginProperties.Builder propsBuilder = JavacPluginProperties.builder();<NEW_LINE>if (args.getProcessorClass().isPresent()) {<NEW_LINE>propsBuilder.addProcessorNames(args.getProcessorClass().get());<NEW_LINE>} else {<NEW_LINE>for (String pClass : args.getProcessorClasses()) {<NEW_LINE>propsBuilder.addProcessorNames(pClass);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>for (BuildRule dep : params.getBuildDeps()) {<NEW_LINE>if (!(dep instanceof JavaLibrary)) {<NEW_LINE>throw new HumanReadableException(String.format("%s: dependencies must produce JVM libraries; %s is a %s", buildTarget, dep.getBuildTarget(), dep.getType()));<NEW_LINE>}<NEW_LINE>propsBuilder.addDep(dep);<NEW_LINE>}<NEW_LINE>boolean reuseClassLoader = !args.isIsolateClassLoader();<NEW_LINE>propsBuilder.setType(ANNOTATION_PROCESSOR);<NEW_LINE>propsBuilder.setCanReuseClassLoader(reuseClassLoader);<NEW_LINE>propsBuilder.setDoesNotAffectAbi(args.isDoesNotAffectAbi());<NEW_LINE>propsBuilder.setSupportsAbiGenerationFromSource(args.isSupportsAbiGenerationFromSource());<NEW_LINE>JavacPluginProperties properties = propsBuilder.build();<NEW_LINE>return new JavaAnnotationProcessor(buildTarget, context.<MASK><NEW_LINE>} | getProjectFilesystem(), params, properties); |
41,839 | void remove(CompletableDisposable inner) {<NEW_LINE>for (; ; ) {<NEW_LINE>CompletableDisposable[] a = observers.get();<NEW_LINE>int n = a.length;<NEW_LINE>if (n == 0) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>int j = -1;<NEW_LINE>for (int i = 0; i < n; i++) {<NEW_LINE>if (a[i] == inner) {<NEW_LINE>j = i;<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (j < 0) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>CompletableDisposable[] b;<NEW_LINE>if (n == 1) {<NEW_LINE>b = EMPTY;<NEW_LINE>} else {<NEW_LINE>b = new CompletableDisposable[n - 1];<NEW_LINE>System.arraycopy(a, 0, b, 0, j);<NEW_LINE>System.arraycopy(a, j + 1, b, <MASK><NEW_LINE>}<NEW_LINE>if (observers.compareAndSet(a, b)) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | j, n - j - 1); |
819,066 | protected void halt(final AbstractRunningQuery q) {<NEW_LINE>boolean interrupted = false;<NEW_LINE>lock.lock();<NEW_LINE>try {<NEW_LINE>// notify listener(s)<NEW_LINE>try {<NEW_LINE>fireEvent(q);<NEW_LINE>} catch (Throwable t) {<NEW_LINE>if (InnerCause.isInnerCause(t, InterruptedException.class)) {<NEW_LINE>// Defer impact until outside of this critical section.<NEW_LINE>interrupted = true;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// insert/touch the LRU of recently finished queries.<NEW_LINE>doneQueries.put(q.getQueryId(), q.getFuture());<NEW_LINE>// remove from the set of running queries.<NEW_LINE>runningQueries.remove(q.getQueryId(), q);<NEW_LINE>if (runningQueries.isEmpty()) {<NEW_LINE>// Signal that no queries are running.<NEW_LINE>nothingRunning.signalAll();<NEW_LINE>}<NEW_LINE>} finally {<NEW_LINE>lock.unlock();<NEW_LINE>}<NEW_LINE>if (interrupted)<NEW_LINE>Thread<MASK><NEW_LINE>} | .currentThread().interrupt(); |
393,530 | public static void toJSON(OutputWriter jsonWriter, JobConfig jobConfig) {<NEW_LINE>if (!jobConfig.errors().isEmpty()) {<NEW_LINE>jsonWriter.addChild("errors", errorWriter -> {<NEW_LINE>HashMap<String, String> errorMapping = new HashMap<>();<NEW_LINE>errorMapping.put("runType", "run_instance_count");<NEW_LINE>new ErrorGetter(errorMapping).toJSON(errorWriter, jobConfig);<NEW_LINE>});<NEW_LINE>}<NEW_LINE>jsonWriter.addIfNotNull("name", jobConfig.name());<NEW_LINE>addRunInstanceCount(jsonWriter, jobConfig);<NEW_LINE>addTimeout(jsonWriter, jobConfig);<NEW_LINE>jsonWriter.addIfNotNull("elastic_profile_id", jobConfig.getElasticProfileId());<NEW_LINE>jsonWriter.addChildList("environment_variables", envVarsWriter -> EnvironmentVariableRepresenter.toJSON(envVarsWriter, jobConfig.getVariables()));<NEW_LINE>jsonWriter.addChildList("resources", getResourceNames(jobConfig));<NEW_LINE>jsonWriter.addChildList("tasks", tasksWriter -> TaskRepresenter.toJSONArray(tasksWriter, jobConfig.getTasks()));<NEW_LINE>jsonWriter.addChildList("tabs", tabsWriter -> TabConfigRepresenter.toJSONArray(tabsWriter<MASK><NEW_LINE>jsonWriter.addChildList("artifacts", getArtifacts(jobConfig));<NEW_LINE>} | , jobConfig.getTabs())); |
7,085 | public GetAdminAccountResult unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>GetAdminAccountResult getAdminAccountResult = new GetAdminAccountResult();<NEW_LINE><MASK><NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return getAdminAccountResult;<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("AdminAccount", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>getAdminAccountResult.setAdminAccount(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("RoleStatus", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>getAdminAccountResult.setRoleStatus(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 getAdminAccountResult;<NEW_LINE>} | int originalDepth = context.getCurrentDepth(); |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.