auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void mergeLicenses( List<String> licenseMerges, LicenseMap licenseMap ) throws MojoFailureException { Set<String> licenseFound = new HashSet<>(); if ( !CollectionUtils.isEmpty( licenseMerges ) ) { Map<String, Set<String>> mergedLicenses = new HashMap<>(); for ( String merge : licenseMerges ) { merge = merge.trim(); String[] split = merge.split( "\\s*\\|\\s*" ); String mainLicense = split[0]; Set<String> mergeList; if ( mergedLicenses.containsKey( mainLicense ) ) { mergeList = mergedLicenses.get( mainLicense ); } else { mergeList = new HashSet<>(); } for ( int i = 0; i < split.length; i++ ) { String licenseToAdd = split[i]; if ( i == 0 ) { continue; } if ( mergeList.contains( licenseToAdd ) || licenseFound.contains( licenseToAdd ) || mainLicense.equals( licenseToAdd ) ) { throw new MojoFailureException( "The license " + licenseToAdd + " was already registered in the " + "configuration, please use only one such entry as described in the example " + "<LINK_0>" + "example-thirdparty.html#Merge_licenses" ); } mergeList.add( licenseToAdd ); licenseFound.add( licenseToAdd ); } mergedLicenses.put( mainLicense, mergeList ); } for ( Map.Entry<String, Set<String>> entry : mergedLicenses.entrySet() ) { String mainLicense = entry.getKey(); Set<String> mergedLicense = entry.getValue(); if ( verbose ) { LOG.info( "Will merge to *" + mainLicense + "*, licenses: " + mergedLicense ); } thirdPartyTool.mergeLicenses( licenseMap, mainLicense, mergedLicense ); } } }

Target:
public void mergeLicenses( List<String> licenseMerges, LicenseMap licenseMap ) throws MojoFailureException { Set<String> licenseFound = new HashSet<>(); if ( !CollectionUtils.isEmpty( licenseMerges ) ) { Map<String, Set<String>> mergedLicenses = new HashMap<>(); for ( String merge : licenseMerges ) { merge = merge.trim(); String[] split = merge.split( "\\s*\\|\\s*" ); String mainLicense = split[0]; Set<String> mergeList; if ( mergedLicenses.containsKey( mainLicense ) ) { mergeList = mergedLicenses.get( mainLicense ); } else { mergeList = new HashSet<>(); } for ( int i = 0; i < split.length; i++ ) { String licenseToAdd = split[i]; if ( i == 0 ) { continue; } if ( mergeList.contains( licenseToAdd ) || licenseFound.contains( licenseToAdd ) || mainLicense.equals( licenseToAdd ) ) { throw new MojoFailureException( "The license " + licenseToAdd + " was already registered in the " + "configuration, please use only one such entry as described in the example " + "<LINK_0>" + "example-thirdparty.html#Merge_licenses" ); } mergeList.add( licenseToAdd ); licenseFound.add( licenseToAdd ); } mergedLicenses.put( mainLicense, mergeList ); } for ( Map.Entry<String, Set<String>> entry : mergedLicenses.entrySet() ) { String mainLicense = entry.getKey(); Set<String> mergedLicense = entry.getValue(); if ( verbose ) { LOG.info( "Will merge to '{}', licenses: {}", mainLicense, mergedLicense ); } thirdPartyTool.mergeLicenses( licenseMap, mainLicense, mergedLicense ); } } }
Source:
public static File prepareAbsoluteOutputDirPath(MojoParameters params, String dir, String path) { return prepareAbsolutePath(params, new File(new File(params.getProject().getBuild().getDirectory(), params.getOutputDirectory()), dir).toString(), path); }

Target:
public static File prepareAbsoluteOutputDirPath(MojoParameters params, String dir, String path) { return prepareAbsolutePath(params, new File(params.getOutputDirectory(), dir), path); }
Source:
public void folderContains_shouldReturnTrueWhenFolderContainsFileWithGivenName() { String path = System.getProperty("user.dir"); File folder = new File(path+"/folder"); folder.mkdir(); File file = new File(path+"/folder/file"); try { file.createNewFile(); assertTrue(OpenmrsUtil.folderContains(folder,"file")); file.delete(); } catch (Exception e) { } folder.delete(); }

Target:
public void folderContains_shouldReturnTrueWhenFolderContainsFileWithGivenName() { File folder = createFileInUserDirectory("folder"); folder.mkdir(); File file = createFileInUserDirectory("folder" + separator + "file"); try { file.createNewFile(); assertTrue(OpenmrsUtil.folderContains(folder, "file")); file.delete(); } catch (IOException e) {Assert.fail("Unable to create file");} folder.delete(); }
Source:
protected Result pushDownDereferences(Context context, ProjectNode projectNode, BiMap<DereferenceExpression, VariableReferenceExpression> expressions) { ImmutableMap<VariableReferenceExpression, RowExpression> dereferencesMap = expressions.inverse().entrySet().stream().collect(toImmutableMap(Map.Entry::getKey, entry -> castToRowExpression(entry.getValue()))); return Result.ofPlanNode( new ProjectNode(context.getIdAllocator().getNextId(), projectNode.getSource(), Assignments.builder().putAll(projectNode.getAssignments()).putAll(dereferencesMap).build())); }

Target:
protected Result pushDownDereferences(Context context, ProjectNode projectNode, BiMap<DereferenceExpression, VariableReferenceExpression> expressions) { Map<VariableReferenceExpression, RowExpression> dereferencesMap = expressions.inverse().entrySet().stream() .collect(toImmutableMap(Map.Entry::getKey, entry -> castToRowExpression(entry.getValue()))); return Result.ofPlanNode( new ProjectNode(context.getIdAllocator().getNextId(), projectNode.getSource(), Assignments.builder() .putAll(projectNode.getAssignments()) .putAll(dereferencesMap) .build())); }
Source:
public void deleteQueue(String queueName) throws QueueManagerException { try { UserRegistry userRegistry = Utils.getUserRegistry(); String resourcePath = QueueManagementConstants.MB_QUEUE_STORAGE_PATH + "/" + queueName; if (QueueManagementBeans.queueExists(queueName)) { QueueManagementBeans.getInstance().deleteQueue(queueName); userRegistry.delete(resourcePath); } removeRoleCreateForLoggedInUser(queueName); } catch (RegistryException e) { throw new QueueManagerException("Failed to delete queue : " + queueName, e); } }

Target:
public void deleteQueue(String queueName) throws QueueManagerException { try { UserRegistry userRegistry = Utils.getUserRegistry(); String resourcePath = QueueManagementConstants.MB_QUEUE_STORAGE_PATH + "/" + queueName; if (QueueManagementBeans.queueExists(queueName)) { QueueManagementBeans.getInstance().deleteQueue(queueName); userRegistry.delete(resourcePath); } removeRoleCreatedForLoggedInUser(queueName); } catch (RegistryException e) { throw new QueueManagerException("Failed to delete queue : " + queueName, e); } }
Source:
public Session openSession(URI sessionResourceURI, IProgressMonitor monitor, UICallBack uiCallback) { SubMonitor subMonitor = SubMonitor.convert(monitor, 100); Session session = SessionManager.INSTANCE.getSession(sessionResourceURI, subMonitor.newChild(30)); if (session != null && !session.isOpen()) { try { session.open(subMonitor.newChild(70)); } catch (AirdResourceVersionMismatchException e) { session = null; if (uiCallback != null && uiCallback.askSessionReopeningWithResourceVersionMismatch(e)) { try { MigrationUtil.ignoreVersionMismatch = true; session = SessionManager.INSTANCE.getSession(sessionResourceURI, new NullProgressMonitor()); session.open(new NullProgressMonitor()); } finally { MigrationUtil.ignoreVersionMismatch = false; } } else { throw e; } } } subMonitor.done(); return session; }

Target:
public Session openSession(URI sessionResourceURI, IProgressMonitor monitor, UICallBack uiCallback) { SubMonitor subMonitor = SubMonitor.convert(monitor, 100); Session session = this.getSession(sessionResourceURI, subMonitor.newChild(30)); if (session != null && !session.isOpen()) { try { session.open(subMonitor.newChild(70)); } catch (AirdResourceVersionMismatchException e) { session = null; if (uiCallback != null && uiCallback.askSessionReopeningWithResourceVersionMismatch(e)) { try { MigrationUtil.ignoreVersionMismatch = true; session = this.getSession(sessionResourceURI, new NullProgressMonitor()); session.open(new NullProgressMonitor()); } finally { MigrationUtil.ignoreVersionMismatch = false; } } else { throw e; } } } subMonitor.done(); return session; }
Source:
private <E> E executePrincipalQuery(QueryConfiguration configuration, ResultSetCallback<E> resultSetCallback) { String sql = configuration.getSql(); if (log.isDebugEnabled()) { log.debug("Executing principalQuery..."); } if (log.isTraceEnabled()) { log.tracef("principalQuery ==> \"%s\" using \"%s\" as value", sql, name); } try ( Connection connection = getConnection(configuration); PreparedStatement preparedStatement = connection.prepareStatement(sql) ) { preparedStatement.setString(1, name); try ( ResultSet resultSet = preparedStatement.executeQuery() ) { return resultSetCallback.handle(resultSet); } } catch (SQLException e) { throw log.couldNotExecuteQuery(sql, e); } catch (Exception e) { throw log.unexpectedErrorWhenProcessingAuthenticationQuery(sql, e); } }

Target:
private <E> E executePrincipalQuery(QueryConfiguration configuration, ResultSetCallback<E> resultSetCallback) { String sql = configuration.getSql(); log.tracef("Executing principalQuery %s with value %s", sql, name); try ( Connection connection = getConnection(configuration); PreparedStatement preparedStatement = connection.prepareStatement(sql) ) { preparedStatement.setString(1, name); try ( ResultSet resultSet = preparedStatement.executeQuery() ) { return resultSetCallback.handle(resultSet); } } catch (SQLException e) { throw log.couldNotExecuteQuery(sql, e); } catch (Exception e) { throw log.unexpectedErrorWhenProcessingAuthenticationQuery(sql, e); } }
Source:
public void testGetCachedBranches() throws GerritException { if (!isVersion28OrLater()) { return; } GerritClient client = reviewHarness.getClient(); NullProgressMonitor monitor = new NullProgressMonitor(); NameKey project = client.getChange(reviewHarness.getShortId(), monitor) .getChangeDetail() .getChange() .getProject(); assertNull(client.getCachedBranches(project)); client.refreshConfigOnce(project, monitor); Set<String> branches = client.getCachedBranches(project); assertNotNull(branches); assertTrue(branches.contains("refs/heads/master")); String newBranch = "branch-" + System.currentTimeMillis(); String newBranchRef = "refs/heads/" + newBranch; try { createBranchIfNonExistent(newBranch); assertFalse(client.getCachedBranches(project).contains(newBranchRef)); client.refreshConfigOnce(project, monitor); assertFalse(client.getCachedBranches(project).contains(newBranchRef)); client.refreshConfig(monitor); assertTrue(client.getCachedBranches(project).contains(newBranchRef)); System.out.println(newBranchRef); } finally { deleteBranch(newBranch); } }

Target:
public void testGetCachedBranches() throws GerritException { if (!isVersion28OrLater()) { return; } GerritClient client = reviewHarness.getClient(); NullProgressMonitor monitor = new NullProgressMonitor(); NameKey project = client.getChange(reviewHarness.getShortId(), monitor) .getChangeDetail() .getChange() .getProject(); assertNull(client.getCachedBranches(project)); client.refreshConfigOnce(project, monitor); Set<String> branches = client.getCachedBranches(project); assertNotNull(branches); assertTrue(branches.contains("refs/heads/master")); String newBranch = "branch-" + System.currentTimeMillis(); String newBranchRef = "refs/heads/" + newBranch; try { createBranchIfNonExistent(newBranch); assertFalse(client.getCachedBranches(project).contains(newBranchRef)); client.refreshConfigOnce(project, monitor); assertFalse(client.getCachedBranches(project).contains(newBranchRef)); client.refreshConfig(monitor); assertTrue(client.getCachedBranches(project).contains(newBranchRef)); } finally { deleteBranch(newBranch); } }
Source:
default ITag<?> getInternal(MCTag<T> theTag) { return getTagCollection().getIDTagMap().get(theTag.getIdInternal()); }

Target:
default ITag<?> getInternal(MCTag<T> theTag) { return getTagCollection().get(theTag.getIdInternal()); }
Source:
private synchronized short updateLibraryId(final String library) { Short libraryId = this.libraryIds.get(library); if (libraryId == null) { libraryId = this.nextLibraryId++; this.libraryIds.put(library, libraryId); } return libraryId; }

Target:
private short updateLibraryId(final String library) { return this.libraryIds.computeIfAbsent(library, (s) -> this.nextLibraryId++); }
Source:
public String getDefaultMetaVariable() { T[] enumConstants = enumType.getEnumConstants(); List<String> items = new ArrayList<>(enumConstants.length); for (Enum<T> item : enumConstants) { try { if (enumType.getField(item.name()).getAnnotation(Deprecated.class) == null) { items.add(item.name()); } } catch (NoSuchFieldException e) { throw new AssertionError(); } catch (SecurityException e) { items.add(item.name()); LoggerFactory.getLogger() .info( "A SecurityException occured while getting field '" + item.name() + "' from enum '" + enumType.getName() + "': " + e.getMessage()); } } return new StringBuffer() .append('[') .append(Joiner.on(" | ").join(items)) .append(']') .toString(); }

Target:
public String getDefaultMetaVariable() { T[] enumConstants = enumType.getEnumConstants(); List<String> items = new ArrayList<>(enumConstants.length); for (Enum<T> item : enumConstants) { try { if (enumType.getField(item.name()).getAnnotation(Deprecated.class) == null) { items.add(item.name().toLowerCase()); } } catch (NoSuchFieldException e) { throw new AssertionError(); } catch (SecurityException e) { items.add(item.name()); LoggerFactory.getLogger() .info( "A SecurityException occured while getting field '" + item.name() + "' from enum '" + enumType.getName() + "': " + e.getMessage()); } } return new StringBuffer() .append('[') .append(Joiner.on(" | ").join(items)) .append(']') .toString(); }
Source:
public void onStart() { super.onStart(); if (TextUtils.getTrimmedLength(lastSearchedText) > 0) { forceStartSearch(lastSearchedText); } }

Target:
public void onStart() { super.onStart(); if (isValidQuery(lastSearchedText)) { forceStartSearch(lastSearchedText); } }
Source:
private Comparable findPropertyValueByName(IProperty property, String valueIn) { Optional<Comparable> value = property.parseValue(valueIn); if (value.isPresent()) { return value.get(); } else { for (Object v : property.getAllowedValues()) { if (isValueEqualTo(property, (Comparable) v, valueIn)) { return (Comparable) v; } } ; } return null; }

Target:
private Comparable findPropertyValueByName(IProperty property, String valueIn) { Optional<Comparable> value = property.parseValue(valueIn); if (value.isPresent()) { return value.get(); } else { for (Object v : property.getAllowedValues()) { if (isValueEqualTo(property, (Comparable) v, valueIn)) { return (Comparable) v; } } } return null; }
Source:
public DivolteConfiguration configuration() { if (exceptions.size() > 0) { throw new IllegalStateException("Attempt to access invalid configuration."); } return divolteConfiguration; }

Target:
public DivolteConfiguration configuration() { if (!exceptions.isEmpty()) { throw new IllegalStateException("Attempt to access invalid configuration."); } return divolteConfiguration; }
Source:
private void patchParagraph(NotebookSocket conn, HashSet<String> userAndRoles, Notebook notebook, Message fromMessage) throws IOException { String paragraphId = (String) fromMessage.get("id"); if (paragraphId == null) { return; } String noteId = getOpenNoteId(conn); if (noteId == null) { noteId = (String) fromMessage.get("noteId"); } if (!hasParagraphWriterPermission(conn, notebook, noteId, userAndRoles, fromMessage.principal, "write")) { return; } final Note note = notebook.getNote(noteId); Paragraph p = note.getParagraph(paragraphId); DiffMatchPatch dmp = new DiffMatchPatch(); String patchText = (String) fromMessage.get("patch"); patchText = patchText.replace(",@@", "@@"); LinkedList<DiffMatchPatch.Patch> patches = (LinkedList<DiffMatchPatch.Patch>) dmp.patchFromText(patchText); String paragraphText = p.getText(); paragraphText = (String) dmp.patchApply(patches, paragraphText)[0]; p.setText(paragraphText); Message message = new Message(OP.PATCH_PARAGRAPH).put("patch", patchText) .put("paragraphId", p.getId()); broadcastExcept(note.getId(), message, conn); }

Target:
private void patchParagraph(NotebookSocket conn, HashSet<String> userAndRoles, Notebook notebook, Message fromMessage) throws IOException { if (!collaborativeModeEnable) { return; } String paragraphId = fromMessage.getType("id", LOG); if (paragraphId == null) { return; } String noteId = getOpenNoteId(conn); if (noteId == null) { noteId = fromMessage.getType("noteId", LOG); if (noteId == null) { return; } } if (!hasParagraphWriterPermission(conn, notebook, noteId, userAndRoles, fromMessage.principal, "write")) { return; } final Note note = notebook.getNote(noteId); if (note == null) { return; } Paragraph p = note.getParagraph(paragraphId); if (p == null) { return; } DiffMatchPatch dmp = new DiffMatchPatch(); String patchText = fromMessage.getType("patch", LOG); if (patchText == null) { return; } LinkedList<DiffMatchPatch.Patch> patches = null; try { patches = (LinkedList<DiffMatchPatch.Patch>) dmp.patchFromText(patchText); } catch (ClassCastException e) { LOG.error("Failed to parse patches", e); } if (patches == null) { return; } String paragraphText = p.getText() == null ? "" : p.getText(); paragraphText = (String) dmp.patchApply(patches, paragraphText)[0]; p.setText(paragraphText); Message message = new Message(OP.PATCH_PARAGRAPH).put("patch", patchText) .put("paragraphId", p.getId()); broadcastExcept(note.getId(), message, conn); }
Source:
private Level resolveLogLevelOnClose() { if (!serverContext.isActive()) { return Level.FINEST; } if (closeCause == null || closeCause instanceof EOFException || closeCause instanceof CancelledKeyException) { if (connectionType.equals(ConnectionType.REST_CLIENT) || connectionType.equals(ConnectionType.MEMCACHE_CLIENT)) { return Level.FINE; } else { return Level.INFO; } } else { return Level.WARNING; } }

Target:
private Level resolveLogLevelOnClose() { if (!serverContext.isNodeActive()) { return Level.FINEST; } if (closeCause == null || closeCause instanceof EOFException || closeCause instanceof CancelledKeyException) { if (connectionType.equals(ConnectionType.REST_CLIENT) || connectionType.equals(ConnectionType.MEMCACHE_CLIENT)) { return Level.FINE; } else { return Level.INFO; } } else { return Level.WARNING; } }
Source:
public void convertsToXml() throws Exception { final Memo memo = new MkMemo(); memo.update( new Directives() .xpath("/memo") .add("uri").set("fake.thindeck.com").up() .addIf("domains") .addIf("domain").set("domain.thindeck.com") ); final StringWriter writer = new StringWriter(); JAXBContext.newInstance(JxMemo.class) .createMarshaller() .marshal(new JxMemo(memo), writer); MatcherAssert.assertThat( writer.toString(), XhtmlMatchers.hasXPaths( " " ) ); }

Target:
public void convertsToXml() throws Exception { final Memo memo = new MkMemo(); memo.update( new Directives() .xpath("/memo") .add("uri").set("fake.thindeck.com").up() .addIf("domains") .addIf("domain").set("domain.thindeck.com") ); MatcherAssert.assertThat( JaxbConverter.the(new JxMemo(memo)), XhtmlMatchers.hasXPaths( " " ) ); }
Source:
private Optional<ImageInfoV4Response> selectLatestImageFromCandidates(List<ImageInfoV4Response> upgradeCandidates) { ImageInfoV4Response imageInfoV4Response = upgradeCandidates.stream().max(ImageInfoV4Response.creationBasedComparator()).orElseThrow(); LOGGER.debug("Choosing latest image as either upgrade request is empty or lockComponents is true", imageInfoV4Response); return Optional.of(imageInfoV4Response); }

Target:
private Optional<ImageInfoV4Response> selectLatestImageFromCandidates(List<ImageInfoV4Response> upgradeCandidates) { Optional<ImageInfoV4Response> imageInfoV4Response = upgradeCandidates.stream().max(ImageInfoV4Response.creationBasedComparator()); LOGGER.debug("Choosing latest image as either upgrade request is empty or lockComponents is true", imageInfoV4Response); return imageInfoV4Response; }
Source:
public WatsonService(final String name) { this.name = name; String iamApiKey = CredentialUtils.getIAMKey(name); if (iamApiKey != null) { tokenManager = new IamTokenManager(new IamOptions.Builder().apiKey(iamApiKey).build()); } apiKey = CredentialUtils.getAPIKey(name); String url = CredentialUtils.getAPIUrl(name); if ((url != null) && !url.isEmpty()) { setEndPoint(url); } client = configureHttpClient(); }

Target:
public WatsonService(final String name) { this.name = name; String iamApiKey = CredentialUtils.getIAMKey(name); String iamUrl = CredentialUtils.getIAMUrl(name); if (iamApiKey != null) { IamOptions iamOptions = new IamOptions.Builder() .apiKey(iamApiKey) .url(iamUrl) .build(); tokenManager = new IamTokenManager(iamOptions); } apiKey = CredentialUtils.getAPIKey(name); String url = CredentialUtils.getAPIUrl(name); if ((url != null) && !url.isEmpty()) { setEndPoint(url); } client = configureHttpClient(); }
Source:
public List<ObservationDto> getSampleObservations(final int studyId, final List<Integer> instanceIds, final Integer selectionVariableId) { final SQLQuery createSQLQuery = this.session.createSQLQuery(measurementQuery.getSampleObservationQuery()); createSQLQuery.addScalar("nd_experiment_id", new IntegerType()); createSQLQuery.addScalar("preferred_name", new StringType()); createSQLQuery.addScalar("value", new IntegerType()); createSQLQuery.setParameter("studyId", studyId); createSQLQuery.setParameter("selectionVariableId", selectionVariableId); createSQLQuery.setParameterList("instanceIds", instanceIds); return this.mapSampleObservations(createSQLQuery.list()); }

Target:
public List<ObservationDto> getSampleObservations(final int studyId, final List<Integer> instanceIds, final Integer selectionVariableId) { final SQLQuery createSQLQuery = this.session.createSQLQuery(this.measurementQuery.getSampleObservationQuery()); createSQLQuery.addScalar("nd_experiment_id", new IntegerType()); createSQLQuery.addScalar("preferred_name", new StringType()); createSQLQuery.addScalar("value", new StringType()); createSQLQuery.setParameter("studyId", studyId); createSQLQuery.setParameter("selectionVariableId", selectionVariableId); createSQLQuery.setParameterList("instanceIds", instanceIds); return this.mapSampleObservations(createSQLQuery.list()); }
Source:
public void asyncReadLastConfirmed(final ReadLastConfirmedCallback cb, final Object ctx) { if (clientCtx.getConf().useExplicitLacForReads) { asyncReadExplicitLastConfirmed(cb, ctx); } else { asyncReadLastConfirmedInternal(cb, ctx); } }

Target:
public void asyncReadLastConfirmed(final ReadLastConfirmedCallback cb, final Object ctx) { if (clientCtx.getConf().useExplicitLacForReads) { asyncReadExplicitLastConfirmed(cb, ctx); } else { asyncReadPiggybackLastConfirmed(cb, ctx); } }
Source:
synchronized public void send(PlainCommand command) { if (socket == null) { try { socket = recreateSocket(); socketStream = socket.getOutputStream(); } catch (IOException e) { throw new AtsdClientException("Error while connecting to ATSD", e); } } try { socketStream.write(command.compose().getBytes("UTF8")); if (clientConfiguration.isAutoflush()) { socketStream.flush(); } return; } catch (Exception e) { log.warn("Error while sending commands to ATSD. Trying to reconnect", e); } try { socket = recreateSocket(); socketStream = socket.getOutputStream(); socketStream.write(command.compose().getBytes("UTF8")); if (clientConfiguration.isAutoflush()) { socketStream.flush(); } } catch (Exception e) { throw new AtsdClientException("Error while sending command to ATSD", e); } }

Target:
synchronized public void send(PlainCommand command) { send(command.compose()); }
Source:
public void throwsForNonParcelableProperty() throws Exception { TypeElement type = elements.getTypeElement(SampleTypeWithNonSerializable.class.getCanonicalName()); AutoValueExtension.Context context = createContext(type); extension.generateClass(context, "Test_AnnotatedType", "SampleTypeWithNonSerializable", true); fail(); }

Target:
@Test public void throwsForNonParcelableProperty() throws Exception { TypeElement type = elements.getTypeElement(SampleTypeWithNonSerializable.class.getCanonicalName()); AutoValueExtension.Context context = createContext(type); try { extension.generateClass(context, "Test_AnnotatedType", "SampleTypeWithNonSerializable", true); fail(); } catch (AutoParcelException e) }
Source:
protected boolean validate() { if (!super.validate()) { return false; } oldPool = getVmPoolDao().get(getVmPool().getVmPoolId()); if (oldPool == null) { return failValidation(EngineMessage.VM_POOL_CANNOT_UPDATE_POOL_NOT_FOUND); } if (getParameters().getVmsCount() < 0) { return failValidation(EngineMessage.VM_POOL_CANNOT_DECREASE_VMS_FROM_POOL); } if (oldPool.getVmPoolType() != getParameters().getVmPool().getVmPoolType() || oldPool.isStateful() != getParameters().getVmPool().isStateful()) { return failValidation(EngineMessage.VM_POOL_CANNOT_CHANGE_POOL_TYPE); } return true; }

Target:
protected boolean validate() { if (!super.validate()) { return false; } oldPool = getVmPoolDao().get(getVmPool().getVmPoolId()); if (oldPool == null) { return failValidation(EngineMessage.VM_POOL_CANNOT_UPDATE_POOL_NOT_FOUND); } if (getParameters().getVmsCount() < 0) { return failValidation(EngineMessage.VM_POOL_CANNOT_DECREASE_VMS_FROM_POOL); } if (oldPool.getVmPoolType() != getParameters().getVmPool().getVmPoolType()) { return failValidation(EngineMessage.VM_POOL_CANNOT_CHANGE_POOL_TYPE); } if (oldPool.isStateful() != getParameters().getVmPool().isStateful()) { return failValidation(EngineMessage.VM_POOL_CANNOT_CHANGE_POOL_STATEFUL_OPTION); } return true; }
Source:
public DatastreamRestClient(String zkAddr, String clusterName) { Validate.notEmpty(zkAddr, "invalid ZooKeeper address"); Validate.notEmpty(zkAddr, "invalid cluster name"); _httpClient = null; String basePath = String.format("/%s/d2", clusterName); D2Client d2Client = new D2ClientBuilder() .setZkHosts(zkAddr) .setBasePath(basePath) .build(); try { FutureCallback<None> future = new FutureCallback<>(); d2Client.start(future); future.get(TIMEOUT_MS, TimeUnit.MILLISECONDS); _restClient = new RestClient(d2Client, "d2://"); } catch (Exception e) { String errMsg = String.format("Failed to start D2 client, zk=%s, cluster=%s", zkAddr, clusterName); LOG.error(errMsg, e); throw new DatastreamRuntimeException(errMsg, e); } _builders = new DatastreamRequestBuilders(); _bootstrapBuilders = new BootstrapRequestBuilders(); }

Target:
public DatastreamRestClient(String zkAddr, String clusterName) { Validate.notEmpty(zkAddr, "invalid ZooKeeper address"); Validate.notEmpty(clusterName, "invalid cluster name"); _httpClient = null; String basePath = String.format("/%s/d2", clusterName); D2Client d2Client = new D2ClientBuilder() .setZkHosts(zkAddr) .setBasePath(basePath) .build(); try { FutureCallback<None> future = new FutureCallback<>(); d2Client.start(future); future.get(TIMEOUT_MS, TimeUnit.MILLISECONDS); _restClient = new RestClient(d2Client, "d2://"); } catch (Exception e) { String errMsg = String.format("Failed to start D2 client, zk=%s, cluster=%s", zkAddr, clusterName); LOG.error(errMsg, e); throw new DatastreamRuntimeException(errMsg, e); } _builders = new DatastreamRequestBuilders(); _bootstrapBuilders = new BootstrapRequestBuilders(); LOG.info(String.format("Successfully created Datastream REST client, zk=%s, cluster=%s", zkAddr, clusterName)); }
Source:
public void onCoursePaymentSuccessful() { final Activity activity = getActivity(); if( activity != null) { activity.finish(); } final Bundle arguments = getArguments(); if (arguments != null) { final EnrolledCoursesResponse courseData = (EnrolledCoursesResponse) arguments.getSerializable(Router.EXTRA_COURSE_DATA); EventBus.getDefault().postSticky(new CourseUpgradedEvent(courseData.getCourse().getId())); final Serializable serializable = arguments.getSerializable(Router.EXTRA_COURSE_UNIT); CourseComponent courseUnit; if (serializable != null) { courseUnit = (CourseComponent) serializable; analyticsRegistry.trackCourseUpgradeSuccess(courseUnit.getId(), courseData.getCourse().getId(), courseUnit.getBlockId()); } else { analyticsRegistry.trackCourseUpgradeSuccess(null, courseData.getCourse().getId(), null); } } else { EventBus.getDefault().postSticky(new CourseUpgradedEvent(null)); } }

Target:
public void onCoursePaymentSuccessful() { final Activity activity = getActivity(); if( activity != null) { activity.finish(); } final Bundle arguments = getArguments(); if (arguments != null) { final EnrolledCoursesResponse courseData = (EnrolledCoursesResponse) arguments.getSerializable(Router.EXTRA_COURSE_DATA); EventBus.getDefault().postSticky(new CourseUpgradedEvent(courseData.getCourse().getId())); final CourseComponent courseUnit = (CourseComponent) arguments.getSerializable(Router.EXTRA_COURSE_UNIT); if (courseUnit != null) { analyticsRegistry.trackCourseUpgradeSuccess(courseUnit.getId(), courseData.getCourse().getId(), courseUnit.getBlockId()); } else { analyticsRegistry.trackCourseUpgradeSuccess(null, courseData.getCourse().getId(), null); } } else { EventBus.getDefault().postSticky(new CourseUpgradedEvent(null)); } }
Source:
public void close() throws IOException { IOException first = null; for (int index = keyMaterials.length - 1; index >= 0; index--) { try { if (keyMaterials[index] != null) { keyMaterials[index].close(); } } catch (IOException ioe) { first = first == null ? ioe : first; } } if (first != null) { throw first; } }

Target:
public void close() throws IOException { Throwable first = null; for (int index = keyMaterials.length - 1; index >= 0; index--) { try { if (keyMaterials[index] != null) { keyMaterials[index].close(); } } catch (IOException e) { first = first == null ? e : first; } catch (RuntimeException e) { first = first == null ? e : first; } catch (Throwable e) { first = first == null ? e : first; } } if (first != null) { if (first instanceof IOException) { throw (IOException) first; } else if (first instanceof RuntimeException) { throw (RuntimeException) first; } else { throw new IOException("Error closing credentials.", first); } } }
Source:
private static List<String> getExpectedOutput(int retentionPeriod, RETENTION_UNITS retentionUnit, FEED_TYPE feedType, DateTime endDateUTC, List<String> inputData) { DateTimeFormatter formatter = DateTimeFormat.forPattern(TimeUtil.getFormatStringForFeedType(feedType)); List<String> finalData = new ArrayList<String>(); final String endLimit = formatter.print(getEndLimit(retentionPeriod, retentionUnit, endDateUTC)); for (String testDate : inputData) { if (!testDate.equalsIgnoreCase("somethingRandom")) { if (testDate.compareTo(endLimit) >= 0) { finalData.add(testDate); } } else { finalData.add(testDate); } } return finalData; }

Target:
private static List<String> getExpectedOutput(int retentionPeriod, RETENTION_UNITS retentionUnit, FEED_TYPE feedType, DateTime endDateUTC, List<String> inputData) { DateTimeFormatter formatter = DateTimeFormat.forPattern(TimeUtil.getFormatStringForFeedType(feedType)); List<String> finalData = new ArrayList<String>(); final String endLimit = formatter.print(getEndLimit(retentionPeriod, retentionUnit, endDateUTC)); for (String testDate : inputData) { if (testDate.compareTo(endLimit) >= 0) { finalData.add(testDate); } } return finalData; }
Source:
public String toString() { return String.format("COORD[%s,%s]", X, Y); }

Target:
public String toString() { return String.format("COORD(%s,%s)", X, Y); }
Source:
private CompletableFuture<byte[]> sendAndReceive(String subject, byte[] payload, NodeId toNodeId) { Node node = cluster.getNode(toNodeId); if (node == null) { return Futures.exceptionalFuture(new ConnectException()); } return messagingService.sendAndReceive(node.endpoint(), subject, payload); }

Target:
private CompletableFuture<byte[]> sendAndReceive(String subject, byte[] payload, NodeId toNodeId) { Node node = cluster.getNode(toNodeId); if (node == null) { return Futures.exceptionalFuture(CONNECT_EXCEPTION); } return messagingService.sendAndReceive(node.endpoint(), subject, payload); }
Source:
public void start() throws Exception { LOG.info("Starting split enumerator for source {}.", operatorName); coordinatorExecutor.execute(() -> { try { enumerator.start(); } catch (Exception e) { LOG.error("Failed to start the enumerator of operator due to", operatorName, e); context.failJob(e); } }); started = true; }

Target:
public void start() throws Exception { LOG.info("Starting split enumerator for source {}.", operatorName); coordinatorExecutor.execute(() -> { try { enumerator.start(); } catch (Throwable e) { LOG.error("Failed to start the enumerator of operator due to", operatorName, e); context.failJob(e); ExceptionUtils.rethrowIfFatalErrorOrOOM(e); } }); started = true; }
Source:
@Override public Bitmap transform(Bitmap source) { Bitmap result = createBitmap(source.getWidth(), source.getHeight(), source.getConfig()); Bitmap noise; try { noise = picasso.load(R.drawable.noise).get(); } catch (IOException e) { Log.w(TAG, "Failed to apply transformation!", e); return source; } BitmapShader shader = new BitmapShader(noise, REPEAT, REPEAT); ColorMatrix colorMatrix = new ColorMatrix(); colorMatrix.setSaturation(0); ColorMatrixColorFilter filter = new ColorMatrixColorFilter(colorMatrix); Paint paint = new Paint(ANTI_ALIAS_FLAG); paint.setColorFilter(filter); Canvas canvas = new Canvas(result); canvas.drawBitmap(source, 0, 0, paint); paint.setColorFilter(null); paint.setShader(shader); paint.setXfermode(new PorterDuffXfermode(PorterDuff.Mode.MULTIPLY)); canvas.drawRect(0, 0, canvas.getWidth(), canvas.getHeight(), paint); source.recycle(); noise.recycle(); return result; }

Target:
@Override public Bitmap transform(Bitmap source) { Bitmap result = createBitmap(source.getWidth(), source.getHeight(), source.getConfig()); Bitmap noise; try { noise = picasso.load(R.drawable.noise).get(); } catch (IOException e) { throw new RuntimeException("Failed to apply transformation! Missing resource."); } BitmapShader shader = new BitmapShader(noise, REPEAT, REPEAT); ColorMatrix colorMatrix = new ColorMatrix(); colorMatrix.setSaturation(0); ColorMatrixColorFilter filter = new ColorMatrixColorFilter(colorMatrix); Paint paint = new Paint(ANTI_ALIAS_FLAG); paint.setColorFilter(filter); Canvas canvas = new Canvas(result); canvas.drawBitmap(source, 0, 0, paint); paint.setColorFilter(null); paint.setShader(shader); paint.setXfermode(new PorterDuffXfermode(PorterDuff.Mode.MULTIPLY)); canvas.drawRect(0, 0, canvas.getWidth(), canvas.getHeight(), paint); source.recycle(); noise.recycle(); return result; }
Source:
public static URI summaryToUri(S3ObjectSummary object) { final String originalAuthority = object.getBucketName(); final String originalPath = object.getKey(); final String authority = originalAuthority.endsWith("/") ? originalAuthority.substring(0, originalAuthority.length() - 1) : originalAuthority; final String path = originalPath.startsWith("/") ? originalPath.substring(1) : originalPath; return URI.create(StringUtils.format("s3://%s/%s", authority, path)); }

Target:
public static URI summaryToUri(S3ObjectSummary object) { return summaryToCloudObjectLocation(object).toUri(SCHEME); }
Source:
private RowColumnRangeIterator getAllColumns(Iterable<byte[]> rows) { return kvs.getRowsColumnRange(TABLE_REF, rows, ALL_COLUMNS, 1000, SweepQueueUtils.CAS_TS); }

Target:
private RowColumnRangeIterator getAllColumns(Iterable<byte[]> rows) { return kvs.getRowsColumnRange(TABLE_REF, rows, ALL_COLUMNS, 100_000, SweepQueueUtils.CAS_TS); }
Source:
public void setUp() throws Exception { con = TestUtil.openDB(); assumeTrue(TestUtil.haveMinimumServerVersion(con, ServerVersion.v9_3)); Statement stmt = con.createStatement(); stmt.execute("CREATE DOMAIN testdom AS int4 CHECK (value < 10)"); TestUtil.createTable(con, "testerr", "id int not null, val testdom not null"); stmt.execute("ALTER TABLE testerr ADD CONSTRAINT testerr_pk PRIMARY KEY (id)"); stmt.close(); }

Target:
public void setUp() throws Exception { super.setUp(); assumeMinimumServerVersion(ServerVersion.v9_3); Statement stmt = con.createStatement(); stmt.execute("CREATE DOMAIN testdom AS int4 CHECK (value < 10)"); TestUtil.createTable(con, "testerr", "id int not null, val testdom not null"); stmt.execute("ALTER TABLE testerr ADD CONSTRAINT testerr_pk PRIMARY KEY (id)"); stmt.close(); }
Source:
public boolean run(CommandSender sender, Player sender_p, Command cmd, String commandLabel, String[] args, boolean senderIsConsole) { boolean smite = false; if (args.length >= 1) { if (args[0].equalsIgnoreCase("smite")) { TFM_Util.adminAction(sender.getName(), "Smiting all invisible players", true); smite = true; } else { return false; } } List<String> players = new ArrayList<String>(); int smites = 0; for (Player player : server.getOnlinePlayers()) { if (player.hasPotionEffect(PotionEffectType.INVISIBILITY)) { players.add(player.getName()); if (smite && !TFM_AdminList.isSuperAdmin(player)) { player.setHealth(0.0); smites++; } } } if (players.isEmpty()) { playerMsg("There are no invisible players"); return true; } if (smite) { playerMsg("Smitten " + smites + " players"); } else { playerMsg("Invisible players (" + players.size() + "): " + StringUtils.join(players, ", ")); } { if (args[0].equalsIgnoreCase("clear")) { TFM_Util.adminAction(sender.getName(), "Clearing all invis potion effect from all players", true); smite = true; } else { return false; } } for (Player player : server.getOnlinePlayers()) { if (player.hasPotionEffect(PotionEffectType.INVISIBILITY)) { { player.removePotionEffect((PotionEffectType.INVISIBILITY)); } } } return true; }

Target:
public boolean run(CommandSender sender, Player sender_p, Command cmd, String commandLabel, String[] args, boolean senderIsConsole) { boolean smite = false; if (args.length >= 1) { if (args[0].equalsIgnoreCase("smite")) { TFM_Util.adminAction(sender.getName(), "Smiting all invisible players", true); smite = true; } else { return false; } } List<String> players = new ArrayList<String>(); int smites = 0; for (Player player : server.getOnlinePlayers()) { if (player.hasPotionEffect(PotionEffectType.INVISIBILITY)) { players.add(player.getName()); if (smite && !TFM_AdminList.isSuperAdmin(player)) { player.setHealth(0.0); smites++; } } } if (players.isEmpty()) { playerMsg("There are no invisible players"); return true; } if (smite) { playerMsg("Smitten " + smites + " players"); } else { playerMsg("Invisible players (" + players.size() + "): " + StringUtils.join(players, ", ")); } { if (args[0].equalsIgnoreCase("clear")) { TFM_Util.adminAction(sender.getName(), "Clearing all invis potion effect from all players", true); } else { return false; } } for (Player player : server.getOnlinePlayers()) { if (player.hasPotionEffect(PotionEffectType.INVISIBILITY)) { { player.removePotionEffect((PotionEffectType.INVISIBILITY)); } } } return true; }
Source:
public void beforeCompletion(@NotNull CompletionInitializationContext context) { PsiFile file = context.getFile(); if (file.getFileType() != ErlangFileType.APP) return; int startOffset = context.getStartOffset(); PsiElement elementAt = file.findElementAt(startOffset); PsiElement parent = elementAt != null ? elementAt.getParent() : null; if (parent instanceof ErlangTupleExpression) { context.setDummyIdentifier("a"); } }

Target:
public void beforeCompletion(@NotNull CompletionInitializationContext context) { PsiFile file = context.getFile(); if (file.getFileType() != ErlangFileType.APP) return; int startOffset = context.getStartOffset(); PsiElement elementAt = file.findElementAt(startOffset); PsiElement parent = elementAt != null ? elementAt.getParent() : null; if (parent instanceof ErlangTupleExpression) { context.setDummyIdentifier(APPLICATION_KEYWORD); } }
Source:
public void updateBrand_doesNotFireEventWhenBrandIsSame() { Brand brand = Brand.CHOSEN; currentBrand.update(brand); Mockito.reset(eventBus); currentBrand.update(brand); verify(eventBus, never()).fireEventFromSource(isA(BrandChangedEvent.class), same(currentBrand)); }

Target:
public void updateBrand_doesNotFireEventWhenBrandIsSame() { Brand brand = Brand.CHOSEN; currentBrand.update(brand); Mockito.reset(eventBus); currentBrand.update(brand); verifyZeroInteractions(eventBus); }
Source:
private int stringToSurfaceRotation(String s) { if (s.equals("0")) { return Surface.ROTATION_0; } if (s.equals("90")) { return Surface.ROTATION_90; } if (s.equals("180")) { return Surface.ROTATION_180; } if (s.equals("270")) { return Surface.ROTATION_270; } throw new IllegalArgumentException("Unsupported surface rotation string '" + s + "'"); }

Target:
private static int stringToSurfaceRotation(String s) { if ("0".equals(s)) { return Surface.ROTATION_0; } if ("90".equals(s)) { return Surface.ROTATION_90; } if ("180".equals(s)) { return Surface.ROTATION_180; } if ("270".equals(s)) { return Surface.ROTATION_270; } throw new IllegalArgumentException("Unsupported surface rotation string '" + s + "'"); }
Source:
public void canSendCalendarParameters() throws IOException { DocumentModel testUser = userManager.getBareUserModel(); testUser.setProperty("user", "username", "existingMembers"); testUser = userManager.createUser(testUser); assertNotNull(testUser.getId()); txFeature.nextTransaction(); Document root = (Document) super.session.newRequest(FetchDocument.ID).set("value", "/").execute(); OperationRequest request = session.newRequest(AddPermission.ID); GregorianCalendar begin = new GregorianCalendar(2015, Calendar.JUNE, 20, 12, 34, 56); GregorianCalendar end = new GregorianCalendar(2015, Calendar.JULY, 14, 12, 34, 56); request.setInput(root) .set("username", "existingMembers") .set("permission", "Write") .set("begin", begin) .set("end", end) .execute(); userManager.deleteUser(testUser.getId()); }

Target:
public void canSendCalendarParameters() throws IOException { DocumentModel testUser = userManager.getBareUserModel(); testUser.setProperty("user", "username", "existingMembers"); testUser = userManager.createUser(testUser); assertNotNull(testUser.getId()); txFeature.nextTransaction(); try { Document root = (Document) super.session.newRequest(FetchDocument.ID).set("value", "/").execute(); OperationRequest request = session.newRequest(AddPermission.ID); GregorianCalendar begin = new GregorianCalendar(2015, Calendar.JUNE, 20, 12, 34, 56); GregorianCalendar end = new GregorianCalendar(2015, Calendar.JULY, 14, 12, 34, 56); request.setInput(root) .set("username", "existingMembers") .set("permission", "Write") .set("begin", begin) .set("end", end) .execute(); } finally { userManager.deleteUser(testUser.getId()); } }
Source:
public boolean isValidTokenLocalUser(int token, String username) throws TOTPException { KeyRepresentation encoding = KeyRepresentation.BASE32; try { if ("Base64".equals(TOTPUtil.getEncodingMethod())) { encoding = KeyRepresentation.BASE64; } } catch (IdentityApplicationManagementException e) { log.error("Error when reading the tenant encoding method"); } GoogleAuthenticatorConfig.GoogleAuthenticatorConfigBuilder gacb = new GoogleAuthenticatorConfig .GoogleAuthenticatorConfigBuilder() .setKeyRepresentation(encoding); GoogleAuthenticator googleAuthenticator = new GoogleAuthenticator(gacb.build()); try { int tenantId = IdentityUtil.getTenantIdOFUser(username); UserRealm userRealm = TOTPManagerComponent.getRealmService().getTenantUserRealm(tenantId); if (userRealm != null) { UserStoreManager userStoreManager = userRealm.getUserStoreManager(); String secretkey = userStoreManager.getUserClaimValue(MultitenantUtils.getTenantAwareUsername (username), Constants.SECRET_KEY, null); return googleAuthenticator.authorize(secretkey, token); } else { throw new TOTPException("Cannot find the user realm for the given tenant domain : " + CarbonContext .getThreadLocalCarbonContext().getTenantDomain()); } } catch (IdentityException e) { throw new TOTPException("TOTPTokenVerifier failed while trying to get the tenant ID of the user : " + username, e); } catch (UserStoreException e) { throw new TOTPException("TOTPTokenVerifier failed while trying to access userRealm of the user : " + username, e); } }

Target:
public boolean isValidTokenLocalUser(int token, String username) throws TOTPException { KeyRepresentation encoding = KeyRepresentation.BASE32; try { if (Constants.BASE64.equals(TOTPUtil.getEncodingMethod())) { encoding = KeyRepresentation.BASE64; } } catch (IdentityApplicationManagementException e) { log.error("Error when reading the tenant encoding method", e); } GoogleAuthenticatorConfig.GoogleAuthenticatorConfigBuilder gacb = new GoogleAuthenticatorConfig .GoogleAuthenticatorConfigBuilder() .setKeyRepresentation(encoding); GoogleAuthenticator googleAuthenticator = new GoogleAuthenticator(gacb.build()); try { int tenantId = IdentityUtil.getTenantIdOFUser(username); UserRealm userRealm = TOTPManagerComponent.getRealmService().getTenantUserRealm(tenantId); if (userRealm != null) { UserStoreManager userStoreManager = userRealm.getUserStoreManager(); String secretkey = userStoreManager.getUserClaimValue(MultitenantUtils.getTenantAwareUsername (username), Constants.SECRET_KEY_CLAIM_URL, null); return googleAuthenticator.authorize(secretkey, token); } else { throw new TOTPException("Cannot find the user realm for the given tenant domain : " + CarbonContext .getThreadLocalCarbonContext().getTenantDomain()); } } catch (IdentityException e) { throw new TOTPException("TOTPTokenVerifier failed while trying to get the tenant ID of the user : " + username, e); } catch (UserStoreException e) { throw new TOTPException("TOTPTokenVerifier failed while trying to access userRealm of the user : " + username, e); } }
Source:
public static void error(String message, Throwable throwable) { logError(Level.SEVERE, message, throwable); SlimefunPlugin.instance.getLogger().log(Level.SEVERE, message, throwable); }

Target:
public static void error(String message, Throwable throwable) { logError(Level.SEVERE, message, throwable); Slimefun.getLogger().log(Level.SEVERE, message, throwable); }
Source:
public BundleContext getBundleContext() { final Bundle bundle = FrameworkUtil.getBundle(this.getClass()); if (bundle != null) { return bundle.getBundleContext(); } else { return null; } }

Target:
private BundleContext getBundleContext() { final Bundle bundle = FrameworkUtil.getBundle(this.getClass()); if (bundle != null) { return bundle.getBundleContext(); } else { return null; } }
Source:
for (Class clazz : ApplyFunction.class.getClasses()) { if (!Modifier.isAbstract(clazz.getModifiers()) && ApplyFunction.class.isAssignableFrom(clazz)) { try { ApplyFunction function = (ApplyFunction) clazz.newInstance(); applyFunctionMap.put(StringUtils.toLowerCase(function.name()), function); } catch (Exception e) { log.info("failed to instantiate " + clazz.getName() + ".. ignoring", e); } } }

Target:
for (Class clazz : ApplyFunction.class.getClasses()) { if (!Modifier.isAbstract(clazz.getModifiers()) && ApplyFunction.class.isAssignableFrom(clazz)) { try { ApplyFunction function = (ApplyFunction) clazz.newInstance(); applyFunctionMap.put(StringUtils.toLowerCase(function.name()), function); } catch (Exception e) { log.error(e, "failed to instantiate %s.. ignoring", clazz.getName()); } } }
Source:
public void configure(Binder binder) { this.binder = requireNonNull(binder, "binder is null"); configBinder(binder).bindConfig(KerberosConfig.class); configBinder(binder).bindConfig(HttpClientConfig.class, annotation, name); configBinder(binder).bindConfig(JettyIoPoolConfig.class); binder.bind(JettyIoPoolManager.class).to(SharedJettyIoPoolManager.class).in(Scopes.SINGLETON); binder.bind(QueuedThreadPoolMBean.class) .toProvider(QueuedThreadPoolMBeanProvider.class) .in(SINGLETON); newExporter(binder).export(QueuedThreadPoolMBean.class) .as(generatedNameOf(QueuedThreadPool.class, "shared_" + annotation.getSimpleName())); binder.bind(HttpClient.class).annotatedWith(annotation).toProvider(new HttpClientProvider(name, annotation)).in(SINGLETON); newSetBinder(binder, HttpRequestFilter.class, GlobalFilter.class); newSetBinder(binder, HttpRequestFilter.class, annotation); newExporter(binder).export(HttpClient.class).annotatedWith(annotation).withGeneratedName(); }

Target:
public void configure(Binder binder) { this.binder = requireNonNull(binder, "binder is null"); configBinder(binder).bindConfig(KerberosConfig.class); configBinder(binder).bindConfig(HttpClientConfig.class, annotation, name); binder.install(JETTY_SHARED_IO_POOL_MODULE); binder.bind(HttpClient.class).annotatedWith(annotation).toProvider(new HttpClientProvider(name, annotation)).in(Scopes.SINGLETON); newSetBinder(binder, HttpRequestFilter.class, GlobalFilter.class); newSetBinder(binder, HttpRequestFilter.class, annotation); newExporter(binder).export(HttpClient.class).annotatedWith(annotation).withGeneratedName(); }
Source:
public String toString(){ return mComponent; }

Target:
public String toString() { return component; }