auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public final Session[] listSessions() { getLog().info("fetching sessions information"); final List<String> zkSessions; try { zkSessions = getCurator().getChildren().forPath(getSubscriptionPath("/sessions")); } catch (final KeeperException.NoNodeException e) { throw new SubscriptionNotInitializedException(getSubscriptionId()); } catch (Exception ex) { throw new NakadiRuntimeException(ex); } try { final CountDownLatch latch = new CountDownLatch(zkSessions.size()); final Map<String, Session> resultSessions = new HashMap<>(); for (final String sessionId : zkSessions) { getCurator().getData() .inBackground((client, event) -> { try { if (event.getResultCode() == KeeperException.Code.OK.intValue()) { synchronized (resultSessions) { resultSessions.put( sessionId, new Session( sessionId, Integer.parseInt(new String(event.getData(), UTF_8)))); } } } finally { latch.countDown(); } }) .forPath(getSubscriptionPath("/sessions/" + sessionId)); } if (latch.await(10, TimeUnit.SECONDS)) { return resultSessions.values().toArray(new Session[resultSessions.size()]); } else { throw new ServiceTemporarilyUnavailableException( "Failed to finish waiting for sessions list from zk", null); } } catch (InterruptedException e) { Thread.currentThread().interrupt(); throw new NakadiRuntimeException(e); } catch (MyNakadiRuntimeException1 e) { throw e; } catch (final Exception e) { throw new NakadiRuntimeException(e); } }

Target:
public final Collection<Session> listSessions() throws SubscriptionNotInitializedException, NakadiRuntimeException, ServiceTemporarilyUnavailableException { getLog().info("fetching sessions information"); final List<String> zkSessions; try { zkSessions = getCurator().getChildren().forPath(getSubscriptionPath("/sessions")); } catch (final KeeperException.NoNodeException e) { throw new SubscriptionNotInitializedException(getSubscriptionId()); } catch (Exception ex) { throw new NakadiRuntimeException(ex); } return loadDataAsync( zkSessions, key -> getSubscriptionPath("/sessions/" + key), (key, data) -> new Session(key, Integer.parseInt(new String(data, UTF_8)))).values(); }
Source:
public AttributeDefinition getAttributeDefinition() { AttributeDefinition attr = new AttributeDefinition(); attr.setNamespace(AttributesManager.NS_FACILITY_ATTR_DEF); attr.setFriendlyName("googleGroupName-namespace"); attr.setDisplayName("Google group name namespace"); attr.setType(String.class.getName()); attr.setDescription("Allowed google group name namespace on facility."); return attr; }

Target:
public AttributeDefinition getAttributeDefinition() { AttributeDefinition attr = new AttributeDefinition(); attr.setNamespace(AttributesManager.NS_FACILITY_ATTR_DEF); attr.setFriendlyName("googleGroupNameNamespace"); attr.setDisplayName("Google group name namespace"); attr.setType(String.class.getName()); attr.setDescription("Allowed google group name namespace on facility."); return attr; }
Source:
public void testBlockingFacetBlocksDeletion() throws IOException { createFolderStructure(); TestTaskListener testTaskListener = new TestTaskListener(); Fingerprint fp = new TestFingerprint(false); fp.facets.setOwner(Saveable.NOOP); TestFingperprintFacet facet = new TestFingperprintFacet(fp, System.currentTimeMillis(), true); fp.facets.add(facet); FingerprintCleanupThread cleanupThread = new TestFingerprintCleanupThread(fp); cleanupThread.execute(testTaskListener); assertTrue("Should have deleted obsolete file.", fpFile.toFile().exists()); }

Target:
public void testBlockingFacetBlocksDeletion() throws IOException { createFolderStructure(); TestTaskListener testTaskListener = new TestTaskListener(); Fingerprint fp = new TestFingerprint(false); fp.facets.setOwner(Saveable.NOOP); TestFingperprintFacet facet = new TestFingperprintFacet(fp, System.currentTimeMillis(), true); fp.facets.add(facet); FingerprintCleanupThread cleanupThread = new TestFingerprintCleanupThread(fp); cleanupThread.execute(testTaskListener); String logOutput = testTaskListener.outputStream.toString(); assertThat(logOutput, containsString("blocked deletion of")); }
Source:
public void canRemoveEntityWithBlob() { inTransaction( em -> { Photo photo = new Photo(); photo.setId( ENTITY_ID_2 ); photo.setDescription( "photo2" ); Blob blob = Hibernate.getLobCreator( em.unwrap( Session.class ) ).createBlob( BLOB_CONTENT_1 ); photo.setContentAsBlob( blob ); photo.setContentAsByteArray( BLOB_CONTENT_1 ); photo.setContentAsString( BLOB_STRING_CONTENT_1 ); em.persist( photo ); } ); inTransaction( em -> { Photo photo = em.find( Photo.class, ENTITY_ID_2 ); assertThat( photo ).isNotNull(); assertThat( photo.getContentAsBlob() ).isNotNull(); assertBlobAreEqual( photo.getContentAsBlob(), BLOB_CONTENT_1 ); assertThat( photo.getContentAsByteArray() ).isNotNull(); assertThat( photo.getContentAsByteArray() ).isEqualTo( BLOB_CONTENT_1 ); assertThat( photo.getContentAsString() ).isNotNull(); assertThat( photo.getContentAsString() ).isEqualTo( BLOB_STRING_CONTENT_1 ); em.remove( photo ); } ); inTransaction( em -> { GridFSBucket gridFSFilesBucket = GridFSBuckets.create( getCurrentDB( em ), BUCKET_NAME ); MongoCursor<GridFSFile> cursor = gridFSFilesBucket.find().iterator(); List<GridFSFile> files = new LinkedList<>(); while ( cursor.hasNext() ) { files.add( cursor.next() ); } assertThat( files.size() ).isEqualTo( 3 ); } ); }

Target:
public void canRemoveEntityWithBlob() { inTransaction( em -> { Photo photo = new Photo(); photo.setId( ENTITY_ID_2 ); photo.setDescription( "photo2" ); Blob blob = Hibernate.getLobCreator( em.unwrap( Session.class ) ).createBlob( BLOB_CONTENT_1 ); photo.setContentAsBlob( blob ); photo.setContentAsByteArray( BLOB_CONTENT_1 ); photo.setContentAsString( BLOB_STRING_CONTENT_1 ); em.persist( photo ); } ); inTransaction( em -> { Photo photo = em.find( Photo.class, ENTITY_ID_2 ); assertThat( photo ).isNotNull(); assertBlobAreEqual( photo.getContentAsBlob(), BLOB_CONTENT_1 ); assertThat( photo.getContentAsByteArray() ).isEqualTo( BLOB_CONTENT_1 ); assertThat( photo.getContentAsString() ).isEqualTo( BLOB_STRING_CONTENT_1 ); em.remove( photo ); } ); inTransaction( em -> { GridFSBucket gridFSFilesBucket = GridFSBuckets.create( getCurrentDB( em ), BUCKET_NAME ); MongoCursor<GridFSFile> cursor = gridFSFilesBucket.find().iterator(); List<GridFSFile> files = new LinkedList<>(); while ( cursor.hasNext() ) { files.add( cursor.next() ); } assertThat( files.size() ).isEqualTo( 3 ); } ); }
Source:
public int mktime(ZoneInfo zoneInfo) { this.isDst = this.isDst > 0 ? this.isDst = 1 : this.isDst < 0 ? this.isDst = -1 : 0; copyFieldsToCalendar(); final long longWallTimeSeconds = roundDownMillisToSeconds(calendar.getTimeInMillis()); if (Integer.MIN_VALUE > longWallTimeSeconds || longWallTimeSeconds > Integer.MAX_VALUE) { return -1; } try { final int wallTimeSeconds = (int) longWallTimeSeconds; final int rawOffsetSeconds = zoneInfo.mRawOffset / 1000; final int rawTimeSeconds = checkedSubtract(wallTimeSeconds, rawOffsetSeconds); if (zoneInfo.mTransitions.length == 0) { if (this.isDst > 0) { return -1; } copyFieldsFromCalendar(); this.isDst = 0; this.gmtOffsetSeconds = rawOffsetSeconds; return rawTimeSeconds; } final int initialTransitionIndex = findTransitionIndex(zoneInfo, rawTimeSeconds); if (isDst < 0) { Integer result = doWallTimeSearch(zoneInfo, initialTransitionIndex, wallTimeSeconds, true ); return result == null ? -1 : result; } Integer result = doWallTimeSearch(zoneInfo, initialTransitionIndex, wallTimeSeconds, true ); if (result == null) { result = doWallTimeSearch(zoneInfo, initialTransitionIndex, wallTimeSeconds, false ); } if (result == null) { result = -1; } return result; } catch (CheckedArithmeticException e) { return -1; } }

Target:
public int mktime(ZoneInfo zoneInfo) { this.isDst = this.isDst > 0 ? this.isDst = 1 : this.isDst < 0 ? this.isDst = -1 : 0; copyFieldsToCalendar(); final long longWallTimeSeconds = calendar.getTimeInMillis() / 1000; if (Integer.MIN_VALUE > longWallTimeSeconds || longWallTimeSeconds > Integer.MAX_VALUE) { return -1; } try { final int wallTimeSeconds = (int) longWallTimeSeconds; final int rawOffsetSeconds = zoneInfo.mRawOffset / 1000; final int rawTimeSeconds = checkedSubtract(wallTimeSeconds, rawOffsetSeconds); if (zoneInfo.mTransitions.length == 0) { if (this.isDst > 0) { return -1; } copyFieldsFromCalendar(); this.isDst = 0; this.gmtOffsetSeconds = rawOffsetSeconds; return rawTimeSeconds; } final int initialTransitionIndex = findTransitionIndex(zoneInfo, rawTimeSeconds); if (isDst < 0) { Integer result = doWallTimeSearch(zoneInfo, initialTransitionIndex, wallTimeSeconds, true ); return result == null ? -1 : result; } Integer result = doWallTimeSearch(zoneInfo, initialTransitionIndex, wallTimeSeconds, true ); if (result == null) { result = doWallTimeSearch(zoneInfo, initialTransitionIndex, wallTimeSeconds, false ); } if (result == null) { result = -1; } return result; } catch (CheckedArithmeticException e) { return -1; } }
Source:
public <E extends RealmModel> Observable<E> from(final Realm realm, final E object) { final RealmConfiguration realmConfig = realm.getConfiguration(); return Observable.create(new Observable.OnSubscribe<E>() { @Override public void call(final Subscriber<? super E> subscriber) { final Realm observableRealm = Realm.getInstance(realmConfig); objectRefs.get().acquireReference(object); final RealmChangeListener<E> listener = new RealmChangeListener<E>() { @Override public void onChange(E result) { if (!subscriber.isUnsubscribed()) { subscriber.onNext(object); } } }; RealmObject.addChangeListener(object, listener); subscriber.add(Subscriptions.create(new Action0() { @Override public void call() { RealmObject.removeChangeListener(object, listener); observableRealm.close(); objectRefs.get().releaseReference(object); } })); subscriber.onNext(object); } }); }

Target:
public <E extends RealmModel> Observable<E> from(final Realm realm, final E object) { final RealmConfiguration realmConfig = realm.getConfiguration(); return Observable.create(new Observable.OnSubscribe<E>() { @Override public void call(final Subscriber<? super E> subscriber) { final Realm observableRealm = Realm.getInstance(realmConfig); objectRefs.get().acquireReference(object); final RealmChangeListener<E> listener = new RealmChangeListener<E>() { @Override public void onChange(E object) { if (!subscriber.isUnsubscribed()) { subscriber.onNext(object); } } }; RealmObject.addChangeListener(object, listener); subscriber.add(Subscriptions.create(new Action0() { @Override public void call() { RealmObject.removeChangeListener(object, listener); observableRealm.close(); objectRefs.get().releaseReference(object); } })); subscriber.onNext(object); } }); }
Source:
public boolean containsQuorum(Set<Long> set){ HashMap<Long, Long> expansion = new HashMap<Long, Long>(); if(set.size() == 0) return false; else LOG.debug("Set size: " + set.size()); for(long sid : set){ Long gid = serverGroup.get(sid); if (gid == null) continue; if(!expansion.containsKey(gid)) expansion.put(gid, serverWeight.get(sid)); else { long totalWeight = serverWeight.get(sid) + expansion.get(gid); expansion.put(gid, totalWeight); } } int majGroupCounter = 0; for (Entry<Long, Long> entry : expansion.entrySet()) { Long gid = entry.getKey(); LOG.debug("Group info: " + entry.getValue() + ", " + gid + ", " + groupWeight.get(gid)); if(entry.getValue() > (groupWeight.get(gid) / 2) ) majGroupCounter++; } LOG.debug("Majority group counter: " + majGroupCounter + ", " + numGroups); if((majGroupCounter > (numGroups / 2))){ LOG.debug("Positive set size: " + set.size()); return true; } else { LOG.debug("Negative set size: " + set.size()); return false; } }

Target:
public boolean containsQuorum(Set<Long> set){ HashMap<Long, Long> expansion = new HashMap<Long, Long>(); if(set.size() == 0) return false; else LOG.debug("Set size: " + set.size()); for(long sid : set){ Long gid = serverGroup.get(sid); if (gid == null) continue; if(!expansion.containsKey(gid)) expansion.put(gid, serverWeight.get(sid)); else { long totalWeight = serverWeight.get(sid) + expansion.get(gid); expansion.put(gid, totalWeight); } } int majGroupCounter = 0; for (Entry<Long, Long> entry : expansion.entrySet()) { Long gid = entry.getKey(); LOG.debug("Group info: {}, {}, {}", entry.getValue(), gid, groupWeight.get(gid)); if (entry.getValue() > (groupWeight.get(gid) / 2)) majGroupCounter++; } LOG.debug("Majority group counter: {}, {}", majGroupCounter, numGroups); if ((majGroupCounter > (numGroups / 2))){ LOG.debug("Positive set size: {}", set.size()); return true; } else { LOG.debug("Negative set size: {}", set.size()); return false; } }
Source:
public int kPercentileLatency(double percentile) { if (m_latencyHistogram.getTotalCount() == 0) return 0; percentile = Math.max(0.0, percentile); return (int) (Math.round(m_latencyHistogram.getValueAtPercentile(percentile * 100.0)) / 1000.0); }

Target:
public int kPercentileLatency(double percentile) { if (m_latencyHistogram.getTotalCount() == 0) return 0; percentile = Math.max(0.0D, percentile); return (int) (Math.round(m_latencyHistogram.getValueAtPercentile(percentile * 100.0D)) / 1000.0); }
Source:
SqlArrayArgument(SqlArrayType<T> arrayType, Object newArray) { this.typeName = arrayType.getTypeName(); List<Object> elements = new ArrayList<>(newArray.getClass().isArray() ? Array.getLength(newArray) : 10); IterableLike.of(newArray).forEachRemaining(e -> { @SuppressWarnings("unchecked") T cast = (T) e; elements.add(arrayType.convertArrayElement(cast)); }); array = elements.toArray(); }

Target:
SqlArrayArgument(SqlArrayType<T> arrayType, Object newArray) { this.typeName = arrayType.getTypeName(); @SuppressWarnings("unchecked") Stream<T> stream = (Stream<T>) IterableLike.stream(newArray); array = stream.map(arrayType::convertArrayElement).toArray(); }
Source:
private static TestingHttpServer createServer(final TestResource resource) { try { return new Bootstrap( new TestingNodeModule(), new JaxrsModule(true), new JsonModule(), new TestingHttpServerModule(), binder -> jaxrsBinder(binder).bindInstance(resource)) .strictConfig() .doNotInitializeLogging() .quiet() .initialize() .getInstance(TestingHttpServer.class); } catch (Exception e) { throw new RuntimeException(e); } }

Target:
private static TestingHttpServer createServer(final TestResource resource) { try { List<Module> modules = ImmutableList.<Module>builder() .add(new TestingNodeModule()) .add(new JaxrsModule(true)) .add(new JsonModule()) .add(new TestingHttpServerModule()) .add(binder -> jaxrsBinder(binder).bindInstance(resource)) .build(); return new Bootstrap(modules) .strictConfig() .doNotInitializeLogging() .quiet() .initialize() .getInstance(TestingHttpServer.class); } catch (Exception e) { throwIfUnchecked(e); throw new RuntimeException(e); } }
Source:
public T getAndRemove(Predicate<T> preCondition) { Iterator<T> iterator = deque.iterator(); T found = null; for (int i = 0; i < deque.size(); i++) { T next = iterator.next(); if (preCondition.test(next)) { if (i < numPriorityElements) { numPriorityElements--; } found = next; checkState(deque.remove(found)); } } return checkNotNull(found); }

Target:
public T getAndRemove(Predicate<T> preCondition) { Iterator<T> iterator = deque.iterator(); for (int i = 0; i < deque.size(); i++) { T next = iterator.next(); if (preCondition.test(next)) { if (i < numPriorityElements) { numPriorityElements--; } iterator.remove(); return next; } } throw new NoSuchElementException(); }
Source:
public AbstractSegmentBaseStateSystemAnalysis() { registerListener(); }

Target:
public AbstractSegmentBaseStateSystemAnalysis() { super(); registerListener(); }
Source:
private void doTaskFailed(Throwable exception) { if(started) { this.taskExecution.setEndTime(new Date()); this.taskExecution.setExitCode(1); this.taskExecution.setExitMessage(stackTraceToString(exception)); taskRepository.update(taskExecution); } else { logger.warn("An event to fail a task has been received for a task that has " + "not yet started."); } }

Target:
private void doTaskFailed(Throwable exception) { if(started) { this.taskExecution.setEndTime(new Date()); this.taskExecution.setExitCode(1); this.taskExecution.setExitMessage(stackTraceToString(exception)); taskRepository.update(taskExecution); } else { logger.error("An event to fail a task has been received for a task that has " + "not yet started."); } }
Source:
private Boolean isHeartBeating() throws Exception { Stat stat = this.clClient.checkExists().forPath(clConfig.getWorkerNodePath()); return (null != stat); }

Target:
private boolean isHeartBeating() throws Exception { Stat stat = this.clClient.checkExists().forPath(clConfig.getWorkerNodePath()); return (null != stat); }
Source:
public PinotFilterExpressionConverter(TypeManager typeManager, FunctionMetadataManager functionMetadataManager, StandardFunctionResolution standardFunctionResolution) { this.typeManager = typeManager; this.functionMetadataManager = functionMetadataManager; this.standardFunctionResolution = standardFunctionResolution; }

Target:
public PinotFilterExpressionConverter( TypeManager typeManager, FunctionMetadataManager functionMetadataManager, StandardFunctionResolution standardFunctionResolution) { this.typeManager = requireNonNull(typeManager, "type manager is null"); this.functionMetadataManager = requireNonNull(functionMetadataManager, "function metadata manager is null"); this.standardFunctionResolution = requireNonNull(standardFunctionResolution, "standardFunctionResolution is null"); }
Source:
private boolean initCheckTypeModifiers() { if (Reflections.isClassLoadable(CLASSINFO_CLASS_NAME, new ClassLoaderResourceLoader(classFileServices.getClass().getClassLoader()))) { try { Class<?> classInfoclass = Reflections.loadClass(CLASSINFO_CLASS_NAME, new ClassLoaderResourceLoader(classFileServices.getClass().getClassLoader())); Method setFlags = AccessController.doPrivileged(GetDeclaredMethodAction.of(classInfoclass, "setFlags", short.class)); return setFlags != null; } catch (Exception exceptionIgnored) { return false; } } else { return true; } }

Target:
private boolean initCheckTypeModifiers() { Class<?> classInfoclass = Reflections.loadClass(CLASSINFO_CLASS_NAME, new ClassLoaderResourceLoader(classFileServices.getClass().getClassLoader())); if (classInfoclass != null) { try { Method setFlags = AccessController.doPrivileged(GetDeclaredMethodAction.of(classInfoclass, "setFlags", short.class)); return setFlags != null; } catch (Exception exceptionIgnored) { BootstrapLogger.LOG.usingOldJandexVersion(); return false; } } else { return true; } }
Source:
private String overrideSiteId(HttpServletRequest request, String siteId) { if (siteId.equals("!error")) { siteId = request.getContextPath().split("/portal")[1]; } return siteId; }

Target:
private String overrideSiteId(HttpServletRequest request, String siteId) { if (siteId.equals("!error")) { return request.getContextPath(); } return siteId; }
Source:
private boolean updateVms() { for (VmStatic vm : vmsLockedForUpdate) { VmManagementParametersBase updateParams = new VmManagementParametersBase(vm); updateParams.setLockProperties(LockProperties.create(LockProperties.Scope.None)); updateParams.setClusterLevelChangeFromVersion(oldCluster.getCompatibilityVersion()); upgradeGraphicsDevices(vm, updateParams); updateRngDeviceIfNecessary(vm.getId(), vm.getCustomCompatibilityVersion(), updateParams); VdcReturnValueBase result = runInternalAction( VdcActionType.UpdateVm, updateParams, cloneContextAndDetachFromParent()); if (!result.getSucceeded()) { List<String> params = new ArrayList<>(); params.add("$action Update"); params.add("$type VM"); params.add(parseErrorMessage(result.getValidationMessages())); List<String> messages = Backend.getInstance().getErrorsTranslator().translateErrorText(params); failedUpgradeVms.put(vm.getName(), messages.get(0)); } } return true; }

Target:
private boolean updateVms() { for (VmStatic vm : vmsLockedForUpdate) { VmManagementParametersBase updateParams = new VmManagementParametersBase(vm); updateParams.setLockProperties(LockProperties.create(LockProperties.Scope.None)); updateParams.setClusterLevelChangeFromVersion(oldCluster.getCompatibilityVersion()); upgradeGraphicsDevices(vm, updateParams); updateRngDeviceIfNecessary(vm.getId(), vm.getCustomCompatibilityVersion(), updateParams); VdcReturnValueBase result = runInternalAction( VdcActionType.UpdateVm, updateParams, cloneContextAndDetachFromParent()); if (!result.getSucceeded()) { List<String> params = new ArrayList<>(); params.add("$action Update"); params.add("$type VM"); params.add(parseErrorMessage(result.getValidationMessages())); List<String> messages = Backend.getInstance().getErrorsTranslator().translateErrorText(params); failedUpgradeEntities.put(vm.getName(), getFailedMessage(messages)); } } return true; }
Source:
public SimplePatientCorrelationResponseType addPatientCorrelationPLQ(AddPatientCorrelationPLQRequestType request) { SimplePatientCorrelationResponseType response = new SimplePatientCorrelationResponseType(); PatientCorrelationPLQHelper.addPatientCorrelationPLQRecords(request.getPatientLocationQueryResponse()); response.setMessage("It is done."); return response; }

Target:
public SimplePatientCorrelationResponseType addPatientCorrelationPLQ(AddPatientCorrelationPLQRequestType request) { SimplePatientCorrelationResponseType response = new SimplePatientCorrelationResponseType(); PatientCorrelationPLQHelper.addPatientCorrelationPLQRecords(request.getPatientLocationQueryResponse()); response.setMessage("Response has been received and processed."); return response; }
Source:
public static Map<Integer, Integer> getCategoricalFeatureInfo(Schema inputSchema, @Nullable String featuresToInclude, @Nullable String featuresToExclude, String labelField, @Nullable String cardinalityMapping) { List<String> featureList = getFeatureList(inputSchema, featuresToInclude, featuresToExclude, labelField); Map<Integer, Integer> outputFieldMappings = new HashMap<>(); if (!Strings.isNullOrEmpty(cardinalityMapping)) { return outputFieldMappings; } try { Map<String, String> map = Splitter.on(',').trimResults().withKeyValueSeparator(":").split(cardinalityMapping); for (String field : map.keySet()) { String value = map.get(field); try { outputFieldMappings.put(featureList.indexOf(field), Integer.parseInt(value)); } catch (NumberFormatException e) { throw new IllegalArgumentException( String.format("Invalid cardinality %s. Please specify valid integer for cardinality", value)); } } } catch (IllegalArgumentException e) { throw new IllegalArgumentException( String.format("Invalid categorical feature mapping. %s. Please make sure it is in the format " + "'feature':'cardinality'.", e.getMessage()), e); } return outputFieldMappings; }

Target:
static Map<Integer, Integer> getCategoricalFeatureInfo(Schema inputSchema, @Nullable String featuresToInclude, @Nullable String featuresToExclude, String labelField, @Nullable String cardinalityMapping) { Map<String, Integer> featureList = getFeatureList(inputSchema, featuresToInclude, featuresToExclude, labelField); Map<Integer, Integer> outputFieldMappings = new HashMap<>(); if (Strings.isNullOrEmpty(cardinalityMapping)) { return outputFieldMappings; } try { Map<String, String> map = Splitter.on(',').trimResults().withKeyValueSeparator(":").split(cardinalityMapping); for (Map.Entry<String, String> field : map.entrySet()) { String value = field.getValue(); try { outputFieldMappings.put(featureList.get(field.getKey()), Integer.parseInt(value)); } catch (NumberFormatException e) { throw new IllegalArgumentException( String.format("Invalid cardinality %s. Please specify valid integer for cardinality.", value)); } } } catch (IllegalArgumentException e) { throw new IllegalArgumentException( String.format("Invalid categorical feature mapping. %s. Please make sure it is in the format " + "'feature':'cardinality'.", e.getMessage()), e); } return outputFieldMappings; }
Source:
protected synchronized void removeHandler(ThingHandler thingHandler) { if (thingHandler instanceof OwserverBridgeHandler) { ServiceRegistration<?> serviceReg = this.discoveryServiceRegs.get(thingHandler.getThing().getUID()); if (serviceReg != null) { OwDiscoveryService service = (OwDiscoveryService) bundleContext.getService(serviceReg.getReference()); service.deactivate(); serviceReg.unregister(); discoveryServiceRegs.remove(thingHandler.getThing().getUID()); } } }

Target:
protected synchronized void removeHandler(ThingHandler thingHandler) { if (thingHandler instanceof OwserverBridgeHandler) { ServiceRegistration<?> serviceReg = this.discoveryServiceRegs.get(thingHandler.getThing().getUID()); OwDiscoveryService service = (OwDiscoveryService) bundleContext.getService(serviceReg.getReference()); service.deactivate(); serviceReg.unregister(); discoveryServiceRegs.remove(thingHandler.getThing().getUID()); } }
Source:
public void testCreateSecureS3Bucket() throws IOException { long currentTime = Time.now(); String userName = "ozone/localhost@EXAMPLE.COM"; String bucketName = UUID.randomUUID().toString(); String md5Hash = DigestUtils.md5Hex(userName); store.createS3Bucket(md5Hash, bucketName); String volumeName = store.getOzoneVolumeName(bucketName); assertEquals(volumeName,"s3" + md5Hash); OzoneVolume volume = store.getVolume(volumeName); OzoneBucket bucket = volume.getBucket(bucketName); Assert.assertEquals(bucketName, bucket.getName()); Assert.assertTrue(bucket.getCreationTime() >= currentTime); Assert.assertTrue(volume.getCreationTime() >= currentTime); }

Target:
public void testCreateSecureS3Bucket() throws IOException { long currentTime = Time.now(); String userName = "ozone/localhost@EXAMPLE.COM"; String bucketName = UUID.randomUUID().toString(); String s3VolumeName = OzoneS3Util.getVolumeName(userName); store.createS3Bucket(s3VolumeName, bucketName); String volumeName = store.getOzoneVolumeName(bucketName); assertEquals(volumeName, "s3" + s3VolumeName); OzoneVolume volume = store.getVolume(volumeName); OzoneBucket bucket = volume.getBucket(bucketName); Assert.assertEquals(bucketName, bucket.getName()); Assert.assertTrue(bucket.getCreationTime() >= currentTime); Assert.assertTrue(volume.getCreationTime() >= currentTime); }
Source:
public static int get(final String key) { return map.containsKey(key)? map.get(key) : -1; }

Target:
public static int get(final String key) { return map.containsKey(key)? map.get(key) : R.string.unknown; }
Source:
protected void onPostExecute(List<ApplicationInfoEx> listApp) { super.onPostExecute(listApp); mAppAdapter = new AppListAdapter(ActivityMain.this, R.layout.mainentry, listApp, mRestrictionName); ListView lvApp = (ListView) findViewById(R.id.lvApp); lvApp.setAdapter(mAppAdapter); applyFilter(); mProgressDialog.setMessage(getString(R.string.msg_filtering)); ActivityMain.this.selectRestriction(spRestriction.getSelectedItemPosition()); }

Target:
protected void onPostExecute(List<ApplicationInfoEx> listApp) { super.onPostExecute(listApp); mAppAdapter = new AppListAdapter(ActivityMain.this, R.layout.mainentry, listApp, mRestrictionName); ListView lvApp = (ListView) findViewById(R.id.lvApp); lvApp.setAdapter(mAppAdapter); try { mProgressDialog.dismiss(); } catch (Throwable ex) { Util.bug(null, ex); } ActivityMain.this.selectRestriction(spRestriction.getSelectedItemPosition()); }
Source:
static List<Job> getTopologyJobs(NomadApiClient apiClient, String topologyName) { List<JobListStub> jobs = getJobList(apiClient); List<Job> ret = new LinkedList<>(); for (JobListStub job : jobs) { Job jobActual; try { jobActual = apiClient.getJobsApi().info(job.getId()).getValue(); } catch (IOException | NomadException e) { String msg = "Failed to retrieve job info for job " + job.getId() + " part of topology " + topologyName; LOG.log(Level.SEVERE, msg, e); throw new RuntimeException(msg, e); } Map<String, String> metaData = jobActual.getMeta(); if (metaData != null) { if (metaData.get(NomadConstants.NOMAD_TOPOLOGY_NAME).equals(topologyName)) { ret.add(jobActual); } } } return ret; }

Target:
static List<Job> getTopologyJobs(NomadApiClient apiClient, String topologyName) { List<JobListStub> jobs = getJobList(apiClient); List<Job> ret = new LinkedList<>(); for (JobListStub job : jobs) { Job jobActual; try { jobActual = apiClient.getJobsApi().info(job.getId()).getValue(); } catch (IOException | NomadException e) { String msg = "Failed to retrieve job info for job " + job.getId() + " part of topology " + topologyName; LOG.log(Level.SEVERE, msg, e); throw new RuntimeException(msg, e); } Map<String, String> metaData = jobActual.getMeta(); if (metaData != null && metaData.containsKey(NomadConstants.NOMAD_TOPOLOGY_NAME)) { if (metaData.get(NomadConstants.NOMAD_TOPOLOGY_NAME).equals(topologyName)) { ret.add(jobActual); } } } return ret; }
Source:
public Stream<QueryTerminationResult> killQuery( @Name( "id" ) String idText ) throws InvalidArgumentsException, IOException { securityContext.assertCredentialsNotExpired(); try { long queryId = fromExternalString( idText ).kernelQueryId(); Set<Pair<KernelTransactionHandle,ExecutingQuery>> querys = getActiveTransactions( tx -> executingQueriesWithId( queryId, tx ) ).collect( toSet() ); Config configs = resolver.resolveDependency( Config.class ); if ( configs.get( GraphDatabaseSettings.kill_query_verbose ) && querys.isEmpty() ) { return Stream.<QueryTerminationResult>builder().add( new QueryFailedTerminationResult( fromExternalString( idText ) ) ).build(); } return querys.stream().map( catchThrown( InvalidArgumentsException.class, this::killQueryTransaction ) ); } catch ( UncaughtCheckedException uncaught ) { throwIfPresent( uncaught.getCauseIfOfType( InvalidArgumentsException.class ) ); throw uncaught; } }

Target:
public Stream<QueryTerminationResult> killQuery( @Name( "id" ) String idText ) throws InvalidArgumentsException, IOException { securityContext.assertCredentialsNotExpired(); try { long queryId = fromExternalString( idText ).kernelQueryId(); Set<Pair<KernelTransactionHandle,ExecutingQuery>> querys = getActiveTransactions( tx -> executingQueriesWithId( queryId, tx ) ).collect( toSet() ); boolean killQueryVerbose = resolver.resolveDependency( Config.class ).get( GraphDatabaseSettings.kill_query_verbose ); if ( killQueryVerbose && querys.isEmpty() ) { return Stream.<QueryTerminationResult>builder().add( new QueryFailedTerminationResult( fromExternalString( idText ) ) ).build(); } return querys.stream().map( catchThrown( InvalidArgumentsException.class, this::killQueryTransaction ) ); } catch ( UncaughtCheckedException uncaught ) { throwIfPresent( uncaught.getCauseIfOfType( InvalidArgumentsException.class ) ); throw uncaught; } }
Source:
public void shouldGet404WhenRetrievingNonExistentNode() throws Exception { gen.get() .expectedStatus( 404 ) .get( nodeUri + "600000" ); }

Target:
public void shouldGet404WhenRetrievingNonExistentNode() throws Exception { gen.get() .expectedStatus( 404 ) .get( nodeUri + "123456" ); }
Source:
public void skipCreateInitialFilter(String filterName) {logInfo("016","skip create initial filter, filter with this name already exists: {}", filterName); }

Target:
public void skipCreateInitialFilter(String filterName) { logInfo("016", "Skip initial filter creation, the filter with this name already exists: {}", filterName); }
Source:
private static List<String> innerInitRange(int stopAfter, long startNum, long endNum) { if (startNum > endNum) { return Collections.emptyList(); } List<String> macAddresses = new ArrayList<>(Math.min(stopAfter, (int)(endNum - startNum))); for (long i = startNum; i <= endNum; i++) { if ((MAC_ADDRESS_MULTICAST_BIT & i) != 0) { continue; } macAddresses.add(macAddressToString(i)); if (stopAfter-- <= 0) { return macAddresses; } } return new ArrayList<>(macAddresses); }

Target:
private static List<String> innerInitRange(int stopAfter, long startNum, long endNum) { if (startNum > endNum) { return Collections.emptyList(); } List<String> macAddresses = new LinkedList<>(); for (long i = startNum; i <= endNum; i++) { if ((MAC_ADDRESS_MULTICAST_BIT & i) != 0) { continue; } macAddresses.add(macAddressToString(i)); if (stopAfter-- <= 0) { return macAddresses; } } return macAddresses; }
Source:
public void callService(VM vm, String vdc, ProductRelease product, String action, String token) throws InstallatorException, NodeExecutionException { try { generateFilesinPuppetMaster (vm, vdc, product, action, token); } catch (InstallatorException e) { log.warn ("It is not possible to generate the manifests in the puppet master " + e.getMessage()); throw new InstallatorException(e.getMessage()); } try { isRecipeExecuted(vm,product.getProduct().getName(),token); } catch (NodeExecutionException e) { log.debug(e.getMessage()); throw new NodeExecutionException(e.getMessage()); } try { isRecipeExecuted(vm,product.getProduct().getName(),token); } catch (NodeExecutionException e) { log.warn ("It is not possible execute the recipe " + product.getProduct().getName() + " in node " + vm.getHostname() ); } }

Target:
public void callService(VM vm, String vdc, ProductRelease product, String action, String token) throws InstallatorException, NodeExecutionException { try { generateFilesinPuppetMaster (vm, vdc, product, action, token); } catch (InstallatorException e) { log.warn ("It is not possible to generate the manifests in the puppet master " + e.getMessage()); throw new InstallatorException(e.getMessage()); } try { isRecipeExecuted(vm,product.getProduct().getName(),token); } catch (NodeExecutionException e) { log.debug(e.getMessage()); throw new NodeExecutionException(e.getMessage()); } try { isRecipeExecuted(vm,product.getProduct().getName(),token); } catch (NodeExecutionException e) { log.warn ("It is not possible execute the module " + product.getProduct().getName() + " in node " + vm.getHostname() ); } }
Source:
private void readResourceServerConfig(OperationContext context, ModelNode operation) { final PathAddress address = PathAddress.pathAddress(operation.require(OP_ADDR)); final String hostName = address.getElement(0).getValue(); final PathElement element = address.getLastElement(); final String serverName = element.getValue(); final ModelNode addr = new ModelNode(); addr.add(HOST, hostName); addr.add(SERVER_CONFIG, serverName); context.readResourceFromRoot(PathAddress.pathAddress(addr), false); }

Target:
private void readResourceServerConfig(OperationContext context, ModelNode operation) { final PathAddress address = context.getCurrentAddress(); final String hostName = address.getElement(0).getValue(); final PathElement element = address.getLastElement(); final String serverName = element.getValue(); final ModelNode addr = new ModelNode(); addr.add(HOST, hostName); addr.add(SERVER_CONFIG, serverName); context.readResourceFromRoot(PathAddress.pathAddress(addr), false); }
Source:
private void deleteFeatureFolders(IFolder sourceFolder, ArrayList<String> removedFeatures) { final ArrayList<IResource> featureFolders = new ArrayList<IResource>(); try { Collections.addAll(featureFolders, sourceFolder.members()); } catch (final CoreException e) { e.printStackTrace(); } final ArrayList<IResource> foldersToDelete = new ArrayList<IResource>(); for (final String feature : removedFeatures) { for (final IResource folder : featureFolders) { if (folder.getName().equals(feature)) { foldersToDelete.add(folder); } } } for (final IResource folder : foldersToDelete) { try { folder.delete(true, null); } catch (final CoreException e) { e.printStackTrace(); } } }

Target:
private void deleteFeatureFolders(IFolder sourceFolder, ArrayList<String> removedFeatures) { final ArrayList<IResource> featureFolders = new ArrayList<IResource>(); try { Collections.addAll(featureFolders, sourceFolder.members()); } catch (final CoreException e) { e.printStackTrace(); } for (final String feature : removedFeatures) { for (final IResource folder : featureFolders) { if (folder.getName().equals(feature)) { try { folder.delete(true, null); } catch (final CoreException e) { e.printStackTrace(); } } } } }
Source:
protected void afterTest() { sharedBuilder = null; final int pending = messagesPending.get(); final int pendingDeferred = messagesDeferredPending.get().size(); if (pending < 1 && pendingDeferred < 1) { dispose(receiver, sender, receiveAndDeleteReceiver); return; } try { if (pending > 0) { receiveAndDeleteReceiver.receive() .map(message -> { logger.info("Message received: {}", message.getMessage().getSequenceNumber()); return message; }) .timeout(Duration.ofSeconds(15), Mono.empty()) .blockLast(); } if (pendingDeferred > 0) { for(Long sequenceNumber: messagesDeferredPending.get()) { receiveAndDeleteReceiver.receiveDeferredMessage(sequenceNumber) .map(message -> { logger.info("Message received: {}", message.getSequenceNumber()); return message; }) .timeout(Duration.ofSeconds(15), Mono.empty()) .block(); } } } catch (Exception e) { logger.warning("Error occurred when draining queue.", e); } finally { dispose(receiver, sender, receiveAndDeleteReceiver); } }

Target:
protected void afterTest() { sharedBuilder = null; final int pending = messagesPending.get(); final int pendingDeferred = messagesDeferredPending.size(); if (pending < 1 && pendingDeferred < 1) { dispose(receiver, sender, receiveAndDeleteReceiver); return; } try { if (pending > 0) { receiveAndDeleteReceiver.receive() .map(message -> { logger.info("Message received: {}", message.getMessage().getSequenceNumber()); return message; }) .timeout(Duration.ofSeconds(15), Mono.empty()) .blockLast(); } } catch (Exception e) { logger.warning("Error occurred when draining queue.", e); } try { if (pendingDeferred > 0) { for (Long sequenceNumber : messagesDeferredPending) { receiveAndDeleteReceiver.receiveDeferredMessage(sequenceNumber) .map(message -> { logger.info("Message received: {}", message.getSequenceNumber()); return message; }) .timeout(Duration.ofSeconds(15), Mono.empty()) .block(); } } } catch (Exception e) { logger.warning("Error occurred when draining for deferred messages.", e); } finally { dispose(receiver, sender, receiveAndDeleteReceiver); } }
Source:
public void missingConfigThrowsException() { ModuleDefinition moduleDefinition = ModuleDefinitions.simple("missing", ModuleType.processor, "classpath:/ModuleFactoryTests/modules/processor/missing"); ModuleDescriptor moduleDescriptor = new ModuleDescriptor.Builder() .setModuleDefinition(moduleDefinition) .setModuleName("missing") .setGroup("group") .setModuleDefinition(moduleDefinition) .build(); createResourceConfiguredModule("missing",ModuleType.processor); }

Target:
public void missingConfigThrowsException() { ModuleDefinition moduleDefinition = ModuleDefinitions.simple("missing", ModuleType.processor, "classpath:/ModuleFactoryTests/modules/processor/missing"); createResourceConfiguredModule("missing",ModuleType.processor); }
Source:
public List<DocumentRevision> deleteDocument(String id) throws ConflictException { ArrayList<DocumentRevision> deleted = new ArrayList<DocumentRevision>(); Cursor cursor = null; try { this.getSQLDatabase().beginTransaction(); final String sql = "SELECT revs.revid FROM docs,revs " + "WHERE revs.doc_id = docs.doc_id " + "AND docs.docid = ? " + "AND deleted = 0 AND revs.sequence NOT IN " + "(SELECT DISTINCT parent FROM revs WHERE parent NOT NULL) "; cursor = this.sqlDb.rawQuery(sql, new String[]{id}); while (cursor.moveToNext()) { String revId = cursor.getString(0); deleted.add(deleteDocument(id, revId)); } this.getSQLDatabase().setTransactionSuccessful(); return deleted; } catch (SQLException sqe) { throw new SQLRuntimeException("SQLException in deleteDocument, not deleting revisions", sqe); } finally { this.getSQLDatabase().endTransaction(); DatabaseUtils.closeCursorQuietly(cursor); } }

Target:
public List<BasicDocumentRevision> deleteDocument(String id) throws ConflictException { Preconditions.checkNotNull(id, "id can not be null"); ArrayList<BasicDocumentRevision> deleted = new ArrayList<BasicDocumentRevision>(); Cursor cursor = null; try { this.getSQLDatabase().beginTransaction(); final String sql = "SELECT revs.revid FROM docs,revs " + "WHERE revs.doc_id = docs.doc_id " + "AND docs.docid = ? " + "AND deleted = 0 AND revs.sequence NOT IN " + "(SELECT DISTINCT parent FROM revs WHERE parent NOT NULL) "; cursor = this.sqlDb.rawQuery(sql, new String[]{id}); while (cursor.moveToNext()) { String revId = cursor.getString(0); deleted.add(deleteDocument(id, revId)); } this.getSQLDatabase().setTransactionSuccessful(); return deleted; } catch (SQLException sqe) { throw new SQLRuntimeException("SQLException in deleteDocument, not deleting revisions", sqe); } finally { this.getSQLDatabase().endTransaction(); DatabaseUtils.closeCursorQuietly(cursor); } }
Source:
private void makeRequest(URI uri) throws IOException { try(CloseableHttpClient httpclient = HttpClients.createDefault()) { HttpGet request = new HttpGet(uri); HttpResponse response = httpclient.execute(request); assertEquals(200, response.getStatusLine().getStatusCode()); } }

Target:
private void makeRequest(URI uri) throws IOException { Client client = ClientBuilder.newClient(); WebTarget target = client.target(uri); Response response = target.request(MediaType.APPLICATION_JSON_TYPE).get(); assertEquals(200, response.getStatus()); }
Source:
protected boolean checkPostConditions( final ResourceStoreRequest request, final StorageItem item ) throws IllegalOperationException, ItemNotFoundException, AccessDeniedException { if ( getRequestProcessors().size() > 0 ) { for ( RequestProcessor processor : getRequestProcessors().values() ) { if ( !processor.shouldRetrieve( this, request, item ) ) { request.addItemNotFoundReason( reasonFor( request, this, "Retrieval of request %s in repository %s prevented.", request.getRequestPath(), RepositoryStringUtils.getHumanizedNameString( this ) ) ); return false; } } } return true; }

Target:
protected void checkPostConditions( final ResourceStoreRequest request, final StorageItem item ) throws IllegalOperationException, ItemNotFoundException { final Map<String, RequestStrategy> effectiveRequestStrategies = getRegisteredStrategies(); for ( RequestStrategy strategy : effectiveRequestStrategies.values() ) { strategy.onServing( this, request, item ); } }
Source:
void sendSelection (long id, long sel, long arg) { panel.validateVisibleColumns(); if (filterExtensions.length > 0){ setAllowedFileType(filterExtensions[(int) popup.indexOfSelectedItem()]); } }

Target:
void sendSelection (long id, long sel, long arg) { panel.validateVisibleColumns(); if (filterExtensions != null && filterExtensions.length > 0) { setAllowedFileType(filterExtensions[(int) popup.indexOfSelectedItem()]); } }
Source:
public void paperTag(ReplaceableTagEvent event) { if (!event.matches("paper") || event.replaced()) { return; } Attribute attribute = event.getAttributes().fulfill(1); if (attribute.startsWith("tick_times")) { ListTag list = new ListTag(); for (long time : Bukkit.getServer().getTickTimes()) { list.add(String.valueOf(time / 1000000D)); } event.setReplacedObject(list.getObjectAttribute(attribute.fulfill(1))); return; } }

Target:
public void paperTag(ReplaceableTagEvent event) { if (!event.matches("paper") || event.replaced()) { return; } Attribute attribute = event.getAttributes().fulfill(1); if (attribute.startsWith("tick_times")) { ListTag list = new ListTag(); for (long time : Bukkit.getServer().getTickTimes()) { list.addObject(new DurationTag(time / 1000000000D)); } event.setReplacedObject(list.getObjectAttribute(attribute.fulfill(1))); return; } }
Source:
public void verifyAccessibleForCurrentUserAsInstructorOrTeamMember(AccountAttributes account, String courseId, String section, String email) { if (!isValidInstructor(section, courseId, account) && !isValidStudent(email, courseId, account)) { throw new UnauthorizedAccessException("User is not in the course that student belongs to"); } }

Target:
public void verifyAccessibleForCurrentUserAsInstructorOrTeamMember(AccountAttributes account, String courseId, String section, String email) { InstructorAttributes instructor = instructorsLogic.getInstructorForGoogleId(courseId, account.googleId); if (instructor != null) { verifyInstructorCanViewPhoto(instructor, section); return; } StudentAttributes student = studentsLogic.getStudentForCourseIdAndGoogleId(courseId, account.googleId); if (student != null) { verifyStudentCanViewPhoto(student, courseId, email); return; } throw new UnauthorizedAccessException("User is not in the course that student belongs to"); }
Source:
private void prepareInsertExistingTable(HdfsContext context, TableAndMore tableAndMore) { deleteOnly = false; Table table = tableAndMore.getTable(); Table tableOld = delegate.getTable(table.getDatabaseName(), table.getTableName()) .orElseThrow(() -> new TableNotFoundException(new SchemaTableName(table.getDatabaseName(), table.getTableName()))); Path targetPath = new Path(table.getStorage().getLocation()); Path currentPath = tableAndMore.getCurrentLocation().get(); cleanUpTasksForAbort.add(new DirectoryCleanUpTask(context, targetPath, false)); if (!targetPath.equals(currentPath)) { asyncRename(hdfsEnvironment, renameExecutor, fileRenameCancelled, fileRenameFutures, context, currentPath, targetPath, tableAndMore.getFileNames().get()); } if (tableAndMore.getStatisticsUpdate().isPresent()) { StatisticsUpdate statisticsUpdate = tableAndMore.getStatisticsUpdate().get(); updateStatisticsOperations.add( new UpdateStatisticsOperation( new SchemaTableName(table.getDatabaseName(), table.getTableName()), Optional.empty(), statisticsUpdate.getStatistics(), statisticsUpdate.getOperator())); } }

Target:
private void prepareInsertExistingTable(HdfsContext context, TableAndMore tableAndMore) { deleteOnly = false; Table table = tableAndMore.getTable(); Path targetPath = new Path(table.getStorage().getLocation()); Path currentPath = tableAndMore.getCurrentLocation().get(); cleanUpTasksForAbort.add(new DirectoryCleanUpTask(context, targetPath, false)); if (!targetPath.equals(currentPath)) { asyncRename(hdfsEnvironment, renameExecutor, fileRenameCancelled, fileRenameFutures, context, currentPath, targetPath, tableAndMore.getFileNames().get()); } if (tableAndMore.getStatisticsUpdate().isPresent()) { updateStatisticsOperations.add( new UpdateStatisticsOperation( new SchemaTableName(table.getDatabaseName(), table.getTableName()), Optional.empty(), tableAndMore.getStatisticsUpdate().get())); } }
Source:
public static Optional<BlockState> addTraits(BlockState state, Map<BlockTrait<?>, Object> traits) { Optional<BlockState> newState = Optional.of(state); for (Map.Entry<BlockTrait<?>, Object> traitEntry : traits.entrySet()) { newState = newState.get().withTrait(traitEntry.getKey(), traitEntry.getValue()); if (!newState.isPresent()) { return newState; } } return newState; }

Target:
public static BlockState addTraits(BlockState state, Map<BlockTrait<?>, Object> traits) { Optional<BlockState> nextState; for (Map.Entry<BlockTrait<?>, Object> traitEntry : traits.entrySet()) { nextState = state.withTrait(traitEntry.getKey(), traitEntry.getValue()); if (nextState.isPresent()) { state = nextState.get(); } } return state; }
Source:
public MysqlDaoProvider(DbResourceGroupConfig config) { requireNonNull(config, "DbResourceGroupConfig is null"); MysqlDataSource dataSource = new MysqlDataSource(); dataSource.setURL(requireNonNull(config.getConfigDbUrl(), "resource-groups.config-db-url is null")); this.dao = Jdbi.create(dataSource) .installPlugin(new SqlObjectPlugin()) .open() .attach(ResourceGroupsDao.class); }

Target:
public MysqlDaoProvider(DbResourceGroupConfig config) { requireNonNull(config, "DbResourceGroupConfig is null"); MysqlDataSource dataSource = new MysqlDataSource(); dataSource.setURL(requireNonNull(config.getConfigDbUrl(), "resource-groups.config-db-url is null")); this.dao = Jdbi.create(dataSource) .installPlugin(new SqlObjectPlugin()) .onDemand(ResourceGroupsDao.class); }
Source:
@Override public EngineBackupLogId getId() { EngineBackupLogId key = new EngineBackupLogId(); key.setDbName(dbName); key.setDoneAt(doneAt); return key; }

Target:
public EngineBackupLogId getId() { EngineBackupLogId key = new EngineBackupLogId(); key.setDbName(dbName); key.setDoneAt(doneAt); return key; }
Source:
public void setStatus(Status newStatus) { this.status = newStatus; }

Target:
void setStatus(Status newStatus) { this.status = newStatus; }