idx int32 46 1.86M | input stringlengths 321 6.6k | target stringlengths 9 1.24k |
|---|---|---|
534,010 | final GetObjectInformationResult executeGetObjectInformation(GetObjectInformationRequest getObjectInformationRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(getObjectInformationRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<GetObjectInformationRequest> request = null;<NEW_LINE>Response<GetObjectInformationResult> response = null;<NEW_LINE>try {<NEW_LINE><MASK><NEW_LINE>try {<NEW_LINE>request = new GetObjectInformationRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(getObjectInformationRequest));<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, "CloudDirectory");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "GetObjectInformation");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<GetObjectInformationResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new GetObjectInformationResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | awsRequestMetrics.startEvent(Field.RequestMarshallTime); |
1,692,891 | @RequestMapping(value = "/persistent/{rpcId}", method = RequestMethod.DELETE)<NEW_LINE>@ResponseBody<NEW_LINE>public void deleteRpc(@ApiParam(value = RPC_ID_PARAM_DESCRIPTION, required = true) @PathVariable(RPC_ID) String strRpc) throws ThingsboardException {<NEW_LINE>checkParameter("RpcId", strRpc);<NEW_LINE>try {<NEW_LINE>RpcId rpcId = new RpcId(UUID.fromString(strRpc));<NEW_LINE>Rpc rpc = checkRpcId(rpcId, Operation.DELETE);<NEW_LINE>if (rpc != null) {<NEW_LINE>if (rpc.getStatus().equals(RpcStatus.QUEUED)) {<NEW_LINE>RemoveRpcActorMsg removeMsg = new RemoveRpcActorMsg(getTenantId(), rpc.getDeviceId(), rpc.getUuidId());<NEW_LINE>log.trace("[{}] Forwarding msg {} to queue actor!", rpc.getDeviceId(), rpc);<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>rpcService.deleteRpc(getTenantId(), rpcId);<NEW_LINE>rpc.setStatus(RpcStatus.DELETED);<NEW_LINE>TbMsg msg = TbMsg.newMsg(RPC_DELETED, rpc.getDeviceId(), TbMsgMetaData.EMPTY, JacksonUtil.toString(rpc));<NEW_LINE>tbClusterService.pushMsgToRuleEngine(getTenantId(), rpc.getDeviceId(), msg, null);<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw handleException(e);<NEW_LINE>}<NEW_LINE>} | tbClusterService.pushMsgToCore(removeMsg, null); |
1,533,920 | protected boolean isModified(@Nonnull LayoutImpl component) {<NEW_LINE>UISettings settings = UISettings.getInstance();<NEW_LINE>boolean isModified = false;<NEW_LINE>isModified |= !Comparing.equal(component.myFontCombo.getValue(), settings.FONT_FACE);<NEW_LINE>isModified |= !Comparing.equal(component.myFontSizeCombo.getValue(), Integer.toString(settings.FONT_SIZE));<NEW_LINE>isModified |= component.myAntialiasingInIDE.getValue() != settings.IDE_AA_TYPE;<NEW_LINE>isModified |= component.myAntialiasingInEditor.getValue() != settings.EDITOR_AA_TYPE;<NEW_LINE>isModified |= component.myAnimateWindowsCheckBox.getValue() != settings.ANIMATE_WINDOWS;<NEW_LINE>isModified |= component.myWindowShortcutsCheckBox.getValue() != settings.SHOW_TOOL_WINDOW_NUMBERS;<NEW_LINE>isModified |= component.myShowToolStripesCheckBox.getValue() == settings.HIDE_TOOL_STRIPES;<NEW_LINE>isModified |= component.myCbDisplayIconsInMenu.getValue() != settings.SHOW_ICONS_IN_MENUS;<NEW_LINE>isModified |= component.myAllowMergeButtons.getValue() != settings.ALLOW_MERGE_BUTTONS;<NEW_LINE>isModified |= component.myCycleScrollingCheckBox.getValue() != settings.CYCLE_SCROLLING;<NEW_LINE>isModified |= component.myOverrideLAFFonts.getValue() != settings.OVERRIDE_NONIDEA_LAF_FONTS;<NEW_LINE>isModified |= component.myDisableMnemonics.getValue() != settings.DISABLE_MNEMONICS;<NEW_LINE>isModified |= component.myDisableMnemonicInControlsCheckBox.getValue() != settings.DISABLE_MNEMONICS_IN_CONTROLS;<NEW_LINE>isModified |= component.myUseSmallLabelsOnTabs.getValue() != settings.USE_SMALL_LABELS_ON_TABS;<NEW_LINE>isModified |= component.myWidescreenLayoutCheckBox.getValue() != settings.WIDESCREEN_SUPPORT;<NEW_LINE>isModified |= component.myLeftLayoutCheckBox.getValue() != settings.LEFT_HORIZONTAL_SPLIT;<NEW_LINE>isModified |= component.myRightLayoutCheckBox.getValue() != settings.RIGHT_HORIZONTAL_SPLIT;<NEW_LINE>isModified |= component.myEditorTooltipCheckBox.getValue() != settings.SHOW_EDITOR_TOOLTIP;<NEW_LINE>isModified |= component.myHideIconsInQuickNavigation.getValue() != settings.SHOW_ICONS_IN_QUICK_NAVIGATION;<NEW_LINE>isModified |= !Comparing.equal(component.myPresentationModeFontSize.getValue(), Integer.toString(settings.PRESENTATION_MODE_FONT_SIZE));<NEW_LINE>isModified |= component.myMoveMouseOnDefaultButtonCheckBox<MASK><NEW_LINE>isModified |= component.myHideNavigationPopupsCheckBox.getValue() != settings.HIDE_NAVIGATION_ON_FOCUS_LOSS;<NEW_LINE>isModified |= component.myAltDNDCheckBox.getValue() != settings.DND_WITH_PRESSED_ALT_ONLY;<NEW_LINE>isModified |= component.mySmoothScrollingBox.getValue() != settings.SMOOTH_SCROLLING;<NEW_LINE>isModified |= !Comparing.equal(component.myLafComboBox.getValue(), StyleManager.get().getCurrentStyle());<NEW_LINE>isModified |= !Comparing.equal(component.myIconThemeComboBox.getValue(), getActiveIconLibraryOrNull());<NEW_LINE>return isModified;<NEW_LINE>} | .getValue() != settings.MOVE_MOUSE_ON_DEFAULT_BUTTON; |
172,175 | public boolean apply(Game game, Ability source) {<NEW_LINE>Player player = game.getPlayer(game.getActivePlayerId());<NEW_LINE>if (player == null) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>Cards cards = new CardsImpl();<NEW_LINE>Card toHand = null;<NEW_LINE>for (Card card : player.getLibrary().getCards(game)) {<NEW_LINE>cards.add(card);<NEW_LINE>if (card.isCreature(game)) {<NEW_LINE>toHand = card;<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>player.<MASK><NEW_LINE>Player controller = game.getPlayer(source.getControllerId());<NEW_LINE>if (toHand != null && controller != null) {<NEW_LINE>controller.moveCards(toHand, Zone.BATTLEFIELD, source, game);<NEW_LINE>}<NEW_LINE>cards.retainZone(Zone.LIBRARY, game);<NEW_LINE>player.moveCards(cards, Zone.GRAVEYARD, source, game);<NEW_LINE>return true;<NEW_LINE>} | revealCards(source, cards, game); |
864,676 | public void run(RegressionEnvironment env) {<NEW_LINE>String epl = "@name('s0') select (select theString as c0, sum(intPrimitive) as c1 from SupportBean group by theString).take(10) as subq from SupportBean_S0";<NEW_LINE>env.compileDeploy(epl).addListener("s0");<NEW_LINE>String[] <MASK><NEW_LINE>env.sendEventBean(new SupportBean_S0(1, "E1"));<NEW_LINE>env.assertEventNew("s0", event -> assertMapMultiRow("subq", event, "c0", fields, null));<NEW_LINE>env.sendEventBean(new SupportBean("G1", 10));<NEW_LINE>env.sendEventBean(new SupportBean_S0(2, "E2"));<NEW_LINE>env.assertEventNew("s0", event -> assertMapMultiRow("subq", event, "c0", fields, new Object[][] { { "G1", 10 } }));<NEW_LINE>env.sendEventBean(new SupportBean("G2", 20));<NEW_LINE>env.sendEventBean(new SupportBean_S0(3, "E3"));<NEW_LINE>env.assertEventNew("s0", event -> assertMapMultiRow("subq", event, "c0", fields, new Object[][] { { "G1", 10 }, { "G2", 20 } }));<NEW_LINE>env.undeployAll();<NEW_LINE>} | fields = "c0,c1".split(","); |
1,588,581 | private void generateMdConfigOptions(StringBuilder sb, CodegenConfig config) {<NEW_LINE>sb.append(newline);<NEW_LINE>sb.append("| Option | Description | Values | Default |").append(newline);<NEW_LINE>sb.append("| ------ | ----------- | ------ | ------- |").append(newline);<NEW_LINE>Map<String, CliOption> langCliOptions = config.cliOptions().stream().collect(Collectors.toMap(CliOption::getOpt, Function.identity(), (a, b) -> {<NEW_LINE>throw new IllegalStateException(String.format(Locale.ROOT, "Duplicated options! %s and %s", a.getOpt(), b.getOpt()));<NEW_LINE>}, TreeMap::new));<NEW_LINE>langCliOptions.forEach((key, langCliOption) -> {<NEW_LINE>// start<NEW_LINE>sb.append("|");<NEW_LINE>// option<NEW_LINE>sb.append(escapeHtml4(key)).append("|");<NEW_LINE>// description<NEW_LINE>sb.append(escapeHtml4(langCliOption.getDescription())).append("|");<NEW_LINE>// values<NEW_LINE>Map<String, String> enums = langCliOption.getEnum();<NEW_LINE>if (enums != null) {<NEW_LINE>sb.append("<dl>");<NEW_LINE>for (Map.Entry<String, String> entry : enums.entrySet()) {<NEW_LINE>sb.append("<dt>**").append(escapeHtml4(entry.getKey())).append("**</dt>");<NEW_LINE>sb.append("<dd>").append(escapeHtml4(entry.getValue(<MASK><NEW_LINE>}<NEW_LINE>sb.append("</dl>");<NEW_LINE>} else {<NEW_LINE>sb.append(" ");<NEW_LINE>}<NEW_LINE>sb.append("|");<NEW_LINE>// default<NEW_LINE>sb.append(escapeHtml4(langCliOption.getDefault())).append("|").append(newline);<NEW_LINE>});<NEW_LINE>} | ))).append("</dd>"); |
1,246,098 | public Task closeAsync(List<Module> modules) {<NEW_LINE>Util.err.fine("close: " + modules);<NEW_LINE>ev.log(Events.CLOSE);<NEW_LINE>moduleList.shutDown();<NEW_LINE>List<Task> waitFor = onStartStop.startClose(modules);<NEW_LINE>// [PENDING] this may need to write out changed ModuleInstall externalized<NEW_LINE>// forms...is that really necessary to do here, or isn't it enough to<NEW_LINE>// do right after loading etc.? Currently these are only written when<NEW_LINE>// a ModuleInstall has just been restored etc. which is probably fine.<NEW_LINE>for (Module m : modules) {<NEW_LINE>Class<? extends ModuleInstall> instClazz = installs.get(m);<NEW_LINE>if (instClazz != null) {<NEW_LINE>try {<NEW_LINE>ModuleInstall inst = <MASK><NEW_LINE>// NOI18N<NEW_LINE>if (inst == null)<NEW_LINE>throw new IllegalStateException("Inconsistent state: " + instClazz);<NEW_LINE>inst.close();<NEW_LINE>} catch (ThreadDeath td) {<NEW_LINE>throw td;<NEW_LINE>} catch (Throwable t) {<NEW_LINE>// Catch even the heavy stuff here, we are going away.<NEW_LINE>Util.err.log(Level.SEVERE, null, t);<NEW_LINE>// oh well<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>waitFor.add(WarmUpSupport.waitTask());<NEW_LINE>return new ProxyTask(waitFor);<NEW_LINE>} | SharedClassObject.findObject(instClazz, true); |
439,901 | final UntagResourceResult executeUntagResource(UntagResourceRequest untagResourceRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(untagResourceRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<UntagResourceRequest> request = null;<NEW_LINE>Response<UntagResourceResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new UntagResourceRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(untagResourceRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "FMS");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "UntagResource");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<UntagResourceResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new UntagResourceResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden()); |
1,369,962 | public static void doInstall(DictionaryDescription description) {<NEW_LINE>InputStreamReader input = null;<NEW_LINE>OutputStreamWriter output = null;<NEW_LINE>try {<NEW_LINE>boolean shared;<NEW_LINE>if (description.rAllUsers)<NEW_LINE>shared = true;<NEW_LINE>else if (description.rCurrentUser)<NEW_LINE>shared = false;<NEW_LINE>else {<NEW_LINE>// NOI18N<NEW_LINE>DialogDisplayer.getDefault().notify(new NotifyDescriptor.Message(getMessage("MSG_NoInstallDirectoryAvailable"), NotifyDescriptor.ERROR_MESSAGE));<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>File file = dictionaryFile(description.targetLocale, shared);<NEW_LINE>file.getParentFile().mkdirs();<NEW_LINE>// TODO: if the dictionary already exists, provide user with a warning.<NEW_LINE>input = new InputStreamReader(new FileInputStream(description.dictionaryFile), description.fileEncoding);<NEW_LINE>output = new OutputStreamWriter(new FileOutputStream(file), StandardCharsets.UTF_8);<NEW_LINE>char[] buffer = new char[BUFFER_LENGTH];<NEW_LINE>int len = BUFFER_LENGTH;<NEW_LINE>do {<NEW_LINE>len = input.read(buffer);<NEW_LINE>output.write(buffer, 0, len);<NEW_LINE>} while (len == BUFFER_LENGTH);<NEW_LINE>// NOI18N<NEW_LINE>StatusDisplayer.getDefault().setStatusText(getMessage("MSG_DictionaryWasInstalled"));<NEW_LINE>} catch (FileNotFoundException e) {<NEW_LINE>// NOI18N<NEW_LINE>DialogDisplayer.getDefault().notify(new NotifyDescriptor.Message(getMessage(<MASK><NEW_LINE>} catch (UnsupportedEncodingException e) {<NEW_LINE>// NOI18N<NEW_LINE>DialogDisplayer.getDefault().notify(new NotifyDescriptor.Message(getMessage("MSG_UnsupportedEncoding"), NotifyDescriptor.ERROR_MESSAGE));<NEW_LINE>} catch (IOException e) {<NEW_LINE>// NOI18N<NEW_LINE>DialogDisplayer.getDefault().notify(new NotifyDescriptor.Message(getMessage("MSG_IOErrorDuringInstallation"), NotifyDescriptor.ERROR_MESSAGE));<NEW_LINE>} finally {<NEW_LINE>if (input != null)<NEW_LINE>try {<NEW_LINE>input.close();<NEW_LINE>} catch (IOException e) {<NEW_LINE>}<NEW_LINE>if (output != null)<NEW_LINE>try {<NEW_LINE>output.close();<NEW_LINE>} catch (IOException e) {<NEW_LINE>}<NEW_LINE>// TODO: Dictionary.clearDictionaries();<NEW_LINE>}<NEW_LINE>} | "MSG_InputFileNotFound"), NotifyDescriptor.ERROR_MESSAGE)); |
681,139 | public static AnswerCallResponse unmarshall(AnswerCallResponse answerCallResponse, UnmarshallerContext _ctx) {<NEW_LINE>answerCallResponse.setRequestId(_ctx.stringValue("AnswerCallResponse.RequestId"));<NEW_LINE>answerCallResponse.setCode(_ctx.stringValue("AnswerCallResponse.Code"));<NEW_LINE>answerCallResponse.setHttpStatusCode(_ctx.integerValue("AnswerCallResponse.HttpStatusCode"));<NEW_LINE>answerCallResponse.setMessage(_ctx.stringValue("AnswerCallResponse.Message"));<NEW_LINE>List<String> params = new ArrayList<String>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("AnswerCallResponse.Params.Length"); i++) {<NEW_LINE>params.add(_ctx.stringValue("AnswerCallResponse.Params[" + i + "]"));<NEW_LINE>}<NEW_LINE>answerCallResponse.setParams(params);<NEW_LINE>Data data = new Data();<NEW_LINE>data.setContextId(_ctx.longValue("AnswerCallResponse.Data.ContextId"));<NEW_LINE>CallContext callContext = new CallContext();<NEW_LINE>callContext.setJobId(_ctx.stringValue("AnswerCallResponse.Data.CallContext.JobId"));<NEW_LINE>callContext.setInstanceId(_ctx.stringValue("AnswerCallResponse.Data.CallContext.InstanceId"));<NEW_LINE>callContext.setCallType(_ctx.stringValue("AnswerCallResponse.Data.CallContext.CallType"));<NEW_LINE>List<ChannelContext> channelContexts = new ArrayList<ChannelContext>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("AnswerCallResponse.Data.CallContext.ChannelContexts.Length"); i++) {<NEW_LINE>ChannelContext channelContext = new ChannelContext();<NEW_LINE>channelContext.setReleaseInitiator(_ctx.stringValue("AnswerCallResponse.Data.CallContext.ChannelContexts[" + i + "].ReleaseInitiator"));<NEW_LINE>channelContext.setChannelState(_ctx.stringValue("AnswerCallResponse.Data.CallContext.ChannelContexts[" + i + "].ChannelState"));<NEW_LINE>channelContext.setDestination(_ctx.stringValue("AnswerCallResponse.Data.CallContext.ChannelContexts[" + i + "].Destination"));<NEW_LINE>channelContext.setUserId(_ctx.stringValue("AnswerCallResponse.Data.CallContext.ChannelContexts[" + i + "].UserId"));<NEW_LINE>channelContext.setSkillGroupId(_ctx.stringValue("AnswerCallResponse.Data.CallContext.ChannelContexts[" + i + "].SkillGroupId"));<NEW_LINE>channelContext.setTimestamp(_ctx.longValue("AnswerCallResponse.Data.CallContext.ChannelContexts[" + i + "].Timestamp"));<NEW_LINE>channelContext.setAssociatedData(_ctx.mapValue("AnswerCallResponse.Data.CallContext.ChannelContexts[" + i + "].AssociatedData"));<NEW_LINE>channelContext.setReleaseReason(_ctx.stringValue("AnswerCallResponse.Data.CallContext.ChannelContexts[" + i + "].ReleaseReason"));<NEW_LINE>channelContext.setCallType(_ctx.stringValue("AnswerCallResponse.Data.CallContext.ChannelContexts[" + i + "].CallType"));<NEW_LINE>channelContext.setJobId(_ctx.stringValue("AnswerCallResponse.Data.CallContext.ChannelContexts[" + i + "].JobId"));<NEW_LINE>channelContext.setChannelId(_ctx.stringValue("AnswerCallResponse.Data.CallContext.ChannelContexts[" + i + "].ChannelId"));<NEW_LINE>channelContext.setOriginator(_ctx.stringValue("AnswerCallResponse.Data.CallContext.ChannelContexts[" + i + "].Originator"));<NEW_LINE>channelContext.setUserExtension(_ctx.stringValue("AnswerCallResponse.Data.CallContext.ChannelContexts[" + i + "].UserExtension"));<NEW_LINE>channelContexts.add(channelContext);<NEW_LINE>}<NEW_LINE>callContext.setChannelContexts(channelContexts);<NEW_LINE>data.setCallContext(callContext);<NEW_LINE>UserContext userContext = new UserContext();<NEW_LINE>userContext.setExtension(_ctx.stringValue("AnswerCallResponse.Data.UserContext.Extension"));<NEW_LINE>userContext.setHeartbeat(_ctx.longValue("AnswerCallResponse.Data.UserContext.Heartbeat"));<NEW_LINE>userContext.setWorkMode(_ctx.stringValue("AnswerCallResponse.Data.UserContext.WorkMode"));<NEW_LINE>userContext.setDeviceId(_ctx.stringValue("AnswerCallResponse.Data.UserContext.DeviceId"));<NEW_LINE>userContext.setUserId(_ctx.stringValue("AnswerCallResponse.Data.UserContext.UserId"));<NEW_LINE>userContext.setReserved(_ctx.longValue("AnswerCallResponse.Data.UserContext.Reserved"));<NEW_LINE>userContext.setBreakCode(_ctx.stringValue("AnswerCallResponse.Data.UserContext.BreakCode"));<NEW_LINE>userContext.setInstanceId(_ctx.stringValue("AnswerCallResponse.Data.UserContext.InstanceId"));<NEW_LINE>userContext.setOutboundScenario(_ctx.booleanValue("AnswerCallResponse.Data.UserContext.OutboundScenario"));<NEW_LINE>userContext.setMobile(_ctx.stringValue("AnswerCallResponse.Data.UserContext.Mobile"));<NEW_LINE>userContext.setJobId(_ctx.stringValue("AnswerCallResponse.Data.UserContext.JobId"));<NEW_LINE>userContext.setUserState(_ctx.stringValue("AnswerCallResponse.Data.UserContext.UserState"));<NEW_LINE>List<String> signedSkillGroupIdList = new ArrayList<String>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("AnswerCallResponse.Data.UserContext.SignedSkillGroupIdList.Length"); i++) {<NEW_LINE>signedSkillGroupIdList.add(_ctx.stringValue<MASK><NEW_LINE>}<NEW_LINE>userContext.setSignedSkillGroupIdList(signedSkillGroupIdList);<NEW_LINE>data.setUserContext(userContext);<NEW_LINE>answerCallResponse.setData(data);<NEW_LINE>return answerCallResponse;<NEW_LINE>} | ("AnswerCallResponse.Data.UserContext.SignedSkillGroupIdList[" + i + "]")); |
783,133 | public void start() {<NEW_LINE>if (timer == null) {<NEW_LINE>lastSecondTick = System.currentTimeMillis();<NEW_LINE>timer = UserThread.runPeriodically(() -> {<NEW_LINE>listeners.forEach(Listener::onSecondTick);<NEW_LINE>counter++;<NEW_LINE>if (counter >= 60) {<NEW_LINE>counter = 0;<NEW_LINE>listeners.forEach(Listener::onMinuteTick);<NEW_LINE>}<NEW_LINE>long currentTimeMillis = System.currentTimeMillis();<NEW_LINE>long diff = currentTimeMillis - lastSecondTick;<NEW_LINE>if (diff > 1000) {<NEW_LINE>long missedMs = diff - 1000;<NEW_LINE>listeners.forEach(listener <MASK><NEW_LINE>if (missedMs > ClockWatcher.IDLE_TOLERANCE_MS) {<NEW_LINE>log.info("We have been in standby mode for {} sec", missedMs / 1000);<NEW_LINE>listeners.forEach(listener -> listener.onAwakeFromStandby(missedMs));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>lastSecondTick = currentTimeMillis;<NEW_LINE>}, 1, TimeUnit.SECONDS);<NEW_LINE>}<NEW_LINE>} | -> listener.onMissedSecondTick(missedMs)); |
828,873 | protected void runGroupSynchronization(MapMarkersGroup group) {<NEW_LINE>List<MapMarker> <MASK><NEW_LINE>List<MapMarker> groupMarkers = new ArrayList<>(group.getMarkers());<NEW_LINE>if (group.getType() == ItineraryType.FAVOURITES) {<NEW_LINE>syncFavouriteGroup(group, existingMarkers);<NEW_LINE>} else if (group.getType() == ItineraryType.TRACK) {<NEW_LINE>syncTrackGroup(group, existingMarkers);<NEW_LINE>} else if (group.getType() == ItineraryType.MARKERS) {<NEW_LINE>existingMarkers.addAll(markersDbHelper.getActiveMarkers());<NEW_LINE>existingMarkers.addAll(markersDbHelper.getMarkersHistory());<NEW_LINE>} else {<NEW_LINE>throw new IllegalArgumentException("Unsupported ItineraryType: " + group.getType());<NEW_LINE>}<NEW_LINE>updateGroupMarkers(group, groupMarkers, existingMarkers);<NEW_LINE>removeOldMarkersIfPresent(groupMarkers);<NEW_LINE>} | existingMarkers = new ArrayList<>(); |
924,885 | private void validateStructuredValue(TomlNode tomlValue, String variableName, Type type) {<NEW_LINE>if (tomlValue.kind() == TomlType.INLINE_TABLE) {<NEW_LINE>tomlValue = ((TomlInlineTableValueNode) tomlValue).toTable();<NEW_LINE>}<NEW_LINE>switch(type.getTag()) {<NEW_LINE>case TypeTags.TUPLE_TAG:<NEW_LINE>validateTupleValue(tomlValue, variableName, (TupleType) type);<NEW_LINE>break;<NEW_LINE>case TypeTags.ARRAY_TAG:<NEW_LINE>validateArrayValue(tomlValue, variableName, (ArrayType) type);<NEW_LINE>break;<NEW_LINE>case TypeTags.RECORD_TYPE_TAG:<NEW_LINE>validateRecordValue(tomlValue, variableName, type);<NEW_LINE>break;<NEW_LINE>case TypeTags.MAP_TAG:<NEW_LINE>validateMapValue(tomlValue, variableName, (MapType) type);<NEW_LINE>break;<NEW_LINE>case TypeTags.TABLE_TAG:<NEW_LINE>validateTableValue(tomlValue, variableName, (TableType) type);<NEW_LINE>break;<NEW_LINE>case TypeTags.INTERSECTION_TAG:<NEW_LINE>Type effectiveType = ((IntersectionType) type).getEffectiveType();<NEW_LINE>if (effectiveType.getTag() == TypeTags.RECORD_TYPE_TAG) {<NEW_LINE>validateRecordValue(tomlValue, variableName, type);<NEW_LINE>} else {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>break;<NEW_LINE>case TypeTags.ANYDATA_TAG:<NEW_LINE>case TypeTags.UNION_TAG:<NEW_LINE>validateUnionValue(tomlValue, variableName, (BUnionType) type);<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>invalidTomlLines.add(tomlValue.location().lineRange());<NEW_LINE>throw new ConfigException(CONFIG_TYPE_NOT_SUPPORTED, variableName, type.toString());<NEW_LINE>}<NEW_LINE>} | validateValue(tomlValue, variableName, effectiveType); |
452,245 | ActionResult<Wo> execute(EffectivePerson effectivePerson, String id, JsonElement jsonElement) throws Exception {<NEW_LINE>try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) {<NEW_LINE>ActionResult<Wo> result = new ActionResult<>();<NEW_LINE>Wi wi = this.convertToWrapIn(jsonElement, Wi.class);<NEW_LINE>Business business = new Business(emc);<NEW_LINE>Script script = emc.find(id, Script.class);<NEW_LINE>if (null == script) {<NEW_LINE>throw new ExceptionScriptNotExist(id);<NEW_LINE>}<NEW_LINE>Application application = emc.find(script.<MASK><NEW_LINE>if (null == application) {<NEW_LINE>throw new ExceptionApplicationNotExist(script.getApplication());<NEW_LINE>}<NEW_LINE>if (!business.editable(effectivePerson, application)) {<NEW_LINE>throw new ExceptionApplicationAccessDenied(effectivePerson.getDistinguishedName(), application.getName(), application.getId());<NEW_LINE>}<NEW_LINE>emc.beginTransaction(Script.class);<NEW_LINE>Wi.copier.copy(wi, script);<NEW_LINE>script.setLastUpdatePerson(effectivePerson.getDistinguishedName());<NEW_LINE>script.setLastUpdateTime(new Date());<NEW_LINE>emc.commit();<NEW_LINE>CacheManager.notify(Script.class);<NEW_LINE>ThisApplication.scriptVersionQueue.send(new ScriptVersion(script.getId(), jsonElement));<NEW_LINE>Wo wo = new Wo();<NEW_LINE>wo.setId(script.getId());<NEW_LINE>result.setData(wo);<NEW_LINE>return result;<NEW_LINE>}<NEW_LINE>} | getApplication(), Application.class); |
1,608,283 | public boolean meets(ToolChainRequirement requirement) {<NEW_LINE>switch(requirement) {<NEW_LINE>case AVAILABLE:<NEW_LINE>case VISUALCPP:<NEW_LINE>case SUPPORTS_32:<NEW_LINE>case SUPPORTS_32_AND_64:<NEW_LINE>return true;<NEW_LINE>case VISUALCPP_2012_OR_NEWER:<NEW_LINE>return version.compareTo(VISUALSTUDIO_2012.getVersion()) >= 0;<NEW_LINE>case VISUALCPP_2013:<NEW_LINE>return version.equals(VISUALSTUDIO_2013.getVersion());<NEW_LINE>case VISUALCPP_2013_OR_NEWER:<NEW_LINE>return version.compareTo(VISUALSTUDIO_2013.getVersion()) >= 0;<NEW_LINE>case VISUALCPP_2015:<NEW_LINE>return version.equals(VISUALSTUDIO_2015.getVersion());<NEW_LINE>case VISUALCPP_2015_OR_NEWER:<NEW_LINE>return version.compareTo(VISUALSTUDIO_2015.getVersion()) >= 0;<NEW_LINE>case VISUALCPP_2017:<NEW_LINE>return version.equals(VISUALSTUDIO_2017.getVersion());<NEW_LINE>case VISUALCPP_2017_OR_NEWER:<NEW_LINE>return version.compareTo(VISUALSTUDIO_2017.getVersion()) >= 0;<NEW_LINE>case VISUALCPP_2019:<NEW_LINE>return version.<MASK><NEW_LINE>case VISUALCPP_2019_OR_NEWER:<NEW_LINE>return version.compareTo(VISUALSTUDIO_2019.getVersion()) >= 0;<NEW_LINE>default:<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>} | equals(VISUALSTUDIO_2019.getVersion()); |
1,123,034 | public StateId createStateId(String name) {<NEW_LINE>if (createdStateIds.containsKey(name))<NEW_LINE>return createdStateIds.get(name);<NEW_LINE>if (stateIndexCounter >= activityStates[0].length) {<NEW_LINE>activityStates = new Object[nuActivities][stateIndexCounter + 1];<NEW_LINE>vehicleDependentActivityStates = new Object[nuActivities][nuVehicleTypeKeys][stateIndexCounter + 1];<NEW_LINE>routeStatesArr = new Object[vrp.getVehicles().size() + 2][stateIndexCounter + 1];<NEW_LINE>vehicleDependentRouteStatesArr = new Object[vrp.getVehicles().size() + 2][nuVehicleTypeKeys][stateIndexCounter + 1];<NEW_LINE>problemStates <MASK><NEW_LINE>}<NEW_LINE>StateId id = StateFactory.createId(name, stateIndexCounter);<NEW_LINE>incStateIndexCounter();<NEW_LINE>createdStateIds.put(name, id);<NEW_LINE>return id;<NEW_LINE>} | = new Object[stateIndexCounter + 1]; |
1,525,048 | public static void main(final String[] args) throws Exception {<NEW_LINE>final Options opts = new Options();<NEW_LINE>opts.addOption(Option.builder("b").longOpt("bootstrap-servers").hasArg().desc("Kafka cluster bootstrap server string (ex: broker:9092)").build());<NEW_LINE>opts.addOption(Option.builder("s").longOpt("schema-registry").hasArg().desc("Schema Registry URL").build());<NEW_LINE>opts.addOption(Option.builder("c").longOpt("config-file").hasArg().desc("Java properties file with configurations for Kafka Clients").build());<NEW_LINE>opts.addOption(Option.builder("t").longOpt("state-dir").hasArg().desc("The directory for state storage").build());<NEW_LINE>opts.addOption(Option.builder("h").longOpt("help").hasArg(false).desc("Show usage information").build());<NEW_LINE>final CommandLine cl = new DefaultParser().parse(opts, args);<NEW_LINE>if (cl.hasOption("h")) {<NEW_LINE>final HelpFormatter formatter = new HelpFormatter();<NEW_LINE><MASK><NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final FraudService service = new FraudService();<NEW_LINE>final Properties defaultConfig = Optional.ofNullable(cl.getOptionValue("config-file", null)).map(path -> {<NEW_LINE>try {<NEW_LINE>return buildPropertiesFromConfigFile(path);<NEW_LINE>} catch (final IOException e) {<NEW_LINE>throw new RuntimeException(e);<NEW_LINE>}<NEW_LINE>}).orElse(new Properties());<NEW_LINE>final String schemaRegistryUrl = cl.getOptionValue("schema-registry", DEFAULT_SCHEMA_REGISTRY_URL);<NEW_LINE>defaultConfig.put(AbstractKafkaSchemaSerDeConfig.SCHEMA_REGISTRY_URL_CONFIG, schemaRegistryUrl);<NEW_LINE>Schemas.configureSerdes(defaultConfig);<NEW_LINE>service.start(cl.getOptionValue("bootstrap-servers", DEFAULT_BOOTSTRAP_SERVERS), cl.getOptionValue("state-dir", "/tmp/kafka-streams-examples"), defaultConfig);<NEW_LINE>addShutdownHookAndBlock(service);<NEW_LINE>} | formatter.printHelp("Fraud Service", opts); |
1,800,025 | // GEN-LAST:event_cancelButtonActionPerformed<NEW_LINE>private void sendButtonActionPerformed(java.awt.event.ActionEvent evt) {<NEW_LINE>// GEN-FIRST:event_sendButtonActionPerformed<NEW_LINE>String title = txtIdeaTitle<MASK><NEW_LINE>if (title.isEmpty()) {<NEW_LINE>JOptionPane.showMessageDialog(null, "\"Enter your idea\" is a mandatory field", "Warning", JOptionPane.INFORMATION_MESSAGE);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (title.length() > 100) {<NEW_LINE>JOptionPane.showMessageDialog(null, "\"Enter your idea\" value is too long (100 characters max)", "Warning", JOptionPane.INFORMATION_MESSAGE);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>String type = cleanUpType(cbFeedbackType.getSelectedItem().toString());<NEW_LINE>String message = txtFeedbackMessage.getText().trim();<NEW_LINE>if (message.isEmpty()) {<NEW_LINE>JOptionPane.showMessageDialog(null, "\"Describe your idea\" is a mandatory field.", "Warning", JOptionPane.INFORMATION_MESSAGE);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (message.length() > 300) {<NEW_LINE>JOptionPane.showMessageDialog(null, "\"Describe your idea\" value is too long (300 characters max)", "Warning", JOptionPane.INFORMATION_MESSAGE);<NEW_LINE>}<NEW_LINE>String email = txtEmail.getText().trim();<NEW_LINE>if (email.length() > 100) {<NEW_LINE>email = email.substring(0, 100);<NEW_LINE>}<NEW_LINE>if (SessionHandler.sendFeedback(title, type, message, email)) {<NEW_LINE>JOptionPane.showMessageDialog(null, "Feedback was sent. Thank you!", "Success", JOptionPane.INFORMATION_MESSAGE);<NEW_LINE>reset();<NEW_LINE>dialog.setVisible(false);<NEW_LINE>} else {<NEW_LINE>JOptionPane.showMessageDialog(null, "Couldn't sent feedback.", "Error", JOptionPane.ERROR_MESSAGE);<NEW_LINE>}<NEW_LINE>} | .getText().trim(); |
999,346 | public static void convert(InterleavedF32 input, InterleavedI16 output) {<NEW_LINE>if (input.isSubimage() || output.isSubimage()) {<NEW_LINE>final int N = input.width * input.getNumBands();<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 < N; x++) {<NEW_LINE>output.data[indexDst++] = (short) (input.data[indexSrc++]);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// CONCURRENT_ABOVE });<NEW_LINE>} else {<NEW_LINE>final int N = input.width * input.height * input.getNumBands();<NEW_LINE>// CONCURRENT_BELOW BoofConcurrency.loopBlocks(0,N,(i0,i1)->{<NEW_LINE><MASK><NEW_LINE>for (int i = i0; i < i1; i++) {<NEW_LINE>output.data[i] = (short) (input.data[i]);<NEW_LINE>}<NEW_LINE>// CONCURRENT_INLINE });<NEW_LINE>}<NEW_LINE>} | int i0 = 0, i1 = N; |
330,796 | public Change createChange(IProgressMonitor pm) throws CoreException {<NEW_LINE>final Map<String, String> arguments = new HashMap<>();<NEW_LINE>String project = null;<NEW_LINE>IJavaProject javaProject = fField.getJavaProject();<NEW_LINE>if (javaProject != null) {<NEW_LINE>project = javaProject.getElementName();<NEW_LINE>}<NEW_LINE>int flags = JavaRefactoringDescriptor.JAR_MIGRATION | JavaRefactoringDescriptor.JAR_REFACTORING | RefactoringDescriptor.STRUCTURAL_CHANGE | RefactoringDescriptor.MULTI_CHANGE;<NEW_LINE>final IType declaring = fField.getDeclaringType();<NEW_LINE>try {<NEW_LINE>if (declaring.isAnonymous() || declaring.isLocal()) {<NEW_LINE>flags |= JavaRefactoringDescriptor.JAR_SOURCE_ATTACHMENT;<NEW_LINE>}<NEW_LINE>} catch (JavaModelException exception) {<NEW_LINE>JavaLanguageServerPlugin.log(exception);<NEW_LINE>}<NEW_LINE>final String description = Messages.format(RefactoringCoreMessages.SelfEncapsulateField_descriptor_description_short, BasicElementLabels.getJavaElementName(fField.getElementName()));<NEW_LINE>final String header = Messages.format(RefactoringCoreMessages.SelfEncapsulateFieldRefactoring_descriptor_description, new String[] { JavaElementLabels.getElementLabel(fField, JavaElementLabels.ALL_FULLY_QUALIFIED), JavaElementLabels.getElementLabel(declaring, JavaElementLabels.ALL_FULLY_QUALIFIED) });<NEW_LINE>final JDTRefactoringDescriptorComment comment = new JDTRefactoringDescriptorComment(project, this, header);<NEW_LINE>comment.addSetting(Messages.format(RefactoringCoreMessages.SelfEncapsulateField_original_pattern, JavaElementLabels.getElementLabel(fField, JavaElementLabels.ALL_FULLY_QUALIFIED)));<NEW_LINE>comment.addSetting(Messages.format(RefactoringCoreMessages.SelfEncapsulateField_getter_pattern, BasicElementLabels.getJavaElementName(fGetterName)));<NEW_LINE>comment.addSetting(Messages.format(RefactoringCoreMessages.SelfEncapsulateField_setter_pattern, BasicElementLabels.getJavaElementName(fSetterName)));<NEW_LINE>String visibility = JdtFlags.getVisibilityString(fVisibility);<NEW_LINE>if ("".equals(visibility)) {<NEW_LINE>visibility = RefactoringCoreMessages.SelfEncapsulateField_default_visibility;<NEW_LINE>}<NEW_LINE>comment.addSetting(Messages.format(RefactoringCoreMessages.SelfEncapsulateField_visibility_pattern, visibility));<NEW_LINE>if (fEncapsulateDeclaringClass) {<NEW_LINE>comment.addSetting(RefactoringCoreMessages.SelfEncapsulateField_use_accessors);<NEW_LINE>} else {<NEW_LINE>comment.addSetting(RefactoringCoreMessages.SelfEncapsulateField_do_not_use_accessors);<NEW_LINE>}<NEW_LINE>if (fGenerateJavadoc) {<NEW_LINE>comment.addSetting(RefactoringCoreMessages.SelfEncapsulateField_generate_comments);<NEW_LINE>}<NEW_LINE>final EncapsulateFieldDescriptor descriptor = RefactoringSignatureDescriptorFactory.createEncapsulateFieldDescriptor(project, description, comment.asString(), arguments, flags);<NEW_LINE>arguments.put(JavaRefactoringDescriptorUtil.ATTRIBUTE_INPUT, JavaRefactoringDescriptorUtil.elementToHandle(project, fField));<NEW_LINE>arguments.put(ATTRIBUTE_VISIBILITY, Integer.valueOf(fVisibility).toString());<NEW_LINE>arguments.put(ATTRIBUTE_INSERTION, Integer.valueOf(fInsertionIndex).toString());<NEW_LINE>arguments.put(ATTRIBUTE_SETTER, fSetterName);<NEW_LINE>arguments.put(ATTRIBUTE_GETTER, fGetterName);<NEW_LINE>arguments.put(ATTRIBUTE_COMMENTS, Boolean.valueOf<MASK><NEW_LINE>arguments.put(ATTRIBUTE_DECLARING, Boolean.valueOf(fEncapsulateDeclaringClass).toString());<NEW_LINE>final DynamicValidationRefactoringChange result = new DynamicValidationRefactoringChange(descriptor, getName());<NEW_LINE>TextChange[] changes = fChangeManager.getAllChanges();<NEW_LINE>pm.beginTask(NO_NAME, changes.length);<NEW_LINE>pm.setTaskName(RefactoringCoreMessages.SelfEncapsulateField_create_changes);<NEW_LINE>for (int i = 0; i < changes.length; i++) {<NEW_LINE>result.add(changes[i]);<NEW_LINE>pm.worked(1);<NEW_LINE>}<NEW_LINE>pm.done();<NEW_LINE>return result;<NEW_LINE>} | (fGenerateJavadoc).toString()); |
779,950 | final CreateBucketAccessKeyResult executeCreateBucketAccessKey(CreateBucketAccessKeyRequest createBucketAccessKeyRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(createBucketAccessKeyRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<CreateBucketAccessKeyRequest> request = null;<NEW_LINE>Response<CreateBucketAccessKeyResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new CreateBucketAccessKeyRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(createBucketAccessKeyRequest));<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, "Lightsail");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "CreateBucketAccessKey");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<CreateBucketAccessKeyResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new CreateBucketAccessKeyResultJsonUnmarshaller());<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,641,632 | public int compare(Integer head1, Integer head2) {<NEW_LINE>if (head1.equals(head2)) {<NEW_LINE>return 0;<NEW_LINE>}<NEW_LINE>VcsRef <MASK><NEW_LINE>VcsRef ref2 = myRefsModel.bestRefToHead(head2);<NEW_LINE>if (ref1 == null) {<NEW_LINE>reportNoRefs(head1);<NEW_LINE>if (ref2 == null) {<NEW_LINE>reportNoRefs(head2);<NEW_LINE>return head1 - head2;<NEW_LINE>}<NEW_LINE>return 1;<NEW_LINE>}<NEW_LINE>if (ref2 == null) {<NEW_LINE>reportNoRefs(head2);<NEW_LINE>return -1;<NEW_LINE>}<NEW_LINE>if (ref1.equals(ref2)) {<NEW_LINE>LOG.warn("Different heads " + myHashGetter.fun(head1) + " and " + myHashGetter.fun(head2) + " contain the same reference " + ref1);<NEW_LINE>}<NEW_LINE>VirtualFile root1 = ref1.getRoot();<NEW_LINE>VirtualFile root2 = ref2.getRoot();<NEW_LINE>VcsLogRefManager refManager1 = myRefManagers.get(root1);<NEW_LINE>VcsLogRefManager refManager2 = myRefManagers.get(root2);<NEW_LINE>if (!refManager1.equals(refManager2)) {<NEW_LINE>return refManager1.toString().compareTo(refManager2.toString());<NEW_LINE>}<NEW_LINE>return refManager1.getBranchLayoutComparator().compare(ref1, ref2);<NEW_LINE>} | ref1 = myRefsModel.bestRefToHead(head1); |
427,041 | public FixResult fix() {<NEW_LINE>// If the failure does not include a suggestion, directly inform users that it cannot be auto<NEW_LINE>// fixed.<NEW_LINE>if (!err.hasSuggestion()) {<NEW_LINE>return FixResult.failure(query, err, "No similar function was found.");<NEW_LINE>}<NEW_LINE>// TODO: If the unrecognized function looks like a UDF (i.e. proj.dataset.function), then<NEW_LINE>// request BigQuery for a list of functions and find the most similar one.<NEW_LINE>IToken token = queryTokenProcessor.getTokenAt(query, err.getErrorPosition().getRow(), err.<MASK><NEW_LINE>String fixedQuery = queryTokenProcessor.replaceToken(query, token, err.getSuggestion());<NEW_LINE>String approach = String.format("Replace the function `%s`", err.getFunctionName());<NEW_LINE>String action = String.format("Change to `%s`", err.getSuggestion());<NEW_LINE>FixOption fixOption = FixOption.of(action, fixedQuery);<NEW_LINE>return FixResult.success(query, approach, Collections.singletonList(fixOption), err, /*isConfident=*/<NEW_LINE>true);<NEW_LINE>} | getErrorPosition().getColumn()); |
792,101 | private void splitGraph(StructureVertex<?> vertex, Structure newStructure, Set<StructureVertex<?>> verticesToVisit, Set<StructureEdge<?, ?>> edgesToVisit) {<NEW_LINE>if (!verticesToVisit.contains(vertex))<NEW_LINE>return;<NEW_LINE>verticesToVisit.remove(vertex);<NEW_LINE>newStructure.vertices.put(vertex.id(), vertex);<NEW_LINE>TraversalVertex.Properties props;<NEW_LINE>if (vertex.id().isVariable() && (props = this.properties.get(vertex.id().asVariable())) != null) {<NEW_LINE>newStructure.properties.put(vertex.id(<MASK><NEW_LINE>}<NEW_LINE>List<StructureVertex<?>> adjacents = new ArrayList<>();<NEW_LINE>vertex.outs().forEach(outgoing -> {<NEW_LINE>if (edgesToVisit.contains(outgoing)) {<NEW_LINE>edgesToVisit.remove(outgoing);<NEW_LINE>newStructure.edges.add(outgoing);<NEW_LINE>adjacents.add(outgoing.to());<NEW_LINE>}<NEW_LINE>});<NEW_LINE>vertex.ins().forEach(incoming -> {<NEW_LINE>if (edgesToVisit.contains(incoming)) {<NEW_LINE>edgesToVisit.remove(incoming);<NEW_LINE>newStructure.edges.add(incoming);<NEW_LINE>adjacents.add(incoming.from());<NEW_LINE>}<NEW_LINE>});<NEW_LINE>adjacents.forEach(v -> splitGraph(v, newStructure, verticesToVisit, edgesToVisit));<NEW_LINE>} | ).asVariable(), props); |
865,517 | public static DescribeLoadBalancersResponse unmarshall(DescribeLoadBalancersResponse describeLoadBalancersResponse, UnmarshallerContext _ctx) {<NEW_LINE>describeLoadBalancersResponse.setRequestId(_ctx.stringValue("DescribeLoadBalancersResponse.RequestId"));<NEW_LINE>describeLoadBalancersResponse.setPageNumber(_ctx.integerValue("DescribeLoadBalancersResponse.PageNumber"));<NEW_LINE>describeLoadBalancersResponse.setPageSize(_ctx.integerValue("DescribeLoadBalancersResponse.PageSize"));<NEW_LINE>describeLoadBalancersResponse.setTotalCount(_ctx.integerValue("DescribeLoadBalancersResponse.TotalCount"));<NEW_LINE>List<LoadBalancer> loadBalancers = new ArrayList<LoadBalancer>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("DescribeLoadBalancersResponse.LoadBalancers.Length"); i++) {<NEW_LINE>LoadBalancer loadBalancer = new LoadBalancer();<NEW_LINE>loadBalancer.setVpcId(_ctx.stringValue("DescribeLoadBalancersResponse.LoadBalancers[" + i + "].VpcId"));<NEW_LINE>loadBalancer.setCreateTimeStamp(_ctx.longValue("DescribeLoadBalancersResponse.LoadBalancers[" + i + "].CreateTimeStamp"));<NEW_LINE>loadBalancer.setLoadBalancerId(_ctx.stringValue<MASK><NEW_LINE>loadBalancer.setCreateTime(_ctx.stringValue("DescribeLoadBalancersResponse.LoadBalancers[" + i + "].CreateTime"));<NEW_LINE>loadBalancer.setPayType(_ctx.stringValue("DescribeLoadBalancersResponse.LoadBalancers[" + i + "].PayType"));<NEW_LINE>loadBalancer.setAddressType(_ctx.stringValue("DescribeLoadBalancersResponse.LoadBalancers[" + i + "].AddressType"));<NEW_LINE>loadBalancer.setNetworkType(_ctx.stringValue("DescribeLoadBalancersResponse.LoadBalancers[" + i + "].NetworkType"));<NEW_LINE>loadBalancer.setServiceManagedMode(_ctx.stringValue("DescribeLoadBalancersResponse.LoadBalancers[" + i + "].ServiceManagedMode"));<NEW_LINE>loadBalancer.setSpecBpsFlag(_ctx.booleanValue("DescribeLoadBalancersResponse.LoadBalancers[" + i + "].SpecBpsFlag"));<NEW_LINE>loadBalancer.setAddressIPVersion(_ctx.stringValue("DescribeLoadBalancersResponse.LoadBalancers[" + i + "].AddressIPVersion"));<NEW_LINE>loadBalancer.setLoadBalancerName(_ctx.stringValue("DescribeLoadBalancersResponse.LoadBalancers[" + i + "].LoadBalancerName"));<NEW_LINE>loadBalancer.setBandwidth(_ctx.integerValue("DescribeLoadBalancersResponse.LoadBalancers[" + i + "].Bandwidth"));<NEW_LINE>loadBalancer.setAddress(_ctx.stringValue("DescribeLoadBalancersResponse.LoadBalancers[" + i + "].Address"));<NEW_LINE>loadBalancer.setSlaveZoneId(_ctx.stringValue("DescribeLoadBalancersResponse.LoadBalancers[" + i + "].SlaveZoneId"));<NEW_LINE>loadBalancer.setMasterZoneId(_ctx.stringValue("DescribeLoadBalancersResponse.LoadBalancers[" + i + "].MasterZoneId"));<NEW_LINE>loadBalancer.setInternetChargeTypeAlias(_ctx.stringValue("DescribeLoadBalancersResponse.LoadBalancers[" + i + "].InternetChargeTypeAlias"));<NEW_LINE>loadBalancer.setLoadBalancerSpec(_ctx.stringValue("DescribeLoadBalancersResponse.LoadBalancers[" + i + "].LoadBalancerSpec"));<NEW_LINE>loadBalancer.setSpecType(_ctx.stringValue("DescribeLoadBalancersResponse.LoadBalancers[" + i + "].SpecType"));<NEW_LINE>loadBalancer.setRegionId(_ctx.stringValue("DescribeLoadBalancersResponse.LoadBalancers[" + i + "].RegionId"));<NEW_LINE>loadBalancer.setModificationProtectionReason(_ctx.stringValue("DescribeLoadBalancersResponse.LoadBalancers[" + i + "].ModificationProtectionReason"));<NEW_LINE>loadBalancer.setModificationProtectionStatus(_ctx.stringValue("DescribeLoadBalancersResponse.LoadBalancers[" + i + "].ModificationProtectionStatus"));<NEW_LINE>loadBalancer.setVSwitchId(_ctx.stringValue("DescribeLoadBalancersResponse.LoadBalancers[" + i + "].VSwitchId"));<NEW_LINE>loadBalancer.setLoadBalancerStatus(_ctx.stringValue("DescribeLoadBalancersResponse.LoadBalancers[" + i + "].LoadBalancerStatus"));<NEW_LINE>loadBalancer.setResourceGroupId(_ctx.stringValue("DescribeLoadBalancersResponse.LoadBalancers[" + i + "].ResourceGroupId"));<NEW_LINE>loadBalancer.setInternetChargeType(_ctx.stringValue("DescribeLoadBalancersResponse.LoadBalancers[" + i + "].InternetChargeType"));<NEW_LINE>loadBalancer.setBusinessStatus(_ctx.stringValue("DescribeLoadBalancersResponse.LoadBalancers[" + i + "].BusinessStatus"));<NEW_LINE>loadBalancer.setDeleteProtection(_ctx.stringValue("DescribeLoadBalancersResponse.LoadBalancers[" + i + "].DeleteProtection"));<NEW_LINE>loadBalancer.setRegionIdAlias(_ctx.stringValue("DescribeLoadBalancersResponse.LoadBalancers[" + i + "].RegionIdAlias"));<NEW_LINE>List<Tag> tags = new ArrayList<Tag>();<NEW_LINE>for (int j = 0; j < _ctx.lengthValue("DescribeLoadBalancersResponse.LoadBalancers[" + i + "].Tags.Length"); j++) {<NEW_LINE>Tag tag = new Tag();<NEW_LINE>tag.setTagValue(_ctx.stringValue("DescribeLoadBalancersResponse.LoadBalancers[" + i + "].Tags[" + j + "].TagValue"));<NEW_LINE>tag.setTagKey(_ctx.stringValue("DescribeLoadBalancersResponse.LoadBalancers[" + i + "].Tags[" + j + "].TagKey"));<NEW_LINE>tags.add(tag);<NEW_LINE>}<NEW_LINE>loadBalancer.setTags(tags);<NEW_LINE>loadBalancers.add(loadBalancer);<NEW_LINE>}<NEW_LINE>describeLoadBalancersResponse.setLoadBalancers(loadBalancers);<NEW_LINE>return describeLoadBalancersResponse;<NEW_LINE>} | ("DescribeLoadBalancersResponse.LoadBalancers[" + i + "].LoadBalancerId")); |
472,212 | private void initializeComponents(int min, int max) {<NEW_LINE>// Min<NEW_LINE>minSlider = new Slider(0, 0, 999999, 1);<NEW_LINE>minSlider.setValue(min);<NEW_LINE>minSlider.addChangeListener(new ChangeListener() {<NEW_LINE><NEW_LINE>public void stateChanged(ChangeEvent event) {<NEW_LINE>ParticleController controller = editor.getEmitter();<NEW_LINE>controller.emitter.minParticleCount = (int) minSlider.getValue();<NEW_LINE>editor.restart();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>// Max<NEW_LINE>maxSlider = new Slider(0, 0, 999999, 1);<NEW_LINE>maxSlider.setValue(max);<NEW_LINE>maxSlider.addChangeListener(new ChangeListener() {<NEW_LINE><NEW_LINE>public void stateChanged(ChangeEvent event) {<NEW_LINE>ParticleController controller = editor.getEmitter();<NEW_LINE>controller.emitter.maxParticleCount = (int) maxSlider.getValue();<NEW_LINE>editor.restart();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>int i = 0;<NEW_LINE>contentPanel.add(new JLabel("Min"), new GridBagConstraints(0, i, 1, 1, 0, 0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(6, 0, 0, 0), 0, 0));<NEW_LINE>contentPanel.add(minSlider, new GridBagConstraints(1, i++, 1, 1, 1, 0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(6, 0, 0, 0), 0, 0));<NEW_LINE>contentPanel.add(new JLabel("Max"), new GridBagConstraints(0, i, 1, 1, 0, 0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(6, 0, 0, 0), 0, 0));<NEW_LINE>contentPanel.add(maxSlider, new GridBagConstraints(1, i++, 1, 1, 1, 0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(6, 0, 0, <MASK><NEW_LINE>} | 0), 0, 0)); |
835,638 | private void _forwardLayout(HttpServletRequest req) throws Exception {<NEW_LINE>HttpSession ses = req.getSession();<NEW_LINE>Layout layout = (Layout) req.getAttribute(WebKeys.LAYOUT);<NEW_LINE>String layoutId = null;<NEW_LINE>if (layout == null || !InodeUtils.isSet(layoutId)) {<NEW_LINE>User user = PortalUtil.getUser(req);<NEW_LINE>List<Layout> userLayouts = APILocator.<MASK><NEW_LINE>if (userLayouts != null && userLayouts.size() > 0) {<NEW_LINE>layoutId = userLayouts.get(0).getId();<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>layoutId = layout.getId();<NEW_LINE>}<NEW_LINE>String ctxPath = (String) ses.getAttribute(WebKeys.CTX_PATH);<NEW_LINE>req.setAttribute(WebKeys.FORWARD_URL, ctxPath + "/portal" + PortalUtil.getAuthorizedPath(req) + "/layout?p_l_id=" + layoutId);<NEW_LINE>} | getLayoutAPI().loadLayoutsForUser(user); |
189,351 | private static UserResult makeCredential(CredentialPojo preCredential, String claimJson, Integer cptId, WeIdAuthentication weIdAuthentication) {<NEW_LINE>Map<String, String> credentialInfoMap = buildCredentialInfo(preCredential, claimJson);<NEW_LINE>ResponseData<CredentialTemplateEntity> res = getCptService().queryCredentialTemplate(cptId);<NEW_LINE>CredentialTemplateEntity credentialTemplate = res.getResult();<NEW_LINE>UserResult userResult = UserClient.makeCredential(credentialInfoMap, credentialTemplate);<NEW_LINE>// masterSecret is saved by User<NEW_LINE>String masterSecret = userResult.masterSecret;<NEW_LINE>String credentialSecretsBlindingFactors = userResult.credentialSecretsBlindingFactors;<NEW_LINE>Map<String, String> userCredentialInfo = new HashMap<>();<NEW_LINE>userCredentialInfo.put(ParamKeyConstant.MASTER_SECRET, masterSecret);<NEW_LINE>userCredentialInfo.put(ParamKeyConstant.BLINDING_FACTORS, credentialSecretsBlindingFactors);<NEW_LINE>String json = DataToolUtils.serialize(userCredentialInfo);<NEW_LINE>String id = new StringBuffer().append(weIdAuthentication.getWeId()).append("_").append(cptId).toString();<NEW_LINE>// String id=(String)preCredential.getClaim().get(CredentialConstant.CREDENTIAL_META_KEY_ID);<NEW_LINE>// save masterSecret and credentialSecretsBlindingFactors to persistence.<NEW_LINE>ResponseData<Integer> dbResp = getDataDriver().addOrUpdate(<MASK><NEW_LINE>if (dbResp.getErrorCode().intValue() != ErrorCode.SUCCESS.getCode()) {<NEW_LINE>logger.error("[makeCredential] save masterSecret and blindingFactors to db failed.");<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>return userResult;<NEW_LINE>} | DataDriverConstant.DOMAIN_USER_MASTER_SECRET, id, json); |
1,642,742 | public static List<VirtualMachineDescriptorProxy> list() {<NEW_LINE>try {<NEW_LINE>Method attachMethod = VIRTUAL_MACHINE_CLASS.getMethod("list");<NEW_LINE>attachMethod.setAccessible(true);<NEW_LINE>@SuppressWarnings("rawtypes")<NEW_LINE>List<?> list = (List) attachMethod.invoke(null);<NEW_LINE>if (list == null) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>final <MASK><NEW_LINE>List<VirtualMachineDescriptorProxy> _list = new ArrayList<VirtualMachineDescriptorProxy>(size);<NEW_LINE>for (int i = 0; i < size; ++i) {<NEW_LINE>Object vmd = list.get(i);<NEW_LINE>if (vmd != null) {<NEW_LINE>_list.add((VirtualMachineDescriptorProxy) Proxy.newProxyInstance(VirtualMachineDescriptorProxy.class.getClassLoader(), new Class<?>[] { VirtualMachineDescriptorProxy.class, ObjectProxy.class }, new ForwardingInvocationHandler(vmd)));<NEW_LINE>} else {<NEW_LINE>_list.add(null);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return _list;<NEW_LINE>} catch (NoSuchMethodException e) {<NEW_LINE>throw new IllegalStateException(e);<NEW_LINE>} catch (IllegalArgumentException e) {<NEW_LINE>throw new IllegalStateException(e);<NEW_LINE>} catch (IllegalAccessException e) {<NEW_LINE>throw new IllegalStateException(e);<NEW_LINE>} catch (InvocationTargetException e) {<NEW_LINE>throw new IllegalStateException(e);<NEW_LINE>}<NEW_LINE>} | int size = list.size(); |
1,437,917 | public boolean visit(MySqlShowTopologyStatement x) {<NEW_LINE>final List<SqlNode> operands = new ArrayList<>();<NEW_LINE>SqlNode targetTable = convertToSqlNode(x.getName());<NEW_LINE>if (context.isTestMode()) {<NEW_LINE>String tableName = EagleeyeHelper.rebuildTableName(SQLUtils.normalizeNoTrim(x.getName().getSimpleName()), true);<NEW_LINE>targetTable = ((SqlIdentifier) targetTable).setName(0, tableName);<NEW_LINE>}<NEW_LINE>operands.add(targetTable);<NEW_LINE>SqlNode where = <MASK><NEW_LINE>SqlNode orderBy = convertToSqlNode(x.getOrderBy());<NEW_LINE>SqlNode limit = convertToSqlNode(x.getLimit());<NEW_LINE>this.sqlNode = new SqlShowTopology(SqlParserPos.ZERO, ImmutableList.of(SqlSpecialIdentifier.TOPOLOGY, SqlSpecialIdentifier.FROM), operands, null, where, orderBy, limit);<NEW_LINE>addPrivilegeVerifyItem(null, "", PrivilegePoint.SELECT);<NEW_LINE>return false;<NEW_LINE>} | convertToSqlNode(x.getWhere()); |
990,873 | protected void onCreate(Bundle savedInstanceState) {<NEW_LINE>super.onCreate(savedInstanceState);<NEW_LINE><MASK><NEW_LINE>mSceneView = findViewById(R.id.sceneView);<NEW_LINE>Portal portal = new Portal(getString(R.string.arcgis_online_url));<NEW_LINE>PortalItem portalItem = new PortalItem(portal, getString(R.string.subsurface_item_id));<NEW_LINE>// catch any load errors from the portal items<NEW_LINE>portalItem.addDoneLoadingListener(() -> {<NEW_LINE>if (portalItem.getLoadStatus() != LoadStatus.LOADED) {<NEW_LINE>String error = "Portal item failed to load: " + portalItem.getLoadError();<NEW_LINE>Log.e(TAG, error);<NEW_LINE>Toast.makeText(this, error, Toast.LENGTH_LONG).show();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>// create a scene from a web scene Url and set it to the scene view<NEW_LINE>ArcGISScene scene = new ArcGISScene(portalItem);<NEW_LINE>// ensure the navigation constraint is set to NONE<NEW_LINE>scene.getBaseSurface().setNavigationConstraint(NavigationConstraint.NONE);<NEW_LINE>// set opacity to view content beneath the base surface<NEW_LINE>scene.getBaseSurface().setOpacity(0.5f);<NEW_LINE>mSceneView.setScene(scene);<NEW_LINE>} | setContentView(R.layout.activity_main); |
1,766,160 | private Map<String, Set<String>> resolvePortNamesFromContainerImage(URI imageUri) {<NEW_LINE>String imageName = imageUri.getSchemeSpecificPart();<NEW_LINE>Map<String, Set<String>> portsMap = new HashMap<>();<NEW_LINE>Map<String, String> labels = this.containerImageMetadataResolver.getImageLabels(imageName);<NEW_LINE>if (CollectionUtils.isEmpty(labels)) {<NEW_LINE>return Collections.emptyMap();<NEW_LINE>}<NEW_LINE>String <MASK><NEW_LINE>if (StringUtils.hasText(inboundPortMapping)) {<NEW_LINE>Set<String> inboundPorts = new HashSet<>();<NEW_LINE>inboundPorts.addAll(Arrays.asList(StringUtils.delimitedListToStringArray(inboundPortMapping, ",", " ")));<NEW_LINE>portsMap.put("inbound", inboundPorts);<NEW_LINE>}<NEW_LINE>String outboundPortMapping = labels.get(CONFIGURATION_PROPERTIES_OUTBOUND_PORTS);<NEW_LINE>if (StringUtils.hasText(outboundPortMapping)) {<NEW_LINE>Set<String> outboundPorts = new HashSet<>();<NEW_LINE>outboundPorts.addAll(Arrays.asList(StringUtils.delimitedListToStringArray(outboundPortMapping, ",", " ")));<NEW_LINE>portsMap.put("outbound", outboundPorts);<NEW_LINE>}<NEW_LINE>return portsMap;<NEW_LINE>} | inboundPortMapping = labels.get(CONFIGURATION_PROPERTIES_INBOUND_PORTS); |
229,353 | public static void updateGridOrListIcon(ImageView gridList, int libraryMode) {<NEW_LINE>if (gridList == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>int stringId = R.string.list;<NEW_LINE>if (libraryMode == AppState.MODE_LIST) {<NEW_LINE>gridList.setImageResource(R.drawable.glyphicons_114_justify);<NEW_LINE>stringId = R.string.list;<NEW_LINE>} else if (libraryMode == AppState.MODE_LIST_COMPACT) {<NEW_LINE>gridList.setImageResource(R.drawable.glyphicons_114_justify_compact);<NEW_LINE>stringId = R.string.compact;<NEW_LINE>} else if (libraryMode == AppState.MODE_GRID) {<NEW_LINE>gridList.setImageResource(R.drawable.glyphicons_156_show_big_thumbnails);<NEW_LINE>stringId = R.string.grid;<NEW_LINE>} else if (libraryMode == AppState.MODE_COVERS) {<NEW_LINE>gridList.setImageResource(R.drawable.glyphicons_157_show_thumbnails);<NEW_LINE>stringId = R.string.cover;<NEW_LINE>} else if (libraryMode == AppState.MODE_AUTHORS) {<NEW_LINE>gridList.setImageResource(R.drawable.glyphicons_4_user);<NEW_LINE>stringId = R.string.author;<NEW_LINE>} else if (libraryMode == AppState.MODE_SERIES) {<NEW_LINE>gridList.setImageResource(R.drawable.glyphicons_710_list_numbered);<NEW_LINE>stringId = R.string.serie;<NEW_LINE>} else if (libraryMode == AppState.MODE_GENRE) {<NEW_LINE>gridList.setImageResource(R.drawable.glyphicons_66_tag);<NEW_LINE>stringId = R.string.keywords;<NEW_LINE>} else if (libraryMode == AppState.MODE_USER_TAGS) {<NEW_LINE>gridList.<MASK><NEW_LINE>stringId = R.string.my_tags;<NEW_LINE>} else if (libraryMode == AppState.MODE_KEYWORDS) {<NEW_LINE>gridList.setImageResource(R.drawable.glyphicons_67_keywords);<NEW_LINE>stringId = R.string.keywords;<NEW_LINE>} else if (libraryMode == AppState.MODE_PUBLISHER) {<NEW_LINE>gridList.setImageResource(R.drawable.glyphicons_4_thumbs_up);<NEW_LINE>stringId = R.string.publisher;<NEW_LINE>} else if (libraryMode == AppState.MODE_PUBLICATION_DATE) {<NEW_LINE>gridList.setImageResource(R.drawable.glyphicons_2_book_open);<NEW_LINE>stringId = R.string.publication_date;<NEW_LINE>}<NEW_LINE>gridList.setContentDescription(gridList.getContext().getString(R.string.cd_view_menu) + " " + gridList.getContext().getString(stringId));<NEW_LINE>} | setImageResource(R.drawable.glyphicons_67_tags); |
880,265 | public final Object execute(VirtualFrame frame) {<NEW_LINE>// Reload the arguments<NEW_LINE>Object[] superArguments = new Object[reloadNodes.length];<NEW_LINE>for (int n = 0; n < superArguments.length; n++) {<NEW_LINE>superArguments[n] = reloadNodes<MASK><NEW_LINE>}<NEW_LINE>if (restArgIndex != -1) {<NEW_LINE>final Object restArg = superArguments[restArgIndex];<NEW_LINE>final Object[] restArgs;<NEW_LINE>if (isArrayProfile.profile(restArg instanceof RubyArray)) {<NEW_LINE>restArgs = unsplat((RubyArray) restArg);<NEW_LINE>} else {<NEW_LINE>restArgs = new Object[] { restArg };<NEW_LINE>}<NEW_LINE>final int after = superArguments.length - (restArgIndex + 1);<NEW_LINE>Object[] splattedArguments = ArrayUtils.copyOf(superArguments, superArguments.length + restArgs.length - 1);<NEW_LINE>ArrayUtils.arraycopy(superArguments, restArgIndex + 1, splattedArguments, restArgIndex + restArgs.length, after);<NEW_LINE>ArrayUtils.arraycopy(restArgs, 0, splattedArguments, restArgIndex, restArgs.length);<NEW_LINE>superArguments = splattedArguments;<NEW_LINE>}<NEW_LINE>return superArguments;<NEW_LINE>} | [n].execute(frame); |
753,073 | public static // x > 0 means keep original<NEW_LINE>int compareCursors(final String original, final String candidate, final JsonSchemaPrimitive type) {<NEW_LINE>if (original == null && candidate == null) {<NEW_LINE>return 0;<NEW_LINE>}<NEW_LINE>if (candidate == null) {<NEW_LINE>return 1;<NEW_LINE>}<NEW_LINE>if (original == null) {<NEW_LINE>return -1;<NEW_LINE>}<NEW_LINE>switch(type) {<NEW_LINE>case STRING -><NEW_LINE>{<NEW_LINE>return original.compareTo(candidate);<NEW_LINE>}<NEW_LINE>case NUMBER -><NEW_LINE>{<NEW_LINE>// todo (cgardens) - handle big decimal. this is currently an overflow risk.<NEW_LINE>return Double.compare(Double.parseDouble(original)<MASK><NEW_LINE>}<NEW_LINE>case BOOLEAN -><NEW_LINE>{<NEW_LINE>return Boolean.compare(Boolean.parseBoolean(original), Boolean.parseBoolean(candidate));<NEW_LINE>}<NEW_LINE>// includes OBJECT, ARRAY, NULL<NEW_LINE>default -><NEW_LINE>throw new IllegalStateException(String.format("Cannot use field of type %s as a comparable", type));<NEW_LINE>}<NEW_LINE>} | , Double.parseDouble(candidate)); |
333,212 | /*<NEW_LINE>* Method that will write the latest errors to one file.<NEW_LINE>*/<NEW_LINE>public static void writeLogs() {<NEW_LINE>com.gmt2001.Console.out.println("Generating latest error logs...");<NEW_LINE>String logData = "";<NEW_LINE>// Need to clean this up later.<NEW_LINE>logData += PhantomBot.instance().getBotInformation() + "\r\n";<NEW_LINE>logData += readFile("logs/error/" + getDate(false, true) + ".txt");<NEW_LINE>logData += readFile("logs/core-error/" + getDate(true, true) + ".txt");<NEW_LINE>logData += readFile("logs/error/" + getDate(false, false) + ".txt");<NEW_LINE>logData += readFile("logs/core-error/" + getDate(true, false) + ".txt");<NEW_LINE>String fileName = ("errors_" + getDate(false, false) + "@" + <MASK><NEW_LINE>com.gmt2001.Console.out.println("Log file \"" + fileName + "\" was created in the main bot folder.");<NEW_LINE>writeToFile(fileName, logData);<NEW_LINE>} | System.currentTimeMillis() + ".txt"); |
361,820 | private void insertGroup(long ds_obj_id, final String value, DrawableAttribute<?> groupBy, CaseDbTransaction caseDbTransaction) throws TskCoreException {<NEW_LINE>String cacheKey = Long.toString(ds_obj_id) + "_" + value + "_" + groupBy.getDisplayName();<NEW_LINE>if (groupCache.getIfPresent(cacheKey) != null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>int isAnalyzed = (groupBy == DrawableAttribute.PATH) ? 0 : 1;<NEW_LINE>String insertSQL = String.format(" (data_source_obj_id, value, attribute, is_analyzed) VALUES (%d, \'%s\', \'%s\', %d)", ds_obj_id, SleuthkitCase.escapeSingleQuotes(value), SleuthkitCase.escapeSingleQuotes(groupBy.attrName.toString()), isAnalyzed);<NEW_LINE>if (DbType.POSTGRESQL == caseDb.getDatabaseType()) {<NEW_LINE>insertSQL += " ON CONFLICT DO NOTHING";<NEW_LINE>}<NEW_LINE>caseDb.getCaseDbAccessManager().insert(CASE_DB_GROUPS_TABLENAME, insertSQL, caseDbTransaction);<NEW_LINE>groupCache.<MASK><NEW_LINE>} | put(cacheKey, Boolean.TRUE); |
1,832,897 | protected List<DataFrame> addToBuffer(DataFrame input) {<NEW_LINE>int n = input.getNumRows();<NEW_LINE>if (n == 0) {<NEW_LINE>return Collections.emptyList();<NEW_LINE>}<NEW_LINE>double[] times = input.getDoubleColumnByName(timeColumn);<NEW_LINE>double maxInputTime = ArrayUtils.max(times);<NEW_LINE>DataFrame restInput = input;<NEW_LINE>ArrayList<DataFrame> newPanes = new ArrayList<>(1);<NEW_LINE>// Assuming in order arrival, break up incoming batch into panes<NEW_LINE>while (maxInputTime >= maxWindowTime + slideLength) {<NEW_LINE>// When we fill up a pane, split off the overflow from the current batch<NEW_LINE>double nextWindowEnd = maxWindowTime + slideLength;<NEW_LINE>DataFrame earlyInput = restInput.filter(timeColumn, (double t) -> t < nextWindowEnd);<NEW_LINE>restInput = restInput.filter(timeColumn, (<MASK><NEW_LINE>batchBuffer.add(earlyInput);<NEW_LINE>DataFrame newPane = DataFrame.unionAll(batchBuffer);<NEW_LINE>// Reset the batch buffer and start collecting for the next pane<NEW_LINE>maxWindowTime = nextWindowEnd;<NEW_LINE>batchBuffer.clear();<NEW_LINE>newPanes.add(newPane);<NEW_LINE>}<NEW_LINE>// Buffer partially filled pane until it is filled<NEW_LINE>batchBuffer.add(restInput);<NEW_LINE>return newPanes;<NEW_LINE>} | double t) -> t >= nextWindowEnd); |
724,265 | private Notification create() {<NEW_LINE>Type type = this.type.getSettingValue();<NEW_LINE>Color foreground = HtmlColors.decode(foregroundColor.getSettingValue());<NEW_LINE>Color background = HtmlColors.decode(backgroundColor.getSettingValue());<NEW_LINE>Notification.Builder b = new Notification.Builder(type);<NEW_LINE>b.setDesktopEnabled(desktopState.getSettingValue());<NEW_LINE>b.setSoundEnabled(soundState.getSettingValue());<NEW_LINE>b.setForeground(foreground);<NEW_LINE>b.setBackground(background);<NEW_LINE>b.<MASK><NEW_LINE>b.setVolume(volumeSlider.getSettingValue());<NEW_LINE>b.setSoundCooldown(soundCooldown.getSettingValue(0L).intValue());<NEW_LINE>b.setSoundInactiveCooldown(soundInactiveCooldown.getSettingValue(0L).intValue());<NEW_LINE>b.setChannels(channels.getSettingValue());<NEW_LINE>b.setMatcher(matcher.getSettingValue());<NEW_LINE>b.setOptions(getSubTypes());<NEW_LINE>current = new Notification(b);<NEW_LINE>return current;<NEW_LINE>} | setSoundFile(soundFile.getSettingValue()); |
1,450,695 | public void execute(@Named(IServiceConstants.ACTIVE_SHELL) Shell shell, @Preference(UIConstants.Preferences.ENABLE_EXPERIMENTAL_FEATURES) boolean enableExperimentalFeatures, IThemeEngine themeEngine) {<NEW_LINE>PreferenceManager pm = new PreferenceManager('/');<NEW_LINE>// $NON-NLS-1$<NEW_LINE>pm.addToRoot(new PreferenceNode("general", new GeneralPreferencePage()));<NEW_LINE>// $NON-NLS-1$ //$NON-NLS-2$<NEW_LINE>pm.addTo("general", new PreferenceNode("presets", new PresetsPreferencePage()));<NEW_LINE>// NOSONAR //$NON-NLS-1$<NEW_LINE>pm.addToRoot(new PreferenceNode("presentation", new PresentationPreferencePage()));<NEW_LINE>// $NON-NLS-1$ //$NON-NLS-2$<NEW_LINE>pm.addTo("presentation", new PreferenceNode(<MASK><NEW_LINE>// $NON-NLS-1$ //$NON-NLS-2$<NEW_LINE>pm.addTo("presentation", new PreferenceNode("theme", new ThemePreferencePage(themeEngine)));<NEW_LINE>// $NON-NLS-1$ //$NON-NLS-2$<NEW_LINE>pm.addTo("presentation", new PreferenceNode("formatting", new FormattingPreferencePage()));<NEW_LINE>// $NON-NLS-1$<NEW_LINE>pm.addToRoot(new PreferenceNode("calendar", new CalendarPreferencePage()));<NEW_LINE>// $NON-NLS-1$<NEW_LINE>pm.addToRoot(new PreferenceNode("api", new APIKeyPreferencePage()));<NEW_LINE>// $NON-NLS-1$ //$NON-NLS-2$<NEW_LINE>pm.addTo("api", new PreferenceNode("alphavantage", new AlphaVantagePreferencePage()));<NEW_LINE>// $NON-NLS-1$ //$NON-NLS-2$<NEW_LINE>pm.addTo("api", new PreferenceNode("divvydiary", new DivvyDiaryPreferencePage()));<NEW_LINE>// $NON-NLS-1$ //$NON-NLS-2$<NEW_LINE>pm.addTo("api", new PreferenceNode("eodhistoricaldata", new EODHistoricalDataPreferencePage()));<NEW_LINE>// $NON-NLS-1$ //$NON-NLS-2$<NEW_LINE>pm.addTo("api", new PreferenceNode("finnhub", new FinnhubPreferencePage()));<NEW_LINE>if (enableExperimentalFeatures)<NEW_LINE>// $NON-NLS-1$ //$NON-NLS-2$<NEW_LINE>pm.addTo("api", new PreferenceNode("portfolio-report", new PortfolioReportPreferencePage()));<NEW_LINE>// $NON-NLS-1$ //$NON-NLS-2$<NEW_LINE>pm.addTo("api", new PreferenceNode("quandl", new QuandlPreferencePage()));<NEW_LINE>// $NON-NLS-1$<NEW_LINE>pm.addToRoot(new PreferenceNode("proxy", new ProxyPreferencePage()));<NEW_LINE>// $NON-NLS-1$<NEW_LINE>pm.addToRoot(new PreferenceNode("updates", new UpdatePreferencePage()));<NEW_LINE>PreferenceDialog dialog = new PreferenceDialog(shell, pm) {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>protected void configureShell(Shell newShell) {<NEW_LINE>super.configureShell(newShell);<NEW_LINE>newShell.setText(Messages.LabelSettings);<NEW_LINE>}<NEW_LINE>};<NEW_LINE>// if the dialog reopens with the previously selected node, some of the<NEW_LINE>// nodes are not visible. Workaround: make sure not previous node exists<NEW_LINE>dialog.setSelectedNode(null);<NEW_LINE>dialog.setPreferenceStore(PortfolioPlugin.getDefault().getPreferenceStore());<NEW_LINE>dialog.create();<NEW_LINE>dialog.getTreeViewer().expandAll();<NEW_LINE>dialog.open();<NEW_LINE>} | "language", new LanguagePreferencePage())); |
793,943 | public ExportBackupPlanTemplateResult unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>ExportBackupPlanTemplateResult exportBackupPlanTemplateResult = new ExportBackupPlanTemplateResult();<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 exportBackupPlanTemplateResult;<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("BackupPlanTemplateJson", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>exportBackupPlanTemplateResult.setBackupPlanTemplateJson(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 exportBackupPlanTemplateResult;<NEW_LINE>} | int originalDepth = context.getCurrentDepth(); |
524,004 | public SuggestionContext build(SearchExecutionContext context) throws IOException {<NEW_LINE>CompletionSuggestionContext suggestionContext = new CompletionSuggestionContext(context);<NEW_LINE>// copy over common settings to each suggestion builder<NEW_LINE>populateCommonFields(context, suggestionContext);<NEW_LINE>suggestionContext.setSkipDuplicates(skipDuplicates);<NEW_LINE>suggestionContext.setFuzzyOptions(fuzzyOptions);<NEW_LINE>suggestionContext.setRegexOptions(regexOptions);<NEW_LINE>if (shardSize != null) {<NEW_LINE>suggestionContext.setShardSize(shardSize);<NEW_LINE>}<NEW_LINE>MappedFieldType mappedFieldType = context.getFieldType(suggestionContext.getField());<NEW_LINE>if (mappedFieldType instanceof CompletionFieldMapper.CompletionFieldType == false) {<NEW_LINE>throw new IllegalArgumentException("Field [" + suggestionContext.getField() + "] is not a completion suggest field");<NEW_LINE>}<NEW_LINE>CompletionFieldMapper.CompletionFieldType type = (CompletionFieldMapper.CompletionFieldType) mappedFieldType;<NEW_LINE>suggestionContext.setFieldType(type);<NEW_LINE>if (type.hasContextMappings() && contextBytes != null) {<NEW_LINE>Map<String, List<ContextMapping.InternalQueryContext>> queryContexts = parseContextBytes(contextBytes, context.getParserConfig(<MASK><NEW_LINE>suggestionContext.setQueryContexts(queryContexts);<NEW_LINE>} else if (contextBytes != null) {<NEW_LINE>throw new IllegalArgumentException("suggester [" + type.name() + "] doesn't expect any context");<NEW_LINE>}<NEW_LINE>assert suggestionContext.getFieldType() != null : "no completion field type set";<NEW_LINE>return suggestionContext;<NEW_LINE>} | ), type.getContextMappings()); |
1,413,586 | private RubyRepeatedField rubyToRepeatedField(ThreadContext context, FieldDescriptor fieldDescriptor, IRubyObject value) {<NEW_LINE>RubyArray arr = value.convertToArray();<NEW_LINE>RubyRepeatedField repeatedField = repeatedFieldForFieldDescriptor(context, fieldDescriptor);<NEW_LINE>IRubyObject[] values = new IRubyObject[arr.size()];<NEW_LINE>FieldDescriptor.Type fieldType = fieldDescriptor.getType();<NEW_LINE>RubyModule typeClass = null;<NEW_LINE>if (fieldType == FieldDescriptor.Type.MESSAGE) {<NEW_LINE>RubyDescriptor descriptor = (<MASK><NEW_LINE>typeClass = (RubyModule) descriptor.msgclass(context);<NEW_LINE>} else if (fieldType == FieldDescriptor.Type.ENUM) {<NEW_LINE>RubyEnumDescriptor enumDescriptor = (RubyEnumDescriptor) getDescriptorForField(context, fieldDescriptor);<NEW_LINE>typeClass = (RubyModule) enumDescriptor.enummodule(context);<NEW_LINE>}<NEW_LINE>for (int i = 0; i < arr.size(); i++) {<NEW_LINE>IRubyObject item = arr.eltInternal(i);<NEW_LINE>if (item.isNil()) {<NEW_LINE>throw Utils.createTypeError(context, "nil message not allowed here.");<NEW_LINE>}<NEW_LINE>if (item instanceof RubyHash && typeClass != null) {<NEW_LINE>values[i] = ((RubyClass) typeClass).newInstance(context, item, Block.NULL_BLOCK);<NEW_LINE>} else {<NEW_LINE>if (fieldType == FieldDescriptor.Type.ENUM) {<NEW_LINE>item = enumToSymbol(context, fieldDescriptor.getEnumType(), item);<NEW_LINE>}<NEW_LINE>values[i] = item;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>repeatedField.push(context, values);<NEW_LINE>return repeatedField;<NEW_LINE>} | RubyDescriptor) getDescriptorForField(context, fieldDescriptor); |
1,815,659 | private String queryMicroarchitecture() {<NEW_LINE>String arch = null;<NEW_LINE>Properties archProps = FileUtil.readPropertiesFromFilename(OSHI_ARCHITECTURE_PROPERTIES);<NEW_LINE>// Intel is default, no prefix<NEW_LINE>StringBuilder sb = new StringBuilder();<NEW_LINE>// AMD and ARM properties have prefix<NEW_LINE>String ucVendor = this.cpuVendor.toUpperCase();<NEW_LINE>if (ucVendor.contains("AMD")) {<NEW_LINE>sb.append("amd.");<NEW_LINE>} else if (ucVendor.contains("ARM")) {<NEW_LINE>sb.append("arm.");<NEW_LINE>} else if (ucVendor.contains("IBM")) {<NEW_LINE>// Directly parse the name to POWER#<NEW_LINE>int powerIdx = this.cpuName.indexOf("_POWER");<NEW_LINE>if (powerIdx > 0) {<NEW_LINE>arch = this.cpuName.substring(powerIdx + 1);<NEW_LINE>}<NEW_LINE>} else if (ucVendor.contains("APPLE")) {<NEW_LINE>sb.append("apple.");<NEW_LINE>}<NEW_LINE>if (Util.isBlank(arch) && !sb.toString().equals("arm.")) {<NEW_LINE>// Append family<NEW_LINE>sb.append(this.cpuFamily);<NEW_LINE>arch = archProps.<MASK><NEW_LINE>}<NEW_LINE>if (Util.isBlank(arch)) {<NEW_LINE>// Append model<NEW_LINE>sb.append('.').append(this.cpuModel);<NEW_LINE>arch = archProps.getProperty(sb.toString());<NEW_LINE>}<NEW_LINE>if (Util.isBlank(arch)) {<NEW_LINE>// Append stepping<NEW_LINE>sb.append('.').append(this.cpuStepping);<NEW_LINE>arch = archProps.getProperty(sb.toString());<NEW_LINE>}<NEW_LINE>return Util.isBlank(arch) ? Constants.UNKNOWN : arch;<NEW_LINE>} | getProperty(sb.toString()); |
408,334 | // todo area for optimization<NEW_LINE>private void removeRedundantMappings() {<NEW_LINE>final LocalFileSystem lfs = LocalFileSystem.getInstance();<NEW_LINE>final AllVcsesI <MASK><NEW_LINE>for (Iterator<String> iterator = myVcsToPaths.keySet().iterator(); iterator.hasNext(); ) {<NEW_LINE>final String vcsName = iterator.next();<NEW_LINE>final Collection<VcsDirectoryMapping> mappings = myVcsToPaths.get(vcsName);<NEW_LINE>List<Pair<VirtualFile, VcsDirectoryMapping>> objects = mapNotNull(mappings, dm -> {<NEW_LINE>VirtualFile vf = lfs.findFileByPath(dm.getDirectory());<NEW_LINE>if (vf == null) {<NEW_LINE>vf = lfs.refreshAndFindFileByPath(dm.getDirectory());<NEW_LINE>}<NEW_LINE>return vf == null ? null : Pair.create(vf, dm);<NEW_LINE>});<NEW_LINE>final List<Pair<VirtualFile, VcsDirectoryMapping>> filteredFiles;<NEW_LINE>// todo static<NEW_LINE>Function<Pair<VirtualFile, VcsDirectoryMapping>, VirtualFile> fileConvertor = pair -> pair.getFirst();<NEW_LINE>if (StringUtil.isEmptyOrSpaces(vcsName)) {<NEW_LINE>filteredFiles = AbstractVcs.filterUniqueRootsDefault(objects, fileConvertor);<NEW_LINE>} else {<NEW_LINE>final AbstractVcs<?> vcs = allVcses.getByName(vcsName);<NEW_LINE>if (vcs == null) {<NEW_LINE>VcsBalloonProblemNotifier.showOverChangesView(myProject, "VCS plugin not found for mapping to : '" + vcsName + "'", MessageType.ERROR);<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>filteredFiles = vcs.filterUniqueRoots(objects, fileConvertor);<NEW_LINE>}<NEW_LINE>List<VcsDirectoryMapping> filteredMappings = map(filteredFiles, Functions.pairSecond());<NEW_LINE>// to calculate what had been removed<NEW_LINE>mappings.removeAll(filteredMappings);<NEW_LINE>if (filteredMappings.isEmpty()) {<NEW_LINE>iterator.remove();<NEW_LINE>} else {<NEW_LINE>mappings.clear();<NEW_LINE>mappings.addAll(filteredMappings);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>sortedMappingsByMap();<NEW_LINE>} | allVcses = AllVcses.getInstance(myProject); |
560,386 | protected void consumeInterfaceHeaderName1() {<NEW_LINE>// InterfaceHeaderName ::= Modifiersopt 'interface' 'Identifier'<NEW_LINE>TypeDeclaration typeDecl = new TypeDeclaration(this.compilationUnit.compilationResult);<NEW_LINE>if (this.nestedMethod[this.nestedType] == 0) {<NEW_LINE>if (this.nestedType != 0) {<NEW_LINE>typeDecl.bits |= ASTNode.IsMemberType;<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>// Record that the block has a declaration for local types<NEW_LINE>typeDecl.bits |= ASTNode.IsLocalType;<NEW_LINE>markEnclosingMemberWithLocalType();<NEW_LINE>blockReal();<NEW_LINE>}<NEW_LINE>// highlight the name of the type<NEW_LINE>long pos = this.identifierPositionStack[this.identifierPtr];<NEW_LINE>typeDecl.sourceEnd = (int) pos;<NEW_LINE>typeDecl.sourceStart = (int) (pos >>> 32);<NEW_LINE>typeDecl.name = this.identifierStack[this.identifierPtr--];<NEW_LINE>this.identifierLengthPtr--;<NEW_LINE>// compute the declaration source too<NEW_LINE>// 'class' and 'interface' push an int position<NEW_LINE>this.typeStartPosition = typeDecl.declarationSourceStart = this.intStack[this.intPtr--];<NEW_LINE>this.intPtr--;<NEW_LINE>int declSourceStart = this.intStack[this.intPtr--];<NEW_LINE>typeDecl.modifiersSourceStart = this<MASK><NEW_LINE>typeDecl.modifiers = this.intStack[this.intPtr--] | ClassFileConstants.AccInterface;<NEW_LINE>if (typeDecl.declarationSourceStart > declSourceStart) {<NEW_LINE>typeDecl.declarationSourceStart = declSourceStart;<NEW_LINE>}<NEW_LINE>// consume annotations<NEW_LINE>int length;<NEW_LINE>if ((length = this.expressionLengthStack[this.expressionLengthPtr--]) != 0) {<NEW_LINE>System.arraycopy(this.expressionStack, (this.expressionPtr -= length) + 1, typeDecl.annotations = new Annotation[length], 0, length);<NEW_LINE>}<NEW_LINE>typeDecl.bodyStart = typeDecl.sourceEnd + 1;<NEW_LINE>pushOnAstStack(typeDecl);<NEW_LINE>// javadoc<NEW_LINE>typeDecl.javadoc = this.javadoc;<NEW_LINE>this.javadoc = null;<NEW_LINE>} | .intStack[this.intPtr--]; |
286,356 | // Private methods ---------------------------------------------------------<NEW_LINE>private static Set<URL> readRoots(JavadocRegistry jdr, Set<ClassPath> classpaths, Set<JavadocForBinaryQuery.Result> results) {<NEW_LINE>Set<URL> roots = new HashSet<URL>();<NEW_LINE>List<ClassPath> paths <MASK><NEW_LINE>paths.addAll(jdr.regs.getPaths(ClassPath.COMPILE));<NEW_LINE>paths.addAll(jdr.regs.getPaths(ClassPath.BOOT));<NEW_LINE>for (ClassPath ccp : paths) {<NEW_LINE>classpaths.add(ccp);<NEW_LINE>// System.out.println("CCP " + ccp );<NEW_LINE>for (ClassPath.Entry ccpRoot : ccp.entries()) {<NEW_LINE>// System.out.println(" CCPR " + ccpRoot.getURL());<NEW_LINE>JavadocForBinaryQuery.Result result = JavadocForBinaryQuery.findJavadoc(ccpRoot.getURL());<NEW_LINE>results.add(result);<NEW_LINE>URL[] jdRoots = result.getRoots();<NEW_LINE>for (URL jdRoot : jdRoots) {<NEW_LINE>if (verify(jdRoot)) {<NEW_LINE>roots.add(jdRoot);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// System.out.println("roots=" + roots);<NEW_LINE>return roots;<NEW_LINE>} | = new LinkedList<ClassPath>(); |
542,884 | final ListStudioLifecycleConfigsResult executeListStudioLifecycleConfigs(ListStudioLifecycleConfigsRequest listStudioLifecycleConfigsRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(listStudioLifecycleConfigsRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<ListStudioLifecycleConfigsRequest> request = null;<NEW_LINE>Response<ListStudioLifecycleConfigsResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new ListStudioLifecycleConfigsRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(listStudioLifecycleConfigsRequest));<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, "SageMaker");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ListStudioLifecycleConfigs");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<ListStudioLifecycleConfigsResult>> 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 ListStudioLifecycleConfigsResultJsonUnmarshaller()); |
1,580,759 | public void handleEvent(Event event) {<NEW_LINE>SimpleTextEntryWindow entryWindow = new SimpleTextEntryWindow("max.sr.window.title", "max.sr.window.message");<NEW_LINE>entryWindow.setPreenteredText(existing, false);<NEW_LINE>entryWindow.selectPreenteredText(true);<NEW_LINE>entryWindow.prompt(new UIInputReceiverListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void UIInputReceiverClosed(UIInputReceiver receiver) {<NEW_LINE>if (!receiver.hasSubmittedInput()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>String text = receiver.getSubmittedInput().trim();<NEW_LINE>int sr = 0;<NEW_LINE>if (text.length() > 0) {<NEW_LINE>try {<NEW_LINE>float f = DisplayFormatters.parseFloat(df, text);<NEW_LINE>sr = (int) (f * 1000);<NEW_LINE>if (sr < 0) {<NEW_LINE>sr = 0;<NEW_LINE>} else if (sr == 0 && f > 0) {<NEW_LINE>sr = 1;<NEW_LINE>}<NEW_LINE>tf_rate_limit.setTagMaxShareRatio(sr);<NEW_LINE>} catch (Throwable e) {<NEW_LINE>MessageBox mb = new MessageBox(Utils.findAnyShell(), SWT.ICON_ERROR | SWT.OK);<NEW_LINE>mb.setText(MessageText.getString("MyTorrentsView.dialog.NumberError.title"));<NEW_LINE>mb.setMessage<MASK><NEW_LINE>mb.open();<NEW_LINE>Debug.out(e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} | (MessageText.getString("MyTorrentsView.dialog.NumberError.text")); |
137,094 | public void onCreatePreferences(final Bundle savedInstanceState, final String rootKey) {<NEW_LINE>setPreferencesFromResource(R.xml.preferences_services_geocaching_com, rootKey);<NEW_LINE>// Open website Preference<NEW_LINE>final Preference openWebsite = findPreference(getString(R.string.pref_fakekey_gc_website));<NEW_LINE>final String urlOrHost = GCConnector<MASK><NEW_LINE>openWebsite.setOnPreferenceClickListener(preference -> {<NEW_LINE>final String url = StringUtils.startsWith(urlOrHost, "http") ? urlOrHost : "http://" + urlOrHost;<NEW_LINE>ShareUtils.openUrl(getContext(), url);<NEW_LINE>return true;<NEW_LINE>});<NEW_LINE>// Facebook Login Hint<NEW_LINE>final Preference loginFacebook = findPreference(getString(R.string.pref_gc_fb_login_hint));<NEW_LINE>loginFacebook.setOnPreferenceClickListener(preference -> {<NEW_LINE>final AlertDialog.Builder builder = Dialogs.newBuilder(getContext());<NEW_LINE>builder.setMessage(R.string.settings_info_facebook_login).setIcon(android.R.drawable.ic_dialog_info).setTitle(R.string.settings_info_facebook_login_title).setPositiveButton(android.R.string.ok, (dialog, id) -> dialog.cancel()).setNegativeButton(R.string.more_information, (dialog, id) -> ShareUtils.openUrl(getContext(), getString(R.string.settings_facebook_login_url)));<NEW_LINE>builder.create().show();<NEW_LINE>return true;<NEW_LINE>});<NEW_LINE>} | .getInstance().getHost(); |
1,601,275 | private static String computeParameterName(VariableElement parameter, TypeName type) {<NEW_LINE>String rawClassName = type.withoutAnnotations().toString();<NEW_LINE>String name;<NEW_LINE>if (type.isPrimitive() || type.isBoxedPrimitive()) {<NEW_LINE>name = getSmartPrimitiveParameterName(parameter);<NEW_LINE>} else {<NEW_LINE>if (rawClassName.contains("<") && rawClassName.contains(">")) {<NEW_LINE>String[] preGenericSplit = rawClassName.split("<");<NEW_LINE>String preGeneric = preGenericSplit[0];<NEW_LINE>String[] postGenericSplit = rawClassName.split(">");<NEW_LINE>String postGeneric = postGenericSplit[postGenericSplit.length - 1];<NEW_LINE>if (postGenericSplit.length > 1) {<NEW_LINE>rawClassName = preGeneric + postGeneric;<NEW_LINE>} else {<NEW_LINE>rawClassName = preGeneric;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>String[] <MASK><NEW_LINE>rawClassName = qualifiers[qualifiers.length - 1];<NEW_LINE>rawClassName = applySmartParameterNameReplacements(rawClassName);<NEW_LINE>boolean allCaps = true;<NEW_LINE>for (char c : rawClassName.toCharArray()) {<NEW_LINE>if (Character.isLowerCase(c)) {<NEW_LINE>allCaps = false;<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (allCaps) {<NEW_LINE>name = rawClassName.toLowerCase();<NEW_LINE>} else {<NEW_LINE>int indexOfLastWordStart = 0;<NEW_LINE>char[] chars = rawClassName.toCharArray();<NEW_LINE>for (int i = 0, charArrayLength = chars.length; i < charArrayLength; i++) {<NEW_LINE>char c = chars[i];<NEW_LINE>if (Character.isUpperCase(c)) {<NEW_LINE>indexOfLastWordStart = i;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>rawClassName = rawClassName.substring(indexOfLastWordStart, rawClassName.length());<NEW_LINE>name = Character.toLowerCase(rawClassName.charAt(0)) + rawClassName.substring(1, rawClassName.length());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return name;<NEW_LINE>} | qualifiers = rawClassName.split("\\."); |
1,196,904 | public static <E> DiffResult<List<E>> diff(Collection<E> first, Collection<E> second) {<NEW_LINE>if ((first == null || first.isEmpty()) && (second == null || second.isEmpty())) {<NEW_LINE>return new DiffResult<List<E>>(new ArrayList<E>(), <MASK><NEW_LINE>}<NEW_LINE>if (first == null || first.isEmpty()) {<NEW_LINE>return new DiffResult<List<E>>(new ArrayList<E>(), new ArrayList<E>(second));<NEW_LINE>}<NEW_LINE>if (second == null || second.isEmpty()) {<NEW_LINE>return new DiffResult<List<E>>(new ArrayList<E>(first), new ArrayList<E>());<NEW_LINE>}<NEW_LINE>ArrayList<E> firstArray = new ArrayList<E>(first);<NEW_LINE>firstArray.removeAll(second);<NEW_LINE>ArrayList<E> secondArray = new ArrayList<E>(second);<NEW_LINE>secondArray.removeAll(first);<NEW_LINE>return new DiffResult<List<E>>(firstArray, secondArray);<NEW_LINE>} | new ArrayList<E>()); |
1,035,362 | public Request<UpdateCloudFrontOriginAccessIdentityRequest> marshall(UpdateCloudFrontOriginAccessIdentityRequest updateCloudFrontOriginAccessIdentityRequest) {<NEW_LINE>if (updateCloudFrontOriginAccessIdentityRequest == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>Request<UpdateCloudFrontOriginAccessIdentityRequest> request = new DefaultRequest<UpdateCloudFrontOriginAccessIdentityRequest>(updateCloudFrontOriginAccessIdentityRequest, "AmazonCloudFront");<NEW_LINE>request.setHttpMethod(HttpMethodName.PUT);<NEW_LINE>if (updateCloudFrontOriginAccessIdentityRequest.getIfMatch() != null) {<NEW_LINE>request.addHeader("If-Match", StringUtils.fromString(updateCloudFrontOriginAccessIdentityRequest.getIfMatch()));<NEW_LINE>}<NEW_LINE>String uriResourcePath = "/2020-05-31/origin-access-identity/cloudfront/{Id}/config";<NEW_LINE>uriResourcePath = com.amazonaws.transform.PathMarshallers.NON_GREEDY.marshall(uriResourcePath, "Id", updateCloudFrontOriginAccessIdentityRequest.getId());<NEW_LINE>request.setResourcePath(uriResourcePath);<NEW_LINE>try {<NEW_LINE>StringWriter stringWriter = new StringWriter();<NEW_LINE>XMLWriter xmlWriter = new XMLWriter(stringWriter, "http://cloudfront.amazonaws.com/doc/2020-05-31/");<NEW_LINE>CloudFrontOriginAccessIdentityConfig cloudFrontOriginAccessIdentityConfig = updateCloudFrontOriginAccessIdentityRequest.getCloudFrontOriginAccessIdentityConfig();<NEW_LINE>if (cloudFrontOriginAccessIdentityConfig != null) {<NEW_LINE>xmlWriter.startElement("CloudFrontOriginAccessIdentityConfig");<NEW_LINE>if (cloudFrontOriginAccessIdentityConfig.getCallerReference() != null) {<NEW_LINE>xmlWriter.startElement("CallerReference").value(cloudFrontOriginAccessIdentityConfig.getCallerReference()).endElement();<NEW_LINE>}<NEW_LINE>if (cloudFrontOriginAccessIdentityConfig.getComment() != null) {<NEW_LINE>xmlWriter.startElement("Comment").value(cloudFrontOriginAccessIdentityConfig.getComment()).endElement();<NEW_LINE>}<NEW_LINE>xmlWriter.endElement();<NEW_LINE>}<NEW_LINE>request.setContent(new StringInputStream(stringWriter.getBuffer().toString()));<NEW_LINE>request.addHeader("Content-Length", Integer.toString(stringWriter.getBuffer().toString().getBytes(UTF8).length));<NEW_LINE>if (!request.getHeaders().containsKey("Content-Type")) {<NEW_LINE>request.addHeader("Content-Type", "application/xml");<NEW_LINE>}<NEW_LINE>} catch (Throwable t) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to XML: " + <MASK><NEW_LINE>}<NEW_LINE>return request;<NEW_LINE>} | t.getMessage(), t); |
9,085 | protected void consumeUnaryExpression(int op, boolean post) {<NEW_LINE>// PreIncrementExpression ::= '++' PushPosition UnaryExpression<NEW_LINE>// PreDecrementExpression ::= '--' PushPosition UnaryExpression<NEW_LINE>// ++ and -- operators<NEW_LINE>// optimize the push/pop<NEW_LINE>// this.intStack has the position of the operator when prefix<NEW_LINE>Expression leftHandSide = this.expressionStack[this.expressionPtr];<NEW_LINE>if (leftHandSide instanceof Reference) {<NEW_LINE>// ++foo()++ is unvalid<NEW_LINE>if (post) {<NEW_LINE>this.expressionStack[this.expressionPtr] = new PostfixExpression(leftHandSide, IntLiteral.One, op, this.endStatementPosition);<NEW_LINE>} else {<NEW_LINE>this.expressionStack[this.expressionPtr] = new PrefixExpression(leftHandSide, IntLiteral.One, op, this.intStack[this.intPtr--]);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>// the ++ or the -- is NOT taken into account if code gen proceeds<NEW_LINE>if (!post) {<NEW_LINE>this.intPtr--;<NEW_LINE>}<NEW_LINE>if (!this.statementRecoveryActivated)<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>} | problemReporter().invalidUnaryExpression(leftHandSide); |
1,177,720 | public static void main(String[] args) {<NEW_LINE>final String USAGE = "\n" + "CreateBucket - create an S3 bucket\n\n" + "Usage: CreateBucket <bucketname>\n\n" + "Where:\n" + " bucketname - the name of the bucket to create.\n\n" + "The bucket name must be unique, or an error will result.\n";<NEW_LINE>if (args.length < 1) {<NEW_LINE><MASK><NEW_LINE>System.exit(1);<NEW_LINE>}<NEW_LINE>String bucket_name = args[0];<NEW_LINE>System.out.format("\nCreating S3 bucket: %s\n", bucket_name);<NEW_LINE>Bucket b = createBucket(bucket_name);<NEW_LINE>if (b == null) {<NEW_LINE>System.out.println("Error creating bucket!\n");<NEW_LINE>} else {<NEW_LINE>System.out.println("Done!\n");<NEW_LINE>}<NEW_LINE>} | System.out.println(USAGE); |
771,732 | final DescribeAppResult executeDescribeApp(DescribeAppRequest describeAppRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(describeAppRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DescribeAppRequest> request = null;<NEW_LINE>Response<DescribeAppResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DescribeAppRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(describeAppRequest));<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, "SageMaker");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DescribeApp");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DescribeAppResult>> 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 DescribeAppResultJsonUnmarshaller()); |
221,292 | final GetSecurityConfigurationResult executeGetSecurityConfiguration(GetSecurityConfigurationRequest getSecurityConfigurationRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(getSecurityConfigurationRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<GetSecurityConfigurationRequest> request = null;<NEW_LINE>Response<GetSecurityConfigurationResult> response = null;<NEW_LINE>try {<NEW_LINE><MASK><NEW_LINE>try {<NEW_LINE>request = new GetSecurityConfigurationRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(getSecurityConfigurationRequest));<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, "Glue");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "GetSecurityConfiguration");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<GetSecurityConfigurationResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new GetSecurityConfigurationResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | awsRequestMetrics.startEvent(Field.RequestMarshallTime); |
1,193,083 | public static SegmentNameGenerator createSegmentNameGenerator(TableConfig tableConfig, Schema schema, @Nullable String prefix, @Nullable String postfix, @Nullable String fixedSegmentName, boolean excludeSequenceId) {<NEW_LINE>String segmentNameGeneratorType = tableConfig.getIndexingConfig().getSegmentNameGeneratorType();<NEW_LINE>if (segmentNameGeneratorType == null || segmentNameGeneratorType.isEmpty()) {<NEW_LINE>segmentNameGeneratorType = SIMPLE_SEGMENT_NAME_GENERATOR;<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>switch(segmentNameGeneratorType.toLowerCase()) {<NEW_LINE>case FIXED_SEGMENT_NAME_GENERATOR:<NEW_LINE>return new FixedSegmentNameGenerator(fixedSegmentName);<NEW_LINE>case SIMPLE_SEGMENT_NAME_GENERATOR:<NEW_LINE>if (prefix != null) {<NEW_LINE>return new SimpleSegmentNameGenerator(prefix, postfix);<NEW_LINE>}<NEW_LINE>return new SimpleSegmentNameGenerator(tableName, postfix);<NEW_LINE>case NORMALIZED_DATE_SEGMENT_NAME_GENERATOR:<NEW_LINE>SegmentsValidationAndRetentionConfig validationConfig = tableConfig.getValidationConfig();<NEW_LINE>DateTimeFormatSpec dateTimeFormatSpec = null;<NEW_LINE>String timeColumnName = validationConfig.getTimeColumnName();<NEW_LINE>if (timeColumnName != null) {<NEW_LINE>DateTimeFieldSpec dateTimeFieldSpec = schema.getSpecForTimeColumn(timeColumnName);<NEW_LINE>Preconditions.checkNotNull(dateTimeFieldSpec, "Schema does not contain the time column specified in the table config.");<NEW_LINE>dateTimeFormatSpec = new DateTimeFormatSpec(dateTimeFieldSpec.getFormat());<NEW_LINE>}<NEW_LINE>return new NormalizedDateSegmentNameGenerator(tableName, prefix, excludeSequenceId, IngestionConfigUtils.getBatchSegmentIngestionType(tableConfig), IngestionConfigUtils.getBatchSegmentIngestionFrequency(tableConfig), dateTimeFormatSpec, postfix);<NEW_LINE>default:<NEW_LINE>throw new UnsupportedOperationException("Unsupported segment name generator type: " + segmentNameGeneratorType);<NEW_LINE>}<NEW_LINE>} | String tableName = tableConfig.getTableName(); |
774,908 | public List<JobEntity> queryJobList(String userName, String column, String order, int pageNo, int pageSize) throws Exception {<NEW_LINE>LOG.info("queryJobList owner:{}, column:{}, order:{}, pageNo:{}, pageSize:{}", userName, column, order, pageNo, pageSize);<NEW_LINE>List<JobEntity> list = null;<NEW_LINE>try (SqlSession sqlSession = MyBatisUtil.getSqlSession()) {<NEW_LINE>JobMapper projectMapper = sqlSession.getMapper(JobMapper.class);<NEW_LINE>Map<String, Object> where = new HashMap<>();<NEW_LINE>where.put("userName", userName);<NEW_LINE>where.put("column", column);<NEW_LINE>where.put("order", order);<NEW_LINE>list = projectMapper.selectAll(where, <MASK><NEW_LINE>} catch (Exception e) {<NEW_LINE>LOG.error(e.getMessage(), e);<NEW_LINE>throw new Exception(e);<NEW_LINE>}<NEW_LINE>return list;<NEW_LINE>} | new RowBounds(pageNo, pageSize)); |
954,495 | protected Map<String, Object> createEventData(EventMessage message, DeviceMetadata metadata) {<NEW_LINE>Object value = message.getData();<NEW_LINE>DataType dataType = metadata.getEvent(message.getEvent()).map(EventMetadata::getType).orElseGet(UnknownType::new);<NEW_LINE>Object tempValue = ValueTypeTranslator.translator(value, dataType);<NEW_LINE>Map<String, Object> data;<NEW_LINE>if (tempValue instanceof Map) {<NEW_LINE>@SuppressWarnings("all")<NEW_LINE>Map<String, Object> mapValue = ((Map) tempValue);<NEW_LINE>int size = mapValue.size();<NEW_LINE>data = newMap(size);<NEW_LINE>data.putAll(mapValue);<NEW_LINE>} else {<NEW_LINE>data = newMap(16);<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>data.put("id", createDataId(message));<NEW_LINE>data.put("deviceId", message.getDeviceId());<NEW_LINE>data.put("createTime", System.currentTimeMillis());<NEW_LINE>return data;<NEW_LINE>} | data.put("value", tempValue); |
344,753 | private Tabpanel createTrace() {<NEW_LINE>Tabpanel tabPanel = new Tabpanel();<NEW_LINE>Vbox vbox = new Vbox();<NEW_LINE>vbox.setParent(tabPanel);<NEW_LINE>vbox.setWidth("100%");<NEW_LINE>vbox.setHeight("100%");<NEW_LINE>Hbox hbox = new Hbox();<NEW_LINE>bErrorsOnly = new Checkbox();<NEW_LINE>bErrorsOnly.setLabel(Msg.getMsg(Env.getCtx(), "ErrorsOnly"));<NEW_LINE>// default only show error<NEW_LINE>bErrorsOnly.setChecked(true);<NEW_LINE>bErrorsOnly.addEventListener(Events.ON_CHECK, this);<NEW_LINE>hbox.appendChild(bErrorsOnly);<NEW_LINE>btnDownload = new Button(Msg.getMsg(Env.getCtx(), "SaveFile"));<NEW_LINE>btnDownload.addEventListener(Events.ON_CLICK, this);<NEW_LINE>hbox.appendChild(btnDownload);<NEW_LINE>btnErrorEmail = new Button(Msg.getMsg(Env.getCtx(), "SendEMail"));<NEW_LINE>btnErrorEmail.addEventListener(Events.ON_CLICK, this);<NEW_LINE>hbox.appendChild(btnErrorEmail);<NEW_LINE>vbox.appendChild(hbox);<NEW_LINE>Vector<String> columnNames = CLogErrorBuffer.get(true).<MASK><NEW_LINE>logTable = new Listbox();<NEW_LINE>ListHead listHead = new ListHead();<NEW_LINE>listHead.setParent(logTable);<NEW_LINE>listHead.setSizable(true);<NEW_LINE>for (Object obj : columnNames) {<NEW_LINE>ListHeader header = new ListHeader(obj.toString());<NEW_LINE>header.setWidth("100px");<NEW_LINE>listHead.appendChild(header);<NEW_LINE>}<NEW_LINE>vbox.appendChild(logTable);<NEW_LINE>logTable.setWidth("480px");<NEW_LINE>logTable.setHeight("310px");<NEW_LINE>logTable.setVflex(false);<NEW_LINE>updateLogTable();<NEW_LINE>return tabPanel;<NEW_LINE>} | getColumnNames(Env.getCtx()); |
110,010 | public void showBackReferences(IdEObject idEObject) {<NEW_LINE>System.out.println("Showing back references to: " + idEObject);<NEW_LINE>for (IdEObject object : getValues()) {<NEW_LINE>for (EReference eReference : object.eClass().getEAllReferences()) {<NEW_LINE>if (eReference.isMany()) {<NEW_LINE>List list = (List) object.eGet(eReference);<NEW_LINE>for (Object o : list) {<NEW_LINE>if (o == idEObject) {<NEW_LINE>System.out.println(object.eClass().getName() + "." + eReference.getName() + " " + object);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>Object o = object.eGet(eReference);<NEW_LINE>if (o == idEObject) {<NEW_LINE>System.out.println(object.eClass().getName() + "." + eReference.<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | getName() + " " + object); |
847,362 | public void processSpecific(SchemaDescriptor schema) {<NEW_LINE>switch(schema.entityType()) {<NEW_LINE>case NODE:<NEW_LINE>for (int labelTokenId : schema.getEntityTokenIds()) {<NEW_LINE>checkValidInternalToken(null, labelTokenId, tokenHolders.labelTokens(), neoStores.getLabelTokenStore(), (record, id) -> {<NEW_LINE>}, (ignore, token) -> reporter.forSchema(record).labelNotInUse(token), storeCursors);<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>case RELATIONSHIP:<NEW_LINE>for (int relationshipTypeTokenId : schema.getEntityTokenIds()) {<NEW_LINE>checkValidInternalToken(null, relationshipTypeTokenId, tokenHolders.relationshipTypeTokens(), neoStores.getRelationshipTypeTokenStore(), (record, id) -> {<NEW_LINE>}, (ignore, token) -> reporter.forSchema(record).relationshipTypeNotInUse(token), storeCursors);<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>throw new IllegalArgumentException(<MASK><NEW_LINE>}<NEW_LINE>checkValidPropertyKeyIds(schema);<NEW_LINE>} | "Schema with given entity type is not supported: " + schema.entityType()); |
1,524,974 | public Function<InitialHandshakeResponse, ProtocolHandshake.Result> errorHandler() {<NEW_LINE>return tuple -> {<NEW_LINE>if (!(tuple.getData().containsKey("status"))) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>Object rawStatus = tuple.getData().get("status");<NEW_LINE>if (!(rawStatus instanceof Number)) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>if (((Number) rawStatus).intValue() == 0) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>if (!(tuple.getData().containsKey("value"))) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>Object value = tuple.getData().get("value");<NEW_LINE>if (!(value instanceof Map)) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>response.setStatus(((Number) rawStatus).intValue());<NEW_LINE>response.setValue(value);<NEW_LINE>new ErrorHandler().throwIfResponseFailed(response, tuple.getRequestDuration().toMillis());<NEW_LINE>// We never get this far.<NEW_LINE>return null;<NEW_LINE>};<NEW_LINE>} | Response response = new Response(null); |
1,819,776 | /*<NEW_LINE>* The conditional operator has three operand expressions. ? appears between the first and second expressions, and<NEW_LINE>* : appears between the second and third expressions.<NEW_LINE>* There are three kinds of conditional expressions, classified according to the second and third operand<NEW_LINE>* expressions: boolean conditional expressions, numeric conditional expressions, and reference conditional<NEW_LINE>* expressions.<NEW_LINE>* The classification rules are as follows:<NEW_LINE>* 1/ If both the second and the third operand expressions are boolean expressions, the conditional expression is a<NEW_LINE>* boolean conditional expression.<NEW_LINE>* 2/ If both the second and the third operand expressions are numeric expressions, the conditional expression is a<NEW_LINE>* numeric conditional expression.<NEW_LINE>* 3/ Otherwise, the conditional expression is a reference conditional expression<NEW_LINE>*/<NEW_LINE>@Override<NEW_LINE>public ResolvedType visit(ConditionalExpr node, Boolean solveLambdas) {<NEW_LINE>ResolvedType thenExpr = node.getThenExpr().accept(this, solveLambdas);<NEW_LINE>ResolvedType elseExpr = node.getElseExpr().accept(this, solveLambdas);<NEW_LINE>ConditionalExprHandler rce = <MASK><NEW_LINE>try {<NEW_LINE>return rce.resolveType();<NEW_LINE>} catch (UnsupportedOperationException e) {<NEW_LINE>// There is nothing to do because, for the moment, we want to run actual implementation<NEW_LINE>}<NEW_LINE>return node.getThenExpr().accept(this, solveLambdas);<NEW_LINE>} | ConditionalExprResolver.getConditionExprHandler(thenExpr, elseExpr); |
192,267 | public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {<NEW_LINE>contentView = View.inflate(getContext(), R.layout.bottom_sheet_contact_attachment_item, null);<NEW_LINE>itemsLayout = contentView.<MASK><NEW_LINE>if (savedInstanceState != null) {<NEW_LINE>chatId = savedInstanceState.getLong(CHAT_ID, INVALID_HANDLE);<NEW_LINE>messageId = savedInstanceState.getLong(MESSAGE_ID, INVALID_HANDLE);<NEW_LINE>email = savedInstanceState.getString(EMAIL);<NEW_LINE>MegaChatMessage messageMega = megaChatApi.getMessage(chatId, messageId);<NEW_LINE>if (messageMega != null) {<NEW_LINE>message = new AndroidMegaChatMessage(messageMega);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>chatId = ((ContactAttachmentActivity) requireActivity()).chatId;<NEW_LINE>messageId = ((ContactAttachmentActivity) requireActivity()).messageId;<NEW_LINE>email = ((ContactAttachmentActivity) requireActivity()).selectedEmail;<NEW_LINE>}<NEW_LINE>MegaChatMessage messageMega = megaChatApi.getMessage(chatId, messageId);<NEW_LINE>if (messageMega != null) {<NEW_LINE>message = new AndroidMegaChatMessage(messageMega);<NEW_LINE>}<NEW_LINE>logDebug("Chat ID: " + chatId + ", Message ID: " + messageId);<NEW_LINE>chatC = new ChatController(requireActivity());<NEW_LINE>return contentView;<NEW_LINE>} | findViewById(R.id.items_layout); |
327,698 | public void syncJsonToLocal(boolean isWriteToLocal) throws Exception {<NEW_LINE>XmlProcessBase xmlProcess = new XmlProcessBase();<NEW_LINE>xmlProcess.addParseClass(Shardings.class);<NEW_LINE><MASK><NEW_LINE>xmlProcess.addParseClass(Users.class);<NEW_LINE>// init xml<NEW_LINE>xmlProcess.initJaxbClass();<NEW_LINE>// sharding<NEW_LINE>if ((this.shardingConfig) != null) {<NEW_LINE>ClusterLogic.forConfig().syncShardingXmlToLocal(this.shardingConfig, xmlProcess, JsonFactory.getJson(), isWriteToLocal);<NEW_LINE>}<NEW_LINE>// db<NEW_LINE>ClusterLogic.forConfig().syncDbXmlToLocal(xmlProcess, this.dbConfig, isWriteToLocal);<NEW_LINE>// user<NEW_LINE>ClusterLogic.forConfig().syncUserXmlToLocal(this.userConfig, xmlProcess, JsonFactory.getJson(), isWriteToLocal);<NEW_LINE>// sequence<NEW_LINE>ClusterLogic.forConfig().syncSequenceToLocal(this.sequenceConfig, isWriteToLocal);<NEW_LINE>} | xmlProcess.addParseClass(DbGroups.class); |
1,004,379 | private void addActionsRow(HintHint hintHint, LightweightHint hint, Editor editor, List<? super AnAction> actions, JComponent grid, boolean newLayout, boolean highlightActions) {<NEW_LINE>if (tooltipAction == null || !hintHint.isAwtTooltip())<NEW_LINE>return;<NEW_LINE>JPanel buttons = new JPanel(new GridBagLayout());<NEW_LINE>JPanel wrapper = createActionPanelWithBackground(highlightActions);<NEW_LINE>wrapper.add(buttons, BorderLayout.WEST);<NEW_LINE>buttons.setBorder(JBUI.Borders.empty());<NEW_LINE>buttons.setOpaque(false);<NEW_LINE>Consumer<InputEvent> runFixAction = event -> {<NEW_LINE>hint.hide();<NEW_LINE>tooltipAction.execute(editor, event);<NEW_LINE>};<NEW_LINE>String shortcutRunActionText = KeymapUtil.getShortcutsText(runActionCustomShortcutSet.getShortcuts());<NEW_LINE>String shortcutShowAllActionsText = getKeymap(IdeActions.ACTION_SHOW_INTENTION_ACTIONS);<NEW_LINE>GridBag gridBag = new GridBag().fillCellHorizontally().anchor(GridBagConstraints.WEST);<NEW_LINE>int topInset = 5;<NEW_LINE>int bottomInset = newLayout ? (highlightActions ? 4 : 10) : 5;<NEW_LINE>buttons.add(createActionLabel(tooltipAction.getText(), runFixAction, hintHint.getTextBackground()), gridBag.next().insets(topInset, newLayout ? 10 : 8, bottomInset, 4));<NEW_LINE>buttons.add(createKeymapHint(shortcutRunActionText), gridBag.next().insets(newLayout ? topInset : 0, 4, newLayout ? bottomInset : 0, 12));<NEW_LINE>Consumer<InputEvent> showAllFixes = inputEvent -> {<NEW_LINE>hint.hide();<NEW_LINE>tooltipAction.showAllActions(editor);<NEW_LINE>};<NEW_LINE>buttons.add(createActionLabel("More actions...", showAllFixes, hintHint.getTextBackground()), gridBag.next().insets(topInset<MASK><NEW_LINE>buttons.add(createKeymapHint(shortcutShowAllActionsText), gridBag.next().fillCellHorizontally().insets(newLayout ? topInset : 0, 4, newLayout ? bottomInset : 0, 20));<NEW_LINE>actions.add(new AnAction() {<NEW_LINE><NEW_LINE>{<NEW_LINE>registerCustomShortcutSet(runActionCustomShortcutSet, editor.getContentComponent());<NEW_LINE>}<NEW_LINE><NEW_LINE>@RequiredUIAccess<NEW_LINE>@Override<NEW_LINE>public void actionPerformed(@Nonnull AnActionEvent e) {<NEW_LINE>runFixAction.accept(e.getInputEvent());<NEW_LINE>}<NEW_LINE>});<NEW_LINE>actions.add(new AnAction() {<NEW_LINE><NEW_LINE>{<NEW_LINE>registerCustomShortcutSet(KeymapUtil.getActiveKeymapShortcuts(IdeActions.ACTION_SHOW_INTENTION_ACTIONS), editor.getContentComponent());<NEW_LINE>}<NEW_LINE><NEW_LINE>@RequiredUIAccess<NEW_LINE>@Override<NEW_LINE>public void actionPerformed(@Nonnull AnActionEvent e) {<NEW_LINE>showAllFixes.accept(e.getInputEvent());<NEW_LINE>}<NEW_LINE>});<NEW_LINE>GridBagConstraints buttonsConstraints = new GridBagConstraints(0, 1, 2, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, JBUI.insetsTop(0), 0, 0);<NEW_LINE>grid.add(wrapper, buttonsConstraints);<NEW_LINE>} | , 12, bottomInset, 4)); |
1,022,441 | public static <T> RecordChangeLog of(@NonNull final T model, @NonNull final Class<T> modelClass, @NonNull final List<RecordChangeLogEntry> entries) {<NEW_LINE>final RecordChangeLogBuilder builder = RecordChangeLog.builder().entries(entries);<NEW_LINE>final Integer createdBy = InterfaceWrapperHelper.<MASK><NEW_LINE>builder.createdByUserId(UserId.ofRepoId(createdBy));<NEW_LINE>final Timestamp created = InterfaceWrapperHelper.getValueOrNull(model, InterfaceWrapperHelper.COLUMNNAME_Created);<NEW_LINE>builder.createdTimestamp(TimeUtil.asInstant(created));<NEW_LINE>final Integer updatedBy = InterfaceWrapperHelper.getValueOrNull(model, InterfaceWrapperHelper.COLUMNNAME_UpdatedBy);<NEW_LINE>builder.lastChangedByUserId(UserId.ofRepoId(updatedBy));<NEW_LINE>final Timestamp updated = InterfaceWrapperHelper.getValueOrNull(model, InterfaceWrapperHelper.COLUMNNAME_Updated);<NEW_LINE>builder.createdTimestamp(TimeUtil.asInstant(updated));<NEW_LINE>final String tableName = InterfaceWrapperHelper.getTableName(modelClass);<NEW_LINE>builder.tableName(tableName);<NEW_LINE>final int id = InterfaceWrapperHelper.getId(model);<NEW_LINE>final ComposedRecordId recordId = ComposedRecordId.singleKey(InterfaceWrapperHelper.getKeyColumnName(modelClass), id);<NEW_LINE>builder.recordId(recordId);<NEW_LINE>return builder.build();<NEW_LINE>} | getValueOrNull(model, InterfaceWrapperHelper.COLUMNNAME_Created); |
1,063,172 | public short[] convert(ByteBuffer buffer) {<NEW_LINE>int offset = 0;<NEW_LINE>long dcAccumulator = 0;<NEW_LINE>short sample;<NEW_LINE>short[] samples;<NEW_LINE>byte b1, b2;<NEW_LINE>samples = new short[<MASK><NEW_LINE>for (int x = 0; x < samples.length; x++) {<NEW_LINE>b1 = buffer.get(offset++);<NEW_LINE>b2 = buffer.get(offset++);<NEW_LINE>sample = (short) (((b2 & 0x0F) << 8) | (b1 & 0xFF));<NEW_LINE>samples[x] = sample;<NEW_LINE>dcAccumulator += sample;<NEW_LINE>}<NEW_LINE>// Calculate the average scaled DC offset so that it can be applied in the native buffer's converted samples<NEW_LINE>float averageDcNow = ((float) dcAccumulator / (float) samples.length) - 2048.0f;<NEW_LINE>averageDcNow *= AirspyBufferIterator.SCALE_SIGNED_12_BIT_TO_FLOAT;<NEW_LINE>averageDcNow -= mAverageDc;<NEW_LINE>mAverageDc += (averageDcNow * DC_FILTER_GAIN);<NEW_LINE>return samples;<NEW_LINE>} | buffer.capacity() / 2]; |
1,212,775 | public String updateWhitelistedSite(@PathVariable("id") Long id, @RequestBody String jsonString, ModelMap m, Principal p) {<NEW_LINE>JsonObject json;<NEW_LINE>WhitelistedSite whitelist = null;<NEW_LINE>try {<NEW_LINE>json = parser.parse(jsonString).getAsJsonObject();<NEW_LINE>whitelist = gson.fromJson(json, WhitelistedSite.class);<NEW_LINE>} catch (JsonParseException e) {<NEW_LINE>logger.error("updateWhitelistedSite failed due to JsonParseException", e);<NEW_LINE>m.put(HttpCodeView.CODE, HttpStatus.BAD_REQUEST);<NEW_LINE>m.put(JsonErrorView.ERROR_MESSAGE, "Could not update whitelisted site. The server encountered a JSON syntax exception. Contact a system administrator for assistance.");<NEW_LINE>return JsonErrorView.VIEWNAME;<NEW_LINE>} catch (IllegalStateException e) {<NEW_LINE>logger.error("updateWhitelistedSite failed due to IllegalStateException", e);<NEW_LINE>m.put(<MASK><NEW_LINE>m.put(JsonErrorView.ERROR_MESSAGE, "Could not update whitelisted site. The server encountered an IllegalStateException. Refresh and try again - if the problem persists, contact a system administrator for assistance.");<NEW_LINE>return JsonErrorView.VIEWNAME;<NEW_LINE>}<NEW_LINE>WhitelistedSite oldWhitelist = whitelistService.getById(id);<NEW_LINE>if (oldWhitelist == null) {<NEW_LINE>logger.error("updateWhitelistedSite failed; whitelist with id " + id + " could not be found.");<NEW_LINE>m.put(HttpCodeView.CODE, HttpStatus.NOT_FOUND);<NEW_LINE>m.put(JsonErrorView.ERROR_MESSAGE, "Could not update whitelisted site. The requested whitelisted site with id " + id + "could not be found.");<NEW_LINE>return JsonErrorView.VIEWNAME;<NEW_LINE>} else {<NEW_LINE>WhitelistedSite newWhitelist = whitelistService.update(oldWhitelist, whitelist);<NEW_LINE>m.put(JsonEntityView.ENTITY, newWhitelist);<NEW_LINE>return JsonEntityView.VIEWNAME;<NEW_LINE>}<NEW_LINE>} | HttpCodeView.CODE, HttpStatus.BAD_REQUEST); |
938,146 | public boolean analyze(Program program, AddressSetView set, TaskMonitor monitor, final MessageLog log) throws Exception {<NEW_LINE>DisassemblerMessageListener listener = new DisassemblerMessageListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void disassembleMessageReported(String msg) {<NEW_LINE>log.appendMsg(msg);<NEW_LINE>}<NEW_LINE>};<NEW_LINE>Address imageBase = program.getImageBase();<NEW_LINE>AutoAnalysisManager manager = AutoAnalysisManager.getAnalysisManager(program);<NEW_LINE>Disassembler disassembler = Disassembler.getDisassembler(program, monitor, listener);<NEW_LINE>disassembler.disassemble(imageBase.add(0x00000000L), null, false);<NEW_LINE>manager.disassemble(imageBase.add(0x00000000L));<NEW_LINE>disassembler.disassemble(imageBase.add(0x00000004L), null, false);<NEW_LINE>disassembler.disassemble(imageBase.add(0x00000008L), null, false);<NEW_LINE>disassembler.disassemble(imageBase.add(0x0000000cL), null, false);<NEW_LINE>disassembler.disassemble(imageBase.add(0x00000010L), null, false);<NEW_LINE>disassembler.disassemble(imageBase.add(0x00000014L), null, false);<NEW_LINE>disassembler.disassemble(imageBase.add(0x00000018L), null, false);<NEW_LINE>disassembler.disassemble(imageBase.add(0x0000001cL), null, false);<NEW_LINE>disassembler.disassemble(imageBase.add(0x00000020L), new AddressSet(imageBase.add(0x00000020L)), false);<NEW_LINE>disassembler.disassemble(imageBase.add(0x00000040L), null, false);<NEW_LINE>disassembler.disassemble(imageBase.add(0x00000074L), null, false);<NEW_LINE>createData(program, imageBase.add(0x00000200L), new StringDataType());<NEW_LINE>createData(program, imageBase.add(0x00000240L), new StringDataType());<NEW_LINE>createData(program, imageBase.add(0x00000280L), new StringDataType());<NEW_LINE>long offset = 0x0000032cL;<NEW_LINE>while (!monitor.isCancelled()) {<NEW_LINE>if (offset > 0x000005e8) {<NEW_LINE>// end of ARM code...<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>disassembler.disassemble(imageBase.add(offset), null);<NEW_LINE>Function function = createFunction(program<MASK><NEW_LINE>if (function == null) {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>offset = function.getBody().getMaxAddress().getOffset() + 1 - imageBase.getOffset();<NEW_LINE>}<NEW_LINE>log.appendMsg("You should now run the iOS_ThumbFunctionFinder script!");<NEW_LINE>return true;<NEW_LINE>} | , imageBase.add(offset)); |
557,287 | private FileObject generateMavenTester(File testdir, String baseURL) throws IOException {<NEW_LINE>String[] replaceKeys1 = { "TTL_TEST_RESBEANS", "MSG_TEST_RESBEANS_INFO" };<NEW_LINE>String[] replaceKeys2 = { "MSG_TEST_RESBEANS_wadlErr", "MSG_TEST_RESBEANS_No_AJAX", "MSG_TEST_RESBEANS_Resource", "MSG_TEST_RESBEANS_See", "MSG_TEST_RESBEANS_No_Container", "MSG_TEST_RESBEANS_Content", "MSG_TEST_RESBEANS_TabularView", "MSG_TEST_RESBEANS_RawView", "MSG_TEST_RESBEANS_ResponseHeaders", "MSG_TEST_RESBEANS_Help", "MSG_TEST_RESBEANS_TestButton", "MSG_TEST_RESBEANS_Loading", "MSG_TEST_RESBEANS_Status", "MSG_TEST_RESBEANS_Headers", "MSG_TEST_RESBEANS_HeaderName", "MSG_TEST_RESBEANS_HeaderValue", "MSG_TEST_RESBEANS_Insert", "MSG_TEST_RESBEANS_NoContents", "MSG_TEST_RESBEANS_AddParamButton", "MSG_TEST_RESBEANS_Monitor", "MSG_TEST_RESBEANS_No_SubResources", "MSG_TEST_RESBEANS_SubResources", "MSG_TEST_RESBEANS_ChooseMethod", "MSG_TEST_RESBEANS_ChooseMime", "MSG_TEST_RESBEANS_Continue", "MSG_TEST_RESBEANS_AdditionalParams", "MSG_TEST_RESBEANS_INFO", "MSG_TEST_RESBEANS_Request", "MSG_TEST_RESBEANS_Sent", "MSG_TEST_RESBEANS_Received", "MSG_TEST_RESBEANS_TimeStamp", "MSG_TEST_RESBEANS_Response", "MSG_TEST_RESBEANS_CurrentSelection", "MSG_TEST_RESBEANS_DebugWindow", "MSG_TEST_RESBEANS_Wadl", "MSG_TEST_RESBEANS_RequestFailed" };<NEW_LINE>FileObject testFO = copyFileAndReplaceBaseUrl(testdir, TEST_SERVICES_HTML, replaceKeys1, baseURL);<NEW_LINE>MiscUtilities.copyFile(testdir, RestSupport.TEST_RESBEANS_JS, replaceKeys2, false);<NEW_LINE>MiscUtilities.copyFile(testdir, RestSupport.TEST_RESBEANS_CSS);<NEW_LINE>MiscUtilities.copyFile(testdir, RestSupport.TEST_RESBEANS_CSS2);<NEW_LINE>MiscUtilities.copyFile(testdir, "expand.gif");<NEW_LINE>MiscUtilities.copyFile(testdir, "collapse.gif");<NEW_LINE>MiscUtilities.copyFile(testdir, "item.gif");<NEW_LINE>MiscUtilities.copyFile(testdir, "cc.gif");<NEW_LINE>MiscUtilities.copyFile(testdir, "og.gif");<NEW_LINE>MiscUtilities.copyFile(testdir, "cg.gif");<NEW_LINE>MiscUtilities.copyFile(testdir, "app.gif");<NEW_LINE>File testdir2 = new File(testdir, "images");<NEW_LINE>testdir2.mkdir();<NEW_LINE><MASK><NEW_LINE>MiscUtilities.copyFile(testdir, "images/pbsel.png");<NEW_LINE>MiscUtilities.copyFile(testdir, "images/bg_gradient.gif");<NEW_LINE>MiscUtilities.copyFile(testdir, "images/pname.png");<NEW_LINE>MiscUtilities.copyFile(testdir, "images/level1_selected-1lvl.jpg");<NEW_LINE>MiscUtilities.copyFile(testdir, "images/primary-enabled.gif");<NEW_LINE>MiscUtilities.copyFile(testdir, "images/masthead.png");<NEW_LINE>MiscUtilities.copyFile(testdir, "images/primary-roll.gif");<NEW_LINE>MiscUtilities.copyFile(testdir, "images/pbdis.png");<NEW_LINE>MiscUtilities.copyFile(testdir, "images/secondary-enabled.gif");<NEW_LINE>MiscUtilities.copyFile(testdir, "images/pbena.png");<NEW_LINE>MiscUtilities.copyFile(testdir, "images/tbsel.png");<NEW_LINE>MiscUtilities.copyFile(testdir, "images/pbmou.png");<NEW_LINE>MiscUtilities.copyFile(testdir, "images/tbuns.png");<NEW_LINE>return testFO;<NEW_LINE>} | MiscUtilities.copyFile(testdir, "images/background_border_bottom.gif"); |
1,407,100 | public Engine.DeleteResult deleteRow(final IndexShard indexShard, final String type, final String id, final ConsistencyLevel cl) throws IOException {<NEW_LINE>try {<NEW_LINE>String ksName = indexShard<MASK><NEW_LINE>String cfName = SchemaManager.typeToCfName(indexShard.mapperService().keyspace(), type);<NEW_LINE>DocumentMapper docMapper = indexShard.mapperService().documentMapper(type);<NEW_LINE>this.clusterService.process(cl, buildDeleteQuery(docMapper, ksName, cfName), parseElasticId(ksName, type, id).values);<NEW_LINE>return new Engine.DeleteResult(1L, SequenceNumbers.UNASSIGNED_PRIMARY_TERM, SequenceNumbers.UNASSIGNED_SEQ_NO, true);<NEW_LINE>} catch (RequestExecutionException | RequestValidationException e) {<NEW_LINE>return new Engine.DeleteResult(e, 1L, SequenceNumbers.UNASSIGNED_PRIMARY_TERM, SequenceNumbers.UNASSIGNED_SEQ_NO, false);<NEW_LINE>}<NEW_LINE>} | .mapperService().keyspace(); |
45,811 | public TimeSeriesDatabaseConnection deleteByIdWithResponse(String id, Context context) {<NEW_LINE>String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups");<NEW_LINE>if (resourceGroupName == null) {<NEW_LINE>throw logger.logExceptionAsError(new IllegalArgumentException(String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id)));<NEW_LINE>}<NEW_LINE>String resourceName = Utils.getValueFromIdByName(id, "digitalTwinsInstances");<NEW_LINE>if (resourceName == null) {<NEW_LINE>throw logger.logExceptionAsError(new IllegalArgumentException(String.format("The resource ID '%s' is not valid. Missing path segment 'digitalTwinsInstances'.", id)));<NEW_LINE>}<NEW_LINE>String timeSeriesDatabaseConnectionName = Utils.getValueFromIdByName(id, "timeSeriesDatabaseConnections");<NEW_LINE>if (timeSeriesDatabaseConnectionName == null) {<NEW_LINE>throw logger.logExceptionAsError(new IllegalArgumentException(String.format(<MASK><NEW_LINE>}<NEW_LINE>return this.delete(resourceGroupName, resourceName, timeSeriesDatabaseConnectionName, context);<NEW_LINE>} | "The resource ID '%s' is not valid. Missing path segment" + " 'timeSeriesDatabaseConnections'.", id))); |
1,103,530 | public void write(Annotation annotation) {<NEW_LINE>// name hash<NEW_LINE>buf.putInt(annotation.getType().getId());<NEW_LINE>byte features = 0;<NEW_LINE>if (annotation.isSpanNodeValid()) {<NEW_LINE>features |= ((byte) 1);<NEW_LINE>}<NEW_LINE>if (annotation.hasFieldValue()) {<NEW_LINE>features |= ((byte) 2);<NEW_LINE>}<NEW_LINE>buf.put(features);<NEW_LINE>int posBeforeSize = buf.position();<NEW_LINE>buf.putInt1_2_4BytesAs4(0);<NEW_LINE>// write ID of span node:<NEW_LINE>if (annotation.isSpanNodeValid()) {<NEW_LINE>int spanNodeId = annotation.getSpanNode().getScratchId();<NEW_LINE>if (spanNodeId >= 0) {<NEW_LINE>buf.putInt1_2_4Bytes(spanNodeId);<NEW_LINE>} else {<NEW_LINE>throw new <MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>// write annotation value:<NEW_LINE>if (annotation.hasFieldValue()) {<NEW_LINE>buf.putInt(annotation.getType().getDataType().getId());<NEW_LINE>annotation.getFieldValue().serialize(this);<NEW_LINE>}<NEW_LINE>int end = buf.position();<NEW_LINE>buf.position(posBeforeSize);<NEW_LINE>buf.putInt1_2_4BytesAs4(end - posBeforeSize - 4);<NEW_LINE>buf.position(end);<NEW_LINE>} | SerializationException("Could not serialize annotation, associated SpanNode not found (" + annotation + ")"); |
215,806 | protected Bundle doInBackground(Bundle... params) {<NEW_LINE>Bundle args = params[0];<NEW_LINE>Bundle result = new Bundle(args);<NEW_LINE>String <MASK><NEW_LINE>String comment = args.getString("message");<NEW_LINE>try {<NEW_LINE>Map<String, String> requestParams = new HashMap<String, String>();<NEW_LINE>requestParams.put("linkUrl", link);<NEW_LINE>if (comment != null) {<NEW_LINE>requestParams.put("comment", comment);<NEW_LINE>}<NEW_LINE>String response = mOdnoklassniki.request("share.addLink", requestParams, "get");<NEW_LINE>JSONObject jsonObject = new JSONObject(response);<NEW_LINE>if (jsonObject.has("error_code")) {<NEW_LINE>result.putString(RESULT_ERROR, jsonObject.toString());<NEW_LINE>result.putString(ERROR_CODE, jsonObject.getString("error_code"));<NEW_LINE>return result;<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>result.putString(RESULT_ERROR, e.getMessage());<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>} | link = args.getString("link"); |
1,305,353 | final UpdateJobQueueResult executeUpdateJobQueue(UpdateJobQueueRequest updateJobQueueRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(updateJobQueueRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<UpdateJobQueueRequest> request = null;<NEW_LINE>Response<UpdateJobQueueResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new UpdateJobQueueRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(updateJobQueueRequest));<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, "Batch");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "UpdateJobQueue");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<UpdateJobQueueResult>> 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 UpdateJobQueueResultJsonUnmarshaller()); |
1,090,415 | private String expandRedirectUri(HttpServletRequest request, ClientRegistration clientRegistration, String action) {<NEW_LINE>Map<String, String> <MASK><NEW_LINE>uriVariables.put("registrationId", clientRegistration.getRegistrationId());<NEW_LINE>UriComponents uriComponents = UriComponentsBuilder.fromHttpUrl(UrlUtils.buildFullRequestUrl(request)).replacePath(request.getContextPath()).replaceQuery(null).fragment(null).build();<NEW_LINE>String scheme = uriComponents.getScheme();<NEW_LINE>uriVariables.put("baseScheme", scheme == null ? "" : scheme);<NEW_LINE>String host = uriComponents.getHost();<NEW_LINE>uriVariables.put("baseHost", host == null ? "" : host);<NEW_LINE>// following logic is based on HierarchicalUriComponents#toUriString()<NEW_LINE>int port = uriComponents.getPort();<NEW_LINE>uriVariables.put("basePort", port == -1 ? "" : ":" + port);<NEW_LINE>String path = uriComponents.getPath();<NEW_LINE>if (StringUtils.hasLength(path)) {<NEW_LINE>if (path.charAt(0) != PATH_DELIMITER) {<NEW_LINE>path = PATH_DELIMITER + path;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>uriVariables.put("basePath", path == null ? "" : path);<NEW_LINE>uriVariables.put("baseUrl", uriComponents.toUriString());<NEW_LINE>uriVariables.put("action", action == null ? "" : action);<NEW_LINE>String redirectUri = getRedirectUri(request);<NEW_LINE>log.trace("Redirect URI - {}.", redirectUri);<NEW_LINE>return UriComponentsBuilder.fromUriString(redirectUri).buildAndExpand(uriVariables).toUriString();<NEW_LINE>} | uriVariables = new HashMap<>(); |
828,575 | public void onClick(View v) {<NEW_LINE>controller.clearSelectedText();<NEW_LINE><MASK><NEW_LINE>String trim = editText.getText().toString().trim();<NEW_LINE>if (Build.VERSION.SDK_INT < Build.VERSION_CODES.HONEYCOMB) {<NEW_LINE>ClipboardManager clipboard = (ClipboardManager) c.getSystemService(Context.CLIPBOARD_SERVICE);<NEW_LINE>clipboard.setText(trim);<NEW_LINE>} else {<NEW_LINE>android.content.ClipboardManager clipboard = (android.content.ClipboardManager) c.getSystemService(Context.CLIPBOARD_SERVICE);<NEW_LINE>ClipData clip = ClipData.newPlainText(c.getString(R.string.copied_text), trim);<NEW_LINE>clipboard.setPrimaryClip(clip);<NEW_LINE>}<NEW_LINE>Toast.makeText(c, c.getString(R.string.copied_text) + ": " + trim, Toast.LENGTH_SHORT).show();<NEW_LINE>closeDialog();<NEW_LINE>} | Context c = anchor.getContext(); |
1,545,322 | /*<NEW_LINE>* this routine deals with -er, -or, -ier, and -eer. The -izer ending is<NEW_LINE>* always converted to -ize<NEW_LINE>*/<NEW_LINE>private void erAndOrEndings() {<NEW_LINE>int old_k = k;<NEW_LINE>// YCS<NEW_LINE>if (word.charAt(k) != 'r')<NEW_LINE>return;<NEW_LINE>char word_char;<NEW_LINE>word.setLength(j + 4);<NEW_LINE>k = j + 3;<NEW_LINE>lookup();<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (endsIn('e', 'r') || endsIn('o', 'r')) {<NEW_LINE>word_char = word.charAt(j + 1);<NEW_LINE>if (doubleC(j)) {<NEW_LINE>word.setLength(j);<NEW_LINE>k = j - 1;<NEW_LINE>if (lookup())<NEW_LINE>return;<NEW_LINE>word.unsafeWrite(word.charAt(j - 1));<NEW_LINE>word.setCharAt(j, 'y');<NEW_LINE><MASK><NEW_LINE>k = j;<NEW_LINE>if (lookup())<NEW_LINE>word.unsafeWrite('e');<NEW_LINE>}<NEW_LINE>if (word.charAt(j) == 'e') {<NEW_LINE>k = j + 1;<NEW_LINE>if (lookup())<NEW_LINE>return;<NEW_LINE>word.setLength(j + 1);<NEW_LINE>k = j + 1;<NEW_LINE>if (lookup())<NEW_LINE>return;<NEW_LINE>word.setLength(j + 1);<NEW_LINE>word.unsafeWrite(word_char);<NEW_LINE>word.unsafeWrite('r'); | word.setLength(j + 1); |
1,424,976 | public static void constraintMatrix3x6(DMatrixRMaj L, DMatrixRMaj y, DogArray<Point3D_F64> controlWorldPts, List<Point3D_F64>[] nullPts) {<NEW_LINE>int row = 0;<NEW_LINE>for (int i = 0; i < 3; i++) {<NEW_LINE>Point3D_F64 ci = controlWorldPts.get(i);<NEW_LINE>Point3D_F64 vai = nullPts[0].get(i);<NEW_LINE>Point3D_F64 vbi = nullPts[1].get(i);<NEW_LINE>Point3D_F64 vci = nullPts[2].get(i);<NEW_LINE>for (int j = i + 1; j < 3; j++, row++) {<NEW_LINE>Point3D_F64 cj = controlWorldPts.get(j);<NEW_LINE>Point3D_F64 vaj = nullPts[0].get(j);<NEW_LINE>Point3D_F64 vbj = nullPts[1].get(j);<NEW_LINE>Point3D_F64 vcj = nullPts[2].get(j);<NEW_LINE>y.set(row, 0, ci.distance2(cj));<NEW_LINE>double xa = vai.x - vaj.x;<NEW_LINE>double ya = vai.y - vaj.y;<NEW_LINE>double za = vai.z - vaj.z;<NEW_LINE>double xb = vbi.x - vbj.x;<NEW_LINE>double yb = vbi.y - vbj.y;<NEW_LINE>double zb = vbi.z - vbj.z;<NEW_LINE>double xc = vci.x - vcj.x;<NEW_LINE>double yc = vci.y - vcj.y;<NEW_LINE>double zc = vci.z - vcj.z;<NEW_LINE>double da = xa * xa + ya * ya + za * za;<NEW_LINE>double db = xb * xb + yb * yb + zb * zb;<NEW_LINE>double dc = xc * xc + yc * yc + zc * zc;<NEW_LINE>double dab = xa * xb <MASK><NEW_LINE>double dac = xa * xc + ya * yc + za * zc;<NEW_LINE>double dbc = xb * xc + yb * yc + zb * zc;<NEW_LINE>L.set(row, 0, da);<NEW_LINE>L.set(row, 1, 2 * dab);<NEW_LINE>L.set(row, 2, 2 * dac);<NEW_LINE>L.set(row, 3, db);<NEW_LINE>L.set(row, 4, 2 * dbc);<NEW_LINE>L.set(row, 5, dc);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | + ya * yb + za * zb; |
318,734 | public void build(ScheduleOptions scheduleOptions, HttpOperationResult result, String pipelineName, PipelineScheduleOptions pipelineScheduleOptions, HealthStateType healthStateType) {<NEW_LINE>for (MaterialForScheduling materialForScheduling : pipelineScheduleOptions.getMaterials()) {<NEW_LINE>try {<NEW_LINE>MaterialConfig material = goConfigService.materialForPipelineWithFingerprint(pipelineName, materialForScheduling.getFingerprint());<NEW_LINE>if (StringUtils.isBlank(materialForScheduling.getRevision())) {<NEW_LINE>result.unprocessibleEntity("Request to schedule pipeline rejected", String.format("Material [%s] has empty revision", materialForScheduling.getFingerprint()), HealthStateType.general(HealthStateScope.GLOBAL));<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>scheduleOptions.getSpecifiedRevisions().put(material.getPipelineUniqueFingerprint(<MASK><NEW_LINE>} catch (Exception e) {<NEW_LINE>result.unprocessibleEntity("Request to schedule pipeline rejected", String.format("Pipeline '%s' does not contain the following material(s): [%s].", pipelineName, materialForScheduling.getFingerprint()), healthStateType);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | ), materialForScheduling.getRevision()); |
1,619,140 | public OResultSet executeSimple(OCommandContext ctx) {<NEW_LINE>OInternalResultSet result = new OInternalResultSet();<NEW_LINE>String operation = this.operation.getStringValue();<NEW_LINE>Object key = this.key.execute(new OResultInternal(), ctx);<NEW_LINE>if (key == null) {<NEW_LINE>key = this.key.getDefaultAlias();<NEW_LINE>}<NEW_LINE>Object value = this.value.execute(new OResultInternal(), ctx);<NEW_LINE>if (value == null) {<NEW_LINE>value <MASK><NEW_LINE>if (value.equals("null")) {<NEW_LINE>value = null;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>ODatabaseInternal db = (ODatabaseInternal) ctx.getDatabase();<NEW_LINE>OEnterpriseEndpoint ee = db.getEnterpriseEndpoint();<NEW_LINE>if (ee == null) {<NEW_LINE>throw new OCommandExecutionException("HA SET statements are only supported in OrientDB Enterprise Edition");<NEW_LINE>}<NEW_LINE>if (operation.equalsIgnoreCase("status")) {<NEW_LINE>String finalResult;<NEW_LINE>try {<NEW_LINE>ee.haSetDbStatus((ODatabaseDocument) db, String.valueOf(key), String.valueOf(value));<NEW_LINE>finalResult = "OK";<NEW_LINE>} catch (UnsupportedOperationException e) {<NEW_LINE>finalResult = e.getMessage();<NEW_LINE>}<NEW_LINE>OResultInternal item = new OResultInternal();<NEW_LINE>item.setProperty("operation", "ha set status");<NEW_LINE>item.setProperty("result", finalResult);<NEW_LINE>result.add(item);<NEW_LINE>} else if (operation.equalsIgnoreCase("owner")) {<NEW_LINE>String finalResult;<NEW_LINE>try {<NEW_LINE>ee.haSetOwner((ODatabaseDocument) db, String.valueOf(key), String.valueOf(value));<NEW_LINE>finalResult = "OK";<NEW_LINE>} catch (UnsupportedOperationException e) {<NEW_LINE>finalResult = e.getMessage();<NEW_LINE>}<NEW_LINE>OResultInternal item = new OResultInternal();<NEW_LINE>item.setProperty("operation", "ha set owner");<NEW_LINE>item.setProperty("result", finalResult);<NEW_LINE>result.add(item);<NEW_LINE>} else if (operation.equalsIgnoreCase("role")) {<NEW_LINE>String finalResult;<NEW_LINE>try {<NEW_LINE>ee.haSetRole((ODatabaseDocument) db, String.valueOf(key), String.valueOf(value));<NEW_LINE>finalResult = "OK";<NEW_LINE>} catch (UnsupportedOperationException e) {<NEW_LINE>finalResult = e.getMessage();<NEW_LINE>}<NEW_LINE>OResultInternal item = new OResultInternal();<NEW_LINE>item.setProperty("operation", "ha set role");<NEW_LINE>item.setProperty("result", finalResult);<NEW_LINE>result.add(item);<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>} | = this.value.getDefaultAlias(); |
1,236,882 | final DeleteEmailTemplateResult executeDeleteEmailTemplate(DeleteEmailTemplateRequest deleteEmailTemplateRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(deleteEmailTemplateRequest);<NEW_LINE><MASK><NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DeleteEmailTemplateRequest> request = null;<NEW_LINE>Response<DeleteEmailTemplateResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DeleteEmailTemplateRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(deleteEmailTemplateRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "Pinpoint");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DeleteEmailTemplate");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DeleteEmailTemplateResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DeleteEmailTemplateResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); |
1,787,231 | protected void paintComponent(Graphics g) {<NEW_LINE>if (isPatch()) {<NEW_LINE>paintComponentPatch(g);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>Graphics2D g2 = (Graphics2D) g.create();<NEW_LINE>try {<NEW_LINE>// we should be painting the background behind the painter if we have one<NEW_LINE>// this prevents issues with buffer reuse where visual artifacts sneak in<NEW_LINE>if (isOpaque() || UIManager.getLookAndFeel() instanceof SynthLookAndFeel) {<NEW_LINE>// this will paint the foreground if a JXPanel subclass is<NEW_LINE>// unfortunate enough to have one<NEW_LINE>super.paintComponent(g2);<NEW_LINE>} else if (getAlpha() < 1f) {<NEW_LINE>g.setColor(getBackground());<NEW_LINE>g.fillRect(0, 0, <MASK><NEW_LINE>}<NEW_LINE>if (getBackgroundPainter() != null) {<NEW_LINE>if (isPaintBorderInsets()) {<NEW_LINE>getBackgroundPainter().paint(g2, this, getWidth(), getHeight());<NEW_LINE>} else {<NEW_LINE>Insets insets = getInsets();<NEW_LINE>g.translate(insets.left, insets.top);<NEW_LINE>getBackgroundPainter().paint(g2, this, getWidth() - insets.left - insets.right, getHeight() - insets.top - insets.bottom);<NEW_LINE>g.translate(-insets.left, -insets.top);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// force the foreground to paint again...workaround for folks that<NEW_LINE>// incorrectly extend JXPanel instead of JComponent<NEW_LINE>getUI().paint(g2, this);<NEW_LINE>} finally {<NEW_LINE>g2.dispose();<NEW_LINE>}<NEW_LINE>} | getWidth(), getHeight()); |
901,559 | private void appendReference(StringBuilder sb, ReferenceTree ref, List<? extends DocTree> label, TreePath docPath, DocCommentTree doc, DocTrees trees) {<NEW_LINE>String sig = ref.getSignature();<NEW_LINE>if (sig != null && sig.length() > 0) {<NEW_LINE>if (sig.charAt(0) == '#') {<NEW_LINE>// NOI18N<NEW_LINE>sig = sig.substring(1);<NEW_LINE>}<NEW_LINE>// NOI18N<NEW_LINE>sig = sig.replace('#', '.');<NEW_LINE>}<NEW_LINE>Element element = trees.getElement(DocTreePath.getPath(docPath, doc, ref));<NEW_LINE>if (element != null) {<NEW_LINE>// NOI18N<NEW_LINE>createLink(sb, element, label == null || label.isEmpty() ? sig : inlineTags(label, docPath<MASK><NEW_LINE>} else {<NEW_LINE>sb.append(label == null || label.isEmpty() ? sig : inlineTags(label, docPath, doc, trees, null));<NEW_LINE>}<NEW_LINE>} | , doc, trees, null)); |
912,279 | public void changeRole(Locale locale, Properties ctx) {<NEW_LINE>Env.setCtx(ctx);<NEW_LINE>getDesktop().getSession().setAttribute(Attributes.PREFERRED_LOCALE, locale);<NEW_LINE>Locales.setThreadLocal(locale);<NEW_LINE>new Login(Env.getCtx());<NEW_LINE>MUser user = MUser.get(ctx<MASK><NEW_LINE>boolean loginWithValue = M_Element.get(Env.getCtx(), I_AD_User.COLUMNNAME_IsLoginUser) != null;<NEW_LINE>String loginName = null;<NEW_LINE>if (user.getLDAPUser() != null) {<NEW_LINE>loginName = user.getLDAPUser();<NEW_LINE>} else if (loginWithValue) {<NEW_LINE>loginName = user.getValue();<NEW_LINE>} else {<NEW_LINE>loginName = user.getName();<NEW_LINE>}<NEW_LINE>loginOk(loginName, getTypedPassword());<NEW_LINE>getDesktop().getSession().setAttribute("Check_AD_User_ID", Env.getAD_User_ID(ctx));<NEW_LINE>pnlRole.changeRole(ctx);<NEW_LINE>} | , Env.getAD_User_ID(ctx)); |
300,950 | public void before(Object target, Object[] args) {<NEW_LINE>if (isDebug) {<NEW_LINE>logger.beforeInterceptor(target, args);<NEW_LINE>}<NEW_LINE>if (target == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>Trace trace = traceContext.currentRawTraceObject();<NEW_LINE>if (trace == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final boolean interceptingGetInputStream = isInterceptingGetInputStream();<NEW_LINE>final boolean recordingResponse = isRecordingResponse(trace);<NEW_LINE>if (recordingResponse) {<NEW_LINE>if (interceptingGetInputStream) {<NEW_LINE>return;<NEW_LINE>} else {<NEW_LINE>clearRecordingResponseStatus(trace);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>boolean connected = isConnected(target);<NEW_LINE>boolean connecting = false;<NEW_LINE>if (target instanceof ConnectingGetter) {<NEW_LINE>connecting = ((ConnectingGetter) target)._$PINPOINT$_isConnecting();<NEW_LINE>}<NEW_LINE>boolean addRequestHeader = !connected && !connecting;<NEW_LINE>if (isInterceptingHttps()) {<NEW_LINE>addRequestHeader = addRequestHeader && isInterceptingConnect();<NEW_LINE>}<NEW_LINE>final HttpURLConnection request = (HttpURLConnection) target;<NEW_LINE>final boolean canSample = trace.canSampled();<NEW_LINE>if (canSample) {<NEW_LINE>scope.getCurrentInvocation().setAttachment(TRACE_BLOCK_BEGIN_MARKER);<NEW_LINE>final <MASK><NEW_LINE>recorder.recordServiceType(JdkHttpConstants.SERVICE_TYPE);<NEW_LINE>if (addRequestHeader) {<NEW_LINE>final TraceId nextId = trace.getTraceId().getNextTraceId();<NEW_LINE>recorder.recordNextSpanId(nextId.getSpanId());<NEW_LINE>String host = getHost(request);<NEW_LINE>this.requestTraceWriter.write(request, nextId, host);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>if (addRequestHeader) {<NEW_LINE>this.requestTraceWriter.write(request);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | SpanEventRecorder recorder = trace.traceBlockBegin(); |
266,892 | protected Report reportSumByNameRound(List<TaskStats> taskStats) {<NEW_LINE>// aggregate by task name and round<NEW_LINE>LinkedHashMap<String, TaskStats> p2 = new LinkedHashMap<>();<NEW_LINE>int reported = 0;<NEW_LINE>for (final TaskStats stat1 : taskStats) {<NEW_LINE>if (stat1.getElapsed() >= 0) {<NEW_LINE>// consider only tasks that ended<NEW_LINE>reported++;<NEW_LINE>String name = stat1<MASK><NEW_LINE>// group by round<NEW_LINE>String rname = stat1.getRound() + "." + name;<NEW_LINE>TaskStats stat2 = p2.get(rname);<NEW_LINE>if (stat2 == null) {<NEW_LINE>try {<NEW_LINE>stat2 = stat1.clone();<NEW_LINE>} catch (CloneNotSupportedException e) {<NEW_LINE>throw new RuntimeException(e);<NEW_LINE>}<NEW_LINE>p2.put(rname, stat2);<NEW_LINE>} else {<NEW_LINE>stat2.add(stat1);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// now generate report from secondary list p2<NEW_LINE>return genPartialReport(reported, p2, taskStats.size());<NEW_LINE>} | .getTask().getName(); |
249,265 | public void reduce(final IntWritable key, final Iterator<Text> values, OutputCollector<IntWritable, Text> output, final Reporter reporter) throws IOException {<NEW_LINE>String component_id_str = "";<NEW_LINE>Set<Integer> from_nodes_set = new HashSet<Integer>();<NEW_LINE>boolean self_contained = false;<NEW_LINE>String line = "";<NEW_LINE>while (values.hasNext()) {<NEW_LINE>Text from_cur_node = values.next();<NEW_LINE>line = from_cur_node.toString();<NEW_LINE>if (line.startsWith("m")) {<NEW_LINE>// component info<NEW_LINE>if (component_id_str.length() == 0)<NEW_LINE>component_id_str = line.substring(3);<NEW_LINE>} else {<NEW_LINE>// edge line<NEW_LINE>int from_node_int = Integer.parseInt(line);<NEW_LINE>from_nodes_set.add(from_node_int);<NEW_LINE>if (key.get() == from_node_int)<NEW_LINE>self_contained = true;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (// add self loop, if not exists.<NEW_LINE>self_contained == false)<NEW_LINE>from_nodes_set.<MASK><NEW_LINE>Iterator from_nodes_it = from_nodes_set.iterator();<NEW_LINE>while (from_nodes_it.hasNext()) {<NEW_LINE>String component_info;<NEW_LINE>int cur_key_int = ((Integer) from_nodes_it.next()).intValue();<NEW_LINE>if (cur_key_int == key.get()) {<NEW_LINE>component_info = "msi" + component_id_str;<NEW_LINE>output.collect(new IntWritable(cur_key_int), new Text(component_info));<NEW_LINE>} else {<NEW_LINE>component_info = "moi" + component_id_str;<NEW_LINE>output.collect(new IntWritable(cur_key_int), new Text(component_info));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | add(key.get()); |
1,612,592 | public void userEventTriggered(ChannelHandlerContext ctx, Object evt) throws Exception {<NEW_LINE>if (evt instanceof CompleteEvent) {<NEW_LINE>final CompleteReason reason = ((CompleteEvent) evt).getReason();<NEW_LINE>if ((reason != SESSION_COMPLETE) && (edgeProxy != null)) {<NEW_LINE>LOG.error("Origin request completed with reason other than COMPLETE: {}, {}", reason.name(), ChannelUtils.channelInfoForLogging(ctx.channel()));<NEW_LINE>final ZuulException ze = new ZuulException("CompleteEvent", <MASK><NEW_LINE>edgeProxy.errorFromOrigin(ze);<NEW_LINE>}<NEW_LINE>// First let this event propagate along the pipeline, before cleaning vars from the channel.<NEW_LINE>// See channelWrite() where these vars are first set onto the channel.<NEW_LINE>try {<NEW_LINE>super.userEventTriggered(ctx, evt);<NEW_LINE>} finally {<NEW_LINE>postCompleteHook(ctx, evt);<NEW_LINE>}<NEW_LINE>} else if (evt instanceof SslHandshakeCompletionEvent && !((SslHandshakeCompletionEvent) evt).isSuccess()) {<NEW_LINE>Throwable cause = ((SslHandshakeCompletionEvent) evt).cause();<NEW_LINE>ctx.channel().attr(SSL_HANDSHAKE_UNSUCCESS_FROM_ORIGIN_THROWABLE).set(cause);<NEW_LINE>} else if (evt instanceof IdleStateEvent) {<NEW_LINE>if (edgeProxy != null) {<NEW_LINE>LOG.error("Origin request received IDLE event: {}", ChannelUtils.channelInfoForLogging(ctx.channel()));<NEW_LINE>edgeProxy.errorFromOrigin(new OutboundException(READ_TIMEOUT, edgeProxy.getRequestAttempts()));<NEW_LINE>}<NEW_LINE>super.userEventTriggered(ctx, evt);<NEW_LINE>} else {<NEW_LINE>super.userEventTriggered(ctx, evt);<NEW_LINE>}<NEW_LINE>} | reason.name(), true); |
1,165,786 | public void symbolAdded(Symbol symbol, int type, Address addr, Object oldValue, Object newValue) {<NEW_LINE>if (recordChanges) {<NEW_LINE>if (!symbol.isDynamic()) {<NEW_LINE><MASK><NEW_LINE>((ProgramDBChangeSet) changeSet).symbolAdded(symbolID);<NEW_LINE>}<NEW_LINE>if (symbol instanceof VariableSymbolDB) {<NEW_LINE>long nameSpaceID = symbol.getParentNamespace().getID();<NEW_LINE>Function function = getFunctionManager().getFunction(nameSpaceID);<NEW_LINE>if (function != null) {<NEW_LINE>Address entryPoint = function.getEntryPoint();<NEW_LINE>updateChangeSet(entryPoint, entryPoint);<NEW_LINE>fireEvent(new ProgramChangeRecord(DOCR_FUNCTION_CHANGED, entryPoint, entryPoint, function, null, null));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (addr != null) {<NEW_LINE>updateChangeSet(addr, addr);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>changed = true;<NEW_LINE>fireEvent(new ProgramChangeRecord(type, addr, addr, null, oldValue, newValue));<NEW_LINE>} | long symbolID = symbol.getID(); |
1,505,653 | void mouseDragged(MouseEvent e) {<NEW_LINE>if ((e.getModifiersEx() & InputEvent.BUTTON1_DOWN_MASK) == 0) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>int x = e.getX();<NEW_LINE><MASK><NEW_LINE>if (((Math.abs(x - mouseDownX) > 3) || (Math.abs(y - mouseDownY) > 3))) {<NEW_LINE>didDrag = true;<NEW_LINE>if (selectionHandler.isInProgress()) {<NEW_LINE>if (y < 0 || y > getHeight()) {<NEW_LINE>timerScrollAmount = y < 0 ? y : y - getHeight();<NEW_LINE>timerPoint = new FieldLocation(cursorPosition);<NEW_LINE>scrollTimer.start();<NEW_LINE>} else {<NEW_LINE>scrollTimer.stop();<NEW_LINE>// null means don't notify listeners<NEW_LINE>cursorHandler.setCursorPos(x, y, null);<NEW_LINE>selectionHandler.updateSelectionSequence(cursorPosition);<NEW_LINE>repaint();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | int y = e.getY(); |
13,094 | public static IllegalAccessMaps generate(ModuleFinder finder) {<NEW_LINE>Map<String, ModuleDescriptor> map = new HashMap<>();<NEW_LINE>finder.findAll().stream().map(ModuleReference::descriptor).forEach(md -> md.packages().forEach(pn -> map.<MASK><NEW_LINE>Map<String, Set<String>> concealedPackagesToOpen = new HashMap<>();<NEW_LINE>Map<String, Set<String>> exportedPackagesToOpen = new HashMap<>();<NEW_LINE>String rn = "jdk8_packages.dat";<NEW_LINE>InputStream in = IllegalAccessMaps.class.getResourceAsStream(rn);<NEW_LINE>if (in == null) {<NEW_LINE>throw new InternalError(rn + " not found");<NEW_LINE>}<NEW_LINE>try (BufferedReader br = new BufferedReader(new InputStreamReader(in, UTF_8.INSTANCE))) {<NEW_LINE>br.lines().filter(line -> !line.isEmpty() && !line.startsWith("#")).forEach(pn -> {<NEW_LINE>ModuleDescriptor descriptor = map.get(pn);<NEW_LINE>if (descriptor != null && !isOpen(descriptor, pn)) {<NEW_LINE>String name = descriptor.name();<NEW_LINE>if (isExported(descriptor, pn)) {<NEW_LINE>exportedPackagesToOpen.computeIfAbsent(name, k -> new HashSet<>()).add(pn);<NEW_LINE>} else {<NEW_LINE>concealedPackagesToOpen.computeIfAbsent(name, k -> new HashSet<>()).add(pn);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} catch (IOException ioe) {<NEW_LINE>throw new UncheckedIOException(ioe);<NEW_LINE>}<NEW_LINE>return new IllegalAccessMaps(concealedPackagesToOpen, exportedPackagesToOpen);<NEW_LINE>} | putIfAbsent(pn, md))); |
1,018,678 | public int select(int j) {<NEW_LINE>preComputeCardinalities();<NEW_LINE>if (highLowContainer.size() == 0) {<NEW_LINE>// empty: .select is out-of-bounds<NEW_LINE>throw new IllegalArgumentException("select " + j + " when the cardinality is " + this.getCardinality());<NEW_LINE>}<NEW_LINE>int maxCardinality = highToCumulatedCardinality[highToCumulatedCardinality.length - 1] - 1;<NEW_LINE>if (j == maxCardinality) {<NEW_LINE>// We select the total cardinality: we are selecting the last element of the last bucket<NEW_LINE>return this.last();<NEW_LINE>} else if (j > maxCardinality) {<NEW_LINE>throw new IllegalArgumentException("select " + j + " when the cardinality is " + this.getCardinality());<NEW_LINE>}<NEW_LINE>int index = <MASK><NEW_LINE>int fixedIndex;<NEW_LINE>long leftover = Util.toUnsignedLong(j);<NEW_LINE>if (index >= 0) {<NEW_LINE>// We selected exactly a cumulated cardinality:<NEW_LINE>// we are selecting the first element of next bucket<NEW_LINE>int keycontrib = this.highLowContainer.getKeyAtIndex(index + 1) << 16;<NEW_LINE>// If first bucket has cardinality 1 and we select 1: we actual select the first item of<NEW_LINE>// next bucket<NEW_LINE>int output = keycontrib + this.highLowContainer.getContainerAtIndex(index + 1).first();<NEW_LINE>return output;<NEW_LINE>} else {<NEW_LINE>// We selected a cardinality not matching exactly the cumulated cardinalities: we are not<NEW_LINE>// selected the last element of a bucket<NEW_LINE>fixedIndex = -1 - index;<NEW_LINE>if (fixedIndex > 0) {<NEW_LINE>leftover -= highToCumulatedCardinality[fixedIndex - 1];<NEW_LINE>}<NEW_LINE>}<NEW_LINE>int keycontrib = this.highLowContainer.getKeyAtIndex(fixedIndex) << 16;<NEW_LINE>int lowcontrib = (this.highLowContainer.getContainerAtIndex(fixedIndex).select((int) leftover));<NEW_LINE>int value = lowcontrib + keycontrib;<NEW_LINE>return value;<NEW_LINE>} | Arrays.binarySearch(highToCumulatedCardinality, j); |
1,450,081 | public void sendRequest(final MetaInfoRequest request) {<NEW_LINE>try {<NEW_LINE>String metaServer = queryMetaServerAddress();<NEW_LINE>if (metaServer == null)<NEW_LINE>return;<NEW_LINE>final Channel channel = getOrCreateChannel(metaServer);<NEW_LINE>final Datagram datagram = RemotingBuilder.buildRequestDatagram(CommandCode.CLIENT_REGISTER, new MetaInfoRequestPayloadHolder(request));<NEW_LINE>channel.writeAndFlush(datagram).addListener(new ChannelFutureListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void operationComplete(ChannelFuture future) {<NEW_LINE>if (future.isSuccess()) {<NEW_LINE>LOGGER.debug("request meta info send success. {}", request);<NEW_LINE>} else {<NEW_LINE>LOGGER.debug("request meta info send fail. {}", request);<NEW_LINE>Metrics.counter("qmq_pull_metainfo_request_fail", SUBJECT_GROUP_ARRAY, new String[] { request.getSubject(), request.getConsumerGroup() }).inc();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} catch (Exception e) {<NEW_LINE>LOGGER.<MASK><NEW_LINE>Metrics.counter("qmq_pull_metainfo_request_fail", SUBJECT_GROUP_ARRAY, new String[] { request.getSubject(), request.getConsumerGroup() }).inc();<NEW_LINE>}<NEW_LINE>} | debug("request meta info exception. {}", request, e); |
1,058,791 | // This function checks whether the size of arguments fits in an expected signature.<NEW_LINE>private List<String> convert(List<NoMatchingSignatureError.ArgumentType> arguments, NoMatchingSignatureError.Signature signature) {<NEW_LINE>List<String> argumentTemplates = new ArrayList<>();<NEW_LINE>// A wildcard to match ANY type.<NEW_LINE>String any = null;<NEW_LINE>boolean atRequired = true;<NEW_LINE>int argsIndex = 0;<NEW_LINE>for (int i = 0; i < arguments.size(); i++) {<NEW_LINE>NoMatchingSignatureError.ArgumentType argument = arguments.get(i);<NEW_LINE><MASK><NEW_LINE>NoMatchingSignatureError.ArgumentType expectedArgument = getArgumentType(signature, atRequired, argsIndex);<NEW_LINE>if (expectedArgument == null) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>String expectedType = expectedArgument.getDataType();<NEW_LINE>// ANY equals the data type that matches the first ANY.<NEW_LINE>if (expectedType.equals(TypeCast.ANY)) {<NEW_LINE>expectedType = any == null ? any = sourceType : any;<NEW_LINE>}<NEW_LINE>String argumentHolder;<NEW_LINE>// place holder is 1-based index.<NEW_LINE>if (expectedType.equals(sourceType)) {<NEW_LINE>argumentHolder = String.format("{%s}", i + 1);<NEW_LINE>} else {<NEW_LINE>argumentHolder = TypeCast.getCastTemplate(expectedType, sourceType, i + 1);<NEW_LINE>}<NEW_LINE>argumentTemplates.add(argumentHolder);<NEW_LINE>argsIndex++;<NEW_LINE>// After matching all the required argument, it will start to match optional arguments.<NEW_LINE>if (atRequired && argsIndex == signature.getRequired().size()) {<NEW_LINE>atRequired = false;<NEW_LINE>argsIndex = 0;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return argumentTemplates;<NEW_LINE>} | String sourceType = argument.getDataType(); |
1,070,409 | public ColumnFamilyOptions createColumnFamilyOptions(ColumnFamilyOptions currentOptions) {<NEW_LINE>if (currentOptions == null)<NEW_LINE>currentOptions = new ColumnFamilyOptions();<NEW_LINE>currentOptions.setMergeOperator(new StringAppendOperator());<NEW_LINE>BlockBasedTableConfig tableOptions = new BlockBasedTableConfig();<NEW_LINE>tableOptions.setBlockSize(32 * SizeUnit.KB);<NEW_LINE>// Set memory table size<NEW_LINE>currentOptions.setMaxWriteBufferNumber(4);<NEW_LINE>currentOptions.<MASK><NEW_LINE>// Set block cache size<NEW_LINE>tableOptions.setBlockCacheSize(64 * SizeUnit.MB);<NEW_LINE>tableOptions.setFilter(new BloomFilter(DEFAULT_BLOOM_FILTER_BITS, false));<NEW_LINE>// Put all index into block cache<NEW_LINE>tableOptions.setCacheIndexAndFilterBlocks(true);<NEW_LINE>currentOptions.setTableFormatConfig(tableOptions);<NEW_LINE>currentOptions.setTargetFileSizeBase(64 * SizeUnit.MB);<NEW_LINE>currentOptions.setCompactionStyle(CompactionStyle.LEVEL);<NEW_LINE>currentOptions.setLevelZeroFileNumCompactionTrigger(4);<NEW_LINE>currentOptions.setLevelZeroSlowdownWritesTrigger(20);<NEW_LINE>currentOptions.setLevelZeroStopWritesTrigger(30);<NEW_LINE>currentOptions.setNumLevels(4);<NEW_LINE>currentOptions.setMaxBytesForLevelBase(64 * 4 * SizeUnit.MB);<NEW_LINE>return currentOptions;<NEW_LINE>} | setWriteBufferSize(64 * SizeUnit.MB); |
15,149 | private boolean canExport(JFileChooser chooser) {<NEW_LINE><MASK><NEW_LINE>String defaultExtention = selectedBuilder.getFileTypes()[0].getExtension();<NEW_LINE>try {<NEW_LINE>if (!file.getPath().endsWith(defaultExtention)) {<NEW_LINE>file = new File(file.getPath() + defaultExtention);<NEW_LINE>selectedFile = file;<NEW_LINE>chooser.setSelectedFile(file);<NEW_LINE>}<NEW_LINE>if (!file.exists()) {<NEW_LINE>if (!file.createNewFile()) {<NEW_LINE>String failMsg = NbBundle.getMessage(GraphFileExporterUI.class, "GraphFileExporterUI_SaveFailed", new Object[] { file.getPath() });<NEW_LINE>JOptionPane.showMessageDialog(null, failMsg);<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>String overwriteMsg = NbBundle.getMessage(GraphFileExporterUI.class, "GraphFileExporterUI_overwriteDialog_message", new Object[] { file.getPath() });<NEW_LINE>if (JOptionPane.showConfirmDialog(null, overwriteMsg, NbBundle.getMessage(GraphFileExporterUI.class, "GraphFileExporterUI_overwriteDialog_title"), JOptionPane.YES_NO_OPTION) != JOptionPane.YES_OPTION) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (IOException ex) {<NEW_LINE>NotifyDescriptor.Message msg = new NotifyDescriptor.Message(ex.getMessage(), NotifyDescriptor.WARNING_MESSAGE);<NEW_LINE>DialogDisplayer.getDefault().notifyLater(msg);<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>} | File file = chooser.getSelectedFile(); |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.