idx int32 46 1.86M | input stringlengths 321 6.6k | target stringlengths 9 1.24k |
|---|---|---|
241,440 | public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {<NEW_LINE>super.onCreateView(inflater, container, savedInstanceState);<NEW_LINE>View rootView = inflater.inflate(R.layout.pager_fragment, container, false);<NEW_LINE>Toolbar toolbar = rootView.findViewById(R.id.toolbar);<NEW_LINE>toolbar.setTitle(R.string.episodes_label);<NEW_LINE>toolbar.inflateMenu(R.menu.episodes);<NEW_LINE>displayUpArrow = getParentFragmentManager().getBackStackEntryCount() != 0;<NEW_LINE>if (savedInstanceState != null) {<NEW_LINE>displayUpArrow = savedInstanceState.getBoolean(KEY_UP_ARROW);<NEW_LINE>}<NEW_LINE>((MainActivity) getActivity()).setupToolbarToggle(toolbar, displayUpArrow);<NEW_LINE>ViewPager2 viewPager = rootView.findViewById(R.id.viewpager);<NEW_LINE>viewPager.<MASK><NEW_LINE>viewPager.setOffscreenPageLimit(2);<NEW_LINE>super.setupPagedToolbar(toolbar, viewPager);<NEW_LINE>// Give the TabLayout the ViewPager<NEW_LINE>tabLayout = rootView.findViewById(R.id.sliding_tabs);<NEW_LINE>new TabLayoutMediator(tabLayout, viewPager, (tab, position) -> {<NEW_LINE>switch(position) {<NEW_LINE>case POS_NEW_EPISODES:<NEW_LINE>tab.setText(R.string.new_episodes_label);<NEW_LINE>break;<NEW_LINE>case POS_ALL_EPISODES:<NEW_LINE>tab.setText(R.string.all_episodes_short_label);<NEW_LINE>break;<NEW_LINE>case POS_FAV_EPISODES:<NEW_LINE>tab.setText(R.string.favorite_episodes_label);<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}).attach();<NEW_LINE>// restore our last position<NEW_LINE>SharedPreferences prefs = getActivity().getSharedPreferences(TAG, Context.MODE_PRIVATE);<NEW_LINE>int lastPosition = prefs.getInt(PREF_LAST_TAB_POSITION, 0);<NEW_LINE>viewPager.setCurrentItem(lastPosition, false);<NEW_LINE>return rootView;<NEW_LINE>} | setAdapter(new EpisodesPagerAdapter(this)); |
578,761 | public List scanData(Filter f, final String tableName, Class clazz, EntityMetadata m, String columnFamily, String qualifier) throws IOException, InstantiationException, IllegalAccessException {<NEW_LINE>List returnedResults = new ArrayList();<NEW_LINE>MetamodelImpl metaModel = (MetamodelImpl) kunderaMetadata.getApplicationMetadata().getMetamodel(m.getPersistenceUnit());<NEW_LINE>EntityType entityType = metaModel.<MASK><NEW_LINE>Set<Attribute> attributes = entityType.getAttributes();<NEW_LINE>String[] columns = new String[attributes.size() - 1];<NEW_LINE>int count = 0;<NEW_LINE>boolean isCollection = false;<NEW_LINE>for (Attribute attr : attributes) {<NEW_LINE>if (!attr.isCollection() && !attr.getName().equalsIgnoreCase(m.getIdAttribute().getName())) {<NEW_LINE>columns[count++] = ((AbstractAttribute) attr).getJPAColumnName();<NEW_LINE>} else if (attr.isCollection()) {<NEW_LINE>isCollection = true;<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>List<HBaseData> results = hbaseReader.loadAll(gethTable(tableName), f, null, null, m.getTableName(), isCollection ? qualifier : null, null);<NEW_LINE>if (results != null) {<NEW_LINE>for (HBaseData row : results) {<NEW_LINE>// Entity Object<NEW_LINE>Object entity = clazz.newInstance(); | entity(m.getEntityClazz()); |
1,799,527 | public void updateRequest(final boolean force, boolean useCache, @Nullable final ScrollToPolicy scrollToChangePolicy) {<NEW_LINE>ApplicationManager.getApplication().assertIsDispatchThread();<NEW_LINE>if (isDisposed())<NEW_LINE>return;<NEW_LINE>final T requestProvider = getCurrentRequestProvider();<NEW_LINE>if (requestProvider == null) {<NEW_LINE>applyRequest(NoDiffRequest.INSTANCE, force, scrollToChangePolicy);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>DiffRequest cachedRequest = <MASK><NEW_LINE>if (cachedRequest != null) {<NEW_LINE>applyRequest(cachedRequest, force, scrollToChangePolicy);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>myQueue.executeAndTryWait(indicator -> {<NEW_LINE>final DiffRequest request = doLoadRequest(requestProvider, indicator);<NEW_LINE>return () -> {<NEW_LINE>myRequestCache.put(requestProvider, request);<NEW_LINE>applyRequest(request, force, scrollToChangePolicy);<NEW_LINE>};<NEW_LINE>}, () -> {<NEW_LINE>applyRequest(new LoadingDiffRequest(getRequestName(requestProvider)), force, scrollToChangePolicy);<NEW_LINE>}, ProgressWindow.DEFAULT_PROGRESS_DIALOG_POSTPONE_TIME_MILLIS);<NEW_LINE>} | useCache ? loadRequestFast(requestProvider) : null; |
860,888 | private int writeInlinedSubroutineAbbrev(byte[] buffer, int p, boolean withChildren) {<NEW_LINE>int pos = p;<NEW_LINE>pos = writeAbbrevCode(withChildren ? DwarfDebugInfo.DW_ABBREV_CODE_inlined_subroutine_with_children : DwarfDebugInfo.DW_ABBREV_CODE_inlined_subroutine, buffer, pos);<NEW_LINE>pos = writeTag(DwarfDebugInfo.DW_TAG_inlined_subroutine, buffer, pos);<NEW_LINE>pos = writeFlag(withChildren ? DwarfDebugInfo.DW_CHILDREN_yes : DwarfDebugInfo.DW_CHILDREN_no, buffer, pos);<NEW_LINE>pos = writeAttrType(DwarfDebugInfo.DW_AT_abstract_origin, buffer, pos);<NEW_LINE>pos = writeAttrForm(DwarfDebugInfo.DW_FORM_ref_addr, buffer, pos);<NEW_LINE>pos = writeAttrType(DwarfDebugInfo.DW_AT_low_pc, buffer, pos);<NEW_LINE>pos = writeAttrForm(DwarfDebugInfo.DW_FORM_addr, buffer, pos);<NEW_LINE>pos = writeAttrType(DwarfDebugInfo.DW_AT_hi_pc, buffer, pos);<NEW_LINE>pos = writeAttrForm(<MASK><NEW_LINE>pos = writeAttrType(DwarfDebugInfo.DW_AT_call_file, buffer, pos);<NEW_LINE>pos = writeAttrForm(DwarfDebugInfo.DW_FORM_data4, buffer, pos);<NEW_LINE>pos = writeAttrType(DwarfDebugInfo.DW_AT_call_line, buffer, pos);<NEW_LINE>pos = writeAttrForm(DwarfDebugInfo.DW_FORM_data4, buffer, pos); | DwarfDebugInfo.DW_FORM_addr, buffer, pos); |
1,820,342 | private void write(ElfHeader.EIClass eiClass, ByteBuffer buffer) {<NEW_LINE>if (eiClass == ElfHeader.EIClass.ELFCLASS32) {<NEW_LINE>Elf.Elf32.putElf32Half(buffer, (short) vn_version);<NEW_LINE>Elf.Elf32.putElf32Half(buffer, (short) vn_cnt);<NEW_LINE>Elf.Elf32.putElf32Word(buffer, (int) vn_file);<NEW_LINE>Elf.Elf32.putElf32Word(buffer, (int) vn_aux);<NEW_LINE>Elf.Elf32.putElf32Word(buffer, (int) vn_next);<NEW_LINE>} else {<NEW_LINE>Elf.Elf64.putElf64Half(buffer, (short) vn_version);<NEW_LINE>Elf.Elf64.putElf64Half(buffer, (short) vn_cnt);<NEW_LINE>Elf.Elf64.putElf64Word(buffer, (int) vn_file);<NEW_LINE>Elf.Elf64.putElf64Word<MASK><NEW_LINE>Elf.Elf64.putElf64Word(buffer, (int) vn_next);<NEW_LINE>}<NEW_LINE>} | (buffer, (int) vn_aux); |
345,548 | public com.amazonaws.services.fsx.model.ResourceDoesNotSupportTaggingException unmarshallFromContext(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>com.amazonaws.services.fsx.model.ResourceDoesNotSupportTaggingException resourceDoesNotSupportTaggingException = new com.amazonaws.services.fsx.model.ResourceDoesNotSupportTaggingException(null);<NEW_LINE><MASK><NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>if (context.testExpression("ResourceARN", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>resourceDoesNotSupportTaggingException.setResourceARN(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 resourceDoesNotSupportTaggingException;<NEW_LINE>} | int originalDepth = context.getCurrentDepth(); |
30,751 | protected RexNode convertExtendedExpression(SqlNode node, Blackboard bb) {<NEW_LINE>if (node instanceof SqlBasicCall && (((SqlBasicCall) node).getOperator() == IN || ((SqlBasicCall) node).getOperator() == NOT_IN)) {<NEW_LINE>if (((SqlBasicCall) node).getOperandList().size() == 2 && ((SqlBasicCall) node).getOperandList().get(1) instanceof SqlNodeList) {<NEW_LINE>List<RexNode<MASK><NEW_LINE>for (SqlNode s : ((SqlNodeList) ((SqlBasicCall) node).getOperandList().get(1)).getList()) {<NEW_LINE>rexNodeList.add(bb.convertExpression(s));<NEW_LINE>}<NEW_LINE>RexNode r = rexBuilder.makeCall(SqlStdOperatorTable.ROW, rexNodeList);<NEW_LINE>return rexBuilder.makeCall(((SqlBasicCall) node).getOperator(), bb.convertExpression(((SqlBasicCall) node).getOperandList().get(0)), r);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>} | > rexNodeList = Lists.newArrayList(); |
1,485,064 | public ConsumerCallbackResult onError(Throwable err) {<NEW_LINE>long curNanos = System.nanoTime();<NEW_LINE>for (DatabusV2ConsumerRegistration consumerReg : _registrations) {<NEW_LINE>for (DatabusCombinedConsumer consumer : consumerReg.getConsumers()) {<NEW_LINE>ConsumerCallable<ConsumerCallbackResult> onErrorCallable = _callbackFactory.createOnErrorCallable(curNanos, err, consumer, true);<NEW_LINE>_currentBatch.add(onErrorCallable);<NEW_LINE>// FIXME: bug? "processed" usually means consumer callback has completed; registerErrorEventsProcessed() normally called only if consumer callback returns ERROR: why no registerErrorEventsReceived() call here?<NEW_LINE>if (_consumerStats != null)<NEW_LINE>_consumerStats.registerErrorEventsProcessed(1);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (_loggingConsumer != null) {<NEW_LINE>ConsumerCallable<ConsumerCallbackResult> onErrorCallable = _callbackFactory.createOnErrorCallable(curNanos, err, _loggingConsumer, false);<NEW_LINE>_currentBatch.add(onErrorCallable);<NEW_LINE>}<NEW_LINE>if (_log.isDebugEnabled()) {<NEW_LINE>long endNanos = System.nanoTime();<NEW_LINE>_log.debug("Time spent in databus clientlib by onError = " + (endNanos - curNanos<MASK><NEW_LINE>}<NEW_LINE>return submitBatch(curNanos, true, true);<NEW_LINE>} | ) / DbusConstants.NUM_NSECS_IN_MSEC + "ms"); |
1,001,112 | public void andThenVisit(CustomResourceDefinitionSpecFluent<?> spec, ObjectMeta resourceMeta) {<NEW_LINE>Predicate<CustomResourceDefinitionVersionBuilder> hasStorageVersion = v -> v.getStorage() != null && v.getStorage();<NEW_LINE>if (spec.hasVersions() && !spec.hasMatchingVersion(hasStorageVersion)) {<NEW_LINE>spec.editFirstVersion().withStorage(true).endVersion();<NEW_LINE>}<NEW_LINE>for (CustomResourceDefinitionVersion version : spec.buildVersions()) {<NEW_LINE>if (version.getStorage() != null && version.getStorage()) {<NEW_LINE><MASK><NEW_LINE>if (existing != null && !existing.equals(version.getName())) {<NEW_LINE>throw new IllegalStateException(String.format("'%s' custom resource has versions %s and %s marked as storage. Only one version can be marked as storage per custom resource.", resourceMeta.getName(), version.getName(), existing));<NEW_LINE>} else {<NEW_LINE>storageVersion.set(version.getName());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | String existing = storageVersion.get(); |
564,008 | public void marshall(AuthenticationConfig authenticationConfig, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (authenticationConfig == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(<MASK><NEW_LINE>protocolMarshaller.marshall(authenticationConfig.getIsApiKeyAuthSupported(), ISAPIKEYAUTHSUPPORTED_BINDING);<NEW_LINE>protocolMarshaller.marshall(authenticationConfig.getIsOAuth2Supported(), ISOAUTH2SUPPORTED_BINDING);<NEW_LINE>protocolMarshaller.marshall(authenticationConfig.getIsCustomAuthSupported(), ISCUSTOMAUTHSUPPORTED_BINDING);<NEW_LINE>protocolMarshaller.marshall(authenticationConfig.getOAuth2Defaults(), OAUTH2DEFAULTS_BINDING);<NEW_LINE>protocolMarshaller.marshall(authenticationConfig.getCustomAuthConfigs(), CUSTOMAUTHCONFIGS_BINDING);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>} | authenticationConfig.getIsBasicAuthSupported(), ISBASICAUTHSUPPORTED_BINDING); |
572,153 | public Object objectGetConstructorName(Object object) {<NEW_LINE>TruffleString name = Strings.UC_OBJECT;<NEW_LINE>if (JSDynamicObject.isJSDynamicObject(object)) {<NEW_LINE>JSDynamicObject dynamicObject = (JSDynamicObject) object;<NEW_LINE>Object constructor = JSObject.get(dynamicObject, JSObject.CONSTRUCTOR);<NEW_LINE>if (JSFunction.isJSFunction(constructor)) {<NEW_LINE>name = JSFunction<MASK><NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>InteropLibrary interop = InteropLibrary.getUncached(object);<NEW_LINE>if (interop.hasMetaObject(object)) {<NEW_LINE>try {<NEW_LINE>Object metaObject = interop.getMetaObject(object);<NEW_LINE>Object interopName = InteropLibrary.getUncached(metaObject).getMetaSimpleName(metaObject);<NEW_LINE>name = InteropLibrary.getUncached(interopName).asTruffleString(interopName);<NEW_LINE>} catch (UnsupportedMessageException ex) {<NEW_LINE>throw Errors.shouldNotReachHere(ex);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return name;<NEW_LINE>} | .getName((JSFunctionObject) constructor); |
1,711,718 | public Transaction capture(MerchantStore store, Customer customer, Order order, Transaction capturableTransaction, IntegrationConfiguration configuration, IntegrationModule module) throws IntegrationException {<NEW_LINE>try {<NEW_LINE>// authorize a preauth<NEW_LINE>String trnID = capturableTransaction.getTransactionDetails().get("TRANSACTIONID");<NEW_LINE>String amnt = productPriceUtils.getAdminFormatedAmount(store, order.getTotal());<NEW_LINE>StringBuilder messageString = new StringBuilder();<NEW_LINE>messageString.append("requestType=BACKEND&");<NEW_LINE>messageString.append("merchant_id=").append(configuration.getIntegrationKeys().get("merchantid")).append("&");<NEW_LINE>messageString.append("trnType=").append("PAC").append("&");<NEW_LINE>messageString.append("username=").append(configuration.getIntegrationKeys().get("username")).append("&");<NEW_LINE>messageString.append("password=").append(configuration.getIntegrationKeys().get("password")).append("&");<NEW_LINE>messageString.append("trnAmount=").append(amnt).append("&");<NEW_LINE>messageString.append("adjId=").append(trnID).append("&");<NEW_LINE>messageString.append<MASK><NEW_LINE>LOGGER.debug("REQUEST SENT TO BEANSTREAM -> " + messageString.toString());<NEW_LINE>return sendTransaction(null, store, messageString.toString(), "PAC", TransactionType.CAPTURE, PaymentType.CREDITCARD, order.getTotal(), configuration, module);<NEW_LINE>} catch (Exception e) {<NEW_LINE>if (e instanceof IntegrationException)<NEW_LINE>throw (IntegrationException) e;<NEW_LINE>throw new IntegrationException("Error while processing BeanStream transaction", e);<NEW_LINE>}<NEW_LINE>} | ("trnID=").append(trnID); |
895,615 | public void onCreateContextMenu(ContextMenu menu, View v, ContextMenu.ContextMenuInfo menuInfo) {<NEW_LINE>super.onCreateContextMenu(menu, v, menuInfo);<NEW_LINE>AdapterView.AdapterContextMenuInfo aInfo = (AdapterView.AdapterContextMenuInfo) menuInfo;<NEW_LINE>// ProfileData profile = profileAdapter.getItem(aInfo.position);<NEW_LINE>String name = ((TextView) aInfo.targetView.findViewById(R.id.pro_name)).getText().toString();<NEW_LINE>menu.setHeaderTitle(getString(R.string.select) + " " + name);<NEW_LINE>if (G.isProfileMigrated()) {<NEW_LINE>menu.add(0, MENU_CLONE, 0, getString(R.string.clone));<NEW_LINE>menu.add(0, MENU_RENAME, 0, getString(R.string.rename));<NEW_LINE>}<NEW_LINE>menu.add(0, MENU_DELETE, 0, getString<MASK><NEW_LINE>} | (R.string.delete)); |
1,502,003 | private JPanel optionalSettings() {<NEW_LINE>JPanel panel = new JPanel(new BorderLayout());<NEW_LINE>panel.setOpaque(false);<NEW_LINE>JPanel description = new JPanel();<NEW_LINE>description.setLayout(new BoxLayout(description, BoxLayout.Y_AXIS));<NEW_LINE>description.setOpaque(false);<NEW_LINE>JPanel name = new JPanel(<MASK><NEW_LINE>name.setOpaque(false);<NEW_LINE>JLabel nameLbl = new JLabel(MessageUtils.getLocalizedMessage("createindex.label.option"));<NEW_LINE>name.add(nameLbl);<NEW_LINE>description.add(name);<NEW_LINE>JTextArea descTA1 = new JTextArea(MessageUtils.getLocalizedMessage("createindex.textarea.data_help1"));<NEW_LINE>descTA1.setPreferredSize(new Dimension(550, 20));<NEW_LINE>descTA1.setBorder(BorderFactory.createEmptyBorder(2, 10, 10, 5));<NEW_LINE>descTA1.setOpaque(false);<NEW_LINE>descTA1.setLineWrap(true);<NEW_LINE>descTA1.setEditable(false);<NEW_LINE>description.add(descTA1);<NEW_LINE>JPanel link = new JPanel(new FlowLayout(FlowLayout.LEADING, 10, 1));<NEW_LINE>link.setOpaque(false);<NEW_LINE>JLabel linkLbl = FontUtils.toLinkText(new URLLabel(MessageUtils.getLocalizedMessage("createindex.label.data_link")));<NEW_LINE>link.add(linkLbl);<NEW_LINE>description.add(link);<NEW_LINE>JTextArea descTA2 = new JTextArea(MessageUtils.getLocalizedMessage("createindex.textarea.data_help2"));<NEW_LINE>descTA2.setPreferredSize(new Dimension(550, 50));<NEW_LINE>descTA2.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 5));<NEW_LINE>descTA2.setOpaque(false);<NEW_LINE>descTA2.setLineWrap(true);<NEW_LINE>descTA2.setEditable(false);<NEW_LINE>description.add(descTA2);<NEW_LINE>panel.add(description, BorderLayout.PAGE_START);<NEW_LINE>JPanel dataDirPath = new JPanel(new FlowLayout(FlowLayout.LEADING));<NEW_LINE>dataDirPath.setOpaque(false);<NEW_LINE>dataDirPath.add(new JLabel(MessageUtils.getLocalizedMessage("createindex.label.datadir")));<NEW_LINE>dataDirPath.add(dataDirTF);<NEW_LINE>dataDirPath.add(dataBrowseBtn);<NEW_LINE>dataDirPath.add(clearBtn);<NEW_LINE>panel.add(dataDirPath, BorderLayout.CENTER);<NEW_LINE>return panel;<NEW_LINE>} | new FlowLayout(FlowLayout.LEADING)); |
384,769 | static final Column convertJsonNodeToColumn(final JsonNode root, final JsonParser jsonParser) throws JsonProcessingException {<NEW_LINE>if (root == null || !root.isObject()) {<NEW_LINE>throw JsonMappingException.from(jsonParser, "Column expects a JSON Object node.");<NEW_LINE>}<NEW_LINE>final ObjectNode object = (ObjectNode) root;<NEW_LINE>final JsonNode <MASK><NEW_LINE>final int index;<NEW_LINE>if (indexNode == null) {<NEW_LINE>logger.warn("Building Column from JSON without \"index\".", JsonMappingException.from(jsonParser, "Building Column from JSON without \"index\"."));<NEW_LINE>index = 0;<NEW_LINE>} else {<NEW_LINE>index = OBJECT_MAPPER.treeToValue(indexNode, int.class);<NEW_LINE>}<NEW_LINE>final JsonNode nameNode = object.get("name");<NEW_LINE>if (nameNode == null) {<NEW_LINE>throw JsonMappingException.from(jsonParser, "Building Column from JSON without \"name\".");<NEW_LINE>}<NEW_LINE>final String name = OBJECT_MAPPER.treeToValue(nameNode, String.class);<NEW_LINE>final JsonNode typeNode = object.get("type");<NEW_LINE>if (typeNode == null) {<NEW_LINE>throw JsonMappingException.from(jsonParser, "Building Column from JSON without \"type\".");<NEW_LINE>}<NEW_LINE>final String typeString = OBJECT_MAPPER.treeToValue(typeNode, String.class);<NEW_LINE>if (!STRING_TO_TYPE.containsKey(typeString)) {<NEW_LINE>throw JsonMappingException.from(jsonParser, "Building Column from JSON with unexpected type: " + typeString);<NEW_LINE>}<NEW_LINE>final Type type = STRING_TO_TYPE.get(typeString);<NEW_LINE>return new Column(index, name, type);<NEW_LINE>} | indexNode = object.get("index"); |
1,478,437 | public void cancelTransference(OCFile file) {<NEW_LINE>User currentUser = fileActivity.getUser().orElseThrow(IllegalStateException::new);<NEW_LINE>if (file.isFolder()) {<NEW_LINE>OperationsService.OperationsServiceBinder opsBinder = fileActivity.getOperationsServiceBinder();<NEW_LINE>if (opsBinder != null) {<NEW_LINE>opsBinder.cancel(currentUser.toPlatformAccount(), file);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// for both files and folders<NEW_LINE>FileDownloaderBinder downloaderBinder = fileActivity.getFileDownloaderBinder();<NEW_LINE>if (downloaderBinder != null && downloaderBinder.isDownloading(currentUser, file)) {<NEW_LINE>downloaderBinder.cancel(<MASK><NEW_LINE>}<NEW_LINE>FileUploaderBinder uploaderBinder = fileActivity.getFileUploaderBinder();<NEW_LINE>if (uploaderBinder != null && uploaderBinder.isUploading(currentUser, file)) {<NEW_LINE>uploaderBinder.cancel(currentUser.toPlatformAccount(), file);<NEW_LINE>}<NEW_LINE>} | currentUser.toPlatformAccount(), file); |
357,368 | public String encrypt(String value) {<NEW_LINE>String clearText = value;<NEW_LINE>if (clearText == null)<NEW_LINE>clearText = "";<NEW_LINE>// Init<NEW_LINE>if (m_cipher == null)<NEW_LINE>initCipher();<NEW_LINE>// Encrypt<NEW_LINE>if (m_cipher != null) {<NEW_LINE>try {<NEW_LINE>m_cipher.init(Cipher.ENCRYPT_MODE, m_key);<NEW_LINE>byte[] encBytes = m_cipher.doFinal<MASK><NEW_LINE>String encString = convertToHexString(encBytes);<NEW_LINE>// globalqss - [ 1577737 ] Security Breach - show database password<NEW_LINE>// log.log (Level.ALL, value + " => " + encString);<NEW_LINE>return encString;<NEW_LINE>} catch (Exception ex) {<NEW_LINE>// log.log(Level.INFO, value, ex);<NEW_LINE>log.log(Level.INFO, "Problem encrypting string", ex);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Fallback<NEW_LINE>return CLEARVALUE_START + value + CLEARVALUE_END;<NEW_LINE>} | (clearText.getBytes("UTF8")); |
687,913 | public void addAnnotatedThingActions(ThingActions annotatedThingActions) {<NEW_LINE>if (annotatedThingActions.getClass().isAnnotationPresent(ThingActionsScope.class)) {<NEW_LINE>ThingActionsScope scope = annotatedThingActions.getClass().getAnnotation(ThingActionsScope.class);<NEW_LINE>Collection<ModuleInformation> moduleInformations = helper.parseAnnotations(scope.name(), annotatedThingActions);<NEW_LINE>String thingUID = annotatedThingActions.getThingHandler().getThing().getUID().getAsString();<NEW_LINE>for (ModuleInformation mi : moduleInformations) {<NEW_LINE>mi.setThingUID(thingUID);<NEW_LINE>ModuleType oldType = null;<NEW_LINE>if (this.moduleInformation.containsKey(mi.getUID())) {<NEW_LINE>oldType = helper.buildModuleType(mi.getUID(), this.moduleInformation);<NEW_LINE>Set<ModuleInformation> availableModuleConfigs = this.moduleInformation.get(mi.getUID());<NEW_LINE>availableModuleConfigs.add(mi);<NEW_LINE>} else {<NEW_LINE>Set<ModuleInformation> configs = ConcurrentHashMap.newKeySet();<NEW_LINE>configs.add(mi);<NEW_LINE>this.moduleInformation.put(mi.getUID(), configs);<NEW_LINE>}<NEW_LINE>ModuleType mt = helper.buildModuleType(mi.getUID(), this.moduleInformation);<NEW_LINE>if (mt != null) {<NEW_LINE>for (ProviderChangeListener<ModuleType> l : changeListeners) {<NEW_LINE>if (oldType != null) {<NEW_LINE>l.<MASK><NEW_LINE>} else {<NEW_LINE>l.added(this, mt);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | updated(this, oldType, mt); |
1,213,225 | private Mono<Response<Void>> deleteWithResponseAsync(String resourceGroupName, String automationAccountName, String variableName, Context context) {<NEW_LINE>if (this.client.getEndpoint() == null) {<NEW_LINE>return Mono.<MASK><NEW_LINE>}<NEW_LINE>if (resourceGroupName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (automationAccountName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter automationAccountName is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (variableName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter variableName is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (this.client.getSubscriptionId() == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."));<NEW_LINE>}<NEW_LINE>final String apiVersion = "2019-06-01";<NEW_LINE>final String accept = "application/json";<NEW_LINE>context = this.client.mergeContext(context);<NEW_LINE>return service.delete(this.client.getEndpoint(), resourceGroupName, automationAccountName, variableName, this.client.getSubscriptionId(), apiVersion, accept, context);<NEW_LINE>} | error(new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); |
1,260,439 | protected void recordFilterCompletion(final ExecutionStatus status, final ZuulFilter<I, O> filter, long startTime, final ZuulMessage zuulMesg, final ZuulMessage startSnapshot) {<NEW_LINE>final SessionContext zuulCtx = zuulMesg.getContext();<NEW_LINE>final long execTimeNs = System.nanoTime() - startTime;<NEW_LINE>final long execTimeMs = execTimeNs / 1_000_000L;<NEW_LINE>if (execTimeMs >= FILTER_EXCESSIVE_EXEC_TIME.get()) {<NEW_LINE>registry.timer(filterExcessiveTimerId.withTag("id", filter.filterName()).withTag("status", status.name())).<MASK><NEW_LINE>}<NEW_LINE>// Record the execution summary in context.<NEW_LINE>switch(status) {<NEW_LINE>case FAILED:<NEW_LINE>if (logger.isDebugEnabled()) {<NEW_LINE>zuulCtx.addFilterExecutionSummary(filter.filterName(), FAILED.name(), execTimeMs);<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>case SUCCESS:<NEW_LINE>if (logger.isDebugEnabled()) {<NEW_LINE>zuulCtx.addFilterExecutionSummary(filter.filterName(), SUCCESS.name(), execTimeMs);<NEW_LINE>}<NEW_LINE>if (startSnapshot != null) {<NEW_LINE>// debugRouting == true<NEW_LINE>Debug.addRoutingDebug(zuulCtx, "Filter {" + filter.filterName() + " TYPE:" + filter.filterType().toString() + " ORDER:" + filter.filterOrder() + "} Execution time = " + execTimeMs + "ms");<NEW_LINE>Debug.compareContextState(filter.filterName(), zuulCtx, startSnapshot.getContext());<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>logger.debug("Filter {} completed with status {}, UUID {}", filter.filterName(), status.name(), zuulMesg.getContext().getUUID());<NEW_LINE>// Notify configured listener.<NEW_LINE>usageNotifier.notify(filter, status);<NEW_LINE>} | record(execTimeMs, TimeUnit.MILLISECONDS); |
999,444 | public static ListConversationsResponse unmarshall(ListConversationsResponse listConversationsResponse, UnmarshallerContext _ctx) {<NEW_LINE>listConversationsResponse.setRequestId(_ctx.stringValue("ListConversationsResponse.RequestId"));<NEW_LINE>listConversationsResponse.setTotalCount(_ctx.longValue("ListConversationsResponse.TotalCount"));<NEW_LINE>listConversationsResponse.setPageSize(_ctx.integerValue("ListConversationsResponse.PageSize"));<NEW_LINE>listConversationsResponse.setPageNumber<MASK><NEW_LINE>List<Conversation> conversations = new ArrayList<Conversation>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("ListConversationsResponse.Conversations.Length"); i++) {<NEW_LINE>Conversation conversation = new Conversation();<NEW_LINE>conversation.setEndTime(_ctx.longValue("ListConversationsResponse.Conversations[" + i + "].EndTime"));<NEW_LINE>conversation.setHasToAgent(_ctx.booleanValue("ListConversationsResponse.Conversations[" + i + "].HasToAgent"));<NEW_LINE>conversation.setStartTime(_ctx.longValue("ListConversationsResponse.Conversations[" + i + "].StartTime"));<NEW_LINE>conversation.setSkillGroup(_ctx.stringValue("ListConversationsResponse.Conversations[" + i + "].SkillGroup"));<NEW_LINE>conversation.setConversationId(_ctx.stringValue("ListConversationsResponse.Conversations[" + i + "].ConversationId"));<NEW_LINE>conversation.setCallingNumber(_ctx.stringValue("ListConversationsResponse.Conversations[" + i + "].CallingNumber"));<NEW_LINE>conversation.setEndReason(_ctx.integerValue("ListConversationsResponse.Conversations[" + i + "].EndReason"));<NEW_LINE>conversation.setRounds(_ctx.integerValue("ListConversationsResponse.Conversations[" + i + "].Rounds"));<NEW_LINE>conversation.setHasLastPlaybackCompleted(_ctx.booleanValue("ListConversationsResponse.Conversations[" + i + "].HasLastPlaybackCompleted"));<NEW_LINE>conversation.setSandBox(_ctx.booleanValue("ListConversationsResponse.Conversations[" + i + "].SandBox"));<NEW_LINE>conversations.add(conversation);<NEW_LINE>}<NEW_LINE>listConversationsResponse.setConversations(conversations);<NEW_LINE>return listConversationsResponse;<NEW_LINE>} | (_ctx.integerValue("ListConversationsResponse.PageNumber")); |
331,907 | private ImmutableMap<String, Object> convertSelects(Cell cell, UnconfiguredBuildTarget target, RuleDescriptor<?> descriptor, Map<String, Object> attrs, CellRelativePath pathRelativeToProjectRoot, DependencyStack dependencyStack) {<NEW_LINE>ImmutableMap.Builder<String, Object> result = ImmutableMap.builder();<NEW_LINE>DataTransferObjectDescriptor<?> constructorDescriptor = descriptor.dataTransferObjectDescriptor(typeCoercerFactory);<NEW_LINE>for (Map.Entry<String, Object> attr : attrs.entrySet()) {<NEW_LINE>if (attr.getKey().startsWith("buck.") || attr.getKey().equals(VisibilityAttributes.VISIBILITY) || attr.getKey().equals(VisibilityAttributes.WITHIN_VIEW)) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>ParamInfo<?> paramInfo = constructorDescriptor.getParamInfos().get(attr.getKey());<NEW_LINE>Preconditions.checkNotNull(paramInfo, "attr %s", attr.getKey());<NEW_LINE>result.put(attr.getKey(), convertSelectorListInAttrValue(cell, target, paramInfo, attr.getKey(), attr.getValue<MASK><NEW_LINE>}<NEW_LINE>return result.build();<NEW_LINE>} | (), pathRelativeToProjectRoot, dependencyStack)); |
372,112 | public StaticWorkload putStaticWorkload(String domainName, String serviceName, StaticWorkload staticWorkload) {<NEW_LINE>WebTarget target = base.path("/domain/{domainName}/service/{serviceName}/workload/static").resolveTemplate("domainName", domainName<MASK><NEW_LINE>Invocation.Builder invocationBuilder = target.request("application/json");<NEW_LINE>if (credsHeader != null) {<NEW_LINE>invocationBuilder = credsHeader.startsWith("Cookie.") ? invocationBuilder.cookie(credsHeader.substring(7), credsToken) : invocationBuilder.header(credsHeader, credsToken);<NEW_LINE>}<NEW_LINE>Response response = invocationBuilder.put(javax.ws.rs.client.Entity.entity(staticWorkload, "application/json"));<NEW_LINE>int code = response.getStatus();<NEW_LINE>switch(code) {<NEW_LINE>case 204:<NEW_LINE>return null;<NEW_LINE>default:<NEW_LINE>throw new ResourceException(code, response.readEntity(ResourceError.class));<NEW_LINE>}<NEW_LINE>} | ).resolveTemplate("serviceName", serviceName); |
1,852,357 | protected Result generateContent(int id, ByteBuffer content, boolean recycle, boolean lastContent, Callback callback, FCGI.FrameType frameType) {<NEW_LINE>id &= 0xFF_FF;<NEW_LINE>int contentLength = content == null ? 0 : content.remaining();<NEW_LINE>Result result = new Result(byteBufferPool, callback);<NEW_LINE>while (contentLength > 0 || lastContent) {<NEW_LINE>ByteBuffer buffer = acquire(8);<NEW_LINE>BufferUtil.clearToFill(buffer);<NEW_LINE>result = result.append(buffer, true);<NEW_LINE>// Generate the frame header<NEW_LINE>buffer.put((byte) 0x01);<NEW_LINE>buffer.put((byte) frameType.code);<NEW_LINE>buffer.putShort((short) id);<NEW_LINE>int length = <MASK><NEW_LINE>buffer.putShort((short) length);<NEW_LINE>buffer.putShort((short) 0);<NEW_LINE>BufferUtil.flipToFlush(buffer, 0);<NEW_LINE>if (contentLength == 0)<NEW_LINE>break;<NEW_LINE>// Slice the content to avoid copying<NEW_LINE>int limit = content.limit();<NEW_LINE>content.limit(content.position() + length);<NEW_LINE>ByteBuffer slice = content.slice();<NEW_LINE>// Don't recycle the slice<NEW_LINE>result = result.append(slice, false);<NEW_LINE>content.position(content.limit());<NEW_LINE>content.limit(limit);<NEW_LINE>contentLength -= length;<NEW_LINE>// Recycle the content buffer if needed<NEW_LINE>if (recycle && contentLength == 0)<NEW_LINE>result = result.append(content, true);<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>} | Math.min(MAX_CONTENT_LENGTH, contentLength); |
1,247,722 | public EstimatedResourceSize unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>EstimatedResourceSize estimatedResourceSize = new EstimatedResourceSize();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE><MASK><NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>if (context.testExpression("estimatedSizeInBytes", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>estimatedResourceSize.setEstimatedSizeInBytes(context.getUnmarshaller(Double.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("estimatedOn", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>estimatedResourceSize.setEstimatedOn(DateJsonUnmarshallerFactory.getInstance("unixTimestamp").unmarshall(context));<NEW_LINE>}<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return estimatedResourceSize;<NEW_LINE>} | String currentParentElement = context.getCurrentParentElement(); |
867,881 | public void dumpReplayData(PrintStream out) {<NEW_LINE>out.println("JvmtiExport can_access_local_variables " + (JvmtiExport.canAccessLocalVariables() ? '1' : '0'));<NEW_LINE>out.println("JvmtiExport can_hotswap_or_post_breakpoint " + (JvmtiExport.canHotswapOrPostBreakpoint() ? '1' : '0'));<NEW_LINE>out.println("JvmtiExport can_post_on_exceptions " + (JvmtiExport.canPostOnExceptions() ? '1' : '0'));<NEW_LINE>GrowableArray<ciMetadata> objects <MASK><NEW_LINE>out.println("# " + objects.length() + " ciObject found");<NEW_LINE>for (int i = 0; i < objects.length(); i++) {<NEW_LINE>ciMetadata o = objects.at(i);<NEW_LINE>out.println("# ciMetadata" + i + " @ " + o);<NEW_LINE>o.dumpReplayData(out);<NEW_LINE>}<NEW_LINE>CompileTask task = task();<NEW_LINE>Method method = task.method();<NEW_LINE>int entryBci = task.osrBci();<NEW_LINE>int compLevel = task.compLevel();<NEW_LINE>Klass holder = method.getMethodHolder();<NEW_LINE>out.print("compile " + holder.getName().asString() + " " + OopUtilities.escapeString(method.getName().asString()) + " " + method.getSignature().asString() + " " + entryBci + " " + compLevel);<NEW_LINE>Compile compiler = compilerData();<NEW_LINE>if (compiler != null) {<NEW_LINE>// Dump inlining data.<NEW_LINE>compiler.dumpInlineData(out);<NEW_LINE>}<NEW_LINE>out.println();<NEW_LINE>} | = factory().objects(); |
770,407 | public static void main(String... args) throws Exception {<NEW_LINE>ModelMapper modelMapper = new ModelMapper();<NEW_LINE>modelMapper.getConfiguration().setFieldMatchingEnabled(true).setFieldAccessLevel(AccessLevel.PACKAGE_PRIVATE);<NEW_LINE>modelMapper.addMappings(new PropertyMap<Customer, CustomerDTO>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>protected void configure() {<NEW_LINE>using(new PaymentInfoConverter(true)).map(source.getInfo<MASK><NEW_LINE>using(new PaymentInfoConverter(false)).map(source.getInfo()).setShippingInfo(null);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>PaymentInfo info1 = new PaymentInfo(1, "Billing");<NEW_LINE>PaymentInfo info2 = new PaymentInfo(2, "Shipping");<NEW_LINE>PaymentInfo info3 = new PaymentInfo(3, "Billing");<NEW_LINE>PaymentInfo info4 = new PaymentInfo(4, "Shipping");<NEW_LINE>Customer customer = new Customer();<NEW_LINE>customer.info = Arrays.asList(info1, info2, info3, info4);<NEW_LINE>CustomerDTO dto = modelMapper.map(customer, CustomerDTO.class);<NEW_LINE>assertEquals(dto.billingInfo.get(0).id, 1);<NEW_LINE>assertEquals(dto.billingInfo.get(1).id, 3);<NEW_LINE>assertEquals(dto.shippingInfo.get(0).id, 2);<NEW_LINE>assertEquals(dto.shippingInfo.get(1).id, 4);<NEW_LINE>} | ()).setBillingInfo(null); |
1,375,374 | protected List checkConsistency(File dir) throws ShareException {<NEW_LINE>List kids = new ArrayList();<NEW_LINE>File[<MASK><NEW_LINE>if (files == null || !dir.exists()) {<NEW_LINE>// dir has been deleted<NEW_LINE>if (!isPersistent()) {<NEW_LINE>// actually, this can be bad as some os errors (e.g. "too many open files") can cause the dir<NEW_LINE>// to appear to have been deleted. However, we don't want to delete the share. So let's just<NEW_LINE>// leave it around, manual delete required if deletion required.<NEW_LINE>if (dir == root) {<NEW_LINE>return (null);<NEW_LINE>} else {<NEW_LINE>manager.delete(this, true);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>for (int i = 0; i < files.length; i++) {<NEW_LINE>File file = files[i];<NEW_LINE>String file_name = file.getName();<NEW_LINE>if (!(file_name.equals(".") || file_name.equals(".."))) {<NEW_LINE>if (file.isDirectory()) {<NEW_LINE>if (recursive) {<NEW_LINE>List child = checkConsistency(file);<NEW_LINE>kids.add(new shareNode(this, file, child));<NEW_LINE>} else {<NEW_LINE>try {<NEW_LINE>ShareResource res = manager.getDir(file);<NEW_LINE>if (res == null) {<NEW_LINE>res = manager.addDir(this, file, personal_key != null, properties);<NEW_LINE>}<NEW_LINE>kids.add(res);<NEW_LINE>} catch (Throwable e) {<NEW_LINE>Debug.printStackTrace(e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>try {<NEW_LINE>ShareResource res = manager.getFile(file);<NEW_LINE>if (res == null) {<NEW_LINE>res = manager.addFile(this, file, personal_key != null, properties);<NEW_LINE>}<NEW_LINE>kids.add(res);<NEW_LINE>} catch (Throwable e) {<NEW_LINE>Debug.printStackTrace(e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>for (int i = 0; i < kids.size(); i++) {<NEW_LINE>Object o = kids.get(i);<NEW_LINE>if (o instanceof ShareResourceImpl) {<NEW_LINE>((ShareResourceImpl) o).setParent(this);<NEW_LINE>} else {<NEW_LINE>((shareNode) o).setParent(this);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return (kids);<NEW_LINE>} | ] files = dir.listFiles(); |
661,397 | public static <T, F, R1, R2, R3, R4> Eval<R4> forEach(Eval<T> eval, Function<? super T, ? extends Eval<R1>> value2, Function<? super Tuple2<? super T, ? super R1>, ? extends Eval<R2>> value3, Function<? super Tuple3<? super T, ? super R1, ? super R2>, ? extends Eval<R3>> value4, Function<? super Tuple4<? super T, ? super R1, ? super R2, ? super R3>, ? extends Eval<R4>> value5) {<NEW_LINE>return eval.flatMap(in -> {<NEW_LINE>Eval<R1> a = value2.apply(in);<NEW_LINE>return a.flatMap(ina -> {<NEW_LINE>Eval<R2> b = value3.apply(Tuple<MASK><NEW_LINE>return b.flatMap(inb -> {<NEW_LINE>Eval<R3> c = value4.apply(Tuple.tuple(in, ina, inb));<NEW_LINE>return c.flatMap(inc -> {<NEW_LINE>Eval<R4> d = value5.apply(Tuple.tuple(in, ina, inb, inc));<NEW_LINE>return d;<NEW_LINE>});<NEW_LINE>});<NEW_LINE>});<NEW_LINE>});<NEW_LINE>} | .tuple(in, ina)); |
49,022 | final ListDataSourcesResult executeListDataSources(ListDataSourcesRequest listDataSourcesRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(listDataSourcesRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<ListDataSourcesRequest> request = null;<NEW_LINE>Response<ListDataSourcesResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new ListDataSourcesRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(listDataSourcesRequest));<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, "AppSync");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ListDataSources");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<ListDataSourcesResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new ListDataSourcesResultJsonUnmarshaller());<NEW_LINE>response = <MASK><NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | invoke(request, responseHandler, executionContext); |
1,162,625 | public List<Writable> transformRawStringsToInputList(List<String> values) {<NEW_LINE>List<Writable> <MASK><NEW_LINE>if (values.size() != initialSchema.numColumns())<NEW_LINE>throw new IllegalArgumentException(String.format("Number of values %d does not match the number of input columns %d for schema", values.size(), initialSchema.numColumns()));<NEW_LINE>for (int i = 0; i < values.size(); i++) {<NEW_LINE>switch(initialSchema.getType(i)) {<NEW_LINE>case String:<NEW_LINE>ret.add(new Text(values.get(i)));<NEW_LINE>break;<NEW_LINE>case Integer:<NEW_LINE>ret.add(new IntWritable(Integer.parseInt(values.get(i))));<NEW_LINE>break;<NEW_LINE>case Double:<NEW_LINE>ret.add(new DoubleWritable(Double.parseDouble(values.get(i))));<NEW_LINE>break;<NEW_LINE>case Float:<NEW_LINE>ret.add(new FloatWritable(Float.parseFloat(values.get(i))));<NEW_LINE>break;<NEW_LINE>case Categorical:<NEW_LINE>ret.add(new Text(values.get(i)));<NEW_LINE>break;<NEW_LINE>case Boolean:<NEW_LINE>ret.add(new BooleanWritable(Boolean.parseBoolean(values.get(i))));<NEW_LINE>break;<NEW_LINE>case Time:<NEW_LINE>break;<NEW_LINE>case Long:<NEW_LINE>ret.add(new LongWritable(Long.parseLong(values.get(i))));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return ret;<NEW_LINE>} | ret = new ArrayList<>(); |
1,627,318 | public void text(String $value) throws SAXException {<NEW_LINE>int $ai;<NEW_LINE>switch($_ngcc_current_state) {<NEW_LINE>case 4:<NEW_LINE>{<NEW_LINE>xpath = $value;<NEW_LINE>$_ngcc_current_state = 3;<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>case 0:<NEW_LINE>{<NEW_LINE>revertToParentFromText(makeResult(), super._cookie, $value);<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>case 6:<NEW_LINE>{<NEW_LINE>if (($ai = $runtime.getAttributeIndex("", "xpath")) >= 0) {<NEW_LINE>NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 77, null);<NEW_LINE>spawnChildFromText(h, $value);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>case 1:<NEW_LINE>{<NEW_LINE>$_ngcc_current_state = 0;<NEW_LINE>$runtime.sendText(super._cookie, $value);<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>case 5:<NEW_LINE>{<NEW_LINE>if (($ai = $runtime.getAttributeIndex("", "xpath")) >= 0) {<NEW_LINE>$runtime.consumeAttribute($ai);<NEW_LINE>$runtime.<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>} | sendText(super._cookie, $value); |
1,659,117 | public void initSubDevices() {<NEW_LINE>ModelFactory factory = ModelFactory.eINSTANCE;<NEW_LINE>IndustrialDualAnalogInChannel channel0 = factory.createIndustrialDualAnalogInChannel();<NEW_LINE>channel0.setChannelNum((short) 0);<NEW_LINE>channel0.setUid(getUid());<NEW_LINE>String subIdChannel0 = "channel0";<NEW_LINE>logger.debug(<MASK><NEW_LINE>channel0.setSubId(subIdChannel0);<NEW_LINE>channel0.init();<NEW_LINE>channel0.setMbrick(this);<NEW_LINE>IndustrialDualAnalogInChannel channel1 = factory.createIndustrialDualAnalogInChannel();<NEW_LINE>channel1.setChannelNum((short) 1);<NEW_LINE>channel1.setUid(getUid());<NEW_LINE>String subIdChannel1 = "channel1";<NEW_LINE>logger.debug("{} addSubDevice {}", LoggerConstants.TFINIT, subIdChannel1);<NEW_LINE>channel1.setSubId(subIdChannel1);<NEW_LINE>channel1.init();<NEW_LINE>channel1.setMbrick(this);<NEW_LINE>} | "{} addSubDevice {}", LoggerConstants.TFINIT, subIdChannel0); |
141,870 | // /// ************** ALL METHODS HERE *************************** ////////<NEW_LINE>private void _viewWorkflowTask(ActionRequest req, ActionResponse res, PortletConfig config, ActionForm form, User user) throws Exception {<NEW_LINE>WorkflowTask task = (WorkflowTask) <MASK><NEW_LINE>WorkflowTaskForm taskform = (WorkflowTaskForm) form;<NEW_LINE>BeanUtils.copyProperties(taskform, task);<NEW_LINE>if (task.getDueDate() != null) {<NEW_LINE>Calendar cal = GregorianCalendar.getInstance();<NEW_LINE>cal.setTime(task.getDueDate());<NEW_LINE>taskform.setDueDateDay(String.valueOf(cal.get(Calendar.DATE)));<NEW_LINE>taskform.setDueDateMonth(String.valueOf(cal.get(Calendar.MONTH)));<NEW_LINE>taskform.setDueDateYear(String.valueOf(cal.get(Calendar.YEAR)));<NEW_LINE>}<NEW_LINE>} | req.getAttribute(WebKeys.WORKFLOW_TASK_EDIT); |
1,793,353 | private void showImportProgressLayout(boolean askFolder, boolean isExternal) {<NEW_LINE>// Replace launch options layout with import progress layout<NEW_LINE>rootView.removeAllViews();<NEW_LINE>LayoutInflater.from(getActivity()).inflate(R.layout.include_import_steps, rootView, true);<NEW_LINE>// Memorize UI elements that will be updated during the import events<NEW_LINE>TextView step1Txt = rootView.findViewById(R.id.import_step1_text);<NEW_LINE>step1FolderButton = rootView.findViewById(R.id.import_step1_button);<NEW_LINE>step2Txt = rootView.findViewById(R.id.import_step2_text);<NEW_LINE>step2progress = rootView.findViewById(R.id.import_step2_bar);<NEW_LINE>step2check = rootView.findViewById(R.id.import_step2_check);<NEW_LINE>step3block = rootView.findViewById(R.id.import_step3);<NEW_LINE>step3progress = rootView.findViewById(R.id.import_step3_bar);<NEW_LINE>step3Txt = rootView.findViewById(R.id.import_step3_text);<NEW_LINE>step3check = rootView.findViewById(R.id.import_step3_check);<NEW_LINE>step4block = rootView.findViewById(R.id.import_step4);<NEW_LINE>step4progress = rootView.findViewById(R.id.import_step4_bar);<NEW_LINE>step4check = rootView.findViewById(R.id.import_step4_check);<NEW_LINE>if (isExternal) {<NEW_LINE>step1FolderButton.setText(R.string.api29_migration_step1_select_external);<NEW_LINE>step1Txt.setText(R.string.api29_migration_step1_external);<NEW_LINE>} else {<NEW_LINE>step1FolderButton.setText(R.string.api29_migration_step1_select);<NEW_LINE>step1Txt.setText(R.string.api29_migration_step1);<NEW_LINE>}<NEW_LINE>if (askFolder) {<NEW_LINE>step1FolderButton.setVisibility(View.VISIBLE);<NEW_LINE>step1FolderButton.setOnClickListener(v -> pickFolder.launch(0));<NEW_LINE>// Ask right away, there's no reason why the user should click again<NEW_LINE>pickFolder.launch(0);<NEW_LINE>} else {<NEW_LINE>((TextView) rootView.findViewById(R.id.import_step1_folder)).setText(FileHelper.getFullPathFromTreeUri(requireContext(), Uri.parse(<MASK><NEW_LINE>rootView.findViewById(R.id.import_step1_check).setVisibility(View.VISIBLE);<NEW_LINE>rootView.findViewById(R.id.import_step2).setVisibility(View.VISIBLE);<NEW_LINE>step2progress.setIndeterminate(true);<NEW_LINE>}<NEW_LINE>} | Preferences.getStorageUri()))); |
1,496,668 | public void loadModel(List<Row> modelRows) {<NEW_LINE>IForestModel model = new IForestModelDataConverter().load(modelRows);<NEW_LINE>iForestPredictor = new IForestPredict();<NEW_LINE>iForestPredictor.loadModel(new IForestModelDataConverter().load(modelRows));<NEW_LINE>if (model.meta.contains(WithMultiVarParams.VECTOR_COL)) {<NEW_LINE>final int vectorIndex = TableUtil.findColIndexWithAssertAndHint(getDataSchema(), model.meta.get(WithMultiVarParams.VECTOR_COL));<NEW_LINE>final int maxVectorSize = model.meta.get(OutlierUtil.MAX_VECTOR_SIZE);<NEW_LINE>numericalTypeCastMapper = null;<NEW_LINE>expandToRow = new Function<Row, Row>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public Row apply(Row row) {<NEW_LINE>return OutlierUtil.vectorToRow((Vector) row.getField(vectorIndex), maxVectorSize);<NEW_LINE>}<NEW_LINE>};<NEW_LINE>} else {<NEW_LINE>final int[] indices = TableUtil.findColIndicesWithAssertAndHint(getDataSchema(), model.meta.get(WithMultiVarParams.FEATURE_COLS));<NEW_LINE>numericalTypeCastMapper = new NumericalTypeCastMapper(getDataSchema(), new Params().set(NumericalTypeCastParams.SELECTED_COLS, model.meta.get(WithMultiVarParams.FEATURE_COLS)).set(NumericalTypeCastParams<MASK><NEW_LINE>expandToRow = new Function<Row, Row>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public Row apply(Row row) {<NEW_LINE>return Row.project(row, indices);<NEW_LINE>}<NEW_LINE>};<NEW_LINE>}<NEW_LINE>} | .TARGET_TYPE, TargetType.DOUBLE)); |
1,364,502 | public void onDestroy() {<NEW_LINE>destroyed = true;<NEW_LINE>NotificationCenter.getInstance(currentAccount).removeObserver(this, NotificationCenter.recordStarted);<NEW_LINE>NotificationCenter.getInstance(currentAccount).removeObserver(this, NotificationCenter.recordStartError);<NEW_LINE>NotificationCenter.getInstance(currentAccount).removeObserver(this, NotificationCenter.recordStopped);<NEW_LINE>NotificationCenter.getInstance(currentAccount).removeObserver(this, NotificationCenter.recordProgressChanged);<NEW_LINE>NotificationCenter.getInstance(currentAccount).removeObserver(this, NotificationCenter.closeChats);<NEW_LINE>NotificationCenter.getInstance(currentAccount).removeObserver(this, NotificationCenter.audioDidSent);<NEW_LINE>NotificationCenter.getInstance(currentAccount).removeObserver(this, NotificationCenter.beforeAudioDidSent);<NEW_LINE>NotificationCenter.getInstance(currentAccount).removeObserver(this, NotificationCenter.audioRouteChanged);<NEW_LINE>NotificationCenter.getInstance(currentAccount).removeObserver(this, NotificationCenter.messagePlayingDidReset);<NEW_LINE>NotificationCenter.getInstance(currentAccount).removeObserver(this, NotificationCenter.messagePlayingProgressDidChanged);<NEW_LINE>NotificationCenter.getInstance(currentAccount).removeObserver(this, NotificationCenter.featuredStickersDidLoad);<NEW_LINE>NotificationCenter.getInstance(currentAccount).removeObserver(this, NotificationCenter.messageReceivedByServer);<NEW_LINE>NotificationCenter.getInstance(currentAccount).removeObserver(this, NotificationCenter.sendingMessagesChanged);<NEW_LINE>NotificationCenter.getInstance(currentAccount).removeObserver(this, NotificationCenter.audioRecordTooShort);<NEW_LINE>NotificationCenter.getGlobalInstance().<MASK><NEW_LINE>if (emojiView != null) {<NEW_LINE>emojiView.onDestroy();<NEW_LINE>}<NEW_LINE>if (updateSlowModeRunnable != null) {<NEW_LINE>AndroidUtilities.cancelRunOnUIThread(updateSlowModeRunnable);<NEW_LINE>updateSlowModeRunnable = null;<NEW_LINE>}<NEW_LINE>if (wakeLock != null) {<NEW_LINE>try {<NEW_LINE>wakeLock.release();<NEW_LINE>wakeLock = null;<NEW_LINE>} catch (Exception e) {<NEW_LINE>FileLog.e(e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (sizeNotifierLayout != null) {<NEW_LINE>sizeNotifierLayout.setDelegate(null);<NEW_LINE>}<NEW_LINE>if (senderSelectPopupWindow != null) {<NEW_LINE>senderSelectPopupWindow.setPauseNotifications(false);<NEW_LINE>senderSelectPopupWindow.dismiss();<NEW_LINE>}<NEW_LINE>} | removeObserver(this, NotificationCenter.emojiLoaded); |
514,918 | private Mono<Response<Flux<ByteBuffer>>> deleteWithResponseAsync(String resourceGroupName, String workspaceName) {<NEW_LINE>if (this.client.getEndpoint() == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (this.client.getSubscriptionId() == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (resourceGroupName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (workspaceName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null."));<NEW_LINE>}<NEW_LINE>final String accept = "application/json";<NEW_LINE>return FluxUtil.withContext(context -> service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, workspaceName, this.client.getApiVersion(), accept, context)).contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext(<MASK><NEW_LINE>} | )).readOnly())); |
1,534,155 | protected ErlangVisitor buildErlangVisitor(@NotNull final ProblemsHolder holder, @NotNull LocalInspectionToolSession session) {<NEW_LINE>return new ErlangVisitor() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void visitExportFunction(@NotNull ErlangExportFunction o) {<NEW_LINE>PsiReference reference = o.getReference();<NEW_LINE>if (reference.resolve() != null)<NEW_LINE>return;<NEW_LINE>int arity = ErlangPsiImplUtil.<MASK><NEW_LINE>ErlangAtom atom = o.getQAtom().getAtom();<NEW_LINE>if (arity < 0 || atom == null)<NEW_LINE>return;<NEW_LINE>String name = atom.getName();<NEW_LINE>String functionPresentation = ErlangPsiImplUtil.createFunctionPresentation(name, arity);<NEW_LINE>String fixMessage = "Create Function " + functionPresentation;<NEW_LINE>registerProblem(holder, o, "Unresolved function " + functionPresentation, new ErlangCreateFunctionQuickFix(fixMessage, name, arity));<NEW_LINE>}<NEW_LINE>};<NEW_LINE>} | getArity(o.getInteger()); |
727,619 | public final void handleReversalForInvoice(final org.compiere.model.I_C_Invoice invoice) {<NEW_LINE>final IInvoiceDAO invoiceDAO = Services.get(IInvoiceDAO.class);<NEW_LINE>final int reversalInvoiceId = invoice.getReversal_ID();<NEW_LINE>Check.assume(reversalInvoiceId > invoice.getC_Invoice_ID(), "Invoice {} shall be the original invoice and not it's reversal", invoice);<NEW_LINE>final org.compiere.model.I_C_Invoice reversalInvoice = invoice.getReversal();<NEW_LINE>// services<NEW_LINE>final IMatchInvBL matchInvBL = <MASK><NEW_LINE>final IMatchInvDAO matchInvDAO = Services.get(IMatchInvDAO.class);<NEW_LINE>final IAttributeSetInstanceBL attributeSetInstanceBL = Services.get(IAttributeSetInstanceBL.class);<NEW_LINE>for (final I_C_InvoiceLine il : invoiceDAO.retrieveLines(invoice)) {<NEW_LINE>// task 08627: unlink possible inOutLines because the inOut might now be reactivated and they might be deleted.<NEW_LINE>// Unlinking them now is more performant than selecting an unlinking them when the inOutLine is actually deleted.<NEW_LINE>il.setM_InOutLine(null);<NEW_LINE>InterfaceWrapperHelper.save(il);<NEW_LINE>//<NEW_LINE>// Retrieve the reversal invoice line<NEW_LINE>final I_C_InvoiceLine reversalLine = invoiceDAO.retrieveReversalLine(il, reversalInvoiceId);<NEW_LINE>// 08809<NEW_LINE>// Also set the Attribute Set Instance in the reversal line<NEW_LINE>attributeSetInstanceBL.cloneASI(reversalLine, il);<NEW_LINE>InterfaceWrapperHelper.save(reversalLine);<NEW_LINE>//<NEW_LINE>// Create M_MatchInv reversal records, linked to reversal invoice line and original inout line.<NEW_LINE>final List<I_M_MatchInv> matchInvs = matchInvDAO.retrieveForInvoiceLine(il);<NEW_LINE>for (final I_M_MatchInv matchInv : matchInvs) {<NEW_LINE>final I_M_InOutLine inoutLine = matchInv.getM_InOutLine();<NEW_LINE>final StockQtyAndUOMQty qtyToMatchExact = StockQtyAndUOMQtys.create(matchInv.getQty().negate(), ProductId.ofRepoId(inoutLine.getM_Product_ID()), matchInv.getQtyInUOM().negate(), UomId.ofRepoId(matchInv.getC_UOM_ID()));<NEW_LINE>matchInvBL.createMatchInvBuilder().setContext(reversalLine).setC_InvoiceLine(reversalLine).setM_InOutLine(inoutLine).setDateTrx(reversalInvoice.getDateInvoiced()).setQtyToMatchExact(qtyToMatchExact).build();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | Services.get(IMatchInvBL.class); |
712,540 | private void init() {<NEW_LINE>jButtonVlcPfad.setIcon(IconFontSwing.buildIcon(FontAwesome.FOLDER_OPEN_O, 16));<NEW_LINE>jButtonFFmpegPfad.setIcon(IconFontSwing.buildIcon(FontAwesome.FOLDER_OPEN_O, 16));<NEW_LINE>jButtonHilfe.setIcon(IconFontSwing.buildIcon(FontAwesome.QUESTION_CIRCLE_O, 16));<NEW_LINE>jPanelVlc.setVisible(vlc);<NEW_LINE>jPanelFFmpeg.setVisible(ffmpeg);<NEW_LINE>if (MVConfig.get(MVConfig.Configs.SYSTEM_PFAD_VLC).isEmpty()) {<NEW_LINE>MVConfig.add(MVConfig.Configs.SYSTEM_PFAD_VLC, GuiFunktionenProgramme.getMusterPfadVlc());<NEW_LINE>}<NEW_LINE>if (MVConfig.get(MVConfig.Configs.SYSTEM_PFAD_FFMPEG).isEmpty()) {<NEW_LINE>MVConfig.add(MVConfig.Configs.<MASK><NEW_LINE>}<NEW_LINE>jTextFieldVlc.setText(MVConfig.get(MVConfig.Configs.SYSTEM_PFAD_VLC));<NEW_LINE>jTextFieldFFmpeg.setText(MVConfig.get(MVConfig.Configs.SYSTEM_PFAD_FFMPEG));<NEW_LINE>} | SYSTEM_PFAD_FFMPEG, GuiFunktionenProgramme.getMusterPfadFFmpeg()); |
1,835,994 | private int insertNodeBetween(int index, int nextIndex, long node) {<NEW_LINE>assert (previousIndexFromNode(node) == 0);<NEW_LINE>assert (nextIndexFromNode(node) == 0);<NEW_LINE>assert (nextIndexFromNode(nodes.elementAti(index)) == nextIndex);<NEW_LINE>// Append the new node and link it to the existing nodes.<NEW_LINE>int newIndex = nodes.size();<NEW_LINE>node |= nodeFromPreviousIndex<MASK><NEW_LINE>nodes.addElement(node);<NEW_LINE>// nodes[index].nextIndex = newIndex<NEW_LINE>node = nodes.elementAti(index);<NEW_LINE>nodes.setElementAt(changeNodeNextIndex(node, newIndex), index);<NEW_LINE>// nodes[nextIndex].previousIndex = newIndex<NEW_LINE>if (nextIndex != 0) {<NEW_LINE>node = nodes.elementAti(nextIndex);<NEW_LINE>nodes.setElementAt(changeNodePreviousIndex(node, newIndex), nextIndex);<NEW_LINE>}<NEW_LINE>return newIndex;<NEW_LINE>} | (index) | nodeFromNextIndex(nextIndex); |
765,093 | public List<UserIdentity> discoverMatchingUsers(final SessionLabel sessionLabel, final PwmDomain pwmDomain, final int maxResultSize, final StoredConfiguration storedConfiguration, final StoredConfigKey key) throws Exception {<NEW_LINE>final AppConfig config = new AppConfig(storedConfiguration);<NEW_LINE>final PwmApplication tempApplication = PwmApplication.createPwmApplication(pwmDomain.getPwmApplication().getPwmEnvironment().makeRuntimeInstance(config));<NEW_LINE>final StoredValue storedValue = StoredConfigurationUtil.getValueOrDefault(storedConfiguration, key);<NEW_LINE>final List<UserPermission> <MASK><NEW_LINE>final PwmDomain tempDomain = tempApplication.domains().get(key.getDomainID());<NEW_LINE>validateUserPermissionLdapValues(sessionLabel, tempDomain, permissions);<NEW_LINE>final long maxSearchSeconds = pwmDomain.getConfig().getDefaultLdapProfile().readSettingAsLong(PwmSetting.LDAP_SEARCH_TIMEOUT);<NEW_LINE>final TimeDuration maxSearchTime = TimeDuration.of(maxSearchSeconds, TimeDuration.Unit.SECONDS);<NEW_LINE>final Iterator<UserIdentity> matches = UserPermissionUtility.discoverMatchingUsers(tempDomain, permissions, SessionLabel.SYSTEM_LABEL, maxResultSize, maxSearchTime);<NEW_LINE>final List<UserIdentity> sortedResults = new ArrayList<>(CollectionUtil.iteratorToList(matches));<NEW_LINE>Collections.sort(sortedResults);<NEW_LINE>return Collections.unmodifiableList(sortedResults);<NEW_LINE>} | permissions = ValueTypeConverter.valueToUserPermissions(storedValue); |
686,017 | public void insertPath(int pathIndex, Point2D[] points, int pointsOffset, int count, boolean bForward) {<NEW_LINE>int oldPathCount = getPathCount();<NEW_LINE>if (pathIndex > oldPathCount)<NEW_LINE>throw new IllegalArgumentException();<NEW_LINE>if (pathIndex < 0)<NEW_LINE>pathIndex = oldPathCount;<NEW_LINE>m_bPathStarted = false;<NEW_LINE>int oldPointCount = m_pointCount;<NEW_LINE>// Copy all attribute values.<NEW_LINE>if (points != null) {<NEW_LINE>_resizeImpl(m_pointCount + count);<NEW_LINE>_verifyAllStreams();<NEW_LINE>int pathStart = pathIndex < oldPathCount ? getPathStart(pathIndex) : oldPointCount;<NEW_LINE>for (int iattr = 0, nattr = m_description.getAttributeCount(); iattr < nattr; iattr++) {<NEW_LINE>int semantics = m_description._getSemanticsImpl(iattr);<NEW_LINE>if (semantics == VertexDescription.Semantics.POSITION) {<NEW_LINE>// copy range to make place for new vertices<NEW_LINE>m_vertexAttributes[iattr].writeRange(2 * (pathStart + count), 2 * (oldPointCount - pathIndex), m_vertexAttributes[iattr], 2 * pathStart, true, 2);<NEW_LINE>AttributeStreamOfDbl position = (AttributeStreamOfDbl<MASK><NEW_LINE>int j = pathStart;<NEW_LINE>for (int i = 0; i < count; i++, j++) {<NEW_LINE>int index = (bForward ? pointsOffset + i : pointsOffset + count - i - 1);<NEW_LINE>position.write(2 * j, points[index].x);<NEW_LINE>position.write(2 * j + 1, points[index].y);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>// Need to make room for the attributes, so we copy default<NEW_LINE>// values in<NEW_LINE>int comp = VertexDescription.getComponentCount(semantics);<NEW_LINE>double v = VertexDescription.getDefaultValue(semantics);<NEW_LINE>m_vertexAttributes[iattr].insertRange(pathStart * comp, v, comp * count, comp * oldPointCount);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>_verifyAllStreams();<NEW_LINE>}<NEW_LINE>m_paths.add(m_pointCount);<NEW_LINE>for (int ipath = oldPathCount; ipath >= pathIndex + 1; ipath--) {<NEW_LINE>int iend = m_paths.read(ipath - 1);<NEW_LINE>m_paths.write(ipath, iend + count);<NEW_LINE>}<NEW_LINE>m_pathFlags.add((byte) 0);<NEW_LINE>// _ASSERT(m_pathFlags.size() == m_paths.size());<NEW_LINE>for (int ipath = oldPathCount - 1; ipath >= pathIndex + 1; ipath--) {<NEW_LINE>byte flags = m_pathFlags.read(ipath);<NEW_LINE>// remove calculated flags<NEW_LINE>flags &= ~(byte) PathFlags.enumCalcMask;<NEW_LINE>m_pathFlags.write(ipath + 1, flags);<NEW_LINE>}<NEW_LINE>if (m_bPolygon)<NEW_LINE>m_pathFlags.write(pathIndex, (byte) PathFlags.enumClosed);<NEW_LINE>} | ) (AttributeStreamBase) getAttributeStreamRef(semantics); |
895,773 | public static void horizontal(Kernel1D_F64 kernel, InterleavedF64 src, InterleavedF64 dst) {<NEW_LINE>final double[] dataSrc = src.data;<NEW_LINE>final double[] dataDst = dst.data;<NEW_LINE>final int kernelWidth = kernel.getWidth();<NEW_LINE>final int offsetL = kernel.getOffset();<NEW_LINE>final int offsetR = kernelWidth - offsetL - 1;<NEW_LINE>final int width = src.getWidth();<NEW_LINE>final int height = src.getHeight();<NEW_LINE>final int numBands = src.getNumBands();<NEW_LINE>final double[] total = new double[numBands];<NEW_LINE>for (int i = 0; i < height; i++) {<NEW_LINE>int indexDst = dst.startIndex + i * dst.stride;<NEW_LINE>for (int j = 0; j < offsetL; j++) {<NEW_LINE>int indexSrc = src.startIndex + i * src.stride;<NEW_LINE>Arrays.fill(total, 0);<NEW_LINE>double weight = 0;<NEW_LINE>for (int k = offsetL - j; k < kernelWidth; k++) {<NEW_LINE>double w = kernel.data[k];<NEW_LINE>weight += w;<NEW_LINE>for (int band = 0; band < numBands; band++) {<NEW_LINE>total[band] += (dataSrc[indexSrc++]) * w;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>for (int band = 0; band < numBands; band++) {<NEW_LINE>dataDst[indexDst++] = (total[band] / weight);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>indexDst = dst.startIndex + i * dst.stride + (width - offsetR) * numBands;<NEW_LINE>for (int j = offsetR - 1; j >= 0; j--) {<NEW_LINE>int indexSrc = src.startIndex + i * src.stride + (width - offsetL - j - 1) * numBands;<NEW_LINE>Arrays.fill(total, 0);<NEW_LINE>double weight = 0;<NEW_LINE>for (int k = 0; k <= offsetL + j; k++) {<NEW_LINE>double <MASK><NEW_LINE>weight += w;<NEW_LINE>for (int band = 0; band < numBands; band++) {<NEW_LINE>total[band] += (dataSrc[indexSrc++]) * w;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>for (int band = 0; band < numBands; band++) {<NEW_LINE>dataDst[indexDst++] = (total[band] / weight);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | w = kernel.data[k]; |
966,872 | public static SetWelcomePageURIResponse unmarshall(SetWelcomePageURIResponse setWelcomePageURIResponse, UnmarshallerContext context) {<NEW_LINE>setWelcomePageURIResponse.setRequestId(context.stringValue("SetWelcomePageURIResponse.RequestId"));<NEW_LINE>setWelcomePageURIResponse.setErrorCode(context.integerValue("SetWelcomePageURIResponse.ErrorCode"));<NEW_LINE>setWelcomePageURIResponse.setErrorMsg(context.stringValue("SetWelcomePageURIResponse.ErrorMsg"));<NEW_LINE>setWelcomePageURIResponse.setSuccess(context.booleanValue("SetWelcomePageURIResponse.Success"));<NEW_LINE>List<ErrorMessage> errorList = new ArrayList<ErrorMessage>();<NEW_LINE>for (int i = 0; i < context.lengthValue("SetWelcomePageURIResponse.ErrorList.Length"); i++) {<NEW_LINE>ErrorMessage errorMessage = new ErrorMessage();<NEW_LINE>errorMessage.setErrorMessage(context.stringValue<MASK><NEW_LINE>errorList.add(errorMessage);<NEW_LINE>}<NEW_LINE>setWelcomePageURIResponse.setErrorList(errorList);<NEW_LINE>return setWelcomePageURIResponse;<NEW_LINE>} | ("SetWelcomePageURIResponse.ErrorList[" + i + "].ErrorMessage")); |
1,657,142 | protected BatchPart createSafe() {<NEW_LINE><MASK><NEW_LINE>BatchPartEntity batchPart = partEntityManager.create();<NEW_LINE>batchPart.setBatchId(batch.getId());<NEW_LINE>batchPart.setBatchType(batch.getBatchType());<NEW_LINE>batchPart.setBatchSearchKey(batch.getBatchSearchKey());<NEW_LINE>batchPart.setBatchSearchKey2(batch.getBatchSearchKey2());<NEW_LINE>if (batch.getTenantId() != null) {<NEW_LINE>batchPart.setTenantId(batch.getTenantId());<NEW_LINE>}<NEW_LINE>batchPart.setType(type);<NEW_LINE>batchPart.setSearchKey(searchKey);<NEW_LINE>batchPart.setSearchKey2(searchKey2);<NEW_LINE>batchPart.setStatus(status);<NEW_LINE>batchPart.setScopeId(scopeId);<NEW_LINE>batchPart.setSubScopeId(subScopeId);<NEW_LINE>batchPart.setScopeType(scopeType);<NEW_LINE>batchPart.setCreateTime(batchServiceConfiguration.getClock().getCurrentTime());<NEW_LINE>partEntityManager.insert(batchPart);<NEW_LINE>return batchPart;<NEW_LINE>} | BatchPartEntityManager partEntityManager = batchServiceConfiguration.getBatchPartEntityManager(); |
1,067,621 | boolean mergeClusters_(int vertex1, int vertex2, boolean update_hash) {<NEW_LINE>int cluster_1 = m_shape.getUserIndex(vertex1, m_new_clusters);<NEW_LINE>int cluster_2 = m_shape.getUserIndex(vertex2, m_new_clusters);<NEW_LINE>assert (cluster_1 != StridedIndexTypeCollection.impossibleIndex2());<NEW_LINE>assert (cluster_2 != StridedIndexTypeCollection.impossibleIndex2());<NEW_LINE>if (cluster_1 == -1) {<NEW_LINE>cluster_1 = m_clusters.createList();<NEW_LINE>m_clusters.addElement(cluster_1, vertex1);<NEW_LINE>m_shape.setUserIndex(vertex1, m_new_clusters, cluster_1);<NEW_LINE>}<NEW_LINE>if (cluster_2 == -1) {<NEW_LINE>m_clusters.addElement(cluster_1, vertex2);<NEW_LINE>} else {<NEW_LINE>m_clusters.concatenateLists(cluster_1, cluster_2);<NEW_LINE>}<NEW_LINE>// ensure only single vertex refers to the cluster.<NEW_LINE>m_shape.setUserIndex(vertex2, m_new_clusters, StridedIndexTypeCollection.impossibleIndex2());<NEW_LINE>// merge cordinates<NEW_LINE>boolean <MASK><NEW_LINE>if (update_hash) {<NEW_LINE>int hash = m_hash_function.calculate_hash_from_vertex(vertex1);<NEW_LINE>m_shape.setUserIndex(vertex1, m_hash_values, hash);<NEW_LINE>} else {<NEW_LINE>}<NEW_LINE>return res;<NEW_LINE>} | res = mergeVertices_(vertex1, vertex2); |
1,016,670 | private void toggleRestrictions() {<NEW_LINE>holder.imgCbRestricted.setVisibility(View.GONE);<NEW_LINE>holder.pbRunning.setVisibility(View.VISIBLE);<NEW_LINE>new AsyncTask<Object, Object, Object>() {<NEW_LINE><NEW_LINE>private List<Boolean> oldState;<NEW_LINE><NEW_LINE>private List<Boolean> newState;<NEW_LINE><NEW_LINE>@Override<NEW_LINE>protected Object doInBackground(Object... arg0) {<NEW_LINE>// Change restriction<NEW_LINE>oldState = PrivacyManager.getRestartStates(xAppInfo.getUid(), mRestrictionName);<NEW_LINE>rstate.toggleRestriction();<NEW_LINE>newState = PrivacyManager.getRestartStates(xAppInfo.getUid(), mRestrictionName);<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>protected void onPostExecute(Object result) {<NEW_LINE>// Update restriction display<NEW_LINE>rstate = new RState(xAppInfo.getUid(), mRestrictionName, null, mVersion);<NEW_LINE>holder.imgCbRestricted.setImageBitmap<MASK><NEW_LINE>holder.imgCbAsk.setImageBitmap(getAskBoxImage(rstate, methodExpert));<NEW_LINE>// Notify restart<NEW_LINE>if (!newState.equals(oldState))<NEW_LINE>Toast.makeText(ActivityMain.this, getString(R.string.msg_restart), Toast.LENGTH_LONG).show();<NEW_LINE>// Display new state<NEW_LINE>showState();<NEW_LINE>holder.pbRunning.setVisibility(View.GONE);<NEW_LINE>holder.imgCbRestricted.setVisibility(View.VISIBLE);<NEW_LINE>}<NEW_LINE>}.executeOnExecutor(mExecutor);<NEW_LINE>} | (getCheckBoxImage(rstate, methodExpert)); |
217,903 | private FindPlan createAndPlan(Collection<IndexDescriptor> indexDescriptors, List<Filter> filters) {<NEW_LINE>FindPlan findPlan = new FindPlan();<NEW_LINE>Set<ComparableFilter> indexScanFilters = new LinkedHashSet<>();<NEW_LINE>Set<Filter> <MASK><NEW_LINE>// find out set id filter (if any)<NEW_LINE>planForIdFilter(findPlan, filters);<NEW_LINE>// find out if there are any index only filter with index<NEW_LINE>planForIndexOnlyFilters(findPlan, indexScanFilters, indexDescriptors, filters);<NEW_LINE>// if no id filter found or no index only filter found, scan for matching index<NEW_LINE>if (findPlan.getByIdFilter() == null && indexScanFilters.isEmpty()) {<NEW_LINE>planForIndexScanningFilters(findPlan, indexScanFilters, indexDescriptors, filters);<NEW_LINE>}<NEW_LINE>// plan for column scan filters<NEW_LINE>planForCollectionScanningFilters(findPlan, indexScanFilters, columnScanFilters, filters);<NEW_LINE>IndexScanFilter indexScanFilter;<NEW_LINE>if (indexScanFilters.size() == 1) {<NEW_LINE>indexScanFilter = new IndexScanFilter(Collections.singletonList(firstOrNull(indexScanFilters)));<NEW_LINE>findPlan.setIndexScanFilter(indexScanFilter);<NEW_LINE>} else if (indexScanFilters.size() > 1) {<NEW_LINE>indexScanFilter = new IndexScanFilter(indexScanFilters);<NEW_LINE>findPlan.setIndexScanFilter(indexScanFilter);<NEW_LINE>}<NEW_LINE>if (columnScanFilters.size() == 1) {<NEW_LINE>findPlan.setCollectionScanFilter(firstOrNull(columnScanFilters));<NEW_LINE>} else if (columnScanFilters.size() > 1) {<NEW_LINE>Filter andFilter = and(columnScanFilters.toArray(new Filter[0]));<NEW_LINE>findPlan.setCollectionScanFilter(andFilter);<NEW_LINE>}<NEW_LINE>return findPlan;<NEW_LINE>} | columnScanFilters = new LinkedHashSet<>(); |
800,118 | protected Control createDialogArea(Composite parent) {<NEW_LINE>GridData gd;<NEW_LINE>Composite dialogComp = (Composite) super.createDialogArea(parent);<NEW_LINE>Composite topComp = new Composite(dialogComp, SWT.NONE);<NEW_LINE>gd = new GridData(GridData.FILL_BOTH);<NEW_LINE>topComp.setLayoutData(gd);<NEW_LINE>GridLayout topLayout = new GridLayout();<NEW_LINE>topLayout.numColumns = 2;<NEW_LINE>topLayout.marginHeight = 5;<NEW_LINE>topLayout.marginWidth = 0;<NEW_LINE>topComp.setLayout(topLayout);<NEW_LINE>// Set the things that TitleAreaDialog takes care of<NEW_LINE>setTitle("Soot Launching Options");<NEW_LINE>setMessage("");<NEW_LINE>// Create the SashForm that contains the selection area on the left,<NEW_LINE>// and the edit area on the right<NEW_LINE>setSashForm(new SashForm(topComp, SWT.NONE));<NEW_LINE>getSashForm().setOrientation(SWT.HORIZONTAL);<NEW_LINE>gd = new GridData(GridData.FILL_BOTH);<NEW_LINE>gd.horizontalSpan = 2;<NEW_LINE>getSashForm().setLayoutData(gd);<NEW_LINE>Composite selection = createSelectionComposite(getSashForm());<NEW_LINE>gd = new GridData(GridData.FILL_VERTICAL);<NEW_LINE>selection.setLayoutData(gd);<NEW_LINE>Composite data = createDataComposite(getSashForm());<NEW_LINE>gd <MASK><NEW_LINE>data.setLayoutData(gd);<NEW_LINE>Label separator = new Label(topComp, SWT.HORIZONTAL | SWT.SEPARATOR);<NEW_LINE>gd = new GridData(GridData.FILL_HORIZONTAL);<NEW_LINE>gd.horizontalSpan = 2;<NEW_LINE>separator.setLayoutData(gd);<NEW_LINE>dialogComp.layout(true);<NEW_LINE>return dialogComp;<NEW_LINE>} | = new GridData(GridData.FILL_BOTH); |
1,066,884 | /*<NEW_LINE>* Saves the current value to the data source Don't add a JavaDoc comment<NEW_LINE>* here, we use the default documentation from the implemented interface.<NEW_LINE>*/<NEW_LINE>@Override<NEW_LINE>public void commit() throws Buffered.SourceException, InvalidValueException {<NEW_LINE>if (dataSource != null && !dataSource.isReadOnly()) {<NEW_LINE>if (isInvalidCommitted() || isValid()) {<NEW_LINE>try {<NEW_LINE>// Commits the value to datasource.<NEW_LINE>valueWasModifiedByDataSourceDuringCommit = false;<NEW_LINE>committingValueToDataSource = true;<NEW_LINE>getPropertyDataSource().setValue(getConvertedValue());<NEW_LINE>} catch (final Throwable e) {<NEW_LINE>// Sets the buffering state.<NEW_LINE>SourceException sourceException = new <MASK><NEW_LINE>setCurrentBufferedSourceException(sourceException);<NEW_LINE>// Throws the source exception.<NEW_LINE>throw sourceException;<NEW_LINE>} finally {<NEW_LINE>committingValueToDataSource = false;<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>validate();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// The abstract field is not modified anymore<NEW_LINE>if (isModified()) {<NEW_LINE>setModified(false);<NEW_LINE>}<NEW_LINE>// If successful, remove set the buffering state to be ok<NEW_LINE>if (getCurrentBufferedSourceException() != null) {<NEW_LINE>setCurrentBufferedSourceException(null);<NEW_LINE>}<NEW_LINE>if (valueWasModifiedByDataSourceDuringCommit) {<NEW_LINE>valueWasModifiedByDataSourceDuringCommit = false;<NEW_LINE>fireValueChange(false);<NEW_LINE>}<NEW_LINE>} | Buffered.SourceException(this, e); |
1,754,107 | private CatchStatement createHandleSuppressedThrowableStatement(VariableExpression featureThrowableVar) {<NEW_LINE>Parameter catchParameter = new Parameter(nodeCache.Throwable, "$spock_tmp_throwable");<NEW_LINE>BinaryExpression featureThrowableNotNullExpr = createVariableNotNullExpression(featureThrowableVar);<NEW_LINE>List<Statement> addSuppressedStats = Collections.singletonList(new ExpressionStatement(createDirectMethodCall(featureThrowableVar, nodeCache.Throwable_AddSuppressed, new ArgumentListExpression(new <MASK><NEW_LINE>List<Statement> throwFeatureStats = Collections.singletonList(new ThrowStatement(new VariableExpression(catchParameter)));<NEW_LINE>IfStatement ifFeatureNotNullStat = new IfStatement(new BooleanExpression(featureThrowableNotNullExpr), new BlockStatement(addSuppressedStats, null), new BlockStatement(throwFeatureStats, null));<NEW_LINE>return new CatchStatement(catchParameter, new BlockStatement(Collections.singletonList(ifFeatureNotNullStat), null));<NEW_LINE>} | VariableExpression(catchParameter))))); |
1,731,230 | protected void encodeEvents(FacesContext context, Chronoline chronoline) throws IOException {<NEW_LINE>ResponseWriter writer = context.getResponseWriter();<NEW_LINE>Collection<?> value = (Collection<?>) chronoline.getValue();<NEW_LINE>if (value != null) {<NEW_LINE>Map<String, Object> requestMap = context.getExternalContext().getRequestMap();<NEW_LINE>String var = chronoline.getVar();<NEW_LINE>for (Iterator<?> it = value.iterator(); it.hasNext(); ) {<NEW_LINE>requestMap.put(<MASK><NEW_LINE>writer.startElement("div", null);<NEW_LINE>writer.writeAttribute("class", Chronoline.EVENT_CLASS, null);<NEW_LINE>encodeOppositeContent(context, chronoline);<NEW_LINE>encodeSeparator(context, chronoline, !it.hasNext());<NEW_LINE>encodeContent(context, chronoline);<NEW_LINE>writer.endElement("div");<NEW_LINE>}<NEW_LINE>requestMap.remove(var);<NEW_LINE>}<NEW_LINE>} | var, it.next()); |
587,020 | public void arc(Object x, Object y, Object radius, Object startAngle, Object endAngle, Object anticlockwise) {<NEW_LINE>actions.add(canvas -> {<NEW_LINE>float x_px = dp2px(x);<NEW_LINE>float y_px = dp2px(y);<NEW_LINE>float radius_px = dp2px(radius);<NEW_LINE>boolean anticlockwiseBool = Boolean.parseBoolean(anticlockwise.toString());<NEW_LINE>float startAngle_px = piToAngle(startAngle);<NEW_LINE>float endAngle_px = piToAngle(endAngle);<NEW_LINE>float sweepAngle = getSweepAngle(startAngle_px, endAngle_px, anticlockwiseBool);<NEW_LINE>RectF rectF = new RectF(x_px - radius_px, y_px - radius_px, x_px + radius_px, y_px + radius_px);<NEW_LINE>canvas.drawArc(rectF, startAngle_px, <MASK><NEW_LINE>});<NEW_LINE>} | sweepAngle, false, getLinePaint()); |
764,420 | void applyTo(TaskMonitor monitor, MessageLog log) {<NEW_LINE>while (xmlParser.hasNext()) {<NEW_LINE>if (monitor.isCancelled()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>if (elem.isEnd() && elem.getName().equals("function")) {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>// line number start tag<NEW_LINE>elem = xmlParser.next();<NEW_LINE>String sourcefileName = elem.getAttribute("source_file");<NEW_LINE>int start = XmlUtilities.parseInt(elem.getAttribute("start"));<NEW_LINE>int addr = XmlUtilities.parseInt(elem.getAttribute("addr"));<NEW_LINE>Address address = PdbUtil.reladdr(program, addr);<NEW_LINE>// The following line was changed from getCodeUnitAt(address) to<NEW_LINE>// getCodeUnitContaining(address) in order to fix an issue where the PDB associates<NEW_LINE>// a line number with base part of an instruction instead of the prefix part of an<NEW_LINE>// instruction. In particular, Microsoft emits a "REP RET" (f3 c3) sequence, where<NEW_LINE>// the "REP" is an instruction prefix, in order to avoid a branch prediction penalty<NEW_LINE>// for AMD processors. However, Microsoft associates the line number of the<NEW_LINE>// instruction with the address of the "RET" (c3) instead of with the address of the<NEW_LINE>// "REP" (f3) portion (beginning) of the instruction.<NEW_LINE>CodeUnit cu = program.getListing().getCodeUnitContaining(address);<NEW_LINE>if (cu == null) {<NEW_LINE>log.appendMsg("PDB", "Could not apply source code line number (no code unit found at " + address + ")");<NEW_LINE>} else {<NEW_LINE>cu.setProperty("Source Path", sourcefileName);<NEW_LINE>cu.setProperty("Source File", new File(sourcefileName).getName());<NEW_LINE>cu.setProperty("Source Line", start);<NEW_LINE>}<NEW_LINE>// String comment = sourcefile.getName()+":"+start;<NEW_LINE>// setComment(CodeUnit.PRE_COMMENT, program.getListing(), address, comment);<NEW_LINE>// line number end tag<NEW_LINE>elem = xmlParser.next();<NEW_LINE>}<NEW_LINE>} | XmlElement elem = xmlParser.peek(); |
1,569,032 | private void showFullView(Message smListItem) {<NEW_LINE>try {<NEW_LINE>final String mimeType = FileUtils.getMimeType(smListItem.getFilePaths().get(0));<NEW_LINE>if (mimeType != null) {<NEW_LINE>if (mimeType.startsWith("image")) {<NEW_LINE>Intent intent = new Intent(activityContext, FullScreenImageActivity.class);<NEW_LINE>intent.putExtra(MobiComKitConstants.MESSAGE_JSON_INTENT, GsonUtils.getJsonFromObject(smListItem, Message.class));<NEW_LINE>((MobiComKitActivityInterface) activityContext).startActivityForResult(intent, MobiComKitActivityInterface.REQUEST_CODE_FULL_SCREEN_ACTION);<NEW_LINE>}<NEW_LINE>if (mimeType.startsWith("video")) {<NEW_LINE>if (smListItem.isAttachmentDownloaded()) {<NEW_LINE>Intent intentVideo = new Intent();<NEW_LINE>intentVideo.setAction(Intent.ACTION_VIEW);<NEW_LINE>Uri outputUri;<NEW_LINE>if (Utils.hasNougat()) {<NEW_LINE>outputUri = ALFileProvider.getUriForFile(context, Utils.getMetaDataValue(context, MobiComKitConstants.PACKAGE_NAME) + ".applozic.provider", new File(smListItem.getFilePaths(<MASK><NEW_LINE>} else {<NEW_LINE>outputUri = Uri.fromFile(new File(smListItem.getFilePaths().get(0)));<NEW_LINE>}<NEW_LINE>intentVideo.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);<NEW_LINE>if (intentVideo.resolveActivity(context.getPackageManager()) != null) {<NEW_LINE>intentVideo.setDataAndType(outputUri, "video/*");<NEW_LINE>activityContext.startActivity(intentVideo);<NEW_LINE>} else {<NEW_LINE>Toast.makeText(context, R.string.info_app_not_found_to_open_file, Toast.LENGTH_LONG).show();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>Utils.printLog(context, TAG, "No application found to open this file");<NEW_LINE>}<NEW_LINE>} | ).get(0))); |
599,262 | public void init() {<NEW_LINE>MatrixMeta matrixMeta = context.getMatrixMetaManager().getMatrixMeta(matrixId);<NEW_LINE>Map<Integer, PartitionMeta> partMetas = matrixMeta.getPartitionMetas();<NEW_LINE>String sourceClass = matrixMeta.getAttribute(AngelConf.ANGEL_PS_PARTITION_SOURCE_CLASS, AngelConf.DEFAULT_ANGEL_PS_PARTITION_SOURCE_CLASS);<NEW_LINE>// Get server partition class<NEW_LINE>Class<? extends IServerPartition> partClass;<NEW_LINE>try {<NEW_LINE>partClass = matrixMeta.getPartitionClass();<NEW_LINE>// If partition class is not set, just use the default partition class<NEW_LINE>if (partClass == null) {<NEW_LINE>partClass = MatrixConf.DEFAULT_SERVER_PARTITION_CLASS;<NEW_LINE>}<NEW_LINE>} catch (Throwable e) {<NEW_LINE>LOG.fatal("Server partition class failed ", e);<NEW_LINE>throw new RuntimeException(e);<NEW_LINE>}<NEW_LINE>// Get server partition storage class type<NEW_LINE>Class<? extends IServerPartitionStorage> storageClass;<NEW_LINE>try {<NEW_LINE>storageClass = matrixMeta.getPartitionStorageClass();<NEW_LINE>} catch (Throwable e) {<NEW_LINE>LOG.fatal("Server partition class failed ", e);<NEW_LINE>throw new RuntimeException(e);<NEW_LINE>}<NEW_LINE>RowType rowType = matrixMeta.getRowType();<NEW_LINE>// Get value class<NEW_LINE>Class<MASK><NEW_LINE>if (rowType.isComplexValue()) {<NEW_LINE>try {<NEW_LINE>valueClass = matrixMeta.getValueClass();<NEW_LINE>} catch (Throwable e) {<NEW_LINE>LOG.fatal("Init value class failed ", e);<NEW_LINE>throw new RuntimeException(e);<NEW_LINE>}<NEW_LINE>if (valueClass == null) {<NEW_LINE>throw new RuntimeException("Complex type must set value type class!!");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>for (PartitionMeta partMeta : partMetas.values()) {<NEW_LINE>ServerPartition part = ServerPartitionFactory.getPartition(partMeta.getPartitionKey(), partClass, storageClass, matrixMeta.getRowType(), valueClass, matrixMeta.getValidIndexNumInOnePart(), matrixMeta.isHash() ? RouterType.HASH : RouterType.RANGE);<NEW_LINE>partitionMaps.put(partMeta.getPartId(), part);<NEW_LINE>part.init();<NEW_LINE>part.setState(PartitionState.READ_AND_WRITE);<NEW_LINE>}<NEW_LINE>} | <? extends IElement> valueClass = null; |
638,870 | public void analyzeSentiment() {<NEW_LINE>// BEGIN: com.azure.ai.textanalytics.TextAnalyticsClient.analyzeSentiment#String<NEW_LINE>final DocumentSentiment documentSentiment = textAnalyticsClient.analyzeSentiment("The hotel was dark and unclean.");<NEW_LINE>System.out.printf("Recognized sentiment: %s, positive score: %.2f, neutral score: %.2f, negative score: %.2f.%n", documentSentiment.getSentiment(), documentSentiment.getConfidenceScores().getPositive(), documentSentiment.getConfidenceScores().getNeutral(), documentSentiment.<MASK><NEW_LINE>for (SentenceSentiment sentenceSentiment : documentSentiment.getSentences()) {<NEW_LINE>System.out.printf("Recognized sentence sentiment: %s, positive score: %.2f, neutral score: %.2f, negative score: %.2f.%n", sentenceSentiment.getSentiment(), sentenceSentiment.getConfidenceScores().getPositive(), sentenceSentiment.getConfidenceScores().getNeutral(), sentenceSentiment.getConfidenceScores().getNegative());<NEW_LINE>}<NEW_LINE>// END: com.azure.ai.textanalytics.TextAnalyticsClient.analyzeSentiment#String<NEW_LINE>} | getConfidenceScores().getNegative()); |
921,347 | // todo fix link followed here!<NEW_LINE>private static void linkFollowed(Editor editor, Collection<? extends RangeHighlighter> ranges, final RangeHighlighter link) {<NEW_LINE>MarkupModelEx markupModel = (MarkupModelEx) editor.getMarkupModel();<NEW_LINE>for (RangeHighlighter range : ranges) {<NEW_LINE>TextAttributes oldAttr = range.getUserData(OLD_HYPERLINK_TEXT_ATTRIBUTES);<NEW_LINE>if (oldAttr != null) {<NEW_LINE>markupModel.setRangeHighlighterAttributes(range, oldAttr);<NEW_LINE>range.putUserData(OLD_HYPERLINK_TEXT_ATTRIBUTES, null);<NEW_LINE>}<NEW_LINE>if (range == link) {<NEW_LINE>range.putUserData(OLD_HYPERLINK_TEXT_ATTRIBUTES, range.getTextAttributes());<NEW_LINE>markupModel.setRangeHighlighterAttributes<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>// refresh highlighter text attributes<NEW_LINE>markupModel.addRangeHighlighter(0, 0, link.getLayer(), getHyperlinkAttributes(), HighlighterTargetArea.EXACT_RANGE).dispose();<NEW_LINE>} | (range, getFollowedHyperlinkAttributes(range)); |
1,574,460 | public static IndexInfo indexInfoOf(Document sourceDocument) {<NEW_LINE>Document keyDbObject = (Document) sourceDocument.get("key");<NEW_LINE>int numberOfElements = keyDbObject.keySet().size();<NEW_LINE>List<IndexField> indexFields = new ArrayList<IndexField>(numberOfElements);<NEW_LINE>for (String key : keyDbObject.keySet()) {<NEW_LINE>Object value = keyDbObject.get(key);<NEW_LINE>if (TWO_D_IDENTIFIERS.contains(value)) {<NEW_LINE>indexFields.add(IndexField.geo(key));<NEW_LINE>} else if ("text".equals(value)) {<NEW_LINE>Document weights = (<MASK><NEW_LINE>for (String fieldName : weights.keySet()) {<NEW_LINE>indexFields.add(IndexField.text(fieldName, Float.valueOf(weights.get(fieldName).toString())));<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>if (ObjectUtils.nullSafeEquals("hashed", value)) {<NEW_LINE>indexFields.add(IndexField.hashed(key));<NEW_LINE>} else if (key.endsWith("$**")) {<NEW_LINE>indexFields.add(IndexField.wildcard(key));<NEW_LINE>} else {<NEW_LINE>Double keyValue = new Double(value.toString());<NEW_LINE>if (ONE.equals(keyValue)) {<NEW_LINE>indexFields.add(IndexField.create(key, ASC));<NEW_LINE>} else if (MINUS_ONE.equals(keyValue)) {<NEW_LINE>indexFields.add(IndexField.create(key, DESC));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>String name = sourceDocument.get("name").toString();<NEW_LINE>boolean unique = sourceDocument.containsKey("unique") ? (Boolean) sourceDocument.get("unique") : false;<NEW_LINE>boolean sparse = sourceDocument.containsKey("sparse") ? (Boolean) sourceDocument.get("sparse") : false;<NEW_LINE>String language = sourceDocument.containsKey("default_language") ? (String) sourceDocument.get("default_language") : "";<NEW_LINE>String partialFilter = extractPartialFilterString(sourceDocument);<NEW_LINE>IndexInfo info = new IndexInfo(indexFields, name, unique, sparse, language);<NEW_LINE>info.partialFilterExpression = partialFilter;<NEW_LINE>info.collation = sourceDocument.get("collation", Document.class);<NEW_LINE>if (sourceDocument.containsKey("expireAfterSeconds")) {<NEW_LINE>Number expireAfterSeconds = sourceDocument.get("expireAfterSeconds", Number.class);<NEW_LINE>info.expireAfter = Duration.ofSeconds(NumberUtils.convertNumberToTargetClass(expireAfterSeconds, Long.class));<NEW_LINE>}<NEW_LINE>if (sourceDocument.containsKey("wildcardProjection")) {<NEW_LINE>info.wildcardProjection = sourceDocument.get("wildcardProjection", Document.class);<NEW_LINE>}<NEW_LINE>return info;<NEW_LINE>} | Document) sourceDocument.get("weights"); |
714,107 | protected void doEndElement(String uri, String name, String qName) {<NEW_LINE>if (in("ObjectLockConfiguration")) {<NEW_LINE>if ("ObjectLockEnabled".equals(name)) {<NEW_LINE>objectLockConfiguration.setObjectLockEnabled(getText());<NEW_LINE>} else if ("Rule".equals(name)) {<NEW_LINE>objectLockConfiguration.setRule(rule);<NEW_LINE>}<NEW_LINE>} else if (in("ObjectLockConfiguration", "Rule")) {<NEW_LINE>if ("DefaultRetention".equals(name)) {<NEW_LINE>rule.setDefaultRetention(defaultRetention);<NEW_LINE>}<NEW_LINE>} else if (in("ObjectLockConfiguration", "Rule", "DefaultRetention")) {<NEW_LINE>if ("Mode".equals(name)) {<NEW_LINE><MASK><NEW_LINE>} else if ("Days".equals(name)) {<NEW_LINE>defaultRetention.setDays(Integer.parseInt(getText()));<NEW_LINE>} else if ("Years".equals(name)) {<NEW_LINE>defaultRetention.setYears(Integer.parseInt(getText()));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | defaultRetention.setMode(getText()); |
280,582 | private static void validateLocationAndFrame(LanguageInfo viewLanguage, Node location, Frame frame) {<NEW_LINE><MASK><NEW_LINE>if (rootNode == null) {<NEW_LINE>throw PolyglotEngineException.illegalArgument(String.format("The location '%s' does not have a RootNode.", location));<NEW_LINE>}<NEW_LINE>LanguageInfo nodeLocation = rootNode.getLanguageInfo();<NEW_LINE>if (nodeLocation == null) {<NEW_LINE>throw PolyglotEngineException.illegalArgument(String.format("The location '%s' does not have a language associated.", location));<NEW_LINE>}<NEW_LINE>if (nodeLocation != viewLanguage) {<NEW_LINE>throw PolyglotEngineException.illegalArgument(String.format("The view language '%s' must match the language of the location %s.", viewLanguage, nodeLocation));<NEW_LINE>}<NEW_LINE>if (!EngineAccessor.INSTRUMENT.isInstrumentable(location)) {<NEW_LINE>throw PolyglotEngineException.illegalArgument(String.format("The location '%s' is not instrumentable but must be to request scoped views.", location));<NEW_LINE>}<NEW_LINE>if (!rootNode.getFrameDescriptor().equals(frame.getFrameDescriptor())) {<NEW_LINE>throw PolyglotEngineException.illegalArgument(String.format("The frame provided does not originate from the location. " + "Expected frame descriptor '%s' but was '%s'.", rootNode.getFrameDescriptor(), frame.getFrameDescriptor()));<NEW_LINE>}<NEW_LINE>} | RootNode rootNode = location.getRootNode(); |
1,224,320 | public static int editDistance(String word1, String word2, boolean caseSensitive) {<NEW_LINE>if (!caseSensitive) {<NEW_LINE>word1 = word1.toLowerCase();<NEW_LINE>word2 = word2.toLowerCase();<NEW_LINE>}<NEW_LINE>int len1 = word1.length();<NEW_LINE>int len2 = word2.length();<NEW_LINE>// len1+1, len2+1, because finally return dp[len1][len2]<NEW_LINE>int[][] dp = new int[len1 <MASK><NEW_LINE>for (int i = 0; i <= len1; i++) {<NEW_LINE>dp[i][0] = i;<NEW_LINE>}<NEW_LINE>for (int j = 0; j <= len2; j++) {<NEW_LINE>dp[0][j] = j;<NEW_LINE>}<NEW_LINE>// iterate though, and check last char<NEW_LINE>for (int i = 0; i < len1; i++) {<NEW_LINE>char c1 = word1.charAt(i);<NEW_LINE>for (int j = 0; j < len2; j++) {<NEW_LINE>char c2 = word2.charAt(j);<NEW_LINE>// if last two chars equal<NEW_LINE>if (c1 == c2) {<NEW_LINE>// update dp value for +1 length<NEW_LINE>dp[i + 1][j + 1] = dp[i][j];<NEW_LINE>} else {<NEW_LINE>int replace = dp[i][j] + 1;<NEW_LINE>int insert = Math.min(dp[i][j + 1], dp[i + 1][j]) + 1;<NEW_LINE>dp[i + 1][j + 1] = Math.min(replace, insert);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return dp[len1][len2];<NEW_LINE>} | + 1][len2 + 1]; |
1,322,540 | private void copyFile(FileObject sourceFile) throws IOException {<NEW_LINE>String targetPath = (transformation != null) ? transformation.transformPath(sourceFile.getPath()) : sourceFile.getPath();<NEW_LINE>boolean isTransformed = !targetPath.equals(sourceFile.getPath());<NEW_LINE>FileObject tg = targetRoot.getFileObject(targetPath);<NEW_LINE>try {<NEW_LINE>if (tg == null) {<NEW_LINE>// copy the file otherwise keep old content<NEW_LINE>FileObject targetFolder = null;<NEW_LINE>String name = null, ext = null;<NEW_LINE>if (isTransformed) {<NEW_LINE>FileObject targetFile = FileUtil.createData(targetRoot, targetPath);<NEW_LINE>targetFolder = targetFile.getParent();<NEW_LINE>name = targetFile.getName();<NEW_LINE>ext = targetFile.getExt();<NEW_LINE>targetFile.delete();<NEW_LINE>} else {<NEW_LINE>targetFolder = FileUtil.createFolder(targetRoot, sourceFile.getParent().getPath());<NEW_LINE>name = sourceFile.getName();<NEW_LINE>ext = sourceFile.getExt();<NEW_LINE>}<NEW_LINE>tg = FileUtil.copyFile(<MASK><NEW_LINE>}<NEW_LINE>} catch (IOException ex) {<NEW_LINE>if (sourceFile.getNameExt().endsWith("_hidden")) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>throw ex;<NEW_LINE>}<NEW_LINE>FileUtil.copyAttributes(sourceFile, tg);<NEW_LINE>} | sourceFile, targetFolder, name, ext); |
73,587 | protected Div makeChildDiv(String type, DSpaceObject dso, PackageParameters params) {<NEW_LINE>String handle = dso.getHandle();<NEW_LINE>// start <div><NEW_LINE>Div div = new Div();<NEW_LINE>div<MASK><NEW_LINE>div.setTYPE(type);<NEW_LINE>// make sure we have a handle<NEW_LINE>if (handle == null || handle.length() == 0) {<NEW_LINE>log.warn("METS Disseminator is skipping " + type + " without handle: " + dso.toString());<NEW_LINE>} else {<NEW_LINE>// create <mptr> with handle reference<NEW_LINE>Mptr mptr = new Mptr();<NEW_LINE>mptr.setID(gensym("mptr"));<NEW_LINE>mptr.setLOCTYPE(Loctype.HANDLE);<NEW_LINE>mptr.setXlinkHref(handle);<NEW_LINE>div.getContent().add(mptr);<NEW_LINE>}<NEW_LINE>// determine file extension of child references,<NEW_LINE>// based on whether we are exporting just a manifest or a full Zip pkg<NEW_LINE>String childFileExtension = (params.getBooleanProperty("manifestOnly", false)) ? "xml" : "zip";<NEW_LINE>// Always create <mptr> with file-name reference to child package<NEW_LINE>// This is what DSpace will expect the child package to be named during ingestion<NEW_LINE>// (NOTE: without this reference, DSpace will be unable to restore any child objects during ingestion)<NEW_LINE>Mptr mptr2 = new Mptr();<NEW_LINE>mptr2.setID(gensym("mptr"));<NEW_LINE>mptr2.setLOCTYPE(Loctype.URL);<NEW_LINE>// we get the name of the child package from the Packager -- as it is what will actually create this child pkg<NEW_LINE>// file<NEW_LINE>mptr2.setXlinkHref(PackageUtils.getPackageName(dso, childFileExtension));<NEW_LINE>div.getContent().add(mptr2);<NEW_LINE>return div;<NEW_LINE>} | .setID(gensym("div")); |
611,923 | public void virtualize(VirtualizerTool tool) {<NEW_LINE>ValueNode alias = tool.getAlias(array());<NEW_LINE>if (alias instanceof VirtualObjectNode) {<NEW_LINE>VirtualArrayNode virtual = (VirtualArrayNode) alias;<NEW_LINE>ValueNode indexValue = tool.getAlias(index());<NEW_LINE>int idx = indexValue.isConstant() ? indexValue.asJavaConstant().asInt() : -1;<NEW_LINE>if (idx >= 0 && idx < virtual.entryCount()) {<NEW_LINE>ValueNode entry = tool.getEntry(virtual, idx);<NEW_LINE>if (virtual.isVirtualByteArrayAccess(tool.getMetaAccessExtensionProvider(), elementKind())) {<NEW_LINE>if (virtual.canVirtualizeLargeByteArrayUnsafeRead(entry, idx, elementKind(), tool)) {<NEW_LINE>tool.replaceWith(VirtualArrayNode.virtualizeByteArrayRead(entry<MASK><NEW_LINE>}<NEW_LINE>} else if (stamp.isCompatible(entry.stamp(NodeView.DEFAULT))) {<NEW_LINE>tool.replaceWith(entry);<NEW_LINE>} else {<NEW_LINE>assert stamp(NodeView.DEFAULT).getStackKind() == JavaKind.Int && (entry.stamp(NodeView.DEFAULT).getStackKind() == JavaKind.Long || entry.getStackKind() == JavaKind.Double || entry.getStackKind() == JavaKind.Illegal) : "Can only allow different stack kind two slot marker writes on one stot fields.";<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | , elementKind(), stamp)); |
1,355,499 | public void directoryMappingChanged() {<NEW_LINE>// copy myData under lock<NEW_LINE>HashSet<String> keys;<NEW_LINE>synchronized (myLock) {<NEW_LINE>keys = new HashSet<>(myData.keySet());<NEW_LINE>}<NEW_LINE>// collect new vcs for scheduled files<NEW_LINE>final Map<String, Pair<VirtualFile, AbstractVcs>> vFiles = new HashMap<>();<NEW_LINE>for (String key : keys) {<NEW_LINE>final VirtualFile vf = myLfs.refreshAndFindFileByIoFile(new File(key));<NEW_LINE>final AbstractVcs newVcs = (vf == null) ? null : myVcsManager.getVcsFor(vf);<NEW_LINE>vFiles.put(key, vf == null ? Pair.create((VirtualFile) null, (AbstractVcs) null) : Pair.create(vf, newVcs));<NEW_LINE>}<NEW_LINE>synchronized (myLock) {<NEW_LINE>keys = new HashSet<>(myData.keySet());<NEW_LINE>for (String key : keys) {<NEW_LINE>final Pair<VcsRoot, VcsRevisionNumber> <MASK><NEW_LINE>final VcsRoot storedVcsRoot = value.getFirst();<NEW_LINE>final Pair<VirtualFile, AbstractVcs> pair = vFiles.get(key);<NEW_LINE>if (pair == null) {<NEW_LINE>// already added with new mappings<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>final VirtualFile vf = pair.getFirst();<NEW_LINE>final AbstractVcs newVcs = pair.getSecond();<NEW_LINE>if (newVcs == null) {<NEW_LINE>myData.remove(key);<NEW_LINE>getQueue(storedVcsRoot).forceRemove(key);<NEW_LINE>} else {<NEW_LINE>final VirtualFile newRoot = myVcsManager.getVcsRootFor(vf);<NEW_LINE>final VcsRoot newVcsRoot = new VcsRoot(newVcs, newRoot);<NEW_LINE>if (!storedVcsRoot.equals(newVcsRoot)) {<NEW_LINE>switchVcs(storedVcsRoot, newVcsRoot, key);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | value = myData.get(key); |
1,323,012 | public static ListAlbumsResponse unmarshall(ListAlbumsResponse listAlbumsResponse, UnmarshallerContext context) {<NEW_LINE>listAlbumsResponse.setRequestId(context.stringValue("ListAlbumsResponse.RequestId"));<NEW_LINE>listAlbumsResponse.setCode(context.stringValue("ListAlbumsResponse.Code"));<NEW_LINE>listAlbumsResponse.setMessage(context.stringValue("ListAlbumsResponse.Message"));<NEW_LINE>listAlbumsResponse.setNextCursor(context.stringValue("ListAlbumsResponse.NextCursor"));<NEW_LINE>listAlbumsResponse.setTotalCount(context.integerValue("ListAlbumsResponse.TotalCount"));<NEW_LINE>listAlbumsResponse.setAction(context.stringValue("ListAlbumsResponse.Action"));<NEW_LINE>List<Album> albums = new ArrayList<Album>();<NEW_LINE>for (int i = 0; i < context.lengthValue("ListAlbumsResponse.Albums.Length"); i++) {<NEW_LINE>Album album = new Album();<NEW_LINE>album.setId(context.longValue("ListAlbumsResponse.Albums[" + i + "].Id"));<NEW_LINE>album.setIdStr(context.stringValue("ListAlbumsResponse.Albums[" + i + "].IdStr"));<NEW_LINE>album.setName(context.stringValue("ListAlbumsResponse.Albums[" + i + "].Name"));<NEW_LINE>album.setState(context.stringValue("ListAlbumsResponse.Albums[" + i + "].State"));<NEW_LINE>album.setRemark(context.stringValue("ListAlbumsResponse.Albums[" + i + "].Remark"));<NEW_LINE>album.setPhotosCount(context.longValue("ListAlbumsResponse.Albums[" + i + "].PhotosCount"));<NEW_LINE>album.setCtime(context.longValue("ListAlbumsResponse.Albums[" + i + "].Ctime"));<NEW_LINE>album.setMtime(context.longValue("ListAlbumsResponse.Albums[" + i + "].Mtime"));<NEW_LINE>Cover cover = new Cover();<NEW_LINE>cover.setId(context.longValue("ListAlbumsResponse.Albums[" + i + "].Cover.Id"));<NEW_LINE>cover.setIdStr(context.stringValue("ListAlbumsResponse.Albums[" + i + "].Cover.IdStr"));<NEW_LINE>cover.setTitle(context.stringValue("ListAlbumsResponse.Albums[" + i + "].Cover.Title"));<NEW_LINE>cover.setFileId(context.stringValue("ListAlbumsResponse.Albums[" + i + "].Cover.FileId"));<NEW_LINE>cover.setState(context.stringValue<MASK><NEW_LINE>cover.setMd5(context.stringValue("ListAlbumsResponse.Albums[" + i + "].Cover.Md5"));<NEW_LINE>cover.setIsVideo(context.booleanValue("ListAlbumsResponse.Albums[" + i + "].Cover.IsVideo"));<NEW_LINE>cover.setRemark(context.stringValue("ListAlbumsResponse.Albums[" + i + "].Cover.Remark"));<NEW_LINE>cover.setWidth(context.longValue("ListAlbumsResponse.Albums[" + i + "].Cover.Width"));<NEW_LINE>cover.setHeight(context.longValue("ListAlbumsResponse.Albums[" + i + "].Cover.Height"));<NEW_LINE>cover.setCtime(context.longValue("ListAlbumsResponse.Albums[" + i + "].Cover.Ctime"));<NEW_LINE>cover.setMtime(context.longValue("ListAlbumsResponse.Albums[" + i + "].Cover.Mtime"));<NEW_LINE>album.setCover(cover);<NEW_LINE>albums.add(album);<NEW_LINE>}<NEW_LINE>listAlbumsResponse.setAlbums(albums);<NEW_LINE>return listAlbumsResponse;<NEW_LINE>} | ("ListAlbumsResponse.Albums[" + i + "].Cover.State")); |
1,460,696 | public String functionSignature(int tabs, String typeReturn, String name, String... arguments) {<NEW_LINE>// Remove empty arguments. It can be easier to add empty strings than to filter them in advance<NEW_LINE>List<String> <MASK><NEW_LINE>for (String argument : arguments) {<NEW_LINE>if (argument.isEmpty())<NEW_LINE>continue;<NEW_LINE>realArguments.add(argument);<NEW_LINE>}<NEW_LINE>String text = "";<NEW_LINE>for (int i = 0; i < tabs; i++) {<NEW_LINE>text += "\t";<NEW_LINE>}<NEW_LINE>int startCharacters = tabs * SPACE_PER_TAB;<NEW_LINE>text += typeReturn + " " + name + "(" + (arguments.length == 0 ? "" : " ");<NEW_LINE>startCharacters += text.length() - tabs;<NEW_LINE>int lineLength = startCharacters;<NEW_LINE>for (int argIdx = 0; argIdx < realArguments.size(); argIdx++) {<NEW_LINE>String argument = realArguments.get(argIdx);<NEW_LINE>if (lineLength + argument.length() > MAX_LINE_LENGTH) {<NEW_LINE>text += "\n";<NEW_LINE>for (int i = 0; i < startCharacters / 4; i++) {<NEW_LINE>text += "\t";<NEW_LINE>}<NEW_LINE>for (int i = 0; i < startCharacters % 4; i++) {<NEW_LINE>text += " ";<NEW_LINE>}<NEW_LINE>lineLength = startCharacters;<NEW_LINE>}<NEW_LINE>int lengthBefore = text.length();<NEW_LINE>text += argument;<NEW_LINE>if (argIdx + 1 != realArguments.size()) {<NEW_LINE>text += ", ";<NEW_LINE>}<NEW_LINE>lineLength += text.length() - lengthBefore;<NEW_LINE>}<NEW_LINE>text += " ) {\n";<NEW_LINE>return text;<NEW_LINE>} | realArguments = new ArrayList<>(); |
1,389,729 | final DescribeRuleResult executeDescribeRule(DescribeRuleRequest describeRuleRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(describeRuleRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DescribeRuleRequest> request = null;<NEW_LINE>Response<DescribeRuleResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DescribeRuleRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(describeRuleRequest));<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.<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DescribeRule");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DescribeRuleResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DescribeRuleResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | addHandlerContext(HandlerContextKey.SERVICE_ID, "EventBridge"); |
1,295,614 | public void paint(float zoomFactor, int gotoPosition) {<NEW_LINE>if (from_element.connectOut_overrideable() && to_element.connectIn() && to_element.arrowIn()) {<NEW_LINE>Point from = from_element.getNonStdConnectOut(dir);<NEW_LINE>Point to = to_element.getNonStdConnectIn(dir);<NEW_LINE>Point to_origin = to_element.getConnect(dir);<NEW_LINE>int x = gotoPosition;<NEW_LINE>graphics.drawLine(from.x, from.y, x, from.y);<NEW_LINE>graphics.drawLine(x, from.<MASK><NEW_LINE>if (to.x == to_origin.x && to.y == to_origin.y) {<NEW_LINE>float zoom = zoomFactor;<NEW_LINE>Connector.drawArrow(graphics, zoom, x, to.y, to.x, to.y);<NEW_LINE>} else {<NEW_LINE>graphics.drawLine(x, to.y, to.x, to.y);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | y, x, to.y); |
1,678,770 | public List<PickingCandidate> query(@NonNull final PickingCandidatesQuery pickingCandidatesQuery) {<NEW_LINE>// configure the query builder<NEW_LINE>final IQueryBuilder<I_M_Picking_Candidate> queryBuilder = queryBL.createQueryBuilder(I_M_Picking_Candidate.class).addOnlyActiveRecordsFilter();<NEW_LINE>//<NEW_LINE>// Shipment schedules<NEW_LINE>if (!Check.isEmpty(pickingCandidatesQuery.getShipmentScheduleIds())) {<NEW_LINE>queryBuilder.addInArrayFilter(I_M_Picking_Candidate.COLUMN_M_ShipmentSchedule_ID, pickingCandidatesQuery.getShipmentScheduleIds());<NEW_LINE>}<NEW_LINE>//<NEW_LINE>// Not Closed + Not Rack System Picking slots<NEW_LINE>if (pickingCandidatesQuery.isOnlyNotClosedOrNotRackSystem()) {<NEW_LINE>final IHUPickingSlotDAO huPickingSlotsRepo = Services.get(IHUPickingSlotDAO.class);<NEW_LINE>final Set<PickingSlotId> rackSystemPickingSlotIds = huPickingSlotsRepo.retrieveAllPickingSlotIdsWhichAreRackSystems();<NEW_LINE>queryBuilder.addCompositeQueryFilter().setJoinOr().addNotEqualsFilter(I_M_Picking_Candidate.COLUMN_Status, PickingCandidateStatus.Closed.getCode()).addNotInArrayFilter(I_M_Picking_Candidate.COLUMN_M_PickingSlot_ID, rackSystemPickingSlotIds);<NEW_LINE>}<NEW_LINE>//<NEW_LINE>// Only Picking Slots<NEW_LINE>if (!pickingCandidatesQuery.getOnlyPickingSlotIds().isEmpty()) {<NEW_LINE>queryBuilder.addInArrayFilter(I_M_Picking_Candidate.COLUMN_M_PickingSlot_ID, pickingCandidatesQuery.getOnlyPickingSlotIds());<NEW_LINE>}<NEW_LINE>//<NEW_LINE>// Picking slot Barcode filter<NEW_LINE>final PickingSlotQRCode pickingSlotQRCode = pickingCandidatesQuery.getPickingSlotQRCode();<NEW_LINE>if (pickingSlotQRCode != null) {<NEW_LINE>final IPickingSlotDAO pickingSlotDAO = Services.get(IPickingSlotDAO.class);<NEW_LINE>final Set<PickingSlotId> pickingSlotIds = pickingSlotDAO.retrievePickingSlotIds(PickingSlotQuery.builder().qrCode(pickingSlotQRCode).build());<NEW_LINE>if (pickingSlotIds.isEmpty()) {<NEW_LINE>return ImmutableList.of();<NEW_LINE>}<NEW_LINE>queryBuilder.addInArrayFilter(I_M_Picking_Candidate.COLUMN_M_PickingSlot_ID, pickingSlotIds);<NEW_LINE>}<NEW_LINE>//<NEW_LINE>// HU filter: not already shipped<NEW_LINE>if (!pickingCandidatesQuery.isIncludeShippedHUs()) {<NEW_LINE>final IQuery<I_M_HU> husQuery = // not already shipped (https://github.com/metasfresh/metasfresh-webui-api/issues/647)<NEW_LINE>queryBL.createQueryBuilder(I_M_HU.class).// not already shipped (https://github.com/metasfresh/metasfresh-webui-api/issues/647)<NEW_LINE>addNotEqualsFilter(// not already shipped (https://github.com/metasfresh/metasfresh-webui-api/issues/647)<NEW_LINE>I_M_HU.COLUMNNAME_HUStatus, X_M_HU.HUSTATUS_Shipped).create();<NEW_LINE>// PickFrom HU<NEW_LINE>queryBuilder.addCompositeQueryFilter().setJoinOr().addEqualsFilter(I_M_Picking_Candidate.COLUMN_PickFrom_HU_ID, null).addInSubQueryFilter(I_M_Picking_Candidate.COLUMN_PickFrom_HU_ID, I_M_HU.COLUMN_M_HU_ID, husQuery);<NEW_LINE>// Picked HU<NEW_LINE>queryBuilder.addCompositeQueryFilter().setJoinOr().addEqualsFilter(I_M_Picking_Candidate.COLUMN_M_HU_ID, null).addInSubQueryFilter(I_M_Picking_Candidate.<MASK><NEW_LINE>}<NEW_LINE>//<NEW_LINE>// Execute query & Fetch picking candidates<NEW_LINE>return queryBuilder.orderBy(I_M_Picking_Candidate.COLUMNNAME_M_Picking_Candidate_ID).create().stream().collect(toPickingCandidatesList());<NEW_LINE>} | COLUMN_M_HU_ID, I_M_HU.COLUMN_M_HU_ID, husQuery); |
264,242 | public Object evaluate(DeferredObject[] arg0) throws HiveException {<NEW_LINE>// // if keyInspector has been set<NEW_LINE>if (this.keyInspector != null) {<NEW_LINE>Object key = keyInspector.getPrimitiveJavaObject(arg0[0].get());<NEW_LINE>String mapFileName = this.fileNameInspector.getPrimitiveJavaObject(arg0[1].get());<NEW_LINE>Map<Object, Object> map = getLocalMap(mapFileName);<NEW_LINE>return map.get(key);<NEW_LINE>} else {<NEW_LINE>Object mapFNameObj;<NEW_LINE>if (arg0.length == 1) {<NEW_LINE>mapFNameObj = arg0[0].get();<NEW_LINE>} else {<NEW_LINE>mapFNameObj = arg0[1].get();<NEW_LINE>}<NEW_LINE>String mapFileName = this.fileNameInspector.getPrimitiveJavaObject(mapFNameObj);<NEW_LINE>Map<Object, <MASK><NEW_LINE>return map;<NEW_LINE>}<NEW_LINE>} | Object> map = getLocalMap(mapFileName); |
1,080,399 | protected static BeanEntityLayout makeLayout(Class<? extends AbstractBeanEntity> type) {<NEW_LINE>BeanEntityLayout res = cache.get(type);<NEW_LINE>if (res != null) {<NEW_LINE>return res;<NEW_LINE>}<NEW_LINE>DynamicClassLoader dlc = new DynamicClassLoader(type.getClassLoader());<NEW_LINE>Map<String, BeanAttributeGetter> attrs = new HashMap<>();<NEW_LINE>List<TypedName<?>> names = new ArrayList<>();<NEW_LINE>for (Method m : type.getMethods()) {<NEW_LINE>EntityAttribute annot = m.getAnnotation(EntityAttribute.class);<NEW_LINE>if (annot != null) {<NEW_LINE>BeanAttributeGetter gfunc = generateGetter(dlc, type, m);<NEW_LINE>attrs.put(annot.value(), gfunc);<NEW_LINE>names.add(TypedName.create(annot.value(), TypeToken.of(m.getGenericReturnType())));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>AttributeSet aset = AttributeSet.create(names);<NEW_LINE>ImmutableList.Builder<BeanAttributeGetter> mhlb = ImmutableList.builder();<NEW_LINE>for (String name : aset.nameSet()) {<NEW_LINE>mhlb.add<MASK><NEW_LINE>}<NEW_LINE>res = new BeanEntityLayout(aset, mhlb.build());<NEW_LINE>cache.put(type, res);<NEW_LINE>return res;<NEW_LINE>} | (attrs.get(name)); |
226,217 | public CertificateValidator validateTimestamps() throws GeneralSecurityException {<NEW_LINE>if (!_timestampValidationEnabled)<NEW_LINE>return this;<NEW_LINE>for (int i = 0; i < _certChain.length; i++) {<NEW_LINE>X509Certificate x509Certificate = _certChain[i];<NEW_LINE>if (x509Certificate.getNotBefore().getTime() > Time.currentTimeMillis()) {<NEW_LINE>String serialNumber = x509Certificate.getSerialNumber().toString(16).replaceAll("..(?!$)", "$0 ");<NEW_LINE>String message = "certificate with serialnumber '" + serialNumber + "' is not valid yet: " + x509Certificate.getNotBefore().toString();<NEW_LINE>throw new GeneralSecurityException(message);<NEW_LINE>}<NEW_LINE>if (x509Certificate.getNotAfter().getTime() < Time.currentTimeMillis()) {<NEW_LINE>String serialNumber = x509Certificate.getSerialNumber().toString(16<MASK><NEW_LINE>String message = "certificate with serialnumber '" + serialNumber + "' has expired on: " + x509Certificate.getNotAfter().toString();<NEW_LINE>throw new GeneralSecurityException(message);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return this;<NEW_LINE>} | ).replaceAll("..(?!$)", "$0 "); |
384,789 | protected ExecutableDdlJob doCreate() {<NEW_LINE>boolean isNewPart = DbInfoManager.getInstance().isNewPartitionDb(schemaName);<NEW_LINE>TableGroupConfig tableGroupConfig = isNewPart ? physicalPlanData.getTableGroupConfig() : null;<NEW_LINE>DdlTask validateTask = new TruncateTableValidateTask(schemaName, logicalTableName, tableGroupConfig);<NEW_LINE>DdlTask primaryPhyTruncateTask = new TruncateTablePhyDdlTask(schemaName, physicalPlanData);<NEW_LINE>ExecutableDdlJob executableDdlJob = new ExecutableDdlJob();<NEW_LINE>List<DdlTask> taskList = new ArrayList<>(gsiPhyTruncatePlanMap.size() * 2);<NEW_LINE>taskList.add(validateTask);<NEW_LINE>taskList.add(primaryPhyTruncateTask.onExceptionTryRecoveryThenRollback());<NEW_LINE>gsiPhyTruncatePlanMap.forEach((gsiName, gsiPhysicalPlanData) -> {<NEW_LINE>DdlTask gsiTask <MASK><NEW_LINE>taskList.add(gsiTask.onExceptionTryRecoveryThenRollback());<NEW_LINE>});<NEW_LINE>DdlTask cdcDdlMarkTask = new CdcDdlMarkTask(schemaName, physicalPlanData);<NEW_LINE>taskList.add(cdcDdlMarkTask);<NEW_LINE>executableDdlJob.addSequentialTasks(taskList);<NEW_LINE>return executableDdlJob;<NEW_LINE>} | = new TruncateTablePhyDdlTask(schemaName, gsiPhysicalPlanData); |
318,426 | private void writeCalculatedDeltaShard(DataOutputStream os, int shardNumber) throws IOException {<NEW_LINE>// / 1) max ordinal<NEW_LINE>VarInt.writeVInt(os, maxShardOrdinal[shardNumber]);<NEW_LINE>// / 2) removal / addition ordinals.<NEW_LINE>VarInt.writeVLong(os, deltaRemovedOrdinals[shardNumber].length());<NEW_LINE>deltaRemovedOrdinals[shardNumber].getUnderlyingArray().writeTo(os, 0, deltaRemovedOrdinals[shardNumber].length());<NEW_LINE>VarInt.writeVLong(os, deltaAddedOrdinals[shardNumber].length());<NEW_LINE>deltaAddedOrdinals[shardNumber].getUnderlyingArray().writeTo(os, 0, deltaAddedOrdinals<MASK><NEW_LINE>// / 3) FixedLength field sizes<NEW_LINE>for (int i = 0; i < getSchema().numFields(); i++) {<NEW_LINE>VarInt.writeVInt(os, fieldStats.getMaxBitsForField(i));<NEW_LINE>}<NEW_LINE>// / 4) FixedLength data<NEW_LINE>long numBitsRequired = recordBitOffset[shardNumber];<NEW_LINE>long numLongsRequired = numBitsRequired == 0 ? 0 : ((numBitsRequired - 1) / 64) + 1;<NEW_LINE>fixedLengthLongArray[shardNumber].writeTo(os, numLongsRequired);<NEW_LINE>// / 5) VarLength data<NEW_LINE>for (int i = 0; i < varLengthByteArrays[shardNumber].length; i++) {<NEW_LINE>if (varLengthByteArrays[shardNumber][i] == null) {<NEW_LINE>VarInt.writeVLong(os, 0);<NEW_LINE>} else {<NEW_LINE>VarInt.writeVLong(os, varLengthByteArrays[shardNumber][i].length());<NEW_LINE>varLengthByteArrays[shardNumber][i].getUnderlyingArray().writeTo(os, 0, varLengthByteArrays[shardNumber][i].length());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | [shardNumber].length()); |
797,683 | protected void doImportSelectionAction(Program program, ProgramSelection selection) {<NEW_LINE>if (selection == null || selection.getNumAddressRanges() != 1) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// should only be 1<NEW_LINE>AddressRange range = selection.getFirstRange();<NEW_LINE>if (range.getLength() >= Integer.MAX_VALUE) {<NEW_LINE>Msg.showInfo(getClass(), tool.getActiveWindow(), "Selection Too Large", "The selection is too large to extract.");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>Memory memory = program.getMemory();<NEW_LINE>FileSystemService fsService = FileSystemService.getInstance();<NEW_LINE>// create a tmp ByteProvider that contains the bytes from the selected region<NEW_LINE>FileCacheEntry tmpFile;<NEW_LINE>try (FileCacheEntryBuilder tmpFileBuilder = fsService.createTempFile(range.getLength())) {<NEW_LINE>byte[] bytes = new byte[(int) range.getLength()];<NEW_LINE>memory.getBytes(range.getMinAddress(), bytes);<NEW_LINE>tmpFileBuilder.write(bytes);<NEW_LINE>tmpFile = tmpFileBuilder.finish();<NEW_LINE>}<NEW_LINE>MemoryBlock block = memory.getBlock(range.getMinAddress());<NEW_LINE>String rangeName = block.getName() + "[" + range.getMinAddress() + "," <MASK><NEW_LINE>ByteProvider bp = fsService.getNamedTempFile(tmpFile, program.getName() + " " + rangeName);<NEW_LINE>LoaderMap loaderMap = LoaderService.getAllSupportedLoadSpecs(bp);<NEW_LINE>ImporterDialog importerDialog = new ImporterDialog(tool, tool.getService(ProgramManager.class), loaderMap, bp, null);<NEW_LINE>tool.showDialog(importerDialog);<NEW_LINE>} catch (IOException e) {<NEW_LINE>Msg.showError(this, null, "I/O Error Occurred", e.getMessage(), e);<NEW_LINE>} catch (MemoryAccessException e) {<NEW_LINE>Msg.showError(this, null, "Memory Access Error Occurred", e.getMessage(), e);<NEW_LINE>}<NEW_LINE>} | + range.getMaxAddress() + "]"; |
512,433 | private Object[] tryToConvertLineToHyperlink(Project project, String line) {<NEW_LINE>// pattern is "at ...... (file:line:column)"<NEW_LINE>// file can be also http:// url<NEW_LINE>if (!line.endsWith(")")) {<NEW_LINE>return tryToConvertLineURLToHyperlink(project, line);<NEW_LINE>}<NEW_LINE>int start = line.lastIndexOf('(');<NEW_LINE>if (start == -1) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>int lineNumberEnd = line.lastIndexOf(':');<NEW_LINE>if (lineNumberEnd == -1) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>int fileEnd = line.<MASK><NEW_LINE>if (fileEnd == -1) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>if (start >= fileEnd) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>int lineNumber = -1;<NEW_LINE>int columnNumber = -1;<NEW_LINE>try {<NEW_LINE>lineNumber = Integer.parseInt(line.substring(fileEnd + 1, lineNumberEnd));<NEW_LINE>columnNumber = Integer.parseInt(line.substring(lineNumberEnd + 1, line.length() - 1));<NEW_LINE>} catch (NumberFormatException e) {<NEW_LINE>// ignore<NEW_LINE>}<NEW_LINE>if (columnNumber != -1 && lineNumber == -1) {<NEW_LINE>// perhaps stack trace had only line number:<NEW_LINE>lineNumber = columnNumber;<NEW_LINE>}<NEW_LINE>if (lineNumber == -1) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>String file = line.substring(start + 1, fileEnd);<NEW_LINE>if (file.length() == 0) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>String s1 = line.substring(0, start);<NEW_LINE>// NOI18N<NEW_LINE>String // NOI18N<NEW_LINE>s2 = "(" + getProjectPath(project, file) + line.substring(fileEnd, line.length());<NEW_LINE>MyListener l = new MyListener(project, file, lineNumber, columnNumber);<NEW_LINE>return new Object[] { l, s1, s2 };<NEW_LINE>} | lastIndexOf(':', lineNumberEnd - 1); |
143,066 | final GetModelPackageGroupPolicyResult executeGetModelPackageGroupPolicy(GetModelPackageGroupPolicyRequest getModelPackageGroupPolicyRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(getModelPackageGroupPolicyRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<GetModelPackageGroupPolicyRequest> request = null;<NEW_LINE>Response<GetModelPackageGroupPolicyResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new GetModelPackageGroupPolicyRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(getModelPackageGroupPolicyRequest));<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, "GetModelPackageGroupPolicy");<NEW_LINE>request.<MASK><NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<GetModelPackageGroupPolicyResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new GetModelPackageGroupPolicyResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig); |
973,894 | protected LinkedList<String> splitIntoAllophones(String phoneString) {<NEW_LINE>LinkedList<String> phoneList <MASK><NEW_LINE>for (int i = 0; i < phoneString.length(); i++) {<NEW_LINE>// Try to cut off individual segments,<NEW_LINE>// starting with the longest prefixes,<NEW_LINE>// and allowing for a suffix "1" marking stress:<NEW_LINE>String name = null;<NEW_LINE>for (int j = 3; j >= 1; j--) {<NEW_LINE>if (i + j <= phoneString.length()) {<NEW_LINE>String candidate = phoneString.substring(i, i + j);<NEW_LINE>try {<NEW_LINE>allophoneSet.getAllophone(candidate);<NEW_LINE>name = candidate;<NEW_LINE>// so that the next i++ goes beyond current phone<NEW_LINE>i += j - 1;<NEW_LINE>break;<NEW_LINE>} catch (IllegalArgumentException e) {<NEW_LINE>// ignore<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (name != null) {<NEW_LINE>phoneList.add(name);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return phoneList;<NEW_LINE>} | = new LinkedList<String>(); |
1,274,578 | public com.amazonaws.services.organizations.model.CreateAccountStatusNotFoundException unmarshallFromContext(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>com.amazonaws.services.organizations.model.CreateAccountStatusNotFoundException createAccountStatusNotFoundException = new com.amazonaws.services.organizations.model.CreateAccountStatusNotFoundException(null);<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE><MASK><NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return createAccountStatusNotFoundException;<NEW_LINE>} | JsonToken token = context.getCurrentToken(); |
1,499,497 | public static BidirectionalIndexLookup<String> fromTextFileWithIndex(Path path, char delimiter) throws IOException {<NEW_LINE>if (!path.toFile().exists()) {<NEW_LINE>throw new IllegalArgumentException("File " + path + " does not exist.");<NEW_LINE>}<NEW_LINE>List<String> lines = TextIO.loadLines(path);<NEW_LINE>UIntValueMap<String> indexLookup = new UIntValueMap<>(lines.size());<NEW_LINE>UIntMap<String> wordLookup = new UIntMap<>(lines.size());<NEW_LINE>for (String line : lines) {<NEW_LINE>StringPair pair = StringPair.fromString(line, delimiter);<NEW_LINE>String word = pair.first;<NEW_LINE>int index = <MASK><NEW_LINE>if (indexLookup.contains(word)) {<NEW_LINE>throw new IllegalArgumentException("Duplicated word in line : [" + line + "]");<NEW_LINE>}<NEW_LINE>if (wordLookup.containsKey(index)) {<NEW_LINE>throw new IllegalArgumentException("Duplicated index in line : [" + line + "]");<NEW_LINE>}<NEW_LINE>if (index < 0) {<NEW_LINE>throw new IllegalArgumentException("Index Value cannot be negative : [" + line + "]");<NEW_LINE>}<NEW_LINE>indexLookup.put(word, index);<NEW_LINE>wordLookup.put(index, word);<NEW_LINE>}<NEW_LINE>return new BidirectionalIndexLookup<>(indexLookup, wordLookup);<NEW_LINE>} | Integer.parseInt(pair.second); |
434,082 | public int compareTo(TKeyExtent other) {<NEW_LINE>if (!getClass().equals(other.getClass())) {<NEW_LINE>return getClass().getName().compareTo(other.getClass().getName());<NEW_LINE>}<NEW_LINE>int lastComparison = 0;<NEW_LINE>lastComparison = java.lang.Boolean.compare(isSetTable(<MASK><NEW_LINE>if (lastComparison != 0) {<NEW_LINE>return lastComparison;<NEW_LINE>}<NEW_LINE>if (isSetTable()) {<NEW_LINE>lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.table, other.table);<NEW_LINE>if (lastComparison != 0) {<NEW_LINE>return lastComparison;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>lastComparison = java.lang.Boolean.compare(isSetEndRow(), other.isSetEndRow());<NEW_LINE>if (lastComparison != 0) {<NEW_LINE>return lastComparison;<NEW_LINE>}<NEW_LINE>if (isSetEndRow()) {<NEW_LINE>lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.endRow, other.endRow);<NEW_LINE>if (lastComparison != 0) {<NEW_LINE>return lastComparison;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>lastComparison = java.lang.Boolean.compare(isSetPrevEndRow(), other.isSetPrevEndRow());<NEW_LINE>if (lastComparison != 0) {<NEW_LINE>return lastComparison;<NEW_LINE>}<NEW_LINE>if (isSetPrevEndRow()) {<NEW_LINE>lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.prevEndRow, other.prevEndRow);<NEW_LINE>if (lastComparison != 0) {<NEW_LINE>return lastComparison;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return 0;<NEW_LINE>} | ), other.isSetTable()); |
1,172,893 | // Register late start callbacks with a policy executor. Verify that at most one can be registered,<NEW_LINE>// that the most recently registered replaces any previous ones, and that the late start callback<NEW_LINE>// can be unregistered by supplying null. Verify that the late start callback is notified when a<NEW_LINE>// task starts after the designated threshold.<NEW_LINE>@Test<NEW_LINE>public void testLateStartCallback() throws Exception {<NEW_LINE>PolicyExecutor executor = provider.create("testLateStartCallback").maxConcurrency(1).maxQueueSize(1).maxWaitForEnqueue(TimeUnit.NANOSECONDS.toMillis(TIMEOUT_NS));<NEW_LINE>CountDownLatch lateBy3MinutesLatch = new CountDownLatch(1);<NEW_LINE><MASK><NEW_LINE>assertNull(executor.registerLateStartCallback(3, TimeUnit.MINUTES, lateBy3MinutesCallback));<NEW_LINE>// use up maxConcurrency<NEW_LINE>CountDownLatch blocker1StartedLatch = new CountDownLatch(1);<NEW_LINE>CountDownLatch blockerContinueLatch = new CountDownLatch(1);<NEW_LINE>CountDownTask blocker1Task = new CountDownTask(blocker1StartedLatch, blockerContinueLatch, TimeUnit.MINUTES.toNanos(9));<NEW_LINE>Future<Boolean> blocker1Future = executor.submit(blocker1Task);<NEW_LINE>// queue another task<NEW_LINE>PolicyTaskFuture<Integer> lateTaskFuture = executor.submit(new SharedIncrementTask(), 1, null);<NEW_LINE>assertTrue(blocker1StartedLatch.await(TIMEOUT_NS, TimeUnit.NANOSECONDS));<NEW_LINE>assertEquals(1, lateBy3MinutesLatch.getCount());<NEW_LINE>// new registration replaces previous<NEW_LINE>CountDownLatch lateBy200MillisLatch = new CountDownLatch(1);<NEW_LINE>Runnable lateBy200MillisCallback = new CountDownCallback(lateBy200MillisLatch);<NEW_LINE>assertEquals(lateBy3MinutesCallback, executor.registerLateStartCallback(200, TimeUnit.MILLISECONDS, lateBy200MillisCallback));<NEW_LINE>// wait for task to become late, and then allow it to run<NEW_LINE>// extra 100ms tolerance<NEW_LINE>TimeUnit.MILLISECONDS.sleep(300 - lateTaskFuture.getElapsedAcceptTime(TimeUnit.MILLISECONDS) - lateTaskFuture.getElapsedQueueTime(TimeUnit.MILLISECONDS));<NEW_LINE>blockerContinueLatch.countDown();<NEW_LINE>assertTrue(lateBy200MillisLatch.await(TIMEOUT_NS, TimeUnit.NANOSECONDS));<NEW_LINE>assertEquals(1, lateBy3MinutesLatch.getCount());<NEW_LINE>// register another callback which hasn't been reached<NEW_LINE>assertNull(executor.registerLateStartCallback(3, TimeUnit.MINUTES, lateBy3MinutesCallback));<NEW_LINE>assertEquals(1, lateBy3MinutesLatch.getCount());<NEW_LINE>assertEquals(Integer.valueOf(1), lateTaskFuture.get(TIMEOUT_NS, TimeUnit.NANOSECONDS));<NEW_LINE>assertTrue(blocker1Future.isDone());<NEW_LINE>assertFalse(blocker1Future.isCancelled());<NEW_LINE>executor.shutdown();<NEW_LINE>assertTrue(executor.awaitTermination(TIMEOUT_NS, TimeUnit.NANOSECONDS));<NEW_LINE>// never invoked<NEW_LINE>assertEquals(1, lateBy3MinutesLatch.getCount());<NEW_LINE>try {<NEW_LINE>Runnable previous = executor.registerLateStartCallback(5, TimeUnit.SECONDS, new CountDownCallback(new CountDownLatch(1)));<NEW_LINE>fail("Should not be able to register callback after shutdown. Result of register was: " + previous);<NEW_LINE>} catch (IllegalStateException x) {<NEW_LINE>}<NEW_LINE>// pass<NEW_LINE>} | Runnable lateBy3MinutesCallback = new CountDownCallback(lateBy3MinutesLatch); |
1,476,629 | public static ListTagResourcesResponse unmarshall(ListTagResourcesResponse listTagResourcesResponse, UnmarshallerContext _ctx) {<NEW_LINE>listTagResourcesResponse.setRequestId(_ctx.stringValue("ListTagResourcesResponse.RequestId"));<NEW_LINE>listTagResourcesResponse.setSuccess(_ctx.booleanValue("ListTagResourcesResponse.Success"));<NEW_LINE>listTagResourcesResponse.setNextToken(_ctx.stringValue("ListTagResourcesResponse.NextToken"));<NEW_LINE>List<TagResource> tagResources = new ArrayList<TagResource>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("ListTagResourcesResponse.TagResources.Length"); i++) {<NEW_LINE>TagResource tagResource = new TagResource();<NEW_LINE>tagResource.setTagKey(_ctx.stringValue("ListTagResourcesResponse.TagResources[" + i + "].TagKey"));<NEW_LINE>tagResource.setTagValue(_ctx.stringValue<MASK><NEW_LINE>tagResource.setResourceId(_ctx.stringValue("ListTagResourcesResponse.TagResources[" + i + "].ResourceId"));<NEW_LINE>tagResource.setResourceType(_ctx.stringValue("ListTagResourcesResponse.TagResources[" + i + "].ResourceType"));<NEW_LINE>tagResources.add(tagResource);<NEW_LINE>}<NEW_LINE>listTagResourcesResponse.setTagResources(tagResources);<NEW_LINE>return listTagResourcesResponse;<NEW_LINE>} | ("ListTagResourcesResponse.TagResources[" + i + "].TagValue")); |
533,166 | public boolean shouldReplace(final TransactionInfo existingTransactionInfo, final TransactionInfo newTransactionInfo, final Optional<Wei> baseFee) {<NEW_LINE>// bail early if basefee is absent or neither transaction supports 1559 fee market<NEW_LINE>if (baseFee.isEmpty() || !(isNotGasPriced(existingTransactionInfo) || isNotGasPriced(newTransactionInfo))) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>Wei newEffPrice = priceOf(<MASK><NEW_LINE>Wei newEffPriority = newTransactionInfo.getTransaction().getEffectivePriorityFeePerGas(baseFee);<NEW_LINE>// bail early if price is not strictly positive<NEW_LINE>if (newEffPrice.equals(Wei.ZERO)) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>Wei curEffPrice = priceOf(existingTransactionInfo.getTransaction(), baseFee);<NEW_LINE>Wei curEffPriority = existingTransactionInfo.getTransaction().getEffectivePriorityFeePerGas(baseFee);<NEW_LINE>if (isBumpedBy(curEffPrice, newEffPrice, priceBump)) {<NEW_LINE>// if effective price is bumped by percent:<NEW_LINE>// replace if new effective priority is >= current effective priority<NEW_LINE>return newEffPriority.compareTo(curEffPriority) >= 0;<NEW_LINE>} else if (curEffPrice.equals(newEffPrice)) {<NEW_LINE>// elsif new effective price is equal to current effective price:<NEW_LINE>// replace if the new effective priority is bumped by priceBump relative to current priority<NEW_LINE>return isBumpedBy(curEffPriority, newEffPriority, priceBump);<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>} | newTransactionInfo.getTransaction(), baseFee); |
1,249,346 | public void initUserDirs() throws IOException {<NEW_LINE>File _userDirFile = null;<NEW_LINE>String _userDir = null;<NEW_LINE>// NOI18N<NEW_LINE>String <MASK><NEW_LINE>// NOI18N<NEW_LINE>String username = environment.get("USERNAME");<NEW_LINE>if (username != null) {<NEW_LINE>for (int i = 0; i < username.length(); i++) {<NEW_LINE>char c = username.charAt(i);<NEW_LINE>if (Character.isDigit(c) || c == '_') {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (c >= 'A' && c <= 'Z') {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (c >= 'a' && c <= 'z') {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>// NOI18N<NEW_LINE>username = "" + username.hashCode();<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// NOI18N<NEW_LINE>_userDirFile = new File(ioUserDir);<NEW_LINE>_userDir = _userDirFile.getAbsolutePath();<NEW_LINE>if (shell != null) {<NEW_LINE>_userDir = WindowsSupport.getInstance().convertToShellPath(_userDir);<NEW_LINE>}<NEW_LINE>userDirFile = _userDirFile;<NEW_LINE>userDir = _userDir;<NEW_LINE>} | ioUserDir = System.getProperty("user.home"); |
117,591 | public void linkModelToMaterialTracking(@NonNull final MTLinkRequest request) {<NEW_LINE>final I_M_Material_Tracking materialTracking = request.getMaterialTrackingRecord();<NEW_LINE>final Object model = request.getModel();<NEW_LINE>final IMaterialTrackingDAO materialTrackingDAO = <MASK><NEW_LINE>//<NEW_LINE>// Retrieve existing reference<NEW_LINE>// and if exists and it's not linked to our material tracking, delete it<NEW_LINE>final List<I_M_Material_Tracking_Ref> existingRefs = materialTrackingDAO.retrieveMaterialTrackingRefsForModel(model);<NEW_LINE>final Map<Integer, I_M_Material_Tracking_Ref> materialTrackingId2refs = Maps.uniqueIndex(existingRefs, I_M_Material_Tracking_Ref::getM_Material_Tracking_ID);<NEW_LINE>if (!existingRefs.isEmpty()) {<NEW_LINE>final I_M_Material_Tracking_Ref existingRef = materialTrackingId2refs.get(materialTracking.getM_Material_Tracking_ID());<NEW_LINE>if (existingRef != null) {<NEW_LINE>// Case: material tracking was not changed => do nothing<NEW_LINE>final BigDecimal oldQtyIssued = existingRef.getQtyIssued();<NEW_LINE>final boolean needToUpdateQtyIssued = request.getQtyIssued() != null && request.getQtyIssued().compareTo(oldQtyIssued) != 0;<NEW_LINE>final String msg;<NEW_LINE>if (needToUpdateQtyIssued) {<NEW_LINE>msg = ": M_Material_Tracking_ID=" + materialTracking.getM_Material_Tracking_ID() + " of existing M_Material_Tracking_Ref is valid; update qtyIssued from " + oldQtyIssued + " to " + request.getQtyIssued();<NEW_LINE>existingRef.setQtyIssued(request.getQtyIssued());<NEW_LINE>save(existingRef);<NEW_LINE>listeners.afterQtyIssuedChanged(existingRef, oldQtyIssued);<NEW_LINE>} else {<NEW_LINE>msg = ": M_Material_Tracking_ID=" + materialTracking.getM_Material_Tracking_ID() + " of existing M_Material_Tracking_Ref is still valid; nothing to do";<NEW_LINE>}<NEW_LINE>logRequest(request, msg);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>//<NEW_LINE>// If material tracking don't match and we're going under the assumption that they're already assigned, do NOT drop the assignment to create a new one.<NEW_LINE>// Instead, notify the user that he misconfigured something<NEW_LINE>if (IfModelAlreadyLinked.FAIL.equals(request.getIfModelAlreadyLinked())) {<NEW_LINE>String currentIds = existingRefs.stream().map(ref -> Integer.toString(ref.getM_Material_Tracking_ID())).collect(Collectors.joining(", "));<NEW_LINE>throw new AdempiereException("Cannot assign model to a different material tracking" + "\n Model: " + request.getModel() + "\n Material trackings (current): " + currentIds + "\n Material tracking (new): " + materialTracking);<NEW_LINE>} else if (IfModelAlreadyLinked.UNLINK_FROM_PREVIOUS.equals(request.getIfModelAlreadyLinked())) {<NEW_LINE>final I_M_Material_Tracking_Ref refToUnlink;<NEW_LINE>if (existingRefs.size() == 1 && request.getPreviousMaterialTrackingId() == null) {<NEW_LINE>refToUnlink = existingRefs.get(0);<NEW_LINE>} else {<NEW_LINE>refToUnlink = materialTrackingId2refs.get(request.getPreviousMaterialTrackingId());<NEW_LINE>}<NEW_LINE>if (refToUnlink != null) {<NEW_LINE>// Case: material tracking changed => delete old link<NEW_LINE>unlinkModelFromMaterialTracking(model, refToUnlink);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>//<NEW_LINE>// Create the new link<NEW_LINE>createMaterialTrackingRef(request);<NEW_LINE>} | Services.get(IMaterialTrackingDAO.class); |
1,649,258 | public void head(Node node, int depth) {<NEW_LINE>if (node instanceof TextNode) {<NEW_LINE>String text = ((TextNode) node)<MASK><NEW_LINE>if (members.containsKey(text)) {<NEW_LINE>Node parent = node.parent();<NEW_LINE>if (parent != null && !"td".equals(parent.nodeName())) {<NEW_LINE>parent = parent.parent();<NEW_LINE>}<NEW_LINE>if (parent != null && !"td".equals(parent.nodeName())) {<NEW_LINE>parent = parent.parent();<NEW_LINE>}<NEW_LINE>if (parent != null && "td".equals(parent.nodeName())) {<NEW_LINE>List<Node> siblings = parent.parent().childNodes();<NEW_LINE>List<Node> tdSiblings = new ArrayList<Node>();<NEW_LINE>siblings.forEach(n -> {<NEW_LINE>if ("td".equals(n.nodeName()))<NEW_LINE>tdSiblings.add(n);<NEW_LINE>});<NEW_LINE>if (tdSiblings.get(0) == parent && tdSiblings.size() == 3) {<NEW_LINE>Node td = tdSiblings.get(2);<NEW_LINE>String s = td.toString();<NEW_LINE>String doc = "/** " + DocFiller.removeTags(s.substring(4, s.length() - 5)) + " */";<NEW_LINE>for (Declaration d : members.get(text)) {<NEW_LINE>d.setDocumentation(doc);<NEW_LINE>}<NEW_LINE>docFiller.countDoc(false);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | .text().trim(); |
287,138 | protected void readAdditional(CompoundTag compound, boolean spawnPacket) {<NEW_LINE>super.readAdditional(compound, spawnPacket);<NEW_LINE>if (compound.contains("InitialOrientation"))<NEW_LINE>setInitialOrientation(NBTHelper.readEnum(compound, "InitialOrientation", Direction.class));<NEW_LINE>yaw = compound.getFloat("Yaw");<NEW_LINE>pitch = compound.getFloat("Pitch");<NEW_LINE><MASK><NEW_LINE>if (compound.contains("ForceYaw"))<NEW_LINE>startAtYaw(compound.getFloat("ForceYaw"));<NEW_LINE>ListTag vecNBT = compound.getList("CachedMotion", 6);<NEW_LINE>if (!vecNBT.isEmpty()) {<NEW_LINE>motionBeforeStall = new Vec3(vecNBT.getDouble(0), vecNBT.getDouble(1), vecNBT.getDouble(2));<NEW_LINE>if (!motionBeforeStall.equals(Vec3.ZERO))<NEW_LINE>targetYaw = prevYaw = yaw += yawFromVector(motionBeforeStall);<NEW_LINE>setDeltaMovement(Vec3.ZERO);<NEW_LINE>}<NEW_LINE>setCouplingId(compound.contains("OnCoupling") ? compound.getUUID("OnCoupling") : null);<NEW_LINE>} | manuallyPlaced = compound.getBoolean("Placed"); |
1,809,130 | public void marshall(SegmentDetection segmentDetection, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (segmentDetection == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(segmentDetection.getType(), TYPE_BINDING);<NEW_LINE>protocolMarshaller.marshall(segmentDetection.getStartTimestampMillis(), STARTTIMESTAMPMILLIS_BINDING);<NEW_LINE>protocolMarshaller.marshall(<MASK><NEW_LINE>protocolMarshaller.marshall(segmentDetection.getDurationMillis(), DURATIONMILLIS_BINDING);<NEW_LINE>protocolMarshaller.marshall(segmentDetection.getStartTimecodeSMPTE(), STARTTIMECODESMPTE_BINDING);<NEW_LINE>protocolMarshaller.marshall(segmentDetection.getEndTimecodeSMPTE(), ENDTIMECODESMPTE_BINDING);<NEW_LINE>protocolMarshaller.marshall(segmentDetection.getDurationSMPTE(), DURATIONSMPTE_BINDING);<NEW_LINE>protocolMarshaller.marshall(segmentDetection.getTechnicalCueSegment(), TECHNICALCUESEGMENT_BINDING);<NEW_LINE>protocolMarshaller.marshall(segmentDetection.getShotSegment(), SHOTSEGMENT_BINDING);<NEW_LINE>protocolMarshaller.marshall(segmentDetection.getStartFrameNumber(), STARTFRAMENUMBER_BINDING);<NEW_LINE>protocolMarshaller.marshall(segmentDetection.getEndFrameNumber(), ENDFRAMENUMBER_BINDING);<NEW_LINE>protocolMarshaller.marshall(segmentDetection.getDurationFrames(), DURATIONFRAMES_BINDING);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>} | segmentDetection.getEndTimestampMillis(), ENDTIMESTAMPMILLIS_BINDING); |
1,178,058 | public Optional<ColumnMapper<?>> build(Type type, ConfigRegistry config) {<NEW_LINE>if (type != Duration.class) {<NEW_LINE>return Optional.empty();<NEW_LINE>}<NEW_LINE>return Optional.of((r, i, c) -> {<NEW_LINE>final Object obj = r.getObject(i);<NEW_LINE>if (obj == null) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>if (!(obj instanceof PGInterval)) {<NEW_LINE>throw new IllegalArgumentException(String.format("got non-pginterval %s", obj));<NEW_LINE>}<NEW_LINE>final PGInterval interval = (PGInterval) obj;<NEW_LINE>if (interval.getYears() != 0 || interval.getMonths() != 0) {<NEW_LINE>throw new IllegalArgumentException(String.format("pginterval \"%s\" not representable as duration", interval.getValue()));<NEW_LINE>}<NEW_LINE>final double seconds = interval.getSeconds();<NEW_LINE>if (seconds > Long.MAX_VALUE || seconds < Long.MIN_VALUE) {<NEW_LINE>throw new IllegalArgumentException(String.format("pginterval \"%s\" has seconds too extreme to represent as duration", interval.getValue()));<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>final long nanos = BigDecimal.valueOf(seconds).subtract(BigDecimal.valueOf(secondsLong)).movePointRight(9).longValue();<NEW_LINE>return Duration.ofDays(interval.getDays()).plusHours(interval.getHours()).plusMinutes(interval.getMinutes()).plusSeconds(secondsLong).plusNanos(nanos);<NEW_LINE>});<NEW_LINE>} | final long secondsLong = (long) seconds; |
289,555 | private void populateRole(EjbRelationshipRole ejbR, RelationshipRole role) {<NEW_LINE>ejbR.setCascadeDelete(role.isCascade());<NEW_LINE>RelationshipRoleSource source = ejbR.newRelationshipRoleSource();<NEW_LINE>source.setEjbName(ejbnames.getEntityEjbNamePrefix() + role.getEntityName() + ejbnames.getEntityEjbNameSuffix());<NEW_LINE>ejbR.setRelationshipRoleSource(source);<NEW_LINE>CmrField cmrField = ejbR.newCmrField();<NEW_LINE>cmrField.setCmrFieldName(role.getFieldName());<NEW_LINE>if (role.isMany()) {<NEW_LINE>ejbR.setMultiplicity(ejbR.MULTIPLICITY_MANY);<NEW_LINE>} else {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>if (role.isToMany()) {<NEW_LINE>cmrField.setCmrFieldType(java.util.Collection.class.getName());<NEW_LINE>}<NEW_LINE>ejbR.setCmrField(cmrField);<NEW_LINE>ejbR.setEjbRelationshipRoleName(role.getEntityName());<NEW_LINE>} | ejbR.setMultiplicity(ejbR.MULTIPLICITY_ONE); |
388,329 | public Builder mergeFrom(ai.onnx.proto.OnnxMl.TensorShapeProto other) {<NEW_LINE>if (other == ai.onnx.proto.OnnxMl.TensorShapeProto.getDefaultInstance())<NEW_LINE>return this;<NEW_LINE>if (dimBuilder_ == null) {<NEW_LINE>if (!other.dim_.isEmpty()) {<NEW_LINE>if (dim_.isEmpty()) {<NEW_LINE>dim_ = other.dim_;<NEW_LINE>bitField0_ = (bitField0_ & ~0x00000001);<NEW_LINE>} else {<NEW_LINE>ensureDimIsMutable();<NEW_LINE>dim_.addAll(other.dim_);<NEW_LINE>}<NEW_LINE>onChanged();<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>if (!other.dim_.isEmpty()) {<NEW_LINE>if (dimBuilder_.isEmpty()) {<NEW_LINE>dimBuilder_.dispose();<NEW_LINE>dimBuilder_ = null;<NEW_LINE>dim_ = other.dim_;<NEW_LINE>bitField0_ = (bitField0_ & ~0x00000001);<NEW_LINE>dimBuilder_ = com.google.protobuf.GeneratedMessageV3<MASK><NEW_LINE>} else {<NEW_LINE>dimBuilder_.addAllMessages(other.dim_);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>this.mergeUnknownFields(other.unknownFields);<NEW_LINE>onChanged();<NEW_LINE>return this;<NEW_LINE>} | .alwaysUseFieldBuilders ? getDimFieldBuilder() : null; |
331,418 | final ListApprovedOriginsResult executeListApprovedOrigins(ListApprovedOriginsRequest listApprovedOriginsRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(listApprovedOriginsRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<ListApprovedOriginsRequest> request = null;<NEW_LINE>Response<ListApprovedOriginsResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new ListApprovedOriginsRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(listApprovedOriginsRequest));<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(<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "Connect");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ListApprovedOrigins");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<ListApprovedOriginsResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new ListApprovedOriginsResultJsonUnmarshaller());<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.SIGNING_REGION, getSigningRegion()); |
1,392,350 | private boolean executeWithJSObjectValueInner(JSDynamicObject target, HolesJSObjectArray jsobjectArray, long index, JSDynamicObject value, WriteElementNode root) {<NEW_LINE>if (holesArrayNeedsSlowSet(target, jsobjectArray, index, root)) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>boolean containsHoles = containsHolesProfile.profile(containsHoles(target, jsobjectArray, index));<NEW_LINE>if (containsHoles && inBoundsFastCondition.profile(jsobjectArray.isInBoundsFast(target, index))) {<NEW_LINE>assert !HolesJSObjectArray.isHoleValue(value);<NEW_LINE>if (inBoundsFastHoleCondition.profile(jsobjectArray.isHoleFast(target, (int) index))) {<NEW_LINE>jsobjectArray.setInBoundsFastHole(target, (int) index, value);<NEW_LINE>} else {<NEW_LINE>jsobjectArray.setInBoundsFastNonHole(target, (int) index, value);<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>} else if (containsHoles && inBoundsCondition.profile(jsobjectArray.isInBounds(target, (int) index))) {<NEW_LINE>assert !HolesJSObjectArray.isHoleValue(value);<NEW_LINE>jsobjectArray.setInBounds(target, (<MASK><NEW_LINE>return true;<NEW_LINE>} else if (containsHoles && supportedContainsHolesCondition.profile(jsobjectArray.isSupported(target, index))) {<NEW_LINE>assert !HolesJSObjectArray.isHoleValue(value);<NEW_LINE>jsobjectArray.setSupported(target, (int) index, value, profile);<NEW_LINE>return true;<NEW_LINE>} else {<NEW_LINE>ScriptArray toArrayType;<NEW_LINE>if (!containsHoles && supportedNotContainsHolesCondition.profile(jsobjectArray.isSupported(target, index))) {<NEW_LINE>toArrayType = jsobjectArray.toNonHoles(target, index, value);<NEW_LINE>} else {<NEW_LINE>assert jsobjectArray.isSparse(target, index);<NEW_LINE>toArrayType = jsobjectArray.toSparse(target, index, value);<NEW_LINE>}<NEW_LINE>return setArrayAndWrite(toArrayType, target, index, value, root);<NEW_LINE>}<NEW_LINE>} | int) index, value, profile); |
453,815 | protected void configure() {<NEW_LINE>bind(RequestHelper.class).in(Scopes.SINGLETON);<NEW_LINE>bind(MetadataManager.class).in(Scopes.SINGLETON);<NEW_LINE>bind(StateManager.class).in(Scopes.SINGLETON);<NEW_LINE>bind(TaskManager.class).in(Scopes.SINGLETON);<NEW_LINE>bind(DeployManager.class).in(Scopes.SINGLETON);<NEW_LINE>bind(RackManager.class).in(Scopes.SINGLETON);<NEW_LINE>bind(RequestManager.class).in(Scopes.SINGLETON);<NEW_LINE>bind(AgentManager.class).in(Scopes.SINGLETON);<NEW_LINE>bind(InactiveAgentManager.class).in(Scopes.SINGLETON);<NEW_LINE>bind(TaskRequestManager.class).in(Scopes.SINGLETON);<NEW_LINE>bind(SandboxManager.class).in(Scopes.SINGLETON);<NEW_LINE>bind(SingularityValidator.class).in(Scopes.SINGLETON);<NEW_LINE>bind(UserManager.class).in(Scopes.SINGLETON);<NEW_LINE>bind(UsageManager.class).in(Scopes.SINGLETON);<NEW_LINE>bind(ShuffleConfigurationManager.class).in(Scopes.SINGLETON);<NEW_LINE>bind(WebhookManager.class).in(Scopes.SINGLETON);<NEW_LINE>bind(NotificationsManager.class).in(Scopes.SINGLETON);<NEW_LINE>bind(SingularityWebCache.class).in(Scopes.SINGLETON);<NEW_LINE>bind(<MASK><NEW_LINE>bind(WebhookManager.class).in(Scopes.SINGLETON);<NEW_LINE>bind(DisasterManager.class).in(Scopes.SINGLETON);<NEW_LINE>bind(PriorityManager.class).in(Scopes.SINGLETON);<NEW_LINE>bind(RequestGroupManager.class).in(Scopes.SINGLETON);<NEW_LINE>bind(AuthTokenManager.class).in(Scopes.SINGLETON);<NEW_LINE>} | ExecutorIdGenerator.class).asEagerSingleton(); |
1,623,234 | protected void grow() {<NEW_LINE>RajLog.d("[" + this.getClass().<MASK><NEW_LINE>Vector3 min = new Vector3(Float.MAX_VALUE, Float.MAX_VALUE, Float.MAX_VALUE);<NEW_LINE>Vector3 max = new Vector3(-Float.MAX_VALUE, -Float.MAX_VALUE, -Float.MAX_VALUE);<NEW_LINE>// Get a full list of all the members, including members in the children<NEW_LINE>ArrayList<IGraphNodeMember> members = getAllMembersRecursively(true);<NEW_LINE>int members_count = members.size();<NEW_LINE>for (int i = 0; i < members_count; ++i) {<NEW_LINE>IBoundingVolume volume = members.get(i).getTransformedBoundingVolume();<NEW_LINE>Vector3 test_against_min = null;<NEW_LINE>Vector3 test_against_max = null;<NEW_LINE>if (volume == null) {<NEW_LINE>ATransformable3D object = (ATransformable3D) members.get(i);<NEW_LINE>test_against_min = object.getPosition();<NEW_LINE>test_against_max = test_against_min;<NEW_LINE>} else {<NEW_LINE>if (volume instanceof BoundingBox) {<NEW_LINE>BoundingBox bb = (BoundingBox) volume;<NEW_LINE>test_against_min = bb.getTransformedMin();<NEW_LINE>test_against_max = bb.getTransformedMax();<NEW_LINE>} else if (volume instanceof BoundingSphere) {<NEW_LINE>BoundingSphere bs = (BoundingSphere) volume;<NEW_LINE>Vector3 bs_position = bs.getPosition();<NEW_LINE>double radius = bs.getScaledRadius();<NEW_LINE>Vector3 rad = new Vector3();<NEW_LINE>rad.setAll(radius, radius, radius);<NEW_LINE>test_against_min = Vector3.subtractAndCreate(bs_position, rad);<NEW_LINE>test_against_max = Vector3.addAndCreate(bs_position, rad);<NEW_LINE>} else {<NEW_LINE>RajLog.e("[" + this.getClass().getName() + "] Received a bounding box of unknown type.");<NEW_LINE>throw new IllegalArgumentException("Received a bounding box of unknown type.");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (test_against_min != null && test_against_max != null) {<NEW_LINE>if (test_against_min.x < min.x)<NEW_LINE>min.x = test_against_min.x;<NEW_LINE>if (test_against_min.y < min.y)<NEW_LINE>min.y = test_against_min.y;<NEW_LINE>if (test_against_min.z < min.z)<NEW_LINE>min.z = test_against_min.z;<NEW_LINE>if (test_against_max.x > max.x)<NEW_LINE>max.x = test_against_max.x;<NEW_LINE>if (test_against_max.y > max.y)<NEW_LINE>max.y = test_against_max.y;<NEW_LINE>if (test_against_max.z > max.z)<NEW_LINE>max.z = test_against_max.z;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>mMin.setAll(min);<NEW_LINE>mMax.setAll(max);<NEW_LINE>mTransformedMin.setAll(min);<NEW_LINE>mTransformedMax.setAll(max);<NEW_LINE>calculatePoints();<NEW_LINE>calculateChildSideLengths();<NEW_LINE>if (mSplit) {<NEW_LINE>for (int i = 0; i < CHILD_COUNT; ++i) {<NEW_LINE>mChildren[i].setChildRegion(i, mChildLengths);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>for (int i = 0; i < members_count; ++i) {<NEW_LINE>internalAddObject(members.get(i));<NEW_LINE>}<NEW_LINE>} | getName() + "] Growing tree: " + this); |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.