auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public Set<? extends NodeMetadata> rebootNodesMatching(Predicate<NodeMetadata> filter) { logger.debug(">> rebooting nodes matching(%s)", filter); Set<NodeMetadata> set = ImmutableSet.copyOf(transformParallel(nodesMatchingFilterAndNotTerminatedExceptionIfNotFound(filter), new Function<NodeMetadata, ListenableFuture<? extends NodeMetadata>>() { @Override public ListenableFuture<NodeMetadata> apply(final NodeMetadata from) { return userExecutor.submit(new Callable<NodeMetadata>() { public NodeMetadata call() throws Exception { rebootNode(from.getId()); return from; } public String toString() { return "rebootNode(" + from.getId() + ")"; } }); } }, userExecutor, null, logger, "rebootNodesMatching(" + filter + ")")); logger.debug("<< rebooted"); cleanUpIncidentalResourcesOfDeadNodes(set); return set; }

Target:
public Set<? extends NodeMetadata> rebootNodesMatching(Predicate<NodeMetadata> filter) { logger.debug(">> rebooting nodes matching(%s)", filter); Set<NodeMetadata> rebootNodes = ImmutableSet.copyOf(transformParallel(nodesMatchingFilterAndNotTerminated(filter), new Function<NodeMetadata, ListenableFuture<? extends NodeMetadata>>() { @Override public ListenableFuture<NodeMetadata> apply(final NodeMetadata from) { return userExecutor.submit(new Callable<NodeMetadata>() { public NodeMetadata call() throws Exception { rebootNode(from.getId()); return from; } public String toString() { return "rebootNode(" + from.getId() + ")"; } }); } }, userExecutor, null, logger, "rebootNodesMatching(" + filter + ")")); logger.debug("<< rebooted(%d)", rebootNodes.size()); return rebootNodes; }
Source:
public void init(StorageQos qos) { if (qos.getMaxThroughput() == null && qos.getMaxReadThroughput() == null && qos.getMaxWriteThroughput() == null) { getThroughput().getChoiceGroupNone().setEntity(true); getThroughput().getChoiceGroupTotal().setEntity(false); getThroughput().getChoiceGroupReadWrite().setEntity(false); } else { getThroughput().getTotal().setEntity(qos.getMaxThroughput()); getThroughput().getRead().setEntity(qos.getMaxReadThroughput()); getThroughput().getWrite().setEntity(qos.getMaxWriteThroughput()); getThroughput().getChoiceGroupNone().setEntity(true); getThroughput().getChoiceGroupTotal().setEntity(false); getThroughput().getChoiceGroupReadWrite().setEntity(false); } if (qos.getMaxIops() == null && qos.getMaxReadIops() == null && qos.getMaxWriteIops() == null) { getIops().getChoiceGroupNone().setEntity(true); getIops().getChoiceGroupTotal().setEntity(false); getIops().getChoiceGroupReadWrite().setEntity(false); } else { getIops().getTotal().setEntity(qos.getMaxIops()); getIops().getRead().setEntity(qos.getMaxReadIops()); getIops().getWrite().setEntity(qos.getMaxWriteIops()); getIops().getChoiceGroupNone().setEntity(true); getIops().getChoiceGroupTotal().setEntity(false); getIops().getChoiceGroupReadWrite().setEntity(false); } }

Target:
public void init(StorageQos qos) { if (!(qos.getMaxThroughput() == null && qos.getMaxReadThroughput() == null && qos.getMaxWriteThroughput() == null)) { getThroughput().getTotal().setEntity(qos.getMaxThroughput()); getThroughput().getRead().setEntity(qos.getMaxReadThroughput()); getThroughput().getWrite().setEntity(qos.getMaxWriteThroughput()); } getThroughput().getChoiceGroupNone().setEntity(true); getThroughput().getChoiceGroupTotal().setEntity(false); getThroughput().getChoiceGroupReadWrite().setEntity(false); if (!(qos.getMaxIops() == null && qos.getMaxReadIops() == null && qos.getMaxWriteIops() == null)) { getIops().getTotal().setEntity(qos.getMaxIops()); getIops().getRead().setEntity(qos.getMaxReadIops()); getIops().getWrite().setEntity(qos.getMaxWriteIops()); } getIops().getChoiceGroupNone().setEntity(true); getIops().getChoiceGroupTotal().setEntity(false); getIops().getChoiceGroupReadWrite().setEntity(false); }
Source:
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { rootView = inflater.inflate(R.layout.sf__custom_server_url, container); final String label = getEditDefaultValue(R.id.sf__picker_custom_label); final String urlValue = getEditDefaultValue(R.id.sf__picker_custom_url); isDefault = urlValue.equals(getString(R.string.sf__server_url_default_custom_url)); if (isDefault) { getDialog().setTitle(R.string.sf__server_url_add_title); } else { getDialog().setTitle(R.string.sf__server_url_edit_title); } setEditText(R.id.sf__picker_custom_label, label); setEditText(R.id.sf__picker_custom_url, urlValue); final Button applyBtn = rootView.findViewById(R.id.sf__apply_button); applyBtn.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { final String lbl = validateInput(R.id.sf__picker_custom_label); if (lbl == null) { return; } final String val = validateInput(R.id.sf__picker_custom_url); if (val == null || HttpUrl.parse(val) == null) { return; } loginServerManager.addCustomLoginServer(lbl.trim(), val.trim()); dismiss(); } }); final Button cancelBtn = rootView.findViewById(R.id.sf__cancel_button); cancelBtn.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { dismiss(); } }); return rootView; }

Target:
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { rootView = inflater.inflate(R.layout.sf__custom_server_url, container); final String label = getEditDefaultValue(R.id.sf__picker_custom_label); final String urlValue = getEditDefaultValue(R.id.sf__picker_custom_url); isDefault = urlValue.equals(getString(R.string.sf__server_url_default_custom_url)); if (isDefault) { getDialog().setTitle(R.string.sf__server_url_add_title); } else { getDialog().setTitle(R.string.sf__server_url_edit_title); } setEditText(R.id.sf__picker_custom_label, label); setEditText(R.id.sf__picker_custom_url, urlValue); final Button applyBtn = rootView.findViewById(R.id.sf__apply_button); applyBtn.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { final String lbl = validateInput(R.id.sf__picker_custom_label); if (lbl == null) { return; } final String val = validateInput(R.id.sf__picker_custom_url); if (val == null) { return; } loginServerManager.addCustomLoginServer(lbl.trim(), val.trim()); dismiss(); } }); final Button cancelBtn = rootView.findViewById(R.id.sf__cancel_button); cancelBtn.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { dismiss(); } }); return rootView; }
Source:
private void addSlimefunItem(Category category, int page, Player p, PlayerProfile profile, SlimefunItem item, List<ChatComponent> items) { NamespacedKey key = new NamespacedKey(SlimefunPlugin.instance(), item.getID().toLowerCase(Locale.ROOT)); if (!Slimefun.hasUnlocked(p, item, false) && item.getResearch() != null) { Research research = item.getResearch(); ChatComponent component = new ChatComponent(ChatUtils.crop(ChatColor.RED, item.getItemName()) + "\n"); component.setHoverEvent(new HoverEvent(ChatColor.RESET + item.getItemName(), ChatColor.DARK_RED.toString() + ChatColor.BOLD + SlimefunPlugin.getLocalization().getMessage(p, "guide.locked"), "", ChatColor.GREEN + "> Click to unlock", "", ChatColor.GRAY + "Cost: " + ChatColor.AQUA.toString() + research.getCost() + " Level(s)")); component.setClickEvent(new ClickEvent(key, player -> SlimefunPlugin.runSync(() -> { research.guideClickInteraction(this, player, profile, item, category, page); }) )); items.add(component); } else { ChatComponent component = new ChatComponent(ChatUtils.crop(ChatColor.DARK_GREEN, item.getItemName()) + "\n"); List<String> lore = new ArrayList<>(); lore.add(item.getItemName()); if (item.getItem().hasItemMeta() && item.getItem().getItemMeta().hasLore()) { lore.addAll(item.getItem().getItemMeta().getLore()); } component.setHoverEvent(new HoverEvent(lore)); component.setClickEvent(new ClickEvent(key, player -> SlimefunPlugin.runSync(() -> displayItem(profile, item, true)))); items.add(component); } }

Target:
private void addSlimefunItem(Category category, int page, Player p, PlayerProfile profile, SlimefunItem item, List<ChatComponent> items) { NamespacedKey key = new NamespacedKey(SlimefunPlugin.instance(), item.getID().toLowerCase(Locale.ROOT)); if (!Slimefun.hasUnlocked(p, item, false) && item.getResearch() != null) { Research research = item.getResearch(); ChatComponent component = new ChatComponent(ChatUtils.crop(ChatColor.RED, item.getItemName()) + "\n"); component.setHoverEvent(new HoverEvent(ChatColor.RESET + item.getItemName(), ChatColor.DARK_RED.toString() + ChatColor.BOLD + SlimefunPlugin.getLocalization().getMessage(p, "guide.locked"), "", ChatColor.GREEN + "> Click to unlock", "", ChatColor.GRAY + "Cost: " + ChatColor.AQUA.toString() + research.getCost() + " Level(s)")); component.setClickEvent(new ClickEvent(key, player -> SlimefunPlugin.runSync(() -> research.unlockFromGuide(this, player, profile, item, category, page) ) )); items.add(component); } else { ChatComponent component = new ChatComponent(ChatUtils.crop(ChatColor.DARK_GREEN, item.getItemName()) + "\n"); List<String> lore = new ArrayList<>(); lore.add(item.getItemName()); if (item.getItem().hasItemMeta() && item.getItem().getItemMeta().hasLore()) { lore.addAll(item.getItem().getItemMeta().getLore()); } component.setHoverEvent(new HoverEvent(lore)); component.setClickEvent(new ClickEvent(key, player -> SlimefunPlugin.runSync(() -> displayItem(profile, item, true)))); items.add(component); } }
Source:
final static public < A extends LongAccess > ArrayImg< Unsigned128BitType, A > unsigned128Bits( final A access, final long... dim ) { final ArrayImg< Unsigned128BitType, A > img = new ArrayImg<>( access, dim, new Fraction( 1, 64 ) ); final Unsigned128BitType t = new Unsigned128BitType( img ); img.setLinkedType( t ); return img; }

Target:
final static public < A extends LongAccess > ArrayImg< Unsigned128BitType, A > unsigned128Bits( final A access, final long... dim ) { final ArrayImg< Unsigned128BitType, A > img = new ArrayImg<>( access, dim, new Fraction( 128, 64 ) ); final Unsigned128BitType t = new Unsigned128BitType( img ); img.setLinkedType( t ); return img; }
Source:
public void close() { log.info("Closing BackgroundCompactor"); daemon.interrupt(); try { daemon.join(); daemon = null; } catch (InterruptedException e) { throw Throwables.rewrapAndThrowUncheckedException(e); } }

Target:
public void close() { log.info("Closing BackgroundCompactor"); daemon.interrupt(); try { daemon.join(); daemon = null; } catch (InterruptedException e) { Thread.currentThread().interrupt(); throw Throwables.rewrapAndThrowUncheckedException(e); } }
Source:
public boolean verifyEvidence(final Evidence evidence) throws RealmUnavailableException { return getCredential(PasswordCredential.class, null).verify(evidence); }

Target:
public boolean verifyEvidence(final Evidence evidence) throws RealmUnavailableException { final PasswordCredential credential = getCredential(PasswordCredential.class, null); if (credential == null) return false; return credential.verify(evidence); }
Source:
public static File[] unpackAllFiles(File root, File dest) { List<File> dirs = new ArrayList<File>(); files = root.listFiles(new FilenameFilter() { @Override public boolean accept(File dir, String name) { return name.toLowerCase().endsWith(".osz"); } }); if (files == null || files.length < 1) { files = null; return new File[0]; } BeatmapWatchService ws = (Options.isWatchServiceEnabled()) ? BeatmapWatchService.get() : null; if (ws != null) ws.pause(); for (File file : files) { fileIndex++; String dirName = file.getName().substring(0, file.getName().lastIndexOf('.')); File songDir = new File(dest, dirName); if (!songDir.isDirectory()) { songDir.mkdir(); Utils.unzip(file, songDir); file.delete(); dirs.add(songDir); } } if (ws != null) ws.resume(); fileIndex = -1; files = null; if (!dirs.isEmpty()) { UI.getNotificationManager().sendNotification("ui.notifications.beatmaps.imported", dirs.size()); } return dirs.toArray(new File[dirs.size()]); }

Target:
public static File[] unpackAllFiles(File root, File dest) { List<File> dirs = new ArrayList<File>(); files = root.listFiles(new FilenameFilter() { @Override public boolean accept(File dir, String name) { return name.toLowerCase().endsWith(".osz"); } }); if (files == null || files.length < 1) { files = null; return new File[0]; } BeatmapWatchService ws = (Options.isWatchServiceEnabled()) ? BeatmapWatchService.get() : null; if (ws != null) ws.pause(); for (File file : files) { fileIndex++; String dirName = file.getName().substring(0, file.getName().lastIndexOf('.')); File songDir = new File(dest, dirName); if (!songDir.isDirectory()) { songDir.mkdir(); Utils.unzip(file, songDir); file.delete(); dirs.add(songDir); } } if (ws != null) ws.resume(); fileIndex = -1; files = null; if (!dirs.isEmpty()) { UI.getNotificationManager().sendNotification("ui.notifications.beatmaps.imported", dirs.size(), dirs.size() == 1 ? "" : "s"); } return dirs.toArray(new File[dirs.size()]); }
Source:
public void testParseFile() throws Exception { List<File> testInputFiles = DeclarationGeneratorTests.getTestInputFiles(new FilenameFilter() { @Override public boolean accept(File dir, String name) { return name.endsWith(".depgraph"); } }); List<String> args = new ArrayList<>(); args.add("foo.js"); args.add("--depgraphs"); for (File testInputFile : testInputFiles) { args.add(testInputFile.getAbsolutePath()); } Options opts = new Options(args.toArray(new String[testInputFiles.size() + 2])); List<String> depgraphRoots = new DeclarationGenerator(opts).parseDepgraphRoots(); assertThat(depgraphRoots) .containsExactly("my/thing/static/js/annotations/annotations-canvas-controller.js"); }

Target:
public void testParseFile() throws Exception { List<File> testInputFiles = DeclarationGeneratorTests.getTestInputFiles(new FilenameFilter() { @Override public boolean accept(File dir, String name) { return name.endsWith(".depgraph"); } }); List<String> contents = new ArrayList<>(); for (File testInputFile : testInputFiles) { contents.add(Files.toString(testInputFile, UTF_8)); } Depgraph depgraph = Depgraph.parseFrom(contents); assertThat(depgraph.getRoots()) .containsExactly("my/thing/static/js/annotations/annotations-canvas-controller.js"); }
Source:
private static void putRwtVersion(VersionMap values, Version swtVersion) { if (!(swtVersion instanceof OSGiVersion)) return; int major = ((OSGiVersion) swtVersion).getMajor(); if (major != 3) return; int minor = ((OSGiVersion) swtVersion).getMinor(); if (minor <= 5) { values.put(VERSION, "4.3"); } }

Target:
private static void putRwtVersion(VersionMap values, Version swtVersion) { if (!(swtVersion instanceof OSGiVersion)) return; int major = ((OSGiVersion) swtVersion).getMajor(); if (major != 3) return; int minor = ((OSGiVersion) swtVersion).getMinor(); if (minor <= 6) { values.put(VERSION, "4.3"); } }
Source:
protected void log(@Nullable Site site, Object... params) { if (!app.isEventLoggingEnabled()) { return; } int rate = getSampleRate(); if (rate != 0) { boolean chosen = app.getEventLogSamplingID() % rate == 0 || app.isDevRelease(); if (chosen) { JSONObject eventData = new JSONObject(); String logString = this.getClass().getSimpleName() + ": Sending event"; for (int i = 0; i < params.length; i += 2) { preprocessData(eventData, params[i].toString(), params[i + 1]); logString += ", event_" + params[i] + " = " + params[i + 1]; } Log.d(ANALYTICS_TAG, logString); new EventLoggingEvent( schemaName, revision, Utils.getDBNameForSite(site == null ? getApp().getPrimarySite() : site), app.getUserAgent(), preprocessData(eventData) ).log(); } } }

Target:
protected void log(@Nullable Site site, Object... params) { if (!app.isEventLoggingEnabled()) { return; } int rate = getSampleRate(); if (rate != SAMPLE_LOG_DISABLE) { boolean chosen = app.getEventLogSamplingID() % rate == 0 || app.isDevRelease(); if (chosen) { JSONObject eventData = new JSONObject(); String logString = this.getClass().getSimpleName() + ": Sending event"; for (int i = 0; i < params.length; i += 2) { preprocessData(eventData, params[i].toString(), params[i + 1]); logString += ", event_" + params[i] + " = " + params[i + 1]; } Log.d(ANALYTICS_TAG, logString); new EventLoggingEvent( schemaName, revision, Utils.getDBNameForSite(site == null ? getApp().getPrimarySite() : site), app.getUserAgent(), preprocessData(eventData) ).log(); } } }
Source:
public Map<String, Object> handlePayloadVariables(Map<String, Object> variables) { if (variables != null) { Set<String> mismatchedVars = variableNameValidator.validateVariables(variables); if (!mismatchedVars.isEmpty()) { throw new IllegalStateException("Variables have not valid names: " + String.join(", ", mismatchedVars)); } variables.entrySet() .stream() .filter(stringObjectEntry -> stringObjectEntry.getValue() instanceof String) .forEach(stringObjectEntry -> handleAsDate((String) stringObjectEntry.getValue()).ifPresent(stringObjectEntry::setValue)); } return variables; }

Target:
public Map<String, Object> handlePayloadVariables(Map<String, Object> variables) { if (variables != null) { Set<String> mismatchedVars = variableNameValidator.validateVariables(variables); if (!mismatchedVars.isEmpty()) { throw new IllegalStateException("Variables have not valid names: " + String.join(", ", mismatchedVars)); } handleStringVariablesAsDates(variables); } return variables; }
Source:
public void testFSUriWithHostPortUnspecified() throws Exception { Configuration conf = new OzoneConfiguration(); final int OM_PORT_DEFAULT = OmUtils.getOmRpcPort(conf); OzoneClient ozoneClient = mock(OzoneClient.class); ObjectStore objectStore = mock(ObjectStore.class); OzoneVolume volume = mock(OzoneVolume.class); OzoneBucket bucket = mock(OzoneBucket.class); when(ozoneClient.getObjectStore()).thenReturn(objectStore); when(objectStore.getVolume(eq("volume1"))).thenReturn(volume); when(volume.getBucket("bucket1")).thenReturn(bucket); PowerMockito.mockStatic(OzoneClientFactory.class); PowerMockito.when(OzoneClientFactory.getRpcClient(eq("local.host"), eq(OM_PORT_DEFAULT), eq(conf))).thenReturn(ozoneClient); UserGroupInformation ugi = mock(UserGroupInformation.class); PowerMockito.mockStatic(UserGroupInformation.class); PowerMockito.when(UserGroupInformation.getCurrentUser()).thenReturn(ugi); when(ugi.getShortUserName()).thenReturn("user1"); URI uri = new URI("o3fs://bucket1.volume1.local.host"); FileSystem fileSystem = FileSystem.get(uri, conf); OzoneFileSystem ozfs = (OzoneFileSystem) fileSystem; assertEquals(ozfs.getUri().getHost(), "bucket1.volume1.local.host"); assertEquals(ozfs.getUri().getPort(), -1); PowerMockito.verifyStatic(); OzoneClientFactory.getRpcClient("local.host", OM_PORT_DEFAULT, conf); }

Target:
public void testFSUriWithHostPortUnspecified() throws Exception { Configuration conf = new OzoneConfiguration(); final int omPort = OmUtils.getOmRpcPort(conf); OzoneClient ozoneClient = mock(OzoneClient.class); ObjectStore objectStore = mock(ObjectStore.class); OzoneVolume volume = mock(OzoneVolume.class); OzoneBucket bucket = mock(OzoneBucket.class); when(ozoneClient.getObjectStore()).thenReturn(objectStore); when(objectStore.getVolume(eq("volume1"))).thenReturn(volume); when(volume.getBucket("bucket1")).thenReturn(bucket); PowerMockito.mockStatic(OzoneClientFactory.class); PowerMockito.when(OzoneClientFactory.getRpcClient(eq("local.host"), eq(omPort), eq(conf))).thenReturn(ozoneClient); UserGroupInformation ugi = mock(UserGroupInformation.class); PowerMockito.mockStatic(UserGroupInformation.class); PowerMockito.when(UserGroupInformation.getCurrentUser()).thenReturn(ugi); when(ugi.getShortUserName()).thenReturn("user1"); URI uri = new URI("o3fs://bucket1.volume1.local.host"); FileSystem fileSystem = FileSystem.get(uri, conf); OzoneFileSystem ozfs = (OzoneFileSystem) fileSystem; assertEquals(ozfs.getUri().getHost(), "bucket1.volume1.local.host"); assertEquals(ozfs.getUri().getPort(), -1); PowerMockito.verifyStatic(); OzoneClientFactory.getRpcClient("local.host", omPort, conf); }
Source:
public String encryptMiddleMobile(String mobile) { if (Strings.isNullOrEmpty(mobile) || mobile.length() != 11) { return "****"; } String encryptLoginName = mobile.substring(0, 3) + RandomUtils.showChar(4) + mobile.substring(7); return encryptLoginName; }

Target:
public String encryptMiddleMobile(String mobile) { return mobile.substring(0, 3) + RandomUtils.showChar(4) + mobile.substring(7); }
Source:
private void checkSSLConfig(ExpressionTree expressionTree) { ExpressionTree param = getAssignedValue(expressionTree); if (!param.is(Tree.Kind.ARRAY_INITIALIZER_BRACKET, Tree.Kind.ARRAY_INITIALIZER_FUNCTION)) { return; } ArrayInitializerTree config = (ArrayInitializerTree) param; getProperty(config, "SSL") .flatMap(sslConfig -> { if (sslConfig.is(Tree.Kind.ARRAY_INITIALIZER_BRACKET, Tree.Kind.ARRAY_INITIALIZER_FUNCTION)) { return getProperty((ArrayInitializerTree) sslConfig, "crypto_method"); } return Optional.empty(); }) .ifPresent(value -> checkWeakProtocol(value, STREAM_CONTEXT_CREATE)); }

Target:
private void checkSSLConfig(ExpressionTree expressionTree) { ExpressionTree config = getAssignedValue(expressionTree); if (!isArrayInitializer(config)) { return; } getProperty((ArrayInitializerTree) config, "SSL") .flatMap(sslConfig -> { if (isArrayInitializer(sslConfig)) { return getProperty((ArrayInitializerTree) sslConfig, "crypto_method"); } return Optional.empty(); }) .ifPresent(value -> checkWeakProtocol(value, STREAM_CONTEXT_CREATE)); }
Source:
protected boolean timeToDelete(HostAndPort address, long wait) { Long firstSeen = firstSeenDead.get(address); if (firstSeen != null) { long elapsedTime = TimeUnit.NANOSECONDS.toMillis(System.nanoTime() - firstSeen); log.trace("Elapsed seconds since " + address + " first seen dead: " + elapsedTime); return elapsedTime > wait; } else { log.trace("Adding server to firstSeenDead map " + address); firstSeenDead.put(address, System.nanoTime()); return false; } }

Target:
protected boolean timeToDelete(HostAndPort address, long wait) { Long firstSeen = firstSeenDead.get(address); if (firstSeen != null) { long elapsedTime = TimeUnit.NANOSECONDS.toMillis(System.nanoTime() - firstSeen); log.trace("Elapsed milliseconds since " + address + " first seen dead: " + elapsedTime); return elapsedTime > wait; } else { log.trace("Adding server to firstSeenDead map " + address); firstSeenDead.put(address, System.nanoTime()); return false; } }
Source:
@Override public View getView(int position, View convertView, ViewGroup parent) { SquaredImageView view = (SquaredImageView) convertView; if (view == null) { view = new SquaredImageView(context); view.setScaleType(CENTER_CROP); } String url = getItem(position); RequestCreator creator = Picasso.with(context) .load(url) .placeholder(R.drawable.placeholder) .error(R.drawable.error) .fit(); if (useShaderEffects) { creator.transformTarget(new TargetTransformation() { @Override public Drawable transform(Bitmap source) { return new ShaderEffectsDrawable(source); } }); } creator.into(view); return view; }

Target:
@Override public View getView(int position, View convertView, ViewGroup parent) { SquaredImageView view = (SquaredImageView) convertView; if (view == null) { view = new SquaredImageView(context); view.setScaleType(CENTER_CROP); } String url = getItem(position); RequestCreator creator = Picasso.with(context) .load(url) .placeholder(R.drawable.placeholder) .error(R.drawable.error) .fit(); if (drawableFactory != null) { creator.drawableFactory(drawableFactory); } creator.into(view); return view; }
Source:
public boolean isInstanceWithSameNameExists(String name) { return DbFacade.getInstance().getVmTemplateDao().getInstanceByName(name, null, false) != null; }

Target:
public boolean isInstanceWithSameNameExists(String name) { return vmTemplateDao.getInstanceTypeByName(name, null, false) != null; }
Source:
void setStreamCodec(StreamCodec<?> streamCodec) { if (streamCodec != null) { StreamCodec<?> oldStreamCodec = attributes.put(STREAM_CODEC, streamCodec); if (oldStreamCodec != null && oldStreamCodec != streamCodec) { throw new RuntimeException(String.format("Failed to set stream codec to %s. Input port %s stream codec is already set to %s.", streamCodec, this, oldStreamCodec)); } } }

Target:
void setStreamCodec(StreamCodec<?> streamCodec) { if (streamCodec != null) { StreamCodec<?> oldStreamCodec = attributes.put(STREAM_CODEC, streamCodec); if (oldStreamCodec != null && oldStreamCodec != streamCodec) { LOG.warn("Input port stream codec was changed from to {}", this.getPortName(), oldStreamCodec, streamCodec); } } }
Source:
public void connect() throws IOException { throw new IOException(); }

Target:
public void connect() throws IOException
Source:
public FormValidation doCheckApplication(@QueryParameter String credential, @QueryParameter final String value, @AncestorInPath AbstractProject<?, ?> project) { if (project == null) { if (!project.hasPermission(Jenkins.ADMINISTER)) { return FormValidation.ok(); } } else if (!project.hasPermission(Item.EXTENDED_READ) && !project.hasPermission(CredentialsProvider.USE_ITEM)) { return FormValidation.ok(); } project.checkPermission(AbstractProject.CONFIGURE); if ("Applications/".equals(value)) return ok("Fill in the application ID, eg Applications/PetClinic"); String resolvedName = expandValue(value, project); final String applicationName = DeployitServerFactory.getNameFromId(resolvedName); Credential overridingcredential = RepositoryUtils.retrieveOverridingCredentialFromProject(project); DeployitServer deployitServer = RepositoryUtils.getDeployitServer(credential, overridingcredential, project); List<String> candidates = deployitServer.search(DeployitDescriptorRegistry.UDM_APPLICATION, applicationName + "%"); for (String candidate : candidates) { if (candidate.endsWith("/" + applicationName)) { return ok(); } } if (!candidates.isEmpty()) { return warning("Application does not exist, but will be created upon package import. Did you mean to type one of the following: %s?", candidates); } return warning("Application does not exist, but will be created upon package import."); }

Target:
public FormValidation doCheckApplication(@QueryParameter String credential, @QueryParameter final String value, @AncestorInPath AbstractProject<?, ?> project) { project.checkPermission(Jenkins.ADMINISTER); if ("Applications/".equals(value)) return ok("Fill in the application ID, eg Applications/PetClinic"); String resolvedName = expandValue(value, project); final String applicationName = DeployitServerFactory.getNameFromId(resolvedName); Credential overridingcredential = RepositoryUtils.retrieveOverridingCredentialFromProject(project); DeployitServer deployitServer = RepositoryUtils.getDeployitServer(credential, overridingcredential, project); List<String> candidates = deployitServer.search(DeployitDescriptorRegistry.UDM_APPLICATION, applicationName + "%"); for (String candidate : candidates) { if (candidate.endsWith("/" + applicationName)) { return ok(); } } if (!candidates.isEmpty()) { return warning("Application does not exist, but will be created upon package import. Did you mean to type one of the following: %s?", candidates); } return warning("Application does not exist, but will be created upon package import."); }
Source:
private char[] loadValueFromStore(final String variableKey) { try { final KeyStore ks = getSecretsStore(); if (ks.containsAlias(variableKey)) { final PasswordProtection keyStorePP = new PasswordProtection(loadStorePassword()); final SecretKeyFactory factory = SecretKeyFactory.getInstance( SECRETS_STORE_SECRET_KEY_FACTORY_TYPE); final SecretKeyEntry secretKeyEntry = (SecretKeyEntry) ks.getEntry(variableKey, keyStorePP); return ((PBEKeySpec) factory.getKeySpec(secretKeyEntry.getSecretKey(), PBEKeySpec.class)).getPassword(); } else { return CACHE_404; } } catch (Exception e) { throw new DotRuntimeException(e); } }

Target:
private char[] loadValueFromStore(final String variableKey) { try { final KeyStore keyStore = getSecretsStore(); if (keyStore.containsAlias(variableKey)) { final PasswordProtection keyStorePP = new PasswordProtection(loadStorePassword()); final SecretKeyFactory factory = SecretKeyFactory.getInstance(SECRETS_STORE_SECRET_KEY_FACTORY_TYPE); final SecretKeyEntry secretKeyEntry = (SecretKeyEntry) keyStore.getEntry(variableKey, keyStorePP); return ((PBEKeySpec) factory.getKeySpec(secretKeyEntry.getSecretKey(), PBEKeySpec.class)).getPassword(); } else { return CACHE_404; } } catch (Exception e) { Logger.error(SecretsStoreKeyStoreImpl.class,e); throw new DotRuntimeException(e); } }
Source:
private void auditRequest(PRPAIN201305UV02 request, AssertionType assertion, NhinTargetSystemType target) { getNewPatientDiscoveryAuditLogger().auditRequestMessage(request, assertion, target, NhincConstants.AUDIT_LOG_OUTBOUND_DIRECTION, NhincConstants.AUDIT_LOG_NHIN_INTERFACE, Boolean.TRUE, null, NhincConstants.PATIENT_DISCOVERY_SERVICE_NAME); }

Target:
private void auditRequest(PRPAIN201305UV02 request, AssertionType assertion, NhinTargetSystemType target) { getAuditLogger().auditRequestMessage(request, assertion, target, NhincConstants.AUDIT_LOG_OUTBOUND_DIRECTION, NhincConstants.AUDIT_LOG_NHIN_INTERFACE, Boolean.TRUE, null, NhincConstants.PATIENT_DISCOVERY_SERVICE_NAME); }
Source:
public void execute(TopicEvent<ClusteredAgentRequest> event) { ClusteredAgentRequest agentRequest = event.getData(); if (agentRequest.getRequestType().equals(EXPIRE_LOCAL_CACHE)) { expireLocalCache(); } else { if (event.getKey().equals(getConfig().getRegion())) { AgentControllerIdentityImplementation agentIdentity = getAgentIdentityByIpAndName(agentRequest.getAgentIp(), agentRequest.getAgentName()); if (agentIdentity != null) { agentRequest.getRequestType().process(ClusteredAgentManagerService.this, agentIdentity); } } } }

Target:
public void execute(TopicEvent<ClusteredAgentRequest> event) { ClusteredAgentRequest agentRequest = event.getData(); if (agentRequest.getRequestType().equals(EXPIRE_LOCAL_CACHE)) { expireLocalCache(); return; } if (event.getKey().equals(getConfig().getRegion())) { AgentControllerIdentityImplementation agentIdentity = getAgentIdentityByIpAndName(agentRequest.getAgentIp(), agentRequest.getAgentName()); if (agentIdentity != null) { agentRequest.getRequestType().process(ClusteredAgentManagerService.this, agentIdentity); } } }
Source:
public void check(Message message, Topic topic) { if (ContentType.JSON != topic.getContentType() || !topic.isValidationEnabled()) { return; } List<String> errors = validate(message.<JsonSchema>getSchema().get().getSchema(), message.getData()); if (!errors.isEmpty()) { if (topic.isValidationDryRunEnabled()) { logger.info("Message incompatible with JSON schema for topic {}, errors: {}, message body: {}", topic.getQualifiedName(), Joiner.on(";").join(errors), new String(message.getData(), UTF_8)); } else { throw new InvalidMessageException("Message incompatible with JSON schema", errors); } } }

Target:
public void check(Message message, Topic topic) { if (ContentType.JSON != topic.getContentType() || !topic.isValidationEnabled()) { return; } List<String> errors = validate(message.<JsonSchema>getCompiledSchema(), message.getData()); if (!errors.isEmpty()) { if (topic.isValidationDryRunEnabled()) { logger.info("Message incompatible with JSON schema for topic {}, errors: {}, message body: {}", topic.getQualifiedName(), Joiner.on(";").join(errors), new String(message.getData(), UTF_8)); } else { throw new InvalidMessageException("Message incompatible with JSON schema", errors); } } }
Source:
public String getEventName(ITimeEvent event) { State state = getEventState(event); if (state != null) { return state.toString(); } return null; }

Target:
public String getEventName(ITimeEvent event) { State state = getEventState(event); if (state != null) { return state.toString(); } if (event instanceof TimeEvent) { TimeEvent tcEvent = (TimeEvent) event; if (tcEvent.hasValue()) { return null; } } return Messages.ResourcesView_multipleStates; }
Source:
public final Opt<Identity> enter(final Request request) throws IOException { for (final Pass pass : this.all) { final Opt<Identity> enter = pass.enter(request); if (!enter.has()) { break; } } final Opt<Identity> result; if (this.index < this.all.size()) { result = this.all.get(this.index).enter(request); } else { result = new Opt.Empty<Identity>(); } return result; }

Target:
public final Opt<Identity> enter(final Request request) throws IOException { boolean success = true; for (final Pass pass : this.all) { final Opt<Identity> enter = pass.enter(request); if (!enter.has()) { success = false; } } final Opt<Identity> result; if (success && this.index < this.all.size()) { result = this.all.get(this.index).enter(request); } else { result = new Opt.Empty<Identity>(); } return result; }
Source:
MetricsQuery checkAndAddMergeAggregator(final MetricsQuery metricsQuery) { final List<Metric> newMetrics = new ArrayList<>(); for (final Metric metric : metricsQuery.getMetrics()) { if (needMergeAggregator(metric.getAggregators())) { final List<Aggregator> newAggregators = new ArrayList<>(); final Optional<Aggregator> aggregatorWithSampling = metric.getAggregators().stream().filter( aggregator -> aggregator.getSampling().isPresent()).findFirst(); newAggregators.add(aggregatorWithSampling.map( aggregator -> ThreadLocalBuilder.clone(aggregator, Aggregator.Builder.class, b -> b.setName("merge"))). orElseGet(() -> ThreadLocalBuilder.build(Aggregator.Builder.class, b -> b.setName("merge")))); newAggregators.addAll(metric.getAggregators()); final ImmutableList<Aggregator> finalNewAggregators = ImmutableList.copyOf(newAggregators); newMetrics.add(ThreadLocalBuilder.clone( metric, Metric.Builder.class, b->b.setAggregators(finalNewAggregators))); } else { newMetrics.add(metric); } } final ImmutableList<Metric> finalNewMetrics = ImmutableList.copyOf(newMetrics); return ThreadLocalBuilder.clone(metricsQuery, MetricsQuery.Builder.class, b->b.setMetrics(finalNewMetrics)); }

Target:
MetricsQuery checkAndAddMergeAggregator(final MetricsQuery metricsQuery) { final List<Metric> newMetrics = new ArrayList<>(); for (final Metric metric : metricsQuery.getMetrics()) { if (needMergeAggregator(metric.getAggregators())) { final List<Aggregator> newAggregators = new ArrayList<>(); final Optional<Aggregator> aggregatorWithSampling = metric.getAggregators().stream().filter( aggregator -> aggregator.getSampling().isPresent()).findFirst(); newAggregators.add(aggregatorWithSampling.map( aggregator -> ThreadLocalBuilder.build(Aggregator.Builder.class, b -> { b.setName("merge"); aggregator.getSampling().ifPresent(b::setSampling); aggregator.getAlignStartTime().ifPresent(b::setAlignStartTime); aggregator.getAlignSampling().ifPresent(b::setAlignSampling); aggregator.getAlignEndTime().ifPresent(b::setAlignEndTime); })). orElseGet(() -> ThreadLocalBuilder.build(Aggregator.Builder.class, b -> b.setName("merge")))); newAggregators.addAll(metric.getAggregators()); final ImmutableList<Aggregator> finalNewAggregators = ImmutableList.copyOf(newAggregators); newMetrics.add(ThreadLocalBuilder.clone( metric, Metric.Builder.class, b->b.setAggregators(finalNewAggregators))); } else { newMetrics.add(metric); } } final ImmutableList<Metric> finalNewMetrics = ImmutableList.copyOf(newMetrics); return ThreadLocalBuilder.clone(metricsQuery, MetricsQuery.Builder.class, b->b.setMetrics(finalNewMetrics)); }
Source:
private String parseHost(final String url) { HttpUrl httpUrl = HttpUrl.parse(url); if (httpUrl == null) { throw new IllegalArgumentException("Unable to parse url: " + url); } String hostName = httpUrl.host(); try { InetAddress.getByName(hostName); } catch (UnknownHostException e) { throw new InfluxDBIOException(e); } return hostName; }

Target:
private String parseHost(final String url) { String hostName; try { URI uri = new URI(url); hostName = uri.getHost(); } catch (URISyntaxException e1) { throw new IllegalArgumentException("Unable to parse url: " + url, e1); } if (hostName == null) { throw new IllegalArgumentException("Unable to parse url: " + url); } try { InetAddress.getByName(hostName); } catch (UnknownHostException e) { throw new InfluxDBIOException(e); } return hostName; }
Source:
private void processPackAnnotation(DescriptorPolicy descriptorPolicy) { ConstraintConfiguration packAnnotation = constraintConfigurationClass.getAnnotation(ConstraintConfiguration.class); constraintPackage = packAnnotation.constraintPackage(); if (constraintPackage.equals("")) { constraintPackage = constraintConfigurationClass.getPackage().getName(); } if (packAnnotation == null) { throw new IllegalStateException("The constraintConfigurationClass (" + constraintConfigurationClass + ") has been specified as a " + ConstraintConfigurationProvider.class.getSimpleName() + " in the solution class (" + solutionDescriptor.getSolutionClass() + ")," + " but does not have a " + ConstraintConfiguration.class.getSimpleName() + " annotation."); } }

Target:
private void processPackAnnotation(DescriptorPolicy descriptorPolicy) { ConstraintConfiguration packAnnotation = constraintConfigurationClass.getAnnotation(ConstraintConfiguration.class); if (packAnnotation == null) { throw new IllegalStateException("The constraintConfigurationClass (" + constraintConfigurationClass + ") has been specified as a " + ConstraintConfigurationProvider.class.getSimpleName() + " in the solution class (" + solutionDescriptor.getSolutionClass() + ")," + " but does not have a " + ConstraintConfiguration.class.getSimpleName() + " annotation."); } }
Source:
private SynapseCORSConfiguration() { enabled = SynapsePropertiesLoader.getBooleanProperty(RESTConstants.CORS_CONFIGURATION_ENABLED, true); String allowedOriginListStr = SynapsePropertiesLoader.getPropertyValue(RESTConstants.CORS_CONFIGURATION_ACCESS_CTL_ALLOW_ORIGIN, ""); String[] originList = allowedOriginListStr.split(","); for (String origin : originList) { String trimmedOrigin = origin.trim(); allowedOrigins.add(trimmedOrigin); try { URL url = new URL(trimmedOrigin); if (url.getHost().equals("localhost")) { Enumeration<NetworkInterface> networkInterfaces = NetworkInterface.getNetworkInterfaces(); while (networkInterfaces.hasMoreElements()) { NetworkInterface nInterface = networkInterfaces.nextElement(); for (InterfaceAddress iAddr : nInterface.getInterfaceAddresses()) { URL localUrl = new URL(url.getProtocol(), iAddr.getAddress().getHostAddress(), url.getPort(), ""); allowedOrigins.add(localUrl.toString()); } } } } catch (MalformedURLException e) { LOG.error("Provided origin URL "+ trimmedOrigin + " is malformed", e); } catch (SocketException e) { LOG.error("Error occurred while retrieving network interfaces", e); } } allowedHeaders = SynapsePropertiesLoader.getPropertyValue(RESTConstants.CORS_CONFIGURATION_ACCESS_CTL_ALLOW_HEADERS, ""); }

Target:
private SynapseCORSConfiguration() { enabled = SynapsePropertiesLoader.getBooleanProperty(RESTConstants.CORS_CONFIGURATION_ENABLED, true); String allowedOriginListStr = SynapsePropertiesLoader.getPropertyValue(RESTConstants.CORS_CONFIGURATION_ACCESS_CTL_ALLOW_ORIGIN, null); if (allowedOriginListStr != null) { String[] originList = allowedOriginListStr.split(","); for (String origin : originList) { String trimmedOrigin = origin.trim(); allowedOrigins.add(trimmedOrigin); try { URL url = new URL(trimmedOrigin); if (url.getHost().equals("localhost")) { Enumeration<NetworkInterface> networkInterfaces = NetworkInterface.getNetworkInterfaces(); while (networkInterfaces.hasMoreElements()) { NetworkInterface nInterface = networkInterfaces.nextElement(); for (InterfaceAddress iAddr : nInterface.getInterfaceAddresses()) { URL localUrl = new URL(url.getProtocol(), iAddr.getAddress().getHostAddress(), url.getPort(), ""); allowedOrigins.add(localUrl.toString()); } } } } catch (MalformedURLException e) { throw new SynapseException("Provided origin URL " + trimmedOrigin + " is malformed", e); } catch (SocketException e) { throw new SynapseException("Error occurred while retrieving network interfaces", e); } } } allowedHeaders = SynapsePropertiesLoader.getPropertyValue(RESTConstants.CORS_CONFIGURATION_ACCESS_CTL_ALLOW_HEADERS, ""); }
Source:
protected CommandStatus run() { for (int i = 0; i < commandConfig.getSplitCommand().size(); i++) { if (status == CommandStatus.CANCELED) { logger.info("Job has been canceled, quitting now."); break; } String thisCommand = commandConfig.getSplitCommand().get(i); status = setupProcessBuilder(thisCommand); status = processJob(); status = finishJob(); try { checkStatus(status); } catch (IOException e) { e.printStackTrace(); return CommandStatus.FAILED; } if (status != CommandStatus.SUCCESS && status != CommandStatus.FAILED) { logger.info("Monitoring job"); status = monitorJob(); } try { checkStatus(status); } catch (IOException e) { e.printStackTrace(); return CommandStatus.FAILED; } } try { commandConfig.getStdOut().close(); commandConfig.getStdErr().close(); } catch (IOException e) { status = CommandStatus.INFOERROR; logger.error("Could not close the output and/or error files, returning INFOERROR"); return status; } return status; }

Target:
protected CommandStatus run() { for (int i = 0; i < commandConfig.getSplitCommand().size(); i++) { if (status == CommandStatus.CANCELED) { logger.info("Job has been canceled, quitting now."); break; } String thisCommand = commandConfig.getSplitCommand().get(i); status = setupProcessBuilder(thisCommand); status = processJob(); status = finishJob(); if (!checkStatus(status)) return CommandStatus.FAILED; if (status != CommandStatus.SUCCESS && status != CommandStatus.FAILED) { logger.info("Monitoring job"); status = monitorJob(); } if (!checkStatus(status)) return CommandStatus.FAILED; } try { commandConfig.getStdOut().close(); commandConfig.getStdErr().close(); } catch (IOException e) { status = CommandStatus.FAILED; logger.error("Could not close the output and/or error files, returning INFOERROR", e); return status; } return status; }
Source:
public void testChangeHeaderAfterWritingHeader() { final File fakeVCFFile = VariantBaseTest.createTempFile("testBasicWriteAndRead.", ".vcf"); final SAMSequenceDictionary sequenceDict = createArtificialSequenceDictionary(); final VCFHeader header = createFakeHeader(metaData, additionalColumns, sequenceDict); final VariantContextWriter writer2 = new VariantContextWriterBuilder() .setOutputFile(fakeVCFFile) .setReferenceDictionary(sequenceDict) .build(); writer2.writeHeader(header); writer2.setVCFHeader(header); writer2.close(); }

Target:
public void testChangeHeaderAfterWritingHeader() { final File fakeVCFFile = VariantBaseTest.createTempFile("testBasicWriteAndRead.", ".vcf"); fakeVCFFile.deleteOnExit(); final SAMSequenceDictionary sequenceDict = createArtificialSequenceDictionary(); final VCFHeader header = createFakeHeader(metaData, additionalColumns, sequenceDict); try (final VariantContextWriter writer2 = new VariantContextWriterBuilder() .setOutputFile(fakeVCFFile) .setReferenceDictionary(sequenceDict) .build()) { writer2.writeHeader(header); writer2.setVCFHeader(header); } }
Source:
private void setupSuggestionServiceAndAdapter() { if (!isAdded()) return; int remoteBlogId = -1; String blogID = WordPress.getCurrentRemoteBlogId(); remoteBlogId = StringUtils.stringToInt(blogID, -1); mSuggestionServiceConnectionManager = new SuggestionServiceConnectionManager(getActivity(), remoteBlogId); mTagSuggestionAdapter = SuggestionUtils.setupTagSuggestions(remoteBlogId, getActivity(), mSuggestionServiceConnectionManager); if (mTagSuggestionAdapter != null) { mTags.setAdapter(mTagSuggestionAdapter); } }

Target:
private void setupSuggestionServiceAndAdapter() { if (!isAdded()) return; int remoteBlogId = -1; String blogID = WordPress.getCurrentRemoteBlogId(); remoteBlogId = StringUtils.stringToInt(blogID, -1); mSuggestionServiceConnectionManager = new SuggestionServiceConnectionManager(getActivity(), remoteBlogId); TagSuggestionAdapter tagSuggestionAdapter = SuggestionUtils.setupTagSuggestions(remoteBlogId, getActivity(), mSuggestionServiceConnectionManager); if (tagSuggestionAdapter != null) { mTagsEditText.setAdapter(tagSuggestionAdapter); } }
Source:
public void onWorldLoad(WorldEvent.Load evt) { if (!(evt.getWorld().getWorldType() instanceof ICubicWorldType)) { return; } CubicChunks.LOGGER.info("Initializing world " + evt.getWorld() + " with type " + evt.getWorld().getWorldType()); ICubicWorld world = (ICubicWorld) evt.getWorld(); WorldType type = evt.getWorld().getWorldType(); if(type instanceof ICubicWorldType) { WorldProvider provider = ((ICubicWorldType)type).getReplacedProviderFor(world.getProvider()); world.hotSetProvider(provider); } world.initCubicWorld(); if(!world.isRemote()) { ((ICubicWorldServer)world).generateWorld(); } }

Target:
public void onWorldLoad(WorldEvent.Load evt) { if (!(evt.getWorld().getWorldType() instanceof ICubicWorldType)) { return; } CubicChunks.LOGGER.info("Initializing world " + evt.getWorld() + " with type " + evt.getWorld().getWorldType()); ICubicWorld world = (ICubicWorld) evt.getWorld(); WorldType type = evt.getWorld().getWorldType(); if(type instanceof ICubicWorldType) { WorldProvider provider = ((ICubicWorldType)type).getReplacedProviderFor(world.getProvider()); ReflectionUtil.setFieldValueSrg(world, "field_73011_w", provider); } world.initCubicWorld(); if(!world.isRemote()) { ((ICubicWorldServer)world).generateWorld(); } }
Source:
public long getAuditorLedgerVerificationPercentage() { return getLong(AUDITOR_LEDGER_VERIFICATION_PERCENTAGE, 100); }

Target:
public long getAuditorLedgerVerificationPercentage() { return getLong(AUDITOR_LEDGER_VERIFICATION_PERCENTAGE, 0); }
Source:
public void updated(final Dictionary<String, ?> config) throws ConfigurationException { if (config != null) { final String refreshIntervalString = (String) config.get("refresh"); if (StringUtils.isNotBlank(refreshIntervalString)) { refreshInterval = Long.parseLong(refreshIntervalString); } final String host = (String) config.get("hostname"); if (StringUtils.isNotBlank(host)) { this.hostname = host; } final String port = (String) config.get("port"); if (StringUtils.isNotBlank(port)) { this.port = Integer.parseInt(port); } setProperlyConfigured(true); } }

Target:
public void updated(final Dictionary<String, ?> config) throws ConfigurationException { if (config != null) { final String refreshIntervalString = (String) config.get("refresh"); if (StringUtils.isNotBlank(refreshIntervalString)) { try { refreshInterval = Long.parseLong(refreshIntervalString); } catch (NumberFormatException e) { throw new ConfigurationException( "refresh", String.format( "Provided value (%s) cannot be parsed to an long integer.", port)); } } final String host = (String) config.get("hostname"); if (StringUtils.isNotBlank(host)) { this.hostname = host; } else { throw new ConfigurationException("hostname", "Required configuration parameter is not set."); } final String port = (String) config.get("port"); if (StringUtils.isNotBlank(port)) { try { this.port = Integer.parseInt(port); } catch (NumberFormatException e) { throw new ConfigurationException( "port", String.format( "Provided value (%s) cannot be parsed to an integer.", port)); } } setProperlyConfigured(true); } }
Source:
public void pause() throws IOException { this.client.call( LuaCommand.PAUSE.toString(), this.name); this.client.call( LuaCommand.TIMEOUT.toString(), this.jobs().running(0, -1)); }

Target:
public void pause() throws IOException { this.pause(true); }
Source:
public void testRequiredSerializedNameMissing() { SerializedNameModel result = unmarshal(SerializedNameModel.class, "{}"); assertThat(result, nullValue()); }

Target:
public void testRequiredSerializedNameMissing() { SerializedNameModel result = unmarshal(gson, SerializedNameModel.class, "{}"); assertThat(result, nullValue()); }
Source:
public void testMergeDetachedOrphanRemoval() { final Root entity = doInHibernate( this::sessionFactory, session -> { Root root = new Root(); root.setName( "new" ); session.save( root ); return root; } ); doInHibernate( this::sessionFactory, session -> { entity.setName( "updated" ); Root entityMerged = (Root) session.merge( entity ); assertNotSame( entity, entityMerged ); assertNotSame( entity, entityMerged ); assertNotSame( entity.getLeaves(), entityMerged.getLeaves() ); } ); }

Target:
public void testMergeDetachedOrphanRemoval() { final Root entity = doInHibernate( this::sessionFactory, session -> { Root root = new Root(); root.setName( "new" ); session.save( root ); return root; } ); doInHibernate( this::sessionFactory, session -> { entity.setName( "updated" ); Root entityMerged = (Root) session.merge( entity ); assertNotSame( entity, entityMerged ); assertNotSame( entity.getLeaves(), entityMerged.getLeaves() ); } ); }