auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public SchemaDescriptor getSchemaDescriptor(UUID dbId, String schemaName, TransactionController tc, boolean raiseError) throws StandardException{ if(tc==null){ tc=getTransactionCompile(); } if (dbId == null) { dbId = getLCC().getDatabaseId(); } <START> if(getSystemSchemaDescriptor().getSchemaName().equals(schemaName)){ <END> return getSystemSchemaDescriptor(); }else if(getSysIBMSchemaDescriptor().getSchemaName().equals(schemaName)){ if(dictionaryVersion.checkVersion(DataDictionary.DD_VERSION_CS_5_2,null)){ return getSysIBMSchemaDescriptor(); } } SchemaDescriptor sd = dataDictionaryCache.schemaCacheFind(dbId, schemaName); if (sd!=null) return sd; sd=locateSchemaRow(dbId, schemaName,tc); if (sd!=null) dataDictionaryCache.schemaCacheAdd(dbId, schemaName,sd); if(sd==null && getDeclaredGlobalTemporaryTablesSchemaDescriptor().getSchemaName().equals(schemaName)){ return getDeclaredGlobalTemporaryTablesSchemaDescriptor(); } if(sd==null && raiseError){ throw StandardException.newException(SQLState.LANG_SCHEMA_DOES_NOT_EXIST,schemaName); }else{ return sd; } }</code><technical_language>check SysSchemaDescriptor SysIBMSchemaDescriptor here, list of system schemas: protected SchemaDescriptor sysIBMADMSchemaDesc; protected SchemaDescriptor systemUtilSchemaDesc; protected SchemaDescriptor sysFunSchemaDesc; protected SchemaDescriptor sysViewSchemaDesc; Otherwise, query objects in schemas other databases</technical_language>

Target:
public SchemaDescriptor getSchemaDescriptor(UUID dbId, String schemaName, TransactionController tc, boolean raiseError) throws StandardException{ if(tc==null){ tc=getTransactionCompile(); } if (dbId == null) { dbId = getLCC().getDatabaseId(); } switch (schemaName) { case SchemaDescriptor.STD_SYSTEM_SCHEMA_NAME: return getSystemSchemaDescriptor(); case SchemaDescriptor.IBM_SYSTEM_SCHEMA_NAME: if(dictionaryVersion.checkVersion(DataDictionary.DD_VERSION_CS_5_2,null)){ return getSysIBMSchemaDescriptor(); } break; case SchemaDescriptor.IBM_SYSTEM_ADM_SCHEMA_NAME: return sysIBMADMSchemaDesc; case SchemaDescriptor.STD_SYSTEM_UTIL_SCHEMA_NAME: return getSystemUtilSchemaDescriptor(); case SchemaDescriptor.IBM_SYSTEM_FUN_SCHEMA_NAME: return getSysFunSchemaDescriptor(); case SchemaDescriptor.STD_SYSTEM_VIEW_SCHEMA_NAME: return sysViewSchemaDesc; default: break; } SchemaDescriptor sd = dataDictionaryCache.schemaCacheFind(dbId, schemaName); if (sd!=null) return sd; sd=locateSchemaRow(dbId, schemaName,tc); if (sd!=null) dataDictionaryCache.schemaCacheAdd(dbId, schemaName,sd); if(sd==null && getDeclaredGlobalTemporaryTablesSchemaDescriptor().getSchemaName().equals(schemaName)){ return getDeclaredGlobalTemporaryTablesSchemaDescriptor(); } if(sd==null && raiseError){ throw StandardException.newException(SQLState.LANG_SCHEMA_DOES_NOT_EXIST,schemaName); }else{ return sd; } }
Source:
<code>public void checkAttributeRegex(Attribute attribute, String defaultRegex) throws InternalErrorException, WrongAttributeValueException { if (attribute == null || attribute.getValue() == null) throw new InternalErrorException("Attribute or it's value is null."); String attributeValue = (String) attribute.getValue(); try { <START> String regex = BeansUtils.getPropertyFromCustomConfiguration("perun-namespaces.properties", attribute.getFriendlyName() + ":regex"); <END> try { Pattern.compile(regex); } catch (PatternSyntaxException e) { log.error("Regex pattern \"" + regex + "\" from \"" + attribute.getFriendlyName() + ":regex\"" + " property of perun-namespaces.properties file is invalid."); throw new InternalErrorException("Regex pattern \"" + regex + "\" from \"" + attribute.getFriendlyName() + ":regex\"" + " property of perun-namespaces.properties file is invalid."); } if(!attributeValue.matches(regex)) { throw new WrongAttributeValueException(attribute, "Wrong format. Regex: \"" + regex +"\" expected for this attribute:"); } } catch (InternalErrorException e) { if (defaultRegex == null) return; if (!attributeValue.matches(defaultRegex)) { throw new WrongAttributeValueException(attribute, "Wrong format. Regex: \"" + defaultRegex +"\" expected for this attribute:"); } } }</code><technical_language>This is problem logins group names. want read file for time call this method. fill perunNamespaces map this too</technical_language>

Target:
public void checkAttributeRegex(Attribute attribute, String defaultRegex) throws InternalErrorException, WrongAttributeValueException { if (attribute == null || attribute.getValue() == null) throw new InternalErrorException("Attribute or it's value is null."); String attributeValue = (String) attribute.getValue(); checkPerunNamespacesMap(); String regex = perunNamespaces.get(attribute.getFriendlyName() + ":regex"); if (regex != null) { try { Pattern.compile(regex); } catch (PatternSyntaxException e) { log.error("Regex pattern \"" + regex + "\" from \"" + attribute.getFriendlyName() + ":regex\"" + " property of perun-namespaces.properties file is invalid."); throw new InternalErrorException("Regex pattern \"" + regex + "\" from \"" + attribute.getFriendlyName() + ":regex\"" + " property of perun-namespaces.properties file is invalid."); } if(!attributeValue.matches(regex)) { throw new WrongAttributeValueException(attribute, "Wrong format. Regex: \"" + regex +"\" expected for this attribute:"); } } else { if (defaultRegex == null) return; if (!attributeValue.matches(defaultRegex)) { throw new WrongAttributeValueException(attribute, "Wrong format. Regex: \"" + defaultRegex +"\" expected for this attribute:"); } } }
Source:
<code>public static Long getTotalAmountFor(ChargeEntity charge) { if (charge.getCorporateSurcharge().isPresent()) { return charge.getCorporateSurcharge().get() + charge.getAmount(); } <START> return charge.getAmount(); <END> }</code><technical_language>java return charge.getCorporateSurcharge() .map(surcharge -> surcharge + charge.getAmount()) .orElseGet(charge::getAmount);</technical_language>

Target:
public static Long getTotalAmountFor(ChargeEntity charge) { return charge.getCorporateSurcharge() .map(surcharge -> surcharge + charge.getAmount()) .orElseGet(charge::getAmount); }
Source:
<code>private String getOriginUrl(Activity activity) { if(originUrl == null) { PackageManager pm; String packageName; ApplicationInfo appInfo; try { pm = activity.getPackageManager(); packageName = activity.getApplicationInfo().packageName; appInfo = pm.getApplicationInfo(packageName, 0); originUrl = pm.getApplicationLabel(appInfo).toString(); } catch (Exception e) { Log.e(Constants.TAG, "getOriginUrl: " + e.toString()); <START> resetSurvey(); <END> e.printStackTrace(); } } if(originUrl == null) { originUrl = ""; } return originUrl; }</code><technical_language>I remove this call resetSurvey();. In function showSurveyFragment(), result of call getOriginUrl() matter: returns, fragment created launched, surveyRunning currentEvent attributes remain unchanged. encounter a problem on, fragment handle gracefully</technical_language>

Target:
private String getOriginUrl(Activity activity) { if(originUrl == null) { PackageManager pm; String packageName; ApplicationInfo appInfo; try { pm = activity.getPackageManager(); packageName = activity.getApplicationInfo().packageName; appInfo = pm.getApplicationInfo(packageName, 0); originUrl = pm.getApplicationLabel(appInfo).toString(); } catch (Exception e) { Log.e(Constants.TAG, "getOriginUrl: " + e.toString()); e.printStackTrace(); } } if(originUrl == null) { originUrl = ""; } return originUrl; }
Source:
<code>public List<BakedQuad> getQuads(@Nullable IBlockState state, @Nullable EnumFacing side, long rand) { <START> if(side == null) return quads; <END> return ImmutableList.of(); }</code><technical_language>mezz, braces? ;P</technical_language>

Target:
public List<BakedQuad> getQuads(@Nullable IBlockState state, @Nullable EnumFacing side, long rand) { if(side == null) { return quads; } return ImmutableList.of(); }
Source:
<code>protected void mine() { IBlockState state = worldObj.getBlockState(currentPos); <START> if (BlockUtils.isUnbreakableBlock(getWorld(), currentPos) || state.getBlock() == Blocks.BEDROCK) { <END> setComplete(true); return; } int target = BlockUtils.computeBlockBreakPower(worldObj, currentPos); progress += battery.extractPower(0, target - progress); if (progress >= target) { progress = 0; if (!worldObj.isAirBlock(currentPos)) { BlockEvent.BreakEvent breakEvent = new BlockEvent.BreakEvent(worldObj, currentPos, state, FakePlayerUtil.INSTANCE.getBuildCraftPlayer((WorldServer) worldObj).get()); MinecraftForge.EVENT_BUS.post(breakEvent); if (breakEvent.isCanceled()) { setComplete(true); return; } List<ItemStack> stacks = BlockUtils.getItemStackFromBlock((WorldServer) worldObj, currentPos, pos); if (stacks != null) { for (ItemStack stack : stacks) { stack.stackSize -= Utils.addToRandomInventoryAround(worldObj, pos, stack); if (stack.stackSize > 0) { stack.stackSize -= Utils.addToRandomInjectableAround(worldObj, pos, null, stack); } InvUtils.dropItemUp(getWorld(), stack, getPos()); } } worldObj.sendBlockBreakProgress(currentPos.hashCode(), currentPos, -1); worldObj.destroyBlock(currentPos, false); } worldObj.setBlockState(currentPos, getBlockForDown().getDefaultState()); worldObj.scheduleUpdate(currentPos, getBlockForDown(), 100); currentPos = currentPos.down(); if (currentPos.getY() < 0) { setComplete(true); } } else { if (!worldObj.isAirBlock(currentPos)) { worldObj.sendBlockBreakProgress(currentPos.hashCode(), currentPos, (progress * 9) / target); } } }</code><technical_language>BlockUtils.isUnbreakableBlock is failing identify bedrock unbreakable, ideally check here</technical_language>

Target:
protected void mine() { IBlockState state = worldObj.getBlockState(currentPos); if (BlockUtils.isUnbreakableBlock(getWorld(), currentPos) || state.getBlock() == Blocks.BEDROCK) { setComplete(true); return; } int target = BlockUtils.computeBlockBreakPower(worldObj, currentPos); progress += battery.extractPower(0, target - progress); if (progress >= target) { progress = 0; if (!worldObj.isAirBlock(currentPos)) { BlockEvent.BreakEvent breakEvent = new BlockEvent.BreakEvent(worldObj, currentPos, state, FakePlayerUtil.INSTANCE.getBuildCraftPlayer((WorldServer) worldObj).get()); MinecraftForge.EVENT_BUS.post(breakEvent); if (breakEvent.isCanceled()) { setComplete(true); return; } List<ItemStack> stacks = BlockUtils.getItemStackFromBlock((WorldServer) worldObj, currentPos, pos); if (stacks != null) { for (ItemStack stack : stacks) { stack.stackSize -= Utils.addToRandomInventoryAround(worldObj, pos, stack); if (stack.stackSize > 0) { stack.stackSize -= Utils.addToRandomInjectableAround(worldObj, pos, null, stack); } InvUtils.dropItemUp(getWorld(), stack, getPos()); } } worldObj.sendBlockBreakProgress(currentPos.hashCode(), currentPos, -1); worldObj.destroyBlock(currentPos, false); } currentPos = currentPos.down(); if (currentPos.getY() < 0) { setComplete(true); } } else { if (!worldObj.isAirBlock(currentPos)) { worldObj.sendBlockBreakProgress(currentPos.hashCode(), currentPos, (progress * 9) / target); } } }
Source:
<code>public ChannelFuture bind(SocketAddress localAddress) { validate(); ObjectUtil.checkNotNull(localAddress, "localAddress"); <START> return doBind(localAddress); <END> }</code><technical_language>@qeesung: merge 2 lines</technical_language>

Target:
public ChannelFuture bind(SocketAddress localAddress) { validate(); return doBind(ObjectUtil.checkNotNull(localAddress, "localAddress")); }
Source:
<code>public static ArtifactConfig fromCommandLineArgs( String[] args) throws CmdLineException, IOException { CmdLineArgs parsedArgs = new CmdLineArgs(); CmdLineParser parser = new CmdLineParser(parsedArgs); parser.parseArgument(args); ArtifactConfig artifactConfig; if (parsedArgs.artifactConfigJson != null) { Gson gson = new GsonBuilder().create(); String jsonData = com.google.common.io.Files.toString( new File(parsedArgs.artifactConfigJson), Charsets.UTF_8); <START> artifactConfig = gson.fromJson(jsonData, ArtifactConfig.class); <END> } else { artifactConfig = new ArtifactConfig(); } if (parsedArgs.buckRepoRoot != null) { artifactConfig.buckRepoRoot = parsedArgs.buckRepoRoot; } if (parsedArgs.mavenLocalRepo != null) { artifactConfig.mavenLocalRepo = parsedArgs.mavenLocalRepo; } if (parsedArgs.thirdParty != null) { artifactConfig.thirdParty = parsedArgs.thirdParty; } artifactConfig.artifacts.addAll(parsedArgs.artifacts); for (String url : parsedArgs.repositoryURIs) { artifactConfig.repositories.add(new Repository(url)); } return artifactConfig; }</code><technical_language>If args4j, support @ files a lot of in supporting JSON</technical_language>

Target:
public static ArtifactConfig fromCommandLineArgs( String[] args) throws CmdLineException, IOException { CmdLineArgs parsedArgs = new CmdLineArgs(); CmdLineParser parser = new CmdLineParser(parsedArgs); parser.parseArgument(args); if (parsedArgs.showHelp) { usage(parser); } ArtifactConfig artifactConfig; if (parsedArgs.artifactConfigJson != null) { ObjectMapper mapper = new ObjectMapper(); File jsonFile = new File(parsedArgs.artifactConfigJson); artifactConfig = mapper.readValue(jsonFile, ArtifactConfig.class); } else { artifactConfig = new ArtifactConfig(); } if (artifactConfig.buckRepoRoot == null && parsedArgs.buckRepoRoot == null) { usage(parser); } artifactConfig.mergeCmdLineArgs(parsedArgs); return artifactConfig; }
Source:
<code><START> public void followerNotificationResponse_setup_1() { <END> WikiBasePageObject base = new WikiBasePageObject(driver); base.logInCookie(credentials.userName5, credentials.password5, wikiURL); NewMessageWall wall = base.openMessageWall(credentials.userName6, wikiURL); WatchPageObject watch = wall.unfollowCurrentUrl(); watch.confirmWatchUnwatch(); }</code><technical_language>i wish some description of "setup_1" others mean, eg. top of class</technical_language>

Target:
public void followerNotificationResponse_setup_1() { WikiBasePageObject base = new WikiBasePageObject(driver); base.logInCookie(credentials.userName7, credentials.password7, wikiURL); NewMessageWall wall = base.openMessageWall(credentials.userName8, wikiURL); WatchPageObject watch = wall.unfollowCurrentUrl(); watch.confirmWatchUnwatch(); }
Source:
<code>public synchronized void updateSubscription(Subscription newSubscription) { this.subscription = newSubscription; <START> this.messageSender = messageSenderFactory.create(newSubscription); <END> }</code><technical_language>I this is a good idea rebuilt sending component need some logic determines this is necessary. work I is a bit simplistic. I is a in disrupting delivery flaw if possible. change in delivery flaw is visible clients monitoring happened</technical_language>

Target:
public synchronized void updateSubscription(Subscription newSubscription) { boolean endpointUpdated = !this.subscription.getEndpoint().equals(newSubscription.getEndpoint()); this.subscription = newSubscription; if (endpointUpdated) { this.messageSender = messageSenderFactory.create(newSubscription); } }
Source:
<code>protected IScalarEvaluator createEvaluator(IHyracksTaskContext ctx, IScalarEvaluator[] args) throws AlgebricksException { final ArrayBackedValueStorage abvs = new ArrayBackedValueStorage(); final UTF8StringPointable stringp = (UTF8StringPointable) UTF8StringPointable.FACTORY.createPointable(); final TaggedValuePointable nodep = (TaggedValuePointable) TaggedValuePointable.FACTORY.createPointable(); final ByteBufferInputStream bbis = new ByteBufferInputStream(); final DataInputStream di = new DataInputStream(bbis); final SequenceBuilder sb = new SequenceBuilder(); final ArrayBackedValueStorage abvsFileNode = new ArrayBackedValueStorage(); final int partition = ctx.getTaskAttemptId().getTaskId().getPartition(); final String nodeId = ctx.getJobletContext().getApplicationContext().getNodeId(); final ITreeNodeIdProvider nodeIdProvider = new TreeNodeIdProvider((short) partition); return new AbstractTaggedValueArgumentScalarEvaluator(args) { @Override protected void evaluate(TaggedValuePointable[] args, IPointable result) throws SystemException { try { IndexConstructorUtil.evaluate(args, result, stringp, bbis, di, sb, abvs, nodeIdProvider, abvsFileNode, nodep, false, nodeId); } catch (JAXBException e) { throw new SystemException(ErrorCode.SYSE0001, e); <START> } <END> } }; }</code><technical_language>Add boolean result: XDMConstants.setTrue(result);</technical_language>

Target:
protected IScalarEvaluator createEvaluator(IHyracksTaskContext ctx, IScalarEvaluator[] args) throws AlgebricksException { final ArrayBackedValueStorage abvs = new ArrayBackedValueStorage(); final UTF8StringPointable stringp = (UTF8StringPointable) UTF8StringPointable.FACTORY.createPointable(); final TaggedValuePointable nodep = (TaggedValuePointable) TaggedValuePointable.FACTORY.createPointable(); final ByteBufferInputStream bbis = new ByteBufferInputStream(); final DataInputStream di = new DataInputStream(bbis); final SequenceBuilder sb = new SequenceBuilder(); final ArrayBackedValueStorage abvsFileNode = new ArrayBackedValueStorage(); final int partition = ctx.getTaskAttemptId().getTaskId().getPartition(); final String nodeId = ctx.getJobletContext().getApplicationContext().getNodeId(); final ITreeNodeIdProvider nodeIdProvider = new TreeNodeIdProvider((short) partition); return new AbstractTaggedValueArgumentScalarEvaluator(args) { @Override protected void evaluate(TaggedValuePointable[] args, IPointable result) throws SystemException { try { IndexConstructorUtil.evaluate(args, result, stringp, bbis, di, sb, abvs, nodeIdProvider, abvsFileNode, nodep, false, nodeId); XDMConstants.setTrue(result); } catch (JAXBException e) { throw new SystemException(ErrorCode.SYSE0001, e); } } }; }
Source:
<code>public Mono<ServiceBusReceiverAsyncClient> acceptSession(String sessionId) { if (CoreUtils.isNullOrEmpty(sessionId)) { return monoError(logger, new IllegalArgumentException("sessionId can not be null or empty")); } <START> ReceiverOptions newReceiverOptions = new ReceiverOptions(receiverOptions.getReceiveMode(), <END> receiverOptions.getPrefetchCount(), sessionId, null, receiverOptions.getMaxLockRenewDuration()); final ServiceBusSessionManager sessionSpecificManager = new ServiceBusSessionManager(entityPath, entityType, connectionProcessor, tracerProvider, messageSerializer, newReceiverOptions); return sessionSpecificManager.getActiveLink().thenReturn(new ServiceBusReceiverAsyncClient( fullyQualifiedNamespace, entityPath, entityType, newReceiverOptions, connectionProcessor, ServiceBusConstants.OPERATION_TIMEOUT, tracerProvider, messageSerializer, onClientClose, sessionSpecificManager)); }</code><technical_language>nit: consistent of final</technical_language>

Target:
public Mono<ServiceBusReceiverAsyncClient> acceptSession(String sessionId) { if (sessionId == null) { return monoError(logger, new NullPointerException("'sessionId' cannot be null")); } if (CoreUtils.isNullOrEmpty(sessionId)) { return monoError(logger, new IllegalArgumentException("'sessionId' cannot be empty")); } final ReceiverOptions newReceiverOptions = new ReceiverOptions(receiverOptions.getReceiveMode(), receiverOptions.getPrefetchCount(), receiverOptions.getMaxLockRenewDuration(), receiverOptions.isAutoLockRenewEnabled(), sessionId, null); final ServiceBusSessionManager sessionSpecificManager = new ServiceBusSessionManager(entityPath, entityType, connectionProcessor, tracerProvider, messageSerializer, newReceiverOptions); return sessionSpecificManager.getActiveLink().map(receiveLink -> new ServiceBusReceiverAsyncClient( fullyQualifiedNamespace, entityPath, entityType, newReceiverOptions, connectionProcessor, ServiceBusConstants.OPERATION_TIMEOUT, tracerProvider, messageSerializer, () -> { }, sessionSpecificManager)); }
Source:
<code>public void onUnityAdsReady(String placementId) { <START> Log.d("alice", "onUnityAdsReady: " + placementId); <END> if (mPlacementsInUse.containsKey(placementId) && mPlacementsInUse.get(placementId).get() != null) { mPlacementsInUse.get(placementId).get().onUnityAdsReady(placementId); } }</code><technical_language>a null check for if (mAdShowingAdapterDelegate != null) line 185. This is set show() time, guessing this callback earlier that</technical_language>

Target:
public void onUnityAdsReady(String placementId) { if (mPlacementsInUse.containsKey(placementId) && mPlacementsInUse.get(placementId).get() != null) { mPlacementsInUse.get(placementId).get().onUnityAdsReady(placementId); } }
Source:
<code>public void performSearchWithoutFetchers() { Set<SearchBasedFetcher> empty = new HashSet<>(); CompositeSearchBasedFetcher fetcher = new CompositeSearchBasedFetcher(empty); List<BibEntry> result = fetcher.performSearch("quantum"); <START> Assertions.assertTrue(result.isEmpty()); <END> }</code><technical_language>please assertTrue(empty) assertEquals(..., emptyList) this a error message</technical_language>

Target:
public void performSearchWithoutFetchers() { Set<SearchBasedFetcher> empty = new HashSet<>(); CompositeSearchBasedFetcher fetcher = new CompositeSearchBasedFetcher(empty, Integer.MAX_VALUE); List<BibEntry> result = fetcher.performSearch("quantum"); Assertions.assertEquals(result, Collections.EMPTY_LIST); }
Source:
<code>public View getBannerView() { <START> return mChartboostBanner; <END> }</code><technical_language>If adding mChartboostBannerto a container view (e.g. bannerContainer initBanner()), I this return bannerContainer</technical_language>

Target:
public View getBannerView() { return mBannerContainer; }
Source:
<code>private List<Change.Id> changesReviewedBy(final ReviewDb db, final String userName) { <START> <END> UserNameProcessor processor = new UserNameProcessor(db, userName) { @Override void process(ReviewDb db, Account.Id account, Map<Id, Change> outResultChanges) throws OrmException { ChangeApprovalAccess changes = db.changeApprovals(); ChangeAccess changeAccess = db.changes(); Iterator<ChangeApproval> changeIterator = changes.reviewedByUser(account).iterator(); while (changeIterator.hasNext()) { ChangeApproval approval = changeIterator.next(); Change change = changeAccess.get(approval.getChangeId()); if (change != null) { outResultChanges.put(change.getId(), change); } } } }; return new ArrayList<Change.Id>(processor.call()); }</code><technical_language>Unnecessary blank line</technical_language>

Target:
private Set<Change.Id> changesReviewedBy(final ReviewDb db, final String userName) throws OrmException { UserNameProcessor processor = new UserNameProcessor(db, userName) { @Override void process(ReviewDb db, Account.Id account, Map<Id, Change> outResultChanges) throws OrmException { ChangeApprovalAccess changes = db.changeApprovals(); ChangeAccess changeAccess = db.changes(); Iterator<ChangeApproval> changeIterator = changes.reviewedByUser(account).iterator(); while (changeIterator.hasNext()) { ChangeApproval approval = changeIterator.next(); Change change = changeAccess.get(approval.getChangeId()); if (change != null) { outResultChanges.put(change.getId(), change); } } } }; return processor.call(); }
Source:
<code>private static void addConfigDetail(StringBuilder builder, String name, String value) { builder.append("<tr style=\"background-color: transparent; padding: 0 0 0 0;\">" + "<th style=\"border-width: 0; background-color: transparent; text-align: right; padding: 0 0 0 0; \">" + name + ":</th>" + "<td style=\"border-width: 0; background-color: transparent; text-align: left; padding: 0 0 0 10;\">" + value + "</td>" + <START> "</tr>"); <END> }</code><technical_language>add line return HTML block tables, rows, list items generated HTML stays readable</technical_language>

Target:
private static void addConfigDetail(StringBuilder builder, String name, String value) { builder.append("<tr>" + "<th>" + name + ":</th>" + "<td>" + value + "</td>" + "</tr>\n"); }
Source:
<code>protected MessageDigest getMd5Digest(final HttpServletRequest request) throws NoSuchAlgorithmException { MessageDigest digest = createMd5Digest(); for (MD5Attributes attribute: MD5Attributes.values()) { if (request.getAttribute(attribute.getKey()) != null) { digest.update(request.getAttribute(attribute.getKey()). toString().getBytes()); } } <START> digest.update(request.getAttribute(ATTR_ENGINE_SESSION_TIMEOUT).toString().getBytes()); <END> return digest; }</code><technical_language>getBytes default encoding, this trigger a Coverity warning, please getBytes("UTF-8"). I posted a patch fixes other of in this class</technical_language>

Target:
protected MessageDigest getMd5Digest(final HttpServletRequest request) throws NoSuchAlgorithmException { MessageDigest digest = createMd5Digest(); for (MD5Attributes attribute: MD5Attributes.values()) { if (request.getAttribute(attribute.getKey()) != null) { digest.update(request.getAttribute(attribute.getKey()). toString().getBytes()); } } digest.update(request.getAttribute(ATTR_ENGINE_SESSION_TIMEOUT).toString().getBytes(Charset.forName("UTF-8"))); return digest; }
Source:
<code>private boolean checkVmIsDown() { return Config.<Boolean> GetValue( <START> ConfigValues.LiveSnapshotEnabled, getStoragePool().getcompatibility_version().getValue()); <END> }</code><technical_language>shouldnt return !(getConfig)</technical_language>

Target:
private boolean checkVmIsDown() { return !Config.<Boolean> GetValue( ConfigValues.LiveSnapshotEnabled, getStoragePool().getcompatibility_version().getValue()); }
Source:
<code>public boolean isHardwareFlowControl() { <START> if (parameters.flowControl == FLOW_CONTROL_HW) <END> return true; return false; }</code><technical_language>statement return parameters.flowControl == FLOW_CONTROL_HW; enough</technical_language>

Target:
public boolean isHardwareFlowControl() { return parameters.flowControl == FLOW_CONTROL_HW; }
Source:
<code>public void flush() { <START> if (subnet == null) { <END> subnet = new ExternalSubnet(); } subnet.setName(getName().getEntity()); Network network = getNetwork().getSelectedItem(); subnet.setExternalNetwork(network != null ? network.getProvidedBy() : null); subnet.setCidr(getCidr().getEntity()); subnet.setIpVersion(getIpVersion().getSelectedItem()); }</code><technical_language>initiate subnet new ExternalSubnet() get rid of this check</technical_language>

Target:
public void flush() { subnet = new ExternalSubnet(); subnet.setName(getName().getEntity()); Network network = getNetwork().getSelectedItem(); subnet.setExternalNetwork(network.getProvidedBy()); subnet.setCidr(getCidr().getEntity()); subnet.setIpVersion(getIpVersion().getSelectedItem()); }
Source:
<code>public List<Pair<String, Long>> getTimingLog() { List<Pair<String, Long>> rtn = new ArrayList<Pair<String, Long>>(); if (mMarkers == null || mMarkers.size() == 0) { return rtn; } long prevTime = mMarkers.get(0).time; for (Marker marker : mMarkers) { long thisTime = marker.time; <START> rtn.add(new Pair<String, Long>(marker.name, (thisTime - prevTime))); <END> prevTime = thisTime; } return rtn; }</code><technical_language>Pair.new for righteous implicit typing pair instantiation</technical_language>

Target:
public List<Pair<String, Long>> getTimingLog() { List<Pair<String, Long>> rtn = new ArrayList<Pair<String, Long>>(); if (mMarkers == null || mMarkers.size() == 0) { return rtn; } long prevTime = mMarkers.get(0).time; for (Marker marker : mMarkers) { long thisTime = marker.time; rtn.add(Pair.create(marker.name, (thisTime - prevTime))); prevTime = thisTime; } return rtn; }
Source:
<code>public void setUp() { discoveryParticipant = getService(UpnpDiscoveryParticipant.class, FSInternetRadioDiscoveryParticipant.class); <START> assertThat("The FSInternetRadioDiscoveryParticipant service cannot be found", discoveryParticipant, <END> is(notNullValue())); }</code><technical_language>I string messages. completely agains goal of matchers aim producing readable code. me, this reads "assert FSInternetRadioDiscoveryParticipant service found" - of is exact of asserted. IMHO drop (everywhere - mention again). wdyt</technical_language>

Target:
public void setUp() { discoveryParticipant = getService(UpnpDiscoveryParticipant.class, FSInternetRadioDiscoveryParticipant.class); assertNotNull(discoveryParticipant); }
Source:
<code>public TranslatedExpression<String> translateCall(CallExpression callExpression, Map<VariableReferenceExpression, ColumnHandle> context, RowExpressionTreeTranslator<String, Map<VariableReferenceExpression, ColumnHandle>> rowExpressionTreeTranslator) { List<TranslatedExpression<String>> translatedExpressions = callExpression.getArguments().stream() <START> .map(expression -> expression.accept(rowExpressionTreeTranslator.getVisitor(), context)) <END> .collect(Collectors.toList()); FunctionMetadata functionMetadata = functionManager.getFunctionMetadata(callExpression.getFunctionHandle()); try { return functionTranslator.translate(functionMetadata, callExpression, translatedExpressions); } catch (Throwable t) { return untranslated(callExpression); } }</code><technical_language>rewrite getVisitor</technical_language>

Target:
public TranslatedExpression<String> translateCall(CallExpression callExpression, Map<VariableReferenceExpression, ColumnHandle> context, RowExpressionTreeTranslator<String, Map<VariableReferenceExpression, ColumnHandle>> rowExpressionTreeTranslator) { List<TranslatedExpression<String>> translatedExpressions = callExpression.getArguments().stream() .map(expression -> rowExpressionTreeTranslator.rewrite(expression, context)) .collect(Collectors.toList()); FunctionMetadata functionMetadata = functionManager.getFunctionMetadata(callExpression.getFunctionHandle()); try { return functionTranslator.translate(functionMetadata, callExpression, translatedExpressions); } catch (Throwable t) { return untranslated(callExpression); } }
Source:
<code>public Mono<AccessToken> getToken(TokenRequestContext request) { return Mono.defer(() -> { if (cachedToken.get() != null) { return identityClient.authenticateWithUserRefreshToken(request, cachedToken.get()) <START> .onErrorResume(t -> Mono.empty()); <END> } else { return Mono.empty(); } }).switchIfEmpty( Mono.defer(() -> identityClient.authenticateWithVsCodeCredential(request))) .map(msalToken -> { cachedToken.set(msalToken); return msalToken; }); }</code><technical_language>Is helpful log error a warning? if understand correctly assume error is auth error, log helps debug if fails due some other reason</technical_language>

Target:
public Mono<AccessToken> getToken(TokenRequestContext request) { return Mono.defer(() -> { if (cachedToken.get() != null) { return identityClient.authenticateWithUserRefreshToken(request, cachedToken.get()) .onErrorResume(t -> Mono.empty()); } else { return Mono.empty(); } }).switchIfEmpty( Mono.defer(() -> identityClient.authenticateWithVsCodeCredential(request, cloudInstance))) .map(msalToken -> { cachedToken.set(msalToken); return msalToken; }); }
Source:
<code>public Iterable<Hook> iterate() { <START> return new RtPagination<Hook>( <END> this.request, new RtPagination.Mapping<Hook>() { @Override public Hook map(final JsonObject object) { return RtHooks.this.get(object.getInt("id")); } } ); }</code><technical_language>generic parameters: return new RtPagination<Hook, JsonObject></technical_language>

Target:
public Iterable<Hook> iterate() { return new RtPagination<Hook>( this.request, new RtPagination.Mapping<Hook, JsonObject>() { @Override public Hook map(final JsonObject object) { return RtHooks.this.get(object.getInt("id")); } } ); }
Source:
<code><START> private ArrayList<BasicNameValuePair> getParams() { <END> ArrayList<BasicNameValuePair> params = new ArrayList<>(); params.add(new BasicNameValuePair("access_token", WIKIA_PRODUCTION_APP_ACCESS_TOKEN)); return params; }</code><technical_language>List<BasicNameValuePair> more appropriate</technical_language>

Target:
private List<BasicNameValuePair> getParams() { return Collections.singletonList( new BasicNameValuePair("access_token", WIKIA_PRODUCTION_APP_ACCESS_TOKEN)); }
Source:
<code>static Long toEpochHoursBucket(Long millis, String bucket) { <START> return TimeUnit.MILLISECONDS.toHours(millis) / Integer.parseInt(bucket); <END> }</code><technical_language>Isnt Integer.valueOf()? Agreed returns object, objects cached (for < 128 values, is case here). Otherwise, parsing a string for row ingested</technical_language>

Target:
static Long toEpochHoursBucket(Long millis, String bucket) { return TimeUnit.MILLISECONDS.toHours(millis) / Integer.valueOf(bucket); }
Source:
<code>public synchronized void seek(long pos) throws IOException { if (!initialized) { blockPosition = pos; return; } checkOpen(); if (pos < 0 || pos >= length) { <START> if (pos == 0) { <END> return; } throw new EOFException( "EOF encountered at pos: " + pos + " for block: " + blockID); } Preconditions.assertTrue(chunkIndex >= 0); if (chunkIndex >= chunkStreams.size()) { chunkIndex = Arrays.binarySearch(chunkOffsets, pos); } else if (pos < chunkOffsets[chunkIndex]) { chunkIndex = Arrays.binarySearch(chunkOffsets, 0, chunkIndex, pos); } else if (pos >= chunkOffsets[chunkIndex] + chunkStreams .get(chunkIndex).getLength()) { chunkIndex = Arrays.binarySearch(chunkOffsets, chunkIndex + 1, chunkStreams.size(), pos); } if (chunkIndex < 0) { chunkIndex = -chunkIndex - 2; } chunkStreams.get(chunkIndexOfPrevPosition).resetPosition(); chunkStreams.get(chunkIndex).seek(pos - chunkOffsets[chunkIndex]); chunkIndexOfPrevPosition = chunkIndex; }</code><technical_language>do need this</technical_language>

Target:
public synchronized void seek(long pos) throws IOException { if (!initialized) { blockPosition = pos; return; } checkOpen(); if (pos < 0 || pos >= length) { if (pos == 0) { return; } throw new EOFException( "EOF encountered at pos: " + pos + " for block: " + blockID); } if (chunkIndex >= chunkStreams.size()) { chunkIndex = Arrays.binarySearch(chunkOffsets, pos); } else if (pos < chunkOffsets[chunkIndex]) { chunkIndex = Arrays.binarySearch(chunkOffsets, 0, chunkIndex, pos); } else if (pos >= chunkOffsets[chunkIndex] + chunkStreams .get(chunkIndex).getLength()) { chunkIndex = Arrays.binarySearch(chunkOffsets, chunkIndex + 1, chunkStreams.size(), pos); } if (chunkIndex < 0) { chunkIndex = -chunkIndex - 2; } chunkStreams.get(chunkIndexOfPrevPosition).resetPosition(); chunkStreams.get(chunkIndex).seek(pos - chunkOffsets[chunkIndex]); chunkIndexOfPrevPosition = chunkIndex; }
Source:
<code>void otherSuccess(T value) { if (compareAndSet(0, 1)) { actual.onNext(value); <START> otherState = 2; <END> } else { singleItem = value; otherState = 1; if (getAndIncrement() != 0) { return; } } drainLoop(); }</code><technical_language>some constants improve readability? hard follow</technical_language>

Target:
void otherSuccess(T value) { if (compareAndSet(0, 1)) { actual.onNext(value); otherState = OTHER_STATE_CONSUMED_OR_EMPTY; } else { singleItem = value; otherState = OTHER_STATE_HAS_VALUE; if (getAndIncrement() != 0) { return; } } drainLoop(); }
Source:
<code>private FeedbackSessionAttributes getNewFeedbackSession() { return FeedbackSessionAttributes.builder("fsTest1", "testCourse", "valid@email.tmt") .withCreatedTime(Instant.now()) .withStartTime(Instant.now()) <START> .withSessionVisibleFromTime(Instant.now()) <END> .withResultsVisibleFromTime(Instant.now()) .withEndTime(Instant.now()) .withGracePeriodMinutes(5) .withSentOpenEmail(true) .withSentPublishedEmail(true) .withInstructions("Give feedback.") .build(); }</code><technical_language>Visible start? Actually, do want swap order session valid? is totally fine of methods TimeHelperExtension a valid session. e.g. Session visible 3 hour ago, start 2 hour ago, end 1 hour visible now</technical_language>

Target:
private FeedbackSessionAttributes getNewFeedbackSession() { return FeedbackSessionAttributes.builder("fsTest1", "testCourse", "valid@email.tmt") .withCreatedTime(TimeHelperExtension.getInstantHoursOffsetFromNow(-2)) .withSessionVisibleFromTime(TimeHelperExtension.getInstantMinutesOffsetFromNow(-62)) .withStartTime(TimeHelperExtension.getInstantHoursOffsetFromNow(-1)) .withEndTime(TimeHelperExtension.getInstantHoursOffsetFromNow(0)) .withResultsVisibleFromTime(TimeHelperExtension.getInstantMinutesOffsetFromNow(1)) .withGracePeriodMinutes(5) .withSentOpenEmail(true) .withSentPublishedEmail(true) .withInstructions("Give feedback.") .build(); }
Source:
<code>public void setUp() throws Exception { final Props props = new Props(); <START> final Injector injector = Guice.createInjector(new AbstractModule() { <END> @Override protected void configure() { bind(CommonMetrics.class).in(Scopes.SINGLETON); } }); SERVICE_PROVIDER.unsetInjector(); SERVICE_PROVIDER.setInjector(injector); final File jobTypeDir = this.temp.newFolder(TEST_PLUGIN_DIR); this.testPluginDirPath = jobTypeDir.getCanonicalPath(); final URL resourceUrl = Resources.getResource("plugins/jobtypes"); assertNotNull(resourceUrl); FileUtils.copyDirectory(new File(resourceUrl.toURI()), jobTypeDir); this.manager = new JobTypeManager(this.testPluginDirPath, null, this.getClass().getClassLoader()); }</code><technical_language>is this change necessary</technical_language>

Target:
public void setUp() throws Exception { initServiceProvider(); final File jobTypeDir = this.temp.newFolder(TEST_PLUGIN_DIR); this.testPluginDirPath = jobTypeDir.getCanonicalPath(); final URL resourceUrl = Resources.getResource("plugins/jobtypes"); assertNotNull(resourceUrl); FileUtils.copyDirectory(new File(resourceUrl.toURI()), jobTypeDir); this.manager = new JobTypeManager(this.testPluginDirPath, null, this.getClass().getClassLoader()); }
Source:
<code>public static CommonFilesAction getDefault(){ <START> if(instance == null){ <END> instance = new CommonFilesAction(); } return instance; }</code><technical_language>Please do a format of files committing (ALT+SHIFT+F)</technical_language>

Target:
public static synchronized CommonFilesAction getDefault() { if (instance == null) { instance = new CommonFilesAction(); } return instance; }
Source:
<code>public void serviceStart() throws Exception { startJvmPauseMonitor(); tajoMasterInfo = new TajoMasterInfo(); if (systemConf.getBoolVar(TajoConf.ConfVars.TAJO_MASTER_HA_ENABLE)) { long retryWaitTime = systemConf.getLongVar(TajoConf.ConfVars.TAJO_MASTER_HA_CLIENT_RETRY_WAIT_TIME); int retryMaxNum = systemConf.getIntVar(ConfVars.TAJO_MASTER_HA_CLIENT_RETRY_MAX_NUM); int retryNum = 1; boolean done = false; while (!done && retryNum < retryMaxNum) { try { tajoMasterInfo.setTajoMasterAddress(serviceTracker.getUmbilicalAddress()); tajoMasterInfo.setWorkerResourceTrackerAddr(serviceTracker.getResourceTrackerAddress()); done = true; LOG.info("Find a new TajoMaster (" + tajoMasterInfo.getTajoMasterAddress() + ")"); } catch (ServiceTrackerException e) { LOG.warn("Retry TajoMaster address (" + retryNum + ")"); Thread.sleep(retryWaitTime); } retryNum++; if (retryNum == retryMaxNum) { LOG.error("ERROR: the maximum retry (" + retryNum + ") to read TajoMaster address"); break; <START> } <END> } } else { tajoMasterInfo.setTajoMasterAddress(NetUtils.createSocketAddr(systemConf.getVar(ConfVars .TAJO_MASTER_UMBILICAL_RPC_ADDRESS))); tajoMasterInfo.setWorkerResourceTrackerAddr(NetUtils.createSocketAddr(systemConf.getVar(ConfVars .RESOURCE_TRACKER_RPC_ADDRESS))); } connectToCatalog(); if (!systemConf.get(CommonTestingUtil.TAJO_TEST_KEY, "FALSE").equalsIgnoreCase("TRUE")) { initCleanupService(); } initWorkerMetrics(); super.serviceStart(); LOG.info("Tajo Worker is started"); }</code><technical_language>move retry codes HdfsServiceTracker ? backup master is registered in PingChecker</technical_language>

Target:
public void serviceStart() throws Exception { startJvmPauseMonitor(); tajoMasterInfo = new TajoMasterInfo(); if (systemConf.getBoolVar(TajoConf.ConfVars.TAJO_MASTER_HA_ENABLE)) { tajoMasterInfo.setTajoMasterAddress(serviceTracker.getUmbilicalAddress()); tajoMasterInfo.setWorkerResourceTrackerAddr(serviceTracker.getResourceTrackerAddress()); } else { tajoMasterInfo.setTajoMasterAddress(NetUtils.createSocketAddr(systemConf.getVar(ConfVars .TAJO_MASTER_UMBILICAL_RPC_ADDRESS))); tajoMasterInfo.setWorkerResourceTrackerAddr(NetUtils.createSocketAddr(systemConf.getVar(ConfVars .RESOURCE_TRACKER_RPC_ADDRESS))); } connectToCatalog(); if (!systemConf.get(CommonTestingUtil.TAJO_TEST_KEY, "FALSE").equalsIgnoreCase("TRUE")) { initCleanupService(); } initWorkerMetrics(); super.serviceStart(); LOG.info("Tajo Worker is started"); }
Source:
<code>private void displaySnapshotMetadata(SnapshotMetadata metadata) { TextView metaDataView = (TextView) findViewById(R.id.text_metadata); <START> metaDataView.setText(""); <END> if (metadata == null) { return; } String metadataStr = "Source: Saved Games" + '\n' + "Description: " + metadata.getDescription() + '\n' + "Name: " + metadata.getUniqueName() + '\n' + "Last Modified: " + String.valueOf(metadata.getLastModifiedTimestamp()) + '\n' + "Played Time: " + String.valueOf(metadata.getPlayedTime()) + '\n' + "Cover Image URL: " + metadata.getCoverImageUrl(); metaDataView.setText(metadataStr); }</code><technical_language>ibid</technical_language>

Target:
private void displaySnapshotMetadata(SnapshotMetadata metadata) { TextView metaDataView = (TextView) findViewById(R.id.text_metadata); if (metadata == null) { metaDataView.setText(""); return; } String metadataStr = "Source: Saved Games" + '\n' + "Description: " + metadata.getDescription() + '\n' + "Name: " + metadata.getUniqueName() + '\n' + "Last Modified: " + String.valueOf(metadata.getLastModifiedTimestamp()) + '\n' + "Played Time: " + String.valueOf(metadata.getPlayedTime()) + '\n' + "Cover Image URL: " + metadata.getCoverImageUrl(); metaDataView.setText(metadataStr); }
Source:
<code>public void capitalizeEnglish() { Locale.setDefault(Locale.ENGLISH); String international = Strings.capitalize("international"); <START> assertEquals("International", international); <END> }</code><technical_language>AssertJ for tests</technical_language>

Target:
public void capitalizeEnglish() { Locale.setDefault( Locale.ENGLISH ); String international = Strings.capitalize( "international" ); assertThat( international ).isEqualTo( "International" ); }
Source:
<code>private int syncFromChangesNonMerging(Collection<Change> changes, boolean verifyResult) { Set<String> entityIds = newHashSetWithExpectedSize(changes.size()); List<Statement> insertStatements = new ArrayList<>(); ClassifiedStatements classifiedStatements = new ClassifiedStatements(uris); Set<String> valueSet = new HashSet<>(); Set<String> refSet = new HashSet<>(); UpdateQueryFactory <START> updateQueryFactory = <END> new UpdateQueryFactory(uris); int modified = 0; for (final Change change : changes) { if (change.getStatements() == null) { continue; } entityIds.add(change.entityId()); insertStatements.addAll(change.getStatements()); classifiedStatements.classify(change.getStatements(), change.entityId()); valueSet.addAll(change.getValueCleanupList()); refSet.addAll(change.getRefCleanupList()); if (insertStatements.size() > maxStatementsPerBatch || classifiedStatements.getDataSize() > maxPostDataSize) { log.info("Too much data with bytes - sending batch out, last ID {}", classifiedStatements.getDataSize(), change.entityId()); modified += sendUpdateBatch(updateQueryFactory, entityIds, insertStatements, classifiedStatements, refSet, valueSet, verifyResult); entityIds.clear(); insertStatements.clear(); classifiedStatements.clear(); valueSet.clear(); refSet.clear(); } } if (!entityIds.isEmpty()) { modified += sendUpdateBatch(updateQueryFactory, entityIds, insertStatements, classifiedStatements, refSet, valueSet, verifyResult); } return modified; }</code><technical_language>This immutable uris is stable in this context. this instance variable instead</technical_language>

Target:
private int syncFromChangesNonMerging(Collection<Change> changes, boolean verifyResult) { Set<String> entityIds = newHashSetWithExpectedSize(changes.size()); List<Statement> insertStatements = new ArrayList<>(); ClassifiedStatements classifiedStatements = new ClassifiedStatements(uris); Set<String> valueSet = new HashSet<>(); Set<String> refSet = new HashSet<>(); int modified = 0; for (final Change change : changes) { if (change.getStatements() == null) { continue; } entityIds.add(change.entityId()); insertStatements.addAll(change.getStatements()); classifiedStatements.classify(change.getStatements(), change.entityId()); valueSet.addAll(change.getValueCleanupList()); refSet.addAll(change.getRefCleanupList()); if (insertStatements.size() > maxStatementsPerBatch || classifiedStatements.getDataSize() > maxPostDataSize) { log.info("Too much data with bytes - sending batch out, last ID {}", classifiedStatements.getDataSize(), change.entityId()); modified += sendUpdateBatch(entityIds, insertStatements, classifiedStatements, refSet, valueSet, verifyResult); entityIds.clear(); insertStatements.clear(); classifiedStatements.clear(); valueSet.clear(); refSet.clear(); } } if (!entityIds.isEmpty()) { modified += sendUpdateBatch(entityIds, insertStatements, classifiedStatements, refSet, valueSet, verifyResult); } return modified; }
Source:
<code>void exec() throws ReplicationException; } private void interruptOrAbortWhenFail(ReplicationQueueOperation op) { try { op.exec(); } catch (ReplicationException e) { if (e.getCause() != null && e.getCause() instanceof KeeperException.SystemErrorException && e.getCause().getCause() != null && e.getCause() .getCause() instanceof InterruptedException) { LOG.info("Thread is interrupted, the replication source may be terminated"); <START> return; <END> } server.abort("Failed to operate on replication queue", e); } }</code><technical_language>want propagate InterruptedException? run loop in ReplicationSourceShipper is designed handle exception. return continue thread executing, I is want</technical_language>

Target:
void exec() throws ReplicationException; } private void interruptOrAbortWhenFail(ReplicationQueueOperation op) { try { op.exec(); } catch (ReplicationException e) { if (e.getCause() != null && e.getCause() instanceof KeeperException.SystemErrorException && e.getCause().getCause() != null && e.getCause() .getCause() instanceof InterruptedException) { throw new ReplicationRuntimeException( "Thread is interrupted, the replication source may be terminated", e.getCause().getCause()); } server.abort("Failed to operate on replication queue", e); } }
Source:
<code><START> public void commitCommandToLayer(LayerCommand layerCommand, Command bitmapCommand) { <END> synchronized (mLayerCommandList) { clearUndoCommandList(); enableUndo(true); ArrayList<LayerBitmapCommand> result = getLayerBitmapCommands(layerCommand.getLayer().getLayerID()); result.get(0).commitCommandToLayer(bitmapCommand); layerCommand.setLayersBitmapCommands(result); mLayerCommandList.addLast(createLayerCommand(CommandType.COMMIT_LAYER_BITMAP_COMMAND, layerCommand)); } drawingSurfaceRedraw(); }</code><technical_language>is parameter a LayerCommand if need resulting Layer</technical_language>

Target:
public void commitCommandToLayer(LayerCommand layerCommand, Command bitmapCommand) { synchronized (mLayerOperationsCommandList) { clearUndoCommandList(); enableUndo(true); ArrayList<LayerBitmapCommand> result = getLayerBitmapCommands(layerCommand.getLayer().getLayerID()); result.get(0).commitCommandToLayer(bitmapCommand); layerCommand.setLayersBitmapCommands(result); mLayerOperationsCommandList.addLast(createLayerCommand(CommandType.COMMIT_LAYER_BITMAP_COMMAND, layerCommand)); } drawingSurfaceRedraw(); }
Source:
<code>private boolean isKarafOk() { Class serviceClass = KarafHealthService.class; try { <START> final KarafHealthService service = SERVICE_LOOKUP.lookup(serviceClass, null); <END> return service != null; } catch (Exception e) { LOG.warn("Could not lookup {}, will fail.", serviceClass.getName(), e); return false; } }</code><technical_language>add a log message block while waiting for a service available</technical_language>

Target:
private boolean isKarafOk() { Class serviceClass = KarafHealthService.class; try { LOG.info("Waiting for loading of {}, will block startup until service is available.", serviceClass.getName()); final KarafHealthService service = SERVICE_LOOKUP.lookup(serviceClass, null); return service != null; } catch (Exception e) { LOG.error("Could not lookup {}, will fail.", serviceClass.getName(), e); return false; } }