auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void interpret() throws ParserException { mAidDo = null; mHashDo = null; byte[] data = getRawData(); int index = getValueIndex(); if (index + getValueLength() > data.length) { throw new ParserException("Not enough data for AR_DO!"); } do { BerTlv temp = BerTlv.decode(data, index); if (temp.getTag() == AID_REF_DO.TAG || temp.getTag() == AID_REF_DO.TAG_DEFAULT_APPLICATION) { mAidDo = new AID_REF_DO(data, temp.getTag(), temp.getValueIndex(), temp.getValueLength()); mAidDo.interpret(); } else if (temp.getTag() == Hash_REF_DO.TAG) { mHashDo = new Hash_REF_DO(data, temp.getValueIndex(), temp.getValueLength()); mHashDo.interpret(); } else { } index = temp.getValueIndex() + temp.getValueLength(); } while (getValueIndex() + getValueLength() > index); if ((mAidDo == null && mHashDo != null)) { mAidDo = AID_REF_DO.createCarrierPrivilegeAid(); } if (mAidDo == null) { throw new ParserException("Missing AID-REF-DO in REF-DO!"); } if (mHashDo == null) { throw new ParserException("Missing Hash-REF-DO in REF-DO!"); } }

Target:
public void interpret() throws ParserException { mAidDo = null; mHashDo = null; byte[] data = getRawData(); int index = getValueIndex(); if (index + getValueLength() > data.length) { throw new ParserException("Not enough data for AR_DO!"); } do { BerTlv temp = BerTlv.decode(data, index); if (temp.getTag() == AID_REF_DO.TAG || temp.getTag() == AID_REF_DO.TAG_DEFAULT_APPLICATION) { mAidDo = new AID_REF_DO(data, temp.getTag(), temp.getValueIndex(), temp.getValueLength()); mAidDo.interpret(); } else if (temp.getTag() == Hash_REF_DO.TAG) { mHashDo = new Hash_REF_DO(data, temp.getValueIndex(), temp.getValueLength()); mHashDo.interpret(); } else { } index = temp.getValueIndex() + temp.getValueLength(); } while (getValueIndex() + getValueLength() > index); if (mAidDo == null && mHashDo != null) { mAidDo = AID_REF_DO.createCarrierPrivilegeAid(); } if (mAidDo == null) { throw new ParserException("Missing AID-REF-DO in REF-DO!"); } if (mHashDo == null) { throw new ParserException("Missing Hash-REF-DO in REF-DO!"); } }
Source:
void readNbt(CompoundTag tag) { super.readNbt(tag); if (tag.containsKey("SkullOwner")) { if (!tag.readString( name -> owner.set(GlowPlayerProfile.getProfile(name).join()), "SkullOwner")) { tag.readCompound( skullOwner -> owner.set(GlowPlayerProfile.fromNbt(skullOwner).join()), "SkullOwner"); } } }

Target:
void readNbt(CompoundTag tag) { super.readNbt(tag); if (tag.containsKey("SkullOwner")) { if (!tag.readString("SkullOwner", name -> owner.set(GlowPlayerProfile.getProfile(name).join()))) { tag.readCompound("SkullOwner", skullOwner -> owner.set(GlowPlayerProfile.fromNbt(skullOwner).join()) ); } } }
Source:
public String toString() { StringBuilder sb = new StringBuilder(); sb.append(getClass()).append(":\n"); long delay = getCrawlDelay(); if (delay == UNSET_CRAWL_DELAY) { sb.append(" - no crawl delay\n"); } else { sb.append(" - crawl delay: ").append(delay).append('\n'); } int nSitemaps = getSitemaps().size(); if (nSitemaps == 0) { sb.append(" - no sitemap URLs\n"); } else { sb.append(" - number of sitemap URLs: ").append(nSitemaps).append('\n'); if (nSitemaps <= 10) { sb.append(String.join("\n", getSitemaps())).append("\n\n"); } } return sb.toString(); }

Target:
public String toString() { StringBuilder sb = new StringBuilder(); sb.append(getClass()).append(":\n"); long delay = getCrawlDelay(); if (delay == UNSET_CRAWL_DELAY) { sb.append(" - no crawl delay\n"); } else { sb.append(" - crawl delay: ").append(delay).append('\n'); } List<String> sitemaps = getSitemaps(); int nSitemaps = sitemaps.size(); if (nSitemaps == 0) { sb.append(" - no sitemap URLs\n"); } else { sb.append(" - number of sitemap URLs: ").append(nSitemaps).append('\n'); int numOfSitemapsToShow = Math.min(nSitemaps, 10); for (int i = 0; i < numOfSitemapsToShow; i++) { sb.append(sitemaps.get(i)).append("\n"); } } return sb.toString(); }
Source:
protected void executeCommand() { if (getVds().getStatus() == VDSStatus.Maintenance) { setSucceeded(true); } else { orderListOfRunningVmsOnVds(getVdsId()); if (getVds().getHighlyAvailableIsConfigured()) { try { SetHaMaintenanceModeVDSCommandParameters params = new SetHaMaintenanceModeVDSCommandParameters(getVds(), HaMaintenanceMode.LOCAL, true); if (!runVdsCommand(VDSCommandType.SetHaMaintenanceMode, params).getSucceeded()) { setSucceeded(isHostedEngineOnVds()); haMaintenanceFailed = true; } } catch (VdcBLLException e){ if (isHostedEngineOnVds()) throw e; setSucceeded(false); haMaintenanceFailed = true; } } setSucceeded(migrateAllVms(getExecutionContext())); if (getVds().getStatus() == VDSStatus.NonResponsive || getVds().getStatus() == VDSStatus.Connecting || getVds().getStatus() == VDSStatus.Down) { runVdsCommand(VDSCommandType.SetVdsStatus, new SetVdsStatusVDSCommandParameters(getVdsId(), VDSStatus.Maintenance)); } } if (isVmsExist()) { ExecutionHandler.setAsyncJob(getExecutionContext(), true); } }

Target:
protected void executeCommand() { if (getVds().getStatus() == VDSStatus.Maintenance) { setSucceeded(true); } else { orderListOfRunningVmsOnVds(getVdsId()); if (getVds().getHighlyAvailableIsConfigured()) { SetHaMaintenanceModeVDSCommandParameters params = new SetHaMaintenanceModeVDSCommandParameters(getVds(), HaMaintenanceMode.LOCAL, true); if (!runVdsCommand(VDSCommandType.SetHaMaintenanceMode, params).getSucceeded()) { haMaintenanceFailed = true; if (isHostedEngineOnVds()) { setSucceeded(false); return; } } } setSucceeded(migrateAllVms(getExecutionContext())); if (getVds().getStatus() == VDSStatus.NonResponsive || getVds().getStatus() == VDSStatus.Connecting || getVds().getStatus() == VDSStatus.Down) { runVdsCommand(VDSCommandType.SetVdsStatus, new SetVdsStatusVDSCommandParameters(getVdsId(), VDSStatus.Maintenance)); } } if (isVmsExist()) { ExecutionHandler.setAsyncJob(getExecutionContext(), true); } }
Source:
public void afterQuery(final ExecutionInfo info, final List<QueryInfo> queries) { final Span span = info.getCustomValue(SPAN, Span.class); if (!info.isSuccess()) { final Statement statement = info.getStatement(); final Throwable error = info.getThrowable(); decorator.onError(span, statement, error); } span.finish(); }

Target:
public void afterQuery(final ExecutionInfo info, final List<QueryInfo> queries) { final Span span = info.getCustomValue(SPAN, Span.class); try { if (!info.isSuccess()) { final Statement statement = info.getStatement(); final Throwable error = info.getThrowable(); decorator.onError(span, statement, error); } } finally { span.finish(); } }
Source:
private void rotateTelescope() { if (telescope == null) { telescope = OwlTelescopeReporter.create( OwlTelescopeReporters.EQUIVALENCE_UPDATING_WORKER, Event.Type.EQUIVALENCE ); telescope.startReporting(); timeSinceTelescopeRotated = DateTime.now(); } else if (timeSinceTelescopeRotated.plusHours(1).isBeforeNow()) { telescope.endReporting(); telescope.startReporting(); } }

Target:
private void rotateTelescope() { if (telescope == null) { telescope = OwlTelescopeReporter.create( OwlTelescopeReporters.EQUIVALENCE_UPDATING_WORKER, Event.Type.EQUIVALENCE ); telescope.startReporting(); timeSinceTelescopeRotated = DateTime.now(); } else if (timeSinceTelescopeRotated.plusHours(1).isBeforeNow()) { telescope.endReporting(); telescope = OwlTelescopeReporter.create( OwlTelescopeReporters.EQUIVALENCE_UPDATING_WORKER, Event.Type.EQUIVALENCE ); telescope.startReporting(); timeSinceTelescopeRotated = DateTime.now(); } }
Source:
public void mercury_search_navigateToPageUsingSearchSuggestions() { init(); try { this.topBar.openSearch().typeInSearch(SEARCH_PHRASE).selectSearchSuggestion(0); } catch (Exception e) { System.out.println(e); } Assertion.assertTrue(driver.getCurrentUrl().contains(SEARCH_PHRASE)); }

Target:
public void mercury_search_navigateToPageUsingSearchSuggestions() { String suggestionLink = new ArticlePage() .open(MercurySubpages.MAIN_PAGE) .getTopBar() .openSearch() .typeInSearch(this.SEARCH_PHRASE) .clickSearchSuggestion(0); Assertion.assertTrue(driver.getCurrentUrl().equals(suggestionLink)); }
Source:
private static void handleDynamicResourceAllocation(String[] argArray) { String dynamicAllocProp = System.getenv(HadoopSparkJob.SPARK_DYNAMIC_RES_ENV_VAR); boolean dynamicAllocEnabled = dynamicAllocProp != null && dynamicAllocProp.equals(Boolean.TRUE.toString()); if (dynamicAllocEnabled) { for (int i = 0; i < argArray.length; i++) { if (argArray[i] == null) continue; if (argArray[i].equals(SparkJobArg.NUM_EXECUTORS.sparkParamName) || ( argArray[i].equals(SparkJobArg.SPARK_CONF_PREFIX.sparkParamName) && (argArray[i+1].startsWith(SPARK_CONF_SHUFFLE_SERVICE_ENABLED) || argArray[i+1].startsWith(SPARK_CONF_DYNAMIC_ALLOC_ENABLED)) )) { logger.info("Azbakan enforces dynamic resource allocation. Ignore user param: " + argArray[i] + " " + argArray[i+1]); argArray[i] = null; argArray[++i] = null; } } } }

Target:
private static void handleDynamicResourceAllocation(String[] argArray) { String dynamicAllocProp = System.getenv(HadoopSparkJob.SPARK_DYNAMIC_RES_ENV_VAR); boolean dynamicAllocEnabled = dynamicAllocProp != null && dynamicAllocProp.equals(Boolean.TRUE.toString()); if (dynamicAllocEnabled) { for (int i = 0; i < argArray.length; i++) { if (argArray[i] == null) continue; if (argArray[i].equals(SparkJobArg.NUM_EXECUTORS.sparkParamName) || ( argArray[i].equals(SparkJobArg.SPARK_CONF_PREFIX.sparkParamName) && (argArray[i+1].startsWith(SPARK_CONF_NUM_EXECUTORS) || argArray[i+1].startsWith(SPARK_CONF_SHUFFLE_SERVICE_ENABLED) || argArray[i+1].startsWith(SPARK_CONF_DYNAMIC_ALLOC_ENABLED)) )) { logger.info("Azbakan enforces dynamic resource allocation. Ignore user param: " + argArray[i] + " " + argArray[i+1]); argArray[i] = null; argArray[++i] = null; } } } }
Source:
private void doAuthenticate(Account account) { SecurityContextHolder.clearContext(); Authentication authentication = new PreAuthenticatedAuthenticationToken( account.getEmail(), null, authenticationProvider.getGrantedAuthorities(account) ); SecurityContextHolder.getContext().setAuthentication(authentication); }

Target:
private void doAuthenticate(Account account) { SecurityContextHolder.clearContext(); Authentication authentication = new IdSiteAuthenticationToken(account); authenticationProvider.authenticate(authentication); SecurityContextHolder.getContext().setAuthentication(authentication); }
Source:
public void setSourceOnSave(boolean sourceOnSave) { view_.getSourceOnSave().setValue(sourceOnSave); docUpdateSentinel_.setSourceOnSave(sourceOnSave, null); }

Target:
public void setSourceOnSave(boolean sourceOnSave) { view_.getSourceOnSave().setValue(sourceOnSave, true); }
Source:
protected void updateEmulatedMachines() { Collection<EmulatedMachine> em = new ArrayList<>(); em.add(EmulatedMachine.i440fx_seabios); em.add(EmulatedMachine.q35_ovmf); em.add(EmulatedMachine.q35_secureboot); getModel().getEmulatedMachine().setItems(em); }

Target:
protected void updateEmulatedMachines() { EmulatedMachine oldVal = getModel().getEmulatedMachine().getSelectedItem(); Collection<EmulatedMachine> emList = new ArrayList<>(); emList.add(EmulatedMachine.i440fx_seabios); emList.add(EmulatedMachine.q35_ovmf); emList.add(EmulatedMachine.q35_secureboot); getModel().getEmulatedMachine().setItems(emList); if (oldVal != null) { getModel().getEmulatedMachine().setSelectedItem(oldVal); } else if (getModel().getOSType().getSelectedItem() != null) { EmulatedMachine em = AsyncDataProvider.getInstance().emulatedMachineByOs(getModel().getOSType().getSelectedItem()); if (em != null && getModel().getEmulatedMachine().getIsAvailable()) { getModel().getEmulatedMachine().setSelectedItem(em); } } }
Source:
protected String httpPost(String request, JsonObject body) throws IOException, RuntimeException { String host = getKieRESTUrl(); URL url = new URL(host + "/" + request); System.out.println("[POST] "+url.toString()+" body: "+body); HttpURLConnection conn = (HttpURLConnection) url.openConnection(); conn.setDoOutput(body!=null); conn.setRequestMethod("POST"); conn.setRequestProperty("Content-Type", "application/json"); setHttpCredentials(conn); if (body!=null) { java.io.OutputStream os = conn.getOutputStream(); Writer writer = new OutputStreamWriter(os, "UTF-8"); body.writeTo(writer); writer.close(); os.flush(); } String response = new BufferedReader(new InputStreamReader((conn.getInputStream()))).readLine(); System.out.println("[POST] response: "+response); if (conn.getResponseCode() != HttpURLConnection.HTTP_ACCEPTED) { throw new IOException("HTTP POST failed : HTTP error code : " + conn.getResponseCode()); } JsonObject jo = JsonObject.readFrom(response); String status = jo.get("status").asString(); if (status != null && !status.isEmpty()) { if (!"APPROVED".equals(status)) throw new IOException("HTTP POST failed : Request status code : " + status); } String jobId = jo.get("jobId").asString(); if (jobId != null && !jobId.isEmpty()) return jobId; return response; }

Target:
protected String httpPost(String request, JsonObject body) throws IOException, RuntimeException { String host = getKieRESTUrl(); URL url = new URL(host + "/" + request); Activator.println("[POST] "+url.toString()+" body: "+body); HttpURLConnection conn = (HttpURLConnection) url.openConnection(); conn.setDoOutput(body!=null); conn.setRequestMethod("POST"); conn.setRequestProperty("Content-Type", "application/json"); setHttpCredentials(conn); if (body!=null) { java.io.OutputStream os = conn.getOutputStream(); Writer writer = new OutputStreamWriter(os, "UTF-8"); body.writeTo(writer); writer.close(); os.flush(); } String response = new BufferedReader(new InputStreamReader((conn.getInputStream()))).readLine(); Activator.println("[POST] response: "+response); if (conn.getResponseCode() != HttpURLConnection.HTTP_ACCEPTED) { throw new IOException("HTTP POST failed : HTTP error code : " + conn.getResponseCode()); } JsonObject jo = JsonObject.readFrom(response); String status = jo.get("status").asString(); if (status != null && !status.isEmpty()) { if (!"APPROVED".equals(status)) throw new IOException("HTTP POST failed : Request status code : " + status); } String jobId = jo.get("jobId").asString(); if (jobId != null && !jobId.isEmpty()) return jobId; return response; }
Source:
private SimRobot() { super(); nodeList.add(new FullSimRunner("Full Sim Toolbox", new LocTuple(40.441670, -79.9416362))); RobobuggyJFrame mainWindow = new RobobuggyJFrame("MainWindow", 1.0, 1.0); Gui.getInstance().addWindow(mainWindow); RobobuggyGUITabs tabs = new RobobuggyGUITabs(); mainWindow.addComponent(tabs, 0.0, 0.0, 1.0, 1.0); tabs.addTab(new MainGuiWindow(), "Home"); tabs.add(new PathPanel(), "Path Visualizer"); tabs.addTab(new ConfigurationPanel(), "Configuration"); }

Target:
private SimRobot() { super(); nodeList.add(new FullSimRunner("Full Sim Toolbox", new LocTuple(INITIAL_POS_LAT, INITIAL_POS_LON))); RobobuggyJFrame mainWindow = new RobobuggyJFrame("MainWindow", 1.0, 1.0); Gui.getInstance().addWindow(mainWindow); RobobuggyGUITabs tabs = new RobobuggyGUITabs(); mainWindow.addComponent(tabs, 0.0, 0.0, 1.0, 1.0); tabs.addTab(new MainGuiWindow(), "Home"); tabs.add(new PathPanel(), "Path Visualizer"); tabs.addTab(new ConfigurationPanel(), "Configuration"); }
Source:
public void safeSetValue(String value) throws InvalidParameterException, Exception { System.out.println("Validation helper is " + valueHelper.getClass().getName()); ValidationResult validationResult = valueHelper.validate(this, value); if (!validationResult.isOk()) { StringBuilder invalidParamMsg = new StringBuilder(); invalidParamMsg.append("Cannot set value ") .append(value) .append(" to key ") .append(keyName) .append(". ") .append(StringUtils.isNotEmpty(validationResult.getDetails()) ? validationResult.getDetails() : ""); throw new InvalidParameterException(invalidParamMsg.toString()); } this.value = valueHelper.setValue(value); }

Target:
public void safeSetValue(String value) throws InvalidParameterException, Exception { ValidationResult validationResult = valueHelper.validate(this, value); if (!validationResult.isOk()) { StringBuilder invalidParamMsg = new StringBuilder(); invalidParamMsg.append("Cannot set value ") .append(value) .append(" to key ") .append(keyName) .append(". ") .append(StringUtils.isNotEmpty(validationResult.getDetails()) ? validationResult.getDetails() : ""); throw new InvalidParameterException(invalidParamMsg.toString()); } this.value = valueHelper.setValue(value); }
Source:
private WebElement getSessionLinkInRow(String elementClassNamePrefix, int rowId){ waitForElementPresence(By.id("session" + rowId)); By.id("session" + rowId); waitForElementPresence(By.className(elementClassNamePrefix)); return browser.driver.findElement(By.id("session" + rowId)).findElement(By.className(elementClassNamePrefix)); }

Target:
private WebElement getSessionLinkInRow(String elementClassNamePrefix, int rowId){ waitForElementPresence(By.id("session" + rowId)); waitForElementPresence(By.className(elementClassNamePrefix)); return browser.driver.findElement(By.id("session" + rowId)).findElement(By.className(elementClassNamePrefix)); }
Source:
private io.fabric8.kubernetes.api.model.Container addContainer( Pod toolingPod, String image, List<EnvVar> env, ResourceRequirements resources) { io.fabric8.kubernetes.api.model.Container container = new ContainerBuilder() .withImage(image) .withName(Names.generateName("")) .withEnv(toK8sEnv(env)) .withResources(toK8sResources(resources)) .build(); toolingPod.getSpec().getContainers().add(container); return container; }

Target:
private io.fabric8.kubernetes.api.model.Container addContainer( Pod toolingPod, String image, List<EnvVar> env, ResourceRequirements resources) { io.fabric8.kubernetes.api.model.Container container = new ContainerBuilder() .withImage(image) .withName(Names.generateName("tooling")) .withEnv(toK8sEnv(env)) .withResources(toK8sResources(resources)) .build(); toolingPod.getSpec().getContainers().add(container); return container; }
Source:
public void stop(final StopContext context) { synchronized (serverInventoryLock) { try { serverInventory = null; serverInventoryLock.set(false); } finally { serverInventoryLock.notifyAll(); } } extensionRegistry.clear(); capabilityRegistry.clear(); super.stop(context); }

Target:
public void stop(final StopContext context) { synchronized (serverInventoryLock) { try { serverInventory = null; serverInventoryLock.set(false); } finally { serverInventoryLock.notifyAll(); } } extensionRegistry.clear(); super.stop(context); }
Source:
protected File createFile() { long count=0; File file = null; try{ file = new File("bigfile.txt"); PrintWriter writer = new PrintWriter(file, "UTF-8"); Random random = new Random(); for(int i = 0; i < 23695522; i++) { char[] word = new char[random.nextInt(8)+3]; count+=word.length; for(int j = 0; j < word.length; j++) { word[j] = (char)('a' + random.nextInt(26)); } writer.print(new String(word) + ' '); count+=1; if (i % 10 == 0){ writer.println(); count+=2; } } writer.close(); } catch (IOException e) { } return file; }

Target:
protected File createFile() { long count=0; File file = null; file = new File("bigfile.txt"); InputStream testStream = randomStream(0, 256); try { FileIOUtils.copyInputStreamToFile(testStream, file); } catch (IOException e) { e.printStackTrace(); } return file; }
Source:
public boolean updateEntityLockedState(String entityName, String entityType, String operation) throws WorkflowException { Connection connection = null; PreparedStatement prepStmtGet = null; PreparedStatement prepStmtSelect = null; ResultSet results; try { connection = JDBCPersistenceManager.getInstance().getDBConnection(); prepStmtGet = connection.prepareStatement(SQLConstants.GET_ENTITY_STATE_QUERY); prepStmtGet.setString(1, entityName); prepStmtGet.setString(2, entityType); prepStmtGet.setString(3, "Operation"); prepStmtGet.setString(4, operation); results = prepStmtGet.executeQuery(); if (results.next()) { return false; } else { prepStmtSelect = connection.prepareStatement(SQLConstants.ADD_ENTITY_STATE_QUERY); prepStmtSelect.setString(1, entityName); prepStmtSelect.setString(2, entityType); prepStmtSelect.setString(3, "Operation"); prepStmtSelect.setString(4, operation); prepStmtSelect.execute(); } connection.commit(); } catch (SQLException | IdentityException e) { log.error("Error while saving new user data for Identity database.", e); throw new WorkflowException("Error while saving new user data for Identity database.", e); } finally { IdentityDatabaseUtil.closeStatement(prepStmtSelect); IdentityDatabaseUtil.closeStatement(prepStmtGet); IdentityDatabaseUtil.closeConnection(connection); } return true; }

Target:
public boolean updateEntityLockedState(String entityName, String entityType, String operation) throws WorkflowException { Connection connection = null; PreparedStatement prepStmtGet = null; PreparedStatement prepStmtSelect = null; ResultSet results; try { connection = IdentityDatabaseUtil.getDBConnection();; prepStmtGet = connection.prepareStatement(SQLConstants.GET_ENTITY_STATE_QUERY); prepStmtGet.setString(1, entityName); prepStmtGet.setString(2, entityType); prepStmtGet.setString(3, "Operation"); prepStmtGet.setString(4, operation); results = prepStmtGet.executeQuery(); if (results.next()) { return false; } else { prepStmtSelect = connection.prepareStatement(SQLConstants.ADD_ENTITY_STATE_QUERY); prepStmtSelect.setString(1, entityName); prepStmtSelect.setString(2, entityType); prepStmtSelect.setString(3, "Operation"); prepStmtSelect.setString(4, operation); prepStmtSelect.execute(); } connection.commit(); } catch (SQLException | IdentityException e) { throw new WorkflowException("Error while saving new user data for Identity database.", e); } finally { IdentityDatabaseUtil.closeStatement(prepStmtSelect); IdentityDatabaseUtil.closeStatement(prepStmtGet); IdentityDatabaseUtil.closeConnection(connection); } return true; }
Source:
String gtk_css_default_theme_values (int swt) { byte buffer; int length; long settings = OS.gtk_settings_get_default (); long ptr = new long [1]; long str; OS.g_object_get (settings, OS.gtk_theme_name, ptr, 0); if (ptr [0] == 0) { return ""; } length = OS.strlen (ptr [0]); if (length == 0) { return ""; } buffer = new byte [length]; OS.memmove (buffer, ptr [0], length); OS.g_free (ptr [0]); String gtkThemeName = new String(Converter.mbcsToWcs (null, buffer)); long themeProvider = OS.gtk_css_provider_get_named(Converter.wcsToMbcs (null, gtkThemeName, true), null); str = OS.gtk_css_provider_to_string (themeProvider); length = OS.strlen (str); if (length == 0) { return ""; } buffer = new byte [length]; OS.memmove (buffer, str, length); String cssOutput = new String (Converter.mbcsToWcs (null, buffer)); String color; switch (swt) { case SWT.COLOR_LIST_SELECTION: int tSelected = cssOutput.indexOf ("@define-color theme_selected_bg_color"); int selected = cssOutput.indexOf ("@define-color selected_bg_color"); if (tSelected != -1) { color = cssOutput.substring(tSelected + 38); if (color.startsWith("#") || color.startsWith("rgb")) { return color; } } if (selected != -1) { color = cssOutput.substring(selected + 32); if (color.startsWith("#") || color.startsWith("rgb")) { return color; } } else { return ""; } default: return ""; } }

Target:
String gtk_css_default_theme_values (int swt) { byte buffer; int length; long settings = OS.gtk_settings_get_default (); long ptr = new long [1]; long str; OS.g_object_get (settings, OS.gtk_theme_name, ptr, 0); if (ptr [0] == 0) { return ""; } length = OS.strlen (ptr [0]); if (length == 0) { return ""; } buffer = new byte [length]; OS.memmove (buffer, ptr [0], length); OS.g_free (ptr [0]); long themeProvider = OS.gtk_css_provider_get_named(buffer, null); str = OS.gtk_css_provider_to_string (themeProvider); length = OS.strlen (str); if (length == 0) { return ""; } buffer = new byte [length]; OS.memmove (buffer, str, length); String cssOutput = new String (Converter.mbcsToWcs (null, buffer)); String color; switch (swt) { case SWT.COLOR_LIST_SELECTION: int tSelected = cssOutput.indexOf ("@define-color theme_selected_bg_color"); int selected = cssOutput.indexOf ("@define-color selected_bg_color"); if (tSelected != -1) { color = cssOutput.substring(tSelected + 38); if (color.startsWith("#") || color.startsWith("rgb")) { return color; } } if (selected != -1) { color = cssOutput.substring(selected + 32); if (color.startsWith("#") || color.startsWith("rgb")) { return color; } } else { return ""; } default: return ""; } }
Source:
public boolean isSubtype(JavaType t, JavaType s) { boolean result; if (t == s) { result = true; } else { switch (t.tag) { case JavaType.BYTE: case JavaType.CHAR: result = t.tag == s.tag || (t.tag + 2 <= s.tag && s.tag <= JavaType.DOUBLE); break; case JavaType.SHORT: case JavaType.INT: case JavaType.LONG: case JavaType.FLOAT: case JavaType.DOUBLE: result = t.tag <= s.tag && s.tag <= JavaType.DOUBLE; break; case JavaType.BOOLEAN: case JavaType.VOID: result = t.tag == s.tag; break; case JavaType.ARRAY: if(t.tag != s.tag) { result = t.getSymbol().getSuperclass() == s; break; } result = isSubtype(((JavaType.ArrayJavaType) t).elementType(), ((JavaType.ArrayJavaType) s).elementType()); break; case JavaType.CLASS: if(t.tag != s.tag) { result = false; break; } Set<String> erasedTypes = Sets.newHashSet(); for (JavaType.ClassJavaType classType : t.getSymbol().superTypes()) { erasedTypes.add(classType.erasure().fullyQualifiedName()); } result = erasedTypes.contains(s.fullyQualifiedName()); break; case JavaType.BOT: result = s.tag == JavaType.BOT || s.tag == JavaType.CLASS || s.tag == JavaType.ARRAY; break; default: result = false; break; } } return result; }

Target:
public boolean isSubtype(JavaType t, JavaType s) { boolean result; if (t == s) { result = true; } else { switch (t.tag) { case JavaType.BYTE: case JavaType.CHAR: result = t.tag == s.tag || (t.tag + 2 <= s.tag && s.tag <= JavaType.DOUBLE); break; case JavaType.SHORT: case JavaType.INT: case JavaType.LONG: case JavaType.FLOAT: case JavaType.DOUBLE: result = t.tag <= s.tag && s.tag <= JavaType.DOUBLE; break; case JavaType.BOOLEAN: case JavaType.VOID: result = t.tag == s.tag; break; case JavaType.ARRAY: if(t.tag != s.tag) { result = t.getSymbol().getSuperclass() == s; break; } result = isSubtype(((JavaType.ArrayJavaType) t).elementType(), ((JavaType.ArrayJavaType) s).elementType()); break; case JavaType.CLASS: if(t.tag != s.tag) { result = false; break; } Set<JavaType> erasedTypes = Sets.newHashSet(); for (JavaType.ClassJavaType classType : t.getSymbol().superTypes()) { erasedTypes.add(classType.erasure()); } result = erasedTypes.contains(s.erasure()); break; case JavaType.BOT: result = s.tag == JavaType.BOT || s.tag == JavaType.CLASS || s.tag == JavaType.ARRAY; break; default: result = false; break; } } return result; }
Source:
public ConnectorSplitSource getSplits(ConnectorTransactionHandle transactionHandle, ConnectorSession session, ConnectorTableLayoutHandle layout, SplitSchedulingStrategy splitSchedulingStrategy) { ElasticsearchTableLayoutHandle layoutHandle = (ElasticsearchTableLayoutHandle) layout; ElasticsearchTableHandle tableHandle = layoutHandle.getTable(); ElasticsearchTableDescription table = client.getTable(tableHandle.getSchemaName(), tableHandle.getTableName()); checkState(table != null, "Table %s.%s no longer exists", tableHandle.getSchemaName(), tableHandle.getTableName()); List<String> indices = client.getIndices(table); for (String index : indices) { log.debug("index: " + index); } ImmutableList.Builder<ConnectorSplit> splits = ImmutableList.builder(); for (String index : indices) { ClusterSearchShardsResponse response = client.getSearchShards(index, table); DiscoveryNode[] nodes = response.getNodes(); for (ClusterSearchShardsGroup group : response.getGroups()) { int nodeIndex = group.getShardId().getId() % nodes.length; ElasticsearchSplit split = new ElasticsearchSplit(table, index, group.getShardId().getId(), nodes[nodeIndex].getHostName(), nodes[nodeIndex].getAddress().getPort(), layoutHandle.getTupleDomain()); log.debug("split: " + " index: " + index + " shardId: " + group.getShardId() + " node: " + nodes[nodeIndex].getHostName().toString() + " port: " + nodes[nodeIndex].getAddress().getPort()); splits.add(split); } } return new FixedSplitSource(splits.build()); }

Target:
public ConnectorSplitSource getSplits(ConnectorTransactionHandle transactionHandle, ConnectorSession session, ConnectorTableLayoutHandle layout, SplitSchedulingStrategy splitSchedulingStrategy) { ElasticsearchTableLayoutHandle layoutHandle = (ElasticsearchTableLayoutHandle) layout; ElasticsearchTableHandle tableHandle = layoutHandle.getTable(); ElasticsearchTableDescription table = client.getTable(tableHandle.getSchemaName(), tableHandle.getTableName()); checkState(table != null, "Table %s.%s no longer exists", tableHandle.getSchemaName(), tableHandle.getTableName()); List<String> indices = client.getIndices(table); ImmutableList.Builder<ConnectorSplit> splits = ImmutableList.builder(); for (String index : indices) { ClusterSearchShardsResponse response = client.getSearchShards(index, table); DiscoveryNode[] nodes = response.getNodes(); for (ClusterSearchShardsGroup group : response.getGroups()) { int nodeIndex = group.getShardId().getId() % nodes.length; ElasticsearchSplit split = new ElasticsearchSplit(table, index, group.getShardId().getId(), nodes[nodeIndex].getHostName(), nodes[nodeIndex].getAddress().getPort(), layoutHandle.getTupleDomain()); splits.add(split); } } return new FixedSplitSource(splits.build()); }
Source:
CodeWriter emitAndIndent(String s) throws IOException { boolean first = true; for (String line : s.split("\r?\n", -1)) { if (!first) { if ((javadoc || comment) && trailingNewline) { emitIndentation(); out.append(javadoc ? " *" : " } out.append("\n"); trailingNewline = true; if (statementLine != -1) { if (statementLine == 0) { indent(2); } statementLine++; } } first = false; if (line.isEmpty()) continue; if (trailingNewline) { emitIndentation(); if (javadoc) { out.append(" * "); } else if (comment) { out.append(" } } out.append(line); trailingNewline = false; } return this; }

Target:
CodeWriter emitAndIndent(String s) throws IOException { boolean first = true; for (String line : s.split("\\R", -1)) { if (!first) { if ((javadoc || comment) && trailingNewline) { emitIndentation(); out.append(javadoc ? " *" : " } out.append("\n"); trailingNewline = true; if (statementLine != -1) { if (statementLine == 0) { indent(2); } statementLine++; } } first = false; if (line.isEmpty()) continue; if (trailingNewline) { emitIndentation(); if (javadoc) { out.append(" * "); } else if (comment) { out.append(" } } out.append(line); trailingNewline = false; } return this; }
Source:
public static RequestBodyDeserializer getRequestBodyDeserializer(final String contentType) { RequestBodyDeserializer deserializer = REQUEST_BODY_DESERIALIZERS.get(contentType); if (null == deserializer) { synchronized (RequestBodyDeserializerFactory.class) { if (null == REQUEST_BODY_DESERIALIZERS.get(contentType)) { instantiateRequestBodyDeserializerFromFactories(contentType); } deserializer = REQUEST_BODY_DESERIALIZERS.get(contentType); } } if (MISSING_DESERIALIZER == deserializer) { throw new RequestBodyDeserializerNotFoundException(contentType); } return deserializer; }

Target:
public static RequestBodyDeserializer getRequestBodyDeserializer(final String contentType) { RequestBodyDeserializer result = REQUEST_BODY_DESERIALIZERS.get(contentType); if (null == result) { synchronized (RequestBodyDeserializerFactory.class) { if (null == REQUEST_BODY_DESERIALIZERS.get(contentType)) { instantiateRequestBodyDeserializerFromFactories(contentType); } result = REQUEST_BODY_DESERIALIZERS.get(contentType); } } if (MISSING_DESERIALIZER == result) { throw new RequestBodyDeserializerNotFoundException(contentType); } return result; }
Source:
public void scanWebXml(XmlFile file) { if (hasNoSecurityConstraint(file)) { List<Integer> secondaryLocationLines = new ArrayList<>(); reportIssueOnFile("Add \"security-constraint\" elements to this descriptor.", secondaryLocationLines); } }

Target:
public void scanWebXml(XmlFile file) { if (hasNoSecurityConstraint(file)) { List<Integer> secondaryLocationLines = Collections.emptyList(); reportIssueOnFile("Add \"security-constraint\" elements to this descriptor.", secondaryLocationLines); } }
Source:
public String getUrl() { return PluginImpl.getInstance().getServer(serverName).getConfig().getGerritFrontEndUrlFor(tEvent); }

Target:
public String getUrl() { return url; }
Source:
private void setupClient() throws FileSystemException { final GenericFileName rootName = getRoot(); String userName; if (rootName.getUserName().equals("") || rootName.getUserName() == null) { userName = ""; } else { if (rootName.getUserName().contains(";")) { userName = rootName.getUserName().substring(rootName.getUserName().indexOf(";") + 1, rootName.getUserName().length()); } else { userName = rootName.getUserName(); } } String password = rootName.getPassword(); String authDomain = (rootName.getUserName().contains(";") ? rootName.getUserName().substring(0, rootName.getUserName().indexOf(";")) : null); AuthenticationContext authContext = new AuthenticationContext(userName, password.toCharArray(), authDomain); try { connection = smbClient.connect(rootName.getHostName()); session = connection.authenticate(authContext); String share = ((Smb2FileName) rootName).getShareName(); diskShare = (DiskShare) session.connectShare(share); } catch (Exception e) { throw new FileSystemException("vfs.provider.smb2/connect.error", rootName.getHostName(), e.getCause()); } }

Target:
private void setupClient() throws FileSystemException { final GenericFileName rootName = getRoot(); final String userString = rootName.getUserName(); String userName = ""; if (userString != null && !userString.isEmpty()) { if (userString.contains(";")) { userName = userString.substring(userString.indexOf(";") + 1, userString.length()); } else { userName = userString; } } String password = rootName.getPassword(); String authDomain = (userString.contains(";") ? userString.substring(0, userString.indexOf(";")) : null); AuthenticationContext authContext = new AuthenticationContext(userName, password.toCharArray(), authDomain); try { connection = smbClient.connect(rootName.getHostName()); session = connection.authenticate(authContext); String share = ((Smb2FileName) rootName).getShareName(); diskShare = (DiskShare) session.connectShare(share); } catch (Exception e) { if (LOG.isDebugEnabled()) { LOG.debug("Error while creating connection to " + rootName.getHostName()); } throw new FileSystemException("vfs.provider.smb2/connect.error", rootName.getHostName(), e); } }
Source:
private boolean warXmlExists(File dir){ boolean looseApp = false; if (dir.exists() && dir.isDirectory()) { File[] files = dir.listFiles(); for (File file : files) { if (file.isFile() && file.getName().endsWith(".war.xml")) { looseApp = true; } } } return looseApp; }

Target:
private boolean warXmlExists(File dir){ boolean looseApp = false; if (dir.exists() && dir.isDirectory()) { File[] files = dir.listFiles(); for (File file : files) { if (file.isFile() && file.getName().endsWith(".war.xml") && file.getName().startsWith(DevMojo.this.project.getArtifactId())) { looseApp = true; break; } } } return looseApp; }
Source:
private static String getFileName(HttpURLConnection connection) { String contentType = connection.getContentType(); MediaType type = MediaType.parse(contentType); String fileName = connection.getURL().toString(); if(type.is(MediaType.ANY_APPLICATION_TYPE)) { String contentDisposition = connection.getHeaderField("Content-Disposition"); if(contentDisposition != null) { String[] content = contentDisposition.split(";"); for (String string : content) { if (string.contains("filename=")) { int index = string.indexOf('"'); fileName = string.substring(index+1, string.length() - 1); } } } } else if(type.is(MediaType.ANY_TEXT_TYPE)) { String url = connection.getURL().getPath(); int indexFile = url.lastIndexOf('/'); fileName = url.substring(indexFile+1, url.length()); } return fileName; }

Target:
private static String getFileName(HttpURLConnection connection) { String fileName = getLastSegmentUrl(connection.getURL().toString()); String contentType = connection.getContentType(); if (contentType != null) { MediaType type = MediaType.parse(contentType); if (type.is(MediaType.ANY_APPLICATION_TYPE)) { String contentDisposition = connection.getHeaderField(CONTENT_DISPOSITION); if (contentDisposition != null) { String[] content = contentDisposition.split(";"); for (String string : content) { if (string.contains("filename=")) { int index = string.indexOf('"'); fileName = string.substring(index + 1, string.length() - 1); } } } } } return fileName; }
Source:
private void assertCodeDeploymentWorking(HazelcastInstance client, EntryProcessor entryProcessor) { int keyCount = 100; IMap<Integer, Integer> map = client.getMap(randomName()); for (int i = 0; i < keyCount; i++) { map.put(i, 0); } for (int i = 0; i < 5; i++) { map.executeOnEntries(entryProcessor); } for (int i = 0; i < keyCount; i++) { assertEquals(5, (int) map.get(i)); } }

Target:
private void assertCodeDeploymentWorking(HazelcastInstance client, EntryProcessor entryProcessor) { int keyCount = 100; IMap<Integer, Integer> map = client.getMap(randomName()); for (int i = 0; i < keyCount; i++) { map.put(i, 0); } int incrementCount = 5; for (int i = 0; i < incrementCount; i++) { map.executeOnEntries(entryProcessor); } for (int i = 0; i < keyCount; i++) { assertEquals(incrementCount, (int) map.get(i)); } }
Source:
private static Instant retrieveDeadlineTimestamp(JobDataMap jobDataMap) { Object timestamp = jobDataMap.get(MESSAGE_TIMESTAMP); if (timestamp instanceof String) return Instant.parse(timestamp.toString()); return Instant.ofEpochMilli((long) timestamp); }

Target:
private static Instant retrieveDeadlineTimestamp(JobDataMap jobDataMap) { Object timestamp = jobDataMap.get(MESSAGE_TIMESTAMP); if (timestamp instanceof String) { return Instant.parse(timestamp.toString()); } return Instant.ofEpochMilli((long) timestamp); }
Source:
private static boolean isPublic(DetailAST modifiers) { return ScopeUtil.isInInterfaceBlock(modifiers) && modifiers.findFirstToken(TokenTypes.LITERAL_PRIVATE) == null || ScopeUtil.isInAnnotationBlock(modifiers) || modifiers.findFirstToken(TokenTypes.LITERAL_PUBLIC) != null; }

Target:
private static boolean isPublic(DetailAST modifiers) { return modifiers.findFirstToken(TokenTypes.LITERAL_PUBLIC) != null || ScopeUtil.isInAnnotationBlock(modifiers) || ScopeUtil.isInInterfaceBlock(modifiers) && modifiers.findFirstToken(TokenTypes.LITERAL_PRIVATE) == null; }
Source:
public SeLionSauceProxy(RegistrationRequest request, Registry registry) { super(fixTimeout(request), registry); down = false; poll = true; pollingInterval = request.getConfigAsInt(RegistrationRequest.NODE_POLLING, DEFAULT_POLLING_INTERVAL); downPollingLimit = request.getConfigAsInt(RegistrationRequest.DOWN_POLLING_LIMIT, DEFAULT_DOWN_POLLING_LIMIT); if (!SauceServlet.PROXY_ID.equals(remoteHost.toExternalForm())) { throw new GridException(SeLionSauceProxy.class.getSimpleName() + " can not be used by an external process"); } try { sauceConfigReader = SauceConfigReader.getInstance(); defaultParentTunnel = sauceConfigReader.getDefaultParentTunnel(); defaultTunnelIdentifier = sauceConfigReader.getDefaultTunnelIdentifier(); sauceApi = new SauceLabsRestApi(); } catch (GridConfigurationException e) { throw new GridException("Failed to initialize proxy: ", e); } }

Target:
public SeLionSauceProxy(RegistrationRequest request, Registry registry) { super(fixTimeout(request), registry); down = false; poll = true; pollingInterval = request.getConfigAsInt(RegistrationRequest.NODE_POLLING, DEFAULT_POLLING_INTERVAL); downPollingLimit = request.getConfigAsInt(RegistrationRequest.DOWN_POLLING_LIMIT, DEFAULT_DOWN_POLLING_LIMIT); if ((pollingInterval <= 0) || (downPollingLimit <= 0)) { poll = false; } if (!SauceServlet.PROXY_ID.equals(remoteHost.toExternalForm())) { throw new GridException(SeLionSauceProxy.class.getSimpleName() + " can not be used by an external process"); } try { sauceConfigReader = SauceConfigReader.getInstance(); defaultParentTunnel = sauceConfigReader.getDefaultParentTunnel(); defaultTunnelIdentifier = sauceConfigReader.getDefaultTunnelIdentifier(); sauceApi = new SauceLabsRestApi(); } catch (GridConfigurationException e) { throw new GridException("Failed to initialize proxy: ", e); } renderer = new WebProxyHtmlRenderer(this); }
Source:
public TestingServer(boolean start) throws Exception { this(-1, null); }

Target:
public TestingServer(boolean start) throws Exception { this(-1, null, start); }
Source:
public VoxelShape getSelectionShape(@Nullable ISelectionContext ctx) { boolean hasHammer; if(ctx!=null&&ctx.hasItem(Tools.hammer)) hasHammer = true; else hasHammer = false; return SHAPES.get(new BoundingBoxKey(hasHammer, this)); }

Target:
public VoxelShape getSelectionShape(@Nullable ISelectionContext ctx) { return SHAPES.get(new BoundingBoxKey(ctx!=null&&ctx.getEntity() instanceof ClientPlayerEntity&&Utils.isHammer(((ClientPlayerEntity)ctx.getEntity()).getHeldItemMainhand()), this)); }
Source:
public void onTrackInfoChanged(@NonNull MediaController controller, @NonNull List<TrackInfo> trackInfos) { onTracksChanged(controller, trackInfos); }

Target:
public void onTrackInfoChanged(@NonNull MediaController controller, @NonNull List<TrackInfo> trackInfos) { }
Source:
public void testFilteredContent_2() throws Throwable { UserDetails user = new OAuth2TestUtils.UserBuilder("jack_bauer", "0x24") .withAuthorization(Group.FREE_GROUP_NAME, "tempRole", Permission.BACKOFFICE).build(); String accessToken = mockOAuthInterceptor(user); ResultActions result = mockMvc .perform(get("/plugins/cms/contents") .param("status", IContentService.STATUS_ONLINE) .param("sort", IContentManager.CONTENT_CREATION_DATE_FILTER_KEY) .param("direction", FieldSearchFilter.DESC_ORDER) .param("filters[0].attribute", "id") .param("filters[0].value", "EVN194") .sessionAttr("user", user) .header("Authorization", "Bearer " + accessToken)); String bodyResult = result.andReturn().getResponse().getContentAsString(); result.andExpect(status().isOk()); String expectedContentId = "EVN194"; int payloadSize = JsonPath.read(bodyResult, "$.payload.size()"); String extractedId = JsonPath.read(bodyResult, "$.payload[" + 0 + "].id"); Assert.assertEquals(expectedContentId, extractedId); }

Target:
public void testFilteredContent_2() throws Throwable { UserDetails user = new OAuth2TestUtils.UserBuilder("jack_bauer", "0x24") .withAuthorization(Group.FREE_GROUP_NAME, "tempRole", Permission.BACKOFFICE).build(); String accessToken = mockOAuthInterceptor(user); ResultActions result = mockMvc .perform(get("/plugins/cms/contents") .param("status", IContentService.STATUS_ONLINE) .param("sort", IContentManager.CONTENT_CREATION_DATE_FILTER_KEY) .param("direction", FieldSearchFilter.DESC_ORDER) .param("filters[0].attribute", "id") .param("filters[0].value", "EVN194") .sessionAttr("user", user) .header("Authorization", "Bearer " + accessToken)); result.andDo(print()) .andExpect(status().isOk()) .andExpect(jsonPath("$.payload.size()", is(1))) .andExpect(jsonPath("$.payload[0].id", is("EVN194"))); }
Source:
public Object decorate(ClassLoader loader, Field field) { try { if (isTypifiedElement(field)) { return decorateTypifiedElement(loader, field); } else if (isHtmlElement(field)) { return decorateHtmlElement(loader, field); } else if (isWebElement(field) && !field.getName().equals("wrappedElement")) { return decorateWebElement(loader, field); } else if (isTypifiedElementList(field)) { return decorateTypifiedElementList(loader, field); } else if (isHtmlElementList(field)) { return decorateHtmlElementList(loader, field); } else if (isWebElementList(field)) { return decorateWebElementList(loader, field); } else { return null; } } catch (ClassCastException ignore) { return null; } }

Target:
public Object decorate(ClassLoader loader, Field field) { try { if (isTypifiedElement(field)) { return decorateTypifiedElement(loader, field); } if (isHtmlElement(field)) { return decorateHtmlElement(loader, field); } if (isWebElement(field) && !field.getName().equals("wrappedElement")) { return decorateWebElement(loader, field); } if (isTypifiedElementList(field)) { return decorateTypifiedElementList(loader, field); } if (isHtmlElementList(field)) { return decorateHtmlElementList(loader, field); } if (isWebElementList(field)) { return decorateWebElementList(loader, field); } return null; } catch (ClassCastException ignore) { return null; } }
Source:
public void setCodeMiningProviders(ICodeMiningProvider[] codeMiningProviders) { if (fCodeMiningProviders != null) { for (ICodeMiningProvider contentMiningProvider : fCodeMiningProviders) { contentMiningProvider.dispose(); } } boolean enable= codeMiningProviders != null && codeMiningProviders.length > 0; fCodeMiningProviders= codeMiningProviders; if (enable) { if (fCodeMiningManager != null) { fCodeMiningManager.setCodeMiningProviders(fCodeMiningProviders); } ensureCodeMiningManagerInstalled(); } else { if (fCodeMiningManager != null) { fCodeMiningManager.uninstall(); if (codeMiningProviders == null || codeMiningProviders.length == 0) { fInlinedAnnotationSupport.updateAnnotations(new HashSet<>()); } } fCodeMiningManager= null; } }

Target:
public void setCodeMiningProviders(ICodeMiningProvider[] codeMiningProviders) { if (fCodeMiningProviders != null) { for (ICodeMiningProvider contentMiningProvider : fCodeMiningProviders) { contentMiningProvider.dispose(); } } boolean enable= codeMiningProviders != null && codeMiningProviders.length > 0; fCodeMiningProviders= codeMiningProviders; if (enable) { if (fCodeMiningManager != null) { fCodeMiningManager.setCodeMiningProviders(fCodeMiningProviders); } ensureCodeMiningManagerInstalled(); } else { if (fCodeMiningManager != null) { fCodeMiningManager.uninstall(); } fCodeMiningManager= null; } }
Source:
protected void buildSysprepVmPayload(String strSysPrepContent) { byte[] binarySysPrep; try { binarySysPrep = strSysPrepContent.getBytes(UTF8_CHARSET_ENCODING); } catch (UnsupportedEncodingException e) { throw new RuntimeException("Unsupported charset", e); } createInfo.add(VdsProperties.sysprepInf, binarySysPrep); }

Target:
protected void buildSysprepVmPayload(String strSysPrepContent) { byte[] binarySysPrep; try { binarySysPrep = strSysPrepContent.getBytes(UTF8_CHARSET_ENCODING); } catch (UnsupportedEncodingException e) { throw new RuntimeException("Unsupported charset while building VM sysprep", e); } createInfo.add(VdsProperties.sysprepInf, binarySysPrep); }
Source:
private void deleteEmptyStagingDirectories(List<DeclaredIntentionToWrite> declaredIntentionsToWrite) { for (DeclaredIntentionToWrite declaredIntentionToWrite : declaredIntentionsToWrite) { Path path = declaredIntentionToWrite.getRootPath(); if (declaredIntentionToWrite.isTemporaryTable()) { deleteRecursivelyIfExists(declaredIntentionToWrite.getContext(), hdfsEnvironment, path); continue; } if (declaredIntentionToWrite.getMode() != WriteMode.STAGE_AND_MOVE_TO_TARGET_DIRECTORY) { continue; } recursiveDeleteFilesAndLog(declaredIntentionToWrite.getContext(), path, ImmutableList.of(), true, "staging directory cleanup"); } }

Target:
private void deleteEmptyStagingDirectories(List<DeclaredIntentionToWrite> declaredIntentionsToWrite) { for (DeclaredIntentionToWrite declaredIntentionToWrite : declaredIntentionsToWrite) { if (declaredIntentionToWrite.getMode() != WriteMode.STAGE_AND_MOVE_TO_TARGET_DIRECTORY) { continue; } Path path = declaredIntentionToWrite.getRootPath(); recursiveDeleteFilesAndLog(declaredIntentionToWrite.getContext(), path, ImmutableList.of(), true, "staging directory cleanup"); } }