auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public Response deleteParagraph(@PathParam("noteId") String noteId, @PathParam("paragraphId") String paragraphId) throws IOException { LOG.info("delete paragraph {}", noteId, paragraphId); Note note = notebook.getNote(noteId); checkIfNoteIsNotNull(note); checkIfUserIsOwner(noteId, "Insufficient privileges you cannot remove paragraph from this note"); Paragraph p = note.getParagraph(paragraphId); checkIfParagraphIsNotNull(p); AuthenticationInfo subject = new AuthenticationInfo(SecurityUtils.getPrincipal()); note.removeParagraph(SecurityUtils.getPrincipal(), paragraphId); note.persist(subject); notebookServer.broadcastNote(note); return new JsonResponse(Status.OK, "").build(); }

Target:
public Response deleteParagraph(@PathParam("noteId") String noteId, @PathParam("paragraphId") String paragraphId) throws IOException { LOG.info("delete paragraph {}", noteId, paragraphId); Note note = notebook.getNote(noteId); checkIfNoteIsNotNull(note); checkIfUserCanRead(noteId, "Insufficient privileges you cannot remove paragraph from this note"); Paragraph p = note.getParagraph(paragraphId); checkIfParagraphIsNotNull(p); AuthenticationInfo subject = new AuthenticationInfo(SecurityUtils.getPrincipal()); note.removeParagraph(SecurityUtils.getPrincipal(), paragraphId); note.persist(subject); notebookServer.broadcastNote(note); return new JsonResponse(Status.OK, "").build(); }
Source:
public Object getValue() { if (value == null) { return null; } else { return value; } }

Target:
public Object getValue() { return value; }
Source:
private static List<Interval> breakIntervalAtBandMultiples(final Interval interval, final int bandMultiple) { final List<Interval> brokenUpIntervals = new ArrayList<Interval>(); int startPos = interval.getStart(); int startIndex = startPos / bandMultiple; final int endIndex = interval.getEnd() / bandMultiple; while (startIndex <= endIndex) { int endPos = (startIndex + 1) * bandMultiple -1; if (endPos >= interval.getEnd()) { endPos = interval.getEnd(); } brokenUpIntervals.add(new Interval(interval.getContig(), startPos, endPos, interval.isNegativeStrand(), interval.getName() + "." + startIndex)); startIndex++; startPos = startIndex * bandMultiple; } return brokenUpIntervals; }

Target:
private static List<Interval> breakIntervalAtBandMultiples(final Interval interval, final int bandMultiple) { final List<Interval> brokenUpIntervals = new ArrayList<Interval>(); int startPos = interval.getStart(); int startIndex = startPos / bandMultiple; final int endIndex = interval.getEnd() / bandMultiple; while (startIndex <= endIndex) { int endPos = (startIndex + 1) * bandMultiple -1; if (endPos > interval.getEnd()) { endPos = interval.getEnd(); } brokenUpIntervals.add(new Interval(interval.getContig(), startPos, endPos, interval.isNegativeStrand(), interval.getName() + "." + startIndex)); startIndex++; startPos = startIndex * bandMultiple; } return brokenUpIntervals; }
Source:
public boolean isEnabled() { ISearchResultPage page = getCurrentPage(); return page != null && !BLACKLISTED_IDS.contains(page.getID()); }

Target:
public boolean isEnabled() { ISearchResultPage page = getCurrentPage(); return page != null && WHITELISTED_IDS.contains(page.getID()); }
Source:
public void awaitActiveContexts() throws InterruptedException { activeContextLatch.await(); activeContexts.addAll(pendingTaskSubmissions.values()); for (int i = 0; i < activeContexts.size(); i++) { planEvaluatorIdsToContexts.put(planEvaluatorIds.get(i), activeContexts.get(i)); } }

Target:
public void awaitActiveContexts() { try { activeContextLatch.await(); } catch (final InterruptedException e) { throw new RuntimeException(e); } activeContexts.addAll(pendingTaskSubmissions.values()); for (int i = 0; i < activeContexts.size(); i++) { planEvaluatorIdsToContexts.put(planEvaluatorIds.get(i), activeContexts.get(i)); } }
Source:
public TemplateEngineFreemarkerAuthenticityTokenDirective(Context context) { this.authenticityToken = context.getSession().getAuthenticityToken(); }

Target:
public TemplateEngineFreemarkerAuthenticityTokenDirective(Context context) { this.context = context; }
Source:
private void setShadowBackgroundColor(Graphics graphics) { Color color = null; if (shadowColor != null && !"-1".equals(shadowColor)) { RGBColor rgbColor = CSS2ColorHelper.getRGBColor(shadowColor); if (rgbColor != null) { int red = Integer.parseInt(rgbColor.getRed().toString()); int green = Integer.parseInt(rgbColor.getGreen().toString()); int blue = Integer.parseInt(rgbColor.getBlue().toString()); color = new Color(Display.getCurrent(), new RGB(red, green, blue)); } else { color = ColorRegistry.getInstance().getColor(Integer.valueOf(shadowColor)); } graphics.setBackgroundColor(color); } else { graphics.setBackgroundColor(getForegroundColor()); } }

Target:
private void setShadowBackgroundColor(Graphics graphics) { Color color = null; if (shadowColor != null && !"-1".equals(shadowColor)) { RGBColor rgbColor = CSS2ColorHelper.getRGBColor(shadowColor); if (rgbColor != null) { int red = Integer.parseInt(rgbColor.getRed().toString()); int green = Integer.parseInt(rgbColor.getGreen().toString()); int blue = Integer.parseInt(rgbColor.getBlue().toString()); color = new Color(Display.getCurrent(), new RGB(red, green, blue)); } if (color == null) { try { color = ColorRegistry.getInstance().getColor(Integer.valueOf(shadowColor)); } catch (NumberFormatException e) { } } } if (color != null) { graphics.setBackgroundColor(color); } else { graphics.setBackgroundColor(getForegroundColor()); } }
Source:
public ReadRowsRequest get() { if (cachedRequest == null) { Scan scan = new Scan(); if (start.get() != null && !start.get().isEmpty()) { scan.setStartRow(stop.get().getBytes()); } if (stop.get() != null && !stop.get().isEmpty()) { scan.setStopRow(stop.get().getBytes()); } if (maxVersion.get() != null) { scan.setMaxVersions(maxVersion.get()); } if (filter.get() != null && !filter.get().isEmpty()) { try { scan.setFilter(new ParseFilter().parseFilterString(filter.get())); } catch (CharacterCodingException e) { e.printStackTrace(); throw new RuntimeException(e); } } ReadHooks readHooks = new DefaultReadHooks(); ReadRowsRequest.Builder builder = Adapters.SCAN_ADAPTER.adapt(scan, readHooks); cachedRequest = readHooks.applyPreSendHook(builder.build()); } return cachedRequest; }

Target:
public ReadRowsRequest get() { if (cachedRequest == null) { Scan scan = new Scan(); if (start.get() != null && !start.get().isEmpty()) { scan.setStartRow(start.get().getBytes()); } if (stop.get() != null && !stop.get().isEmpty()) { scan.setStopRow(stop.get().getBytes()); } if (maxVersion.get() != null) { scan.setMaxVersions(maxVersion.get()); } if (filter.get() != null && !filter.get().isEmpty()) { try { scan.setFilter(new ParseFilter().parseFilterString(filter.get())); } catch (CharacterCodingException e) { throw new RuntimeException(e); } } ReadHooks readHooks = new DefaultReadHooks(); ReadRowsRequest.Builder builder = Adapters.SCAN_ADAPTER.adapt(scan, readHooks); cachedRequest = readHooks.applyPreSendHook(builder.build()); } return cachedRequest; }
Source:
public void testMultiplePutsOnSameKey() throws Exception { TestResourceTracker.backgroundTestStarted(this); createStore(); final int number = 100; final int loops = 10000; for (int i = 0; i < loops; i++) { String key = "testMultiplePutsOnSameKey-k"; String value = "testMultiplePutsOnSameKey-v-"; doTestSameKeyPut(number, key, value); doTestSameKeyRemove(key); } }

Target:
public void testMultiplePutsOnSameKey() throws Exception { TestResourceTracker.backgroundTestStarted(this); createStore(); final int number = 1000; String key = "testMultiplePutsOnSameKey-k"; String value = "testMultiplePutsOnSameKey-v-"; doTestSameKeyPut(number, key, value); doTestSameKeyRemove(key); }
Source:
protected void createTable(final DbEntity entity) throws DatabaseEngineException { final String defaultCreateTableStatement = getCreateTableStatement(entity); final String createTableCompressLOBS = getCompressLobsStatements(entity); final String createTableStatement = defaultCreateTableStatement + createTableCompressLOBS; for (final String createTable : ImmutableList.of(createTableStatement, defaultCreateTableStatement)) { try ( Statement statement = conn.createStatement() ) { statement.executeUpdate(createTable); break; } catch (final SQLException ex) { if (ex.getMessage().startsWith(NAME_ALREADY_EXISTS)) { logger.debug(dev, "'{}' is already defined", entity.getName()); handleOperation(new OperationFault(entity.getName(), OperationFault.Type.TABLE_ALREADY_EXISTS), ex); break; } else if (ex.getMessage().startsWith(SECUREFILE_NOT_ASSM)) { logger.warn("Secure file LOBS cannot be used in non-ASSM tablespace. Creating table " + "without compressed lobs"); } else { throw new DatabaseEngineException("Something went wrong handling statement", ex); } } } }

Target:
protected void createTable(final DbEntity entity) throws DatabaseEngineException { final String defaultCreateTableStatement = getCreateTableStatement(entity); final String createTableCompressLOBS = getCompressLobsStatements(entity); final String createTableStatement = defaultCreateTableStatement + createTableCompressLOBS; for (final String createTable : ImmutableList.of(createTableStatement, defaultCreateTableStatement)) { try (final Statement statement = conn.createStatement()) { statement.executeUpdate(createTable); return; } catch (final SQLException ex) { if (ex.getMessage().startsWith(NAME_ALREADY_EXISTS)) { logger.debug(dev, "'{}' is already defined", entity.getName()); handleOperation(new OperationFault(entity.getName(), OperationFault.Type.TABLE_ALREADY_EXISTS), ex); return; } else if (ex.getMessage().startsWith(SECUREFILE_NOT_ASSM)) { logger.warn("Secure file LOBS cannot be used in non-ASSM tablespace. Creating table " + "without compressed lobs"); } else if (ex.getMessage().startsWith(SECUREFILE_LOB_NOT_ENABLED)) { logger.warn("Unsupported LOB type for SECUREFILE LOB operation. Creating table " + "without compressed lobs"); } else if (ex.getMessage().startsWith(COMPRESSION_NOT_ENABLED)) { logger.warn("Feature not enabled: Advanced Compression. Creating table " + "without compressed lobs"); } else { throw new DatabaseEngineException("Something went wrong handling statement", ex); } } } }
Source:
@Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT); }

Target:
@TargetApi(18) @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setRequestedOrientation(Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR2 ? ActivityInfo.SCREEN_ORIENTATION_USER_PORTRAIT : ActivityInfo.SCREEN_ORIENTATION_PORTRAIT); }
Source:
public KualiDecimal getTotalAmountBilledToDate() { KualiDecimal total = KualiDecimal.ZERO; for (InvoiceAccountDetail accountDetail : accountDetails) { total = total.add(accountDetail.getAdjustedCumExpenditures()); } return total; }

Target:
public KualiDecimal getTotalAmountBilledToDate() { KualiDecimal total = KualiDecimal.ZERO; for (InvoiceAccountDetail accountDetail : accountDetails) { total = total.add(accountDetail.getTotalAmountBilledToDate()); } return total; }
Source:
private static List<SourceMethod> filterCandidatesByType(Method method, List<SourceMethod> callbackMethods, Map<SourceMethod, List<Parameter>> parameterAssignmentsForSourceMethod, MappingBuilderContext ctx) { List<SourceMethod> candidates = new ArrayList<SourceMethod>(); List<Parameter> availableParams = getAvailableParameters( method, ctx ); for ( SourceMethod callback : callbackMethods ) { List<Parameter> parameterAssignments = ParameterAssignmentUtil.getParameterAssignments( availableParams, callback.getParameters() ); if ( parameterAssignments != null && callback.matches( extractSourceTypes( parameterAssignments ), method.getResultType() ) && ( callback.getReturnType().isVoid() || callback.getReturnType().isTypeVar() || callback.getReturnType().isAssignableTo( method.getResultType() ) ) ) { parameterAssignmentsForSourceMethod.put( callback, parameterAssignments ); candidates.add( callback ); } } return candidates; }

Target:
private static List<SourceMethod> filterCandidatesByType(Method method, List<SourceMethod> callbackMethods, Map<SourceMethod, List<Parameter>> parameterAssignmentsForSourceMethod, MappingBuilderContext ctx) { List<SourceMethod> candidates = new ArrayList<SourceMethod>(); List<Parameter> availableParams = getAvailableParameters( method, ctx ); for ( SourceMethod callback : callbackMethods ) { List<Parameter> parameterAssignments = ParameterAssignmentUtil.getParameterAssignments( availableParams, callback.getParameters() ); if ( isValidCandidate( callback, method, parameterAssignments ) ) { parameterAssignmentsForSourceMethod.put( callback, parameterAssignments ); candidates.add( callback ); } } return candidates; }
Source:
public void cleanupOrphanedTransactions() { log.tracef("About to cleanup orphaned transactions older than %ld ms", configuration.transaction().completedTxTimeout()); long beginning = System.nanoTime(); Set<GlobalTransaction> toKill = new HashSet<GlobalTransaction>(); for(Map.Entry<GlobalTransaction, RemoteTransaction> e : remoteTransactions.entrySet()) { GlobalTransaction gt = e.getKey(); RemoteTransaction remoteTx = e.getValue(); log.tracef("Checking transaction %s", gt); long txTimestamp = beginning - remoteTx.getCreationTime(); if (txTimestamp >= TimeUnit.MILLISECONDS.toNanos(configuration.transaction().completedTxTimeout())) { toKill.add(gt); } } for(Map.Entry<GlobalTransaction, LocalTransaction> e : globalToLocalTransactions.entrySet()) { GlobalTransaction gt = e.getKey(); LocalTransaction localTx = e.getValue(); log.tracef("Checking transaction %s", gt); long txTimestamp = beginning - localTx.getCreationTime(); if (txTimestamp >= TimeUnit.MILLISECONDS.toNanos(configuration.transaction().completedTxTimeout())) { toKill.add(gt); } } rollbackStaleTransactions(toKill); }

Target:
public void cleanupOrphanedTransactions() { log.tracef("About to cleanup orphaned transactions older than %ld ms", configuration.transaction().completedTxTimeout()); long beginning = timeService.time(); long orphanedTxTimestamp = beginning - TimeUnit.MILLISECONDS.toNanos(configuration.transaction().completedTxTimeout()); Set<GlobalTransaction> toKill = new HashSet<GlobalTransaction>(); for(Map.Entry<GlobalTransaction, RemoteTransaction> e : remoteTransactions.entrySet()) { GlobalTransaction gt = e.getKey(); RemoteTransaction remoteTx = e.getValue(); if(remoteTx != null) { log.tracef("Checking transaction %s", gt); if (remoteTx.getCreationTime() < orphanedTxTimestamp) { long duration = timeService.timeDuration(remoteTx.getCreationTime(), beginning, TimeUnit.MILLISECONDS); log.warnf("Found and rolling back orphaned transaction: %s. Age %d millis", gt, duration); toKill.add(gt); } } } rollbackStaleTransactions(toKill); }
Source:
public void onBackPressed() { if (!shouldShowDualPane) { if (isDrawerOpen()) { toggleNavigationDrawer(false); } } if (navigationDrawer.fetchDefaultPosition() != navigationDrawer.getCheckedItemPosition()) { navigationDrawer.checkDefaultItemPosition(); return; } super.onBackPressed(); }

Target:
public void onBackPressed() { if (!shouldShowDualPane && isDrawerOpen()) { toggleNavigationDrawer(false); } if (navigationDrawer.fetchDefaultPosition() != navigationDrawer.getCheckedItemPosition()) { navigationDrawer.checkDefaultItemPosition(); return; } super.onBackPressed(); }
Source:
@Test public void testPushAggregateThroughtOuterJoin8() { final HepProgram preProgram = new HepProgramBuilder() .addRuleInstance(AggregateProjectMergeRule.INSTANCE) .build(); final HepProgram program = new HepProgramBuilder() .addRuleInstance(AggregateJoinTransposeRule.EXTENDED) .build(); final String sql = "select d.name\n" + "from (select * from sales.emp where empno = 10) as e\n" + "join sales.dept as d on e.job = d.name\n" + "and e.deptno + e.empno = d.deptno + 5\n" + "group by d.name"; checkPlanning(tester, preProgram, new HepPlanner(program), sql); }

Target:
@Test public void testPushAggregateThroughtOuterJoin8() { final HepProgram preProgram = new HepProgramBuilder() .addRuleInstance(AggregateProjectMergeRule.INSTANCE) .build(); final HepProgram program = new HepProgramBuilder() .addRuleInstance(AggregateJoinTransposeRule.EXTENDED) .build(); final String sql = "select d.name\n" + "from (select * from sales.emp where empno = 10) as e\n" + "left outer join sales.dept as d on e.job = d.name\n" + "and e.deptno + e.empno = d.deptno + 5\n" + "group by d.name"; checkPlanning(tester, preProgram, new HepPlanner(program), sql); }
Source:
protected Boolean authSAS(@org.jclouds.location.Provider Supplier<Credentials> creds) { String credential = creds.get().credential; return credential.matches("sv.*se.*sig.*"); }

Target:
protected boolean authSAS(@org.jclouds.location.Provider Supplier<Credentials> creds) { String credential = creds.get().credential; String formattedCredential = credential.startsWith("?") ? credential.substring(1) : credential; List<String> required = ImmutableList.of("sv", "se", "sig", "sp"); try { Map<String, String> tokens = Splitter.on('&').withKeyValueSeparator('=').split(formattedCredential); return all(required, in(tokens.keySet())); } catch (Exception ex) { return false; } }
Source:
private String getName(URL url) { String name = url.getPath(); if (name != null) { { final int j = name.lastIndexOf(File.pathSeparatorChar); if (j >= 0) name = name.substring(j + 1); } if (File.pathSeparatorChar != '/') { final int j = name.lastIndexOf('/'); if (j >= 0) name = name.substring(j + 1); } } return name; }

Target:
private String getName(URL url) { String name = url.getPath(); if (name != null) { final int i = name.lastIndexOf(File.pathSeparatorChar); if (i >= 0) name = name.substring(i + 1); if (File.pathSeparatorChar != '/') { final int j = name.lastIndexOf('/'); if (j >= 0) name = name.substring(j + 1); } } return name; }
Source:
public void checkSourceDirectory(String path, String expected) throws IOException, XmlPullParserException { SpoonPom pomModel = new SpoonPom(path, null, MavenLauncher.SOURCE_TYPE.APP_SOURCE, new StandardEnvironment()); SpoonPom childModel = pomModel.getModules().get(0); assertEquals(expected, childModel.getSourceDirectories().get(0).getAbsolutePath(), expected); }

Target:
public void checkSourceDirectory(String path, String expected) throws IOException, XmlPullParserException { SpoonPom pomModel = new SpoonPom(path, null, MavenLauncher.SOURCE_TYPE.APP_SOURCE, new StandardEnvironment()); SpoonPom childModel = pomModel.getModules().get(0); assertEquals(expected, childModel.getSourceDirectories().get(0).getAbsolutePath()); }
Source:
public void testOwnerProject() { grant(true, OWN, admin, "refs/*", 1); ProjectControl uBlah = user(devs); ProjectControl uAdmin = user(devs, admin); assertFalse("not owner", uBlah.isOwner()); assertTrue("is owner", uAdmin.isOwner()); }

Target:
public void testOwnerProject() { grant(local, OWN, admin, "refs/*", 1); ProjectControl uBlah = user(devs); ProjectControl uAdmin = user(devs, admin); assertFalse("not owner", uBlah.isOwner()); assertTrue("is owner", uAdmin.isOwner()); }
Source:
private void mergeValue() throws Exception { String key = parser.getKey(); String value = parser.getValue(); String version = parser.getVersion(); if (version == null) { version = startVersionDialog(key); } ConfigKey configKey = fetchConfigKey(key, version); if (configKey != null && configKey.getKey() != null) { if (!configKey.isPasswordKey() && configKey.getDisplayValue().trim().length() > 0) { String val = configKey.getDisplayValue(); if (!val.endsWith(";")) { val += ";"; } val += value; value = val; } } boolean sucessUpdate = persist(key, value, version); if (!sucessUpdate) { log.debug("setValue: error concatenating " + key + "'s value. No such entry" + (version == null ? "" : " with version " + version) + "."); throw new IllegalArgumentException("Error setting " + key + "'s value. No such entry" + (version == null ? "" : " with version " + version) + "."); } }

Target:
private void mergeValue() throws Exception { String key = parser.getKey(); String value = parser.getValue(); if(!keysConfig.getBoolean(key + "/" + MERGABLE_TOKEN, false)) { console.writeFormat(MERGE_NOT_SUPPORTED_MSG, key); console.writeLine(); return; } String version = parser.getVersion(); if (version == null) { version = startVersionDialog(key); } ConfigKey configKey = fetchConfigKey(key, version); if (configKey != null && configKey.getKey() != null && configKey.getDisplayValue().trim().length() > 0) { String valueInDb = configKey.getDisplayValue().trim(); String delimiter = keysConfig.getString(key + "/" + DELIMITER_TOKEN, ";"); value = concatenatedValues(value, valueInDb, delimiter); if(valueInDb.equals(value)) { console.writeFormat(MERGE_SAME_VALUE_MSG); console.writeLine(); return; } } if (!persist(key, value, version)) { log.debug("setValue: error concatenating " + key + "'s value. No such entry" + (version == null ? "" : " with version " + version) + "."); throw new IllegalArgumentException("Error setting " + key + "'s value. No such entry" + (version == null ? "" : " with version " + version) + "."); } }
Source:
public void testTokenValueIncorrect() { final Integer id = 184; try { TokenUtils.getTokenName(id); fail("IllegalArgumentException is expected"); } catch (IllegalArgumentException expected) { assertEquals("given id " + id, expected.getMessage()); } }

Target:
public void testTokenValueIncorrect() throws IllegalAccessException { int maxId = 0; final Field[] fields = TokenTypes.class.getDeclaredFields(); for (final Field field : fields) { if (field.getType() != Integer.TYPE) { continue; } final String name = field.getName(); final int id = field.getInt(name); if (id > maxId) { maxId = id; } } final int nextAfterMaxId = maxId + 1; try { TokenUtils.getTokenName(nextAfterMaxId); fail("IllegalArgumentException is expected"); } catch (IllegalArgumentException expected) { assertEquals("given id " + nextAfterMaxId, expected.getMessage()); } }
Source:
private void configureCluster(Settings.Builder builder) { int replicationFactor = props.valueAsInt(ProcessProperties.SEARCH_REPLICAS, 0); int minimumMasterNodes = props.valueAsInt(ProcessProperties.SEARCH_MINIMUM_MASTER_NODES, 1); String initialStateTimeOut = readInitialStateTimeout(); if (clusterEnabled) { if (!props.contains(ProcessProperties.SEARCH_REPLICAS)) { replicationFactor = 1; } if (!props.contains(ProcessProperties.SEARCH_MINIMUM_MASTER_NODES)) { minimumMasterNodes = 2; } if (!props.contains(ProcessProperties.SEARCH_INITIAL_STATE_TIMEOUT)) { initialStateTimeOut = "120s"; } String hosts = props.value(ProcessProperties.CLUSTER_SEARCH_HOSTS, ""); LOGGER.info("Elasticsearch cluster enabled. Connect to hosts [{}]", hosts); builder.put("discovery.zen.ping.unicast.hosts", hosts); } builder.put("discovery.zen.minimum_master_nodes", minimumMasterNodes) .put("discovery.initial_state_timeout", initialStateTimeOut) .put(IndexMetaData.SETTING_NUMBER_OF_REPLICAS, replicationFactor) .put("cluster.name", getClusterName()) .put("cluster.routing.allocation.awareness.attributes", "rack_id") .put("node.rack_id", nodeName) .put("node.name", nodeName) .put("node.data", true) .put("node.master", true); }

Target:
private void configureCluster(Settings.Builder builder) { int replicationFactor = 0; int minimumMasterNodes = 1; String initialStateTimeOut = "30s"; if (clusterEnabled) { replicationFactor = props.valueAsInt(ProcessProperties.SEARCH_REPLICAS, 1); minimumMasterNodes = props.valueAsInt(ProcessProperties.SEARCH_MINIMUM_MASTER_NODES, 2); initialStateTimeOut = props.value(ProcessProperties.SEARCH_INITIAL_STATE_TIMEOUT, "120s"); String hosts = props.value(ProcessProperties.CLUSTER_SEARCH_HOSTS, ""); LOGGER.info("Elasticsearch cluster enabled. Connect to hosts [{}]", hosts); builder.put("discovery.zen.ping.unicast.hosts", hosts); } builder.put("discovery.zen.minimum_master_nodes", minimumMasterNodes) .put("discovery.initial_state_timeout", initialStateTimeOut) .put(IndexMetaData.SETTING_NUMBER_OF_REPLICAS, replicationFactor) .put("cluster.name", getClusterName()) .put("cluster.routing.allocation.awareness.attributes", "rack_id") .put("node.rack_id", nodeName) .put("node.name", nodeName) .put("node.data", true) .put("node.master", true); }
Source:
T get() throws Exception; } private boolean isFormJSONValid(FormTemplate jsonInFormTemplate) { String jsonString = GSON.toJson(jsonInFormTemplate); if (isJSONValid(jsonString)) { return true; } LOGGER.debug("Invalid JSON found: {}", jsonString); return false; }

Target:
T get() throws Exception; } private boolean isFormJSONValid(FormTemplate formTemplate) { String jsonString = GSON.toJson(formTemplate); if (isJSONValid(jsonString)) { return true; } LOGGER.warn("Filtered out invalid JSON"); LOGGER.debug("Invalid JSON: {}", jsonString); return false; }
Source:
public BindFBO(String fboName) { this.fboName = fboName; if (fboName.equals(DEFAULT_FRAME_BUFFER_NAME)) { fboId = DEFAULT_FRAME_BUFFER_ID; } else { fboId = frameBuffersManager.getFBO(fboName).fboId; } }

Target:
public BindFBO(String fboName) { this.fboName = fboName; }
Source:
protected final void onInit() { if (this.getBeanFactory() != null) { this.messagingTemplate.setBeanFactory(getBeanFactory()); if (StringUtils.hasText(this.outputChannelName)) { Assert.isNull(this.outputChannel, "'outputChannelName' and 'outputChannel' are mutually exclusive."); this.outputChannel = this.getBeanFactory().getBean(this.outputChannelName, MessageChannel.class); } } if (!CollectionUtils.isEmpty(this.adviceChain)) { ProxyFactory proxyFactory = new ProxyFactory(new AdvisedRequestHandler()); for (Advice advice : this.adviceChain) { proxyFactory.addAdvice(advice); } this.advisedRequestHandler = (RequestHandler) proxyFactory.getProxy(this.beanClassLoader); } this.doInit(); }

Target:
protected final void onInit() { if (this.getBeanFactory() != null) { this.messagingTemplate.setBeanFactory(getBeanFactory()); if (StringUtils.hasText(this.outputChannelName)) { Assert.isNull(this.outputChannel, "'outputChannelName' and 'outputChannel' are mutually exclusive."); try { this.outputChannel = this.getBeanFactory().getBean(this.outputChannelName, MessageChannel.class); } catch (BeansException e) { throw new DestinationResolutionException("Failed to look up MessageChannel with name '" + this.outputChannelName + "' in the BeanFactory."); } } } if (!CollectionUtils.isEmpty(this.adviceChain)) { ProxyFactory proxyFactory = new ProxyFactory(new AdvisedRequestHandler()); for (Advice advice : this.adviceChain) { proxyFactory.addAdvice(advice); } this.advisedRequestHandler = (RequestHandler) proxyFactory.getProxy(this.beanClassLoader); } this.doInit(); }
Source:
public void testNoLeaksAfterShutdown() { withRemoteCacheManager(new RemoteCacheManagerCallable(getRemoteCacheManager()) { @Override public void call() { RemoteCache<Integer, String> remote = rcm.getCache(); EventLogListener<Integer> eventListener = new EventLogListener<>(); remote.addClientListener(eventListener); eventListener.expectNoEvents(); remote.put(1, "one"); eventListener.expectOnlyCreatedEvent(1, cache()); } }); detectThreadLeaks(".*Client-Listener.*"); }

Target:
public void testNoLeaksAfterShutdown() { withRemoteCacheManager(new RemoteCacheManagerCallable(getRemoteCacheManager()) { @Override public void call() { RemoteCache<Integer, String> remote = rcm.getCache(cacheName); EventLogListener<Integer> eventListener = new EventLogListener<>(); remote.addClientListener(eventListener); eventListener.expectNoEvents(); remote.put(1, "one"); eventListener.expectOnlyCreatedEvent(1, cache(cacheName)); } }); detectThreadLeaks(".*Client-Listener-ClientListenerLeakTest-.*"); }
Source:
public void testPermissionsException() { try { Map<String, EnumSet<Permissions>> userPerms = db.getPermissions(); Assume.assumeTrue(false); }catch(UnsupportedOperationException e){ } }

Target:
public void testPermissionsException() { Map<String, EnumSet<Permissions>> userPerms = db.getPermissions(); }
Source:
public void requestBannerAd(Context context, MediationBannerListener mediationBannerListener, Bundle serverParameters, AdSize adSize, MediationAdRequest mediationAdRequest, Bundle networkExtras) { mContext = context; mMediationBannerListener = mediationBannerListener; mChartboostParams = ChartboostAdapterUtils.createChartboostParams( serverParameters, networkExtras); if (!ChartboostAdapterUtils.isValidChartboostParams(mChartboostParams)) { if (mMediationBannerListener != null) { mMediationBannerListener.onAdFailedToLoad( ChartboostAdapter.this, AdRequest.ERROR_CODE_INVALID_REQUEST); } return; } BannerSize supportedAdSize = chartboostAdSizeFromLocalExtras(context, adSize); if (supportedAdSize == null) { mMediationBannerListener.onAdFailedToLoad(ChartboostAdapter.this, ERROR_BANNER_SIZE_MISMATCH); return; } isAdLoaded.set(false); mChartboostParams.setBannerSize(supportedAdSize); ChartboostSingleton.startChartboostBanner( context, mChartboostBannerDelegate, this); }

Target:
public void requestBannerAd(Context context, MediationBannerListener mediationBannerListener, Bundle serverParameters, AdSize adSize, MediationAdRequest mediationAdRequest, Bundle networkExtras) { mContext = context; mMediationBannerListener = mediationBannerListener; mChartboostParams = ChartboostAdapterUtils.createChartboostParams( serverParameters, networkExtras); if (!ChartboostAdapterUtils.isValidChartboostParams(mChartboostParams)) { if (mMediationBannerListener != null) { mMediationBannerListener.onAdFailedToLoad( ChartboostAdapter.this, AdRequest.ERROR_CODE_INVALID_REQUEST); } return; } BannerSize supportedAdSize = chartboostAdSizeFromLocalExtras(context, adSize); if (supportedAdSize == null) { mMediationBannerListener.onAdFailedToLoad(ChartboostAdapter.this, ERROR_BANNER_SIZE_MISMATCH); return; } mChartboostParams.setBannerSize(supportedAdSize); ChartboostSingleton.startChartboostBanner( context, mChartboostBannerDelegate, this); }
Source:
public void getBeacon(final ScanEvent scanEvent, SortedMap<String, String> attributes, final BeaconResponseHandler beaconResponseHandler) { String networkInfo = NetworkInfoBroadcastReceiver.latestNetworkInfo != null ? NetworkInfoBroadcastReceiver.getNetworkInfoString() : ""; getApiService() .getBeacon(scanEvent.getBeaconId().getPid(), networkInfo, attributes) .enqueue(new Callback<ResolveResponse>() { @Override public void onResponse(Call<ResolveResponse> call, Response<ResolveResponse> response) { if (response.isSuccessful() && response.body() != null) { save(response.body()); onSuccess(response.body()); } else { onFail(new Throwable("No Content, Invalid Api Key")); } } @Override public void onFailure(Call<ResolveResponse> call, Throwable t) { onFail(t); } void onSuccess(ResolveResponse resolveResponse) { List<BeaconEvent> beaconEvents = checkSuccessfulBeaconResponse(scanEvent, resolveResponse); beaconResponseHandler.onSuccess(beaconEvents); checkShouldCallBeaconResponseHandlers(resolveResponse); } void onFail(Throwable t) { if (lastSuccess == null) { beaconResponseHandler.onFailure(t); } else { onSuccess(lastSuccess); } } }); }

Target:
public void getBeacon(final ScanEvent scanEvent, SortedMap<String, String> attributes, final BeaconResponseHandler beaconResponseHandler) { String networkInfo = NetworkInfoBroadcastReceiver.latestNetworkInfo != null ? NetworkInfoBroadcastReceiver.getNetworkInfoString() : ""; getApiService() .getBeacon(scanEvent.getBeaconId().getPid(), networkInfo, attributes) .enqueue(new Callback<ResolveResponse>() { @Override public void onResponse(Call<ResolveResponse> call, Response<ResolveResponse> response) { if (response.isSuccessful() && response.body() != null) { save(response.body()); onSuccess(response.body()); } else { onFail(new Throwable("No Content, Invalid Api Key")); } } @Override public void onFailure(Call<ResolveResponse> call, Throwable t) { onFail(t); } void onSuccess(ResolveResponse resolveResponse) { List<BeaconEvent> beaconEvents = checkSuccessfulBeaconResponse(scanEvent, resolveResponse); beaconResponseHandler.onSuccess(beaconEvents); checkShouldCallBeaconResponseHandlers(resolveResponse); } void onFail(Throwable t) { if (lastSuccess == null) { beaconResponseHandler.onFailure(t); } else { Logger.log.logError("resolution failed, but we have a backup:" + scanEvent.getBeaconId().toTraditionalString(), t); onSuccess(lastSuccess); } } }); }
Source:
public ItemType getItemType() { return ItemTypeRegistryModule.getInstance().getById( this.statId.substring(this.statId.lastIndexOf('.') + 1)).get(); }

Target:
public ItemType getItemType() { return ItemTypeRegistryModule.getInstance().get( CatalogKey.resolve(this.statId.substring(this.statId.lastIndexOf('.') + 1))).get(); }
Source:
private void addTask(VDSReturnValue vdsReturnValue, boolean isRevertedTask) { AsyncTaskCreationInfo taskCreationInfo = vdsReturnValue.getCreationInfo(); getReturnValue().getInternalTaskIdList().add(cmd.createTask( taskCreationInfo, cmd.getActionType(), getTaskObjectType(), getTaskObjects()) ); Guid taskId = taskCreationInfo.getTaskID(); getReturnValue().getTaskIdList().add(taskId); if (isRevertedTask) { log.infoFormat("Reverted task ID is {0}.", taskId); } }

Target:
private void addTask(VDSReturnValue vdsReturnValue, boolean isRevertedTask) { AsyncTaskCreationInfo taskCreationInfo = vdsReturnValue.getCreationInfo(); getReturnValue().getInternalTaskIdList().add(cmd.createTask( taskCreationInfo, cmd.getActionType(), getTaskObjectType(), getTaskObjects()) ); Guid taskId = taskCreationInfo.getTaskID(); getReturnValue().getTaskIdList().add(taskId); if (isRevertedTask) { log.infoFormat("Reverting task {0} with ID {1} on DataCenter {2}.", taskCreationInfo.getTaskType().name(), taskId, taskCreationInfo.getStoragePoolID()); } }
Source:
public Node visitInsert(SqlBaseParser.InsertContext context) { List<String> columns = identsToStrings(context.ident()); Table table; try { table = (Table) visit(context.table()); } catch (ClassCastException e) { TableFunction tf = (TableFunction) visit(context.table()); for (Expression ex : tf.functionCall().getArguments()) { if (!(ex instanceof QualifiedNameReference)) { throw new IllegalArgumentException(String.format(Locale.ENGLISH, "invalid table column reference %s", ex.toString())); } } throw e; } Node subquery = visit(context.insertSource().query()); return new Insert<>( table, subquery == null ? null : (Query) subquery, columns, createDuplicateKeyContext(context)); }

Target:
public Node visitInsert(SqlBaseParser.InsertContext context) { List<String> columns = identsToStrings(context.ident()); Table table; try { table = (Table) visit(context.table()); } catch (ClassCastException e) { TableFunction tf = (TableFunction) visit(context.table()); for (Expression ex : tf.functionCall().getArguments()) { if (!(ex instanceof QualifiedNameReference)) { throw new IllegalArgumentException(String.format(Locale.ENGLISH, "invalid table column reference %s", ex.toString())); } } throw e; } return new Insert( table, (Query) visit(context.insertSource().query()), columns, createDuplicateKeyContext(context)); }
Source:
public URN owner() { try { return URN.create( new JdkRequest(UriBuilder.fromUri(this.home).build()) .header(HttpHeaders.ACCEPT, MediaType.APPLICATION_XML) .header(HttpHeaders.AUTHORIZATION, this.token) .method(Request.GET) .fetch() .as(RestResponse.class) .assertStatus(HttpURLConnection.HTTP_OK) .as(XmlResponse.class) .xml() .xpath("/page/identity/urn/text()") .get(0) ); } catch (IOException ex) { throw new IllegalStateException(ex); } }

Target:
public URN owner() { try { return URN.create( new JdkRequest(this.home) .header(HttpHeaders.ACCEPT, MediaType.APPLICATION_XML) .header(HttpHeaders.AUTHORIZATION, this.token) .fetch() .as(RestResponse.class) .assertStatus(HttpURLConnection.HTTP_OK) .as(XmlResponse.class) .xml() .xpath("/page/identity/urn/text()") .get(0) ); } catch (IOException ex) { throw new IllegalStateException(ex); } }
Source:
protected synchronized void close(final Exception cause) { lock.lock(); queueMap.values().parallelStream() .filter(Objects::nonNull) .forEach(queue -> queue.offer(POISON_PILL)); queueMap.clear(); lock.unlock(); super.close(cause); }

Target:
protected void close(final Exception cause) { synchronized (this) { queueMap.values().parallelStream() .filter(Objects::nonNull) .forEach(queue -> queue.offer(POISON_PILL)); queueMap.clear(); } super.close(cause); }
Source:
public static int getSizeInBytes() { return 2 + 1 + 4 + 1 + 12 + 300; }

Target:
public static int getSizeInBytes() { return PairedReadSequence.getSizeInBytes() + (3 * 4); }
Source:
public void info(PrintStream out) { if (clusterId != null) { out.println("Minimesos cluster is running: " + clusterId); out.println("Mesos version: " + clusterConfig.getMesosVersion()); printServiceUrls(out); } }

Target:
public void info(PrintStream out) { if (clusterId != null) { out.println("Minimesos cluster is running: " + clusterId); if (getMesosVersion() != null) { out.println("Mesos version: " + clusterConfig.getMesosVersion()); } printServiceUrls(out); } }
Source:
public void testSwitchToFilter() { final Rectangle cellBounds = SWTBotUtils.getCellBounds(fTableBot.widget, ROW, 1); ImageHelper before = ImageHelper.getScreenGrab(cellBounds); fTableBot.click(0, 1); fBot.text().typeText("00\n", 100); fTableBot.select(4); ImageHelper after = ImageHelper.getScreenGrab(cellBounds); fTableBot.click(0, 0); ImageHelper afterFilter = ImageHelper.getScreenGrab(cellBounds); fTableBot.click(0, 0); List<RGB> beforeLine = before.getPixelRow(2); List<RGB> afterLine = after.getPixelRow(2); List<RGB> afterFilterLine = afterFilter.getPixelRow(2); assertEquals(beforeLine.size(), afterLine.size()); assertEquals(beforeLine.size(), afterFilterLine.size()); for (int i = 0; i < beforeLine.size(); i++) { RGB afterFilterPixel = afterFilterLine.get(i); RGB beforePixel = beforeLine.get(i); RGB afterPixel = afterLine.get(i); assertEquals(beforePixel, afterFilterPixel); if (!afterPixel.equals(YELLOW)) { assertEquals(beforePixel, afterPixel); } else { assertNotEquals(YELLOW, beforePixel); } } assertEquals(beforeLine, afterFilterLine); assertNotEquals(afterLine, beforeLine); }

Target:
public void testSwitchToFilter() { final Rectangle cellBounds = SWTBotUtils.getCellBounds(fTableBot.widget, ROW, TIMESTAMP_COLUMN); ImageHelper before = ImageHelper.getScreenGrab(cellBounds); fTableBot.click(0, TIMESTAMP_COLUMN); fBot.text().typeText("00\n", 100); fTableBot.select(ROW - 1); ImageHelper after = ImageHelper.getScreenGrab(cellBounds); fTableBot.click(0, 0); ImageHelper afterFilter = ImageHelper.getScreenGrab(cellBounds); fTableBot.click(0, 0); List<RGB> beforeLine = before.getPixelRow(2); List<RGB> afterLine = after.getPixelRow(2); List<RGB> afterFilterLine = afterFilter.getPixelRow(2); assertEquals(beforeLine.size(), afterLine.size()); assertEquals(beforeLine.size(), afterFilterLine.size()); for (int i = 0; i < beforeLine.size(); i++) { RGB afterFilterPixel = afterFilterLine.get(i); RGB beforePixel = beforeLine.get(i); RGB afterPixel = afterLine.get(i); assertEquals(beforePixel, afterFilterPixel); if (!afterPixel.equals(YELLOW)) { assertEquals(beforePixel, afterPixel); } else { assertNotEquals(YELLOW, beforePixel); } } assertEquals(beforeLine, afterFilterLine); assertNotEquals(afterLine, beforeLine); }
Source:
public Collection<PotionEffect> getEffectList() { return effectList; }

Target:
public Collection<PotionEffect> getEffectList() { return Collections.unmodifiableCollection(effectList); }
Source:
public boolean equals(Object obj) { if (this == obj) { return true; } if (!super.equals(obj)) { return false; } if (!(obj instanceof CustomEvent)) { return false; } CustomEvent other = (CustomEvent) obj; if (fDefinition == null) { if (other.fDefinition != null) { return false; } } else if (!fDefinition.equals(other.fDefinition)) { return false; } return true; }

Target:
public boolean equals(Object obj) { if (this == obj) { return true; } if (!super.equals(obj)) { return false; } if (!(obj instanceof CustomEvent)) { return false; } CustomEvent other = (CustomEvent) obj; if (fDefinition == null) { if (other.fDefinition != null) { return false; } } else if (!fDefinition.equals(other.fDefinition)) { return false; } if (customEventTimestamp == null) { if (other.customEventTimestamp != null) { return false; } } else if (!customEventTimestamp.equals(other.customEventTimestamp)) { return false; } if (customEventContent == null) { if (other.customEventContent != null) { return false; } } else if (!customEventContent.equals(other.customEventContent)) { return false; } if (customEventType == null) { if (other.customEventType != null) { return false; } } else if (!customEventType.equals(other.customEventType)) { return false; } return true; }
Source:
public static void process(String label, BufferedReader in) throws IOException { processFile(label, in); }

Target:
public static void process(String label, BufferedReader in) throws IOException { validate(in, label); }
Source:
public DatabaseJoinData() { super(); notfound = null; }

Target:
public DatabaseJoinData() { super(); }
Source:
public Aggregator factorize(ColumnSelectorFactory metricFactory) { return new LongLastAggregator( name, metricFactory.makeLongColumnSelector(fieldName), metricFactory.makeLongColumnSelector(Column.TIME_COLUMN_NAME) ); }

Target:
public Aggregator factorize(ColumnSelectorFactory metricFactory) { return new LongLastAggregator( name, metricFactory.makeLongColumnSelector(Column.TIME_COLUMN_NAME), metricFactory.makeLongColumnSelector(fieldName) ); }
Source:
private Schema(@JsonProperty("id") final String id, @JsonProperty("url") final URI url, @JsonProperty("links") final Map<String, String> links, @JsonProperty("last_created") final String lastCreated, @JsonProperty("last_version") final Integer lastVersion) { this.id = id; this.url = url; this.links = links; this.lastCreated = ZonedDateTime.parse(lastCreated); this.lastVersion = lastVersion; }

Target:
private Schema(@JsonProperty("id") final String id, @JsonProperty("url") final URI url, @JsonProperty("links") final Map<String, String> links, @JsonProperty("last_created") final String lastCreated, @JsonProperty("last_version") final Integer lastVersion) { this.id = id; this.url = url; this.links = links; this.lastCreated = DateConverter.iso8601DateTimeFromString(lastCreated); this.lastVersion = lastVersion; }
Source:
private Map<Guid, Guid> loadImageGroupsIdsIfNeeded() { List<Guid> requiredDisks = new ArrayList<>(); for (VmInternalData vmInternalData : _runningVms.values()) { for (DiskImageDynamic disk : vmInternalData.getVmDynamic().getDisks()) { requiredDisks.add(disk.getId()); } } if (_vdsManager.getRefreshStatistics()) return getDbFacade().getImageDao().getImageGroupIdMapForImageList(requiredDisks); return new HashMap<>(); }

Target:
private Map<Guid, Guid> loadImageGroupsIdsIfNeeded() { if (_vdsManager.getRefreshStatistics()) { Set<Guid> requiredDisks = new HashSet<>(); for (VmInternalData vmInternalData : _runningVms.values()) { for (DiskImageDynamic disk : vmInternalData.getVmDynamic().getDisks()) { requiredDisks.add(disk.getId()); } } return getDbFacade().getImageDao().getImageGroupIdMapForImageList(requiredDisks); } return Collections.emptyMap(); }
Source:
public long getTimeOut(AbstractBuild<?, ?> build, BuildListener listener) throws InterruptedException, MacroEvaluationException, IOException { double elasticTimeout = getElasticTimeout(Integer.parseInt(expandAll(build,listener,getTimeoutPercentage())), build, listener); if (elasticTimeout == 0) { if (isFailSafeTimeoutDuration()) { return Math.max(Integer.parseInt(getTimeoutMinutesElasticDefault()) * 60 * 1000, Integer.parseInt(expandAll(build, listener, getTimeoutMinutesElasticDefault())) * MINUTES); } else { return Math.max(MINIMUM_TIMEOUT_MILLISECONDS, Integer.parseInt(expandAll(build, listener, getTimeoutMinutesElasticDefault())) * MINUTES); } } else { if (isFailSafeTimeoutDuration()) { return Math.max(Integer.parseInt(getTimeoutMinutesElasticDefault()) * 60 * 1000, (long) elasticTimeout); } else { return (long) Math.max(MINIMUM_TIMEOUT_MILLISECONDS, elasticTimeout); } } }

Target:
public long getTimeOut(AbstractBuild<?, ?> build, BuildListener listener) throws InterruptedException, MacroEvaluationException, IOException { double elasticTimeout = getElasticTimeout(Integer.parseInt(expandAll(build,listener,getTimeoutPercentage())), build, listener); if (elasticTimeout == 0) { return Math.max(MINIMUM_TIMEOUT_MILLISECONDS, Integer.parseInt(expandAll(build, listener, getTimeoutMinutesElasticDefault())) * MINUTES); } else { if (isFailSafeTimeoutDuration()) { return Math.max(Integer.parseInt(expandAll(build, listener, getTimeoutMinutesElasticDefault())) * MINUTES, (long) elasticTimeout); } else { return (long) Math.max(MINIMUM_TIMEOUT_MILLISECONDS, elasticTimeout); } } }
Source:
public List<FieldInfo> findIterableFields() { List<FieldInfo> iterableFields = new ArrayList<>(); try { for (FieldInfo fieldInfo : fieldsInfo().fields()) { Class type = getField(fieldInfo).getType(); if (type.isArray() || Iterable.class.isAssignableFrom(type)) { iterableFields.add(fieldInfo); } } return iterableFields; } catch (Exception e) { throw new RuntimeException(e); } }

Target:
public List<FieldInfo> findIterableFields() { Predicate<FieldInfo> isIterable = f -> { Class type = getField(f).getType(); return type.isArray() || Iterable.class.isAssignableFrom(type); }; try { return fieldsInfo().fields().stream() .filter(isIterable).collect(toList()); } catch (Exception e) { throw new RuntimeException(e); } }
Source:
public Context extractContext(String diagnosticId, Context context) { Objects.requireNonNull(context, "'context' cannot be null"); Objects.requireNonNull(diagnosticId, "'diagnosticId' cannot be null"); Context local = context; for (Tracer tracer : tracers) { local = tracer.extractContext(diagnosticId, local); } return local; }

Target:
public Context extractContext(String diagnosticId, Context context) { Context local = Objects.requireNonNull(context, "'context' cannot be null"); Objects.requireNonNull(diagnosticId, "'diagnosticId' cannot be null"); for (Tracer tracer : tracers) { local = tracer.extractContext(diagnosticId, local); } return local; }
Source:
private static long timeout(Properties props) { String timeout = PGProperty.LOGIN_TIMEOUT.get(props); if (timeout != null) { try { return (long) (Float.parseFloat(timeout) * 1000); } catch (NumberFormatException e) { LOGGER.log(Level.FINE, "Couldn't parse loginTimeout value: {0}", timeout); } } return (long) DriverManager.getLoginTimeout() * 1000; }

Target:
private static long timeout(Properties props) { String timeout = PGProperty.LOGIN_TIMEOUT.get(props); if (timeout != null) { try { return (long) (Float.parseFloat(timeout) * 1000); } catch (NumberFormatException e) { LOGGER.log(Level.WARNING, "Couldn't parse loginTimeout value: {0}", timeout); } } return (long) DriverManager.getLoginTimeout() * 1000; }
Source:
public void transferMemoryToTaskContext(long taskBytes, LocalMemoryContext transferredBytesMemoryContext) { long bytes = operatorMemoryContext.getUserMemory(); operatorMemoryContext.localUserMemoryContext().transferOwnership(transferredBytesMemoryContext); try { transferredBytesMemoryContext.setBytes(transferredBytesMemoryContext.getBytes() + taskBytes - bytes); } catch (ExceededMemoryLimitException e) { transferredBytesMemoryContext.setBytes(0); throw e; } }

Target:
public void transferMemoryToTaskContext(long taskBytes, LocalMemoryContext transferredBytesMemoryContext) { checkArgument(taskBytes >= 0, "taskBytes is negative"); long bytes = operatorMemoryContext.getUserMemory(); long bytesBeforeTransfer = transferredBytesMemoryContext.getBytes(); operatorMemoryContext.localUserMemoryContext().transferMemory(transferredBytesMemoryContext); try { transferredBytesMemoryContext.setBytes(transferredBytesMemoryContext.getBytes() + taskBytes - bytes); } catch (ExceededMemoryLimitException e) { transferredBytesMemoryContext.setBytes(bytesBeforeTransfer); throw e; } }
Source:
private void setDebugStatus( String message ) { if ( debug ) { log.setLogLevel(LogLevel.DEBUG); log.logBasic( message ); } }

Target:
private void setDebugStatus( String message ) { if ( log.isDebug() ) { log.logBasic( message ); } }