idx
int32 46
1.86M
| input
stringlengths 321
6.6k
| target
stringlengths 9
1.24k
|
|---|---|---|
1,501,674
|
public SModelComparePluginConfiguration convertToSObject(ModelComparePluginConfiguration input) {<NEW_LINE>if (input == null) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>SModelComparePluginConfiguration result = new SModelComparePluginConfiguration();<NEW_LINE>result.<MASK><NEW_LINE>result.setUuid(input.getUuid());<NEW_LINE>result.setRid(input.getRid());<NEW_LINE>result.setName(input.getName());<NEW_LINE>result.setEnabled(input.getEnabled());<NEW_LINE>result.setDescription(input.getDescription());<NEW_LINE>PluginDescriptor pluginDescriptorVal = input.getPluginDescriptor();<NEW_LINE>result.setPluginDescriptorId(pluginDescriptorVal == null ? -1 : pluginDescriptorVal.getOid());<NEW_LINE>ObjectType settingsVal = input.getSettings();<NEW_LINE>result.setSettingsId(settingsVal == null ? -1 : settingsVal.getOid());<NEW_LINE>UserSettings userSettingsVal = input.getUserSettings();<NEW_LINE>result.setUserSettingsId(userSettingsVal == null ? -1 : userSettingsVal.getOid());<NEW_LINE>return result;<NEW_LINE>}
|
setOid(input.getOid());
|
628,827
|
public static IFile readProjectRootFile(IProject project) {<NEW_LINE>final IEclipsePreferences projectPrefs = getProjectPreferences(project);<NEW_LINE>if (projectPrefs != null) {<NEW_LINE>String rootFileName = projectPrefs.get(IPreferenceConstants.P_PROJECT_ROOT_FILE, IPreferenceConstants.DEFAULT_NOT_SET);<NEW_LINE>if (!IPreferenceConstants.DEFAULT_NOT_SET.equals(rootFileName)) {<NEW_LINE>final IPath path = new Path(rootFileName);<NEW_LINE>if (path.isAbsolute()) {<NEW_LINE>// Convert a legacy (absolute) path to the new relative one<NEW_LINE>// with the magic PARENT_PROJECT_LOC prefix.<NEW_LINE>rootFileName = ResourceHelper<MASK><NEW_LINE>convertAbsoluteToRelative(projectPrefs, rootFileName);<NEW_LINE>}<NEW_LINE>return ResourceHelper.getLinkedFile(project, rootFileName);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>Activator.getDefault().logInfo("projectPrefs is null");<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>}
|
.PARENT_ONE_PROJECT_LOC + path.lastSegment();
|
1,052,119
|
public static void convolve5(Kernel2D_S32 kernel, GrayS32 src, GrayS32 dest) {<NEW_LINE>final int[] dataSrc = src.data;<NEW_LINE>final int[] dataDst = dest.data;<NEW_LINE>final int width = src.getWidth();<NEW_LINE>final int height = src.getHeight();<NEW_LINE>final int kernelRadius = kernel.getRadius();<NEW_LINE>// CONCURRENT_BELOW BoofConcurrency.loopFor(kernelRadius, height-kernelRadius, y -> {<NEW_LINE>for (int y = kernelRadius; y < height - kernelRadius; y++) {<NEW_LINE>// first time through the value needs to be set<NEW_LINE>int k1 = kernel.data[0];<NEW_LINE>int k2 = kernel.data[1];<NEW_LINE>int k3 = kernel.data[2];<NEW_LINE>int k4 = kernel.data[3];<NEW_LINE>int k5 = kernel.data[4];<NEW_LINE>int indexDst = dest.startIndex + y * dest.stride + kernelRadius;<NEW_LINE>int indexSrcRow = src.startIndex + (y - kernelRadius) * src.stride - kernelRadius;<NEW_LINE>for (int x = kernelRadius; x < width - kernelRadius; x++) {<NEW_LINE>int indexSrc = indexSrcRow + x;<NEW_LINE>int total = 0;<NEW_LINE>total += (dataSrc[indexSrc++]) * k1;<NEW_LINE>total += (dataSrc[indexSrc++]) * k2;<NEW_LINE>total += (dataSrc[indexSrc++]) * k3;<NEW_LINE>total += (dataSrc[indexSrc++]) * k4;<NEW_LINE>total += <MASK><NEW_LINE>dataDst[indexDst++] = total;<NEW_LINE>}<NEW_LINE>// rest of the convolution rows are an addition<NEW_LINE>for (int i = 1; i < 5; i++) {<NEW_LINE>indexDst = dest.startIndex + y * dest.stride + kernelRadius;<NEW_LINE>indexSrcRow = src.startIndex + (y + i - kernelRadius) * src.stride - kernelRadius;<NEW_LINE>k1 = kernel.data[i * 5 + 0];<NEW_LINE>k2 = kernel.data[i * 5 + 1];<NEW_LINE>k3 = kernel.data[i * 5 + 2];<NEW_LINE>k4 = kernel.data[i * 5 + 3];<NEW_LINE>k5 = kernel.data[i * 5 + 4];<NEW_LINE>for (int x = kernelRadius; x < width - kernelRadius; x++) {<NEW_LINE>int indexSrc = indexSrcRow + x;<NEW_LINE>int total = 0;<NEW_LINE>total += (dataSrc[indexSrc++]) * k1;<NEW_LINE>total += (dataSrc[indexSrc++]) * k2;<NEW_LINE>total += (dataSrc[indexSrc++]) * k3;<NEW_LINE>total += (dataSrc[indexSrc++]) * k4;<NEW_LINE>total += (dataSrc[indexSrc]) * k5;<NEW_LINE>dataDst[indexDst++] += total;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// CONCURRENT_ABOVE });<NEW_LINE>}
|
(dataSrc[indexSrc]) * k5;
|
1,801,130
|
public void doFilter(final ServletRequest request, final ServletResponse response, final FilterChain chain) throws IOException, ServletException {<NEW_LINE>// Pre-processing<NEW_LINE>if (!(request instanceof HttpServletRequest)) {<NEW_LINE>throw new ServletException("Expected an HttpServletRequest but didn't get one");<NEW_LINE>}<NEW_LINE>final HttpServletRequest httpServletRequest = (HttpServletRequest) request;<NEW_LINE>String userName = httpServletRequest.getHeader(MetacatRequestContext.HEADER_KEY_USER_NAME);<NEW_LINE>if (userName == null) {<NEW_LINE>userName = "metacat";<NEW_LINE>}<NEW_LINE>final String clientAppName = httpServletRequest.getHeader(MetacatRequestContext.HEADER_KEY_CLIENT_APP_NAME);<NEW_LINE>final String clientId = httpServletRequest.getHeader("X-Forwarded-For");<NEW_LINE>final String jobId = httpServletRequest.getHeader(MetacatRequestContext.HEADER_KEY_JOB_ID);<NEW_LINE>final String dataTypeContext = httpServletRequest.getHeader(MetacatRequestContext.HEADER_KEY_DATA_TYPE_CONTEXT);<NEW_LINE>final MetacatRequestContext context = MetacatRequestContext.builder().userName(userName).clientAppName(clientAppName).clientId(clientId).jobId(jobId).dataTypeContext(dataTypeContext).scheme(httpServletRequest.getScheme()).apiUri(httpServletRequest.getRequestURI()).build();<NEW_LINE>MetacatContextManager.setContext(context);<NEW_LINE>log.info(context.toString());<NEW_LINE>// Do the rest of the chain<NEW_LINE><MASK><NEW_LINE>// Post processing<NEW_LINE>MetacatContextManager.removeContext();<NEW_LINE>}
|
chain.doFilter(request, response);
|
1,411,643
|
public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {<NEW_LINE>try {<NEW_LINE>return invokeImpl(proxy, method, args);<NEW_LINE>} catch (TargetError te) {<NEW_LINE>// Unwrap target exception. If the interface declares that<NEW_LINE>// it throws the ex it will be delivered. If not it will be<NEW_LINE>// wrapped in an UndeclaredThrowable<NEW_LINE>// This isn't simple because unwrapping this loses all context info.<NEW_LINE>// So rewrap is better than unwrap. - fschmidt<NEW_LINE>Throwable t = te.getTarget();<NEW_LINE>Class<? extends Throwable<MASK><NEW_LINE>String msg = t.getMessage();<NEW_LINE>try {<NEW_LINE>Throwable t2 = msg == null ? c.getConstructor().newInstance() : c.getConstructor(String.class).newInstance(msg);<NEW_LINE>t2.initCause(te);<NEW_LINE>throw t2;<NEW_LINE>} catch (NoSuchMethodException e) {<NEW_LINE>throw t;<NEW_LINE>}<NEW_LINE>} catch (EvalError ee) {<NEW_LINE>// Ease debugging...<NEW_LINE>// XThis.this refers to the enclosing class instance<NEW_LINE>Interpreter.debug("EvalError in scripted interface: ", This.this.toString(), ": ", ee);<NEW_LINE>throw ee;<NEW_LINE>}<NEW_LINE>}
|
> c = t.getClass();
|
1,807,776
|
public void processBindingConfiguration(String context, Item item, String bindingConfig) throws BindingConfigParseException {<NEW_LINE>super.processBindingConfiguration(context, item, bindingConfig);<NEW_LINE>String[] parts = parseConfigString(bindingConfig);<NEW_LINE>if (parts.length != 3) {<NEW_LINE>throw new BindingConfigParseException("item config must have addr:prodKey#feature format");<NEW_LINE>}<NEW_LINE>InsteonAddress addr = new InsteonAddress(parts[0]);<NEW_LINE>String[] params = parts[2].split(",");<NEW_LINE>String feature = params[0];<NEW_LINE>HashMap<String, String> args = new HashMap<String, String>();<NEW_LINE>for (int i = 1; i < params.length; i++) {<NEW_LINE>String[] kv = params<MASK><NEW_LINE>if (kv.length == 2) {<NEW_LINE>args.put(kv[0], kv[1]);<NEW_LINE>} else {<NEW_LINE>logger.error("parameter {} does not have format a=b", params[i]);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>InsteonPLMBindingConfig config = new InsteonPLMBindingConfig(item.getName(), addr, feature, parts[1], args);<NEW_LINE>addBindingConfig(item, config);<NEW_LINE>logger.trace("processing item \"{}\" read from .items file with cfg string {}", item.getName(), bindingConfig);<NEW_LINE>items.put(item.getName(), item);<NEW_LINE>}
|
[i].split("=");
|
1,034,889
|
public void onClick(Entity item, String columnId) {<NEW_LINE>Table.Column column = table.getColumn(columnId);<NEW_LINE>MetaProperty metaProperty;<NEW_LINE>String value;<NEW_LINE>if (DynamicAttributesUtils.isDynamicAttribute(columnId)) {<NEW_LINE>metaProperty = dynamicAttributesTools.getMetaPropertyPath(item.getMetaClass(), columnId).getMetaProperty();<NEW_LINE>value = dynamicAttributesTools.getDynamicAttributeValueAsString(metaProperty<MASK><NEW_LINE>} else {<NEW_LINE>value = metadataTools.format(item.getValueEx(columnId));<NEW_LINE>}<NEW_LINE>if (column.getMaxTextLength() != null) {<NEW_LINE>boolean isMultiLineCell = StringUtils.contains(value, "\n");<NEW_LINE>if (value == null || (value.length() <= column.getMaxTextLength() + MAX_TEXT_LENGTH_GAP && !isMultiLineCell)) {<NEW_LINE>// todo artamonov if we click with CTRL and Table is multiselect then we lose previous selected items<NEW_LINE>if (!table.getSelected().contains(item)) {<NEW_LINE>table.setSelected(item);<NEW_LINE>}<NEW_LINE>// do not show popup view<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>VerticalLayout layout = new VerticalLayout();<NEW_LINE>layout.setMargin(false);<NEW_LINE>layout.setSpacing(false);<NEW_LINE>layout.setWidthUndefined();<NEW_LINE>layout.setStyleName("c-table-view-textcut");<NEW_LINE>CubaTextArea textArea = new CubaTextArea();<NEW_LINE>textArea.setValue(Strings.nullToEmpty(value));<NEW_LINE>textArea.setReadOnly(true);<NEW_LINE>CubaResizableTextAreaWrapper content = new CubaResizableTextAreaWrapper(textArea);<NEW_LINE>content.setResizableDirection(ResizeDirection.BOTH);<NEW_LINE>// todo implement injection for ThemeConstains in components<NEW_LINE>ThemeConstants theme = App.getInstance().getThemeConstants();<NEW_LINE>if (theme != null) {<NEW_LINE>content.setWidth(theme.get("cuba.web.Table.abbreviatedPopupWidth"));<NEW_LINE>content.setHeight(theme.get("cuba.web.Table.abbreviatedPopupHeight"));<NEW_LINE>} else {<NEW_LINE>content.setWidth("320px");<NEW_LINE>content.setHeight("200px");<NEW_LINE>}<NEW_LINE>layout.addComponent(content);<NEW_LINE>table.withUnwrapped(CubaEnhancedTable.class, enhancedTable -> {<NEW_LINE>enhancedTable.showCustomPopup(layout);<NEW_LINE>enhancedTable.setCustomPopupAutoClose(false);<NEW_LINE>});<NEW_LINE>}
|
, item.getValueEx(columnId));
|
764,980
|
public void onReceiveLocation(BDLocation bdLocation) {<NEW_LINE>WritableMap params = Arguments.createMap();<NEW_LINE>params.putDouble("latitude", bdLocation.getLatitude());<NEW_LINE>params.putDouble("longitude", bdLocation.getLongitude());<NEW_LINE>params.putDouble("speed", bdLocation.getSpeed());<NEW_LINE>params.putDouble("direction", bdLocation.getDirection());<NEW_LINE>params.putDouble("altitude", bdLocation.getAltitude());<NEW_LINE>params.putDouble("radius", bdLocation.getRadius());<NEW_LINE>params.putString("address", bdLocation.getAddrStr());<NEW_LINE>params.putString("countryCode", bdLocation.getCountryCode());<NEW_LINE>params.putString("country", bdLocation.getCountry());<NEW_LINE>params.putString("province", bdLocation.getProvince());<NEW_LINE>params.putString("cityCode", bdLocation.getCityCode());<NEW_LINE>params.putString("city", bdLocation.getCity());<NEW_LINE>params.putString("district", bdLocation.getDistrict());<NEW_LINE>params.putString("street", bdLocation.getStreet());<NEW_LINE>params.putString(<MASK><NEW_LINE>params.putString("buildingId", bdLocation.getBuildingID());<NEW_LINE>params.putString("buildingName", bdLocation.getBuildingName());<NEW_LINE>Log.i("onReceiveLocation", "onGetCurrentLocationPosition");<NEW_LINE>if (locateOnce) {<NEW_LINE>locating = false;<NEW_LINE>sendEvent("onGetCurrentLocationPosition", params);<NEW_LINE>locationClient.stop();<NEW_LINE>locationClient = null;<NEW_LINE>} else {<NEW_LINE>sendEvent("onLocationUpdate", params);<NEW_LINE>}<NEW_LINE>}
|
"streetNumber", bdLocation.getStreetNumber());
|
1,256,477
|
protected JComponent createNorthPanel() {<NEW_LINE>final JPanel panel = new JPanel(new GridBagLayout());<NEW_LINE>final GridBagConstraints gbc = new GridBagConstraints();<NEW_LINE>final String promptKey = isDelete() ? "prompt.delete.elements" : "search.for.usages.and.delete.elements";<NEW_LINE>final String warningMessage = DeleteUtil.generateWarningMessage(IdeBundle.message(promptKey), myElements);<NEW_LINE>gbc.insets = JBUI.insets(4, 8);<NEW_LINE>gbc.weighty = 1;<NEW_LINE>gbc.weightx = 1;<NEW_LINE>gbc.gridx = 0;<NEW_LINE>gbc.gridy = 0;<NEW_LINE>gbc.gridwidth = 2;<NEW_LINE>gbc.fill = GridBagConstraints.BOTH;<NEW_LINE>gbc.anchor = GridBagConstraints.WEST;<NEW_LINE>panel.add(new JLabel(warningMessage), gbc);<NEW_LINE>if (isDelete()) {<NEW_LINE>gbc.gridy++;<NEW_LINE>gbc.gridx = 0;<NEW_LINE>gbc.weightx = 0.0;<NEW_LINE>gbc.gridwidth = 1;<NEW_LINE>gbc.insets = JBUI.insets(4, 8, 0, 8);<NEW_LINE>myCbSafeDelete = new JCheckBox(IdeBundle.message("checkbox.safe.delete.with.usage.search"));<NEW_LINE>panel.add(myCbSafeDelete, gbc);<NEW_LINE>myCbSafeDelete.addActionListener(new ActionListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void actionPerformed(ActionEvent e) {<NEW_LINE>updateControls(myCbSearchInComments);<NEW_LINE>updateControls(myCbSearchTextOccurrences);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}<NEW_LINE>gbc.gridy++;<NEW_LINE>gbc.gridx = 0;<NEW_LINE>gbc.weightx = 0.0;<NEW_LINE>gbc.gridwidth = 1;<NEW_LINE>myCbSearchInComments = new StateRestoringCheckBox();<NEW_LINE>myCbSearchInComments.setText(RefactoringBundle.getSearchInCommentsAndStringsText());<NEW_LINE>panel.add(myCbSearchInComments, gbc);<NEW_LINE>if (needSearchForTextOccurrences()) {<NEW_LINE>gbc.gridx++;<NEW_LINE>myCbSearchTextOccurrences = new StateRestoringCheckBox();<NEW_LINE>myCbSearchTextOccurrences.setText(RefactoringBundle.getSearchForTextOccurrencesText());<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>final RefactoringSettings refactoringSettings = RefactoringSettings.getInstance();<NEW_LINE>if (myCbSafeDelete != null) {<NEW_LINE>myCbSafeDelete.setSelected(refactoringSettings.SAFE_DELETE_WHEN_DELETE);<NEW_LINE>}<NEW_LINE>myCbSearchInComments.setSelected(myDelegate != null ? myDelegate.isToSearchInComments(myElements[0]) : refactoringSettings.SAFE_DELETE_SEARCH_IN_COMMENTS);<NEW_LINE>if (myCbSearchTextOccurrences != null) {<NEW_LINE>myCbSearchTextOccurrences.setSelected(myDelegate != null ? myDelegate.isToSearchForTextOccurrences(myElements[0]) : refactoringSettings.SAFE_DELETE_SEARCH_IN_NON_JAVA);<NEW_LINE>}<NEW_LINE>updateControls(myCbSearchTextOccurrences);<NEW_LINE>updateControls(myCbSearchInComments);<NEW_LINE>return panel;<NEW_LINE>}
|
panel.add(myCbSearchTextOccurrences, gbc);
|
1,104,361
|
public Result login() {<NEW_LINE>boolean useOAuth = runtimeConfigFactory.globalRuntimeConf().getBoolean("yb.security.use_oauth");<NEW_LINE>boolean useLdap = runtimeConfigFactory.globalRuntimeConf().getString("yb.security.ldap.use_ldap").equals("true");<NEW_LINE>if (useOAuth) {<NEW_LINE>throw new PlatformServiceException(BAD_REQUEST, "Platform login not supported when using SSO.");<NEW_LINE>}<NEW_LINE>CustomerLoginFormData data = formFactory.getFormDataOrBadRequest(CustomerLoginFormData.class).get();<NEW_LINE>Users user = null;<NEW_LINE>Users existingUser = Users.find.query().where().eq("email", data.getEmail().toLowerCase()).findOne();<NEW_LINE>if (existingUser != null) {<NEW_LINE>if (existingUser.userType == null || !existingUser.userType.equals(UserType.ldap)) {<NEW_LINE>user = Users.authWithPassword(data.getEmail().toLowerCase(<MASK><NEW_LINE>if (user == null) {<NEW_LINE>throw new PlatformServiceException(UNAUTHORIZED, "Invalid User Credentials.");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (useLdap && user == null) {<NEW_LINE>try {<NEW_LINE>user = ldapUtil.loginWithLdap(data);<NEW_LINE>} catch (LdapException e) {<NEW_LINE>LOG.error("LDAP error {} authenticating user {}", e.getMessage(), data.getEmail());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (user == null) {<NEW_LINE>throw new PlatformServiceException(UNAUTHORIZED, "Invalid User Credentials.");<NEW_LINE>}<NEW_LINE>Customer cust = Customer.get(user.customerUUID);<NEW_LINE>String authToken = user.createAuthToken();<NEW_LINE>SessionInfo sessionInfo = new SessionInfo(authToken, null, cust.uuid, user.uuid);<NEW_LINE>response().setCookie(Http.Cookie.builder(AUTH_TOKEN, authToken).withSecure(ctx().request().secure()).build());<NEW_LINE>response().setCookie(Http.Cookie.builder("customerId", cust.uuid.toString()).withSecure(ctx().request().secure()).build());<NEW_LINE>response().setCookie(Http.Cookie.builder("userId", user.uuid.toString()).withSecure(ctx().request().secure()).build());<NEW_LINE>return withData(sessionInfo);<NEW_LINE>}
|
), data.getPassword());
|
1,236,207
|
public SourceForBinaryQueryImplementation2.Result findSourceRoots2(URL binaryRoot) {<NEW_LINE>SourceForBinaryQueryImplementation2.Result res = this.cache.get(binaryRoot);<NEW_LINE>if (res != null) {<NEW_LINE>return res;<NEW_LINE>}<NEW_LINE>final JavaPlatformManager jpm = JavaPlatformManager.getDefault();<NEW_LINE>final Collection<JavaPlatform> candidates = new ArrayDeque<>();<NEW_LINE>for (JavaPlatform platform : jpm.getInstalledPlatforms()) {<NEW_LINE>if (contains(platform, binaryRoot)) {<NEW_LINE>candidates.add(platform);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (!candidates.isEmpty()) {<NEW_LINE>res = new Result(jpm, binaryRoot, candidates);<NEW_LINE>this.cache.put(binaryRoot, res);<NEW_LINE>return res;<NEW_LINE>}<NEW_LINE>String binaryRootS = binaryRoot.toExternalForm();<NEW_LINE>if (binaryRootS.startsWith(JAR_FILE)) {<NEW_LINE>if (binaryRootS.endsWith(RTJAR_PATH)) {<NEW_LINE>// Unregistered platform<NEW_LINE>String srcZipS = binaryRootS.substring(4, binaryRootS.length() - RTJAR_PATH.length()) + SRC_ZIP;<NEW_LINE>try {<NEW_LINE>URL srcZip = FileUtil.<MASK><NEW_LINE>FileObject fo = URLMapper.findFileObject(srcZip);<NEW_LINE>if (fo != null) {<NEW_LINE>return new UnregisteredPlatformResult(fo);<NEW_LINE>}<NEW_LINE>} catch (MalformedURLException mue) {<NEW_LINE>Exceptions.printStackTrace(mue);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>}
|
getArchiveRoot(new URL(srcZipS));
|
750,703
|
public /*<NEW_LINE>* Parg: replaced above commented out checking with one that verifies that the<NEW_LINE>* requests still exist. As piece-picker activity and peer disconnect logic is multi-threaded<NEW_LINE>* and full of holes, this is a stop-gap measure to prevent a piece from being left with<NEW_LINE>* requests that no longer exist<NEW_LINE>*/<NEW_LINE>void checkRequests() {<NEW_LINE>if (getTimeSinceLastActivity() < 30 * 1000) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>int cleared = 0;<NEW_LINE>PEPeerManager manager = piecePicker.getPeerManager();<NEW_LINE>for (int i = 0; i < nbBlocks; i++) {<NEW_LINE>if (!downloaded[i] && !dmPiece.isWritten(i)) {<NEW_LINE><MASK><NEW_LINE>if (requester != null) {<NEW_LINE>if (!manager.requestExists(requester, getPieceNumber(), i * DiskManager.BLOCK_SIZE, getBlockSize(i))) {<NEW_LINE>clearRequested(i);<NEW_LINE>cleared++;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (cleared > 0) {<NEW_LINE>if (Logger.isEnabled())<NEW_LINE>Logger.log(new LogEvent(dmPiece.getManager().getTorrent(), LOGID, LogEvent.LT_WARNING, "checkRequests(): piece #" + getPieceNumber() + " cleared " + cleared + " requests"));<NEW_LINE>} else {<NEW_LINE>if (fully_requested && getNbUnrequested() > 0) {<NEW_LINE>if (Logger.isEnabled())<NEW_LINE>Logger.log(new LogEvent(dmPiece.getManager().getTorrent(), LOGID, LogEvent.LT_WARNING, "checkRequests(): piece #" + getPieceNumber() + " reset fully requested"));<NEW_LINE>fully_requested = false;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
|
final String requester = requested[i];
|
693,054
|
public Revision convertFromSObject(SRevision input, Revision result, DatabaseSession session) throws BimserverDatabaseException {<NEW_LINE>if (input == null) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>result.setId(input.getId());<NEW_LINE>result.setDate(input.getDate());<NEW_LINE>result.setComment(input.getComment());<NEW_LINE>result.setSize(input.getSize());<NEW_LINE>result.setTag(input.getTag());<NEW_LINE>result.setLastError(input.getLastError());<NEW_LINE>result.setBmi(input.getBmi());<NEW_LINE>result.setHasGeometry(input.isHasGeometry());<NEW_LINE>result.setNrPrimitives(input.getNrPrimitives());<NEW_LINE>result.setUser((User) session.get(StorePackage.eINSTANCE.getUser(), input.getUserId(), OldQuery.getDefault()));<NEW_LINE>List<ConcreteRevision> listconcreteRevisions = result.getConcreteRevisions();<NEW_LINE>for (long oid : input.getConcreteRevisions()) {<NEW_LINE>listconcreteRevisions.add((ConcreteRevision) session.get(StorePackage.eINSTANCE.getConcreteRevision(), oid, OldQuery.getDefault()));<NEW_LINE>}<NEW_LINE>result.setLastConcreteRevision((ConcreteRevision) session.get(StorePackage.eINSTANCE.getConcreteRevision(), input.getLastConcreteRevisionId(), OldQuery.getDefault()));<NEW_LINE>List<Checkout> listcheckouts = result.getCheckouts();<NEW_LINE>for (long oid : input.getCheckouts()) {<NEW_LINE>listcheckouts.add((Checkout) session.get(StorePackage.eINSTANCE.getCheckout(), oid, OldQuery.getDefault()));<NEW_LINE>}<NEW_LINE>result.setProject((Project) session.get(StorePackage.eINSTANCE.getProject(), input.getProjectId(), OldQuery.getDefault()));<NEW_LINE>List<ExtendedData> listextendedData = result.getExtendedData();<NEW_LINE>for (long oid : input.getExtendedData()) {<NEW_LINE>listextendedData.add((ExtendedData) session.get(StorePackage.eINSTANCE.getExtendedData(), oid, OldQuery.getDefault()));<NEW_LINE>}<NEW_LINE>List<RevisionRelated> listlogs = result.getLogs();<NEW_LINE>for (long oid : input.getLogs()) {<NEW_LINE>listlogs.add((RevisionRelated) session.get(LogPackage.eINSTANCE.getRevisionRelated(), oid, OldQuery.getDefault()));<NEW_LINE>}<NEW_LINE>result.setService((Service) session.get(StorePackage.eINSTANCE.getService(), input.getServiceId(), OldQuery.getDefault()));<NEW_LINE>result.setBounds(convertFromSObject(input.getBounds(), session));<NEW_LINE>result.setBoundsUntransformed(convertFromSObject(input.getBoundsUntransformed(), session));<NEW_LINE>result.setBoundsMm(convertFromSObject(input.getBoundsMm(), session));<NEW_LINE>result.setBoundsUntransformedMm(convertFromSObject(input.getBoundsUntransformedMm(), session));<NEW_LINE>List<NewService> listservicesLinked = result.getServicesLinked();<NEW_LINE>for (long oid : input.getServicesLinked()) {<NEW_LINE>listservicesLinked.add((NewService) session.get(StorePackage.eINSTANCE.getNewService(), oid<MASK><NEW_LINE>}<NEW_LINE>result.setDensityCollection((DensityCollection) session.get(StorePackage.eINSTANCE.getDensityCollection(), input.getDensityCollectionId(), OldQuery.getDefault()));<NEW_LINE>return result;<NEW_LINE>}
|
, OldQuery.getDefault()));
|
501,413
|
public SessionData read(ObjectDataInput in) throws IOException {<NEW_LINE>final String id = in.readUTF();<NEW_LINE>final String contextPath = in.readUTF();<NEW_LINE>final String vhost = in.readUTF();<NEW_LINE>final long accessed = in.readLong();<NEW_LINE>final long lastAccessed = in.readLong();<NEW_LINE>final long created = in.readLong();<NEW_LINE>final long cookieSet = in.readLong();<NEW_LINE>final String lastNode = in.readUTF();<NEW_LINE>final long expiry = in.readLong();<NEW_LINE>final <MASK><NEW_LINE>SessionData sd = new SessionData(id, contextPath, vhost, created, accessed, lastAccessed, maxInactiveMs);<NEW_LINE>ByteArrayInputStream bais = new ByteArrayInputStream(in.readByteArray());<NEW_LINE>try (ClassLoadingObjectInputStream ois = new ClassLoadingObjectInputStream(bais)) {<NEW_LINE>SessionData.deserializeAttributes(sd, ois);<NEW_LINE>} catch (ClassNotFoundException e) {<NEW_LINE>throw new IOException(e);<NEW_LINE>}<NEW_LINE>sd.setCookieSet(cookieSet);<NEW_LINE>sd.setLastNode(lastNode);<NEW_LINE>sd.setExpiry(expiry);<NEW_LINE>return sd;<NEW_LINE>}
|
long maxInactiveMs = in.readLong();
|
858,437
|
private // <editor-fold defaultstate="collapsed" desc=" Generated Code ">//GEN-BEGIN:initComponents<NEW_LINE>void initComponents() {<NEW_LINE>java.awt.GridBagConstraints gridBagConstraints;<NEW_LINE>notAgain = new javax.swing.JCheckBox();<NEW_LINE>message = new javax.swing.JLabel();<NEW_LINE>setLayout(new java.awt.GridBagLayout());<NEW_LINE>getAccessibleContext().setAccessibleName(org.openide.util.NbBundle.getMessage<MASK><NEW_LINE>getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(BrokenServerAlertPanel.class, "ACSD_BrokenServersAlertPanel"));<NEW_LINE>org.openide.awt.Mnemonics.setLocalizedText(notAgain, org.openide.util.NbBundle.getMessage(BrokenServerAlertPanel.class, "MSG_Broken_Server_Again"));<NEW_LINE>notAgain.setMargin(new java.awt.Insets(0, 0, 0, 0));<NEW_LINE>notAgain.addActionListener(new java.awt.event.ActionListener() {<NEW_LINE><NEW_LINE>public void actionPerformed(java.awt.event.ActionEvent evt) {<NEW_LINE>notAgainActionPerformed(evt);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>gridBagConstraints = new java.awt.GridBagConstraints();<NEW_LINE>gridBagConstraints.gridx = 0;<NEW_LINE>gridBagConstraints.gridy = 1;<NEW_LINE>gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;<NEW_LINE>gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;<NEW_LINE>gridBagConstraints.insets = new java.awt.Insets(6, 11, 0, 0);<NEW_LINE>add(notAgain, gridBagConstraints);<NEW_LINE>notAgain.getAccessibleContext().setAccessibleName(org.openide.util.NbBundle.getMessage(BrokenServerAlertPanel.class, "ACSN_BrokenServersAlertPanel_notAgain"));<NEW_LINE>notAgain.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(BrokenServerAlertPanel.class, "ACSD_BrokenServersAlertPanel_notAgain"));<NEW_LINE>org.openide.awt.Mnemonics.setLocalizedText(message, org.openide.util.NbBundle.getMessage(BrokenServerAlertPanel.class, "MSG_Broken_Server"));<NEW_LINE>gridBagConstraints = new java.awt.GridBagConstraints();<NEW_LINE>gridBagConstraints.gridx = 0;<NEW_LINE>gridBagConstraints.gridy = 0;<NEW_LINE>gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;<NEW_LINE>gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;<NEW_LINE>gridBagConstraints.weightx = 1.0;<NEW_LINE>gridBagConstraints.weighty = 1.0;<NEW_LINE>gridBagConstraints.insets = new java.awt.Insets(11, 11, 0, 0);<NEW_LINE>add(message, gridBagConstraints);<NEW_LINE>message.getAccessibleContext().setAccessibleName(NbBundle.getMessage(BrokenServerAlertPanel.class, "ACSN_BrokenServersAlertPanel"));<NEW_LINE>message.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(BrokenServerAlertPanel.class, "ACSD_BrokenServersAlertPanel"));<NEW_LINE>}
|
(BrokenServerAlertPanel.class, "ACSN_BrokenServersAlertPanel"));
|
1,256,258
|
public okhttp3.Call exportTenantConfigCall(final ApiCallback _callback) throws ApiException {<NEW_LINE>Object localVarPostBody = null;<NEW_LINE>// create path and map variables<NEW_LINE>String localVarPath = "/tenant-config";<NEW_LINE>List<Pair> localVarQueryParams = new ArrayList<Pair>();<NEW_LINE>List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();<NEW_LINE>Map<String, String> localVarHeaderParams = new HashMap<String, String>();<NEW_LINE>Map<String, String> localVarCookieParams = new HashMap<String, String>();<NEW_LINE>Map<String, Object> localVarFormParams = new HashMap<String, Object>();<NEW_LINE>final String[] localVarAccepts = { "application/json" };<NEW_LINE>final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);<NEW_LINE>if (localVarAccept != null) {<NEW_LINE>localVarHeaderParams.put("Accept", localVarAccept);<NEW_LINE>}<NEW_LINE>final String[] localVarContentTypes = {};<NEW_LINE>final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);<NEW_LINE>localVarHeaderParams.put("Content-Type", localVarContentType);<NEW_LINE>String[] localVarAuthNames = new String[] { "OAuth2Security" };<NEW_LINE>return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, <MASK><NEW_LINE>}
|
localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
|
93,684
|
public static java.lang.Object decode_(com.jsoniter.JsonIterator iter) throws java.io.IOException {<NEW_LINE>com.jsoniter.CodegenAccess.resetExistingObject(iter);<NEW_LINE>byte nextToken = com.jsoniter.CodegenAccess.readByte(iter);<NEW_LINE>if (nextToken != '[') {<NEW_LINE>if (nextToken == 'n') {<NEW_LINE>com.jsoniter.CodegenAccess.skipFixedBytes(iter, 3);<NEW_LINE>com.jsoniter.CodegenAccess.resetExistingObject(iter);<NEW_LINE>return null;<NEW_LINE>} else {<NEW_LINE>nextToken = com.<MASK><NEW_LINE>if (nextToken == 'n') {<NEW_LINE>com.jsoniter.CodegenAccess.skipFixedBytes(iter, 3);<NEW_LINE>com.jsoniter.CodegenAccess.resetExistingObject(iter);<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>nextToken = com.jsoniter.CodegenAccess.nextToken(iter);<NEW_LINE>if (nextToken == ']') {<NEW_LINE>return new int[0];<NEW_LINE>}<NEW_LINE>com.jsoniter.CodegenAccess.unreadByte(iter);<NEW_LINE>int a1 = (int) iter.readInt();<NEW_LINE>if (!com.jsoniter.CodegenAccess.nextTokenIsComma(iter)) {<NEW_LINE>return new int[] { a1 };<NEW_LINE>}<NEW_LINE>int a2 = (int) iter.readInt();<NEW_LINE>if (!com.jsoniter.CodegenAccess.nextTokenIsComma(iter)) {<NEW_LINE>return new int[] { a1, a2 };<NEW_LINE>}<NEW_LINE>int a3 = (int) iter.readInt();<NEW_LINE>if (!com.jsoniter.CodegenAccess.nextTokenIsComma(iter)) {<NEW_LINE>return new int[] { a1, a2, a3 };<NEW_LINE>}<NEW_LINE>int a4 = (int) (int) iter.readInt();<NEW_LINE>if (!com.jsoniter.CodegenAccess.nextTokenIsComma(iter)) {<NEW_LINE>return new int[] { a1, a2, a3, a4 };<NEW_LINE>}<NEW_LINE>int a5 = (int) (int) iter.readInt();<NEW_LINE>int[] arr = new int[10];<NEW_LINE>arr[0] = a1;<NEW_LINE>arr[1] = a2;<NEW_LINE>arr[2] = a3;<NEW_LINE>arr[3] = a4;<NEW_LINE>arr[4] = a5;<NEW_LINE>int i = 5;<NEW_LINE>while (com.jsoniter.CodegenAccess.nextTokenIsComma(iter)) {<NEW_LINE>if (i == arr.length) {<NEW_LINE>int[] newArr = new int[arr.length * 2];<NEW_LINE>System.arraycopy(arr, 0, newArr, 0, arr.length);<NEW_LINE>arr = newArr;<NEW_LINE>}<NEW_LINE>arr[i++] = (int) iter.readInt();<NEW_LINE>}<NEW_LINE>int[] result = new int[i];<NEW_LINE>System.arraycopy(arr, 0, result, 0, i);<NEW_LINE>return result;<NEW_LINE>}
|
jsoniter.CodegenAccess.nextToken(iter);
|
627,905
|
/*<NEW_LINE>* "Implementing types" (i.e.: types that might implement interfaces) have the potential to be invalid if incorrectly defined.<NEW_LINE>*<NEW_LINE>* The same interface might not be implemented more than once by a type and its extensions<NEW_LINE>* The implementing type must implement all the transitive interfaces<NEW_LINE>* An interface implementation must not result in a circular reference (i.e.: an interface implementing itself)<NEW_LINE>* All fields declared by an interface have to be correctly declared by its implementing type, including the proper field arguments<NEW_LINE>*/<NEW_LINE>void checkImplementingTypes(List<GraphQLError> errors, TypeDefinitionRegistry typeRegistry) {<NEW_LINE>List<InterfaceTypeDefinition> interfaces = <MASK><NEW_LINE>List<ObjectTypeDefinition> objects = typeRegistry.getTypes(ObjectTypeDefinition.class);<NEW_LINE>Stream.<ImplementingTypeDefinition<?>>concat(interfaces.stream(), objects.stream()).forEach(type -> checkImplementingType(errors, typeRegistry, type));<NEW_LINE>}
|
typeRegistry.getTypes(InterfaceTypeDefinition.class);
|
1,390,270
|
private static void loadFile() throws IOException {<NEW_LINE>kits.clear();<NEW_LINE>NbtCompound rootTag = NbtIo.read(new File(configPath.toFile(), "kits.dat"));<NEW_LINE>if (rootTag == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final int currentVersion = SharedConstants.getGameVersion().getWorldVersion();<NEW_LINE>final int fileVersion = rootTag.getInt("DataVersion");<NEW_LINE>NbtCompound compoundTag = rootTag.getCompound("Kits");<NEW_LINE>if (fileVersion >= currentVersion) {<NEW_LINE>compoundTag.getKeys().forEach(key -> kits.put(key, compoundTag.getList(key, NbtElement.COMPOUND_TYPE)));<NEW_LINE>} else {<NEW_LINE>compoundTag.getKeys().forEach(key -> {<NEW_LINE>NbtList updatedListTag = new NbtList();<NEW_LINE>compoundTag.getList(key, NbtElement.COMPOUND_TYPE).forEach(tag -> {<NEW_LINE>Dynamic<NbtElement> oldTagDynamic = new Dynamic<>(NbtOps.INSTANCE, tag);<NEW_LINE>Dynamic<NbtElement> newTagDynamic = client.getDataFixer().update(TypeReferences.ITEM_STACK, oldTagDynamic, fileVersion, currentVersion);<NEW_LINE>updatedListTag.<MASK><NEW_LINE>});<NEW_LINE>kits.put(key, updatedListTag);<NEW_LINE>});<NEW_LINE>}<NEW_LINE>}
|
add(newTagDynamic.getValue());
|
167,303
|
public void processEndElement() throws IOException {<NEW_LINE>super.processEndElement();<NEW_LINE>// Build the value, if necessary<NEW_LINE>if (value instanceof Builder<?>) {<NEW_LINE>Builder<Object> builder = (Builder<Object>) value;<NEW_LINE>updateValue(builder.build());<NEW_LINE>processValue();<NEW_LINE>} else {<NEW_LINE>processInstancePropertyAttributes();<NEW_LINE>}<NEW_LINE>processEventHandlerAttributes();<NEW_LINE>// Process static property attributes<NEW_LINE>if (staticPropertyAttributes.size() > 0) {<NEW_LINE>for (Attribute attribute : staticPropertyAttributes) {<NEW_LINE>processPropertyAttribute(attribute);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Process static property elements<NEW_LINE>if (staticPropertyElements.size() > 0) {<NEW_LINE>for (PropertyElement element : staticPropertyElements) {<NEW_LINE>BeanAdapter.put(value, element.sourceType, <MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (parent != null) {<NEW_LINE>if (parent.isCollection()) {<NEW_LINE>parent.add(value);<NEW_LINE>} else {<NEW_LINE>parent.set(value);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
|
element.name, element.value);
|
1,292,484
|
private void encodeScript(FacesContext context, Sidebar sidebar) throws IOException {<NEW_LINE>WidgetBuilder wb = getWidgetBuilder(context);<NEW_LINE>wb.init("Sidebar", sidebar).attr("visible", sidebar.isVisible(), false).attr("modal", sidebar.isModal(), true).attr("blockScroll", sidebar.isBlockScroll(), false).attr("baseZIndex", sidebar.getBaseZIndex(), 0).attr("dynamic", sidebar.isDynamic(), false).attr("showCloseIcon", sidebar.isShowCloseIcon(), true).attr("appendTo", SearchExpressionFacade.resolveClientId(context, sidebar, sidebar.getAppendTo(), SearchExpressionUtils.SET_RESOLVE_CLIENT_SIDE), null).callback("onHide", "function()", sidebar.getOnHide()).callback("onShow", <MASK><NEW_LINE>encodeClientBehaviors(context, sidebar);<NEW_LINE>wb.finish();<NEW_LINE>}
|
"function()", sidebar.getOnShow());
|
240,351
|
public void marshall(InputDescription inputDescription, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (inputDescription == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(inputDescription.getInputId(), INPUTID_BINDING);<NEW_LINE>protocolMarshaller.marshall(inputDescription.getNamePrefix(), NAMEPREFIX_BINDING);<NEW_LINE>protocolMarshaller.marshall(inputDescription.getInAppStreamNames(), INAPPSTREAMNAMES_BINDING);<NEW_LINE>protocolMarshaller.marshall(inputDescription.getInputProcessingConfigurationDescription(), INPUTPROCESSINGCONFIGURATIONDESCRIPTION_BINDING);<NEW_LINE>protocolMarshaller.marshall(<MASK><NEW_LINE>protocolMarshaller.marshall(inputDescription.getKinesisFirehoseInputDescription(), KINESISFIREHOSEINPUTDESCRIPTION_BINDING);<NEW_LINE>protocolMarshaller.marshall(inputDescription.getInputSchema(), INPUTSCHEMA_BINDING);<NEW_LINE>protocolMarshaller.marshall(inputDescription.getInputParallelism(), INPUTPARALLELISM_BINDING);<NEW_LINE>protocolMarshaller.marshall(inputDescription.getInputStartingPositionConfiguration(), INPUTSTARTINGPOSITIONCONFIGURATION_BINDING);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>}
|
inputDescription.getKinesisStreamsInputDescription(), KINESISSTREAMSINPUTDESCRIPTION_BINDING);
|
1,463,976
|
protected void performOperation(final ShardIterator shardIt, final ShardRouting shard, final int shardIndex) {<NEW_LINE>if (shard == null) {<NEW_LINE>// no more active shards... (we should not really get here, just safety)<NEW_LINE>onOperation(null, shardIt, shardIndex, new NoShardAvailableActionException(shardIt.shardId()));<NEW_LINE>} else {<NEW_LINE>try {<NEW_LINE>final ShardRequest shardRequest = newShardRequest(shardIt.size(), shard, request);<NEW_LINE>shardRequest.setParentTask(clusterService.localNode().getId(), task.getId());<NEW_LINE>DiscoveryNode node = nodes.get(shard.currentNodeId());<NEW_LINE>if (node == null) {<NEW_LINE>// no node connected, act as failure<NEW_LINE>onOperation(shard, shardIt, shardIndex, new NoShardAvailableActionException(shardIt.shardId()));<NEW_LINE>} else {<NEW_LINE>sendShardRequest(node, shardRequest, ActionListener.wrap(r -> onOperation(shard, shardIndex, r), e -> onOperation(shard, <MASK><NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>onOperation(shard, shardIt, shardIndex, e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
|
shardIt, shardIndex, e)));
|
901,612
|
public XContentBuilder toXContent(XContentBuilder builder, Params params) throws IOException {<NEW_LINE>builder.startObject();<NEW_LINE>builder.field(Job.ID.getPreferredName(), jobId);<NEW_LINE>builder.field(MIN_VERSION.getPreferredName(), minVersion);<NEW_LINE>if (timestamp != null) {<NEW_LINE>builder.timeField(TIMESTAMP.getPreferredName(), TIMESTAMP.getPreferredName() + "_string", timestamp.getTime());<NEW_LINE>}<NEW_LINE>if (description != null) {<NEW_LINE>builder.field(DESCRIPTION.getPreferredName(), description);<NEW_LINE>}<NEW_LINE>if (snapshotId != null) {<NEW_LINE>builder.field(ModelSnapshotField.SNAPSHOT_ID.getPreferredName(), snapshotId);<NEW_LINE>}<NEW_LINE>builder.field(SNAPSHOT_DOC_COUNT.getPreferredName(), snapshotDocCount);<NEW_LINE>if (modelSizeStats != null) {<NEW_LINE>builder.field(ModelSizeStats.RESULT_TYPE_FIELD.getPreferredName(), modelSizeStats);<NEW_LINE>}<NEW_LINE>if (latestRecordTimeStamp != null) {<NEW_LINE>builder.timeField(LATEST_RECORD_TIME.getPreferredName(), LATEST_RECORD_TIME.getPreferredName() + "_string", latestRecordTimeStamp.getTime());<NEW_LINE>}<NEW_LINE>if (latestResultTimeStamp != null) {<NEW_LINE>builder.timeField(LATEST_RESULT_TIME.getPreferredName(), LATEST_RESULT_TIME.getPreferredName() + "_string", latestResultTimeStamp.getTime());<NEW_LINE>}<NEW_LINE>if (quantiles != null) {<NEW_LINE>builder.field(<MASK><NEW_LINE>}<NEW_LINE>builder.field(RETAIN.getPreferredName(), retain);<NEW_LINE>builder.endObject();<NEW_LINE>return builder;<NEW_LINE>}
|
QUANTILES.getPreferredName(), quantiles);
|
567,620
|
public void apply(FaceletContext ctx, UIComponent parent) throws IOException {<NEW_LINE>CompositeComponentBeanInfo beanInfo = (CompositeComponentBeanInfo) parent.getAttributes().get(UIComponent.BEANINFO_KEY);<NEW_LINE>if (beanInfo == null) {<NEW_LINE>if (log.isLoggable(Level.SEVERE)) {<NEW_LINE>log.severe("Cannot find composite bean descriptor UIComponent.BEANINFO_KEY ");<NEW_LINE>}<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>BeanDescriptor beanDescriptor = beanInfo.getBeanDescriptor();<NEW_LINE>Map<String, PropertyDescriptor> facetPropertyDescriptorMap = (Map<String, PropertyDescriptor>) beanDescriptor.getValue(UIComponent.FACETS_KEY);<NEW_LINE>if (facetPropertyDescriptorMap == null) {<NEW_LINE>facetPropertyDescriptorMap = new HashMap<String, PropertyDescriptor>();<NEW_LINE>beanDescriptor.setValue(UIComponent.FACETS_KEY, facetPropertyDescriptorMap);<NEW_LINE>}<NEW_LINE>String facetName = _name.getValue(ctx);<NEW_LINE>if (isCacheable()) {<NEW_LINE>if (_propertyDescriptor == null) {<NEW_LINE>_propertyDescriptor = _createFacetPropertyDescriptor(facetName, ctx);<NEW_LINE>}<NEW_LINE>facetPropertyDescriptorMap.put(facetName, _propertyDescriptor);<NEW_LINE>} else {<NEW_LINE>PropertyDescriptor facetDescriptor = _createFacetPropertyDescriptor(facetName, ctx);<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>nextHandler.apply(ctx, parent);<NEW_LINE>}
|
facetPropertyDescriptorMap.put(facetName, facetDescriptor);
|
384,291
|
void decode(Decoder decoder, Instruction instruction) {<NEW_LINE>instruction.setCode(code);<NEW_LINE>instruction.setOp0Register(decoder.state_reg + decoder.<MASK><NEW_LINE>if ((((decoder.state_zs_flags & StateFlags.Z) | decoder.state_vvvv_invalidCheck | decoder.state_aaa) & decoder.invalidCheckMask) != 0)<NEW_LINE>decoder.setInvalidInstruction();<NEW_LINE>if (decoder.state_mod == 3) {<NEW_LINE>instruction.setOp1Register(decoder.state_rm + decoder.state_extraBaseRegisterBaseEVEX + baseReg2);<NEW_LINE>if ((decoder.state_zs_flags & StateFlags.B) != 0)<NEW_LINE>instruction.setSuppressAllExceptions(true);<NEW_LINE>} else {<NEW_LINE>instruction.setOp1Kind(OpKind.MEMORY);<NEW_LINE>if (((decoder.state_zs_flags & StateFlags.B) & decoder.invalidCheckMask) != 0)<NEW_LINE>decoder.setInvalidInstruction();<NEW_LINE>decoder.readOpMem(instruction, tupleType);<NEW_LINE>}<NEW_LINE>}
|
state_zs_extraRegisterBase + decoder.state_extraRegisterBaseEVEX + baseReg1);
|
1,422,435
|
static PBytes doUnicode(String s, long elementSize, ByteOrder byteOrder, @Shared("factory") @Cached PythonObjectFactory factory) {<NEW_LINE>Charset utf32Charset = byteOrder == ByteOrder.LITTLE_ENDIAN ? UTF32LE : UTF32BE;<NEW_LINE>// elementSize == 2: Store String in 'wchar_t' of size == 2, i.e., use UCS2. This is<NEW_LINE>// achieved by decoding to UTF32 (which is basically UCS4) and ignoring the two<NEW_LINE>// MSBs.<NEW_LINE>if (elementSize == 2L) {<NEW_LINE>ByteBuffer bytes = ByteBuffer.wrap(s.getBytes(utf32Charset));<NEW_LINE>// FIXME unsafe narrowing<NEW_LINE>int size = bytes.remaining() / 2;<NEW_LINE>ByteBuffer buf = ByteBuffer.allocate(size);<NEW_LINE>while (bytes.remaining() >= 4) {<NEW_LINE>if (byteOrder != ByteOrder.nativeOrder()) {<NEW_LINE>buf.putChar((char) ((bytes.getInt() <MASK><NEW_LINE>} else {<NEW_LINE>buf.putChar((char) (bytes.getInt() & 0x0000FFFF));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>buf.flip();<NEW_LINE>byte[] barr = new byte[buf.remaining()];<NEW_LINE>buf.get(barr);<NEW_LINE>return factory.createBytes(barr);<NEW_LINE>} else if (elementSize == 4L) {<NEW_LINE>return factory.createBytes(s.getBytes(utf32Charset));<NEW_LINE>} else {<NEW_LINE>throw new RuntimeException("unsupported wchar size; was: " + elementSize);<NEW_LINE>}<NEW_LINE>}
|
& 0xFFFF0000) >> 16));
|
190,149
|
private void addItemsInRange(AssetInfo asset, List<FeeItem> feeItems, FeeItemsAlgorithm algorithm, int txSize, int scale) {<NEW_LINE>for (int i = algorithm.getMinPosition(); i < algorithm.getMaxPosition(); i++) {<NEW_LINE>FeeItem currFeeItem = createFeeItem(asset, txSize, algorithm.computeValue(i), scale);<NEW_LINE>FeeItem prevFeeItem = !feeItems.isEmpty() ? feeItems.get(feeItems.size() - 1) : null;<NEW_LINE>boolean canAdd = prevFeeItem == null <MASK><NEW_LINE>if (currFeeItem.value != null && prevFeeItem != null && prevFeeItem.value != null && currFeeItem.fiatValue != null && prevFeeItem.fiatValue != null) {<NEW_LINE>String currFiatFee = currFeeItem.fiatValue.toString();<NEW_LINE>String prevFiatFee = prevFeeItem.fiatValue.toString();<NEW_LINE>// if we reached this, then we can override canAdd<NEW_LINE>canAdd = (float) currFeeItem.feePerKb / prevFeeItem.feePerKb >= MIN_FEE_INCREMENT && !currFiatFee.equals(prevFiatFee);<NEW_LINE>}<NEW_LINE>if (canAdd) {<NEW_LINE>feeItems.add(currFeeItem);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
|
|| prevFeeItem.feePerKb < currFeeItem.feePerKb;
|
1,630,917
|
private void addActivityMessage(FriendsChatMember member, ActivityType activityType) {<NEW_LINE>final <MASK><NEW_LINE>if (friendsChatManager == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final String activityMessage = activityType == ActivityType.JOINED ? " has joined." : " has left.";<NEW_LINE>final FriendsChatRank rank = member.getRank();<NEW_LINE>final Color textColor, channelColor;<NEW_LINE>int rankIcon = -1;<NEW_LINE>// Use configured friends chat info colors if set, otherwise default to the jagex text and fc name colors<NEW_LINE>if (client.isResized() && client.getVar(Varbits.TRANSPARENT_CHATBOX) == 1) {<NEW_LINE>textColor = MoreObjects.firstNonNull(chatColorConfig.transparentFriendsChatInfo(), CHAT_FC_TEXT_TRANSPARENT_BACKGROUND);<NEW_LINE>channelColor = MoreObjects.firstNonNull(chatColorConfig.transparentFriendsChatChannelName(), CHAT_FC_NAME_TRANSPARENT_BACKGROUND);<NEW_LINE>} else {<NEW_LINE>textColor = MoreObjects.firstNonNull(chatColorConfig.opaqueFriendsChatInfo(), CHAT_FC_TEXT_OPAQUE_BACKGROUND);<NEW_LINE>channelColor = MoreObjects.firstNonNull(chatColorConfig.opaqueFriendsChatChannelName(), CHAT_FC_NAME_OPAQUE_BACKGROUND);<NEW_LINE>}<NEW_LINE>if (config.chatIcons() && rank != null && rank != FriendsChatRank.UNRANKED) {<NEW_LINE>rankIcon = chatIconManager.getIconNumber(rank);<NEW_LINE>}<NEW_LINE>ChatMessageBuilder message = new ChatMessageBuilder().append("[").append(channelColor, friendsChatManager.getName());<NEW_LINE>if (rankIcon > -1) {<NEW_LINE>message.append(" ").img(rankIcon);<NEW_LINE>}<NEW_LINE>message.append("] ").append(textColor, member.getName() + activityMessage);<NEW_LINE>final String messageString = message.build();<NEW_LINE>final MessageNode line = client.addChatMessage(ChatMessageType.FRIENDSCHATNOTIFICATION, "", messageString, "");<NEW_LINE>MemberJoinMessage joinMessage = new MemberJoinMessage(line, line.getId(), client.getTickCount());<NEW_LINE>joinMessages.addLast(joinMessage);<NEW_LINE>}
|
FriendsChatManager friendsChatManager = client.getFriendsChatManager();
|
271,467
|
public static void encryptAndInsertData(DataSource pool, Aead envAead, String tableName, String team, String email) throws GeneralSecurityException, SQLException {<NEW_LINE>try (Connection conn = pool.getConnection()) {<NEW_LINE>String stmt = String.format("INSERT INTO %s (team, time_cast, voter_email) VALUES (?, ?, ?);", tableName);<NEW_LINE>try (PreparedStatement voteStmt = conn.prepareStatement(stmt)) {<NEW_LINE>voteStmt.setString(1, team);<NEW_LINE>voteStmt.setTimestamp(2, new Timestamp(new Date<MASK><NEW_LINE>// Use the envelope AEAD primitive to encrypt the email, using the team name as<NEW_LINE>// associated data. This binds the encryption of the email to the team name, preventing<NEW_LINE>// associating an encrypted email in one row with a team name in another row.<NEW_LINE>byte[] encryptedEmail = envAead.encrypt(email.getBytes(), team.getBytes());<NEW_LINE>voteStmt.setBytes(3, encryptedEmail);<NEW_LINE>// Finally, execute the statement. If it fails, an error will be thrown.<NEW_LINE>voteStmt.execute();<NEW_LINE>System.out.println(String.format("Successfully inserted row into table %s", tableName));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
|
().getTime()));
|
1,168,980
|
final CreateModelResult executeCreateModel(CreateModelRequest createModelRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(createModelRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<CreateModelRequest> request = null;<NEW_LINE>Response<CreateModelResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new CreateModelRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(createModelRequest));<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, "FraudDetector");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "CreateModel");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<CreateModelResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new CreateModelResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
|
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
|
907,664
|
protected void reconstructCoordinators(RecoverableUnit log) throws SystemException {<NEW_LINE>if (tc.isEntryEnabled())<NEW_LINE>Tr.entry(tc, "reconstructCoordinators", new Object[] { log, this });<NEW_LINE>// Create a WSATRecoveryCoordinator if we are a WSAT subordinate.<NEW_LINE>final RecoverableUnitSection _wsatRCSection = log.lookupSection(RECCOORD_WSAT_SECTION);<NEW_LINE>if (_wsatRCSection != null) {<NEW_LINE>if (_subordinate) {<NEW_LINE>// If we have already discovered we are a subordinate, then something is broken.<NEW_LINE>Tr.error(tc, "WTRN0001_ERR_INT_ERROR", new Object[] { "reconstruct", this.getClass().getName() });<NEW_LINE>if (tc.isEntryEnabled())<NEW_LINE>Tr.exit(tc, "reconstructCoordinators", "SystemException");<NEW_LINE>throw new SystemException();<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>_subordinate = true;<NEW_LINE>final byte[] logData = _wsatRCSection.lastData();<NEW_LINE>_wsatRC = WSATRecoveryCoordinator.fromLogData(logData);<NEW_LINE>// WSATControlSet.reconstruct(this, _wsatRC, getFailureScopeController()); TODO<NEW_LINE>_globalId = _wsatRC.getGlobalId();<NEW_LINE>if (tc.isDebugEnabled())<NEW_LINE>Tr.debug(tc, "We are WSAT subordinate: " + _globalId);<NEW_LINE>new TransactionWrapper(this);<NEW_LINE>} catch (Throwable e) {<NEW_LINE>FFDCFilter.processException(e, "com.ibm.ws.tx.jta.TransactionImpl.reconstruct", "1670", this);<NEW_LINE>Tr.fatal(tc, "WTRN0000_ERR_INT_ERROR", new Object[] { "reconstruct", this.getClass().getName(), e });<NEW_LINE>if (tc.isEntryEnabled())<NEW_LINE>Tr.<MASK><NEW_LINE>throw new SystemException(e.getLocalizedMessage());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (tc.isEntryEnabled())<NEW_LINE>Tr.exit(tc, "reconstructCoordinators");<NEW_LINE>}
|
exit(tc, "reconstructCoordinators", "SystemException");
|
511,800
|
public void paint(Graphics2D g, int x, int y, int w, int h) {<NEW_LINE>float scale = (float) h / (float) mMax;<NEW_LINE>g.setColor(Color.BLACK);<NEW_LINE>int by1 = h - (int) (y + minimum * scale);<NEW_LINE>int by2 = h - (int) (y + maximum * scale);<NEW_LINE>g.drawLine(x, by1, x + w, by1);<NEW_LINE>g.drawLine(x, by2, x + w, by2);<NEW_LINE>int q1 = h - (int) (y + Q1 * scale);<NEW_LINE>int q2 = h - (int) (y + median * scale);<NEW_LINE>int q3 = h - (int) (y + Q3 * scale);<NEW_LINE>int bh = (int) ((Q3 - Q1) * scale);<NEW_LINE>g.drawLine(x + w / 2, by1, x + w / 2, q1);<NEW_LINE>g.drawLine(x + w / 2, q3, x + w / 2, by2);<NEW_LINE>if (isReference) {<NEW_LINE>g.setColor(new Color(115, 118, 255));<NEW_LINE>} else if (isOptimized) {<NEW_LINE>g.setColor(new Color(197, 255, 153));<NEW_LINE>} else {<NEW_LINE>g.setColor(new Color<MASK><NEW_LINE>}<NEW_LINE>g.fillRect(x, q3, w, bh);<NEW_LINE>g.setColor(Color.BLACK);<NEW_LINE>g.drawRect(x, q3, w, bh);<NEW_LINE>g.drawLine(x, q2, x + w, q2);<NEW_LINE>}
|
(255, 88, 119));
|
3,662
|
public boolean filterMatches(AbstractItem item) throws MessageStoreException {<NEW_LINE>if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())<NEW_LINE>SibTr.entry(tc, "filterMatches", item);<NEW_LINE>boolean result = true;<NEW_LINE>// If messages are classified by XD, then check the classification up front.<NEW_LINE>// If the index is 0, then there is no classification<NEW_LINE>if (classIndex > 0) {<NEW_LINE>// If we're classifying then the classification property must match this<NEW_LINE>// filter's classification<NEW_LINE>result = false;<NEW_LINE>// Do not throw exception if Message not available in the store<NEW_LINE>boolean throwExceptionIfMessageNotAvailable = false;<NEW_LINE>// Need to get the classification out of the message<NEW_LINE>String keyClassification = ((SIMPMessage) item).getMessageControlClassification(throwExceptionIfMessageNotAvailable);<NEW_LINE>if (keyClassification != null && keyClassification.equalsIgnoreCase(classificationName))<NEW_LINE>result = true;<NEW_LINE>else {<NEW_LINE>if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())<NEW_LINE>SibTr.debug(tc, "filter class: " + classificationName + ", message class: " + keyClassification);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// If we still have a potential match, then drive any selector<NEW_LINE>// processing through the parent class.<NEW_LINE>if (result)<NEW_LINE>result = parentFilter.filterMatches(item);<NEW_LINE>if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())<NEW_LINE>SibTr.exit(tc, "filterMatches"<MASK><NEW_LINE>return result;<NEW_LINE>}
|
, Boolean.valueOf(result));
|
959,827
|
private void checkHashesPartition(List<String> hashes, Map<String, BugInstance> bugsByHash) throws IOException {<NEW_LINE>FindIssuesResponse response = submitHashes(hashes);<NEW_LINE>if (response.hasCurrentServerTime() && (response.getCurrentServerTime() < earliestSeenServerTime))<NEW_LINE>earliestSeenServerTime = response.getCurrentServerTime();<NEW_LINE>int count = Math.min(hashes.size(), response.getFoundIssuesCount());<NEW_LINE>if (hashes.size() != response.getFoundIssuesCount()) {<NEW_LINE>LOGGER.severe(String.format("Requested %d issues, got %d responses", hashes.size()<MASK><NEW_LINE>}<NEW_LINE>for (int j = 0; j < count; j++) {<NEW_LINE>String hash = hashes.get(j);<NEW_LINE>Issue issue = response.getFoundIssues(j);<NEW_LINE>if (isEmpty(issue))<NEW_LINE>// the issue was not found!<NEW_LINE>continue;<NEW_LINE>storeIssueDetails(hash, issue);<NEW_LINE>BugInstance bugInstance;<NEW_LINE>if (FORCE_UPLOAD_ALL_ISSUES)<NEW_LINE>bugInstance = bugsByHash.get(hash);<NEW_LINE>else<NEW_LINE>bugInstance = bugsByHash.remove(hash);<NEW_LINE>if (bugInstance == null) {<NEW_LINE>LOGGER.warning("Server sent back issue that we don't know about: " + hash + " - " + issue);<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>long firstSeen = cloudClient.getLocalFirstSeen(bugInstance);<NEW_LINE>long cloudFirstSeen = issue.getFirstSeen();<NEW_LINE>if (WebCloudClient.DEBUG_FIRST_SEEN)<NEW_LINE>System.out.printf("%s %s%n", new Date(firstSeen), new Date(cloudFirstSeen));<NEW_LINE>if (firstSeen > 0 && firstSeen < cloudFirstSeen)<NEW_LINE>timestampsToUpdate.add(hash);<NEW_LINE>cloudClient.updateBugInstanceAndNotify(bugInstance);<NEW_LINE>}<NEW_LINE>}
|
, response.getFoundIssuesCount()));
|
1,389,718
|
public Mono<Void> commitTransaction() {<NEW_LINE>return useTransactionStatus(transactionStatus -> {<NEW_LINE>if (IDLE != transactionStatus) {<NEW_LINE>return Flux.from(exchange("COMMIT")).doOnComplete(this::cleanupIsolationLevel).filter(CommandComplete.class::isInstance).cast(CommandComplete.class).<BackendMessage>handle((message, sink) -> {<NEW_LINE>// Certain backend versions (e.g. 12.2, 11.7, 10.12, 9.6.17, 9.5.21, etc)<NEW_LINE>// silently rollback the transaction in the response to COMMIT statement<NEW_LINE>// in case the transaction has failed.<NEW_LINE>// See discussion in pgsql-hackers: https://www.postgresql.org/message-id/b9fb50dc-0f6e-15fb-6555-8ddb86f4aa71%40postgresfriends.org<NEW_LINE>if ("ROLLBACK".equalsIgnoreCase(message.getCommand())) {<NEW_LINE>sink.error(new ExceptionFactory.PostgresqlRollbackException(ErrorDetails.fromMessage("The database returned ROLLBACK, so the transaction cannot be committed. Transaction" + <MASK><NEW_LINE>return;<NEW_LINE>}<NEW_LINE>sink.next(message);<NEW_LINE>});<NEW_LINE>} else {<NEW_LINE>this.logger.debug(this.connectionContext.getMessage("Skipping commit transaction because status is {}"), transactionStatus);<NEW_LINE>return Mono.empty();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}
|
" " + "failure is not known (check server logs?)"), "COMMIT"));
|
742,743
|
public int execute(final String fullCommand, final CommandLine cl, final Shell shellState) throws AccumuloException, AccumuloSecurityException, IOException {<NEW_LINE>final String currentUser = shellState.getAccumuloClient().whoami();<NEW_LINE>final String user = cl.getOptionValue(userOpt.getOpt(), currentUser);<NEW_LINE>String password = null;<NEW_LINE>String passwordConfirm = null;<NEW_LINE>String oldPassword = null;<NEW_LINE>oldPassword = shellState.readMaskedLine("Enter current password for '" + currentUser + "': ", '*');<NEW_LINE>if (oldPassword == null) {<NEW_LINE>shellState.getWriter().println();<NEW_LINE>return 0;<NEW_LINE>}<NEW_LINE>// user canceled<NEW_LINE>if (!shellState.getAccumuloClient().securityOperations().authenticateUser(currentUser, new PasswordToken(oldPassword)))<NEW_LINE>throw new AccumuloSecurityException(user, SecurityErrorCode.BAD_CREDENTIALS);<NEW_LINE>password = shellState.readMaskedLine(<MASK><NEW_LINE>if (password == null) {<NEW_LINE>shellState.getWriter().println();<NEW_LINE>return 0;<NEW_LINE>}<NEW_LINE>// user canceled<NEW_LINE>passwordConfirm = shellState.readMaskedLine("Please confirm new password for '" + user + "': ", '*');<NEW_LINE>if (passwordConfirm == null) {<NEW_LINE>shellState.getWriter().println();<NEW_LINE>return 0;<NEW_LINE>}<NEW_LINE>// user canceled<NEW_LINE>if (!password.equals(passwordConfirm)) {<NEW_LINE>throw new IllegalArgumentException("Passwords do not match");<NEW_LINE>}<NEW_LINE>byte[] pass = password.getBytes(UTF_8);<NEW_LINE>shellState.getAccumuloClient().securityOperations().changeLocalUserPassword(user, new PasswordToken(pass));<NEW_LINE>// update the current credentials if the password changed was for<NEW_LINE>// the current user<NEW_LINE>if (shellState.getAccumuloClient().whoami().equals(user)) {<NEW_LINE>shellState.updateUser(user, new PasswordToken(pass));<NEW_LINE>}<NEW_LINE>Shell.log.debug("Changed password for user {}", user);<NEW_LINE>return 0;<NEW_LINE>}
|
"Enter new password for '" + user + "': ", '*');
|
1,731,653
|
private Object invoke(HashMap<String, Object> event, Context context) throws Exception {<NEW_LINE>Method method = findHandlerMethod(this.clazz, this.handlerName);<NEW_LINE>Class<?> requestClass = method.getParameterTypes()[0];<NEW_LINE>Mapper mapper = MapperFactory.getMapper(requestClass);<NEW_LINE>Object <MASK><NEW_LINE>if (method.getParameterCount() == 1) {<NEW_LINE>return method.invoke(this.instance, request);<NEW_LINE>} else if (method.getParameterCount() == 2) {<NEW_LINE>return method.invoke(this.instance, request, context);<NEW_LINE>} else if (method.getParameterCount() == 3 && requestClass.isAssignableFrom(InputStream.class)) {<NEW_LINE>ByteArrayOutputStream outputStream = new ByteArrayOutputStream();<NEW_LINE>method.invoke(this.instance, request, outputStream, context);<NEW_LINE>return outputStream;<NEW_LINE>} else {<NEW_LINE>throw new NoSuchMethodException("Handler should take 1, 2, or 3 (com.amazonaws.services.lambda.runtime.RequestStreamHandler compatible handlers) arguments: " + method);<NEW_LINE>}<NEW_LINE>}
|
request = mapper.read(event);
|
1,044,990
|
public Boolean visit(ScopeBinding command) {<NEW_LINE>Scope scope = command.getScope();<NEW_LINE>Class<? extends Annotation> annotationType = command.getAnnotationType();<NEW_LINE>if (Annotations.isScopeAnnotation(annotationType) == false) {<NEW_LINE>errors.withSource(annotationType).missingScopeAnnotation();<NEW_LINE>// Go ahead and bind anyway so we don't get collateral errors.<NEW_LINE>}<NEW_LINE>if (Annotations.isRetainedAtRuntime(annotationType) == false) {<NEW_LINE>errors.withSource(annotationType).missingRuntimeRetention(command.getSource());<NEW_LINE>// Go ahead and bind anyway so we don't get collateral errors.<NEW_LINE>}<NEW_LINE>Scope existing = injector.state.getScope(Objects.requireNonNull(annotationType, "annotation type"));<NEW_LINE>if (existing != null) {<NEW_LINE>errors.<MASK><NEW_LINE>} else {<NEW_LINE>injector.state.putAnnotation(annotationType, Objects.requireNonNull(scope, "scope"));<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>}
|
duplicateScopes(existing, annotationType, scope);
|
632,221
|
public boolean createConfigAndDefaultPrinterMatching(@NonNull final I_AD_PrinterHW printerHW) {<NEW_LINE>final Properties ctx = getCtx(printerHW);<NEW_LINE><MASK><NEW_LINE>final List<I_AD_Printer> printers = Services.get(IPrintingDAO.class).retrievePrinters(ctx, printerHW.getAD_Org_ID());<NEW_LINE>if (printers.isEmpty()) {<NEW_LINE>// no logical printer defined, nothing to match<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>boolean anythingCreated = false;<NEW_LINE>for (final I_AD_Printer printer : printers) {<NEW_LINE>// Generate default matching<NEW_LINE>final I_AD_Printer_Matching printerMatchingOrNull = createPrinterMatchingIfNoneExists(printerConfig, printer, printerHW);<NEW_LINE>anythingCreated = anythingCreated || printerMatchingOrNull != null;<NEW_LINE>}<NEW_LINE>return anythingCreated;<NEW_LINE>}
|
final I_AD_Printer_Config printerConfig = createPrinterConfigIfNoneExists(printerHW);
|
1,482,186
|
public String convertAuditRecordToMessage(final PwmApplication pwmApplication, final AuditRecord auditRecord) throws PwmUnrecoverableException {<NEW_LINE>final AppConfig domainConfig = pwmApplication.getConfig();<NEW_LINE>final Settings settings = Settings.fromConfiguration(domainConfig);<NEW_LINE>final String auditRecordAsJson = JsonFactory.get().serialize(auditRecord);<NEW_LINE>final Map<String, Object> auditRecordMap = JsonFactory.get().deserializeMap(auditRecordAsJson, String.class, Object.class);<NEW_LINE>final Optional<String> srcHost = PwmApplication.deriveLocalServerHostname(pwmApplication.getConfig());<NEW_LINE>final StringBuilder cefOutput = new StringBuilder();<NEW_LINE>// cef header<NEW_LINE>cefOutput.append(makeCefHeader<MASK><NEW_LINE>cefOutput.append(CEFAuditFormatter.CEF_EXTENSION_SEPARATOR);<NEW_LINE>srcHost.ifPresent(s -> appendCefValue(CEFAuditField.dvchost.name(), s, cefOutput, settings));<NEW_LINE>if (StringUtil.isEmpty(settings.getCefTimezone())) {<NEW_LINE>appendCefValue(CEFAuditField.dtz.name(), settings.getCefTimezone(), cefOutput, settings);<NEW_LINE>}<NEW_LINE>for (final CEFAuditField cefAuditField : CEFAuditField.values()) {<NEW_LINE>if (cefAuditField.getAuditField() != null) {<NEW_LINE>final String auditFieldName = cefAuditField.getAuditField().name();<NEW_LINE>final Object value = auditRecordMap.get(auditFieldName);<NEW_LINE>if (value != null) {<NEW_LINE>final String valueString = value.toString();<NEW_LINE>appendCefValue(auditFieldName, valueString, cefOutput, settings);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>final int cefLength = CEFAuditFormatter.CEF_EXTENSION_SEPARATOR.length();<NEW_LINE>if (Objects.equals(cefOutput.substring(cefOutput.length() - cefLength), CEFAuditFormatter.CEF_EXTENSION_SEPARATOR)) {<NEW_LINE>cefOutput.replace(cefOutput.length() - cefLength, cefOutput.length(), "");<NEW_LINE>}<NEW_LINE>return cefOutput.toString();<NEW_LINE>}
|
(pwmApplication, settings, auditRecord));
|
1,122,539
|
protected void writeBuf(BlockWriteRequestContext context, StreamObserver<WriteResponse> observer, DataBuffer buf, long pos) throws Exception {<NEW_LINE>Preconditions.checkState(context != null);<NEW_LINE>WriteRequest request = context.getRequest();<NEW_LINE>long bytesReserved = context.getBytesReserved();<NEW_LINE>if (bytesReserved < pos) {<NEW_LINE>long bytesToReserve = Math.max(FILE_BUFFER_SIZE, pos - bytesReserved);<NEW_LINE>// Allocate enough space in the existing temporary block for the write.<NEW_LINE>mWorker.requestSpace(request.getSessionId(), request.getId(), bytesToReserve);<NEW_LINE>context.setBytesReserved(bytesReserved + bytesToReserve);<NEW_LINE>}<NEW_LINE>if (context.getBlockWriter() == null) {<NEW_LINE>context.setBlockWriter(mWorker.createBlockWriter(request.getSessionId(), request.getId()));<NEW_LINE>}<NEW_LINE>Preconditions.checkState(<MASK><NEW_LINE>int sz = buf.readableBytes();<NEW_LINE>Preconditions.checkState(context.getBlockWriter().append(buf) == sz);<NEW_LINE>}
|
context.getBlockWriter() != null);
|
1,762,437
|
private synchronized void init() {<NEW_LINE>if (!initialized.compareAndSet(false, true)) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>LOG.debug("GStreamer webcam device initialization");<NEW_LINE>pipe = new Pipeline(getName());<NEW_LINE>source = ElementFactory.make(GStreamerDriver.getSourceBySystem(), "source");<NEW_LINE>if (Platform.isWindows()) {<NEW_LINE>source.set("device-index", deviceIndex);<NEW_LINE>} else if (Platform.isLinux()) {<NEW_LINE>source.set("device", videoFile.getAbsolutePath());<NEW_LINE>} else if (Platform.isMacOSX()) {<NEW_LINE>throw new IllegalStateException("not yet implemented");<NEW_LINE>}<NEW_LINE>sink = new <MASK><NEW_LINE>sink.setPassDirectBuffer(true);<NEW_LINE>sink.getSinkElement().setMaximumLateness(LATENESS, TimeUnit.MILLISECONDS);<NEW_LINE>sink.getSinkElement().setQOSEnabled(true);<NEW_LINE>filter = ElementFactory.make("capsfilter", "capsfilter");<NEW_LINE>jpegdec = ElementFactory.make("jpegdec", "jpegdec");<NEW_LINE>pipelineReady();<NEW_LINE>resolutions = parseResolutions(source.getPads().get(0));<NEW_LINE>pipelineStop();<NEW_LINE>}
|
RGBDataSink(getName(), this);
|
1,393,465
|
public SuggestionMatch unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>SuggestionMatch suggestionMatch = new SuggestionMatch();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return 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("suggestion", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>suggestionMatch.setSuggestion(context.getUnmarshaller(String.<MASK><NEW_LINE>}<NEW_LINE>if (context.testExpression("score", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>suggestionMatch.setScore(context.getUnmarshaller(Long.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("id", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>suggestionMatch.setId(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 suggestionMatch;<NEW_LINE>}
|
class).unmarshall(context));
|
1,526,979
|
public static void vertical5(Kernel1D_S32 kernel, GrayS16 src, GrayI16 dst) {<NEW_LINE>final short[] dataSrc = src.data;<NEW_LINE>final short[] dataDst = dst.data;<NEW_LINE>final int k1 = kernel.data[0];<NEW_LINE>final int k2 = kernel.data[1];<NEW_LINE>final int k3 = kernel.data[2];<NEW_LINE>final int k4 = kernel.data[3];<NEW_LINE>final int <MASK><NEW_LINE>final int radius = kernel.getRadius();<NEW_LINE>final int imgWidth = dst.getWidth();<NEW_LINE>final int imgHeight = dst.getHeight();<NEW_LINE>final int yEnd = imgHeight - radius;<NEW_LINE>// CONCURRENT_BELOW BoofConcurrency.loopFor(radius, yEnd, y -> {<NEW_LINE>for (int y = radius; y < yEnd; y++) {<NEW_LINE>int indexDst = dst.startIndex + y * dst.stride;<NEW_LINE>int i = src.startIndex + (y - radius) * src.stride;<NEW_LINE>final int iEnd = i + imgWidth;<NEW_LINE>for (; i < iEnd; i++) {<NEW_LINE>int indexSrc = i;<NEW_LINE>int total = (dataSrc[indexSrc]) * k1;<NEW_LINE>indexSrc += src.stride;<NEW_LINE>total += (dataSrc[indexSrc]) * k2;<NEW_LINE>indexSrc += src.stride;<NEW_LINE>total += (dataSrc[indexSrc]) * k3;<NEW_LINE>indexSrc += src.stride;<NEW_LINE>total += (dataSrc[indexSrc]) * k4;<NEW_LINE>indexSrc += src.stride;<NEW_LINE>total += (dataSrc[indexSrc]) * k5;<NEW_LINE>dataDst[indexDst++] = (short) total;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// CONCURRENT_ABOVE });<NEW_LINE>}
|
k5 = kernel.data[4];
|
1,262,135
|
public static DescribeDBInstancesResponse unmarshall(DescribeDBInstancesResponse describeDBInstancesResponse, UnmarshallerContext context) {<NEW_LINE>describeDBInstancesResponse.setRequestId(context.stringValue("DescribeDBInstancesResponse.RequestId"));<NEW_LINE>describeDBInstancesResponse.setCode(context.stringValue("DescribeDBInstancesResponse.Code"));<NEW_LINE>describeDBInstancesResponse.setMessage<MASK><NEW_LINE>describeDBInstancesResponse.setSuccess(context.stringValue("DescribeDBInstancesResponse.Success"));<NEW_LINE>Data data = new Data();<NEW_LINE>data.setPageNumber(context.integerValue("DescribeDBInstancesResponse.Data.PageNumber"));<NEW_LINE>data.setTotalRecordCount(context.integerValue("DescribeDBInstancesResponse.Data.TotalRecordCount"));<NEW_LINE>data.setPageRecordCount(context.integerValue("DescribeDBInstancesResponse.Data.PageRecordCount"));<NEW_LINE>List<DBInstanceVO> items = new ArrayList<DBInstanceVO>();<NEW_LINE>for (int i = 0; i < context.lengthValue("DescribeDBInstancesResponse.Data.Items.Length"); i++) {<NEW_LINE>DBInstanceVO dBInstanceVO = new DBInstanceVO();<NEW_LINE>dBInstanceVO.setDbInstanceId(context.stringValue("DescribeDBInstancesResponse.Data.Items[" + i + "].DbInstanceId"));<NEW_LINE>dBInstanceVO.setInstanceDescription(context.stringValue("DescribeDBInstancesResponse.Data.Items[" + i + "].InstanceDescription"));<NEW_LINE>dBInstanceVO.setPayType(context.stringValue("DescribeDBInstancesResponse.Data.Items[" + i + "].PayType"));<NEW_LINE>dBInstanceVO.setInstanceStatus(context.stringValue("DescribeDBInstancesResponse.Data.Items[" + i + "].InstanceStatus"));<NEW_LINE>dBInstanceVO.setRegionId(context.stringValue("DescribeDBInstancesResponse.Data.Items[" + i + "].RegionId"));<NEW_LINE>dBInstanceVO.setZoneId(context.stringValue("DescribeDBInstancesResponse.Data.Items[" + i + "].ZoneId"));<NEW_LINE>dBInstanceVO.setVpcId(context.stringValue("DescribeDBInstancesResponse.Data.Items[" + i + "].VpcId"));<NEW_LINE>dBInstanceVO.setVSwitchId(context.stringValue("DescribeDBInstancesResponse.Data.Items[" + i + "].VSwitchId"));<NEW_LINE>dBInstanceVO.setInstanceType(context.stringValue("DescribeDBInstancesResponse.Data.Items[" + i + "].InstanceType"));<NEW_LINE>dBInstanceVO.setStorageType(context.stringValue("DescribeDBInstancesResponse.Data.Items[" + i + "].StorageType"));<NEW_LINE>items.add(dBInstanceVO);<NEW_LINE>}<NEW_LINE>data.setItems(items);<NEW_LINE>describeDBInstancesResponse.setData(data);<NEW_LINE>return describeDBInstancesResponse;<NEW_LINE>}
|
(context.stringValue("DescribeDBInstancesResponse.Message"));
|
1,326,273
|
public void doBuild(AdminModel model, Element adminElement, ConfigModelContext modelContext) {<NEW_LINE>if (modelContext.getDeployState().isHosted()) {<NEW_LINE>// admin v4 is used on hosted: Build a default V4 instead<NEW_LINE>new BuilderV4().<MASK><NEW_LINE>return;<NEW_LINE>}<NEW_LINE>AbstractConfigProducer<?> parent = modelContext.getParentProducer();<NEW_LINE>ModelContext.Properties properties = modelContext.getDeployState().getProperties();<NEW_LINE>DomAdminV2Builder domBuilder = new DomAdminV2Builder(modelContext.getApplicationType(), properties.multitenant(), properties.configServerSpecs());<NEW_LINE>model.admin = domBuilder.build(modelContext.getDeployState(), parent, adminElement);<NEW_LINE>// TODO: Is required since other models depend on admin.<NEW_LINE>if (parent instanceof ApplicationConfigProducerRoot) {<NEW_LINE>((ApplicationConfigProducerRoot) parent).setupAdmin(model.admin);<NEW_LINE>}<NEW_LINE>}
|
doBuild(model, adminElement, modelContext);
|
1,016,385
|
public static APIGetResourceConfigReply __example__() {<NEW_LINE>APIGetResourceConfigReply reply = new APIGetResourceConfigReply();<NEW_LINE>reply.value = "5";<NEW_LINE>ResourceConfigInventory hostConfig = new ResourceConfigInventory();<NEW_LINE>hostConfig.setCategory("host");<NEW_LINE>hostConfig.setName("cpu.overProvisioning.ratio");<NEW_LINE>hostConfig.setResourceType(HostVO.class.getSimpleName());<NEW_LINE>hostConfig.setResourceUuid(Platform.getUuid());<NEW_LINE>hostConfig.setUuid(Platform.getUuid());<NEW_LINE>hostConfig.setCreateDate(new Timestamp(org.zstack.header.message.DocUtils.date));<NEW_LINE>hostConfig.setLastOpDate(new Timestamp(org.zstack.header.message.DocUtils.date));<NEW_LINE>hostConfig.setValue("5");<NEW_LINE>ResourceConfigInventory clusterConfig = new ResourceConfigInventory();<NEW_LINE>clusterConfig.setCategory("host");<NEW_LINE>clusterConfig.setName("cpu.overProvisioning.ratio");<NEW_LINE>clusterConfig.setResourceType(ClusterVO.class.getSimpleName());<NEW_LINE>clusterConfig.setResourceUuid(Platform.getUuid());<NEW_LINE>clusterConfig.setUuid(Platform.getUuid());<NEW_LINE>clusterConfig.setCreateDate(new Timestamp(org.zstack.header<MASK><NEW_LINE>clusterConfig.setLastOpDate(new Timestamp(org.zstack.header.message.DocUtils.date));<NEW_LINE>clusterConfig.setValue("10");<NEW_LINE>reply.effectiveConfigs = Arrays.asList(hostConfig, clusterConfig);<NEW_LINE>return reply;<NEW_LINE>}
|
.message.DocUtils.date));
|
651,632
|
private final void addForeignKey0(MutableTable mt, ConstraintImpl impl) {<NEW_LINE>MutableSchema ms = getSchema(impl.$referencesTable().getSchema());<NEW_LINE>if (ms == null)<NEW_LINE>throw notExists(impl.$referencesTable().getSchema());<NEW_LINE>MutableTable mrf = ms.table(impl.$referencesTable());<NEW_LINE>MutableUniqueKey mu = null;<NEW_LINE>if (mrf == null)<NEW_LINE>throw notExists(impl.$referencesTable());<NEW_LINE>List<MutableField> mfs = mt.fields(impl.$foreignKey(), true);<NEW_LINE>List<MutableField> mrfs = mrf.fields(impl.$references(), true);<NEW_LINE>if (!mrfs.isEmpty())<NEW_LINE>mu = mrf.uniqueKey(mrfs);<NEW_LINE>else if (mrf.primaryKey != null && mrf.primaryKey.fields.size() == mfs.size())<NEW_LINE>mrfs = (mu = mrf.primaryKey).fields;<NEW_LINE>if (mu == null)<NEW_LINE>throw primaryKeyNotExists(impl.$referencesTable());<NEW_LINE>mt.foreignKeys.add(new MutableForeignKey((UnqualifiedName) impl.getUnqualifiedName(), mt, mfs, mu, mrfs, impl.$onDelete(), impl.$onUpdate()<MASK><NEW_LINE>}
|
, impl.$enforced()));
|
1,457,873
|
public static void debugHtml(Writer writer, FacesContext faces) throws IOException {<NEW_LINE>_init(faces);<NEW_LINE>Date now = new Date();<NEW_LINE>for (int i = 0; i < debugParts.length; i++) {<NEW_LINE>if ("message".equals(debugParts[i])) {<NEW_LINE>writer.write(faces.getViewRoot().getViewId());<NEW_LINE>} else if ("now".equals(debugParts[i])) {<NEW_LINE>writer.write(DateFormat.getDateTimeInstance().format(now));<NEW_LINE>} else if ("tree".equals(debugParts[i])) {<NEW_LINE>_writeComponent(faces, writer, faces.getViewRoot(), null, true);<NEW_LINE>} else if ("extendedtree".equals(debugParts[i])) {<NEW_LINE>_writeExtendedComponentTree(writer, faces);<NEW_LINE>} else if ("vars".equals(debugParts[i])) {<NEW_LINE>_writeVariables(writer, faces, faces.getViewRoot());<NEW_LINE>} else {<NEW_LINE>writer<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
|
.write(debugParts[i]);
|
1,032,273
|
final CreateInstancesFromSnapshotResult executeCreateInstancesFromSnapshot(CreateInstancesFromSnapshotRequest createInstancesFromSnapshotRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(createInstancesFromSnapshotRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<CreateInstancesFromSnapshotRequest> request = null;<NEW_LINE>Response<CreateInstancesFromSnapshotResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new CreateInstancesFromSnapshotRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(createInstancesFromSnapshotRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "Lightsail");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "CreateInstancesFromSnapshot");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<CreateInstancesFromSnapshotResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new CreateInstancesFromSnapshotResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
|
HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());
|
387,452
|
public void testAnnotationJavamailSessionCreated() throws Throwable {<NEW_LINE>if (jm2 != null) {<NEW_LINE>Properties props = jm2.getProperties();<NEW_LINE>System.out.println("JavamailFATServlet.testAnnotationJavamailSessionCreated properties : " + props.toString());<NEW_LINE>// Validate we got the session we expected<NEW_LINE>String userValue = jm2.getProperty("mail.user");<NEW_LINE>if (!("jm2test").equals(userValue)) {<NEW_LINE>throw new Exception("Did not find the user for mail session jm2 defined as an annotation");<NEW_LINE>}<NEW_LINE>String fromValue = jm2.getProperty("mail.from");<NEW_LINE>if (!("jm2From").equals(fromValue)) {<NEW_LINE>throw new Exception("Did not find the from value for mail session jm2 defined as an annotation");<NEW_LINE>}<NEW_LINE>String descValue = jm2.getProperty("description");<NEW_LINE>if (!("jm2Desc").equals(descValue)) {<NEW_LINE>throw new Exception("Did not find the description for mail session jm2 defined as an annotation");<NEW_LINE>}<NEW_LINE>String spValue = jm2.getProperty("mail.store.protocol");<NEW_LINE>if (!("jm2StoreProtocol").equals(spValue)) {<NEW_LINE>throw new Exception("Did not find the store.protocol for mail session jm2 defined as an annotation");<NEW_LINE>}<NEW_LINE>String <MASK><NEW_LINE>if (!("jm2TransportProtocol").equals(tpValue)) {<NEW_LINE>throw new Exception("Did not find the transport.protocol for mail session jm2 defined as an annotation");<NEW_LINE>}<NEW_LINE>// Vaidate the property "test" returns the value added with the annotation<NEW_LINE>String testValue = jm2.getProperty("test");<NEW_LINE>if (testValue == null || !testValue.equals("jm2Def_MailSession")) {<NEW_LINE>throw new Exception("Did not find the test property for mail session mergeMS defined as an annotation, instead found: " + testValue);<NEW_LINE>}<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>throw new Exception("Annotated jm2 MailSession was null");<NEW_LINE>}
|
tpValue = jm2.getProperty("mail.transport.protocol");
|
806,094
|
void addFunction(final T function) {<NEW_LINE>final List<ParamType> parameters = function.parameters();<NEW_LINE>if (allFunctions.put(parameters, function) != null) {<NEW_LINE>throw new KsqlFunctionException("Can't add function " + function.name() + " with parameters " + function.parameters() + " as a function with the same name and parameter types already exists " + allFunctions.get(parameters));<NEW_LINE>}<NEW_LINE>Node curr = root;<NEW_LINE>Node parent = curr;<NEW_LINE>for (final ParamType parameter : parameters) {<NEW_LINE>final Parameter param = new Parameter(parameter, false);<NEW_LINE>parent = curr;<NEW_LINE>curr = curr.children.computeIfAbsent(param, ignored -> new Node());<NEW_LINE>}<NEW_LINE>if (function.isVariadic()) {<NEW_LINE>// first add the function to the parent to address the<NEW_LINE>// case of empty varargs<NEW_LINE>parent.update(function);<NEW_LINE>// then add a new child node with the parameter value type<NEW_LINE>// and add this function to that node<NEW_LINE>final ParamType varargSchema = Iterables.getLast(parameters);<NEW_LINE>final Parameter vararg <MASK><NEW_LINE>final Node leaf = parent.children.computeIfAbsent(vararg, ignored -> new Node());<NEW_LINE>leaf.update(function);<NEW_LINE>// add a self referential loop for varargs so that we can<NEW_LINE>// add as many of the same param at the end and still retrieve<NEW_LINE>// this node<NEW_LINE>leaf.children.putIfAbsent(vararg, leaf);<NEW_LINE>}<NEW_LINE>curr.update(function);<NEW_LINE>}
|
= new Parameter(varargSchema, true);
|
1,337,301
|
public void handle(JsonRequest request, JsonResponse response) throws Exception {<NEW_LINE>var exchange = request.getExchange();<NEW_LINE>switch(request.getMethod()) {<NEW_LINE>case GET -><NEW_LINE>{<NEW_LINE>if (checkRequestPath(request)) {<NEW_LINE>var roles = array();<NEW_LINE>request.getAuthenticatedAccount().getRoles().forEach(roles::add);<NEW_LINE>response.setContent(object().put("authenticated", true)<MASK><NEW_LINE>} else {<NEW_LINE>exchange.setStatusCode(HttpStatus.SC_FORBIDDEN);<NEW_LINE>// REMOVE THE AUTH TOKEN HEADERS!!!!!!!!!!!<NEW_LINE>response.getHeaders().remove(AUTH_TOKEN_HEADER);<NEW_LINE>response.getHeaders().remove(AUTH_TOKEN_VALID_HEADER);<NEW_LINE>response.getHeaders().remove(AUTH_TOKEN_LOCATION_HEADER);<NEW_LINE>exchange.endExchange();<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>case OPTIONS -><NEW_LINE>handleOptions(request);<NEW_LINE>default -><NEW_LINE>{<NEW_LINE>exchange.setStatusCode(HttpStatus.SC_METHOD_NOT_ALLOWED);<NEW_LINE>exchange.endExchange();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
|
.put("roles", roles));
|
1,122,571
|
public static LinkedBuffer writeAscii(final CharSequence str, final WriteSession session, final LinkedBuffer lb) throws IOException {<NEW_LINE>final int len = str.length();<NEW_LINE>if (len == 0)<NEW_LINE>return lb;<NEW_LINE>int offset = lb.offset;<NEW_LINE>final int limit = lb.buffer.length;<NEW_LINE>final byte[] buffer = lb.buffer;<NEW_LINE>// actual size<NEW_LINE>session.size += len;<NEW_LINE>if (offset + len > limit) {<NEW_LINE>// need to flush<NEW_LINE>int index = 0, start = lb.start, bufSize = limit - start, available = limit - offset, remaining = len - available;<NEW_LINE>// write available space<NEW_LINE>while (available-- > 0) buffer[offset++] = (byte) str.charAt(index++);<NEW_LINE>// flush and reset<NEW_LINE>offset = session.flush(buffer, start, bufSize);<NEW_LINE>while (remaining-- > 0) {<NEW_LINE>if (offset == limit)<NEW_LINE>offset = session.<MASK><NEW_LINE>buffer[offset++] = (byte) str.charAt(index++);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>// fast path<NEW_LINE>for (int i = 0; i < len; i++) buffer[offset++] = (byte) str.charAt(i);<NEW_LINE>}<NEW_LINE>lb.offset = offset;<NEW_LINE>return lb;<NEW_LINE>}
|
flush(buffer, start, bufSize);
|
1,398,123
|
protected JPopupMenu createPopup(Point p) {<NEW_LINE>final List<Edge> selectedElements = elementsDataTable.getElementsFromSelectedRows();<NEW_LINE>final Edge clickedElement = elementsDataTable.getElementFromRow<MASK><NEW_LINE>JPopupMenu contextMenu = new JPopupMenu();<NEW_LINE>// First add edges manipulators items:<NEW_LINE>DataLaboratoryHelper dlh = DataLaboratoryHelper.getDefault();<NEW_LINE>Integer lastManipulatorType = null;<NEW_LINE>for (EdgesManipulator em : dlh.getEdgesManipulators()) {<NEW_LINE>em.setup(selectedElements.toArray(new Edge[0]), clickedElement);<NEW_LINE>if (lastManipulatorType == null) {<NEW_LINE>lastManipulatorType = em.getType();<NEW_LINE>}<NEW_LINE>if (lastManipulatorType != em.getType()) {<NEW_LINE>contextMenu.addSeparator();<NEW_LINE>}<NEW_LINE>lastManipulatorType = em.getType();<NEW_LINE>if (em.isAvailable()) {<NEW_LINE>contextMenu.add(PopupMenuUtils.createMenuItemFromEdgesManipulator(em, clickedElement, selectedElements.toArray(new Edge[0])));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Add AttributeValues manipulators submenu:<NEW_LINE>Column column = elementsDataTable.getColumnAtIndex(table.columnAtPoint(p));<NEW_LINE>if (column != null) {<NEW_LINE>contextMenu.add(PopupMenuUtils.createSubMenuFromRowColumn(clickedElement, column));<NEW_LINE>}<NEW_LINE>return contextMenu;<NEW_LINE>}
|
(table.rowAtPoint(p));
|
569,982
|
public void onError(java.lang.Exception e) {<NEW_LINE>byte msgType = org.apache.thrift.protocol.TMessageType.REPLY;<NEW_LINE>org.apache.thrift.TSerializable msg;<NEW_LINE>executeFateOperation_result result = new executeFateOperation_result();<NEW_LINE>if (e instanceof org.apache.accumulo.core.clientImpl.thrift.ThriftSecurityException) {<NEW_LINE>result.sec = (org.apache.accumulo.core.clientImpl.thrift.ThriftSecurityException) e;<NEW_LINE>result.setSecIsSet(true);<NEW_LINE>msg = result;<NEW_LINE>} else if (e instanceof org.apache.accumulo.core.clientImpl.thrift.ThriftTableOperationException) {<NEW_LINE>result.tope = (org.apache.accumulo.core.clientImpl.thrift.ThriftTableOperationException) e;<NEW_LINE>result.setTopeIsSet(true);<NEW_LINE>msg = result;<NEW_LINE>} else if (e instanceof org.apache.accumulo.core.clientImpl.thrift.ThriftNotActiveServiceException) {<NEW_LINE>result.tnase = (org.apache.accumulo.core.clientImpl.thrift.ThriftNotActiveServiceException) e;<NEW_LINE>result.setTnaseIsSet(true);<NEW_LINE>msg = result;<NEW_LINE>} else if (e instanceof org.apache.thrift.transport.TTransportException) {<NEW_LINE>_LOGGER.error("TTransportException inside handler", e);<NEW_LINE>fb.close();<NEW_LINE>return;<NEW_LINE>} else if (e instanceof org.apache.thrift.TApplicationException) {<NEW_LINE>_LOGGER.error("TApplicationException inside handler", e);<NEW_LINE>msgType = org.apache<MASK><NEW_LINE>msg = (org.apache.thrift.TApplicationException) e;<NEW_LINE>} else {<NEW_LINE>_LOGGER.error("Exception inside handler", e);<NEW_LINE>msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION;<NEW_LINE>msg = new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage());<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>fcall.sendResponse(fb, msg, msgType, seqid);<NEW_LINE>} catch (java.lang.Exception ex) {<NEW_LINE>_LOGGER.error("Exception writing to internal frame buffer", ex);<NEW_LINE>fb.close();<NEW_LINE>}<NEW_LINE>}
|
.thrift.protocol.TMessageType.EXCEPTION;
|
1,056,115
|
private void writeWrappedOptions(boolean includeDefaultBindings, Element root) {<NEW_LINE>for (String optionName : valueMap.keySet()) {<NEW_LINE>Option option = valueMap.get(optionName);<NEW_LINE>if (includeDefaultBindings || !option.isDefault()) {<NEW_LINE>Object value = option.getCurrentValue();<NEW_LINE>if (isSupportedBySaveState(value)) {<NEW_LINE>// handled above<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>WrappedOption wrappedOption = wrapOption(option);<NEW_LINE>if (wrappedOption == null) {<NEW_LINE>// cannot write an option without a value to determine its type<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>SaveState ss = new SaveState(WRAPPED_OPTION_NAME);<NEW_LINE>Element elem = null;<NEW_LINE>if (value == null) {<NEW_LINE>// Handle the null case ourselves, not using the wrapped option (and when<NEW_LINE>// reading from xml) so the logic does not need to be in each wrapped option<NEW_LINE>elem = ss.saveToXml();<NEW_LINE>elem.addContent(new Element(CLEARED_VALUE_ELEMENT_NAME));<NEW_LINE>} else {<NEW_LINE>wrappedOption.writeState(ss);<NEW_LINE>elem = ss.saveToXml();<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>elem.setAttribute(CLASS_ATTRIBUTE, wrappedOption.getClass().getName());<NEW_LINE>root.addContent(elem);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
|
elem.setAttribute(NAME_ATTRIBUTE, optionName);
|
436,239
|
public Builder mergeFrom(io.kubernetes.client.proto.V1.ResourceQuotaList other) {<NEW_LINE>if (other == io.kubernetes.client.proto.V1.ResourceQuotaList.getDefaultInstance())<NEW_LINE>return this;<NEW_LINE>if (other.hasMetadata()) {<NEW_LINE>mergeMetadata(other.getMetadata());<NEW_LINE>}<NEW_LINE>if (itemsBuilder_ == null) {<NEW_LINE>if (!other.items_.isEmpty()) {<NEW_LINE>if (items_.isEmpty()) {<NEW_LINE>items_ = other.items_;<NEW_LINE>bitField0_ = (bitField0_ & ~0x00000002);<NEW_LINE>} else {<NEW_LINE>ensureItemsIsMutable();<NEW_LINE>items_.addAll(other.items_);<NEW_LINE>}<NEW_LINE>onChanged();<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>if (!other.items_.isEmpty()) {<NEW_LINE>if (itemsBuilder_.isEmpty()) {<NEW_LINE>itemsBuilder_.dispose();<NEW_LINE>itemsBuilder_ = null;<NEW_LINE>items_ = other.items_;<NEW_LINE>bitField0_ = (bitField0_ & ~0x00000002);<NEW_LINE>itemsBuilder_ = com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? getItemsFieldBuilder() : null;<NEW_LINE>} else {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>this.mergeUnknownFields(other.unknownFields);<NEW_LINE>onChanged();<NEW_LINE>return this;<NEW_LINE>}
|
itemsBuilder_.addAllMessages(other.items_);
|
800,085
|
// private Ehcache cache = ApplicationCache.instance().getCache(File.class);<NEW_LINE>ActionResult<Wo> execute(EffectivePerson effectivePerson, String flag, String applicationFlag) throws Exception {<NEW_LINE>try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) {<NEW_LINE>ActionResult<Wo> result = new ActionResult<>();<NEW_LINE>Wo wo = null;<NEW_LINE>CacheCategory cacheCategory = new CacheCategory(File.class);<NEW_LINE>CacheKey cacheKey = new CacheKey(this.getClass(), flag, applicationFlag);<NEW_LINE>Optional<?> optional = CacheManager.get(cacheCategory, cacheKey);<NEW_LINE>if (optional.isPresent()) {<NEW_LINE>wo = (Wo) optional.get();<NEW_LINE>} else {<NEW_LINE>Business business = new Business(emc);<NEW_LINE>Application application = business.application().pick(applicationFlag);<NEW_LINE>if (null == application) {<NEW_LINE>throw new ExceptionEntityNotExist(applicationFlag, Application.class);<NEW_LINE>}<NEW_LINE>String id = this.get(business, application, flag);<NEW_LINE>if (StringUtils.isEmpty(id)) {<NEW_LINE>throw new ExceptionEntityNotExist(flag, File.class);<NEW_LINE>}<NEW_LINE>File file = business.<MASK><NEW_LINE>byte[] bs = new byte[] {};<NEW_LINE>if (StringUtils.isNotEmpty(file.getData())) {<NEW_LINE>bs = Base64.decodeBase64(file.getData());<NEW_LINE>}<NEW_LINE>wo = new Wo(bs, this.contentType(true, file.getFileName()), this.contentDisposition(true, file.getFileName()));<NEW_LINE>CacheManager.put(cacheCategory, cacheKey, wo);<NEW_LINE>}<NEW_LINE>result.setData(wo);<NEW_LINE>return result;<NEW_LINE>}<NEW_LINE>}
|
file().pick(id);
|
744,544
|
public void marshall(JobTemplate jobTemplate, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (jobTemplate == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(jobTemplate.getAccelerationSettings(), ACCELERATIONSETTINGS_BINDING);<NEW_LINE>protocolMarshaller.marshall(jobTemplate.getArn(), ARN_BINDING);<NEW_LINE>protocolMarshaller.marshall(jobTemplate.getCategory(), CATEGORY_BINDING);<NEW_LINE>protocolMarshaller.marshall(jobTemplate.getCreatedAt(), CREATEDAT_BINDING);<NEW_LINE>protocolMarshaller.marshall(jobTemplate.getDescription(), DESCRIPTION_BINDING);<NEW_LINE>protocolMarshaller.marshall(jobTemplate.getHopDestinations(), HOPDESTINATIONS_BINDING);<NEW_LINE>protocolMarshaller.marshall(jobTemplate.getLastUpdated(), LASTUPDATED_BINDING);<NEW_LINE>protocolMarshaller.marshall(jobTemplate.getName(), NAME_BINDING);<NEW_LINE>protocolMarshaller.marshall(<MASK><NEW_LINE>protocolMarshaller.marshall(jobTemplate.getQueue(), QUEUE_BINDING);<NEW_LINE>protocolMarshaller.marshall(jobTemplate.getSettings(), SETTINGS_BINDING);<NEW_LINE>protocolMarshaller.marshall(jobTemplate.getStatusUpdateInterval(), STATUSUPDATEINTERVAL_BINDING);<NEW_LINE>protocolMarshaller.marshall(jobTemplate.getType(), TYPE_BINDING);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>}
|
jobTemplate.getPriority(), PRIORITY_BINDING);
|
1,828,796
|
private List<Frame> splitMessageToFrames(Message msg) {<NEW_LINE>byte code = getCode(msg.getCommand());<NEW_LINE>List<Frame> ret = new ArrayList<>();<NEW_LINE>byte[] bytes = msg.getEncoded();<NEW_LINE>int curPos = 0;<NEW_LINE>while (curPos < bytes.length) {<NEW_LINE>int newPos = min(curPos + maxFramePayloadSize, bytes.length);<NEW_LINE>byte[] frameBytes = curPos == 0 && newPos == bytes.length ? bytes : Arrays.<MASK><NEW_LINE>ret.add(new Frame(code, frameBytes));<NEW_LINE>curPos = newPos;<NEW_LINE>}<NEW_LINE>if (ret.size() > 1) {<NEW_LINE>// frame has been split<NEW_LINE>int contextId = contextIdCounter.getAndIncrement();<NEW_LINE>ret.get(0).totalFrameSize = bytes.length;<NEW_LINE>loggerWire.debug("Message (size " + bytes.length + ") split to " + ret.size() + " frames. Context-id: " + contextId);<NEW_LINE>for (Frame frame : ret) {<NEW_LINE>frame.contextId = contextId;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return ret;<NEW_LINE>}
|
copyOfRange(bytes, curPos, newPos);
|
537,078
|
/*<NEW_LINE>* (non-Javadoc)<NEW_LINE>* @see android.app.Service#onStartCommand(android.content.Intent, int, int)<NEW_LINE>*/<NEW_LINE>public int onStartCommand(Intent intent, int flags, int startId) {<NEW_LINE>// Overridden method called when the service is started. Data<NEW_LINE>// associated with the transfer is stored in the intent.<NEW_LINE>// Extract the transfer data from the Intent<NEW_LINE>Bundle transferData = intent.getExtras();<NEW_LINE>// Transfer attributes<NEW_LINE>Boolean <MASK><NEW_LINE>int port = transferData.getInt(Port);<NEW_LINE>Boolean bCreateFolders = transferData.getBoolean(CreateFolders);<NEW_LINE>String source = transferData.getString(Source);<NEW_LINE>String destination = transferData.getString(Destination);<NEW_LINE>Boolean bOverwrite = transferData.getBoolean(Overwrite);<NEW_LINE>String username = transferData.getString(Username);<NEW_LINE>String password = transferData.getString(Password);<NEW_LINE>String transferEvent = transferData.getString(TransferEvent);<NEW_LINE>// Class to receive the broadcast intent when the transfer is finished<NEW_LINE>String intentFilter = transferData.getString("IntentFilter");<NEW_LINE>// ID caller has associated with the return<NEW_LINE>String returnID = transferData.getString(ReturnID);<NEW_LINE>Boolean bCopy = transferData.getBoolean(Copy);<NEW_LINE>Logger.I(TAG, "Starting FileTransfer >> source: " + source + ", destination: " + destination);<NEW_LINE>// Start a thread to handle the transfer<NEW_LINE>Thread transferThread;<NEW_LINE>try {<NEW_LINE>transferThread = new Thread(new TransferThread(fileDestination, port, bCreateFolders, source, destination, bOverwrite, bCopy, username, password, transferEvent, startId, intentFilter, returnID));<NEW_LINE>// Maintain the list of running threads in case we are stopped mid transfer<NEW_LINE>transferThread.start();<NEW_LINE>} catch (Exception e) {<NEW_LINE>// An error has occured configuring the File Transfer service<NEW_LINE>Logger.W(TAG, "File Transfer Failed, either source or destination were not specified correctly.");<NEW_LINE>}<NEW_LINE>// Want this service to remain alive until the transfer is complete therefore<NEW_LINE>// start sticky.<NEW_LINE>return START_NOT_STICKY;<NEW_LINE>}
|
fileDestination = transferData.getBoolean(FileDestination);
|
1,742,512
|
public void onCreate(Bundle savedInstanceState) {<NEW_LINE>super.onCreate(savedInstanceState);<NEW_LINE>((WordPress) getApplication()).component().inject(this);<NEW_LINE>AppLog.i(AppLog.T.NOTIFS, "Creating NotificationsDetailActivity");<NEW_LINE>setContentView(R.layout.notifications_detail_activity);<NEW_LINE>mToolbar = findViewById(R.id.toolbar_main);<NEW_LINE>setSupportActionBar(mToolbar);<NEW_LINE>mAppBarLayout = findViewById(R.id.appbar_main);<NEW_LINE>ActionBar actionBar = getSupportActionBar();<NEW_LINE>if (actionBar != null) {<NEW_LINE>actionBar.setDisplayHomeAsUpEnabled(true);<NEW_LINE>}<NEW_LINE>if (savedInstanceState == null) {<NEW_LINE>mNoteId = getIntent().getStringExtra(NotificationsListFragment.NOTE_ID_EXTRA);<NEW_LINE>mIsTappedOnNotification = getIntent().getBooleanExtra(IS_TAPPED_ON_NOTIFICATION, false);<NEW_LINE>} else {<NEW_LINE>if (savedInstanceState.containsKey(ARG_TITLE) && getSupportActionBar() != null) {<NEW_LINE>getSupportActionBar().setTitle(StringUtils.notNullStr(savedInstanceState.getString(ARG_TITLE)));<NEW_LINE>}<NEW_LINE>mNoteId = savedInstanceState.getString(NotificationsListFragment.NOTE_ID_EXTRA);<NEW_LINE>mIsTappedOnNotification = savedInstanceState.getBoolean(IS_TAPPED_ON_NOTIFICATION);<NEW_LINE>}<NEW_LINE>// set up the viewpager and adapter for lateral navigation<NEW_LINE>mViewPager = findViewById(R.id.viewpager);<NEW_LINE>mViewPager.setPageTransformer(false, new WPViewPagerTransformer(WPViewPagerTransformer.TransformType.SLIDE_OVER));<NEW_LINE>Note note = NotificationsTable.getNoteById(mNoteId);<NEW_LINE>// if this is coming from a tapped push notification, let's try refreshing it as its contents may have been<NEW_LINE>// updated since the notification was first received and created on the system's dashboard<NEW_LINE>updateUIAndNote((note == null) || mIsTappedOnNotification);<NEW_LINE>// Hide the keyboard, unless we arrived here from the 'Reply' action in a push notification<NEW_LINE>if (!getIntent().getBooleanExtra(NotificationsListFragment.NOTE_INSTANT_REPLY_EXTRA, false)) {<NEW_LINE>getWindow().<MASK><NEW_LINE>}<NEW_LINE>// track initial comment note view<NEW_LINE>if (savedInstanceState == null && note != null) {<NEW_LINE>trackCommentNote(note);<NEW_LINE>}<NEW_LINE>}
|
setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_HIDDEN);
|
1,171,159
|
// personalizePageContainers<NEW_LINE>@DELETE<NEW_LINE>@Path("/pagepersonas/page/{pageId}/personalization/{personalization}")<NEW_LINE>@JSONP<NEW_LINE>@NoCache<NEW_LINE>@Produces({ MediaType.APPLICATION_JSON, "application/javascript" })<NEW_LINE>public Response personalizePageContainers(@Context final HttpServletRequest request, @Context final HttpServletResponse response, @PathParam("pageId") final String pageId, @PathParam("personalization") final String personalization) throws DotDataException, DotSecurityException {<NEW_LINE>final User user = this.webResource.init(true, request, true).getUser();<NEW_LINE>final boolean respectFrontEndRoles = PageMode.get(request).respectAnonPerms;<NEW_LINE>Logger.debug(this, () -> "Deleting all Personalizing:" + personalization + ", on all containers on the page personas per page: " + pageId);<NEW_LINE>if (!UtilMethods.isSet(pageId) || !UtilMethods.isSet(personalization)) {<NEW_LINE>throw new BadRequestException("Page or Personalization parameter are missing, should use: /pagepersonas/page/{pageId}/personalization/{personalization}");<NEW_LINE>}<NEW_LINE>if (MultiTree.DOT_PERSONALIZATION_DEFAULT.equalsIgnoreCase(personalization) || !this.personaAPI.findPersonaByTag(personalization, user, true).isPresent()) {<NEW_LINE>throw new BadRequestException("Persona tag: " + personalization + " does not exist or the user does not have permissions to it");<NEW_LINE>}<NEW_LINE>final Contentlet <MASK><NEW_LINE>if (!permissionAPI.doesUserHavePermission(pageContentlet, PermissionAPI.PERMISSION_EDIT, user, respectFrontEndRoles)) {<NEW_LINE>Logger.warn(PersonalizationResource.class, String.format("User `%s` does not have edit permission over page `%s` therefore personalization isn't allowed. ", user.getUserId(), pageId));<NEW_LINE>return Response.status(Status.FORBIDDEN).build();<NEW_LINE>}<NEW_LINE>this.multiTreeAPI.deletePersonalizationForPage(pageId, Persona.DOT_PERSONA_PREFIX_SCHEME + StringPool.COLON + personalization);<NEW_LINE>return Response.ok(new ResponseEntityView("OK")).build();<NEW_LINE>}
|
pageContentlet = contentletAPI.findContentletByIdentifierAnyLanguage(pageId);
|
509,549
|
public void saveParam(ConnectionParam options) {<NEW_LINE>options.setUseSocksProxy(useSocksCheckBox.isSelected());<NEW_LINE>SocksProxy oldSocksProxy = options.getSocksProxy();<NEW_LINE>if (!oldSocksProxy.getHost().equals(hostTextField.getText()) || oldSocksProxy.getPort() != portNumberSpinner.getValue() || oldSocksProxy.getVersion() != getSelectedVersion() || oldSocksProxy.isUseDns() != useSocksDnsCheckBox.isSelected()) {<NEW_LINE>options.setSocksProxy(new SocksProxy(hostTextField.getText(), portNumberSpinner.getValue(), getSelectedVersion(), useSocksDnsCheckBox.isSelected()));<NEW_LINE>}<NEW_LINE>PasswordAuthentication passwordAuthentication = options.getSocksProxyPasswordAuth();<NEW_LINE>char[<MASK><NEW_LINE>if (!passwordAuthentication.getUserName().equals(usernameTextField.getText()) || !Arrays.equals(passwordAuthentication.getPassword(), password)) {<NEW_LINE>options.setSocksProxyPasswordAuth(new PasswordAuthentication(usernameTextField.getText(), password));<NEW_LINE>}<NEW_LINE>}
|
] password = passwordField.getPassword();
|
1,070,341
|
private // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents<NEW_LINE>void initComponents() {<NEW_LINE>java.awt.GridBagConstraints gridBagConstraints;<NEW_LINE>jLabelDesc = new javax.swing.JLabel();<NEW_LINE>jPanelBeanTree = new javax.swing.JPanel();<NEW_LINE>jLabelError = new javax.swing.JLabel();<NEW_LINE>setLayout(new java.awt.GridBagLayout());<NEW_LINE>// NOI18N<NEW_LINE>org.openide.awt.Mnemonics.setLocalizedText(jLabelDesc, org.openide.util.NbBundle.getMessage(PortChooser.class, "LBL_SelectPort"));<NEW_LINE>gridBagConstraints = new java.awt.GridBagConstraints();<NEW_LINE>gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;<NEW_LINE>gridBagConstraints.insets = new java.awt.Insets(11, 11, 0, 11);<NEW_LINE>add(jLabelDesc, gridBagConstraints);<NEW_LINE>jPanelBeanTree.setLayout(new java.awt.BorderLayout());<NEW_LINE>gridBagConstraints = new java.awt.GridBagConstraints();<NEW_LINE>gridBagConstraints.gridx = 0;<NEW_LINE>gridBagConstraints.gridy = 1;<NEW_LINE>gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;<NEW_LINE>gridBagConstraints.weightx = 1.0;<NEW_LINE>gridBagConstraints.weighty = 1.0;<NEW_LINE>gridBagConstraints.insets = new java.awt.Insets(11, 11, 11, 11);<NEW_LINE>add(jPanelBeanTree, gridBagConstraints);<NEW_LINE>jLabelError.setForeground(new java.awt.Color<MASK><NEW_LINE>jLabelError.setLabelFor(jPanelBeanTree);<NEW_LINE>jLabelError.setText(" ");<NEW_LINE>gridBagConstraints = new java.awt.GridBagConstraints();<NEW_LINE>gridBagConstraints.gridx = 0;<NEW_LINE>gridBagConstraints.gridy = 2;<NEW_LINE>gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;<NEW_LINE>gridBagConstraints.insets = new java.awt.Insets(0, 11, 0, 11);<NEW_LINE>add(jLabelError, gridBagConstraints);<NEW_LINE>// NOI18N<NEW_LINE>getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(PortChooser.class, "TTL_SelectPort"));<NEW_LINE>}
|
(255, 0, 0));
|
810,529
|
public ValueRange range(TemporalField field) {<NEW_LINE>if (field instanceof ChronoField) {<NEW_LINE>if (isSupported(field)) {<NEW_LINE>ChronoField f = (ChronoField) field;<NEW_LINE>switch(f) {<NEW_LINE>case DAY_OF_MONTH:<NEW_LINE>case DAY_OF_YEAR:<NEW_LINE>case ALIGNED_WEEK_OF_MONTH:<NEW_LINE>return isoDate.range(field);<NEW_LINE>case YEAR_OF_ERA:<NEW_LINE>{<NEW_LINE>ValueRange range = YEAR.range();<NEW_LINE>long max = getProlepticYear() <= 0 ? -range.getMinimum() + 1 + YEARS_DIFFERENCE : range.getMaximum() - YEARS_DIFFERENCE;<NEW_LINE>return <MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>return getChronology().range(f);<NEW_LINE>}<NEW_LINE>throw new UnsupportedTemporalTypeException("Unsupported field: " + field);<NEW_LINE>}<NEW_LINE>return field.rangeRefinedBy(this);<NEW_LINE>}
|
ValueRange.of(1, max);
|
1,084,366
|
private Collection<InetSocketAddress> buildWhiteListCollection(String whiteList) {<NEW_LINE>String[] list = whiteList.split(Constants.COMMA);<NEW_LINE>Collection<InetSocketAddress> whiteListCollection = new ArrayList<InetSocketAddress>();<NEW_LINE>PersistenceUnitMetadata persistenceUnitMetadata = kunderaMetadata.getApplicationMetadata().getPersistenceUnitMetadata(getPersistenceUnit());<NEW_LINE>Properties props = persistenceUnitMetadata.getProperties();<NEW_LINE>int defaultPort = 9042;<NEW_LINE>if (externalProperties != null && externalProperties.get(PersistenceProperties.KUNDERA_PORT) != null) {<NEW_LINE>try {<NEW_LINE>defaultPort = Integer.parseInt((String) externalProperties.get(PersistenceProperties.KUNDERA_PORT));<NEW_LINE>} catch (NumberFormatException e) {<NEW_LINE>logger.error("Port in persistence.xml should be integer");<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>try {<NEW_LINE>defaultPort = Integer.parseInt((String) props<MASK><NEW_LINE>} catch (NumberFormatException e) {<NEW_LINE>logger.error("Port in persistence.xml should be integer");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>for (String node : list) {<NEW_LINE>if (node.indexOf(Constants.COLON) > 0) {<NEW_LINE>String[] parts = node.split(Constants.COLON);<NEW_LINE>whiteListCollection.add(new InetSocketAddress(parts[0], Integer.parseInt(parts[1])));<NEW_LINE>} else {<NEW_LINE>whiteListCollection.add(new InetSocketAddress(node, defaultPort));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return whiteListCollection;<NEW_LINE>}
|
.get(PersistenceProperties.KUNDERA_PORT));
|
1,738,390
|
public void validateCertificateChain(List<X509Certificate> certificateChain) throws UaException {<NEW_LINE>PKIXCertPathBuilderResult certPathResult;<NEW_LINE>try {<NEW_LINE>certPathResult = buildTrustedCertPath(certificateChain, trustListManager.getTrustedCertificates(), trustListManager.getIssuerCertificates());<NEW_LINE>} catch (UaException e) {<NEW_LINE>certificateChain.forEach(trustListManager::addRejectedCertificate);<NEW_LINE>long statusCode = e.getStatusCode().getValue();<NEW_LINE>if (statusCode == StatusCodes.Bad_CertificateUntrusted) {<NEW_LINE>// servers need to report a less informative StatusCode if the<NEW_LINE>// certificate was not trusted, either explicitly or because it<NEW_LINE>// or one if its issuers was revoked.<NEW_LINE>throw new UaException(StatusCodes.Bad_SecurityChecksFailed, e.getMessage(), e);<NEW_LINE>} else {<NEW_LINE>throw e;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>List<X509CRL> crls = new ArrayList<>();<NEW_LINE>crls.<MASK><NEW_LINE>crls.addAll(trustListManager.getIssuerCrls());<NEW_LINE>validateTrustedCertPath(certPathResult.getCertPath(), certPathResult.getTrustAnchor(), crls, validationChecks, true);<NEW_LINE>} catch (UaException e) {<NEW_LINE>long statusCode = e.getStatusCode().getValue();<NEW_LINE>if (statusCode == StatusCodes.Bad_CertificateRevoked || statusCode == StatusCodes.Bad_CertificateIssuerRevoked) {<NEW_LINE>// servers need to report a less informative StatusCode if the<NEW_LINE>// certificate was not trusted, either explicitly or because it<NEW_LINE>// or one if its issuers was revoked.<NEW_LINE>throw new UaException(StatusCodes.Bad_SecurityChecksFailed, e.getMessage(), e);<NEW_LINE>} else {<NEW_LINE>throw e;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
|
addAll(trustListManager.getTrustedCrls());
|
620,376
|
public void startUp(FloodlightModuleContext context) {<NEW_LINE>// paag: register the IControllerCompletionListener<NEW_LINE>floodlightProviderService.addCompletionListener(this);<NEW_LINE>floodlightProviderService.addOFMessageListener(OFType.PACKET_IN, this);<NEW_LINE>floodlightProviderService.addOFMessageListener(OFType.FLOW_REMOVED, this);<NEW_LINE>floodlightProviderService.addOFMessageListener(OFType.ERROR, this);<NEW_LINE>restApiService.addRestletRoutable(new LearningSwitchWebRoutable());<NEW_LINE>// read our config options<NEW_LINE>Map<String, String> configOptions = context.getConfigParams(this);<NEW_LINE>try {<NEW_LINE>String idleTimeout = configOptions.get("idletimeout");<NEW_LINE>if (idleTimeout != null) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>} catch (NumberFormatException e) {<NEW_LINE>log.warn("Error parsing flow idle timeout, " + "using default of {} seconds", FLOWMOD_DEFAULT_IDLE_TIMEOUT);<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>String hardTimeout = configOptions.get("hardtimeout");<NEW_LINE>if (hardTimeout != null) {<NEW_LINE>FLOWMOD_DEFAULT_HARD_TIMEOUT = Short.parseShort(hardTimeout);<NEW_LINE>}<NEW_LINE>} catch (NumberFormatException e) {<NEW_LINE>log.warn("Error parsing flow hard timeout, " + "using default of {} seconds", FLOWMOD_DEFAULT_HARD_TIMEOUT);<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>String priority = configOptions.get("priority");<NEW_LINE>if (priority != null) {<NEW_LINE>FLOWMOD_PRIORITY = Short.parseShort(priority);<NEW_LINE>}<NEW_LINE>} catch (NumberFormatException e) {<NEW_LINE>log.warn("Error parsing flow priority, " + "using default of {}", FLOWMOD_PRIORITY);<NEW_LINE>}<NEW_LINE>log.debug("FlowMod idle timeout set to {} seconds", FLOWMOD_DEFAULT_IDLE_TIMEOUT);<NEW_LINE>log.debug("FlowMod hard timeout set to {} seconds", FLOWMOD_DEFAULT_HARD_TIMEOUT);<NEW_LINE>log.debug("FlowMod priority set to {}", FLOWMOD_PRIORITY);<NEW_LINE>debugCounterService.registerModule(this.getName());<NEW_LINE>counterFlowMod = debugCounterService.registerCounter(this.getName(), "flow-mods-written", "Flow mods written to switches by LearningSwitch", MetaData.WARN);<NEW_LINE>counterPacketOut = debugCounterService.registerCounter(this.getName(), "packet-outs-written", "Packet outs written to switches by LearningSwitch", MetaData.WARN);<NEW_LINE>}
|
FLOWMOD_DEFAULT_IDLE_TIMEOUT = Short.parseShort(idleTimeout);
|
316,807
|
protected List<IFacet<I_C_Invoice_Candidate>> collectFacets(final IQueryBuilder<I_C_Invoice_Candidate> queryBuilder) {<NEW_LINE>// FRESH-560: Add default filter<NEW_LINE>final IQueryBuilder<I_C_Invoice_Candidate> queryBuilderWithDefaultFilters = Services.get(IInvoiceCandDAO.class).applyDefaultFilter(queryBuilder);<NEW_LINE>final List<Map<String, Object>> bpartners = queryBuilderWithDefaultFilters.andCollect(I_C_Invoice_Candidate.COLUMNNAME_Bill_BPartner_ID, I_C_BPartner.class).create().listDistinct(I_C_BPartner.COLUMNNAME_C_BPartner_ID, <MASK><NEW_LINE>final List<IFacet<I_C_Invoice_Candidate>> facets = new ArrayList<>(bpartners.size());<NEW_LINE>for (final Map<String, Object> row : bpartners) {<NEW_LINE>final IFacet<I_C_Invoice_Candidate> facet = createFacet(row);<NEW_LINE>facets.add(facet);<NEW_LINE>}<NEW_LINE>return facets;<NEW_LINE>}
|
I_C_BPartner.COLUMNNAME_Name, I_C_BPartner.COLUMNNAME_Value);
|
1,529,794
|
final CreateConnectPeerResult executeCreateConnectPeer(CreateConnectPeerRequest createConnectPeerRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(createConnectPeerRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<CreateConnectPeerRequest> request = null;<NEW_LINE>Response<CreateConnectPeerResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new CreateConnectPeerRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(createConnectPeerRequest));<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, "NetworkManager");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "CreateConnectPeer");<NEW_LINE>request.<MASK><NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<CreateConnectPeerResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new CreateConnectPeerResultJsonUnmarshaller());<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);
|
1,657,306
|
public static void exportDiagramError(OutputStream os, Throwable exception, FileFormatOption fileFormat, long seed, String metadata, String flash, List<String> strings) throws IOException {<NEW_LINE>if (fileFormat.getFileFormat() == FileFormat.ATXT || fileFormat.getFileFormat() == FileFormat.UTXT) {<NEW_LINE>exportDiagramErrorText(os, exception, strings);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>strings.addAll(CommandExecutionResult.getStackTrace(exception));<NEW_LINE>BufferedImage im2 = null;<NEW_LINE>if (flash != null) {<NEW_LINE>final FlashCodeUtils utils = FlashCodeFactory.getFlashCodeUtils();<NEW_LINE>try {<NEW_LINE>im2 = utils.exportFlashcode(flash, Color.BLACK, Color.WHITE);<NEW_LINE>} catch (Throwable e) {<NEW_LINE>Log.error("Issue in flashcode generation " + e);<NEW_LINE>// e.printStackTrace();<NEW_LINE>}<NEW_LINE>if (im2 != null)<NEW_LINE>GraphvizCrash.addDecodeHint(strings);<NEW_LINE>}<NEW_LINE>final BufferedImage im = im2;<NEW_LINE>final TextBlockBackcolored graphicStrings = GraphicStrings.createBlackOnWhite(strings, IconLoader.getRandom(), GraphicPosition.BACKGROUND_CORNER_TOP_RIGHT);<NEW_LINE>final UDrawable drawable = (im == null) ? graphicStrings : new UDrawable() {<NEW_LINE><NEW_LINE>public void drawU(UGraphic ug) {<NEW_LINE>graphicStrings.drawU(ug);<NEW_LINE>final double height = graphicStrings.calculateDimension(ug.getStringBounder()).getHeight();<NEW_LINE>ug = ug.apply<MASK><NEW_LINE>ug.draw(new UImage(new PixelImage(im, AffineTransformType.TYPE_NEAREST_NEIGHBOR)).scale(3));<NEW_LINE>}<NEW_LINE>};<NEW_LINE>plainImageBuilder(drawable, fileFormat).metadata(metadata).seed(seed).write(os);<NEW_LINE>}
|
(UTranslate.dy(height));
|
530,264
|
private void handleSignInResponse(int resultCode, @Nullable IdpResponse response) {<NEW_LINE>// Successfully signed in<NEW_LINE>if (resultCode == RESULT_OK) {<NEW_LINE>startSignedInActivity(response);<NEW_LINE>finish();<NEW_LINE>} else {<NEW_LINE>// Sign in failed<NEW_LINE>if (response == null) {<NEW_LINE>// User pressed back button<NEW_LINE>showSnackbar(R.string.sign_in_cancelled);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (response.getError().getErrorCode() == ErrorCodes.NO_NETWORK) {<NEW_LINE>showSnackbar(R.string.no_internet_connection);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (response.getError().getErrorCode() == ErrorCodes.ANONYMOUS_UPGRADE_MERGE_CONFLICT) {<NEW_LINE>Intent intent = new Intent(this, AnonymousUpgradeActivity.class).putExtra(ExtraConstants.IDP_RESPONSE, response);<NEW_LINE>startActivity(intent);<NEW_LINE>}<NEW_LINE>if (response.getError().getErrorCode() == ErrorCodes.ERROR_USER_DISABLED) {<NEW_LINE><MASK><NEW_LINE>return;<NEW_LINE>}<NEW_LINE>showSnackbar(R.string.unknown_error);<NEW_LINE>Log.e(TAG, "Sign-in error: ", response.getError());<NEW_LINE>}<NEW_LINE>}
|
showSnackbar(R.string.account_disabled);
|
551,156
|
public CreateEmailIdentityResult unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>CreateEmailIdentityResult createEmailIdentityResult = new CreateEmailIdentityResult();<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 createEmailIdentityResult;<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("IdentityType", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>createEmailIdentityResult.setIdentityType(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("VerifiedForSendingStatus", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>createEmailIdentityResult.setVerifiedForSendingStatus(context.getUnmarshaller(Boolean.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("DkimAttributes", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>createEmailIdentityResult.setDkimAttributes(DkimAttributesJsonUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>}<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return createEmailIdentityResult;<NEW_LINE>}
|
String currentParentElement = context.getCurrentParentElement();
|
172,040
|
public void marshall(ConnectorDetail connectorDetail, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (connectorDetail == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(connectorDetail.getConnectorDescription(), CONNECTORDESCRIPTION_BINDING);<NEW_LINE>protocolMarshaller.marshall(connectorDetail.getConnectorName(), CONNECTORNAME_BINDING);<NEW_LINE>protocolMarshaller.marshall(connectorDetail.getConnectorOwner(), CONNECTOROWNER_BINDING);<NEW_LINE>protocolMarshaller.marshall(connectorDetail.getConnectorVersion(), CONNECTORVERSION_BINDING);<NEW_LINE>protocolMarshaller.marshall(connectorDetail.getApplicationType(), APPLICATIONTYPE_BINDING);<NEW_LINE>protocolMarshaller.marshall(connectorDetail.getConnectorType(), CONNECTORTYPE_BINDING);<NEW_LINE>protocolMarshaller.marshall(<MASK><NEW_LINE>protocolMarshaller.marshall(connectorDetail.getRegisteredAt(), REGISTEREDAT_BINDING);<NEW_LINE>protocolMarshaller.marshall(connectorDetail.getRegisteredBy(), REGISTEREDBY_BINDING);<NEW_LINE>protocolMarshaller.marshall(connectorDetail.getConnectorProvisioningType(), CONNECTORPROVISIONINGTYPE_BINDING);<NEW_LINE>protocolMarshaller.marshall(connectorDetail.getConnectorModes(), CONNECTORMODES_BINDING);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>}
|
connectorDetail.getConnectorLabel(), CONNECTORLABEL_BINDING);
|
1,489,898
|
protected <T extends Ruleset> T mapResultTuple(Class<T> rulesetType, RulesetQuery query, ResultSet rs) throws SQLException {<NEW_LINE>T ruleset;<NEW_LINE>if (rulesetType == GlobalRuleset.class) {<NEW_LINE>ruleset = (T) new GlobalRuleset();<NEW_LINE>} else if (rulesetType == TenantRuleset.class) {<NEW_LINE>TenantRuleset tenantRuleset = new TenantRuleset();<NEW_LINE>tenantRuleset.setRealm(rs.getString("REALM"));<NEW_LINE>tenantRuleset.setAccessPublicRead(rs.getBoolean("ACCESS_PUBLIC_READ"));<NEW_LINE>ruleset = (T) tenantRuleset;<NEW_LINE>} else if (rulesetType == AssetRuleset.class) {<NEW_LINE>AssetRuleset assetRuleset = new AssetRuleset();<NEW_LINE>assetRuleset.setAssetId(rs.getString("ASSET_ID"));<NEW_LINE>assetRuleset.setRealm(rs.getString("REALM"));<NEW_LINE>assetRuleset.setAccessPublicRead(rs.getBoolean("ACCESS_PUBLIC_READ"));<NEW_LINE>ruleset = (T) assetRuleset;<NEW_LINE>} else {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>ruleset.setName(rs.getString("NAME"));<NEW_LINE>ruleset.setId(rs.getLong("ID"));<NEW_LINE>ruleset.setVersion(rs.getLong("VERSION"));<NEW_LINE>ruleset.setLang(Ruleset.Lang.valueOf(rs.getString("RULES_LANG")));<NEW_LINE>ruleset.setEnabled(rs.getBoolean("ENABLED"));<NEW_LINE>ruleset.setLastModified(rs.getTimestamp("LAST_MODIFIED"));<NEW_LINE>ruleset.setCreatedOn(rs.getTimestamp("CREATED_ON"));<NEW_LINE>if (rs.getString("META") != null) {<NEW_LINE>ruleset.setMeta(ValueUtil.parse(rs.getString("META"), MetaMap.class).orElse(null));<NEW_LINE>}<NEW_LINE>if (query.fullyPopulate) {<NEW_LINE>ruleset.setRules(rs.getString("RULES"));<NEW_LINE>}<NEW_LINE>return ruleset;<NEW_LINE>}
|
throw new UnsupportedOperationException("Ruleset type not supported: " + rulesetType);
|
1,649,963
|
public ThingTypeMetadata unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>ThingTypeMetadata thingTypeMetadata = new ThingTypeMetadata();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return 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("deprecated", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>thingTypeMetadata.setDeprecated(context.getUnmarshaller(Boolean.<MASK><NEW_LINE>}<NEW_LINE>if (context.testExpression("deprecationDate", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>thingTypeMetadata.setDeprecationDate(DateJsonUnmarshallerFactory.getInstance("unixTimestamp").unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("creationDate", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>thingTypeMetadata.setCreationDate(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 thingTypeMetadata;<NEW_LINE>}
|
class).unmarshall(context));
|
166,955
|
public KeystoreWrapper build() throws EsHadoopSecurityException, IOException {<NEW_LINE>if (StringUtils.hasText(path)) {<NEW_LINE>try {<NEW_LINE>keystoreFile = IOUtils.open(path);<NEW_LINE>if (keystoreFile == null) {<NEW_LINE>throw new EsHadoopIllegalArgumentException(String<MASK><NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new EsHadoopIllegalArgumentException(String.format("Expected to find keystore file at [%s] but " + "was unable to. Make sure that it is available on the classpath, or if not, that you have " + "specified a valid file URI.", path));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (!StringUtils.hasText(type)) {<NEW_LINE>type = PKCS12;<NEW_LINE>}<NEW_LINE>if (!StringUtils.hasText(password)) {<NEW_LINE>password = DEFAULT_PASS;<NEW_LINE>}<NEW_LINE>return new KeystoreWrapper(keystoreFile, type, password);<NEW_LINE>}
|
.format("Could not locate [%s] on classpath", path));
|
931,082
|
public I_C_Order createDraft() {<NEW_LINE>if (costCollectorsToAggregate.isEmpty()) {<NEW_LINE>throw new AdempiereException("No cost collectors to aggregate");<NEW_LINE>}<NEW_LINE>//<NEW_LINE>// Make sure they are ordered by Task ID, so the quotation lines will be in same ordering as the repair tasks<NEW_LINE>costCollectorsToAggregate.sort(Comparator.comparing(ServiceRepairProjectCostCollector::getTaskId));<NEW_LINE>//<NEW_LINE>// Create lines groups<NEW_LINE>final LinkedHashMap<QuotationLinesGroupKey, QuotationLinesGroupAggregator> linesGroups = new LinkedHashMap<>();<NEW_LINE>for (final ServiceRepairProjectCostCollector costCollector : costCollectorsToAggregate) {<NEW_LINE>linesGroups.computeIfAbsent(QuotationLinesGroupAggregator.extractKey(costCollector), this::createGroupAggregator).add(costCollector);<NEW_LINE>}<NEW_LINE>//<NEW_LINE>// Create the quotation<NEW_LINE>final OrderFactory orderFactory = newOrderFactory();<NEW_LINE>for (final QuotationLinesGroupAggregator groupAggregator : linesGroups.values()) {<NEW_LINE>groupAggregator.createOrderLines(orderFactory);<NEW_LINE>}<NEW_LINE>final <MASK><NEW_LINE>//<NEW_LINE>// Group the order lines<NEW_LINE>linesGroups.values().forEach(this::groupOrderLinesIfNeeded);<NEW_LINE>orderGroupRepository.renumberOrderLinesForOrderId(OrderId.ofRepoId(quotation.getC_Order_ID()));<NEW_LINE>//<NEW_LINE>//<NEW_LINE>generatedQuotationLineIdsIndexedByCostCollectorId = QuotationLineIdsByCostCollectorIdIndex.of(linesGroups.values().stream().flatMap(QuotationLinesGroupAggregator::streamQuotationLineIdsIndexedByCostCollectorId).distinct().collect(GuavaCollectors.toImmutableListMultimap()));<NEW_LINE>//<NEW_LINE>return quotation;<NEW_LINE>}
|
I_C_Order quotation = orderFactory.createDraft();
|
775,098
|
public static Map<String, DcZkInfo> parseDcJsonAndPopulateDcInfo(String dcInfoJsonString) throws JSONException {<NEW_LINE>Map<String, DcZkInfo> dataCenterToZkAddress = new HashMap<>();<NEW_LINE>JSONObject root = new JSONObject(dcInfoJsonString);<NEW_LINE>JSONArray all = root.getJSONArray(ZKINFO_STR);<NEW_LINE>for (int i = 0; i < all.length(); i++) {<NEW_LINE>JSONObject entry = all.getJSONObject(i);<NEW_LINE>String name = entry.getString(DATACENTER_STR);<NEW_LINE>byte id = (byte) entry.getInt(DATACENTER_ID_STR);<NEW_LINE>ReplicaType replicaType = entry.optEnum(ReplicaType.<MASK><NEW_LINE>ArrayList<String> zkConnectStrs = (replicaType == ReplicaType.DISK_BACKED) ? Utils.splitString(entry.getString(ZKCONNECT_STR), ZKCONNECT_STR_DELIMITER) : Utils.splitString(entry.optString(ZKCONNECT_STR), ZKCONNECT_STR_DELIMITER);<NEW_LINE>DcZkInfo dcZkInfo = new DcZkInfo(name, id, zkConnectStrs, replicaType);<NEW_LINE>dataCenterToZkAddress.put(dcZkInfo.dcName, dcZkInfo);<NEW_LINE>}<NEW_LINE>return dataCenterToZkAddress;<NEW_LINE>}
|
class, REPLICA_TYPE_STR, ReplicaType.DISK_BACKED);
|
852,811
|
public boolean isDeleted(final OPhysicalPosition position) throws IOException {<NEW_LINE>atomicOperationsManager.acquireReadLock(this);<NEW_LINE>try {<NEW_LINE>acquireSharedLock();<NEW_LINE>try {<NEW_LINE>final OAtomicOperation atomicOperation = atomicOperationsManager.getCurrentOperation();<NEW_LINE>final long clusterPosition = position.clusterPosition;<NEW_LINE>final OClusterPositionMapBucket.PositionEntry positionEntry = clusterPositionMap.get(clusterPosition, 1, atomicOperation);<NEW_LINE>if (positionEntry == null) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>final long pageIndex = positionEntry.getPageIndex();<NEW_LINE>final int recordPosition = positionEntry.getRecordPosition();<NEW_LINE>final long pagesCount = getFilledUpTo(atomicOperation, fileId);<NEW_LINE>if (pageIndex >= pagesCount) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>final OCacheEntry cacheEntry = loadPageForRead(atomicOperation, fileId, pageIndex, false);<NEW_LINE>try {<NEW_LINE>final <MASK><NEW_LINE>return localPage.isDeleted(recordPosition);<NEW_LINE>} finally {<NEW_LINE>releasePageFromRead(atomicOperation, cacheEntry);<NEW_LINE>}<NEW_LINE>} finally {<NEW_LINE>releaseSharedLock();<NEW_LINE>}<NEW_LINE>} finally {<NEW_LINE>atomicOperationsManager.releaseReadLock(this);<NEW_LINE>}<NEW_LINE>}
|
OClusterPage localPage = new OClusterPage(cacheEntry);
|
1,647,222
|
public boolean canCreate(ODatabaseSession session, ORecord record) {<NEW_LINE>if (session.getUser() == null) {<NEW_LINE>// executeNoAuth<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>if (!session.getConfiguration().getValueAsBoolean(OGlobalConfiguration.SECURITY_ADVANCED_POLICY)) {<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>if (record instanceof OElement) {<NEW_LINE>String className;<NEW_LINE>if (record instanceof ODocument) {<NEW_LINE>className = ((ODocument) record).getClassName();<NEW_LINE>} else {<NEW_LINE>className = ((OElement) record).getSchemaType().map(x -> x.getName()).orElse(null);<NEW_LINE>}<NEW_LINE>if (roleHasPredicateSecurityForClass != null) {<NEW_LINE>for (OSecurityRole role : session.getUser().getRoles()) {<NEW_LINE>Map<String, Boolean> roleMap = roleHasPredicateSecurityForClass.get(role.getName());<NEW_LINE>if (roleMap == null) {<NEW_LINE>// TODO hierarchy...?<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>Boolean val = roleMap.get(className);<NEW_LINE>if (!(Boolean.TRUE.equals(val))) {<NEW_LINE>// TODO hierarchy...?<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>OBooleanExpression predicate;<NEW_LINE>if (className == null) {<NEW_LINE>predicate = null;<NEW_LINE>} else {<NEW_LINE>predicate = OSecurityEngine.getPredicateForSecurityResource(session, this, "database.class.`" + className + <MASK><NEW_LINE>}<NEW_LINE>return OSecurityEngine.evaluateSecuirtyPolicyPredicate(session, predicate, record);<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>}
|
"`", OSecurityPolicy.Scope.CREATE);
|
246,557
|
public BuiltInScalarFunctionImplementation specialize(BoundVariables boundVariables, int arity, FunctionAndTypeManager functionAndTypeManager) {<NEW_LINE>checkArgument(arity == 1, "Expected arity to be 1");<NEW_LINE>Type fromType = boundVariables.getTypeVariable("F");<NEW_LINE>Type toType = boundVariables.getTypeVariable("T");<NEW_LINE>FunctionHandle functionHandle = functionAndTypeManager.lookupCast(CastType.CAST, fromType, toType);<NEW_LINE>JavaScalarFunctionImplementation <MASK><NEW_LINE>Class<?> castOperatorClass = generateArrayCast(functionAndTypeManager, functionAndTypeManager.getFunctionMetadata(functionHandle), function);<NEW_LINE>MethodHandle methodHandle = methodHandle(castOperatorClass, "castArray", SqlFunctionProperties.class, Block.class);<NEW_LINE>return new BuiltInScalarFunctionImplementation(false, ImmutableList.of(valueTypeArgumentProperty(RETURN_NULL_ON_NULL), valueTypeArgumentProperty(RETURN_NULL_ON_NULL)), methodHandle);<NEW_LINE>}
|
function = functionAndTypeManager.getJavaScalarFunctionImplementation(functionHandle);
|
1,474,083
|
public static void usage() {<NEW_LINE>System.err.println("JDiff version: " + JDiff.version);<NEW_LINE>System.err.println("");<NEW_LINE>System.err.println("Valid JDiff arguments:");<NEW_LINE>System.err.println("");<NEW_LINE>System.err.println(" -apiname <Name of a version>");<NEW_LINE>System.err.println(" -oldapi <Name of a version>");<NEW_LINE>System.err.println(" -newapi <Name of a version>");<NEW_LINE>System.err.println(" Optional Arguments");<NEW_LINE>System.err.println();<NEW_LINE>System.err.println(" -d <directory> Destination directory for output HTML files");<NEW_LINE><MASK><NEW_LINE>System.err.println(" -oldapidir <directory> Location of the XML file for the old API");<NEW_LINE>System.err.println(" -newapidir <directory> Location of the XML file for the new API");<NEW_LINE>System.err.println(" -sourcepath <location of Java source files>");<NEW_LINE>System.err.println(" -javadocnew <location of existing Javadoc files for the new API>");<NEW_LINE>System.err.println(" -javadocold <location of existing Javadoc files for the old API>");<NEW_LINE>System.err.println(" -baseURI <base> Use \"base\" as the base location of the various DTDs and Schemas used by JDiff");<NEW_LINE>System.err.println(" -excludeclass [public|protected|package|private] Exclude classes which are not public, protected etc");<NEW_LINE>System.err.println(" -excludemember [public|protected|package|private] Exclude members which are not public, protected etc");<NEW_LINE>System.err.println(" -firstsentence Save only the first sentence of each comment block with the API.");<NEW_LINE>System.err.println(" -docchanges Report changes in Javadoc comments between the APIs");<NEW_LINE>System.err.println(" -incompatible Only report incompatible changes");<NEW_LINE>System.err.println(" -nosuggest [all|remove|add|change] Do not add suggested comments to all, or the removed, added or chabged sections");<NEW_LINE>System.err.println(" -checkcomments Check that comments are sentences");<NEW_LINE>System.err.println(" -stripnonprinting Remove non-printable characters from comments.");<NEW_LINE>System.err.println(" -excludetag <tag> Define the Javadoc tag which implies exclusion");<NEW_LINE>System.err.println(" -stats Generate statistical output");<NEW_LINE>System.err.println(" -help (generates this output)");<NEW_LINE>System.err.println("");<NEW_LINE>System.err.println("For more help, see jdiff.html");<NEW_LINE>}
|
System.err.println(" -apidir <directory> Destination directory for the XML file generated with the '-apiname' argument.");
|
864,588
|
public void load() {<NEW_LINE>synchronized (registryLock) {<NEW_LINE>// Find subsystems asking for initialization.<NEW_LINE>ServiceLoader<T> sl;<NEW_LINE>try {<NEW_LINE>// Use this->classloader form : better for OSGi<NEW_LINE>sl = ServiceLoader.load(moduleClass, this.getClass().getClassLoader());<NEW_LINE>} catch (ServiceConfigurationError ex) {<NEW_LINE>Log.error(this, "Problem with service loading for " + <MASK><NEW_LINE>throw ex;<NEW_LINE>}<NEW_LINE>sl.stream().forEach(provider -> {<NEW_LINE>try {<NEW_LINE>T module = provider.get();<NEW_LINE>this.add(module);<NEW_LINE>} catch (ServiceConfigurationError ex) {<NEW_LINE>FmtLog.error(LoggerFactory.getLogger(this.getClass()), "Error instantiating class %s for %s", provider.type().getName(), moduleClass.getName(), ex);<NEW_LINE>throw ex;<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}<NEW_LINE>}
|
moduleClass.getName(), ex);
|
1,363,050
|
public static void registerType(ModelBuilder modelBuilder) {<NEW_LINE>ModelElementTypeBuilder typeBuilder = modelBuilder.defineType(MessageEventDefinition.class, BPMN_ELEMENT_MESSAGE_EVENT_DEFINITION).namespaceUri(BPMN20_NS).extendsType(EventDefinition.class).instanceProvider(new ModelElementTypeBuilder.ModelTypeInstanceProvider<MessageEventDefinition>() {<NEW_LINE><NEW_LINE>public MessageEventDefinition newInstance(ModelTypeInstanceContext instanceContext) {<NEW_LINE>return new MessageEventDefinitionImpl(instanceContext);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>messageRefAttribute = typeBuilder.stringAttribute(BPMN_ATTRIBUTE_MESSAGE_REF).qNameAttributeReference(Message.class).build();<NEW_LINE>SequenceBuilder sequenceBuilder = typeBuilder.sequence();<NEW_LINE>operationRefChild = sequenceBuilder.element(OperationRef.class).qNameElementReference(Operation.class).build();<NEW_LINE>camundaClassAttribute = typeBuilder.stringAttribute(CAMUNDA_ATTRIBUTE_CLASS).namespace(CAMUNDA_NS).build();<NEW_LINE>camundaDelegateExpressionAttribute = typeBuilder.stringAttribute(CAMUNDA_ATTRIBUTE_DELEGATE_EXPRESSION).namespace(CAMUNDA_NS).build();<NEW_LINE>camundaExpressionAttribute = typeBuilder.stringAttribute(CAMUNDA_ATTRIBUTE_EXPRESSION).<MASK><NEW_LINE>camundaResultVariableAttribute = typeBuilder.stringAttribute(CAMUNDA_ATTRIBUTE_RESULT_VARIABLE).namespace(CAMUNDA_NS).build();<NEW_LINE>camundaTopicAttribute = typeBuilder.stringAttribute(CAMUNDA_ATTRIBUTE_TOPIC).namespace(CAMUNDA_NS).build();<NEW_LINE>camundaTypeAttribute = typeBuilder.stringAttribute(CAMUNDA_ATTRIBUTE_TYPE).namespace(CAMUNDA_NS).build();<NEW_LINE>camundaTaskPriorityAttribute = typeBuilder.stringAttribute(CAMUNDA_ATTRIBUTE_TASK_PRIORITY).namespace(CAMUNDA_NS).build();<NEW_LINE>typeBuilder.build();<NEW_LINE>}
|
namespace(CAMUNDA_NS).build();
|
373,861
|
public void handleRequest(HttpServerExchange exchange) throws Exception {<NEW_LINE>var request = MongoRequest.of(exchange);<NEW_LINE>var response = MongoResponse.of(exchange);<NEW_LINE>if (request.isInError()) {<NEW_LINE>next(exchange);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>var _content = request.getContent();<NEW_LINE>if (RequestHelper.isNotAcceptableContent(_content, exchange)) {<NEW_LINE>next(exchange);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>var content = _content.asDocument();<NEW_LINE>var id = request.getDocumentId();<NEW_LINE>if (content.get("_id") == null) {<NEW_LINE>content.put("_id", id);<NEW_LINE>} else if (!content.get("_id").equals(id)) {<NEW_LINE>response.setInError(HttpStatus.SC_NOT_ACCEPTABLE, "_id in json data cannot be different than id in URL");<NEW_LINE>next(exchange);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>var result = documents.writeDocument(Optional.ofNullable(request.getClientSession()), request.getMethod(), request.getWriteMode(), request.getDBName(), request.getCollectionName(), Optional.of(request.getDocumentId()), Optional.ofNullable(request.getFiltersDocument()), Optional.ofNullable(request.getShardKey()), content, request.getETag(), request.isETagCheckRequired());<NEW_LINE>response.setDbOperationResult(result);<NEW_LINE>if (RequestHelper.isResponseInConflict(result, exchange)) {<NEW_LINE>next(exchange);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// handle the case of error result with exception<NEW_LINE>if (result.getCause() != null) {<NEW_LINE>response.setInError(result.getHttpCode(), result.<MASK><NEW_LINE>next(exchange);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>response.setStatusCode(result.getHttpCode());<NEW_LINE>next(exchange);<NEW_LINE>}
|
getCause().getMessage());
|
1,795,518
|
private void onNextInternal(R value) throws IOException {<NEW_LINE>LOG.debug("Received request {}", value);<NEW_LINE>if (mStream == null) {<NEW_LINE>throw new IllegalStateException("No request stream assigned");<NEW_LINE>}<NEW_LINE>if (!mSnapshotFile.exists()) {<NEW_LINE>throw new FileNotFoundException(String.format("Snapshot file %s does not exist", mSnapshotFile.getPath()));<NEW_LINE>}<NEW_LINE>long offsetReceived = mOffsetGetter.apply(value);<NEW_LINE>// TODO(feng): implement better flow control<NEW_LINE>if (mOffset != offsetReceived) {<NEW_LINE>throw new InvalidArgumentException(String.format("Received mismatched offset: %d. Expect %d", offsetReceived, mOffset));<NEW_LINE>}<NEW_LINE>LOG.debug("Streaming data at {}", mOffset);<NEW_LINE>try (InputStream is = new FileInputStream(mSnapshotFile)) {<NEW_LINE>is.skip(mOffset);<NEW_LINE>boolean eof = false;<NEW_LINE>int chunkSize = SNAPSHOT_CHUNK_SIZE;<NEW_LINE>long available = mLength - mOffset;<NEW_LINE>if (available <= SNAPSHOT_CHUNK_SIZE) {<NEW_LINE>eof = true;<NEW_LINE>chunkSize = (int) available;<NEW_LINE>}<NEW_LINE>byte[] buffer = new byte[chunkSize];<NEW_LINE>IOUtils.readFully(is, buffer);<NEW_LINE>LOG.debug("Read {} bytes from file {}", chunkSize, mSnapshotFile);<NEW_LINE>mStream.onNext(mDataMessageBuilder.apply(SnapshotData.newBuilder().setOffset(mOffset).setEof(eof).setChunk(UnsafeByteOperations.unsafeWrap(buffer)).setSnapshotTerm(mSnapshotInfo.getTerm()).setSnapshotIndex(mSnapshotInfo.getIndex(<MASK><NEW_LINE>mOffset += chunkSize;<NEW_LINE>LOG.debug("Uploaded total {} bytes of file {}", mOffset, mSnapshotFile);<NEW_LINE>}<NEW_LINE>}
|
)).build()));
|
461,835
|
public void lockToPortraitUpsideDown() {<NEW_LINE>final Activity activity = getCurrentActivity();<NEW_LINE>if (activity == null)<NEW_LINE>return;<NEW_LINE>activity.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_REVERSE_PORTRAIT);<NEW_LINE>isLocked = true;<NEW_LINE>// force send an UI orientation event<NEW_LINE>lastOrientationValue = "PORTRAIT-UPSIDEDOWN";<NEW_LINE>WritableMap params = Arguments.createMap();<NEW_LINE><MASK><NEW_LINE>if (ctx.hasActiveCatalystInstance()) {<NEW_LINE>ctx.getJSModule(DeviceEventManagerModule.RCTDeviceEventEmitter.class).emit("orientationDidChange", params);<NEW_LINE>}<NEW_LINE>// send a locked event<NEW_LINE>WritableMap lockParams = Arguments.createMap();<NEW_LINE>lockParams.putString("orientation", lastOrientationValue);<NEW_LINE>if (ctx.hasActiveCatalystInstance()) {<NEW_LINE>ctx.getJSModule(DeviceEventManagerModule.RCTDeviceEventEmitter.class).emit("lockDidChange", lockParams);<NEW_LINE>}<NEW_LINE>}
|
params.putString("orientation", lastOrientationValue);
|
73,441
|
public void entity2Storage(final ZipkinSpanRecord storageData, final Convert2Storage converter) {<NEW_LINE>converter.accept(TRACE_ID, storageData.getTraceId());<NEW_LINE>converter.accept(<MASK><NEW_LINE>converter.accept(SERVICE_ID, storageData.getServiceId());<NEW_LINE>converter.accept(SERVICE_INSTANCE_ID, storageData.getServiceInstanceId());<NEW_LINE>converter.accept(ENDPOINT_NAME, storageData.getEndpointName());<NEW_LINE>converter.accept(ENDPOINT_ID, storageData.getEndpointId());<NEW_LINE>converter.accept(START_TIME, storageData.getStartTime());<NEW_LINE>converter.accept(END_TIME, storageData.getEndTime());<NEW_LINE>converter.accept(LATENCY, storageData.getLatency());<NEW_LINE>converter.accept(IS_ERROR, storageData.getIsError());<NEW_LINE>converter.accept(TIME_BUCKET, storageData.getTimeBucket());<NEW_LINE>converter.accept(DATA_BINARY, storageData.getDataBinary());<NEW_LINE>converter.accept(ENCODE, storageData.getEncode());<NEW_LINE>converter.accept(TAGS, storageData.getTags());<NEW_LINE>}
|
SPAN_ID, storageData.getSpanId());
|
1,642,340
|
final ListRegistriesResult executeListRegistries(ListRegistriesRequest listRegistriesRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(listRegistriesRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<ListRegistriesRequest> request = null;<NEW_LINE>Response<ListRegistriesResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new ListRegistriesRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(listRegistriesRequest));<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, "schemas");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ListRegistries");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<ListRegistriesResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new ListRegistriesResultJsonUnmarshaller());<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());
|
16,742
|
public boolean load(Properties props) {<NEW_LINE>assert !SwingUtilities.isEventDispatchThread();<NEW_LINE>final Properties <MASK><NEW_LINE>try {<NEW_LINE>SwingUtilities.invokeAndWait(new Runnable() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void run() {<NEW_LINE>hostTextField.setText(attachProps.getString(PROP_HOST, ""));<NEW_LINE>portTextField.setText(Integer.toString(attachProps.getInt(PROP_PORT, 0)));<NEW_LINE>localSourcesCheckBox.setSelected(attachProps.getBoolean(PROP_HAS_SOURCES, false));<NEW_LINE>String localPath = attachProps.getString(PROP_LOCAL_PATH, "");<NEW_LINE>localSourcesTextField.setText(localPath);<NEW_LINE>String serverPath = attachProps.getString(PROP_SERVER_PATH, "");<NEW_LINE>serverPathTextField.setText(serverPath);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} catch (InterruptedException ex) {<NEW_LINE>Exceptions.printStackTrace(ex);<NEW_LINE>} catch (InvocationTargetException ex) {<NEW_LINE>Exceptions.printStackTrace(ex);<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>}
|
attachProps = props.getProperties(V8_ATTACH_PROPERTIES);
|
971,014
|
public final void primaryExpression() throws RecognitionException, TokenStreamException {<NEW_LINE>returnAST = null;<NEW_LINE>ASTPair currentAST = new ASTPair();<NEW_LINE>AST primaryExpression_AST = null;<NEW_LINE>switch(LA(1)) {<NEW_LINE>case LPAREN_WITH_NO_LEADING_SPACE:<NEW_LINE>case LPAREN:<NEW_LINE>case GLOBAL_VARIABLE:<NEW_LINE>case COLON_WITH_NO_FOLLOWING_SPACE:<NEW_LINE>case INSTANCE_VARIABLE:<NEW_LINE>case CLASS_VARIABLE:<NEW_LINE>case LITERAL_nil:<NEW_LINE>case LITERAL_true:<NEW_LINE>case LITERAL_false:<NEW_LINE>case LITERAL___FILE__:<NEW_LINE>case LITERAL___LINE__:<NEW_LINE>case DOUBLE_QUOTE_STRING:<NEW_LINE>case SINGLE_QUOTE_STRING:<NEW_LINE>case STRING_BEFORE_EXPRESSION_SUBSTITUTION:<NEW_LINE>case REGEX:<NEW_LINE>case REGEX_BEFORE_EXPRESSION_SUBSTITUTION:<NEW_LINE>case COMMAND_OUTPUT:<NEW_LINE>case COMMAND_OUTPUT_BEFORE_EXPRESSION_SUBSTITUTION:<NEW_LINE>case HERE_DOC_BEGIN:<NEW_LINE>case W_ARRAY:<NEW_LINE>case INTEGER:<NEW_LINE>case HEX:<NEW_LINE>case BINARY:<NEW_LINE>case OCTAL:<NEW_LINE>case FLOAT:<NEW_LINE>case ASCII_VALUE:<NEW_LINE>case LBRACK:<NEW_LINE>case LCURLY_HASH:<NEW_LINE>case LITERAL_begin:<NEW_LINE>case LITERAL_if:<NEW_LINE>case LITERAL_unless:<NEW_LINE>case LITERAL_case:<NEW_LINE>case LITERAL_for:<NEW_LINE>case LITERAL_while:<NEW_LINE>case LITERAL_until:<NEW_LINE>case LITERAL_module:<NEW_LINE>case LITERAL_class:<NEW_LINE>case LITERAL_def:<NEW_LINE>{<NEW_LINE>primaryExpressionThatCanNotBeMethodName();<NEW_LINE><MASK><NEW_LINE>primaryExpression_AST = (AST) currentAST.root;<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>case IDENTIFIER:<NEW_LINE>case CONSTANT:<NEW_LINE>case FUNCTION:<NEW_LINE>case UNARY_PLUS_MINUS_METHOD_NAME:<NEW_LINE>case EMPTY_ARRAY_ACCESS:<NEW_LINE>case LITERAL_self:<NEW_LINE>case LITERAL_super:<NEW_LINE>case LEADING_COLON2:<NEW_LINE>case LITERAL_retry:<NEW_LINE>case LITERAL_yield:<NEW_LINE>case LITERAL_redo:<NEW_LINE>case EMPTY_ARRAY:<NEW_LINE>case 155:<NEW_LINE>{<NEW_LINE>primaryExpressionThatCanBeMethodName();<NEW_LINE>astFactory.addASTChild(currentAST, returnAST);<NEW_LINE>primaryExpression_AST = (AST) currentAST.root;<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>default:<NEW_LINE>{<NEW_LINE>throw new NoViableAltException(LT(1), getFilename());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>returnAST = primaryExpression_AST;<NEW_LINE>}
|
astFactory.addASTChild(currentAST, returnAST);
|
302,472
|
private void initLayout() {<NEW_LINE>this.getStyleClass().add("searchBox");<NEW_LINE>searchField = new JFXTextField();<NEW_LINE>searchField.setOnKeyReleased(e -> {<NEW_LINE>if (e.getCode() == KeyCode.ESCAPE) {<NEW_LINE>if (closeHandler != null) {<NEW_LINE>closeHandler.run();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>searchField.setPromptText("Search");<NEW_LINE>searchField.setOnKeyPressed(e -> {<NEW_LINE>if (e.getCode() == KeyCode.ENTER) {<NEW_LINE>triggerSearch(e.isShiftDown());<NEW_LINE>}<NEW_LINE>});<NEW_LINE>var searchUp = new JFXButton();<NEW_LINE>searchUp.setGraphic(<MASK><NEW_LINE>searchUp.setOnAction(e -> triggerSearch(true));<NEW_LINE>var searchDown = new JFXButton();<NEW_LINE>searchDown.setGraphic(new FontAwesomeIconView(FontAwesomeIcon.ANGLE_DOWN));<NEW_LINE>searchDown.setOnAction(e -> triggerSearch(false));<NEW_LINE>this.add(searchField);<NEW_LINE>this.add(searchUp);<NEW_LINE>this.add(searchDown);<NEW_LINE>this.setMaxWidth(200);<NEW_LINE>this.setMaxHeight(40);<NEW_LINE>this.setVisible(false);<NEW_LINE>ChangeListener<Boolean> focusListener = (obs, o, n) -> {<NEW_LINE>if (n != null && n == false) {<NEW_LINE>var focusedNode = this.getScene().getFocusOwner();<NEW_LINE>if (!JavaFxUtils.isParent(this, focusedNode)) {<NEW_LINE>if (closeHandler != null) {<NEW_LINE>closeHandler.run();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>};<NEW_LINE>searchField.focusedProperty().addListener(focusListener);<NEW_LINE>searchUp.focusedProperty().addListener(focusListener);<NEW_LINE>searchDown.focusedProperty().addListener(focusListener);<NEW_LINE>}
|
new FontAwesomeIconView(FontAwesomeIcon.ANGLE_UP));
|
242,407
|
protected List<SlimAssertion> assertionsFromScenario(int row) throws TestExecutionException {<NEW_LINE>int lastCol = table.getColumnCountInRow(row) - 1;<NEW_LINE>String scenarioName = getScenarioNameFromAlternatingCells(lastCol, row);<NEW_LINE>ScenarioTable scenario = getTestContext().getScenario(scenarioName);<NEW_LINE>String[] args = null;<NEW_LINE>List<SlimAssertion> <MASK><NEW_LINE>if (scenario != null) {<NEW_LINE>args = getArgumentsStartingAt(1, lastCol, row, assertions);<NEW_LINE>} else if (lastCol == 0) {<NEW_LINE>String cellContents = table.getCellContents(0, row);<NEW_LINE>scenario = getTestContext().getScenarioByPattern(cellContents);<NEW_LINE>if (scenario != null) {<NEW_LINE>args = scenario.matchParameters(cellContents);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (scenario != null) {<NEW_LINE>scenario.setCustomComparatorRegistry(customComparatorRegistry);<NEW_LINE>assertions.addAll(scenario.call(args, this, row));<NEW_LINE>}<NEW_LINE>return assertions;<NEW_LINE>}
|
assertions = new ArrayList<>();
|
80,843
|
private void parseKeyboard(final XmlPullParser parser, final boolean skip) throws XmlPullParserException, IOException {<NEW_LINE>while (parser.getEventType() != XmlPullParser.END_DOCUMENT) {<NEW_LINE>final int event = parser.next();<NEW_LINE>if (event == XmlPullParser.START_TAG) {<NEW_LINE>final String tag = parser.getName();<NEW_LINE>if (TAG_KEYBOARD.equals(tag)) {<NEW_LINE>if (DEBUG)<NEW_LINE>startTag("<%s> %s%s", TAG_KEYBOARD, mParams.mId, skip ? " skipped" : "");<NEW_LINE>if (!skip) {<NEW_LINE>if (mKeyboardDefined) {<NEW_LINE>throw new XmlParseUtils.ParseException("Only one " + TAG_KEYBOARD + " tag can be defined", parser);<NEW_LINE>}<NEW_LINE>mKeyboardDefined = true;<NEW_LINE>parseKeyboardAttributes(parser);<NEW_LINE>startKeyboard();<NEW_LINE>}<NEW_LINE>parseKeyboardContent(parser, skip);<NEW_LINE>} else if (TAG_SWITCH.equals(tag)) {<NEW_LINE>parseSwitchKeyboard(parser, skip);<NEW_LINE>} else {<NEW_LINE>throw new XmlParseUtils.<MASK><NEW_LINE>}<NEW_LINE>} else if (event == XmlPullParser.END_TAG) {<NEW_LINE>final String tag = parser.getName();<NEW_LINE>if (DEBUG)<NEW_LINE>endTag("</%s>", tag);<NEW_LINE>if (TAG_CASE.equals(tag) || TAG_DEFAULT.equals(tag)) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>throw new XmlParseUtils.IllegalEndTag(parser, tag, TAG_ROW);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
|
IllegalStartTag(parser, tag, TAG_KEYBOARD);
|
25,608
|
public WebContentDto updateWebContent(final WebContentForm webContentForm) {<NEW_LINE>log.debug("updateWebContent() - webContentForm: {}", webContentForm);<NEW_LINE>final WebContent webContent = webContentService.find(webContentForm.getId());<NEW_LINE>switch(webContentForm.getType()) {<NEW_LINE>case SIMPLE:<NEW_LINE>final SimpleWebContentForm simpleWebContentForm = (SimpleWebContentForm) webContentForm;<NEW_LINE>webContent.changeContent(simpleWebContentForm.getContent());<NEW_LINE>webContent.changeTitle(simpleWebContentForm.getTitle());<NEW_LINE>break;<NEW_LINE>case ADVANCED:<NEW_LINE>final AdvancedWebContentForm advancedWebContentForm = (AdvancedWebContentForm) webContentForm;<NEW_LINE>final Structure structure = structureService.find(advancedWebContentForm.getStructure().getId());<NEW_LINE>webContent.<MASK><NEW_LINE>webContent.changeTitle(advancedWebContentForm.getTitle());<NEW_LINE>((AdvancedWebContent) webContent).changeStructure(structure);<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>throw new UnsupportedOperationException("Web content type: " + webContentForm.getType() + " is unsupported.");<NEW_LINE>}<NEW_LINE>final WebContent updatedWebContent = webContentService.update(webContent);<NEW_LINE>return webContentToWebContentDtoConverter.convert(updatedWebContent);<NEW_LINE>}
|
changeContent(advancedWebContentForm.getContent());
|
895,637
|
private static String buildAutomodFragments(JSONArray fragments) {<NEW_LINE>StringBuilder b = new StringBuilder();<NEW_LINE>for (Object o : fragments) {<NEW_LINE>JSONObject fragment = (JSONObject) o;<NEW_LINE>String text = JSONUtil.getString(fragment, "text");<NEW_LINE>if (fragment.containsKey("automod")) {<NEW_LINE>if (b.length() > 0) {<NEW_LINE>b.append(", ");<NEW_LINE>}<NEW_LINE>b.append("\"").append(text).append("\":");<NEW_LINE>JSONObject topics = (JSONObject) ((JSONObject) fragment.get(<MASK><NEW_LINE>boolean first = true;<NEW_LINE>for (Object o2 : topics.keySet()) {<NEW_LINE>if (!first) {<NEW_LINE>b.append("/");<NEW_LINE>}<NEW_LINE>first = false;<NEW_LINE>String key = (String) o2;<NEW_LINE>b.append(key).append(topics.get(key));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return b.toString();<NEW_LINE>}
|
"automod")).get("topics");
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.