auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private KafkaConsumer<byte[], byte[]> getKafkaConsumer() throws IOException { final Map<String, Object> configs = new HashMap<>(); configs.put("metadata.max.age.ms", "10000"); configs.put("group.id", StringUtils.format("kafka-supervisor-%s", getRandomId())); for (Map.Entry<String, Object> entry : ioConfig.getConsumerProperties().entrySet()) { String propertyKey = entry.getKey(); if (propertyKey.equals(KafkaSupervisorIOConfig.TRUST_STORE_PASSWORD_KEY) || propertyKey.equals(KafkaSupervisorIOConfig.KEY_STORE_PASSWORD_KEY) || propertyKey.equals(KafkaSupervisorIOConfig.KEY_PASSWORD_KEY)) { PasswordProvider configPasswordProvider = sortingMapper.readValue( sortingMapper.writeValueAsString(entry.getValue()), PasswordProvider.class ); configs.put(propertyKey, (configPasswordProvider.getPassword())); } else { configs.put(propertyKey, entry.getValue()); } } configs.put("enable.auto.commit", "false"); ClassLoader currCtxCl = Thread.currentThread().getContextClassLoader(); try { Thread.currentThread().setContextClassLoader(getClass().getClassLoader()); return new KafkaConsumer<>(configs, new ByteArrayDeserializer(), new ByteArrayDeserializer()); } finally { Thread.currentThread().setContextClassLoader(currCtxCl); } }

Target:
private KafkaConsumer<byte[], byte[]> getKafkaConsumer() { final Properties props = new Properties(); props.setProperty("metadata.max.age.ms", "10000"); props.setProperty("group.id", StringUtils.format("kafka-supervisor-%s", RealtimeIndexTask.makeRandomId())); KafkaIndexTask.addConsumerPropertiesFromConfig(props, sortingMapper, ioConfig.getConsumerProperties()); props.setProperty("enable.auto.commit", "false"); ClassLoader currCtxCl = Thread.currentThread().getContextClassLoader(); try { Thread.currentThread().setContextClassLoader(getClass().getClassLoader()); return new KafkaConsumer<>(props, new ByteArrayDeserializer(), new ByteArrayDeserializer()); } finally { Thread.currentThread().setContextClassLoader(currCtxCl); } }
Source:
public void initialize() { layoutProviders.stream().forEach(lp -> addProvider(lp.getAlias(), lp)); logger.info("Initialized the layout provider registry."); }

Target:
public void initialize() { logger.info("Initialized the layout provider registry."); }
Source:
public static String[] parseImageName(String imageName) throws MojoExecutionException { if (imageName == null) { throw new MojoExecutionException("You must specify an \"imageName\" in your " + "docker-maven-client's plugin configuration"); } final int lastSlashIndex = imageName.lastIndexOf('/'); final int lastColonIndex = imageName.lastIndexOf(':'); String repo = imageName; String tag = null; if (lastColonIndex > lastSlashIndex) { repo = imageName.substring(0, lastColonIndex); tag = imageName.substring(lastColonIndex + 1); if (tag.isEmpty()) { tag = null; } } return new String[] { repo, tag }; }

Target:
public static String[] parseImageName(String imageName) throws MojoExecutionException { if (isNullOrEmpty(imageName)) { throw new MojoExecutionException("You must specify an \"imageName\" in your " + "docker-maven-client's plugin configuration"); } final int lastSlashIndex = imageName.lastIndexOf('/'); final int lastColonIndex = imageName.lastIndexOf(':'); String repo = imageName; String tag = null; if (lastColonIndex > lastSlashIndex) { repo = imageName.substring(0, lastColonIndex); tag = imageName.substring(lastColonIndex + 1); if (tag.isEmpty()) { tag = null; } } return new String[] { repo, tag }; }
Source:
protected void collect(Resource resource, List<ModuleDefinition> holder) throws IOException { if (!resource.exists()) { return; } String path = resource.getURI().toString(); if (path.endsWith(HASH_EXTENSION)) { return; } else if (path.endsWith(ARCHIVE_AS_FILE_EXTENSION) && requireHashFiles && !hashResource(resource).exists()) { return; } if (path.endsWith("/")) { path = path.substring(0, path.length() - 1); } int lastSlash = path.lastIndexOf('/'); int nextToLastSlash = path.lastIndexOf('/', lastSlash - 1); String name = path.substring(lastSlash + 1); if (name.endsWith(ARCHIVE_AS_FILE_EXTENSION)) { name = name.substring(0, name.length() - ARCHIVE_AS_FILE_EXTENSION.length()); } String typeAsString = path.substring(nextToLastSlash + 1, lastSlash); ModuleType type = null; try { type = ModuleType.valueOf(typeAsString); } catch (IllegalArgumentException e) { return; } String locationToUse = resource.getURL().toString(); ModuleDefinition found = ModuleDefinitions.simple(name, type, locationToUse); if (holder.contains(found)) { SimpleModuleDefinition one = (SimpleModuleDefinition) found; SimpleModuleDefinition two = (SimpleModuleDefinition) holder.get(holder.indexOf(found)); throw new IllegalStateException(String.format("Duplicate module definitions for '%s:%s' found at '%s' and '%s'", found.getType(), found.getName(), one.getLocation(), two.getLocation())); } else { holder.add(found); } }

Target:
protected void collect(Resource resource, List<ModuleDefinition> holder) throws IOException { if (!resource.exists()) { return; } String path = resource.getURI().toString(); if (path.endsWith(HASH_EXTENSION)) { return; } else if (path.endsWith(ARCHIVE_AS_FILE_EXTENSION) && requireHashFiles && !hashResource(resource).exists()) { return; } if (path.endsWith("/")) { path = path.substring(0, path.length() - 1); } int lastSlash = path.lastIndexOf('/'); int nextToLastSlash = path.lastIndexOf('/', lastSlash - 1); String name = path.substring(lastSlash + 1); if (name.endsWith(ARCHIVE_AS_FILE_EXTENSION)) { name = name.substring(0, name.length() - ARCHIVE_AS_FILE_EXTENSION.length()); } String typeAsString = path.substring(nextToLastSlash + 1, lastSlash); ModuleType type = null; try { type = ModuleType.valueOf(typeAsString); } catch (IllegalArgumentException e) { return; } String locationToUse = resource.getURL().toString(); SimpleModuleDefinition found = ModuleDefinitions.simple(name, type, locationToUse); if (holder.contains(found)) { SimpleModuleDefinition other = (SimpleModuleDefinition) holder.get(holder.indexOf(found)); throw new IllegalStateException(String.format("Duplicate module definitions for '%s:%s' found at '%s' and" + " " + "'%s'", found.getType(), found.getName(), found.getLocation(), other.getLocation())); } else { holder.add(found); } }
Source:
void handleApiError(IOException e) throws IOException { int responseCode; try { responseCode = uc.getResponseCode(); } catch (IOException e2) { if (LOGGER.isLoggable(FINE)) LOGGER.log(FINE, "Silently ignore exception retrieving response code for '" + uc.getURL() + "'" + " handling exception " + e, e); throw e; } if (responseCode == HttpURLConnection.HTTP_UNAUTHORIZED) throw e; if ("0".equals(uc.getHeaderField("X-RateLimit-Remaining"))) { root.rateLimitHandler.onError(e,uc); return; } InputStream es = wrapStream(uc.getErrorStream()); try { if (es!=null) { String errorString = IOUtils.toString(es, "UTF-8"); if (responseCode == HttpURLConnection.HTTP_FORBIDDEN && uc.getHeaderField("Retry-After") != null) { this.root.abuseLimitHandler.onError(e,uc); return; } if (e instanceof FileNotFoundException) { throw (IOException) new FileNotFoundException(IOUtils.toString(es, "UTF-8")).initCause(e); } else throw (IOException) new IOException(IOUtils.toString(es, "UTF-8")).initCause(e); } else throw e; } finally { IOUtils.closeQuietly(es); } }

Target:
void handleApiError(IOException e) throws IOException { int responseCode; try { responseCode = uc.getResponseCode(); } catch (IOException e2) { if (LOGGER.isLoggable(FINE)) LOGGER.log(FINE, "Silently ignore exception retrieving response code for '" + uc.getURL() + "'" + " handling exception " + e, e); throw e; } if (responseCode == HttpURLConnection.HTTP_UNAUTHORIZED) throw e; if ("0".equals(uc.getHeaderField("X-RateLimit-Remaining"))) { root.rateLimitHandler.onError(e,uc); return; } if (responseCode == HttpURLConnection.HTTP_FORBIDDEN && uc.getHeaderField("Retry-After") != null) { this.root.abuseLimitHandler.onError(e,uc); return; } InputStream es = wrapStream(uc.getErrorStream()); try { if (es!=null) { if (e instanceof FileNotFoundException) { throw (IOException) new FileNotFoundException(IOUtils.toString(es, "UTF-8")).initCause(e); } else throw (IOException) new IOException(IOUtils.toString(es, "UTF-8")).initCause(e); } else throw e; } finally { IOUtils.closeQuietly(es); } }
Source:
public void send(Command cmd) { sync.lock(); try { cpipe.write(cmd, false); boolean ok = cpipe.flush(); if (!ok) { condition.signalAll(); signalers.forEach(Signaler::send); } } finally { sync.unlock(); } }

Target:
public void send(Command cmd) { sync.lock(); try { cpipe.write(cmd, false); boolean ok = cpipe.flush(); if (!ok) { condition.signalAll(); for (int i = 0; i < signalers.size(); i++) { signalers.get(i).send(); } } } finally { sync.unlock(); } }
Source:
public boolean requestRouteToHost(int networkType, int hostAddress) { InetAddress inetAddress = NetworkUtils.lookupHost(hostAddress); if (inetAddress == null) { return false; } return requestRouteToHostAddress(networkType, inetAddress); }

Target:
public boolean requestRouteToHost(int networkType, int hostAddress) { InetAddress inetAddress = NetworkUtils.intToInetAddress(hostAddress); if (inetAddress == null) { return false; } return requestRouteToHostAddress(networkType, inetAddress); }
Source:
public void checkAttributeValue(PerunSessionImpl perunSession, String key, Attribute attribute) throws InternalErrorException, WrongAttributeValueException, WrongReferenceAttributeValueException, WrongAttributeAssignmentException { if(attribute.getValue() == null) return; if(!(attribute.getValue() instanceof String)) { throw new WrongAttributeValueException(attribute, key, "value must be of type String"); } String value = attribute.valueAsString(); }

Target:
public void checkAttributeValue(PerunSessionImpl perunSession, String key, Attribute attribute) throws InternalErrorException, WrongAttributeValueException, WrongReferenceAttributeValueException, WrongAttributeAssignmentException { if (attribute.getValue() == null) return; if (!(attribute.getValue() instanceof String)) { throw new WrongAttributeValueException(attribute, key, "value must be of type String"); } }
Source:
public DB2MillisecondFunction() { super("MICROSECOND(?1)"); }

Target:
public DB2MillisecondFunction() { super("(MICROSECOND(?1) / 1000)"); }
Source:
public static ArrayList<String> getAllMsysHomes() { if (!isWindowsPlatform) { return null; } IEnvironmentVariable varMsysHome = CCorePlugin.getDefault().getBuildEnvironmentManager() .getVariable(ENV_MSYS_HOME, (ICConfigurationDescription) null, true); ArrayList<String> msysHomeValue = new ArrayList<String>(); msysHomeValue.add(varMsysHome != null ? varMsysHome.getValue() : null); if (msysHomeValue != null) { return msysHomeValue; } String envMinGWHomeValue = getMinGWHome(); if (isMSysLocationCached && CDataUtil.objectsEqual(envMinGWHomeValue, envMinGWHomeValueCached_msys)) { return allmSysLocations; } allmSysLocations = findMSysRoot(allMinGWLocations); if (allmSysLocations.size() > 0) mSysLocation = allmSysLocations.get(0); else minGWLocation = null; envMinGWHomeValueCached_msys = envMinGWHomeValue; isMSysLocationCached = true; return allmSysLocations; }

Target:
public static ArrayList<String> getAllMsysHomes() { if (!isWindowsPlatform) { return null; } IEnvironmentVariable varMsysHome = CCorePlugin.getDefault().getBuildEnvironmentManager() .getVariable(ENV_MSYS_HOME, (ICConfigurationDescription) null, true); ArrayList<String> msysHomeValue = new ArrayList<>(); msysHomeValue.add(varMsysHome != null ? varMsysHome.getValue() : null); if (msysHomeValue != null) { return msysHomeValue; } String envMinGWHomeValue = getMinGWHome(); if (isMSysLocationCached && CDataUtil.objectsEqual(envMinGWHomeValue, envMinGWHomeValueCached_msys)) { return allmSysLocations; } allmSysLocations = findMSysRoot(allMinGWLocations); if (allmSysLocations.size() > 0) mSysLocation = allmSysLocations.get(0); else minGWLocation = null; envMinGWHomeValueCached_msys = envMinGWHomeValue; isMSysLocationCached = true; return allmSysLocations; }
Source:
public void setDrain(boolean drain) { super.setDrain(drain); LOG.info("Stopping socket input: {}", getShortDescription()); try { serverSocket.close(); setClosed(true); } catch (Exception e) { LOG.error("Error during closing socket input: {}", e); } }

Target:
public void setDrain(boolean drain) { super.setDrain(drain); LOG.info("Stopping socket input: {}", getShortDescription()); try { serverSocket.close(); setClosed(true); } catch (Exception e) { LOG.error("Error during closing socket input.", e); } }
Source:
private LiveMigrateDiskParameters createLiveMigrateDiskParameters(MoveDiskParameters moveDiskParameters, Guid vmId) { LiveMigrateDiskParameters toReturn = new LiveMigrateDiskParameters(moveDiskParameters.getImageId(), moveDiskParameters.getSourceDomainId(), moveDiskParameters.getStorageDomainId(), vmId, moveDiskParameters.getQuotaId()); toReturn.setImageGroupID(diskMap.get(moveDiskParameters.getImageId()).getId()); return toReturn; }

Target:
private LiveMigrateDiskParameters createLiveMigrateDiskParameters(MoveDiskParameters moveDiskParameters, Guid vmId) { return new LiveMigrateDiskParameters(moveDiskParameters.getImageId(), moveDiskParameters.getSourceDomainId(), moveDiskParameters.getStorageDomainId(), vmId, moveDiskParameters.getQuotaId(), diskMap.get(moveDiskParameters.getImageId()).getId()); }
Source:
public void userCanCloseJoinPage() { ArticlePage article = openArticleOnMobile(); String title = article.getArticleTitle(); article .getTopBar() .openNavigation() .clickOnSignInRegisterButton() .close(); Assertion.assertEquals(article.getArticleTitle(), title); }

Target:
public void userCanCloseJoinPage() { ArticlePage article = openArticleOnMobile(); String previousTitle = article.getArticleTitle(); article .getTopBar() .openNavigation() .clickOnSignInRegisterButton() .close(); Assertion.assertEquals(article.getArticleTitle(), previousTitle); }
Source:
public boolean removeNode(N node) { List<E> incident_edges = ImmutableList.copyOf(delegate.incidentEdges(node)); for (E e : incident_edges) { this.removeEdge(e); } boolean state = delegate.removeNode(node); if (state) { NetworkEvent<N, E> evt = new NetworkEvent.Node<N, E>(delegate, NetworkEvent.Type.VERTEX_REMOVED, (N) node); fireGraphEvent(evt); } return state; }

Target:
public boolean removeNode(N node) { List<E> incident_edges = ImmutableList.copyOf(delegate.incidentEdges(node)); for (E e : incident_edges) { this.removeEdge(e); } boolean state = delegate.removeNode(node); if (state) { NetworkEvent<N, E> evt = new NetworkEvent.Node<N, E>(delegate, NetworkEvent.Type.NODE_REMOVED, (N) node); fireGraphEvent(evt); } return state; }
Source:
protected synchronized void loadCatalog() { if (catalog!=null) return; BasicBrooklynCatalog catalog = null; String catalogUrl = getConfig().getConfig(BROOKLYN_CATALOG_URL); try { if (!Strings.isEmpty(catalogUrl)) { catalog = new BasicBrooklynCatalog(this, CatalogDtoUtils.newDtoFromUrl(catalogUrl)); if (log.isDebugEnabled()) log.debug("Loaded catalog from "+catalogUrl+": "+catalog); } } catch (Exception e) { if (Throwables.getRootCause(e) instanceof FileNotFoundException) { Maybe<Object> nonDefaultUrl = getConfig().getConfigRaw(BROOKLYN_CATALOG_URL, true); if (nonDefaultUrl.isPresent() && nonDefaultUrl.get()!=null && !"".equals(nonDefaultUrl)) { log.warn("Could not find catalog XML specified at "+nonDefaultUrl+"; using default (local classpath) catalog. Error was: "+e); } else { if (log.isDebugEnabled()) log.debug("No default catalog file available; trying again using local classpath to populate catalog. Error was: "+e); } } else { log.warn("Error importing catalog XML at "+catalogUrl+"; using default (local classpath) catalog. Error was: "+e, e); } } if (catalog==null) { catalog = new BasicBrooklynCatalog(this, CatalogDtoUtils.newDefaultLocalScanningDto(CatalogScanningModes.ANNOTATIONS)); if (log.isDebugEnabled()) log.debug("Loaded default (local classpath) catalog: "+catalog); } catalog.getCatalog().load(this, null); this.catalog = catalog; }

Target:
protected synchronized void loadCatalog() { if (catalog!=null) return; BasicBrooklynCatalog catalog = null; String catalogUrl = getConfig().getConfig(BROOKLYN_CATALOG_URL); try { if (!Strings.isEmpty(catalogUrl)) { catalog = new BasicBrooklynCatalog(this, CatalogDtoUtils.newDtoFromUrl(catalogUrl)); if (log.isDebugEnabled()) log.debug("Loaded catalog from "+catalogUrl+": "+catalog); } } catch (Exception e) { if (Throwables.getRootCause(e) instanceof FileNotFoundException) { Maybe<Object> nonDefaultUrl = getConfig().getConfigRaw(BROOKLYN_CATALOG_URL, true); if (nonDefaultUrl.isPresentAndNonNull() && !"".equals(nonDefaultUrl.get())) { log.warn("Could not find catalog XML specified at "+nonDefaultUrl+"; using default (local classpath) catalog. Error was: "+e); } else { if (log.isDebugEnabled()) log.debug("No default catalog file available; trying again using local classpath to populate catalog. Error was: "+e); } } else { log.warn("Error importing catalog XML at "+catalogUrl+"; using default (local classpath) catalog. Error was: "+e, e); } } if (catalog==null) { catalog = new BasicBrooklynCatalog(this, CatalogDtoUtils.newDefaultLocalScanningDto(CatalogScanningModes.ANNOTATIONS)); if (log.isDebugEnabled()) log.debug("Loaded default (local classpath) catalog: "+catalog); } catalog.getCatalog().load(this, null); this.catalog = catalog; }
Source:
private void timeout() { replyFuture.completeExceptionally(new TimeoutException("Request type " + type + " timed out in " + timeout + " milliseconds")); }

Target:
private void timeout() { replyFuture.completeExceptionally(new TimeoutException("Request type " + type + " timed out in " + timeout + " milliseconds")); callbacks.remove(id); }
Source:
private DeleteRequest createDeleteRequest() { return new DeleteRequest(correlationIdGenerator.incrementAndGet(), routerConfig.routerHostname, blobId); }

Target:
private DeleteRequest createDeleteRequest() { return new DeleteRequest(NonBlockingRouter.correlationIdGenerator.incrementAndGet(), routerConfig.routerHostname, blobId); }
Source:
@Override public boolean onOptionsItemSelected(MenuItem item) { switch (item.getItemId()) { case R.id.rawData: try { String json = FileUtils.readFileToString(Measurement.getEntryFile(this, measurement.id, measurement.test_name), StandardCharsets.UTF_8); json = new GsonBuilder().setPrettyPrinting().disableHtmlEscaping().create().toJson(new JsonParser().parse(json).getAsJsonObject()); startActivity(TextActivity.newIntent(this, json)); } catch (Exception e) { e.printStackTrace(); } return true; case R.id.viewLog: try { String log = FileUtils.readFileToString(Measurement.getLogFile(this, measurement.result.id, measurement.test_name), StandardCharsets.UTF_8); startActivity(TextActivity.newIntent(this, log)); } catch (Exception e) { e.printStackTrace(); } return true; default: return super.onOptionsItemSelected(item); } }

Target:
@Override public boolean onOptionsItemSelected(MenuItem item) { switch (item.getItemId()) { case R.id.rawData: try { File entryFile = Measurement.getEntryFile(this, measurement.id, measurement.test_name); String json = FileUtils.readFileToString(entryFile, StandardCharsets.UTF_8); json = new GsonBuilder().setPrettyPrinting().disableHtmlEscaping().create().toJson(new JsonParser().parse(json).getAsJsonObject()); startActivity(TextActivity.newIntent(this, json)); } catch (Exception e) { e.printStackTrace(); } return true; case R.id.viewLog: try { File logFile = Measurement.getLogFile(this, measurement.result.id, measurement.test_name); String log = FileUtils.readFileToString(logFile, StandardCharsets.UTF_8); startActivity(TextActivity.newIntent(this, log)); } catch (Exception e) { e.printStackTrace(); } return true; default: return super.onOptionsItemSelected(item); } }
Source:
public static boolean codeAwareEqualsIgnoreSpaces(String in1, String in2) { if ( in1 == null || in2 == null ) { return in1 == null && in2 == null; } if ( in1.isEmpty() && in2.isEmpty() ) { return true; } if ( in1.length() == 0 ) { in1 = " "; } if ( in2.length() == 0 ) { in2 = " "; } int idx1 = 0; boolean quoted1 = false; int idx2 = 0; boolean quoted2 = false; boolean equals = true; while ( idx1 < in1.length() && idx2 < in2.length() ) { equals &= in1.charAt(idx1) == in2.charAt(idx2); if (!equals) { break; } if ( in1.charAt(idx1) == '"' ) { if (idx1 == 0 || in1.charAt(idx1-1) != '\\') { quoted1 = !quoted1; } } if ( in2.charAt(idx2) == '"' ) { if (idx2 == 0 || in2.charAt(idx2-1) != '\\') { quoted2 = !quoted2; } } idx1++; idx2++; while ( idx1 < in1.length() && !quoted1 && isWhitespace(in1.charAt(idx1)) ) { idx1++; } while ( idx2 < in2.length() && !quoted2 && isWhitespace(in2.charAt(idx2)) ) { idx2++; } } return equals && idx1 == in1.length() && idx2 == in2.length(); }

Target:
public static boolean codeAwareEqualsIgnoreSpaces(String in1, String in2) { if ( in1 == null || in2 == null ) { return in1 == null && in2 == null; } if ( in1.isEmpty() && in2.isEmpty() ) { return true; } if ( in1.length() == 0 ) { in1 = " "; } if ( in2.length() == 0 ) { in2 = " "; } int idx1 = 0; Character quoted1 = null; int idx2 = 0; Character quoted2 = null; boolean equals = true; while ( equals ) { while ( idx1 < (in1.length()) && (quoted1==null) && isWhitespace(in1.charAt(idx1)) ) { idx1++; } while ( idx2 < (in2.length()) && (quoted2==null) && isWhitespace(in2.charAt(idx2)) ) { idx2++; } if ( idx1 >= in1.length() || idx2 >= in2.length() ) { equals = equals && idx1 == in1.length() && idx2 == in2.length(); break; } if ( in1.charAt(idx1) == '"' || in1.charAt(idx1) == '\'' ) { if ( quoted1 == null ) { quoted1 = in1.charAt(idx1); } else if ( quoted1 != null && quoted1.equals( in1.charAt(idx1) ) ) { if ( in1.charAt(idx1-1) != '\\' ) { quoted1 = null; } } } if ( in2.charAt(idx2) == '"' || in2.charAt(idx2) == '\'' ) { if ( quoted2 == null ) { quoted2 = in2.charAt(idx2); } else if ( quoted2 != null && quoted2.equals( in2.charAt(idx2) ) ) { if ( in2.charAt(idx2-1) != '\\' ) { quoted2 = null; } } } equals &= in1.charAt(idx1) == in2.charAt(idx2); idx1++; idx2++; } return equals; }
Source:
private void writeVmMetadata() { writer.setPrefix(OVIRT_VM_PREFIX, OVIRT_VM_URI); writer.writeStartElement(OVIRT_VM_URI, "vm"); writer.writeNamespace(OVIRT_VM_PREFIX, OVIRT_VM_URI); if (vm.isRunOnce()) { writer.writeStartElement(OVIRT_VM_URI, "destroy_on_reboot"); writer.writeAttributeString("type", "bool"); writer.writeRaw("True"); writer.writeEndElement(); } writer.writeEndElement(); }

Target:
private void writeVmMetadata() { writer.setPrefix(OVIRT_VM_PREFIX, OVIRT_VM_URI); writer.writeStartElement(OVIRT_VM_URI, "vm"); writer.writeNamespace(OVIRT_VM_PREFIX, OVIRT_VM_URI); if (scratchRun) { writer.writeStartElement(OVIRT_VM_URI, "destroy_on_reboot"); writer.writeAttributeString("type", "bool"); writer.writeRaw("True"); writer.writeEndElement(); } writer.writeEndElement(); }
Source:
public void addDescriptor(TupleDescriptor td, TupleDescriptor parent, int catalogNumber, boolean duplicatesAllowed, TransactionController tc, boolean buildVersion2Descriptor) throws StandardException{ TabInfoImpl ti=(catalogNumber<NUM_CORE)?coreInfo[catalogNumber]:getNonCoreTI(catalogNumber); ExecRow row=ti.getCatalogRowFactory().makeRow(td,parent); if (buildVersion2Descriptor) { row.setColumn(SYSTABLESRowFactory.SYSTABLES_VERSION,new SQLVarchar("2.0")); } int insertRetCode=ti.insertRow(row,tc); if(!duplicatesAllowed){ if(insertRetCode!=TabInfoImpl.ROWNOTDUPLICATE) throw duplicateDescriptorException(td,parent); } }

Target:
public void addDescriptor(TupleDescriptor td, TupleDescriptor parent, int catalogNumber, boolean duplicatesAllowed, TransactionController tc, boolean buildVersion2Descriptor) throws StandardException{ TabInfoImpl ti=(catalogNumber<NUM_CORE)?coreInfo[catalogNumber]:getNonCoreTI(catalogNumber); ExecRow row=ti.getCatalogRowFactory().makeRow(td,parent); if (buildVersion2Descriptor && catalogNumber == DataDictionary.SYSTABLES_CATALOG_NUM) { row.setColumn(SYSTABLESRowFactory.SYSTABLES_VERSION,new SQLVarchar("2.0")); } int insertRetCode=ti.insertRow(row,tc); if(!duplicatesAllowed){ if(insertRetCode!=TabInfoImpl.ROWNOTDUPLICATE) throw duplicateDescriptorException(td,parent); } }
Source:
public String toString() { StringBuilder builder = new StringBuilder(StringUtil.simpleClassName(this)).append('['); for (MqttTopicSubscription subscription : topicSubscriptions) { builder.append(subscription).append(", "); } if (!topicSubscriptions.isEmpty()) { builder.setLength(builder.length() - 2); } return builder.append(']').toString(); }

Target:
public String toString() { StringBuilder builder = new StringBuilder(StringUtil.simpleClassName(this)).append('['); for (int i = 0; i < topicSubscriptions.size(); i++) { builder.append(topicSubscriptions.get(i)).append(", "); } if (!topicSubscriptions.isEmpty()) { builder.setLength(builder.length() - 2); } return builder.append(']').toString(); }
Source:
public final void visitNewArray(NewArrayTree tree) { scan(tree.dimensions()); scan(tree.initializers()); SymbolicValue value = createSymbolicInstanceValue(); for (ExecutionState executionState : currentStates) { for (int i = tree.dimensions().size() + tree.initializers().size() - 1; i >= 0; i -= 1) { executionState.pop(); } executionState.push(value); } }

Target:
public final void visitNewArray(NewArrayTree tree) { scan(tree.dimensions()); scan(tree.initializers()); SymbolicValue value = createSymbolicInstanceValue(); for (ExecutionState executionState : currentStates) { for (int i = tree.dimensions().size() + tree.initializers().size() - 1; i >= 0; i--) { executionState.pop(); } executionState.push(value); } }
Source:
public void dump() { System.out.println(resourceTable); }

Target:
public synchronized void dump() { System.out.println(resourceTable); }
Source:
public Float getUVCVideoAspectRatio(){ return prefs.getFloat(PREF_UVC_VIDEO_ASPECT_RATIO, 3f / 4f); }

Target:
public Float getUVCVideoAspectRatio(){ return prefs.getFloat(PREF_UVC_VIDEO_ASPECT_RATIO, DEFAULT_UVC_VIDEO_ASPECT_RATIO); }
Source:
public void multipleValidApiUriConfigShouldSetApiUriPrefsOnScanResult() throws Exception { List<String> uris=Lists.newArrayList("<LINK_0>", "<LINK_1>"); setMultipleValidApiOnlyWithIntentResult(); assertThat(Lists.newArrayList(sharedPrefs.getString(PreferenceKeys.API_URIS, null).split(" ")),is(uris)); }

Target:
public void multipleValidApiUriConfigShouldSetApiUriPrefsOnScanResult() throws Exception { List<String> uris = Lists.newArrayList("<LINK_0>", "<LINK_1>"); setMultipleValidApiOnlyWithIntentResult(); assertThat(prefs.getRestApiBaseUris(), is(uris)); }
Source:
private void addError(@NotNull ReviewFile reviewFile, @NotNull String source, int line, @Nullable String message, Severity severity) { reviewFile.getComments().add(new Comment(line, MessageFormat.format( ConfigurationHolder.instance().getProperty(GeneralOption.COMMENT_FORMAT), source, severity, message))); incrementCounters(severity); }

Target:
private void addError(@NotNull ReviewFile reviewFile, @NotNull String source, int line, @Nullable String message, Severity severity) { reviewFile.getComments().add(new Comment(line, formatter.formatComment(source, severity, message))); incrementCounters(severity); }
Source:
public AbstractDictionary(Object subject, Locale defaultLocale) { checkNotNull(subject, "subject"); checkNotNull(defaultLocale, "default locale"); this.subject = subject; this.defaultLocale = defaultLocale; }

Target:
public AbstractDictionary(Object subject, Locale defaultLocale) { this.subject = checkNotNull(subject, "subject"); this.defaultLocale = checkNotNull(defaultLocale, "default locale"); }
Source:
InternalTopicConfig(final String name, final Map<String, String> topicConfigs, final int numberOfPartitions, final boolean enforceNumberOfPartitions) { Objects.requireNonNull(name, "name can't be null"); Topic.validate(name); validateNumberOfPartitions(numberOfPartitions); this.name = name; this.topicConfigs = topicConfigs; this.numberOfPartitions = Optional.of(numberOfPartitions); this.enforceNumberOfPartitions = enforceNumberOfPartitions; }

Target:
InternalTopicConfig(final String name, final Map<String, String> topicConfigs, final int numberOfPartitions, final boolean enforceNumberOfPartitions) { this.name = Objects.requireNonNull(name, "name can't be null"); Topic.validate(name); validateNumberOfPartitions(numberOfPartitions); this.topicConfigs = Objects.requireNonNull(topicConfigs, "topicConfigs can't be null"); this.numberOfPartitions = Optional.of(numberOfPartitions); this.enforceNumberOfPartitions = enforceNumberOfPartitions; }
Source:
public boolean hasAttribute(final SAMTag tag) { return getAttribute(tag.name())!=null; }

Target:
public boolean hasAttribute(final SAMTag tag) { return getAttribute(tag) != null; }
Source:
public Map<String, FederatedAuthenticatorConfig> getAllFederatedAuthenticators() throws Exception { Map<String, FederatedAuthenticatorConfig> configMap = new HashMap<String, FederatedAuthenticatorConfig>(); try { FederatedAuthenticatorConfig[] fedAuthConfigs = idPMgtStub .getAllFederatedAuthenticators(); if (fedAuthConfigs != null && fedAuthConfigs.length > 0) { for (FederatedAuthenticatorConfig config : fedAuthConfigs) { if (!("facebook").equals(config.getDisplayName()) || ("openid").equals(config.getDisplayName()) || ("openidconnect").equals(config.getDisplayName()) || ("samlsso").equals(config.getDisplayName())|| ("passovests"). equals(config.getDisplayName())) configMap.put(config.getName(), config); } } } catch (Exception e) { log.error(e.getMessage(), e); throw new Exception("Error occurred while retrieving all local claim URIs"); } return configMap; }

Target:
public Map<String, FederatedAuthenticatorConfig> getAllFederatedAuthenticators() throws Exception { Map<String, FederatedAuthenticatorConfig> configMap = new HashMap<String, FederatedAuthenticatorConfig>(); try { FederatedAuthenticatorConfig[] fedAuthConfigs = idPMgtStub .getAllFederatedAuthenticators(); if (fedAuthConfigs != null && fedAuthConfigs.length > 0) { for (FederatedAuthenticatorConfig config : fedAuthConfigs) { if (!("facebook").equals(config.getDisplayName()) || ("openid").equals(config.getDisplayName()) || ("openidconnect").equals(config.getDisplayName()) || ("samlsso").equals(config.getDisplayName()) || ("passivests"). equals(config.getDisplayName())) configMap.put(config.getName(), config); } } } catch (Exception e) { log.error(e.getMessage(), e); throw new Exception("Error occurred while retrieving all local claim URIs"); } return configMap; }
Source:
@Override public void onResponse(Call<List<Metric>> call, Response<List<Metric>> response) { if (response.isSuccessful()){ getActivity().succeed(); } }

Target:
@Override public void onResponse(Call<List<Metric>> call, Response<List<Metric>> response) { if (response.isSuccessful()){ getActivity().succeed(); } else { LoginActivity activity = getActivity(); if (activity.authIndicator.isShowing()){ activity.authIndicator.setMessage("Error occurred"); activity.authIndicator.dismiss(); } switch (response.code()){ case 404: activity.showError(R.string.error_not_found); break; case 401: activity.showError(R.string.error_unauth); break; default: activity.showError(R.string.error_general); } } }
Source:
public Order cloneForRevision() { Order newOrder = new Order(); newOrder.setCareSetting(this.getCareSetting()); newOrder.setConcept(this.getConcept()); newOrder.setAction(Action.REVISE); newOrder.setPreviousOrder(this); newOrder.setPatient(this.getPatient()); newOrder.setOrderer(this.getOrderer()); newOrder.setInstructions(this.getInstructions()); newOrder.setUrgency(this.getUrgency()); newOrder.setCommentToFulfiller(this.getCommentToFulfiller()); newOrder.setAccessionNumber(this.getAccessionNumber()); newOrder.setAutoExpireDate(this.getAutoExpireDate()); newOrder.setOrderReason(this.getOrderReason()); newOrder.setOrderReasonNonCoded(this.getOrderReasonNonCoded()); return newOrder; }

Target:
public Order cloneForRevision() { Order newOrder = new Order(); newOrder.setCareSetting(this.getCareSetting()); newOrder.setConcept(this.getConcept()); newOrder.setAction(Action.REVISE); newOrder.setPreviousOrder(this); newOrder.setPatient(this.getPatient()); newOrder.setInstructions(this.getInstructions()); newOrder.setUrgency(this.getUrgency()); newOrder.setCommentToFulfiller(this.getCommentToFulfiller()); newOrder.setAccessionNumber(this.getAccessionNumber()); newOrder.setAutoExpireDate(this.getAutoExpireDate()); newOrder.setOrderReason(this.getOrderReason()); newOrder.setOrderReasonNonCoded(this.getOrderReasonNonCoded()); return newOrder; }
Source:
public ExpressionTree UNARY_EXPR() { return b.<ExpressionTree>nonterminal(PHPLexicalGrammar.UNARY_EXPR).is( b.firstOf( f.unaryExpr( b.firstOf( b.token(PHPPunctuator.INC), b.token(PHPPunctuator.DEC), b.token(PHPPunctuator.PLUS), b.token(PHPPunctuator.MINUS), b.token(PHPPunctuator.TILDA), b.token(PHPPunctuator.BANG), b.token(PHPPunctuator.AT)), UNARY_EXPR()), CAST_EXPR(), COMMON_SCALAR(), EXPRESSION())); }

Target:
public ExpressionTree UNARY_EXPR() { return b.<ExpressionTree>nonterminal(PHPLexicalGrammar.UNARY_EXPR).is( b.firstOf( f.prefixExpr( b.firstOf( b.token(PHPPunctuator.INC), b.token(PHPPunctuator.DEC), b.token(PHPPunctuator.PLUS), b.token(PHPPunctuator.MINUS), b.token(PHPPunctuator.TILDA), b.token(PHPPunctuator.BANG), b.token(PHPPunctuator.AT)), UNARY_EXPR()), CAST_EXPR(), ASSIGNMENT_EXPRESSION(), ASSIGNMENT_BY_REFERENCE(), POSTFIX_EXPRESSION())); }
Source:
protected void onReveal() { ActionBarVisibilityEvent.fire(this, false); if (!Strings.isNullOrEmpty(getLoggedInCookie())) { tryLoggingInWithCookieFirst(); } if (!currentUser.isLoggedIn() && !isOnLoginPage()) { PlaceRequest p = new Builder().nameToken(NameTokens.login).with(REDIRECT_PARAMETER_NAME, getHistoryToken()).build(); placeManager.revealPlace(p); } }

Target:
protected void onReveal() { ActionBarVisibilityEvent.fire(this, false); if (!Strings.isNullOrEmpty(getLoggedInCookie())) { tryLoggingInWithCookieFirst(); } }
Source:
public static Client getClient(ClientConfig config, String[] servers, int port) throws Exception { config.setTopologyChangeAware(true); final Client client = ClientFactory.createClient(config); for (String server : servers) { try { client.createConnection(server.trim(), port); break; } catch(Exception e) { } } if (client.getConnectedHostList().isEmpty()) { throw new Exception("Fail to connect any server."); } return client; }

Target:
public static Client getClient(ClientConfig config, String[] servers, int port) throws Exception { config.setTopologyChangeAware(true); final Client client = ClientFactory.createClient(config); for (String server : servers) { try { client.createConnection(server.trim(), port); break; } catch(IOException e) { } } if (client.getConnectedHostList().isEmpty()) { throw new Exception("Unable to connect to any servers."); } return client; }
Source:
Map<String, String> getPackageJsonMainEntries() { return null; }

Target:
Map<String, String> getPackageJsonMainEntries() { return ImmutableMap.of(); }
Source:
private KeyStore getKeystore(Path keystorePath, String keystoreType, String alias, boolean failIfNotAccessible) throws KeystoreServiceException { if (failIfNotAccessible) { File keystoreFile = keystorePath.toFile(); if (!keystoreFile.exists()) { LOG.keystoreFileDoesNotExist(keystorePath.toString()); throw new KeystoreServiceException("The keystore file does not exist: " + keystoreFile.getAbsolutePath()); } else if (!keystoreFile.isFile()) { LOG.keystoreFileIsNotAFile(keystorePath.toString()); throw new KeystoreServiceException("The keystore file is not a file: " + keystoreFile.getAbsolutePath()); } else if (!keystoreFile.canRead()) { LOG.keystoreFileIsNotAccessible(keystorePath.toString()); throw new KeystoreServiceException("The keystore file cannot be read: " + keystoreFile.getAbsolutePath()); } } readLock.lock(); try { return loadKeyStore(keystorePath, keystoreType, getKeyStorePassword(alias)); } finally { readLock.unlock(); } }

Target:
private KeyStore getKeystore(Path keystorePath, String keystoreType, String alias, boolean failIfNotAccessible) throws KeystoreServiceException { if (failIfNotAccessible) { if (Files.notExists(keystorePath)) { LOG.keystoreFileDoesNotExist(keystorePath.toString()); throw new KeystoreServiceException("The keystore file does not exist: " + keystorePath.toString()); } else if (!Files.isRegularFile(keystorePath)) { LOG.keystoreFileIsNotAFile(keystorePath.toString()); throw new KeystoreServiceException("The keystore file is not a file: " + keystorePath.toString()); } else if (!Files.isReadable(keystorePath)) { LOG.keystoreFileIsNotAccessible(keystorePath.toString()); throw new KeystoreServiceException("The keystore file cannot be read: " + keystorePath.toString()); } } readLock.lock(); try { return loadKeyStore(keystorePath, keystoreType, getKeyStorePassword(alias)); } finally { readLock.unlock(); } }
Source:
private void flushBuffer() throws IOException { Log.d(TAG, "Writing " + fileBuffer.size() + " bytes to incoming file (" + this.fileBytesLeft + " bytes left)"); fileStream.write(fileBuffer.toByteArray()); fileBuffer.reset(); }

Target:
private void flushBuffer() throws IOException { if (LogUtil.isLogAvailable()) { Log.d(TAG, "Writing " + fileBuffer.size() + " bytes to incoming file (" + this.fileBytesLeft + " bytes left)"); } fileStream.write(fileBuffer.toByteArray()); fileBuffer.reset(); }
Source:
void serviceShouldNotLogHeadersWhenFalse() throws Exception { FakeMailetConfig mailetConfig = FakeMailetConfig.builder() .mailetName("LogContext") .mailetContext(mailContext) .setProperty("headers",false) .setProperty("body",true) .setProperty("level",LogLevel.INFO) .build(); mailet.init(mailetConfig); mailet.service(createMail()); verify(logger).isInfoEnabled(); verify(logger).info("\nThis is a fake mail"); verifyNoMoreInteractions(logger); }

Target:
void serviceShouldNotLogHeadersWhenFalse() throws Exception { FakeMailetConfig mailetConfig = FakeMailetConfig.builder() .mailetName("LogContext") .mailetContext(mailContext) .setProperty("headers", false) .setProperty("body", true) .setProperty("level", LogLevel.INFO) .build(); mailet.init(mailetConfig); mailet.service(createMail()); verify(logger).isInfoEnabled(); verify(logger).info("This is a fake mail"); verifyNoMoreInteractions(logger); }
Source:
protected int getNumberOfInstructorsDisplayedToStudents(String courseId) { List<InstructorAttributes> instructors = logic.getInstructorsForCourse(courseId); int numberOfInstructorsDisplayed = 0; for (InstructorAttributes instructor : instructors) { if (instructor.isDisplayedToStudents) { numberOfInstructorsDisplayed++; } } return numberOfInstructorsDisplayed; }

Target:
private long getNumberOfInstructorsDisplayedToStudents(String courseId) { List<InstructorAttributes> instructors = logic.getInstructorsForCourse(courseId); return instructors.stream().filter(instructor -> instructor.isDisplayedToStudents).count(); }
Source:
public void endWithFailure() { setSucceeded(true); if (getParameters().getStage() != LiveMigrateStage.AUTO_GENERATED_SNAPSHOT_REMOVE_START) { ImagesHandler.updateAllDiskImagesSnapshotsStatusInTransactionWithCompensation( getMovedDiskIds(), ImageStatus.OK, ImageStatus.OK, getCompensationContext()); } }

Target:
public void endWithFailure() { setSucceeded(true); if (getParameters().getStage() == LiveMigrateStage.CREATE_SNAPSHOT) { ImagesHandler.updateAllDiskImagesSnapshotsStatusInTransactionWithCompensation( getMovedDiskIds(), ImageStatus.OK, ImageStatus.OK, getCompensationContext()); } }
Source:
private void preExpandCollapseNotify() { notifyExpandBar(SWT.Activate); notifyExpandBar(SWT.FocusIn); notifyExpandBar(SWT.MouseDown); }

Target:
private void preExpandCollapseNotify() { notifyExpandBar(SWT.Activate, super.createEvent()); notifyExpandBar(SWT.FocusIn, super.createEvent()); notifyExpandBar(SWT.MouseDown, super.createEvent()); }
Source:
private static Duration getFsTimestampResolution(Path file) { Path dir = Files.isDirectory(file) ? file : file.getParent(); if (!dir.toFile().canWrite()) { return FALLBACK_TIMESTAMP_RESOLUTION; } try { FileStore s = Files.getFileStore(dir); FileStoreAttributeCache c = attributeCache.get(s); if (c != null) { return c.getFsTimestampResolution(); } Lock lock = locks.computeIfAbsent(s, l -> new ReentrantLock()); CompletableFuture<Optional<Duration>> f = CompletableFuture .supplyAsync(() -> { if (!lock.tryLock()) { return Optional.empty(); } Optional<Duration> resolution; try { resolution = measureTimestampResolution(s, dir); if (resolution.isPresent()) { FileStoreAttributeCache cache = new FileStoreAttributeCache( resolution.get()); attributeCache.put(s, cache); if (LOG.isDebugEnabled()) { LOG.debug(cache.toString()); } } } finally { lock.unlock(); } return resolution; }); if (!background.get()) { Optional<Duration> d = f.get(); if (d.isPresent()) { return d.get(); } } } catch (IOException | InterruptedException | ExecutionException e) { LOG.error(e.getMessage(), e); } return FALLBACK_TIMESTAMP_RESOLUTION; }

Target:
private static Duration getFsTimestampResolution(Path file) { Path dir = Files.isDirectory(file) ? file : file.getParent(); FileStore s; try { if (Files.exists(dir)) { s = Files.getFileStore(dir); FileStoreAttributeCache c = attributeCache.get(s); if (c != null) { return c.getFsTimestampResolution(); } if (!Files.isWritable(dir)) { return FALLBACK_TIMESTAMP_RESOLUTION; } } else { return FALLBACK_TIMESTAMP_RESOLUTION; } CompletableFuture<Optional<Duration>> f = CompletableFuture .supplyAsync(() -> { Lock lock = locks.computeIfAbsent(s, l -> new ReentrantLock()); if (!lock.tryLock()) { return Optional.empty(); } Optional<Duration> resolution; try { resolution = measureFsTimestampResolution(s, dir); if (resolution.isPresent()) { FileStoreAttributeCache cache = new FileStoreAttributeCache( resolution.get()); attributeCache.put(s, cache); if (LOG.isDebugEnabled()) { LOG.debug(cache.toString()); } } } finally { lock.unlock(); locks.remove(s); } return resolution; }); Optional<Duration> d = f.get(background.get() ? 50 : 5000, TimeUnit.MILLISECONDS); if (d.isPresent()) { return d.get(); } } catch (IOException | InterruptedException | ExecutionException e) { LOG.error(e.getMessage(), e); } catch (TimeoutException e) { } return FALLBACK_TIMESTAMP_RESOLUTION; }
Source:
boolean handleUri(String uriScheme, String uri) throws CoreException; default boolean handleUri(URI uri) throws CoreException { return handleUri(uri.getScheme(), uri.toString()); }

Target:
void handleUri(String uriScheme, String uri) throws CoreException; default void handleUri(URI uri) throws CoreException { handleUri(uri.getScheme(), uri.toString()); }
Source:
final private void loadSecretKeyForAPI() throws NoSuchAlgorithmException, InvalidKeySpecException { if (sKey != null && sMacKey != null) return; synchronized (lockObject) { if (Build.VERSION.SDK_INT >= 18) { try { sKey = getSecretKeyFromAndroidKeyStore(); sMacKey = getMacKey(sKey); sKeyVersion = VERSION_ANDROID_KEY_STORE; return; } catch (Exception e) { Logger.e(TAG, "Failed to get private key from AndroidKeyStore", "", ADALError.ANDROIDKEYSTORE_FAILED, e); } } sKey = AuthenticationSettings.INSTANCE.getSecretKey(); sMacKey = getMacKey(sKey); sKeyVersion = VERSION_USER_DEFINED; } }

Target:
final private void loadSecretKeyForAPI() throws NoSuchAlgorithmException, InvalidKeySpecException { if (sKey != null && sMacKey != null) return; synchronized (lockObject) { if (Build.VERSION.SDK_INT >= 18) { try { sKey = getSecretKeyFromAndroidKeyStore(); sMacKey = getMacKey(sKey); sBlobVersion = VERSION_ANDROID_KEY_STORE; return; } catch (Exception e) { Logger.e(TAG, "Failed to get private key from AndroidKeyStore", "", ADALError.ANDROIDKEYSTORE_FAILED, e); } } sKey = getSecretKey(AuthenticationSettings.INSTANCE.getSecretKeyData()); sMacKey = getMacKey(sKey); sBlobVersion = VERSION_USER_DEFINED; } }
Source:
public void deleteUsers(List<String> userNames, HttpLocalizedOperationResult result) { if (userNames == null || userNames.isEmpty()) { result.notFound(LocalizedMessage.string("NO_USERS_SELECTED"), HealthStateType.notFound()); return; } Set<String> disabledUsers = allDisabledUserNames(); for (String username : userNames) { if(!disabledUsers.contains(username)){ result.notFound(LocalizedMessage.string("USER_DISABLED_OR_NOT_FOUND", "users", userNames), HealthStateType.notFound()); return; } } for (String username : userNames) { deleteUser(username, result); } if(result.isSuccessful()){ result.setMessage(LocalizedMessage.string("RESOURCE_DELETE_SUCCESSFUL", "users", userNames)); } }

Target:
public BulkDeletionFailureResult deleteUsers(List<String> userNames, HttpLocalizedOperationResult result) { if (userNames == null || userNames.isEmpty()) { result.badRequest(LocalizedMessage.string("NO_USERS_SELECTED")); return null; } synchronized (enableUserMutex) { BulkDeletionFailureResult bulkDeletionFailureResult = deletionValidation(userNames); if (bulkDeletionFailureResult.isEmpty()) { userDao.deleteUsers(userNames); result.setMessage(LocalizedMessage.string("RESOURCES_DELETE_SUCCESSFUL", "users", userNames)); } else { result.unprocessableEntity(LocalizedMessage.string("USER_ENABLED_OR_NOT_FOUND")); } return bulkDeletionFailureResult; } }
Source:
private ExtensionScript getScriptsExtension() { if (extensionScript == null) extensionScript = Control.getSingleton().getExtensionLoader().getExtension(ExtensionScript.class); return extensionScript; }

Target:
private static ExtensionScript getScriptsExtension() { if (extensionScript == null) extensionScript = Control.getSingleton().getExtensionLoader().getExtension(ExtensionScript.class); return extensionScript; }
Source:
public void run() { try { log.info("Running reporting task: " + getClass().getSimpleName()); currentSession = sessionFactory.getHibernateSessionFactory().getCurrentSession(); executeTask(); log.info("Completed reporting task: " + getClass().getSimpleName()); } catch (Exception e) { log.error("An error occurred while running reporting task: " + getClass(), e); } }

Target:
public void run() { try { log.info("Running reporting task: " + getClass().getSimpleName()); currentSession = sessionFactory.getCurrentSession(); executeTask(); log.info("Completed reporting task: " + getClass().getSimpleName()); } catch (Exception e) { log.error("An error occurred while running reporting task: " + getClass(), e); } }
Source:
public void init(Run src, AbstractBuild<?,?> dst, FilePath srcDir, FilePath baseTargetDir) throws IOException, InterruptedException { if (Util.isOverridden(Copier.class, getClass(), "init", Run.class, Run.class, FilePath.class, FilePath.class)) { init(src, (Run) dst, srcDir, baseTargetDir); } }

Target:
public void init(Run src, AbstractBuild<?,?> dst, FilePath srcDir, FilePath baseTargetDir) throws IOException, InterruptedException { if (Util.isOverridden(Copier.class, getClass(), "initialize", Run.class, Run.class, FilePath.class, FilePath.class)) { initialize((Run<?, ?>)src, dst, srcDir, baseTargetDir); } else { throw new AbstractMethodError(String.format("Invalid call to Copier.init(Run src, AbstractBuild dst, FilePath, FilePath). " + "%s implements the newer version of 'initialize' that takes a Run instance for the 'dst' arg. Please call that implementation.", getClass().getName())); } }
Source:
public ICPPASTAttributeSpecifier copy(CopyStyle style) { ICPPASTAttributeSpecifier copy = copy(new CPPASTAttributeSpecifier(), style); for (ICPPASTAttribute attribute : ArrayUtil.trim(attributes)){ copy.addAttribute(attribute.copy(style)); } return copy; }

Target:
public ICPPASTAttributeSpecifier copy(CopyStyle style) { CPPASTAttributeSpecifier copy = copy(new CPPASTAttributeSpecifier(), style); copy.attributes = ArrayUtil.trim(attributes, true); for (int i = 0; i < copy.attributes.length; i++) { copy.attributes[i] = copy.attributes[i].copy(style); } return copy; }