method2testcases
stringlengths
118
6.63k
### Question: KeycloakPreAuthActionsFilter extends GenericFilterBean implements ApplicationContextAware { @Override public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException { HttpFacade facade = new SimpleHttpFacade((HttpServletRequest)request, (Http...
### Question: QueryParamPresenceRequestMatcher implements RequestMatcher { @Override public boolean matches(HttpServletRequest httpServletRequest) { return param != null && httpServletRequest.getParameter(param) != null; } QueryParamPresenceRequestMatcher(String param); @Override boolean matches(HttpServletRequest http...
### Question: KeycloakCsrfRequestMatcher implements RequestMatcher { public boolean matches(HttpServletRequest request) { String uri = request.getRequestURI().replaceFirst(request.getContextPath(), ""); return !allowedEndpoints.matcher(uri).matches() && !allowedMethods.matcher(request.getMethod()).matches(); } boolean...
### Question: KeycloakAuthenticationProcessingFilter extends AbstractAuthenticationProcessingFilter implements ApplicationContextAware { @Override public Authentication attemptAuthentication(HttpServletRequest request, HttpServletResponse response) throws AuthenticationException, IOException, ServletException { log.deb...
### Question: KeycloakAuthenticationProcessingFilter extends AbstractAuthenticationProcessingFilter implements ApplicationContextAware { @Override protected void successfulAuthentication(HttpServletRequest request, HttpServletResponse response, FilterChain chain, Authentication authResult) throws IOException, ServletEx...
### Question: KeycloakAuthenticationProcessingFilter extends AbstractAuthenticationProcessingFilter implements ApplicationContextAware { @Override protected void unsuccessfulAuthentication(HttpServletRequest request, HttpServletResponse response, AuthenticationException failed) throws IOException, ServletException { su...
### Question: KeycloakAuthenticationProcessingFilter extends AbstractAuthenticationProcessingFilter implements ApplicationContextAware { @Override public final void setAllowSessionCreation(boolean allowSessionCreation) { throw new UnsupportedOperationException("This filter does not support explicitly setting a session ...
### Question: KeycloakAuthenticationProcessingFilter extends AbstractAuthenticationProcessingFilter implements ApplicationContextAware { @Override public final void setContinueChainBeforeSuccessfulAuthentication(boolean continueChainBeforeSuccessfulAuthentication) { throw new UnsupportedOperationException("This filter ...
### Question: SpringSecurityAdapterTokenStoreFactory implements AdapterTokenStoreFactory { @Override public AdapterTokenStore createAdapterTokenStore(KeycloakDeployment deployment, HttpServletRequest request, HttpServletResponse response) { Assert.notNull(deployment, "KeycloakDeployment is required"); if (deployment.ge...
### Question: SpringSecurityTokenStore implements AdapterTokenStore { @Override public boolean isCached(RequestAuthenticator authenticator) { logger.debug("Checking if {} is cached", authenticator); SecurityContext context = SecurityContextHolder.getContext(); KeycloakAuthenticationToken token; KeycloakSecurityContext ...
### Question: SpringSecurityTokenStore implements AdapterTokenStore { @Override public void saveAccountInfo(OidcKeycloakAccount account) { Authentication authentication = SecurityContextHolder.getContext().getAuthentication(); if (authentication != null) { throw new IllegalStateException(String.format("Went to save Key...
### Question: ProxyMappings { public boolean isEmpty() { return this.entries.isEmpty(); } ProxyMappings(List<ProxyMapping> entries); static ProxyMappings valueOf(List<String> proxyMappings); static ProxyMappings valueOf(String... proxyMappings); boolean isEmpty(); ProxyMapping getProxyFor(String hostname); static void ...
### Question: SpringSecurityTokenStore implements AdapterTokenStore { @Override public void logout() { logger.debug("Handling logout request"); HttpSession session = request.getSession(false); if (session != null) { session.setAttribute(KeycloakSecurityContext.class.getName(), null); session.invalidate(); } SecurityCon...
### Question: AdapterDeploymentContextFactoryBean implements FactoryBean<AdapterDeploymentContext>, InitializingBean { @Override public void afterPropertiesSet() throws Exception { if (keycloakConfigResolver != null) { adapterDeploymentContext = new AdapterDeploymentContext(keycloakConfigResolver); } else { log.info("L...
### Question: WrappedHttpServletResponse implements Response { @Override public void resetCookie(String name, String path) { Cookie cookie = new Cookie(name, ""); cookie.setMaxAge(0); if (path != null) { cookie.setPath(path); } response.addCookie(cookie); } WrappedHttpServletResponse(HttpServletResponse response); @Ove...
### Question: WrappedHttpServletResponse implements Response { @Override public void setCookie(String name, String value, String path, String domain, int maxAge, boolean secure, boolean httpOnly) { Cookie cookie = new Cookie(name, value); if (path != null) { cookie.setPath(path); } if (domain != null) { cookie.setDomai...
### Question: WrappedHttpServletResponse implements Response { @Override public void setStatus(int status) { response.setStatus(status); } WrappedHttpServletResponse(HttpServletResponse response); @Override void resetCookie(String name, String path); @Override void setCookie(String name, String value, String path, Stri...
### Question: WrappedHttpServletResponse implements Response { @Override public void addHeader(String name, String value) { response.addHeader(name, value); } WrappedHttpServletResponse(HttpServletResponse response); @Override void resetCookie(String name, String path); @Override void setCookie(String name, String valu...
### Question: WrappedHttpServletResponse implements Response { @Override public void setHeader(String name, String value) { response.setHeader(name, value); } WrappedHttpServletResponse(HttpServletResponse response); @Override void resetCookie(String name, String path); @Override void setCookie(String name, String valu...
### Question: WrappedHttpServletResponse implements Response { @Override public OutputStream getOutputStream() { try { return response.getOutputStream(); } catch (IOException e) { throw new RuntimeException("Unable to return response output stream", e); } } WrappedHttpServletResponse(HttpServletResponse response); @Ove...
### Question: WrappedHttpServletResponse implements Response { @Override public void sendError(int code) { try { response.sendError(code); } catch (IOException e) { throw new RuntimeException("Unable to set HTTP status", e); } } WrappedHttpServletResponse(HttpServletResponse response); @Override void resetCookie(String...
### Question: WrappedHttpServletResponse implements Response { @Override public void end() { } WrappedHttpServletResponse(HttpServletResponse response); @Override void resetCookie(String name, String path); @Override void setCookie(String name, String value, String path, String domain, int maxAge, boolean secure, boole...
### Question: Invoice extends UdoDomainObject2<T> implements WithApplicationTenancyAny, WithApplicationTenancyPathPersisted { @Property(notPersisted = true) public BigDecimal getTotalNetAmount() { return sum(InvoiceItem::getNetAmount); } Invoice(final String keyProperties); @Property(hidden = Where.ALL_TABLES) @Propert...
### Question: LocationLookupService { @Programmatic public Location lookup(final String description) { RequestConfig requestConfig = RequestConfig.custom() .setSocketTimeout(TIMEOUT_SECONDS * 1000) .setConnectTimeout(TIMEOUT_SECONDS * 1000) .build(); CloseableHttpClient httpClient = HttpClientBuilder.create() .setDefau...
### Question: PdfManipulator { @Programmatic public byte[] extractAndStamp( final byte[] docBytes, final ExtractSpec extractSpec, final Stamp stamp) throws IOException { List<byte[]> extractedPageDocBytes = Lists.newArrayList(); final PDDocument pdDoc = PDDocument.load(docBytes); try { final Splitter splitter = new Spl...
### Question: FinancialAmountUtil { public static BigDecimal subtractHandlingNulls(final BigDecimal amount, final BigDecimal amountToSubtract) { if (amountToSubtract == null) return amount; return amount == null ? amountToSubtract.negate() : amount.subtract(amountToSubtract); } static BigDecimal subtractHandlingNulls(...
### Question: FinancialAmountUtil { public static BigDecimal addHandlingNulls(final BigDecimal amount, final BigDecimal amountToAdd) { if (amountToAdd == null) return amount; return amount == null ? amountToAdd : amount.add(amountToAdd); } static BigDecimal subtractHandlingNulls(final BigDecimal amount, final BigDecim...
### Question: DocumentNameUtil { public static String stripPdfSuffixFromDocumentName(final String documentName){ return documentName.replaceAll("(?i)\\.pdf", ""); } static String stripPdfSuffixFromDocumentName(final String documentName); }### Answer: @Test public void stripPdfSuffixFromDocumentName() { Assertions.ass...
### Question: Invoice extends UdoDomainObject2<T> implements WithApplicationTenancyAny, WithApplicationTenancyPathPersisted { @Programmatic public InvoiceItem findFirstItemWithCharge(final Charge charge) { for (InvoiceItem item : getItems()) { if (item.getCharge().equals(charge)) { return item; } } return null; } Invoi...
### Question: PeriodUtil { public static boolean isValidPeriod(final String period){ if (period!=null && !period.equals("") && !yearFromPeriod(period).equals(new LocalDateInterval(null, null))){ return true; } return false; } static LocalDate startDateFromPeriod(final String period); static LocalDate endDateFromPeriod...
### Question: IncomingInvoiceExport { public static String getCodaElement6FromSellerReference(final String sellerReference){ if (sellerReference.startsWith("FR")) { return "FRFO".concat(sellerReference.substring(2)); } if (sellerReference.startsWith("BE")){ return "BEFO".concat(sellerReference.substring(2)); } return n...
### Question: IncomingInvoiceExport { public static String deriveCodaElement3FromPropertyAndIncomingInvoiceType(final FixedAsset property, final IncomingInvoiceType incomingInvoiceType, final String atPath){ if (incomingInvoiceType==IncomingInvoiceType.CORPORATE_EXPENSES){ if (atPath!=null && atPath.startsWith("/BEL"))...
### Question: IncomingInvoiceExport { public static String deriveCodaElement1FromBuyer(Party buyer) { if (buyer==null) return null; if (buyer.getReference().equals("BE00")){ return "BE01EUR"; } return buyer.getReference().concat("EUR"); } IncomingInvoiceExport( final IncomingInvoiceItem item, fi...
### Question: ChargingLine implements Importable { String keyToChargeReference() { return "SE" + getKod() + "-" + getKod2(); } ChargingLine(); String title(); @PropertyLayout(hidden = Where.PARENTED_TABLES) Lease getLease(); LeaseItem getLeaseItem(); @Action(semantics = SemanticsOf.NON_IDEMPOTENT) ImportStatus apply();...
### Question: OrderProjectImportAdapter implements FixtureAwareRowHandler<OrderProjectImportAdapter>, ExcelMetaDataEnabled { public String deriveOrderNumber() { if (getNumero() == null) return null; StringBuilder builder = new StringBuilder(); builder.append(getNumero().toString()); builder.append("/"); if (getCentro()...
### Question: OrderProjectImportAdapter implements FixtureAwareRowHandler<OrderProjectImportAdapter>, ExcelMetaDataEnabled { public void correctProgressivoCentroIfNecessary() { if (getProgressivoCentro() != null && getProgressivoCentro().length() == 1) setProgressivoCentro("00".concat(getProgressivoCentro())); if (getP...
### Question: OrderProjectImportAdapter implements FixtureAwareRowHandler<OrderProjectImportAdapter>, ExcelMetaDataEnabled { public String deriveProjectReference() { if (getCommessa() == null) return null; if (getCentro() == null) return ProjectImportAdapter.ITA_PROJECT_PREFIX + getCommessa(); return ProjectImportAdapt...
### Question: ChamberOfCommerceCodeLookUpService { public List<OrganisationNameNumberViewModel> getChamberOfCommerceCodeCandidatesByOrganisation(final Organisation organisation) { return getChamberOfCommerceCodeCandidatesByOrganisation(organisation.getName(), organisation.getAtPath()); } List<OrganisationNameNumberVie...
### Question: ChamberOfCommerceCodeLookUpService { public OrganisationNameNumberViewModel getChamberOfCommerceCodeCandidatesByCode(final Organisation organisation) { return getChamberOfCommerceCodeCandidatesByCode(organisation.getChamberOfCommerceCode(), organisation.getAtPath()); } List<OrganisationNameNumberViewMode...
### Question: ChargingLine implements Importable { boolean discardedOrAggregatedOrApplied() { if (getImportStatus() == ImportStatus.DISCARDED || getImportStatus() == ImportStatus.AGGREGATED || getApplied() != null) { return true; } return false; } ChargingLine(); String title(); @PropertyLayout(hidden = Where.PARENTED_...
### Question: ChamberOfCommerceCodeLookUpService { OrganisationNameNumberViewModel findCandidateForFranceByCode(final String code) { try { SirenResult sirenResult = sirenService.getCompanyName(code); if (sirenResult != null) { return new OrganisationNameNumberViewModel(sirenResult.getCompanyName(), code, sirenResult.ge...
### Question: ChamberOfCommerceCodeLookUpService { String filterLegalFormsFromOrganisationName(final String name ) { return Arrays.stream(name.split(" ")) .filter(element -> !LEGAL_FORMS.contains(element)) .filter(element -> !LEGAL_FORMS.contains(element.replace(".", ""))) .collect(Collectors.joining(" ")); } List<Org...
### Question: StatusMessageSummaryCache implements WithTransactionScope { @Programmatic public StatusMessageSummary findFor(final InvoiceForLease invoice) { final Long invoiceId = idFor(invoice); if (invoiceId==null) return null; Optional<StatusMessageSummary> statusMessageOpt = statusMessageByInvoiceId.get(invoiceId);...
### Question: RendererForStringInterpolatorCaptureUrl implements RendererFromCharsToBytes { protected URL previewCharsToBytes( final DocumentType documentType, final String atPath, final long templateVersion, final String templateChars, final Object dataModel) throws IOException { final StringInterpolatorService.Root r...
### Question: ChargingLine implements Importable { @Action(semantics = SemanticsOf.NON_IDEMPOTENT) public ImportStatus apply() { if (!discardedOrAggregatedOrApplied()) { ImportStatus result = fastnetImportService.updateOrCreateItemAndTerm(this); if (result != null && getImportStatus() != ImportStatus.AGGREGATED) { setA...
### Question: ChargingLine implements Importable { void appendImportLog(final String msg){ final String prefix = clockService.nowAsLocalDateTime().toString("yyyy-MM-dd HH:mm:ss") + " "; String nwContent = prefix; if (getImportLog()!=null) { nwContent = nwContent.concat(msg).concat(" ").concat(getImportLog()); } else { ...
### Question: RentRollLine implements Importable { String keyToLeaseExternalReference() { return getKontraktNr() != null ? getKontraktNr().substring(2) : null; } RentRollLine(); String title(); LocalDate getInflyttningsDatumAsDate(); @Action(semantics = SemanticsOf.SAFE) List<ChargingLine> getChargingLines(); @Property...
### Question: TurnoverAggregation { @Programmatic public LocalDateInterval calculationPeriod(){ return LocalDateInterval.including(getDate().minusMonths(23), getDate()); } TurnoverAggregation(); TurnoverAggregation(final TurnoverReportingConfig turnoverReportingConfig, final LocalDate date, final Currency currency); S...
### Question: ContextFilter implements Filter { public Result invoke(Invoker<?> invoker, Invocation invocation) throws RpcException { Map<String, String> attachments = setCallChainContextMap(invocation); if (attachments != null) { attachments = new HashMap<String, String>(attachments); attachments.remove(Constants.PATH...
### Question: Generators { protected Map<Matcher<ASTType>, ReadWriteGenerator> getGenerators() { return generators; } Generators(ASTClassFactory astClassFactory); boolean matches(ASTType type); ReadWriteGenerator getGenerator(ASTType type); void addPair(Class clazz, String readMethod, String writeMethod); void addPair(...
### Question: SpringSkillsAutoConfiguration { @Bean @ConditionalOnMissingBean(value=SpeechRequestDispatcher.class) public SpeechRequestDispatcher dispatcher() { return new BeanNameSpeechRequestDispatcher( (request) -> { Speech speech = new Speech(); speech.setSsml("<speak>I don't know what you're doing...</speak>"); Sp...
### Question: GoogleAssistantAutoConfiguration { @Bean @ConditionalOnMissingBean(WebhookController.class) public WebhookController webhookController(SpeechRequestDispatcher dispatcher) { return new WebhookController(dispatcher); } @Bean @ConditionalOnMissingBean(WebhookController.class) WebhookController webhookContro...
### Question: Hello { public String say() { return hello; } Hello(String s); String say(); }### Answer: @Test public void shouldSayHello() throws InterruptedException { assertEquals("hi", new Hello("hi").say()); Thread.sleep(1000); }
### Question: AppConfiguration { public String getString(final String propertyName) { if(this.javaSystemConfig.containsKey(propertyName)) { return this.javaSystemConfig.getString(propertyName); } List<String> propertiesToAttempt = getOrderedPropertyList(propertyName); for (String propertyToAttempt : propertiesToAttempt...
### Question: HexUtil { public static String toHexFromByte(final byte b) { byte leftSymbol = (byte) ((b >>> BITS_PER_HEX_DIGIT) & 0x0f); byte rightSymbol = (byte) (b & 0x0f); return (hexSymbols[leftSymbol] + hexSymbols[rightSymbol]); } static String toHexFromByte(final byte b); static byte toByteFromHex(char upperChar...
### Question: HexUtil { public static byte toByteFromHex(char upperChar, char lowerChar) { byte upper = HEX_TO_BYTE_MAP.get(Character.toLowerCase(upperChar)); byte lower = HEX_TO_BYTE_MAP.get(Character.toLowerCase(lowerChar)); return (byte) ((upper << BITS_PER_HEX_DIGIT) + lower); } static String toHexFromByte(final b...
### Question: HexUtil { public static String toHexFromBytes(final ByteBuffer bytes) { if (bytes == null) { return ""; } StringBuilder hexBuffer = new StringBuilder(); while (bytes.hasRemaining()) { hexBuffer.append(toHexFromByte(bytes.get())); } return hexBuffer.toString(); } static String toHexFromByte(final byte b);...
### Question: HexUtil { public static byte[] toBytesFromHex(String hexStr) { if (hexStr == null || hexStr.length() == 0) { return new byte[] {}; } if (hexStr.length() % 2 != 0) { hexStr += '0'; } int byteIndex = 0; final byte[] bytes = new byte[hexStr.length() / 2]; for (int i = 0; i < hexStr.length(); i += 2) { char u...
### Question: DecoderUtil { public static String getUtf8FromByteBuffer(final ByteBuffer bb) { bb.rewind(); byte[] bytes; if (bb.hasArray()) { bytes = bb.array(); } else { bytes = new byte[bb.remaining()]; bb.get(bytes); } return new String(bytes, StandardCharsets.UTF_8); } static String getUtf8FromByteBuffer(final Byt...
### Question: KinesisEvent { public Long getServerTimestamp() { return serverTimestamp; } KinesisEvent(); void parseFromJson(final ObjectMapper jsonParser, final String rawJson); String getRawJson(); String getProcessedJson(); @Override String toString(); boolean isRequiredSanitization(); List<String> getSanitizedField...
### Question: QueueBuffer { public synchronized void add(Message message) { linkLast(message); postProcessDeliverableNode(); } QueueBuffer(int inMemoryLimit, int indelibleMessageLimit, MessageReader messageReader); synchronized void add(Message message); synchronized void addAllBareMessages(Collection<Message> messages...
### Question: AuthResourceInMemoryDao implements AuthResourceDao { @Override public List<AuthResource> readAll(String resourceType, String ownerId) { Map<String, AuthResource> resourceMap = inMemoryResourceMap.row(resourceType); if (Objects.nonNull(resourceMap)) { Collection<AuthResource> authResources = resourceMap.va...
### Question: AuthResourceInMemoryDao implements AuthResourceDao { @Override public boolean isExists(String resourceType, String resourceName) { return inMemoryResourceMap.contains(resourceType, resourceName); } @Override void persist(AuthResource authResource); @Override void update(AuthResource authResource); @Overr...
### Question: AuthResourceInMemoryDao implements AuthResourceDao { @Override public void update(AuthResource authResource) { inMemoryResourceMap.put(authResource.getResourceType(), authResource.getResourceName(), authResource); } @Override void persist(AuthResource authResource); @Override void update(AuthResource aut...
### Question: AuthResourceInMemoryDao implements AuthResourceDao { @Override public boolean delete(String resourceType, String resource) { AuthResource removedItem = inMemoryResourceMap.remove(resourceType, resource); return removedItem != null; } @Override void persist(AuthResource authResource); @Override void updat...
### Question: AuthScopeRdbmsDao extends AuthScopeDao { @Override public AuthScope read(String scopeName) throws AuthServerException { Set<String> userGroups = new HashSet<>(); String scopeId = null; Connection connection = null; PreparedStatement statement = null; ResultSet resultSet = null; try { connection = getConne...
### Question: AuthScopeRdbmsDao extends AuthScopeDao { @Override public List<AuthScope> readAll() throws AuthServerException { Map<String, AuthScope> authScopes = new HashMap<>(); Connection connection = null; PreparedStatement statement = null; ResultSet resultSet = null; try { connection = getConnection(); statement ...
### Question: AuthScopeRdbmsDao extends AuthScopeDao { @Override public void update(String scopeName, List<String> userGroups) throws AuthServerException { Connection connection = null; try { connection = getConnection(); deleteGroups(scopeName, connection); persistGroups(scopeName, userGroups, connection); connection....
### Question: AmqpConnectionHandler extends ChannelInboundHandlerAdapter { public int closeConnection(String reason, boolean force, boolean used) throws ValidationException { int numberOfChannels = channels.size(); if (!used && numberOfChannels > 0) { throw new ValidationException("Cannot close connection. " + numberOf...
### Question: AmqpConnectionHandler extends ChannelInboundHandlerAdapter { public void closeChannel(int channelId) { AmqpChannel channel = channels.remove(channelId); if (Objects.nonNull(channel)) { closeChannel(channel); } } AmqpConnectionHandler(AmqpMetricManager metricManager, AmqpChannelFactory amqpChannelFactory, ...
### Question: QueueDelete extends MethodFrame { @Override protected void writeMethod(ByteBuf buf) { buf.writeShort(0); queue.write(buf); int flags = 0x00; if (ifUnused) { flags |= 0x1; } if (ifEmpty) { flags |= 0x2; } if (noWait) { flags |= 0x4; } buf.writeByte(flags); } QueueDelete(int channel, ShortString queue, bool...
### Question: DbEventMatcher implements EventHandler<DbOperation> { @Override public void onEvent(DbOperation event, long sequence, boolean endOfBatch) { if (LOGGER.isDebugEnabled()) { LOGGER.debug("{} event with message id {} for sequence {}", event.getType(), event.getMessage(), sequence); } eventQueue.add(event.getM...
### Question: AmqMethodRegistry { public AmqMethodBodyFactory getFactory(short classId, short methodId) throws AmqFrameDecodingException { try { AmqMethodBodyFactory factory = factories[classId][methodId]; if (factory == null) { throw new AmqFrameDecodingException(AmqConstant.COMMAND_INVALID, "Method " + methodId + " u...
### Question: AmqpChannel implements AmqpChannelView { @Override public String getTransactionType() { String transactionType = "unidentified"; if (transaction instanceof AutoCommitTransaction) { transactionType = "AutoCommit"; } else if (transaction instanceof LocalTransaction) { transactionType = "LocalTransaction"; }...
### Question: ChannelFlowManager { public void notifyMessageAddition(ChannelHandlerContext ctx) { messagesInFlight++; if (messagesInFlight > highLimit && inflowEnabled) { inflowEnabled = false; ctx.writeAndFlush(new ChannelFlow(channel.getChannelId(), false)); ctx.channel().config().setAutoRead(false); LOGGER.info("Inf...
### Question: AmqpConsumer extends Consumer { public Properties getTransportProperties() { return transportProperties; } AmqpConsumer(ChannelHandlerContext ctx, Broker broker, AmqpChannel channel, String queueName, ShortStri...
### Question: ChunkConverter { public List<ContentChunk> convert(List<ContentChunk> chunkList, long totalLength) { if (chunkList.isEmpty() || isChunksUnderLimit(chunkList)) { return chunkList; } ArrayList<ContentChunk> convertedChunks = new ArrayList<>(); long pendingBytes = totalLength; long offset = 0; ContentReader ...
### Question: BindingsRegistry { void bind(QueueHandler queueHandler, String bindingKey, FieldTable arguments) throws BrokerException, ValidationException { BindingSet bindingSet = bindingPatternToBindingsMap.computeIfAbsent(bindingKey, k -> new BindingSet()); Queue queue = queueHandler.getUnmodifiableQueue(); Binding ...
### Question: TopicExchange extends Exchange implements BindingsRegistryListener { @Override public BindingSet getBindingsForRoute(String routingKey) { if (routingKey.isEmpty()) { return BindingSet.emptySet(); } lock.readLock().lock(); try { BindingSet matchedBindingSet = new BindingSet(); fastTopicMatcher.matchingBind...
### Question: CipherToolInitializer { public static void execute(String... toolArgs) { CommandLineParser commandLineParser; try { commandLineParser = Utils.createCommandLineParser(toolArgs); } catch (CipherToolException e) { printHelpMessage(); throw new CipherToolRuntimeException("Unable to run CipherTool", e); } URLC...
### Question: QueueBuffer { public int size() { return size.get(); } QueueBuffer(int inMemoryLimit, int indelibleMessageLimit, MessageReader messageReader); synchronized void add(Message message); synchronized void addAllBareMessages(Collection<Message> messages); synchronized void addBareMessage(Message message); sync...
### Question: CarbonConfigAdapter implements ConfigProvider { @Override public <T> T getConfigurationObject(Class<T> aClass) throws ConfigurationException { return getConfig(aClass.getCanonicalName(), aClass); } CarbonConfigAdapter(BrokerConfigProvider configProvider); @Override T getConfigurationObject(Class<T> aClass...
### Question: LongString implements EncodableData { @Override public long getSize() { return 4 + length; } @SuppressFBWarnings("EI_EXPOSE_REP2") LongString(long length, byte[] content); static LongString parseString(String data); @Override long getSize(); @Override void write(ByteBuf buf); static LongString parse(Byte...
### Question: LongString implements EncodableData { public static LongString parse(ByteBuf buf) throws Exception { int size = (int) buf.readUnsignedInt(); if (size < 0) { throw new Exception("Invalid string length"); } byte[] data = new byte[size]; buf.readBytes(data); return new LongString(size, data); } @SuppressFBWa...
### Question: LongString implements EncodableData { @Override public String toString() { return new String(content, StandardCharsets.UTF_8); } @SuppressFBWarnings("EI_EXPOSE_REP2") LongString(long length, byte[] content); static LongString parseString(String data); @Override long getSize(); @Override void write(ByteBu...
### Question: QueueBuffer { public synchronized Message getFirstDeliverable() { submitMessageReads(); Node deliverableCandidate = firstDeliverableCandidate; if (deliverableCandidate != firstUndeliverable) { if (!deliverableCandidate.hasContent()) { return null; } firstDeliverableCandidate = deliverableCandidate.next; r...
### Question: LongString implements EncodableData { @Override public boolean equals(Object obj) { if (this == obj) { return true; } return (obj instanceof LongString) && (Arrays.equals(content, ((LongString) obj).content)); } @SuppressFBWarnings("EI_EXPOSE_REP2") LongString(long length, byte[] content); static LongStr...
### Question: LongString implements EncodableData { @Override public int hashCode() { return Arrays.hashCode(content); } @SuppressFBWarnings("EI_EXPOSE_REP2") LongString(long length, byte[] content); static LongString parseString(String data); @Override long getSize(); @Override void write(ByteBuf buf); static LongStr...
### Question: LongUint implements EncodableData { @Override public long getSize() { return 4L; } private LongUint(long value); @Override long getSize(); @Override void write(ByteBuf buf); long getInt(); @Override int hashCode(); @Override boolean equals(Object obj); static LongUint parse(ByteBuf buf); static LongUint ...
### Question: LongUint implements EncodableData { @Override public boolean equals(Object obj) { if (this == obj) { return true; } return (obj instanceof LongUint) && (value == ((LongUint) obj).value); } private LongUint(long value); @Override long getSize(); @Override void write(ByteBuf buf); long getInt(); @Override ...
### Question: LongUint implements EncodableData { @Override public int hashCode() { return Objects.hash(value); } private LongUint(long value); @Override long getSize(); @Override void write(ByteBuf buf); long getInt(); @Override int hashCode(); @Override boolean equals(Object obj); static LongUint parse(ByteBuf buf);...
### Question: LongUint implements EncodableData { public static LongUint parse(ByteBuf buf) { return new LongUint(buf.readUnsignedInt()); } private LongUint(long value); @Override long getSize(); @Override void write(ByteBuf buf); long getInt(); @Override int hashCode(); @Override boolean equals(Object obj); static Lo...
### Question: ShortShortUint implements EncodableData { @Override public long getSize() { return 1L; } private ShortShortUint(short value); @Override long getSize(); @Override void write(ByteBuf buf); static ShortShortUint parse(ByteBuf buf); static ShortShortUint parse(short value); short getByte(); @Override int has...
### Question: ShortShortUint implements EncodableData { @Override public boolean equals(Object obj) { if (this == obj) { return true; } return (obj instanceof ShortShortUint) && (value == ((ShortShortUint) obj).value); } private ShortShortUint(short value); @Override long getSize(); @Override void write(ByteBuf buf); ...
### Question: ShortShortUint implements EncodableData { @Override public int hashCode() { return (int) value; } private ShortShortUint(short value); @Override long getSize(); @Override void write(ByteBuf buf); static ShortShortUint parse(ByteBuf buf); static ShortShortUint parse(short value); short getByte(); @Overrid...
### Question: ExchangeRegistry { Exchange getExchange(String exchangeName) { return exchangeMap.get(exchangeName); } ExchangeRegistry(ExchangeDao exchangeDao, BindingDao bindingDao); void createExchange(String exchangeName, Exchange.Type type, boolean durable); Exchange getDefaultExchange(); void retrieveFromStore(Queu...
### Question: ShortShortUint implements EncodableData { public static ShortShortUint parse(ByteBuf buf) { return new ShortShortUint(buf.readUnsignedByte()); } private ShortShortUint(short value); @Override long getSize(); @Override void write(ByteBuf buf); static ShortShortUint parse(ByteBuf buf); static ShortShortUin...
### Question: ShortString implements EncodableData { public long getSize() { return length + 1; } @SuppressFBWarnings("EI_EXPOSE_REP2") ShortString(long length, byte[] content); long getSize(); void write(ByteBuf buf); static ShortString parse(ByteBuf buf); static ShortString parseString(String data); @Override String...
### Question: ShortString implements EncodableData { public static ShortString parse(ByteBuf buf) { int size = buf.readUnsignedByte(); byte[] data = new byte[size]; buf.readBytes(data); return new ShortString(size, data); } @SuppressFBWarnings("EI_EXPOSE_REP2") ShortString(long length, byte[] content); long getSize();...
### Question: ShortString implements EncodableData { @Override public String toString() { return new String(content, StandardCharsets.UTF_8); } @SuppressFBWarnings("EI_EXPOSE_REP2") ShortString(long length, byte[] content); long getSize(); void write(ByteBuf buf); static ShortString parse(ByteBuf buf); static ShortStr...