auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void testCaseWhenElse() throws DatabaseEngineException { test5Columns(); engine.persist("TEST", entry().set("COL1", 1).set("COL5", "teste") .build()); engine.persist("TEST", entry().set("COL1", 2).set("COL5", "TESTE") .build()); engine.persist("TEST", entry().set("COL1", 3).set("COL5", "TeStE") .build()); engine.persist("TEST", entry().set("COL1", 4).set("COL5", "teste") .build()); List<Map<String, ResultColumn>> query = engine.query( select(all(), caseElse(eq(column("COL5"), k("teste")), k("LOL"), k("ROFL")).alias("case")) .from(table("TEST")) ); assertEquals("COL5 must be LOL", "LOL", query.get(0).get("case").toString()); assertEquals("COL5 must be ROFL", "ROFL", query.get(1).get("case").toString()); assertEquals("COL5 must be ROFL", "ROFL", query.get(2).get("case").toString()); assertEquals("COL5 must be LOL", "LOL", query.get(3).get("case").toString()); }

Target:
public void testCaseWhenElse() throws DatabaseEngineException { test5Columns(); engine.persist("TEST", entry().set("COL1", 1).set("COL5", "teste") .build()); engine.persist("TEST", entry().set("COL1", 2).set("COL5", "xpto") .build()); engine.persist("TEST", entry().set("COL1", 3).set("COL5", "xpto") .build()); engine.persist("TEST", entry().set("COL1", 4).set("COL5", "teste") .build()); List<Map<String, ResultColumn>> result = engine.query( select(caseWhen().when(eq(column("COL5"), k("teste")), k("LOL")) .otherwise(k("ROFL")).alias("case")) .from(table("TEST")) ); assertEquals("COL5 must be LOL", "LOL", result.get(0).get("case").toString()); assertEquals("COL5 must be ROFL", "ROFL", result.get(1).get("case").toString()); assertEquals("COL5 must be ROFL", "ROFL", result.get(2).get("case").toString()); assertEquals("COL5 must be LOL", "LOL", result.get(3).get("case").toString()); }
Source:
public boolean processNextEvent() { if (queue.isEmpty() || status.get() == Status.RUNNING) { return false; } if (status.compareAndSet(Status.READY, Status.RUNNING)) { if (queue.isEmpty()) { status.set(Status.READY); return false; } final Tuple<MistEvent, Direction> event; synchronized (sharedLock) { event = queue.poll(); } process(event); status.set(Status.READY); if (operatorChainManager != null && !queue.isEmpty()) { operatorChainManager.insert(this); } return true; } else { return false; } }

Target:
public boolean processNextEvent() { if (queue.isEmpty() || status.get() == Status.RUNNING) { return false; } if (status.compareAndSet(Status.READY, Status.RUNNING)) { if (queue.isEmpty()) { status.set(Status.READY); return false; } final Tuple<MistEvent, Direction> event; synchronized (this) { event = queue.poll(); } process(event); status.set(Status.READY); if (operatorChainManager != null && !queue.isEmpty()) { operatorChainManager.insert(this); } return true; } else { return false; } }
Source:
protected boolean executeAnalysis(@Nullable final IProgressMonitor monitor) { IProgressMonitor mon = (monitor == null ? new NullProgressMonitor() : monitor); final ITmfStateProvider provider = createStateProvider(); String id = getId(); try { StateSystemBackendType backend = getBackendType(); String directory; File htFile; ITmfTrace trace = getTrace(); if (trace == null) { return false; } switch (backend) { case FULL: directory = TmfTraceManager.getSupplementaryFileDir(trace); htFile = new File(directory + getSsFileName()); createFullHistory(id, provider, htFile); break; case PARTIAL: directory = TmfTraceManager.getSupplementaryFileDir(trace); htFile = new File(directory + getSsFileName()); createPartialHistory(id, provider, htFile); break; case INMEM: createInMemoryHistory(id, provider); break; case NULL: createNullHistory(id, provider); break; default: break; } } catch (TmfTraceException e) { return false; } return !mon.isCanceled(); }

Target:
protected boolean executeAnalysis(@Nullable final IProgressMonitor monitor) { IProgressMonitor mon = (monitor == null ? new NullProgressMonitor() : monitor); final ITmfStateProvider provider = createStateProvider(); String id = getId(); try { StateSystemBackendType backend = getBackendType(); String directory; File htFile; ITmfTrace trace = getTrace(); if (trace == null) { fInitialized.countDown(); return false; } switch (backend) { case FULL: directory = TmfTraceManager.getSupplementaryFileDir(trace); htFile = new File(directory + getSsFileName()); createFullHistory(id, provider, htFile); break; case PARTIAL: directory = TmfTraceManager.getSupplementaryFileDir(trace); htFile = new File(directory + getSsFileName()); createPartialHistory(id, provider, htFile); break; case INMEM: createInMemoryHistory(id, provider); break; case NULL: createNullHistory(id, provider); break; default: break; } } catch (TmfTraceException e) { fInitialized.countDown(); return false; } return !mon.isCanceled(); }
Source:
protected void doFilterInternal(HttpServletRequest request, HttpServletResponse response, FilterChain chain) throws IOException, ServletException { final boolean debug = this.logger.isDebugEnabled(); try { UsernamePasswordAuthenticationToken authRequest = authenticationConverter.convert(request); if (authRequest == null) { chain.doFilter(request, response); return; } String username = authRequest.getName(); if (debug) { this.logger .debug("Basic Authentication Authorization header found for user '" + username + "'"); } if (authenticationIsRequired(username)) { Authentication authResult = this.authenticationManager .authenticate(authRequest); if (debug) { this.logger.debug("Authentication success: " + authResult); } SecurityContextHolder.getContext().setAuthentication(authResult); this.rememberMeServices.loginSuccess(request, response, authResult); onSuccessfulAuthentication(request, response, authResult); } } catch (AuthenticationException failed) { SecurityContextHolder.clearContext(); if (debug) { this.logger.debug("Authentication request for failed: " + failed, failed); } this.rememberMeServices.loginFail(request, response); onUnsuccessfulAuthentication(request, response, failed); if (this.ignoreFailure) { chain.doFilter(request, response); } else { this.authenticationEntryPoint.commence(request, response, failed); } return; } chain.doFilter(request, response); }

Target:
protected void doFilterInternal(HttpServletRequest request, HttpServletResponse response, FilterChain chain) throws IOException, ServletException { final boolean debug = this.logger.isDebugEnabled(); try { UsernamePasswordAuthenticationToken authRequest = authenticationConverter.convert(request); if (authRequest == null) { chain.doFilter(request, response); return; } String username = authRequest.getName(); if (debug) { this.logger .debug("Basic Authentication Authorization header found for user '" + username + "'"); } if (authenticationIsRequired(username)) { Authentication authResult = this.authenticationManager .authenticate(authRequest); if (debug) { this.logger.debug("Authentication success: " + authResult); } SecurityContextHolder.getContext().setAuthentication(authResult); this.rememberMeServices.loginSuccess(request, response, authResult); onSuccessfulAuthentication(request, response, authResult); } } catch (AuthenticationException failed) { SecurityContextHolder.clearContext(); if (debug) { this.logger.debug("Authentication request for failed!", failed); } this.rememberMeServices.loginFail(request, response); onUnsuccessfulAuthentication(request, response, failed); if (this.ignoreFailure) { chain.doFilter(request, response); } else { this.authenticationEntryPoint.commence(request, response, failed); } return; } chain.doFilter(request, response); }
Source:
private FilterExpression parseQuotedContent(QualifierType type, Token token) { String keywords = token.getValue(); keywords = keywords.substring(1, keywords.length() - 1); return new Qualifier(type, keywords); }

Target:
private FilterExpression parseQuotedContent(QualifierType type, Token token) { String keywords = token.getValue(); return new Qualifier(type, Utility.stripQuotes(keywords)); }
Source:
public DefaultDevToolsFactory(final Config config) { _chromePath = config.getString("path"); _chromeArgs = ImmutableMap.copyOf(config.getObject("args").unwrapped()); _executor = createExecutorService(config.getConfig("executor")); _service = Suppliers.memoize(this::createService); }

Target:
public DefaultDevToolsFactory(final Config config) { _chromePath = config.getString("path"); _chromeArgs = ImmutableMap.copyOf(config.getObject("args").unwrapped()); _executor = createExecutorService(config.hasPath("executor") ? config.getConfig("executor") : ConfigFactory.empty()); _service = Suppliers.memoize(this::createService); }
Source:
Object saveLabel(@PathVariable("pid") String pid, @RequestParam("label") String label) throws IngestException { if (label != null && label.trim().length() > 0) { try { PremisEventLogger logger = new PremisEventLogger(pid); PID pidObject = new PID(pid); this.client.modifyObject(pidObject, label, null, null, null); Element event = logger.logEvent(PremisEventLogger.Type.NORMALIZATION, "Object renamed to " + label, pidObject); PremisEventLogger.addDetailedOutcome(event, "success", "Message: Object renamed successfully", null); this.client.writePremisEventsToFedoraObject(logger, pidObject); } catch (FedoraException e) { throw new IngestException("Could not update label for " + pid, e); } } else { Map <String, String> response = new HashMap<>(); response.put("message", "error"); return response ; } Map <String, String> response = new HashMap<>(); response.put("message", "success"); return response; }

Target:
Object saveLabel(@PathVariable("pid") String pid, @RequestParam("label") String label) throws IngestException { if (label != null && label.trim().length() > 0) { try { PremisEventLogger logger = new PremisEventLogger(pid); PID pidObject = new PID(pid); this.client.modifyObject(pidObject, label, null, null, null); Element event = logger.logEvent(PremisEventLogger.Type.MIGRATION, "Object renamed to " + label, pidObject); PremisEventLogger.addDetailedOutcome(event, "success", "Object renamed successfully", null); this.client.writePremisEventsToFedoraObject(logger, pidObject); } catch (FedoraException e) { throw new IngestException("Could not update label for " + pid, e); } } else { Map <String, String> response = new HashMap<>(); response.put("message", "error"); return response ; } Map <String, String> response = new HashMap<>(); response.put("message", "success"); return response; }
Source:
public void handleError(HttpCommand command, HttpResponse response) { String message = parseMessage(response); Exception exception = null; try { message = message != null ? message : String.format("%s -> %s", command.getCurrentRequest().getRequestLine(), response.getStatusLine()); switch (response.getStatusCode()) { case 400: exception = new IllegalArgumentException(message); break; case 404: if (command.getCurrentRequest().getMethod().equals("DELETE")) { if (command.getCurrentRequest().getEndpoint().getPath().startsWith("/" + EtcdApiMetadata.API_VERSION + "/keys") && message.contains("Key not found")) { exception = new ResourceNotFoundException("Could not find key to delete: message=" + message, new HttpResponseException(command, response, message)); } } else if (command.getCurrentRequest().getMethod().equals("GET")) { if (command.getCurrentRequest().getEndpoint().getPath().startsWith("/" + EtcdApiMetadata.API_VERSION + "/keys") && message.contains("Key not found")) { exception = new ResourceNotFoundException("Could not find key: message=" + message, new HttpResponseException(command, response, message)); } } break; case 409: exception = new ResourceAlreadyExistsException(message); break; default: exception = new HttpResponseException(message, command, response); break; } } catch (Exception e) { exception = new HttpResponseException(command, response, e); } finally { if (exception == null) { exception = message != null ? new HttpResponseException(command, response, message) : new HttpResponseException(command, response); } closeQuietly(response.getPayload()); command.setException(exception); } }

Target:
public void handleError(HttpCommand command, HttpResponse response) { String message = parseMessage(response); Exception exception = null; try { message = message != null ? message : String.format("%s -> %s", command.getCurrentRequest().getRequestLine(), response.getStatusLine()); switch (response.getStatusCode()) { case 400: exception = new IllegalArgumentException(message); break; case 409: exception = new ResourceAlreadyExistsException(message); break; default: exception = new HttpResponseException(message, command, response); break; } } catch (Exception e) { exception = new HttpResponseException(command, response, e); } finally { if (exception == null) { exception = message != null ? new HttpResponseException(command, response, message) : new HttpResponseException(command, response); } closeQuietly(response.getPayload()); command.setException(exception); } }
Source:
protected Serializable copyHierRecursive(IdWithTypes source, Serializable parentId, String name, Serializable overwriteId, boolean resetVersion, Map<Serializable, Serializable> idMap, Map<Serializable, IdWithTypes> idToTypes, boolean excludeSpecialChildren) throws SQLException { idToTypes.put(source.id, source); Serializable newId; if (overwriteId == null) { newId = copyHier(source.id, parentId, name, resetVersion, idMap); } else { newId = overwriteId; idMap.put(source.id, newId); } boolean onlyComplex = parentId == null; for (IdWithTypes child : getChildrenIdsWithTypes(source.id, onlyComplex, excludeSpecialChildren)) { copyHierRecursive(child, newId, null, null, resetVersion, idMap, idToTypes, true); } return newId; }

Target:
protected Serializable copyHierRecursive(IdWithTypes source, Serializable parentId, String name, Serializable overwriteId, boolean resetVersion, Map<Serializable, Serializable> idMap, Map<Serializable, IdWithTypes> idToTypes, boolean excludeSpecialChildren) throws SQLException { idToTypes.put(source.id, source); Serializable newId; if (overwriteId == null) { newId = copyHier(source.id, parentId, name, resetVersion, idMap); } else { newId = overwriteId; idMap.put(source.id, newId); } boolean excludeRegularChildren = parentId == null; for (IdWithTypes child : getChildrenIdsWithTypes(source.id, excludeSpecialChildren, excludeRegularChildren)) { copyHierRecursive(child, newId, null, null, resetVersion, idMap, idToTypes, excludeSpecialChildren); } return newId; }
Source:
public void should_fail_if_actual_is_null() { assertThatExceptionOfType(AssertionError.class).isThrownBy(() -> maps.assertAnySatisfy(someInfo(), null, (team, player) -> { })) .withMessage(actualIsNull()); }

Target:
public void should_fail_if_actual_is_null() { AssertionError error = expectAssertionError(() -> maps.assertAnySatisfy(someInfo(), null, (team, player) -> { })); assertThat(error).hasMessage(actualIsNull()); }
Source:
public List<CitationCollectionOrder> getNestedCollectionAsList(String citationCollectionId){ return null; }

Target:
public List<CitationCollectionOrder> getNestedCollectionAsList(String citationCollectionId){ return (List<CitationCollectionOrder>) m_citationCollections; }
Source:
public void notifyOfConnection( int hostId, SocketChannel socket, InetSocketAddress listeningAddress) throws Exception { m_networkLog.info("Host " + getHostId() + " receives a new connection from host " + hostId); prepSocketChannel(socket); ForeignHost fhost = new ForeignHost(this, hostId, socket, Integer.MAX_VALUE, listeningAddress, new PicoNetwork(socket, true)); putForeignHost(hostId, fhost); fhost.enableRead(VERBOTEN_THREADS); boolean ready = true; for (int peer : m_peers) { ready = ready && m_foreignHosts.get(peer).size() == (m_secondaryConnections + 1); } if (ready) { m_hasAllSecondaryConnectionCreated = true; } }

Target:
public void notifyOfConnection( int hostId, SocketChannel socket, InetSocketAddress listeningAddress) throws Exception { networkLog.info("Host " + getHostId() + " receives a new connection from host " + hostId); prepSocketChannel(socket); ForeignHost fhost = new ForeignHost(this, hostId, socket, Integer.MAX_VALUE, listeningAddress, new PicoNetwork(socket, true)); putForeignHost(hostId, fhost); fhost.enableRead(VERBOTEN_THREADS); for (int hId : m_peers) { if (m_foreignHosts.get(hId).size() != (m_secondaryConnections + 1)) { return; } } m_hasAllSecondaryConnectionCreated = true; }
Source:
CompletableFuture<AggregatedHttpResponse> sendRequest() { final HttpResponse response; try (SafeCloseable ignored = Clients.withContextCustomizer(ctx -> ctx.attr(NAME).set(name))) { response = httpClient.execute(request); } CompletableFuture<AggregatedHttpResponse> responseFuture = RequestContext.mapCurrent( ctx -> response.aggregateWithPooledObjects(ctx.eventLoop(), ctx.alloc()), response::aggregate); responseFuture = responseFuture.exceptionally(t -> { if (t instanceof UnprocessedRequestException) { Throwable cause = t.getCause(); Exceptions.clearTrace(cause); throw new RejectedExecutionException("Could not process request.", cause); } else { Exceptions.throwUnsafely(t); } return null; }); this.responseFuture = responseFuture; return responseFuture; }

Target:
CompletableFuture<AggregatedHttpResponse> sendRequest() { final HttpResponse response; try (SafeCloseable ignored = Clients.withContextCustomizer(ctx -> ctx.attr(NAME).set(name))) { response = httpClient.execute(request); } CompletableFuture<AggregatedHttpResponse> responseFuture = RequestContext.mapCurrent( ctx -> response.aggregateWithPooledObjects(ctx.eventLoop(), ctx.alloc()), response::aggregate); responseFuture = responseFuture.exceptionally(t -> { if (t instanceof UnprocessedRequestException) { Throwable cause = t.getCause(); Exceptions.clearTrace(cause); throw new RejectedExecutionException("Rejected execution: " + cause.getMessage(), cause); } else { Exceptions.throwUnsafely(t); } return null; }); this.responseFuture = responseFuture; return responseFuture; }
Source:
public void added(ModuleType moduleType) { Set<String> notInitailizedRules = new HashSet<String>(20); String moduleTypeName = moduleType.getUID(); Set<String> rules = null; synchronized (this) { Set<String> rulesPerModule = mapModuleTypeToRules.get(moduleTypeName); if (rulesPerModule != null) { rules = new HashSet<String>(); rules.addAll(rulesPerModule); } } if (rules != null) { for (String rUID : rules) { RuleStatus ruleStatus = getRuleStatus(rUID); if (ruleStatus == RuleStatus.NOT_INITIALIZED) { notInitailizedRules.add(rUID); } } } if (notInitailizedRules != null) { for (String rUID : notInitailizedRules) { scheduleRuleInitialization(rUID); } } }

Target:
public void added(ModuleType moduleType) { String moduleTypeName = moduleType.getUID(); Set<String> rules = null; synchronized (this) { Set<String> rulesPerModule = mapModuleTypeToRules.get(moduleTypeName); if (rulesPerModule != null) { rules = new HashSet<String>(); rules.addAll(rulesPerModule); } } if (rules != null) { for (String rUID : rules) { RuleStatus ruleStatus = getRuleStatus(rUID); if (ruleStatus == RuleStatus.NOT_INITIALIZED) { scheduleRuleInitialization(rUID); } } } }
Source:
public static void register(final DataProviderRegistrator registrator) { registrator .asImmutable(BlockState.class) .create(Keys.DIRECTION) .get(h -> DirectionUtils.getFor(h.get(AbstractFurnaceBlock.FACING))) .set((h, v) -> DirectionUtils.set(h, v, AbstractFurnaceBlock.FACING)) .supports(AbstractFurnaceBlock.class::isInstance) .create(Keys.IS_LIT) .get(h -> h.get(AbstractFurnaceBlock.LIT)) .set((h, v) -> h.with(AbstractFurnaceBlock.LIT, v)) .supports(AbstractFurnaceBlock.class::isInstance); }

Target:
public static void register(final DataProviderRegistrator registrator) { registrator .asImmutable(BlockState.class) .create(Keys.DIRECTION) .get(h -> DirectionUtils.getFor(h.get(AbstractFurnaceBlock.FACING))) .set((h, v) -> DirectionUtils.set(h, v, AbstractFurnaceBlock.FACING)) .supports(h -> h.getBlock() instanceof AbstractFurnaceBlock) .create(Keys.IS_LIT) .get(h -> h.get(AbstractFurnaceBlock.LIT)) .set((h, v) -> h.with(AbstractFurnaceBlock.LIT, v)) .supports(h -> h.getBlock() instanceof AbstractFurnaceBlock); }
Source:
protected String getMarkerMessage() throws CoreException { IMarker marker = this.getMarker(); int bp_line = 0; int bp_request_line = 0; String bp_file = null; String bp_reqest_file = null; if (marker != null) { bp_line = marker.getAttribute(IMarker.LINE_NUMBER, -1); bp_request_line = marker.getAttribute(ICLineBreakpoint2.REQUESTED_LINE, -1); bp_file = marker.getAttribute(ICBreakpoint.SOURCE_HANDLE, (String)null); bp_reqest_file = marker.getAttribute(ICLineBreakpoint2.REQUESTED_SOURCE_HANDLE, (String)null); } if (bp_line != bp_request_line || (bp_file == null && bp_reqest_file != null) || (bp_file != null && !bp_file.equals(bp_reqest_file)) ) { StringBuffer label = new StringBuffer(); if (bp_file != null && !bp_file.equals(bp_reqest_file)) { IPath path = new Path(bp_reqest_file); if (path.isValidPath(bp_reqest_file)) { label.append(path.lastSegment()); } label.append(' '); } label.append(MessageFormat.format(DebugCoreMessages.getString("CDebugUtils.0"), (Object[])new String[]{ Integer.toString(bp_request_line) })); return MessageFormat.format( BreakpointMessages.getString( "CLineBreakpoint.1" ), (Object[])new String[] { label.toString(), CDebugUtils.getBreakpointText( this, false ) } ); } else { return MessageFormat.format( BreakpointMessages.getString( "CLineBreakpoint.0" ), (Object[])new String[] { CDebugUtils.getBreakpointText( this, false ) } ); } }

Target:
protected String getMarkerMessage() throws CoreException { return MessageFormat.format( BreakpointMessages.getString( "CLineBreakpoint.0" ), (Object[])new String[] { CDebugUtils.getBreakpointText( this, false ) } ); }
Source:
private void checkIfEmxEntityType(EntityType entityType) { String entityName = entityType.getId(); String packageName = entityType.getPackage() != null ? entityType.getPackage().getId() : ""; if (!(packageName.isEmpty() || entityName.startsWith(packageName))) { throw new InvalidEntityIdentifierException(entityName); } }

Target:
private void checkIfEmxEntityType(EntityType entityType) { String entityTypeId = entityType.getId(); String packageName = entityType.getPackage() != null ? entityType.getPackage().getId() : null; if (!(Strings.isNullOrEmpty(packageName) || entityTypeId.startsWith(packageName))) { throw new InvalidEmxIdentifierException(entityTypeId); } }
Source:
public void validateRemoveTagsWhenExists() { List<ResourceTag> resourceTags = Arrays.asList(new ResourceTagVO("test", "test", 1l, 2l, 2l, ResourceTag.ResourceObjectType.UserVm, "", "test")); Map<String, String> tags = new HashMap<>(); List<String> resourceIds = Arrays.asList("123"); Mockito.when(taggedResourceManagerMock.getUuid("123", ResourceTag.ResourceObjectType.UserVm)).thenReturn("123"); Mockito.when(taggedResourceManagerMock.deleteTags(resourceIds, ResourceTag.ResourceObjectType.UserVm, tags)).thenReturn(true); Mockito.<List<? extends ResourceTag>>when(taggedResourceManagerMock.listByResourceTypeAndId(ResourceTag.ResourceObjectType.UserVm, 0)).thenReturn(resourceTags); Mockito.when(userVmVoMock.getUuid()).thenReturn("123"); Mockito.when(userVmDao.findById(Mockito.eq(vmId))).thenReturn(userVmVoMock); userVmManagerImpl.removeTagsFromVm(1l); }

Target:
public void validateRemoveTagsWhenExists() { List<ResourceTag> resourceTags = Arrays.asList(new ResourceTagVO("test", "test", 1l, 2l, Long.valueOf(123), ResourceTag.ResourceObjectType.UserVm, "", "test")); List<String> resourceIds = Arrays.asList("123"); Mockito.when(taggedResourceManagerMock.getUuid("123", ResourceTag.ResourceObjectType.UserVm)).thenReturn("123"); Mockito.when(taggedResourceManagerMock.getResourceId("123", ResourceTag.ResourceObjectType.UserVm)).thenReturn(Long.valueOf(123)); Mockito.<List<? extends ResourceTag>>when(taggedResourceManagerMock.listByResourceTypeAndId(ResourceTag.ResourceObjectType.UserVm, Long.valueOf(123))).thenReturn(resourceTags); Mockito.when(taggedResourceManagerMock.deleteTags(resourceIds, ResourceTag.ResourceObjectType.UserVm, null)).thenReturn(true); Mockito.when(userVmDao.findById(123l)).thenReturn(userVmVoMock); Mockito.when(userVmVoMock.getUuid()).thenReturn("123"); userVmManagerImpl.removeTagsFromVm(Long.valueOf(123)); Assert.assertTrue(taggedResourceManagerMock.deleteTags(resourceIds, ResourceTag.ResourceObjectType.UserVm, null)); }
Source:
public Matrix removeColumn(int j) { return removeColumn(j, this.factory); }

Target:
public Matrix removeColumn(int j) { return removeColumn(j, factory); }
Source:
private boolean isEntireColumn(Subfield subfield) { return subfield.getPath().isEmpty(); }

Target:
private static boolean isEntireColumn(Subfield subfield) { return subfield.getPath().isEmpty(); }
Source:
public void configure() throws Exception { String mimetypePattern = "^(text/|application/pdf|application/msword" + "|application/vnd\\.|application/rtf|application/powerpoint" + "|application/postscript).*$"; from("direct-vm:extractFulltext") .routeId("CdrServiceFulltextExtraction") .log(LoggingLevel.DEBUG, "Calling text extraction route for ${headers[org.fcrepo.jms.identifier]}") .filter(simple("${headers[MimeType]} regex '" + mimetypePattern + "'")) .log(LoggingLevel.INFO, "Extracting text from ${headers[org.fcrepo.jms.identifier]}" + " of type ${headers[MimeType]}") .to("direct:fulltext.extraction"); from("direct:fulltext.extraction") .routeId("ExtractingText") .log(LoggingLevel.INFO, "Extracting full text for ${headers[binaryPath]}") .bean(ftProcessor); }

Target:
public void configure() throws Exception { onException(Exception.class) .redeliveryDelay("{{error.retryDelay}}") .maximumRedeliveries("{{error.maxRedeliveries}}") .backOffMultiplier(2) .retryAttemptedLogLevel(LoggingLevel.WARN); from("direct-vm:extractFulltext") .routeId("CdrServiceFulltextExtraction") .log(LoggingLevel.DEBUG, "Calling text extraction route for ${headers[org.fcrepo.jms.identifier]}") .filter(simple("${headers[MimeType]} regex '" + MIMETYPE_PATTERN + "'")) .log(LoggingLevel.INFO, "Extracting text from ${headers[org.fcrepo.jms.identifier]}" + " of type ${headers[MimeType]}") .to("direct:fulltext.extraction"); from("direct:fulltext.extraction") .routeId("ExtractingText") .log(LoggingLevel.INFO, "Extracting full text for ${headers[binaryPath]}") .bean(ftProcessor); }
Source:
public void testGetGridLayer() { final DMNGridLayer gridLayer = control.getGridLayer(); assertEquals(gridLayer, control.getGridLayer()); }

Target:
public void testGetGridLayer() { final DMNGridLayer gridLayer = control.getGridLayer(); assertEquals("GridLayer instances should be identical.", gridLayer, control.getGridLayer()); }
Source:
public String apply(Entity input) { String hostname = input.getAttribute(getConfig(HOSTNAME_SENSOR)); hostname = DOMAIN_NAME_FIRST_CHAR_MATCHER.negate().trimFrom(hostname); return DOMAIN_NAME_MATCHER.retainFrom(hostname); }

Target:
public String apply(Entity input) { String hostname = input.getAttribute(getConfig(HOSTNAME_SENSOR)); hostname = DOMAIN_NAME_FIRST_CHAR_MATCHER.negate().trimFrom(hostname); hostname = DOMAIN_NAME_MATCHER.negate().trimAndCollapseFrom(hostname, '-'); if (hostname.length() > 63) { hostname = hostname.substring(0, 63); } return hostname; }
Source:
public JettyWorkDirValidator() { systemEnvironment = new SystemEnvironment(); }

Target:
public JettyWorkDirValidator() { this(new SystemEnvironment()); }
Source:
private void addSellOrder(Order order) { SellOrder s = (SellOrder) order; if (sellOrders.containsKey(s.getStockSymbol())) { ArrayList<Order> temp = sellOrders.get(s.getStockSymbol()); temp.add(s); sellOrders.put(s.getStockSymbol(), temp); } else { ArrayList<Order> temp = new ArrayList<Order>(); temp.add(s); sellOrders.put(s.getStockSymbol(), temp); } }

Target:
private void addSellOrder(Order order) { SellOrder sellOrderToAdd = (SellOrder) order; if (sellOrders.containsKey(s.getStockSymbol())) { ArrayList<Order> temp = sellOrders.get(s.getStockSymbol()); temp.add(s); sellOrders.put(s.getStockSymbol(), temp); } else { ArrayList<Order> temp = new ArrayList<Order>(); temp.add(s); sellOrders.put(s.getStockSymbol(), temp); } }
Source:
public final void handlePacket(SeekableLittleEndianAccessor slea, MapleClient c) { slea.readInt(); int birthday = slea.readInt(); if (!CashOperationHandler.checkBirthday(c, birthday)) { c.announce(MaplePacketCreator.showCashShopMessage((byte) 0xC4)); c.announce(MaplePacketCreator.enableActions()); return; } if(!ServerConstants.ALLOW_CASHSHOP_NAME_CHANGE) { c.announce(MaplePacketCreator.sendNameTransferRules(4)); return; } MapleCharacter chr = c.getPlayer(); if(chr.getLevel() < 10) { c.announce(MaplePacketCreator.sendNameTransferRules(4)); return; } else if(c.getTempBanCalendar() != null && c.getTempBanCalendar().getTimeInMillis() + (30*24*60*60*1000) < Calendar.getInstance().getTimeInMillis()) { c.announce(MaplePacketCreator.sendNameTransferRules(2)); return; } try (Connection con = DatabaseConnection.getConnection(); PreparedStatement ps = con.prepareStatement("SELECT completionTime FROM namechanges WHERE characterid=?")) { ps.setInt(1, chr.getId()); ResultSet rs = ps.executeQuery(); while(rs.next()) { Timestamp completedTimestamp = rs.getTimestamp("completionTime"); if(completedTimestamp == null) { c.announce(MaplePacketCreator.sendNameTransferRules(1)); return; } else if(completedTimestamp.getTime() + ServerConstants.NAME_CHANGE_COOLDOWN > System.currentTimeMillis()) { c.announce(MaplePacketCreator.sendNameTransferRules(3)); return; }; } } catch(SQLException e) { e.printStackTrace(); } c.announce(MaplePacketCreator.sendNameTransferRules(0)); }

Target:
public final void handlePacket(SeekableLittleEndianAccessor slea, MapleClient c) { slea.readInt(); int birthday = slea.readInt(); if (!CashOperationHandler.checkBirthday(c, birthday)) { c.announce(MaplePacketCreator.showCashShopMessage((byte) 0xC4)); c.announce(MaplePacketCreator.enableActions()); return; } if(!ServerConstants.ALLOW_CASHSHOP_NAME_CHANGE) { c.announce(MaplePacketCreator.sendNameTransferRules(4)); return; } MapleCharacter chr = c.getPlayer(); if(chr.getLevel() < 10) { c.announce(MaplePacketCreator.sendNameTransferRules(4)); return; } else if(c.getTempBanCalendar() != null && c.getTempBanCalendar().getTimeInMillis() + (30*24*60*60*1000) < Calendar.getInstance().getTimeInMillis()) { c.announce(MaplePacketCreator.sendNameTransferRules(2)); return; } try (Connection con = DatabaseConnection.getConnection(); PreparedStatement ps = con.prepareStatement("SELECT completionTime FROM namechanges WHERE characterid=?")) { ps.setInt(1, chr.getId()); ResultSet rs = ps.executeQuery(); while(rs.next()) { Timestamp completedTimestamp = rs.getTimestamp("completionTime"); if(completedTimestamp == null) { c.announce(MaplePacketCreator.sendNameTransferRules(1)); return; } else if(completedTimestamp.getTime() + ServerConstants.NAME_CHANGE_COOLDOWN > System.currentTimeMillis()) { c.announce(MaplePacketCreator.sendNameTransferRules(3)); return; }; } } catch(SQLException e) { e.printStackTrace(); return; } c.announce(MaplePacketCreator.sendNameTransferRules(0)); }
Source:
private void updateIndex(String indexName, List<FieldSort> fieldNames) throws QueryException { Misc.checkNotNullOrEmpty(indexName, "indexName"); Changes changes; long lastSequence = sequenceNumberForIndex(indexName); try { do { changes = database.changes(lastSequence, 10000); updateIndex(indexName, fieldNames, changes, lastSequence); lastSequence = changes.getLastSequence(); } while (changes.size() > 0); } catch (DocumentStoreException e) { String message = String.format(Locale.ENGLISH, "Failed to get changes feed from %d", lastSequence); logger.log(Level.SEVERE, message, e); throw new QueryException(e.getCause()); } }

Target:
private void updateIndex(String indexName, List<FieldSort> fieldNames) throws QueryException { Misc.checkNotNullOrEmpty(indexName, "indexName"); Changes changes; long lastSequence = sequenceNumberForIndex(indexName); try { do { changes = database.changes(lastSequence, 10000); updateIndex(indexName, fieldNames, changes, lastSequence); lastSequence = changes.getLastSequence(); } while (changes.size() > 0); } catch (DocumentStoreException e) { String message = String.format(Locale.ENGLISH, "Failed to get changes feed from %d", lastSequence); logger.log(Level.SEVERE, message, e); throw new QueryException(message, e.getCause()); } }
Source:
public void testShareable() { Shareable myShareable = new Shareable() { @Override public Shareable copy() { return this; } }; JsonObject json = new JsonObject(); json.put("0", myShareable); assertEquals(myShareable, json.getValue("0")); assertSame(myShareable, json.getValue("0")); JsonObject json2 = json.copy(); }

Target:
public void testShareable() { final AtomicInteger cnt = new AtomicInteger(0); Shareable myShareable = new Shareable() { @Override public Shareable copy() { cnt.incrementAndGet(); return this; } }; JsonObject json = new JsonObject(); json.put("0", myShareable); assertEquals(myShareable, json.getValue("0")); assertSame(myShareable, json.getValue("0")); assertEquals(0, cnt.get()); JsonObject json2 = json.copy(); assertEquals(1, cnt.get()); assertEquals(myShareable, json2.getValue("0")); assertSame(myShareable, json2.getValue("0")); }
Source:
public List<Credential> fromRequest(final HttpServletRequest request, final MultiValueMap<String, String> requestBody) { if (requestBody == null || requestBody.isEmpty()) { LOGGER.debug("Skipping because the requestBody is null or empty", this); return new ArrayList<>(0); } final String token = requestBody.getFirst(PARAMETER_NAME_GAUTH_OTP); LOGGER.debug("Google authenticator token in the request body: [{}]", token); if (StringUtils.isBlank(token)) { return new ArrayList<>(0); } return CollectionUtils.wrap(new GoogleAuthenticatorTokenCredential(token)); }

Target:
public List<Credential> fromRequest(final HttpServletRequest request, final MultiValueMap<String, String> requestBody) { if (requestBody == null || requestBody.isEmpty()) { LOGGER.debug("Skipping because the requestBody is null or empty", getClass().getSimpleName()); return new ArrayList<>(0); } final String token = requestBody.getFirst(PARAMETER_NAME_GAUTH_OTP); LOGGER.debug("Google authenticator token in the request body: [{}]", token); if (StringUtils.isBlank(token)) { return new ArrayList<>(0); } return CollectionUtils.wrap(new GoogleAuthenticatorTokenCredential(token)); }
Source:
public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } TimeShareFilter that = (TimeShareFilter) o; return (mode == that.mode) && (Double.compare(that.minShare, minShare) == 0); }

Target:
public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; TimeShareFilter that = (TimeShareFilter) o; return (mode == that.mode) && (Double.compare(that.minShare, minShare) == 0); }
Source:
protected void decode(ChannelHandlerContext ctx, ByteBuf buffer, List<Object> out) throws Exception { if (buffer.readableBytes() < 1) return; int version = buffer.getByte(0); version = version & 0x7F; DecoderForStreamIdSize decoder = decoderForStreamIdSize.get(); if (decoder == null) { decoder = new DecoderForStreamIdSize(version, version >= 3 ? 2 : 1); if (!decoderForStreamIdSize.compareAndSet(null, decoder)) { decoder = decoderForStreamIdSize.get(); } } assert decoder.protocolVersion == version; Object frame = decoder.decode(ctx, buffer); if (frame != null) out.add(frame); }

Target:
protected void decode(ChannelHandlerContext ctx, ByteBuf buffer, List<Object> out) throws Exception { if (buffer.readableBytes() < 1) return; if (decoder == null) { int version = buffer.getByte(buffer.readerIndex()); version = version & 0x7F; decoder = new DecoderForStreamIdSize(version, version >= 3 ? 2 : 1); } Object frame = decoder.decode(ctx, buffer); if (frame != null) out.add(frame); }
Source:
private void initializeLoader(StoreConfiguration cfg, CacheLoader loader, InitializationContextImpl ctx) { if (loader != null) { if (loader instanceof DelegatingCacheLoader) loader.init(ctx); storesMutex.writeLock().lock(); try { loaders.add(loader); long interval = configuration.persistence().availabilityInterval(); ConnectableObservable<StoreAvailability> observable = Observable.interval(interval, TimeUnit.MILLISECONDS, Schedulers.from(persistenceExecutor)) .map(t -> new StoreAvailability(loader, loader.isAvailable())) .doOnError(err -> log.debugf("Error encountered when calling isAvailable on %s: %s", loader, err)) .retry() .publish(); storeStatuses.put(loader, new StoreStatus(cfg, observable)); } finally { storesMutex.writeLock().unlock(); } } }

Target:
private void initializeLoader(StoreConfiguration cfg, CacheLoader loader, InitializationContextImpl ctx) { if (loader != null) { if (loader instanceof DelegatingCacheLoader) loader.init(ctx); storesMutex.writeLock().lock(); try { loaders.add(loader); storeStatuses.put(loader, new StoreStatus(loader, cfg)); } finally { storesMutex.writeLock().unlock(); } } }
Source:
private void addExternalNames(DetailedSample sample, SampleIdentity identityCopy) throws IOException { if (identityCopy == null || identityCopy.getExternalName() == null) return; SampleIdentity identity = (SampleIdentity) get(getIdentity(sample).getId()); Set<String> identityExternalNames = SampleIdentityImpl.getSetFromString(identity.getExternalName()); Set<String> tempExternalNames = SampleIdentityImpl.getSetFromString(identityCopy.getExternalName()); Set<String> lowerCaseIdentityExternalNames = identityExternalNames.stream().map(String::toLowerCase).collect(Collectors.toSet()); tempExternalNames.stream().forEach(name -> { try { if (!lowerCaseIdentityExternalNames.contains(name.toLowerCase()) && !(isUniqueExternalNameWithinProjectRequired() && (identity.getProject() == null || getIdentitiesByExternalNameOrAliasAndProject(name, identity.getProject().getId(), true).size() > 0))) { identityExternalNames.add(name); } } catch (IOException e) { log.error("Failed to retrieve all external names: " + e); } }); identity.setExternalName(String.join(",", identityExternalNames)); if (identityExternalNames.size() > lowerCaseIdentityExternalNames.size()) { sampleStore.update(identity); } }

Target:
private void addExternalNames(DetailedSample sample, SampleIdentity identityCopy) throws IOException { if (identityCopy == null || identityCopy.getExternalName() == null) return; SampleIdentity identity = (SampleIdentity) get(getIdentity(sample).getId()); Set<String> identityExternalNames = SampleIdentityImpl.getSetFromString(identity.getExternalName()); Set<String> tempExternalNames = SampleIdentityImpl.getSetFromString(identityCopy.getExternalName()); Set<String> lowerCaseIdentityExternalNames = identityExternalNames.stream().map(String::toLowerCase).collect(Collectors.toSet()); tempExternalNames.stream().forEach(name -> { try { if (!lowerCaseIdentityExternalNames.contains(name.toLowerCase()) && !(isUniqueExternalNameWithinProjectRequired() && (identity.getProject() == null || getIdentitiesByExternalNameOrAliasAndProject(name, identity.getProject().getId(), true).size() > 0))) { identityExternalNames.add(name); } } catch (IOException e) { log.error("Failed to retrieve all external names: " + e); } }); identity.setExternalName(String.join(",", identityExternalNames)); if (identityExternalNames.size() > lowerCaseIdentityExternalNames.size()) { setChangeDetails(identity); sampleStore.update(identity); } }
Source:
protected String getRouteURL(List<String> urls) { return urls.stream().filter(this::isInternalDomain).findFirst().orElse(""); }

Target:
protected String getRouteURL(List<String> urls) { for (String url : urls) { if (isInternalDomain(url)) { return url; } } return ""; }
Source:
public boolean equals(Object other) { if (other instanceof ImapFolder) { return other.hashCode() == hashCode() ; } return super.equals(other); }

Target:
public boolean equals(Object other) { if (other instanceof ImapFolder) { ImapFolder otherFolder = (ImapFolder) other; if (otherFolder.getName().equalsIgnoreCase("INBOX")) { return otherFolder.getName().equalsIgnoreCase(getName()); } return otherFolder.getName().equals(getName()); } return super.equals(other); }
Source:
public void processDataObject( DataObject dataObject, DataModel dataModel ) { if ( dataModel != null ) { boolean hasPlanningEntity = dataObject.getAnnotation( PlannerDomainAnnotations.PLANNING_ENTITY_ANNOTATION ) != null; boolean hasComparatorDefinition = dataObject.getAnnotation( ComparatorDefinition.class.getName() ) != null; if ( hasPlanningEntity && hasComparatorDefinition ) { try { ComparatorObject comparatorObject = plannerDataObjectEditorService.extractComparatorObject( dataObject, dataModel ); dataObject.getNestedClasses().clear(); dataObject.getNestedClasses().add( comparatorObject ); } catch ( Exception e ) { logger.error( "Unable to extract comparator object from " + dataObject.getClassName() ); } } } }

Target:
public void processDataObject( DataObject dataObject, DataModel dataModel ) { if ( dataObject != null ) { boolean hasPlanningEntity = dataObject.getAnnotation( PlannerDomainAnnotations.PLANNING_ENTITY_ANNOTATION ) != null; boolean hasComparatorDefinition = dataObject.getAnnotation( ComparatorDefinition.class.getName() ) != null; if ( hasPlanningEntity && hasComparatorDefinition ) { try { ComparatorObject comparatorObject = plannerDataObjectEditorService.extractComparatorObject( dataObject, dataModel ); dataObject.getNestedClasses().clear(); dataObject.getNestedClasses().add( comparatorObject ); } catch ( Exception e ) { logger.error( "Unable to extract comparator object from " + dataObject.getClassName() ); } } } }
Source:
public SchedulerRestClient(String restEndpointURL, ClientHttpEngine httpEngine) { if (sslContext == null) { setBlindTrustSSLContext(); } if (httpEngine == null) { SSLConnectionSocketFactory sslConnectionSocketFactory = new SSLConnectionSocketFactory(sslContext, NoopHostnameVerifier.INSTANCE); HttpClient httpClient = HttpClientBuilder.create().setSSLSocketFactory(sslConnectionSocketFactory).build(); httpEngine = new ApacheHttpClient4Engine(httpClient); } this.httpEngine = httpEngine; this.restEndpointURL = restEndpointURL; providerFactory = ResteasyProviderFactory.getInstance(); if (!providerFactory.isRegistered(JacksonContextResolver.class)) { providerFactory.registerProvider(JacksonContextResolver.class); } registerGzipEncoding(providerFactory); scheduler = createRestProxy(providerFactory, restEndpointURL, httpEngine); }

Target:
public SchedulerRestClient(String restEndpointURL, ClientHttpEngine httpEngine) { if (httpEngine == null) { setBlindTrustSSLContext(); SSLConnectionSocketFactory sslConnectionSocketFactory = new SSLConnectionSocketFactory(sslContext, NoopHostnameVerifier.INSTANCE); HttpClient httpClient = HttpClientBuilder.create().setSSLSocketFactory(sslConnectionSocketFactory).build(); httpEngine = new ApacheHttpClient4Engine(httpClient); } this.httpEngine = httpEngine; this.restEndpointURL = restEndpointURL; providerFactory = ResteasyProviderFactory.getInstance(); if (!providerFactory.isRegistered(JacksonContextResolver.class)) { providerFactory.registerProvider(JacksonContextResolver.class); } registerGzipEncoding(providerFactory); scheduler = createRestProxy(providerFactory, restEndpointURL, httpEngine); }
Source:
public AuditLogType getAuditLogTypeValue() { if(getSucceeded()) return AuditLogType.GLUSTER_VOLUME_GEO_REP_PAUSE; else return AuditLogType.GLUSTER_VOLUME_GEO_REP_PAUSE_FAILED; }

Target:
public AuditLogType getAuditLogTypeValue() { if (getSucceeded()) { return AuditLogType.GLUSTER_VOLUME_GEO_REP_PAUSE; } else { return AuditLogType.GLUSTER_VOLUME_GEO_REP_PAUSE_FAILED; } }
Source:
public void testCreate() throws Exception { server.enqueue(jsonResponse("/storageCreateResponse.json")); final StorageAccountApi storageAPI = api.getStorageAccountApi(resourceGroup); assertEquals(storageAPI.create("name-of-storage-account", "westus", ImmutableMap.of("property_name", "property_value"), ImmutableMap.of("accountType", StorageService.AccountType.Premium_LRS.toString())), getCreateResponse()); assertSent(server, "PUT", "/subscriptions/" + subsriptionId + "/resourcegroups/resourceGroup/providers/Microsoft.Storage/" + "storageAccounts/name-of-storage-account?api-version=2015-06-15"); }

Target:
public void testCreate() throws Exception { final StorageAccountApi storageAPI = api.getStorageAccountApi(resourceGroup); server.enqueue(response202WithHeader()); URI uri = storageAPI.create("name-of-storage-account", "westus", ImmutableMap.of("property_name", "property_value"), ImmutableMap.of("accountType", StorageService.AccountType.Premium_LRS.toString())); assertNotNull(uri); assertSent(server, "PUT", "/subscriptions/" + subsriptionId + "/resourcegroups/resourceGroup/providers/Microsoft.Storage/" + "storageAccounts/name-of-storage-account?api-version=2015-06-15", String.format("{\"location\":\"westus\",\"tags\":{\"property_name\":\"property_value\"},\"properties\":{\"accountType\":\"Premium_LRS\"}}")); }
Source:
private boolean checkAddressMatch(List<String> addresses, String host, int port) { for (String address : addresses) { try { if (NetUtils.matchIpExpression(address, host, port)) { return true; } if ((ALL_IP_MATCH + ":" + port).equals(address)) { return true; } } catch (UnknownHostException e) { logger.error("The format of ip address is invalid in tag route. Address :" + address, e); } catch (Exception e) { logger.error("The format of ip address is invalid in tag route. Address :" + address, e); } } return false; }

Target:
private boolean checkAddressMatch(List<String> addresses, String host, int port) { for (String address : addresses) { try { if (NetUtils.matchIpExpression(address, host, port)) { return true; } if ((ANYHOST_VALUE + ":" + port).equals(address)) { return true; } } catch (UnknownHostException e) { logger.error("The format of ip address is invalid in tag route. Address :" + address, e); } catch (Exception e) { logger.error("The format of ip address is invalid in tag route. Address :" + address, e); } } return false; }
Source:
@Test public void invalidSourceArgumentExecutorTest() { Path destination = Paths.get(System.getProperty("java.io.tmpdir")); executeConversion(null, destination); Path jarFilePath = TestConstants.SAMPLE_JAR_FILE.getFileName(); if (jarFilePath != null) { String jarFileName = getBundleSymbolicName(jarFilePath); String bundleName = jarFileName + "_1.0.0.jar"; Path bundlePath = Paths.get(destination.toString(), bundleName); Assert.assertFalse(Files.exists(bundlePath)); } else { assert false; } }

Target:
public void invalidSourceArgumentExecutorTest() { Path destination = Paths.get(System.getProperty("java.io.tmpdir")); executeConversion(null, destination); Path jarFilePath = TestConstants.SAMPLE_JAR_FILE.getFileName(); if (jarFilePath != null) { String jarFileName = getBundleSymbolicName(jarFilePath); String bundleName = jarFileName + "_1.0.0.jar"; Path bundlePath = Paths.get(destination.toString(), bundleName); Assert.assertFalse(Files.exists(bundlePath)); } else { assert false; } }
Source:
public void testIteratorBehavior3() throws Exception { h.insert("insert into something (id, name) values (1, 'eric')"); h.insert("insert into something (id, name) values (2, 'eric')"); assertThat(h.createQuery("select * from something order by id").mapToBean(Something.class)) .hasSize(2) .extracting(Something::getName) .containsOnly("eric"); }

Target:
public void testIteratorBehavior3() throws Exception { h.insert("insert into something (id, name) values (1, 'eric')"); h.insert("insert into something (id, name) values (2, 'eric')"); assertThat(h.createQuery("select * from something order by id").mapToBean(Something.class)) .extracting(Something::getName) .containsExactly("eric", "eric"); }
Source:
public PartitionCreator withDisplayNames(String[] displayNames){ descriptor.setValue(SIConstants.SCHEMA_DISPLAY_NAME_ATTR, displayNames[0]); descriptor.setValue(SIConstants.TABLE_DISPLAY_NAME_ATTR, displayNames[0] != null ? displayNames[0] : descriptor.getNameAsString()); descriptor.setValue(SIConstants.INDEX_DISPLAY_NAME_ATTR, displayNames[1]); return this; }

Target:
public PartitionCreator withDisplayNames(String[] displayNames){ descriptor.setValue(SIConstants.SCHEMA_DISPLAY_NAME_ATTR, displayNames[0]); descriptor.setValue(SIConstants.TABLE_DISPLAY_NAME_ATTR, displayNames[1] != null ? displayNames[1] : descriptor.getNameAsString()); descriptor.setValue(SIConstants.INDEX_DISPLAY_NAME_ATTR, displayNames[2]); return this; }