auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public TestHueChannelTypeProvider() { try { ChannelType ctColor = new ChannelType(COLOR_CHANNEL_TYPE_UID, false, "Color", "colorLabel", "description", null, null, null, new URI("hue", "LCT001:color", null)); ChannelType ctColorTemperature = new ChannelType(COLOR_TEMP_CHANNEL_TYPE_UID, false, "Dimmer", "colorTemperatureLabel", "description", null, null, null, new URI("hue", "LCT001:color_temperature", null)); ChannelType ctColorX = new ChannelType(COLORX_CHANNEL_TYPE_UID, false, "Color", "colorLabel", "description", null, null, null, new URI("Xhue", "XLCT001:Xcolor", null)); ChannelType ctColorTemperatureX = new ChannelType(COLORX_TEMP_CHANNEL_TYPE_UID, false, "Dimmer", "colorTemperatureLabel", "description", null, null, null, new URI("Xhue", "XLCT001:Xcolor_temperature", null)); channelTypes = Arrays.asList(ctColor, ctColorTemperature, ctColorX, ctColorTemperatureX); ChannelGroupType groupX = ChannelGroupTypeBuilder.instance(GROUP_CHANNEL_GROUP_TYPE_UID, "Channel Group") .isAdvanced(false).withDescription("Channel Group") .withChannelDefinitions(Arrays.asList( new ChannelDefinition("foo", TestHueChannelTypeProvider.COLOR_CHANNEL_TYPE_UID), new ChannelDefinition("bar", TestHueChannelTypeProvider.COLOR_CHANNEL_TYPE_UID))) .build(); channelGroupTypes = Arrays.asList(groupX); } catch (Exception willNeverBeThrown) { } }

Target:
public TestHueChannelTypeProvider() { try { ChannelType ctColor = new ChannelType(COLOR_CHANNEL_TYPE_UID, false, "Color", "colorLabel", "description", null, null, null, new URI("hue", "LCT001:color", null)); ChannelType ctColorTemperature = new ChannelType(COLOR_TEMP_CHANNEL_TYPE_UID, false, "Dimmer", "colorTemperatureLabel", "description", null, null, null, new URI("hue", "LCT001:color_temperature", null)); ChannelType ctColorX = new ChannelType(COLORX_CHANNEL_TYPE_UID, false, "Color", "colorLabel", "description", null, null, null, new URI("Xhue", "XLCT001:Xcolor", null)); ChannelType ctColorTemperatureX = new ChannelType(COLORX_TEMP_CHANNEL_TYPE_UID, false, "Dimmer", "colorTemperatureLabel", "description", null, null, null, new URI("Xhue", "XLCT001:Xcolor_temperature", null)); channelTypes = Arrays.asList(ctColor, ctColorTemperature, ctColorX, ctColorTemperatureX); ChannelGroupType groupX = ChannelGroupTypeBuilder.instance(GROUP_CHANNEL_GROUP_TYPE_UID, "Channel Group") .withDescription("Channel Group") .withChannelDefinitions(Arrays.asList( new ChannelDefinition("foo", TestHueChannelTypeProvider.COLOR_CHANNEL_TYPE_UID), new ChannelDefinition("bar", TestHueChannelTypeProvider.COLOR_CHANNEL_TYPE_UID))) .build(); channelGroupTypes = Arrays.asList(groupX); } catch (Exception willNeverBeThrown) { } }
Source:
private List<IRecord> getChangeRecords(BrowserAction action) { String type = action.getType(); if (type.equals(ActionTypes.NEW)) { return create(action); } else if (type.equals(ActionTypes.SET)) { return set(action); } else if (type.equals(ActionTypes.REMOVE)) { return remove(action); } else { LOG.error("undefined action type received: " + type); return new LinkedList<IRecord>(); } }

Target:
private List<IRecord> getChangeRecords(BrowserAction action) { String type = action.getType(); if (type.equals(RecordType.NEW.toString())) { return create(action); } else if (type.equals(RecordType.SET.toString())) { return set(action); } else if (type.equals(RecordType.REMOVE.toString())) { return remove(action); } else { LOG.error("undefined action type received: " + type); return Collections.emptyList(); } }
Source:
private Map<String, String> updateHeaders(final Map<String, String> headers) { if (headers == null) { throw new IllegalArgumentException("headers"); } if (mRequestCorrelationId != null) { headers.put(AAD.CLIENT_REQUEST_ID, mRequestCorrelationId.toString()); } headers.put(AAD.ADAL_ID_PLATFORM, "Android"); headers.put(AAD.ADAL_ID_VERSION, AuthenticationContext.getVersionName()); headers.put(AAD.ADAL_ID_OS_VER, "" + Build.VERSION.SDK_INT); headers.put(AAD.ADAL_ID_DM, android.os.Build.MODEL); return headers; }

Target:
private Map<String, String> updateHeaders(final Map<String, String> headers) { if (mRequestCorrelationId != null) { headers.put(AAD.CLIENT_REQUEST_ID, mRequestCorrelationId.toString()); } headers.put(AAD.ADAL_ID_PLATFORM, "Android"); headers.put(AAD.ADAL_ID_VERSION, AuthenticationContext.getVersionName()); headers.put(AAD.ADAL_ID_OS_VER, "" + Build.VERSION.SDK_INT); headers.put(AAD.ADAL_ID_DM, android.os.Build.MODEL); return headers; }
Source:
public Collection<PackFile> gc() throws IOException, ParseException { final GcLog gcLog = background ? new GcLog(repo) : null; if (gcLog != null && !gcLog.lock(background)) { return Collections.emptyList(); } Callable<Collection<PackFile>> gcTask = () -> { try { Collection<PackFile> newPacks = doGc(); if (automatic && tooManyLooseObjects() && gcLog != null) { String message = JGitText.get().gcTooManyUnpruned; gcLog.write(message); gcLog.commit(); } return newPacks; } catch (IOException | ParseException e) { if (background) { if (gcLog == null) { return Collections.emptyList(); } try { gcLog.write(e.getMessage()); StringWriter sw = new StringWriter(); e.printStackTrace(new PrintWriter(sw)); gcLog.write(sw.toString()); gcLog.commit(); } catch (IOException e2) { e2.addSuppressed(e); LOG.error(e2.getMessage(), e2); } } else { throw new JGitInternalException(e.getMessage(), e); } } finally { if (gcLog != null) { gcLog.unlock(); } } return Collections.emptyList(); }; if (background) { executor.submit(gcTask); return Collections.emptyList(); } else { try { return gcTask.call(); } catch (Exception e) { throw new IOException(e); } } }

Target:
public Collection<PackFile> gc() throws IOException, ParseException { if (!background) { return doGc(); } final GcLog gcLog = new GcLog(repo); if (!gcLog.lock()) { return Collections.emptyList(); } Callable<Collection<PackFile>> gcTask = () -> { try { Collection<PackFile> newPacks = doGc(); if (automatic && tooManyLooseObjects()) { String message = JGitText.get().gcTooManyUnpruned; gcLog.write(message); gcLog.commit(); } return newPacks; } catch (IOException | ParseException e) { try { gcLog.write(e.getMessage()); StringWriter sw = new StringWriter(); e.printStackTrace(new PrintWriter(sw)); gcLog.write(sw.toString()); gcLog.commit(); } catch (IOException e2) { e2.addSuppressed(e); LOG.error(e2.getMessage(), e2); } } finally { gcLog.unlock(); } return Collections.emptyList(); }; executor.submit(gcTask); return Collections.emptyList(); }
Source:
public CompletableFuture<Acknowledge> archiveExecutionGraph(AccessExecutionGraph executionGraph) { final CompletableFuture<Acknowledge> ackFuture = new CompletableFuture<>(); ioExecutor.execute(() -> { try { FsJobArchivist.archiveJob(archivePath, executionGraph.getJobID(), jsonArchivist.archiveJsonWithPath(executionGraph)); ackFuture.complete(Acknowledge.get()); } catch (IOException e) { ackFuture.completeExceptionally(e); } }); return ackFuture; }

Target:
public CompletableFuture<Acknowledge> archiveExecutionGraph(AccessExecutionGraph executionGraph) { return CompletableFuture .runAsync( ThrowingRunnable.unchecked(() -> FsJobArchivist.archiveJob(archivePath, executionGraph.getJobID(), jsonArchivist.archiveJsonWithPath(executionGraph))), ioExecutor) .thenApply(ignored -> Acknowledge.get()); }
Source:
protected boolean isInterestingFolder(IFolder folder) { return !findProductFiles(folder, false).isEmpty(); }

Target:
protected boolean isInterestingFolder(IFolder folder) { return true; }
Source:
static void checkGetter(Method getter) { checkNotNull(getter); checkArgument(GETTER_PREFIX_PATTERN.matcher(getter.getName()) .find() && getter.getParameterTypes().length == 0, "Method `%s` is not a getter.", getter); checkArgument(getAnnotatedVersion(getter).isPresent(), format("Entity column getter should be annotated with `%s`.", Column.class.getName())); int modifiers = getter.getModifiers(); checkArgument(isPublic(modifiers) && !isStatic(modifiers), "Entity column getter should be public instance method."); Class<?> returnType = getter.getReturnType(); Class<?> wrapped = wrap(returnType); checkArgument(Serializable.class.isAssignableFrom(wrapped), format("Cannot create column of non-serializable type %s by method %s.", returnType, getter)); }

Target:
static void checkGetter(Method getter) { checkNotNull(getter); checkArgument(GETTER_PREFIX_PATTERN.matcher(getter.getName()) .find() && getter.getParameterTypes().length == 0, "Method `%s` is not a getter.", getter); checkArgument(getAnnotatedVersion(getter).isPresent(), "Entity column getter should be annotated with `%s`.", Column.class.getName()); int modifiers = getter.getModifiers(); checkArgument(isPublic(modifiers) && !isStatic(modifiers), "Entity column getter should be public instance method."); Class<?> returnType = getter.getReturnType(); Class<?> wrapped = wrap(returnType); checkArgument(Serializable.class.isAssignableFrom(wrapped), "Cannot create column of non-serializable type %s by method %s.", returnType, getter); }
Source:
public String getTimestamp() { return timestamp; }

Target:
public String getTimestamp() { return StringUtils.defaultString(timestamp); }
Source:
private int importAtlasMetadata(AtlasReplInfo atlasReplInfo) throws Exception { AtlasImportRequest importRequest = atlasRequestBuilder.createImportRequest(atlasReplInfo.getSrcDB(), atlasReplInfo.getTgtDB(), atlasRequestBuilder.getAtlasClusterName(atlasReplInfo.getSrcCluster()), atlasRequestBuilder.getAtlasClusterName(atlasReplInfo.getTgtCluster()), atlasReplInfo.getSrcFsUri(), atlasReplInfo.getTgtFsUri(), atlasReplInfo.getSrcCluster()); AtlasImportResult result = clientBuilder.getClient(atlasReplInfo.getAtlasEndpoint(), atlasReplInfo.getConf()) .importData(importRequest, atlasReplInfo); if (result == null || result.getProcessedEntities() == null) { LOG.info("HiveAtlasPlugin: No entities found"); return 0; } return result.getProcessedEntities().size(); }

Target:
private int importAtlasMetadata(AtlasReplInfo atlasReplInfo) throws Exception { AtlasRequestBuilder atlasRequestBuilder = new AtlasRequestBuilder(); AtlasImportRequest importRequest = atlasRequestBuilder.createImportRequest( atlasReplInfo.getSrcDB(), atlasReplInfo.getTgtDB(), atlasReplInfo.getSrcCluster(), atlasReplInfo.getTgtCluster(), atlasReplInfo.getSrcFsUri(), atlasReplInfo.getTgtFsUri()); AtlasImportResult result = new AtlasRestClientBuilder(atlasReplInfo.getAtlasEndpoint()) .getClient(atlasReplInfo.getConf()).importData(importRequest, atlasReplInfo); if (result == null || result.getProcessedEntities() == null) { LOG.info("No Atlas entity found"); return 0; } return result.getProcessedEntities().size(); }
Source:
public void setUp(String testOutputDir, String... processNames) { mProcessNames = processNames; mTestOutputDir = testOutputDir; mDropCacheOption = 0; mUiDevice = UiDevice.getInstance(InstrumentationRegistry.getInstrumentation()); mGarbageCollectionHelper.setUp(processNames); }

Target:
public void setUp(String testOutputDir, String... processNames) { mProcessNames = processNames; mTestOutputDir = testOutputDir; mDropCacheOption = 0; mUiDevice = UiDevice.getInstance(InstrumentationRegistry.getInstrumentation()); }
Source:
@Override public boolean process(Set<? extends TypeElement> types, RoundEnvironment env) { try { Set<InjectedClass> injectedClasses = new HashSet<InjectedClass>(); injectedClasses.addAll(getInjectedClasses(env)); for (String e : delayedInjectedClassNames) { injectedClasses.add(getInjectedClass(processingEnv.getElementUtils().getTypeElement(e))); } for (InjectedClass injectedClass : injectedClasses) { String injectedClassName = injectedClass.type.toString(); boolean missingDependentClasses = !allTypesExist(injectedClass.fields) || (injectedClass.constructor != null && !allTypesExist(injectedClass.constructor .getParameters())) || !allTypesExist(injectedClass.staticFields); if (missingDependentClasses) { delayedInjectedClassNames.add(injectedClassName); } else { writeInjectionsForClass(injectedClass); delayedInjectedClassNames.remove(injectedClassName); } } } catch (IOException e) { error("Code gen failed: %s", e); } if (env.processingOver() && delayedInjectedClassNames.size() > 0) { error("Could not find injection type required by %s!", delayedInjectedClassNames.toString()); } return true; }

Target:
@Override public boolean process(Set<? extends TypeElement> types, RoundEnvironment env) { try { remainingTypeNames.addAll(getInjectedClassNames(env)); for (Iterator<String> i = remainingTypeNames.iterator(); i.hasNext();) { InjectedClass injectedClass = getInjectedClass(i.next()); boolean missingDependentClasses = !allTypesExist(injectedClass.fields) || (injectedClass.constructor != null && !allTypesExist(injectedClass.constructor .getParameters())) || !allTypesExist(injectedClass.staticFields); if (!missingDependentClasses) { writeInjectionsForClass(injectedClass); i.remove(); } } } catch (IOException e) { error("Code gen failed: %s", e); } if (env.processingOver() && !remainingTypeNames.isEmpty()) { error("Could not find injection type required by %s!", remainingTypeNames); } return true; }
Source:
public void setChannelSendOptions(String channelSendOptions) { int value = Channel.parseChannelSendOptions(channelSendOptions); if (value > 0) this.setChannelSendOptions(value); }

Target:
public void setChannelSendOptions(String channelSendOptions) { int value = Channel.parseSendOptions(channelSendOptions); if (value > 0) { this.setChannelSendOptions(value); } }
Source:
public TaskDefinition getTaskByUuid(String uuid) { if (log.isDebugEnabled()) { log.debug("get task " + uuid); } return getSchedulerDAO().getTaskByUuid(uuid); }

Target:
public TaskDefinition getTaskByUuid(String uuid) { return getSchedulerDAO().getTaskByUuid(uuid); }
Source:
private Map<String, Path> videoContentPaths(Map<String, Map<String, Path>> tmpContentPaths, ContentItem contentItem) { if (!isVideo(contentItem)) { return null; } final long contentItemSizeBytes; try { contentItemSizeBytes = contentItem.getSize(); } catch (IOException e) { LOGGER.warn( "Error retrieving size for ContentItem (id={}). Unable to create thumbnail for metacard (id={})", contentItem.getId(), contentItem.getMetacard().getId()); return null; } final long bytesPerMegabyte = 1024L * 1024L; final long maxFileSizeBytes = maxFileSizeMB * bytesPerMegabyte; if (contentItemSizeBytes > maxFileSizeBytes) { LOGGER.debug( "ContentItem (id={} size={} MB) is larger than the configured max file size to process ({} MB). Skipping creating thumbnail for metacard (id={})", contentItem.getId(), contentItemSizeBytes, maxFileSizeBytes, contentItem.getMetacard().getId()); return null; } Map<String, Path> contentPaths = tmpContentPaths.get(contentItem.getId()); if (contentPaths == null || contentPaths.isEmpty()) { LOGGER.warn( "No path for ContentItem (id={}). Unable to create thumbnail for metacard (id={})", contentItem.getId(), contentItem.getMetacard().getId()); return null; } return contentPaths; }

Target:
private Map<String, Path> videoContentPaths( Map<String, Map<String, Path>> tmpContentPaths, ContentItem contentItem) { if (!isVideo(contentItem)) { return null; } final long contentItemSizeBytes; try { contentItemSizeBytes = contentItem.getSize(); } catch (IOException e) { LOGGER.debug( "Error retrieving size for ContentItem (id={}). Unable to create thumbnail for metacard (id={})", contentItem.getId(), contentItem.getMetacard().getId()); return null; } final long bytesPerMegabyte = 1024L * 1024L; final long maxFileSizeBytes = maxFileSizeMB * bytesPerMegabyte; if (contentItemSizeBytes > maxFileSizeBytes) { LOGGER.debug( "ContentItem (id={} size={} MB) is larger than the configured max file size to process ({} MB). Skipping creating thumbnail for metacard (id={})", contentItem.getId(), contentItemSizeBytes, maxFileSizeBytes, contentItem.getMetacard().getId()); return null; } Map<String, Path> contentPaths = tmpContentPaths.get(contentItem.getId()); if (contentPaths == null || contentPaths.isEmpty()) { LOGGER.debug( "No path for ContentItem (id={}). Unable to create thumbnail for metacard (id={})", contentItem.getId(), contentItem.getMetacard().getId()); return null; } return contentPaths; }
Source:
public DiscordRPCSubSystem() throws IllegalStateException { if (instance != null) { throw new IllegalStateException("More then one instance in the DiscordRPC"); } lastRichPresence = null; ipcClient = new IPCClient(515274721080639504L); ipcClient.setListener(this); logger = LoggerFactory.getLogger(DiscordRPCSubSystem.class); autoReconnect = true; reconnectThread = new Thread(this); reconnectThread.setName("DISCORD-RPC-RECONNECT"); reconnectThread.start(); instance = this; }

Target:
public DiscordRPCSubSystem() throws IllegalStateException { if (instance != null) { throw new IllegalStateException("More then one instance in the DiscordRPC"); } lastRichPresence = null; ipcClient = new IPCClient(DISCORD_APP_CLIENT_ID); ipcClient.setListener(this); autoReconnect = true; reconnectThread = new Thread(this); reconnectThread.setName("DISCORD-RPC-RECONNECT"); reconnectThread.start(); instance = this; enabled = false; dontTryAgain = true; }
Source:
protected void fillTitle(final ChangePasswordPageContent viewModel, final Void input, final Form<? extends ChangePasswordFormData> form) { viewModel.setTitle(pageTitleResolver.getOrEmpty("my-account:changePassword.title")); }

Target:
protected void fillTitle(final ChangePasswordPageContent viewModel, final Void input, final Form<? extends ChangePasswordFormData> form) { viewModel.setTitle(pageTitleResolver.getOrEmpty("my-account:changePassword.changePasswordTitle")); }
Source:
private void save() throws IOException, GeneralSecurityException { System.out.println("Write to temp file"); try (FileOutputStream fos = new FileOutputStream(tempFile)) { workingKeyStore.store(fos, STORE_PASSWORD); } System.out.println("Delete real file"); if (keystoreFile.exists()) { if (keystoreFile.delete() == false) { fail("Unable to delete KeyStore"); } } System.out.println("Rename temp to real"); if (tempFile.renameTo(keystoreFile) == false) { fail("Unable to rename temporary keystore to test keystore."); } }

Target:
private void save() throws IOException, GeneralSecurityException { System.out.println("Write to temp file"); try (FileOutputStream fos = new FileOutputStream(tempFile)) { workingKeyStore.store(fos, STORE_PASSWORD); } System.out.println("Rename temp to real"); Files.move(tempFile.toPath(), keystoreFile.toPath(), StandardCopyOption.ATOMIC_MOVE, StandardCopyOption.REPLACE_EXISTING); }
Source:
public DefaultCacheLoaderWriterConfigurationParser() { super(DefaultCacheLoaderWriterConfiguration.class, CacheTemplate::loaderWriter, (config, loader) -> new DefaultCacheLoaderWriterConfiguration((Class<? extends CacheLoaderWriter<?, ?>>) getClassForName(config, loader)), CacheType::getLoaderWriter, CacheType::setLoaderWriter, config -> { if (config.getInstance() != null) { throw new XmlConfigurationException("XML translation when instance is provided is not supported"); } return new CacheLoaderWriterType().withClazz(config.getClazz().getName()); }); }

Target:
public DefaultCacheLoaderWriterConfigurationParser() { super(DefaultCacheLoaderWriterConfiguration.class, CacheTemplate::loaderWriter, (config, loader) -> new DefaultCacheLoaderWriterConfiguration((Class<? extends CacheLoaderWriter<?, ?>>) getClassForName(config, loader)), CacheType::getLoaderWriter, CacheType::setLoaderWriter, config -> { checkNoConcreteInstance(config); return new CacheLoaderWriterType().withClazz(config.getClazz().getName()); }); }
Source:
public void testUpdateStmtBuilder() { printStatement("update foo set \"column['looks_like_nested']\"=1"); printStatement("update foo set foo.a='b'"); printStatement("update bar.foo set bar.foo.t=3"); printStatement("update foo set col['x'] = 3"); printStatement("update foo set col['x'] = 3 where foo['x'] = 2"); printStatement("update schemah.foo set foo.a='b', foo.b=foo.a"); printStatement("update schemah.foo set foo.a=abs(-6.3334), x=true where x=false"); printStatement("update foo set foo='a' returning id"); printStatement("update foo set foo='a' where x=false returning id"); printStatement("update foo set foo='a' returning id AS foo"); printStatement("update foo set foo='a' returning id + 1 AS foo, id -1 as bar"); }

Target:
public void testUpdateStmtBuilder() { printStatement("update foo set \"column['looks_like_nested']\"=1"); printStatement("update foo set foo.a='b'"); printStatement("update bar.foo set bar.foo.t=3"); printStatement("update foo set col['x'] = 3"); printStatement("update foo set col['x'] = 3 where foo['x'] = 2"); printStatement("update schemah.foo set foo.a='b', foo.b=foo.a"); printStatement("update schemah.foo set foo.a=abs(-6.3334), x=true where x=false"); }
Source:
private static void parseOsStanza(ClientInfo.Builder builder, String stanza) { String[] components = null; if (stanza.matches(OLD_OS_FORMAT_REGEXP)) { components = new String[] { stanza.substring(0, stanza.lastIndexOf(" ")), stanza.substring(stanza.lastIndexOf(" ")), }; } else { components = stanza.split("/"); } if (components.length == 2) { builder.withOsName(parseString(components[0])); builder.withOsVersion(parseString(components[1])).build(); } else if (components.length == 1) { if (components[0].trim().matches(SEMANTIC_VERSION_REGEXP)) { builder.withOsVersion(parseString(components[0])); } else { builder.withOsName(parseString(components[0])); } } }

Target:
private static void parseOsStanza(ClientInfo.Builder builder, String stanza) { String[] components = null; if (stanza.matches(OLD_OS_FORMAT_REGEXP)) { components = new String[] { stanza.substring(0, stanza.lastIndexOf(" ")), stanza.substring(stanza.lastIndexOf(" ")), }; } else { components = stanza.split("/"); } if (components.length == 2) { builder.withOsName(parseString(components[0])); builder.withOsVersion(parseString(components[1])); } else if (components.length == 1) { if (components[0].trim().matches(SEMANTIC_VERSION_REGEXP)) { builder.withOsVersion(parseString(components[0])); } else { builder.withOsName(parseString(components[0])); } } }
Source:
private static boolean canAssignFrom(RelDataType type1, RelDataType type2, RelDataTypeFactory typeFactory) { final SqlTypeName name1 = type1.getSqlTypeName(); final SqlTypeName name2 = type2.getSqlTypeName(); if (name1.getFamily() == name2.getFamily()) { switch (name1.getFamily()) { case NUMERIC: if (SqlTypeUtil.isExactNumeric(type1) && SqlTypeUtil.isExactNumeric(type2)) { int precision1; int scale1; if (name1 == SqlTypeName.DECIMAL) { precision1 = type1.getPrecision(); scale1 = type1.getScale(); } else { precision1 = typeFactory.getTypeSystem().getMaxPrecision(name1); scale1 = typeFactory.getTypeSystem().getMaxScale(name1); } int precision2; int scale2; if (name2 == SqlTypeName.DECIMAL) { precision2 = type2.getPrecision(); scale2 = type2.getScale(); } else { precision2 = typeFactory.getTypeSystem().getMaxPrecision(name2); scale2 = typeFactory.getTypeSystem().getMaxScale(name2); } return precision1 >= precision2 && scale1 >= scale2; } else if (SqlTypeUtil.isApproximateNumeric(type1) && SqlTypeUtil.isApproximateNumeric(type2)) { return type1.getPrecision() >= type2.getPrecision() && type1.getScale() >= type2.getScale(); } break; default: return type1.getPrecision() >= type2.getPrecision(); } } return false; }

Target:
private static boolean canAssignFrom(RelDataType type1, RelDataType type2, RelDataTypeFactory typeFactory) { final SqlTypeName name1 = type1.getSqlTypeName(); final SqlTypeName name2 = type2.getSqlTypeName(); if (name1.getFamily() == name2.getFamily()) { switch (name1.getFamily()) { case NUMERIC: if (SqlTypeUtil.isExactNumeric(type1) && SqlTypeUtil.isExactNumeric(type2)) { int precision1; int scale1; if (name1 == SqlTypeName.DECIMAL) { type1 = typeFactory.decimalOf(type1); precision1 = type1.getPrecision(); scale1 = type1.getScale(); } else { precision1 = typeFactory.getTypeSystem().getMaxPrecision(name1); scale1 = typeFactory.getTypeSystem().getMaxScale(name1); } int precision2; int scale2; if (name2 == SqlTypeName.DECIMAL) { type2 = typeFactory.decimalOf(type2); precision2 = type2.getPrecision(); scale2 = type2.getScale(); } else { precision2 = typeFactory.getTypeSystem().getMaxPrecision(name2); scale2 = typeFactory.getTypeSystem().getMaxScale(name2); } return precision1 >= precision2 && scale1 >= scale2; } else if (SqlTypeUtil.isApproximateNumeric(type1) && SqlTypeUtil.isApproximateNumeric(type2)) { return type1.getPrecision() >= type2.getPrecision() && type1.getScale() >= type2.getScale(); } break; default: return type1.getPrecision() >= type2.getPrecision(); } } return false; }
Source:
public ScriptEntryData getScriptEntryData() { return new BukkitScriptEntryData( hitBy.isPlayer() ? hitBy.getDenizenPlayer() : (entity.isPlayer() ? entity.getDenizenPlayer() : null), hitBy.isCitizensNPC() ? hitBy.getDenizenNPC() : (entity.isCitizensNPC() ? entity.getDenizenNPC() : null) ); }

Target:
public ScriptEntryData getScriptEntryData() { return new BukkitScriptEntryData( hitBy.isPlayer() ? hitBy.getDenizenPlayer() : entity.isPlayer() ? entity.getDenizenPlayer() : null, hitBy.isCitizensNPC() ? hitBy.getDenizenNPC() : entity.isCitizensNPC() ? entity.getDenizenNPC() : null); }
Source:
public String commitMessage(GitRepositoryManager repoManager, Provider<ReviewDb> db) { if (commitMessage == null) { try { PatchSet.Id psId = change.currentPatchSetId(); String sha1 = db.get().patchSets().get(psId).getRevision().get(); Project.NameKey name = change.getProject(); Repository repo = repoManager.openRepository(name); RevWalk walk = new RevWalk(repo); RevCommit c = walk.parseCommit(ObjectId.fromString(sha1)); commitMessage = c.getFullMessage(); walk.release(); } catch (RepositoryNotFoundException e) { } catch (IOException e) { } catch (OrmException e) { } } return commitMessage; }

Target:
public String commitMessage(GitRepositoryManager repoManager, Provider<ReviewDb> db) { if (commitMessage == null) { try { PatchSet.Id psId = change(db).currentPatchSetId(); String sha1 = db.get().patchSets().get(psId).getRevision().get(); Project.NameKey name = change.getProject(); Repository repo = repoManager.openRepository(name); RevWalk walk = new RevWalk(repo); try { RevCommit c = walk.parseCommit(ObjectId.fromString(sha1)); commitMessage = c.getFullMessage(); } finally { walk.release(); } } catch (RepositoryNotFoundException e) { log.error("Problem opening change repository", e); } catch (IOException e) { log.error("Problem finding commit message", e); } catch (OrmException e) { log.error("Problem requesting sha1 from database", e); } } return commitMessage; }
Source:
private Map<String, String> getStringStringMap(final File sampleMapFile, final String inputFieldName) { final Map<String, String> sampleMap = new HashMap<>(); final TabbedInputParser parser = new TabbedInputParser(false, sampleMapFile); for (final String[] strings : parser) { if (strings.length != 2) { throw new IllegalArgumentException("Each line of the " + inputFieldName + " must have exactly two strings separated by a tab. " + "Found: " + Arrays.toString(strings) + "] right before [" + parser.getCurrentLine() + "], in " + sampleMapFile.getAbsolutePath()); } if (sampleMap.containsKey(strings[0])) { throw new IllegalArgumentException("Strings in first column of the " + inputFieldName + " must be unique. found [" + strings[0] + "] twice. Right before [" + parser.getCurrentLine() + "] in " + sampleMapFile.getAbsolutePath()); } sampleMap.put(strings[0], strings[1]); } return sampleMap; }

Target:
private Map<String, String> getStringStringMap(final File sampleMapFile, final String inputFieldName) { final Map<String, String> sampleMap = new HashMap<>(); final TabbedInputParser parser = new TabbedInputParser(false, sampleMapFile); for (final String[] strings : parser) { if (strings.length != 2) { throw new IllegalArgumentException("Each line of the " + inputFieldName + " must have exactly two strings separated by a tab. " + "Found: [" + Arrays.toString(strings) + "] right before [" + parser.getCurrentLine() + "], in " + sampleMapFile.getAbsolutePath()); } if (sampleMap.containsKey(strings[0])) { throw new IllegalArgumentException("Strings in first column of the " + inputFieldName + " must be unique. found [" + strings[0] + "] twice. Right before [" + parser.getCurrentLine() + "] in " + sampleMapFile.getAbsolutePath()); } sampleMap.put(strings[0], strings[1]); } return sampleMap; }
Source:
protected void validateBillingPeriodDateRange(ContractsGrantsInvoiceDocument contractsGrantsInvoiceDocument, List<String> warningMessages) throws ParseException { Pair<Date, Date> billingPeriodDates = parseDateRange(contractsGrantsInvoiceDocument.getInvoiceGeneralDetail().getBillingPeriod()); validateBillingPeriodDateRangeAgainstLastBilledDate(contractsGrantsInvoiceDocument, billingPeriodDates, warningMessages); validateBillingPeriodDateRangeStartBeforeEnd(contractsGrantsInvoiceDocument, billingPeriodDates, warningMessages); validateBillingPeriodStartDateAgainstAwardDate(contractsGrantsInvoiceDocument, billingPeriodDates.getLeft(), warningMessages); }

Target:
protected void validateBillingPeriodDateRange(ContractsGrantsInvoiceDocument contractsGrantsInvoiceDocument, List<String> warningMessages) throws ParseException { Pair<Date, Date> billingPeriodDates = parseDateRange(contractsGrantsInvoiceDocument.getInvoiceGeneralDetail().getBillingPeriod()); DateTimeService dateTimeService = SpringContext.getBean(DateTimeService.class); ConfigurationService configurationService = SpringContext.getBean(ConfigurationService.class); Date billingPeriodStartDate = billingPeriodDates.getLeft(); Date billingPeriodEndDate = billingPeriodDates.getRight(); if (dateTimeService.dateDiff(billingPeriodEndDate, billingPeriodStartDate, false) >= 1) { warningMessages.add(configurationService.getPropertyValueAsString(CUKFSKeyConstants.WARNING_CINV_BILLING_PERIOD_END_DATE_BEFORE_BILLING_PERIOD_START_DATE)); } Date lastBilledDate = contractsGrantsInvoiceDocument.getInvoiceGeneralDetail().getLastBilledDate(); if (dateTimeService.dateDiff(billingPeriodEndDate, lastBilledDate, false) >= 1) { warningMessages.add(configurationService.getPropertyValueAsString(CUKFSKeyConstants.WARNING_CINV_BILLING_PERIOD_END_DATE_BEFORE_LAST_BILLED_DATE)); } if (dateTimeService.dateDiff(billingPeriodStartDate, lastBilledDate, false) >= 1) { warningMessages.add(configurationService.getPropertyValueAsString(CUKFSKeyConstants.WARNING_CINV_BILLING_PERIOD_START_DATE_BEFORE_LAST_BILLED_DATE)); } Pair<Date, Date> awardDateRange = parseDateRange(contractsGrantsInvoiceDocument.getInvoiceGeneralDetail().getAwardDateRange()); if (dateTimeService.dateDiff(billingPeriodStartDate, awardDateRange.getLeft(), false) >= 1) { warningMessages.add(configurationService.getPropertyValueAsString(CUKFSKeyConstants.WARNING_CINV_BILLING_PERIOD_START_DATE_BEFORE_AWARD_START_DATE)); } }
Source:
private void performPrimaryAction() { switch (getPrimaryAction()) { case PUBLISH_NOW: case UPDATE: case SCHEDULE: case SUBMIT_FOR_REVIEW: mAnalyticsTrackerWrapper.track(Stat.EDITOR_POST_PUBLISH_TAPPED); showPrepublishingNudgeBottomSheet(); return; case SAVE: uploadPost(false); break; } }

Target:
private void performPrimaryAction() { switch (getPrimaryAction()) { case PUBLISH_NOW: mAnalyticsTrackerWrapper.track(Stat.EDITOR_POST_PUBLISH_TAPPED); showPrepublishingNudgeBottomSheet(); return; case UPDATE: case SCHEDULE: case SUBMIT_FOR_REVIEW: showPrepublishingNudgeBottomSheet(); return; case SAVE: uploadPost(false); break; } }
Source:
private Map<String, Object> pojoToMap(Object input, int streamIndex) { Map<String, Object> map = new HashMap<>(); List<KeyValPair<String,PojoUtils.Getter>> gettersStream; if (streamIndex == 1) { gettersStream = gettersStream1; } else { gettersStream = gettersStream2; } for (KeyValPair<String,PojoUtils.Getter> getter : gettersStream) { try { Object value = getter.getValue().get(input); map.put(getter.getKey(), value); } catch (Exception e) { throw Throwables.propagate(e); } } return map; }

Target:
private Map<String, Object> pojoToMap(Object input, int streamIndex) { Map<String, Object> map = new HashMap<>(); List<KeyValPair<String,PojoUtils.Getter>> gettersStream = streamIndex == 1 ? gettersStream1 : gettersStream2; for (KeyValPair<String,PojoUtils.Getter> getter : gettersStream) { try { Object value = getter.getValue().get(input); map.put(getter.getKey(), value); } catch (Exception e) { throw Throwables.propagate(e); } } return map; }
Source:
public byte[] getResultsByID(String asyncQueryID) { log.debug("getAsyncResultsByID"); AsyncQuery asyncQuery = null; byte[] byteResult = null; try { asyncQuery = (AsyncQuery) DBUtil.executeInTransaction(elideSettings, dataStore, (tx, scope) -> { EntityProjection asyncQueryCollection = EntityProjection.builder() .type(AsyncQuery.class) .build(); Object loaded = tx.loadObject(asyncQueryCollection, asyncQueryID, scope); return loaded; }); if (asyncQuery != null && asyncQuery.getResult().getAttachment() != null) { Blob result = asyncQuery.getResult().getAttachment(); byteResult = result.getBytes(1, (int) result.length()); } } catch (SQLException e) { log.error("Exception: {}", e); throw new IllegalStateException(e); } return byteResult; }

Target:
public Observable<String> getResultsByID(String asyncQueryID) { log.debug("getAsyncResultsByID"); Optional<AsyncQuery> asyncQuery = null; Observable<String> observableResult = Observable.empty(); PathElement idPathElement = new PathElement(AsyncQuery.class, String.class, "id"); List<String> idList = Collections.singletonList(asyncQueryID); FilterExpression fltStatusExpression = new InPredicate(idPathElement, idList); Collection<AsyncQuery> asyncQueryCollection = defaultAsyncQueryDAO.loadAsyncQueryCollection(fltStatusExpression); if (asyncQueryCollection != null && asyncQueryCollection.size() > 0) { asyncQuery = asyncQueryCollection.stream().findAny(); AsyncQueryResult queryResult = asyncQuery.get().getResult(); if (queryResult != null && queryResult.getAttachment() != null) { observableResult = Observable.fromArray(queryResult.getAttachment().split(NEW_LINE_REGEX)); } } return observableResult; }
Source:
int getZoneId() { int zoneValue = -1; String value = dataMap.get(ZONE_ID); if (value != null) { zoneValue = Integer.parseInt(value); } return zoneValue; }

Target:
private int getZoneId() { int zoneValue = -1; String value = properties.getProperty(ZONE_ID); if (value != null) { zoneValue = Integer.parseInt(value); } return zoneValue; }
Source:
public static void main(String[] args) { long maxMem = Runtime.getRuntime().maxMemory(); Object[] holder = new Object[(int)maxMem / 16]; int count = 0; try { while (true) { holder[count++] = new byte[7000]; } } catch (OutOfMemoryError e) for (int i = 0; i < count; ++i) { holder[i] = null; } holder[0] = new Object[(int)maxMem / 8]; }

Target:
public static void main(String[] args) { long maxMem = Runtime.getRuntime().maxMemory(); Object[] holder = new Object[(int)maxMem / 16]; int count = 0; try { while (true) { holder[count++] = new Object[1025]; } } catch (OutOfMemoryError e) for (int i = 0; i < count; ++i) { holder[i] = null; } holder[0] = new Object[(int)maxMem / 8]; }
Source:
public static void skipFully(final InputStream fd, long toSkip) throws IOException { while (toSkip > 0) { final long r = fd.skip(toSkip); if (r <= 0) throw new EOFException(JGitText.get().shortReadOfBlock); toSkip -= r; } }

Target:
public static void skipFully(final InputStream fd, long toSkip) throws IOException { while (toSkip > 0) { final long r = fd.skip(toSkip); if (r <= 0) throw new EOFException(JGitText.get().shortSkipOfBlock); toSkip -= r; } }
Source:
public void testBasicCopy() throws Throwable { describe("Checks whether S3A FS supports native copy" + " and copies a file from one location to another." + " File deletion taken care in teardown."); assertPathExists(srcFile + " does not exist", srcFile); fs.delete(dstFile, false); fs.copyFile(srcFile.toUri(), dstFile.toUri()); assertIsFile(dstFile); }

Target:
public void testBasicCopy() throws Throwable { describe("Checks whether S3A FS supports native copy" + " and copies a file from one location to another." + " File deletion taken care in teardown."); assertPathExists(srcFile + " does not exist", srcFile); fs.delete(dstFile, false); fs.copyFile(srcFile.toUri(), dstFile.toUri()).get(); assertIsFile(srcFile); assertIsFile(dstFile); verifyFileContents(fs, dstFile, srcData); }
Source:
AbstractLock addAGrantedLock(String user, LockingMode which, StreamManagement streamManagement, ImmutableReadFileManagement immutableReadFileManagement, GrantedAccess rights) { Collection<AbstractLock> locksForUser = locks.get(user); if (locksForUser == null) { locksForUser = new LinkedList<>(); locks.put(user, locksForUser); } AbstractLock lock; if (Objects.nonNull(rights) && which.equals(LockingMode.UPGRADE_WRITE_ONCE) && rights.getLock(uri) instanceof UpgradeableReadLock) { lock = rights.getLock(uri); ((UpgradeableReadLock) lock).upgradeForAOneTimeWrite(); } else { lock = AbstractLock.createLock(uri, which, user, streamManagement, immutableReadFileManagement); } locksForUser.add(lock); return lock; }

Target:
AbstractLock addAGrantedLock(String user, LockingMode which, StreamManagement streamManagement, ImmutableReadFileManagement immutableReadFileManagement, GrantedAccess rights) { locks.computeIfAbsent(user, create -> new LinkedList<>()); Collection<AbstractLock> locksForUser = locks.get(user); AbstractLock lock; if (Objects.nonNull(rights) && which.equals(LockingMode.UPGRADE_WRITE_ONCE) && rights.getLock(uri) instanceof UpgradeableReadLock) { lock = rights.getLock(uri); ((UpgradeableReadLock) lock).upgradeForAOneTimeWrite(); } else { lock = AbstractLock.createLock(uri, which, user, streamManagement, immutableReadFileManagement); } locksForUser.add(lock); return lock; }
Source:
public void getParameterName_NoAnnotations() throws NoSuchMethodException { String actualResult = getParameterNameWithMethodNameAndParamIndex(TEST_METHOD_10, FIRST_INDEX); assertEquals(NAME, actualResult); }

Target:
public void getParameterName_NoAnnotations() throws NoSuchMethodException { String actualRes = getParameterNameWithMethodNameAndParamIndex(TEST_METHOD_10, FIRST_INDEX); assertEquals(NAME, actualRes); }
Source:
TaskData getTaskData(AbstractRepositoryConnector connector, IProgressMonitor monitor) throws CoreException { if (taskId != null) { try { return connector.getTaskData(repository, taskId, monitor); } catch (Exception e) { TaskData taskData = getTaskDataByKey(connector, monitor); if (taskData != null) { return taskData; } else { throw e; } } } else { return getTaskDataByKey(connector, monitor); } }

Target:
TaskData getTaskData(AbstractRepositoryConnector connector, IProgressMonitor monitor) throws CoreException { if (taskId != null) { return connector.getTaskData(repository, taskId, monitor); } else if (taskKey != null && connector.supportsSearchByTaskKey(repository)) { TaskData searchTaskData = connector.searchByTaskKey(repository, taskKey, monitor); if (searchTaskData.isPartial()) { return connector.getTaskData(repository, searchTaskData.getTaskId(), monitor); } else { return searchTaskData; } } return null; }
Source:
@Override public void implementNotNullAdd(AggContext info, AggAddContext add) { Expression acc = add.accumulator().get(0); Expression arg = add.arguments().get(0); SqlAggFunction aggregation = info.aggregation(); final Method method = (aggregation == BIT_AND ? BuiltInMethod.BIT_AND : (aggregation == BIT_OR ? BuiltInMethod.BIT_OR : BuiltInMethod.BIT_XOR)).method; Expression next = Expressions.call( method.getDeclaringClass(), method.getName(), acc, Expressions.unbox(arg)); accAdvance(add, acc, next); }

Target:
@Override public void implementNotNullAdd(AggContext info, AggAddContext add) { Expression acc = add.accumulator().get(0); Expression arg = add.arguments().get(0); SqlAggFunction aggregation = info.aggregation(); final BuiltInMethod builtInMethod; switch (aggregation.kind) { case BIT_AND: builtInMethod = BuiltInMethod.BIT_AND; break; case BIT_OR: builtInMethod = BuiltInMethod.BIT_OR; break; case BIT_XOR: builtInMethod = BuiltInMethod.BIT_XOR; break; default: throw new IllegalArgumentException("Unknown " + aggregation.getName() + ". Only support bit_and, bit_or and bit_xor for bit aggregation function"); } final Method method = builtInMethod.method; Expression next = Expressions.call( method.getDeclaringClass(), method.getName(), acc, Expressions.unbox(arg)); accAdvance(add, acc, next); }
Source:
public final void stop() { List<Runnable> pending = null; synchronized (this) { if (running.compareAndSet(true, false)) { LOGGER.info("Stopping DTLS connector on [{}]", lastBindAddress); receiver.interrupt(); if (socket != null) { socket.close(); socket = null; } maximumTransmissionUnit = 0; if (externalExecutor == null) { pending = executor.shutdownNow(); executor = null; } if (externalExecutor != timer) { timer.shutdownNow(); timer = null; } } } if (pending != null) { for (Runnable job : pending) { job.run(); } } }

Target:
public final void stop() { ExecutorService shutdown = null; List<Runnable> pending = null; synchronized (this) { if (running.compareAndSet(true, false)) { LOGGER.info("Stopping DTLS connector on [{}]", lastBindAddress); receiver.interrupt(); if (socket != null) { socket.close(); socket = null; } maximumTransmissionUnit = 0; if (externalExecutor == null) { pending = executor.shutdownNow(); shutdown = executor; executor = null; } if (externalExecutor != timer) { timer.shutdownNow(); timer = null; } } } if (shutdown != null) { try { if (!shutdown.awaitTermination(500, TimeUnit.MILLISECONDS)) { LOGGER.warn("Shutdown DTLS connector on not terminated in time!", lastBindAddress); } } catch (InterruptedException e) { } } if (pending != null) { for (Runnable job : pending) { job.run(); } } }
Source:
public void onEntityCollidedWithBlock(IAlchemyArray array, World world, BlockPos pos, IBlockState state, Entity entity) { double motionY = 1; double motionYGlowstoneMod = 0.1; double motionYFeatherMod = 0.05; entity.fallDistance = 0; TileAlchemyArray tileArray = (TileAlchemyArray) array; entity.motionY = motionY + motionYGlowstoneMod * (tileArray.getStackInSlot(0).getCount() - 1) + motionYFeatherMod * (tileArray.getStackInSlot(1).getCount() - 1); }

Target:
public void onEntityCollidedWithBlock(IAlchemyArray array, World world, BlockPos pos, IBlockState state, Entity entity) { double motionY = 1; double motionYGlowstoneMod = 0.1; double motionYFeatherMod = 0.05; entity.fallDistance = 0; TileAlchemyArray tileArray = (TileAlchemyArray) array; motionY += motionYGlowstoneMod * (tileArray.getStackInSlot(0).getCount() - 1); motionY += motionYFeatherMod * (tileArray.getStackInSlot(1).getCount() - 1); entity.motionY = motionY; }
Source:
private boolean shouldAddImage(String uriStr) { return uriStr != null && !isTokenString(uriStr) && isValidURI(uriStr); }

Target:
private boolean shouldAddImage(String uriStr) { return uriStr != null && isValidURI(uriStr); }
Source:
public void testApplicationSelectInsertWithAPI() throws Exception { try { LocalMode lma = LocalMode.newInstance(); Configuration conf = new Configuration(false); lma.prepareDAG(new KafkaApplication(kafka.getBroker(), testTopicData0, testTopicResult), conf); LocalMode.Controller lc = lma.getController(); lc.runAsync(); kafka.publish(testTopicData0, Arrays.asList("15/02/2016 10:15:00 +0000,1,paint1,11", "15/02/2016 10:16:00 +0000,2,paint2,12", "15/02/2016 10:17:00 +0000,3,paint3,13", "15/02/2016 10:18:00 +0000,4,paint4,14", "15/02/2016 10:19:00 +0000,5,paint5,15", "15/02/2016 10:10:00 +0000,6,abcde6,16")); String[] expectedLines = new String[]{"15/02/2016 10:18:00 +0000,15/02/2016 00:00:00 +0000,OILPAINT4\r\n", "15/02/2016 10:19:00 +0000,15/02/2016 00:00:00 +0000,OILPAINT5\r\n"}; List<String> consume = kafka.consume(testTopicResult, 30000); Assert.assertTrue(Arrays.deepEquals(consume.toArray(new String[consume.size()]), expectedLines)); lc.shutdown(); } catch (Exception e) { e.printStackTrace(); Assert.fail("constraint violations: " + e); } }

Target:
public void testApplicationSelectInsertWithAPI() throws Exception { try { LocalMode lma = LocalMode.newInstance(); Configuration conf = new Configuration(false); lma.prepareDAG(new KafkaApplication(kafka.getBroker(), testTopicData0, testTopicResult), conf); LocalMode.Controller lc = lma.getController(); lc.runAsync(); kafka.publish(testTopicData0, Arrays.asList("15/02/2016 10:15:00 +0000,1,paint1,11", "15/02/2016 10:16:00 +0000,2,paint2,12", "15/02/2016 10:17:00 +0000,3,paint3,13", "15/02/2016 10:18:00 +0000,4,paint4,14", "15/02/2016 10:19:00 +0000,5,paint5,15", "15/02/2016 10:10:00 +0000,6,abcde6,16")); String[] expectedLines = new String[]{"15/02/2016 10:18:00 +0000,15/02/2016 00:00:00 +0000,OILPAINT4\r\n", "15/02/2016 10:19:00 +0000,15/02/2016 00:00:00 +0000,OILPAINT5\r\n"}; List<String> consume = kafka.consume(testTopicResult, 30000); Assert.assertTrue(Arrays.deepEquals(consume.toArray(new String[consume.size()]), expectedLines)); lc.shutdown(); } catch (Exception e) { Assert.fail("constraint violations: " + e); } }
Source:
public List<Callable<DocumentRevsList>> createTasks(List<String> ids, Map<String, Collection<String>> revisions) { List<Callable<DocumentRevsList>> tasks = new ArrayList<Callable<DocumentRevsList>>(); for(String id : ids) { HashSet<String> possibleAncestors = new HashSet<String>(); for (String revId : revisions.get(id)) { List<String> thesePossibleAncestors = targetDb.getDbCore().getPossibleAncestorRevisionIDs(id, revId, 50); if (thesePossibleAncestors != null) { possibleAncestors.addAll(thesePossibleAncestors); } } tasks.add(GetRevisionTask.createGetRevisionTask(this.sourceDb, id, revisions.get(id), possibleAncestors)); } return tasks; }

Target:
public List<Callable<DocumentRevsList>> createTasks(List<String> ids, Map<String, Collection<String>> revisions) { List<Callable<DocumentRevsList>> tasks = new ArrayList<Callable<DocumentRevsList>>(); for(String id : ids) { HashSet<String> possibleAncestors = new HashSet<String>(); for (String revId : revisions.get(id)) { List<String> thesePossibleAncestors = targetDb.getDbCore().getPossibleAncestorRevisionIDs(id, revId, 50); if (thesePossibleAncestors != null) { possibleAncestors.addAll(thesePossibleAncestors); } } tasks.add(GetRevisionTask.createGetRevisionTask(this.sourceDb, id, revisions.get(id), possibleAncestors, config.pullAttachmentsInline)); } return tasks; }
Source:
public boolean checkTrigger(GameEvent event, Game game) { Permanent enchantment = game.getPermanent(this.getSourceId()); UUID controller = this.getControllerId(); if (enchantment != null && enchantment.getAttachedTo() != null && game.getCombat().getPlayerDefenders(game).contains(enchantment.getAttachedTo())) { if (game.getCombat().getAttackerId() != controller) { for (Effect effect: this.getEffects()) { effect.setTargetPointer(new FixedTarget(game.getCombat().getAttackerId())); } } return true; } return false; }

Target:
public boolean checkTrigger(GameEvent event, Game game) { Permanent enchantment = game.getPermanentOrLKIBattlefield(this.getSourceId()); UUID controller = this.getControllerId(); if (enchantment != null && enchantment.getAttachedTo() != null && game.getCombat().getPlayerDefenders(game).contains(enchantment.getAttachedTo())) { if (!game.getCombat().getAttackerId().equals(controller)) { for (Effect effect: this.getEffects()) { effect.setTargetPointer(new FixedTarget(game.getCombat().getAttackerId())); } } return true; } return false; }
Source:
protected String configure(final String args[]) { configureSecurityManager(); configureRMAndProActiveHomes(); configureProActiveDefaultConfigurationFile(); try { loadSigarIfRunningWithOneJar(); } catch (Exception e) { logger.warn("Sigar will not be loaded, as it is not supported by the underlying OS."); } String nodeName = parseCommandLine(args); configureLogging(nodeName); logger.info("ProActive Node version is " + Version.PA_VERSION); logger.info("Using ProActive configuration file : " + System.getProperty(CentralPAPropertyRepository.PA_CONFIGURATION_FILE.getName())); selectNetworkInterface(); readAndSetTheRank(); return nodeName; }

Target:
protected String configure(final String args[]) { configureSecurityManager(); configureRMAndProActiveHomes(); configureProActiveDefaultConfigurationFile(); loadSigarIfRunningWithOneJar(); String nodeName = parseCommandLine(args); configureLogging(nodeName); logger.info("ProActive Node version is " + Version.PA_VERSION); logger.info("Using ProActive configuration file : " + System.getProperty(CentralPAPropertyRepository.PA_CONFIGURATION_FILE.getName())); selectNetworkInterface(); readAndSetTheRank(); return nodeName; }