auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
protected LinkedHashMap<String, U> retrieveAll(final boolean readFromSession) { return super.retrieveAll(readFromSession).entrySet().stream().filter( it -> it.getValue() .getAttribute(SESSION_CLIENT_ID) .equals(context.getRequestParameter(REQUEST_CLIENT_ID))) .collect(Collectors.toMap( Map.Entry::getKey, Map.Entry::getValue, (v1, v2) -> { throw new IllegalStateException("Duplicate key"); }, LinkedHashMap::new)); }

Target:
protected LinkedHashMap<String, U> retrieveAll(final boolean readFromSession) { return super.retrieveAll(readFromSession).entrySet().stream().filter( it -> it.getValue() .getAuthenticationAttribute(SESSION_CLIENT_ID) .equals(context.getRequestParameter(REQUEST_CLIENT_ID))) .collect(Collectors.toMap( Map.Entry::getKey, Map.Entry::getValue, (v1, v2) -> { throw new IllegalStateException("Duplicate key"); }, LinkedHashMap::new)); }
Source:
public void eventDispatched(IStartedDMEvent event) { if (event instanceof org.eclipse.cdt.dsf.gdb.service.GDBProcesses_7_0.ContainerStartedDMEvent) { handleContainerStartedEvent(event.getDMContext()); } else if (event instanceof org.eclipse.cdt.dsf.mi.service.MIProcesses.ContainerStartedDMEvent) { handleContainerStartedEvent(event.getDMContext()); } }

Target:
public void eventDispatched(IStartedDMEvent event) { if (event.getDMContext() instanceof IContainerDMContext) { IMemoryDMContext memoryDmc = DMContexts.getAncestorOfType(event.getDMContext(), IMemoryDMContext.class); if (memoryDmc != null) { initialize(memoryDmc); } } }
Source:
public void initializationAlwaysFailsAfterTheFirstAsynchronousTry() { AlwaysFailingInitializer initializer = new AlwaysFailingInitializer(); initializer.initialize(true); assertThatThrownBy(() -> initializer.initialize(false)) .isInstanceOf(IllegalStateException.class) .hasMessageContaining("Multiple calls tried to initialize the same instance."); tickSchedulerFiveTimes(initializer); assertThat(initializer.initializationAttempts).isEqualTo(1 + 5); }

Target:
public void initializationAlwaysFailsAfterTheFirstAsynchronousTry() { AlwaysFailingInitializer initializer = new AlwaysFailingInitializer(); initializer.initialize(true); assertThatThrownBy(() -> initializer.initialize(false)) .isInstanceOf(IllegalStateException.class) .hasMessageContaining("Multiple calls tried to initialize the same instance."); tickSchedulerFiveTimes(initializer); assertThat(initializer.initializationAttempts).isEqualTo(1 + FIVE); }
Source:
private MeetingSchedule getMeetingSchedule(int numberOfEntities) { MeetingSchedule solution = new MeetingSchedule(); MeetingWeightPack parametrization = new MeetingWeightPack(); parametrization.setId(0L); solution.setWeightPack(parametrization); List<Meeting> meetingList = new ArrayList<>(); List<Day> dayList = new ArrayList<>(); List<TimeGrain> timeGrainList = new ArrayList<>(); List<Room> roomList = new ArrayList<>(); List<Person> personList = new ArrayList<>(); List<MeetingAssignment> meetingAssignmentList = new ArrayList<>(); for (int i = 0; i < numberOfEntities; i++) { Meeting m = new Meeting(); m.setId((long) i); m.setTopic("meeting" + i); meetingList.add(m); Day d = new Day(); d.setId((long) i); d.setDayOfYear(i+1); dayList.add(d); TimeGrain t = new TimeGrain(); t.setId((long) i); t.setGrainIndex(i); t.setDay(dayList.get(0)); t.setStartingMinuteOfDay(i * TimeGrain.GRAIN_LENGTH_IN_MINUTES); timeGrainList.add(t); Room r = new Room(); r.setId((long) i); r.setName("room" + i); roomList.add(r); Person p = new Person(); p.setId((long) i); p.setFullName("person" + i); personList.add(p); MeetingAssignment ma = new MeetingAssignment(); ma.setId((long) i); meetingAssignmentList.add(ma); } solution.setRoomList(roomList); solution.setTimeGrainList(timeGrainList); solution.setDayList(dayList); solution.setPersonList(personList); solution.setMeetingList(meetingList); solution.setMeetingAssignmentList(meetingAssignmentList); return solution; }

Target:
private MeetingSchedule getMeetingSchedule(int numberOfEntities) { MeetingSchedule solution = new MeetingSchedule(); MeetingConstraintConfiguration constraintConfiguration = new MeetingConstraintConfiguration(); constraintConfiguration.setId(0L); solution.setConstraintConfiguration(constraintConfiguration); List<Meeting> meetingList = new ArrayList<>(); List<Day> dayList = new ArrayList<>(); List<TimeGrain> timeGrainList = new ArrayList<>(); List<Room> roomList = new ArrayList<>(); List<Person> personList = new ArrayList<>(); List<MeetingAssignment> meetingAssignmentList = new ArrayList<>(); for (int i = 0; i < numberOfEntities; i++) { Meeting m = new Meeting(); m.setId((long) i); m.setTopic("meeting" + i); meetingList.add(m); Day d = new Day(); d.setId((long) i); d.setDayOfYear(i+1); dayList.add(d); TimeGrain t = new TimeGrain(); t.setId((long) i); t.setGrainIndex(i); t.setDay(dayList.get(0)); t.setStartingMinuteOfDay(i * TimeGrain.GRAIN_LENGTH_IN_MINUTES); timeGrainList.add(t); Room r = new Room(); r.setId((long) i); r.setName("room" + i); roomList.add(r); Person p = new Person(); p.setId((long) i); p.setFullName("person" + i); personList.add(p); MeetingAssignment ma = new MeetingAssignment(); ma.setId((long) i); meetingAssignmentList.add(ma); } solution.setRoomList(roomList); solution.setTimeGrainList(timeGrainList); solution.setDayList(dayList); solution.setPersonList(personList); solution.setMeetingList(meetingList); solution.setMeetingAssignmentList(meetingAssignmentList); return solution; }
Source:
private void countRows(long[] rowCount, ShardResponse response) { updateOrFail(rowCount, response, (a,b) -> a[0] += 1); }

Target:
private void countRows(long[] rowCount, ShardResponse response) { updateOrFail(rowCount, response, (acc,b) -> acc[0] += 1); }
Source:
public Response getIncompleteTasks() { final List<TaskResponseObject> incompleteTasks = Lists.transform( taskStorageQueryAdapter.getActiveTasks(), new Function<Task, TaskResponseObject>() { @Nullable @Override public TaskResponseObject apply(Task task) { return new TaskResponseObject( task.getId(), new DateTime(0), new DateTime(0), Optional.<TaskStatus>absent() ); } } ); return Response.ok(incompleteTasks).build(); }

Target:
public Response getIncompleteTasks() { final List<TaskResponseObject> incompleteTasks = Lists.transform( taskStorageQueryAdapter.getActiveTasks(), new Function<Task, TaskResponseObject>() { @Nullable @Override public TaskResponseObject apply(Task task) { return new TaskResponseObject( task.getId(), new DateTime(0), new DateTime(0), Optional.<TaskStatus>absent(), TaskLocation.unknown() ); } } ); return Response.ok(incompleteTasks).build(); }
Source:
private static Repository getRepositoryOfProjects(Collection<?> collection, boolean single) { Repository repo = null; for (Object element : collection) { IProject project = AdapterUtils.adapt(element, IProject.class); if (project != null) { Repository r = getRepositoryOfMapping(project); if (single && r != null && repo != null && r != repo) return null; else if (r != null) repo = r; } else { IContainer container = AdapterUtils.adapt(element, IContainer.class); RepositoryMapping mapping = null; if (container != null) { mapping = RepositoryMapping.getMapping(container); } if (container != null && mapping != null && container.equals(mapping.getContainer())) { Repository r = mapping.getRepository(); if (single && r != null && repo != null && r != repo) return null; else if (r != null) repo = r; } else { IWorkingSet workingSet = AdapterUtils.adapt(element, IWorkingSet.class); if (workingSet != null) { for (IAdaptable adaptable : workingSet.getElements()) { Repository r = getRepositoryOfProject(adaptable); if (single && r != null && repo != null && r != repo) return null; else if (r != null) repo = r; } } } } } return repo; }

Target:
private static Repository getRepositoryOfProjects(Collection<?> collection, boolean single) { Repository repo = null; for (Object element : collection) { IProject project = AdapterUtils.adapt(element, IProject.class); if (project != null) { Repository r = getRepositoryOfMapping(project); if (single && r != null && repo != null && r != repo) { return null; } else if (r != null) { repo = r; } } else { IContainer container = AdapterUtils.adapt(element, IContainer.class); RepositoryMapping mapping = null; if (container != null) { mapping = RepositoryMapping.getMapping(container); } if (container != null && mapping != null && container.equals(mapping.getContainer())) { Repository r = mapping.getRepository(); if (single && r != null && repo != null && r != repo) { return null; } else if (r != null) { repo = r; } } else { IWorkingSet workingSet = AdapterUtils.adapt(element, IWorkingSet.class); if (workingSet != null) { for (IAdaptable adaptable : workingSet.getElements()) { Repository r = getRepositoryOfProject(adaptable); if (single && r != null && repo != null && r != repo) { return null; } else if (r != null) { repo = r; } } } } } } return repo; }
Source:
public Vector2i getPreferredContentSize(Canvas canvas, Vector2i sizeHint) { if (currentImage.get() != null) { return currentImage.get().getPreferredContentSize(canvas, sizeHint); } return Vector2i.zero(); }

Target:
public Vector2i getPreferredContentSize(Canvas canvas, Vector2i sizeHint) { if (images.get(index) != null) { return images.get(index).getPreferredContentSize(canvas, sizeHint); } return Vector2i.zero(); }
Source:
private BlobStoreStats setupBlobStoreStats(int bucketCount, long logSegmentForecastOffsetMs) { return new BlobStoreStats("", state.index, bucketCount, BUCKET_SPAN_IN_MS, logSegmentForecastOffsetMs, QUEUE_PROCESSOR_PERIOD_IN_SECS, Time.SecsPerMin, state.time, indexScannerScheduler, queueProcessorScheduler, diskIOScheduler, METRICS); }

Target:
private BlobStoreStats setupBlobStoreStats(int bucketCount, long logSegmentForecastOffsetMs) { return new BlobStoreStats("", state.index, bucketCount, BUCKET_SPAN_IN_MS, logSegmentForecastOffsetMs, QUEUE_PROCESSOR_PERIOD_IN_Ms, DEFAULT_WAIT_TIMEOUT_SECS, state.time, indexScannerScheduler, queueProcessorScheduler, diskIOScheduler, METRICS); }
Source:
private static Intent helper_baseHMSOpenIntent() { return new Intent() .setFlags(Intent.FLAG_ACTIVITY_NO_HISTORY | Intent.FLAG_ACTIVITY_CLEAR_WHEN_TASK_RESET | Intent.FLAG_ACTIVITY_MULTIPLE_TASK | Intent.FLAG_ACTIVITY_NEW_TASK) .setAction("android.intent.action.VIEW"); }

Target:
private static Intent helper_baseHMSOpenIntent() { return new Intent() .setFlags(Intent.FLAG_ACTIVITY_NO_HISTORY | Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_MULTIPLE_TASK) .setAction("android.intent.action.VIEW"); }
Source:
private void deleteFileOrLog(File file, Attachable object, FileAttachment attachment) { if (!file.delete()) { log.error(String.format("File no longer associated with an object, but failed to delete: %s%s from %s %d", file.getName(), (attachment == null ? "" : " (" + attachment.getFilename() + ")"), attachment.getFilename(), object.getAttachmentsTarget(), object.getId())); } }

Target:
private void deleteFileOrLog(File file, Attachable object, FileAttachment attachment) { if (!file.delete()) { log.error("File no longer associated with an object, but failed to delete: {}{} from {}", new Object[] { file.getName(), (attachment == null ? "" : " (" + attachment.getFilename() + ")"), object.getAttachmentsTarget(), Long.valueOf(object.getId()) }); } }
Source:
public static String normalizeMethodSignature(String requestURL, String method) { if (requestURL.startsWith("/repo/v1") || requestURL.startsWith("/file/v1") || requestURL.startsWith("/auth/v1")) { requestURL = requestURL.substring(8); } Matcher matcher = NUMERIC_PARAM_PATTERN.matcher(requestURL); StringBuffer buffer = new StringBuffer(); while (matcher.find()) { matcher.appendReplacement(buffer, NUMBER_REPLACEMENT); } matcher.appendTail(buffer); return method + " " + buffer; }

Target:
public static String normalizeMethodSignature(String requestURL, String method) { requestURL = requestURL.toLowerCase(); if (requestURL.startsWith(REPO_V1) || requestURL.startsWith(FILE_V1) || requestURL.startsWith(AUTH_V1)) { requestURL = requestURL.substring(8); } Matcher matcher = NUMERIC_PARAM_PATTERN.matcher(requestURL); StringBuffer buffer = new StringBuffer(); while (matcher.find()) { matcher.appendReplacement(buffer, NUMBER_REPLACEMENT); } matcher.appendTail(buffer); return method + " " + buffer; }
Source:
public JSONArray put(String index, JSONArray values) { if (values.length() == 2 && index != null) { synchronized (mConcurrentLock) { return mVars.put(index, values); } } Logy.d(LOGGER_TAG, "value length should be equal 2"); return null; }

Target:
public JSONArray put(String index, JSONArray values) { if (values.length() != 2 || index == null) { Logy.d(LOGGER_TAG, "values.length() should be equal 2"); return null; } return mVars.put(index, values); }
Source:
private Object decodeNtcb(Channel channel, SocketAddress remoteAddress, ByteBuf buf) { prefix = buf.toString(buf.readerIndex(), 4, StandardCharsets.US_ASCII); buf.skipBytes(prefix.length()); serverId = buf.readUnsignedIntLE(); deviceUniqueId = buf.readUnsignedIntLE(); int length = buf.readUnsignedShortLE(); buf.skipBytes(2); if (length == 0) { return null; } String type = buf.toString(buf.readerIndex(), 3, StandardCharsets.US_ASCII); buf.skipBytes(type.length()); if (type.equals("*>S")) { return processHandshake(channel, remoteAddress, buf); } else { DeviceSession deviceSession = getDeviceSession(channel, remoteAddress); if (deviceSession != null) { try { switch (type) { case "*>A": return processNtcbArray(deviceSession, channel, buf); case "*>T": return processNtcbSingle(deviceSession, channel, buf); case "*>F": buf.skipBytes(3); return processFlexNegotiation(channel, buf); default: break; } } catch (IndexOutOfBoundsException error) { LOGGER.warn("Navis NTCB message parsing error", error); } } } return null; }

Target:
private Object decodeNtcb(Channel channel, SocketAddress remoteAddress, ByteBuf buf) { prefix = buf.toString(buf.readerIndex(), 4, StandardCharsets.US_ASCII); buf.skipBytes(prefix.length()); serverId = buf.readUnsignedIntLE(); deviceUniqueId = buf.readUnsignedIntLE(); int length = buf.readUnsignedShortLE(); buf.skipBytes(2); if (length == 0) { return null; } String type = buf.toString(buf.readerIndex(), 3, StandardCharsets.US_ASCII); buf.skipBytes(type.length()); if (type.equals("*>S")) { return processHandshake(channel, remoteAddress, buf); } else { DeviceSession deviceSession = getDeviceSession(channel, remoteAddress); if (deviceSession != null) { switch (type) { case "*>A": return processNtcbArray(deviceSession, channel, buf); case "*>T": return processNtcbSingle(deviceSession, channel, buf); case "*>F": buf.skipBytes(3); return processFlexNegotiation(channel, buf); default: break; } } } return null; }
Source:
public void intercept(SimpleInterceptorStack stack) { addRedirectListener(); EntityTransaction transaction = null; try { transaction = entityManager.getTransaction(); transaction.begin(); stack.next(); if (!validator.hasErrors() && transaction.isActive()) { transaction.commit(); } } finally { if (transaction != null && transaction.isActive()) { transaction.rollback(); } } }

Target:
public void intercept(SimpleInterceptorStack stack) { addRedirectListener(); EntityTransaction transaction = null; try { transaction = entityManager.getTransaction(); transaction.begin(); stack.next(); commit(transaction); } finally { if (transaction != null && transaction.isActive()) { transaction.rollback(); } } }
Source:
public boolean isInteresting(String project, String branch, String topic, List<String> files) { if (compareType.matches(pattern, project)) { for (Branch b : branches) { boolean foundInterestingForbidden = false; boolean foundInterestingTopicOrFile = false; if (b.isInteresting(branch)) { if (forbiddenFilePaths != null) { for (FilePath ffp : forbiddenFilePaths) { if (ffp.isInteresting(files)) { foundInterestingForbidden = true; break; } } } if (isInterestingTopic(topic) && isInterestingFile(files)) { foundInterestingTopicOrFile = true; } if (disableStrictForbiddenFileVerification) { return foundInterestingTopicOrFile; } else { if (foundInterestingForbidden && foundInterestingTopicOrFile) { return false; } if (!foundInterestingForbidden && foundInterestingTopicOrFile) { return true; } } } } } return false; }

Target:
public boolean isInteresting(String project, String branch, String topic, List<String> files) { if (compareType.matches(pattern, project)) { for (Branch b : branches) { boolean foundInterestingForbidden = false; boolean foundInterestingTopicOrFile = false; if (b.isInteresting(branch)) { if (forbiddenFilePaths != null) { for (FilePath ffp : forbiddenFilePaths) { if (ffp.isInteresting(files)) { foundInterestingForbidden = true; break; } } } if (isInterestingTopic(topic) && isInterestingFile(files)) { foundInterestingTopicOrFile = true; } if (disableStrictForbiddenFileVerification) { return foundInterestingTopicOrFile; } else { if (foundInterestingForbidden) { return false; } else if (foundInterestingTopicOrFile) { return true; } } } } } return false; }
Source:
private void discardEntity(HttpResponse httpResponse, Materializer materializer) { final HttpMessage.DiscardedEntity discarded = httpResponse.discardEntityBytes(materializer); discarded.completionStage() .whenComplete((done, ex) -> log.info("Entity discarded completely!")); }

Target:
private void discardEntity(HttpResponse httpResponse, Materializer materializer) { httpResponse.discardEntityBytes(materializer) .completionStage() .whenComplete((done, ex) -> log.info("Entity discarded completely!")); }
Source:
public List<AddOn> getMarketplaceAddOns() { AddOnCollection aoc = this.getLatestVersionInfo(); if (aoc != null) { return aoc.getAddOns(); } return new ArrayList<AddOn>(); }

Target:
protected List<AddOn> getMarketplaceAddOns() { AddOnCollection aoc = this.getLatestVersionInfo(); if (aoc != null) { return aoc.getAddOns(); } return Collections.<AddOn>emptyList(); }
Source:
static void pruneParentDirectories(final MantaClient client, final MantaHttpHeaders headers, final String path, final int limit) throws IOException { client.delete(path, headers, null); int actualLimit = limit; if (actualLimit == PRUNE_ALL_PARENTS) { actualLimit = path.split(MantaClient.SEPARATOR).length - 1; } LOG.debug("Actual Number : " + actualLimit + " of directories"); String parent = path; try { for (int i = 0; i < actualLimit; i++) { parent = parent.substring(0, parent.lastIndexOf("/")); client.delete(parent, headers, null); } } catch (MantaClientHttpResponseException responseException) { if (responseException.getServerCode() != MantaErrorCode.DIRECTORY_NOT_EMPTY_ERROR) { throw responseException; } } }

Target:
static void pruneParentDirectories(final MantaClient client, final MantaHttpHeaders headers, final String path, final int limit) throws IOException { client.delete(path, headers, null); String[] directories = MantaUtils.writeablePrefixPaths(path); ArrayUtils.reverse(directories); directories = ArrayUtils.remove(directories, 0); int actualLimit = limit; if (actualLimit > directories.length || actualLimit == PRUNE_ALL_PARENTS) { actualLimit = directories.length; } for (int i = 0; i < actualLimit; i++) { try { LOG.debug("************ Deleting Index : " + i + " name " + directories[i]); client.delete(directories[i], headers, null); } catch (MantaClientHttpResponseException responseException) { if (responseException.getServerCode().equals(MantaErrorCode.RESOURCE_NOT_FOUND_ERROR)) { continue; } else if (responseException.getServerCode() != MantaErrorCode.DIRECTORY_NOT_EMPTY_ERROR) { throw responseException; } } } }
Source:
public void onBindViewHolder(ProviderViewHolder holder, int position) { final Provider provider = mItems.get(position); if (provider.getPerson().getDisplay() != null) { holder.mName.setText(provider.getPerson().getDisplay()); } if (provider.getIdentifier() != null) { holder.mIdentifier.setText(provider.getIdentifier()); } holder.deleteIv.setOnClickListener(v -> { createDeleteDialogBox(provider); }); holder.editIv.setOnClickListener(v -> { Intent intent = new Intent(fragment.getContext(),AddProviderActivity.class); ArrayList<Provider> providerArrayList = new ArrayList<>(mItems); intent.putExtra(ApplicationConstants.BundleKeys.EXISTING_PROVIDERS_BUNDLE,providerArrayList); intent.putExtra(ApplicationConstants.BundleKeys.PROVIDER_ID_BUNDLE, provider); fragment.startActivityForResult(intent, EDIT_PROVIDER_REQ_CODE); }); }

Target:
public void onBindViewHolder(ProviderViewHolder holder, int position) { final Provider provider = mItems.get(position); if (provider.getPerson().getDisplay() != null) { holder.mName.setText(provider.getPerson().getDisplay()); } if (provider.getIdentifier() != null) { holder.mIdentifier.setText(provider.getIdentifier()); } holder.deleteIv.setOnClickListener(view -> { createDeleteDialogBox(provider); }); holder.editIv.setOnClickListener(view -> { Intent intent = new Intent(fragment.getContext(), AddProviderActivity.class); ArrayList<Provider> providerArrayList = new ArrayList<>(mItems); intent.putExtra(ApplicationConstants.BundleKeys.EXISTING_PROVIDERS_BUNDLE, providerArrayList); intent.putExtra(ApplicationConstants.BundleKeys.PROVIDER_ID_BUNDLE, provider); fragment.startActivityForResult(intent, EDIT_PROVIDER_REQ_CODE); }); }
Source:
public <T> void addTask( ScheduledTask<T> task ) { if ( RunNowSchedule.class.isAssignableFrom( task.getSchedule().getClass() ) ) { return; } synchronized ( applicationConfiguration ) { List<CScheduledTask> tasks = getCurrentConfiguration( true ); CScheduledTask foundTask = findTask( task.getId(), tasks ); CScheduledTask storeableTask = translateFrom( task ); if ( storeableTask != null ) { if ( foundTask != null ) { tasks.remove( foundTask ); storeableTask.setLastRun( foundTask.getLastRun() ); } tasks.add( storeableTask ); } if ( NXCM4979DEBUG ) { logger.info( "Task with ID={} added, config modified.", task.getId(), storeableTask != null ? "IS" : "is NOT", new Exception( "This is an exception only to provide caller backtrace" ) ); } try { applicationConfiguration.saveConfiguration(); } catch ( IOException e ) { logger.warn( "Could not save task changes!", e ); } } }

Target:
public <T> void addTask( ScheduledTask<T> task ) { if ( RunNowSchedule.class.isAssignableFrom( task.getSchedule().getClass() ) ) { return; } synchronized ( applicationConfiguration ) { List<CScheduledTask> tasks = getCurrentConfiguration( true ); CScheduledTask foundTask = findTask( task.getId(), tasks ); CScheduledTask storeableTask = translateFrom( task ); if ( storeableTask != null ) { if ( foundTask != null ) { tasks.remove( foundTask ); storeableTask.setLastRun( foundTask.getLastRun() ); } tasks.add( storeableTask ); } if ( logger.isTraceEnabled() ) { logger.trace( "Task with ID={} added, config modified.", task.getId(), storeableTask != null ? "IS" : "is NOT", new Exception( "This is an exception only to provide caller backtrace" ) ); } try { applicationConfiguration.saveConfiguration(); } catch ( IOException e ) { logger.warn( "Could not save task changes!", e ); } } }
Source:
protected void setHeader() { String degreeRegistrationDiploma = BundleUtil.getString(Bundle.ACADEMIC, getLocale(), "label.phd.registryDiploma.degreeRegistrationDiploma"); final LocalizedString graduationLevel = getDocumentRequest().getProgramConclusion().getGraduationLevel(); if (!graduationLevel.isEmpty()) { degreeRegistrationDiploma = Joiner.on(" ").join(degreeRegistrationDiploma, BundleUtil.getLocalizedString(Bundle.ACADEMIC, "label.of.both").getContent(getLocale()), graduationLevel.getContent(getLocale())); } addParameter("degreeRegistrationDiploma", degreeRegistrationDiploma); addParameter("portugueseRepublic_1", BundleUtil.getString(Bundle.ACADEMIC, getLocale(), "label.phd.registryDiploma.portugueseRepublic.part1")); addParameter("portugueseRepublic_2", BundleUtil.getString(Bundle.ACADEMIC, getLocale(), "label.phd.registryDiploma.portugueseRepublic.part2")); }

Target:
protected void setHeader() { String degreeRegistrationDiploma = BundleUtil.getString(Bundle.ACADEMIC, getLocale(), "label.phd.registryDiploma.degreeRegistrationDiploma"); final LocalizedString graduationLevel = getDocumentRequest().getProgramConclusion().getGraduationLevel(); if (!graduationLevel.isEmpty()) { degreeRegistrationDiploma = Joiner.on(" ").join(degreeRegistrationDiploma, BundleUtil.getString(Bundle.ACADEMIC, getLocale(), "label.of.both"), graduationLevel.getContent(getLocale())); } addParameter("degreeRegistrationDiploma", degreeRegistrationDiploma); addParameter("portugueseRepublic_1", BundleUtil.getString(Bundle.ACADEMIC, getLocale(), "label.phd.registryDiploma.portugueseRepublic.part1")); addParameter("portugueseRepublic_2", BundleUtil.getString(Bundle.ACADEMIC, getLocale(), "label.phd.registryDiploma.portugueseRepublic.part2")); }
Source:
public void testGetUrlAsString() throws Exception { String md5 = IOUtils.getUrlAsString(file2url(getTestResource("test-jar-1.0.zip.md5"))); assertNotNull(md5); if (md5.length() == 34) assertEquals(md5, "beec1608cf997d3acb42f0ab772b143f\r\n"); else assertEquals(md5, "beec1608cf997d3acb42f0ab772b143f\n"); }

Target:
public void testGetUrlAsString() throws Exception { String md5 = IOUtils.getUrlAsString(file2url(getTestResource("test-jar-1.0.zip.md5"))); assertNotNull(md5); assertEquals(md5.trim(), "beec1608cf997d3acb42f0ab772b143f"); }
Source:
public String toString() { return new String(b, CHARSET); }

Target:
public String toString() { if (s == null) { s = new String(b, CHARSET); } return s; }
Source:
public void testRefLocation() throws Exception { File repository = new File(verifier.getBasedir(), "target/repository"); assertThat(new File(repository, "content.xml.xz"), isFile()); assertThat(new File(repository, "artifacts.xml.xz"), isFile()); assertThat(new File(repository, "p2.index"), isFile()); assertThat(new File(repository, "category.xml"), isFile()); }

Target:
public void testRefLocation() throws Exception { File repository = new File(verifier.getBasedir(), "target/repository"); assertThat(new File(repository, "content.xml"), isFile()); File artifactXml = new File(repository, "artifacts.xml"); assertThat(artifactXml, isFile()); assertThat(new File(repository, "category.xml"), isFile()); Map<String, String> expected = new HashMap<>(3, 1.f); expected.put("p2.statsURI", "<LINK_0>"); expected.put("p2.mirrorsURL", "<LINK_0>.else"); expected.put("foo", "bar"); Document artifactsDocument = XMLParser.parse(artifactXml); artifactsDocument.getChild("repository").getChild("properties").getChildren("property").forEach(element -> { String propertyName = element.getAttributeValue("name"); if (expected.containsKey(propertyName) && expected.get(propertyName).equals(element.getAttributeValue("value"))) { expected.remove(propertyName); } }); assertEquals("Missing properties in artifact repository", Collections.emptyMap(), expected); }
Source:
protected AbstractGraphDecorator(Graph g) { if (g == null) { throw new NullPointerException("g may not be null."); } this.inner = g; }

Target:
protected AbstractGraphDecorator(Graph g) { if (g == null) { throw new IllegalArgumentException("g may not be null."); } this.inner = g; }
Source:
public void selectVideosOnly() { filterVideos.click(); }

Target:
public void selectVideosOnly() { filterVideos.click(); PageObjectLogging.log("selectVideosOnly", "Videos option is selected", true, driver); }
Source:
public void buildListOfRowKeyColumnExpressionsSingleNodeComparisonTest() throws Exception { List<Expression> expressions = new ArrayList<>(); RowKeyColumnExpression rvc1 = new RowKeyColumnExpression(); RowKeyColumnExpression rvc2 = new RowKeyColumnExpression(); ComparisonExpression expression1 = mock(ComparisonExpression.class); Mockito.when(expression1.getChildren()).thenReturn(Lists.<Expression>newArrayList(rvc1)); List<RowKeyColumnExpression> result = offsetCompiler.buildListOfRowKeyColumnExpressions(expression1, false); assertEquals(1,result.size()); assertEquals(rvc1,result.get(0)); }

Target:
public void buildListOfRowKeyColumnExpressionsSingleNodeComparisonTest() throws Exception { List<Expression> expressions = new ArrayList<>(); RowKeyColumnExpression rvc = new RowKeyColumnExpression(); ComparisonExpression expression = mock(ComparisonExpression.class); Mockito.when(expression.getChildren()).thenReturn(Lists.<Expression>newArrayList(rvc)); List<RowKeyColumnExpression> result = offsetCompiler.buildListOfRowKeyColumnExpressions(expression, false); assertEquals(1,result.size()); assertEquals(rvc,result.get(0)); }
Source:
ExpressionOrColumn(int aIndexEntryNumber, StmtTableScan tableScan, AbstractExpression expr, SortDirectionType sortDir, ColumnRef colRef) { assert (expr == null) == (colRef != null); assert colRef == null || tableScan != null; m_expr = expr; m_colRef = colRef; m_indexKeyComponentPosition = aIndexEntryNumber; m_tableScan = tableScan; m_sortDirection = sortDir; }

Target:
ExpressionOrColumn(int aIndexEntryNumber, StmtTableScan tableScan, AbstractExpression expr, SortDirectionType sortDir, ColumnRef colRef) { Preconditions.checkArgument((expr == null) == (colRef != null), "Exactly one of argument expr or colRef must be null."); Preconditions.checkArgument(colRef == null || tableScan != null, "When argument colRef is null, tableScan cannot be null."); m_expr = expr; m_colRef = colRef; m_indexKeyComponentPosition = aIndexEntryNumber; m_tableScan = tableScan; m_sortDirection = sortDir; }
Source:
public boolean createIndex(String indexName) { Assert.notNull(indexName, "No index defined for Query"); try { CreateIndexRequest indexRequest = createIndexRequest(indexName); return client.indices().create(indexRequest, RequestOptions.DEFAULT).isAcknowledged(); } catch (Exception e) { throw new ElasticsearchException("Failed to create index " + indexName, e); } }

Target:
public boolean createIndex(String indexName) { Assert.notNull(indexName, "No index defined for Query"); try { return client.indices().create(createIndexRequest(indexName), RequestOptions.DEFAULT).isAcknowledged(); } catch (Exception e) { throw new ElasticsearchException("Failed to create index " + indexName, e); } }
Source:
public String[] collect(int relativeDocId) { sortedSetDocValues.setDocument( relativeDocId ); int valueCount = safeLongToInt( sortedSetDocValues.getValueCount() ); String[] values = new String[valueCount]; BytesRef bytesRef = new BytesRef(); for ( int i = 0; i < valueCount; i++ ) { long ordinal = sortedSetDocValues.nextOrd(); if ( ordinal == SortedSetDocValues.NO_MORE_ORDS ) { break; } sortedSetDocValues.lookupOrd( ordinal, bytesRef ); values[i] = bytesRef.utf8ToString(); } return values; }

Target:
public String[] collect(int relativeDocId) { sortedSetDocValues.setDocument( relativeDocId ); int valueCount = safeLongToInt( sortedSetDocValues.getValueCount() ); String[] values = new String[valueCount]; BytesRef bytesRef = new BytesRef(); int i; for ( i = 0; i < valueCount; i++ ) { long ordinal = sortedSetDocValues.nextOrd(); if ( ordinal == SortedSetDocValues.NO_MORE_ORDS ) { break; } sortedSetDocValues.lookupOrd( ordinal, bytesRef ); values[i] = bytesRef.utf8ToString(); } return Arrays.copyOf( values, i ); }
Source:
public WriteAttributesRequest(String path, ObserveSpec observeSpec) { this(newPath(path), new AttributeSet(observeSpec.toQueryParams())); }

Target:
public WriteAttributesRequest(String path, ObserveSpec observeSpec) throws InvalidRequestException { this(newPath(path), new AttributeSet(observeSpec.toQueryParams())); }
Source:
public static String getCurveName(String curveOid) { switch (curveOid) { case "1.2.840.10045.3.1.7": return "nistp256"; case "1.3.132.0.34": return "nistp384"; case "1.3.132.0.35": return "nistp521"; ENDED curves case "1.3.132.0.1": return "1.3.132.0.1"; case "1.2.840.10045.3.1.1": return "1.2.840.10045.3.1.1"; case "1.3.132.0.33": return "1.3.132.0.33"; case "1.3.132.0.26": return "1.3.132.0.26"; case "1.3.132.0.27": return "1.3.132.0.27"; case "1.3.132.0.16": return "1.3.132.0.16"; case "1.3.132.0.36": return "1.3.132.0.36"; case "1.3.132.0.37": return "1.3.132.0.37"; case "1.3.132.0.38": return "1.3.132.0.38"; default: return null; } }

Target:
public static String getCurveName(String curveOid) throws NoSuchAlgorithmException { switch (curveOid) { case "1.2.840.10045.3.1.7": return "nistp256"; case "1.3.132.0.34": return "nistp384"; case "1.3.132.0.35": return "nistp521"; ENDED curves case "1.3.132.0.1": return "1.3.132.0.1"; case "1.2.840.10045.3.1.1": return "1.2.840.10045.3.1.1"; case "1.3.132.0.33": return "1.3.132.0.33"; case "1.3.132.0.26": return "1.3.132.0.26"; case "1.3.132.0.27": return "1.3.132.0.27"; case "1.3.132.0.16": return "1.3.132.0.16"; case "1.3.132.0.36": return "1.3.132.0.36"; case "1.3.132.0.37": return "1.3.132.0.37"; case "1.3.132.0.38": return "1.3.132.0.38"; default: throw new NoSuchAlgorithmException("Can't translate curve OID to SSH curve identifier"); } }
Source:
public void launch(List<ModuleLaunchRequest> moduleLaunchRequests, boolean aggregate) { this.launch(moduleLaunchRequests, aggregate, null); }

Target:
public void launch(List<ModuleLaunchRequest> moduleLaunchRequests, boolean aggregate) { this.launch(moduleLaunchRequests, aggregate, Collections.EMPTY_MAP); }
Source:
public Map<DatasetField,String> getDisplayValueMap() { Map<DatasetField, String> fieldMap = new LinkedHashMap<>(); boolean fixTrailingComma = false; for (DatasetField childDatasetField : childDatasetFields) { fixTrailingComma = false; if (!StringUtils.isBlank(childDatasetField.getValue()) && !DatasetField.NA_VALUE.equals(childDatasetField.getValue())) { String format = childDatasetField.getDatasetFieldType().getDisplayFormat(); if (StringUtils.isBlank(format)) { format = "#VALUE"; } String sanitizedValue = childDatasetField.getDatasetFieldType().isSanitizeHtml() ? MarkupChecker.sanitizeBasicHTML(childDatasetField.getValue()) : childDatasetField.getValue(); if (!childDatasetField.getDatasetFieldType().isSanitizeHtml() && childDatasetField.getDatasetFieldType().isEscapeOutputText()){ sanitizedValue = MarkupChecker.stripAllTags(sanitizedValue); } if (format.equals("#VALUE, ")) fixTrailingComma = true; String displayValue = format .replace("#NAME", childDatasetField.getDatasetFieldType().getTitle()) .replace("#EMAIL", BundleUtil.getStringFromBundle("dataset.email.hiddenMessage")) .replace("#VALUE", sanitizedValue ); if(childDatasetField.getDatasetFieldType().getName().equals("country")){ System.out.print(displayValue); } fieldMap.put(childDatasetField,displayValue); } } if (fixTrailingComma) { return (removeLastComma(fieldMap)); } return fieldMap; }

Target:
public Map<DatasetField,String> getDisplayValueMap() { Map<DatasetField, String> fieldMap = new LinkedHashMap<>(); boolean fixTrailingComma = false; for (DatasetField childDatasetField : childDatasetFields) { fixTrailingComma = false; if (!StringUtils.isBlank(childDatasetField.getValue()) && !DatasetField.NA_VALUE.equals(childDatasetField.getValue())) { String format = childDatasetField.getDatasetFieldType().getDisplayFormat(); if (StringUtils.isBlank(format)) { format = "#VALUE"; } String sanitizedValue = childDatasetField.getDatasetFieldType().isSanitizeHtml() ? MarkupChecker.sanitizeBasicHTML(childDatasetField.getValue()) : childDatasetField.getValue(); if (!childDatasetField.getDatasetFieldType().isSanitizeHtml() && childDatasetField.getDatasetFieldType().isEscapeOutputText()){ sanitizedValue = MarkupChecker.stripAllTags(sanitizedValue); } if (format.equals("#VALUE, ")) fixTrailingComma = true; String displayValue = format .replace("#NAME", childDatasetField.getDatasetFieldType().getTitle()) .replace("#EMAIL", BundleUtil.getStringFromBundle("dataset.email.hiddenMessage")) .replace("#VALUE", sanitizedValue ); fieldMap.put(childDatasetField,displayValue); } } if (fixTrailingComma) { return (removeLastComma(fieldMap)); } return fieldMap; }
Source:
private Mono<AmqpSendLink> getSendLink() { return connectionProcessor .flatMap(connection -> { String linkName = entityName; if (!CoreUtils.isNullOrEmpty(viaEntityName)) { linkName = String.format("VIA-%s", viaEntityName); } return connection.createSendLink(linkName, entityName, viaEntityName, retryOptions); }) .doOnNext(next -> linkName.compareAndSet(null, next.getLinkName())); }

Target:
private Mono<AmqpSendLink> getSendLink() { return connectionProcessor .flatMap(connection -> { if (!CoreUtils.isNullOrEmpty(viaEntityName)) { return connection.createSendLink("VIA-".concat(viaEntityName), viaEntityName, retryOptions, entityName); } else { return connection.createSendLink(entityName, entityName, retryOptions, null); } }) .doOnNext(next -> linkName.compareAndSet(null, next.getLinkName())); }
Source:
private CompositeJobParametersValidator compositeJobParametersValidator() { List<JobParametersValidator> jobParametersValidators = new ArrayList<>(Arrays.asList( new VepPathValidator(), new VepCacheVersionValidator(), new VepCachePathValidator(), new VepCacheSpeciesValidator(), new InputFastaValidator(), new VepNumForksValidator(), new OutputDirAnnotationValidator(), new InputVcfIdValidator() )); if (isStudyIdRequired) { jobParametersValidators.add(new InputStudyIdValidator()); } CompositeJobParametersValidator compositeJobParametersValidator = new CompositeJobParametersValidator(); compositeJobParametersValidator.setValidators(jobParametersValidators); return compositeJobParametersValidator; }

Target:
private CompositeJobParametersValidator compositeJobParametersValidator() { List<JobParametersValidator> jobParametersValidators = new ArrayList<>(); Collections.addAll(jobParametersValidators, new VepPathValidator(), new VepCacheVersionValidator(), new VepCachePathValidator(), new VepCacheSpeciesValidator(), new InputFastaValidator(), new VepNumForksValidator(), new OutputDirAnnotationValidator() ); if (isStudyIdRequired) { jobParametersValidators.add(new InputStudyIdValidator()); jobParametersValidators.add(new InputVcfIdValidator()); } CompositeJobParametersValidator compositeJobParametersValidator = new CompositeJobParametersValidator(); compositeJobParametersValidator.setValidators(jobParametersValidators); return compositeJobParametersValidator; }
Source:
public HostData() { try { this.hostName = java.net.InetAddress.getLocalHost().getHostName(); this.hostAddress = java.net.InetAddress.getLocalHost().getHostAddress(); } catch (UnknownHostException e) { setHostName("unknown-host"); } }

Target:
public HostData() { try { setHostName(java.net.InetAddress.getLocalHost().getHostName()); setHostAddress(java.net.InetAddress.getLocalHost().getHostAddress()); } catch (UnknownHostException e) { setHostName("unknown-host"); } }
Source:
public Optional<InsightCard.Category> selectMarketingInsightToGenerate(final Long accountId, final DateTime currentTime) { final Optional<MarketingInsightsSeen> marketingInsightsSeenOptional = marketingInsightsSeenDAODynamoDB.getSeenCategories(accountId); if (marketingInsightsSeenOptional.isPresent()) { return selectMarketingInsightToGenerate(currentTime, marketingInsightsSeenOptional.get().seenCategories, random); } return selectMarketingInsightToGenerate(currentTime, new HashSet<InsightCard.Category>(), random); }

Target:
private Optional<InsightCard.Category> selectMarketingInsightToGenerate(final Long accountId, final DateTime currentTime) { final Optional<MarketingInsightsSeen> marketingInsightsSeenOptional = marketingInsightsSeenDAODynamoDB.getSeenCategories(accountId); if (marketingInsightsSeenOptional.isPresent()) { return selectMarketingInsightToGenerate(currentTime, marketingInsightsSeenOptional.get().seenCategories, RANDOM); } return selectMarketingInsightToGenerate(currentTime, new HashSet<InsightCard.Category>(), RANDOM); }
Source:
public boolean filter(List<?> filters) { if (filters == null) { return true; } fLock.lock(); try { cancelOngoingRequests(); List<FilterCriteria> list = (List<FilterCriteria>)filters; fFilterCriteria = new ArrayList<FilterCriteria>(list); fillCurrentPage(fEvents); } finally { fLock.unlock(); } return true; }

Target:
public boolean filter(List<?> filters) { fLock.lock(); try { cancelOngoingRequests(); if (filters == null) { fFilterCriteria = new ArrayList<FilterCriteria>(); } else { List<FilterCriteria> list = (List<FilterCriteria>)filters; fFilterCriteria = new ArrayList<FilterCriteria>(list); } fillCurrentPage(fEvents); } finally { fLock.unlock(); } return true; }
Source:
public ResourceDescriptor addAttributes(Collection<AttributeDefinition> attributes) { for (AttributeDefinition attribute : attributes) { this.addAttributes(new Attribute() { @Override public AttributeDefinition getDefinition() { return attribute; } }); } return this; }

Target:
public ResourceDescriptor addAttributes(Collection<AttributeDefinition> attributes) { this.attributes.addAll(attributes); return this; }
Source:
public void shouldParseUUID() throws Exception { SurefireMasterProcessChannelProcessorFactory factory = new SurefireMasterProcessChannelProcessorFactory(); UUID uuid = UUID.randomUUID(); URI uri = new URI( "tcp://127.0.0.1:12345?auth=" + uuid ); UUID parsed = invokeMethod( factory, "parseAuth", uri ); assertThat( parsed ) .isEqualTo( uuid ); }

Target:
public void shouldParseUUID() throws Exception { UUID uuid = UUID.randomUUID(); URI uri = new URI( "tcp://localhost:12345?sessionId=" + uuid ); String parsed = invokeMethod( SurefireMasterProcessChannelProcessorFactory.class, "extractSessionId", uri ); assertThat( parsed ) .isEqualTo( uuid.toString() ); }
Source:
public RegexMessageParser(SecorConfig config) { super(config); String patStr = config.getMessageTimestampInputPattern(); LOG.info("timestamp pattern: " + patStr); tsPattern = Pattern.compile(patStr); }

Target:
public RegexMessageParser(SecorConfig config) { super(config); String patStr = config.getMessageTimestampInputPattern(); LOG.info("timestamp pattern: {}", patStr); mTsPattern = Pattern.compile(patStr); }
Source:
public boolean isOpen() { boolean result = true; try { service.getToken(); } catch (Throwable t) { result = false; } return result; }

Target:
public boolean isOpen() { boolean result = true; try { service.getApplications(); } catch (Throwable t) { result = false; } return result; }
Source:
public void testConflictsDetected() { waitForClusterToForm(CACHE_NAME); IntStream.range(0, NUMBER_OF_CACHE_ENTRIES).forEach(i -> getCache(0).put(i, "v" + i)); final int cacheIndex = numMembersInCluster - 1; assertEquals(0, getConflicts(cacheIndex).count()); introduceCacheConflicts(); List<Map<Address, InternalCacheEntry<Object, Object>>> conflicts = getConflicts(cacheIndex).collect(Collectors.toList()); assertEquals(INCONSISTENT_VALUE_INCREMENT, conflicts.size()); for (Map<Address, InternalCacheEntry<Object, Object>> map : conflicts) { assertEquals(NUMBER_OF_OWNERS, map.keySet().size()); Collection<InternalCacheEntry<Object, Object>> mapValues = map.values(); int key = (Integer) mapValues.stream().findAny().orElse(new NullValueEntry(-1)).getKey(); assertTrue(key > -1); if (key % NULL_VALUE_FREQUENCY == 0) { assertTrue(map.values().stream().anyMatch(entry -> entry instanceof NullValueEntry)); } else { List<Object> icvs = map.values().stream().map(InternalCacheEntry::getValue).distinct().collect(Collectors.toList()); assertEquals(NUMBER_OF_OWNERS, icvs.size()); assertTrue("Expected one of the conflicting string values to be 'INCONSISTENT'", icvs.contains("INCONSISTENT")); } } }

Target:
public void testConflictsDetected() { waitForClusterToForm(CACHE_NAME); IntStream.range(0, NUMBER_OF_CACHE_ENTRIES).forEach(i -> getCache(0).put(i, "v" + i)); final int cacheIndex = numMembersInCluster - 1; assertEquals(0, getConflicts(cacheIndex).count()); introduceCacheConflicts(); List<Map<Address, CacheEntry<Object, Object>>> conflicts = getConflicts(cacheIndex).collect(Collectors.toList()); assertEquals(INCONSISTENT_VALUE_INCREMENT, conflicts.size()); for (Map<Address, CacheEntry<Object, Object>> map : conflicts) { assertEquals(NUMBER_OF_OWNERS, map.keySet().size()); Collection<CacheEntry<Object, Object>> mapValues = map.values(); int key = mapValues.stream().filter(e -> !(e instanceof NullCacheEntry)).mapToInt(e -> (Integer) e.getKey()).findAny().orElse(-1); assertTrue(key > -1); if (key % NULL_VALUE_FREQUENCY == 0) { assertTrue(map.values().stream().anyMatch(NullCacheEntry.class::isInstance)); } else { List<Object> icvs = map.values().stream().map(CacheEntry::getValue).distinct().collect(Collectors.toList()); assertEquals(NUMBER_OF_OWNERS, icvs.size()); assertTrue("Expected one of the conflicting string values to be 'INCONSISTENT'", icvs.contains("INCONSISTENT")); } } }
Source:
public void createPendingSegmentsTable(final String tableName) { createTable( tableName, ImmutableList.of( String.format( "CREATE TABLE %1$s (\n" + " id VARCHAR(255) NOT NULL,\n" + " dataSource VARCHAR(255) NOT NULL,\n" + " created_date VARCHAR(255) NOT NULL,\n" + " start VARCHAR(255) NOT NULL,\n" + " %send%s VARCHAR(255) NOT NULL,\n" + " sequence_name VARCHAR(255) NOT NULL,\n" + " sequence_prev_id VARCHAR(255) NOT NULL,\n" + " sequence_name_prev_id_sha1 VARCHAR(255) NOT NULL,\n" + " payload %2$s NOT NULL,\n" + " PRIMARY KEY (id),\n" + " UNIQUE (sequence_name_prev_id_sha1)\n" + ")", tableName, getQuoteString(), getQuoteString(), getPayloadType() ) ) ); }

Target:
public void createPendingSegmentsTable(final String tableName) { createTable( tableName, ImmutableList.of( String.format( "CREATE TABLE %1$s (\n" + " id VARCHAR(255) NOT NULL,\n" + " dataSource VARCHAR(255) NOT NULL,\n" + " created_date VARCHAR(255) NOT NULL,\n" + " start VARCHAR(255) NOT NULL,\n" + " %3$send%3$s VARCHAR(255) NOT NULL,\n" + " sequence_name VARCHAR(255) NOT NULL,\n" + " sequence_prev_id VARCHAR(255) NOT NULL,\n" + " sequence_name_prev_id_sha1 VARCHAR(255) NOT NULL,\n" + " payload %2$s NOT NULL,\n" + " PRIMARY KEY (id),\n" + " UNIQUE (sequence_name_prev_id_sha1)\n" + ")", tableName, getPayloadType(), getQuoteString() ) ) ); }
Source:
public SRAFileReader(final SRAAccession acc) { this.acc = acc; if (!acc.isValid()) { throw new RuntimeException("Passes invalid SRA accession into SRA reader: " + acc); } try { run = gov.nih.nlm.ncbi.ngs.NGS.openReadCollection(acc.toString()); virtualHeader = loadSamHeader(); cachedReferences = loadReferences(); } catch (final Exception e) { throw new RuntimeException(e); } recordRangeInfo = SRAIterator.getRecordsRangeInfo(run); index = new SRAIndex(virtualHeader, recordRangeInfo); }

Target:
public SRAFileReader(final SRAAccession acc) { this.acc = acc; if (!acc.isValid()) { throw new IllegalArgumentException("Invalid SRA accession was passed to SRA reader: " + acc); } try { run = gov.nih.nlm.ncbi.ngs.NGS.openReadCollection(acc.toString()); virtualHeader = loadSamHeader(); } catch (final Exception e) { throw new RuntimeException(e); } cachedReferences = new ReferenceCache(run, virtualHeader); recordRangeInfo = SRAIterator.getRecordsRangeInfo(run); index = new SRAIndex(virtualHeader, recordRangeInfo); }
Source:
public @Nullable R apply(@Nullable R input) { checkNotNull(input); if (fieldMask.getPathsList() .isEmpty()) { return input; } if (input instanceof EntityRecord) { return (R) maskEntityRecord((EntityRecord) input); } return applyMask(fieldMask, input); }

Target:
public @Nullable R apply(@Nullable R input) { if (null == input || fieldMask.getPathsList() .isEmpty()) { return input; } if (input instanceof EntityRecord) { return (R) maskEntityRecord((EntityRecord) input); } return applyMask(fieldMask, input); }
Source:
public AutomationWatchService(AbstractFileProvider provider, String watchingDir) { this.provider = provider; this.watchingDir = watchingDir; File file = new File(watchingDir); if (!file.exists()) { file.mkdirs(); } }

Target:
public AutomationWatchService(AbstractFileProvider provider, String watchingDir) { this.provider = provider; this.watchingDir = watchingDir; File file = new File(watchingDir); if (!file.exists()) { throw new IllegalArgumentException(String.format("Directory \"%s\" not exist!", file.getAbsolutePath())); } }
Source:
private void probeGetsEmptied() { new PollingProber(10000, 1000).check(new Probe() { @Override public boolean isSatisfied() { return queue.isEmpty(); } @Override public String describeFailure() { return "Queue should have been empty"; } }); }

Target:
private void probeGetsEmptied() { new PollingProber(PROBE_EMPTIED_TIMEOUT_MILLIS, PROBE_EMPTIED_DELAY_MILLIS).check(new Probe() { @Override public boolean isSatisfied() { return queue.isEmpty(); } @Override public String describeFailure() { return "Queue should have been empty"; } }); }