auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void endVisitByUuid(String uuid, Visit visit, DefaultVisitsCallback callbackListener) { restApi.endVisitByUUID(uuid, visit).enqueue(new Callback<Visit>() { @Override public void onResponse(@NonNull Call<Visit> call, @NonNull Response<Visit> response) { if (response.isSuccessful()) { if (callbackListener != null) { callbackListener.onSuccess(response.body().getStopDatetime()); } } else { if (callbackListener != null) { callbackListener.onFailure(response.message()); } } } @Override public void onFailure(@NonNull Call<Visit> call, @NonNull Throwable t) { if (callbackListener != null) { callbackListener.onFailure(t.getMessage()); } } }); }

Target:
public void endVisitByUuid(String uuid, Visit visit, DefaultVisitsCallback callbackListener) { restApi.endVisitByUUID(uuid, visit).enqueue(new Callback<Visit>() { @Override public void onResponse(@NonNull Call<Visit> call, @NonNull Response<Visit> response) { if (callbackListener != null) { if (response.isSuccessful()) { callbackListener.onSuccess(response.body().getStopDatetime()); } else { callbackListener.onFailure(response.message()); } } } @Override public void onFailure(@NonNull Call<Visit> call, @NonNull Throwable t) { if (callbackListener != null) { callbackListener.onFailure(t.getMessage()); } } }); }
Source:
public SubnetworkList getSubnetworkList(Region region, Compute compute, String projectId, List<String> subnetIds, String sharedProjectId) throws IOException { SubnetworkList subnetworkList; if (subnetIds != null && subnetIds.isEmpty()) { subnetworkList = compute.subnetworks() .list(projectId, region.value()).execute(); } else { if (!Strings.isNullOrEmpty(sharedProjectId)) { subnetworkList = new SubnetworkList().setItems(new ArrayList<>()); for (String subnetId : subnetIds) { Subnetwork subnetwork = compute.subnetworks().get(sharedProjectId, region.value(), subnetId).execute(); subnetworkList.getItems().add(subnetwork); } } else { subnetworkList = new SubnetworkList().setItems(new ArrayList<>()); for (String subnetId : subnetIds) { Subnetwork subnetwork = compute.subnetworks().get(projectId, region.value(), subnetId).execute(); subnetworkList.getItems().add(subnetwork); } } } return subnetworkList; }

Target:
private SubnetworkList getSubnetworkList(Region region, Compute compute, String projectId, List<String> subnetIds, String sharedProjectId) throws IOException { SubnetworkList subnetworkList; validateSubnetRequest(subnetIds, sharedProjectId); if (subnetIds.isEmpty()) { subnetworkList = compute.subnetworks().list(projectId, region.value()).execute(); } else { String tmpProjectId = !Strings.isNullOrEmpty(sharedProjectId) ? sharedProjectId : projectId; subnetworkList = new SubnetworkList().setItems(new ArrayList<>()); for (String subnetId : subnetIds) { Subnetwork subnetwork = compute.subnetworks().get(tmpProjectId, region.value(), subnetId).execute(); subnetworkList.getItems().add(subnetwork); } } return subnetworkList; }
Source:
public Predicate createPredicateAndJoin(String filterString, Root<T> root) { LogicalOperatorRulesLexer lexer = new LogicalOperatorRulesLexer(new ANTLRInputStream(filterString)); LogicalOperatorRulesParser parser = new LogicalOperatorRulesParser(new CommonTokenStream(lexer)); parser.addErrorListener(new OsiamAntlrErrorListener()); ParseTree tree = parser.parse(); EvalVisitor<T> visitor = new EvalVisitor<>(this, root); return (Predicate) visitor.visit(tree); }

Target:
public Predicate createPredicateAndJoin(String filterString, Root<T> root) { LogicalOperatorRulesLexer lexer = new LogicalOperatorRulesLexer(new ANTLRInputStream(filterString)); LogicalOperatorRulesParser parser = new LogicalOperatorRulesParser(new CommonTokenStream(lexer)); parser.addErrorListener(new OsiamAntlrErrorListener()); ParseTree tree = parser.parse(); EvalVisitor<T> visitor = new EvalVisitor<>(this, root); return visitor.visit(tree); }
Source:
public void testDeleteNic() { nicApi().deleteNic(testNic.dataCenterId(), testServer.id(), testNic.id()); assertNicRemoved(testNic); }

Target:
public void testDeleteNic() { nicApi().delete(testNic.dataCenterId(), testServer.id(), testNic.id()); assertNicRemoved(testNic); }
Source:
private static Map<String, String> readProperties() { try { Map<String, String> properties = Maps.newHashMap(); File file = new File(AndroidLocation.getFolder(), PATH_FIRST_RUN_PROPERTIES); if (file.isFile()) { try { final List<String> lines = Files.readLines(file, Charsets.UTF_16LE); for (String line : lines) { final Matcher matcher = KEY_VALUE_PATTERN.matcher(line); if (matcher.matches()) { final String key = matcher.group(1); final String value = matcher.group(2); properties.put(key, value); } } } catch (IOException e) { Logger.getInstance(InstallerData.class).error(e); } return properties; } } catch (AndroidLocation.AndroidLocationException e) { Logger.getInstance(InstallerData.class).error(e); } return null; }

Target:
private static Map<String, String> readProperties() { try { Map<String, String> properties = Maps.newHashMap(); File file = new File(AndroidLocation.getFolder(), PATH_FIRST_RUN_PROPERTIES); if (file.isFile()) { try { final List<String> lines = Files.readLines(file, Charsets.UTF_16LE); for (String line : lines) { int keyValueSeparator = line.indexOf('='); final String key = line.substring(0, keyValueSeparator); final String value = line.substring(keyValueSeparator + 1); properties.put(key, value); } } catch (IOException e) { Logger.getInstance(InstallerData.class).error(e); } return properties; } } catch (AndroidLocation.AndroidLocationException e) { Logger.getInstance(InstallerData.class).error(e); } return null; }
Source:
private void getChildrenImpl() { RevWalk rw = new RevWalk(repo); RevFlag localFlag = rw.newFlag("local"); RevFlag remoteFlag = rw.newFlag("remote"); RevFlagSet allFlags = new RevFlagSet(); allFlags.add(localFlag); allFlags.add(remoteFlag); rw.carry(allFlags); List<GitModelCommit> result = new ArrayList<GitModelCommit>(); rw.setRetainBody(true); try { RevCommit srcCommit = rw.parseCommit(srcRev); srcCommit.add(localFlag); rw.markStart(srcCommit); RevCommit dstCommit = rw.parseCommit(dstRev); dstCommit.add(remoteFlag); rw.markStart(dstCommit); for (RevCommit nextCommit : rw) { if (nextCommit.hasAll(allFlags)) break; if (nextCommit.has(localFlag)) result.add(new GitModelCommit(this, nextCommit, LEFT)); else if (nextCommit.has(remoteFlag)) result.add(new GitModelCommit(this, nextCommit, RIGHT)); } } catch (IOException e) { Activator.logError(e.getMessage(), e); } childrens = result.toArray(new GitModelCommit[result.size()]); }

Target:
private void getChildrenImpl() { RevWalk rw = new RevWalk(repo); RevFlag localFlag = rw.newFlag("local"); RevFlag remoteFlag = rw.newFlag("remote"); RevFlagSet allFlags = new RevFlagSet(); allFlags.add(localFlag); allFlags.add(remoteFlag); rw.carry(allFlags); List<GitModelCommit> result = new ArrayList<GitModelCommit>(); rw.setRetainBody(true); try { RevCommit srcCommit = rw.parseCommit(srcRev); srcCommit.add(localFlag); rw.markStart(srcCommit); RevCommit dstCommit = rw.parseCommit(dstRev); dstCommit.add(remoteFlag); rw.markStart(dstCommit); for (RevCommit nextCommit : rw) { if (nextCommit.hasAll(allFlags)) break; if (nextCommit.has(localFlag)) result.add(new GitModelCommit(this, nextCommit, RIGHT)); else if (nextCommit.has(remoteFlag)) result.add(new GitModelCommit(this, nextCommit, LEFT)); } } catch (IOException e) { Activator.logError(e.getMessage(), e); } childrens = result.toArray(new GitModelCommit[result.size()]); }
Source:
public StringColorPickerEditor(Composite parent, int style) { super(parent, style); colorPicker = new Button(this, SWT.PUSH); doSetColor("0"); colorPicker.addSelectionListener(new SelectionListener() { public void widgetSelected(SelectionEvent e) { ColorPalettePopup colorPickerPopup = new ColorPalettePopup(getShell(), IDialogConstants.BUTTON_BAR_HEIGHT); colorPickerPopup.setPreviousColor(Integer.valueOf(getValue())); Rectangle r = colorPicker.getBounds(); Point location = colorPicker.getParent().toDisplay(r.x, r.y); colorPickerPopup.open(new Point(location.x, location.y + r.height)); if (colorPickerPopup.getSelectedColor() == null && !colorPickerPopup.useDefaultColor()) { return; } setColor(colorPickerPopup.getSelectedColor()); commit(); } public void widgetDefaultSelected(SelectionEvent e) { } }); }

Target:
public StringColorPickerEditor(Composite parent, int style) { super(parent, style); colorPicker = new Button(this, SWT.PUSH); doSetColor("0"); colorPicker.addSelectionListener(new SelectionListener() { public void widgetSelected(SelectionEvent e) { ColorPalettePopup colorPickerPopup = new ColorPalettePopup(getShell(), IDialogConstants.BUTTON_BAR_HEIGHT); colorPickerPopup.setPreviousColor(Integer.valueOf(getValue())); Rectangle r = colorPicker.getBounds(); Point location = colorPicker.getParent().toDisplay(r.x, r.y); colorPickerPopup.open(new Point(location.x, location.y + r.height)); if (colorPickerPopup.getSelectedColor() != null || colorPickerPopup.useDefaultColor()) { setColor(colorPickerPopup.getSelectedColor()); commit(); } } public void widgetDefaultSelected(SelectionEvent e) { } }); }
Source:
private Path getRectifiedConfig(String collection, Path collectionPath) { Set<Path> allFiles = SOLR_CONFIG_FILES.stream() .map(configName -> Paths.get(collectionPath.toString(), configName)) .collect(Collectors.toSet()); Set<Path> missingFiles = allFiles.stream().filter(config -> !config.toFile().exists()).collect(Collectors.toSet()); Set<Path> existingFiles = allFiles.stream().filter(missingFiles::contains).collect(Collectors.toSet()); if (missingFiles.isEmpty()) { return collectionPath; } Path tempConfigDir; try { tempConfigDir = Files.createTempDirectory("solr-configsets"); tempConfigDir.toFile().deleteOnExit(); } catch (IOException e) { LOGGER.debug( "Could not create directory to utilize incomplete configset [{}]. Using default configset instead", collection); return defaultPath; } Set<Path> pathsToCopy = ImmutableSet.<Path>builder() .addAll( missingFiles.stream() .map(Path::getFileName) .map(Path::toString) .map(fileName -> Paths.get(defaultPath.toString(), fileName)) .collect(Collectors.toSet())) .addAll(existingFiles) .build(); for (Path filePath : pathsToCopy) { try { Files.copy( filePath, Paths.get(tempConfigDir.toString(), filePath.getFileName().toString()), StandardCopyOption.REPLACE_EXISTING); } catch (IOException e) { LOGGER.debug("Could not copy config file [{}], reverting to default.", filePath); return defaultPath; } } return tempConfigDir; }

Target:
private Path getRectifiedConfig(String collection, Path collectionPath) { Set<Path> allFiles = SOLR_CONFIG_FILES.stream() .map(configName -> Paths.get(collectionPath.toString(), configName)) .collect(Collectors.toSet()); Set<Path> missingFiles = allFiles.stream().filter(config -> !config.toFile().exists()).collect(Collectors.toSet()); Set<Path> existingFiles = allFiles.stream().filter(config -> config.toFile().exists()).collect(Collectors.toSet()); if (missingFiles.isEmpty()) { return collectionPath; } Path tempConfigDir; try { tempConfigDir = Files.createTempDirectory("solr-configsets"); tempConfigDir.toFile().deleteOnExit(); } catch (IOException e) { LOGGER.debug( "Could not create directory to utilize incomplete configset [{}]. Using default configset instead", collection); return defaultPath; } Set<Path> pathsToCopy = ImmutableSet.<Path>builder() .addAll( missingFiles.stream() .map(Path::getFileName) .map(Path::toString) .map(fileName -> Paths.get(defaultPath.toString(), fileName)) .collect(Collectors.toSet())) .addAll(existingFiles) .build(); for (Path filePath : pathsToCopy) { try { Files.copy( filePath, Paths.get(tempConfigDir.toString(), filePath.getFileName().toString()), StandardCopyOption.REPLACE_EXISTING); } catch (IOException e) { LOGGER.info("Could not copy config file [{}], reverting to default.", filePath); return defaultPath; } } return tempConfigDir; }
Source:
private IProgressMonitor beginWork(IProgressMonitor monitor) { if (monitor == null) return new NullProgressMonitor(); return SubMonitor.convert(monitor, IProgressMonitor.UNKNOWN); }

Target:
private IProgressMonitor beginWork(IProgressMonitor monitor) { return SubMonitor.convert(monitor); }
Source:
public void finish() { new PushButton("Finish").click(); }

Target:
public void finish() { new PushButton("Finish").click(); new WaitWhile(new ShellIsAvailable(this)); }
Source:
public Set<String> loadAllKeys() { Set<String> keys = new HashSet<String>(); LOGGER.debug("Entering loadAllKeys"); File[] files = persistencePath.toFile().listFiles(getFilenameFilter()); if (files == null) { return keys; } for (File file : files) { keys.add(file.getName().replaceFirst(SER_REGEX, "")); } LOGGER.debug("Leaving loadAllKeys"); return keys; }

Target:
public Set<String> loadAllKeys() { Set<String> keys = new HashSet<>(); LOGGER.trace("Entering loadAllKeys"); try (Stream<Path> stream = Files.list(persistencePath.toPath())) { keys = stream .filter(getPathMatcher()::matches) .map(Path::getFileName) .map(Path::toString) .map(fileName -> fileName.replaceFirst(EXT_REGEX, "")) .collect(Collectors.toSet()); } catch (IOException e) { LOGGER.warn("Unable to read files at {}", persistencePath); } LOGGER.trace("Leaving loadAllKeys"); return keys; }
Source:
void processServerError(ServerErrorCode errorCode) { switch (errorCode) { case Blob_Deleted: logger.trace("Requested blob was deleted"); setOperationException(new RouterException("Server returned: " + errorCode, RouterErrorCode.BlobDeleted)); break; case Blob_Expired: logger.trace("Requested blob is expired"); setOperationException(new RouterException("Server returned: " + errorCode, RouterErrorCode.BlobExpired)); break; case Blob_Not_Found: logger.trace("Requested blob was not found on this server"); setOperationException(new RouterException("Server returned: " + errorCode, RouterErrorCode.BlobDoesNotExist)); break; default: setOperationException(new RouterException("Server returned: " + errorCode, RouterErrorCode.AmbryUnavailable)); break; } }

Target:
void processServerError(ServerErrorCode errorCode) { switch (errorCode) { case Blob_Deleted: logger.trace("Requested blob was deleted"); setOperationException(new RouterException("Server returned: " + errorCode, RouterErrorCode.BlobDeleted)); break; case Blob_Expired: logger.trace("Requested blob is expired"); setOperationException(new RouterException("Server returned: " + errorCode, RouterErrorCode.BlobExpired)); break; case Blob_Not_Found: logger.trace("Requested blob was not found on this server"); setOperationException(new RouterException("Server returned: " + errorCode, RouterErrorCode.BlobDoesNotExist)); break; default: setOperationException( new RouterException("Server returned: " + errorCode, RouterErrorCode.UnexpectedInternalError)); break; } }
Source:
protected Iterator<E> flatMap(final Traverser.Admin<S> traverser) { final S s = traverser.get(); if (s instanceof Iterator) return (Iterator) s; else if (s instanceof Iterable) return ((Iterable) s).iterator(); else if (s instanceof Map) return ((Map) s).entrySet().iterator(); else if (s.getClass().isArray()) return new ArrayIterator((Object[])s); else return IteratorUtils.of((E) s); }

Target:
protected Iterator<E> flatMap(final Traverser.Admin<S> traverser) { final S s = traverser.get(); if (s instanceof Iterator) return (Iterator) s; else if (s instanceof Iterable) return ((Iterable) s).iterator(); else if (s instanceof Map) return ((Map) s).entrySet().iterator(); else if (s.getClass().isArray()) return handleArrays(s); else return IteratorUtils.of((E) s); }
Source:
public void testSerializePlayMessage() throws IOException { File file = new File("./assets/Jesse_normal_trimmed.wav"); FileInputStream fis = new FileInputStream(file); byte[] bytes = new byte[fis.available()]; fis.read(bytes); TransferSongMessage oldMessage = new TransferSongMessage(132452L, file.getName(), bytes); TransferSongMessage newMessage = super.testSerializeMessage(oldMessage); assertEquals(oldMessage.getSongId(), newMessage.getSongId()); assertEquals(oldMessage.getSongFileName(), newMessage.getSongFileName()); assertTrue(Arrays.equals(oldMessage.getSongData(), newMessage.getSongData())); }

Target:
public void testSerializePlayMessage() throws IOException { File file = new File("./assets/Jesse_normal_trimmed.wav"); FileInputStream fis = new FileInputStream(file); byte[] bytes = new byte[fis.available()]; fis.read(bytes); long songId = 132452L; TransferSongMessage oldMessage = new TransferSongMessage(songId, file.getName(), bytes); TransferSongMessage newMessage = super.testSerializeMessage(oldMessage); assertEquals(oldMessage.getSongId(), newMessage.getSongId()); assertEquals(oldMessage.getSongFileName(), newMessage.getSongFileName()); assertTrue(Arrays.equals(oldMessage.getSongData(), newMessage.getSongData())); }
Source:
protected void closeSplitInputStreams() throws IOException { for (StreamsHolder<InputStream> holder : splitInputHolders.values()) { if (holder.getStream() != null) { holder.getStream().close(); } if (holder.getWrappedStream() != null) { holder.getWrappedStream().close(); } } splitInputHolders.clear(); }

Target:
protected void closeSplitInputStreams() throws IOException { IOException last = null; for (StreamsHolder<InputStream> holder : splitInputHolders.values()) { try { holder.close(); } catch (IOException e) { last = e; } } splitInputHolders.clear(); if (last != null) { throw last; } }
Source:
public String toString() { return MoreObjects.toStringHelper(this).omitNullValues().add("code", code).add("message", message).toString(); }

Target:
public String toString() { return toStringHelper(this).add("code", code).add("message", message).toString(); }
Source:
public void createControl(Composite parent) { Composite composite = new Composite(parent, SWT.NONE); composite.setLayout(new GridLayout(2, false)); composite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true)); composite.setFont(parent.getFont()); Label label = new Label(composite, SWT.NONE); label.setLayoutData(new GridData()); label.setText(Messages.rename_label); this.nameText = new Text(composite, SWT.BORDER); this.nameText.setText(""); this.nameText.setFont(composite.getFont()); this.nameText.setLayoutData(new GridData(GridData.FILL, GridData.BEGINNING, true, false)); this.nameText.addModifyListener(new ModifyListener() { @Override public void modifyText(ModifyEvent e) { if (!CharMatcher.whitespace().matchesAnyOf(RenameInputWizardPage.this.nameText.getText())) { setPageComplete(true); } } }); this.nameText.selectAll(); this.setPageComplete(false); this.setControl(composite); }

Target:
public void createControl(Composite parent) { Composite composite = new Composite(parent, SWT.NONE); composite.setLayout(new GridLayout(2, false)); composite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true)); composite.setFont(parent.getFont()); Label label = new Label(composite, SWT.NONE); label.setLayoutData(new GridData()); label.setText(Messages.rename_label); this.nameText = new Text(composite, SWT.BORDER); this.nameText.setText("newName"); this.nameText.setFont(composite.getFont()); this.nameText.setLayoutData(new GridData(GridData.FILL, GridData.BEGINNING, true, false)); this.nameText.addModifyListener(new ModifyListener() { @Override public void modifyText(ModifyEvent e) { if (!CharMatcher.whitespace().matchesAnyOf(RenameInputWizardPage.this.nameText.getText())) { setPageComplete(true); } } }); this.nameText.selectAll(); this.setPageComplete(true); this.setControl(composite); }
Source:
public void init() { dictionaryConnection = _dictionary.openConnection(_configuration); dictionary = new ArrayList<>(); final Iterator<String> allValues = dictionaryConnection.getAllValues(); while (allValues.hasNext()) { dictionary.add(allValues.next()); } }

Target:
public void init() { _dictionaryConnection = _dictionary.openConnection(_configuration); dictionaryValues = new ArrayList<>(); final Iterator<String> allValues = _dictionaryConnection.getLengthSortedValues(); while (allValues.hasNext()) { dictionaryValues.add(allValues.next()); } }
Source:
public boolean run(CommandSender sender, Player sender_p, Command cmd, String commandLabel, String[] args, boolean senderIsConsole) { if (args.length != 1) { return false; } if (args[0].equalsIgnoreCase("all") || args[0].equalsIgnoreCase("everyone")) { playerMsg("Correct usage: /opall"); return true; } OfflinePlayer player = null; for (Player onlinePlayer : server.getOnlinePlayers()) { if (args[0].equalsIgnoreCase(onlinePlayer.getName())) { player = onlinePlayer; } } if (player == null) { if (TFM_AdminList.isSuperAdmin(sender) || senderIsConsole) { player = TFM_DepreciationAggregator.getOfflinePlayer(server, args[0]); } else { playerMsg("That player is not online."); playerMsg("You don't have permissions to OP offline players.", ChatColor.YELLOW); return true; } } if (!player.isOp()) { TFM_Util.adminAction(sender.getName(), "Opping " + player.getName(), false); player.setOp(true); } else { playerMsg("That player is not online."); } return true; }

Target:
public boolean run(CommandSender sender, Player sender_p, Command cmd, String commandLabel, String[] args, boolean senderIsConsole) { if (args.length != 1) { return false; } if (args[0].equalsIgnoreCase("all") || args[0].equalsIgnoreCase("everyone")) { playerMsg("Correct usage: /opall"); return true; } OfflinePlayer player = null; for (Player onlinePlayer : server.getOnlinePlayers()) { if (args[0].equalsIgnoreCase(onlinePlayer.getName())) { player = onlinePlayer; } } if (player == null) { if (TFM_AdminList.isSuperAdmin(sender) || senderIsConsole) { player = TFM_DepreciationAggregator.getOfflinePlayer(server, args[0]); } else { playerMsg("That player is not online."); playerMsg("You don't have permissions to OP offline players.", ChatColor.YELLOW); return true; } } if (!player.isOp()) { TFM_Util.adminAction(sender.getName(), "Opping " + player.getName(), false); player.setOp(true); } else { playerMsg("That player is already an Op."); } return true; }
Source:
void assignExclusiveSegments() throws IOException { checkState(bufferManager.unsynchronizedGetAvailableExclusiveBuffers() == 0, "Bug in input channel setup logic: exclusive buffers have already been set for this input channel."); checkState(initialCredit > 0, "Number of exclusive buffers must be larger than 0."); bufferManager.requestExclusiveBuffers(initialCredit); }

Target:
void assignExclusiveSegments() throws IOException { checkState(bufferManager.unsynchronizedGetAvailableExclusiveBuffers() == 0, "Bug in input channel setup logic: exclusive buffers have already been set for this input channel."); bufferManager.requestExclusiveBuffers(initialCredit); }
Source:
public List getClients() { return clientDao.getClients(); }

Target:
public List<ClientEntity> getClients() { return clientDao.getClients(); }
Source:
protected Message beforeForward(final Message message, final SimpleString forwardingAddress) { if (useDuplicateDetection) { byte[] bytes = getDuplicateBytes(nodeUUID, message.getMessageID()); message.putExtraBytesProperty(Message.HDR_BRIDGE_DUPLICATE_ID, bytes); } if (forwardingAddress != null) { message.setAddress(forwardingAddress); } if (transformer != null) { final Message transformedMessage = transformer.transform(message); if (transformedMessage != message) { if (logger.isDebugEnabled()) { logger.debug("The transformer " + transformer + " made a copy of the message " + message + " as transformedMessage"); } } transformedMessage.reencode(); return EmbedMessageUtil.embedAsCoreMessage(transformedMessage); } else { return EmbedMessageUtil.embedAsCoreMessage(message); } }

Target:
protected Message beforeForward(final Message message, final SimpleString forwardingAddress) { if (useDuplicateDetection) { byte[] bytes = getDuplicateBytes(nodeUUID, message.getMessageID()); message.putExtraBytesProperty(Message.HDR_BRIDGE_DUPLICATE_ID, bytes); } if (forwardingAddress != null) { message.setAddress(forwardingAddress); } switch (routingType) { case ANYCAST: message.setRoutingType(RoutingType.ANYCAST); break; case MULTICAST: message.setRoutingType(RoutingType.MULTICAST); break; case STRIP: message.setRoutingType(null); break; case PASS: break; } if (transformer != null) { final Message transformedMessage = transformer.transform(message); if (transformedMessage != message) { if (logger.isDebugEnabled()) { logger.debug("The transformer " + transformer + " made a copy of the message " + message + " as transformedMessage"); } } return EmbedMessageUtil.embedAsCoreMessage(transformedMessage); } else { return EmbedMessageUtil.embedAsCoreMessage(message); } }
Source:
public static ReaderPost getPost(boolean isFeed, long blogOrFeedId, long postOrItemId, boolean excludeTextColumn) { String columns = (excludeTextColumn ? COLUMN_NAMES_NO_TEXT : "*"); String sql = "SELECT " + columns + " FROM tbl_posts WHERE " + (isFeed ? "feed_id" : "blog_id") + "=? AND " + (isFeed ? "feed_item_id" : "post_id") + "=? LIMIT 1"; String[] args = new String[] {Long.toString(blogOrFeedId), Long.toString(postOrItemId)}; Cursor c = ReaderDatabase.getReadableDb().rawQuery(sql, args); try { if (!c.moveToFirst()) { return null; } return getPostFromCursor(c); } finally { SqlUtils.closeCursor(c); } }

Target:
private static ReaderPost getPost(boolean isFeed, long blogOrFeedId, long postOrItemId, boolean excludeTextColumn) { String columns = (excludeTextColumn ? COLUMN_NAMES_NO_TEXT : "*"); String sql = "SELECT " + columns + " FROM tbl_posts WHERE " + (isFeed ? "feed_id" : "blog_id") + "=? AND " + (isFeed ? "feed_item_id" : "post_id") + "=? LIMIT 1"; String[] args = new String[] {Long.toString(blogOrFeedId), Long.toString(postOrItemId)}; Cursor c = ReaderDatabase.getReadableDb().rawQuery(sql, args); try { if (!c.moveToFirst()) { return null; } return getPostFromCursor(c); } finally { SqlUtils.closeCursor(c); } }
Source:
public Object[][] testHeaderVersionScenarios() { return new Object[][]{ {"1.0", true}, {"1.3", true}, {"1.4", true}, {"1.5", true} }; }

Target:
public Object[][] testHeaderVersionScenarios() { return new Object[][]{ {"1.0", true}, {"1.3", true}, {"1.4", true}, {"1.5", true}, {"1.6", false}, }; }
Source:
private List<RelDataTypeField> getRelFields(List<Schema.Field> fields) { List<RelDataTypeField> relFields = new ArrayList<>(); relFields.add(new RelDataTypeFieldImpl(AvroRelConverter.KEY_NAME, 0, createTypeWithNullability(createSqlType(SqlTypeName.VARCHAR), true))); for (Schema.Field field : fields) { String fieldName = field.name(); int fieldPos = field.pos() + 1; RelDataType dataType = getRelDataType(field.schema()); relFields.add(new RelDataTypeFieldImpl(fieldName, fieldPos, dataType)); } return relFields; }

Target:
private List<RelDataTypeField> getRelFields(List<Schema.Field> fields) { List<RelDataTypeField> relFields = new ArrayList<>(); for (Schema.Field field : fields) { String fieldName = field.name(); int fieldPos = field.pos() + 1; RelDataType dataType = getRelDataType(field.schema()); relFields.add(new RelDataTypeFieldImpl(fieldName, fieldPos, dataType)); } return relFields; }
Source:
public void processAction(RequiredActionContext context) { if (context.getHttpRequest().getDecodedFormParameters().containsKey("cancel")) { context.getUser().removeAttribute(USER_ATTRIBUTE); context.failure(); return; } SimpleDateFormat dateTimeFormat = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ssZ"); context.getUser().setAttribute(USER_ATTRIBUTE, Arrays.asList(dateTimeFormat.format(new Date()))); context.success(); }

Target:
public void processAction(RequiredActionContext context) { if (context.getHttpRequest().getDecodedFormParameters().containsKey("cancel")) { context.getUser().removeAttribute(USER_ATTRIBUTE); context.failure(); return; } context.getUser().setAttribute(USER_ATTRIBUTE, Arrays.asList(Integer.toString(Time.currentTime()))); context.success(); }
Source:
public void waitHttp() { String server = String.format("http://localhost:%s", serverPort); httpServer.setPort(serverPort); start(httpServer); parallel().actions( sequential().actions( waitFor() .http() .url(server) ), sequential().actions( http(http -> http.server(httpServer).receive().head()), http(http -> http.server(httpServer).respond(HttpStatus.NOT_FOUND)), http(http -> http.server(httpServer).receive().head()), http(http -> http.server(httpServer).respond(HttpStatus.OK)) ) ); doFinally().actions(stop(httpServer)); }

Target:
public void waitHttp() { String server = startHttpServerAndGetUrl(); parallel().actions( sequential().actions( waitFor() .http() .url(server) ), sequential().actions( http(http -> http.server(httpServer).receive().head()), http(http -> http.server(httpServer).respond(HttpStatus.NOT_FOUND)), http(http -> http.server(httpServer).receive().head()), http(http -> http.server(httpServer).respond(HttpStatus.OK)) ) ); doFinally().actions(stop(httpServer)); }
Source:
private void setDataProfilesAsNeeded() { if (DBG) log("setDataProfilesAsNeeded"); ArrayList<DataProfile> dataProfileList = new ArrayList<>(); if (mAllApnSettings != null) { for (ApnSetting apn : mAllApnSettings) { DataProfile dp = createDataProfile(apn); if (!dataProfileList.contains(dp)) { dataProfileList.add(dp); } } } if (dataProfileList.size() != mLastDataProfileList.size() || !mLastDataProfileList.containsAll(dataProfileList)) { mDataServiceManager.setDataProfile(dataProfileList, mPhone.getServiceState().getDataRoamingFromRegistration(), null); mLastDataProfileList = dataProfileList; } }

Target:
private void setDataProfilesAsNeeded() { if (DBG) log("setDataProfilesAsNeeded"); ArrayList<DataProfile> dataProfileList = new ArrayList<>(); if (mAllApnSettings != null) { for (ApnSetting apn : mAllApnSettings) { DataProfile dp = createDataProfile(apn); if (!dataProfileList.contains(dp)) { dataProfileList.add(dp); } } } if (mLastDataProfileList == null || dataProfileList.size() != mLastDataProfileList.size() || !mLastDataProfileList.containsAll(dataProfileList)) { mDataServiceManager.setDataProfile(dataProfileList, mPhone.getServiceState().getDataRoamingFromRegistration(), null); mLastDataProfileList = dataProfileList; } }
Source:
private static boolean areColumnTypesSupported(List<Column> columns) { if (columns == null || columns.isEmpty()) { return false; } for (Column column : columns) { String type = column.getType().getHiveTypeName().toString(); if (type.startsWith(StandardTypes.DECIMAL)) { type = StandardTypes.DECIMAL; } if (!SUPPORTED_COLUMN_TYPES.contains(type.toLowerCase(Locale.ENGLISH))) { return false; } } return true; }

Target:
private static boolean areColumnTypesSupported(List<Column> columns) { if (columns == null || columns.isEmpty()) { return false; } for (Column column : columns) { String type = column.getType().getHiveTypeName().toString(); if (column.getType().getTypeInfo() instanceof DecimalTypeInfo) { type = DECIMAL_TYPE_NAME; } if (!SUPPORTED_COLUMN_TYPES.contains(type)) { return false; } } return true; }
Source:
public int writeAsBinary(ByteBuf buffer, @Nonnull Object value) { MonthDaySecondInterval MOnthDaySecondInterval = (MonthDaySecondInterval) value; buffer.writeInt(TYPE_LEN); buffer.writeDouble(MOnthDaySecondInterval.getSeconds()); buffer.writeInt(MOnthDaySecondInterval.getDays()); buffer.writeInt(MOnthDaySecondInterval.getMonths()); return TYPE_LEN; }

Target:
public int writeAsBinary(ByteBuf buffer, @Nonnull Object value) { Interval MOnthDaySecondInterval = (Interval) value; buffer.writeInt(TYPE_LEN); buffer.writeLong(Double.valueOf(MOnthDaySecondInterval.getSeconds()).longValue()); buffer.writeInt(MOnthDaySecondInterval.getDays()); buffer.writeInt(MOnthDaySecondInterval.getMonths()); return TYPE_LEN; }
Source:
public void done(IJobChangeEvent event) { PlatformUI.getWorkbench().getDisplay().asyncExec(new Runnable() { public void run() { Map<Repository, Object> res = new HashMap<Repository, Object>( PullOperationUI.this.results); Shell shell = PlatformUI.getWorkbench() .getActiveWorkbenchWindow().getShell(); handlePullResults(res, shell); } }); }

Target:
public void done(IJobChangeEvent event) { PlatformUI.getWorkbench().getDisplay().asyncExec(new Runnable() { public void run() { Map<Repository, Object> res = new LinkedHashMap<Repository, Object>( PullOperationUI.this.results); Shell shell = PlatformUI.getWorkbench() .getActiveWorkbenchWindow().getShell(); handlePullResults(res, shell); } }); }
Source:
protected void initLibraryTargetFolder(ISCTFileSystemAccess access, GeneratorEntry entry) { FeatureParameterValue libraryTargetFolderValue = helper.getLibraryTargetFolderValue(entry); if (libraryTargetFolderValue != null) { String folderName = libraryTargetFolderValue.getStringValue(); access.setOutputPath(LIBRARY_TARGET_FOLDER_OUTPUT, libraryTargetFolderValue.getStringValue()); OutputConfiguration output = access.getOutputConfigurations().get(LIBRARY_TARGET_FOLDER_OUTPUT); checkWriteAccess(access, LIBRARY_TARGET_FOLDER_OUTPUT, folderName); output.setCreateOutputDirectory(true); output.setCanClearOutputDirectory(false); output.setOverrideExistingResources(false); } }

Target:
protected void initLibraryTargetFolder(ISCTFileSystemAccess access, GeneratorEntry entry) { FeatureParameterValue libraryTargetFolderValue = helper.getLibraryTargetFolderValue(entry); if (libraryTargetFolderValue != null) { String folderName = libraryTargetFolderValue.getStringValue(); access.setOutputPath(LIBRARY_TARGET_FOLDER_OUTPUT, folderName); OutputConfiguration output = access.getOutputConfigurations().get(LIBRARY_TARGET_FOLDER_OUTPUT); checkWriteAccess(access, LIBRARY_TARGET_FOLDER_OUTPUT, folderName); output.setCreateOutputDirectory(true); output.setCanClearOutputDirectory(false); output.setOverrideExistingResources(false); } }
Source:
private Map<String, Object> getDetails(String depositUUID) { Map<String, String> status = depositStatusFactory.get(depositUUID); Map<String, Object> result = new HashMap<>(); for (Entry<String, String> field : status.entrySet()) { result.put(field.getKey(), field.getValue()); } Map<String, Map<String, String>> jobStatuses = jobStatusFactory.getAllJobs(depositUUID); result.put("jobs", jobStatuses); String state = status.get(DepositField.state.name()); if (DepositState.running.name().equals(state)) { String jobUUID = jobStatusFactory.getWorkingJob(depositUUID); result.put("currentJobUUID", jobUUID); } result.put("jobsURI", "/api/status/deposit/" + depositUUID + "/jobs"); result.put("eventsURI", "/api/status/deposit/" + depositUUID + "/eventsXML"); AccessGroupSet groups = getAgentPrincipals().getPrincipals(); result.put("isAdmin", groups.contains("unc:app:lib:cdr:admin")); return result; }

Target:
private Map<String, Object> getDetails(String depositUUID) { Map<String, String> status = depositStatusFactory.get(depositUUID); Map<String, Object> result = new HashMap<>(); for (Entry<String, String> field : status.entrySet()) { result.put(field.getKey(), field.getValue()); } Map<String, Map<String, String>> jobStatuses = jobStatusFactory.getAllJobs(depositUUID); result.put("jobs", jobStatuses); String state = status.get(DepositField.state.name()); if (DepositState.running.name().equals(state)) { String jobUUID = jobStatusFactory.getWorkingJob(depositUUID); result.put("currentJobUUID", jobUUID); } result.put("jobsURI", "/api/status/deposit/" + depositUUID + "/jobs"); result.put("eventsURI", "/api/status/deposit/" + depositUUID + "/eventsXML"); AccessGroupSet principals = getAgentPrincipals().getPrincipals(); result.put("isAdmin", globalPermissionEvaluator.hasGlobalPermission(principals, Permission.createAdminUnit)); return result; }
Source:
public static FilterPredicate rewrite(FilterPredicate pred) { Preconditions.checkNotNull(pred, "pred"); return pred.accept(INSTANCE); }

Target:
public static FilterPredicate rewrite(FilterPredicate pred) { checkNotNull(pred, "pred"); return pred.accept(INSTANCE); }
Source:
private ParentDimensions getTargetDimensions(Container target) { int targetWidth = target.getSize().width; Container container = target; while (container.getSize().width == 0 && container.getParent() != null) { container = container.getParent(); } targetWidth = container.getSize().width; if (targetWidth == 0) { targetWidth = Integer.MAX_VALUE; } int hgap = getHgap(); Insets insets = target.getInsets(); int horizontalInsetsAndGap = insets.left + insets.right + (hgap * 2); int maxWidth = targetWidth - horizontalInsetsAndGap; return new ParentDimensions(targetWidth, maxWidth, insets); }

Target:
private ParentDimensions getTargetDimensions(Container target) { Container container = target; while (container.getSize().width == 0 && container.getParent() != null) { container = container.getParent(); } int targetWidth = container.getSize().width; if (targetWidth == 0) { targetWidth = Integer.MAX_VALUE; } Insets insets = container.getInsets(); int horizontalInsetsAndGap = insets.left + insets.right + (getHorizontalGap() * 2); int maxWidth = targetWidth - horizontalInsetsAndGap; return new ParentDimensions(targetWidth, maxWidth, insets); }
Source:
public void prepareTextLookup(ILookupCall<LOOKUP_KEY> call, String text) { String textPattern = text; if (textPattern == null) { textPattern = ""; } textPattern = textPattern.toLowerCase(); IDesktop desktop = ClientSessionProvider.currentSession().getDesktop(); if (desktop != null && desktop.isAutoPrefixWildcardForTextSearch()) { textPattern = getWildcard() + textPattern; } if (!textPattern.endsWith(getWildcard())) { textPattern = textPattern + getWildcard(); } if (isBrowseHierarchy() && getLookupCall() != null && getLookupCall() instanceof LocalLookupCall) { ((LocalLookupCall) getLookupCall()).setHierarchicLookup(true); } call.setKey(null); call.setText(textPattern); call.setAll(null); call.setRec(null); call.setActive(isActiveFilterEnabled() ? getActiveFilter() : TriState.TRUE); if (getMasterValue() != null || getLookupCall() == null || getLookupCall().getMaster() == null) { call.setMaster(getMasterValue()); } interceptPrepareLookup(call); interceptPrepareTextLookup(call, text); }

Target:
public void prepareTextLookup(ILookupCall<LOOKUP_KEY> call, String text) { String textPattern = text; if (textPattern == null) { textPattern = ""; } textPattern = textPattern.toLowerCase(); IDesktop desktop = ClientSessionProvider.currentSession().getDesktop(); if (desktop != null && desktop.isAutoPrefixWildcardForTextSearch()) { textPattern = getWildcard() + textPattern; } if (!textPattern.endsWith(getWildcard())) { textPattern = textPattern + getWildcard(); } if (isBrowseHierarchy() && getLookupCall() instanceof LocalLookupCall) { ((LocalLookupCall) getLookupCall()).setHierarchicLookup(true); } call.setKey(null); call.setText(textPattern); call.setAll(null); call.setRec(null); call.setActive(isActiveFilterEnabled() ? getActiveFilter() : TriState.TRUE); if (getMasterValue() != null || getLookupCall() == null || getLookupCall().getMaster() == null) { call.setMaster(getMasterValue()); } interceptPrepareLookup(call); interceptPrepareTextLookup(call, text); }
Source:
public void testLeavesBehindTurdlingsWhenToldTo() throws Exception { curator.start(); Announcer announcer = new Announcer(curator, exec); final byte[] billy = "billy".getBytes(); final String testPath = "/somewhere/test2"; final String parent = ZKPaths.getPathAndNode(testPath).getPath(); announcer.start(); try { Assert.assertNull(curator.checkExists().forPath(parent)); announcer.announce(testPath, billy, false); Assert.assertNotNull(curator.checkExists().forPath(parent)); } finally { announcer.stop(); } Assert.assertNotNull(curator.checkExists().forPath(parent)); }

Target:
public void testLeavesBehindTurdlingsWhenToldTo() throws Exception { curator.start(); Announcer announcer = new Announcer(curator, exec); final byte[] billy = "billy".getBytes(); final String testPath = "/somewhere/test2"; final String parent = ZKPaths.getPathAndNode(testPath).getPath(); announcer.start(); try { Assert.assertNull(curator.checkExists().forPath(parent)); awaitAnnounce(announcer, testPath, billy, false); Assert.assertNotNull(curator.checkExists().forPath(parent)); } finally { announcer.stop(); } Assert.assertNotNull(curator.checkExists().forPath(parent)); }
Source:
public SquidCursor<?> swapCursor(SquidCursor<? extends M> newCursor) { if (cursor == newCursor) { return null; } SquidCursor<?> oldCursor = cursor; cursor = newCursor; notifyDataSetChanged(); return oldCursor; }

Target:
public SquidCursor<? extends M> swapCursor(SquidCursor<? extends M> newCursor) { if (cursor == newCursor) { return null; } SquidCursor<? extends M> oldCursor = cursor; cursor = newCursor; notifyDataSetChanged(); return oldCursor; }
Source:
char sendIMKeyEvent (int type, long event, char chars) { int index = 0, count = 0, state = 0; long ptr = 0; if (event == 0) { ptr = GTK.gtk_get_current_event (); if (ptr != 0) { int eventType = GDK.gdk_event_get_event_type(ptr); eventType = Control.fixGdkEventTypeValues(eventType); switch (eventType) { case GDK.GDK_KEY_PRESS: case GDK.GDK_KEY_RELEASE: int eventState = new int[1]; GDK.gdk_event_get_state(ptr, eventState); state = eventState[0]; break; default: event = 0; break; } } } if (event == 0) { int buffer = new int [1]; GTK.gtk_get_current_event_state (buffer); state = buffer [0]; } while (index < chars.length) { Event javaEvent = new Event (); if ((event != 0 || ptr != 0) && chars.length <= 1) { setKeyState (javaEvent, ptr); } else { setInputState (javaEvent, state); } javaEvent.character = chars [index]; sendEvent (type, javaEvent); if (isDisposed ()) { if (ptr != 0) gdk_event_free (ptr); return null; } if (javaEvent.doit) chars [count++] = chars [index]; index++; } if (ptr != 0) gdk_event_free (ptr); if (count == 0) return null; if (index != count) { char result = new char [count]; System.arraycopy (chars, 0, result, 0, count); return result; } return chars; }

Target:
char sendIMKeyEvent (int type, long event, char chars) { int index = 0, count = 0, state = 0; long ptr = 0; if (event == 0) { ptr = GTK.gtk_get_current_event (); if (ptr != 0) { int eventType = GDK.gdk_event_get_event_type(ptr); eventType = Control.fixGdkEventTypeValues(eventType); switch (eventType) { case GDK.GDK_KEY_PRESS: case GDK.GDK_KEY_RELEASE: int eventState = new int[1]; GDK.gdk_event_get_state(ptr, eventState); state = eventState[0]; break; default: event = 0; break; } } else { int buffer = new int [1]; GTK.gtk_get_current_event_state (buffer); state = buffer [0]; } } else { ptr = event; } while (index < chars.length) { Event javaEvent = new Event (); if (ptr != 0 && chars.length <= 1) { setKeyState (javaEvent, ptr); } else { setInputState (javaEvent, state); } javaEvent.character = chars [index]; sendEvent (type, javaEvent); if (isDisposed ()) { if (ptr != 0) gdk_event_free (ptr); return null; } if (javaEvent.doit) chars [count++] = chars [index]; index++; } if (ptr != 0) gdk_event_free (ptr); if (count == 0) return null; if (index != count) { char result = new char [count]; System.arraycopy (chars, 0, result, 0, count); return result; } return chars; }
Source:
private Iterator<DiscoveryDruidNode> getDruidServers(DruidNodeDiscoveryProvider druidNodeDiscoveryProvider) { final Collection<DiscoveryDruidNode> discoveryDruidNodes = new ArrayList<>(); discoveryDruidNodes.addAll(getServerTypeNodes(druidNodeDiscoveryProvider, NodeType.COORDINATOR)); discoveryDruidNodes.addAll(getServerTypeNodes(druidNodeDiscoveryProvider, NodeType.OVERLORD)); discoveryDruidNodes.addAll(getServerTypeNodes(druidNodeDiscoveryProvider, NodeType.BROKER)); discoveryDruidNodes.addAll(getServerTypeNodes(druidNodeDiscoveryProvider, NodeType.ROUTER)); discoveryDruidNodes.addAll(getServerTypeNodes(druidNodeDiscoveryProvider, NodeType.HISTORICAL)); discoveryDruidNodes.addAll(getServerTypeNodes(druidNodeDiscoveryProvider, NodeType.MIDDLE_MANAGER)); discoveryDruidNodes.addAll(getServerTypeNodes(druidNodeDiscoveryProvider, NodeType.PEON)); return discoveryDruidNodes.iterator(); }

Target:
private Iterator<DiscoveryDruidNode> getDruidServers(DruidNodeDiscoveryProvider druidNodeDiscoveryProvider) { return Arrays.stream(NodeType.values()) .flatMap(nodeType -> druidNodeDiscoveryProvider.getForNodeType(nodeType).getAllNodes().stream()) .collect(Collectors.toList()) .iterator(); }
Source:
public CellAddress getAddress() { throw new UnsupportedOperationException("Not implememted yet."); }

Target:
public CellAddress getAddress() { return new CellAddress(getRow().getRowNum(), columnIndex); }
Source:
private ContactDataBuilder extractContactData(ContactDataBuilder builder, long contactId, Cursor cursor) { final ColumnProcessors processors = new ColumnProcessors(); builder.setContactId(contactId); builder.setPhotoId(processors.forInteger().extract(cursor, Column.PHOTO_ID)); String mimeType = processors.forString().extract(cursor, Column.MIMETYPE); String data = processors.forString().extract(cursor, Column.DATA1); int isPrimary = processors.forInteger().extract(cursor, Column.IS_PRIMARY); if (mimeType.equals(Email.CONTENT_ITEM_TYPE)) { builder.addEmailId(data); } else if (mimeType.equals(Phone.CONTENT_ITEM_TYPE)) { builder.addPhoneNumber(new ContactNumber(data, isPrimary > 0 ? true : false)); } else if (mimeType.equals(StructuredName.CONTENT_ITEM_TYPE)) { PersonNameDataBuilder nameBuilder = new PersonNameDataBuilder(); nameBuilder.setDisplayName(data); data = processors.forString().extract(cursor, Column.DATA2); nameBuilder.setGivenName(data); data = processors.forString().extract(cursor, Column.DATA3); nameBuilder.setFamilyName(data); data = processors.forString().extract(cursor, Column.DATA4); nameBuilder.setPrefix(data); data = processors.forString().extract(cursor, Column.DATA5); nameBuilder.setMiddleName(data); data = processors.forString().extract(cursor, Column.DATA6); nameBuilder.setSuffix(data); builder.setName(nameBuilder.build()); } return builder; }

Target:
private ContactDataBuilder extractContactData(ContactDataBuilder builder, long contactId, Cursor cursor) { final ColumnProcessors processors = new ColumnProcessors(); builder.setContactId(contactId); builder.setPhotoId(processors.forInteger().extract(cursor, Column.PHOTO_ID)); String mimeType = processors.forString().extract(cursor, Column.MIMETYPE); String data = processors.forString().extract(cursor, Column.DATA1); int isPrimary = processors.forInteger().extract(cursor, Column.IS_PRIMARY); if (mimeType.equals(Email.CONTENT_ITEM_TYPE)) { builder.addEmailId(data); } else if (mimeType.equals(Phone.CONTENT_ITEM_TYPE)) { builder.addPhoneNumber(new ContactNumber(data, isPrimary > 0 ? true : false)); } else if (mimeType.equals(StructuredName.CONTENT_ITEM_TYPE)) { PersonNameDataBuilder nameBuilder = new PersonNameDataBuilder(); nameBuilder.setDisplayName(data); nameBuilder.setGivenName(processors.forString().extract(cursor, Column.DATA2)); nameBuilder.setFamilyName(processors.forString().extract(cursor, Column.DATA3)); nameBuilder.setPrefix(processors.forString().extract(cursor, Column.DATA4)); nameBuilder.setMiddleName(processors.forString().extract(cursor, Column.DATA5)); nameBuilder.setSuffix(processors.forString().extract(cursor, Column.DATA6)); builder.setName(nameBuilder); } return builder; }
Source:
public GeoNamesCatalogIndexer( CatalogFramework catalogFramework, UuidGenerator uuidGenerator, MetacardType metacardType, FilterBuilder filterBuilder, List<CatalogProvider> catalogProviders) { this.catalogFramework = catalogFramework; this.uuidGenerator = uuidGenerator; this.geoNamesMetacardType = metacardType; this.catalogProviders = catalogProviders; this.filterBuilder = filterBuilder; filter = filterBuilder.allOf( filterBuilder .attribute(METACARD_TAGS) .is() .equalTo() .text(GeoCodingConstants.GEONAMES_TAG), filterBuilder.attribute(METACARD_TAGS).is().equalTo().text(GAZETTEER_METACARD_TAG)); }

Target:
public GeoNamesCatalogIndexer( CatalogFramework catalogFramework, UuidGenerator uuidGenerator, MetacardType metacardType, FilterBuilder filterBuilder, List<CatalogProvider> catalogProviders) { this.catalogFramework = catalogFramework; this.uuidGenerator = uuidGenerator; this.geoNamesMetacardType = metacardType; this.catalogProviders = catalogProviders; this.filterBuilder = filterBuilder; filter = filterBuilder.allOf( filterBuilder .attribute(Core.METACARD_TAGS) .is() .equalTo() .text(GeoCodingConstants.GEONAMES_TAG), filterBuilder .attribute(Core.METACARD_TAGS) .is() .equalTo() .text(GAZETTEER_METACARD_TAG)); }
Source:
protected boolean validateAction() { return true; }

Target:
protected boolean validateAction() { return getLookupRule() != null; }