auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
@Test public void testWindowOnSortedInput() { Tester tester = new TesterImpl(getDiffRepos(), true, true, false, false, true, null, null) { @Override public RelOptPlanner createPlanner() { return new MockRelOptPlanner(Contexts.empty()) { @Override public List<RelTraitDef> getRelTraitDefs() { return ImmutableList.of(RelCollationTraitDef.INSTANCE); } @Override public RelTraitSet emptyTraitSet() { return RelTraitSet.createEmpty().plus( RelCollationTraitDef.INSTANCE.getDefault()); } }; } }; final HepProgram preProgram = new HepProgramBuilder() .addRuleInstance(SortProjectTransposeRule.INSTANCE) .build(); final HepProgram program = HepProgram.builder() .addRuleInstance(ProjectToWindowRule.PROJECT) .build(); final String sql = "select mgr, deptno, sum(sal) over (partition by deptno)\n" + "from emp\n" + "order by mgr, deptno"; RelNode r = checkPlanning(tester, preProgram, new HepPlanner(program), sql); RelCollation c = r.getInput(0).getTraitSet().getTrait(RelCollationTraitDef.INSTANCE); assertEquals("Collation is incorrect", "[3, 7]", c.toString()); }

Target:
@Test public void testWindowOnSortedInput() { Tester tester = new TesterImpl(getDiffRepos(), true, true, false, false, true, null, null) { @Override public RelOptPlanner createPlanner() { return new MockRelOptPlanner(Contexts.empty()) { @Override public List<RelTraitDef> getRelTraitDefs() { return ImmutableList.of(RelCollationTraitDef.INSTANCE); } @Override public RelTraitSet emptyTraitSet() { return RelTraitSet.createEmpty().plus( RelCollationTraitDef.INSTANCE.getDefault()); } }; } }; final HepProgram preProgram = new HepProgramBuilder() .addRuleInstance(SortProjectTransposeRule.INSTANCE) .build(); final HepProgram program = HepProgram.builder() .addRuleInstance(ProjectToWindowRule.PROJECT) .build(); final String sql = "select mgr, deptno, sum(sal) over (partition by deptno)\n" + "from emp\n" + "order by mgr, deptno"; RelNode r = checkPlanning(tester, preProgram, new HepPlanner(program), sql); RelCollation ci = r.getInput(0).getTraitSet().getTrait(RelCollationTraitDef.INSTANCE); assertEquals("Window collation is incorrect", "[3, 7]", ci.toString()); RelCollation co = r.getTraitSet().getTrait(RelCollationTraitDef.INSTANCE); assertEquals("Project collation is incorrect", "[0, 1]", co.toString()); }
Source:
public RangeOptions scanMetadataTable() { this.table = MetadataTable.NAME; return this; }

Target:
public RangeOptions scanMetadataTable() { return scanTable(MetadataTable.NAME); }
Source:
public int run() throws IOException { Preconditions.checkArgument(samplePaths != null && !samplePaths.isEmpty(), "Sample CSV path is required"); Preconditions.checkArgument(samplePaths.size() == 1, "Only one CSV sample can be given"); if (header != null) { noHeader = true; } CSVProperties props = new CSVProperties.Builder() .delimiter(delimiter) .escape(escape) .quote(quote) .header(header) .hasHeader(!noHeader) .linesToSkip(linesToSkip) .charset(charsetName) .build(); Set<String> required = ImmutableSet.of(); if (requiredFields != null) { required = ImmutableSet.copyOf(requiredFields); } HashMap<String,String> types = new HashMap<String,String>(); if (fieldTypes != null) { for (String fieldType : fieldTypes) { String[] ft = fieldType.split("=", 2); types.put(ft[0], ft[1]); } } String sampleSchema = CSVUtil .inferNullableSchema( recordName, open(samplePaths.get(0)), props, required, types) .toString(!minimize); output(sampleSchema, console, outputPath); return 0; }

Target:
public int run() throws IOException { Preconditions.checkArgument(samplePaths != null && !samplePaths.isEmpty(), "Sample CSV path is required"); Preconditions.checkArgument(samplePaths.size() == 1, "Only one CSV sample can be given"); if (header != null) { noHeader = true; } CSVProperties props = new CSVProperties.Builder() .delimiter(delimiter) .escape(escape) .quote(quote) .header(header) .hasHeader(!noHeader) .linesToSkip(linesToSkip) .charset(charsetName) .build(); Set<String> required = ImmutableSet.of(); if (requiredFields != null) { required = ImmutableSet.copyOf(requiredFields); } String sampleSchema = CSVUtil .inferNullableSchema( recordName, open(samplePaths.get(0)), props, required, fieldTypes) .toString(!minimize); output(sampleSchema, console, outputPath); return 0; }
Source:
public ScheduledExecutorService getTimerExecutor() { if (timerExecutor == null) { timerExecutor = Executors.newScheduledThreadPool(1, new DaemonThreadFactory(new ThreadGroup("weld-workers"), "weld-timer-")); } return timerExecutor; }

Target:
public ScheduledExecutorService getTimerExecutor() { return timerExecutor; }
Source:
public LogRecord<M> read(Duration timeout) throws InterruptedException { LogRecord<M> ret = read(); if (ret != null) { return ret; } final long timeoutMs = timeout.toMillis(); final long deadline = System.currentTimeMillis() + timeoutMs; final long delay = Math.min(POLL_INTERVAL_MS, timeoutMs); while (ret == null && System.currentTimeMillis() < deadline) { Thread.sleep(delay); ret = read(); } return ret; }

Target:
public LogRecord<M> read(Duration timeout) throws InterruptedException { LogRecord<M> ret = read(); if (ret != null) { return ret; } long timeoutMs = timeout.toMillis(); long deadline = System.currentTimeMillis() + timeoutMs; long delay = Math.min(POLL_INTERVAL_MS, timeoutMs); while (ret == null && System.currentTimeMillis() < deadline) { Thread.sleep(delay); ret = read(); } return ret; }
Source:
private void scheduleManagerUpdate(IContributionManager mgr) { boolean workaroundEnabled = Boolean.getBoolean("eclipse.workaround.bug467000"); if (!workaroundEnabled) { mgr.update(false); return; } synchronized (mgrToUpdate) { if (this.mgrToUpdate.isEmpty()) { Display display = context.get(Display.class); if (display != null && !display.isDisposed()) { display.timerExec(100, new Runnable() { @Override public void run() { Collection<IContributionManager> toUpdate = new LinkedHashSet<>(); synchronized (mgrToUpdate) { toUpdate.addAll(mgrToUpdate); mgrToUpdate.clear(); } for (IContributionManager mgr : toUpdate) { mgr.update(false); } } }); } this.mgrToUpdate.add(mgr); } } }

Target:
private void scheduleManagerUpdate(IContributionManager mgr) { boolean workaroundEnabled = Boolean.getBoolean(ECLIPSE_WORKAROUND_BUG467000); if (!workaroundEnabled) { mgr.update(false); return; } synchronized (mgrToUpdate) { if (this.mgrToUpdate.isEmpty()) { Display display = context.get(Display.class); if (display != null && !display.isDisposed()) { display.timerExec(100, new Runnable() { @Override public void run() { Collection<IContributionManager> toUpdate = new LinkedHashSet<>(); synchronized (mgrToUpdate) { toUpdate.addAll(mgrToUpdate); mgrToUpdate.clear(); } for (IContributionManager mgr : toUpdate) { mgr.update(false); } } }); } this.mgrToUpdate.add(mgr); } } }
Source:
public HistorySearchBar(String id, CommitGraphTable graph, IAction openCloseAction, IActionBars bars) { super(id, graph, openCloseAction); this.bars = bars; }

Target:
public HistorySearchBar(String id, CommitGraphTable graph, IAction openCloseAction, IActionBars bars) { super(id, graph); this.bars = bars; this.openCloseToggle = openCloseAction; super.setVisible(false); }
Source:
static String getProtectedPrefix(final String protectedId) { return PROTECTED_PREFIX + protectedId + PROTECTED_SEPARATOR; }

Target:
public static String getProtectedPrefix(final String protectedId) { return PROTECTED_PREFIX + protectedId + PROTECTED_SEPARATOR; }
Source:
public static TimestampString literalValue(RexNode node, TimeZone timeZone) { switch (node.getKind()) { case LITERAL: switch (((RexLiteral) node).getTypeName()) { case TIMESTAMP_WITH_LOCAL_TIME_ZONE: return ((RexLiteral) node).getValueAs(TimestampString.class); case TIMESTAMP: final TimestampString t = ((RexLiteral) node).getValueAs(TimestampString.class); return new TimestampWithTimeZoneString(t.toString() + " " + timeZone.getID()) .withTimeZone(DateTimeUtils.UTC_ZONE).getLocalTimestampString(); case DATE: final DateString d = ((RexLiteral) node).getValueAs(DateString.class); return new TimestampWithTimeZoneString( TimestampString.fromMillisSinceEpoch( d.getMillisSinceEpoch()).toString() + " " + timeZone.getID()) .withTimeZone(DateTimeUtils.UTC_ZONE).getLocalTimestampString(); } break; case CAST: assert node instanceof RexCall; final RexCall call = (RexCall) node; final RexNode operand = call.getOperands().get(0); final RelDataType callType = call.getType(); final RelDataType operandType = operand.getType(); if (operand.getKind() == SqlKind.LITERAL && callType.getSqlTypeName() == operandType.getSqlTypeName() && (callType.getSqlTypeName() == SqlTypeName.DATE || callType.getSqlTypeName() == SqlTypeName.TIMESTAMP || callType.getSqlTypeName() == SqlTypeName.TIMESTAMP_WITH_LOCAL_TIME_ZONE) && callType.isNullable() && !operandType.isNullable()) { return literalValue(operand, timeZone); } } return null; }

Target:
protected static TimestampString literalValue(RexNode node, TimeZone timeZone) { switch (node.getKind()) { case LITERAL: switch (((RexLiteral) node).getTypeName()) { case TIMESTAMP_WITH_LOCAL_TIME_ZONE: return ((RexLiteral) node).getValueAs(TimestampString.class); case TIMESTAMP: final TimestampString t = ((RexLiteral) node).getValueAs(TimestampString.class); return new TimestampWithTimeZoneString(t.toString() + " " + timeZone.getID()) .withTimeZone(DateTimeUtils.UTC_ZONE).getLocalTimestampString(); case DATE: final DateString d = ((RexLiteral) node).getValueAs(DateString.class); return new TimestampWithTimeZoneString( TimestampString.fromMillisSinceEpoch( d.getMillisSinceEpoch()).toString() + " " + timeZone.getID()) .withTimeZone(DateTimeUtils.UTC_ZONE).getLocalTimestampString(); } break; case CAST: assert node instanceof RexCall; final RexCall call = (RexCall) node; final RexNode operand = call.getOperands().get(0); final RelDataType callType = call.getType(); final RelDataType operandType = operand.getType(); if (operand.getKind() == SqlKind.LITERAL && callType.getSqlTypeName() == operandType.getSqlTypeName() && (callType.getSqlTypeName() == SqlTypeName.DATE || callType.getSqlTypeName() == SqlTypeName.TIMESTAMP || callType.getSqlTypeName() == SqlTypeName.TIMESTAMP_WITH_LOCAL_TIME_ZONE) && callType.isNullable() && !operandType.isNullable()) { return literalValue(operand, timeZone); } } return null; }
Source:
public static Optional<SchemaTableName> getSourceTableNameFromSystemTable(SchemaTableName tableName) { for (SystemTableHandler handler : ImmutableList.of(partitionsTableHandler, propertiesTableHandler)) { if (handler.matches(tableName)) { SchemaTableName sourceTableName = handler.getSourceTableName(tableName); return Optional.of(sourceTableName); } } return Optional.empty(); }

Target:
public static Optional<SchemaTableName> getSourceTableNameFromSystemTable(SchemaTableName tableName) { return Stream.of(PARTITIONS_TABLE_HANDLER, PROPERTIES_TABLE_HANDLER) .filter(handler -> handler.matches(tableName)) .map(handler -> handler.getSourceTableName(tableName)) .findAny(); }
Source:
public static List<List<String>> findComponentCycles(StormTopology topology, String topoId) { List<List<String>> ret = new ArrayList<>(); Map<String, Set<String>> edgesOut = getStormTopologyForwardGraph(topology); Set<String> allComponentIds = new HashSet<>(); edgesOut.forEach((k, v) -> { allComponentIds.add(k) ; allComponentIds.addAll(v); }); if (topology.get_spouts_size() == 0) { LOG.error("Topology does not contain any spouts, cannot traverse graph to determine cycles", topoId); ret.add(new ArrayList(edgesOut.keySet())); return ret; } Set<String> unreachable = new HashSet<>(edgesOut.keySet()); topology.get_spouts().forEach((spoutId, spout) -> { Stack<String> dfsStack = new Stack<>(); dfsStack.push(spoutId); Set<String> seen = new HashSet<>(); seen.add(spoutId); findComponentCyclesRecursion(dfsStack, edgesOut, seen, ret); unreachable.removeAll(seen); }); if (!unreachable.isEmpty()) { LOG.warn("Topology contains unreachable components \"{}\"", topoId, String.join(",", unreachable)); } if (!ret.isEmpty()) { LOG.error("Topology contains cycles {}", topoId, ret.stream() .map(x -> String.join(",", x)) .collect(Collectors.joining(" ; ")) ); } return ret; }

Target:
public static List<List<String>> findComponentCycles(StormTopology topology, String topoId) { List<List<String>> ret = new ArrayList<>(); Map<String, Set<String>> edgesOut = getStormTopologyForwardGraph(topology); Set<String> allComponentIds = new HashSet<>(); edgesOut.forEach((k, v) -> { allComponentIds.add(k) ; allComponentIds.addAll(v); }); if (topology.get_spouts_size() == 0) { LOG.error("Topology does not contain any spouts, cannot traverse graph to determine cycles", topoId); return ret; } Set<String> unreachable = new HashSet<>(edgesOut.keySet()); topology.get_spouts().forEach((spoutId, spout) -> { Stack<String> dfsStack = new Stack<>(); dfsStack.push(spoutId); Set<String> seen = new HashSet<>(); seen.add(spoutId); findComponentCyclesRecursion(dfsStack, edgesOut, seen, ret); unreachable.removeAll(seen); }); if (!unreachable.isEmpty()) { LOG.warn("Topology contains unreachable components \"{}\"", topoId, String.join(",", unreachable)); } return ret; }
Source:
protected void executeQueryCommand() { if (MultiLevelAdministrationHandler.isAdminUser(getUser())) { VmDeviceDAO dao = getDbFacade().getVmDeviceDao(); List<VmDevice> disks = dao.getVmDeviceByVmIdAndType(getParameters().getId(), VmDeviceGeneralType.DISK); for (VmDevice disk : disks) { if (VmPayload.isPayload(disk.getSpecParams())) { VmPayload payload = new VmPayload(disk); payload.setDeviceType(VmDeviceType.valueOf(disk.getDevice().toUpperCase())); for (Map.Entry<String, String> entry : payload.getFiles().entrySet()) { entry.setValue(new String(Base64.decodeBase64(entry.getValue()))); } getQueryReturnValue().setReturnValue(payload); } } } }

Target:
protected void executeQueryCommand() { if (MultiLevelAdministrationHandler.isAdminUser(getUser())) { VmDeviceDAO dao = getDbFacade().getVmDeviceDao(); List<VmDevice> disks = dao.getVmDeviceByVmIdAndType(getParameters().getId(), VmDeviceGeneralType.DISK); for (VmDevice disk : disks) { if (VmPayload.isPayload(disk.getSpecParams())) { VmPayload payload = new VmPayload(disk); for (Map.Entry<String, String> entry : payload.getFiles().entrySet()) { entry.setValue(new String(Base64.decodeBase64(entry.getValue()))); } getQueryReturnValue().setReturnValue(payload); } } } }
Source:
protected void sendReplies(Object processorResult, Message message) { Object replyChannelHeader = null; if (message != null) { replyChannelHeader = message.getHeaders().getReplyChannel(); } if (StringUtils.hasText(this.outputChannelName)) { synchronized (this) { if (this.outputChannelName != null) { try { this.outputChannel = getBeanFactory().getBean(this.outputChannelName, MessageChannel.class); this.outputChannelName = null; } catch (BeansException e) { throw new DestinationResolutionException("Failed to look up MessageChannel with name '" + this.outputChannelName + "' in the BeanFactory."); } } } } Object replyChannel = this.outputChannel; if (this.outputChannel == null) { replyChannel = replyChannelHeader; } Assert.notNull(replyChannel, "no outputChannel or replyChannel header available"); if (processorResult instanceof Iterable<?> && shouldSendMultipleReplies((Iterable<?>) processorResult)) { for (Object next : (Iterable<?>) processorResult) { this.sendReplyMessage(next, replyChannel); } } else { this.sendReplyMessage(processorResult, replyChannel); } }

Target:
protected void sendReplies(Object processorResult, Message message) { Object replyChannelHeader = null; if (message != null) { replyChannelHeader = message.getHeaders().getReplyChannel(); } if (this.outputChannelName != null) { synchronized (this) { if (this.outputChannelName != null) { try { this.outputChannel = getBeanFactory().getBean(this.outputChannelName, MessageChannel.class); this.outputChannelName = null; } catch (BeansException e) { throw new DestinationResolutionException("Failed to look up MessageChannel with name '" + this.outputChannelName + "' in the BeanFactory."); } } } } Object replyChannel = this.outputChannel; if (this.outputChannel == null) { replyChannel = replyChannelHeader; } Assert.notNull(replyChannel, "no outputChannel or replyChannel header available"); if (processorResult instanceof Iterable<?> && shouldSendMultipleReplies((Iterable<?>) processorResult)) { for (Object next : (Iterable<?>) processorResult) { this.sendReplyMessage(next, replyChannel); } } else { this.sendReplyMessage(processorResult, replyChannel); } }
Source:
protected boolean checkCanDisableVirtIoScsi() { VmValidator vmValidator = createVmValidator(vmFromConfiguration); if (Boolean.FALSE.equals(getParameters().isVirtioScsiEnabled()) && !validate(vmValidator.canDisableVirtioScsi(getAdjustedDiskImagesFromConfiguration()))) { return false; } else return true; }

Target:
protected boolean checkCanDisableVirtIoScsi() { VmValidator vmValidator = createVmValidator(vmFromConfiguration); if (Boolean.FALSE.equals(getParameters().isVirtioScsiEnabled()) && !validate(vmValidator.canDisableVirtioScsi(getAdjustedDiskImagesFromConfiguration()))) { return false; } else { return true; } }
Source:
public boolean hasPermission( Authentication authentication, Object targetDomainObject, Object permission) { if (authorizationServiceFacade == null) { authorizationServiceFacade = AuthorizationServiceFacade.instance(); } final IAuthorizationPrincipal principal = getAuthorizationPrincipal(authentication); String targetId = null; if (targetDomainObject instanceof String) { targetId = (String) targetDomainObject; } else if (targetDomainObject instanceof JsonEntityBean) { targetId = ((JsonEntityBean) targetDomainObject).getTargetString(); } AuthorizableActivity activity = null; if (permission instanceof AuthorizableActivity) { activity = (AuthorizableActivity) permission; } else if (permission instanceof String) { String activityName = (String) permission; activity = getViewActivity(activityName, (JsonEntityBean) targetDomainObject); } else { throw new RuntimeException( "Unable to determine permission target id for type " + targetDomainObject.getClass()); } if (this.logger.isTraceEnabled()) { logger.trace( String.format( "In hasPermission() - owner=[%s], activity=[%s], targetId=[%s] ", activity.getOwnerFname(), activity.getActivityFname(), targetId)); } if (activity != null) { final boolean hasPermission = principal.hasPermission( activity.getOwnerFname(), activity.getActivityFname(), targetId); return hasPermission; } else { return false; } }

Target:
public boolean hasPermission( Authentication authentication, Object targetDomainObject, Object permission) { if (authorizationServiceFacade == null) { authorizationServiceFacade = AuthorizationServiceFacade.instance(); } final IAuthorizationPrincipal principal = getAuthorizationPrincipal(authentication); String targetId = null; if (targetDomainObject instanceof String) { targetId = (String) targetDomainObject; } else if (targetDomainObject instanceof JsonEntityBean) { targetId = ((JsonEntityBean) targetDomainObject).getTargetString(); } AuthorizableActivity activity = null; if (permission instanceof AuthorizableActivity) { activity = (AuthorizableActivity) permission; } else if (permission instanceof String) { String activityName = (String) permission; activity = getViewActivity(activityName, (JsonEntityBean) targetDomainObject); } else { throw new RuntimeException( "Unable to determine permission target id for type " + targetDomainObject.getClass()); } logger.trace( "In hasPermission() - owner=[{}], activity=[{}], targetId=[{}] ", activity.getOwnerFname(), activity.getActivityFname(), targetId); if (activity != null) { final boolean hasPermission = principal.hasPermission( activity.getOwnerFname(), activity.getActivityFname(), targetId); return hasPermission; } else { return false; } }
Source:
public void addCurrentReviewers(ChangeAttribute a, Change change) throws OrmException { String approvaltype = "Code-Review"; a.currentReviewers = Lists.newArrayList(); PatchSet.Id psid = change.currentPatchSetId(); for (PatchSetApproval psa : db.get().patchSetApprovals().byPatchSet(psid)) { if(psa.getLabel().equals(approvaltype)) a.currentReviewers.add(asAccountAttribute(psa.getAccountId())); } }

Target:
public void addCurrentReviewers(ChangeAttribute a, Change change) throws OrmException { a.currentReviewers = Lists.newArrayList(); ArrayList<Object> accountIdlist = Lists.newArrayList(); PatchSet.Id psid = change.currentPatchSetId(); for (PatchSetApproval psa : db.get().patchSetApprovals().byPatchSet(psid)) { Account.Id accountId = psa.getAccountId(); if (!accountIdlist.contains(accountId)) { accountIdlist.add(accountId); a.currentReviewers.add(asAccountAttribute(psa.getAccountId())); } } if (a.currentReviewers.isEmpty()) { a.currentReviewers = null; } }
Source:
protected void postShutdown() { logger().debug("Shutting down the elasticsearch index provider '{0}' in repository '{1}'", getName(), getRepositoryName()); try { client.close(); esNode.stop(); } catch (Exception e) { } }

Target:
protected void postShutdown() { logger().debug("Shutting down the elasticsearch index provider '{0}' in repository '{1}'", getName(), getRepositoryName()); }
Source:
private void ensureState() { if (version == null) { version = Constants.HeaderConstants.TARGET_STORAGE_VERSION; } if (ImplUtils.isNullOrEmpty(blobName)) { resource = SAS_CONTAINER_CONSTANT; } else if (snapshotId != null) { resource = SAS_BLOB_SNAPSHOT_CONSTANT; } else { resource = SAS_BLOB_CONSTANT; } if (permissions != null) { switch (resource) { case SAS_BLOB_CONSTANT: case SAS_BLOB_SNAPSHOT_CONSTANT: permissions = BlobSasPermission.parse(permissions).toString(); break; case SAS_CONTAINER_CONSTANT: permissions = BlobContainerSasPermission.parse(permissions).toString(); break; default: logger.info("Not re-parsing permissions. Resource type '{}' is unknown.", resource); break; } } }

Target:
private void ensureState() { if (version == null) { version = BlobServiceVersion.getLatest().getVersion(); } if (ImplUtils.isNullOrEmpty(blobName)) { resource = SAS_CONTAINER_CONSTANT; } else if (snapshotId != null) { resource = SAS_BLOB_SNAPSHOT_CONSTANT; } else { resource = SAS_BLOB_CONSTANT; } if (permissions != null) { switch (resource) { case SAS_BLOB_CONSTANT: case SAS_BLOB_SNAPSHOT_CONSTANT: permissions = BlobSasPermission.parse(permissions).toString(); break; case SAS_CONTAINER_CONSTANT: permissions = BlobContainerSasPermission.parse(permissions).toString(); break; default: logger.info("Not re-parsing permissions. Resource type '{}' is unknown.", resource); break; } } }
Source:
private Job createSaveJob() { Job job = new UIJob("Saving") { @Override public IStatus runInUIThread(IProgressMonitor monitor) { currentEditor.doSave(new NullProgressMonitor()); if (!browser.isDisposed()) { refresh(browser); } return Status.OK_STATUS; } }; return job; }

Target:
private Job createSaveJob() { Job job = new UIJob("HTML Preview: Saving " + currentEditor.getTitle()) { @Override public IStatus runInUIThread(IProgressMonitor monitor) { currentEditor.doSave(new NullProgressMonitor()); if (!browser.isDisposed()) { refresh(browser); } return Status.OK_STATUS; } }; return job; }
Source:
private void setLoggedInUser(User user, Session session) { if (mSession != session) { mSession = session; updateSessionExpiryWithTimezone(); } if (mSession != null) { Cookies.setCookie(COOKIE_KEY_TOKEN, mSession.token, mSession.expires); Date nextYear = new Date(); CalendarUtil.addMonthsToDate(nextYear, 12); if (mSession.user != null && mSession.user.username != null) { Cookies.setCookie(COOKIE_KEY_LAST_USER, mSession.user.username, nextYear); } } else { Cookies.removeCookie(COOKIE_KEY_TOKEN); } if (mLoggedInUser != user) { mLoggedInUser = user; MixPanelApiHelper.trackLoginUser(mLoggedInUser); if (mLoggedInUser == null) { DefaultEventBus.get().fireEventFromSource(new UserLoggedOut(), SessionController.this); } else { DefaultEventBus.get().fireEventFromSource(new UserLoggedIn(mLoggedInUser, mSession), SessionController.this); } } }

Target:
private void setLoggedInUser(User user, Session session) { if (mSession != session) { mSession = session; updateSessionExpiryWithTimezone(); } if (mSession != null) { Cookies.setCookie(COOKIE_KEY_TOKEN, mSession.token, mSession.expires); if (mSession.user != null && mSession.user.username != null) { Cookies.setCookie(COOKIE_KEY_LAST_USER, mSession.user.username); } } else { Cookies.removeCookie(COOKIE_KEY_TOKEN); } if (mLoggedInUser != user) { mLoggedInUser = user; MixPanelApiHelper.trackLoginUser(mLoggedInUser); if (mLoggedInUser == null) { DefaultEventBus.get().fireEventFromSource(new UserLoggedOut(), SessionController.this); } else { DefaultEventBus.get().fireEventFromSource(new UserLoggedIn(mLoggedInUser, mSession), SessionController.this); } } }
Source:
private static Map<String, String> getOldStyleUserMetadataAsHashMap(byte[] userMetadata) throws UnsupportedEncodingException { int totalSize = userMetadata.length; Map<String, String> toReturn = new HashMap<String, String>(); int sizeRead = 0; int counter = 0; ByteBuffer userMetadataBuffer = ByteBuffer.wrap(userMetadata); while (sizeRead < totalSize) { String key = Headers.UserMetaData_OldStyle_Prefix + counter++; int sizeToRead = Math.min(totalSize - sizeRead, Max_UserMetadata_Value_Size); byte[] userMetadataPart = new byte[sizeToRead]; userMetadataBuffer.get(userMetadataPart); String value = new String(userMetadataPart, "US-ASCII"); toReturn.put(key, value); sizeRead += sizeToRead; } return toReturn; }

Target:
private static Map<String, String> getOldStyleUserMetadataAsHashMap(byte[] userMetadata) { int totalSize = userMetadata.length; Map<String, String> toReturn = new HashMap<String, String>(); int sizeRead = 0; int counter = 0; while (sizeRead < totalSize) { String key = Headers.UserMetaData_OldStyle_Prefix + counter++; int sizeToRead = Math.min(totalSize - sizeRead, Max_UserMetadata_Value_Size); String value = new String(userMetadata, sizeRead, sizeToRead, StandardCharsets.US_ASCII); toReturn.put(key, value); sizeRead += sizeToRead; } return toReturn; }
Source:
public void test12() throws InterruptedException { log.info("Test12 - Test output attributes and its types for table"); SiddhiManager siddhiManager = new SiddhiManager(); String streams = "" + "define stream StockStream (symbol string, price float, volume long);" + "@PrimaryKey('symbol') " + "define table StockTable (symbol string, price float, volume long); "; String storeQuery = "" + "from StockTable " + "select * ;"; SiddhiAppRuntime siddhiAppRuntime = siddhiManager.createSiddhiAppRuntime(streams); siddhiAppRuntime.start(); Attribute[] actualAttributeArray = siddhiAppRuntime.getStoreQueryOutputAttributes(SiddhiCompiler.parseStoreQuery (storeQuery)); Attribute symbolAttribute = new Attribute("symbol", Attribute.Type.STRING); Attribute priceAttribute = new Attribute("price", Attribute.Type.FLOAT); Attribute volumeAttribute = new Attribute("volume", Attribute.Type.LONG); Attribute[] expectedAttributeArray = new Attribute[]{symbolAttribute, priceAttribute, volumeAttribute}; AssertJUnit.assertArrayEquals(expectedAttributeArray, actualAttributeArray); storeQuery = "" + "from StockTable " + "select symbol, sum(volume) as totalVolume ;"; actualAttributeArray = siddhiAppRuntime.getStoreQueryOutputAttributes(SiddhiCompiler.parseStoreQuery (storeQuery)); Attribute totalVolumeAttribute = new Attribute("totalVolume", Attribute.Type.LONG); expectedAttributeArray = new Attribute[]{symbolAttribute, totalVolumeAttribute}; AssertJUnit.assertArrayEquals(expectedAttributeArray, actualAttributeArray); }

Target:
public void test12() throws InterruptedException { log.info("Test12 - Test output attributes and its types for table"); SiddhiManager siddhiManager = new SiddhiManager(); String streams = "" + "define stream StockStream (symbol string, price float, volume long);" + "@PrimaryKey('symbol') " + "define table StockTable (symbol string, price float, volume long); "; String storeQuery = "" + "from StockTable " + "select * ;"; SiddhiAppRuntime siddhiAppRuntime = siddhiManager.createSiddhiAppRuntime(streams); siddhiAppRuntime.start(); Attribute[] actualAttributeArray = siddhiAppRuntime.getStoreQueryOutputAttributes(SiddhiCompiler.parseStoreQuery (storeQuery)); Attribute symbolAttribute = new Attribute("symbol", Attribute.Type.STRING); Attribute priceAttribute = new Attribute("price", Attribute.Type.FLOAT); Attribute volumeAttribute = new Attribute("volume", Attribute.Type.LONG); Attribute[] expectedAttributeArray = new Attribute[]{symbolAttribute, priceAttribute, volumeAttribute}; AssertJUnit.assertArrayEquals(expectedAttributeArray, actualAttributeArray); storeQuery = "" + "from StockTable " + "select symbol, sum(volume) as totalVolume ;"; actualAttributeArray = siddhiAppRuntime.getStoreQueryOutputAttributes(SiddhiCompiler.parseStoreQuery (storeQuery)); Attribute totalVolumeAttribute = new Attribute("totalVolume", Attribute.Type.LONG); expectedAttributeArray = new Attribute[]{symbolAttribute, totalVolumeAttribute}; siddhiAppRuntime.shutdown(); AssertJUnit.assertArrayEquals(expectedAttributeArray, actualAttributeArray); }
Source:
public void updateExistingPaymentWorksVendorInStagingTable(Integer id, String kfsVendorProcessingStatus, Integer vendorHeaderGeneratedIdentifier, Integer vendorDetailAssignedIdentifier, Timestamp processingTimeStamp) { updateExistingPaymentWorksVendorInStagingTable(id, null, kfsVendorProcessingStatus, KFSConstants.EMPTY_STRING, KFSConstants.EMPTY_STRING, KFSConstants.EMPTY_STRING, processingTimeStamp, vendorHeaderGeneratedIdentifier, vendorDetailAssignedIdentifier, null); }

Target:
public void updateExistingPaymentWorksVendorInStagingTable(Integer id, String kfsVendorProcessingStatus, Integer vendorHeaderGeneratedIdentifier, Integer vendorDetailAssignedIdentifier, Timestamp processingTimeStamp) { updateExistingPaymentWorksVendorInStagingTable(id, KFSConstants.EMPTY_STRING, kfsVendorProcessingStatus, KFSConstants.EMPTY_STRING, KFSConstants.EMPTY_STRING, KFSConstants.EMPTY_STRING, processingTimeStamp, vendorHeaderGeneratedIdentifier, vendorDetailAssignedIdentifier, null); }
Source:
private int getNumTasks(DatastreamGroup dg, int numInstances) { int numTasks = dg.getDatastreams().stream() .map(ds -> ds.getMetadata().get(CFG_MAX_TASKS)) .filter(Objects::nonNull) .mapToInt(Integer::valueOf) .map(x -> x < 1 ? Integer.MAX_VALUE : x) .max() .orElse(_maxTasks); return _limitTasksToInstanceSize ? Math.min(numTasks, numInstances) : numTasks; }

Target:
private int getNumTasks(DatastreamGroup dg, int numInstances) { int numTasks = dg.getDatastreams().stream() .map(ds -> ds.getMetadata().get(CFG_MAX_TASKS)) .filter(Objects::nonNull) .mapToInt(Integer::valueOf) .map(x -> x < 1 ? Integer.MAX_VALUE : x) .max() .orElse(_maxTasks); return Math.min(numTasks, numInstances * _dsTaskLimitPerInstance); }
Source:
public FEELFnResult<BigDecimal> invoke(@ParameterName("list") List<?> list) { if ( list == null ) { return FEELFnResult.ofError( new InvalidParametersEvent( FEELEvent.Severity.ERROR, "list", "the list cannot be null" ) ); } int length = list.size(); List<Double> intermediate = new ArrayList<>( length ); double total = 0.0; for ( Object o : list ) { if (!(o instanceof Number)) { return FEELFnResult.ofError( new InvalidParametersEvent( FEELEvent.Severity.ERROR, "list", "an element in the list is not suitable for the stddev" ) ); } double val = ((Number) o).doubleValue(); intermediate.add( val ); total += val; } double mean = total/length; double total2 = 0.0; for ( Double val : intermediate) { total2 += Math.pow( val - mean, 2 ); } double mean2 = total2 / ( length - 1 ); BigDecimal result = new BigDecimal( Math.sqrt( mean2 ) ); return FEELFnResult.ofResult( result ); }

Target:
public FEELFnResult<BigDecimal> invoke(@ParameterName("list") List<?> list) { if ( list == null ) { return FEELFnResult.ofError( new InvalidParametersEvent( FEELEvent.Severity.ERROR, "list", "the list cannot be null" ) ); } int n = list.size(); BigDecimal[] numbers = new BigDecimal[n]; for ( int i = 0; i < n; i++ ) { final BigDecimal val = EvalHelper.getBigDecimalOrNull( list.get( i ) ); if ( val == null ) { return FEELFnResult.ofError( new InvalidParametersEvent( FEELEvent.Severity.ERROR, "list", "an element in the list is not suitable for the stddev" ) ); } numbers[i] = val; } BigDecimal total = BigDecimal.ZERO; for ( int i = 0; i < n; i++ ) { total = total.add( numbers[i] ); } BigDecimal mean = total.divide( BigDecimal.valueOf( n ), MathContext.DECIMAL128 ); total = BigDecimal.ZERO; for ( int i = 0; i < n; i++ ) { BigDecimal distanceSquared = numbers[i].subtract( mean ).pow( 2, MathContext.DECIMAL128 ); total = total.add( distanceSquared ); } mean = total.divide( BigDecimal.valueOf( n - 1 ), MathContext.DECIMAL128 ); return FEELFnResult.ofResult( SqrtFunction.sqrt( mean ) ); }
Source:
public void updated(Dictionary<String, ?> config) throws ConfigurationException { if (config != null && config.get("bots") != null) { String[] bots = ((String) config.get("bots")).split(","); for (String bot : bots) { String chatIdKey = String.format("%s.chatId", bot); String tokenKey = String.format("%s.token", bot); String parseKey = String.format("%s.parseMode", bot); if (config.get(chatIdKey) != null && config.get(tokenKey) != null) { String chatId = (String) config.get(chatIdKey); String token = (String) config.get(tokenKey); if (parseKey == null) { Telegram.addToken(bot, chatId, token); } else { Telegram.addToken(bot, chatId, token, (String) config.get(parseKey)); } logger.info("Bot loaded from config file", bot); } else { logger.warn("Bot is misconfigured. Please check the configuration", bot); } } isProperlyConfigured = true; } }

Target:
public void updated(Dictionary<String, ?> config) throws ConfigurationException { if (config != null && config.get("bots") != null) { String[] bots = ((String) config.get("bots")).split(","); for (String bot : bots) { String chatIdKey = String.format("%s.chatId", bot); String tokenKey = String.format("%s.token", bot); String parseModeKey = String.format("%s.parseMode", bot); String chatId = Objects.toString(config.get(chatIdKey), null); String token = Objects.toString(config.get(tokenKey), null); String parseMode = Objects.toString(config.get(parseModeKey), null); if (chatId != null && token != null) { if (parseMode == null) { Telegram.addToken(bot, chatId, token); } else { Telegram.addToken(bot, chatId, token, parseMode); } logger.info("Bot loaded from config file", bot); } else { logger.warn("Bot is misconfigured. Please check the configuration", bot); } } isProperlyConfigured = true; } }
Source:
void abort(Exception abortCause) { operationCompleteCallback.completeOperation(operationFuture, operationCallback, null, new RouterException("Aborted operation because Router is closed", RouterErrorCode.RouterClosed)); }

Target:
void abort(Exception abortCause) { operationCompleteCallback.completeOperation(operationFuture, operationCallback, null, abortCause); operationCompleted = true; }
Source:
public void onBackPressed() { if (mDrawerLayout != null && mDrawerLayout.isDrawerOpen(GravityCompat.START)) { mDrawerLayout.closeDrawer(Gravity.START); } else { if (doubleBackToExitPressedOnce) { setMenuCreateClient(true); setMenuCreateCentre(true); setMenuCreateGroup(true); super.onBackPressed(); return; } this.doubleBackToExitPressedOnce = true; FragmentManager fragmentManager = getSupportFragmentManager(); Fragment fragment = fragmentManager.findFragmentById(R.id.container); if (fragment instanceof CreateNewClientFragment) { Toast.makeText(this, R.string.back_to_dashboard, Toast.LENGTH_SHORT).show(); new Handler().postDelayed(new Runnable() { @Override public void run() { doubleBackToExitPressedOnce = false; } }, 2000); } else if (fragment instanceof CreateNewCenterFragment) { Toast.makeText(this, R.string.back_to_dashboard, Toast.LENGTH_SHORT).show(); new Handler().postDelayed(new Runnable() { @Override public void run() { doubleBackToExitPressedOnce = false; } }, 2000); } else if (fragment instanceof CreateNewGroupFragment) { Toast.makeText(this, R.string.back_to_dashboard, Toast.LENGTH_SHORT).show(); new Handler().postDelayed(new Runnable() { @Override public void run() { doubleBackToExitPressedOnce = false; } }, 2000); } else { Toast.makeText(this, R.string.back_again, Toast.LENGTH_SHORT).show(); new Handler().postDelayed(new Runnable() { @Override public void run() { doubleBackToExitPressedOnce = false; } }, 2000); } } }

Target:
public void onBackPressed() { if (mDrawerLayout != null && mDrawerLayout.isDrawerOpen(GravityCompat.START)) { mDrawerLayout.closeDrawer(Gravity.START); } else { if (doubleBackToExitPressedOnce) { setMenuCreateClient(true); setMenuCreateCentre(true); setMenuCreateGroup(true); super.onBackPressed(); return; } this.doubleBackToExitPressedOnce = true; Fragment fragment = getSupportFragmentManager().findFragmentById(R.id.container); if (fragment instanceof CreateNewClientFragment || fragment instanceof CreateNewCenterFragment || fragment instanceof CreateNewGroupFragment) { showToastOnBackPressed(R.string.back_to_dashboard); } else { showToastOnBackPressed(R.string.back_again); } } }
Source:
public static JSONPropertyWriter create() { JSONPropertyWriter writer = new JSONPropertyWriter(); writer.dateTimeFormat = DateTimeFormat.W3C; return writer; }

Target:
public static JSONPropertyWriter create() { return new JSONPropertyWriter(); }
Source:
public IStatus validate(IProject project, String path) { File xmlFile = new File(path); if (xmlFile.exists() && xmlFile.isFile() && xmlFile.canRead() && xmlFile.length() > 0) { DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); DocumentBuilder db; try { db = dbf.newDocumentBuilder(); EntityResolver resolver = new EntityResolver() { @Override public InputSource resolveEntity(String publicId, String systemId) { String empty = ""; ByteArrayInputStream bais = new ByteArrayInputStream(empty.getBytes()); return new InputSource(bais); } }; db.setEntityResolver(resolver); db.setErrorHandler(new ErrorHandler() { @Override public void error(SAXParseException saxparseexception) throws SAXException { } @Override public void warning(SAXParseException saxparseexception) throws SAXException { } @Override public void fatalError(SAXParseException saxparseexception) throws SAXException { throw saxparseexception; } }); db.parse(new FileInputStream(xmlFile)); return Status.OK_STATUS; } catch (ParserConfigurationException e) { return new Status(IStatus.ERROR, Activator.PLUGIN_ID, e.getMessage(), e); } catch (FileNotFoundException e) { return new Status(IStatus.ERROR, Activator.PLUGIN_ID, e.getMessage(), e); } catch (SAXException e) { return new Status(IStatus.ERROR, Activator.PLUGIN_ID, e.getMessage(), e); } catch (IOException e) { return new Status(IStatus.ERROR, Activator.PLUGIN_ID, e.getMessage(), e); } } return new Status(IStatus.ERROR, Activator.PLUGIN_ID, Messages.CustomTrace_FileNotFound + ": " + path); }

Target:
public IStatus validate(IProject project, String path) { File xmlFile = new File(path); if (xmlFile.exists() && xmlFile.isFile() && xmlFile.canRead() && xmlFile.length() > 0) { DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); DocumentBuilder db; try { db = dbf.newDocumentBuilder(); EntityResolver resolver = new EntityResolver() { @Override public InputSource resolveEntity(String publicId, String systemId) { return new InputSource(new ByteArrayInputStream(new byte[0])); } }; db.setEntityResolver(resolver); db.setErrorHandler(new ErrorHandler() { @Override public void error(SAXParseException saxparseexception) throws SAXException { } @Override public void warning(SAXParseException saxparseexception) throws SAXException { } @Override public void fatalError(SAXParseException saxparseexception) throws SAXException { throw saxparseexception; } }); db.parse(new FileInputStream(xmlFile)); return Status.OK_STATUS; } catch (ParserConfigurationException e) { return new Status(IStatus.ERROR, Activator.PLUGIN_ID, e.getMessage(), e); } catch (FileNotFoundException e) { return new Status(IStatus.ERROR, Activator.PLUGIN_ID, e.getMessage(), e); } catch (SAXException e) { return new Status(IStatus.ERROR, Activator.PLUGIN_ID, e.getMessage(), e); } catch (IOException e) { return new Status(IStatus.ERROR, Activator.PLUGIN_ID, e.getMessage(), e); } } return new Status(IStatus.ERROR, Activator.PLUGIN_ID, Messages.CustomTrace_FileNotFound + ": " + path); }
Source:
private void internalConfigChanged(TemperatureControlStatus tempControlStatus) { if (tempControlStatus != null) { if (tempControlStatus.getIsConfigured()) { logger.debug("found configured zone TemperatureControlStatus = {}", tempControlStatus); ThingUID thingUID = getThingUID(tempControlStatus); if (thingUID != null) { Map<String, Object> properties = new HashMap<>(1); properties.put(DigitalSTROMBindingConstants.ZONE_ID, tempControlStatus.getZoneID()); String zoneName = tempControlStatus.getZoneName(); if (StringUtils.isBlank(zoneName)) { zoneName = tempControlStatus.getZoneID().toString(); } DiscoveryResult discoveryResult = DiscoveryResultBuilder.create(thingUID).withProperties(properties) .withBridge(BRIDGE_UID).withLabel(zoneName).build(); thingDiscovered(discoveryResult); } } } }

Target:
private void internalConfigChanged(TemperatureControlStatus tempControlStatus) { if (tempControlStatus == null) { return; } if (tempControlStatus.getIsConfigured()) { logger.debug("found configured zone TemperatureControlStatus = {}", tempControlStatus); ThingUID thingUID = getThingUID(tempControlStatus); if (thingUID != null) { Map<String, Object> properties = new HashMap<>(); properties.put(DigitalSTROMBindingConstants.ZONE_ID, tempControlStatus.getZoneID()); String zoneName = tempControlStatus.getZoneName(); if (StringUtils.isBlank(zoneName)) { zoneName = tempControlStatus.getZoneID().toString(); } DiscoveryResult discoveryResult = DiscoveryResultBuilder.create(thingUID).withProperties(properties) .withBridge(bridgeUID).withLabel(zoneName).build(); thingDiscovered(discoveryResult); } } }
Source:
public Object execute(ExecutionEvent event) throws ExecutionException { Object checkCompositeRename= HandlerUtil.getVariable(event, LTK_CHECK_COMPOSITE_RENAME_PARAMETER_KEY); if (checkCompositeRename != null) { return checkForCompositeRename(event, checkCompositeRename); } else { performRename(event); } return null; }

Target:
public Object execute(ExecutionEvent event) throws ExecutionException { Object checkCompositeRename= HandlerUtil.getVariable(event, LTK_CHECK_COMPOSITE_RENAME_PARAMETER_KEY); if (checkCompositeRename instanceof Boolean) { return checkForCompositeRename(event); } else { performRename(event); } return null; }
Source:
public <T> ExecuteOperation<T> newExecuteOperation(String taskName, Map<String, byte[]> marshalledParams) { return new ExecuteOperation<>(codec, transportFactory, cacheNameBytes == null ? DEFAULT_CACHE_NAME_BYTES : cacheNameBytes, topologyId, flags(), clientIntelligence, taskName, marshalledParams); }

Target:
public <T> ExecuteOperation<T> newExecuteOperation(String taskName, Map<String, byte[]> marshalledParams) { return new ExecuteOperation<>(codec, transportFactory, cacheNameBytes, topologyId, flags(), clientIntelligence, taskName, marshalledParams); }
Source:
protected static Filter appendFilter(final Filter main, final Filter toAppend) { if (main == null) { return toAppend; } else { return ff.and(main, toAppend); } }

Target:
protected static Filter appendFilter(final Filter main, final Filter toAppend) { if (main == null) { return toAppend; } else if (toAppend == null) { return main; } else { return ff.and(main, toAppend); } }
Source:
public void validate(Long partSizeInMB) throws IllegalArgumentException { checkNotNull(partSizeInMB, "partSizeInMB"); checkArgument(!(partSizeInMB < MIN_PART_SIZE || partSizeInMB > MAX_PART_SIZE || (partSizeInMB & (partSizeInMB - 1)) != 0), "partSizeInMB must be a power of 2 between 1 and 4096."); }

Target:
public void validate(Long partSizeInMB) throws IllegalArgumentException { checkNotNull(partSizeInMB, "partSizeInMB"); checkArgument(!(partSizeInMB < MIN_PART_SIZE || partSizeInMB > MAX_PART_SIZE || Long.bitCount(partSizeInMB) != 1), "partSizeInMB must be a power of 2 between 1 and 4096."); }
Source:
private static void set(final Map<String, Object> map, final String key, final String defaultValue, final Consumer<String> consumer) { final String value = (String) map.get(key); if (isNotEmpty(value)) { consumer.accept(value); } else if (null != defaultValue) { consumer.accept(defaultValue); } }

Target:
private static void set(final Map<String, Object> map, final String key, final String defaultValue, final Consumer<String> consumer) { final String value = (String) map.get(key); if (nonEmpty(value)) { consumer.accept(value); } else if (null != defaultValue) { consumer.accept(defaultValue); } }
Source:
public List<ProductRelease> findAllProductReleasesOfProduct(String pName, String token, String tenant) throws SdcException { Response response = null; try { String url = sDCUtil.getSdcUtil(token) + "/catalog/product/" + pName + "/release"; log.debug("url: " + url); Invocation.Builder builder = createWebResource(url, token, tenant); builder = builder.accept(MediaType.APPLICATION_JSON); response = builder.get(); String responseJSON = response.readEntity(String.class); return fromSDCToPaasManager(responseJSON); } catch (Exception e) { String message = "Error calling SDC to obtain the products " + e.getMessage(); log.error(message); throw new SdcException(message); } finally { if (response != null) { response.close(); } } }

Target:
public List<ProductRelease> findAllProductReleasesOfProduct(String pName, String token, String tenant) throws SdcException { Response response = null; try { String url = sDCUtil.getSdcUtil(token) + "/catalog/product/" + pName + "/release"; log.debug("url: " + url); Invocation.Builder builder = createWebResource(url, token, tenant); builder = builder.accept(MediaType.APPLICATION_JSON); response = builder.get(); String responseJSON = response.readEntity(String.class); return fromSDCToPaasManager(responseJSON); } catch (Exception e) { String message = "Error calling SDC to obtain the product release list: " + e.getMessage(); log.error(message); throw new SdcException(message); } finally { if (response != null) { response.close(); } } }
Source:
private void encodeLocalizedDescriptions(Described entity, DBObject dbObject) { Iterable<DBObject> localizedDescriptions = Iterables.transform(entity.getLocalizedDescriptions(), new Function<LocalizedDescription, DBObject>() { @Override public DBObject apply(LocalizedDescription input) { return localizedDescriptionTranslator.toDBObject(new BasicDBObject(), input); } }); dbObject.put(LOCALIZED_DESCRIPTIONS_KEY, localizedDescriptions); }

Target:
private void encodeLocalizedDescriptions(Described entity, DBObject dbObject) { List<LocalizedDescription> sortedDescriptions = LOCALIZED_DESCRIPTION_ORDERING.sortedCopy(entity.getLocalizedDescriptions()); BasicDBList dbDescriptions = new BasicDBList(); for (LocalizedDescription localizedDescriptions : sortedDescriptions) { dbDescriptions.add(localizedDescriptionTranslator.toDBObject(new BasicDBObject(), localizedDescriptions)); } dbObject.put(LOCALIZED_DESCRIPTIONS_KEY, dbDescriptions); }
Source:
public static final Object[][] getFileNames() { return new Object[][] { {"文件名óśłżźćńę.jpg"}, {"Image001.jpg"}, }; }

Target:
public static final Object[][] getFileNames() { return new Object[][] { {"文件名óśłżźćńę%?.jpg"}, {"Image001.jpg"}, }; }
Source:
private void destroyPlayer() { if (player != null) { player.destroy(); player = null; } if (skinLayout != null) { skinLayout.release(); } if (playerSkinLayoutController != null) { playerSkinLayoutController.deleteObserver(this); playerSkinLayoutController = null; } }

Target:
private void destroyPlayer() { pulseManager = null; if (player != null) { player.destroy(); player = null; } if (skinLayout != null) { skinLayout.release(); } if (playerSkinLayoutController != null) { playerSkinLayoutController.onDestroy(); playerSkinLayoutController = null; } }