auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public static Map<String, String> postData(EndPointInfo endPointInfo, Map<String, String> headers) throws IDPTokenManagerException { HTTP_METHODS httpMethod = endPointInfo.getHttpMethod(); String url = endPointInfo.getEndPoint(); String params = ""; if(endPointInfo.getRequestParams() != null){ params = endPointInfo.getRequestParams(); } Map<String, String> responseParams = new HashMap<String, String>(); switch (httpMethod) { case GET: responseParams = sendGetRequest(url, params, headers); break; case POST: responseParams = sendPostRequest(url, params, headers); break; case DELETE: responseParams = sendDeleteRequest(url, params, headers); break; case PUT: responseParams = sendPutRequest(url, params, headers); break; } return responseParams; }

Target:
public static Map<String, String> postData(EndPointInfo endPointInfo, Map<String, String> headers) throws IDPTokenManagerException { HTTP_METHODS httpMethod = endPointInfo.getHttpMethod(); String url = endPointInfo.getEndPoint(); String params = null; if(endPointInfo != null && endPointInfo.getRequestParams() != null){ params = endPointInfo.getRequestParams(); } Map<String, String> responseParams = new HashMap<String, String>(); switch (httpMethod) { case GET: responseParams = sendGetRequest(url, headers); break; case POST: responseParams = sendPostRequest(url, params, headers); break; case DELETE: responseParams = sendDeleteRequest(url, headers); break; case PUT: responseParams = sendPutRequest(url, params, headers); break; } return responseParams; }
Source:
public void shouldNotifyEventWhenRemoveAnnotation() { Annotation createdAnnotation = createAnnotationAndAddSubscription("CommentRemoved"); DocumentModel annotationDocModel = session.getDocument(new IdRef(createdAnnotation.getId())); annotationDocModel.detach(true); captureAndVerifyAnnotationEventNotification(() -> { annotationService.deleteAnnotation(session, createdAnnotation.getId()); return annotationDocModel; }, COMMENT_REMOVED, DOCUMENT_REMOVED, 0); }

Target:
public void shouldNotifyEventWhenRemoveAnnotation() { Annotation createdAnnotation = createAnnotationAndAddSubscription("CommentRemoved"); DocumentModel annotationDocModel = session.getDocument(new IdRef(createdAnnotation.getId())); annotationDocModel.detach(true); captureAndVerifyAnnotationEventNotification(() -> { annotationService.deleteAnnotation(session, createdAnnotation.getId()); return annotationDocModel; }, COMMENT_REMOVED, DOCUMENT_REMOVED); }
Source:
public ServiceTest(TOptions options) throws IOException, EventHubException { super(options); String connectionString = System.getenv("EVENTHUBS_CONNECTION_STRING"); String eventHubName = System.getenv("EVENTHUB_NAME"); if (CoreUtils.isNullOrEmpty(connectionString)) { throw new IllegalStateException("Environment variable EVENTHUBS_CONNECTION_STRING must be set"); } if (CoreUtils.isNullOrEmpty(eventHubName)) { System.out.println("Environment variable EVENTHUB_NAME must be set"); System.exit(1); } ScheduledExecutorService executor = Executors.newScheduledThreadPool(4); eventHubClient = EventHubClient.createSync( new ConnectionStringBuilder(connectionString).setEventHubName(eventHubName).toString(), executor); }

Target:
public ServiceTest(TOptions options) throws IOException, EventHubException { super(options); connectionString = System.getenv("EVENTHUBS_CONNECTION_STRING"); eventHubName = System.getenv("EVENTHUB_NAME"); poolSize = System.getenv("EVENTHUB_POOL_SIZE"); if (CoreUtils.isNullOrEmpty(connectionString)) { throw new IllegalStateException("Environment variable EVENTHUBS_CONNECTION_STRING must be set"); } if (CoreUtils.isNullOrEmpty(eventHubName)) { System.out.println("Environment variable EVENTHUB_NAME must be set"); System.exit(1); } }
Source:
public void restorePanels() { getChildren().clear(); List<PanelInfo> panelInfo = prefs.getPanelInfo(); if (panelInfo.isEmpty()) { addPanel(); return; } for (int i = 0; i < panelInfo.size(); i++) { addPanel().restorePanel(panelInfo.get(i).getPanelName(), panelInfo.get(i).getPanelFilter()); } }

Target:
public void restorePanels() { getChildren().clear(); List<PanelInfo> panels = prefs.getPanelInfo(); if (panels.isEmpty()) { addPanel(); return; } for (PanelInfo panel : panels) { addPanel().restorePanel(panel.getPanelName(), panel.getPanelFilter()); } }
Source:
public void setProvider(String provider) { this.provider = PROVIDERS_PLUGIN_MAPPING.getOrDefault(provider, provider.toLowerCase()); }

Target:
public void setProvider(String provider) { if (provider == null) { this.provider = null; } else { this.provider = PROVIDERS_PLUGIN_MAPPING.getOrDefault(provider.toUpperCase(), provider.toLowerCase()); } }
Source:
public boolean equals(Object o) { if (this == o) return true; if (!(o instanceof TypeaheadSearchResp)) return false; TypeaheadSearchResp that = (TypeaheadSearchResp) o; if (getGene() != null ? !getGene().equals(that.getGene()) : that.getGene() != null) return false; if (getVariant() != null ? !getVariant().equals(that.getVariant()) : that.getVariant() != null) return false; if (getOncogenicity() != null ? !getOncogenicity().equals(that.getOncogenicity()) : that.getOncogenicity() != null) return false; if (getHighestLevelOfSensitivity() != null ? !getHighestLevelOfSensitivity().equals(that.getHighestLevelOfSensitivity()) : that.getHighestLevelOfSensitivity() != null) return false; if (getHighestLevelOfResistance() != null ? !getHighestLevelOfResistance().equals(that.getHighestLevelOfResistance()) : that.getHighestLevelOfResistance() != null) return false; if (getVariantExist() != null ? !getVariantExist().equals(that.getVariantExist()) : that.getVariantExist() != null) return false; if (getAnnotation() != null ? !getAnnotation().equals(that.getAnnotation()) : that.getAnnotation() != null) return false; if (getQueryType() != null ? !getQueryType().equals(that.getQueryType()) : that.getQueryType() != null) return false; return getLink() != null ? getLink().equals(that.getLink()) : that.getLink() == null; }

Target:
public boolean equals(Object o) { if (this == o) return true; if (!(o instanceof TypeaheadSearchResp)) return false; TypeaheadSearchResp that = (TypeaheadSearchResp) o; if (getGene() != null ? !getGene().equals(that.getGene()) : that.getGene() != null) return false; if (getVariant() != null ? !getVariant().equals(that.getVariant()) : that.getVariant() != null) return false; if (getOncogenicity() != null ? !getOncogenicity().equals(that.getOncogenicity()) : that.getOncogenicity() != null) return false; if (getHighestSensitiveLevel() != null ? !getHighestSensitiveLevel().equals(that.getHighestSensitiveLevel()) : that.getHighestSensitiveLevel() != null) return false; if (getHighestResistanceLevel() != null ? !getHighestResistanceLevel().equals(that.getHighestResistanceLevel()) : that.getHighestResistanceLevel() != null) return false; if (getVariantExist() != null ? !getVariantExist().equals(that.getVariantExist()) : that.getVariantExist() != null) return false; if (isVUS != null ? !isVUS.equals(that.isVUS) : that.isVUS != null) return false; if (getAnnotation() != null ? !getAnnotation().equals(that.getAnnotation()) : that.getAnnotation() != null) return false; if (getQueryType() != null ? !getQueryType().equals(that.getQueryType()) : that.getQueryType() != null) return false; return getLink() != null ? getLink().equals(that.getLink()) : that.getLink() == null; }
Source:
void cancel() { synchronized (submittedJobs) { for (Future<DocumentRevsList> f : submittedJobs) { f.cancel(false); } try { while (!submittedJobs.isEmpty()) { Future<DocumentRevsList> r = completionService.take(); submittedJobs.remove(r); } } catch (InterruptedException e) { ; } finally { shutdownThreadPool(); } } }

Target:
void cancel() { synchronized (submittedJobs) { for (Future<DocumentRevsList> f : submittedJobs) { f.cancel(false); } } try { while (!submittedJobs.isEmpty()) { try { Future<DocumentRevsList> r = completionService.poll(responseTimeout, responseTimeoutUnits); if (r != null) { submittedJobs.remove(r); } } catch (InterruptedException e) { continue; } } } finally { shutdownThreadPool(); } }
Source:
public void run() throws IOException { if (this.isStarted() || this.isComplete()) { throw new IllegalStateException("The process can only be used once."); } ProcessBuilder builder = new ProcessBuilder(cmd); builder.directory(new File(workingDir)); builder.environment().putAll(env); builder.redirectErrorStream(true); this.process = builder.start(); try { this.processId = processId(process); if (processId == 0) { logger.debug("Spawned thread with unknown process id"); } else { logger.debug("Spawned thread with process id " + processId); } this.startupLatch.countDown(); LogGobbler outputGobbler = new LogGobbler(new InputStreamReader(process.getInputStream()), logger, Level.INFO, 30); LogGobbler errorGobbler = new LogGobbler(new InputStreamReader(process.getErrorStream()), logger, Level.ERROR, 30); outputGobbler.start(); errorGobbler.start(); int exitCode = -1; try { exitCode = process.waitFor(); } catch (InterruptedException e) { logger.info("Process interrupted. Exit code is " + exitCode, e); } completeLatch.countDown(); outputGobbler.awaitCompletion(5000); errorGobbler.awaitCompletion(5000); if (exitCode != 0) { throw new ProcessFailureException(exitCode, errorGobbler.getRecentLog()); } } finally { IOUtils.closeQuietly(process.getInputStream()); IOUtils.closeQuietly(process.getOutputStream()); IOUtils.closeQuietly(process.getErrorStream()); } }

Target:
public void run() throws IOException { if (this.isStarted() || this.isComplete()) { throw new IllegalStateException("The process can only be used once."); } ProcessBuilder builder = new ProcessBuilder(cmd); builder.directory(new File(workingDir)); builder.environment().putAll(env); builder.redirectErrorStream(true); this.process = builder.start(); try { this.processId = processId(process); if (processId == 0) { logger.debug("Spawned thread with unknown process id"); } else { logger.debug("Spawned thread with process id " + processId); } this.startupLatch.countDown(); LogGobbler outputGobbler = new LogGobbler(new InputStreamReader(process.getInputStream()), logger, Level.INFO, 30); LogGobbler errorGobbler = new LogGobbler(new InputStreamReader(process.getErrorStream()), logger, Level.ERROR, 30); outputGobbler.start(); errorGobbler.start(); int exitCode = -1; try { exitCode = process.waitFor(); } catch (InterruptedException e) { logger.info("Process interrupted. Exit code is " + exitCode, e); } completeLatch.countDown(); outputGobbler.awaitCompletion(5000); errorGobbler.awaitCompletion(5000); if (exitCode != 0) { String output = new StringBuilder().append("Stdout:\n") .append(outputGobbler.getRecentLog()).append("\n\n") .append("Stderr:\n").append(errorGobbler.getRecentLog()) .append("\n").toString(); throw new ProcessFailureException(exitCode, output); } } finally { IOUtils.closeQuietly(process.getInputStream()); IOUtils.closeQuietly(process.getOutputStream()); IOUtils.closeQuietly(process.getErrorStream()); } }
Source:
public void doublePairVsThree() { String doublePair2And8 = "2S 8H 2H 8D JH"; String threeOf4 = "4S 5H 4C 8S 4H"; assertEquals(Arrays.asList(threeOf4), new Poker(Arrays.asList(doublePair2And8, threeOf4)).getBestHands()); }

Target:
public void doublePairVsThree() { String doublePair2And8 = "2S 8H 2H 8D JH"; String threeOf4 = "4S 5H 4C 8S 4H"; assertEquals(Collections.singletonList(threeOf4), new Poker(Arrays.asList(doublePair2And8, threeOf4)).getBestHands()); }
Source:
public void testRoundTripTypes(List<Type> types, List<List<?>> readValues, List<Map<Integer, Map<Subfield, TupleDomainFilter>>> filters, List<List<Integer>> expectedFilterOrder) throws Exception { assertEquals(types.size(), readValues.size()); if (expectedFilterOrder.size() > 0) { assertEquals(filters.size(), expectedFilterOrder.size()); } assertRoundTrip(types, readValues, filters, expectedFilterOrder); if (reverseTestsEnabled) { assertRoundTrip(types, Lists.transform(readValues, OrcTester::reverse), filters, ImmutableList.of()); } if (nullTestsEnabled) { assertRoundTrip(types, insertNulls(types, readValues), filters, expectedFilterOrder); if (reverseTestsEnabled) { assertRoundTrip(types, insertNulls(types, Lists.transform(readValues, OrcTester::reverse)), filters, ImmutableList.of()); } } }

Target:
public void testRoundTripTypes(List<Type> types, List<List<?>> readValues, List<Map<Integer, Map<Subfield, TupleDomainFilter>>> filters, List<List<Integer>> expectedFilterOrder) throws Exception { assertEquals(types.size(), readValues.size()); if (!expectedFilterOrder.isEmpty()) { assertEquals(filters.size(), expectedFilterOrder.size()); } assertRoundTrip(types, readValues, filters, expectedFilterOrder); if (reverseTestsEnabled) { assertRoundTrip(types, Lists.transform(readValues, OrcTester::reverse), filters, expectedFilterOrder); } if (nullTestsEnabled) { assertRoundTrip(types, insertNulls(types, readValues), filters, expectedFilterOrder); if (reverseTestsEnabled) { assertRoundTrip(types, insertNulls(types, Lists.transform(readValues, OrcTester::reverse)), filters, expectedFilterOrder); } } }
Source:
public Set<ConnectorCapabilities> getConnectorCapabilities(Session session, ConnectorId catalogName) { return emptySet(); }

Target:
public Set<ConnectorCapabilities> getConnectorCapabilities(Session session, ConnectorId catalogName) { throw new UnsupportedOperationException(); }
Source:
private void deployStream(CuratorFramework client, Stream stream) throws InterruptedException { try { client.setData().forPath( Paths.build(Paths.STREAM_DEPLOYMENTS, stream.getName(), Paths.STATUS), ZooKeeperUtils.mapToBytes(new DeploymentUnitStatus(DeploymentUnitStatus.State.deploying).toMap())); StreamModuleDeploymentPropertiesProvider provider = new StreamModuleDeploymentPropertiesProvider(stream); Collection<ModuleDeploymentStatus> deploymentStatus = moduleDeploymentWriter.writeDeployment(stream.getDeploymentOrderIterator(), provider); DeploymentUnitStatus status = stateCalculator.calculate(stream, provider, deploymentStatus); logger.info("Deployment state for stream: {}", status); client.setData().forPath( Paths.build(Paths.STREAM_DEPLOYMENTS, stream.getName(), Paths.STATUS), ZooKeeperUtils.mapToBytes(status.toMap())); } catch (NoContainerException e) { logger.warn("No containers available for deployment of stream {}", stream.getName()); } catch (InterruptedException e) { throw e; } catch (Exception e) { throw ZooKeeperUtils.wrapThrowable(e); } }

Target:
private void deployStream(CuratorFramework client, Stream stream) throws InterruptedException { String statusPath = Paths.build(Paths.STREAM_DEPLOYMENTS, stream.getName(), Paths.STATUS); DeploymentUnitStatus deployingStatus = null; try { deployingStatus = new DeploymentUnitStatus(ZooKeeperUtils.bytesToMap( client.getData().forPath(statusPath))); } catch (Exception e) { } Assert.state(deployingStatus != null && deployingStatus.getState() == DeploymentUnitStatus.State.deploying, String.format("Expected 'deploying' status for stream '%s'; current status: %s", stream.getName(), deployingStatus)); try { StreamModuleDeploymentPropertiesProvider provider = new StreamModuleDeploymentPropertiesProvider(stream); Collection<ModuleDeploymentStatus> deploymentStatus = moduleDeploymentWriter.writeDeployment(stream.getDeploymentOrderIterator(), provider); DeploymentUnitStatus status = stateCalculator.calculate(stream, provider, deploymentStatus); logger.info("Deployment status for stream '{}': {}", stream.getName(), status); client.setData().forPath(statusPath, ZooKeeperUtils.mapToBytes(status.toMap())); } catch (NoContainerException e) { logger.warn("No containers available for deployment of stream {}", stream.getName()); } catch (InterruptedException e) { throw e; } catch (Exception e) { throw ZooKeeperUtils.wrapThrowable(e); } }
Source:
protected void deleteDepthFirst(final Transaction tx, final PersistentStorageSession pSession, final FedoraResource fedoraResource, final String userPrincipal) throws PersistentStorageException { final FedoraId fedoraId = fedoraResource.getFedoraId(); if (fedoraResource instanceof Container) { final Stream<String> children = getContained(tx, fedoraResource); children.forEach(childResourceId -> { try { final FedoraResource res = resourceFactory.getResource(tx, FedoraId.create(childResourceId)); deleteDepthFirst(tx, pSession, res, userPrincipal); } catch (final PathNotFoundException ex) { log.error("Path not found for {}: {}", fedoraId.getFullId(), ex.getMessage()); throw new PathNotFoundRuntimeException(ex); } catch (final PersistentStorageException ex) { throw new RepositoryRuntimeException(format("failed to delete resource %s", fedoraId.getFullId()), ex); } }); } else if (fedoraResource instanceof Binary) { doAction(tx, pSession, fedoraResource.getDescribedResource().getFedoraId(), userPrincipal); } if (!fedoraResource.isAcl()) { final FedoraResource acl = fedoraResource.getAcl(); if (acl != null) { doAction(tx, pSession, acl.getFedoraId(), userPrincipal); } } doAction(tx, pSession, fedoraId, userPrincipal); }

Target:
private void deleteDepthFirst(final Transaction tx, final PersistentStorageSession pSession, final FedoraResource fedoraResource, final String userPrincipal) throws PersistentStorageException { final FedoraId fedoraId = fedoraResource.getFedoraId(); if (fedoraResource instanceof Container) { final Stream<String> children = getContained(tx, fedoraResource); children.forEach(childResourceId -> { try { final FedoraResource res = resourceFactory.getResource(tx, FedoraId.create(childResourceId)); deleteDepthFirst(tx, pSession, res, userPrincipal); } catch (final PathNotFoundException ex) { log.error("Path not found for {}: {}", fedoraId.getFullId(), ex.getMessage()); throw new PathNotFoundRuntimeException(ex); } catch (final PersistentStorageException ex) { throw new RepositoryRuntimeException(format("failed to delete resource %s", fedoraId.getFullId()), ex); } }); } else if (fedoraResource instanceof Binary) { doAction(tx, pSession, fedoraResource.getDescribedResource().getFedoraId(), userPrincipal); } if (!fedoraResource.isAcl()) { final FedoraResource acl = fedoraResource.getAcl(); if (acl != null) { doAction(tx, pSession, acl.getFedoraId(), userPrincipal); } } doAction(tx, pSession, fedoraId, userPrincipal); }
Source:
public static List<GameObject> parse(FileHandle file) throws IOException { List<GameObject> result = new ArrayList<GameObject>(); Scanner sc = new Scanner(file.read()); if(sc.hasNext()) { String enemyType = sc.nextLine(); switch(enemyType) { case "SimpleEnemy": enemyFactory = new SimpleEnemyFactory(); break; case "StrongEnemy": enemyFactory = new StrongEnemyFactory(); break; default: enemyFactory = new SimpleEnemyFactory(); result.add(getObject(enemyType)); } } while (sc.hasNext()) { String object = sc.nextLine(); try { result.add(getObject(object)); } catch (IOException ioe) { ioe.printStackTrace(); } } return result; }

Target:
public static List<GameObject> parse(FileHandle file) throws IOException { List<GameObject> result = new ArrayList<GameObject>(); Scanner sc = new Scanner(file.read()); if(sc.hasNext()) { String enemyType = sc.nextLine(); switch(enemyType) { case "SimpleEnemy": enemyFactory = new SimpleEnemyFactory(); break; case "StrongEnemy": enemyFactory = new StrongEnemyFactory(); break; default: enemyFactory = new SimpleEnemyFactory(); result.add(getObject(enemyType)); break; } } while (sc.hasNext()) { String object = sc.nextLine(); result.add(getObject(object)); } return result; }
Source:
private void cleanupOldDocVer(DBObject doc) { DBObject hidden=getHidden(doc,false); if(hidden!=null) { List<ObjectId> list=(List<ObjectId>)hidden.get(DOCVER); if(list!=null) { List<ObjectId> copy=new ArrayList<>(list.size()); long now=docVer.getDate().getTime(); for(ObjectId id:list) { if(!id.equals(docVer)) { Date d=id.getDate(); if(now-d.getTime()<TOO_OLD) { copy.add(id); } } else { copy.add(id); } } if(copy.size()!=list.size()) { hidden.put(DOCVER,copy); LOGGER.debug("cleanupInput={}, cleanupOutput={}",list,copy); } } } }

Target:
private void cleanupOldDocVer(DBObject doc) { DBObject hidden=getHidden(doc,false); if(hidden!=null) { List<ObjectId> list=(List<ObjectId>)hidden.get(DOCVER); if(list!=null) { List<ObjectId> copy=new ArrayList<>(list.size()); long now=docVer.getDate().getTime(); for(ObjectId id:list) { if(!id.equals(docVer)) { Date d=id.getDate(); if(now-d.getTime()<TOO_OLD_MS) { copy.add(id); } } else { copy.add(id); } } if(copy.size()!=list.size()) { hidden.put(DOCVER,copy); LOGGER.debug("cleanupInput={}, cleanupOutput={}",list,copy); } } } }
Source:
void receiveMessage(Protos.TwoWayChannelMessage msg) throws InsufficientMoneyException; void connectionClosed(); void settle() throws IllegalStateException; void connectionOpen(); ListenableFuture<Coin> incrementPayment(Coin size, ByteString info) throws ValueOutOfRangeException, IllegalStateException; interface ClientConnection { void sendToServer(Protos.TwoWayChannelMessage msg); void destroyConnection(PaymentChannelCloseException.CloseReason reason); void channelOpen(boolean wasInitiated); }

Target:
void receiveMessage(Protos.TwoWayChannelMessage msg) throws InsufficientMoneyException; void connectionClosed(); void settle() throws IllegalStateException; void connectionOpen(); ListenableFuture<Coin> incrementPayment(Coin size, @Nullable ByteString info) throws ValueOutOfRangeException, IllegalStateException; interface ClientConnection { void sendToServer(Protos.TwoWayChannelMessage msg); void destroyConnection(PaymentChannelCloseException.CloseReason reason); void channelOpen(boolean wasInitiated); }
Source:
private boolean isThis(ExpressionTree expression) { expression = (ExpressionUtils.skipParentheses(expression)); if (expression.is(Tree.Kind.IDENTIFIER)) { String targetName = ((IdentifierTree) expression).name(); return "this".equals(targetName); } return false; }

Target:
private boolean isThis(ExpressionTree expression) { ExpressionTree expressionNoParenthesis = ExpressionUtils.skipParentheses(expression); if (expressionNoParenthesis.is(Tree.Kind.IDENTIFIER)) { String targetName = ((IdentifierTree) expressionNoParenthesis).name(); return "this".equals(targetName); } return false; }
Source:
public static <T> T invokePrivileged(final Method method, final Object instance, final Object... args) { Assert.requireNonNull(method, "method"); Assert.requireNonNull(instance, "instance"); return AccessController.doPrivileged((PrivilegedAction<T>) new PrivilegedAction<Object>() { @Override public Object run() { boolean wasAccessible = method.isAccessible(); try { method.setAccessible(true); return method.invoke(instance, args); } catch (InvocationTargetException ex) { throw new DolphinRuntimeException("Error while calling method '" + method.getName() + "' on instance of type '" + instance.getClass() + "'. Method details: " + method.toGenericString(), ex); } catch (IllegalAccessException ex) { throw new DolphinRuntimeException("Cannot invoke method '" + method.getName() + "' on instance of type '" + instance.getClass() + "'. Method details: " + method.toGenericString(), ex); } finally { method.setAccessible(wasAccessible); } } }); }

Target:
public static <T> T invokePrivileged(final Method method, final Object instance, final Object... args) { Assert.requireNonNull(method, "method"); Assert.requireNonNull(instance, "instance"); return AccessController.doPrivileged((PrivilegedAction<T>) new PrivilegedAction<Object>() { @Override public Object run() { final boolean wasAccessible = method.isAccessible(); try { method.setAccessible(true); return method.invoke(instance, args); } catch (final InvocationTargetException ex) { throw new DolphinRuntimeException("Error while calling method '" + method.getName() + "' on instance of type '" + instance.getClass() + "'. Method details: " + method.toGenericString(), ex); } catch (final IllegalAccessException ex) { throw new DolphinRuntimeException("Cannot invoke method '" + method.getName() + "' on instance of type '" + instance.getClass() + "'. Method details: " + method.toGenericString(), ex); } finally { method.setAccessible(wasAccessible); } } }); }
Source:
public String getReplicationId() { HashMap<String, String> dict = new HashMap<String, String>(); try { dict.put("source", this.sourceDb.getIdentifier()); } catch (DatastoreException e){ logger.log(Level.WARNING,"Failed to get ID using default",e); dict.put("source","touchdb_defaultUUID"); } dict.put("target", this.targetDb.getIdentifier()); byte[] sha1Bytes = Misc.getSha1(new ByteArrayInputStream(JSONUtils.serializeAsBytes(dict))); byte[] sha1Hex = new Hex().encode(sha1Bytes); return new String(sha1Hex); }

Target:
public String getReplicationId() throws DatastoreException { HashMap<String, String> dict = new HashMap<String, String>(); dict.put("source", this.sourceDb.getIdentifier()); dict.put("target", this.targetDb.getIdentifier()); byte[] sha1Bytes = Misc.getSha1(new ByteArrayInputStream(JSONUtils.serializeAsBytes(dict))); byte[] sha1Hex = new Hex().encode(sha1Bytes); return new String(sha1Hex); }
Source:
public static IConnector[] getActiveConnectors() { final List<IConnector> activeConnectors = new ArrayList<>(); for (final IConnector conn : CONNECTORS) { if (conn.isActive()) { activeConnectors.add(conn); } } return activeConnectors.toArray(new IConnector[activeConnectors.size()]); }

Target:
public static List<IConnector> getActiveConnectors() { final List<IConnector> activeConnectors = new ArrayList<>(); for (final IConnector conn : CONNECTORS) { if (conn.isActive()) { activeConnectors.add(conn); } } return activeConnectors; }
Source:
public void testMODSGetsUpdated() throws Exception { populateFedora("uuid:ae0091e0-192d-46f9-a8ad-8b0dc82f33ad"); InputStream originalMods = workObj.getMODS().getBinaryStream(); assertModsNotUpdated(originalMods); importFile = createTempImportFile("src/test/resources/mods/update-work-mods.xml"); createJob(); job.run(); verify(mailSender).send(any(MimeMessage.class)); InputStream updatedMods = objLoader.getWorkObject(workObj.getPid()).getMODS().getBinaryStream(); assertModsUpdated(updatedMods); }

Target:
public void testMODSGetsUpdated() throws Exception { populateFedora("uuid:ae0091e0-192d-46f9-a8ad-8b0dc82f33ad"); InputStream originalMods = workObj.getMODS().getBinaryStream(); assertModsNotUpdated(originalMods); importFile = createTempImportFile("src/test/resources/mods/update-work-mods.xml"); createJob(); job.run(); verify(mailSender).send(any(MimeMessage.class)); InputStream updatedMods = workObj.getMODS().getBinaryStream(); assertModsUpdated(updatedMods); }
Source:
public void prepareRun(BatchSinkContext context) throws InstantiationException, IOException { FailureCollector collector = context.getFailureCollector(); config.validate(collector); ValidatingOutputFormat validatingOutputFormat = context.newPluginInstance(FORMAT_PLUGIN_ID); FileFormat fileFormat = config.getFormat(); FormatContext formatContext = new FormatContext(collector, context.getInputSchema()); validateOutputFormatProvider(formatContext, fileFormat, validatingOutputFormat); collector.getOrThrowException(); Schema schema = config.getSchema(); if (schema == null) { schema = context.getInputSchema(); } LineageRecorder lineageRecorder = new LineageRecorder(context, config.getReferenceName()); lineageRecorder.createExternalDataset(schema); if (schema != null && schema.getFields() != null && !schema.getFields().isEmpty()) { recordLineage(lineageRecorder, schema.getFields().stream().map(Schema.Field::getName).collect(Collectors.toList())); } Map<String, String> outputProperties = new HashMap<>(validatingOutputFormat.getOutputFormatConfiguration()); outputProperties.putAll(getFileSystemProperties(context)); outputProperties.put(FileOutputFormat.OUTDIR, getOutputDir(context.getLogicalStartTime())); context.addOutput(Output.of(config.getReferenceName(), new SinkOutputFormatProvider(validatingOutputFormat.getOutputFormatClassName(), outputProperties))); }

Target:
public void prepareRun(BatchSinkContext context) throws Exception { FailureCollector collector = context.getFailureCollector(); config.validate(collector); ValidatingOutputFormat validatingOutputFormat = context.newPluginInstance(FORMAT_PLUGIN_ID); FileFormat fileFormat = config.getFormat(); FormatContext formatContext = new FormatContext(collector, context.getInputSchema()); validateOutputFormatProvider(formatContext, fileFormat, validatingOutputFormat); collector.getOrThrowException(); Schema schema = config.getSchema(); if (schema == null) { schema = context.getInputSchema(); } LineageRecorder lineageRecorder = new LineageRecorder(context, config.getReferenceName()); lineageRecorder.createExternalDataset(schema); if (schema != null && schema.getFields() != null && !schema.getFields().isEmpty()) { recordLineage(lineageRecorder, schema.getFields().stream().map(Schema.Field::getName).collect(Collectors.toList())); } Map<String, String> outputProperties = new HashMap<>(validatingOutputFormat.getOutputFormatConfiguration()); outputProperties.putAll(getFileSystemProperties(context)); outputProperties.put(FileOutputFormat.OUTDIR, getOutputDir(context.getLogicalStartTime())); context.addOutput(Output.of(config.getReferenceName(), new SinkOutputFormatProvider(validatingOutputFormat.getOutputFormatClassName(), outputProperties))); }
Source:
public boolean apply(Game game, Ability source) { Player targetPlayer = game.getPlayer(targetPointer.getFirst(game, source)); Player controller = game.getPlayer(source.getControllerId()); MageObject sourceObject = game.getObject(source.getSourceId()); if (targetPlayer == null || controller == null || sourceObject == null) { return true; } String cardName = (String) game.getState().getValue(source.getSourceId().toString() + ChooseACardNameEffect.INFO_KEY); Cards hand = targetPlayer.getHand().copy(); targetPlayer.revealCards(source, hand, game); hand.removeIf(uuid -> { Card card = hand.get(uuid, game); if (card == null) { return true; } if (card.isSplitCard()) { SplitCard splitCard = (SplitCard) card; if (CardUtil.haveSameNames(splitCard.getLeftHalfCard().getName(), cardName)) { return false; } else if (CardUtil.haveSameNames(splitCard.getRightHalfCard().getName(), cardName)) { return false; } } if (CardUtil.haveSameNames(card.getName(), cardName)) { return false; } return true; }); targetPlayer.discard(hand, source, game); return true; }

Target:
public boolean apply(Game game, Ability source) { Player targetPlayer = game.getPlayer(targetPointer.getFirst(game, source)); Player controller = game.getPlayer(source.getControllerId()); MageObject sourceObject = game.getObject(source.getSourceId()); if (targetPlayer == null || controller == null || sourceObject == null) { return false; } String cardName = (String) game.getState().getValue(source.getSourceId().toString() + ChooseACardNameEffect.INFO_KEY); Cards hand = targetPlayer.getHand().copy(); targetPlayer.revealCards(source, hand, game); hand.removeIf(uuid -> { Card card = hand.get(uuid, game); if (card == null) { return true; } if (card.isSplitCard()) { SplitCard splitCard = (SplitCard) card; if (CardUtil.haveSameNames(splitCard.getLeftHalfCard().getName(), cardName)) { return false; } else if (CardUtil.haveSameNames(splitCard.getRightHalfCard().getName(), cardName)) { return false; } } if (CardUtil.haveSameNames(card.getName(), cardName)) { return false; } return true; }); targetPlayer.discard(hand, source, game); return true; }
Source:
protected static boolean moveFrom(String oldLocation, String newLocation, boolean force) throws InvalidReferenceException { File newFile = new File(ReferenceManager.instance().DeriveReference(newLocation).getLocalURI()); File oldFile = new File(ReferenceManager.instance().DeriveReference(oldLocation).getLocalURI()); if (!oldFile.exists()) { return newFile.exists(); } if (oldFile.exists() && newFile.exists()) { if (force) { if (!newFile.delete()) { return false; } else { } } else { return false; } } boolean suceess = oldFile.renameTo(newFile); if (suceess && oldFile.exists()) { Logger.log(LogTypes.SOFT_ASSERT, "Old File exists after rename"); } if (suceess && newFile.exists()) { Logger.log(LogTypes.SOFT_ASSERT, "New File doesn't exist after rename"); } return suceess; }

Target:
protected static boolean moveFrom(String oldLocation, String newLocation, boolean force) throws InvalidReferenceException { File newFile = new File(ReferenceManager.instance().DeriveReference(newLocation).getLocalURI()); File oldFile = new File(ReferenceManager.instance().DeriveReference(oldLocation).getLocalURI()); if (!oldFile.exists()) { return newFile.exists(); } if (oldFile.exists() && newFile.exists()) { if (force) { if (!newFile.delete()) { return false; } else { } } else { return false; } } boolean success = oldFile.renameTo(newFile); if (success && oldFile.exists()) { Logger.log(LogTypes.SOFT_ASSERT, "Old File exists after rename"); } if (success && !newFile.exists()) { Logger.log(LogTypes.SOFT_ASSERT, "New File doesn't exist after rename"); } return success; }
Source:
NodeCursorResourceIterator( NodeLabelIndexCursor cursor, Statement statement ) { this.cursor = cursor; this.statement = statement; next = -2L; }

Target:
NodeCursorResourceIterator( NodeLabelIndexCursor cursor, Statement statement ) { this.cursor = cursor; this.statement = statement; this.next = NOT_INITIALIZED; }
Source:
public void testSequencerCacheEvict2() { SequencerServerCache cache = new SequencerServerCache(cacheSize, Address.NOT_FOUND); long address = 0; HashMap<ConflictTxStream, Long> recordMap = new HashMap<>(); while (cache.size() < cacheSize) { for (int j = 0; j < entryPerAddress; j++) { generateData(recordMap, cache, address++, false); } } verifyData(recordMap, cache); assertThat(cache.size() == cacheSize); for (int i = 0; i < iterations; i++, address++) { generateData(recordMap, cache, address, true); } verifyData(recordMap, cache); log.info("cacheSize cacheByteSize cacheEntriesBytes ", cache.size(), cache.byteSize(), cache.byteSize()); long entrySize = cache.byteSize() / cache.size(); cache.invalidateUpTo(address - numRemains); assertThat(cache.size() == numRemains); assertThat(entrySize == cache.byteSize() / cache.size()); log.info("cacheSize cacheByteSize cacheEntriesBytes ", cache.size(), cache.byteSize(), cache.byteSize()); cache.invalidateUpTo(address); assertThat(cache.size() == 0); }

Target:
public void testSequencerCacheEvict2() { SequencerServerCache cache = new SequencerServerCache(cacheSize, Address.NOT_FOUND); long address = 0; HashMap<ConflictTxStream, Long> recordMap = new HashMap<>(); while (cache.size() < cacheSize) { for (int j = 0; j < entryPerAddress; j++) { generateData(recordMap, cache, address++, false); } } verifyData(recordMap, cache); assertThat(cache.size()).isEqualTo(cacheSize); for (int i = 0; i < iterations; i++, address++) { generateData(recordMap, cache, address, true); } verifyData(recordMap, cache); log.info("cacheSize cacheByteSize cacheEntriesBytes ", cache.size(), cache.byteSize(), cache.byteSize()); long entrySize = cache.byteSize() / cache.size(); cache.invalidateUpTo(address - numRemains); assertThat(cache.size()).isEqualTo(numRemains); assertThat(entrySize).isEqualTo(cache.byteSize() / cache.size()); log.info("cacheSize cacheByteSize cacheEntriesBytes ", cache.size(), cache.byteSize(), cache.byteSize()); cache.invalidateUpTo(address); assertThat(cache.size()).isZero(); }
Source:
protected void onCreate(Bundle savedInstanceState){ super.onCreate(savedInstanceState); setContentView(R.layout.activity_snooze); setTitle("Later"); notificationId = getIntent().getIntExtra(NOTIFICATION_ID_KEY, -1); pushNotificationId = getIntent().getIntExtra(PUSH_NOTIFICATION_ID_KEY, -1); ListView list = (ListView)findViewById(R.id.snooze_list); list.setAdapter(new SnoozeAdapter(this)); list.setOnItemClickListener(this); }

Target:
protected void onCreate(Bundle savedInstanceState){ super.onCreate(savedInstanceState); setContentView(R.layout.activity_snooze); setTitle(R.string.later_title); notificationId = getIntent().getIntExtra(NOTIFICATION_ID_KEY, -1); pushNotificationId = getIntent().getIntExtra(PUSH_NOTIFICATION_ID_KEY, -1); ListView list = (ListView)findViewById(R.id.snooze_list); list.setAdapter(new SnoozeAdapter(this)); list.setOnItemClickListener(this); }
Source:
private static Field[] getFields(Class<?> recordClass, boolean excludeJava) { Field[] fieldsList; Map<String, Field> fields = new LinkedHashMap<>(); Class<?> c = recordClass; do { if (excludeJava && c.getPackage() != null && c.getPackage().getName().startsWith("java.")) break; Field[] declaredFields = c.getDeclaredFields(); Arrays.sort(declaredFields, new Comparator<Field>() { @Override public int compare(Field o1, Field o2) { return o1.getName().compareTo(o2.getName()); } }); for (Field field : declaredFields) if ((field.getModifiers() & (Modifier.TRANSIENT | Modifier.STATIC)) == 0) if (fields.put(field.getName(), field) != null) throw new AvroTypeException(c + " contains two fields named: " + field); c = c.getSuperclass(); } while (c != null); fieldsList = fields.values().toArray(new Field[0]); return fieldsList; }

Target:
private static Field[] getFields(Class<?> recordClass, boolean excludeJava) { Field[] fieldsList; Map<String, Field> fields = new LinkedHashMap<>(); Class<?> c = recordClass; do { if (excludeJava && c.getPackage() != null && c.getPackage().getName().startsWith("java.")) break; Field[] declaredFields = c.getDeclaredFields(); Arrays.sort(declaredFields, Comparator.comparing(Field::getName)); for (Field field : declaredFields) if ((field.getModifiers() & (Modifier.TRANSIENT | Modifier.STATIC)) == 0) if (fields.put(field.getName(), field) != null) throw new AvroTypeException(c + " contains two fields named: " + field); c = c.getSuperclass(); } while (c != null); fieldsList = fields.values().toArray(new Field[0]); return fieldsList; }
Source:
private void killOpportunisticContainers(Container container) { List<Container> extraOpportContainersToKill = pickOpportunisticContainersToKill(container.getContainerId()); for (Container contToKill : extraOpportContainersToKill) { contToKill.sendKillEvent( ContainerExitStatus.KILLED_BY_CONTAINER_SCHEDULER, "Container Killed to make room for Guaranteed Container."); oppContainersMarkedForKill.put(contToKill.getContainerId(), contToKill); LOG.info( "Opportunistic container will be killed in order to start the " + "execution of guaranteed container {}.", contToKill.getContainerId(), container.getContainerId()); } }

Target:
private void killOpportunisticContainers(Container container) { List<Container> extraOpportContainersToKill = pickOpportunisticContainersToKill(container.getContainerId()); for (Container contToKill : extraOpportContainersToKill) { contToKill.sendKillEvent( ContainerExitStatus.KILLED_BY_CONTAINER_SCHEDULER, "Container Killed to make room for Guaranteed Container."); oppContainersToKill.put(contToKill.getContainerId(), contToKill); LOG.info( "Opportunistic container will be killed in order to start the " + "execution of guaranteed container {}.", contToKill.getContainerId(), container.getContainerId()); } }
Source:
private int chooseOption(int[] optionProbs) { int sum = 0; for (int opt : optionProbs) sum += opt; double rand = new Random().nextDouble() * sum; sum = 0; for (int i = 0; i < optionProbs.length; i++) { sum += optionProbs[i]; if (rand <= sum) return i; } return optionProbs.length - 1; }

Target:
private int chooseOption(int[] optionProbs) { int sum = 0; for (int opt : optionProbs) sum += opt; double rand = random.nextDouble() * sum; sum = 0; for (int i = 0; i < optionProbs.length; i++) { sum += optionProbs[i]; if (rand <= sum) return i; } return optionProbs.length - 1; }
Source:
public FieldDeclarationTree CLASS_FIELD_INITIALIZER() { return b.<FieldDeclarationTree>nonterminal() .is(f.fieldDeclaration( b.optional(b.token(JavaScriptLegacyGrammar.STATIC)), PROPERTY_NAME(), b.optional(f.newTuple58(b.token(JavaScriptPunctuator.EQU), ASSIGNMENT_EXPRESSION())), b.token(JavaScriptPunctuator.SEMI))); }

Target:
public FieldDeclarationTree CLASS_FIELD_INITIALIZER() { return b.<FieldDeclarationTree>nonterminal() .is(f.fieldDeclaration( b.optional(b.token(JavaScriptLegacyGrammar.STATIC)), PROPERTY_NAME(), b.optional(f.newTuple58(b.token(JavaScriptPunctuator.EQU), ASSIGNMENT_EXPRESSION())), b.token(JavaScriptLegacyGrammar.EOS))); }
Source:
private void populateIdpList(List<IdpConfig> providers) { mIdpProviders = new ArrayList<>(); for (IdpConfig idpConfig : providers) { switch (idpConfig.getProviderId()) { case AuthUI.GOOGLE_PROVIDER: mIdpProviders.add(new GoogleProvider(this, idpConfig)); break; case AuthUI.FACEBOOK_PROVIDER: mIdpProviders.add(new FacebookProvider( this, idpConfig, mActivityHelper.getFlowParams().themeId)); break; case AuthUI.TWITTER_PROVIDER: mIdpProviders.add(new TwitterProvider(this)); break; case AuthUI.EMAIL_PROVIDER: findViewById(R.id.email_provider).setVisibility(View.VISIBLE); break; default: Log.e(TAG, "Encountered unknown IDPProvider parcel with type: " + idpConfig.getProviderId()); } } ViewGroup btnHolder = (ViewGroup) findViewById(R.id.btn_holder); for (final IdpProvider provider : mIdpProviders) { View loginButton = null; switch (provider.getProviderId()) { case GoogleAuthProvider.PROVIDER_ID: loginButton = getLayoutInflater() .inflate(R.layout.idp_button_google, btnHolder, false); break; case FacebookAuthProvider.PROVIDER_ID: loginButton = getLayoutInflater() .inflate(R.layout.idp_button_facebook, btnHolder, false); break; case TwitterAuthProvider.PROVIDER_ID: loginButton = getLayoutInflater() .inflate(R.layout.idp_button_twitter, btnHolder, false); break; default: Log.e(TAG, "No button for provider " + provider.getProviderId()); } if (loginButton != null) { loginButton.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { mActivityHelper.showLoadingDialog(R.string.progress_dialog_loading); provider.startLogin(AuthMethodPickerActivity.this); } }); provider.setAuthenticationCallback(this); btnHolder.addView(loginButton, btnHolder.getChildCount() - 1); } } }

Target:
private void populateIdpList(List<IdpConfig> providers) { mProviders = new ArrayList<>(); for (IdpConfig idpConfig : providers) { switch (idpConfig.getProviderId()) { case AuthUI.GOOGLE_PROVIDER: mProviders.add(new GoogleProvider(this, idpConfig)); break; case AuthUI.FACEBOOK_PROVIDER: mProviders.add(new FacebookProvider( this, idpConfig, mActivityHelper.getFlowParams().themeId)); break; case AuthUI.TWITTER_PROVIDER: mProviders.add(new TwitterProvider(this)); break; case AuthUI.EMAIL_PROVIDER: mProviders.add(new EmailProvider(this, mActivityHelper)); break; default: Log.e(TAG, "Encountered unknown provider parcel with type: " + idpConfig.getProviderId()); } } ViewGroup btnHolder = (ViewGroup) findViewById(R.id.btn_holder); for (final Provider provider : mProviders) { View loginButton = getLayoutInflater() .inflate(provider.getButtonLayout(), btnHolder, false); loginButton.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { if (provider instanceof IdpProvider) { mActivityHelper.showLoadingDialog(R.string.progress_dialog_loading); } provider.startLogin(AuthMethodPickerActivity.this); } }); if (provider instanceof IdpProvider) { ((IdpProvider) provider).setAuthenticationCallback(this); } btnHolder.addView(loginButton); } }
Source:
public void setUp() { super.setUp(); testStreamAppName = String.format("test-app-name-%s", UUID.randomUUID().toString()); testStreamAppId = String.format("test-app-id-%s", UUID.randomUUID().toString()); inputKafkaTopic = String.format("test-input-topic-%s", UUID.randomUUID().toString()); outputKafkaTopic = String.format("test-output-topic-%s", UUID.randomUUID().toString()); for (String kafkaTopic : ImmutableList.of(inputKafkaTopic, outputKafkaTopic)) { LOGGER.info("Creating kafka topic: {}.", kafkaTopic); TestUtils.createTopic(zkUtils(), kafkaTopic, 5, 1, servers(), new Properties()); } }

Target:
public void setUp() { super.setUp(); String uniqueTestId = UUID.randomUUID().toString(); String testStreamAppName = String.format("test-app-name-%s", uniqueTestId); String testStreamAppId = String.format("test-app-id-%s", uniqueTestId); inputKafkaTopic = String.format("test-input-topic-%s", uniqueTestId); outputKafkaTopic = String.format("test-output-topic-%s", uniqueTestId); ZkClient zkClient = new ZkClient(zkConnect()); ZkKeyBuilder zkKeyBuilder = new ZkKeyBuilder(String.format("app-%s-%s", testStreamAppName, testStreamAppId)); zkJobCoordinatorMetrics = new ZkJobCoordinatorMetrics(new NoOpMetricsRegistry()); zkUtils = new ZkUtils(zkKeyBuilder, zkClient, ZK_CONNECTION_TIMEOUT_MS, zkJobCoordinatorMetrics); zkUtils.connect(); applicationConfig1 = buildStreamApplicationConfig(TEST_SYSTEM, inputKafkaTopic, PROCESSOR_IDS[0], testStreamAppName, testStreamAppId); applicationConfig2 = buildStreamApplicationConfig(TEST_SYSTEM, inputKafkaTopic, PROCESSOR_IDS[1], testStreamAppName, testStreamAppId); applicationConfig3 = buildStreamApplicationConfig(TEST_SYSTEM, inputKafkaTopic, PROCESSOR_IDS[2], testStreamAppName, testStreamAppId); applicationRunner1 = new LocalApplicationRunner(applicationConfig1); applicationRunner2 = new LocalApplicationRunner(applicationConfig2); applicationRunner3 = new LocalApplicationRunner(applicationConfig3); for (String kafkaTopic : ImmutableList.of(inputKafkaTopic, outputKafkaTopic)) { LOGGER.info("Creating kafka topic: {}.", kafkaTopic); TestUtils.createTopic(zkUtils(), kafkaTopic, 5, 1, servers(), new Properties()); } }
Source:
private Object aggregate(ParameterContext parameterContext, ExtensionContext extensionContext) { Parameter parameter = parameterContext.getParameter(); Optional<AggregateWith> annotation = AnnotationUtils.findAnnotation(parameter, AggregateWith.class); ArgumentsAccessor accessor = new DefaultArgumentsAccessor(arguments); return annotation.map(AggregateWith::value) .map(clazz -> ReflectionUtils.newInstance(clazz)) .map(aggregator -> aggregator.aggregateArguments(accessor,parameterContext)) .orElse(accessor); }

Target:
private Object aggregate(ParameterContext parameterContext, ExtensionContext extensionContext) { Parameter parameter = parameterContext.getParameter(); Optional<AggregateWith> annotation = AnnotationUtils.findAnnotation(parameter, AggregateWith.class); ArgumentsAccessor accessor = new DefaultArgumentsAccessor(arguments); try { return annotation.map(AggregateWith::value) .map(clazz -> ReflectionUtils.newInstance(clazz)) .map(aggregator -> aggregator.aggregateArguments(accessor, parameterContext)) .orElse(accessor); } catch (Exception ex) { throw new ParameterResolutionException( "Error aggregating parameter at index " + parameterContext.getIndex(), ex); } }
Source:
private String buildLongMessage() { StringBuilder sb = new StringBuilder(ConcurConstants.VALIDATION_RESULT_MESSAGE_MAX_LENGTH); for (int i = 0; i<ConcurConstants.VALIDATION_RESULT_MESSAGE_MAX_LENGTH; i++) { sb.append("A"); } return sb.toString(); }

Target:
private String buildLongMessage() { return StringUtils.repeat("A", ConcurConstants.VALIDATION_RESULT_MESSAGE_MAX_LENGTH); }
Source:
@Test public void runner_can_coexists_with_rule() { Result result = runner.run(WithJUnitRule.class); JUnitResultAssert.assertThat(result).isSuccessful(); }

Target:
@Test public void runner_can_coexists_with_rule() { Result result = runner.run(RunnerAndRule.class); JUnitResultAssert.assertThat(result).fails(1, UnnecessaryStubbingException.class); }