auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
protected Object decode( ChannelHandlerContext ctx, Channel channel, ByteBuf buf) throws Exception { if (buf.readableBytes() < KEEP_ALIVE_LENGTH) { return null; } if (buf.getUnsignedByte(buf.readerIndex()) == 0xD0) { ByteBuf frame = buf.readBytes(KEEP_ALIVE_LENGTH); if (ctx != null && ctx.channel() != null) { ctx.channel().writeAndFlush(new NetworkMessage(frame, ctx.channel().remoteAddress())); } return frame; } else { int index = new AsciiString(buf.array(), buf.readerIndex(), buf.writerIndex(), false).indexOf("\r\n"); if (index != -1) { ByteBuf frame = buf.readBytes(index - buf.readerIndex()); buf.skipBytes(2); return frame; } } return null; }

Target:
protected Object decode( ChannelHandlerContext ctx, Channel channel, ByteBuf buf) throws Exception { if (buf.readableBytes() < KEEP_ALIVE_LENGTH) { return null; } if (buf.getUnsignedByte(buf.readerIndex()) == 0xD0) { ByteBuf frame = buf.readBytes(KEEP_ALIVE_LENGTH); if (channel != null) { channel.writeAndFlush(new NetworkMessage(frame, channel.remoteAddress())); } return frame; } else { ByteBuf delimiter = Unpooled.wrappedBuffer("\r\n".getBytes(StandardCharsets.US_ASCII)); int index = ByteBufUtil.indexOf(delimiter, buf); if (index != -1) { ByteBuf frame = buf.readBytes(index - buf.readerIndex()); buf.skipBytes(2); return frame; } } return null; }
Source:
protected File execute(UnalignedSettings settings) throws Exception { final File checkpointDir = temp.newFolder(); StreamExecutionEnvironment env = settings.createEnvironment(checkpointDir); int minCheckpoints = 10; settings.dagCreator.accept(env, minCheckpoints, settings.slotSharing); try { final JobExecutionResult result = env.execute(); collector.checkThat("NUM_OUT_OF_ORDER", result.<Long>getAccumulatorResult(NUM_OUT_OF_ORDER), equalTo(0L)); collector.checkThat("NUM_DUPLICATES", result.<Long>getAccumulatorResult(NUM_DUPLICATES), equalTo(0L)); collector.checkThat("NUM_LOST", result.<Long>getAccumulatorResult(NUM_LOST), equalTo(0L)); collector.checkThat("NUM_FAILURES", result.<Integer>getAccumulatorResult(NUM_FAILURES), equalTo(settings.expectedFailures)); } catch (Exception e) { if (settings.generateCheckpoint) { return Files.find(checkpointDir.toPath(), 2, (file, attr) -> attr.isDirectory() && file.getFileName().toString().startsWith("chk")) .findFirst() .map(Path::toFile) .orElseThrow(() -> new IllegalStateException("Cannot generate checkpoint", e)); } throw e; } if (settings.generateCheckpoint) { fail("Could not generate checkpoint"); } return null; }

Target:
protected File execute(UnalignedSettings settings) throws Exception { final File checkpointDir = temp.newFolder(); StreamExecutionEnvironment env = settings.createEnvironment(checkpointDir); settings.dagCreator.create(env, settings.minCheckpoints, settings.slotSharing, settings.expectedFailures - 1); try { final JobExecutionResult result = env.execute(); collector.checkThat("NUM_OUT_OF_ORDER", result.<Long>getAccumulatorResult(NUM_OUT_OF_ORDER), equalTo(0L)); collector.checkThat("NUM_DUPLICATES", result.<Long>getAccumulatorResult(NUM_DUPLICATES), equalTo(0L)); collector.checkThat("NUM_LOST", result.<Long>getAccumulatorResult(NUM_LOST), equalTo(0L)); collector.checkThat("NUM_FAILURES", result.<Integer>getAccumulatorResult(NUM_FAILURES), equalTo(settings.expectedFailures)); } catch (Exception e) { if (settings.generateCheckpoint) { return Files.find(checkpointDir.toPath(), 2, (file, attr) -> attr.isDirectory() && file.getFileName().toString().startsWith("chk")) .findFirst() .map(Path::toFile) .orElseThrow(() -> new IllegalStateException("Cannot generate checkpoint", e)); } throw e; } if (settings.generateCheckpoint) { fail("Could not generate checkpoint"); } return null; }
Source:
public void addRepeat(boolean fromPrompt) { if (formController == null) { return; } if (jumpBackIndex != null) { jumpBackIndex = null; analytics.logEvent(ADD_REPEAT, "Inline", formController.getCurrentFormIdentifierHash()); } else if (fromPrompt) { analytics.logEvent(ADD_REPEAT, "Prompt", formController.getCurrentFormIdentifierHash()); } else { analytics.logEvent(ADD_REPEAT, "Hierarchy", formController.getCurrentFormIdentifierHash()); } try { formController.newRepeat(); } catch (RuntimeException e) { error.setValue(e.getCause() != null ? e.getCause().getMessage() : "Unknown issue occurred while adding a new group"); } if (!formController.indexIsInFieldList()) { try { formController.stepToNextScreenEvent(); } catch (JavaRosaException e) { error.setValue(e.getCause() != null ? e.getCause().getMessage() : "Unknown issue occurred while adding a new group"); } } }

Target:
public void addRepeat(boolean fromPrompt) { if (formController == null) { return; } if (jumpBackIndex != null) { jumpBackIndex = null; analytics.logEvent(ADD_REPEAT, "Inline", formController.getCurrentFormIdentifierHash()); } else if (fromPrompt) { analytics.logEvent(ADD_REPEAT, "Prompt", formController.getCurrentFormIdentifierHash()); } else { analytics.logEvent(ADD_REPEAT, "Hierarchy", formController.getCurrentFormIdentifierHash()); } try { formController.newRepeat(); } catch (RuntimeException e) { error.setValue(e.getCause() != null ? e.getCause().getMessage() : e.getMessage()); } if (!formController.indexIsInFieldList()) { try { formController.stepToNextScreenEvent(); } catch (JavaRosaException e) { error.setValue(e.getCause() != null ? e.getCause().getMessage() : e.getMessage()); } } }
Source:
public void validateDiskInBackupDomainForUpVM() { createParameters(); initDiskImage(diskImageGroupId, diskImageId); initVm(VMStatus.Up, Guid.newGuid(), diskImageGroupId); StorageDomain srcStorageDomain = initStorageDomain(srcStorageId); srcStorageDomain.setStatus(StorageDomainStatus.Active); srcStorageDomain.setStorageType(StorageType.NFS); StorageDomain destStorageDomain = initStorageDomain(dstStorageId); destStorageDomain.setStatus(StorageDomainStatus.Active); destStorageDomain.setStorageType(StorageType.NFS); destStorageDomain.setBackup(true); doReturn(destStorageDomain).when(command).getStorageDomain(); ValidateTestUtils.runAndAssertValidateFailure(command, EngineMessage.ACTION_TYPE_FAILED_RUNNING_VM_DISK_CANNOT_COPY_OR_MOVE_TO_BACKUP_DOMAIN); }

Target:
public void validateDiskInBackupDomainForUpVM() { createParameters(); initDiskImage(diskImageGroupId, diskImageId); initVm(VMStatus.Up, Guid.newGuid(), diskImageGroupId); StorageDomain destStorageDomain = initStorageDomain(dstStorageId); destStorageDomain.setStatus(StorageDomainStatus.Active); destStorageDomain.setStorageType(StorageType.NFS); destStorageDomain.setBackup(true); ValidateTestUtils.runAndAssertValidateFailure(command, EngineMessage.ACTION_TYPE_FAILED_RUNNING_VM_DISK_CANNOT_COPY_OR_MOVE_TO_BACKUP_DOMAIN); }
Source:
public static String relativize(String base, String other) { if (base.equals(other)) return ""; final boolean ignoreCase = SystemReader.getInstance().isWindows(); final String[] baseSegments = base.split(Pattern.quote(File.separator)); final String[] otherSegments = other.split(Pattern .quote(File.separator)); int commonPrefix = 0; while (commonPrefix < baseSegments.length && commonPrefix < otherSegments.length) { if (ignoreCase && baseSegments[commonPrefix] .equalsIgnoreCase(otherSegments[commonPrefix])) commonPrefix++; else if (!ignoreCase && baseSegments[commonPrefix] .equals(otherSegments[commonPrefix])) commonPrefix++; else break; } final StringBuilder builder = new StringBuilder(); for (int i = commonPrefix; i < baseSegments.length; i++) builder.append("..").append(File.separator); for (int i = commonPrefix; i < otherSegments.length; i++) { builder.append(otherSegments[i]); if (i < otherSegments.length - 1) builder.append(File.separator); } return builder.toString(); }

Target:
public static String relativize(String base, String other) { if (base.equals(other)) return ""; final boolean ignoreCase = !FS.DETECTED.isCaseSensitive(); final String[] baseSegments = base.split(Pattern.quote(File.separator)); final String[] otherSegments = other.split(Pattern .quote(File.separator)); int commonPrefix = 0; while (commonPrefix < baseSegments.length && commonPrefix < otherSegments.length) { if (ignoreCase && baseSegments[commonPrefix] .equalsIgnoreCase(otherSegments[commonPrefix])) commonPrefix++; else if (!ignoreCase && baseSegments[commonPrefix] .equals(otherSegments[commonPrefix])) commonPrefix++; else break; } final StringBuilder builder = new StringBuilder(); for (int i = commonPrefix; i < baseSegments.length; i++) builder.append("..").append(File.separator); for (int i = commonPrefix; i < otherSegments.length; i++) { builder.append(otherSegments[i]); if (i < otherSegments.length - 1) builder.append(File.separator); } return builder.toString(); }
Source:
protected Object writeReplace() { Channel currentChannel = Channel.current(); if (currentChannel == null) return null; return remoteProxyFor(currentChannel.export(IGitAPI.class, this)); }

Target:
protected Object writeReplace() throws java.io.ObjectStreamException { Channel currentChannel = Channel.current(); if (currentChannel == null) throw new java.io.WriteAbortedException("No current channel", new java.lang.NullPointerException()); return remoteProxyFor(currentChannel.export(IGitAPI.class, this)); }
Source:
public void mergeDependencies(Collection<ClassLoaderModel> otherClassloaderModels) { for (ClassLoaderModel otherClassLoaderModel : otherClassloaderModels) { Artifact pluginArtifact = getClassLoaderModel().getDependencies().stream() .filter(dependency -> dependency.getArtifactCoordinates().equals(otherClassLoaderModel.getArtifactCoordinates())) .findFirst() .orElseThrow(() -> new IllegalStateException(format("Couldn't find an artifact coordinate for '%s' to merge dependencies as inline", otherClassLoaderModel.getArtifactCoordinates()))); if (nestedClassLoaderModels.putIfAbsent(otherClassLoaderModel.getArtifactCoordinates(), otherClassLoaderModel) != null) { throw new IllegalArgumentException(format("Duplicated definition of a nested class loader model for artifact coordinates '%s'", otherClassLoaderModel.getArtifactCoordinates())); } pluginArtifact.setDependencies(otherClassLoaderModel.getDependencies()); } }

Target:
public void mergeDependencies(Collection<ClassLoaderModel> otherClassloaderModels) { doMergeDependencies(otherClassloaderModels, context -> { }); }
Source:
public Bundle getAuthToken(final Context context, final Bundle requestBundle) throws AuthenticationException { final CountDownLatch countDownLatch = new CountDownLatch(1); final AtomicReference<Bundle> bundleResult = new AtomicReference<>(null); final AtomicReference<Throwable> exception = new AtomicReference<>(null); bindToBrokerAccountService(context, new Callback<BrokerAccountServiceConnection>() { @Override public void onSuccess(BrokerAccountServiceConnection result) { final IBrokerAccountService brokerAccountService = result.getBrokerAccountServiceProvider(); try { HttpWebRequest.throwIfNetworkNotAvaliable(context); bundleResult.set(brokerAccountService.acquireTokenSilently(prepareGetAuthTokenRequestData(context, requestBundle))); } catch (final RemoteException | AuthenticationException exc) { exception.set(exc); } countDownLatch.countDown(); } @Override public void onError(Throwable throwable) { exception.set(throwable); countDownLatch.countDown(); } }); try { countDownLatch.await(); } catch (final InterruptedException e) { exception.set(e); } final Throwable throwable = exception.getAndSet(null); if (throwable != null) { throw new AuthenticationException(ADALError.AUTH_REFRESH_FAILED_PROMPT_NOT_ALLOWED, throwable.getMessage(), throwable); } return bundleResult.getAndSet(null); }

Target:
public Bundle getAuthToken(final Context context, final Bundle requestBundle) throws AuthenticationException { final CountDownLatch countDownLatch = new CountDownLatch(1); final AtomicReference<Bundle> bundleResult = new AtomicReference<>(null); final AtomicReference<Throwable> exception = new AtomicReference<>(null); bindToBrokerAccountService(context, new Callback<BrokerAccountServiceConnection>() { @Override public void onSuccess(BrokerAccountServiceConnection result) { final IBrokerAccountService brokerAccountService = result.getBrokerAccountServiceProvider(); try { bundleResult.set(brokerAccountService.acquireTokenSilently(prepareGetAuthTokenRequestData(context, requestBundle))); } catch (final RemoteException remoteException) { exception.set(remoteException); } countDownLatch.countDown(); } @Override public void onError(Throwable throwable) { exception.set(throwable); countDownLatch.countDown(); } }); try { countDownLatch.await(); } catch (final InterruptedException e) { exception.set(e); } final Throwable throwable = exception.getAndSet(null); if (throwable != null) { throw new AuthenticationException(ADALError.AUTH_REFRESH_FAILED_PROMPT_NOT_ALLOWED, throwable.getMessage(), throwable); } return bundleResult.getAndSet(null); }
Source:
private String getTeamNameForUser(String giver, InstructorAttributes instructorGiver, StudentAttributes studentGiver) { String giverTeam = null; boolean isStudentGiver = studentGiver != null; boolean isInstructorGiver = instructorGiver != null; if (isStudentGiver) { giverTeam = studentGiver.team; } else if (isInstructorGiver) { giverTeam = Const.USER_TEAM_FOR_INSTRUCTOR; } else { giverTeam = giver; } return giverTeam; }

Target:
private String getTeamNameForUser(String giver, InstructorAttributes instructorGiver, StudentAttributes studentGiver) { boolean isStudentGiver = studentGiver != null; boolean isInstructorGiver = instructorGiver != null; if (isStudentGiver) { return studentGiver.team; } else if (isInstructorGiver) { return Const.USER_TEAM_FOR_INSTRUCTOR; } return giver; }
Source:
public void setType(int x, int z, int y, int type) { if (type < 0 || type >= 256) throw new IllegalArgumentException("Block type out of range: " + type); ChunkSection section = getSection(y); if (section == null) { if (type == 0) { return; } else { int idx = y >> 4; if (y < 0 || y >= DEPTH || idx >= sections.length) { return; } sections[idx] = section = new ChunkSection(); } } int tileEntityIndex = coordToIndex(x, z, y); if (tileEntities.containsKey(tileEntityIndex)) { tileEntities.remove(tileEntityIndex).destroy(); } int index = section.index(x, y, z); if (type == 0) { if(section.types[index] != 0) section.count--; } else { if(section.types[index] == 0) section.count++; } section.types[index] = (char) (type << 4); if (type == 0 && section.count == 0) { sections[y / SEC_DEPTH] = null; return; } createEntity(x, y, z, type); }

Target:
public void setType(int x, int z, int y, int type) { if (type < 0 || type >= 256) throw new IllegalArgumentException("Block type out of range: " + type); ChunkSection section = getSection(y); if (section == null) { if (type == 0) { return; } else { int idx = y >> 4; if (y < 0 || y >= DEPTH || idx >= sections.length) { return; } sections[idx] = section = new ChunkSection(); } } int tileEntityIndex = coordToIndex(x, z, y); if (tileEntities.containsKey(tileEntityIndex)) { tileEntities.remove(tileEntityIndex).destroy(); } int index = section.index(x, y, z); if (type == 0) { if(section.types[index] != 0) { section.count--; } } else { if(section.types[index] == 0) { section.count++; } } section.types[index] = (char) (type << 4); if (type == 0 && section.count == 0) { sections[y / SEC_DEPTH] = null; return; } createEntity(x, y, z, type); }
Source:
public long addTaskStarted(Task task, Map<String, Object> parameters) { int totalActions = task.getActions().size(); TaskActivity activity = taskActivitiesDataService.create( new TaskActivity(TASK_IN_PROGRESS, Arrays.asList("0", String.valueOf(totalActions)), task.getId(), TaskActivityType.IN_PROGRESS, null, parameters, totalActions)); return activity.getId(); }

Target:
public long addTaskStarted(Task task, Map<String, Object> parameters) { int totalActions = task.getActions().size(); TaskActivity activity = taskActivitiesDataService.create( new TaskActivity(TASK_IN_PROGRESS, Arrays.asList("0", String.valueOf(totalActions)), task.getId(), TaskActivityType.IN_PROGRESS, null, parameters, new TaskExecutionProgress(totalActions))); return activity.getId(); }
Source:
private Supplier<DruidLongPredicate> makeLongPredicateSupplier() { class BoundLongPredicateSupplier implements Supplier<DruidLongPredicate> { private final Object initLock = new Object(); private boolean matchesNothing; private DruidLongPredicate predicate; @Override public DruidLongPredicate get() { initPredicate(); return predicate; } private void initPredicate() { if (predicate != null) { return; } synchronized (initLock) { if (predicate != null) { return; } final boolean hasLowerLongBound; final boolean hasUpperLongBound; final long lowerLongBound; final long upperLongBound; matchesNothing = false; if (hasLowerBound()) { final Long lowerLong = GuavaUtils.tryParseLong(lower); if (lowerLong == null) { hasLowerLongBound = false; lowerLongBound = 0L; } else { hasLowerLongBound = true; lowerLongBound = lowerLong; } } else { hasLowerLongBound = false; lowerLongBound = 0L; } if (hasUpperBound()) { Long upperLong = GuavaUtils.tryParseLong(upper); if (upperLong == null) { matchesNothing = true; hasUpperLongBound = false; upperLongBound = 0L; } else { hasUpperLongBound = true; upperLongBound = upperLong; } } else { hasUpperLongBound = false; upperLongBound = 0L; } if (matchesNothing) { predicate = DruidLongPredicate.FALSE_PREDICATE; } else { predicate = new DruidLongPredicate() { @Override public boolean applyLong(long input) { int lowerComparing = 1; int upperComparing = 1; if (hasLowerLongBound) { lowerComparing = Long.compare(input, lowerLongBound); } if (hasUpperLongBound) { upperComparing = Long.compare(upperLongBound, input); } return boundsCheck(lowerStrict, upperStrict, lowerComparing, upperComparing); } }; } } } } return new BoundLongPredicateSupplier(); }

Target:
private Supplier<DruidLongPredicate> makeLongPredicateSupplier() { class BoundLongPredicateSupplier implements Supplier<DruidLongPredicate> { private final Object initLock = new Object(); private DruidLongPredicate predicate; @Override public DruidLongPredicate get() { initPredicate(); return predicate; } private void initPredicate() { if (predicate != null) { return; } synchronized (initLock) { if (predicate != null) { return; } final boolean hasLowerLongBound; final boolean hasUpperLongBound; final long lowerLongBound; final long upperLongBound; boolean matchesNothing = false; if (hasLowerBound()) { final Long lowerLong = GuavaUtils.tryParseLong(lower); if (lowerLong == null) { hasLowerLongBound = false; lowerLongBound = 0L; } else { hasLowerLongBound = true; lowerLongBound = lowerLong; } } else { hasLowerLongBound = false; lowerLongBound = 0L; } if (hasUpperBound()) { Long upperLong = GuavaUtils.tryParseLong(upper); if (upperLong == null) { matchesNothing = true; hasUpperLongBound = false; upperLongBound = 0L; } else { hasUpperLongBound = true; upperLongBound = upperLong; } } else { hasUpperLongBound = false; upperLongBound = 0L; } if (matchesNothing) { predicate = DruidLongPredicate.ALWAYS_FALSE; } else { predicate = makeLongPredicateFromBounds( hasLowerLongBound, hasUpperLongBound, lowerStrict, upperStrict, lowerLongBound, upperLongBound ); } } } } return new BoundLongPredicateSupplier(); }
Source:
public boolean editUserText(String fullname, String text) throws ActionFailedException { JSONObject object = (JSONObject) restClient.post( "thing_id=" + fullname + "&text=" + text + "&uh=" + user.getModhash(), ApiEndpointUtils.EDITUSERTEXT, user.getCookie() ).getResponseObject(); if (object.toJSONString().contains(".error.USER_REQUIRED")) { System.err.println("User is required for this action."); return false; } else if (object.toJSONString().contains(".error.NOT_AUTHOR")) { System.err.println("User is not the author of this thing."); return false; } else if (object.toJSONString().contains(".error.TOO_LONG")) { System.err.println("The text is too long."); return false; } else if (object.toJSONString().contains(".error.NO_TEXT")) { System.err.println("Missing text."); return false; } else { return true; } }

Target:
public boolean editUserText(String fullname, String text) throws ActionFailedException { JSONObject object = (JSONObject) restClient.post( "thing_id=" + fullname + "&text=" + text + "&uh=" + user.getModhash(), ApiEndpointUtils.EDITUSERTEXT, user.getCookie() ).getResponseObject(); String responseAsString = object.toJSONString(); if (responseAsString.contains(".error.USER_REQUIRED")) { System.err.println("User is required for this action."); return false; } else if (responseAsString.contains(".error.NOT_AUTHOR")) { System.err.println("User is not the author of this thing."); return false; } else if (responseAsString.contains(".error.TOO_LONG")) { System.err.println("The text is too long."); return false; } else if (responseAsString.contains(".error.NO_TEXT")) { System.err.println("Missing text."); return false; } else { return true; } }
Source:
public DescribeResult describe(char type, String portalOrStatement) { if (LOGGER.isDebugEnabled()) { LOGGER.debug("method=describe type={} portalOrStatement={}", type, portalOrStatement); } switch (type) { case 'P': Portal portal = getSafePortal(portalOrStatement); AnalyzedStatement analyzedStmt = portal.boundOrUnboundStatement(); if (analyzedStmt instanceof AnalyzedRelation) { return new DescribeResult(((AnalyzedRelation) analyzedStmt).fields()); } else if (analyzedStmt instanceof AnalyzedUpdateStatement) { return new DescribeResult(((AnalyzedUpdateStatement) analyzedStmt).fields()); } else { return new DescribeResult(null); } case 'S': PreparedStmt preparedStmt = preparedStatements.get(portalOrStatement); Statement statement = preparedStmt.parsedStatement(); AnalyzedStatement analyzedStatement; if (preparedStmt.isRelationInitialized()) { analyzedStatement = preparedStmt.unboundStatement(); } else { analyzedStatement = analyzer.unboundAnalyze(statement, sessionContext, preparedStmt.paramTypes()); preparedStmt.unboundStatement(analyzedStatement); } if (analyzedStatement == null) { return new DescribeResult(null); } DataType[] parameterSymbols = parameterTypeExtractor.getParameterTypes(x -> Relations.traverseDeepSymbols(analyzedStatement, x)); if (parameterSymbols.length > 0) { preparedStmt.setDescribedParameters(parameterSymbols); } if (analyzedStatement instanceof AnalyzedRelation) { AnalyzedRelation relation = (AnalyzedRelation) analyzedStatement; return new DescribeResult(relation.fields(), parameterSymbols); } if (analyzedStatement instanceof AnalyzedUpdateStatement) { AnalyzedUpdateStatement update = (AnalyzedUpdateStatement) analyzedStatement; List<Field> fields = update.fields(); return new DescribeResult(fields, parameterSymbols); } return new DescribeResult(null, parameterSymbols); default: throw new AssertionError("Unsupported type: " + type); } }

Target:
public DescribeResult describe(char type, String portalOrStatement) { if (LOGGER.isDebugEnabled()) { LOGGER.debug("method=describe type={} portalOrStatement={}", type, portalOrStatement); } switch (type) { case 'P': Portal portal = getSafePortal(portalOrStatement); AnalyzedStatement analyzedStmt = portal.boundOrUnboundStatement(); return new DescribeResult(analyzedStmt.fields()); case 'S': PreparedStmt preparedStmt = preparedStatements.get(portalOrStatement); Statement statement = preparedStmt.parsedStatement(); AnalyzedStatement analyzedStatement; if (preparedStmt.isRelationInitialized()) { analyzedStatement = preparedStmt.unboundStatement(); } else { analyzedStatement = analyzer.unboundAnalyze(statement, sessionContext, preparedStmt.paramTypes()); preparedStmt.unboundStatement(analyzedStatement); } if (analyzedStatement == null) { return new DescribeResult(null); } DataType[] parameterSymbols = parameterTypeExtractor.getParameterTypes(x -> Relations.traverseDeepSymbols(analyzedStatement, x)); if (parameterSymbols.length > 0) { preparedStmt.setDescribedParameters(parameterSymbols); } return new DescribeResult(analyzedStatement.fields(), parameterSymbols); default: throw new AssertionError("Unsupported type: " + type); } }
Source:
public void testTaggedVersionListenerHandleRemovedDocuments() { DocumentModel doc = session.createDocumentModel("/", "doc", "File"); doc = session.createDocument(doc); session.save(); DocumentRef version = session.checkIn(doc.getRef(), VersioningOption.MAJOR, "checked in !"); doc = session.restoreToVersion(doc.getRef(), version); session.removeDocument(doc.getRef()); txFeature.nextTransaction(); assertTrue(logCaptureResult.getCaughtEventMessages().isEmpty()); }

Target:
public void testTaggedVersionListenerHandleRemovedDocuments() { DocumentModel doc = session.createDocumentModel("/", "doc", "File"); doc = session.createDocument(doc); DocumentRef version = session.checkIn(doc.getRef(), VersioningOption.MAJOR, "checked in !"); doc = session.restoreToVersion(doc.getRef(), version); session.removeDocument(doc.getRef()); txFeature.nextTransaction(); assertTrue(logCaptureResult.getCaughtEventMessages().isEmpty()); }
Source:
public static void flashOff() { Log.d(TAG, "flashOff()"); if (!isAvailable()) { return; } CameraManager.getInstance().setFlashParams(paramsOff); currentFlashValue = false; }

Target:
public static void flashOff() { if (!isAvailable()) { return; } CameraManager.getInstance().setFlashParams(paramsOff); currentFlashValue = false; }
Source:
public InvokeMethodRunnable(ITestNGMethod thisMethod, Object instance, Object[] parameters, IHookable hookable, ITestResult testResult) { m_method = thisMethod; m_instance = instance; m_parameters = parameters; this.hookable = hookable; this.testResult = testResult; }

Target:
public InvokeMethodRunnable(ITestNGMethod thisMethod, Object instance, Object[] parameters, IHookable hookable, ITestResult testResult) { m_method = thisMethod; m_instance = instance; m_parameters = parameters; m_hookable = hookable; m_testResult = testResult; }
Source:
private List<Object[]> getUserListCore(String searchTerm, String sortKey, Integer resultLimit, Integer offset) { if ((sortKey == null) || (sortKey.isEmpty())){ sortKey = "u.username"; }else{ sortKey = "u." + sortKey; } if ((resultLimit == null)||(resultLimit < 1)){ resultLimit = 1; } if ((searchTerm==null)||(searchTerm.isEmpty())){ searchTerm = ""; } if ((offset == null)||(offset < 0)){ offset = 0; } searchTerm = searchTerm.trim(); String sharedSearchClause = ""; if (!searchTerm.isEmpty()) { sharedSearchClause = " AND " + getSharedSearchClause(); } String qstr = "SELECT u.id, u.useridentifier,"; qstr += " u.lastname, u.firstname, u.email,"; qstr += " u.affiliation, u.superuser,"; qstr += " u.position, u.modificationtime,"; qstr += " prov.id, prov.factoryalias"; qstr += " FROM authenticateduser u,"; qstr += " authenticateduserlookup prov_lookup,"; qstr += " authenticationproviderrow prov"; qstr += " WHERE"; qstr += " u.id = prov_lookup.authenticateduser_id"; qstr += " AND prov_lookup.authenticationproviderid = prov.id"; qstr += sharedSearchClause; qstr += " ORDER BY u.useridentifier"; qstr += " LIMIT " + resultLimit; qstr += " OFFSET " + offset; qstr += ";"; logger.log(Level.FINE, "getUserCount: {0}", qstr); Query nativeQuery = em.createNativeQuery(qstr); nativeQuery.setParameter("searchTerm", searchTerm + "%"); return nativeQuery.getResultList(); }

Target:
private List<Object[]> getUserListCore(String searchTerm, String sortKey, Integer resultLimit, Integer offset) { if ((sortKey == null) || (sortKey.isEmpty())){ sortKey = "u.username"; }else{ sortKey = "u." + sortKey; } if ((resultLimit == null)||(resultLimit < 1)){ resultLimit = 1; } if ((searchTerm==null)||(searchTerm.isEmpty())){ searchTerm = ""; } if ((offset == null)||(offset < 0)){ offset = 0; } searchTerm = searchTerm.trim(); String sharedSearchClause = ""; if (!searchTerm.isEmpty()) { sharedSearchClause = " AND " + getSharedSearchClause(); } String qstr = "SELECT u.id, u.useridentifier,"; qstr += " u.lastname, u.firstname, u.email,"; qstr += " u.affiliation, u.superuser,"; qstr += " u.position,"; qstr += " u.createdtime, u.lastlogintime, u.lastapiusetime, "; qstr += " prov.id, prov.factoryalias"; qstr += " FROM authenticateduser u,"; qstr += " authenticateduserlookup prov_lookup,"; qstr += " authenticationproviderrow prov"; qstr += " WHERE"; qstr += " u.id = prov_lookup.authenticateduser_id"; qstr += " AND prov_lookup.authenticationproviderid = prov.id"; qstr += sharedSearchClause; qstr += " ORDER BY u.useridentifier"; qstr += " LIMIT " + resultLimit; qstr += " OFFSET " + offset; qstr += ";"; logger.log(Level.FINE, "getUserCount: {0}", qstr); Query nativeQuery = em.createNativeQuery(qstr); nativeQuery.setParameter("searchTerm", searchTerm + "%"); return nativeQuery.getResultList(); }
Source:
public void presentAnnotationIsAvailable() { TestClass tc = new TestClass(AnnotatedClass.class); Annotation annotation = tc.getAnnotation(Ignore.class); assertThat(annotation, isA((Class)Ignore.class)); }

Target:
public void presentAnnotationIsAvailable() { TestClass tc = new TestClass(AnnotatedClass.class); Annotation annotation = tc.getAnnotation(Ignore.class); assertTrue(Ignore.class.isAssignableFrom(annotation.getClass())); }
Source:
private String getFullKey(String site, String key) { StringBuffer sb = new StringBuffer(); if (prefix != null) { sb.append(prefix); sb.append(separator); } if (site != null) { sb.append(site.substring(site.indexOf(":")+3)); } else { sb.append(GLOBAL_KEY); } sb.append(separator); sb.append(key); return sb.toString().replace(":", "-"); }

Target:
private String getFullKey(String site, String key) { StringBuilder sb = new StringBuilder(); if (prefix != null) { sb.append(prefix); sb.append(separator); } if (site != null) { sb.append(site.substring(site.indexOf(':')+3)); } else { sb.append(GLOBAL_KEY); } sb.append(separator); sb.append(key); return sb.toString().replace(":", "-"); }
Source:
private int mapSQLStateToXAErrorCode(SQLException sqlException) { if (isPostgreSQLIntegrityConstraintViolation(sqlException)) { return XAException.XA_RBROLLBACK; } return XAException.XAER_RMFAIL; }

Target:
private int mapSQLStateToXAErrorCode(SQLException sqlException) { if (isPostgreSQLIntegrityConstraintViolation(sqlException)) { return XAException.XA_RBINTEGRITY; } return XAException.XAER_RMFAIL; }
Source:
public void validTest() throws Exception { String mimetype = "text/plain"; String checksumPrefix = "urn:sha1:"; String checksum = "61673dacf6c6eea104e77b151584ed7215388ea3"; Model model = ModelFactory.createDefaultModel(); Resource resc = model.createResource(RESC_ID); resc.addProperty(RDF.type, Fcrepo4Repository.Binary); resc.addProperty(Ebucore.hasMimeType, mimetype); resc.addProperty(Premis.hasMessageDigest, checksumPrefix + checksum); setMessageBody(model); processor.process(exchange); verify(message).setHeader("CdrChecksum", checksum); verify(message).setHeader("CdrMimeType", mimetype); verify(message).setHeader("CdrBinaryPath", BINARY_BASE + "61/67/3d/" + checksum); }

Target:
public void validTest() throws Exception { String mimetype = "text/plain"; String checksumPrefix = "urn:sha1:"; String checksum = "61673dacf6c6eea104e77b151584ed7215388ea3"; Model model = ModelFactory.createDefaultModel(); Resource resc = model.createResource(RESC_ID); resc.addProperty(RDF.type, Fcrepo4Repository.Binary); resc.addProperty(Ebucore.hasMimeType, mimetype); resc.addProperty(Premis.hasMessageDigest, checksumPrefix + checksum); setMessageBody(model); processor.process(exchange); verify(message).setHeader(CdrBinaryChecksum, checksum); verify(message).setHeader(CdrBinaryMimeType, mimetype); verify(message).setHeader(CdrBinaryPath, BINARY_BASE + "61/67/3d/" + checksum); }
Source:
public void update() { deltaManager.tick(); if(worldObj.isRemote) { return; } if(currentRecipe != null) { ItemStack resultStack = invResult.getStackInSlot(0); if(resultStack == null || currentRecipe.getRecipeOutput().stackSize + resultStack.stackSize <= currentRecipe.getRecipeOutput().getMaxStackSize()) { if(tryUseMaterials()) { if(resultStack != null) { if(StackUtil.canMerge(resultStack, currentRecipe.getRecipeOutput())) { resultStack.stackSize += currentRecipe.getRecipeOutput().stackSize; } } else { resultStack = currentRecipe.getRecipeOutput().copy(); } } } invResult.setStackInSlot(0, resultStack); } }

Target:
public void update() { deltaManager.tick(); if (getWorld().isRemote) { return; } moveOverflowDown(); updateRecipe(); if (hasMaterialsForRecipe()) { if (progress == 0) { deltaProgress.addDelta(0, 200, 100); deltaProgress.addDelta(200, 205, -100); } if (progress < 200) { progress++; return; } if (invOverflow.getStackInSlot(1) == null) { ItemStack out = crafting.craft(); ItemStack leftOver = invResult.insertItem(0, out, false); InvUtils.dropItems(getWorld(), leftOver, getPos()); progress = 0; } } else if (progress != -1) { progress = -1; deltaProgress.setValue(0); } }
Source:
private TimestampData convertToTimestamp(Object object) { final long millis; if (object instanceof Long) { millis = (Long) object; } else { final DateTime value = (DateTime) object; millis = value.toDate().getTime(); } return TimestampData.fromEpochMillis(millis - LOCAL_TZ.getOffset(millis)); }

Target:
private TimestampData convertToTimestamp(Object object) { final long millis; if (object instanceof Long) { millis = (Long) object; } else { final DateTime value = (DateTime) object; millis = value.toDate().getTime(); } return toTimestampData(millis); }
Source:
public JsonInstanceSerializer(Class<T> payloadClass) { this(payloadClass, false, false); }

Target:
public JsonInstanceSerializer(Class<T> payloadClass) { this(payloadClass, true, false); }
Source:
private static DatatypeFactory getDatatypeFactory() { if (datatypeFactory == null) { try { datatypeFactory = DatatypeFactory.newInstance(); } catch (DatatypeConfigurationException dce) { log.warn(DATATYPE_FACTORY_CREATION_FAILED, dce.getMessage()); log.debug("Exception", dce); } } return datatypeFactory; }

Target:
private static DatatypeFactory getDatatypeFactory() { if (datatypeFactory == null) { try { datatypeFactory = DatatypeFactory.newInstance(); } catch (DatatypeConfigurationException dce) { log.warn(DATATYPE_FACTORY_CREATION_FAILED, dce); } } return datatypeFactory; }
Source:
public DefaultLogBuilder(Logger logger, Level level) { this.logger = logger; this.level = level; this.inUse = false; this.threadId = Thread.currentThread().getId(); this.inUse = true; }

Target:
public DefaultLogBuilder(Logger logger, Level level) { this.logger = logger; this.level = level; this.threadId = Thread.currentThread().getId(); this.inUse = true; }
Source:
public static NullTypes copyOrUpdate(Realm realm, NullTypes object, boolean update, Map<RealmObject,RealmObjectProxy> cache) { if (((RealmObject) object).realm != null && ((RealmObject) object).realm.threadId != realm.threadId) { throw new IllegalArgumentException( "Objects belonging to Realm instances in other threads cannot be copied into this Realm instance."); } if (((RealmObject) object).realm != null && ((RealmObject) object).realm.getPath().equals(realm.getPath())) { return object; } return copy(realm, object, update, cache); }

Target:
public static NullTypes copyOrUpdate(Realm realm, NullTypes object, boolean update, Map<RealmObject,RealmObjectProxy> cache) { if (((RealmObject) object).realm != null && ((RealmObject) object).realm.threadId != realm.threadId) { throw new IllegalArgumentException( "Objects which belong to Realm instances in other threads cannot be copied into this Realm instance."); } if (((RealmObject) object).realm != null && ((RealmObject) object).realm.getPath().equals(realm.getPath())) { return object; } return copy(realm, object, update, cache); }
Source:
private void populatePanes(LabelPickerState state) { populateAssignedLabels(state.getInitialLabels(), state.getRemovedLabels(), state.getAddedLabels(), state.getCurrentSuggestion()); populateFeedbackLabels(state.getAssignedLabels(), state.getMatchedLabels(), state.getCurrentSuggestion()); getDialogPane().getScene().getWindow().sizeToScene(); }

Target:
private final void populatePanes(LabelPickerState state) { populateAssignedLabels(state.getInitialLabels(), state.getRemovedLabels(), state.getAddedLabels(), state.getCurrentSuggestion()); populateFeedbackLabels(state.getAssignedLabels(), state.getMatchedLabels(), state.getCurrentSuggestion()); getDialogPane().getScene().getWindow().sizeToScene(); }
Source:
public void testTopologicalSort() { List<ProcessorNode> sortedNodes1 = graph1.topologicalSort(); Map<String, Integer> idxMap1 = new HashMap<>(); for (int i = 0; i < sortedNodes1.size(); i++) { idxMap1.put(sortedNodes1.get(i).getId(), i); } assertTrue(idxMap1.size() == 8); assertTrue(idxMap1.get("11") > idxMap1.get("5")); assertTrue(idxMap1.get("11") > idxMap1.get("7")); assertTrue(idxMap1.get("8") > idxMap1.get("7")); assertTrue(idxMap1.get("8") > idxMap1.get("3")); assertTrue(idxMap1.get("2") > idxMap1.get("11")); assertTrue(idxMap1.get("9") > idxMap1.get("8")); assertTrue(idxMap1.get("9") > idxMap1.get("11")); assertTrue(idxMap1.get("10") > idxMap1.get("11")); assertTrue(idxMap1.get("10") > idxMap1.get("3")); List<ProcessorNode> sortedNodes2 = graph2.topologicalSort(); Map<String, Integer> idxMap2 = new HashMap<>(); for (int i = 0; i < sortedNodes2.size(); i++) { idxMap2.put(sortedNodes2.get(i).getId(), i); } assertTrue(idxMap2.size() == 7); assertTrue(idxMap2.get("2") > idxMap2.get("1")); assertTrue(idxMap2.get("3") > idxMap2.get("1")); assertTrue(idxMap2.get("4") > idxMap2.get("1")); assertTrue(idxMap2.get("6") > idxMap2.get("1")); assertTrue(idxMap2.get("5") > idxMap2.get("4")); assertTrue(idxMap2.get("7") > idxMap2.get("5")); List<ProcessorNode> sortedNodes3 = graph3.topologicalSort(); assertTrue(sortedNodes3.size() == 1); }

Target:
public void testTopologicalSort() { List<ProcessorNode> sortedNodes1 = graph1.topologicalSort(); Map<String, Integer> idxMap1 = new HashMap<>(); for (int i = 0; i < sortedNodes1.size(); i++) { idxMap1.put(sortedNodes1.get(i).getId(), i); } assertTrue(idxMap1.size() == 8); assertTrue(idxMap1.get("11") > idxMap1.get("5")); assertTrue(idxMap1.get("11") > idxMap1.get("7")); assertTrue(idxMap1.get("8") > idxMap1.get("7")); assertTrue(idxMap1.get("8") > idxMap1.get("3")); assertTrue(idxMap1.get("2") > idxMap1.get("11")); assertTrue(idxMap1.get("9") > idxMap1.get("8")); assertTrue(idxMap1.get("9") > idxMap1.get("11")); assertTrue(idxMap1.get("10") > idxMap1.get("11")); assertTrue(idxMap1.get("10") > idxMap1.get("3")); List<ProcessorNode> sortedNodes2 = graph2.topologicalSort(); Map<String, Integer> idxMap2 = new HashMap<>(); for (int i = 0; i < sortedNodes2.size(); i++) { idxMap2.put(sortedNodes2.get(i).getId(), i); } assertTrue(idxMap2.size() == 7); assertTrue(idxMap2.get("2") > idxMap2.get("1")); assertTrue(idxMap2.get("3") > idxMap2.get("1")); assertTrue(idxMap2.get("4") > idxMap2.get("1")); assertTrue(idxMap2.get("6") > idxMap2.get("1")); assertTrue(idxMap2.get("5") > idxMap2.get("4")); assertTrue(idxMap2.get("7") > idxMap2.get("5")); List<ProcessorNode> sortedNodes3 = graph3.topologicalSort(); assertTrue(sortedNodes3.size() == 2); assertEquals(sortedNodes3.get(0).getId(), "1"); assertEquals(sortedNodes3.get(1).getId(), "2"); List<ProcessorNode> sortedNodes4 = graph4.topologicalSort(); assertTrue(sortedNodes4.size() == 1); assertEquals(sortedNodes4.get(0).getId(), "1"); }
Source:
void decrement() { set(get() - 1); }

Target:
void decrement() { int val = get(); assert val > 0; set(val - 1); }
Source:
public long srem( ByteArrayWrapper key, ArrayList<ByteArrayWrapper> membersToRemove, AtomicBoolean setWasDeleted) { RedisSet redisSet = get(key); long l = redisSet.srem(key, membersToRemove, setWasDeleted); if (get(key).scard(key) == 0) { region.remove(key); } else { region.put(key, get(key)); } return l; }

Target:
public long srem( ByteArrayWrapper key, ArrayList<ByteArrayWrapper> membersToRemove, AtomicBoolean setWasDeleted) { return getRedisSet(key).srem(membersToRemove, region, key, setWasDeleted); }
Source:
public String getProtectedEnvironmentVariables() { return protectedEnvironmentVariables; }

Target:
public String getProtectedEnvironmentVariables() { if (protectedEnvironmentVariables == null) { return ""; } return protectedEnvironmentVariables; }
Source:
public String getQuery(String action, Class<?> clazz, boolean extended) { String queryName; if (action.equals(ACTION_SELECT_ALL)) { queryName = "database.select" + clazz.getSimpleName() + "s"; } else { queryName = "database." + action.toLowerCase() + clazz.getSimpleName() + (extended ? "Extended" : ""); } String query = config.getString(queryName); if (query == null) { query = constructObjectQuery(action, clazz, extended); config.setString(queryName, query); } return query; }

Target:
public String getQuery(String action, Class<?> clazz, boolean extended) { String queryName; if (action.equals(ACTION_SELECT_ALL)) { queryName = "database.select" + clazz.getSimpleName() + "s"; } else { queryName = "database." + action.toLowerCase() + clazz.getSimpleName(); if (extended) { queryName += "Extended"; } } String query = config.getString(queryName); if (query == null) { query = constructObjectQuery(action, clazz, extended); config.setString(queryName, query); } return query; }
Source:
public String getSystemOffsetDefault(String systemName) { String perSystemResetValue = get(String.format("systems.%s.default.stream.samza.offset.default", systemName)); if (StringUtils.isBlank(perSystemResetValue)) { perSystemResetValue = get(String.format("systems.%s.samza.offset.default", systemName)); if (StringUtils.isBlank(perSystemResetValue)) { return SAMZA_SYSTEM_OFFSET_UPCOMING; } } return perSystemResetValue; }

Target:
public String getSystemOffsetDefault(String systemName) { String systemOffsetDefault = get(String.format("systems.%s.default.stream.samza.offset.default", systemName)); if (StringUtils.isBlank(systemOffsetDefault)) { systemOffsetDefault = get(String.format("systems.%s.samza.offset.default", systemName)); if (StringUtils.isBlank(systemOffsetDefault)) { return SAMZA_SYSTEM_OFFSET_UPCOMING; } } return systemOffsetDefault; }
Source:
public FbStatus(final int code, final Scalar<Fallback> fallback) { this( new Filtered<Integer>( (status) -> { return code == status.intValue(); }, code ), fallback ); }

Target:
public FbStatus(final int code, final Scalar<Fallback> fallback) { this( new Filtered<Integer>( (status) -> code == status.intValue(), code ), fallback ); }
Source:
public RegistryAuth authFor(final String imageName) throws DockerException { if (!configFileExists()) { return null; } final ImageRef ref = new ImageRef(imageName); try { final RegistryAuth registryAuth = reader.fromConfig(path, ref.getRegistryUrl()); if (registryAuth != null) { return registryAuth; } return reader.fromConfig(path, ref.getRegistryName()); } catch (IllegalArgumentException e) { log.debug("Failed first attempt to find auth for {}", ref.getRegistryUrl(), e); try { return reader.fromConfig(path, ref.getRegistryName()); } catch (IllegalArgumentException | IOException e2) { throw new DockerException(e2); } } catch (IOException e) { throw new DockerException(e); } }

Target:
public RegistryAuth authFor(final String imageName) throws DockerException { if (!configFileExists()) { return null; } final ImageRef ref = new ImageRef(imageName); try { final RegistryAuth registryAuth = reader.fromConfig(path, ref.getRegistryUrl()); if (registryAuth != null) { return registryAuth; } return reader.fromConfig(path, ref.getRegistryName()); } catch (IllegalArgumentException e) { log.debug("Failed first attempt to find auth for {}", ref.getRegistryUrl(), e); try { return reader.fromConfig(path, ref.getRegistryName()); } catch (IllegalArgumentException e2) { log.debug("Failed second attempt to find auth for {}", ref.getRegistryName(), e2); return null; } catch (IOException e2) { throw new DockerException(e2); } } catch (IOException e) { throw new DockerException(e); } }
Source:
public ResultScanner adapt( final com.google.cloud.bigtable.grpc.scanner.ResultScanner<Row> bigtableResultScanner) { return new AbstractClientScanner() { @Override public Result next() throws IOException { Row row = bigtableResultScanner.next(); if (row == null) { return null; } if (!hasMatchingLabels(row)) { return null; } return rowAdapter.adaptResponse(row); } @Override public void close() { try { bigtableResultScanner.close(); } catch (IOException ioe) { throw Throwables.propagate(ioe); } } public boolean renewLease() { return false; } }; }

Target:
public ResultScanner adapt( final com.google.cloud.bigtable.grpc.scanner.ResultScanner<Row> bigtableResultScanner) { return new AbstractClientScanner() { @Override public Result next() throws IOException { Row row = bigtableResultScanner.next(); if (row == null) { return null; } if (!hasMatchingLabels(row)) { return null; } return rowAdapter.adaptResponse(row); } @Override public void close() { try { bigtableResultScanner.close(); } catch (IOException ioe) { throw Throwables.propagate(ioe); } } public boolean renewLease() { throw new UnsupportedOperationException("renewLease"); } }; }
Source:
public KiiApp getApp() { return thingIfApi.getApp(); }

Target:
public KiiApp getApp() { return this.thingIfApi.getApp(); }
Source:
public void testWaitContainerTimeout() throws Exception { CreateContainerResponse container = dockerClient.createContainerCmd("busybox").withCmd("sleep", "9999").exec(); LOG.info("Created container: {}", container.toString()); assertThat(container.getId(), not(isEmptyString())); dockerClient.startContainerCmd(container.getId()).exec(); WaitContainerResultCallback callback = dockerClient.waitContainerCmd(container.getId()).exec( new WaitContainerResultCallback()); try { callback.awaitStatusCode(100, TimeUnit.MILLISECONDS); fail("Should throw exception on timeout."); } catch(DockerClientException e){ LOG.info(e.getMessage()); } dockerClient.killContainerCmd(container.getId()).exec(); InspectContainerResponse inspectContainerResponse = dockerClient.inspectContainerCmd(container.getId()).exec(); LOG.info("Container Inspect: {}", inspectContainerResponse.toString()); assertThat(inspectContainerResponse.getState().getRunning(), is(equalTo(false))); }

Target:
public void testWaitContainerTimeout() throws Exception { CreateContainerResponse container = dockerClient.createContainerCmd("busybox").withCmd("sleep", "10").exec(); LOG.info("Created container: {}", container.toString()); assertThat(container.getId(), not(isEmptyString())); dockerClient.startContainerCmd(container.getId()).exec(); WaitContainerResultCallback callback = dockerClient.waitContainerCmd(container.getId()).exec( new WaitContainerResultCallback()); try { callback.awaitStatusCode(100, TimeUnit.MILLISECONDS); fail("Should throw exception on timeout."); } catch(DockerClientException e){ LOG.info(e.getMessage()); } }