auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private Mono<PollResponse<BlobCopyInfo>> onPoll(PollResponse<BlobCopyInfo> pollResponse) { if (pollResponse.getStatus() == OperationStatus.SUCCESSFULLY_COMPLETED || pollResponse.getStatus() == OperationStatus.FAILED) { return Mono.just(pollResponse); } final BlobCopyInfo lastInfo = pollResponse.getValue(); if (lastInfo == null) { logger.warning("BlobCopyInfo does not exist. Activation operation failed."); return Mono.just(new PollResponse<>( OperationStatus.fromString("COPY_START_FAILED", true), null)); } return getProperties().map(response -> { final CopyStatusType status = response.getCopyStatus(); final BlobCopyInfo result = new BlobCopyInfo(response.getCopySource(), response.getCopyId(), status, response.getETag(), response.getCopyCompletionTime(), response.getCopyStatusDescription()); OperationStatus operationStatus; switch (status) { case SUCCESS: operationStatus = OperationStatus.SUCCESSFULLY_COMPLETED; break; case FAILED: operationStatus = OperationStatus.NOT_STARTED; break; case ABORTED: operationStatus = OperationStatus.USER_CANCELLED; break; case PENDING: operationStatus = OperationStatus.IN_PROGRESS; break; default: throw Exceptions.propagate(logger.logExceptionAsError(new IllegalArgumentException( "CopyStatusType is not supported. Status: " + status))); } return new PollResponse<>(operationStatus, result); }).onErrorReturn( new PollResponse<>(OperationStatus.fromString("POLLING_FAILED", true), lastInfo)); }

Target:
private Mono<PollResponse<BlobCopyInfo>> onPoll(PollResponse<BlobCopyInfo> pollResponse) { if (pollResponse.getStatus() == OperationStatus.SUCCESSFULLY_COMPLETED || pollResponse.getStatus() == OperationStatus.FAILED) { return Mono.just(pollResponse); } final BlobCopyInfo lastInfo = pollResponse.getValue(); if (lastInfo == null) { logger.warning("BlobCopyInfo does not exist. Activation operation failed."); return Mono.just(new PollResponse<>( OperationStatus.fromString("COPY_START_FAILED", true), null)); } return getProperties().map(response -> { final CopyStatusType status = response.getCopyStatus(); final BlobCopyInfo result = new BlobCopyInfo(response.getCopySource(), response.getCopyId(), status, response.getETag(), response.getCopyCompletionTime(), response.getCopyStatusDescription()); OperationStatus operationStatus; switch (status) { case SUCCESS: operationStatus = OperationStatus.SUCCESSFULLY_COMPLETED; break; case FAILED: operationStatus = OperationStatus.FAILED; break; case ABORTED: operationStatus = OperationStatus.USER_CANCELLED; break; case PENDING: operationStatus = OperationStatus.IN_PROGRESS; break; default: throw logger.logExceptionAsError(new IllegalArgumentException( "CopyStatusType is not supported. Status: " + status)); } return new PollResponse<>(operationStatus, result); }).onErrorReturn( new PollResponse<>(OperationStatus.fromString("POLLING_FAILED", true), lastInfo)); }
Source:
public void populate(List<CategoryDTO> categories) { Platform.runLater(() -> { Set<String> themedCategories = Sets.newHashSet( "custom", "development", "games", "graphics", "internet", "multimedia", "office", "other", "science" ); final List<LeftButton> leftButtonList = new ArrayList<>(); for (CategoryDTO category : categories) { if(category.getType() == CategoryDTO.CategoryType.INSTALLERS) { final LeftButton categoryButton = new LeftButton(category.getName()); if (themedCategories.contains(category.getName().toLowerCase())) { final String themeName = new String(category.getName().toLowerCase() + "Button"); categoryButton.getStyleClass().add(themeName); } else { categoryButton.setStyle("-fx-background-image: url('file:/ } categoryButton.setOnMouseClicked(event -> selectCategory(category)); leftButtonList.add(categoryButton); } } categoryView.setNodes(leftButtonList); showAvailableApps(); }); }

Target:
public void populate(List<CategoryDTO> categories) { Platform.runLater(() -> { final List<LeftButton> leftButtonList = new ArrayList<>(); for (CategoryDTO category : categories) { if(category.getType() == CategoryDTO.CategoryType.INSTALLERS) { final LeftButton categoryButton = new LeftButton(category.getName()); final String themeName = new String(category.getName().toLowerCase() + "Button"); categoryButton.setStyle("-fx-background-image: url('" + category.getIcon() + "');"); categoryButton.getStyleClass().add(themeName); categoryButton.setOnMouseClicked(event -> selectCategory(category)); leftButtonList.add(categoryButton); } } categoryView.setNodes(leftButtonList); showAvailableApps(); }); }
Source:
public long[] getLargeUpdateCount() { long[] copyCount = uncompressLongUpdateCount(); return Arrays.copyOf(copyCount, copyCount.length); }

Target:
public long[] getLargeUpdateCount() { return uncompressLongUpdateCount(); }
Source:
public void setRemoteCharset(Charset remoteCharset) { this.remoteCharset = remoteCharset; }

Target:
public void setRemoteCharset(Charset remoteCharset) { this.remoteCharset = remoteCharset != null ? remoteCharset : IOUtils.UTF8; }
Source:
public String toString() { if ( isClosed() ) { return "NodeValueIndexCursor[closed state]"; } else { return "NodeValueIndexCursor[node=" + node + ", open state with: keys=" + Arrays.toString( query ) + ", values=" + Arrays.toString( values ) + ", underlying record=" + super.toString() + " ]"; } }

Target:
public String toString() { if ( isClosed() ) { return "NodeValueIndexCursor[closed state]"; } else { return "NodeValueIndexCursor[node=" + node + ", open state with: keys=" + Arrays.toString( stream( query ).map( IndexQuery::propertyKeyId ).toArray( Integer[]::new ) ) + ", values=" + Arrays.toString( values ) + ", underlying record=" + super.toString() + " ]"; } }
Source:
public Field setHidden(Boolean hidden) { retrievable = this.hidden == null ? null : !this.hidden; this.hidden = hidden; return this; }

Target:
public Field setHidden(Boolean hidden) { this.hidden = hidden; retrievable = this.hidden == null ? null : !this.hidden; return this; }
Source:
public String _getBindingItemsPolicy() { String value = config.getString("binding-items-policy", "keep").toLowerCase(Locale.ENGLISH); if (!value.equals("delete") && !value.equals("drop") && !value.equals("keep")) { value = "delete"; } return value; }

Target:
public KeepInvPolicy _getBindingItemsPolicy() { String value = config.getString("binding-items-policy", "keep").toLowerCase(Locale.ENGLISH); try { return KeepInvPolicy.valueOf(value.toUpperCase(Locale.ENGLISH)); } catch (IllegalArgumentException e) { return KeepInvPolicy.KEEP; } }
Source:
public void onResult(String text) { result = text; AfterGettingText(result, false); onDelete(); }

Target:
public void onResult(String text) { result = text; AfterGettingText(result, false); }
Source:
public WorkunitInfo createWUFromECL(WorkunitInfo wu) throws Exception { WorkunitInfo createdWU = null; if (wsWorkunitsServiceSoapProxy == null) throw new Exception("wsWorkunitsServiceSoapProxy not available"); else { WUCreateAndUpdateWrapper wucreateparameters = new WUCreateAndUpdateWrapper(); wucreateparameters.setAction(1); wucreateparameters.setQueryText(wu.getECL()); wucreateparameters.setApplicationValues(wu.getRawApplicationValues()); wucreateparameters.setDebugValues(wu.getDebugValues()); wucreateparameters.setJobname(wu.getJobname()); wucreateparameters.setClusterOrig(wu.getCluster()); wucreateparameters.setResultLimit(wu.getResultLimit()); wucreateparameters.setWuid(wu.getWuid()); WUUpdateResponseWrapper wuUpdateResponse = null; if (targetVersion.major==6) { wuUpdateResponse=new WUUpdateResponseWrapper(this.version6WorkunitsServiceSoapProxy.WUCreateAndUpdate(wucreateparameters.getRawVersion6())); } else if (targetVersion.major==7) { wuUpdateResponse=new WUUpdateResponseWrapper(this.wsWorkunitsServiceSoapProxy.WUCreateAndUpdate(wucreateparameters.getRaw())); } else { throw new NotImplementedException("Can only handle cluster versions 6 and 7, not version " + String.valueOf(targetVersion.major)); } createdWU = wuUpdateResponse.getWorkunit(); if (wuUpdateResponse.getExceptions().size()==0) { createdWU.setMaxMonitorMillis(wu.getMaxMonitorMillis()); createdWU.setCluster(wu.getCluster()); createdWU.setJobname(wu.getJobname()); createdWU.setSleepMillis(wu.getSleepMillis()); createdWU.setOriginalEclWatchUrl(getEclWatchUrl()); } else { throwWsWUExceptions(createdWU.getRawArrayOfEspExceptions(), "Error compiling ECL query"); } } return createdWU; }

Target:
public WorkunitInfo createWUFromECL(WorkunitInfo wu) throws Exception { WorkunitInfo createdWU = null; getSoapProxy(); WUCreateAndUpdateWrapper wucreateparameters = new WUCreateAndUpdateWrapper(); wucreateparameters.setAction(WUActionCode.WUActionCompile.ordinal()); wucreateparameters.setQueryText(wu.getECL()); wucreateparameters.setApplicationValues(wu.getRawApplicationValues()); wucreateparameters.setDebugValues(wu.getDebugValues()); wucreateparameters.setJobname(wu.getJobname()); wucreateparameters.setClusterOrig(wu.getCluster()); wucreateparameters.setResultLimit(wu.getResultLimit()); wucreateparameters.setWuid(wu.getWuid()); WUUpdateResponseWrapper wuUpdateResponse = soapWrapper.WUCreateAndUpdate(wucreateparameters); createdWU = wuUpdateResponse.getWorkunit(); if (wuUpdateResponse.getExceptions().size()==0) { createdWU.setMaxMonitorMillis(wu.getMaxMonitorMillis()); createdWU.setCluster(wu.getCluster()); createdWU.setJobname(wu.getJobname()); createdWU.setSleepMillis(wu.getSleepMillis()); createdWU.setOriginalEclWatchUrl(getEclWatchUrl()); } else { throwWsWUExceptions(createdWU.getRawArrayOfEspExceptions(), "Error compiling ECL query"); } return createdWU; }
Source:
public boolean performNextOperationColdMerge(int completedChildren) { if (completedChildren == getParameters().getImageIds().size()) { return false; } if (completedChildren == 0) { ImagesHandler.updateAllDiskImageSnapshotsStatus(getImageGroupId(), ImageStatus.LOCKED); } Guid nextImageId = getParameters().getImageIds().get(completedChildren); log.info("Starting child command of {}, image '{}'", completedChildren + 1, getParameters().getImageIds().size(), nextImageId); ImagesContainterParametersBase parameters = buildRemoveSnapshotSingleDiskParameters(nextImageId); CommandCoordinatorUtil.executeAsyncCommand(VdcActionType.RemoveSnapshotSingleDisk, parameters, cloneContextAndDetachFromParent()); return true; }

Target:
private boolean performNextOperationColdMerge(int completedChildren) { Guid nextImageId = getParameters().getImageIds().get(completedChildren); log.info("Starting child command of {}, image '{}'", completedChildren + 1, getParameters().getImageIds().size(), nextImageId); ImagesContainterParametersBase parameters = buildRemoveSnapshotSingleDiskParameters(nextImageId); CommandCoordinatorUtil.executeAsyncCommand(VdcActionType.RemoveSnapshotSingleDisk, parameters, cloneContextAndDetachFromParent()); return true; }
Source:
public void testChangePassword() throws InterruptedException { List<SharedStorageAccess> response = sharedStorageApi().changePassword(SharedStorageAccess.UpdateSharedStorageAccess.create("Test123!")); assertNotNull(response); }

Target:
public void testChangePassword() { List<SharedStorageAccess> response = sharedStorageApi().changePassword(SharedStorageAccess.UpdateSharedStorageAccess.create("Test123!")); assertNotNull(response); }
Source:
public FeedbackSessionResponseStatus() { noResponse = new ArrayList<String>(); studentsWhoRespond = new ArrayList<String>(); emailNameTable = new HashMap<String, String>(); emailSectionTable = new HashMap<String, String>(); emailTeamNameTable = new HashMap<String, String>(); }

Target:
public FeedbackSessionResponseStatus() { noResponse = new ArrayList<String>(); studentsWhoResponded = new ArrayList<String>(); emailNameTable = new HashMap<String, String>(); emailSectionTable = new HashMap<String, String>(); emailTeamNameTable = new HashMap<String, String>(); }
Source:
public void updateDependentPhenotypesAsOutOfSync(final Integer variableId, final Set<Integer> observationUnitIds) { final List<Formula> formulaList = this.daoFactory.getFormulaDAO().getByInputId(variableId); if (!formulaList.isEmpty() && !observationUnitIds.isEmpty()) { final List<Integer> targetVariableIds = Lists.transform(formulaList, new Function<Formula, Integer>() { @Override public Integer apply(final Formula formula) { return formula.getTargetCVTerm().getCvTermId(); } }); this.daoFactory.getPhenotypeDAO() .updateOutOfSyncPhenotypes(observationUnitIds, Sets.newHashSet(targetVariableIds)); } }

Target:
public void updateDependentPhenotypesAsOutOfSync(final Integer variableId, final Set<Integer> observationUnitIds) { final List<Formula> formulaList = this.daoFactory.getFormulaDAO().getByInputId(variableId); if (!org.springframework.util.CollectionUtils.isEmpty(formulaList) && !org.springframework.util.CollectionUtils .isEmpty(observationUnitIds)) { final List<Integer> targetVariableIds = Lists.transform(formulaList, new Function<Formula, Integer>() { @Override public Integer apply(final Formula formula) { return formula.getTargetCVTerm().getCvTermId(); } }); this.daoFactory.getPhenotypeDAO() .updateOutOfSyncPhenotypes(observationUnitIds, Sets.newHashSet(targetVariableIds)); } }
Source:
private int calculateLifeTime(int power) { ThreadLocalRandom random = ThreadLocalRandom.current(); return ((power + 1) * 10 + random.nextInt(0, 6) + random.nextInt(0, 7)); }

Target:
private int calculateLifeTime(int power) { ThreadLocalRandom random = ThreadLocalRandom.current(); return ((power + 1) * 10 + random.nextInt(6) + random.nextInt(7)); }
Source:
protected DistributedTxManagerProvider() { Properties properties = new Properties(); properties.setProperty(JMSTestConstants.ATOMIKOS_BASE_DIRECTORY_PROP, JMSTestConstants.TEST_LOG_DIR); try { UserTransactionServiceImp service = new UserTransactionServiceImp(properties); service.init(); UserTransactionManager utm = new UserTransactionManager(); utm.setStartupTransactionService(false); utm.init(); this.transactionManager = utm; } catch (SystemException e) { logger.error("Error when creating the XA provider ", e); } }

Target:
protected DistributedTxManagerProvider() { Properties properties = new Properties(); properties.setProperty(JMSTestConstants.ATOMIKOS_BASE_DIRECTORY_PROP, JMSTestConstants.TEST_LOG_DIR); try { UserTransactionServiceImp service = new UserTransactionServiceImp(properties); service.init(); UserTransactionManager atomikosTransactionManager = new UserTransactionManager(); atomikosTransactionManager.setStartupTransactionService(false); atomikosTransactionManager.init(); this.transactionManager = atomikosTransactionManager; } catch (SystemException e) { logger.error("Error when creating the XA provider ", e); } }
Source:
private void validatePlugins(WorkspaceConfig config) throws ValidationException { List<String> installers = config .getEnvironments() .values() .stream() .map( env -> env.getMachines() .values() .stream() .map(MachineConfig::getInstallers) .flatMap(List::stream)) .flatMap(Function.identity()) .collect(Collectors.toList()); Map<String, String> attributes = config.getAttributes(); boolean hasPlugins = !Strings.isNullOrEmpty(attributes.getOrDefault(PLUGINS_ATTRIBUTE, null)); boolean hasEditor = !Strings.isNullOrEmpty(attributes.getOrDefault(EDITOR_ATTRIBUTE, null)); if ((hasPlugins || hasEditor) && installers.size() > 0) { throw new ValidationException("Workspace config cannot have both plugins and installers."); } }

Target:
private void validatePlugins(WorkspaceConfig config) throws ValidationException { Optional<String> installers = config .getEnvironments() .values() .stream() .flatMap(env -> env.getMachines().values().stream()) .flatMap(machine -> machine.getInstallers().stream()) .findAny(); Map<String, String> attributes = config.getAttributes(); boolean hasPlugins = !Strings.isNullOrEmpty( attributes.getOrDefault(Constants.WORKSPACE_TOOLING_PLUGINS_ATTRIBUTE, null)); boolean hasEditor = !Strings.isNullOrEmpty( attributes.getOrDefault(Constants.WORKSPACE_TOOLING_EDITOR_ATTRIBUTE, null)); if ((hasPlugins || hasEditor) && installers.isPresent()) { throw new ValidationException("Workspace config cannot have both plugins and installers."); } }
Source:
private void validate() throws UnloggedFailure { if (active && inactive) { throw new UnloggedFailure(1, "You can't use both --active and --inactive"); } if (addSshKeys.contains("-")) { if (deleteSshKeys.contains("-")) { throw new UnloggedFailure(1, "You can't use both --add-ssh-key and --delete-ssh-key with stdin"); } if (addSshKeys.size() > 1) { throw new UnloggedFailure(1, "You can't use stdin with multiple arguments"); } } if (deleteSshKeys.size() > 1) { if (deleteSshKeys.contains("-")) { throw new UnloggedFailure(1, "You can't use stdin with multiple arguments"); } if (deleteSshKeys.contains("ALL")) { throw new UnloggedFailure(1, "You can't use 'ALL' with multiple arguments"); } } if (deleteEmails.size() > 1 && deleteEmails.contains("ALL")) { throw new UnloggedFailure(1, "You can't use 'ALL' with multiple arguments"); } }

Target:
private void validate() throws UnloggedFailure { if (active && inactive) { throw new UnloggedFailure(1, "--active and --inactive options are mutually exclusive."); } if (addSshKeys.contains("-") && deleteSshKeys.contains("-")) { throw new UnloggedFailure(1, "Only one option may use the stdin"); } if (deleteSshKeys.contains("ALL")) { deleteSshKeys = Collections.singletonList("ALL"); } if (deleteEmails.contains("ALL")) { deleteEmails = Collections.singletonList("ALL"); } }
Source:
public MutableBoundedValue<Double> walkSpeed() { return SpongeValueBuilder.boundedBuilder(Keys.WALKING_SPEED) .defaultValue(0.699999988079071D) .minimum(0D) .maximum(Double.MAX_VALUE) .actualValue(this.walkSpeed) .build(); }

Target:
public Value<Double> walkSpeed() { return new SpongeValue<>(Keys.WALKING_SPEED, 0.7D, this.walkSpeed); }
Source:
public long getID() { if (!isConnected()) { throw new IllegalStateException("Session must be connected first."); } return mSessionID; }

Target:
public long getID() { return mSessionID; }
Source:
public ASTNode visit(TermCons tc, Void _) { if (!MetaK.isComputationSort(tc.getSort())) { return KApp.of(new KInjectedLabel((Term) trans.visitNode(tc))); } String l = tc.getLocation(); String f = tc.getFilename(); Production ppp = tc.getProduction(); KList lok = new KList(l, f); for (Term t : tc.getContents()) { lok.getContents().add((Term) this.visitNode(t)); } String label; if (ppp.isListDecl() && tc.getContents().size() == 0) label = "'.List{\"" + StringUtil.escape(ppp.getListDecl().getSeparator()) + "\"}"; else label = ppp.getKLabel(); return new KApp(l, f, KLabelConstant.of(label, context), lok); }

Target:
public ASTNode visit(TermCons tc, Void _) { if (!MetaK.isComputationSort(tc.getSort())) { return KApp.of(new KInjectedLabel((Term) trans.visitNode(tc))); } String l = tc.getLocation(); String f = tc.getFilename(); Production ppp = tc.getProduction(); KList lok = new KList(l, f); for (Term t : tc.getContents()) { lok.getContents().add((Term) this.visitNode(t)); } String label; if (tc.isListTerminator()) label = tc.getProduction().getListDecl().getTerminatorKLabel(); else label = ppp.getKLabel(); return new KApp(l, f, KLabelConstant.of(label, context), lok); }
Source:
private Rect calculateFocusArea(float x, float y) { Display display = ((WindowManager) getContext().getSystemService(Context.WINDOW_SERVICE)).getDefaultDisplay(); Point size = new Point(); display.getSize(size); screen_width = size.x; screen_height = size.y; int left = clamp(Float.valueOf((x / mSurfaceView.getWidth()) * screen_height - screen_width).intValue(), FOCUS_AREA_SIZE); int top = clamp(Float.valueOf((y / mSurfaceView.getHeight()) * screen_height - screen_width).intValue(), FOCUS_AREA_SIZE); return new Rect(left, top, left + FOCUS_AREA_SIZE, top + FOCUS_AREA_SIZE); }

Target:
private Rect calculateFocusArea(float x, float y) { screen_width = Utils.getScreenWidth(getContext()); screen_height = Utils.getScreenHeight(getContext()); int left = clamp(Float.valueOf((x / mSurfaceView.getWidth()) * screen_height - screen_width).intValue(), FOCUS_AREA_SIZE); int top = clamp(Float.valueOf((y / mSurfaceView.getHeight()) * screen_height - screen_width).intValue(), FOCUS_AREA_SIZE); return new Rect(left, top, left + FOCUS_AREA_SIZE, top + FOCUS_AREA_SIZE); }
Source:
public CliCommand init(final Arguments args) throws Exception { this.bucketName = args.getBucket(); if (this.bucketName == null) { throw new MissingOptionException("The bulk put command requires '-b' to be set."); } pipe = args.isPipe(); if (pipe) { this.pipedFiles = getPipedFilesFromStdin(); if (this.pipedFiles.isEmpty()) { throw new MissingOptionException("Stdin is empty"); } } else { final String srcDir = args.getDirectory(); if (srcDir == null) { throw new MissingOptionException("The bulk put command required '-d' to be set."); } this.inputDirectory = FileSystems.getDefault().getPath(srcDir); } if (args.getObjectName() != null) { System.err.println("Warning: '-o' is not used with bulk put and is ignored."); } this.prefix = args.getPrefix(); this.priority = args.getPriority(); this.writeOptimization = args.getWriteOptimization(); this.checksum = args.isChecksum(); this.force = args.isForce(); if (args.isSync()) { LOG.info("Using sync command"); this.sync = true; } this.numberOfThreads = Integer.valueOf(args.getNumberOfThreads()); return this; }

Target:
public CliCommand init(final Arguments args) throws Exception { this.bucketName = args.getBucket(); if (this.bucketName == null) { throw new MissingOptionException("The bulk put command requires '-b' to be set."); } this.pipe = Utils.isPipe(); if (this.pipe) { if (this.isOtherArgs(args)) { throw new BadArgumentException("-d, -o and -p arguments are not supported when using piped input"); } this.pipedFiles = Utils.getPipedFilesFromStdin(getFileUtils()); if (Guard.isNullOrEmpty(this.pipedFiles)) { throw new MissingOptionException("Stdin is empty"); } this.mapNormalizedObjectNameToObjectName = this.getNormalizedObjectNameToObjectName(this.pipedFiles); } else { final String srcDir = args.getDirectory(); if (srcDir == null) { throw new MissingOptionException("The bulk put command required '-d' to be set."); } this.inputDirectory = Paths.get(srcDir); if (args.getObjectName() != null) { System.err.println("Warning: '-o' is not used with bulk put and is ignored."); } this.prefix = args.getPrefix(); } this.priority = args.getPriority(); this.writeOptimization = args.getWriteOptimization(); this.checksum = args.isChecksum(); this.force = args.isForce(); if (args.isSync()) { if (!SyncUtils.isSyncSupported(getClient())) { throw new SyncNotSupportedException("The sync command is not supported with your version of BlackPearl."); } LOG.info("Using sync command"); this.sync = true; } this.numberOfThreads = Integer.valueOf(args.getNumberOfThreads()); if (args.isIgnoreErrors()) { LOG.info("Ignoring files that cause errors"); this.ignoreErrors = true; } return this; }
Source:
private XmlRpcStruct initNicStructure() { XmlRpcStruct map = new XmlRpcStruct(); VmNetworkInterface nic = getParameters().getNic(); VmDevice vmDevice = getParameters().getVmDevice(); map.add("type", "interface"); map.add("device", "bridge"); map.add("macAddr", nic.getMacAddress()); map.add("network", nic.getNetworkName()); addAddress(map, vmDevice.getAddress()); map.add("specParams", vmDevice.getSpecParams()); map.add("nicModel", VmInterfaceType.forValue(nic.getType()).name()); if (vmDevice.getBootOrder() > 0) { map.add("bootOrder", String.valueOf(vmDevice.getBootOrder())); } if (nic.isPortMirroring()) { struct.add(VdsProperties.portMirroring, Collections.singletonList(nic.getNetworkName())); } return map; }

Target:
private XmlRpcStruct initNicStructure() { XmlRpcStruct map = new XmlRpcStruct(); VmNetworkInterface nic = getParameters().getNic(); VmDevice vmDevice = getParameters().getVmDevice(); map.add("type", "interface"); map.add("device", "bridge"); map.add("macAddr", nic.getMacAddress()); map.add("network", nic.getNetworkName()); addAddress(map, vmDevice.getAddress()); map.add("specParams", vmDevice.getSpecParams()); map.add("nicModel", VmInterfaceType.forValue(nic.getType()).name()); if (vmDevice.getBootOrder() > 0) { map.add("bootOrder", String.valueOf(vmDevice.getBootOrder())); } if (nic.isPortMirroring()) { map.add(VdsProperties.portMirroring, Collections.singletonList(nic.getNetworkName())); } return map; }
Source:
private boolean read(EpollRecvByteAllocatorHandle allocHandle, ByteBuf byteBuf, int maxDatagramPacketSize) throws IOException { try { allocHandle.attemptedBytesRead(byteBuf.writableBytes()); final DatagramSocketAddress remoteAddress; if (byteBuf.hasMemoryAddress()) { remoteAddress = socket.recvFromAddress( byteBuf.memoryAddress(), byteBuf.writerIndex(), byteBuf.capacity()); } else { ByteBuffer nioData = byteBuf.internalNioBuffer( byteBuf.writerIndex(), byteBuf.writableBytes()); remoteAddress = socket.recvFrom(nioData, nioData.position(), nioData.limit()); } if (remoteAddress == null) { allocHandle.lastBytesRead(-1); return false; } InetSocketAddress localAddress = remoteAddress.localAddress(); if (localAddress == null) { localAddress = localAddress(); } allocHandle.lastBytesRead(maxDatagramPacketSize <= 0 ? remoteAddress.receivedAmount() : maxDatagramPacketSize); byteBuf.writerIndex(byteBuf.writerIndex() + allocHandle.lastBytesRead()); allocHandle.incMessagesRead(1); pipeline().fireChannelRead(new DatagramPacket(byteBuf, localAddress, remoteAddress)); byteBuf = null; return true; } finally { if (byteBuf != null) { byteBuf.release(); } } }

Target:
private boolean read(EpollRecvByteAllocatorHandle allocHandle, ByteBuf byteBuf, int maxDatagramPacketSize) throws IOException { try { int writable = maxDatagramPacketSize != 0 ? Math.min(byteBuf.writableBytes(), maxDatagramPacketSize) : byteBuf.writableBytes(); allocHandle.attemptedBytesRead(writable); int writerIndex = byteBuf.writerIndex(); final DatagramSocketAddress remoteAddress; if (byteBuf.hasMemoryAddress()) { remoteAddress = socket.recvFromAddress( byteBuf.memoryAddress(), writerIndex, writerIndex + writable); } else { ByteBuffer nioData = byteBuf.internalNioBuffer(writerIndex, writable); remoteAddress = socket.recvFrom(nioData, nioData.position(), nioData.limit()); } if (remoteAddress == null) { allocHandle.lastBytesRead(-1); return false; } InetSocketAddress localAddress = remoteAddress.localAddress(); if (localAddress == null) { localAddress = localAddress(); } allocHandle.lastBytesRead(maxDatagramPacketSize <= 0 ? remoteAddress.receivedAmount() : writable); byteBuf.writerIndex(byteBuf.writerIndex() + allocHandle.lastBytesRead()); allocHandle.incMessagesRead(1); pipeline().fireChannelRead(new DatagramPacket(byteBuf, localAddress, remoteAddress)); byteBuf = null; return true; } finally { if (byteBuf != null) { byteBuf.release(); } } }
Source:
private Class<?> createLinkToInterface(final Class<?> controller, String interfaceName) { try { return Class.forName(interfaceName); } catch (ClassNotFoundException e1) { } final Set<CtMethod> used = new HashSet<>(); ClassPool pool = ClassPool.getDefault(); CtClass inter = pool.makeInterface(interfaceName); try { CtClass returnType = pool.get(String.class.getName()); CtClass objectType = pool.get(Object.class.getName()); for (Method m : getMethods(controller)) { String name = m.getName(); CtClass[] params = createParameters(objectType, m.getParameterTypes().length); CtClass[] empty = new CtClass[0]; for (int length = params.length; length >= 0; length--) { CtMethod method = abstractMethod(returnType, name, params, empty, inter); if (!used.contains(method)) { used.add(method); inter.addMethod(method); logger.debug("added method to interface {}", method.getName(), controller); } } CtMethod getter = abstractMethod(returnType, String.format("get%s", capitalize(name)), empty, empty, inter); if (!used.contains(getter)) { used.add(getter); inter.addMethod(getter); logger.debug("added getter to interface {}", getter.getName(), controller); } } return inter.toClass(); } catch (CannotCompileException | NotFoundException e) { throw new ProxyCreationException(e); } }

Target:
private Class<?> createLinkToInterface(final Class<?> controller, String interfaceName) { try { return Class.forName(interfaceName); } catch (ClassNotFoundException e1) { } final Set<CtMethod> used = new HashSet<>(); ClassPool pool = ClassPool.getDefault(); CtClass inter = pool.makeInterface(interfaceName); try { CtClass returnType = pool.get(String.class.getName()); CtClass objectType = pool.get(Object.class.getName()); for (Method m : getMethods(controller)) { String name = m.getName(); CtClass[] params = createParameters(objectType, m.getParameterTypes().length); CtClass[] empty = new CtClass[0]; for (int length = params.length; length >= 0; length--) { CtMethod method = abstractMethod(returnType, m.getName(), Arrays.copyOf(params, length), empty, inter); if (!used.contains(method)) { used.add(method); inter.addMethod(method); logger.debug("added method to interface {}", method.getName(), controller); } } CtMethod getter = abstractMethod(returnType, String.format("get%s", capitalize(name)), empty, empty, inter); if (!used.contains(getter)) { used.add(getter); inter.addMethod(getter); logger.debug("added getter to interface {}", getter.getName(), controller); } } return inter.toClass(); } catch (CannotCompileException | NotFoundException e) { throw new ProxyCreationException(e); } }
Source:
protected void execute(Context context) throws SQLException { MassUpdate massUpdate = context.prepareMassUpdate(); massUpdate.select("select" + " s.id" + " from properties s" + " where" + " s.resource_id is not null" + " and not exists (" + " select" + " 1" + " from projects p" + " where" + " p.id = s.resource_id" + " and p.scope = ?" + " and p.qualifier in (?,?,?,?)" + " )") .setString(1, SCOPE_PROJECT) .setString(2, QUALIFIER_PROJECT) .setString(3, QUALIFIER_VIEW) .setString(4, QUALIFIER_MODULE) .setString(5, QUALIFIER_SUBVIEW); massUpdate.update("delete from properties where id = ?"); massUpdate.rowPluralName("orphan properties"); massUpdate.execute(CleanOrphanRowsInProperties::handle); }

Target:
protected void execute(Context context) throws SQLException { MassUpdate massUpdate = context.prepareMassUpdate(); massUpdate.select("select" + " s.id" + " from properties s" + " where" + " s.resource_id is not null" + " and not exists (" + " select" + " 1" + " from projects p" + " where" + " p.id = s.resource_id" + " and p.scope = ?" + " and p.qualifier in (?,?,?,?)" + " and p.enabled = ?" + " )") .setString(1, SCOPE_PROJECT) .setString(2, QUALIFIER_PROJECT) .setString(3, QUALIFIER_VIEW) .setString(4, QUALIFIER_MODULE) .setString(5, QUALIFIER_SUBVIEW) .setBoolean(6, true); massUpdate.update("delete from properties where id = ?"); massUpdate.rowPluralName("orphan properties"); massUpdate.execute(CleanOrphanRowsInProperties::handle); }
Source:
private void addStorageQuotaColumn() { if (!importModel.isQuotaEnabled()) { return; } if (quotaColumn != null) { return; } CustomSelectionCell customSelectionCellQuota = new CustomSelectionCell(new ArrayList<String>()); customSelectionCellQuota.setStyle(""); quotaColumn = new Column<DiskImage, String>(customSelectionCellQuota) { @Override public String getValue(DiskImage disk) { ImportDiskData importData = importModel.getDiskImportData(disk.getId()); ArrayList<String> storageQuotaList = new ArrayList<>(); Quota selectedQuota = null; if (importData != null && importData.getQuotaList() != null) { for (Quota quota : importData.getQuotaList()) { storageQuotaList.add(quota.getQuotaName()); if (importData.getSelectedQuota() != null) { if (quota.getId().equals(importData.getSelectedQuota().getId())) { selectedQuota = quota; } } } } ((CustomSelectionCell) getCell()).setOptions(storageQuotaList); if (!storageQuotaList.isEmpty()) { if (selectedQuota != null) { return selectedQuota.getQuotaName(); } else { return storageQuotaList.get(0); } } return ""; } }; quotaColumn.setFieldUpdater(new FieldUpdater<DiskImage, String>() { @Override public void update(int index, DiskImage disk, String value) { importModel.getDiskImportData(disk.getId()).setSelectedQuotaString(value); } }); diskTable.addColumn(quotaColumn, constants.quota(), "100px"); }

Target:
private void addStorageQuotaColumn() { if (!importModel.isQuotaEnabled()) { return; } if (quotaColumn != null) { return; } CustomSelectionCell customSelectionCellQuota = new CustomSelectionCell(new ArrayList<String>()); customSelectionCellQuota.setStyle(EMPTY_STYLE); quotaColumn = new Column<DiskImage, String>(customSelectionCellQuota) { @Override public String getValue(DiskImage disk) { ImportDiskData importData = importModel.getDiskImportData(disk.getId()); ArrayList<String> storageQuotaList = new ArrayList<>(); Quota selectedQuota = null; if (importData != null && importData.getQuotaList() != null) { for (Quota quota : importData.getQuotaList()) { storageQuotaList.add(quota.getQuotaName()); if (importData.getSelectedQuota() != null) { if (quota.getId().equals(importData.getSelectedQuota().getId())) { selectedQuota = quota; } } } } ((CustomSelectionCell) getCell()).setOptions(storageQuotaList); if (!storageQuotaList.isEmpty()) { if (selectedQuota != null) { return selectedQuota.getQuotaName(); } else { return storageQuotaList.get(0); } } return ""; } }; quotaColumn.setFieldUpdater(new FieldUpdater<DiskImage, String>() { @Override public void update(int index, DiskImage disk, String value) { importModel.getDiskImportData(disk.getId()).setSelectedQuotaString(value); } }); diskTable.addColumn(quotaColumn, constants.quota(), "100px"); }
Source:
protected void initializeContainer(FIELD field, FieldElement fieldElement) { String containerSetting = fieldElement.getParams().get("nestedFormContainer"); if(containerSetting != null) { try { Container container = Container.valueOf(containerSetting); field.setContainer(container); } catch (Exception ex){} } }

Target:
protected void initializeContainer(FIELD field, FieldElement fieldElement) { String containerSetting = fieldElement.getParams().get(FIELD_CONTAINER_PARAM); if (containerSetting != null) { try { Container container = Container.valueOf(containerSetting); field.setContainer(container); } catch (Exception ex) { } } }
Source:
public ContentletSystemEventUtil(SystemEventsAPI systemEventsAPI){ this.systemEventsAPI = systemEventsAPI; }

Target:
protected ContentletSystemEventUtil(SystemEventsAPI systemEventsAPI){ this.systemEventsAPI = systemEventsAPI; }
Source:
private void handleDetails(LookData lookData, LookViewHolder holder, LookBaseAdapter lookAdapter) { if (lookAdapter.getShowDetails()) { if (lookData.getAbsolutePath() != null) { holder.lookFileSizeTextView.setText(UtilFile.getSizeAsString(new File(lookData.getAbsolutePath()))); } int[] measure = lookData.getMeasure(); int Length = measure[0]; int Width = measure[1]; String measureString = String.format(Locale.getDefault(), "%d", Length) + " x " + String.format(Locale.getDefault(), "%d", Width); holder.lookMeasureTextView.setText(measureString); holder.lookDetailsLinearLayout.setVisibility(TextView.VISIBLE); } else { holder.lookDetailsLinearLayout.setVisibility(TextView.GONE); } }

Target:
private void handleDetails(LookData lookData, LookViewHolder holder, LookBaseAdapter lookAdapter) { if (lookAdapter.getShowDetails()) { if (lookData.getAbsolutePath() != null) { holder.lookFileSizeTextView.setText(UtilFile.getSizeAsString(new File(lookData.getAbsolutePath()))); } int[] measure = lookData.getMeasure(); int width = measure[0]; int height = measure[1]; String measureString = String.format(Locale.getDefault(), "%d", width) + " x " + String.format(Locale .getDefault(), "%d", height); holder.lookMeasureTextView.setText(measureString); holder.lookDetailsLinearLayout.setVisibility(TextView.VISIBLE); } else { holder.lookDetailsLinearLayout.setVisibility(TextView.GONE); } }
Source:
public static RecordWriter createParquetWriter(Path target, JobConf conf, Properties properties, boolean compress, ConnectorSession session) throws IOException, ReflectiveOperationException { conf.setLong(ParquetOutputFormat.BLOCK_SIZE, HiveSessionProperties.getParquetWriterBlockSize(session).toBytes()); conf.setLong(ParquetOutputFormat.PAGE_SIZE, HiveSessionProperties.getParquetWriterPageSize(session).toBytes()); RecordWriter recordWriter = new MapredParquetOutputFormat() .getHiveRecordWriter(conf, target, Text.class, compress, properties, Reporter.NULL); Object realWriter = REAL_WRITER_FIELD.get(recordWriter); Object internalWriter = INTERNAL_WRITER_FIELD.get(realWriter); ParquetFileWriter fileWriter = (ParquetFileWriter) FILE_WRITER_FIELD.get(internalWriter); return new ExtendedRecordWriter() { private long length; @Override public long getWrittenBytes() { return length; } @Override public void write(Writable value) throws IOException { recordWriter.write(value); length = fileWriter.getPos(); } @Override public void close(boolean abort) throws IOException { recordWriter.close(abort); if (!abort) { length = target.getFileSystem(conf).getFileStatus(target).getLen(); } } }; }

Target:
public static RecordWriter createParquetWriter(Path target, JobConf conf, Properties properties, boolean compress, ConnectorSession session) throws IOException, ReflectiveOperationException { conf.setLong(ParquetOutputFormat.BLOCK_SIZE, getParquetWriterBlockSize(session).toBytes()); conf.setLong(ParquetOutputFormat.PAGE_SIZE, getParquetWriterPageSize(session).toBytes()); RecordWriter recordWriter = new MapredParquetOutputFormat() .getHiveRecordWriter(conf, target, Text.class, compress, properties, Reporter.NULL); Object realWriter = REAL_WRITER_FIELD.get(recordWriter); Object internalWriter = INTERNAL_WRITER_FIELD.get(realWriter); ParquetFileWriter fileWriter = (ParquetFileWriter) FILE_WRITER_FIELD.get(internalWriter); return new ExtendedRecordWriter() { private long length; @Override public long getWrittenBytes() { return length; } @Override public void write(Writable value) throws IOException { recordWriter.write(value); length = fileWriter.getPos(); } @Override public void close(boolean abort) throws IOException { recordWriter.close(abort); if (!abort) { length = target.getFileSystem(conf).getFileStatus(target).getLen(); } } }; }
Source:
public void onNext(CorfuStreamEntries results) { synchronized (discoveryService) { if (!discoveryService.getIsLeader().get()) { log.info("The onNext call with will be skipped as the current node as it is not the leader.", results); return; } log.info("LogReplicationEventListener onNext will be processed at node in the cluster {}", results, discoveryService.getLocalNodeDescriptor(), discoveryService.getLocalClusterDescriptor()); for (List<CorfuStreamEntry> entryList : results.getEntries().values()) { for (CorfuStreamEntry entry : entryList) { ReplicationEvent event = (ReplicationEvent) entry.getPayload(); log.info("ReplicationEventListener put an event to its local discoveryServiceQueue", event); discoveryService.input(new DiscoveryServiceEvent( DiscoveryServiceEvent.DiscoveryServiceEventType.ENFORCE_SNAPSHOT_SYNC, event.getClusterId(), event.getEventId())); } } } }

Target:
public void onNext(CorfuStreamEntries results) { synchronized (discoveryService) { if (!discoveryService.getIsLeader().get()) { log.info("The onNext call with will be skipped as the current node as it is not the leader.", results); return; } log.info("LogReplicationEventListener onNext will be processed at node in the cluster {}", results, discoveryService.getLocalNodeDescriptor(), discoveryService.getLocalClusterDescriptor()); for (List<CorfuStreamEntry> entryList : results.getEntries().values()) { for (CorfuStreamEntry entry : entryList) { ReplicationEvent event = (ReplicationEvent) entry.getPayload(); log.info("ReplicationEventListener received an event with id {}, type {}, cluster id {}", event.getEventId(), event.getType(), event.getClusterId()); if (event.getType().equals(ReplicationEvent.ReplicationEventType.FORCE_SNAPSHOT_SYNC)) { discoveryService.input(new DiscoveryServiceEvent( DiscoveryServiceEvent.DiscoveryServiceEventType.ENFORCE_SNAPSHOT_SYNC, event.getClusterId(), event.getEventId())); } } } } }
Source:
public void checkWfswarmRestHttpProjectCommands() { consoles.executeCommandFromProjectExplorer( PROJECT_NAME, BUILD_GOAL, BUILD_COMMAND, BUILD_SUCCESS); consoles.executeCommandFromProjectExplorer( PROJECT_NAME, RUN_GOAL, RUN_COMMAND, "WildFly Swarm is Ready"); consoles.checkWebElementVisibilityAtPreviewPage(By.xpath(" }

Target:
public void checkWfswarmRestHttpProjectCommands() { By textOnPreviewPage = By.xpath(" consoles.executeCommandFromProjectExplorer( PROJECT_NAME, BUILD_GOAL, BUILD_COMMAND, BUILD_SUCCESS); consoles.executeCommandFromProjectExplorer( PROJECT_NAME, RUN_GOAL, RUN_COMMAND, "WildFly Swarm is Ready"); consoles.checkWebElementVisibilityAtPreviewPage(textOnPreviewPage); }
Source:
public List<Map<String, String>> linkify(HttpServletRequest req, String message) { List<CommentLinkInfo> operationalCommentLinks = new ArrayList<>(commentLinks); String baseGerritUrl = urls.getBaseGerritUrl(req); if (baseGerritUrl != null) { System.out.println("baseGerritUrl: " + baseGerritUrl); CommentLinkInfo changeIds = new CommentLinkInfo(CHANGE_ID_PATTERN, baseGerritUrl + "#/q/$0,n,z"); operationalCommentLinks.add(changeIds); } List<Map<String, String>> parsed = Lists.newArrayList(); parsed.add(ImmutableMap.of("text", message)); for (int index = 0; index < parsed.size(); index++) { if (parsed.get(index).get("url") != null) { continue; } Matcher m = allPattern.matcher(parsed.get(index).get("text")); if (!m.find()) { continue; } for (CommentLinkInfo cli : operationalCommentLinks) { if (parsed.get(index).get("url") != null) { break; } List<Map<String, String>> resultingReplacement = cli.replace(parsed.get(index).get("text")); if (resultingReplacement != null) { parsed.remove(index); parsed.addAll(index, resultingReplacement); } } } return parsed; }

Target:
public List<Map<String, String>> linkify(HttpServletRequest req, String message) { List<CommentLinkInfo> operationalCommentLinks = new ArrayList<>(commentLinks); String baseGerritUrl = urls.getBaseGerritUrl(req); if (baseGerritUrl != null) { CommentLinkInfo changeIds = new CommentLinkInfo(CHANGE_ID_PATTERN, baseGerritUrl + "#/q/$0,n,z"); operationalCommentLinks.add(changeIds); } List<Map<String, String>> parsed = Lists.newArrayList(); parsed.add(ImmutableMap.of("text", message)); for (int index = 0; index < parsed.size(); index++) { if (parsed.get(index).get("url") != null) { continue; } Matcher m = allPattern.matcher(parsed.get(index).get("text")); if (!m.find()) { continue; } for (CommentLinkInfo cli : operationalCommentLinks) { if (parsed.get(index).get("url") != null) { break; } String text = parsed.get(index).get("text"); List<Map<String, String>> resultingReplacement = cli.linkify(text); parsed.remove(index); parsed.addAll(index, resultingReplacement); } } return parsed; }
Source:
public Object status(@PathParam("executionId") String executionId) throws IOException, URISyntaxException, MessagingException { if (isCompleted(executionId)) { String error = getError(executionId); if (error != null) { throw new NuxeoException(error, Response.Status.INTERNAL_SERVER_ERROR.getStatusCode()); } String resURL = StringUtils.stripEnd(ctx.getURL(), "/status"); return redirect(resURL); } else { Object result = "RUNNING"; if (isAsync(executionId)) { Serializable commandId = getCommandId(executionId); result = getAsyncService(executionId).getStatus(commandId); } return ResponseHelper.getResponse(result, request, Response.Status.OK.getStatusCode()); } }

Target:
public Object status(@PathParam("executionId") String executionId) throws IOException, URISyntaxException, MessagingException { if (isCompleted(executionId)) { String error = getError(executionId); if (error != null) { throw new NuxeoException(error, HttpServletResponse.SC_INTERNAL_SERVER_ERROR); } String resURL = StringUtils.removeEnd(ctx.getURL(), STATUS_PATH); return redirect(resURL); } else { Object result = RUNNING_STATUS; if (isAsync(executionId)) { Serializable taskId = getTaskId(executionId); result = getAsyncService(executionId).getStatus(taskId); } return ResponseHelper.getResponse(result, request, HttpServletResponse.SC_OK); } }
Source:
public NGuid getStorageDomainId() { if (_storageDomainId.equals(Guid.Empty) && getVm() != null) { long sizeNeeded = getVm().getTotalMemorySizeInBytes() / BYTES_IN_GB; StorageDomain storageDomain = VmHandler.findStorageDomainForMemory(getVm().getStoragePoolId(), sizeNeeded); if (storageDomain != null) { _storageDomainId = storageDomain.getId(); } } return _storageDomainId; }

Target:
public NGuid getStorageDomainId() { if (cachedStorageDomainId.equals(Guid.Empty) && getVm() != null) { long sizeNeeded = getVm().getTotalMemorySizeInBytes() / BYTES_IN_GB; StorageDomain storageDomain = VmHandler.findStorageDomainForMemory(getVm().getStoragePoolId(), sizeNeeded); if (storageDomain != null) { cachedStorageDomainId = storageDomain.getId(); } } return cachedStorageDomainId; }
Source:
public void testRecursiveTheirsStrategy() throws GitException, InterruptedException { mergeCmd.setStrategy(MergeCommand.Strategy.RECURSIVE_THEIRS).setRevisionToMerge(commit1Branch2).execute(); assertTrue("branch 2 commit 1 not on master branch after merge", git.revList("master").contains(commit1Branch2)); }

Target:
public void testRecursiveTheirsStrategy() throws GitException, InterruptedException, FileNotFoundException, IOException { mergeCmd.setStrategy(MergeCommand.Strategy.RECURSIVE_THEIRS).setRevisionToMerge(commit1Branch2).execute(); assertTrue("branch 2 commit 1 not on master branch after merge", git.revList("master").contains(commit1Branch2)); assertTrue("README.md is missing on master", readme.exists()); try(FileReader reader = new FileReader(readme); BufferedReader br = new BufferedReader(reader)) { assertTrue("README.md does not contain expected content", br.readLine().startsWith(BRANCH_2_README_CONTENT)); } }
Source:
public EntryVersionsMap createNewVersionsAndCheckForWriteSkews(VersionGenerator versionGenerator, TxInvocationContext context, VersionedPrepareCommand prepareCommand) { CacheTopology cacheTopology = stateTransferManager.getCacheTopology(); if (cacheTopology == null || prepareCommand.getModifications().length == 0) { context.getCacheTransaction().setUpdatedEntryVersions(new EntryVersionsMap()); } else { ConsistentHash readConsistentHash = cacheTopology.getReadConsistentHash(); List<Address> members = readConsistentHash.getMembers(); if (members.get(0).equals(rpcManager.getAddress())) { EntryVersionsMap uv = performWriteSkewCheckAndReturnNewVersions( prepareCommand, dataContainer, versionGenerator, context, keySpecificLogic); context.getCacheTransaction().setUpdatedEntryVersions(uv); return uv; } } return null; }

Target:
public EntryVersionsMap createNewVersionsAndCheckForWriteSkews(VersionGenerator versionGenerator, TxInvocationContext context, VersionedPrepareCommand prepareCommand) { CacheTopology cacheTopology = stateTransferManager.getCacheTopology(); if (prepareCommand.getModifications().length == 0) { context.getCacheTransaction().setUpdatedEntryVersions(new EntryVersionsMap()); } else { ConsistentHash readConsistentHash = cacheTopology.getReadConsistentHash(); List<Address> members = readConsistentHash.getMembers(); if (members.get(0).equals(rpcManager.getAddress())) { EntryVersionsMap uv = performWriteSkewCheckAndReturnNewVersions( prepareCommand, dataContainer, versionGenerator, context, keySpecificLogic); context.getCacheTransaction().setUpdatedEntryVersions(uv); return uv; } } return null; }
Source:
public boolean isContainsOwnerPostsOnly() { for (Post post : getDisplayedPosts()) { if (post.getUserCreated().equals(topicStarter)) { return false; } } return true; }

Target:
public boolean isContainsOwnerPostsOnly() { for (Post post : getDisplayedPosts()) { if (!post.getUserCreated().equals(topicStarter)) { return false; } } return true; }
Source:
protected DynamicConstants(final CommonApplicationConstants gwtConstants) { this.constants = gwtConstants; dictionary = null; try { dictionary = Dictionary.getDictionary(MESSAGES_DICTIONARY_NAME); } catch (MissingResourceException mre) { mre.printStackTrace(); } }

Target:
public DynamicConstants(final CommonApplicationConstants gwtConstants) { this.constants = gwtConstants; dictionary = null; try { dictionary = Dictionary.getDictionary(MESSAGES_DICTIONARY_NAME); } catch (MissingResourceException mre) { } }