auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void closesDecoratedResponseInputStream() throws IOException { final String xml = Joiner.on(' ').join( "<?xml-stylesheet href='/b.xsl' type='text/xsl'?>", "<subject>World</subject>" ); final String xsl = Joiner.on(' ').join( "<stylesheet xmlns='<LINK_1>' ", " xmlns:x='<LINK_0>' version='2.0' >", "<output method='text'/><template match='/'> ", "Hello, <value-of select='/subject'/>!</template></stylesheet>" ); final StateAwareInputStream inputStream = new StateAwareInputStream(IOUtils.toInputStream(xml)); MatcherAssert.assertThat( new RsPrint( new RsXSLT( new RsText(inputStream), new URIResolver() { @Override public Source resolve(final String href, final String base) { return new StreamSource(new StringReader(xsl)); } } ) ).print(), Matchers.endsWith("Hello, World!") ); MatcherAssert.assertThat( inputStream.isClosed(), Matchers.is(true) ); }

Target:
public void closesDecoratedResponseInputStream() throws Exception { final String xml = Joiner.on(' ').join( "<?xml-stylesheet href='/b.xsl' type='text/xsl'?>", "<subject>World</subject>" ); final String xsl = Joiner.on(' ').join( "<stylesheet xmlns='<LINK_1>' ", " xmlns:x='<LINK_0>' version='2.0' >", "<output method='text'/><template match='/'> ", "Hello, <value-of select='/subject'/>!</template></stylesheet>" ); final StateAwareInputStream stream = new StateAwareInputStream(IOUtils.toInputStream(xml)); MatcherAssert.assertThat( new RsPrint( new RsXSLT( new RsText(stream), new URIResolver() { @Override public Source resolve(final String href, final String base) { return new StreamSource(new StringReader(xsl)); } } ) ).print(), Matchers.endsWith("Hello, World!") ); MatcherAssert.assertThat( stream.isClosed(), Matchers.is(true) ); }
Source:
private static String getHostAddress(final int port) throws IOException { String hostAddress = "INVALID"; final Enumeration e = NetworkInterface.getNetworkInterfaces(); while (e.hasMoreElements()) { final NetworkInterface n = (NetworkInterface) e.nextElement(); if (n.isLoopback() || n.isVirtual() || !n.isUp()) { continue; } final Enumeration ee = n.getInetAddresses(); while (ee.hasMoreElements()) { final InetAddress i = (InetAddress) ee.nextElement(); if (i.isLinkLocalAddress()) { continue; } hostAddress = i.getHostAddress(); break; } } try { (new Socket(hostAddress, port)).close(); LOG.log(Level.WARNING, "Port number already in use."); throw new IOException("Port number already in use."); } catch (ConnectException connectException) { LOG.log(Level.INFO, "URL found: {0}:{1}", new Object[]{hostAddress, port}); return hostAddress; } }

Target:
private static String getHostAddress(final int port) throws IOException { String hostAddress = INVALID_HOST_ADDRESS; final Enumeration e = NetworkInterface.getNetworkInterfaces(); while (e.hasMoreElements()) { final NetworkInterface n = (NetworkInterface) e.nextElement(); if (n.isLoopback() || n.isVirtual() || !n.isUp()) { continue; } final Enumeration ee = n.getInetAddresses(); while (ee.hasMoreElements()) { final InetAddress i = (InetAddress) ee.nextElement(); if (i.isLinkLocalAddress()) { continue; } hostAddress = i.getHostAddress(); break; } } try { (new Socket(hostAddress, port)).close(); LOG.log(Level.WARNING, "Port number already in use."); throw new IOException("Port number already in use."); } catch (ConnectException connectException) { LOG.log(Level.INFO, "URL found: {0}:{1}", new Object[]{hostAddress, port}); return hostAddress; } }
Source:
public void postRun() throws Exception { ui.header("Database Primary Keys"); if (ui.yesno(true, "Fix primary keys column order")) { ui.message("fixing primary keys..."); fix.run(); ui.message("done"); } }

Target:
public void postRun() throws Exception { db = dbFactory.open(); try { conn = ((JdbcSchema) db).getConnection(); Map<String, List<String>> corrections = findPKUpdates(); if (corrections.isEmpty()) { return; } ui.header("Database Primary Keys"); if (ui.yesno(true, "Fix primary keys column order")) { ui.message("fixing primary keys...\n"); JdbcExecutor executor = new JdbcExecutor(conn); for (Map.Entry<String, List<String>> c : corrections.entrySet()) { ui.message(" table: %s ... ", c.getKey()); recreatePK(executor, c.getKey(), c.getValue()); ui.message("done\n"); } ui.message("done\n"); } } finally { db.close(); } }
Source:
protected void generateTableSpecConfig(Map<String, String> tableSpecConfig) { super.generateTableSpecConfig(tableSpecConfig); if (writeBatchSize != null) { addInMemoryConfig(tableSpecConfig, WRITE_BATCH_SIZE, writeBatchSize.toString()); } if (objectCacheSize != null) { addInMemoryConfig(tableSpecConfig, OBJECT_CACHE_SIZE, objectCacheSize.toString()); } }

Target:
protected void generateTableSpecConfig(Map<String, String> tableSpecConfig) { super.generateTableSpecConfig(tableSpecConfig); }
Source:
public void updateHealthState(final Stack stack) { if (stack == null) { return; } List<Service> services = objectManager.find(Service.class, SERVICE.STACK_ID, stack.getId(), SERVICE.REMOVED, null); List<? extends Host> ActiveHosts = allocatorDao.getActiveHosts(stack.getAccountId()); HashSet<String> activeHosts = new HashSet<String>(); for(Host host: ActiveHosts){ activeHosts.add(host.getId().toString()); } setServiceHealthState(services, activeHosts); setStackHealthState(stack); setEnvironmentHealthState(objectManager.loadResource(Account.class, stack.getAccountId())); }

Target:
public void updateHealthState(final Stack stack) { if (stack == null) { return; } List<Service> services = objectManager.find(Service.class, SERVICE.STACK_ID, stack.getId(), SERVICE.REMOVED, null); List<? extends Host> ActiveHosts = allocatorDao.getActiveHosts(stack.getAccountId()); HashSet<Long> activeHosts = new HashSet<Long>(); for(Host host: ActiveHosts){ activeHosts.add(host.getId()); } setServiceHealthState(services, activeHosts); setStackHealthState(stack); setEnvironmentHealthState(objectManager.loadResource(Account.class, stack.getAccountId())); }
Source:
public void onError(Task task, Throwable throwable) { boolean alreadyRegisteredError = _errorsReported.getAndSet(true); if (!alreadyRegisteredError) { _analysisListener.errorUnknown(_analysisJob, throwable); } cleanup(); if (_nextTaskListener != null) { _nextTaskListener.onError(task, throwable); } }

Target:
public void onError(Task task, Throwable throwable) { final boolean alreadyRegisteredError = _errorsReported.getAndSet(true); if (!alreadyRegisteredError) { _analysisListener.errorUnknown(_analysisJob, throwable); } cleanup(); if (_nextTaskListener != null) { _nextTaskListener.onError(task, throwable); } }
Source:
public String toString() { return "FilterEntry{" + "eventName='" + eventName + '\'' + ", exclude=" + exclude + ", transportCandidate='" + transportCandidate + '\'' + ", address='" + address + '\'' + '}'; }

Target:
public String toString() { return "FilterEntry{" + "eventName='" + eventName + '\'' + ", exclude=" + exclude + ", recipient=" + recipient + '}'; }
Source:
public static void filePermissionAndKeyHelper(String filePermission, String filePermissionKey) { if (filePermission != null && filePermissionKey != null) { throw new IllegalArgumentException(FileConstants.MessageConstants.FILE_PERMISSION_FILE_PERMISSION_KEY_INVALID); } if (filePermission != null) { Utility.assertInBounds("filePermission", filePermission.getBytes().length, 0, 8* Constants.KB); } }

Target:
public static void filePermissionAndKeyHelper(String filePermission, String filePermissionKey) { if (filePermission != null && filePermissionKey != null) { throw new IllegalArgumentException(FileConstants.MessageConstants.FILE_PERMISSION_FILE_PERMISSION_KEY_INVALID); } if (filePermission != null) { Utility.assertInBounds("filePermission", filePermission.getBytes(StandardCharsets.UTF_8).length, 0, 8 * Constants.KB); } }
Source:
public Set<PingableLeader> getPotentialLeaders() { if (leaderEligible.get()) { return Sets.union(ImmutableSet.of(localPingable), ImmutableSet.copyOf(otherPingables)); } else { return ImmutableSet.copyOf(otherPingables); } }

Target:
public Set<PingableLeader> getPotentialLeaders() { return Sets.union(ImmutableSet.of(localPingable), ImmutableSet.copyOf(otherPingables)); }
Source:
public static StringCredentials lookupCredentials(String credentialId, Item item) { List<StringCredentials> credentials = com.cloudbees.plugins.credentials.CredentialsProvider.lookupCredentials(StringCredentials.class, item, ACL.SYSTEM, Collections.emptyList()); CredentialsMatcher matcher = CredentialsMatchers.withId(credentialId); return CredentialsMatchers.firstOrNull(credentials, matcher); }

Target:
public static StringCredentials lookupCredentials(String credentialId, Item item) { List<StringCredentials> credentials = CredentialsProvider.lookupCredentials(StringCredentials.class, item, ACL.SYSTEM, Collections.emptyList()); return getCredentialWithId(credentialId, credentials); }
Source:
InputStream startUpload() throws IOException { super.startUpload(); dataSize = buffer.size(); ByteArrayInputStream bufferData = new ByteArrayInputStream( buffer.toByteArray()); buffer.reset(); buffer = null; return bufferData; }

Target:
InputStream startUpload() throws IOException { super.startUpload(); dataSize = buffer.size(); ByteArrayInputStream bufferData = new ByteArrayInputStream( buffer.toByteArray()); buffer = null; return bufferData; }
Source:
public List<Object> next() throws IOException, ParseException { List<Object> lineTuple = super.next(); String jsonLine = (String) lineTuple.get(0); if ( jsonLine==null ) return null; if ( jsonLine.trim().isEmpty() ) return next(); try { HashMap<String, Object> jsonMap = new ObjectMapper().readValue(jsonLine, HashMap.class); StreamlineEventImpl slEvent = new StreamlineEventImpl(jsonMap, "HdfsSpout"); ArrayList<Object> tuple = new ArrayList<>(1); tuple.add(slEvent); return tuple; } catch (JsonProcessingException e) { throw new ParseException("Json parsing error at location : " + getFileOffset().toString(), e); } }

Target:
public List<Object> next() throws IOException, ParseException { List<Object> lineTuple = super.next(); String jsonLine = (String) lineTuple.get(0); if ( jsonLine==null ) return null; if ( jsonLine.trim().isEmpty() ) return next(); try { HashMap<String, Object> jsonMap = new ObjectMapper().readValue(jsonLine, HashMap.class); StreamlineEventImpl slEvent = new StreamlineEventImpl(jsonMap, "HdfsSpout"); return Collections.singletonList(slEvent); } catch (JsonProcessingException e) { throw new ParseException("Json parsing error at location : " + getFileOffset().toString(), e); } }
Source:
public void testDoesNotAllowCircularDependencies() throws Exception { Bootstrap bootstrap = new Bootstrap((Module) binder -> { binder.bind(InstanceA.class); binder.bind(InstanceB.class); }); try { bootstrap.initialize().getInstance(InstanceA.class); fail("should not allow circular dependencies"); } catch (ProvisionException e) { assertContains(e.getErrorMessages().iterator().next().getMessage(), "circular dependencies are disabled"); } }

Target:
public void testDoesNotAllowCircularDependencies() throws Exception { Bootstrap bootstrap = new Bootstrap(binder -> { binder.bind(InstanceA.class); binder.bind(InstanceB.class); }); try { bootstrap.initialize().getInstance(InstanceA.class); fail("should not allow circular dependencies"); } catch (ProvisionException e) { assertContains(e.getErrorMessages().iterator().next().getMessage(), "circular dependencies are disabled"); } }
Source:
public void setProperties(EntityDraft draft, Entity entity, String username) { draft.setParentEntity(entity); draft.setParentVersion(entity.getEntityVersion()); draft.setDraftOwnerUsername(username); draft.setLastModificationDate(DateUtil.nowUTC()); draft.setSuperClass(entity.getSuperClass()); draft.setName(entity.getName()); draft.setClassName(entity.getClassName()); draft.setNamespace(entity.getNamespace()); draft.setModule(entity.getModule()); draft.setSecurityMode(entity.getSecurityMode()); draft.setSecurityMembers(new HashSet<>(entity.getSecurityMembers())); draft.setReadOnlySecurityMode(entity.getReadOnlySecurityMode()); draft.setReadOnlySecurityMembers(new HashSet<>(entity.getReadOnlySecurityMembers())); draft.getFields().clear(); for (Field field : entity.getFields()) { draft.addField(field.copy()); } draft.getLookups().clear(); for (Lookup lookup : entity.getLookups()) { Lookup newLookup = lookup.copy(draft.getFields()); draft.addLookup(newLookup); } if (entity.getRestOptions() != null) { RestOptions restOptions = entity.getRestOptions().copy(); restOptions.setEntity(draft); draft.setRestOptions(restOptions); } if (entity.getTracking() != null) { Tracking tracking = entity.getTracking().copy(); tracking.setEntity(draft); draft.setTracking(tracking); } }

Target:
public void setProperties(EntityDraft draft, Entity entity, String username) { draft.setParentEntity(entity); draft.setParentVersion(entity.getEntityVersion()); draft.setDraftOwnerUsername(username); draft.setLastModificationDate(DateUtil.nowUTC()); draft.setName(entity.getName()); draft.setClassName(entity.getClassName()); draft.setNamespace(entity.getNamespace()); draft.setModule(entity.getModule()); draft.setSecurityMode(entity.getSecurityMode()); draft.setSecurityMembers(new HashSet<>(entity.getSecurityMembers())); draft.setReadOnlySecurityMode(entity.getReadOnlySecurityMode()); draft.setReadOnlySecurityMembers(new HashSet<>(entity.getReadOnlySecurityMembers())); draft.getFields().clear(); for (Field field : entity.getFields()) { draft.addField(field.copy()); } draft.getLookups().clear(); for (Lookup lookup : entity.getLookups()) { Lookup newLookup = lookup.copy(draft.getFields()); draft.addLookup(newLookup); } if (entity.getRestOptions() != null) { RestOptions restOptions = entity.getRestOptions().copy(); restOptions.setEntity(draft); draft.setRestOptions(restOptions); } if (entity.getTracking() != null) { Tracking tracking = entity.getTracking().copy(); tracking.setEntity(draft); draft.setTracking(tracking); } }
Source:
public void onMapReady(MapboxMap mapboxMap) { MultipleHeatmapStylingActivity.this.mapboxMap = mapboxMap; CameraPosition cameraPositionForFragmentMap = new CameraPosition.Builder() .target(new LatLng(34.056684, -118.254002)) .zoom(11.047) .build(); mapboxMap.animateCamera( CameraUpdateFactory.newCameraPosition(cameraPositionForFragmentMap), 2600); addHeatmapDataSource(); initHeatmapColors(); initHeatmapRadiusStops(); initHeatmapIntensityStops(); addHeatmapLayer(); findViewById(R.id.switch_heatmap_style_fab).setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { if (index == listOfHeatmapColors.length - 1) { index = 0; } if (firstLoad) { index = 1; firstLoad = false; } mapboxMap.getLayer(HEATMAP_LAYER_ID).setProperties( heatmapColor(listOfHeatmapColors[index]), heatmapRadius(listOfHeatmapRadiusStops[index]), heatmapIntensity(listOfHeatmapIntensityStops[index]) ); index++; } }); }

Target:
public void onMapReady(MapboxMap mapboxMap) { MultipleHeatmapStylingActivity.this.mapboxMap = mapboxMap; CameraPosition cameraPositionForFragmentMap = new CameraPosition.Builder() .target(new LatLng(34.056684, -118.254002)) .zoom(11.047) .build(); mapboxMap.animateCamera( CameraUpdateFactory.newCameraPosition(cameraPositionForFragmentMap), 2600); addHeatmapDataSource(); initHeatmapColors(); initHeatmapRadiusStops(); initHeatmapIntensityStops(); addHeatmapLayer(); findViewById(R.id.switch_heatmap_style_fab).setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { index++; if (index == listOfHeatmapColors.length - 1) { index = 0; } if (mapboxMap.getLayer(HEATMAP_LAYER_ID) != null) { mapboxMap.getLayer(HEATMAP_LAYER_ID).setProperties( heatmapColor(listOfHeatmapColors[index]), heatmapRadius(listOfHeatmapRadiusStops[index]), heatmapIntensity(listOfHeatmapIntensityStops[index]) ); } } }); }
Source:
public void revsDiff_emptyInput_returnEmpty() throws Exception { Map<String, List<String>> revs = datastore.revsDiff(new ValueListMap<String, String>()); Assert.assertTrue(revs.size() == 0); }

Target:
public void revsDiff_emptyInput_returnEmpty() throws Exception { thrown.expect(IllegalArgumentException.class); thrown.expectMessage("revisions cannot be empty"); datastore.revsDiff(new ValueListMap<String, String>()); }
Source:
protected WrappedByteBuf(ByteBuf buf) { ObjectUtil.checkNotNull(buf, "buf"); this.buf = buf; }

Target:
protected WrappedByteBuf(ByteBuf buf) { this.buf = ObjectUtil.checkNotNull(buf, "buf"); }
Source:
public boolean run(CommandSender sender, Player sender_p, Command cmd, String commandLabel, String[] args, boolean senderIsConsole) { if (args.length == 1) { if (!args[0].equals("reload")) { return false; } if (!TFM_AdminList.isSuperAdmin(sender)) { playerMsg(TFM_Command.MSG_NO_PERMS); return true; } TFM_MainConfig.load(); TFM_AdminList.load(); TFM_PermbanList.load(); TFM_PlayerList.load(); TFM_BanManager.load(); TFM_CommandBlocker.load(); final String message = String.format("%s v%s.%s reloaded.", TotalFreedomMod.pluginName, TotalFreedomMod.pluginVersion, TotalFreedomMod.buildNumber); playerMsg(message); TFM_Log.info(message); return true; } playerMsg("TotalFreedomMod for 'Total Freedom', the original all-op server.", ChatColor.GOLD); playerMsg(String.format("Version " + ChatColor.BLUE + "%s.%s" + ChatColor.GOLD + ", built " + ChatColor.BLUE + "%s" + ChatColor.GOLD + " by " + ChatColor.BLUE + "%s" + ChatColor.GOLD + ".", TotalFreedomMod.pluginVersion, TotalFreedomMod.buildNumber, TotalFreedomMod.buildDate, TotalFreedomMod.buildCreator), ChatColor.GOLD); playerMsg("Running on " + TFM_ConfigEntry.SERVER_NAME.getString() + ".", ChatColor.GOLD); playerMsg("Created by Madgeek1450 and Prozza.", ChatColor.GOLD); playerMsg("If you wish to contribute to the development of this plugin, go to " + ChatColor.AQUA + "<LINK_0>", ChatColor.GREEN); playerMsg("Visit " + ChatColor.AQUA + "<LINK_1>" + ChatColor.GREEN + " for more information.", ChatColor.GREEN); return true; }

Target:
public boolean run(CommandSender sender, Player sender_p, Command cmd, String commandLabel, String[] args, boolean senderIsConsole) { if (args.length == 1) { if (!args[0].equals("reload")) { return false; } if (!TFM_AdminList.isSuperAdmin(sender)) { playerMsg(TFM_Command.MSG_NO_PERMS); return true; } TFM_MainConfig.load(); TFM_AdminList.load(); TFM_PermbanList.load(); TFM_PlayerList.load(); TFM_BanManager.load(); TFM_CommandBlocker.load(); final String message = String.format("%s v%s.%s reloaded.", TotalFreedomMod.pluginName, TotalFreedomMod.pluginVersion, TotalFreedomMod.buildNumber); playerMsg(message); TFM_Log.info(message); return true; } playerMsg("TotalFreedomMod for 'Total Freedom', the original all-op server.", ChatColor.GOLD); playerMsg(String.format("Version " + ChatColor.BLUE + "%s.%s" + ChatColor.GOLD + ", built " + ChatColor.BLUE + "%s" + ChatColor.GOLD + " by " + ChatColor.BLUE + "%s" + ChatColor.GOLD + ".", TotalFreedomMod.pluginVersion, TotalFreedomMod.buildNumber, TotalFreedomMod.buildDate, TotalFreedomMod.buildCreator), ChatColor.GOLD); playerMsg("Running on " + TFM_ConfigEntry.SERVER_NAME.getString() + ".", ChatColor.GOLD); playerMsg("Created by Madgeek1450 and Prozza.", ChatColor.GOLD); playerMsg("This Plugin is opensource: " + ChatColor.AQUA + "<LINK_0>", ChatColor.GREEN); playerMsg("Visit " + ChatColor.AQUA + "<LINK_1>" + ChatColor.GREEN + " for more information.", ChatColor.GREEN); return true; }
Source:
public ActionResponseDto execute(final ClientConnection conn, final DlmsDevice device, final GetFirmwareVersionRequestDataDto getFirmwareVersionRequestDataDto) { List<FirmwareVersionDto> resultList; try { resultList = this.getFirmwareVersionsCommandExecutor.execute(conn, device, null); } catch (final ProtocolAdapterException e) { LOGGER.error("Error while getting firmware versions from device: " + device.getDeviceIdentification(), e); return new ActionResponseDto(e, "Error while getting firmware versions from device: " + device.getDeviceIdentification()); } return new FirmwareVersionResponseDataDto(resultList); }

Target:
public ActionResponseDto execute(final ClientConnection conn, final DlmsDevice device, final GetFirmwareVersionRequestDataDto getFirmwareVersionRequestDataDto) { try { return new FirmwareVersionResponseDataDto(this.getFirmwareVersionsCommandExecutor.execute(conn, device, null)); } catch (final ProtocolAdapterException e) { LOGGER.error("Error while getting firmware versions from device: " + device.getDeviceIdentification(), e); return new ActionResponseDto(e, "Error while getting firmware versions from device: " + device.getDeviceIdentification()); } }
Source:
private boolean hasMissingRequiredFieldInGroupType(GroupType requested, GroupType fullSchema) { for (Type field : fullSchema.getFields()) { Type requestedType = null; try { requestedType = requested.getType(field.getName()); } catch (InvalidRecordException e) { if (field.getRepetition() == Type.Repetition.REQUIRED) return true; else continue; } if (!field.isPrimitive()) { if (hasMissingRequiredFieldInGroupType(requestedType.asGroupType(), field.asGroupType())) return true; } } return false; }

Target:
private boolean hasMissingRequiredFieldInGroupType(GroupType requested, GroupType fullSchema) { for (Type field : fullSchema.getFields()) { if (requested.containsField(field.getName())) { Type requestedType = requested.getType(field.getName()); if (!field.isPrimitive()) { if (hasMissingRequiredFieldInGroupType(requestedType.asGroupType(), field.asGroupType())) { return true; } else { continue; } } } else { if (field.getRepetition() == Type.Repetition.REQUIRED) { return true; } else { continue; } } } return false; }
Source:
private DataManager getDataManager() { return (DataManager)Services.getService(DataManager.class); }

Target:
private DataManager getDataManager() { return Services.getService(DataManager.class); }
Source:
public WorkloadStatus getStatus() { int started = samplesCountStartedFromTerminatedThreads; int finished = samplesCountFinishedFromTerminatedThreads; long emptyTrx = emptyTransactionsFromTerminatedThreads; int runningThreads = 0; for (WorkloadService thread : threads) { started += thread.getStartedSamples(); finished += thread.getFinishedSamples(); emptyTrx += thread.getEmptyTransactions(); if (thread.isRunning()) { runningThreads ++; } } return new WorkloadStatus(started, finished, runningThreads, emptyTrx); }

Target:
public WorkloadStatus getStatus() { int started = samplesCountStartedFromTerminatedThreads; int finished = samplesCountFinishedFromTerminatedThreads; long emptyTrn = emptyTransactionsFromTerminatedThreads; int runningThreads = 0; for (WorkloadService thread : threads) { started += thread.getStartedSamples(); finished += thread.getFinishedSamples(); emptyTrn += thread.getEmptyTransactions(); if (thread.isRunning()) { runningThreads ++; } } return new WorkloadStatus(started, finished, runningThreads, emptyTrn); }
Source:
public WCheckBoxFieldUI() { panel.add(messages); WFieldLayout fieldLayout = new WFieldLayout(LAYOUT_FLAT); fieldLayout.setTitle("this is a bunch of fields"); WCheckBox wCheckBox = new WCheckBox(); fieldLayout.addField("this is a checkbox", wCheckBox); panel.add(fieldLayout); add(panel); }

Target:
public WCheckBoxFieldUI() { panel.add(messages); WFieldLayout fieldLayout = new WFieldLayout(LAYOUT_FLAT); fieldLayout.setTitle("this is a bunch of fields"); fieldLayout.addField("this is a checkbox", wCheckBox); panel.add(fieldLayout); add(panel); }
Source:
public void getObject() throws Exception { final String bucketName = "test_get_object"; try { final String expected = "SUCCESS: Finished downloading object. The object was written to: " + SterilizeString.pathToWindows(Util.DOWNLOAD_BASE_NAME) + "beowulf.txt"; Util.createBucket(client, bucketName); Util.loadBookTestData(client, bucketName); final Arguments args = new Arguments(new String[]{"--http", "-c", "get_object", "-b", bucketName, "-o", "beowulf.txt", "-d", Util.DOWNLOAD_BASE_NAME}); final CommandResponse response = Util.command(client, args); assertThat(response.getMessage(), is(expected)); } finally { Util.deleteBucket(client, bucketName); Util.deleteLoadedFile("beowulf.txt"); } }

Target:
public void getObject() throws Exception { final String bucketName = "test_get_object"; try { final String expected = "SUCCESS: Finished downloading object. The object was written to: " + SterilizeString.osSpecificPath(Util.DOWNLOAD_BASE_NAME) + "beowulf.txt"; Util.createBucket(client, bucketName); Util.loadBookTestData(client, bucketName); final Arguments args = new Arguments(new String[]{"--http", "-c", "get_object", "-b", bucketName, "-o", "beowulf.txt", "-d", Util.DOWNLOAD_BASE_NAME}); final CommandResponse response = Util.command(client, args); assertThat(response.getMessage(), is(expected)); } finally { Util.deleteBucket(client, bucketName); Util.deleteLoadedFile("beowulf.txt"); } }
Source:
public List<ResolvedReferenceType> getAncestors(boolean acceptIncompleteList) { List<ResolvedReferenceType> ancestors = new ArrayList<>(); ResolvedReferenceType enumClass = ReflectionFactory.typeUsageFor(Enum.class, typeSolver).asReferenceType(); ResolvedTypeParameterDeclaration eTypeParameter = enumClass.getTypeDeclaration().getTypeParameters().get(0); enumClass = enumClass.deriveTypeParameters(new ResolvedTypeParametersMap.Builder().setValue(eTypeParameter, new ReferenceTypeImpl(this, typeSolver)).build()); ancestors.add(enumClass); if (wrappedNode.getImplementedTypes() != null) { for (ClassOrInterfaceType implementedType : wrappedNode.getImplementedTypes()) { ResolvedReferenceType ancestor; try { ancestor = toReferenceType(implementedType); } catch (UnsolvedSymbolException e) { if (acceptIncompleteList) { ancestor = null; } else { throw e; } } if (ancestor != null) { ancestors.add(ancestor); } } } return ancestors; }

Target:
public List<ResolvedReferenceType> getAncestors(boolean acceptIncompleteList) { List<ResolvedReferenceType> ancestors = new ArrayList<>(); ResolvedReferenceType enumClass = ReflectionFactory.typeUsageFor(Enum.class, typeSolver).asReferenceType(); ResolvedTypeParameterDeclaration eTypeParameter = enumClass.getTypeDeclaration().getTypeParameters().get(0); enumClass = enumClass.deriveTypeParameters(new ResolvedTypeParametersMap.Builder().setValue(eTypeParameter, new ReferenceTypeImpl(this, typeSolver)).build()); ancestors.add(enumClass); if (wrappedNode.getImplementedTypes() != null) { for (ClassOrInterfaceType implementedType : wrappedNode.getImplementedTypes()) { try { ancestors.add(toReferenceType(implementedType)); } catch (UnsolvedSymbolException e) { if (!acceptIncompleteList) { throw e; } } } } return ancestors; }
Source:
public ActivityCalendar(final String calendarName, final Date activatePassiveCalendarTime, final List<SeasonProfile> seasonProfileList) { super(); this.calendarName = calendarName; this.activatePassiveCalendarTime = new Date(activatePassiveCalendarTime.getTime()); this.seasonProfileList = new ArrayList<SeasonProfile>(seasonProfileList); }

Target:
public ActivityCalendar(final String calendarName, final Date activatePassiveCalendarTime, final List<SeasonProfile> seasonProfileList) { this.calendarName = calendarName; this.activatePassiveCalendarTime = new Date(activatePassiveCalendarTime.getTime()); this.seasonProfileList = new ArrayList<SeasonProfile>(seasonProfileList); }
Source:
public List<MatchmakerQueueMapPool> getMatchmakerPools(int matchmakerQueueId) { return getAll("/data/matchmakerQueueMapPool", ImmutableMap.of( "include", "matchmakerQueue,mapPool,mapPool.mapVersion," + "mapPool.mapVersion.map,mapPool.mapVersion.map.latestVersion," + "mapPool.mapVersion.map.author,mapPool.mapVersion.map.statistics," + "mapPool.mapVersion.map.reviewsSummary,mapPool.mapVersion.map.versions.reviews," + "mapPool.mapVersion.map.versions.reviews.player", "filter", rsql(qBuilder().string("matchmakerQueue.id").eq(String.valueOf(matchmakerQueueId))))); }

Target:
public List<MatchmakerQueueMapPool> getMatchmakerPools(int matchmakerQueueId) { return getAll("/data/matchmakerQueueMapPool", java.util.Map.of( INCLUDE, "matchmakerQueue,mapPool,mapPool.mapVersions," + "mapPool.mapVersions.map,mapPool.mapVersions.map.latestVersion," + "mapPool.mapVersions.map.author,mapPool.mapVersions.map.statistics," + "mapPool.mapVersions.map.reviewsSummary,mapPool.mapVersions.map.versions.reviews," + "mapPool.mapVersions.map.versions.reviews.player", FILTER, rsql(qBuilder().string("matchmakerQueue.id").eq(String.valueOf(matchmakerQueueId))))); }
Source:
public static String docs() { return "Allow to manipulate the Bukkit metadata."; }

Target:
public static String docs() { return "This class allows manipulation of entity metadata."; }
Source:
private IQueryResultProvider getResultProviderInternal(IQuerySpecification<?> query, QueryEvaluationHint hint) throws QueryProcessingException, ViatraQueryException { IQueryResultProvider resultProvider = resultProviders.get(query); if (resultProvider == null){ resultProvider = createResultProvider(query, hint); resultProviders.put(query, resultProvider); } return resultProvider; }

Target:
private IQueryResultProvider getResultProviderInternal(IQuerySpecification<?> query, QueryEvaluationHint hint) throws ViatraQueryException, QueryProcessingException{ final IQueryBackend backend = getQueryBackend(query.getInternalQueryRepresentation()); return backend.getResultProvider(query.getInternalQueryRepresentation(), hint); }
Source:
public void testTranslationWithRawKeyVersion2() { DocumentTranslator translator = new DocumentTranslator(TestUtils.createHBaseConfigWithRawKeyV2()); Table table = new Table(); table.setName(UUID.randomUUID().toString()); Document document = new Document(); document.setId(UUID.randomUUID().toString()); document.setTimestamp(System.currentTimeMillis()); document.setData(mapper.createObjectNode().put("name", "rishabh")); Document translatedDocument = translator.translate(table, document); assert (translatedDocument.getMetadata() != null); assert (translatedDocument.getId().equals(translatedDocument.getMetadata().getRawStorageId())); assert (translatedDocument.getMetadata().getId().equals(document.getId())); assert (translatedDocument.getMetadata().getRawStorageId().endsWith(Constants.rawKeyVersionToSuffixMap.get("2.0"))); }

Target:
public void testTranslationWithRawKeyVersion2() { DocumentTranslator translator = new DocumentTranslator(TestUtils.createHBaseConfigWithRawKeyV2()); Table table = new Table(); table.setName(UUID.randomUUID().toString()); Document document = new Document(); document.setId(UUID.randomUUID().toString()); document.setTimestamp(System.currentTimeMillis()); document.setData(mapper.createObjectNode().put("name", "rishabh")); Document translatedDocument = translator.translate(table, document); assertNotNull(translatedDocument.getMetadata()); assertEquals(translatedDocument.getId(), translatedDocument.getMetadata().getRawStorageId()); assertEquals(translatedDocument.getMetadata().getId(), document.getId()); assertTrue(translatedDocument.getMetadata().getRawStorageId().endsWith(Constants.rawKeyVersionToSuffixMap.get("2.0"))); }
Source:
public MockUserState(String inPersistKey, boolean load) { super(inPersistKey, load); persistKey = inPersistKey; if (load) loadState(); else { dependValues = new JSONObject(); syncValues = new JSONObject(); } }

Target:
public MockUserState(String inPersistKey, boolean load) { super(inPersistKey, load); persistKey = inPersistKey; if (load) { loadState(); } else { dependValues = new JSONObject(); syncValues = new JSONObject(); } }
Source:
@Override public boolean lock(Session ses, boolean exclusive, boolean force) { Long res = sessions.get(ses); if (res != null) { if (EXCLUSIVE_LOCK == res) return true; if(ver.longValue() != res) throw new QueryRetryException(getName()); return false; } lock(exclusive); if (destroyed) { unlock(exclusive); throw new IllegalStateException("Table " + identifierString() + " already destroyed."); } sessions.put(ses, exclusive ? EXCLUSIVE_LOCK : ver.longValue()); ses.addLock(this); return false; }

Target:
@Override public boolean lock(Session ses, boolean exclusive, boolean force) { SessionLock sesLock = sessions.get(ses); if (sesLock != null) { if (sesLock.isExclusive()) return true; if (ver.get() != sesLock.version()) throw new QueryRetryException(getName()); return false; } lock(exclusive); if (destroyed) { unlock(exclusive); throw new IllegalStateException("Table " + identifierString() + " already destroyed."); } sessions.put(ses, exclusive ? SessionLock.exclusiveLock() : SessionLock.sharedLock(ver.longValue())); ses.addLock(this); return false; }
Source:
public ThriftSessionProperties(SessionPropertyProvider sessionPropertyProvider) { requireNonNull(sessionPropertyProvider, "sessionPropertyProvider is null"); headerProperties = requireNonNull(sessionPropertyProvider.getHeaderProperties(), "sessionPropertyProvider returns null header properties"); headerProperties.values().stream().forEach(sessionProperty -> checkIfTypeSupported(sessionProperty.getJavaType())); sessionProperties = ImmutableList.copyOf(headerProperties.values()); }

Target:
public ThriftSessionProperties(SessionPropertyProvider sessionPropertyProvider) { requireNonNull(sessionPropertyProvider, "sessionPropertyProvider is null"); headerProperties = requireNonNull(sessionPropertyProvider.getHeaderProperties(), "sessionPropertyProvider returned null header properties"); headerProperties.values().stream().forEach(property -> checkIfTypeSupported(property.getJavaType())); sessionProperties = ImmutableList.copyOf(headerProperties.values()); }
Source:
private FormulaEditorFragment addResourceToActiveFormulaInFormulaEditor(CategoryListItem categoryListItem) { FormulaEditorFragment formulaEditorFragment = ((FormulaEditorFragment) getFragmentManager() .findFragmentByTag(FormulaEditorFragment.FORMULA_EDITOR_FRAGMENT_TAG)); formulaEditorFragment.addResourceToActiveFormula(categoryListItem.nameResId); return formulaEditorFragment; }

Target:
private FormulaEditorFragment addResourceToActiveFormulaInFormulaEditor(CategoryListItem categoryListItem) { FormulaEditorFragment formulaEditorFragment = null; if (getFragmentManager() != null) { formulaEditorFragment = ((FormulaEditorFragment) getFragmentManager() .findFragmentByTag(FormulaEditorFragment.FORMULA_EDITOR_FRAGMENT_TAG)); if (formulaEditorFragment != null) { formulaEditorFragment.addResourceToActiveFormula(categoryListItem.nameResId); } } return formulaEditorFragment; }
Source:
public void onOpened() { super.onOpened(); worlds.clear(); worldNumber = 0; final UIDropdownScrollable worldsDropdown = find("worlds", UIDropdownScrollable.class); if (worldsDropdown != null) { worldsDropdown.setOptions(worldNames()); } selectedWorld = ""; indexOfWorld =findIndex(worlds, selectedWorld); }

Target:
public void onOpened() { super.onOpened(); worlds.clear(); worldNumber = 0; final UIDropdownScrollable worldsDropdown = find("worlds", UIDropdownScrollable.class); if (worldsDropdown != null) { worldsDropdown.setOptions(worldNames()); } selectedWorld = ""; indexOfSelectedWorld = findIndex(worlds, selectedWorld); }
Source:
protected void onDestroy() { super.onDestroy(); getService().unregisterOnServiceStateChangeListener(this); }

Target:
protected void onDestroy() { super.onDestroy(); SyncthingService syncthingService = getService(); if (syncthingService != null) { syncthingService.unregisterOnServiceStateChangeListener(this::onServiceStateChange); } }
Source:
public List<Double> interpretDurationDiff(ImmutableList<Double> durationDiff) { final ImmutableList<Integer> path = hmm.decodeSensorData(durationDiff); List<List<Double>> jointProbs = bayesModel.getJointOfForwardsAndBackwards(path); List<Double> probOfMeInBed = Lists.newArrayList(); for (final List<Double> joint : jointProbs) { final double notJointNot = 1.0 - joint.get(1); probOfMeInBed.add(notJointNot); } return probOfMeInBed; }

Target:
public List<Double> interpretDurationDiff(ImmutableList<Double> durationDiff) { final ImmutableList<Integer> path = hmm.decodeSensorData(durationDiff); final List<List<Double>> jointProbs = bayesModel.getJointOfForwardsAndBackwards(path); final List<Double> probOfMeInBed = Lists.newArrayList(); for (final List<Double> joint : jointProbs) { final double notJointNot = 1.0 - joint.get(1); probOfMeInBed.add(notJointNot); } return probOfMeInBed; }
Source:
public KafkaMockConsumer(final OffsetResetStrategy offsetResetStrategy) { super(OffsetResetStrategy.EARLIEST); assign(Arrays.asList(new TopicPartition("testtopic", 0))); HashMap<TopicPartition, Long> beginningOffsets = new HashMap<>(); beginningOffsets.put(new TopicPartition("testtopic", 0), 0L); updateBeginningOffsets(beginningOffsets); for (int idx = 0; idx < 10; ++idx) { addRecord(new ConsumerRecord<byte[], byte[]>("testtopic", 0, idx, ("mykey" + idx).getBytes(Charset.forName("UTF-8")), ("myvalue" + idx).getBytes(Charset.forName("UTF-8")))); } }

Target:
public KafkaMockConsumer(final OffsetResetStrategy offsetResetStrategy) { super(OffsetResetStrategy.EARLIEST); assign(Arrays.asList(new TopicPartition("testtopic", 0))); HashMap<TopicPartition, Long> beginningOffsets = new HashMap<>(); beginningOffsets.put(new TopicPartition("testtopic", 0), 0L); updateBeginningOffsets(beginningOffsets); for (int idx = 0; idx < 10; ++idx) { addRecord(new ConsumerRecord<byte[], byte[]>("testtopic", 0, idx, ("mykey" + idx).getBytes(StandardCharsets.UTF_8), ("myvalue" + idx).getBytes(StandardCharsets.UTF_8))); } }
Source:
private Collection<File> getPluginFiles() throws IOException { if (pluginsDir == null || !pluginsDir.exists()) return Collections.emptyList(); return FileUtils.listFiles(pluginsDir, new String[] {"jar"}, false); }

Target:
private Collection<File> getPluginFiles() throws IOException { if (pluginsDir == null || !pluginsDir.exists()) { return Collections.emptyList(); } return FileUtils.listFiles(pluginsDir, new String[] {"jar"}, false); }
Source:
private URI createMergedGraphic(final File printDirectory, final Dimension mapSize, final List<URI> graphics, final MapfishMapContext mapContext, final String outputFormat) throws IOException, JRException { final File mergedGraphic = File.createTempFile("map-", "." + outputFormat, printDirectory); int width = (int) Math.round(mapContext.getMapSize().width); int height = (int) Math.round(mapContext.getMapSize().height); if ("pdf".equalsIgnoreCase(outputFormat)) { com.lowagie.text.Document document = new com.lowagie.text.Document( new com.lowagie.text.Rectangle(width, height)); try { PdfWriter writer = PdfWriter.getInstance(document, new FileOutputStream(mergedGraphic)); document.open(); PdfContentByte pdfCB = writer.getDirectContent(); Graphics g = pdfCB.createGraphics(width, height); drawGraphics(width, height, graphics, g); g.dispose(); document.close(); } catch (BadElementException e) { throw new IOException(e); } catch (DocumentException e) { throw new IOException(e); } } else { boolean isJpeg = RenderType.fromFileExtension(outputFormat) == RenderType.JPEG; final BufferedImage bufferedImage = new BufferedImage(width, height, (isJpeg ? this.jpegImageType.value : this.imageType.value)); Graphics g = bufferedImage.getGraphics(); if (isJpeg) { g.setColor(Color.WHITE); g.fillRect(0, 0, width, height); } drawGraphics(width, height, graphics, g); g.dispose(); ImageIO.write(bufferedImage, outputFormat, mergedGraphic); } return mergedGraphic.toURI(); }

Target:
private URI createMergedGraphic(final File printDirectory, final Dimension mapSize, final List<URI> graphics, final MapfishMapContext mapContext, final String outputFormat) throws IOException, JRException { final File mergedGraphic = File.createTempFile("map-", "." + outputFormat, printDirectory); int width = (int) Math.round(mapContext.getMapSize().width); int height = (int) Math.round(mapContext.getMapSize().height); if ("pdf".equalsIgnoreCase(outputFormat)) { com.lowagie.text.Document document = new com.lowagie.text.Document( new com.lowagie.text.Rectangle(width, height)); try { PdfWriter writer = PdfWriter.getInstance(document, new FileOutputStream(mergedGraphic)); document.open(); PdfContentByte pdfCB = writer.getDirectContent(); Graphics g = pdfCB.createGraphics(width, height); try { drawGraphics(width, height, graphics, g); } finally { g.dispose(); } } catch (BadElementException e) { throw new IOException(e); } catch (DocumentException e) { throw new IOException(e); } finally { document.close(); } } else { boolean isJpeg = RenderType.fromFileExtension(outputFormat) == RenderType.JPEG; final BufferedImage bufferedImage = new BufferedImage(width, height, (isJpeg ? this.jpegImageType.value : this.imageType.value)); Graphics g = bufferedImage.getGraphics(); if (isJpeg) { g.setColor(Color.WHITE); g.fillRect(0, 0, width, height); } try { drawGraphics(width, height, graphics, g); } finally { g.dispose(); } ImageIO.write(bufferedImage, outputFormat, mergedGraphic); } return mergedGraphic.toURI(); }
Source:
public void putAll( Table<Locator, String, String> meta ) throws IOException { Timer.Context ctx = Instrumentation.getWriteTimerContext( CassandraModel.CF_METRICS_STATE_NAME ); Session session = DatastaxIO.getSession(); try { PreparedStatement ps = session.prepare( "INSERT INTO metrics_metadata (key, column1, value) VALUES (?, ?, ?)" ); BatchStatement batch = new BatchStatement(); for( Table.Cell<Locator, String, String> cell : meta.cellSet() ) { batch.add( ps.bind( cell.getRowKey().toString(), cell.getColumnKey(), serDes.serialize( cell.getValue() ) ) ); } ResultSet result = session.execute( batch ); LOG.debug( "result.size=" + result.all().size() ); } finally { ctx.stop(); } }

Target:
public void putAll( Table<Locator, String, String> meta ) throws IOException { Timer.Context ctx = Instrumentation.getWriteTimerContext( CassandraModel.CF_METRICS_METADATA_NAME ); Session session = DatastaxIO.getSession(); try { PreparedStatement ps = session.prepare( "INSERT INTO " + CassandraModel.CF_METRICS_METADATA_NAME + " (key, column1, value) VALUES (?, ?, ?)" ); BatchStatement batch = new BatchStatement(); for( Table.Cell<Locator, String, String> cell : meta.cellSet() ) { batch.add( ps.bind( cell.getRowKey().toString(), cell.getColumnKey(), serDes.serialize( cell.getValue() ) ) ); } ResultSet result = session.execute( batch ); LOG.debug( "result.size=" + result.all().size() ); } finally { ctx.stop(); } }
Source:
public void freeUnderlyingResources() { int spi = mSpi.getSpi(); try { mSrvConfig .getNetdInstance() .ipSecDeleteSecurityAssociation( uid, mConfig.getSourceAddress(), mConfig.getDestinationAddress(), spi, 0, mConfig.getMarkMask()); } catch (RemoteException | ServiceSpecificException e) { Log.e(TAG, "Failed to delete SA with ID: " + mResourceId, e); } getResourceTracker().give(); }

Target:
public void freeUnderlyingResources() { int spi = mSpi.getSpi(); try { mSrvConfig .getNetdInstance() .ipSecDeleteSecurityAssociation( uid, mConfig.getSourceAddress(), mConfig.getDestinationAddress(), spi, mConfig.getMarkValue(), mConfig.getMarkMask()); } catch (RemoteException | ServiceSpecificException e) { Log.e(TAG, "Failed to delete SA with ID: " + mResourceId, e); } getResourceTracker().give(); }
Source:
protected RemoteOperationResult run(OwnCloudClient client) { RemoteOperationResult result = null; mFailsInFileSyncsFound = 0; mConflictsFound = 0; try { mLocalFolder = getStorageManager().getFileByPath(mRemotePath); result = checkForChanges(client); if (result.isSuccess()) { if (mRemoteFolderChanged) { result = fetchAndSyncRemoteFolder(client); } else { prepareOpsFromLocalKnowledge(); } if (result.isSuccess()) { syncContents(client); } if (mFilesForDirectDownload.isEmpty()) { sendBroadcastForNotifyingUIUpdate(result.isSuccess()); } } if (mCancellationRequested.get()) { throw new OperationCancelledException(); } } catch (OperationCancelledException e) { result = new RemoteOperationResult(e); sendBroadcastForNotifyingUIUpdate(result.isSuccess()); Intent intent = new Intent(mContext, FileDownloader.class); intent.setAction(FileDownloader.ACTION_CANCEL_FILE_DOWNLOAD); intent.putExtra(FileDownloader.EXTRA_ACCOUNT, mAccount); intent.putExtra(FileDownloader.EXTRA_FILE, mLocalFolder); mContext.startService(intent); } return result; }

Target:
protected RemoteOperationResult run(OwnCloudClient client) { RemoteOperationResult result = null; mFailsInFileSyncsFound = 0; mConflictsFound = 0; try { mLocalFolder = getStorageManager().getFileByPath(mRemotePath); result = checkForChanges(client); if (result.isSuccess()) { if (mRemoteFolderChanged) { result = fetchAndSyncRemoteFolder(client); } else { prepareOpsFromLocalKnowledge(); } if (result.isSuccess()) { syncContents(client); } if (mFilesForDirectDownload.isEmpty()) { sendBroadcastForNotifyingUIUpdate(result.isSuccess()); } } if (mCancellationRequested.get()) { throw new OperationCancelledException(); } } catch (OperationCancelledException e) { result = new RemoteOperationResult(e); sendBroadcastForNotifyingUIUpdate(false); Intent intent = new Intent(mContext, FileDownloader.class); intent.setAction(FileDownloader.ACTION_CANCEL_FILE_DOWNLOAD); intent.putExtra(FileDownloader.EXTRA_ACCOUNT, mAccount); intent.putExtra(FileDownloader.EXTRA_FILE, mLocalFolder); mContext.startService(intent); } return result; }
Source:
public CompositeTriJoiner(List<SingleTriJoiner<A, B, C>> joinerList) { this.joinerList = joinerList; if (joinerList.isEmpty()) { throw new IllegalArgumentException("The joinerList (" + joinerList + ") must not be empty."); } }

Target:
public CompositeTriJoiner(List<SingleTriJoiner<A, B, C>> joinerList) { if (joinerList.isEmpty()) { throw new IllegalArgumentException("The joinerList (" + joinerList + ") must not be empty."); } this.joinerList = joinerList; }
Source:
public void testRandomName(){ try { createConfigFileWithRobot("SafetyDuck!!!"); RobobuggyConfigFile.loadConfigFile(); Assert.fail(); } catch (IOException e) { e.printStackTrace(); Assert.fail(); } catch (IllegalArgumentException e) { } }

Target:
public void testRandomName(){ try { createConfigFileWithRobot("SafetyDuck!!!"); RobobuggyConfigFile.loadConfigFile(); Assert.fail(); } catch (IOException e) { e.printStackTrace(); Assert.fail(); } catch (IllegalArgumentException e) { return; } Assert.fail(); }
Source:
public KeySettings delimiter(String delimiter) { this.delimiter = delimiter; return this; }

Target:
public KeySettings delimiter(String delimiter) { if (delimiter == null) { return this; } this.delimiter = delimiter; return this; }
Source:
public void simplePlanExecutionTest() { final Plan plan = PlanImpl.newBuilder() .addEvaluatorToDelete("WORKER", EVAL_PREFIX + 0) .addEvaluatorToAdd("WORKER", EVAL_PREFIX + 1) .addEvaluatorToAdd("SERVER", EVAL_PREFIX + 2) .addEvaluatorToDelete("SERVER", EVAL_PREFIX + 3) .addTransferStep("SERVER", new TransferStepImpl(EVAL_PREFIX + 4, EVAL_PREFIX + 2, new DataInfoImpl(1))) .build(); final Future<PlanResult> result = planExecutor.execute(plan); final int planSize = plan.getPlanSize(); try { final PlanResultImpl summary = (PlanResultImpl) result.get(); assertEquals(planSize, summary.getNumExecutedOps()); } catch (final Exception e) { e.printStackTrace(); } }

Target:
public void simplePlanExecutionTest() { final Plan plan = PlanImpl.newBuilder() .addEvaluatorToDelete("WORKER", EVAL_PREFIX + 0) .addEvaluatorToAdd("WORKER", EVAL_PREFIX + 1) .addEvaluatorToAdd("SERVER", EVAL_PREFIX + 2) .addEvaluatorToDelete("SERVER", EVAL_PREFIX + 3) .addTransferStep("SERVER", new TransferStepImpl(EVAL_PREFIX + 4, EVAL_PREFIX + 2, new DataInfoImpl(1))) .build(); final Future<PlanResult> result = planExecutor.execute(plan); final int planSize = plan.getPlanSize(); try { final PlanResult summary = result.get(10, TimeUnit.SECONDS); assertEquals(planSize, summary.getNumExecutedOps()); } catch (final TimeoutException e) { fail("Failed to execute the plan. Timeout occurred."); e.printStackTrace(); } catch (final InterruptedException | ExecutionException e) { fail("Failed to execute the plan. Exception occurred."); e.printStackTrace(); } }